From 3413d441a03d89dcd53138258f5ae81e78d7bd4d Mon Sep 17 00:00:00 2001 From: hc-github-team-tf-azure <> Date: Mon, 6 May 2024 09:27:52 +0000 Subject: [PATCH] Updating based on 0421b4e7 --- .../2023-08-01-preview/arcsettings/README.md | 163 - .../2023-08-01-preview/arcsettings/client.go | 26 - .../arcsettings/constants.go | 277 -- .../arcsettings/id_arcsetting.go | 139 - .../arcsettings/id_arcsetting_test.go | 327 -- .../arcsettings/id_cluster.go | 130 - .../arcsettings/id_cluster_test.go | 282 -- .../arcsettings/method_arcsettingscreate.go | 58 - .../arcsettings/method_arcsettingsdelete.go | 71 - .../arcsettings/method_arcsettingsget.go | 54 - .../method_arcsettingslistbycluster.go | 91 - .../arcsettings/method_arcsettingsupdate.go | 58 - ...thod_consentandinstalldefaultextensions.go | 55 - .../arcsettings/method_createidentity.go | 71 - .../arcsettings/method_generatepassword.go | 55 - .../method_initializedisableprocess.go | 70 - .../arcsettings/model_arcidentityresponse.go | 8 - .../model_arcidentityresponseproperties.go | 11 - .../arcsettings/model_arcsetting.go | 16 - .../arcsettings/model_arcsettingproperties.go | 17 - .../arcsettings/model_arcsettingspatch.go | 9 - .../model_arcsettingspatchproperties.go | 8 - .../model_defaultextensiondetails.go | 27 - .../arcsettings/model_passwordcredential.go | 41 - .../arcsettings/model_pernodestate.go | 11 - .../arcsettings/predicates.go | 27 - .../2023-08-01-preview/arcsettings/version.go | 12 - .../2023-08-01-preview/client.go | 127 - .../2023-08-01-preview/cluster/README.md | 66 - .../2023-08-01-preview/cluster/client.go | 26 - .../2023-08-01-preview/cluster/constants.go | 510 --- .../2023-08-01-preview/cluster/id_cluster.go | 130 - .../cluster/id_cluster_test.go | 282 -- .../cluster/method_createidentity.go | 71 - .../method_extendsoftwareassurancebenefit.go | 75 - .../cluster/method_uploadcertificate.go | 73 - .../cluster/model_cluster.go | 20 - .../cluster/model_clusterdesiredproperties.go | 9 - .../cluster/model_clusteridentityresponse.go | 8 - ...model_clusteridentityresponseproperties.go | 11 - .../cluster/model_clusternode.go | 40 - .../cluster/model_clusterproperties.go | 69 - .../model_clusterreportedproperties.go | 36 - ...odel_isolatedvmattestationconfiguration.go | 10 - .../cluster/model_rawcertificatedata.go | 8 - .../model_softwareassurancechangerequest.go | 8 - ...oftwareassurancechangerequestproperties.go | 8 - .../model_softwareassuranceproperties.go | 28 - .../cluster/model_uploadcertificaterequest.go | 8 - .../2023-08-01-preview/cluster/version.go | 12 - .../2023-08-01-preview/clusters/README.md | 125 - .../2023-08-01-preview/clusters/constants.go | 510 --- .../2023-08-01-preview/clusters/id_cluster.go | 130 - .../clusters/id_cluster_test.go | 282 -- .../clusters/method_create.go | 58 - .../clusters/method_delete.go | 71 - .../clusters/method_listbyresourcegroup.go | 92 - .../clusters/method_listbysubscription.go | 92 - .../clusters/method_update.go | 58 - .../clusters/model_cluster.go | 20 - .../model_clusterdesiredproperties.go | 9 - .../clusters/model_clusternode.go | 40 - .../clusters/model_clusterpatch.go | 14 - .../clusters/model_clusterpatchproperties.go | 11 - .../clusters/model_clusterproperties.go | 69 - .../model_clusterreportedproperties.go | 36 - ...odel_isolatedvmattestationconfiguration.go | 10 - .../model_softwareassuranceproperties.go | 28 - .../2023-08-01-preview/clusters/predicates.go | 32 - .../2023-08-01-preview/clusters/version.go | 12 - .../deploymentsettings/README.md | 82 - .../deploymentsettings/client.go | 26 - .../deploymentsettings/constants.go | 110 - .../deploymentsettings/id_cluster.go | 130 - .../deploymentsettings/id_cluster_test.go | 282 -- .../id_deploymentsetting.go | 139 - .../id_deploymentsetting_test.go | 327 -- .../method_createorupdate.go | 75 - .../deploymentsettings/method_delete.go | 70 - .../deploymentsettings/method_get.go | 54 - .../method_listbyclusters.go | 91 - .../model_adapterpropertyoverrides.go | 10 - .../deploymentsettings/model_cluster.go | 12 - .../model_deploymentconfiguration.go | 9 - .../model_deploymentdata.go | 19 - .../model_deploymentsetting.go | 16 - .../model_deploymentsettingsproperties.go | 12 - .../model_deploymentstatus.go | 9 - .../deploymentsettings/model_hostnetwork.go | 11 - .../model_infrastructurenetwork.go | 12 - .../deploymentsettings/model_intents.go | 16 - .../deploymentsettings/model_ippools.go | 9 - .../deploymentsettings/model_observability.go | 10 - .../model_optionalservices.go | 8 - .../deploymentsettings/model_physicalnodes.go | 9 - .../model_qospolicyoverrides.go | 10 - .../model_reportedproperties.go | 9 - .../deploymentsettings/model_scaleunits.go | 8 - .../model_securitysettings.go | 17 - .../deploymentsettings/model_step.go | 15 - .../deploymentsettings/model_storage.go | 8 - .../model_storagenetworks.go | 10 - .../model_validationstatus.go | 9 - ...del_virtualswitchconfigurationoverrides.go | 9 - .../deploymentsettings/predicates.go | 27 - .../deploymentsettings/version.go | 12 - .../2023-08-01-preview/edgedevices/README.md | 100 - .../2023-08-01-preview/edgedevices/client.go | 26 - .../edgedevices/constants.go | 69 - .../edgedevices/id_scopededgedevice.go | 120 - .../edgedevices/id_scopededgedevice_test.go | 222 -- .../edgedevices/method_createorupdate.go | 75 - .../edgedevices/method_delete.go | 71 - .../edgedevices/method_get.go | 54 - .../edgedevices/method_list.go | 92 - .../edgedevices/method_validate.go | 75 - .../edgedevices/model_deviceconfiguration.go | 9 - .../edgedevices/model_edgedevice.go | 16 - .../edgedevices/model_edgedeviceproperties.go | 9 - .../edgedevices/model_nicdetail.go | 16 - .../edgedevices/model_validaterequest.go | 9 - .../edgedevices/model_validateresponse.go | 8 - .../edgedevices/predicates.go | 27 - .../2023-08-01-preview/edgedevices/version.go | 12 - .../2023-08-01-preview/extensions/README.md | 116 - .../2023-08-01-preview/extensions/client.go | 26 - .../extensions/constants.go | 356 --- .../extensions/id_arcsetting.go | 139 - .../extensions/id_arcsetting_test.go | 327 -- .../extensions/id_extension.go | 148 - .../extensions/id_extension_test.go | 372 --- .../extensions/method_create.go | 75 - .../extensions/method_delete.go | 71 - .../extensions/method_get.go | 54 - .../extensions/method_listbyarcsetting.go | 91 - .../extensions/method_update.go | 75 - .../extensions/method_upgrade.go | 73 - .../extensions/model_extension.go | 16 - .../extensions/model_extensioninstanceview.go | 11 - .../model_extensioninstanceviewstatus.go | 30 - .../extensions/model_extensionparameters.go | 15 - .../extensions/model_extensionpatch.go | 8 - .../model_extensionpatchparameters.go | 11 - .../model_extensionpatchproperties.go | 8 - .../extensions/model_extensionproperties.go | 12 - .../model_extensionupgradeparameters.go | 8 - .../extensions/model_pernodeextensionstate.go | 12 - .../extensions/predicates.go | 27 - .../2023-08-01-preview/extensions/version.go | 12 - .../2023-08-01-preview/offers/README.md | 70 - .../2023-08-01-preview/offers/client.go | 26 - .../2023-08-01-preview/offers/id_cluster.go | 130 - .../offers/id_cluster_test.go | 282 -- .../2023-08-01-preview/offers/id_offer.go | 148 - .../offers/id_offer_test.go | 372 --- .../2023-08-01-preview/offers/id_publisher.go | 139 - .../offers/id_publisher_test.go | 327 -- .../2023-08-01-preview/offers/method_get.go | 83 - .../offers/method_listbycluster.go | 119 - .../offers/method_listbypublisher.go | 119 - .../2023-08-01-preview/offers/model_offer.go | 16 - .../offers/model_offerproperties.go | 12 - .../offers/model_skumappings.go | 10 - .../2023-08-01-preview/offers/predicates.go | 27 - .../2023-08-01-preview/offers/version.go | 12 - .../2023-08-01-preview/publishers/README.md | 53 - .../2023-08-01-preview/publishers/client.go | 26 - .../publishers/id_cluster.go | 130 - .../publishers/id_cluster_test.go | 282 -- .../publishers/id_publisher.go | 139 - .../publishers/id_publisher_test.go | 327 -- .../publishers/method_get.go | 54 - .../publishers/method_listbycluster.go | 91 - .../publishers/model_publisher.go | 16 - .../publishers/model_publisherproperties.go | 8 - .../publishers/predicates.go | 27 - .../2023-08-01-preview/publishers/version.go | 12 - .../2023-08-01-preview/skuses/README.md | 53 - .../2023-08-01-preview/skuses/client.go | 26 - .../2023-08-01-preview/skuses/id_offer.go | 148 - .../skuses/id_offer_test.go | 372 --- .../2023-08-01-preview/skuses/id_sku.go | 157 - .../2023-08-01-preview/skuses/id_sku_test.go | 417 --- .../skuses/method_skusget.go | 83 - .../skuses/method_skuslistbyoffer.go | 119 - .../2023-08-01-preview/skuses/model_sku.go | 16 - .../skuses/model_skumappings.go | 10 - .../skuses/model_skuproperties.go | 13 - .../2023-08-01-preview/skuses/predicates.go | 27 - .../2023-08-01-preview/skuses/version.go | 12 - .../2023-08-01-preview/updateruns/README.md | 86 - .../2023-08-01-preview/updateruns/client.go | 26 - .../updateruns/constants.go | 107 - .../updateruns/id_update.go | 139 - .../updateruns/id_update_test.go | 327 -- .../updateruns/id_updaterun.go | 148 - .../updateruns/id_updaterun_test.go | 372 --- .../updateruns/method_delete.go | 71 - .../updateruns/method_get.go | 54 - .../updateruns/method_list.go | 91 - .../updateruns/method_put.go | 58 - .../updateruns/model_step.go | 57 - .../updateruns/model_updaterun.go | 17 - .../updateruns/model_updaterunproperties.go | 43 - .../updateruns/predicates.go | 32 - .../2023-08-01-preview/updateruns/version.go | 12 - .../2023-08-01-preview/updates/README.md | 98 - .../2023-08-01-preview/updates/client.go | 26 - .../2023-08-01-preview/updates/constants.go | 381 --- .../2023-08-01-preview/updates/id_cluster.go | 130 - .../updates/id_cluster_test.go | 282 -- .../2023-08-01-preview/updates/id_update.go | 139 - .../updates/id_update_test.go | 327 -- .../updates/method_delete.go | 71 - .../2023-08-01-preview/updates/method_get.go | 54 - .../2023-08-01-preview/updates/method_list.go | 91 - .../2023-08-01-preview/updates/method_post.go | 70 - .../2023-08-01-preview/updates/method_put.go | 58 - .../updates/model_packageversioninfo.go | 28 - .../updates/model_precheckresult.go | 37 - .../updates/model_precheckresulttags.go | 9 - .../updates/model_update.go | 17 - .../updates/model_updateprerequisite.go | 10 - .../updates/model_updateproperties.go | 57 - .../updates/model_updatestateproperties.go | 9 - .../2023-08-01-preview/updates/predicates.go | 32 - .../2023-08-01-preview/updates/version.go | 12 - .../updatesummaries/README.md | 86 - .../updatesummaries/client.go | 26 - .../updatesummaries/constants.go | 263 -- .../updatesummaries/id_cluster.go | 130 - .../updatesummaries/id_cluster_test.go | 282 -- .../updatesummaries/method_delete.go | 71 - .../updatesummaries/method_get.go | 55 - .../updatesummaries/method_list.go | 91 - .../updatesummaries/method_put.go | 59 - .../model_packageversioninfo.go | 28 - .../updatesummaries/model_precheckresult.go | 37 - .../model_precheckresulttags.go | 9 - .../updatesummaries/model_updatesummaries.go | 17 - .../model_updatesummariesproperties.go | 60 - .../updatesummaries/predicates.go | 32 - .../updatesummaries/version.go | 12 - .../2023-08-01/arcsettings/README.md | 163 - .../2023-08-01/arcsettings/client.go | 26 - .../2023-08-01/arcsettings/constants.go | 277 -- .../2023-08-01/arcsettings/id_arcsetting.go | 139 - .../arcsettings/id_arcsetting_test.go | 327 -- .../2023-08-01/arcsettings/id_cluster.go | 130 - .../2023-08-01/arcsettings/id_cluster_test.go | 282 -- .../arcsettings/method_arcsettingscreate.go | 58 - .../arcsettings/method_arcsettingsdelete.go | 71 - .../arcsettings/method_arcsettingsget.go | 54 - .../method_arcsettingslistbycluster.go | 91 - .../arcsettings/method_arcsettingsupdate.go | 58 - ...thod_consentandinstalldefaultextensions.go | 55 - .../arcsettings/method_createidentity.go | 71 - .../arcsettings/method_generatepassword.go | 55 - .../method_initializedisableprocess.go | 70 - .../arcsettings/model_arcidentityresponse.go | 8 - .../model_arcidentityresponseproperties.go | 11 - .../arcsettings/model_arcsetting.go | 16 - .../arcsettings/model_arcsettingproperties.go | 17 - .../arcsettings/model_arcsettingspatch.go | 9 - .../model_arcsettingspatchproperties.go | 8 - .../model_defaultextensiondetails.go | 27 - .../arcsettings/model_passwordcredential.go | 41 - .../arcsettings/model_pernodestate.go | 10 - .../2023-08-01/arcsettings/predicates.go | 27 - .../2023-08-01/arcsettings/version.go | 12 - .../azurestackhci/2023-08-01/client.go | 109 - .../2023-08-01/cluster/README.md | 66 - .../2023-08-01/cluster/client.go | 26 - .../2023-08-01/cluster/constants.go | 492 --- .../2023-08-01/cluster/id_cluster.go | 130 - .../2023-08-01/cluster/id_cluster_test.go | 282 -- .../cluster/method_createidentity.go | 71 - .../method_extendsoftwareassurancebenefit.go | 75 - .../cluster/method_uploadcertificate.go | 73 - .../2023-08-01/cluster/model_cluster.go | 20 - .../cluster/model_clusterdesiredproperties.go | 9 - .../cluster/model_clusteridentityresponse.go | 8 - ...model_clusteridentityresponseproperties.go | 11 - .../2023-08-01/cluster/model_clusternode.go | 40 - .../cluster/model_clusterproperties.go | 69 - .../model_clusterreportedproperties.go | 36 - ...odel_isolatedvmattestationconfiguration.go | 10 - .../cluster/model_rawcertificatedata.go | 8 - .../model_softwareassurancechangerequest.go | 8 - ...oftwareassurancechangerequestproperties.go | 8 - .../model_softwareassuranceproperties.go | 28 - .../cluster/model_uploadcertificaterequest.go | 8 - .../2023-08-01/cluster/version.go | 12 - .../2023-08-01/clusters/README.md | 125 - .../2023-08-01/clusters/client.go | 26 - .../2023-08-01/clusters/constants.go | 492 --- .../2023-08-01/clusters/id_cluster.go | 130 - .../2023-08-01/clusters/id_cluster_test.go | 282 -- .../2023-08-01/clusters/method_create.go | 58 - .../2023-08-01/clusters/method_delete.go | 71 - .../2023-08-01/clusters/method_get.go | 54 - .../clusters/method_listbyresourcegroup.go | 92 - .../clusters/method_listbysubscription.go | 92 - .../2023-08-01/clusters/method_update.go | 58 - .../2023-08-01/clusters/model_cluster.go | 20 - .../model_clusterdesiredproperties.go | 9 - .../2023-08-01/clusters/model_clusternode.go | 40 - .../2023-08-01/clusters/model_clusterpatch.go | 14 - .../clusters/model_clusterpatchproperties.go | 11 - .../clusters/model_clusterproperties.go | 69 - .../model_clusterreportedproperties.go | 36 - ...odel_isolatedvmattestationconfiguration.go | 10 - .../model_softwareassuranceproperties.go | 28 - .../2023-08-01/clusters/predicates.go | 32 - .../2023-08-01/clusters/version.go | 12 - .../2023-08-01/extensions/README.md | 116 - .../2023-08-01/extensions/client.go | 26 - .../2023-08-01/extensions/constants.go | 356 --- .../2023-08-01/extensions/id_arcsetting.go | 139 - .../extensions/id_arcsetting_test.go | 327 -- .../2023-08-01/extensions/id_extension.go | 148 - .../extensions/id_extension_test.go | 372 --- .../2023-08-01/extensions/method_create.go | 75 - .../2023-08-01/extensions/method_delete.go | 71 - .../2023-08-01/extensions/method_get.go | 54 - .../extensions/method_listbyarcsetting.go | 91 - .../2023-08-01/extensions/method_update.go | 75 - .../2023-08-01/extensions/method_upgrade.go | 73 - .../2023-08-01/extensions/model_extension.go | 16 - .../extensions/model_extensioninstanceview.go | 11 - .../model_extensioninstanceviewstatus.go | 30 - .../extensions/model_extensionparameters.go | 15 - .../extensions/model_extensionpatch.go | 8 - .../model_extensionpatchparameters.go | 11 - .../model_extensionpatchproperties.go | 8 - .../extensions/model_extensionproperties.go | 12 - .../model_extensionupgradeparameters.go | 8 - .../extensions/model_pernodeextensionstate.go | 12 - .../2023-08-01/extensions/predicates.go | 27 - .../2023-08-01/extensions/version.go | 12 - .../azurestackhci/2023-08-01/offers/README.md | 70 - .../azurestackhci/2023-08-01/offers/client.go | 26 - .../2023-08-01/offers/id_cluster.go | 130 - .../2023-08-01/offers/id_cluster_test.go | 282 -- .../2023-08-01/offers/id_offer.go | 148 - .../2023-08-01/offers/id_offer_test.go | 372 --- .../2023-08-01/offers/id_publisher.go | 139 - .../2023-08-01/offers/id_publisher_test.go | 327 -- .../2023-08-01/offers/method_get.go | 83 - .../2023-08-01/offers/method_listbycluster.go | 119 - .../offers/method_listbypublisher.go | 119 - .../2023-08-01/offers/model_offer.go | 16 - .../offers/model_offerproperties.go | 12 - .../2023-08-01/offers/model_skumappings.go | 10 - .../2023-08-01/offers/predicates.go | 27 - .../2023-08-01/offers/version.go | 12 - .../2023-08-01/publishers/README.md | 53 - .../2023-08-01/publishers/client.go | 26 - .../2023-08-01/publishers/id_cluster.go | 130 - .../2023-08-01/publishers/id_cluster_test.go | 282 -- .../2023-08-01/publishers/id_publisher.go | 139 - .../publishers/id_publisher_test.go | 327 -- .../2023-08-01/publishers/method_get.go | 54 - .../publishers/method_listbycluster.go | 91 - .../2023-08-01/publishers/model_publisher.go | 16 - .../publishers/model_publisherproperties.go | 8 - .../2023-08-01/publishers/predicates.go | 27 - .../2023-08-01/publishers/version.go | 12 - .../azurestackhci/2023-08-01/skuses/README.md | 53 - .../azurestackhci/2023-08-01/skuses/client.go | 26 - .../2023-08-01/skuses/id_offer.go | 148 - .../2023-08-01/skuses/id_offer_test.go | 372 --- .../azurestackhci/2023-08-01/skuses/id_sku.go | 157 - .../2023-08-01/skuses/id_sku_test.go | 417 --- .../2023-08-01/skuses/method_skusget.go | 83 - .../skuses/method_skuslistbyoffer.go | 119 - .../2023-08-01/skuses/model_sku.go | 16 - .../2023-08-01/skuses/model_skumappings.go | 10 - .../2023-08-01/skuses/model_skuproperties.go | 13 - .../2023-08-01/skuses/predicates.go | 27 - .../2023-08-01/skuses/version.go | 12 - .../2023-08-01/updateruns/README.md | 86 - .../2023-08-01/updateruns/client.go | 26 - .../2023-08-01/updateruns/constants.go | 107 - .../2023-08-01/updateruns/id_update.go | 139 - .../2023-08-01/updateruns/id_update_test.go | 327 -- .../2023-08-01/updateruns/id_updaterun.go | 148 - .../updateruns/id_updaterun_test.go | 372 --- .../2023-08-01/updateruns/method_delete.go | 71 - .../2023-08-01/updateruns/method_get.go | 54 - .../2023-08-01/updateruns/method_list.go | 91 - .../2023-08-01/updateruns/method_put.go | 58 - .../2023-08-01/updateruns/model_step.go | 57 - .../2023-08-01/updateruns/model_updaterun.go | 17 - .../updateruns/model_updaterunproperties.go | 43 - .../2023-08-01/updateruns/predicates.go | 32 - .../2023-08-01/updateruns/version.go | 12 - .../2023-08-01/updates/README.md | 98 - .../2023-08-01/updates/client.go | 26 - .../2023-08-01/updates/constants.go | 381 --- .../2023-08-01/updates/id_cluster.go | 130 - .../2023-08-01/updates/id_cluster_test.go | 282 -- .../2023-08-01/updates/id_update.go | 139 - .../2023-08-01/updates/id_update_test.go | 327 -- .../2023-08-01/updates/method_delete.go | 71 - .../2023-08-01/updates/method_get.go | 54 - .../2023-08-01/updates/method_list.go | 91 - .../2023-08-01/updates/method_post.go | 70 - .../2023-08-01/updates/method_put.go | 58 - .../updates/model_packageversioninfo.go | 28 - .../updates/model_precheckresult.go | 37 - .../updates/model_precheckresulttags.go | 9 - .../2023-08-01/updates/model_update.go | 17 - .../updates/model_updateprerequisite.go | 10 - .../updates/model_updateproperties.go | 57 - .../updates/model_updatestateproperties.go | 9 - .../2023-08-01/updates/predicates.go | 32 - .../2023-08-01/updates/version.go | 12 - .../2023-08-01/updatesummaries/README.md | 86 - .../2023-08-01/updatesummaries/client.go | 26 - .../2023-08-01/updatesummaries/constants.go | 263 -- .../2023-08-01/updatesummaries/id_cluster.go | 130 - .../updatesummaries/id_cluster_test.go | 282 -- .../updatesummaries/method_delete.go | 71 - .../2023-08-01/updatesummaries/method_get.go | 55 - .../2023-08-01/updatesummaries/method_list.go | 91 - .../2023-08-01/updatesummaries/method_put.go | 59 - .../model_packageversioninfo.go | 28 - .../updatesummaries/model_precheckresult.go | 37 - .../model_precheckresulttags.go | 9 - .../updatesummaries/model_updatesummaries.go | 17 - .../model_updatesummariesproperties.go | 60 - .../2023-08-01/updatesummaries/predicates.go | 32 - .../2023-08-01/updatesummaries/version.go | 12 - .../2023-09-01-preview/client.go | 100 - .../galleryimages/README.md | 117 - .../galleryimages/client.go | 26 - .../galleryimages/constants.go | 268 -- .../galleryimages/id_galleryimage.go | 130 - .../galleryimages/id_galleryimage_test.go | 282 -- .../galleryimages/method_createorupdate.go | 75 - .../galleryimages/method_delete.go | 70 - .../galleryimages/method_get.go | 54 - .../galleryimages/method_list.go | 92 - .../galleryimages/method_listall.go | 92 - .../galleryimages/method_update.go | 75 - .../galleryimages/model_extendedlocation.go | 9 - .../galleryimages/model_gallerydiskimage.go | 8 - .../model_galleryimageidentifier.go | 10 - .../model_galleryimageproperties.go | 16 - .../galleryimages/model_galleryimages.go | 19 - .../galleryimages/model_galleryimagestatus.go | 12 - .../model_galleryimagestatusdownloadstatus.go | 8 - ...el_galleryimagestatusprovisioningstatus.go | 9 - .../model_galleryimagesupdaterequest.go | 8 - .../model_galleryimageversion.go | 9 - .../model_galleryimageversionproperties.go | 8 - ...model_galleryimageversionstorageprofile.go | 8 - .../galleryimages/predicates.go | 32 - .../galleryimages/version.go | 12 - .../2023-09-01-preview/guestagents/README.md | 83 - .../2023-09-01-preview/guestagents/client.go | 26 - .../guestagents/constants.go | 54 - .../guestagents/method_guestagentcreate.go | 76 - .../guestagents/method_guestagentdelete.go | 71 - .../guestagents/method_guestagentget.go | 56 - .../guestagents/method_list.go | 92 - .../guestagents/model_guestagentproperties.go | 11 - .../guestagents/model_guestcredential.go | 9 - .../guestagents/predicates.go | 27 - .../2023-09-01-preview/guestagents/version.go | 12 - .../hybrididentitymetadata/README.md | 54 - .../hybrididentitymetadata/client.go | 26 - .../hybrididentitymetadata/method_get.go | 56 - .../hybrididentitymetadata/method_list.go | 92 - .../model_hybrididentitymetadata.go | 16 - .../model_hybrididentitymetadataproperties.go | 15 - .../hybrididentitymetadata/predicates.go | 27 - .../hybrididentitymetadata/version.go | 12 - .../logicalnetworks/README.md | 117 - .../logicalnetworks/client.go | 26 - .../logicalnetworks/constants.go | 227 -- .../logicalnetworks/id_logicalnetwork.go | 130 - .../logicalnetworks/id_logicalnetwork_test.go | 282 -- .../logicalnetworks/method_createorupdate.go | 75 - .../logicalnetworks/method_delete.go | 70 - .../logicalnetworks/method_get.go | 54 - .../logicalnetworks/method_list.go | 92 - .../logicalnetworks/method_listall.go | 92 - .../logicalnetworks/method_update.go | 75 - .../logicalnetworks/model_extendedlocation.go | 9 - .../logicalnetworks/model_ippool.go | 12 - .../logicalnetworks/model_ippoolinfo.go | 9 - .../model_logicalnetworkproperties.go | 12 - ...del_logicalnetworkpropertiesdhcpoptions.go | 8 - .../logicalnetworks/model_logicalnetworks.go | 19 - .../model_logicalnetworkstatus.go | 10 - ..._logicalnetworkstatusprovisioningstatus.go | 9 - .../model_logicalnetworksupdaterequest.go | 8 - .../logicalnetworks/model_route.go | 9 - .../model_routepropertiesformat.go | 9 - .../logicalnetworks/model_routetable.go | 11 - .../model_routetablepropertiesformat.go | 8 - .../logicalnetworks/model_subnet.go | 9 - .../model_subnetpropertiesformat.go | 14 - ...sformatipconfigurationreferencesinlined.go | 8 - .../logicalnetworks/predicates.go | 32 - .../logicalnetworks/version.go | 12 - .../marketplacegalleryimages/README.md | 117 - .../marketplacegalleryimages/client.go | 26 - .../marketplacegalleryimages/constants.go | 268 -- .../id_marketplacegalleryimage.go | 130 - .../id_marketplacegalleryimage_test.go | 282 -- .../method_createorupdate.go | 75 - .../marketplacegalleryimages/method_delete.go | 70 - .../marketplacegalleryimages/method_get.go | 54 - .../marketplacegalleryimages/method_list.go | 92 - .../method_listall.go | 92 - .../marketplacegalleryimages/method_update.go | 75 - .../model_extendedlocation.go | 9 - .../model_gallerydiskimage.go | 8 - .../model_galleryimageidentifier.go | 10 - .../model_galleryimageversion.go | 9 - .../model_galleryimageversionproperties.go | 8 - ...model_galleryimageversionstorageprofile.go | 8 - ...model_marketplacegalleryimageproperties.go | 15 - .../model_marketplacegalleryimages.go | 19 - .../model_marketplacegalleryimagestatus.go | 12 - ...etplacegalleryimagestatusdownloadstatus.go | 8 - ...acegalleryimagestatusprovisioningstatus.go | 9 - ...l_marketplacegalleryimagesupdaterequest.go | 8 - .../marketplacegalleryimages/predicates.go | 32 - .../marketplacegalleryimages/version.go | 12 - .../networkinterfaces/README.md | 117 - .../networkinterfaces/constants.go | 145 - .../networkinterfaces/id_networkinterface.go | 130 - .../id_networkinterface_test.go | 282 -- .../method_createorupdate.go | 75 - .../networkinterfaces/method_delete.go | 70 - .../networkinterfaces/method_get.go | 54 - .../networkinterfaces/method_list.go | 92 - .../networkinterfaces/method_listall.go | 92 - .../networkinterfaces/method_update.go | 75 - .../model_extendedlocation.go | 9 - .../model_interfacednssettings.go | 8 - .../model_ipconfiguration.go | 9 - .../model_ipconfigurationproperties.go | 11 - .../model_ipconfigurationpropertiessubnet.go | 8 - .../model_networkinterfaceproperties.go | 12 - .../model_networkinterfaces.go | 19 - .../model_networkinterfacestatus.go | 10 - ...etworkinterfacestatusprovisioningstatus.go | 9 - .../model_networkinterfacesupdaterequest.go | 8 - .../networkinterfaces/predicates.go | 32 - .../networkinterfaces/version.go | 12 - .../storagecontainers/README.md | 117 - .../storagecontainers/client.go | 26 - .../storagecontainers/constants.go | 145 - .../storagecontainers/id_storagecontainer.go | 130 - .../id_storagecontainer_test.go | 282 -- .../method_createorupdate.go | 75 - .../storagecontainers/method_delete.go | 70 - .../storagecontainers/method_get.go | 54 - .../storagecontainers/method_list.go | 92 - .../storagecontainers/method_listall.go | 92 - .../storagecontainers/method_update.go | 75 - .../model_extendedlocation.go | 9 - .../model_storagecontainerproperties.go | 10 - .../model_storagecontainers.go | 19 - .../model_storagecontainerstatus.go | 12 - ...toragecontainerstatusprovisioningstatus.go | 9 - .../model_storagecontainersupdaterequest.go | 8 - .../storagecontainers/predicates.go | 32 - .../storagecontainers/version.go | 12 - .../virtualharddisks/README.md | 117 - .../virtualharddisks/client.go | 26 - .../virtualharddisks/constants.go | 227 -- .../virtualharddisks/id_virtualharddisk.go | 130 - .../id_virtualharddisk_test.go | 282 -- .../virtualharddisks/method_createorupdate.go | 75 - .../virtualharddisks/method_delete.go | 70 - .../virtualharddisks/method_get.go | 54 - .../virtualharddisks/method_list.go | 92 - .../virtualharddisks/method_listall.go | 92 - .../virtualharddisks/method_update.go | 75 - .../model_extendedlocation.go | 9 - .../model_virtualharddiskproperties.go | 17 - .../model_virtualharddisks.go | 19 - .../model_virtualharddiskstatus.go | 10 - ...virtualharddiskstatusprovisioningstatus.go | 9 - .../model_virtualharddisksupdaterequest.go | 8 - .../virtualharddisks/predicates.go | 32 - .../virtualharddisks/version.go | 12 - .../virtualmachineinstances/README.md | 136 - .../virtualmachineinstances/constants.go | 475 --- .../method_createorupdate.go | 76 - .../virtualmachineinstances/method_delete.go | 71 - .../virtualmachineinstances/method_get.go | 56 - .../virtualmachineinstances/method_list.go | 92 - .../virtualmachineinstances/method_start.go | 72 - .../virtualmachineinstances/method_stop.go | 72 - .../virtualmachineinstances/method_update.go | 76 - .../model_erroradditionalinfo.go | 9 - .../model_errordetail.go | 12 - .../model_extendedlocation.go | 9 - .../model_guestagentinstallstatus.go | 30 - .../model_hardwareprofileupdate.go | 10 - .../model_httpproxyconfiguration.go | 11 - .../model_instanceviewstatus.go | 30 - .../model_networkprofileupdate.go | 8 - ...rkprofileupdatenetworkinterfacesinlined.go | 8 - .../model_osprofileupdate.go | 10 - ...model_osprofileupdatelinuxconfiguration.go | 9 - ...del_osprofileupdatewindowsconfiguration.go | 9 - .../model_sshconfiguration.go | 8 - .../model_sshpublickey.go | 9 - .../model_storageprofileupdate.go | 8 - ...el_storageprofileupdatedatadisksinlined.go | 8 - ...l_virtualmachineconfigagentinstanceview.go | 9 - .../model_virtualmachineinstance.go | 19 - .../model_virtualmachineinstanceproperties.go | 19 - ...achineinstancepropertieshardwareprofile.go | 11 - ...rtieshardwareprofiledynamicmemoryconfig.go | 10 - ...machineinstancepropertiesnetworkprofile.go | 8 - ...snetworkprofilenetworkinterfacesinlined.go | 8 - ...rtualmachineinstancepropertiesosprofile.go | 12 - ...cepropertiesosprofilelinuxconfiguration.go | 11 - ...propertiesosprofilewindowsconfiguration.go | 12 - ...achineinstancepropertiessecurityprofile.go | 10 - ...cepropertiessecurityprofileuefisettings.go | 8 - ...machineinstancepropertiesstorageprofile.go | 11 - ...ropertiesstorageprofiledatadisksinlined.go | 8 - ...epropertiesstorageprofileimagereference.go | 8 - ...einstancepropertiesstorageprofileosdisk.go | 9 - .../model_virtualmachineinstancestatus.go | 11 - ...machineinstancestatusprovisioningstatus.go | 9 - ..._virtualmachineinstanceupdateproperties.go | 11 - ...del_virtualmachineinstanceupdaterequest.go | 13 - .../model_virtualmachineinstanceview.go | 8 - .../virtualmachineinstances/version.go | 12 - .../2023-04-15-preview/capabilities/README.md | 107 - .../2023-04-15-preview/capabilities/client.go | 26 - .../capabilities/id_capabilitytype.go | 139 - .../capabilities/id_capabilitytype_test.go | 327 -- .../capabilities/method_capabilitytypesget.go | 54 - .../capabilities/method_createorupdate.go | 59 - .../capabilities/method_delete.go | 48 - .../capabilities/method_get.go | 55 - .../capabilities/method_list.go | 120 - .../capabilities/model_capability.go | 16 - .../model_capabilityproperties.go | 12 - .../capabilities/model_capabilitytype.go | 17 - .../model_capabilitytypeproperties.go | 17 - ...pabilitytypepropertiesruntimeproperties.go | 8 - .../capabilities/predicates.go | 27 - .../capabilities/version.go | 12 - .../capabilitytypes/README.md | 37 - .../capabilitytypes/client.go | 26 - .../capabilitytypes/id_targettype.go | 130 - .../capabilitytypes/id_targettype_test.go | 282 -- .../capabilitytypes/method_list.go | 119 - .../capabilitytypes/model_capabilitytype.go | 17 - .../model_capabilitytypeproperties.go | 17 - ...pabilitytypepropertiesruntimeproperties.go | 8 - .../capabilitytypes/predicates.go | 32 - .../capabilitytypes/version.go | 12 - .../chaosstudio/2023-04-15-preview/client.go | 64 - .../2023-04-15-preview/experiments/README.md | 227 -- .../2023-04-15-preview/experiments/client.go | 26 - .../experiments/constants.go | 127 - .../experiments/id_executiondetail.go | 139 - .../experiments/id_executiondetail_test.go | 327 -- .../experiments/id_experiment.go | 130 - .../experiments/id_experiment_test.go | 282 -- .../experiments/id_status.go | 139 - .../experiments/id_status_test.go | 327 -- .../experiments/method_cancel.go | 55 - .../experiments/method_createorupdate.go | 58 - .../experiments/method_delete.go | 47 - .../experiments/method_get.go | 54 - .../experiments/method_getexecutiondetails.go | 54 - .../experiments/method_getstatus.go | 54 - .../experiments/method_list.go | 124 - .../experiments/method_listall.go | 124 - .../experiments/method_listallstatuses.go | 91 - .../method_listexecutiondetails.go | 91 - .../experiments/method_start.go | 55 - .../experiments/method_update.go | 58 - .../experiments/model_action.go | 69 - .../experiments/model_actionstatus.go | 43 - .../experiments/model_branch.go | 49 - .../experiments/model_branchstatus.go | 11 - .../experiments/model_continuousaction.go | 44 - .../experiments/model_delayaction.go | 42 - .../experiments/model_discreteaction.go | 43 - .../experiments/model_experiment.go | 20 - .../model_experimentcanceloperationresult.go | 9 - ...rimentexecutionactiontargetdetailserror.go | 9 - ...texecutionactiontargetdetailsproperties.go | 42 - .../model_experimentexecutiondetails.go | 11 - ...el_experimentexecutiondetailsproperties.go | 69 - ...xecutiondetailspropertiesruninformation.go | 8 - .../experiments/model_experimentproperties.go | 51 - .../model_experimentstartoperationresult.go | 9 - .../experiments/model_experimentstatus.go | 11 - .../model_experimentstatusproperties.go | 40 - .../experiments/model_experimentupdate.go | 12 - .../experiments/model_filter.go | 53 - .../experiments/model_keyvaluepair.go | 9 - .../experiments/model_listselector.go | 70 - .../experiments/model_queryselector.go | 72 - .../experiments/model_selector.go | 61 - .../experiments/model_simplefilter.go | 41 - .../model_simplefilterparameters.go | 8 - .../experiments/model_step.go | 9 - .../experiments/model_stepstatus.go | 11 - .../experiments/model_targetreference.go | 9 - .../experiments/predicates.go | 78 - .../2023-04-15-preview/experiments/version.go | 12 - .../2023-04-15-preview/targets/README.md | 91 - .../2023-04-15-preview/targets/client.go | 26 - .../targets/method_createorupdate.go | 59 - .../targets/method_delete.go | 48 - .../2023-04-15-preview/targets/method_get.go | 55 - .../2023-04-15-preview/targets/method_list.go | 120 - .../targets/model_target.go | 17 - .../2023-04-15-preview/targets/predicates.go | 37 - .../2023-04-15-preview/targets/version.go | 12 - .../2023-04-15-preview/targettypes/README.md | 53 - .../2023-04-15-preview/targettypes/client.go | 26 - .../targettypes/id_location.go | 121 - .../targettypes/id_location_test.go | 237 -- .../targettypes/id_targettype.go | 130 - .../targettypes/id_targettype_test.go | 282 -- .../targettypes/method_get.go | 54 - .../targettypes/method_list.go | 119 - .../targettypes/model_targettype.go | 17 - .../targettypes/model_targettypeproperties.go | 11 - .../targettypes/predicates.go | 32 - .../2023-04-15-preview/targettypes/version.go | 12 - .../connectedvmware/2023-12-01/client.go | 118 + .../2023-12-01/clusters/README.md | 121 + .../2023-12-01}/clusters/client.go | 0 .../2023-12-01/clusters/constants.go | 69 + .../2023-12-01/clusters/id_cluster.go | 130 + .../2023-12-01/clusters/id_cluster_test.go | 282 ++ .../2023-12-01/clusters/method_create.go | 75 + .../2023-12-01/clusters/method_delete.go | 99 + .../2023-12-01}/clusters/method_get.go | 0 .../2023-12-01/clusters/method_list.go | 92 + .../clusters/method_listbyresourcegroup.go | 92 + .../2023-12-01/clusters/method_update.go | 58 + .../2023-12-01/clusters/model_cluster.go | 20 + .../clusters/model_clusterproperties.go | 21 + .../clusters/model_extendedlocation.go | 9 + .../clusters/model_resourcepatch.go | 8 + .../clusters/model_resourcestatus.go | 31 + .../2023-12-01/clusters/predicates.go | 37 + .../2023-12-01/clusters/version.go | 12 + .../2023-12-01/datastores/README.md | 121 + .../2023-12-01/datastores/client.go | 26 + .../2023-12-01/datastores/constants.go | 69 + .../2023-12-01/datastores/id_datastore.go | 130 + .../datastores/id_datastore_test.go | 282 ++ .../2023-12-01/datastores/method_create.go | 75 + .../2023-12-01/datastores/method_delete.go | 99 + .../2023-12-01/datastores/method_get.go | 54 + .../2023-12-01/datastores/method_list.go | 92 + .../datastores/method_listbyresourcegroup.go | 92 + .../2023-12-01/datastores/method_update.go | 58 + .../2023-12-01/datastores/model_datastore.go | 20 + .../datastores/model_datastoreproperties.go | 17 + .../datastores/model_extendedlocation.go | 9 + .../datastores/model_resourcepatch.go | 8 + .../datastores/model_resourcestatus.go | 31 + .../2023-12-01/datastores/predicates.go | 37 + .../2023-12-01/datastores/version.go | 12 + .../2023-12-01/hosts/README.md | 121 + .../2023-12-01/hosts/client.go | 26 + .../2023-12-01/hosts/constants.go | 69 + .../2023-12-01/hosts/id_host.go | 130 + .../2023-12-01/hosts/id_host_test.go | 282 ++ .../2023-12-01/hosts/method_create.go | 75 + .../2023-12-01/hosts/method_delete.go | 99 + .../2023-12-01/hosts/method_get.go | 54 + .../2023-12-01/hosts/method_list.go | 92 + .../hosts/method_listbyresourcegroup.go | 92 + .../2023-12-01/hosts/method_update.go | 58 + .../hosts/model_extendedlocation.go | 9 + .../2023-12-01/hosts/model_host.go | 20 + .../2023-12-01/hosts/model_hostproperties.go | 21 + .../2023-12-01/hosts/model_resourcepatch.go | 8 + .../2023-12-01/hosts/model_resourcestatus.go | 31 + .../2023-12-01/hosts/predicates.go | 37 + .../2023-12-01/hosts/version.go | 12 + .../2023-12-01/inventoryitems/README.md | 90 + .../2023-12-01/inventoryitems/client.go | 26 + .../2023-12-01/inventoryitems/constants.go | 363 +++ .../inventoryitems/id_inventoryitem.go | 139 + .../inventoryitems/id_inventoryitem_test.go | 327 ++ .../2023-12-01/inventoryitems/id_vcenter.go | 130 + .../inventoryitems/id_vcenter_test.go | 282 ++ .../inventoryitems/method_create.go | 58 + .../inventoryitems/method_delete.go | 47 + .../2023-12-01/inventoryitems/method_get.go | 54 + .../inventoryitems/method_listbyvcenter.go | 91 + .../model_clusterinventoryitem.go | 44 + .../model_datastoreinventoryitem.go | 46 + .../inventoryitems/model_hostinventoryitem.go | 51 + .../inventoryitems/model_inventoryitem.go | 50 + .../model_inventoryitemdetails.go | 10 + .../model_inventoryitemproperties.go | 101 + .../model_networkinterfaceinventory.go | 14 + .../model_networkprofileinventory.go | 8 + .../model_resourcepoolinventoryitem.go | 45 + .../model_storageprofileinventory.go | 8 + .../model_virtualdiskinventory.go | 21 + .../model_virtualmachineinventoryitem.go | 68 + ...del_virtualmachinetemplateinventoryitem.go | 52 + .../model_virtualnetworkinventoryitem.go | 44 + .../2023-12-01/inventoryitems/predicates.go | 32 + .../2023-12-01/inventoryitems/version.go | 12 + .../2023-12-01/resourcepools/README.md | 121 + .../2023-12-01/resourcepools/client.go | 26 + .../2023-12-01/resourcepools/constants.go | 69 + .../resourcepools/id_resourcepool.go | 130 + .../resourcepools/id_resourcepool_test.go | 282 ++ .../2023-12-01/resourcepools/method_create.go | 75 + .../2023-12-01/resourcepools/method_delete.go | 99 + .../2023-12-01/resourcepools/method_get.go | 54 + .../2023-12-01/resourcepools/method_list.go | 92 + .../method_listbyresourcegroup.go | 92 + .../2023-12-01/resourcepools/method_update.go | 58 + .../resourcepools/model_extendedlocation.go | 9 + .../resourcepools/model_resourcepatch.go | 8 + .../resourcepools/model_resourcepool.go | 20 + .../model_resourcepoolproperties.go | 27 + .../resourcepools/model_resourcestatus.go | 31 + .../2023-12-01/resourcepools/predicates.go | 37 + .../2023-12-01/resourcepools/version.go | 12 + .../2023-12-01/vcenters/README.md | 121 + .../2023-12-01/vcenters/client.go | 26 + .../2023-12-01/vcenters/constants.go | 69 + .../2023-12-01/vcenters/id_vcenter.go | 130 + .../2023-12-01/vcenters/id_vcenter_test.go | 282 ++ .../2023-12-01/vcenters/method_create.go | 75 + .../2023-12-01/vcenters/method_delete.go | 99 + .../2023-12-01/vcenters/method_get.go | 54 + .../2023-12-01/vcenters/method_list.go | 92 + .../vcenters/method_listbyresourcegroup.go | 92 + .../2023-12-01/vcenters/method_update.go | 58 + .../vcenters/model_extendedlocation.go | 9 + .../vcenters/model_resourcepatch.go | 8 + .../vcenters/model_resourcestatus.go | 31 + .../2023-12-01/vcenters/model_vcenter.go | 20 + .../vcenters/model_vcenterproperties.go | 17 + .../2023-12-01/vcenters/model_vicredential.go | 9 + .../2023-12-01/vcenters/predicates.go | 37 + .../2023-12-01/vcenters/version.go | 12 + .../virtualmachineinstances/README.md | 141 + .../virtualmachineinstances/client.go | 0 .../virtualmachineinstances/constants.go | 492 +++ .../method_createorupdate.go | 76 + .../virtualmachineinstances/method_delete.go | 103 + .../virtualmachineinstances/method_get.go | 56 + .../virtualmachineinstances/method_list.go | 92 + .../virtualmachineinstances/method_restart.go | 4 +- .../virtualmachineinstances/method_start.go | 70 + .../virtualmachineinstances/method_stop.go | 74 + .../virtualmachineinstances/method_update.go | 76 + .../model_extendedlocation.go | 9 + .../model_hardwareprofile.go | 13 + .../model_infrastructureprofile.go | 17 + .../model_networkinterface.go | 18 + .../model_networkinterfaceupdate.go | 12 + .../model_networkprofile.go | 8 + .../model_networkprofileupdate.go | 8 + .../model_nicipaddresssettings.go | 10 + .../model_nicipsettings.go | 15 + .../model_osprofileforvminstance.go | 17 + .../model_placementprofile.go | 11 + .../model_resourcestatus.go | 31 + .../model_securityprofile.go | 8 + .../model_stopvirtualmachineoptions.go | 8 + .../model_storageprofile.go | 9 + .../model_storageprofileupdate.go | 8 + .../model_uefisettings.go | 8 + .../model_virtualdisk.go | 17 + .../model_virtualdiskupdate.go | 15 + .../model_virtualmachineinstance.go | 17 + .../model_virtualmachineinstanceproperties.go | 18 + .../model_virtualmachineinstanceupdate.go | 8 + ..._virtualmachineinstanceupdateproperties.go | 10 + .../model_virtualscsicontroller.go | 12 + .../model_windowsconfiguration.go | 18 + .../virtualmachineinstances/predicates.go | 0 .../virtualmachineinstances/version.go | 12 + .../virtualmachinetemplates/README.md | 121 + .../virtualmachinetemplates/client.go | 26 + .../virtualmachinetemplates/constants.go | 401 +++ .../id_virtualmachinetemplate.go | 130 + .../id_virtualmachinetemplate_test.go | 282 ++ .../virtualmachinetemplates/method_create.go | 75 + .../virtualmachinetemplates/method_delete.go | 99 + .../virtualmachinetemplates/method_get.go | 54 + .../virtualmachinetemplates/method_list.go | 92 + .../method_listbyresourcegroup.go | 92 + .../virtualmachinetemplates/method_update.go | 58 + .../model_extendedlocation.go | 9 + .../model_networkinterface.go | 18 + .../model_nicipaddresssettings.go | 10 + .../model_nicipsettings.go | 15 + .../model_resourcepatch.go | 8 + .../model_resourcestatus.go | 31 + .../model_virtualdisk.go | 17 + .../model_virtualmachinetemplate.go | 20 + .../model_virtualmachinetemplateproperties.go | 26 + .../virtualmachinetemplates/predicates.go | 37 + .../virtualmachinetemplates/version.go | 12 + .../2023-12-01/virtualnetworks/README.md | 121 + .../2023-12-01}/virtualnetworks/client.go | 0 .../2023-12-01/virtualnetworks/constants.go | 69 + .../virtualnetworks/id_virtualnetwork.go | 130 + .../virtualnetworks/id_virtualnetwork_test.go | 282 ++ .../virtualnetworks/method_create.go | 75 + .../virtualnetworks/method_delete.go | 99 + .../2023-12-01/virtualnetworks/method_get.go | 54 + .../2023-12-01/virtualnetworks/method_list.go | 92 + .../method_listbyresourcegroup.go | 92 + .../virtualnetworks/method_update.go | 58 + .../virtualnetworks/model_extendedlocation.go | 9 + .../virtualnetworks/model_resourcepatch.go | 8 + .../virtualnetworks/model_resourcestatus.go | 31 + .../virtualnetworks/model_virtualnetwork.go | 20 + .../model_virtualnetworkproperties.go | 15 + .../2023-12-01/virtualnetworks/predicates.go | 37 + .../2023-12-01/virtualnetworks/version.go | 12 + .../vminstanceguestagents/README.md | 83 + .../vminstanceguestagents/client.go | 26 + .../vminstanceguestagents/constants.go | 113 + .../vminstanceguestagents/method_create.go | 76 + .../vminstanceguestagents/method_delete.go | 71 + .../vminstanceguestagents/method_get.go | 56 + .../vminstanceguestagents/method_list.go | 92 + .../model_guestagent.go | 2 +- .../model_guestagentproperties.go | 16 + .../model_guestcredential.go | 10 + .../model_httpproxyconfiguration.go | 8 + .../model_resourcestatus.go | 31 + .../vminstanceguestagents/predicates.go | 27 + .../vminstanceguestagents/version.go | 12 + .../README.md | 54 + .../client.go | 26 + .../constants.go | 69 + .../method_get.go | 56 + .../method_list.go | 92 + .../model_vminstancehybrididentitymetadata.go | 16 + ...nstancehybrididentitymetadataproperties.go | 10 + .../predicates.go | 27 + .../version.go | 12 + .../2022-09-02-preview/agentpools/README.md | 143 - .../2022-09-02-preview/agentpools/client.go | 26 - .../agentpools/constants.go | 561 ---- .../agentpools/id_agentpool.go | 139 - .../agentpools/id_agentpool_test.go | 327 -- .../agentpools/method_abortlatestoperation.go | 47 - .../agentpools/method_createorupdate.go | 75 - .../agentpools/method_delete.go | 98 - .../agentpools/method_get.go | 54 - .../method_getavailableagentpoolversions.go | 56 - .../agentpools/method_getupgradeprofile.go | 55 - .../agentpools/method_list.go | 92 - .../method_upgradenodeimageversion.go | 71 - .../agentpools/model_agentpool.go | 11 - .../model_agentpoolavailableversions.go | 11 - ...el_agentpoolavailableversionsproperties.go | 8 - ...sionspropertiesagentpoolversionsinlined.go | 10 - .../model_agentpoolnetworkprofile.go | 10 - .../model_agentpoolupgradeprofile.go | 11 - ...model_agentpoolupgradeprofileproperties.go | 11 - ...upgradeprofilepropertiesupgradesinlined.go | 9 - .../model_agentpoolupgradesettings.go | 8 - .../model_agentpoolwindowsprofile.go | 8 - .../agentpools/model_creationdata.go | 8 - .../agentpools/model_iptag.go | 9 - .../agentpools/model_kubeletconfig.go | 18 - .../agentpools/model_linuxosconfig.go | 11 - ...anagedclusteragentpoolprofileproperties.go | 57 - .../agentpools/model_portrange.go | 10 - .../agentpools/model_powerstate.go | 8 - .../agentpools/model_sysctlconfig.go | 35 - .../agentpools/predicates.go | 27 - .../2022-09-02-preview/agentpools/version.go | 12 - .../2022-09-02-preview/client.go | 118 - .../2022-09-02-preview/fleetmembers/README.md | 82 - .../2022-09-02-preview/fleetmembers/client.go | 26 - .../fleetmembers/constants.go | 63 - .../fleetmembers/id_fleet.go | 130 - .../fleetmembers/id_fleet_test.go | 282 -- .../fleetmembers/id_member.go | 139 - .../fleetmembers/id_member_test.go | 327 -- .../fleetmembers/method_create.go | 107 - .../fleetmembers/method_delete.go | 99 - .../fleetmembers/method_get.go | 54 - .../fleetmembers/method_listbyfleet.go | 91 - .../fleetmembers/model_fleetmember.go | 17 - .../model_fleetmemberproperties.go | 9 - .../fleetmembers/predicates.go | 32 - .../fleetmembers/version.go | 12 - .../2022-09-02-preview/fleets/README.md | 137 - .../2022-09-02-preview/fleets/client.go | 26 - .../2022-09-02-preview/fleets/constants.go | 63 - .../2022-09-02-preview/fleets/id_fleet.go | 130 - .../fleets/id_fleet_test.go | 282 -- .../fleets/method_createorupdate.go | 107 - .../fleets/method_delete.go | 99 - .../2022-09-02-preview/fleets/method_get.go | 54 - .../fleets/method_listbyresourcegroup.go | 92 - .../fleets/method_listbysubscription.go | 92 - .../fleets/method_listcredentials.go | 55 - .../fleets/method_update.go | 87 - .../2022-09-02-preview/fleets/model_fleet.go | 19 - .../fleets/model_fleetcredentialresult.go | 9 - .../fleets/model_fleetcredentialresults.go | 8 - .../fleets/model_fleethubprofile.go | 10 - .../fleets/model_fleetpatch.go | 8 - .../fleets/model_fleetproperties.go | 9 - .../2022-09-02-preview/fleets/predicates.go | 37 - .../2022-09-02-preview/fleets/version.go | 12 - .../maintenanceconfigurations/README.md | 91 - .../maintenanceconfigurations/client.go | 26 - .../maintenanceconfigurations/constants.go | 66 - .../id_maintenanceconfiguration.go | 139 - .../id_maintenanceconfiguration_test.go | 327 -- .../method_createorupdate.go | 58 - .../method_delete.go | 47 - .../maintenanceconfigurations/method_get.go | 54 - .../method_listbymanagedcluster.go | 92 - .../model_maintenanceconfiguration.go | 16 - ...odel_maintenanceconfigurationproperties.go | 9 - .../model_timeinweek.go | 9 - .../model_timespan.go | 39 - .../maintenanceconfigurations/predicates.go | 27 - .../maintenanceconfigurations/version.go | 12 - .../managedclusters/README.md | 361 --- .../managedclusters/client.go | 26 - .../managedclusters/constants.go | 1537 --------- .../managedclusters/id_accessprofile.go | 139 - .../managedclusters/id_accessprofile_test.go | 327 -- .../managedclusters/id_commandresult.go | 139 - .../managedclusters/id_commandresult_test.go | 327 -- .../managedclusters/id_location.go | 121 - .../managedclusters/id_location_test.go | 237 -- .../method_abortlatestoperation.go | 48 - .../managedclusters/method_createorupdate.go | 76 - .../managedclusters/method_delete.go | 99 - .../managedclusters/method_get.go | 55 - .../method_getaccessprofile.go | 55 - .../method_getcommandresult.go | 55 - .../managedclusters/method_getosoptions.go | 83 - .../method_getupgradeprofile.go | 56 - .../managedclusters/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_listclusteradmincredentials.go | 84 - ...od_listclustermonitoringusercredentials.go | 84 - .../method_listclusterusercredentials.go | 88 - ...istoutboundnetworkdependenciesendpoints.go | 92 - .../managedclusters/method_resetaadprofile.go | 75 - .../method_resetserviceprincipalprofile.go | 75 - .../method_rotateclustercertificates.go | 71 - .../method_rotateserviceaccountsigningkeys.go | 71 - .../managedclusters/method_runcommand.go | 76 - .../managedclusters/method_start.go | 71 - .../managedclusters/method_stop.go | 71 - .../managedclusters/method_updatetags.go | 75 - .../managedclusters/model_accessprofile.go | 8 - .../model_agentpoolnetworkprofile.go | 10 - .../model_agentpoolupgradesettings.go | 8 - .../model_agentpoolwindowsprofile.go | 8 - .../managedclusters/model_azurekeyvaultkms.go | 11 - .../model_commandresultproperties.go | 43 - .../model_containerservicelinuxprofile.go | 9 - .../model_containerservicenetworkprofile.go | 24 - ...nerservicenetworkprofilekubeproxyconfig.go | 10 - ...networkprofilekubeproxyconfigipvsconfig.go | 11 - .../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 - .../model_guardrailsprofile.go | 11 - .../managedclusters/model_iptag.go | 9 - .../managedclusters/model_kubeletconfig.go | 18 - .../managedclusters/model_linuxosconfig.go | 11 - .../managedclusters/model_managedcluster.go | 23 - .../model_managedclusteraadprofile.go | 14 - .../model_managedclusteraccessprofile.go | 18 - .../model_managedclusteraddonprofile.go | 10 - .../model_managedclusteragentpoolprofile.go | 58 - ...el_managedclusterapiserveraccessprofile.go | 14 - .../model_managedclusterautoupgradeprofile.go | 8 - ...model_managedclusterazuremonitorprofile.go | 8 - ...sterazuremonitorprofilekubestatemetrics.go | 9 - ...anagedclusterazuremonitorprofilemetrics.go | 9 - .../model_managedclusterhttpproxyconfig.go | 12 - .../model_managedclusteringressprofile.go | 8 - ...nagedclusteringressprofilewebapprouting.go | 9 - ...model_managedclusterloadbalancerprofile.go | 15 - ...erloadbalancerprofilemanagedoutboundips.go | 9 - ...erloadbalancerprofileoutboundipprefixes.go | 8 - ...edclusterloadbalancerprofileoutboundips.go | 8 - ..._managedclustermanagedoutboundipprofile.go | 8 - .../model_managedclusternatgatewayprofile.go | 10 - .../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 | 46 - ...nagedclusterpropertiesautoscalerprofile.go | 24 - .../model_managedclustersecurityprofile.go | 13 - ...l_managedclustersecurityprofiledefender.go | 9 - ...curityprofiledefendersecuritymonitoring.go | 8 - ...nagedclustersecurityprofileimagecleaner.go | 9 - ...edclustersecurityprofilenoderestriction.go | 8 - ...dclustersecurityprofileworkloadidentity.go | 8 - ...l_managedclusterserviceprincipalprofile.go | 9 - .../model_managedclustersku.go | 9 - .../model_managedclusterstorageprofile.go | 11 - ...nagedclusterstorageprofileblobcsidriver.go | 8 - ...nagedclusterstorageprofilediskcsidriver.go | 9 - ...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 | 10 - .../managedclusters/model_osoptionprofile.go | 11 - .../managedclusters/model_osoptionproperty.go | 9 - .../model_osoptionpropertylist.go | 8 - .../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 - .../managedclusters/model_sysctlconfig.go | 35 - .../managedclusters/model_tagsobject.go | 8 - .../model_userassignedidentity.go | 10 - .../model_windowsgmsaprofile.go | 10 - .../managedclusters/predicates.go | 45 - .../managedclusters/version.go | 12 - .../managedclustersnapshots/README.md | 129 - .../managedclustersnapshots/client.go | 26 - .../managedclustersnapshots/constants.go | 335 -- .../id_managedclustersnapshot.go | 130 - .../id_managedclustersnapshot_test.go | 282 -- .../method_createorupdate.go | 59 - .../managedclustersnapshots/method_delete.go | 47 - .../managedclustersnapshots/method_get.go | 54 - .../managedclustersnapshots/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_creationdata.go | 8 - ...del_managedclusterpropertiesforsnapshot.go | 11 - .../model_managedclustersku.go | 9 - .../model_managedclustersnapshot.go | 18 - .../model_managedclustersnapshotproperties.go | 10 - .../model_networkprofileforsnapshot.go | 12 - .../model_tagsobject.go | 8 - .../managedclustersnapshots/predicates.go | 32 - .../managedclustersnapshots/version.go | 12 - .../privateendpointconnections/README.md | 86 - .../privateendpointconnections/client.go | 26 - .../privateendpointconnections/constants.go | 104 - .../id_privateendpointconnection.go | 139 - .../id_privateendpointconnection_test.go | 327 -- .../method_delete.go | 70 - .../privateendpointconnections/method_get.go | 54 - .../privateendpointconnections/method_list.go | 56 - .../method_update.go | 58 - .../model_privateendpoint.go | 8 - .../model_privateendpointconnection.go | 11 - ...del_privateendpointconnectionlistresult.go | 8 - ...del_privateendpointconnectionproperties.go | 10 - ...model_privatelinkserviceconnectionstate.go | 9 - .../privateendpointconnections/version.go | 12 - .../privatelinkresources/README.md | 37 - .../privatelinkresources/client.go | 26 - .../privatelinkresources/method_list.go | 56 - .../model_privatelinkresource.go | 13 - .../model_privatelinkresourceslistresult.go | 8 - .../privatelinkresources/version.go | 12 - .../resolveprivatelinkserviceid/README.md | 42 - .../resolveprivatelinkserviceid/client.go | 26 - .../method_post.go | 60 - .../model_privatelinkresource.go | 13 - .../resolveprivatelinkserviceid/version.go | 12 - .../2022-09-02-preview/snapshots/README.md | 129 - .../2022-09-02-preview/snapshots/constants.go | 142 - .../snapshots/id_snapshot.go | 130 - .../snapshots/id_snapshot_test.go | 282 -- .../snapshots/method_createorupdate.go | 59 - .../snapshots/method_delete.go | 47 - .../snapshots/method_list.go | 92 - .../snapshots/method_listbyresourcegroup.go | 92 - .../snapshots/method_updatetags.go | 58 - .../snapshots/model_creationdata.go | 8 - .../snapshots/model_snapshot.go | 18 - .../snapshots/model_snapshotproperties.go | 15 - .../snapshots/model_tagsobject.go | 8 - .../snapshots/predicates.go | 32 - .../2022-09-02-preview/snapshots/version.go | 12 - .../trustedaccess/README.md | 108 - .../trustedaccess/client.go | 26 - .../trustedaccess/constants.go | 57 - .../trustedaccess/id_location.go | 121 - .../trustedaccess/id_location_test.go | 237 -- .../id_trustedaccessrolebinding.go | 139 - .../id_trustedaccessrolebinding_test.go | 327 -- .../method_rolebindingscreateorupdate.go | 58 - .../method_rolebindingsdelete.go | 47 - .../trustedaccess/method_rolebindingsget.go | 54 - .../trustedaccess/method_rolebindingslist.go | 92 - .../trustedaccess/method_roleslist.go | 91 - .../trustedaccess/model_trustedaccessrole.go | 10 - .../model_trustedaccessrolebinding.go | 16 - ...odel_trustedaccessrolebindingproperties.go | 10 - .../model_trustedaccessrolerule.go | 12 - .../trustedaccess/predicates.go | 45 - .../trustedaccess/version.go | 12 - .../2023-04-02-preview/agentpools/README.md | 139 - .../2023-04-02-preview/agentpools/client.go | 26 - .../agentpools/constants.go | 567 ---- .../agentpools/id_agentpool.go | 139 - .../agentpools/id_agentpool_test.go | 327 -- .../agentpools/method_abortlatestoperation.go | 70 - .../agentpools/method_createorupdate.go | 75 - .../agentpools/method_delete.go | 98 - .../agentpools/method_get.go | 54 - .../method_getavailableagentpoolversions.go | 56 - .../agentpools/method_getupgradeprofile.go | 55 - .../agentpools/method_list.go | 92 - .../method_upgradenodeimageversion.go | 71 - .../agentpools/model_agentpool.go | 11 - .../model_agentpoolavailableversions.go | 11 - ...el_agentpoolavailableversionsproperties.go | 8 - ...sionspropertiesagentpoolversionsinlined.go | 10 - .../model_agentpoolnetworkprofile.go | 10 - .../model_agentpoolupgradeprofile.go | 11 - ...model_agentpoolupgradeprofileproperties.go | 11 - ...upgradeprofilepropertiesupgradesinlined.go | 9 - .../model_agentpoolupgradesettings.go | 8 - .../model_agentpoolwindowsprofile.go | 8 - .../agentpools/model_creationdata.go | 8 - .../agentpools/model_iptag.go | 9 - .../agentpools/model_kubeletconfig.go | 18 - .../agentpools/model_linuxosconfig.go | 11 - ...anagedclusteragentpoolprofileproperties.go | 57 - .../agentpools/model_portrange.go | 10 - .../agentpools/model_powerstate.go | 8 - .../agentpools/model_sysctlconfig.go | 35 - .../agentpools/predicates.go | 27 - .../2023-04-02-preview/agentpools/version.go | 12 - .../2023-04-02-preview/client.go | 100 - .../maintenanceconfigurations/README.md | 91 - .../maintenanceconfigurations/client.go | 26 - .../maintenanceconfigurations/constants.go | 116 - .../id_maintenanceconfiguration.go | 139 - .../id_maintenanceconfiguration_test.go | 327 -- .../method_createorupdate.go | 58 - .../method_delete.go | 47 - .../maintenanceconfigurations/method_get.go | 54 - .../method_listbymanagedcluster.go | 92 - .../model_absolutemonthlyschedule.go | 9 - .../model_dailyschedule.go | 8 - .../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 | 27 - .../maintenanceconfigurations/version.go | 12 - .../managedclusters/README.md | 373 --- .../managedclusters/client.go | 26 - .../managedclusters/constants.go | 1807 ----------- .../managedclusters/id_accessprofile.go | 139 - .../managedclusters/id_accessprofile_test.go | 327 -- .../managedclusters/id_commandresult.go | 139 - .../managedclusters/id_commandresult_test.go | 327 -- .../managedclusters/id_location.go | 121 - .../managedclusters/id_location_test.go | 237 -- .../method_abortlatestoperation.go | 71 - .../managedclusters/method_createorupdate.go | 76 - .../managedclusters/method_delete.go | 99 - .../managedclusters/method_get.go | 55 - .../method_getaccessprofile.go | 55 - .../method_getcommandresult.go | 55 - .../managedclusters/method_getosoptions.go | 83 - .../method_getupgradeprofile.go | 56 - .../managedclusters/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_listclusteradmincredentials.go | 84 - ...od_listclustermonitoringusercredentials.go | 84 - .../method_listclusterusercredentials.go | 88 - .../method_listkubernetesversions.go | 55 - ...istoutboundnetworkdependenciesendpoints.go | 92 - .../managedclusters/method_resetaadprofile.go | 75 - .../method_resetserviceprincipalprofile.go | 75 - .../method_rotateclustercertificates.go | 71 - .../method_rotateserviceaccountsigningkeys.go | 71 - .../managedclusters/method_runcommand.go | 76 - .../managedclusters/method_start.go | 71 - .../managedclusters/method_stop.go | 71 - .../managedclusters/method_updatetags.go | 75 - .../managedclusters/model_accessprofile.go | 8 - .../model_agentpoolnetworkprofile.go | 10 - .../model_agentpoolupgradesettings.go | 8 - .../model_agentpoolwindowsprofile.go | 8 - .../managedclusters/model_azurekeyvaultkms.go | 11 - .../model_clusterupgradesettings.go | 8 - .../model_commandresultproperties.go | 43 - .../model_containerservicelinuxprofile.go | 9 - .../model_containerservicenetworkprofile.go | 23 - ...nerservicenetworkprofilekubeproxyconfig.go | 10 - ...networkprofilekubeproxyconfigipvsconfig.go | 11 - .../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 - .../model_guardrailsprofile.go | 11 - .../managedclusters/model_iptag.go | 9 - .../managedclusters/model_istiocomponents.go | 8 - .../model_istioingressgateway.go | 9 - .../managedclusters/model_istioservicemesh.go | 8 - .../managedclusters/model_kubeletconfig.go | 18 - .../model_kubernetespatchversion.go | 8 - .../model_kubernetesversion.go | 11 - .../model_kubernetesversioncapabilities.go | 8 - .../model_kubernetesversionlistresult.go | 8 - .../managedclusters/model_linuxosconfig.go | 11 - .../managedclusters/model_managedcluster.go | 23 - .../model_managedclusteraadprofile.go | 14 - .../model_managedclusteraccessprofile.go | 18 - .../model_managedclusteraddonprofile.go | 10 - .../model_managedclusteragentpoolprofile.go | 58 - ...el_managedclusterapiserveraccessprofile.go | 14 - .../model_managedclusterautoupgradeprofile.go | 9 - ...model_managedclusterazuremonitorprofile.go | 8 - ...sterazuremonitorprofilekubestatemetrics.go | 9 - ...anagedclusterazuremonitorprofilemetrics.go | 9 - .../model_managedclusterhttpproxyconfig.go | 12 - .../model_managedclusteringressprofile.go | 8 - ...nagedclusteringressprofilewebapprouting.go | 10 - ...model_managedclusterloadbalancerprofile.go | 15 - ...erloadbalancerprofilemanagedoutboundips.go | 9 - ...erloadbalancerprofileoutboundipprefixes.go | 8 - ...edclusterloadbalancerprofileoutboundips.go | 8 - ..._managedclustermanagedoutboundipprofile.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 | 50 - ...nagedclusterpropertiesautoscalerprofile.go | 24 - .../model_managedclustersecurityprofile.go | 13 - ...l_managedclustersecurityprofiledefender.go | 9 - ...curityprofiledefendersecuritymonitoring.go | 8 - ...nagedclustersecurityprofileimagecleaner.go | 9 - ...edclustersecurityprofilenoderestriction.go | 8 - ...dclustersecurityprofileworkloadidentity.go | 8 - ...l_managedclusterserviceprincipalprofile.go | 9 - .../model_managedclustersku.go | 9 - .../model_managedclusterstorageprofile.go | 11 - ...nagedclusterstorageprofileblobcsidriver.go | 8 - ...nagedclusterstorageprofilediskcsidriver.go | 9 - ...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 | 10 - .../managedclusters/model_osoptionprofile.go | 11 - .../managedclusters/model_osoptionproperty.go | 9 - .../model_osoptionpropertylist.go | 8 - .../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 | 10 - .../model_windowsgmsaprofile.go | 10 - .../managedclusters/predicates.go | 45 - .../managedclusters/version.go | 12 - .../managedclustersnapshots/README.md | 129 - .../managedclustersnapshots/client.go | 26 - .../managedclustersnapshots/constants.go | 341 -- .../id_managedclustersnapshot.go | 130 - .../id_managedclustersnapshot_test.go | 282 -- .../method_createorupdate.go | 59 - .../managedclustersnapshots/method_delete.go | 47 - .../managedclustersnapshots/method_get.go | 54 - .../managedclustersnapshots/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_creationdata.go | 8 - ...del_managedclusterpropertiesforsnapshot.go | 11 - .../model_managedclustersku.go | 9 - .../model_managedclustersnapshot.go | 18 - .../model_managedclustersnapshotproperties.go | 10 - .../model_networkprofileforsnapshot.go | 12 - .../model_tagsobject.go | 8 - .../managedclustersnapshots/predicates.go | 32 - .../managedclustersnapshots/version.go | 12 - .../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 | 54 - .../privateendpointconnections/method_list.go | 56 - .../method_update.go | 58 - .../model_privateendpoint.go | 8 - .../model_privateendpointconnection.go | 11 - ...del_privateendpointconnectionlistresult.go | 8 - ...del_privateendpointconnectionproperties.go | 10 - ...model_privatelinkserviceconnectionstate.go | 9 - .../privateendpointconnections/version.go | 12 - .../privatelinkresources/README.md | 37 - .../privatelinkresources/client.go | 26 - .../privatelinkresources/method_list.go | 56 - .../model_privatelinkresource.go | 13 - .../model_privatelinkresourceslistresult.go | 8 - .../privatelinkresources/version.go | 12 - .../resolveprivatelinkserviceid/README.md | 42 - .../resolveprivatelinkserviceid/client.go | 26 - .../method_post.go | 60 - .../model_privatelinkresource.go | 13 - .../resolveprivatelinkserviceid/version.go | 12 - .../2023-04-02-preview/snapshots/README.md | 129 - .../2023-04-02-preview/snapshots/client.go | 26 - .../2023-04-02-preview/snapshots/constants.go | 145 - .../snapshots/id_snapshot.go | 130 - .../snapshots/id_snapshot_test.go | 282 -- .../snapshots/method_createorupdate.go | 59 - .../snapshots/method_delete.go | 47 - .../snapshots/method_get.go | 54 - .../snapshots/method_list.go | 92 - .../snapshots/method_listbyresourcegroup.go | 92 - .../snapshots/method_updatetags.go | 58 - .../snapshots/model_creationdata.go | 8 - .../snapshots/model_snapshot.go | 18 - .../snapshots/model_snapshotproperties.go | 15 - .../snapshots/model_tagsobject.go | 8 - .../snapshots/predicates.go | 32 - .../2023-04-02-preview/snapshots/version.go | 12 - .../trustedaccess/README.md | 108 - .../trustedaccess/client.go | 26 - .../trustedaccess/constants.go | 60 - .../trustedaccess/id_location.go | 121 - .../trustedaccess/id_location_test.go | 237 -- .../id_trustedaccessrolebinding.go | 139 - .../id_trustedaccessrolebinding_test.go | 327 -- .../method_rolebindingscreateorupdate.go | 58 - .../method_rolebindingsdelete.go | 47 - .../trustedaccess/method_rolebindingsget.go | 54 - .../trustedaccess/method_rolebindingslist.go | 92 - .../trustedaccess/method_roleslist.go | 91 - .../trustedaccess/model_trustedaccessrole.go | 10 - .../model_trustedaccessrolebinding.go | 16 - ...odel_trustedaccessrolebindingproperties.go | 10 - .../model_trustedaccessrolerule.go | 12 - .../trustedaccess/predicates.go | 45 - .../trustedaccess/version.go | 12 - .../2018-06-01/linkedservices/constants.go | 223 ++ ...forsqlserverlinkedservicetypeproperties.go | 50 +- ...esqldatabaselinkedservicetypeproperties.go | 71 +- ...l_azuresqldwlinkedservicetypeproperties.go | 69 +- ...l_azuresqlmilinkedservicetypeproperties.go | 71 +- ...el_sqlserverlinkedservicetypeproperties.go | 50 +- .../2018-06-01-preview/applications/README.md | 83 - .../2018-06-01-preview/applications/client.go | 26 - .../applications/constants.go | 66 - .../applications/id_application.go | 139 - .../applications/id_application_test.go | 327 -- .../applications/method_create.go | 74 - .../applications/method_delete.go | 71 - .../applications/method_get.go | 54 - .../applications/method_listbycluster.go | 92 - .../applications/model_application.go | 13 - .../model_applicationgetendpoint.go | 11 - .../model_applicationgethttpsendpoint.go | 14 - .../model_applicationproperties.go | 18 - .../applications/model_autoscale.go | 9 - .../applications/model_autoscalecapacity.go | 9 - .../applications/model_autoscalerecurrence.go | 9 - .../applications/model_autoscaleschedule.go | 9 - .../model_autoscaletimeandcapacity.go | 10 - .../applications/model_computeprofile.go | 8 - .../applications/model_datadisksgroups.go | 10 - .../applications/model_errors.go | 9 - .../applications/model_hardwareprofile.go | 8 - .../model_linuxoperatingsystemprofile.go | 10 - .../applications/model_osprofile.go | 8 - .../applications/model_role.go | 18 - .../applications/model_runtimescriptaction.go | 12 - .../applications/model_scriptaction.go | 10 - .../applications/model_sshprofile.go | 8 - .../applications/model_sshpublickey.go | 8 - .../model_virtualnetworkprofile.go | 9 - .../applications/predicates.go | 32 - .../applications/version.go | 12 - .../hdinsight/2018-06-01-preview/client.go | 100 - .../2018-06-01-preview/clusters/README.md | 239 -- .../2018-06-01-preview/clusters/client.go | 26 - .../2018-06-01-preview/clusters/constants.go | 412 --- .../clusters/method_create.go | 75 - .../clusters/method_delete.go | 72 - .../clusters/method_executescriptactions.go | 75 - .../2018-06-01-preview/clusters/method_get.go | 55 - .../clusters/method_getgatewaysettings.go | 56 - .../clusters/method_list.go | 92 - .../clusters/method_listbyresourcegroup.go | 92 - .../clusters/method_resize.go | 75 - .../method_rotatediskencryptionkey.go | 75 - .../clusters/method_update.go | 59 - .../method_updateautoscaleconfiguration.go | 75 - .../clusters/method_updategatewaysettings.go | 75 - .../method_updateidentitycertificate.go | 75 - .../clusters/model_autoscale.go | 9 - .../clusters/model_autoscalecapacity.go | 9 - ...l_autoscaleconfigurationupdateparameter.go | 8 - .../clusters/model_autoscalerecurrence.go | 9 - .../clusters/model_autoscaleschedule.go | 9 - .../model_autoscaletimeandcapacity.go | 10 - .../clusters/model_clientgroupinfo.go | 9 - .../clusters/model_cluster.go | 19 - .../model_clustercreateparametersextended.go | 15 - .../clusters/model_clustercreateproperties.go | 20 - .../clusters/model_clusterdefinition.go | 11 - .../model_clusterdiskencryptionparameters.go | 10 - .../clusters/model_clustergetproperties.go | 29 - .../clusters/model_clusterpatchparameters.go | 8 - .../clusters/model_clusterresizeparameters.go | 8 - .../model_computeisolationproperties.go | 9 - .../clusters/model_computeprofile.go | 8 - .../clusters/model_connectivityendpoint.go | 12 - .../clusters/model_datadisksgroups.go | 10 - .../model_diskencryptionproperties.go | 13 - .../model_encryptionintransitproperties.go | 8 - .../clusters/model_errors.go | 9 - .../clusters/model_excludedservicesconfig.go | 9 - .../model_executescriptactionparameters.go | 9 - .../clusters/model_gatewaysettings.go | 10 - .../clusters/model_hardwareprofile.go | 8 - .../clusters/model_kafkarestproperties.go | 9 - .../model_linuxoperatingsystemprofile.go | 10 - .../clusters/model_networkproperties.go | 9 - .../clusters/model_osprofile.go | 8 - .../clusters/model_quotainfo.go | 8 - .../2018-06-01-preview/clusters/model_role.go | 18 - .../clusters/model_runtimescriptaction.go | 12 - .../clusters/model_scriptaction.go | 10 - .../clusters/model_securityprofile.go | 16 - .../clusters/model_sshprofile.go | 8 - .../clusters/model_sshpublickey.go | 8 - .../clusters/model_storageaccount.go | 16 - .../clusters/model_storageprofile.go | 8 - ...ateclusteridentitycertificateparameters.go | 10 - .../model_updategatewaysettingsparameters.go | 10 - .../clusters/model_virtualnetworkprofile.go | 9 - .../2018-06-01-preview/clusters/predicates.go | 37 - .../2018-06-01-preview/clusters/version.go | 12 - .../configurations/README.md | 66 - .../configurations/client.go | 26 - .../configurations/id_configuration.go | 139 - .../configurations/id_configuration_test.go | 327 -- .../configurations/method_get.go | 54 - .../configurations/method_list.go | 56 - .../configurations/method_update.go | 75 - .../model_clusterconfigurations.go | 8 - .../configurations/version.go | 12 - .../2018-06-01-preview/extensions/README.md | 156 - .../2018-06-01-preview/extensions/client.go | 26 - .../extensions/id_extension.go | 139 - .../extensions/id_extension_test.go | 327 -- .../extensions/method_create.go | 74 - .../extensions/method_delete.go | 71 - .../extensions/method_disableazuremonitor.go | 72 - .../extensions/method_disablemonitoring.go | 72 - .../extensions/method_enableazuremonitor.go | 75 - .../extensions/method_enablemonitoring.go | 75 - .../extensions/method_get.go | 54 - .../method_getazuremonitorstatus.go | 56 - .../extensions/method_getmonitoringstatus.go | 56 - .../extensions/model_azuremonitorrequest.go | 10 - .../extensions/model_azuremonitorresponse.go | 10 - ...odel_azuremonitorselectedconfigurations.go | 10 - .../model_azuremonitortableconfiguration.go | 8 - .../model_clustermonitoringrequest.go | 9 - .../model_clustermonitoringresponse.go | 9 - .../extensions/model_extension.go | 9 - .../2018-06-01-preview/extensions/version.go | 12 - .../2018-06-01-preview/promote/client.go | 26 - .../promote/id_scriptexecutionhistory.go | 139 - .../promote/id_scriptexecutionhistory_test.go | 327 -- .../method_scriptexecutionhistorypromote.go | 47 - .../2018-06-01-preview/promote/version.go | 12 - .../2018-06-01-preview/regions/README.md | 110 - .../2018-06-01-preview/regions/client.go | 26 - .../2018-06-01-preview/regions/constants.go | 359 --- .../2018-06-01-preview/regions/id_location.go | 121 - .../regions/id_location_test.go | 237 -- .../method_locationsgetcapabilities.go | 55 - .../method_locationslistbillingspecs.go | 55 - .../regions/method_locationslistusages.go | 55 - ...d_locationsvalidateclustercreaterequest.go | 59 - .../regions/model_aaddsresourcedetails.go | 14 - .../regions/model_autoscale.go | 9 - .../regions/model_autoscalecapacity.go | 9 - .../regions/model_autoscalerecurrence.go | 9 - .../regions/model_autoscaleschedule.go | 9 - .../regions/model_autoscaletimeandcapacity.go | 10 - .../regions/model_billingmeters.go | 10 - .../regions/model_billingresources.go | 10 - .../model_billingresponselistresult.go | 12 - .../regions/model_capabilitiesresult.go | 13 - .../regions/model_clientgroupinfo.go | 9 - .../regions/model_clustercreateproperties.go | 20 - ...lustercreaterequestvalidationparameters.go | 19 - .../model_clustercreatevalidationresult.go | 11 - .../regions/model_clusterdefinition.go | 11 - .../model_computeisolationproperties.go | 9 - .../regions/model_computeprofile.go | 8 - .../regions/model_datadisksgroups.go | 10 - .../regions/model_diskbillingmeters.go | 10 - .../regions/model_diskencryptionproperties.go | 13 - .../model_encryptionintransitproperties.go | 8 - .../regions/model_hardwareprofile.go | 8 - .../regions/model_kafkarestproperties.go | 9 - .../model_linuxoperatingsystemprofile.go | 10 - .../regions/model_localizedname.go | 9 - ..._nameavailabilitycheckrequestparameters.go | 9 - .../model_nameavailabilitycheckresult.go | 10 - .../regions/model_networkproperties.go | 9 - .../regions/model_osprofile.go | 8 - .../regions/model_quotacapability.go | 10 - .../regions/model_regionalquotacapability.go | 10 - .../regions/model_regionscapability.go | 8 - .../2018-06-01-preview/regions/model_role.go | 18 - .../regions/model_scriptaction.go | 10 - .../regions/model_securityprofile.go | 16 - .../regions/model_sshprofile.go | 8 - .../regions/model_sshpublickey.go | 8 - .../regions/model_storageaccount.go | 16 - .../regions/model_storageprofile.go | 8 - .../2018-06-01-preview/regions/model_usage.go | 11 - .../regions/model_usageslistresult.go | 8 - .../regions/model_validationerrorinfo.go | 11 - .../regions/model_versionscapability.go | 8 - .../regions/model_versionspec.go | 11 - .../regions/model_virtualnetworkprofile.go | 9 - .../model_vmsizecompatibilityfilter.go | 16 - .../model_vmsizecompatibilityfilterv2.go | 14 - .../regions/model_vmsizeproperty.go | 17 - .../regions/model_vmsizescapability.go | 8 - .../2018-06-01-preview/regions/version.go | 12 - .../scriptactions/README.md | 54 - .../scriptactions/client.go | 26 - .../scriptactions/id_scriptaction.go | 139 - .../scriptactions/id_scriptaction_test.go | 327 -- .../scriptactions/method_delete.go | 47 - .../scriptactions/method_listbycluster.go | 92 - .../model_runtimescriptactiondetail.go | 12 - .../scriptactions/predicates.go | 32 - .../scriptactions/version.go | 12 - .../scriptexecutionhistory/README.md | 54 - .../scriptexecutionhistory/client.go | 26 - .../id_scriptexecutionhistory.go | 139 - .../id_scriptexecutionhistory_test.go | 327 -- .../method_listbycluster.go | 92 - .../method_scriptactionsgetexecutiondetail.go | 54 - .../model_runtimescriptactiondetail.go | 12 - .../scriptexecutionhistory/predicates.go | 32 - .../scriptexecutionhistory/version.go | 12 - .../virtualmachines/README.md | 50 - .../virtualmachines/client.go | 26 - .../virtualmachines/method_listhosts.go | 56 - .../virtualmachines/method_restarthosts.go | 75 - .../virtualmachines/model_hostinfo.go | 10 - .../virtualmachines/version.go | 12 - .../hdinsight/2024-05-01/client.go | 28 + .../hdinsight/2024-05-01/hdinsights/README.md | 505 +++ .../hdinsight/2024-05-01/hdinsights/client.go | 26 + .../2024-05-01/hdinsights/constants.go | 1471 +++++++++ .../2024-05-01/hdinsights/id_cluster.go | 139 + .../2024-05-01/hdinsights/id_cluster_test.go | 327 ++ .../2024-05-01/hdinsights/id_clusterpool.go | 130 + .../hdinsights/id_clusterpool_test.go | 282 ++ .../2024-05-01/hdinsights/id_location.go | 121 + .../2024-05-01/hdinsights/id_location_test.go | 237 ++ ...ilableclusterpoolversionslistbylocation.go | 91 + ..._availableclusterversionslistbylocation.go | 91 + .../method_clusteravailableupgradeslist.go | 91 + .../hdinsights/method_clusterjobslist.go | 119 + .../hdinsights/method_clusterjobsrunjob.go | 75 + .../hdinsights/method_clusterlibrarieslist.go | 119 + .../method_clusterlibrariesmanagelibraries.go | 73 + ...method_clusterpoolavailableupgradeslist.go | 91 + .../method_clusterpoolscreateorupdate.go | 75 + .../hdinsights/method_clusterpoolsdelete.go | 71 + .../hdinsights/method_clusterpoolsget.go | 54 + .../method_clusterpoolslistbyresourcegroup.go | 92 + .../method_clusterpoolslistbysubscription.go | 92 + .../method_clusterpoolsupdatetags.go | 75 + .../hdinsights/method_clusterpoolsupgrade.go | 75 + .../method_clusterpoolupgradehistorieslist.go | 91 + .../hdinsights/method_clusterscreate.go | 75 + .../hdinsights/method_clustersdelete.go | 71 + .../hdinsights/method_clustersget.go | 54 + .../method_clustersgetinstanceview.go | 55 + .../method_clusterslistbyclusterpoolname.go | 91 + .../method_clusterslistinstanceviews.go | 91 + .../method_clusterslistserviceconfigs.go | 91 + .../hdinsights/method_clustersresize.go | 75 + .../hdinsights/method_clustersupdate.go | 75 + .../hdinsights/method_clustersupgrade.go | 75 + .../method_clustersupgrademanualrollback.go | 75 + .../method_clusterupgradehistorieslist.go | 91 + .../method_locationschecknameavailability.go | 8 +- .../hdinsights/model_aksclusterprofile.go | 10 + .../hdinsights/model_authorizationprofile.go | 9 + .../hdinsights/model_autoscaleprofile.go | 12 + .../hdinsights/model_catalogoptions.go | 8 + .../2024-05-01/hdinsights/model_cluster.go | 18 + .../hdinsights/model_clusteraccessprofile.go | 9 + ...clusterakspatchupgradehistoryproperties.go | 44 + ...clusterakspatchversionupgradeproperties.go | 40 + .../model_clusteravailableupgrade.go | 48 + ...ailableupgradeakspatchupgradeproperties.go | 43 + ...availableupgradehotfixupgradeproperties.go | 51 + ...bleupgradepatchversionupgradeproperties.go | 51 + ...model_clusteravailableupgradeproperties.go | 69 + ...odel_clustercomponentscomponentsinlined.go | 9 + .../hdinsights/model_clusterconfigfile.go | 12 + ...l_clusterhotfixupgradehistoryproperties.go | 50 + .../model_clusterhotfixupgradeproperties.go | 44 + ...rhotfixupgraderollbackhistoryproperties.go | 50 + .../model_clusterinstanceviewproperties.go | 9 + .../model_clusterinstanceviewresult.go | 9 + .../model_clusterinstanceviewstatus.go | 10 + .../2024-05-01/hdinsights/model_clusterjob.go | 48 + .../hdinsights/model_clusterjobproperties.go | 53 + .../hdinsights/model_clusterlibrary.go | 48 + ...model_clusterlibrarymanagementoperation.go | 16 + ...terlibrarymanagementoperationproperties.go | 9 + .../model_clusterlibraryproperties.go | 61 + ...odel_clusterloganalyticsapplicationlogs.go | 9 + .../model_clusterloganalyticsprofile.go | 10 + .../hdinsights/model_clusterpatch.go | 9 + .../model_clusterpatchproperties.go | 8 + ...terpatchversionupgradehistoryproperties.go | 50 + ...el_clusterpatchversionupgradeproperties.go | 44 + ...versionupgraderollbackhistoryproperties.go | 50 + .../hdinsights/model_clusterpool.go | 18 + ...terpoolakspatchupgradehistoryproperties.go | 46 + ...terpoolakspatchversionupgradeproperties.go | 43 + .../model_clusterpoolavailableupgrade.go | 48 + ...ailableupgradeakspatchupgradeproperties.go | 43 + ...availableupgradenodeosupgradeproperties.go | 41 + ...l_clusterpoolavailableupgradeproperties.go | 61 + .../model_clusterpoolcomputeprofile.go | 9 + .../model_clusterpoolloganalyticsprofile.go | 9 + .../model_clusterpoolnetworkprofile.go | 11 + ..._clusterpoolnodeosimageupdateproperties.go | 40 + ...usterpoolnodeosupgradehistoryproperties.go | 43 + .../hdinsights/model_clusterpoolprofile.go | 8 + .../model_clusterpoolresourceproperties.go | 17 + .../hdinsights/model_clusterpoolupgrade.go | 32 + .../model_clusterpoolupgradehistory.go | 48 + ...del_clusterpoolupgradehistoryproperties.go | 61 + .../model_clusterpoolupgradeproperties.go | 61 + .../hdinsights/model_clusterpoolversion.go | 16 + .../model_clusterpoolversionproperties.go | 10 + .../hdinsights/model_clusterprofile.go | 30 + .../model_clusterprometheusprofile.go | 8 + .../model_clusterrangerpluginprofile.go | 8 + .../hdinsights/model_clusterresizedata.go | 18 + .../model_clusterresizeproperties.go | 8 + .../model_clusterresourceproperties.go | 13 + .../hdinsights/model_clusterserviceconfig.go | 9 + .../model_clusterserviceconfigsprofile.go | 9 + .../hdinsights/model_clusterupgrade.go | 32 + .../hdinsights/model_clusterupgradehistory.go | 48 + .../model_clusterupgradehistoryproperties.go | 85 + .../model_clusterupgradeproperties.go | 69 + .../model_clusterupgraderollback.go | 8 + .../model_clusterupgraderollbackproperties.go | 8 + .../hdinsights/model_clusterversion.go | 16 + .../model_clusterversionproperties.go | 13 + .../hdinsights/model_comparisonrule.go | 9 + .../hdinsights/model_computeprofile.go | 8 + .../model_computeresourcedefinition.go | 9 + .../hdinsights/model_connectivityprofile.go | 9 + .../hdinsights/model_diskstorageprofile.go | 9 + .../hdinsights/model_flinkcatalogoptions.go | 8 + .../model_flinkhivecatalogoption.go | 11 + .../hdinsights/model_flinkjobprofile.go | 13 + .../hdinsights/model_flinkjobproperties.go | 54 + .../hdinsights/model_flinkprofile.go | 15 + .../hdinsights/model_flinkstorageprofile.go | 9 + .../hdinsights/model_hivecatalogoption.go | 13 + .../hdinsights/model_identityprofile.go | 10 + .../model_kafkaconnectivityendpoints.go | 9 + .../hdinsights/model_kafkaprofile.go | 12 + .../hdinsights/model_loadbasedconfig.go | 12 + .../model_managedidentityprofile.go | 8 + .../hdinsights/model_managedidentityspec.go | 11 + .../model_mavenlibraryproperties.go | 62 + .../model_nameavailabilityparameters.go | 9 + .../model_nameavailabilityresult.go | 10 + .../hdinsights/model_nodeprofile.go | 10 + .../hdinsights/model_pypilibraryproperties.go | 61 + .../hdinsights/model_rangeradminspec.go | 9 + .../model_rangeradminspecdatabase.go | 11 + .../hdinsights/model_rangerauditspec.go | 8 + .../hdinsights/model_rangerprofile.go | 10 + .../hdinsights/model_rangerusersyncspec.go | 12 + .../hdinsights/model_scalingrule.go | 11 + .../2024-05-01/hdinsights/model_schedule.go | 11 + .../hdinsights/model_schedulebasedconfig.go | 10 + .../hdinsights/model_scriptactionprofile.go | 14 + .../hdinsights/model_secretreference.go | 11 + .../hdinsights/model_secretsprofile.go | 9 + ...model_serviceconfiglistresultproperties.go | 15 + ...odel_serviceconfiglistresultvalueentity.go | 9 + .../hdinsights/model_serviceconfigresult.go | 8 + .../hdinsights/model_servicestatus.go | 10 + .../hdinsights/model_sparkmetastorespec.go | 14 + .../hdinsights/model_sparkprofile.go | 10 + .../hdinsights/model_sparkuserplugin.go | 8 + .../hdinsights/model_sparkuserplugins.go | 8 + .../model_sshconnectivityendpoint.go | 9 + .../2024-05-01/hdinsights/model_sshprofile.go | 10 + .../2024-05-01/hdinsights/model_tagsobject.go | 8 + .../hdinsights/model_trinocoordinator.go | 9 + .../hdinsights/model_trinodebugconfig.go | 10 + .../hdinsights/model_trinoprofile.go | 12 + .../hdinsights/model_trinotelemetryconfig.go | 11 + .../hdinsights/model_trinouserplugin.go | 10 + .../hdinsights/model_trinouserplugins.go | 8 + .../hdinsights/model_trinousertelemetry.go | 8 + .../hdinsights/model_trinoworker.go | 8 + .../model_updatableclusterprofile.go | 18 + .../model_webconnectivityendpoint.go | 9 + .../2024-05-01/hdinsights/predicates.go | 265 ++ .../2024-05-01/hdinsights/version.go | 12 + .../insights/2021-04-01/client.go | 46 - .../datacollectionendpoints/README.md | 129 - .../datacollectionendpoints/client.go | 26 - .../datacollectionendpoints/constants.go | 142 - .../id_datacollectionendpoint.go | 130 - .../id_datacollectionendpoint_test.go | 282 -- .../datacollectionendpoints/method_create.go | 59 - .../datacollectionendpoints/method_delete.go | 47 - .../datacollectionendpoints/method_get.go | 54 - .../method_listbyresourcegroup.go | 92 - .../method_listbysubscription.go | 92 - .../datacollectionendpoints/method_update.go | 58 - .../model_configurationaccessendpointspec.go | 8 - .../model_datacollectionendpoint.go | 13 - .../model_datacollectionendpointresource.go | 20 - .../model_logsingestionendpointspec.go | 8 - .../model_networkruleset.go | 8 - .../model_resourceforupdate.go | 8 - .../datacollectionendpoints/predicates.go | 37 - .../datacollectionendpoints/version.go | 12 - .../datacollectionruleassociations/README.md | 108 - .../datacollectionruleassociations/client.go | 26 - .../constants.go | 60 - .../id_datacollectionrule.go | 130 - .../id_datacollectionrule_test.go | 282 -- .../id_scopeddatacollectionruleassociation.go | 120 - ...copeddatacollectionruleassociation_test.go | 222 -- .../method_create.go | 59 - .../method_delete.go | 47 - .../method_get.go | 54 - .../method_listbyresource.go | 92 - .../method_listbyrule.go | 91 - .../model_datacollectionruleassociation.go | 11 - ...lectionruleassociationproxyonlyresource.go | 17 - .../predicates.go | 32 - .../datacollectionruleassociations/version.go | 12 - .../2021-04-01/datacollectionrules/README.md | 129 - .../2021-04-01/datacollectionrules/client.go | 26 - .../datacollectionrules/constants.go | 499 --- .../id_datacollectionrule.go | 130 - .../id_datacollectionrule_test.go | 282 -- .../datacollectionrules/method_create.go | 59 - .../datacollectionrules/method_delete.go | 47 - .../datacollectionrules/method_get.go | 54 - .../method_listbyresourcegroup.go | 92 - .../method_listbysubscription.go | 92 - .../datacollectionrules/method_update.go | 58 - .../model_azuremonitormetricsdestination.go | 8 - .../model_datacollectionrule.go | 13 - .../model_datacollectionruleresource.go | 20 - .../datacollectionrules/model_dataflow.go | 9 - .../model_datasourcesspec.go | 11 - .../model_destinationsspec.go | 9 - .../model_extensiondatasource.go | 12 - .../model_loganalyticsdestination.go | 10 - .../model_perfcounterdatasource.go | 11 - .../model_resourceforupdate.go | 8 - .../model_syslogdatasource.go | 11 - .../model_windowseventlogdatasource.go | 10 - .../datacollectionrules/predicates.go | 37 - .../2021-04-01/datacollectionrules/version.go | 12 - .../insights/2021-07-01-preview/client.go | 55 - .../privateendpointconnections/README.md | 81 - .../privateendpointconnections/client.go | 26 - .../privateendpointconnections/constants.go | 101 - .../id_privateendpointconnection.go | 139 - .../id_privateendpointconnection_test.go | 327 -- .../id_privatelinkscope.go | 130 - .../id_privatelinkscope_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../privateendpointconnections/method_get.go | 54 - .../method_listbyprivatelinkscope.go | 55 - .../model_privateendpoint.go | 8 - .../model_privateendpointconnection.go | 11 - ...del_privateendpointconnectionlistresult.go | 8 - ...del_privateendpointconnectionproperties.go | 10 - ...model_privatelinkserviceconnectionstate.go | 10 - .../privateendpointconnections/version.go | 12 - .../privatelinkresources/README.md | 52 - .../privatelinkresources/client.go | 26 - .../id_privatelinkresource.go | 139 - .../id_privatelinkresource_test.go | 327 -- .../id_privatelinkscope.go | 130 - .../id_privatelinkscope_test.go | 282 -- .../privatelinkresources/method_get.go | 54 - .../method_listbyprivatelinkscope.go | 55 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourcelistresult.go | 8 - .../model_privatelinkresourceproperties.go | 10 - .../privatelinkresources/version.go | 12 - .../privatelinkscopedresources/README.md | 82 - .../privatelinkscopedresources/client.go | 26 - .../id_privatelinkscope.go | 130 - .../id_privatelinkscope_test.go | 282 -- .../id_scopedresource.go | 139 - .../id_scopedresource_test.go | 327 -- .../method_createorupdate.go | 76 - .../method_delete.go | 71 - .../privatelinkscopedresources/method_get.go | 54 - .../method_listbyprivatelinkscope.go | 91 - .../model_scopedresource.go | 16 - .../model_scopedresourceproperties.go | 9 - .../privatelinkscopedresources/predicates.go | 27 - .../privatelinkscopedresources/version.go | 12 - .../privatelinkscopesapis/README.md | 125 - .../privatelinkscopesapis/client.go | 26 - .../privatelinkscopesapis/constants.go | 142 - .../id_privatelinkscope.go | 130 - .../id_privatelinkscope_test.go | 282 -- .../method_privatelinkscopescreateorupdate.go | 59 - .../method_privatelinkscopesdelete.go | 71 - .../method_privatelinkscopesget.go | 54 - .../method_privatelinkscopeslist.go | 92 - ...od_privatelinkscopeslistbyresourcegroup.go | 92 - .../method_privatelinkscopesupdatetags.go | 58 - .../model_accessmodesettings.go | 10 - .../model_accessmodesettingsexclusion.go | 10 - .../model_azuremonitorprivatelinkscope.go | 18 - ..._azuremonitorprivatelinkscopeproperties.go | 10 - .../model_privateendpoint.go | 8 - .../model_privateendpointconnection.go | 11 - ...del_privateendpointconnectionproperties.go | 10 - ...model_privatelinkserviceconnectionstate.go | 10 - .../model_tagsresource.go | 8 - .../privatelinkscopesapis/predicates.go | 32 - .../privatelinkscopesapis/version.go | 12 - .../2022-03-01/client.go | 73 - .../2022-03-01/clusterextensions/README.md | 100 - .../2022-03-01/clusterextensions/client.go | 26 - .../2022-03-01/clusterextensions/constants.go | 148 - .../clusterextensions/id_scopedextension.go | 120 - .../id_scopedextension_test.go | 222 -- .../method_extensionscreate.go | 75 - .../method_extensionsdelete.go | 99 - .../clusterextensions/method_extensionsget.go | 54 - .../method_extensionslist.go | 92 - .../method_extensionsupdate.go | 75 - .../model_erroradditionalinfo.go | 9 - .../clusterextensions/model_errordetail.go | 12 - .../clusterextensions/model_extension.go | 18 - .../model_extensionproperties.go | 21 - ..._extensionpropertiesaksassignedidentity.go | 10 - .../model_extensionstatus.go | 12 - .../clusterextensions/model_patchextension.go | 8 - .../model_patchextensionproperties.go | 12 - .../clusterextensions/model_scope.go | 9 - .../clusterextensions/model_scopecluster.go | 8 - .../clusterextensions/model_scopenamespace.go | 8 - .../clusterextensions/predicates.go | 27 - .../2022-03-01/clusterextensions/version.go | 12 - .../2022-03-01/extensions/README.md | 100 - .../2022-03-01/extensions/client.go | 26 - .../2022-03-01/extensions/constants.go | 148 - .../extensions/id_scopedextension.go | 120 - .../extensions/id_scopedextension_test.go | 222 -- .../2022-03-01/extensions/method_create.go | 75 - .../2022-03-01/extensions/method_delete.go | 99 - .../2022-03-01/extensions/method_get.go | 54 - .../2022-03-01/extensions/method_list.go | 92 - .../2022-03-01/extensions/method_update.go | 75 - .../extensions/model_erroradditionalinfo.go | 9 - .../extensions/model_errordetail.go | 12 - .../2022-03-01/extensions/model_extension.go | 18 - .../extensions/model_extensionproperties.go | 21 - ..._extensionpropertiesaksassignedidentity.go | 10 - .../extensions/model_extensionstatus.go | 12 - .../extensions/model_patchextension.go | 8 - .../model_patchextensionproperties.go | 12 - .../2022-03-01/extensions/model_scope.go | 9 - .../extensions/model_scopecluster.go | 8 - .../extensions/model_scopenamespace.go | 8 - .../2022-03-01/extensions/predicates.go | 27 - .../2022-03-01/extensions/version.go | 12 - .../2022-03-01/flux/README.md | 100 - .../2022-03-01/flux/client.go | 26 - .../2022-03-01/flux/constants.go | 195 -- .../flux/id_scopedfluxconfiguration.go | 120 - .../flux/id_scopedfluxconfiguration_test.go | 222 -- .../method_configurationscreateorupdate.go | 75 - .../flux/method_configurationsdelete.go | 99 - .../flux/method_configurationsget.go | 54 - .../flux/method_configurationslist.go | 92 - .../flux/method_configurationsupdate.go | 75 - .../2022-03-01/flux/model_bucketdefinition.go | 14 - .../flux/model_bucketpatchdefinition.go | 14 - .../flux/model_fluxconfiguration.go | 16 - .../flux/model_fluxconfigurationpatch.go | 8 - .../model_fluxconfigurationpatchproperties.go | 13 - .../flux/model_fluxconfigurationproperties.go | 53 - .../flux/model_gitrepositorydefinition.go | 15 - .../model_gitrepositorypatchdefinition.go | 15 - .../model_helmreleasepropertiesdefinition.go | 12 - .../flux/model_kustomizationdefinition.go | 15 - .../model_kustomizationpatchdefinition.go | 14 - .../flux/model_objectreferencedefinition.go | 9 - .../model_objectstatusconditiondefinition.go | 30 - .../flux/model_objectstatusdefinition.go | 14 - .../flux/model_repositoryrefdefinition.go | 11 - .../2022-03-01/flux/predicates.go | 27 - .../2022-03-01/flux/version.go | 12 - .../2022-03-01/fluxconfiguration/README.md | 100 - .../2022-03-01/fluxconfiguration/client.go | 26 - .../2022-03-01/fluxconfiguration/constants.go | 195 -- .../id_scopedfluxconfiguration.go | 120 - .../id_scopedfluxconfiguration_test.go | 222 -- .../method_createorupdate.go | 75 - .../fluxconfiguration/method_delete.go | 99 - .../fluxconfiguration/method_get.go | 54 - .../fluxconfiguration/method_list.go | 92 - .../fluxconfiguration/method_update.go | 75 - .../model_bucketdefinition.go | 14 - .../model_bucketpatchdefinition.go | 14 - .../model_fluxconfiguration.go | 16 - .../model_fluxconfigurationpatch.go | 8 - .../model_fluxconfigurationpatchproperties.go | 13 - .../model_fluxconfigurationproperties.go | 53 - .../model_gitrepositorydefinition.go | 15 - .../model_gitrepositorypatchdefinition.go | 15 - .../model_helmreleasepropertiesdefinition.go | 12 - .../model_kustomizationdefinition.go | 15 - .../model_kustomizationpatchdefinition.go | 14 - .../model_objectreferencedefinition.go | 9 - .../model_objectstatusconditiondefinition.go | 30 - .../model_objectstatusdefinition.go | 14 - .../model_repositoryrefdefinition.go | 11 - .../fluxconfiguration/predicates.go | 27 - .../2022-03-01/fluxconfiguration/version.go | 12 - .../2022-03-01/operationsinacluster/README.md | 38 - .../2022-03-01/operationsinacluster/client.go | 26 - .../method_operationstatuslist.go | 92 - .../model_erroradditionalinfo.go | 9 - .../operationsinacluster/model_errordetail.go | 12 - .../model_operationstatusresult.go | 12 - .../operationsinacluster/predicates.go | 27 - .../operationsinacluster/version.go | 12 - .../sourcecontrolconfiguration/README.md | 87 - .../sourcecontrolconfiguration/client.go | 26 - .../sourcecontrolconfiguration/constants.go | 233 -- .../id_scopedsourcecontrolconfiguration.go | 120 - ...d_scopedsourcecontrolconfiguration_test.go | 222 -- .../method_createorupdate.go | 59 - .../method_delete.go | 70 - .../sourcecontrolconfiguration/method_get.go | 54 - .../sourcecontrolconfiguration/method_list.go | 92 - .../model_compliancestatus.go | 29 - .../model_helmoperatorproperties.go | 9 - .../model_sourcecontrolconfiguration.go | 16 - ...el_sourcecontrolconfigurationproperties.go | 20 - .../sourcecontrolconfiguration/predicates.go | 27 - .../sourcecontrolconfiguration/version.go | 12 - .../labservices/2021-10-01-preview/client.go | 73 - .../2021-10-01-preview/image/README.md | 95 - .../2021-10-01-preview/image/client.go | 26 - .../2021-10-01-preview/image/constants.go | 186 -- .../2021-10-01-preview/image/id_image.go | 139 - .../2021-10-01-preview/image/id_image_test.go | 327 -- .../2021-10-01-preview/image/id_labplan.go | 130 - .../image/id_labplan_test.go | 282 -- .../image/method_createorupdate.go | 58 - .../2021-10-01-preview/image/method_get.go | 54 - .../image/method_listbylabplan.go | 91 - .../2021-10-01-preview/image/method_update.go | 58 - .../2021-10-01-preview/image/model_image.go | 16 - .../image/model_imageproperties.go | 23 - .../image/model_imageupdate.go | 8 - .../image/model_imageupdateproperties.go | 8 - .../2021-10-01-preview/image/predicates.go | 27 - .../2021-10-01-preview/image/version.go | 12 - .../2021-10-01-preview/lab/README.md | 141 - .../2021-10-01-preview/lab/client.go | 26 - .../2021-10-01-preview/lab/constants.go | 371 --- .../2021-10-01-preview/lab/id_lab.go | 130 - .../2021-10-01-preview/lab/id_lab_test.go | 282 -- .../lab/method_createorupdate.go | 76 - .../2021-10-01-preview/lab/method_delete.go | 71 - .../2021-10-01-preview/lab/method_get.go | 54 - .../lab/method_listbyresourcegroup.go | 92 - .../lab/method_listbysubscription.go | 92 - .../2021-10-01-preview/lab/method_publish.go | 70 - .../lab/method_syncgroup.go | 70 - .../2021-10-01-preview/lab/method_update.go | 75 - .../lab/model_autoshutdownprofile.go | 13 - .../lab/model_connectionprofile.go | 11 - .../lab/model_credentials.go | 9 - .../lab/model_imagereference.go | 13 - .../2021-10-01-preview/lab/model_lab.go | 18 - .../lab/model_labnetworkprofile.go | 10 - .../lab/model_labproperties.go | 18 - .../2021-10-01-preview/lab/model_labupdate.go | 9 - .../lab/model_labupdateproperties.go | 15 - .../lab/model_rosterprofile.go | 12 - .../lab/model_securityprofile.go | 9 - .../2021-10-01-preview/lab/model_sku.go | 12 - ...el_virtualmachineadditionalcapabilities.go | 8 - .../lab/model_virtualmachineprofile.go | 16 - .../2021-10-01-preview/lab/predicates.go | 32 - .../2021-10-01-preview/lab/version.go | 12 - .../2021-10-01-preview/labplan/README.md | 117 - .../2021-10-01-preview/labplan/client.go | 26 - .../2021-10-01-preview/labplan/constants.go | 192 -- .../2021-10-01-preview/labplan/id_labplan.go | 130 - .../labplan/id_labplan_test.go | 282 -- .../labplan/method_createorupdate.go | 76 - .../labplan/method_delete.go | 71 - .../2021-10-01-preview/labplan/method_get.go | 54 - .../labplan/method_listbyresourcegroup.go | 92 - .../labplan/method_listbysubscription.go | 92 - .../labplan/method_update.go | 75 - .../labplan/model_autoshutdownprofile.go | 13 - .../labplan/model_connectionprofile.go | 11 - .../labplan/model_labplan.go | 18 - .../labplan/model_labplannetworkprofile.go | 8 - .../labplan/model_labplanproperties.go | 15 - .../labplan/model_labplanupdate.go | 9 - .../labplan/model_labplanupdateproperties.go | 14 - .../labplan/model_supportinfo.go | 11 - .../2021-10-01-preview/labplan/predicates.go | 32 - .../2021-10-01-preview/labplan/version.go | 12 - .../2021-10-01-preview/schedule/README.md | 107 - .../2021-10-01-preview/schedule/client.go | 26 - .../2021-10-01-preview/schedule/constants.go | 160 - .../2021-10-01-preview/schedule/id_lab.go | 130 - .../schedule/id_lab_test.go | 282 -- .../schedule/id_schedule.go | 139 - .../schedule/id_schedule_test.go | 327 -- .../schedule/method_createorupdate.go | 59 - .../schedule/method_delete.go | 71 - .../2021-10-01-preview/schedule/method_get.go | 54 - .../schedule/method_listbylab.go | 91 - .../schedule/method_update.go | 58 - .../schedule/model_recurrencepattern.go | 11 - .../schedule/model_schedule.go | 16 - .../schedule/model_scheduleproperties.go | 43 - .../schedule/model_scheduleupdate.go | 8 - .../model_scheduleupdateproperties.go | 42 - .../2021-10-01-preview/schedule/predicates.go | 27 - .../2021-10-01-preview/schedule/version.go | 12 - .../2021-10-01-preview/user/README.md | 116 - .../2021-10-01-preview/user/client.go | 26 - .../2021-10-01-preview/user/constants.go | 151 - .../2021-10-01-preview/user/id_lab.go | 130 - .../2021-10-01-preview/user/id_lab_test.go | 282 -- .../2021-10-01-preview/user/id_user.go | 139 - .../2021-10-01-preview/user/id_user_test.go | 327 -- .../user/method_createorupdate.go | 76 - .../2021-10-01-preview/user/method_delete.go | 71 - .../2021-10-01-preview/user/method_get.go | 54 - .../2021-10-01-preview/user/method_invite.go | 74 - .../user/method_listbylab.go | 91 - .../2021-10-01-preview/user/method_update.go | 75 - .../user/model_invitebody.go | 8 - .../2021-10-01-preview/user/model_user.go | 16 - .../user/model_userproperties.go | 33 - .../user/model_userupdate.go | 8 - .../user/model_userupdateproperties.go | 8 - .../2021-10-01-preview/user/predicates.go | 27 - .../2021-10-01-preview/user/version.go | 12 - .../virtualmachine/README.md | 135 - .../virtualmachine/client.go | 26 - .../virtualmachine/constants.go | 160 - .../virtualmachine/id_lab.go | 130 - .../virtualmachine/id_lab_test.go | 282 -- .../virtualmachine/id_labplan.go | 130 - .../virtualmachine/id_labplan_test.go | 282 -- .../virtualmachine/id_virtualmachine.go | 139 - .../virtualmachine/id_virtualmachine_test.go | 327 -- .../virtualmachine/method_get.go | 54 - .../method_labplanssaveimage.go | 74 - .../virtualmachine/method_listbylab.go | 91 - .../virtualmachine/method_redeploy.go | 70 - .../virtualmachine/method_reimage.go | 70 - .../virtualmachine/method_resetpassword.go | 74 - .../virtualmachine/method_start.go | 70 - .../virtualmachine/method_stop.go | 70 - .../virtualmachine/model_resetpasswordbody.go | 9 - .../virtualmachine/model_saveimagebody.go | 9 - .../virtualmachine/model_virtualmachine.go | 16 - .../model_virtualmachineconnectionprofile.go | 14 - .../model_virtualmachineproperties.go | 12 - .../virtualmachine/predicates.go | 27 - .../virtualmachine/version.go | 12 - .../2022-07-01-preview/applyupdate/README.md | 53 - .../2022-07-01-preview/applyupdate/client.go | 26 - .../applyupdate/constants.go | 60 - .../method_forresourcegrouplist.go | 56 - .../applyupdate/method_list.go | 56 - .../applyupdate/model_applyupdate.go | 16 - .../model_applyupdateproperties.go | 28 - .../applyupdate/model_listapplyupdate.go | 8 - .../2022-07-01-preview/applyupdate/version.go | 12 - .../2022-07-01-preview/applyupdates/README.md | 85 - .../2022-07-01-preview/applyupdates/client.go | 26 - .../applyupdates/constants.go | 60 - .../applyupdates/id_scopedapplyupdate.go | 120 - .../applyupdates/id_scopedapplyupdate_test.go | 222 -- .../applyupdates/method_createorupdate.go | 56 - .../method_createorupdateparent.go | 56 - .../applyupdates/method_get.go | 54 - .../applyupdates/method_getparent.go | 54 - .../applyupdates/model_applyupdate.go | 16 - .../model_applyupdateproperties.go | 28 - .../applyupdates/version.go | 12 - .../maintenance/2022-07-01-preview/client.go | 73 - .../configurationassignments/README.md | 175 - .../configurationassignments/client.go | 26 - .../id_scopedconfigurationassignment.go | 120 - .../id_scopedconfigurationassignment_test.go | 222 -- .../method_createorupdate.go | 58 - .../method_createorupdateparent.go | 58 - .../configurationassignments/method_delete.go | 55 - .../method_deleteparent.go | 55 - .../configurationassignments/method_get.go | 54 - .../method_getparent.go | 54 - .../configurationassignments/method_list.go | 56 - .../method_listparent.go | 56 - .../method_withinsubscriptionlist.go | 56 - .../model_configurationassignment.go | 17 - ...model_configurationassignmentproperties.go | 9 - ...odel_listconfigurationassignmentsresult.go | 8 - .../configurationassignments/version.go | 12 - .../maintenanceconfigurations/README.md | 127 - .../maintenanceconfigurations/client.go | 26 - .../maintenanceconfigurations/constants.go | 192 -- .../id_maintenanceconfiguration.go | 130 - .../id_maintenanceconfiguration_test.go | 282 -- .../method_createorupdate.go | 58 - .../method_delete.go | 55 - .../method_forresourcegrouplist.go | 56 - .../maintenanceconfigurations/method_get.go | 54 - .../maintenanceconfigurations/method_list.go | 56 - .../method_update.go | 58 - .../model_inputlinuxparameters.go | 10 - .../model_inputpatchconfiguration.go | 11 - .../model_inputwindowsparameters.go | 11 - ...del_listmaintenanceconfigurationsresult.go | 8 - .../model_maintenanceconfiguration.go | 18 - ...odel_maintenanceconfigurationproperties.go | 13 - .../model_maintenancewindow.go | 12 - .../model_softwareupdateconfigurationtasks.go | 9 - .../model_taskproperties.go | 10 - .../maintenanceconfigurations/version.go | 12 - .../publicmaintenanceconfigurations/README.md | 53 - .../publicmaintenanceconfigurations/client.go | 26 - .../constants.go | 192 -- .../id_publicmaintenanceconfiguration.go | 121 - .../id_publicmaintenanceconfiguration_test.go | 237 -- .../method_get.go | 54 - .../method_list.go | 56 - .../model_inputlinuxparameters.go | 10 - .../model_inputpatchconfiguration.go | 11 - .../model_inputwindowsparameters.go | 11 - ...del_listmaintenanceconfigurationsresult.go | 8 - .../model_maintenanceconfiguration.go | 18 - ...odel_maintenanceconfigurationproperties.go | 13 - .../model_maintenancewindow.go | 12 - .../model_softwareupdateconfigurationtasks.go | 9 - .../model_taskproperties.go | 10 - .../version.go | 12 - .../2022-07-01-preview/updates/README.md | 53 - .../2022-07-01-preview/updates/client.go | 26 - .../2022-07-01-preview/updates/constants.go | 163 - .../2022-07-01-preview/updates/method_list.go | 56 - .../updates/method_listparent.go | 56 - .../updates/model_listupdatesresult.go | 8 - .../updates/model_update.go | 31 - .../updates/model_updateproperties.go | 8 - .../2022-07-01-preview/updates/version.go | 12 - .../netapp/2023-11-01/backuppolicy/README.md | 98 + .../netapp/2023-11-01/backuppolicy/client.go | 26 + .../backuppolicy/id_backuppolicy.go | 139 + .../backuppolicy/id_backuppolicy_test.go | 327 ++ .../backuppolicy/id_netappaccount.go | 130 + .../backuppolicy/id_netappaccount_test.go | 282 ++ .../method_backuppoliciescreate.go | 76 + .../method_backuppoliciesdelete.go | 71 + .../backuppolicy/method_backuppoliciesget.go | 54 + .../backuppolicy/method_backuppolicieslist.go | 55 + .../method_backuppoliciesupdate.go | 75 + .../backuppolicy/model_backuppolicieslist.go | 8 + .../backuppolicy/model_backuppolicy.go | 19 + .../backuppolicy/model_backuppolicypatch.go | 13 + .../model_backuppolicyproperties.go | 15 + .../backuppolicy/model_volumebackups.go | 11 + .../netapp/2023-11-01/backuppolicy/version.go | 12 + .../netapp/2023-11-01/backups/README.md | 166 + .../netapp/2023-11-01/backups/client.go | 26 + .../netapp/2023-11-01/backups/constants.go | 142 + .../netapp/2023-11-01/backups/id_backup.go | 148 + .../2023-11-01/backups/id_backup_test.go | 372 +++ .../2023-11-01/backups/id_backupvault.go | 139 + .../2023-11-01/backups/id_backupvault_test.go | 327 ++ .../2023-11-01/backups/id_netappaccount.go | 130 + .../backups/id_netappaccount_test.go | 282 ++ .../netapp/2023-11-01/backups/id_volume.go | 148 + .../2023-11-01/backups/id_volume_test.go | 372 +++ .../2023-11-01/backups/method_create.go | 75 + .../2023-11-01/backups/method_delete.go | 70 + .../netapp/2023-11-01/backups/method_get.go | 54 + .../backups/method_getlateststatus.go | 55 + .../2023-11-01/backups/method_listbyvault.go | 119 + .../method_underaccountmigratebackups.go | 73 + .../method_underbackupvaultrestorefiles.go | 73 + .../method_undervolumemigratebackups.go | 73 + .../2023-11-01/backups/method_update.go | 75 + .../netapp/2023-11-01/backups/model_backup.go | 16 + .../2023-11-01/backups/model_backuppatch.go | 8 + .../backups/model_backuppatchproperties.go | 8 + .../backups/model_backupproperties.go | 36 + .../backups/model_backuprestorefiles.go | 10 + .../backups/model_backupsmigrationrequest.go | 8 + .../2023-11-01/backups/model_backupstatus.go | 16 + .../netapp/2023-11-01/backups/predicates.go | 27 + .../netapp/2023-11-01/backups/version.go | 12 + .../netapp/2023-11-01/backupvaults/README.md | 99 + .../netapp/2023-11-01/backupvaults/client.go | 26 + .../2023-11-01/backupvaults/id_backupvault.go | 139 + .../backupvaults/id_backupvault_test.go | 327 ++ .../backupvaults/id_netappaccount.go | 130 + .../backupvaults/id_netappaccount_test.go | 282 ++ .../backupvaults/method_createorupdate.go | 75 + .../2023-11-01/backupvaults/method_delete.go | 70 + .../2023-11-01/backupvaults/method_get.go | 54 + .../method_listbynetappaccount.go | 91 + .../2023-11-01/backupvaults/method_update.go | 75 + .../backupvaults/model_backupvault.go | 18 + .../backupvaults/model_backupvaultpatch.go | 8 + .../model_backupvaultproperties.go | 8 + .../2023-11-01/backupvaults/predicates.go | 32 + .../netapp/2023-11-01/backupvaults/version.go | 12 + .../netapp/2023-11-01/capacitypools/README.md | 99 + .../netapp/2023-11-01/capacitypools/client.go | 26 + .../2023-11-01/capacitypools/constants.go | 139 + .../capacitypools/id_capacitypool.go | 139 + .../capacitypools/id_capacitypool_test.go | 327 ++ .../capacitypools/id_netappaccount.go | 130 + .../capacitypools/id_netappaccount_test.go | 282 ++ .../method_poolscreateorupdate.go | 75 + .../capacitypools/method_poolsdelete.go | 70 + .../capacitypools/method_poolsget.go | 54 + .../capacitypools/method_poolslist.go | 91 + .../capacitypools/method_poolsupdate.go | 75 + .../capacitypools/model_capacitypool.go | 19 + .../capacitypools/model_capacitypoolpatch.go | 13 + .../model_poolpatchproperties.go | 10 + .../capacitypools/model_poolproperties.go | 16 + .../2023-11-01/capacitypools/predicates.go | 37 + .../2023-11-01/capacitypools/version.go | 12 + resource-manager/netapp/2023-11-01/client.go | 208 ++ .../netapp/2023-11-01/filelocks/README.md | 37 + .../netapp/2023-11-01/filelocks/client.go | 26 + .../netapp/2023-11-01/filelocks/id_volume.go | 148 + .../2023-11-01/filelocks/id_volume_test.go | 372 +++ .../filelocks/method_volumesbreakfilelocks.go | 74 + .../filelocks/model_breakfilelocksrequest.go | 9 + .../netapp/2023-11-01/filelocks/version.go | 12 + .../groupidlistforldapuser/README.md | 37 + .../groupidlistforldapuser/client.go | 26 + .../groupidlistforldapuser/id_volume.go | 148 + .../groupidlistforldapuser/id_volume_test.go | 372 +++ ...od_volumeslistgetgroupidlistforldapuser.go | 75 + .../model_getgroupidlistforldapuserrequest.go | 8 + ...model_getgroupidlistforldapuserresponse.go | 8 + .../groupidlistforldapuser/version.go | 12 + .../2023-11-01/netappaccounts/README.md | 129 + .../2023-11-01/netappaccounts/client.go | 26 + .../2023-11-01/netappaccounts/constants.go | 151 + .../netappaccounts/id_netappaccount.go | 130 + .../netappaccounts/id_netappaccount_test.go | 282 ++ .../method_accountscreateorupdate.go | 75 + .../netappaccounts/method_accountsdelete.go | 70 + .../netappaccounts/method_accountsget.go | 54 + .../netappaccounts/method_accountslist.go | 92 + .../method_accountslistbysubscription.go | 92 + .../method_accountsrenewcredentials.go | 70 + .../netappaccounts/method_accountsupdate.go | 75 + .../netappaccounts/model_accountencryption.go | 10 + .../netappaccounts/model_accountproperties.go | 11 + .../netappaccounts/model_activedirectory.go | 30 + .../model_encryptionidentity.go | 9 + .../model_keyvaultproperties.go | 12 + .../model_ldapsearchscopeopt.go | 10 + .../netappaccounts/model_netappaccount.go | 21 + .../model_netappaccountpatch.go | 18 + .../2023-11-01/netappaccounts/predicates.go | 37 + .../2023-11-01/netappaccounts/version.go | 12 + .../2023-11-01/netappresource/README.md | 202 ++ .../2023-11-01/netappresource/client.go | 26 + .../2023-11-01/netappresource/constants.go | 298 ++ .../2023-11-01/netappresource/id_location.go | 121 + .../netappresource/id_location_test.go | 237 ++ .../netappresource/id_quotalimit.go | 130 + .../netappresource/id_quotalimit_test.go | 282 ++ .../method_checkfilepathavailability.go | 59 + .../method_checknameavailability.go | 59 + .../method_checkquotaavailability.go | 59 + .../method_querynetworksiblingset.go | 59 + .../netappresource/method_queryregioninfo.go | 55 + .../netappresource/method_quotalimitsget.go | 54 + .../netappresource/method_quotalimitslist.go | 55 + .../netappresource/method_regioninfosget.go | 55 + .../netappresource/method_regioninfoslist.go | 91 + .../method_updatenetworksiblingset.go | 75 + .../model_checkavailabilityresponse.go | 10 + .../model_filepathavailabilityrequest.go | 9 + .../netappresource/model_networksiblingset.go | 13 + .../netappresource/model_nicinfo.go | 9 + .../model_querynetworksiblingsetrequest.go | 9 + .../model_quotaavailabilityrequest.go | 10 + .../netappresource/model_regioninfo.go | 9 + ...gioninfoavailabilityzonemappingsinlined.go | 9 + .../model_regioninforesource.go | 16 + .../model_resourcenameavailabilityrequest.go | 10 + .../model_subscriptionquotaitem.go | 16 + .../model_subscriptionquotaitemlist.go | 8 + .../model_subscriptionquotaitemproperties.go | 9 + .../model_updatenetworksiblingsetrequest.go | 11 + .../2023-11-01/netappresource/predicates.go | 27 + .../2023-11-01/netappresource/version.go | 12 + .../netapp/2023-11-01/poolchange/README.md | 37 + .../netapp/2023-11-01/poolchange/client.go | 26 + .../netapp/2023-11-01/poolchange/id_volume.go | 148 + .../2023-11-01/poolchange/id_volume_test.go | 372 +++ .../poolchange/method_volumespoolchange.go | 74 + .../poolchange/model_poolchangerequest.go | 8 + .../netapp/2023-11-01/poolchange/version.go | 12 + .../2023-11-01/resetcifspassword/client.go | 26 + .../2023-11-01/resetcifspassword/id_volume.go | 148 + .../resetcifspassword/id_volume_test.go | 372 +++ .../method_volumesresetcifspassword.go | 69 + .../2023-11-01/resetcifspassword/version.go | 12 + .../netapp/2023-11-01/restore/README.md | 36 + .../netapp/2023-11-01/restore/client.go | 26 + .../netapp/2023-11-01/restore/constants.go | 101 + .../netapp/2023-11-01/restore/id_volume.go | 148 + .../2023-11-01/restore/id_volume_test.go | 372 +++ ...hod_backupsgetvolumelatestrestorestatus.go | 55 + .../2023-11-01/restore/model_restorestatus.go | 13 + .../netapp/2023-11-01/restore/version.go | 12 + .../2023-11-01/snapshotpolicy/README.md | 102 + .../2023-11-01/snapshotpolicy/client.go | 26 + .../snapshotpolicy/id_netappaccount.go | 130 + .../snapshotpolicy/id_netappaccount_test.go | 282 ++ .../snapshotpolicy/id_snapshotpolicy.go | 139 + .../snapshotpolicy/id_snapshotpolicy_test.go | 327 ++ .../method_snapshotpoliciescreate.go | 59 + .../method_snapshotpoliciesdelete.go | 71 + .../method_snapshotpoliciesget.go | 54 + .../method_snapshotpolicieslist.go | 55 + .../method_snapshotpoliciesupdate.go | 75 + .../snapshotpolicy/model_dailyschedule.go | 11 + .../snapshotpolicy/model_hourlyschedule.go | 10 + .../snapshotpolicy/model_monthlyschedule.go | 12 + .../model_snapshotpolicieslist.go | 8 + .../snapshotpolicy/model_snapshotpolicy.go | 19 + .../model_snapshotpolicypatch.go | 13 + .../model_snapshotpolicyproperties.go | 13 + .../snapshotpolicy/model_weeklyschedule.go | 12 + .../2023-11-01/snapshotpolicy/version.go | 12 + .../snapshotpolicylistvolumes/README.md | 36 + .../snapshotpolicylistvolumes/client.go | 26 + .../snapshotpolicylistvolumes/constants.go | 608 ++++ .../id_snapshotpolicy.go | 139 + .../id_snapshotpolicy_test.go | 327 ++ .../method_snapshotpolicieslistvolumes.go | 55 + .../model_exportpolicyrule.go | 22 + .../model_mounttargetproperties.go | 11 + .../model_placementkeyvaluepairs.go | 9 + .../model_replicationobject.go | 12 + .../model_snapshotpolicyvolumelist.go | 8 + .../snapshotpolicylistvolumes/model_volume.go | 21 + .../model_volumebackupproperties.go | 10 + .../model_volumeproperties.go | 61 + .../model_volumepropertiesdataprotection.go | 11 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumerelocationproperties.go | 9 + .../model_volumesnapshotproperties.go | 8 + .../snapshotpolicylistvolumes/version.go | 12 + .../netapp/2023-11-01/snapshots/README.md | 111 + .../2023-11-01}/snapshots/client.go | 0 .../2023-11-01/snapshots/id_snapshot.go | 157 + .../2023-11-01/snapshots/id_snapshot_test.go | 417 +++ .../netapp/2023-11-01/snapshots/id_volume.go | 148 + .../2023-11-01/snapshots/id_volume_test.go | 372 +++ .../2023-11-01/snapshots/method_create.go | 75 + .../2023-11-01/snapshots/method_delete.go | 71 + .../2023-11-01}/snapshots/method_get.go | 0 .../2023-11-01/snapshots/method_list.go | 55 + .../snapshots/method_restorefiles.go | 74 + .../2023-11-01/snapshots/method_update.go | 75 + .../2023-11-01/snapshots/model_snapshot.go | 17 + .../snapshots/model_snapshotproperties.go | 28 + .../snapshots/model_snapshotrestorefiles.go | 9 + .../snapshots/model_snapshotslist.go | 8 + .../netapp/2023-11-01/snapshots/version.go | 12 + .../netapp/2023-11-01/subvolumes/README.md | 111 + .../netapp/2023-11-01/subvolumes/client.go | 26 + .../2023-11-01/subvolumes/id_subvolume.go | 157 + .../subvolumes/id_subvolume_test.go | 417 +++ .../netapp/2023-11-01/subvolumes/id_volume.go | 148 + .../2023-11-01/subvolumes/id_volume_test.go | 372 +++ .../2023-11-01/subvolumes/method_create.go | 76 + .../2023-11-01/subvolumes/method_delete.go | 71 + .../2023-11-01/subvolumes/method_get.go | 54 + .../subvolumes/method_getmetadata.go | 71 + .../subvolumes/method_listbyvolume.go | 91 + .../2023-11-01/subvolumes/method_update.go | 75 + .../subvolumes/model_subvolumeinfo.go | 16 + .../subvolumes/model_subvolumemodel.go | 11 + .../model_subvolumemodelproperties.go | 71 + .../subvolumes/model_subvolumepatchparams.go | 9 + .../subvolumes/model_subvolumepatchrequest.go | 8 + .../subvolumes/model_subvolumeproperties.go | 11 + .../2023-11-01/subvolumes/predicates.go | 27 + .../netapp/2023-11-01/subvolumes/version.go | 12 + .../netapp/2023-11-01/volumegroups/README.md | 81 + .../netapp/2023-11-01/volumegroups/client.go | 26 + .../2023-11-01/volumegroups/constants.go | 649 ++++ .../volumegroups/id_netappaccount.go | 130 + .../volumegroups/id_netappaccount_test.go | 282 ++ .../2023-11-01/volumegroups/id_volumegroup.go | 139 + .../volumegroups/id_volumegroup_test.go | 327 ++ .../2023-11-01/volumegroups/method_create.go | 74 + .../2023-11-01/volumegroups/method_delete.go | 71 + .../2023-11-01/volumegroups/method_get.go | 54 + .../method_listbynetappaccount.go | 55 + .../volumegroups/model_exportpolicyrule.go | 22 + .../model_mounttargetproperties.go | 11 + .../model_placementkeyvaluepairs.go | 9 + .../volumegroups/model_replicationobject.go | 12 + .../model_volumebackupproperties.go | 10 + .../volumegroups/model_volumegroup.go | 12 + .../volumegroups/model_volumegroupdetails.go | 12 + .../volumegroups/model_volumegrouplist.go | 8 + .../model_volumegrouplistproperties.go | 9 + .../volumegroups/model_volumegroupmetadata.go | 12 + .../model_volumegroupproperties.go | 10 + .../model_volumegroupvolumeproperties.go | 17 + .../volumegroups/model_volumeproperties.go | 61 + .../model_volumepropertiesdataprotection.go | 11 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumerelocationproperties.go | 9 + .../model_volumesnapshotproperties.go | 8 + .../netapp/2023-11-01/volumegroups/version.go | 12 + .../2023-11-01/volumequotarules/README.md | 98 + .../2023-11-01/volumequotarules/client.go | 26 + .../2023-11-01/volumequotarules/constants.go | 113 + .../2023-11-01/volumequotarules/id_volume.go | 148 + .../volumequotarules/id_volume_test.go | 372 +++ .../volumequotarules/id_volumequotarule.go | 157 + .../id_volumequotarule_test.go | 417 +++ .../volumequotarules/method_create.go | 75 + .../volumequotarules/method_delete.go | 71 + .../2023-11-01/volumequotarules/method_get.go | 54 + .../volumequotarules/method_listbyvolume.go | 55 + .../volumequotarules/method_update.go | 75 + .../volumequotarules/model_volumequotarule.go | 18 + .../model_volumequotarulepatch.go | 9 + .../model_volumequotaruleslist.go | 8 + .../model_volumequotarulesproperties.go | 11 + .../2023-11-01/volumequotarules/version.go | 12 + .../netapp/2023-11-01/volumes/README.md | 111 + .../netapp/2023-11-01/volumes/client.go | 26 + .../netapp/2023-11-01/volumes/constants.go | 608 ++++ .../2023-11-01/volumes/id_capacitypool.go | 139 + .../volumes/id_capacitypool_test.go | 327 ++ .../netapp/2023-11-01/volumes/id_volume.go | 148 + .../2023-11-01/volumes/id_volume_test.go | 372 +++ .../volumes/method_createorupdate.go | 76 + .../2023-11-01/volumes/method_delete.go | 98 + .../netapp/2023-11-01/volumes/method_get.go | 54 + .../netapp/2023-11-01/volumes/method_list.go | 91 + .../method_populateavailabilityzone.go | 71 + .../2023-11-01/volumes/method_update.go | 75 + .../volumes/model_exportpolicyrule.go | 22 + .../volumes/model_mounttargetproperties.go | 11 + .../volumes/model_placementkeyvaluepairs.go | 9 + .../volumes/model_replicationobject.go | 12 + .../netapp/2023-11-01/volumes/model_volume.go | 21 + .../volumes/model_volumebackupproperties.go | 10 + .../2023-11-01/volumes/model_volumepatch.go | 13 + .../volumes/model_volumepatchproperties.go | 22 + ...del_volumepatchpropertiesdataprotection.go | 9 + ...model_volumepatchpropertiesexportpolicy.go | 8 + .../volumes/model_volumeproperties.go | 61 + .../model_volumepropertiesdataprotection.go | 11 + .../model_volumepropertiesexportpolicy.go | 8 + .../model_volumerelocationproperties.go | 9 + .../volumes/model_volumesnapshotproperties.go | 8 + .../netapp/2023-11-01/volumes/predicates.go | 37 + .../netapp/2023-11-01/volumes/version.go | 12 + .../2023-11-01/volumesrelocation/README.md | 61 + .../2023-11-01/volumesrelocation/client.go | 26 + .../2023-11-01/volumesrelocation/id_volume.go | 148 + .../volumesrelocation/id_volume_test.go | 372 +++ .../method_volumesfinalizerelocation.go | 70 + .../method_volumesrelocate.go | 74 + .../method_volumesrevertrelocation.go | 70 + .../model_relocatevolumerequest.go | 8 + .../2023-11-01/volumesrelocation/version.go | 12 + .../2023-11-01/volumesreplication/README.md | 139 + .../2023-11-01/volumesreplication/client.go | 26 + .../volumesreplication/constants.go | 180 ++ .../volumesreplication/id_volume.go | 148 + .../volumesreplication/id_volume_test.go | 372 +++ .../method_volumesauthorizereplication.go | 74 + .../method_volumesbreakreplication.go | 74 + .../method_volumesdeletereplication.go | 70 + .../method_volumeslistreplications.go | 55 + .../method_volumesreestablishreplication.go | 73 + .../method_volumesreinitializereplication.go | 70 + .../method_volumesreplicationstatus.go | 55 + .../method_volumesresyncreplication.go | 70 + .../model_authorizerequest.go | 8 + .../model_breakreplicationrequest.go | 8 + .../model_listreplications.go | 8 + .../model_reestablishreplicationrequest.go | 8 + .../volumesreplication/model_replication.go | 11 + .../model_replicationstatus.go | 12 + .../2023-11-01/volumesreplication/version.go | 12 + .../netapp/2023-11-01/volumesrevert/README.md | 37 + .../netapp/2023-11-01/volumesrevert/client.go | 26 + .../2023-11-01/volumesrevert/id_volume.go | 148 + .../volumesrevert/id_volume_test.go | 372 +++ .../volumesrevert/method_volumesrevert.go | 74 + .../volumesrevert/model_volumerevert.go | 8 + .../2023-11-01/volumesrevert/version.go | 12 + .../2022-07-01/adminrulecollections/README.md | 86 + .../adminrulecollections/client.go | 0 .../adminrulecollections/constants.go | 0 .../adminrulecollections/id_rulecollection.go | 0 .../id_rulecollection_test.go | 0 .../id_securityadminconfiguration.go | 0 .../id_securityadminconfiguration_test.go | 0 .../method_createorupdate.go | 0 .../adminrulecollections/method_delete.go | 0 .../adminrulecollections/method_get.go | 0 .../adminrulecollections/method_list.go | 0 .../model_adminrulecollection.go | 0 ...del_adminrulecollectionpropertiesformat.go | 10 + .../model_networkmanagersecuritygroupitem.go | 0 .../adminrulecollections/predicates.go | 0 .../adminrulecollections/version.go | 12 + .../network/2022-07-01/adminrules/README.md | 86 + .../adminrules/client.go | 0 .../adminrules/constants.go | 0 .../adminrules/id_rule.go | 0 .../adminrules/id_rule_test.go | 0 .../adminrules/id_rulecollection.go | 0 .../adminrules/id_rulecollection_test.go | 0 .../adminrules/method_createorupdate.go | 0 .../adminrules/method_delete.go | 0 .../adminrules/method_get.go | 0 .../adminrules/method_list.go | 0 .../adminrules/model_addressprefixitem.go | 0 .../adminrules/model_adminpropertiesformat.go | 17 + .../adminrules/model_adminrule.go | 0 .../adminrules/model_baseadminrule.go | 0 .../model_defaultadminpropertiesformat.go | 18 + .../adminrules/model_defaultadminrule.go | 0 .../adminrules/predicates.go | 0 .../network/2022-07-01/adminrules/version.go | 12 + .../README.md | 82 + .../client.go | 0 .../constants.go | 1013 ++++++ .../id_applicationgateway.go | 0 .../id_applicationgateway_test.go | 0 ...icationgatewayprivateendpointconnection.go | 0 ...ongatewayprivateendpointconnection_test.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../method_update.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 ...icationgatewayprivateendpointconnection.go | 0 ...ewayprivateendpointconnectionproperties.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../model_ddossettings.go | 0 .../model_delegation.go | 0 .../model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../model_route.go | 0 .../model_routepropertiesformat.go | 0 .../model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../predicates.go | 0 .../version.go | 12 + .../README.md | 37 + .../client.go | 0 .../id_applicationgateway.go | 0 .../id_applicationgateway_test.go | 0 .../method_list.go | 0 ...l_applicationgatewayprivatelinkresource.go | 0 ...iongatewayprivatelinkresourceproperties.go | 0 .../predicates.go | 0 .../version.go | 12 + .../2022-07-01/applicationgateways/README.md | 287 ++ .../applicationgateways/client.go | 0 .../applicationgateways/constants.go | 1954 +++++++++++ .../id_applicationgateway.go | 0 .../id_applicationgateway_test.go | 0 .../id_predefinedpolicy.go | 0 .../id_predefinedpolicy_test.go | 0 .../method_backendhealth.go | 0 .../method_backendhealthondemand.go | 0 .../method_createorupdate.go | 0 .../applicationgateways/method_delete.go | 0 .../applicationgateways/method_get.go | 0 .../method_getsslpredefinedpolicy.go | 0 .../applicationgateways/method_list.go | 0 .../applicationgateways/method_listall.go | 0 .../method_listavailablerequestheaders.go | 0 .../method_listavailableresponseheaders.go | 0 .../method_listavailableservervariables.go | 0 .../method_listavailablessloptions.go | 0 ...thod_listavailablesslpredefinedpolicies.go | 0 .../method_listavailablewafrulesets.go | 0 .../applicationgateways/method_start.go | 0 .../applicationgateways/method_stop.go | 0 .../applicationgateways/method_updatetags.go | 0 .../model_applicationgateway.go | 0 ...icationgatewayauthenticationcertificate.go | 0 ...thenticationcertificatepropertiesformat.go | 0 ...pplicationgatewayautoscaleconfiguration.go | 0 ...l_applicationgatewayavailablessloptions.go | 0 ...ewayavailablessloptionspropertiesformat.go | 0 ...cationgatewayavailablewafrulesetsresult.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 .../model_applicationgatewaybackendhealth.go | 0 ...icationgatewaybackendhealthhttpsettings.go | 0 ...applicationgatewaybackendhealthondemand.go | 0 ...del_applicationgatewaybackendhealthpool.go | 0 ...l_applicationgatewaybackendhealthserver.go | 0 ...l_applicationgatewaybackendhttpsettings.go | 0 ...ewaybackendhttpsettingspropertiesformat.go | 0 ...model_applicationgatewaybackendsettings.go | 0 ...ngatewaybackendsettingspropertiesformat.go | 0 ...plicationgatewayclientauthconfiguration.go | 0 ...el_applicationgatewayconnectiondraining.go | 0 .../model_applicationgatewaycustomerror.go | 0 ...icationgatewayfirewalldisabledrulegroup.go | 0 ...del_applicationgatewayfirewallexclusion.go | 0 .../model_applicationgatewayfirewallrule.go | 0 ...del_applicationgatewayfirewallrulegroup.go | 0 ...model_applicationgatewayfirewallruleset.go | 0 ...ngatewayfirewallrulesetpropertiesformat.go | 0 ...plicationgatewayfrontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 .../model_applicationgatewayfrontendport.go | 0 ...tiongatewayfrontendportpropertiesformat.go | 0 ...l_applicationgatewayglobalconfiguration.go | 0 ...l_applicationgatewayheaderconfiguration.go | 0 .../model_applicationgatewayhttplistener.go | 0 ...tiongatewayhttplistenerpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationgatewaylistener.go | 0 ...licationgatewaylistenerpropertiesformat.go | 0 ...pplicationgatewayloaddistributionpolicy.go | 0 ...yloaddistributionpolicypropertiesformat.go | 0 ...pplicationgatewayloaddistributiontarget.go | 0 ...yloaddistributiontargetpropertiesformat.go | 0 .../model_applicationgatewayondemandprobe.go | 0 .../model_applicationgatewaypathrule.go | 0 ...licationgatewaypathrulepropertiesformat.go | 0 ...icationgatewayprivateendpointconnection.go | 0 ...ewayprivateendpointconnectionproperties.go | 0 ...licationgatewayprivatelinkconfiguration.go | 0 ...tewayprivatelinkconfigurationproperties.go | 0 ...cationgatewayprivatelinkipconfiguration.go | 0 ...wayprivatelinkipconfigurationproperties.go | 0 .../model_applicationgatewayprobe.go | 0 ...licationgatewayprobehealthresponsematch.go | 0 ...applicationgatewayprobepropertiesformat.go | 0 ...odel_applicationgatewaypropertiesformat.go | 42 + ...applicationgatewayredirectconfiguration.go | 0 ...ayredirectconfigurationpropertiesformat.go | 0 ...el_applicationgatewayrequestroutingrule.go | 0 ...tewayrequestroutingrulepropertiesformat.go | 0 .../model_applicationgatewayrewriterule.go | 0 ..._applicationgatewayrewriteruleactionset.go | 0 ..._applicationgatewayrewriterulecondition.go | 0 .../model_applicationgatewayrewriteruleset.go | 0 ...ongatewayrewriterulesetpropertiesformat.go | 0 .../model_applicationgatewayroutingrule.go | 0 ...ationgatewayroutingrulepropertiesformat.go | 0 .../model_applicationgatewaysku.go | 0 .../model_applicationgatewaysslcertificate.go | 0 ...ongatewaysslcertificatepropertiesformat.go | 0 .../model_applicationgatewaysslpolicy.go | 0 ...l_applicationgatewaysslpredefinedpolicy.go | 0 ...ewaysslpredefinedpolicypropertiesformat.go | 0 .../model_applicationgatewaysslprofile.go | 0 ...cationgatewaysslprofilepropertiesformat.go | 0 ...licationgatewaytrustedclientcertificate.go | 0 ...rustedclientcertificatepropertiesformat.go | 0 ...pplicationgatewaytrustedrootcertificate.go | 0 ...ytrustedrootcertificatepropertiesformat.go | 0 ...odel_applicationgatewayurlconfiguration.go | 0 .../model_applicationgatewayurlpathmap.go | 0 ...cationgatewayurlpathmappropertiesformat.go | 0 ...ewaywebapplicationfirewallconfiguration.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../applicationgateways/model_ddossettings.go | 0 .../applicationgateways/model_delegation.go | 0 .../applicationgateways/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../applicationgateways/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../applicationgateways/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../applicationgateways/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../applicationgateways/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../applicationgateways/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../applicationgateways/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../applicationgateways/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../applicationgateways/model_subresource.go | 0 .../applicationgateways/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../applicationgateways/predicates.go | 0 .../2022-07-01/applicationgateways/version.go | 12 + .../README.md | 53 + .../client.go | 0 .../constants.go | 0 .../id_location.go | 0 .../id_location_test.go | 0 .../method_defaultget.go | 0 .../method_get.go | 0 ...plicationgatewayfirewallmanifestruleset.go | 0 .../model_applicationgatewayfirewallrule.go | 0 ...del_applicationgatewayfirewallrulegroup.go | 0 ...tewaywafdynamicmanifestpropertiesresult.go | 0 ...licationgatewaywafdynamicmanifestresult.go | 0 .../model_defaultrulesetpropertyformat.go | 0 .../predicates.go | 0 .../version.go | 12 + .../applicationsecuritygroups/README.md | 121 + .../applicationsecuritygroups/client.go | 0 .../applicationsecuritygroups/constants.go | 0 .../id_applicationsecuritygroup.go | 0 .../id_applicationsecuritygroup_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../applicationsecuritygroups/method_get.go | 0 .../applicationsecuritygroups/method_list.go | 0 .../method_listall.go | 0 .../method_updatetags.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_tagsobject.go | 0 .../applicationsecuritygroups/predicates.go | 0 .../applicationsecuritygroups/version.go | 12 + .../2022-07-01/availabledelegations/README.md | 54 + .../availabledelegations/client.go | 0 .../availabledelegations/id_location.go | 0 .../availabledelegations/id_location_test.go | 0 .../id_providerlocation.go | 0 .../id_providerlocation_test.go | 0 .../method_availabledelegationslist.go | 0 ...d_availableresourcegroupdelegationslist.go | 0 .../model_availabledelegation.go | 0 .../availabledelegations/predicates.go | 0 .../availabledelegations/version.go | 12 + .../availableservicealiases/README.md | 54 + .../availableservicealiases/client.go | 0 .../availableservicealiases/id_location.go | 0 .../id_location_test.go | 0 .../id_providerlocation.go | 0 .../id_providerlocation_test.go | 0 .../availableservicealiases/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../model_availableservicealias.go | 0 .../availableservicealiases/predicates.go | 0 .../availableservicealiases/version.go | 12 + .../2022-07-01/azurefirewalls/README.md | 129 + .../azurefirewalls/client.go | 0 .../2022-07-01/azurefirewalls/constants.go | 359 +++ .../azurefirewalls/id_azurefirewall.go | 0 .../azurefirewalls/id_azurefirewall_test.go | 0 ...ethod_azurefirewallslistlearnedprefixes.go | 0 .../azurefirewalls/method_createorupdate.go | 0 .../azurefirewalls/method_delete.go | 0 .../azurefirewalls/method_get.go | 0 .../azurefirewalls/method_list.go | 0 .../azurefirewalls/method_listall.go | 0 .../azurefirewalls/method_updatetags.go | 0 .../azurefirewalls/model_azurefirewall.go | 0 .../model_azurefirewallapplicationrule.go | 0 ..._azurefirewallapplicationrulecollection.go | 0 ...plicationrulecollectionpropertiesformat.go | 0 ...el_azurefirewallapplicationruleprotocol.go | 0 .../model_azurefirewallipconfiguration.go | 0 ...firewallipconfigurationpropertiesformat.go | 0 .../model_azurefirewallipgroups.go | 0 .../model_azurefirewallnatrcaction.go | 0 .../model_azurefirewallnatrule.go | 0 .../model_azurefirewallnatrulecollection.go | 0 ...zurefirewallnatrulecollectionproperties.go | 0 .../model_azurefirewallnetworkrule.go | 0 ...odel_azurefirewallnetworkrulecollection.go | 0 ...llnetworkrulecollectionpropertiesformat.go | 0 .../model_azurefirewallpropertiesformat.go | 0 .../model_azurefirewallpublicipaddress.go | 0 .../model_azurefirewallrcaction.go | 0 .../azurefirewalls/model_azurefirewallsku.go | 0 .../azurefirewalls/model_hubipaddresses.go | 0 .../model_hubpublicipaddresses.go | 0 .../azurefirewalls/model_ipprefixeslist.go | 0 .../azurefirewalls/model_subresource.go | 0 .../azurefirewalls/model_tagsobject.go | 0 .../azurefirewalls/predicates.go | 0 .../2022-07-01/azurefirewalls/version.go | 12 + .../network/2022-07-01/bastionhosts/README.md | 217 ++ .../bastionhosts/client.go | 0 .../bastionhosts/constants.go | 0 .../bastionhosts/id_bastionhost.go | 0 .../bastionhosts/id_bastionhost_test.go | 0 .../bastionhosts/method_createorupdate.go | 0 .../bastionhosts/method_delete.go | 0 .../method_deletebastionshareablelink.go | 0 .../method_disconnectactivesessions.go | 0 .../bastionhosts/method_get.go | 0 .../bastionhosts/method_getactivesessions.go | 0 .../method_getbastionshareablelink.go | 0 .../bastionhosts/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../method_putbastionshareablelink.go | 0 .../bastionhosts/method_updatetags.go | 0 .../model_bastionactivesession.go | 0 .../bastionhosts/model_bastionhost.go | 0 .../model_bastionhostipconfiguration.go | 0 ...tionhostipconfigurationpropertiesformat.go | 0 .../model_bastionhostpropertiesformat.go | 16 + .../bastionhosts/model_bastionsessionstate.go | 0 .../model_bastionshareablelink.go | 0 .../model_bastionshareablelinklistrequest.go | 0 .../bastionhosts/model_resource.go | 0 .../bastionhosts/model_sessionids.go | 0 .../bastionhosts/model_sku.go | 0 .../bastionhosts/model_subresource.go | 0 .../bastionhosts/model_tagsobject.go | 0 .../bastionhosts/predicates.go | 0 .../2022-07-01/bastionhosts/version.go | 12 + .../2022-07-01/bastionshareablelink/README.md | 81 + .../bastionshareablelink/client.go | 0 .../bastionshareablelink/id_bastionhost.go | 0 .../id_bastionhost_test.go | 0 .../method_deletebastionshareablelink.go | 0 .../method_getbastionshareablelink.go | 0 .../method_putbastionshareablelink.go | 0 .../model_bastionshareablelink.go | 0 .../model_bastionshareablelinklistrequest.go | 0 .../bastionshareablelink/model_resource.go | 0 .../bastionshareablelink/predicates.go | 0 .../bastionshareablelink/version.go | 12 + .../bgpservicecommunities/README.md | 38 + .../bgpservicecommunities/client.go | 0 .../bgpservicecommunities/method_list.go | 0 .../model_bgpcommunity.go | 0 .../model_bgpservicecommunity.go | 0 ...del_bgpservicecommunitypropertiesformat.go | 0 .../bgpservicecommunities/predicates.go | 0 .../bgpservicecommunities/version.go | 12 + .../checkdnsavailabilities/README.md | 36 + .../checkdnsavailabilities/client.go | 0 .../checkdnsavailabilities/id_location.go | 0 .../id_location_test.go | 0 .../method_checkdnsnameavailability.go | 0 .../model_dnsnameavailabilityresult.go | 0 .../checkdnsavailabilities/version.go | 12 + resource-manager/network/2022-07-01/client.go | 982 ++++++ .../cloudservicepublicipaddresses/README.md | 71 + .../cloudservicepublicipaddresses/client.go | 0 .../constants.go | 1013 ++++++ .../id_providercloudservice.go | 0 .../id_providercloudservice_test.go | 0 ...addressesgetcloudservicepublicipaddress.go | 0 ...resseslistcloudservicepublicipaddresses.go | 0 ...oudserviceroleinstancepublicipaddresses.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../model_ddossettings.go | 0 .../model_delegation.go | 0 .../model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../model_route.go | 0 .../model_routepropertiesformat.go | 0 .../model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../predicates.go | 0 .../cloudservicepublicipaddresses/version.go | 12 + .../2022-07-01/connectionmonitors/README.md | 138 + .../connectionmonitors/client.go | 0 .../connectionmonitors/constants.go | 0 .../id_connectionmonitor.go | 0 .../id_connectionmonitor_test.go | 0 .../connectionmonitors/id_networkwatcher.go | 0 .../id_networkwatcher_test.go | 0 .../method_createorupdate.go | 0 .../connectionmonitors/method_delete.go | 0 .../connectionmonitors/method_get.go | 0 .../connectionmonitors/method_list.go | 0 .../connectionmonitors/method_query.go | 0 .../connectionmonitors/method_start.go | 0 .../connectionmonitors/method_stop.go | 0 .../connectionmonitors/method_updatetags.go | 0 .../model_connectionmonitor.go | 0 .../model_connectionmonitordestination.go | 0 .../model_connectionmonitorendpoint.go | 0 .../model_connectionmonitorendpointfilter.go | 0 ...del_connectionmonitorendpointfilteritem.go | 0 .../model_connectionmonitorendpointscope.go | 0 ...odel_connectionmonitorendpointscopeitem.go | 0 ...odel_connectionmonitorhttpconfiguration.go | 0 ...odel_connectionmonitoricmpconfiguration.go | 0 .../model_connectionmonitorlistresult.go | 0 .../model_connectionmonitoroutput.go | 0 .../model_connectionmonitorparameters.go | 0 .../model_connectionmonitorqueryresult.go | 0 .../model_connectionmonitorresult.go | 0 ...model_connectionmonitorresultproperties.go | 0 .../model_connectionmonitorsource.go | 0 ...model_connectionmonitorsuccessthreshold.go | 0 ...model_connectionmonitortcpconfiguration.go | 0 ...odel_connectionmonitortestconfiguration.go | 0 .../model_connectionmonitortestgroup.go | 0 ...odel_connectionmonitorworkspacesettings.go | 0 .../model_connectionstatesnapshot.go | 0 .../model_connectivityhop.go | 0 .../model_connectivityissue.go | 0 .../connectionmonitors/model_hoplink.go | 0 .../model_hoplinkproperties.go | 0 .../connectionmonitors/model_httpheader.go | 0 .../connectionmonitors/model_tagsobject.go | 0 .../2022-07-01/connectionmonitors/version.go | 12 + .../connectivityconfigurations/README.md | 86 + .../connectivityconfigurations/client.go | 0 .../connectivityconfigurations/constants.go | 0 .../id_connectivityconfiguration.go | 0 .../id_connectivityconfiguration_test.go | 0 .../id_networkmanager.go | 0 .../id_networkmanager_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../connectivityconfigurations/method_get.go | 0 .../connectivityconfigurations/method_list.go | 0 .../model_connectivityconfiguration.go | 0 ...del_connectivityconfigurationproperties.go | 14 + .../model_connectivitygroupitem.go | 0 .../connectivityconfigurations/model_hub.go | 0 .../connectivityconfigurations/predicates.go | 0 .../connectivityconfigurations/version.go | 12 + .../2022-07-01/customipprefixes/README.md | 121 + .../customipprefixes/client.go | 0 .../customipprefixes/constants.go | 0 .../customipprefixes/id_customipprefix.go | 0 .../id_customipprefix_test.go | 0 .../customipprefixes/method_createorupdate.go | 0 .../customipprefixes/method_delete.go | 0 .../customipprefixes/method_get.go | 0 .../customipprefixes/method_list.go | 0 .../customipprefixes/method_listall.go | 0 .../customipprefixes/method_updatetags.go | 0 .../customipprefixes/model_customipprefix.go | 0 .../model_customipprefixpropertiesformat.go | 0 .../customipprefixes/model_subresource.go | 0 .../customipprefixes/model_tagsobject.go | 0 .../customipprefixes/predicates.go | 0 .../2022-07-01/customipprefixes/version.go | 12 + .../2022-07-01/ddoscustompolicies/README.md | 86 + .../ddoscustompolicies/client.go | 0 .../ddoscustompolicies/constants.go | 0 .../ddoscustompolicies/id_ddoscustompolicy.go | 0 .../id_ddoscustompolicy_test.go | 0 .../method_createorupdate.go | 0 .../ddoscustompolicies/method_delete.go | 0 .../ddoscustompolicies/method_get.go | 0 .../ddoscustompolicies/method_updatetags.go | 0 .../model_ddoscustompolicy.go | 0 .../model_ddoscustompolicypropertiesformat.go | 0 .../ddoscustompolicies/model_tagsobject.go | 0 .../2022-07-01/ddoscustompolicies/version.go | 12 + .../2022-07-01/ddosprotectionplans/README.md | 121 + .../ddosprotectionplans/client.go | 0 .../ddosprotectionplans/constants.go | 0 .../id_ddosprotectionplan.go | 0 .../id_ddosprotectionplan_test.go | 0 .../method_createorupdate.go | 0 .../ddosprotectionplans/method_delete.go | 0 .../ddosprotectionplans/method_get.go | 0 .../ddosprotectionplans/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../ddosprotectionplans/method_updatetags.go | 0 .../model_ddosprotectionplan.go | 0 ...odel_ddosprotectionplanpropertiesformat.go | 0 .../ddosprotectionplans/model_subresource.go | 0 .../ddosprotectionplans/model_tagsobject.go | 0 .../ddosprotectionplans/predicates.go | 0 .../2022-07-01/ddosprotectionplans/version.go | 12 + .../2022-07-01/dscpconfiguration/README.md | 65 + .../dscpconfiguration/client.go | 0 .../2022-07-01/dscpconfiguration/constants.go | 1075 +++++++ .../dscpconfiguration/id_dscpconfiguration.go | 0 .../id_dscpconfiguration_test.go | 0 .../method_createorupdate.go | 0 .../dscpconfiguration/method_delete.go | 0 .../dscpconfiguration/method_get.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../dscpconfiguration/model_ddossettings.go | 0 .../dscpconfiguration/model_delegation.go | 0 .../model_dscpconfiguration.go | 0 ...model_dscpconfigurationpropertiesformat.go | 0 .../dscpconfiguration/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../dscpconfiguration/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../dscpconfiguration/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../dscpconfiguration/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../dscpconfiguration/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../dscpconfiguration/model_qosdefinition.go | 0 .../dscpconfiguration/model_qosiprange.go | 0 .../dscpconfiguration/model_qosportrange.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../dscpconfiguration/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../dscpconfiguration/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../dscpconfiguration/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../dscpconfiguration/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../dscpconfiguration/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../dscpconfiguration/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../2022-07-01/dscpconfiguration/version.go | 12 + .../2022-07-01/dscpconfigurations/README.md | 55 + .../dscpconfigurations/client.go | 0 .../dscpconfigurations/constants.go | 1075 +++++++ .../method_dscpconfigurationlist.go | 0 .../method_dscpconfigurationlistall.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../dscpconfigurations/model_ddossettings.go | 0 .../dscpconfigurations/model_delegation.go | 0 .../model_dscpconfiguration.go | 0 ...model_dscpconfigurationpropertiesformat.go | 0 .../dscpconfigurations/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../dscpconfigurations/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../dscpconfigurations/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../dscpconfigurations/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../dscpconfigurations/model_qosdefinition.go | 0 .../dscpconfigurations/model_qosiprange.go | 0 .../dscpconfigurations/model_qosportrange.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../dscpconfigurations/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../dscpconfigurations/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../dscpconfigurations/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../dscpconfigurations/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../dscpconfigurations/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../dscpconfigurations/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../dscpconfigurations/predicates.go | 0 .../2022-07-01/dscpconfigurations/version.go | 12 + .../2022-07-01/endpointservices/README.md | 37 + .../endpointservices/client.go | 0 .../endpointservices/id_location.go | 0 .../endpointservices/id_location_test.go | 0 .../method_availableendpointserviceslist.go | 0 .../model_endpointserviceresult.go | 0 .../endpointservices/predicates.go | 0 .../2022-07-01/endpointservices/version.go | 12 + .../expressroutecircuitarptable/README.md | 37 + .../expressroutecircuitarptable/client.go | 0 .../id_arptable.go | 0 .../id_arptable_test.go | 0 ...method_expressroutecircuitslistarptable.go | 0 .../model_expressroutecircuitarptable.go | 0 .../expressroutecircuitarptable/predicates.go | 0 .../expressroutecircuitarptable/version.go | 12 + .../README.md | 82 + .../client.go | 0 .../constants.go | 0 .../id_authorization.go | 0 .../id_authorization_test.go | 0 .../id_expressroutecircuit.go | 0 .../id_expressroutecircuit_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../model_authorizationpropertiesformat.go | 0 .../model_expressroutecircuitauthorization.go | 0 .../predicates.go | 0 .../version.go | 12 + .../expressroutecircuitconnections/README.md | 83 + .../expressroutecircuitconnections/client.go | 0 .../constants.go | 0 .../id_peeringconnection.go | 0 .../id_peeringconnection_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../model_expressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../model_ipv6circuitconnectionconfig.go | 0 .../model_subresource.go | 0 .../predicates.go | 0 .../expressroutecircuitconnections/version.go | 12 + .../expressroutecircuitpeerings/README.md | 83 + .../expressroutecircuitpeerings/client.go | 0 .../expressroutecircuitpeerings/constants.go | 0 .../id_expressroutecircuit.go | 0 .../id_expressroutecircuit_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../expressroutecircuitpeerings/method_get.go | 0 .../method_list.go | 0 .../model_expressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../model_expressroutecircuitpeering.go | 0 .../model_expressroutecircuitpeeringconfig.go | 0 ...ressroutecircuitpeeringpropertiesformat.go | 0 .../model_expressroutecircuitstats.go | 0 .../model_expressrouteconnectionid.go | 0 .../model_ipv6circuitconnectionconfig.go | 0 ...el_ipv6expressroutecircuitpeeringconfig.go | 0 ...model_peerexpressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../model_subresource.go | 0 .../expressroutecircuitpeerings/predicates.go | 0 .../expressroutecircuitpeerings/version.go | 12 + .../expressroutecircuitroutestable/README.md | 37 + .../expressroutecircuitroutestable/client.go | 0 .../id_peeringroutetable.go | 0 .../id_peeringroutetable_test.go | 0 ...hod_expressroutecircuitslistroutestable.go | 0 .../model_expressroutecircuitroutestable.go | 0 .../predicates.go | 0 .../expressroutecircuitroutestable/version.go | 12 + .../README.md | 37 + .../client.go | 0 .../id_routetablessummary.go | 0 .../id_routetablessummary_test.go | 0 ...ressroutecircuitslistroutestablesummary.go | 0 ...l_expressroutecircuitroutestablesummary.go | 0 .../predicates.go | 0 .../version.go | 12 + .../2022-07-01/expressroutecircuits/README.md | 121 + .../expressroutecircuits/client.go | 0 .../expressroutecircuits/constants.go | 0 .../id_expressroutecircuit.go | 0 .../id_expressroutecircuit_test.go | 0 .../method_createorupdate.go | 0 .../expressroutecircuits/method_delete.go | 0 .../expressroutecircuits/method_get.go | 0 .../expressroutecircuits/method_list.go | 0 .../expressroutecircuits/method_listall.go | 0 .../expressroutecircuits/method_updatetags.go | 0 .../model_authorizationpropertiesformat.go | 0 .../model_expressroutecircuit.go | 0 .../model_expressroutecircuitauthorization.go | 0 .../model_expressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../model_expressroutecircuitpeering.go | 0 .../model_expressroutecircuitpeeringconfig.go | 0 ...ressroutecircuitpeeringpropertiesformat.go | 0 ...del_expressroutecircuitpropertiesformat.go | 22 + ...ssroutecircuitserviceproviderproperties.go | 0 .../model_expressroutecircuitsku.go | 0 .../model_expressroutecircuitstats.go | 0 .../model_expressrouteconnectionid.go | 0 .../model_ipv6circuitconnectionconfig.go | 0 ...el_ipv6expressroutecircuitpeeringconfig.go | 0 ...model_peerexpressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../expressroutecircuits/model_subresource.go | 0 .../expressroutecircuits/model_tagsobject.go | 0 .../expressroutecircuits/predicates.go | 0 .../expressroutecircuits/version.go | 12 + .../expressroutecircuitstats/README.md | 53 + .../expressroutecircuitstats/client.go | 0 .../id_expressroutecircuit.go | 0 .../id_expressroutecircuit_test.go | 0 ...hod_expressroutecircuitsgetpeeringstats.go | 0 .../method_expressroutecircuitsgetstats.go | 0 .../model_expressroutecircuitstats.go | 0 .../expressroutecircuitstats/version.go | 12 + .../expressrouteconnections/README.md | 81 + .../expressrouteconnections/client.go | 0 .../expressrouteconnections/constants.go | 0 .../id_expressrouteconnection.go | 0 .../id_expressrouteconnection_test.go | 0 .../id_expressroutegateway.go | 0 .../id_expressroutegateway_test.go | 0 .../method_createorupdate.go | 0 .../expressrouteconnections/method_delete.go | 0 .../expressrouteconnections/method_get.go | 0 .../expressrouteconnections/method_list.go | 0 .../model_expressroutecircuitpeeringid.go | 0 .../model_expressrouteconnection.go | 0 .../model_expressrouteconnectionlist.go | 0 .../model_expressrouteconnectionproperties.go | 0 .../model_propagatedroutetable.go | 0 .../model_routingconfiguration.go | 0 .../model_staticroute.go | 0 .../model_staticroutesconfig.go | 0 .../model_subresource.go | 0 .../model_vnetroute.go | 0 .../expressrouteconnections/version.go | 12 + .../README.md | 37 + .../client.go | 0 .../id_peeringarptable.go | 0 .../id_peeringarptable_test.go | 0 ...xpressroutecrossconnectionslistarptable.go | 0 .../model_expressroutecircuitarptable.go | 0 .../predicates.go | 0 .../version.go | 12 + .../README.md | 82 + .../client.go | 0 .../constants.go | 0 .../id_expressroutecrossconnection.go | 0 .../id_expressroutecrossconnection_test.go | 0 .../id_peering.go | 0 .../id_peering_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../model_expressroutecircuitpeeringconfig.go | 0 ...odel_expressroutecrossconnectionpeering.go | 0 ...ssroutecrossconnectionpeeringproperties.go | 0 ...el_ipv6expressroutecircuitpeeringconfig.go | 0 .../model_subresource.go | 0 .../predicates.go | 0 .../version.go | 12 + .../README.md | 37 + .../client.go | 0 ...ssroutecrossconnectionpeeringroutetable.go | 0 ...tecrossconnectionpeeringroutetable_test.go | 0 ...essroutecrossconnectionslistroutestable.go | 0 .../model_expressroutecircuitroutestable.go | 0 .../predicates.go | 0 .../version.go | 12 + .../README.md | 37 + .../client.go | 0 .../id_peeringroutetablessummary.go | 0 .../id_peeringroutetablessummary_test.go | 0 ...ecrossconnectionslistroutestablesummary.go | 0 ...sroutecrossconnectionroutestablesummary.go | 0 .../predicates.go | 0 .../version.go | 12 + .../expressroutecrossconnections/README.md | 109 + .../expressroutecrossconnections/client.go | 0 .../expressroutecrossconnections/constants.go | 0 .../id_expressroutecrossconnection.go | 0 .../id_expressroutecrossconnection_test.go | 0 .../method_createorupdate.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../method_updatetags.go | 0 .../model_expressroutecircuitpeeringconfig.go | 0 .../model_expressroutecircuitreference.go | 0 .../model_expressroutecrossconnection.go | 0 ...odel_expressroutecrossconnectionpeering.go | 0 ...ssroutecrossconnectionpeeringproperties.go | 0 ...l_expressroutecrossconnectionproperties.go | 0 ...el_ipv6expressroutecircuitpeeringconfig.go | 0 .../model_subresource.go | 0 .../model_tagsobject.go | 0 .../predicates.go | 0 .../expressroutecrossconnections/version.go | 12 + .../2022-07-01/expressroutegateways/README.md | 115 + .../expressroutegateways/client.go | 0 .../expressroutegateways/constants.go | 0 .../id_expressroutegateway.go | 0 .../id_expressroutegateway_test.go | 0 .../method_createorupdate.go | 0 .../expressroutegateways/method_delete.go | 0 .../expressroutegateways/method_get.go | 0 .../method_listbyresourcegroup.go | 0 .../method_listbysubscription.go | 0 .../expressroutegateways/method_updatetags.go | 0 .../model_expressroutecircuitpeeringid.go | 0 .../model_expressrouteconnection.go | 0 .../model_expressrouteconnectionproperties.go | 0 .../model_expressroutegateway.go | 0 .../model_expressroutegatewaylist.go | 0 .../model_expressroutegatewayproperties.go | 0 ...gatewaypropertiesautoscaleconfiguration.go | 0 ...ypropertiesautoscaleconfigurationbounds.go | 0 .../model_propagatedroutetable.go | 0 .../model_routingconfiguration.go | 0 .../expressroutegateways/model_staticroute.go | 0 .../model_staticroutesconfig.go | 0 .../expressroutegateways/model_subresource.go | 0 .../expressroutegateways/model_tagsobject.go | 0 .../model_virtualhubid.go | 0 .../expressroutegateways/model_vnetroute.go | 0 .../expressroutegateways/version.go | 12 + .../2022-07-01/expressroutelinks/README.md | 53 + .../expressroutelinks/client.go | 0 .../expressroutelinks/constants.go | 0 .../expressroutelinks/id_expressrouteport.go | 0 .../id_expressrouteport_test.go | 0 .../expressroutelinks/id_link.go | 0 .../expressroutelinks/id_link_test.go | 0 .../expressroutelinks/method_get.go | 0 .../expressroutelinks/method_list.go | 0 .../model_expressroutelink.go | 0 .../model_expressroutelinkmacsecconfig.go | 0 .../model_expressroutelinkpropertiesformat.go | 0 .../expressroutelinks/predicates.go | 0 .../2022-07-01/expressroutelinks/version.go | 12 + .../expressrouteportauthorizations/README.md | 82 + .../expressrouteportauthorizations/client.go | 0 .../constants.go | 0 .../id_expressrouteport.go | 0 .../id_expressrouteport_test.go | 0 .../id_expressrouteportauthorization.go | 0 .../id_expressrouteportauthorization_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../model_expressrouteportauthorization.go | 0 ...srouteportauthorizationpropertiesformat.go | 0 .../predicates.go | 0 .../expressrouteportauthorizations/version.go | 12 + .../2022-07-01/expressrouteports/README.md | 142 + .../expressrouteports/client.go | 0 .../expressrouteports/constants.go | 0 .../expressrouteports/id_expressrouteport.go | 0 .../id_expressrouteport_test.go | 0 .../method_createorupdate.go | 0 .../expressrouteports/method_delete.go | 0 .../expressrouteports/method_generateloa.go | 0 .../expressrouteports/method_get.go | 0 .../expressrouteports/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../expressrouteports/method_updatetags.go | 0 .../model_expressroutelink.go | 0 .../model_expressroutelinkmacsecconfig.go | 0 .../model_expressroutelinkpropertiesformat.go | 0 .../model_expressrouteport.go | 0 .../model_expressrouteportpropertiesformat.go | 0 ...del_generateexpressrouteportsloarequest.go | 0 ...odel_generateexpressrouteportsloaresult.go | 0 .../expressrouteports/model_subresource.go | 0 .../expressrouteports/model_tagsobject.go | 0 .../expressrouteports/predicates.go | 0 .../2022-07-01/expressrouteports/version.go | 12 + .../expressrouteportslocations/README.md | 54 + .../expressrouteportslocations/client.go | 0 .../expressrouteportslocations/constants.go | 0 .../id_expressrouteportslocation.go | 0 .../id_expressrouteportslocation_test.go | 0 .../expressrouteportslocations/method_get.go | 0 .../expressrouteportslocations/method_list.go | 0 .../model_expressrouteportslocation.go | 0 ...del_expressrouteportslocationbandwidths.go | 0 ...pressrouteportslocationpropertiesformat.go | 0 .../expressrouteportslocations/predicates.go | 0 .../expressrouteportslocations/version.go | 12 + .../expressrouteproviderports/README.md | 54 + .../expressrouteproviderports/client.go | 0 .../id_expressrouteproviderport.go | 0 .../id_expressrouteproviderport_test.go | 0 .../method_expressrouteproviderport.go | 0 .../method_locationlist.go | 0 .../model_expressrouteproviderport.go | 0 ...odel_expressrouteproviderportproperties.go | 0 .../expressrouteproviderports/predicates.go | 0 .../expressrouteproviderports/version.go | 12 + .../expressrouteserviceproviders/README.md | 38 + .../expressrouteserviceproviders/client.go | 0 .../expressrouteserviceproviders/constants.go | 0 .../method_list.go | 0 .../model_expressrouteserviceprovider.go | 0 ...ssrouteserviceproviderbandwidthsoffered.go | 0 ...essrouteserviceproviderpropertiesformat.go | 0 .../predicates.go | 0 .../expressrouteserviceproviders/version.go | 12 + .../2022-07-01/firewallpolicies/README.md | 237 ++ .../firewallpolicies/client.go | 0 .../firewallpolicies/constants.go | 0 .../firewallpolicies/id_firewallpolicy.go | 0 .../id_firewallpolicy_test.go | 0 .../firewallpolicies/method_createorupdate.go | 0 .../firewallpolicies/method_delete.go | 0 ...allpolicyidpssignaturesfiltervalueslist.go | 0 ...method_firewallpolicyidpssignatureslist.go | 0 ...irewallpolicyidpssignaturesoverridesget.go | 0 ...rewallpolicyidpssignaturesoverrideslist.go | 0 ...ewallpolicyidpssignaturesoverridespatch.go | 0 ...irewallpolicyidpssignaturesoverridesput.go | 0 .../firewallpolicies/method_get.go | 0 .../firewallpolicies/method_list.go | 0 .../firewallpolicies/method_listall.go | 0 .../firewallpolicies/method_updatetags.go | 0 .../firewallpolicies/model_dnssettings.go | 0 .../firewallpolicies/model_explicitproxy.go | 0 .../firewallpolicies/model_filteritems.go | 0 .../firewallpolicies/model_firewallpolicy.go | 0 ...odel_firewallpolicycertificateauthority.go | 0 .../model_firewallpolicyinsights.go | 0 .../model_firewallpolicyintrusiondetection.go | 0 ...iondetectionbypasstrafficspecifications.go | 0 ...llpolicyintrusiondetectionconfiguration.go | 0 ...ntrusiondetectionsignaturespecification.go | 0 ...del_firewallpolicyloganalyticsresources.go | 0 ...del_firewallpolicyloganalyticsworkspace.go | 0 .../model_firewallpolicypropertiesformat.go | 0 .../model_firewallpolicysku.go | 0 .../model_firewallpolicysnat.go | 0 .../model_firewallpolicysql.go | 0 ...odel_firewallpolicythreatintelwhitelist.go | 0 .../model_firewallpolicytransportsecurity.go | 0 .../firewallpolicies/model_idpsqueryobject.go | 0 .../firewallpolicies/model_orderby.go | 0 .../firewallpolicies/model_queryresults.go | 0 ...del_signatureoverridesfiltervaluesquery.go | 0 ..._signatureoverridesfiltervaluesresponse.go | 0 .../model_signaturesoverrides.go | 0 .../model_signaturesoverrideslist.go | 0 .../model_signaturesoverridesproperties.go | 0 .../model_singlequeryresult.go | 0 .../firewallpolicies/model_subresource.go | 0 .../firewallpolicies/model_tagsobject.go | 0 .../firewallpolicies/predicates.go | 0 .../2022-07-01/firewallpolicies/version.go | 12 + .../README.md | 82 + .../client.go | 0 .../constants.go | 0 .../id_firewallpolicy.go | 0 .../id_firewallpolicy_test.go | 0 .../id_rulecollectiongroup.go | 0 .../id_rulecollectiongroup_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../model_applicationrule.go | 51 + ...odel_firewallpolicyfilterrulecollection.go | 0 ...irewallpolicyfilterrulecollectionaction.go | 0 .../model_firewallpolicynatrulecollection.go | 0 ...l_firewallpolicynatrulecollectionaction.go | 0 .../model_firewallpolicyrule.go | 0 ...l_firewallpolicyruleapplicationprotocol.go | 0 .../model_firewallpolicyrulecollection.go | 0 ...model_firewallpolicyrulecollectiongroup.go | 0 ...wallpolicyrulecollectiongroupproperties.go | 0 .../model_natrule.go | 0 .../model_networkrule.go | 0 .../predicates.go | 0 .../version.go | 12 + .../network/2022-07-01/flowlogs/README.md | 103 + .../flowlogs/client.go | 0 .../flowlogs/constants.go | 0 .../flowlogs/id_flowlog.go | 0 .../flowlogs/id_flowlog_test.go | 0 .../flowlogs/id_networkwatcher.go | 0 .../flowlogs/id_networkwatcher_test.go | 0 .../flowlogs/method_createorupdate.go | 0 .../flowlogs/method_delete.go | 0 .../flowlogs/method_get.go | 0 .../flowlogs/method_list.go | 0 .../flowlogs/method_updatetags.go | 0 .../flowlogs/model_flowlog.go | 0 .../flowlogs/model_flowlogformatparameters.go | 0 .../flowlogs/model_flowlogpropertiesformat.go | 0 .../model_retentionpolicyparameters.go | 0 .../flowlogs/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../flowlogs/predicates.go | 0 .../network/2022-07-01/flowlogs/version.go | 12 + .../2022-07-01/ipallocations/README.md | 121 + .../ipallocations/client.go | 0 .../ipallocations/constants.go | 0 .../ipallocations/id_ipallocation.go | 0 .../ipallocations/id_ipallocation_test.go | 0 .../ipallocations/method_createorupdate.go | 0 .../ipallocations/method_delete.go | 0 .../ipallocations/method_get.go | 0 .../ipallocations/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../ipallocations/method_updatetags.go | 0 .../ipallocations/model_ipallocation.go | 0 .../model_ipallocationpropertiesformat.go | 0 .../ipallocations/model_subresource.go | 0 .../ipallocations/model_tagsobject.go | 0 .../ipallocations/predicates.go | 0 .../2022-07-01/ipallocations/version.go | 12 + .../network/2022-07-01/ipgroups/README.md | 121 + .../ipgroups/client.go | 0 .../ipgroups/constants.go | 0 .../ipgroups/id_ipgroup.go | 0 .../ipgroups/id_ipgroup_test.go | 0 .../ipgroups/method_createorupdate.go | 0 .../ipgroups/method_delete.go | 0 .../ipgroups/method_get.go | 0 .../ipgroups/method_list.go | 0 .../ipgroups/method_listbyresourcegroup.go | 0 .../ipgroups/method_updategroups.go | 0 .../ipgroups/model_ipgroup.go | 0 .../ipgroups/model_ipgrouppropertiesformat.go | 0 .../ipgroups/model_subresource.go | 0 .../ipgroups/model_tagsobject.go | 0 .../ipgroups/predicates.go | 0 .../network/2022-07-01/ipgroups/version.go | 12 + .../2022-07-01/loadbalancers/README.md | 428 +++ .../loadbalancers/client.go | 0 .../2022-07-01/loadbalancers/constants.go | 1230 +++++++ .../loadbalancers/id_backendaddresspool.go | 0 .../id_backendaddresspool_test.go | 0 .../id_frontendipconfiguration.go | 0 .../id_frontendipconfiguration_test.go | 0 .../loadbalancers/id_inboundnatrule.go | 0 .../loadbalancers/id_inboundnatrule_test.go | 0 .../loadbalancers/id_loadbalancer.go | 130 + .../loadbalancers/id_loadbalancer_test.go | 282 ++ .../id_loadbalancerbackendaddresspool.go | 0 .../id_loadbalancerbackendaddresspool_test.go | 0 .../loadbalancers/id_loadbalancingrule.go | 0 .../id_loadbalancingrule_test.go | 0 .../loadbalancers/id_location.go | 0 .../loadbalancers/id_location_test.go | 0 .../loadbalancers/id_outboundrule.go | 0 .../loadbalancers/id_outboundrule_test.go | 0 .../loadbalancers/id_probe.go | 0 .../loadbalancers/id_probe_test.go | 0 .../loadbalancers/method_createorupdate.go | 75 + .../2022-07-01/loadbalancers/method_delete.go | 71 + .../2022-07-01/loadbalancers/method_get.go | 83 + .../method_inboundnatrulescreateorupdate.go | 0 .../method_inboundnatrulesdelete.go | 0 .../method_inboundnatrulesget.go | 0 .../method_inboundnatruleslist.go | 91 + .../loadbalancers/method_list.go | 0 .../loadbalancers/method_listall.go | 0 .../method_listinboundnatruleportmappings.go | 0 ...lancerbackendaddresspoolscreateorupdate.go | 0 ...d_loadbalancerbackendaddresspoolsdelete.go | 0 ...thod_loadbalancerbackendaddresspoolsget.go | 0 ...hod_loadbalancerbackendaddresspoolslist.go | 91 + ...loadbalancerfrontendipconfigurationsget.go | 0 ...oadbalancerfrontendipconfigurationslist.go | 91 + ...ethod_loadbalancerloadbalancingrulesget.go | 0 ...thod_loadbalancerloadbalancingruleslist.go | 91 + ...ethod_loadbalancernetworkinterfaceslist.go | 91 + .../method_loadbalanceroutboundrulesget.go | 0 .../method_loadbalanceroutboundruleslist.go | 91 + .../method_loadbalancerprobesget.go | 0 .../method_loadbalancerprobeslist.go | 91 + .../method_swappublicipaddresses.go | 0 .../loadbalancers/method_updatetags.go | 58 + .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 ...ackendaddressinboundnatruleportmappings.go | 0 .../loadbalancers/model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../loadbalancers/model_ddossettings.go | 0 .../loadbalancers/model_delegation.go | 0 .../loadbalancers/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../loadbalancers/model_inboundnatpool.go | 0 .../model_inboundnatpoolpropertiesformat.go | 0 .../loadbalancers/model_inboundnatrule.go | 0 .../model_inboundnatruleportmapping.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../loadbalancers/model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../loadbalancers/model_iptag.go | 0 .../loadbalancers/model_loadbalancer.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../model_loadbalancerpropertiesformat.go | 0 .../loadbalancers/model_loadbalancersku.go | 0 .../model_loadbalancervipswaprequest.go | 0 ...ervipswaprequestfrontendipconfiguration.go | 0 ...equestfrontendipconfigurationproperties.go | 0 .../loadbalancers/model_loadbalancingrule.go | 0 ...model_loadbalancingrulepropertiesformat.go | 0 .../loadbalancers/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../loadbalancers/model_natgatewaysku.go | 0 .../loadbalancers/model_natruleportmapping.go | 0 .../loadbalancers/model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../loadbalancers/model_outboundrule.go | 0 .../model_outboundrulepropertiesformat.go | 0 .../loadbalancers/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../loadbalancers/model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../loadbalancers/model_probe.go | 0 .../model_probepropertiesformat.go | 0 .../loadbalancers/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../loadbalancers/model_publicipaddresssku.go | 0 ...l_queryinboundnatruleportmappingrequest.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../loadbalancers/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../loadbalancers/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../loadbalancers/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../loadbalancers/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../loadbalancers/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../loadbalancers/model_subresource.go | 0 .../loadbalancers/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../loadbalancers/model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../loadbalancers/predicates.go | 0 .../2022-07-01/loadbalancers/version.go | 12 + .../2022-07-01/localnetworkgateways/README.md | 104 + .../localnetworkgateways/client.go | 0 .../localnetworkgateways/constants.go | 0 .../id_localnetworkgateway.go | 0 .../id_localnetworkgateway_test.go | 0 .../method_createorupdate.go | 0 .../localnetworkgateways/method_delete.go | 0 .../localnetworkgateways/method_get.go | 0 .../localnetworkgateways/method_list.go | 0 .../localnetworkgateways/method_updatetags.go | 0 .../model_addressspace.go | 0 .../localnetworkgateways/model_bgpsettings.go | 0 .../model_ipconfigurationbgppeeringaddress.go | 0 .../model_localnetworkgateway.go | 0 ...del_localnetworkgatewaypropertiesformat.go | 0 .../localnetworkgateways/model_tagsobject.go | 0 .../localnetworkgateways/predicates.go | 0 .../localnetworkgateways/version.go | 12 + .../network/2022-07-01/natgateways/README.md | 121 + .../natgateways/client.go | 0 .../natgateways/constants.go | 0 .../natgateways/id_natgateway.go | 0 .../natgateways/id_natgateway_test.go | 0 .../natgateways/method_createorupdate.go | 0 .../natgateways/method_delete.go | 0 .../natgateways/method_get.go | 0 .../natgateways/method_list.go | 0 .../natgateways/method_listall.go | 0 .../natgateways/method_updatetags.go | 0 .../natgateways/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../natgateways/model_natgatewaysku.go | 0 .../natgateways/model_subresource.go | 0 .../natgateways/model_tagsobject.go | 0 .../natgateways/predicates.go | 0 .../network/2022-07-01/natgateways/version.go | 12 + .../2022-07-01/networkgroups/README.md | 86 + .../networkgroups/client.go | 0 .../networkgroups/constants.go | 0 .../networkgroups/id_networkgroup.go | 0 .../networkgroups/id_networkgroup_test.go | 0 .../networkgroups/id_networkmanager.go | 0 .../networkgroups/id_networkmanager_test.go | 0 .../networkgroups/method_createorupdate.go | 0 .../networkgroups/method_delete.go | 0 .../networkgroups/method_get.go | 0 .../networkgroups/method_list.go | 0 .../networkgroups/model_networkgroup.go | 0 .../model_networkgroupproperties.go | 9 + .../networkgroups/predicates.go | 0 .../2022-07-01/networkgroups/version.go | 12 + .../2022-07-01/networkinterfaces/README.md | 371 +++ .../2022-07-01}/networkinterfaces/client.go | 0 .../2022-07-01/networkinterfaces/constants.go | 1362 ++++++++ .../id_providercloudservice.go | 0 .../id_providercloudservice_test.go | 0 .../networkinterfaces/id_roleinstance.go | 0 .../networkinterfaces/id_roleinstance_test.go | 0 .../id_roleinstancenetworkinterface.go | 0 .../id_roleinstancenetworkinterface_test.go | 0 .../networkinterfaces/id_tapconfiguration.go | 0 .../id_tapconfiguration_test.go | 0 .../networkinterfaces/id_virtualmachine.go | 0 .../id_virtualmachine_test.go | 0 .../id_virtualmachinescaleset.go | 0 .../id_virtualmachinescaleset_test.go | 0 .../method_createorupdate.go | 0 .../networkinterfaces/method_delete.go | 0 .../networkinterfaces/method_get.go | 0 .../method_getcloudservicenetworkinterface.go | 0 .../method_geteffectiveroutetable.go | 0 ...etvirtualmachinescalesetipconfiguration.go | 0 ...tvirtualmachinescalesetnetworkinterface.go | 0 .../networkinterfaces/method_list.go | 0 .../networkinterfaces/method_listall.go | 0 ...ethod_listcloudservicenetworkinterfaces.go | 0 ...oudserviceroleinstancenetworkinterfaces.go | 0 ...thod_listeffectivenetworksecuritygroups.go | 0 ...tvirtualmachinescalesetipconfigurations.go | 0 ...virtualmachinescalesetnetworkinterfaces.go | 0 ...rtualmachinescalesetvmnetworkinterfaces.go | 0 ...hod_networkinterfaceipconfigurationsget.go | 0 ...od_networkinterfaceipconfigurationslist.go | 0 ...ethod_networkinterfaceloadbalancerslist.go | 0 ...od_networkinterfacetapconfigurationsget.go | 0 ...d_networkinterfacetapconfigurationslist.go | 0 .../networkinterfaces/method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../networkinterfaces/model_ddossettings.go | 0 .../networkinterfaces/model_delegation.go | 0 .../model_effectivenetworksecuritygroup.go | 0 ...ffectivenetworksecuritygroupassociation.go | 0 .../model_effectivenetworksecurityrule.go | 0 .../networkinterfaces/model_effectiveroute.go | 0 .../networkinterfaces/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../networkinterfaces/model_inboundnatpool.go | 0 .../model_inboundnatpoolpropertiesformat.go | 0 .../networkinterfaces/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../networkinterfaces/model_iptag.go | 0 .../networkinterfaces/model_loadbalancer.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../model_loadbalancerpropertiesformat.go | 0 .../model_loadbalancersku.go | 0 .../model_loadbalancingrule.go | 0 ...model_loadbalancingrulepropertiesformat.go | 0 .../networkinterfaces/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../networkinterfaces/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../networkinterfaces/model_outboundrule.go | 0 .../model_outboundrulepropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../networkinterfaces/model_probe.go | 0 .../model_probepropertiesformat.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../networkinterfaces/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../networkinterfaces/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../networkinterfaces/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../networkinterfaces/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../networkinterfaces/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../networkinterfaces/model_subresource.go | 0 .../networkinterfaces/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../networkinterfaces/predicates.go | 0 .../2022-07-01/networkinterfaces/version.go | 12 + .../README.md | 41 + .../client.go | 0 .../constants.go | 0 .../id_networkmanager.go | 0 .../id_networkmanager_test.go | 0 .../method_listactivesecurityadminrules.go | 0 .../model_activebasesecurityadminrule.go | 0 .../model_activeconfigurationparameter.go | 0 .../model_activedefaultsecurityadminrule.go | 0 .../model_activesecurityadminrule.go | 0 ...odel_activesecurityadminruleslistresult.go | 0 .../model_addressprefixitem.go | 0 .../model_adminpropertiesformat.go | 17 + .../model_configurationgroup.go | 0 .../model_defaultadminpropertiesformat.go | 18 + .../model_networkgroupproperties.go | 9 + .../model_networkmanagersecuritygroupitem.go | 0 .../version.go | 12 + .../README.md | 41 + .../client.go | 0 .../constants.go | 0 .../id_networkmanager.go | 0 .../id_networkmanager_test.go | 0 ...od_listactiveconnectivityconfigurations.go | 0 .../model_activeconfigurationparameter.go | 0 .../model_activeconnectivityconfiguration.go | 0 ...iveconnectivityconfigurationslistresult.go | 0 .../model_configurationgroup.go | 0 ...del_connectivityconfigurationproperties.go | 14 + .../model_connectivitygroupitem.go | 0 .../model_hub.go | 0 .../model_networkgroupproperties.go | 9 + .../version.go | 12 + .../networkmanagerconnections/README.md | 161 + .../networkmanagerconnections/client.go | 0 .../networkmanagerconnections/constants.go | 0 .../id_networkmanagerconnection.go | 0 .../id_networkmanagerconnection_test.go | 0 .../id_providers2networkmanagerconnection.go | 0 ...providers2networkmanagerconnection_test.go | 0 ...networkmanagerconnectionscreateorupdate.go | 0 ...entgroupnetworkmanagerconnectionsdelete.go | 0 ...gementgroupnetworkmanagerconnectionsget.go | 0 ...ementgroupnetworkmanagerconnectionslist.go | 0 ...networkmanagerconnectionscreateorupdate.go | 0 ...criptionnetworkmanagerconnectionsdelete.go | 0 ...ubscriptionnetworkmanagerconnectionsget.go | 0 ...bscriptionnetworkmanagerconnectionslist.go | 0 .../model_networkmanagerconnection.go | 0 ...odel_networkmanagerconnectionproperties.go | 0 .../networkmanagerconnections/predicates.go | 0 .../networkmanagerconnections/version.go | 12 + .../README.md | 42 + .../client.go | 0 .../constants.go | 0 ...agereffectiveconnectivityconfigurations.go | 0 .../model_configurationgroup.go | 0 ...del_connectivityconfigurationproperties.go | 14 + .../model_connectivitygroupitem.go | 0 ...odel_effectiveconnectivityconfiguration.go | 0 .../model_hub.go | 0 .../model_networkgroupproperties.go | 9 + ...tiveconnectivityconfigurationlistresult.go | 0 .../model_queryrequestoptions.go | 0 .../version.go | 12 + .../README.md | 42 + .../client.go | 0 .../constants.go | 0 ...tworkmanagereffectivesecurityadminrules.go | 0 .../model_addressprefixitem.go | 0 .../model_adminpropertiesformat.go | 17 + .../model_configurationgroup.go | 0 .../model_defaultadminpropertiesformat.go | 18 + .../model_effectivebasesecurityadminrule.go | 0 ...model_effectivedefaultsecurityadminrule.go | 0 .../model_effectivesecurityadminrule.go | 0 .../model_networkgroupproperties.go | 9 + ...ereffectivesecurityadminruleslistresult.go | 0 .../model_networkmanagersecuritygroupitem.go | 0 .../model_queryrequestoptions.go | 0 .../version.go | 12 + .../2022-07-01/networkmanagers/README.md | 163 + .../networkmanagers/client.go | 0 .../networkmanagers/constants.go | 0 .../networkmanagers/id_networkmanager.go | 0 .../networkmanagers/id_networkmanager_test.go | 0 .../networkmanagers/method_createorupdate.go | 0 .../networkmanagers/method_delete.go | 0 .../networkmanagers/method_get.go | 0 .../networkmanagers/method_list.go | 0 .../method_listbysubscription.go | 0 .../method_networkmanagercommitspost.go | 0 ...thod_networkmanagerdeploymentstatuslist.go | 0 .../networkmanagers/method_patch.go | 0 .../model_crosstenantscopes.go | 0 .../networkmanagers/model_networkmanager.go | 0 .../model_networkmanagercommit.go | 0 .../model_networkmanagerdeploymentstatus.go | 0 ...etworkmanagerdeploymentstatuslistresult.go | 0 ...networkmanagerdeploymentstatusparameter.go | 0 .../model_networkmanagerproperties.go | 11 + ...rkmanagerpropertiesnetworkmanagerscopes.go | 0 .../networkmanagers/model_patchobject.go | 0 .../networkmanagers/predicates.go | 0 .../2022-07-01/networkmanagers/version.go | 12 + .../2022-07-01/networkprofiles/README.md | 125 + .../networkprofiles/client.go | 0 .../2022-07-01/networkprofiles/constants.go | 1013 ++++++ .../networkprofiles/id_networkprofile.go | 0 .../networkprofiles/id_networkprofile_test.go | 0 .../networkprofiles/method_createorupdate.go | 0 .../networkprofiles/method_delete.go | 0 .../networkprofiles/method_get.go | 0 .../networkprofiles/method_list.go | 0 .../networkprofiles/method_listall.go | 0 .../networkprofiles/method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_containernetworkinterface.go | 0 ..._containernetworkinterfaceconfiguration.go | 0 ...kinterfaceconfigurationpropertiesformat.go | 0 ...ontainernetworkinterfaceipconfiguration.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 ...ntainernetworkinterfacepropertiesformat.go | 0 .../model_customdnsconfigpropertiesformat.go | 0 .../networkprofiles/model_ddossettings.go | 0 .../networkprofiles/model_delegation.go | 0 .../networkprofiles/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../networkprofiles/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../networkprofiles/model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../networkprofiles/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../networkprofiles/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../networkprofiles/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../networkprofiles/model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../networkprofiles/model_networkprofile.go | 0 .../model_networkprofilepropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../networkprofiles/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../networkprofiles/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../networkprofiles/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../networkprofiles/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../networkprofiles/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../networkprofiles/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../networkprofiles/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../networkprofiles/model_subresource.go | 0 .../networkprofiles/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../networkprofiles/predicates.go | 0 .../2022-07-01/networkprofiles/version.go | 12 + .../networksecuritygroups/README.md | 121 + .../networksecuritygroups/client.go | 0 .../networksecuritygroups/constants.go | 1013 ++++++ .../id_networksecuritygroup.go | 0 .../id_networksecuritygroup_test.go | 0 .../method_createorupdate.go | 0 .../networksecuritygroups/method_delete.go | 0 .../networksecuritygroups/method_get.go | 0 .../networksecuritygroups/method_list.go | 0 .../networksecuritygroups/method_listall.go | 0 .../method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../model_ddossettings.go | 0 .../networksecuritygroups/model_delegation.go | 0 .../networksecuritygroups/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../networksecuritygroups/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../networksecuritygroups/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../networksecuritygroups/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../networksecuritygroups/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../networksecuritygroups/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../model_subresource.go | 0 .../networksecuritygroups/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../networksecuritygroups/predicates.go | 0 .../networksecuritygroups/version.go | 12 + .../networkvirtualappliances/README.md | 138 + .../networkvirtualappliances/client.go | 0 .../networkvirtualappliances/constants.go | 0 .../id_inboundsecurityrule.go | 0 .../id_inboundsecurityrule_test.go | 0 .../id_networkvirtualappliance.go | 0 .../id_networkvirtualappliance_test.go | 0 .../method_createorupdate.go | 0 .../networkvirtualappliances/method_delete.go | 0 .../networkvirtualappliances/method_get.go | 0 ...ethod_inboundsecurityrulecreateorupdate.go | 0 .../networkvirtualappliances/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../method_updatetags.go | 0 .../model_delegationproperties.go | 0 .../model_inboundsecurityrule.go | 0 .../model_inboundsecurityruleproperties.go | 0 .../model_inboundsecurityrules.go | 0 .../model_networkvirtualappliance.go | 0 ...networkvirtualappliancepropertiesformat.go | 22 + .../model_partnermanagedresourceproperties.go | 0 .../model_subresource.go | 0 .../model_tagsobject.go | 0 .../model_virtualappliancenicproperties.go | 10 + .../model_virtualapplianceskuproperties.go | 0 .../networkvirtualappliances/predicates.go | 0 .../networkvirtualappliances/version.go | 12 + .../2022-07-01/networkwatchers/README.md | 331 ++ .../networkwatchers/client.go | 0 .../networkwatchers/constants.go | 0 .../networkwatchers/id_networkwatcher.go | 0 .../networkwatchers/id_networkwatcher_test.go | 0 .../method_checkconnectivity.go | 0 .../networkwatchers/method_createorupdate.go | 0 .../networkwatchers/method_delete.go | 0 .../networkwatchers/method_get.go | 0 .../method_getazurereachabilityreport.go | 0 .../method_getflowlogstatus.go | 0 ...ethod_getnetworkconfigurationdiagnostic.go | 0 .../networkwatchers/method_getnexthop.go | 0 .../networkwatchers/method_gettopology.go | 0 .../method_gettroubleshooting.go | 0 .../method_gettroubleshootingresult.go | 0 .../method_getvmsecurityrules.go | 0 .../networkwatchers/method_list.go | 0 .../networkwatchers/method_listall.go | 0 .../method_listavailableproviders.go | 0 .../method_setflowlogconfiguration.go | 0 .../networkwatchers/method_updatetags.go | 0 .../networkwatchers/method_verifyipflow.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_availableproviderslist.go | 0 .../model_availableproviderslistcity.go | 0 .../model_availableproviderslistcountry.go | 0 .../model_availableproviderslistparameters.go | 0 .../model_availableprovidersliststate.go | 0 .../model_azurereachabilityreport.go | 0 .../model_azurereachabilityreportitem.go | 0 ...odel_azurereachabilityreportlatencyinfo.go | 0 .../model_azurereachabilityreportlocation.go | 0 ...model_azurereachabilityreportparameters.go | 0 .../model_connectivitydestination.go | 0 .../networkwatchers/model_connectivityhop.go | 0 .../model_connectivityinformation.go | 0 .../model_connectivityissue.go | 0 .../model_connectivityparameters.go | 0 .../model_connectivitysource.go | 0 .../model_effectivenetworksecurityrule.go | 0 .../model_evaluatednetworksecuritygroup.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowloginformation.go | 0 .../model_flowlogproperties.go | 0 .../model_flowlogstatusparameters.go | 0 .../networkwatchers/model_hoplink.go | 0 .../model_hoplinkproperties.go | 0 .../model_httpconfiguration.go | 0 .../networkwatchers/model_httpheader.go | 0 .../networkwatchers/model_matchedrule.go | 0 ...etworkconfigurationdiagnosticparameters.go | 0 ...l_networkconfigurationdiagnosticprofile.go | 0 ..._networkconfigurationdiagnosticresponse.go | 0 ...el_networkconfigurationdiagnosticresult.go | 0 .../model_networkinterfaceassociation.go | 0 .../model_networksecuritygroupresult.go | 0 ...el_networksecurityrulesevaluationresult.go | 0 .../networkwatchers/model_networkwatcher.go | 0 .../model_networkwatcherlistresult.go | 0 .../model_networkwatcherpropertiesformat.go | 0 .../model_nexthopparameters.go | 0 .../networkwatchers/model_nexthopresult.go | 0 .../model_protocolconfiguration.go | 0 .../model_querytroubleshootingparameters.go | 0 .../model_retentionpolicyparameters.go | 0 .../model_securitygroupnetworkinterface.go | 0 .../model_securitygroupviewparameters.go | 0 .../model_securitygroupviewresult.go | 0 .../networkwatchers/model_securityrule.go | 0 .../model_securityruleassociations.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_subnetassociation.go | 0 .../networkwatchers/model_subresource.go | 0 .../networkwatchers/model_tagsobject.go | 0 .../networkwatchers/model_topology.go | 0 .../model_topologyassociation.go | 0 .../model_topologyparameters.go | 0 .../networkwatchers/model_topologyresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_troubleshootingdetails.go | 0 .../model_troubleshootingparameters.go | 0 .../model_troubleshootingproperties.go | 0 ...model_troubleshootingrecommendedactions.go | 0 .../model_troubleshootingresult.go | 0 .../model_verificationipflowparameters.go | 0 .../model_verificationipflowresult.go | 0 .../2022-07-01/networkwatchers/version.go | 12 + .../2022-07-01/p2svpngateways/README.md | 113 + .../p2svpngateways/client.go | 0 .../p2svpngateways/constants.go | 0 .../method_disconnectp2svpnconnections.go | 0 .../method_generatevpnprofile.go | 0 .../method_getp2svpnconnectionhealth.go | 0 ...ethod_getp2svpnconnectionhealthdetailed.go | 0 .../p2svpngateways/method_reset.go | 0 .../p2svpngateways/method_updatetags.go | 0 .../p2svpngateways/model_addressspace.go | 0 .../model_p2sconnectionconfiguration.go | 0 ...el_p2sconnectionconfigurationproperties.go | 0 .../model_p2svpnconnectionhealth.go | 0 .../model_p2svpnconnectionhealthrequest.go | 0 .../model_p2svpnconnectionrequest.go | 0 .../p2svpngateways/model_p2svpngateway.go | 0 .../model_p2svpngatewayproperties.go | 0 .../model_p2svpnprofileparameters.go | 0 .../model_propagatedroutetable.go | 0 .../model_routingconfiguration.go | 0 .../p2svpngateways/model_staticroute.go | 0 .../model_staticroutesconfig.go | 0 .../p2svpngateways/model_subresource.go | 0 .../p2svpngateways/model_tagsobject.go | 0 .../p2svpngateways/model_vnetroute.go | 0 .../model_vpnclientconnectionhealth.go | 0 .../model_vpnprofileresponse.go | 0 ...model_vpnserverconfigurationpolicygroup.go | 0 ...vpnserverconfigurationpolicygroupmember.go | 0 ...erverconfigurationpolicygroupproperties.go | 0 .../2022-07-01/p2svpngateways/version.go | 12 + .../2022-07-01/packetcaptures/README.md | 105 + .../packetcaptures/client.go | 0 .../packetcaptures/constants.go | 0 .../packetcaptures/id_networkwatcher.go | 0 .../packetcaptures/id_networkwatcher_test.go | 0 .../packetcaptures/id_packetcapture.go | 0 .../packetcaptures/id_packetcapture_test.go | 0 .../packetcaptures/method_create.go | 0 .../packetcaptures/method_delete.go | 0 .../packetcaptures/method_get.go | 0 .../packetcaptures/method_getstatus.go | 0 .../packetcaptures/method_list.go | 0 .../packetcaptures/method_stop.go | 0 .../packetcaptures/model_packetcapture.go | 0 .../model_packetcapturefilter.go | 0 .../model_packetcapturelistresult.go | 0 .../model_packetcapturemachinescope.go | 0 .../model_packetcaptureparameters.go | 0 .../model_packetcapturequerystatusresult.go | 0 .../model_packetcaptureresult.go | 0 .../model_packetcaptureresultproperties.go | 0 .../model_packetcapturestoragelocation.go | 0 .../2022-07-01/packetcaptures/version.go | 12 + .../README.md | 54 + .../client.go | 0 .../constants.go | 0 .../id_peerconnection.go | 0 .../id_peerconnection_test.go | 0 .../method_get.go | 0 .../method_list.go | 0 ...model_peerexpressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../model_subresource.go | 0 .../predicates.go | 0 .../version.go | 12 + .../2022-07-01/privatednszonegroups/README.md | 82 + .../privatednszonegroups/client.go | 0 .../privatednszonegroups/constants.go | 0 .../id_privatednszonegroup.go | 0 .../id_privatednszonegroup_test.go | 0 .../id_privateendpoint.go | 0 .../id_privateendpoint_test.go | 0 .../method_createorupdate.go | 0 .../privatednszonegroups/method_delete.go | 0 .../privatednszonegroups/method_get.go | 0 .../privatednszonegroups/method_list.go | 0 .../model_privatednszoneconfig.go | 0 .../model_privatednszonegroup.go | 0 ...del_privatednszonegrouppropertiesformat.go | 0 .../model_privatednszonepropertiesformat.go | 0 .../privatednszonegroups/model_recordset.go | 0 .../privatednszonegroups/predicates.go | 0 .../privatednszonegroups/version.go | 12 + .../2022-07-01/privateendpoints/README.md | 134 + .../privateendpoints/client.go | 0 .../2022-07-01/privateendpoints/constants.go | 1013 ++++++ .../privateendpoints/id_location.go | 0 .../privateendpoints/id_location_test.go | 0 .../privateendpoints/id_privateendpoint.go | 0 .../id_privateendpoint_test.go | 0 .../privateendpoints/id_providerlocation.go | 0 .../id_providerlocation_test.go | 0 ...ethod_availableprivateendpointtypeslist.go | 0 ...privateendpointtypeslistbyresourcegroup.go | 0 .../privateendpoints/method_createorupdate.go | 0 .../privateendpoints/method_delete.go | 0 .../privateendpoints/method_get.go | 0 .../privateendpoints/method_list.go | 0 .../method_listbysubscription.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_availableprivateendpointtype.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../privateendpoints/model_ddossettings.go | 0 .../privateendpoints/model_delegation.go | 0 .../privateendpoints/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../privateendpoints/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../privateendpoints/model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../privateendpoints/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../privateendpoints/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../privateendpoints/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../privateendpoints/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../privateendpoints/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../privateendpoints/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../privateendpoints/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../privateendpoints/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../privateendpoints/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../privateendpoints/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../privateendpoints/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../privateendpoints/predicates.go | 0 .../2022-07-01/privateendpoints/version.go | 12 + .../2022-07-01/privatelinkservice/README.md | 37 + .../privatelinkservice/client.go | 0 .../privatelinkservice/constants.go | 1013 ++++++ .../id_privatelinkservice.go | 0 .../id_privatelinkservice_test.go | 0 .../method_createorupdate.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../privatelinkservice/model_ddossettings.go | 0 .../privatelinkservice/model_delegation.go | 0 .../privatelinkservice/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../privatelinkservice/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../privatelinkservice/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../privatelinkservice/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../privatelinkservice/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../privatelinkservice/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../privatelinkservice/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../privatelinkservice/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../privatelinkservice/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../privatelinkservice/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../2022-07-01/privatelinkservice/version.go | 12 + .../2022-07-01/privatelinkservices/README.md | 217 ++ .../privatelinkservices/client.go | 0 .../privatelinkservices/constants.go | 1013 ++++++ .../privatelinkservices/id_location.go | 0 .../privatelinkservices/id_location_test.go | 0 .../id_privateendpointconnection.go | 0 .../id_privateendpointconnection_test.go | 0 .../id_privatelinkservice.go | 0 .../id_privatelinkservice_test.go | 0 .../id_providerlocation.go | 0 .../id_providerlocation_test.go | 0 ...ethod_checkprivatelinkservicevisibility.go | 0 ...atelinkservicevisibilitybyresourcegroup.go | 0 .../privatelinkservices/method_delete.go | 0 .../method_deleteprivateendpointconnection.go | 0 .../privatelinkservices/method_get.go | 0 .../method_getprivateendpointconnection.go | 0 .../privatelinkservices/method_list.go | 0 ...hod_listautoapprovedprivatelinkservices.go | 0 ...rovedprivatelinkservicesbyresourcegroup.go | 0 .../method_listbysubscription.go | 0 .../method_listprivateendpointconnections.go | 0 .../method_updateprivateendpointconnection.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_autoapprovedprivatelinkservice.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + ...heckprivatelinkservicevisibilityrequest.go | 0 .../model_customdnsconfigpropertiesformat.go | 0 .../privatelinkservices/model_ddossettings.go | 0 .../privatelinkservices/model_delegation.go | 0 .../privatelinkservices/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../privatelinkservices/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../privatelinkservices/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_privatelinkservicevisibility.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../privatelinkservices/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../privatelinkservices/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../privatelinkservices/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../privatelinkservices/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../privatelinkservices/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../privatelinkservices/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../privatelinkservices/predicates.go | 0 .../2022-07-01/privatelinkservices/version.go | 12 + .../2022-07-01/publicipaddresses/README.md | 133 + .../publicipaddresses/client.go | 0 .../2022-07-01/publicipaddresses/constants.go | 1054 ++++++ .../method_createorupdate.go | 0 .../method_ddosprotectionstatus.go | 0 .../publicipaddresses/method_delete.go | 0 .../publicipaddresses/method_get.go | 0 .../publicipaddresses/method_list.go | 0 .../publicipaddresses/method_listall.go | 0 .../publicipaddresses/method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../publicipaddresses/model_ddossettings.go | 0 .../publicipaddresses/model_delegation.go | 0 .../publicipaddresses/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../publicipaddresses/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../publicipaddresses/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../publicipaddresses/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../publicipaddresses/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 ...odel_publicipddosprotectionstatusresult.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../publicipaddresses/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../publicipaddresses/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../publicipaddresses/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../publicipaddresses/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../publicipaddresses/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../publicipaddresses/model_subresource.go | 0 .../publicipaddresses/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../publicipaddresses/predicates.go | 0 .../2022-07-01/publicipaddresses/version.go | 12 + .../2022-07-01/publicipprefixes/README.md | 121 + .../publicipprefixes/client.go | 0 .../publicipprefixes/constants.go | 0 .../publicipprefixes/id_publicipprefix.go | 0 .../id_publicipprefix_test.go | 0 .../publicipprefixes/method_createorupdate.go | 0 .../publicipprefixes/method_delete.go | 0 .../publicipprefixes/method_get.go | 0 .../publicipprefixes/method_list.go | 0 .../publicipprefixes/method_listall.go | 0 .../publicipprefixes/method_updatetags.go | 0 .../publicipprefixes/model_iptag.go | 0 .../publicipprefixes/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../publicipprefixes/model_natgatewaysku.go | 0 .../publicipprefixes/model_publicipprefix.go | 0 .../model_publicipprefixpropertiesformat.go | 0 .../model_publicipprefixsku.go | 0 .../model_referencedpublicipaddress.go | 0 .../publicipprefixes/model_subresource.go | 0 .../publicipprefixes/model_tagsobject.go | 0 .../publicipprefixes/predicates.go | 0 .../2022-07-01/publicipprefixes/version.go | 12 + .../2022-07-01/routefilterrules/README.md | 82 + .../routefilterrules/client.go | 0 .../routefilterrules/constants.go | 0 .../routefilterrules/id_routefilter.go | 0 .../routefilterrules/id_routefilter_test.go | 0 .../routefilterrules/id_routefilterrule.go | 0 .../id_routefilterrule_test.go | 0 .../routefilterrules/method_createorupdate.go | 0 .../routefilterrules/method_delete.go | 0 .../routefilterrules/method_get.go | 0 .../method_listbyroutefilter.go | 0 .../routefilterrules/model_routefilterrule.go | 0 .../model_routefilterrulepropertiesformat.go | 0 .../routefilterrules/predicates.go | 0 .../2022-07-01/routefilterrules/version.go | 12 + .../network/2022-07-01/routefilters/README.md | 121 + .../routefilters/client.go | 0 .../routefilters/constants.go | 0 .../routefilters/id_routefilter.go | 0 .../routefilters/id_routefilter_test.go | 0 .../routefilters/method_createorupdate.go | 0 .../routefilters/method_delete.go | 0 .../routefilters/method_get.go | 0 .../routefilters/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../routefilters/method_updatetags.go | 0 .../model_expressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../model_expressroutecircuitpeering.go | 0 .../model_expressroutecircuitpeeringconfig.go | 0 ...ressroutecircuitpeeringpropertiesformat.go | 0 .../model_expressroutecircuitstats.go | 0 .../model_expressrouteconnectionid.go | 0 .../model_ipv6circuitconnectionconfig.go | 0 ...el_ipv6expressroutecircuitpeeringconfig.go | 0 ...model_peerexpressroutecircuitconnection.go | 0 ...sroutecircuitconnectionpropertiesformat.go | 0 .../routefilters/model_routefilter.go | 0 .../model_routefilterpropertiesformat.go | 0 .../routefilters/model_routefilterrule.go | 0 .../model_routefilterrulepropertiesformat.go | 0 .../routefilters/model_subresource.go | 0 .../routefilters/model_tagsobject.go | 0 .../routefilters/predicates.go | 0 .../2022-07-01/routefilters/version.go | 12 + .../network/2022-07-01/routes/README.md | 82 + .../routes/client.go | 0 .../routes/constants.go | 0 .../routes/id_route.go | 0 .../routes/id_route_test.go | 0 .../routes/id_routetable.go | 0 .../routes/id_routetable_test.go | 0 .../routes/method_createorupdate.go | 0 .../routes/method_delete.go | 0 .../routes/method_get.go | 0 .../routes/method_list.go | 0 .../routes/model_route.go | 0 .../routes/model_routepropertiesformat.go | 0 .../routes/predicates.go | 0 .../network/2022-07-01/routes/version.go | 12 + .../network/2022-07-01/routetables/README.md | 121 + .../routetables/client.go | 0 .../2022-07-01/routetables/constants.go | 1013 ++++++ .../routetables/id_routetable.go | 0 .../routetables/id_routetable_test.go | 0 .../routetables/method_createorupdate.go | 0 .../routetables/method_delete.go | 0 .../routetables/method_get.go | 0 .../routetables/method_list.go | 0 .../routetables/method_listall.go | 0 .../routetables/method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../routetables/model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../routetables/model_ddossettings.go | 0 .../routetables/model_delegation.go | 0 .../routetables/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../routetables/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../routetables/model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../routetables/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../routetables/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../routetables/model_natgatewaysku.go | 0 .../routetables/model_natruleportmapping.go | 0 .../routetables/model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../routetables/model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../routetables/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../routetables/model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../routetables/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../routetables/model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../routetables/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../routetables/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../routetables/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../routetables/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../routetables/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../routetables/model_subresource.go | 0 .../routetables/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../routetables/model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../routetables/predicates.go | 0 .../network/2022-07-01/routetables/version.go | 12 + .../2022-07-01/scopeconnections/README.md | 90 + .../scopeconnections/client.go | 0 .../scopeconnections/constants.go | 0 .../scopeconnections/id_networkmanager.go | 0 .../id_networkmanager_test.go | 0 .../scopeconnections/id_scopeconnection.go | 0 .../id_scopeconnection_test.go | 0 .../scopeconnections/method_createorupdate.go | 0 .../scopeconnections/method_delete.go | 0 .../scopeconnections/method_get.go | 0 .../scopeconnections/method_list.go | 0 .../scopeconnections/model_scopeconnection.go | 0 .../model_scopeconnectionproperties.go | 0 .../scopeconnections/predicates.go | 0 .../2022-07-01/scopeconnections/version.go | 12 + .../securityadminconfigurations/README.md | 86 + .../securityadminconfigurations/client.go | 0 .../securityadminconfigurations/constants.go | 0 .../id_networkmanager.go | 0 .../id_networkmanager_test.go | 0 .../id_securityadminconfiguration.go | 0 .../id_securityadminconfiguration_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../securityadminconfigurations/method_get.go | 0 .../method_list.go | 0 .../model_securityadminconfiguration.go | 0 ...urityadminconfigurationpropertiesformat.go | 10 + .../securityadminconfigurations/predicates.go | 0 .../securityadminconfigurations/version.go | 12 + .../securitypartnerproviders/README.md | 121 + .../securitypartnerproviders/client.go | 0 .../securitypartnerproviders/constants.go | 0 .../id_securitypartnerprovider.go | 0 .../id_securitypartnerprovider_test.go | 0 .../method_createorupdate.go | 0 .../securitypartnerproviders/method_delete.go | 0 .../securitypartnerproviders/method_get.go | 0 .../securitypartnerproviders/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../method_updatetags.go | 0 .../model_securitypartnerprovider.go | 0 ...securitypartnerproviderpropertiesformat.go | 0 .../model_subresource.go | 0 .../model_tagsobject.go | 0 .../securitypartnerproviders/predicates.go | 0 .../securitypartnerproviders/version.go | 12 + .../2022-07-01/securityrules/README.md | 115 + .../securityrules/client.go | 0 .../securityrules/constants.go | 0 .../securityrules/id_defaultsecurityrule.go | 0 .../id_defaultsecurityrule_test.go | 0 .../securityrules/id_networksecuritygroup.go | 0 .../id_networksecuritygroup_test.go | 0 .../securityrules/id_securityrule.go | 0 .../securityrules/id_securityrule_test.go | 0 .../securityrules/method_createorupdate.go | 0 .../method_defaultsecurityrulesget.go | 0 .../method_defaultsecurityruleslist.go | 0 .../securityrules/method_delete.go | 0 .../securityrules/method_get.go | 0 .../securityrules/method_list.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../securityrules/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../securityrules/predicates.go | 0 .../2022-07-01/securityrules/version.go | 12 + .../serviceendpointpolicies/README.md | 121 + .../serviceendpointpolicies/client.go | 0 .../serviceendpointpolicies/constants.go | 1013 ++++++ .../id_serviceendpointpolicy.go | 0 .../id_serviceendpointpolicy_test.go | 0 .../method_createorupdate.go | 0 .../serviceendpointpolicies/method_delete.go | 0 .../serviceendpointpolicies/method_get.go | 0 .../serviceendpointpolicies/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../model_ddossettings.go | 0 .../model_delegation.go | 0 .../serviceendpointpolicies/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../serviceendpointpolicies/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../serviceendpointpolicies/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../serviceendpointpolicies/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../model_subresource.go | 0 .../model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../serviceendpointpolicies/predicates.go | 0 .../serviceendpointpolicies/version.go | 12 + .../README.md | 82 + .../client.go | 0 .../constants.go | 0 .../id_serviceendpointpolicy.go | 0 .../id_serviceendpointpolicy_test.go | 0 .../id_serviceendpointpolicydefinition.go | 0 ...id_serviceendpointpolicydefinition_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_listbyresourcegroup.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 .../predicates.go | 0 .../version.go | 12 + .../network/2022-07-01/servicetags/README.md | 53 + .../servicetags/client.go | 0 .../servicetags/id_location.go | 0 .../servicetags/id_location_test.go | 0 .../method_servicetaginformationlist.go | 0 .../servicetags/method_servicetagslist.go | 0 .../model_servicetaginformation.go | 0 ...l_servicetaginformationpropertiesformat.go | 0 .../model_servicetagslistresult.go | 0 .../servicetags/predicates.go | 0 .../network/2022-07-01/servicetags/version.go | 12 + .../2022-07-01/staticmembers/README.md | 90 + .../staticmembers/client.go | 0 .../staticmembers/constants.go | 0 .../staticmembers/id_networkgroup.go | 0 .../staticmembers/id_networkgroup_test.go | 0 .../staticmembers/id_staticmember.go | 0 .../staticmembers/id_staticmember_test.go | 0 .../staticmembers/method_createorupdate.go | 0 .../staticmembers/method_delete.go | 0 .../staticmembers/method_get.go | 0 .../staticmembers/method_list.go | 0 .../staticmembers/model_staticmember.go | 0 .../model_staticmemberproperties.go | 0 .../staticmembers/predicates.go | 0 .../2022-07-01/staticmembers/version.go | 12 + .../network/2022-07-01/subnets/README.md | 83 + .../subnets/client.go | 0 .../network/2022-07-01/subnets/constants.go | 1013 ++++++ .../subnets/method_createorupdate.go | 0 .../subnets/method_delete.go | 0 .../subnets/method_get.go | 0 .../subnets/method_list.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../subnets/model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../subnets/model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../subnets/model_ddossettings.go | 0 .../subnets/model_delegation.go | 0 .../subnets/model_flowlog.go | 0 .../subnets/model_flowlogformatparameters.go | 0 .../subnets/model_flowlogpropertiesformat.go | 0 .../subnets/model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../subnets/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../subnets/model_ipconfiguration.go | 0 .../subnets/model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../subnets/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../subnets/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../subnets/model_natgatewaysku.go | 0 .../subnets/model_natruleportmapping.go | 0 .../subnets/model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../subnets/model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../subnets/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../subnets/model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../subnets/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../subnets/model_publicipaddresssku.go | 0 .../subnets/model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../subnets/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../subnets/model_route.go | 0 .../subnets/model_routepropertiesformat.go | 0 .../subnets/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../subnets/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../subnets/model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../subnets/model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../subnets/model_subnet.go | 0 .../subnets/model_subnetpropertiesformat.go | 26 + .../subnets/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../subnets/model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../subnets/predicates.go | 0 .../network/2022-07-01/subnets/version.go | 12 + .../2022-07-01/trafficanalytics/README.md | 54 + .../trafficanalytics/client.go | 0 .../trafficanalytics/constants.go | 0 .../trafficanalytics/id_networkwatcher.go | 0 .../id_networkwatcher_test.go | 0 .../method_networkwatchersgetflowlogstatus.go | 0 ..._networkwatcherssetflowlogconfiguration.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowloginformation.go | 0 .../model_flowlogproperties.go | 0 .../model_flowlogstatusparameters.go | 0 .../model_retentionpolicyparameters.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../2022-07-01/trafficanalytics/version.go | 12 + .../network/2022-07-01/usages/README.md | 37 + .../usages/client.go | 0 .../usages/constants.go | 0 .../usages/id_location.go | 0 .../usages/id_location_test.go | 0 .../usages/method_list.go | 0 .../usages/model_usage.go | 0 .../usages/model_usagename.go | 0 .../usages/predicates.go | 0 .../network/2022-07-01/usages/version.go | 12 + .../network/2022-07-01/vipswap/README.md | 69 + .../vipswap/client.go | 0 .../vipswap/constants.go | 0 .../vipswap/id_cloudservice.go | 0 .../vipswap/id_cloudservice_test.go | 0 .../vipswap/method_create.go | 0 .../vipswap/method_get.go | 0 .../vipswap/method_list.go | 0 .../vipswap/model_swapresource.go | 0 .../vipswap/model_swapresourcelistresult.go | 0 .../vipswap/model_swapresourceproperties.go | 0 .../network/2022-07-01/vipswap/version.go | 12 + .../virtualappliancesites/README.md | 82 + .../virtualappliancesites/client.go | 0 .../virtualappliancesites/constants.go | 0 .../id_networkvirtualappliance.go | 0 .../id_networkvirtualappliance_test.go | 0 .../id_virtualappliancesite.go | 0 .../id_virtualappliancesite_test.go | 0 .../method_createorupdate.go | 0 .../virtualappliancesites/method_delete.go | 0 .../virtualappliancesites/method_get.go | 0 .../virtualappliancesites/method_list.go | 0 .../model_breakoutcategorypolicies.go | 0 .../model_office365policyproperties.go | 0 .../model_virtualappliancesite.go | 0 .../model_virtualappliancesiteproperties.go | 0 .../virtualappliancesites/predicates.go | 0 .../virtualappliancesites/version.go | 12 + .../2022-07-01/virtualapplianceskus/README.md | 54 + .../virtualapplianceskus/client.go | 0 .../id_networkvirtualappliancesku.go | 0 .../id_networkvirtualappliancesku_test.go | 0 .../virtualapplianceskus/method_get.go | 0 .../virtualapplianceskus/method_list.go | 0 .../model_networkvirtualappliancesku.go | 0 ...del_networkvirtualapplianceskuinstances.go | 0 ...workvirtualapplianceskupropertiesformat.go | 0 .../virtualapplianceskus/predicates.go | 0 .../virtualapplianceskus/version.go | 12 + .../README.md | 208 ++ .../client.go | 0 .../constants.go | 1137 +++++++ .../id_connection.go | 0 .../id_connection_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_getikesas.go | 0 .../method_getsharedkey.go | 0 .../method_list.go | 0 .../method_resetconnection.go | 0 .../method_resetsharedkey.go | 0 .../method_setsharedkey.go | 0 .../method_startpacketcapture.go | 0 .../method_stoppacketcapture.go | 0 .../method_updatetags.go | 0 .../model_addressspace.go | 0 .../model_bgpsettings.go | 0 .../model_connectionresetsharedkey.go | 0 .../model_connectionsharedkey.go | 0 ...atewaycustombgpipaddressipconfiguration.go | 0 .../model_ipconfigurationbgppeeringaddress.go | 0 .../model_ipsecpolicy.go | 0 .../model_localnetworkgateway.go | 0 ...del_localnetworkgatewaypropertiesformat.go | 0 .../model_radiusserver.go | 0 .../model_subresource.go | 0 .../model_tagsobject.go | 0 .../model_trafficselectorpolicy.go | 0 .../model_tunnelconnectionhealth.go | 0 .../model_virtualnetworkgateway.go | 0 .../model_virtualnetworkgatewayconnection.go | 0 ...etworkgatewayconnectionpropertiesformat.go | 0 ...el_virtualnetworkgatewayipconfiguration.go | 0 ...kgatewayipconfigurationpropertiesformat.go | 0 .../model_virtualnetworkgatewaynatrule.go | 0 ..._virtualnetworkgatewaynatruleproperties.go | 0 .../model_virtualnetworkgatewaypolicygroup.go | 0 ..._virtualnetworkgatewaypolicygroupmember.go | 0 ...tualnetworkgatewaypolicygroupproperties.go | 0 ...l_virtualnetworkgatewaypropertiesformat.go | 30 + .../model_virtualnetworkgatewaysku.go | 0 .../model_vngclientconnectionconfiguration.go | 0 ...clientconnectionconfigurationproperties.go | 0 .../model_vpnclientconfiguration.go | 0 .../model_vpnclientrevokedcertificate.go | 0 ...lientrevokedcertificatepropertiesformat.go | 0 .../model_vpnclientrootcertificate.go | 0 ...pnclientrootcertificatepropertiesformat.go | 0 .../model_vpnnatrulemapping.go | 0 .../model_vpnpacketcapturestartparameters.go | 0 .../model_vpnpacketcapturestopparameters.go | 0 .../predicates.go | 0 .../version.go | 12 + .../virtualnetworkgateways/README.md | 414 +++ .../virtualnetworkgateways/client.go | 0 .../virtualnetworkgateways/constants.go | 1269 ++++++++ .../virtualnetworkgateways/id_connection.go | 0 .../id_connection_test.go | 0 .../id_virtualnetworkgateway.go | 0 .../id_virtualnetworkgateway_test.go | 0 .../id_virtualnetworkgatewaynatrule.go | 0 .../id_virtualnetworkgatewaynatrule_test.go | 0 .../method_createorupdate.go | 0 .../virtualnetworkgateways/method_delete.go | 0 ...nectvirtualnetworkgatewayvpnconnections.go | 0 .../method_generatevpnclientpackage.go | 0 .../method_generatevpnprofile.go | 0 .../virtualnetworkgateways/method_get.go | 0 .../method_getadvertisedroutes.go | 0 .../method_getbgppeerstatus.go | 0 .../method_getlearnedroutes.go | 0 .../method_getvpnclientconnectionhealth.go | 0 .../method_getvpnclientipsecparameters.go | 0 .../method_getvpnprofilepackageurl.go | 0 .../virtualnetworkgateways/method_list.go | 0 .../method_listconnections.go | 0 .../virtualnetworkgateways/method_reset.go | 0 .../method_resetvpnclientsharedkey.go | 0 .../method_setvpnclientipsecparameters.go | 0 .../method_startpacketcapture.go | 0 .../method_stoppacketcapture.go | 0 .../method_supportedvpndevices.go | 0 .../method_updatetags.go | 0 ...ualnetworkgatewaynatrulescreateorupdate.go | 0 ...hod_virtualnetworkgatewaynatrulesdelete.go | 0 ...method_virtualnetworkgatewaynatrulesget.go | 0 ...ewaynatruleslistbyvirtualnetworkgateway.go | 0 .../method_vpndeviceconfigurationscript.go | 0 .../model_addressspace.go | 0 .../model_bgppeerstatus.go | 0 .../model_bgppeerstatuslistresult.go | 0 .../model_bgpsettings.go | 0 ...atewaycustombgpipaddressipconfiguration.go | 0 .../model_gatewayroute.go | 0 .../model_gatewayroutelistresult.go | 0 .../model_ipconfigurationbgppeeringaddress.go | 0 .../model_ipsecpolicy.go | 0 .../model_p2svpnconnectionrequest.go | 0 .../model_radiusserver.go | 0 .../model_subresource.go | 0 .../model_tagsobject.go | 0 .../model_trafficselectorpolicy.go | 0 .../model_tunnelconnectionhealth.go | 0 ...irtualnetworkconnectiongatewayreference.go | 0 .../model_virtualnetworkgateway.go | 0 ...rtualnetworkgatewayconnectionlistentity.go | 0 ...wayconnectionlistentitypropertiesformat.go | 0 ...el_virtualnetworkgatewayipconfiguration.go | 0 ...kgatewayipconfigurationpropertiesformat.go | 0 .../model_virtualnetworkgatewaynatrule.go | 0 ..._virtualnetworkgatewaynatruleproperties.go | 0 .../model_virtualnetworkgatewaypolicygroup.go | 0 ..._virtualnetworkgatewaypolicygroupmember.go | 0 ...tualnetworkgatewaypolicygroupproperties.go | 0 ...l_virtualnetworkgatewaypropertiesformat.go | 30 + .../model_virtualnetworkgatewaysku.go | 0 .../model_vngclientconnectionconfiguration.go | 0 ...clientconnectionconfigurationproperties.go | 0 .../model_vpnclientconfiguration.go | 0 .../model_vpnclientconnectionhealthdetail.go | 0 ...nclientconnectionhealthdetaillistresult.go | 0 .../model_vpnclientipsecparameters.go | 0 .../model_vpnclientparameters.go | 0 .../model_vpnclientrevokedcertificate.go | 0 ...lientrevokedcertificatepropertiesformat.go | 0 .../model_vpnclientrootcertificate.go | 0 ...pnclientrootcertificatepropertiesformat.go | 0 .../model_vpndevicescriptparameters.go | 0 .../model_vpnnatrulemapping.go | 0 .../model_vpnpacketcapturestartparameters.go | 0 .../model_vpnpacketcapturestopparameters.go | 0 .../virtualnetworkgateways/predicates.go | 0 .../virtualnetworkgateways/version.go | 12 + .../virtualnetworkpeerings/README.md | 83 + .../virtualnetworkpeerings/client.go | 0 .../virtualnetworkpeerings/constants.go | 0 .../id_virtualnetworkpeering.go | 0 .../id_virtualnetworkpeering_test.go | 0 .../method_createorupdate.go | 0 .../virtualnetworkpeerings/method_delete.go | 0 .../virtualnetworkpeerings/method_get.go | 0 .../virtualnetworkpeerings/method_list.go | 0 .../model_addressspace.go | 0 .../model_subresource.go | 0 .../model_virtualnetworkbgpcommunities.go | 0 .../model_virtualnetworkencryption.go | 0 .../model_virtualnetworkpeering.go | 0 ...l_virtualnetworkpeeringpropertiesformat.go | 0 .../virtualnetworkpeerings/predicates.go | 0 .../virtualnetworkpeerings/version.go | 12 + .../2022-07-01/virtualnetworks/README.md | 239 ++ .../virtualnetworks/client.go | 0 .../2022-07-01/virtualnetworks/constants.go | 1186 +++++++ .../virtualnetworks/method_createorupdate.go | 0 .../virtualnetworks/method_delete.go | 0 .../virtualnetworks/method_get.go | 0 .../virtualnetworks/method_list.go | 0 .../virtualnetworks/method_listall.go | 0 .../method_resourcenavigationlinkslist.go | 0 .../method_serviceassociationlinkslist.go | 0 .../method_subnetspreparenetworkpolicies.go | 0 .../method_subnetsunpreparenetworkpolicies.go | 0 .../virtualnetworks/method_updatetags.go | 0 ...rtualnetworkscheckipaddressavailability.go | 0 ...virtualnetworkslistddosprotectionstatus.go | 0 .../method_virtualnetworkslistusage.go | 0 .../virtualnetworks/model_addressspace.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../virtualnetworks/model_ddossettings.go | 0 .../virtualnetworks/model_delegation.go | 0 .../virtualnetworks/model_dhcpoptions.go | 0 .../virtualnetworks/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../virtualnetworks/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipaddressavailabilityresult.go | 0 .../virtualnetworks/model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../virtualnetworks/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../virtualnetworks/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../virtualnetworks/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkintentpolicy.go | 0 .../model_networkintentpolicyconfiguration.go | 0 .../virtualnetworks/model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_preparenetworkpoliciesrequest.go | 0 .../virtualnetworks/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../virtualnetworks/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 ...odel_publicipddosprotectionstatusresult.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../virtualnetworks/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../virtualnetworks/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../virtualnetworks/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../virtualnetworks/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../virtualnetworks/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../virtualnetworks/model_subresource.go | 0 .../virtualnetworks/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_unpreparenetworkpoliciesrequest.go | 0 .../virtualnetworks/model_virtualnetwork.go | 0 .../model_virtualnetworkbgpcommunities.go | 0 .../model_virtualnetworkencryption.go | 0 .../model_virtualnetworkpeering.go | 0 ...l_virtualnetworkpeeringpropertiesformat.go | 0 .../model_virtualnetworkpropertiesformat.go | 20 + .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../model_virtualnetworkusage.go | 0 .../model_virtualnetworkusagename.go | 0 .../virtualnetworks/predicates.go | 0 .../2022-07-01/virtualnetworks/version.go | 12 + .../2022-07-01/virtualnetworktap/README.md | 86 + .../virtualnetworktap/client.go | 0 .../2022-07-01/virtualnetworktap/constants.go | 1013 ++++++ .../virtualnetworktap/id_virtualnetworktap.go | 0 .../id_virtualnetworktap_test.go | 0 .../method_createorupdate.go | 0 .../virtualnetworktap/method_delete.go | 0 .../virtualnetworktap/method_get.go | 0 .../virtualnetworktap/method_updatetags.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../virtualnetworktap/model_ddossettings.go | 0 .../virtualnetworktap/model_delegation.go | 0 .../virtualnetworktap/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../virtualnetworktap/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../virtualnetworktap/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../virtualnetworktap/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../virtualnetworktap/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../virtualnetworktap/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../virtualnetworktap/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../virtualnetworktap/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../virtualnetworktap/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../virtualnetworktap/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../virtualnetworktap/model_subresource.go | 0 .../virtualnetworktap/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../2022-07-01/virtualnetworktap/version.go | 12 + .../2022-07-01/virtualnetworktaps/README.md | 55 + .../virtualnetworktaps/client.go | 0 .../virtualnetworktaps/constants.go | 1013 ++++++ .../virtualnetworktaps/method_listall.go | 0 .../method_listbyresourcegroup.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../virtualnetworktaps/model_ddossettings.go | 0 .../virtualnetworktaps/model_delegation.go | 0 .../virtualnetworktaps/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../virtualnetworktaps/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../virtualnetworktaps/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../virtualnetworktaps/model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../virtualnetworktaps/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../virtualnetworktaps/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../virtualnetworktaps/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../virtualnetworktaps/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../virtualnetworktaps/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../virtualnetworktaps/model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../virtualnetworktaps/predicates.go | 0 .../2022-07-01/virtualnetworktaps/version.go | 12 + .../virtualrouterpeerings/README.md | 83 + .../virtualrouterpeerings/client.go | 0 .../virtualrouterpeerings/constants.go | 0 .../virtualrouterpeerings/id_virtualrouter.go | 0 .../id_virtualrouter_test.go | 0 .../method_createorupdate.go | 0 .../virtualrouterpeerings/method_delete.go | 0 .../virtualrouterpeerings/method_get.go | 0 .../virtualrouterpeerings/method_list.go | 0 .../model_virtualrouterpeering.go | 0 .../model_virtualrouterpeeringproperties.go | 0 .../virtualrouterpeerings/predicates.go | 0 .../virtualrouterpeerings/version.go | 12 + .../2022-07-01/virtualrouters/README.md | 100 + .../virtualrouters/client.go | 0 .../virtualrouters/constants.go | 0 .../virtualrouters/id_virtualrouter.go | 0 .../virtualrouters/id_virtualrouter_test.go | 0 .../virtualrouters/method_createorupdate.go | 0 .../virtualrouters/method_delete.go | 0 .../virtualrouters/method_get.go | 0 .../virtualrouters/method_list.go | 0 .../method_listbyresourcegroup.go | 0 .../virtualrouters/model_subresource.go | 0 .../virtualrouters/model_virtualrouter.go | 0 .../model_virtualrouterpropertiesformat.go | 0 .../virtualrouters/predicates.go | 0 .../2022-07-01/virtualrouters/version.go | 12 + .../network/2022-07-01/virtualwans/README.md | 1406 ++++++++ .../virtualwans/client.go | 0 .../2022-07-01/virtualwans/constants.go | 2197 +++++++++++++ .../id_configurationpolicygroup.go | 0 .../id_configurationpolicygroup_test.go | 0 .../virtualwans/id_hubroutetable.go | 0 .../virtualwans/id_hubroutetable_test.go | 0 .../id_hubvirtualnetworkconnection.go | 0 .../id_hubvirtualnetworkconnection_test.go | 0 .../virtualwans/id_natrule.go | 0 .../virtualwans/id_natrule_test.go | 0 .../virtualwans/id_routemap.go | 0 .../virtualwans/id_routemap_test.go | 0 .../virtualwans/id_routingintent.go | 0 .../virtualwans/id_routingintent_test.go | 0 .../virtualwans/id_virtualhub.go | 0 .../virtualwans/id_virtualhub_test.go | 0 .../virtualwans/id_virtualhubroutetable.go | 0 .../id_virtualhubroutetable_test.go | 0 .../virtualwans/id_virtualwan.go | 0 .../virtualwans/id_virtualwan_test.go | 0 .../virtualwans/id_vpngateway.go | 0 .../virtualwans/id_vpngateway_test.go | 0 .../virtualwans/id_vpnlinkconnection.go | 0 .../virtualwans/id_vpnlinkconnection_test.go | 0 .../virtualwans/id_vpnserverconfiguration.go | 0 .../id_vpnserverconfiguration_test.go | 0 .../virtualwans/id_vpnsite.go | 0 .../virtualwans/id_vpnsite_test.go | 0 .../virtualwans/id_vpnsitelink.go | 0 .../virtualwans/id_vpnsitelink_test.go | 0 ...configurationpolicygroupscreateorupdate.go | 0 .../method_configurationpolicygroupsdelete.go | 0 .../method_configurationpolicygroupsget.go | 0 ...olicygroupslistbyvpnserverconfiguration.go | 0 ...tualwanvpnserverconfigurationvpnprofile.go | 0 .../method_hubroutetablescreateorupdate.go | 0 .../method_hubroutetablesdelete.go | 0 .../virtualwans/method_hubroutetablesget.go | 0 .../virtualwans/method_hubroutetableslist.go | 0 ...virtualnetworkconnectionscreateorupdate.go | 0 ...thod_hubvirtualnetworkconnectionsdelete.go | 0 .../method_hubvirtualnetworkconnectionsget.go | 0 ...method_hubvirtualnetworkconnectionslist.go | 0 .../method_natrulescreateorupdate.go | 0 .../virtualwans/method_natrulesdelete.go | 0 .../virtualwans/method_natrulesget.go | 0 .../method_natruleslistbyvpngateway.go | 0 .../method_p2svpngatewayscreateorupdate.go | 0 .../method_p2svpngatewaysdelete.go | 0 .../virtualwans/method_p2svpngatewaysget.go | 0 .../virtualwans/method_p2svpngatewayslist.go | 0 ...ethod_p2svpngatewayslistbyresourcegroup.go | 0 .../method_routemapscreateorupdate.go | 0 .../virtualwans/method_routemapsdelete.go | 0 .../virtualwans/method_routemapsget.go | 0 .../virtualwans/method_routemapslist.go | 0 .../method_routingintentcreateorupdate.go | 0 .../virtualwans/method_routingintentdelete.go | 0 .../virtualwans/method_routingintentget.go | 0 .../virtualwans/method_routingintentlist.go | 0 .../method_supportedsecurityproviders.go | 0 .../virtualwans/method_updatetags.go | 0 ...d_virtualhubbgpconnectioncreateorupdate.go | 0 .../method_virtualhubbgpconnectiondelete.go | 0 .../method_virtualhubbgpconnectionget.go | 0 .../method_virtualhubbgpconnectionslist.go | 0 ...alhubbgpconnectionslistadvertisedroutes.go | 72 + ...rtualhubbgpconnectionslistlearnedroutes.go | 72 + ...virtualhubipconfigurationcreateorupdate.go | 0 .../method_virtualhubipconfigurationdelete.go | 0 .../method_virtualhubipconfigurationget.go | 0 .../method_virtualhubipconfigurationlist.go | 0 ...d_virtualhubroutetablev2screateorupdate.go | 0 .../method_virtualhubroutetablev2sdelete.go | 0 .../method_virtualhubroutetablev2sget.go | 0 .../method_virtualhubroutetablev2slist.go | 0 .../method_virtualhubscreateorupdate.go | 0 .../virtualwans/method_virtualhubsdelete.go | 0 .../virtualwans/method_virtualhubsget.go | 0 ...virtualhubsgeteffectivevirtualhubroutes.go | 74 + .../method_virtualhubsgetinboundroutes.go | 74 + .../method_virtualhubsgetoutboundroutes.go | 74 + .../virtualwans/method_virtualhubslist.go | 0 .../method_virtualhubslistbyresourcegroup.go | 0 .../method_virtualhubsupdatetags.go | 0 .../method_virtualwanscreateorupdate.go | 0 .../virtualwans/method_virtualwansdelete.go | 0 .../virtualwans/method_virtualwansget.go | 0 .../virtualwans/method_virtualwanslist.go | 0 .../method_virtualwanslistbyresourcegroup.go | 0 .../method_vpnconnectionscreateorupdate.go | 0 .../method_vpnconnectionsdelete.go | 0 .../virtualwans/method_vpnconnectionsget.go | 0 .../method_vpnconnectionslistbyvpngateway.go | 0 ...method_vpnconnectionsstartpacketcapture.go | 0 .../method_vpnconnectionsstoppacketcapture.go | 0 .../method_vpngatewayscreateorupdate.go | 0 .../virtualwans/method_vpngatewaysdelete.go | 0 .../virtualwans/method_vpngatewaysget.go | 0 .../virtualwans/method_vpngatewayslist.go | 0 .../method_vpngatewayslistbyresourcegroup.go | 0 .../method_vpnlinkconnectionsgetikesas.go | 0 ...d_vpnlinkconnectionslistbyvpnconnection.go | 0 ...figurationsassociatedwithvirtualwanlist.go | 0 ...d_vpnserverconfigurationscreateorupdate.go | 0 .../method_vpnserverconfigurationsdelete.go | 0 .../method_vpnserverconfigurationsget.go | 0 .../method_vpnserverconfigurationslist.go | 0 ...serverconfigurationslistbyresourcegroup.go | 0 .../method_vpnsitelinkconnectionsget.go | 0 .../virtualwans/method_vpnsitelinksget.go | 0 .../method_vpnsitelinkslistbyvpnsite.go | 0 .../method_vpnsitesconfigurationdownload.go | 0 .../method_vpnsitescreateorupdate.go | 0 .../virtualwans/method_vpnsitesdelete.go | 0 .../virtualwans/method_vpnsitesget.go | 0 .../virtualwans/method_vpnsiteslist.go | 0 .../method_vpnsiteslistbyresourcegroup.go | 0 .../model_aadauthenticationparameters.go | 0 .../virtualwans/model_action.go | 0 .../virtualwans/model_addressspace.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../virtualwans/model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../virtualwans/model_bgpconnection.go | 0 .../model_bgpconnectionproperties.go | 0 .../virtualwans/model_bgpsettings.go | 0 .../virtualwans/model_criterion.go | 0 .../model_customdnsconfigpropertiesformat.go | 0 .../virtualwans/model_ddossettings.go | 0 .../virtualwans/model_delegation.go | 0 .../virtualwans/model_deviceproperties.go | 0 .../model_effectiveroutesparameters.go | 0 .../virtualwans/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...atewaycustombgpipaddressipconfiguration.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_getinboundroutesparameters.go | 0 .../model_getoutboundroutesparameters.go | 0 .../model_getvpnsitesconfigurationrequest.go | 0 .../virtualwans/model_hubipconfiguration.go | 0 ...odel_hubipconfigurationpropertiesformat.go | 0 .../virtualwans/model_hubroute.go | 0 .../virtualwans/model_hubroutetable.go | 0 .../model_hubroutetableproperties.go | 0 .../model_hubvirtualnetworkconnection.go | 0 ...l_hubvirtualnetworkconnectionproperties.go | 0 .../virtualwans/model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../virtualwans/model_ipconfiguration.go | 0 .../model_ipconfigurationbgppeeringaddress.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../virtualwans/model_ipsecpolicy.go | 0 .../virtualwans/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../virtualwans/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../virtualwans/model_natgatewaysku.go | 0 .../virtualwans/model_natruleportmapping.go | 0 .../virtualwans/model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../virtualwans/model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_o365breakoutcategorypolicies.go | 0 .../virtualwans/model_o365policyproperties.go | 0 .../model_p2sconnectionconfiguration.go | 0 ...el_p2sconnectionconfigurationproperties.go | 0 .../virtualwans/model_p2svpngateway.go | 0 .../model_p2svpngatewayproperties.go | 0 .../virtualwans/model_parameter.go | 0 .../virtualwans/model_peerroute.go | 0 .../virtualwans/model_peerroutelist.go | 8 + .../virtualwans/model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../virtualwans/model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../virtualwans/model_propagatedroutetable.go | 0 .../virtualwans/model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../virtualwans/model_publicipaddresssku.go | 0 .../virtualwans/model_radiusserver.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../virtualwans/model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../virtualwans/model_route.go | 0 .../virtualwans/model_routemap.go | 0 .../virtualwans/model_routemapproperties.go | 0 .../virtualwans/model_routemaprule.go | 0 .../model_routepropertiesformat.go | 0 .../virtualwans/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../virtualwans/model_routingconfiguration.go | 0 .../virtualwans/model_routingintent.go | 0 .../model_routingintentproperties.go | 0 .../virtualwans/model_routingpolicy.go | 0 .../virtualwans/model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../virtualwans/model_staticroute.go | 0 .../virtualwans/model_staticroutesconfig.go | 0 .../virtualwans/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../virtualwans/model_subresource.go | 0 .../virtualwans/model_tagsobject.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_trafficselectorpolicy.go | 0 .../virtualwans/model_virtualhub.go | 0 .../virtualwans/model_virtualhubproperties.go | 0 .../virtualwans/model_virtualhubroute.go | 0 .../virtualwans/model_virtualhubroutetable.go | 0 .../model_virtualhubroutetablev2.go | 0 .../model_virtualhubroutetablev2properties.go | 0 .../virtualwans/model_virtualhubroutev2.go | 0 .../virtualwans/model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 ...del_virtualrouterautoscaleconfiguration.go | 0 .../virtualwans/model_virtualwan.go | 0 .../virtualwans/model_virtualwanproperties.go | 0 .../model_virtualwansecurityprovider.go | 0 .../model_virtualwansecurityproviders.go | 0 .../model_virtualwanvpnprofileparameters.go | 0 .../virtualwans/model_vnetroute.go | 0 .../model_vpnclientconnectionhealth.go | 0 .../virtualwans/model_vpnconnection.go | 0 ...nconnectionpacketcapturestartparameters.go | 0 ...pnconnectionpacketcapturestopparameters.go | 0 .../model_vpnconnectionproperties.go | 0 .../virtualwans/model_vpngateway.go | 0 .../model_vpngatewayipconfiguration.go | 0 .../virtualwans/model_vpngatewaynatrule.go | 0 .../model_vpngatewaynatruleproperties.go | 0 .../virtualwans/model_vpngatewayproperties.go | 0 .../virtualwans/model_vpnlinkbgpsettings.go | 0 .../model_vpnlinkproviderproperties.go | 0 .../virtualwans/model_vpnnatrulemapping.go | 0 .../virtualwans/model_vpnprofileresponse.go | 0 ...serverconfigradiusclientrootcertificate.go | 0 ...serverconfigradiusserverrootcertificate.go | 0 .../model_vpnserverconfiguration.go | 0 ...model_vpnserverconfigurationpolicygroup.go | 0 ...vpnserverconfigurationpolicygroupmember.go | 0 ...erverconfigurationpolicygroupproperties.go | 0 .../model_vpnserverconfigurationproperties.go | 0 .../model_vpnserverconfigurationsresponse.go | 0 ...serverconfigvpnclientrevokedcertificate.go | 0 ...vpnserverconfigvpnclientrootcertificate.go | 0 .../virtualwans/model_vpnsite.go | 0 .../virtualwans/model_vpnsitelink.go | 0 .../model_vpnsitelinkconnection.go | 0 .../model_vpnsitelinkconnectionproperties.go | 0 .../model_vpnsitelinkproperties.go | 0 .../virtualwans/model_vpnsiteproperties.go | 0 .../virtualwans/predicates.go | 0 .../network/2022-07-01/virtualwans/version.go | 12 + .../vmsspublicipaddresses/README.md | 71 + .../vmsspublicipaddresses/client.go | 0 .../vmsspublicipaddresses/constants.go | 1013 ++++++ .../id_virtualmachinescaleset.go | 0 .../id_virtualmachinescaleset_test.go | 0 ...etvirtualmachinescalesetpublicipaddress.go | 0 ...virtualmachinescalesetpublicipaddresses.go | 0 ...rtualmachinescalesetvmpublicipaddresses.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../model_ddossettings.go | 0 .../vmsspublicipaddresses/model_delegation.go | 0 .../vmsspublicipaddresses/model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../vmsspublicipaddresses/model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../vmsspublicipaddresses/model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../vmsspublicipaddresses/model_route.go | 0 .../model_routepropertiesformat.go | 0 .../vmsspublicipaddresses/model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../vmsspublicipaddresses/model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../vmsspublicipaddresses/predicates.go | 0 .../vmsspublicipaddresses/version.go | 12 + .../network/2022-07-01/vpngateways/README.md | 83 + .../vpngateways/client.go | 0 .../vpngateways/constants.go | 0 .../vpngateways/id_vpngateway.go | 0 .../vpngateways/id_vpngateway_test.go | 0 .../2022-07-01/vpngateways/method_reset.go | 71 + .../vpngateways/method_startpacketcapture.go | 0 .../vpngateways/method_stoppacketcapture.go | 0 .../vpngateways/method_updatetags.go | 0 .../vpngateways/model_bgpsettings.go | 0 ...atewaycustombgpipaddressipconfiguration.go | 0 .../model_ipconfigurationbgppeeringaddress.go | 0 .../vpngateways/model_ipsecpolicy.go | 0 .../vpngateways/model_propagatedroutetable.go | 0 .../vpngateways/model_routingconfiguration.go | 0 .../vpngateways/model_staticroute.go | 0 .../vpngateways/model_staticroutesconfig.go | 0 .../vpngateways/model_subresource.go | 0 .../vpngateways/model_tagsobject.go | 0 .../model_trafficselectorpolicy.go | 0 .../vpngateways/model_vnetroute.go | 0 .../vpngateways/model_vpnconnection.go | 0 .../model_vpnconnectionproperties.go | 0 .../vpngateways/model_vpngateway.go | 0 .../model_vpngatewayipconfiguration.go | 0 .../vpngateways/model_vpngatewaynatrule.go | 0 .../model_vpngatewaynatruleproperties.go | 0 ..._vpngatewaypacketcapturestartparameters.go | 0 ...l_vpngatewaypacketcapturestopparameters.go | 0 .../vpngateways/model_vpngatewayproperties.go | 0 .../vpngateways/model_vpnnatrulemapping.go | 0 .../model_vpnsitelinkconnection.go | 0 .../model_vpnsitelinkconnectionproperties.go | 0 .../network/2022-07-01/vpngateways/version.go | 12 + .../vpnlinkconnections/client.go | 0 .../id_vpnlinkconnection.go | 0 .../id_vpnlinkconnection_test.go | 0 .../method_resetconnection.go | 0 .../2022-07-01/vpnlinkconnections/version.go | 12 + .../vpnserverconfigurations/README.md | 41 + .../vpnserverconfigurations/client.go | 0 .../vpnserverconfigurations/constants.go | 0 .../id_vpnserverconfiguration.go | 0 .../id_vpnserverconfiguration_test.go | 0 .../method_updatetags.go | 0 .../model_aadauthenticationparameters.go | 0 .../model_addressspace.go | 0 .../model_ipsecpolicy.go | 0 .../model_p2sconnectionconfiguration.go | 0 ...el_p2sconnectionconfigurationproperties.go | 0 .../model_p2svpngateway.go | 0 .../model_p2svpngatewayproperties.go | 0 .../model_propagatedroutetable.go | 0 .../model_radiusserver.go | 0 .../model_routingconfiguration.go | 0 .../model_staticroute.go | 0 .../model_staticroutesconfig.go | 0 .../model_subresource.go | 0 .../model_tagsobject.go | 0 .../model_vnetroute.go | 0 .../model_vpnclientconnectionhealth.go | 0 ...serverconfigradiusclientrootcertificate.go | 0 ...serverconfigradiusserverrootcertificate.go | 0 .../model_vpnserverconfiguration.go | 0 ...model_vpnserverconfigurationpolicygroup.go | 0 ...vpnserverconfigurationpolicygroupmember.go | 0 ...erverconfigurationpolicygroupproperties.go | 0 .../model_vpnserverconfigurationproperties.go | 0 ...serverconfigvpnclientrevokedcertificate.go | 0 ...vpnserverconfigvpnclientrootcertificate.go | 0 .../vpnserverconfigurations/version.go | 12 + .../network/2022-07-01/vpnsites/README.md | 41 + .../vpnsites/client.go | 0 .../vpnsites/constants.go | 0 .../vpnsites/id_vpnsite.go | 0 .../vpnsites/id_vpnsite_test.go | 0 .../vpnsites/method_updatetags.go | 0 .../vpnsites/model_addressspace.go | 0 .../vpnsites/model_bgpsettings.go | 0 .../vpnsites/model_deviceproperties.go | 0 .../model_ipconfigurationbgppeeringaddress.go | 0 .../model_o365breakoutcategorypolicies.go | 0 .../vpnsites/model_o365policyproperties.go | 0 .../vpnsites/model_subresource.go | 0 .../vpnsites/model_tagsobject.go | 0 .../vpnsites/model_vpnlinkbgpsettings.go | 0 .../model_vpnlinkproviderproperties.go | 0 .../vpnsites/model_vpnsite.go | 0 .../vpnsites/model_vpnsitelink.go | 0 .../vpnsites/model_vpnsitelinkproperties.go | 0 .../vpnsites/model_vpnsiteproperties.go | 0 .../network/2022-07-01/vpnsites/version.go | 12 + .../webapplicationfirewallpolicies/README.md | 104 + .../webapplicationfirewallpolicies/client.go | 0 .../constants.go | 2372 ++++++++++++++ ...tiongatewaywebapplicationfirewallpolicy.go | 0 ...atewaywebapplicationfirewallpolicy_test.go | 0 .../method_createorupdate.go | 0 .../method_delete.go | 0 .../method_get.go | 0 .../method_list.go | 0 .../method_listall.go | 0 .../model_applicationgateway.go | 0 ...icationgatewayauthenticationcertificate.go | 0 ...thenticationcertificatepropertiesformat.go | 0 ...pplicationgatewayautoscaleconfiguration.go | 0 .../model_applicationgatewaybackendaddress.go | 0 ...el_applicationgatewaybackendaddresspool.go | 0 ...tewaybackendaddresspoolpropertiesformat.go | 0 ...l_applicationgatewaybackendhttpsettings.go | 0 ...ewaybackendhttpsettingspropertiesformat.go | 0 ...model_applicationgatewaybackendsettings.go | 0 ...ngatewaybackendsettingspropertiesformat.go | 0 ...plicationgatewayclientauthconfiguration.go | 0 ...el_applicationgatewayconnectiondraining.go | 0 .../model_applicationgatewaycustomerror.go | 0 ...icationgatewayfirewalldisabledrulegroup.go | 0 ...del_applicationgatewayfirewallexclusion.go | 0 ...plicationgatewayfrontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 .../model_applicationgatewayfrontendport.go | 0 ...tiongatewayfrontendportpropertiesformat.go | 0 ...l_applicationgatewayglobalconfiguration.go | 0 ...l_applicationgatewayheaderconfiguration.go | 0 .../model_applicationgatewayhttplistener.go | 0 ...tiongatewayhttplistenerpropertiesformat.go | 0 ...model_applicationgatewayipconfiguration.go | 0 ...ngatewayipconfigurationpropertiesformat.go | 0 .../model_applicationgatewaylistener.go | 0 ...licationgatewaylistenerpropertiesformat.go | 0 ...pplicationgatewayloaddistributionpolicy.go | 0 ...yloaddistributionpolicypropertiesformat.go | 0 ...pplicationgatewayloaddistributiontarget.go | 0 ...yloaddistributiontargetpropertiesformat.go | 0 .../model_applicationgatewaypathrule.go | 0 ...licationgatewaypathrulepropertiesformat.go | 0 ...icationgatewayprivateendpointconnection.go | 0 ...ewayprivateendpointconnectionproperties.go | 0 ...licationgatewayprivatelinkconfiguration.go | 0 ...tewayprivatelinkconfigurationproperties.go | 0 ...cationgatewayprivatelinkipconfiguration.go | 0 ...wayprivatelinkipconfigurationproperties.go | 0 .../model_applicationgatewayprobe.go | 0 ...licationgatewayprobehealthresponsematch.go | 0 ...applicationgatewayprobepropertiesformat.go | 0 ...odel_applicationgatewaypropertiesformat.go | 42 + ...applicationgatewayredirectconfiguration.go | 0 ...ayredirectconfigurationpropertiesformat.go | 0 ...el_applicationgatewayrequestroutingrule.go | 0 ...tewayrequestroutingrulepropertiesformat.go | 0 .../model_applicationgatewayrewriterule.go | 0 ..._applicationgatewayrewriteruleactionset.go | 0 ..._applicationgatewayrewriterulecondition.go | 0 .../model_applicationgatewayrewriteruleset.go | 0 ...ongatewayrewriterulesetpropertiesformat.go | 0 .../model_applicationgatewayroutingrule.go | 0 ...ationgatewayroutingrulepropertiesformat.go | 0 .../model_applicationgatewaysku.go | 0 .../model_applicationgatewaysslcertificate.go | 0 ...ongatewaysslcertificatepropertiesformat.go | 0 .../model_applicationgatewaysslpolicy.go | 0 .../model_applicationgatewaysslprofile.go | 0 ...cationgatewaysslprofilepropertiesformat.go | 0 ...licationgatewaytrustedclientcertificate.go | 0 ...rustedclientcertificatepropertiesformat.go | 0 ...pplicationgatewaytrustedrootcertificate.go | 0 ...ytrustedrootcertificatepropertiesformat.go | 0 ...odel_applicationgatewayurlconfiguration.go | 0 .../model_applicationgatewayurlpathmap.go | 0 ...cationgatewayurlpathmappropertiesformat.go | 0 ...ewaywebapplicationfirewallconfiguration.go | 0 .../model_applicationsecuritygroup.go | 0 ...pplicationsecuritygrouppropertiesformat.go | 0 .../model_backendaddresspool.go | 0 ...odel_backendaddresspoolpropertiesformat.go | 18 + .../model_customdnsconfigpropertiesformat.go | 0 .../model_ddossettings.go | 0 .../model_delegation.go | 0 .../model_exclusionmanagedrule.go | 0 .../model_exclusionmanagedrulegroup.go | 0 .../model_exclusionmanagedruleset.go | 0 .../model_flowlog.go | 0 .../model_flowlogformatparameters.go | 0 .../model_flowlogpropertiesformat.go | 0 .../model_frontendipconfiguration.go | 0 ...frontendipconfigurationpropertiesformat.go | 0 ...odel_gatewayloadbalancertunnelinterface.go | 0 .../model_inboundnatrule.go | 0 .../model_inboundnatrulepropertiesformat.go | 0 .../model_ipconfiguration.go | 0 .../model_ipconfigurationprofile.go | 0 ..._ipconfigurationprofilepropertiesformat.go | 0 .../model_ipconfigurationpropertiesformat.go | 0 .../model_iptag.go | 0 .../model_loadbalancerbackendaddress.go | 0 ...dbalancerbackendaddresspropertiesformat.go | 0 .../model_managedrulegroupoverride.go | 0 .../model_managedruleoverride.go | 0 .../model_managedrulesdefinition.go | 0 .../model_managedruleset.go | 0 .../model_matchcondition.go | 0 .../model_matchvariable.go | 0 .../model_natgateway.go | 0 .../model_natgatewaypropertiesformat.go | 0 .../model_natgatewaysku.go | 0 .../model_natruleportmapping.go | 0 .../model_networkinterface.go | 0 .../model_networkinterfacednssettings.go | 0 .../model_networkinterfaceipconfiguration.go | 0 ...gurationprivatelinkconnectionproperties.go | 0 ...nterfaceipconfigurationpropertiesformat.go | 0 .../model_networkinterfacepropertiesformat.go | 28 + .../model_networkinterfacetapconfiguration.go | 0 ...terfacetapconfigurationpropertiesformat.go | 0 .../model_networksecuritygroup.go | 0 ...el_networksecuritygrouppropertiesformat.go | 0 .../model_owaspcrsexclusionentry.go | 0 .../model_policysettings.go | 14 + .../model_privateendpoint.go | 0 .../model_privateendpointconnection.go | 0 ...del_privateendpointconnectionproperties.go | 11 + .../model_privateendpointipconfiguration.go | 0 ...rivateendpointipconfigurationproperties.go | 0 .../model_privateendpointproperties.go | 0 .../model_privatelinkservice.go | 0 .../model_privatelinkserviceconnection.go | 0 ..._privatelinkserviceconnectionproperties.go | 0 ...model_privatelinkserviceconnectionstate.go | 0 ...model_privatelinkserviceipconfiguration.go | 0 ...atelinkserviceipconfigurationproperties.go | 0 .../model_privatelinkserviceproperties.go | 0 .../model_publicipaddress.go | 0 .../model_publicipaddressdnssettings.go | 10 + .../model_publicipaddresspropertiesformat.go | 0 .../model_publicipaddresssku.go | 0 .../model_resourcenavigationlink.go | 0 .../model_resourcenavigationlinkformat.go | 0 .../model_resourceset.go | 0 .../model_retentionpolicyparameters.go | 0 .../model_route.go | 0 .../model_routepropertiesformat.go | 0 .../model_routetable.go | 0 .../model_routetablepropertiesformat.go | 0 .../model_securityrule.go | 0 .../model_securityrulepropertiesformat.go | 23 + .../model_serviceassociationlink.go | 0 ..._serviceassociationlinkpropertiesformat.go | 0 ...model_servicedelegationpropertiesformat.go | 0 .../model_serviceendpointpolicy.go | 0 .../model_serviceendpointpolicydefinition.go | 0 ...ndpointpolicydefinitionpropertiesformat.go | 0 ...l_serviceendpointpolicypropertiesformat.go | 0 .../model_serviceendpointpropertiesformat.go | 0 .../model_subnet.go | 0 .../model_subnetpropertiesformat.go | 26 + .../model_subresource.go | 0 ...trafficanalyticsconfigurationproperties.go | 0 .../model_trafficanalyticsproperties.go | 0 .../model_virtualnetworktap.go | 0 ...model_virtualnetworktappropertiesformat.go | 0 .../model_webapplicationfirewallcustomrule.go | 13 + .../model_webapplicationfirewallpolicy.go | 0 ...plicationfirewallpolicypropertiesformat.go | 0 .../predicates.go | 0 .../webapplicationfirewallpolicies/version.go | 12 + .../2022-07-01/webcategories/README.md | 54 + .../webcategories/client.go | 0 .../webcategories/id_azurewebcategory.go | 0 .../webcategories/id_azurewebcategory_test.go | 0 .../webcategories/method_get.go | 0 .../method_listbysubscription.go | 0 .../webcategories/model_azurewebcategory.go | 0 .../model_azurewebcategorypropertiesformat.go | 0 .../webcategories/predicates.go | 0 .../2022-07-01/webcategories/version.go | 12 + .../2023-04-01/adminrulecollections/README.md | 86 - ...del_adminrulecollectionpropertiesformat.go | 11 - .../adminrulecollections/version.go | 12 - .../network/2023-04-01/adminrules/README.md | 86 - .../adminrules/model_adminpropertiesformat.go | 18 - .../model_defaultadminpropertiesformat.go | 19 - .../network/2023-04-01/adminrules/version.go | 12 - .../README.md | 82 - .../constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../version.go | 12 - .../README.md | 37 - .../version.go | 12 - .../2023-04-01/applicationgateways/README.md | 287 -- .../applicationgateways/constants.go | 2119 ------------ ...odel_applicationgatewaypropertiesformat.go | 43 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/applicationgateways/version.go | 12 - .../README.md | 53 - .../version.go | 12 - .../applicationsecuritygroups/README.md | 121 - .../applicationsecuritygroups/version.go | 12 - .../2023-04-01/availabledelegations/README.md | 54 - .../availabledelegations/version.go | 12 - .../availableservicealiases/README.md | 54 - .../availableservicealiases/version.go | 12 - .../2023-04-01/azurefirewalls/README.md | 146 - .../2023-04-01/azurefirewalls/constants.go | 412 --- .../azurefirewalls/method_packetcapture.go | 73 - .../model_azurefirewallpacketcaptureflags.go | 8 - .../model_azurefirewallpacketcapturerule.go | 10 - .../model_firewallpacketcaptureparameters.go | 9 - ...l_firewallpacketcaptureparametersformat.go | 14 - .../2023-04-01/azurefirewalls/version.go | 12 - .../network/2023-04-01/bastionhosts/README.md | 217 -- .../model_bastionhostpropertiesformat.go | 17 - .../2023-04-01/bastionhosts/version.go | 12 - .../2023-04-01/bastionshareablelink/README.md | 81 - .../bastionshareablelink/version.go | 12 - .../bgpservicecommunities/README.md | 38 - .../bgpservicecommunities/version.go | 12 - .../checkdnsavailabilities/README.md | 36 - .../checkdnsavailabilities/version.go | 12 - resource-manager/network/2023-04-01/client.go | 982 ------ .../cloudservicepublicipaddresses/README.md | 71 - .../constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../cloudservicepublicipaddresses/version.go | 12 - .../2023-04-01/connectionmonitors/README.md | 138 - .../2023-04-01/connectionmonitors/version.go | 12 - .../connectivityconfigurations/README.md | 86 - ...del_connectivityconfigurationproperties.go | 15 - .../connectivityconfigurations/version.go | 12 - .../2023-04-01/customipprefixes/README.md | 121 - .../2023-04-01/customipprefixes/version.go | 12 - .../2023-04-01/ddoscustompolicies/README.md | 86 - .../2023-04-01/ddoscustompolicies/version.go | 12 - .../2023-04-01/ddosprotectionplans/README.md | 121 - .../2023-04-01/ddosprotectionplans/version.go | 12 - .../2023-04-01/dscpconfiguration/README.md | 65 - .../2023-04-01/dscpconfiguration/constants.go | 1213 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/dscpconfiguration/version.go | 12 - .../2023-04-01/dscpconfigurations/README.md | 55 - .../dscpconfigurations/constants.go | 1213 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/dscpconfigurations/version.go | 12 - .../2023-04-01/endpointservices/README.md | 37 - .../2023-04-01/endpointservices/version.go | 12 - .../expressroutecircuitarptable/README.md | 37 - .../expressroutecircuitarptable/version.go | 12 - .../README.md | 82 - .../version.go | 12 - .../expressroutecircuitconnections/README.md | 83 - .../expressroutecircuitconnections/version.go | 12 - .../expressroutecircuitpeerings/README.md | 83 - .../expressroutecircuitpeerings/version.go | 12 - .../expressroutecircuitroutestable/README.md | 37 - .../expressroutecircuitroutestable/version.go | 12 - .../README.md | 37 - .../version.go | 12 - .../2023-04-01/expressroutecircuits/README.md | 121 - ...del_expressroutecircuitpropertiesformat.go | 23 - .../expressroutecircuits/version.go | 12 - .../expressroutecircuitstats/README.md | 53 - .../expressroutecircuitstats/version.go | 12 - .../expressrouteconnections/README.md | 81 - .../expressrouteconnections/version.go | 12 - .../README.md | 37 - .../version.go | 12 - .../README.md | 82 - .../version.go | 12 - .../README.md | 37 - .../version.go | 12 - .../README.md | 37 - .../version.go | 12 - .../expressroutecrossconnections/README.md | 109 - .../expressroutecrossconnections/version.go | 12 - .../2023-04-01/expressroutegateways/README.md | 115 - .../expressroutegateways/version.go | 12 - .../2023-04-01/expressroutelinks/README.md | 53 - .../2023-04-01/expressroutelinks/version.go | 12 - .../expressrouteportauthorizations/README.md | 82 - .../expressrouteportauthorizations/version.go | 12 - .../2023-04-01/expressrouteports/README.md | 142 - .../2023-04-01/expressrouteports/version.go | 12 - .../expressrouteportslocations/README.md | 54 - .../expressrouteportslocations/version.go | 12 - .../expressrouteproviderports/README.md | 54 - .../expressrouteproviderports/version.go | 12 - .../expressrouteserviceproviders/README.md | 38 - .../expressrouteserviceproviders/version.go | 12 - .../2023-04-01/firewallpolicies/README.md | 237 -- .../2023-04-01/firewallpolicies/version.go | 12 - .../README.md | 82 - .../model_applicationrule.go | 52 - .../model_firewallpolicyhttpheadertoinsert.go | 9 - .../version.go | 12 - .../network/2023-04-01/flowlogs/README.md | 103 - .../network/2023-04-01/flowlogs/version.go | 12 - .../2023-04-01/ipallocations/README.md | 121 - .../2023-04-01/ipallocations/version.go | 12 - .../network/2023-04-01/ipgroups/README.md | 121 - .../network/2023-04-01/ipgroups/version.go | 12 - .../2023-04-01/loadbalancers/README.md | 449 --- .../2023-04-01/loadbalancers/constants.go | 1368 -------- .../loadbalancers/id_loadbalancer.go | 130 - .../loadbalancers/id_loadbalancer_test.go | 282 -- .../loadbalancers/id_providerloadbalancer.go | 130 - .../id_providerloadbalancer_test.go | 282 -- .../loadbalancers/method_createorupdate.go | 75 - .../2023-04-01/loadbalancers/method_delete.go | 71 - .../2023-04-01/loadbalancers/method_get.go | 83 - .../method_inboundnatruleslist.go | 91 - ...hod_loadbalancerbackendaddresspoolslist.go | 91 - ...oadbalancerfrontendipconfigurationslist.go | 91 - ...thod_loadbalancerloadbalancingruleslist.go | 91 - ...ethod_loadbalancernetworkinterfaceslist.go | 91 - .../method_loadbalanceroutboundruleslist.go | 91 - .../method_loadbalancerprobeslist.go | 91 - .../loadbalancers/method_migratetoipbased.go | 59 - .../loadbalancers/method_updatetags.go | 58 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../loadbalancers/model_migratedpools.go | 8 - ...del_migrateloadbalancertoipbasedrequest.go | 8 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/loadbalancers/version.go | 12 - .../2023-04-01/localnetworkgateways/README.md | 104 - .../localnetworkgateways/version.go | 12 - .../network/2023-04-01/natgateways/README.md | 121 - .../network/2023-04-01/natgateways/version.go | 12 - .../2023-04-01/networkgroups/README.md | 86 - .../model_networkgroupproperties.go | 10 - .../2023-04-01/networkgroups/version.go | 12 - .../2023-04-01/networkinterfaces/README.md | 371 --- .../2023-04-01/networkinterfaces/client.go | 26 - .../2023-04-01/networkinterfaces/constants.go | 1500 --------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/networkinterfaces/version.go | 12 - .../README.md | 41 - .../model_adminpropertiesformat.go | 18 - .../model_defaultadminpropertiesformat.go | 19 - .../model_networkgroupproperties.go | 10 - .../version.go | 12 - .../README.md | 41 - ...del_connectivityconfigurationproperties.go | 15 - .../model_networkgroupproperties.go | 10 - .../version.go | 12 - .../networkmanagerconnections/README.md | 161 - .../networkmanagerconnections/version.go | 12 - .../README.md | 42 - ...del_connectivityconfigurationproperties.go | 15 - .../model_networkgroupproperties.go | 10 - .../version.go | 12 - .../README.md | 42 - .../model_adminpropertiesformat.go | 18 - .../model_defaultadminpropertiesformat.go | 19 - .../model_networkgroupproperties.go | 10 - .../version.go | 12 - .../2023-04-01/networkmanagers/README.md | 163 - .../model_networkmanagerproperties.go | 12 - .../2023-04-01/networkmanagers/version.go | 12 - .../2023-04-01/networkprofiles/README.md | 125 - .../2023-04-01/networkprofiles/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/networkprofiles/version.go | 12 - .../networksecuritygroups/README.md | 121 - .../networksecuritygroups/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../networksecuritygroups/version.go | 12 - .../networkvirtualappliances/README.md | 138 - ...networkvirtualappliancepropertiesformat.go | 23 - ...virtualapplianceadditionalnicproperties.go | 9 - .../model_virtualappliancenicproperties.go | 11 - .../networkvirtualappliances/version.go | 12 - .../2023-04-01/networkwatchers/README.md | 331 -- .../model_securityrulepropertiesformat.go | 23 - .../2023-04-01/networkwatchers/version.go | 12 - .../2023-04-01/p2svpngateways/README.md | 113 - .../2023-04-01/p2svpngateways/version.go | 12 - .../2023-04-01/packetcaptures/README.md | 105 - .../2023-04-01/packetcaptures/version.go | 12 - .../README.md | 54 - .../version.go | 12 - .../2023-04-01/privatednszonegroups/README.md | 82 - .../privatednszonegroups/version.go | 12 - .../2023-04-01/privateendpoints/README.md | 134 - .../2023-04-01/privateendpoints/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/privateendpoints/version.go | 12 - .../2023-04-01/privatelinkservice/README.md | 37 - .../privatelinkservice/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/privatelinkservice/version.go | 12 - .../2023-04-01/privatelinkservices/README.md | 217 -- .../privatelinkservices/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/privatelinkservices/version.go | 12 - .../2023-04-01/publicipaddresses/README.md | 133 - .../2023-04-01/publicipaddresses/constants.go | 1192 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/publicipaddresses/version.go | 12 - .../2023-04-01/publicipprefixes/README.md | 121 - .../2023-04-01/publicipprefixes/version.go | 12 - .../2023-04-01/routefilterrules/README.md | 82 - .../2023-04-01/routefilterrules/version.go | 12 - .../network/2023-04-01/routefilters/README.md | 121 - .../2023-04-01/routefilters/version.go | 12 - .../network/2023-04-01/routes/README.md | 82 - .../network/2023-04-01/routes/version.go | 12 - .../network/2023-04-01/routetables/README.md | 121 - .../2023-04-01/routetables/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../network/2023-04-01/routetables/version.go | 12 - .../2023-04-01/scopeconnections/README.md | 90 - .../2023-04-01/scopeconnections/version.go | 12 - .../securityadminconfigurations/README.md | 86 - ...urityadminconfigurationpropertiesformat.go | 11 - .../securityadminconfigurations/version.go | 12 - .../securitypartnerproviders/README.md | 121 - .../securitypartnerproviders/version.go | 12 - .../2023-04-01/securityrules/README.md | 115 - .../model_securityrulepropertiesformat.go | 23 - .../2023-04-01/securityrules/version.go | 12 - .../serviceendpointpolicies/README.md | 121 - .../serviceendpointpolicies/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../serviceendpointpolicies/version.go | 12 - .../README.md | 82 - .../version.go | 12 - .../network/2023-04-01/servicetags/README.md | 53 - .../network/2023-04-01/servicetags/version.go | 12 - .../2023-04-01/staticmembers/README.md | 90 - .../2023-04-01/staticmembers/version.go | 12 - .../network/2023-04-01/subnets/README.md | 83 - .../network/2023-04-01/subnets/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../subnets/model_subnetpropertiesformat.go | 26 - .../network/2023-04-01/subnets/version.go | 12 - .../2023-04-01/trafficanalytics/README.md | 54 - .../2023-04-01/trafficanalytics/version.go | 12 - .../network/2023-04-01/usages/README.md | 37 - .../network/2023-04-01/usages/version.go | 12 - .../network/2023-04-01/vipswap/README.md | 69 - .../network/2023-04-01/vipswap/version.go | 12 - .../virtualappliancesites/README.md | 82 - .../virtualappliancesites/version.go | 12 - .../2023-04-01/virtualapplianceskus/README.md | 54 - .../virtualapplianceskus/version.go | 12 - .../README.md | 208 -- .../constants.go | 1178 ------- ...l_virtualnetworkgatewaypropertiesformat.go | 31 - .../version.go | 12 - .../virtualnetworkgateways/README.md | 414 --- .../virtualnetworkgateways/constants.go | 1310 -------- ...l_virtualnetworkgatewaypropertiesformat.go | 31 - .../virtualnetworkgateways/version.go | 12 - .../virtualnetworkpeerings/README.md | 83 - .../virtualnetworkpeerings/version.go | 12 - .../2023-04-01/virtualnetworks/README.md | 239 -- .../2023-04-01/virtualnetworks/constants.go | 1324 -------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../model_virtualnetworkpropertiesformat.go | 21 - .../2023-04-01/virtualnetworks/version.go | 12 - .../2023-04-01/virtualnetworktap/README.md | 86 - .../2023-04-01/virtualnetworktap/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/virtualnetworktap/version.go | 12 - .../2023-04-01/virtualnetworktaps/README.md | 55 - .../virtualnetworktaps/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../2023-04-01/virtualnetworktaps/version.go | 12 - .../virtualrouterpeerings/README.md | 83 - .../virtualrouterpeerings/version.go | 12 - .../2023-04-01/virtualrouters/README.md | 100 - .../2023-04-01/virtualrouters/version.go | 12 - .../network/2023-04-01/virtualwans/README.md | 1406 -------- .../2023-04-01/virtualwans/constants.go | 2335 -------------- ...alhubbgpconnectionslistadvertisedroutes.go | 72 - ...rtualhubbgpconnectionslistlearnedroutes.go | 72 - ...virtualhubsgeteffectivevirtualhubroutes.go | 75 - .../method_virtualhubsgetinboundroutes.go | 75 - .../method_virtualhubsgetoutboundroutes.go | 75 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_effectiveroutemaproute.go | 10 - .../model_effectiveroutemaproutelist.go | 8 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../model_virtualhubeffectiveroute.go | 12 - .../model_virtualhubeffectiveroutelist.go | 8 - .../network/2023-04-01/virtualwans/version.go | 12 - .../vmsspublicipaddresses/README.md | 71 - .../vmsspublicipaddresses/constants.go | 1151 ------- ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_networkinterfacepropertiesformat.go | 29 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../vmsspublicipaddresses/version.go | 12 - .../network/2023-04-01/vpngateways/README.md | 83 - .../2023-04-01/vpngateways/method_reset.go | 99 - .../network/2023-04-01/vpngateways/version.go | 12 - .../2023-04-01/vpnlinkconnections/version.go | 12 - .../vpnserverconfigurations/README.md | 41 - .../vpnserverconfigurations/version.go | 12 - .../network/2023-04-01/vpnsites/README.md | 41 - .../network/2023-04-01/vpnsites/version.go | 12 - .../webapplicationfirewallpolicies/README.md | 104 - .../constants.go | 2842 ---------------- ...odel_applicationgatewaypropertiesformat.go | 43 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_groupbyusersession.go | 8 - .../model_groupbyvariable.go | 8 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_policysettings.go | 18 - .../model_policysettingslogscrubbing.go | 9 - ...del_privateendpointconnectionproperties.go | 12 - .../model_publicipaddressdnssettings.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetpropertiesformat.go | 26 - .../model_webapplicationfirewallcustomrule.go | 17 - ...el_webapplicationfirewallscrubbingrules.go | 11 - .../webapplicationfirewallpolicies/version.go | 12 - .../2023-04-01/webcategories/README.md | 54 - .../2023-04-01/webcategories/version.go | 12 - .../2023-05-01/adminrulecollections/README.md | 86 - .../2023-05-01/adminrulecollections/client.go | 26 - .../adminrulecollections/constants.go | 57 - .../adminrulecollections/id_rulecollection.go | 148 - .../id_rulecollection_test.go | 372 --- .../id_securityadminconfiguration.go | 139 - .../id_securityadminconfiguration_test.go | 327 -- .../method_createorupdate.go | 59 - .../adminrulecollections/method_delete.go | 99 - .../adminrulecollections/method_get.go | 54 - .../adminrulecollections/method_list.go | 119 - .../model_adminrulecollection.go | 17 - ...del_adminrulecollectionpropertiesformat.go | 11 - .../model_networkmanagersecuritygroupitem.go | 8 - .../adminrulecollections/predicates.go | 32 - .../adminrulecollections/version.go | 12 - .../network/2023-05-01/adminrules/README.md | 86 - .../network/2023-05-01/adminrules/client.go | 26 - .../2023-05-01/adminrules/constants.go | 277 -- .../network/2023-05-01/adminrules/id_rule.go | 157 - .../2023-05-01/adminrules/id_rule_test.go | 417 --- .../adminrules/id_rulecollection.go | 148 - .../adminrules/id_rulecollection_test.go | 372 --- .../adminrules/method_createorupdate.go | 63 - .../2023-05-01/adminrules/method_delete.go | 99 - .../2023-05-01/adminrules/method_get.go | 58 - .../2023-05-01/adminrules/method_list.go | 103 - .../adminrules/model_addressprefixitem.go | 9 - .../adminrules/model_adminpropertiesformat.go | 18 - .../2023-05-01/adminrules/model_adminrule.go | 48 - .../adminrules/model_baseadminrule.go | 61 - .../model_defaultadminpropertiesformat.go | 19 - .../adminrules/model_defaultadminrule.go | 48 - .../2023-05-01/adminrules/predicates.go | 12 - .../network/2023-05-01/adminrules/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 1151 ------- .../id_applicationgateway.go | 130 - .../id_applicationgateway_test.go | 282 -- ...icationgatewayprivateendpointconnection.go | 139 - ...ongatewayprivateendpointconnection_test.go | 327 -- .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../method_update.go | 75 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - ...icationgatewayprivateendpointconnection.go | 12 - ...ewayprivateendpointconnectionproperties.go | 11 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../predicates.go | 32 - .../version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_applicationgateway.go | 130 - .../id_applicationgateway_test.go | 282 -- .../method_list.go | 91 - ...l_applicationgatewayprivatelinkresource.go | 12 - ...iongatewayprivatelinkresourceproperties.go | 10 - .../predicates.go | 32 - .../version.go | 12 - .../2023-05-01/applicationgateways/README.md | 287 -- .../2023-05-01/applicationgateways/client.go | 26 - .../applicationgateways/constants.go | 2119 ------------ .../id_applicationgateway.go | 130 - .../id_applicationgateway_test.go | 282 -- .../id_predefinedpolicy.go | 123 - .../id_predefinedpolicy_test.go | 267 -- .../method_backendhealth.go | 99 - .../method_backendhealthondemand.go | 103 - .../method_createorupdate.go | 75 - .../applicationgateways/method_delete.go | 71 - .../applicationgateways/method_get.go | 54 - .../method_getsslpredefinedpolicy.go | 54 - .../applicationgateways/method_list.go | 92 - .../applicationgateways/method_listall.go | 92 - .../method_listavailablerequestheaders.go | 56 - .../method_listavailableresponseheaders.go | 56 - .../method_listavailableservervariables.go | 56 - .../method_listavailablessloptions.go | 56 - ...thod_listavailablesslpredefinedpolicies.go | 92 - .../method_listavailablewafrulesets.go | 56 - .../applicationgateways/method_start.go | 70 - .../applicationgateways/method_stop.go | 70 - .../applicationgateways/method_updatetags.go | 58 - .../model_applicationgateway.go | 21 - ...icationgatewayauthenticationcertificate.go | 12 - ...thenticationcertificatepropertiesformat.go | 9 - ...pplicationgatewayautoscaleconfiguration.go | 9 - ...l_applicationgatewayavailablessloptions.go | 13 - ...ewayavailablessloptionspropertiesformat.go | 11 - ...cationgatewayavailablewafrulesetsresult.go | 8 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - .../model_applicationgatewaybackendhealth.go | 8 - ...icationgatewaybackendhealthhttpsettings.go | 9 - ...applicationgatewaybackendhealthondemand.go | 9 - ...del_applicationgatewaybackendhealthpool.go | 9 - ...l_applicationgatewaybackendhealthserver.go | 11 - ...l_applicationgatewaybackendhttpsettings.go | 12 - ...ewaybackendhttpsettingspropertiesformat.go | 21 - ...model_applicationgatewaybackendsettings.go | 12 - ...ngatewaybackendsettingspropertiesformat.go | 15 - ...plicationgatewayclientauthconfiguration.go | 9 - ...el_applicationgatewayconnectiondraining.go | 9 - .../model_applicationgatewaycustomerror.go | 9 - ...icationgatewayfirewalldisabledrulegroup.go | 9 - ...del_applicationgatewayfirewallexclusion.go | 10 - .../model_applicationgatewayfirewallrule.go | 12 - ...del_applicationgatewayfirewallrulegroup.go | 10 - ...model_applicationgatewayfirewallruleset.go | 13 - ...ngatewayfirewallrulesetpropertiesformat.go | 12 - ...plicationgatewayfrontendipconfiguration.go | 12 - ...frontendipconfigurationpropertiesformat.go | 13 - .../model_applicationgatewayfrontendport.go | 12 - ...tiongatewayfrontendportpropertiesformat.go | 9 - ...l_applicationgatewayglobalconfiguration.go | 9 - ...l_applicationgatewayheaderconfiguration.go | 9 - .../model_applicationgatewayhttplistener.go | 12 - ...tiongatewayhttplistenerpropertiesformat.go | 18 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationgatewaylistener.go | 12 - ...licationgatewaylistenerpropertiesformat.go | 13 - ...pplicationgatewayloaddistributionpolicy.go | 12 - ...yloaddistributionpolicypropertiesformat.go | 10 - ...pplicationgatewayloaddistributiontarget.go | 12 - ...yloaddistributiontargetpropertiesformat.go | 9 - .../model_applicationgatewayondemandprobe.go | 15 - .../model_applicationgatewaypathrule.go | 12 - ...licationgatewaypathrulepropertiesformat.go | 15 - ...icationgatewayprivateendpointconnection.go | 12 - ...ewayprivateendpointconnectionproperties.go | 11 - ...licationgatewayprivatelinkconfiguration.go | 12 - ...tewayprivatelinkconfigurationproperties.go | 9 - ...cationgatewayprivatelinkipconfiguration.go | 12 - ...wayprivatelinkipconfigurationproperties.go | 12 - .../model_applicationgatewayprobe.go | 12 - ...licationgatewayprobehealthresponsematch.go | 9 - ...applicationgatewayprobepropertiesformat.go | 19 - ...odel_applicationgatewaypropertiesformat.go | 43 - ...applicationgatewayredirectconfiguration.go | 12 - ...ayredirectconfigurationpropertiesformat.go | 15 - ...el_applicationgatewayrequestroutingrule.go | 12 - ...tewayrequestroutingrulepropertiesformat.go | 17 - .../model_applicationgatewayrewriterule.go | 11 - ..._applicationgatewayrewriteruleactionset.go | 10 - ..._applicationgatewayrewriterulecondition.go | 11 - .../model_applicationgatewayrewriteruleset.go | 11 - ...ongatewayrewriterulesetpropertiesformat.go | 9 - .../model_applicationgatewayroutingrule.go | 12 - ...ationgatewayroutingrulepropertiesformat.go | 13 - .../model_applicationgatewaysku.go | 10 - .../model_applicationgatewaysslcertificate.go | 12 - ...ongatewaysslcertificatepropertiesformat.go | 12 - .../model_applicationgatewaysslpolicy.go | 12 - ...l_applicationgatewaysslpredefinedpolicy.go | 10 - ...ewaysslpredefinedpolicypropertiesformat.go | 9 - .../model_applicationgatewaysslprofile.go | 12 - ...cationgatewaysslprofilepropertiesformat.go | 11 - ...licationgatewaytrustedclientcertificate.go | 12 - ...rustedclientcertificatepropertiesformat.go | 11 - ...pplicationgatewaytrustedrootcertificate.go | 12 - ...ytrustedrootcertificatepropertiesformat.go | 10 - ...odel_applicationgatewayurlconfiguration.go | 10 - .../model_applicationgatewayurlpathmap.go | 12 - ...cationgatewayurlpathmappropertiesformat.go | 14 - ...ewaywebapplicationfirewallconfiguration.go | 17 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../applicationgateways/model_ddossettings.go | 9 - .../applicationgateways/model_delegation.go | 12 - .../applicationgateways/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../applicationgateways/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../applicationgateways/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../applicationgateways/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../applicationgateways/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../applicationgateways/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../applicationgateways/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../applicationgateways/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../applicationgateways/model_subresource.go | 8 - .../applicationgateways/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../applicationgateways/predicates.go | 55 - .../2023-05-01/applicationgateways/version.go | 12 - .../README.md | 53 - .../client.go | 26 - .../constants.go | 195 -- .../id_location.go | 121 - .../id_location_test.go | 237 -- .../method_defaultget.go | 55 - .../method_get.go | 91 - ...plicationgatewayfirewallmanifestruleset.go | 12 - .../model_applicationgatewayfirewallrule.go | 12 - ...del_applicationgatewayfirewallrulegroup.go | 10 - ...tewaywafdynamicmanifestpropertiesresult.go | 9 - ...licationgatewaywafdynamicmanifestresult.go | 11 - .../model_defaultrulesetpropertyformat.go | 9 - .../predicates.go | 27 - .../version.go | 12 - .../applicationsecuritygroups/README.md | 121 - .../applicationsecuritygroups/client.go | 26 - .../applicationsecuritygroups/constants.go | 57 - .../id_applicationsecuritygroup.go | 130 - .../id_applicationsecuritygroup_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../applicationsecuritygroups/method_get.go | 54 - .../applicationsecuritygroups/method_list.go | 92 - .../method_listall.go | 92 - .../method_updatetags.go | 58 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_tagsobject.go | 8 - .../applicationsecuritygroups/predicates.go | 37 - .../applicationsecuritygroups/version.go | 12 - .../2023-05-01/availabledelegations/README.md | 54 - .../2023-05-01/availabledelegations/client.go | 26 - .../availabledelegations/id_location.go | 121 - .../availabledelegations/id_location_test.go | 237 -- .../id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../method_availabledelegationslist.go | 91 - ...d_availableresourcegroupdelegationslist.go | 91 - .../model_availabledelegation.go | 12 - .../availabledelegations/predicates.go | 32 - .../availabledelegations/version.go | 12 - .../availableservicealiases/README.md | 54 - .../availableservicealiases/client.go | 26 - .../availableservicealiases/id_location.go | 121 - .../id_location_test.go | 237 -- .../id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../availableservicealiases/method_list.go | 91 - .../method_listbyresourcegroup.go | 91 - .../model_availableservicealias.go | 11 - .../availableservicealiases/predicates.go | 32 - .../availableservicealiases/version.go | 12 - .../2023-05-01/azurefirewalls/README.md | 146 - .../2023-05-01/azurefirewalls/client.go | 26 - .../2023-05-01/azurefirewalls/constants.go | 412 --- .../azurefirewalls/id_azurefirewall.go | 130 - .../azurefirewalls/id_azurefirewall_test.go | 282 -- ...ethod_azurefirewallslistlearnedprefixes.go | 71 - .../azurefirewalls/method_createorupdate.go | 75 - .../azurefirewalls/method_delete.go | 71 - .../2023-05-01/azurefirewalls/method_get.go | 54 - .../2023-05-01/azurefirewalls/method_list.go | 92 - .../azurefirewalls/method_listall.go | 92 - .../azurefirewalls/method_packetcapture.go | 73 - .../azurefirewalls/method_updatetags.go | 75 - .../azurefirewalls/model_azurefirewall.go | 19 - .../model_azurefirewallapplicationrule.go | 14 - ..._azurefirewallapplicationrulecollection.go | 11 - ...plicationrulecollectionpropertiesformat.go | 11 - ...el_azurefirewallapplicationruleprotocol.go | 9 - .../model_azurefirewallipconfiguration.go | 12 - ...firewallipconfigurationpropertiesformat.go | 11 - .../model_azurefirewallipgroups.go | 9 - .../model_azurefirewallnatrcaction.go | 8 - .../model_azurefirewallnatrule.go | 17 - .../model_azurefirewallnatrulecollection.go | 11 - ...zurefirewallnatrulecollectionproperties.go | 11 - .../model_azurefirewallnetworkrule.go | 16 - ...odel_azurefirewallnetworkrulecollection.go | 11 - ...llnetworkrulecollectionpropertiesformat.go | 11 - .../model_azurefirewallpacketcaptureflags.go | 8 - .../model_azurefirewallpacketcapturerule.go | 10 - .../model_azurefirewallpropertiesformat.go | 20 - .../model_azurefirewallpublicipaddress.go | 8 - .../model_azurefirewallrcaction.go | 8 - .../azurefirewalls/model_azurefirewallsku.go | 9 - .../model_firewallpacketcaptureparameters.go | 9 - ...l_firewallpacketcaptureparametersformat.go | 14 - .../azurefirewalls/model_hubipaddresses.go | 9 - .../model_hubpublicipaddresses.go | 9 - .../azurefirewalls/model_ipprefixeslist.go | 8 - .../azurefirewalls/model_subresource.go | 8 - .../azurefirewalls/model_tagsobject.go | 8 - .../2023-05-01/azurefirewalls/predicates.go | 37 - .../2023-05-01/azurefirewalls/version.go | 12 - .../network/2023-05-01/bastionhosts/README.md | 217 -- .../network/2023-05-01/bastionhosts/client.go | 26 - .../2023-05-01/bastionhosts/constants.go | 180 -- .../2023-05-01/bastionhosts/id_bastionhost.go | 130 - .../bastionhosts/id_bastionhost_test.go | 282 -- .../bastionhosts/method_createorupdate.go | 75 - .../2023-05-01/bastionhosts/method_delete.go | 71 - .../method_deletebastionshareablelink.go | 74 - .../method_disconnectactivesessions.go | 91 - .../2023-05-01/bastionhosts/method_get.go | 54 - .../bastionhosts/method_getactivesessions.go | 76 - .../method_getbastionshareablelink.go | 91 - .../2023-05-01/bastionhosts/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_putbastionshareablelink.go | 80 - .../bastionhosts/method_updatetags.go | 75 - .../model_bastionactivesession.go | 18 - .../bastionhosts/model_bastionhost.go | 15 - .../model_bastionhostipconfiguration.go | 12 - ...tionhostipconfigurationpropertiesformat.go | 11 - .../model_bastionhostpropertiesformat.go | 19 - ..._bastionhostpropertiesformatnetworkacls.go | 8 - .../bastionhosts/model_bastionsessionstate.go | 10 - .../model_bastionshareablelink.go | 11 - .../model_bastionshareablelinklistrequest.go | 8 - .../2023-05-01/bastionhosts/model_iprule.go | 8 - .../2023-05-01/bastionhosts/model_resource.go | 12 - .../bastionhosts/model_sessionids.go | 8 - .../2023-05-01/bastionhosts/model_sku.go | 8 - .../bastionhosts/model_subresource.go | 8 - .../bastionhosts/model_tagsobject.go | 8 - .../2023-05-01/bastionhosts/predicates.go | 141 - .../2023-05-01/bastionhosts/version.go | 12 - .../2023-05-01/bastionshareablelink/README.md | 81 - .../2023-05-01/bastionshareablelink/client.go | 26 - .../bastionshareablelink/id_bastionhost.go | 130 - .../id_bastionhost_test.go | 282 -- .../method_deletebastionshareablelink.go | 74 - .../method_getbastionshareablelink.go | 91 - .../method_putbastionshareablelink.go | 80 - .../model_bastionshareablelink.go | 11 - .../model_bastionshareablelinklistrequest.go | 8 - .../bastionshareablelink/model_resource.go | 12 - .../bastionshareablelink/predicates.go | 27 - .../bastionshareablelink/version.go | 12 - .../bgpservicecommunities/README.md | 38 - .../bgpservicecommunities/client.go | 26 - .../bgpservicecommunities/method_list.go | 92 - .../model_bgpcommunity.go | 13 - .../model_bgpservicecommunity.go | 13 - ...del_bgpservicecommunitypropertiesformat.go | 9 - .../bgpservicecommunities/predicates.go | 32 - .../bgpservicecommunities/version.go | 12 - .../checkdnsavailabilities/README.md | 36 - .../checkdnsavailabilities/client.go | 26 - .../checkdnsavailabilities/id_location.go | 121 - .../id_location_test.go | 237 -- .../method_checkdnsnameavailability.go | 83 - .../model_dnsnameavailabilityresult.go | 8 - .../checkdnsavailabilities/version.go | 12 - resource-manager/network/2023-05-01/client.go | 982 ------ .../cloudservicepublicipaddresses/README.md | 71 - .../cloudservicepublicipaddresses/client.go | 26 - .../constants.go | 1151 ------- .../id_providercloudservice.go | 130 - .../id_providercloudservice_test.go | 282 -- ...addressesgetcloudservicepublicipaddress.go | 84 - ...resseslistcloudservicepublicipaddresses.go | 91 - ...oudserviceroleinstancepublicipaddresses.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../predicates.go | 37 - .../cloudservicepublicipaddresses/version.go | 12 - .../2023-05-01/connectionmonitors/README.md | 138 - .../2023-05-01/connectionmonitors/client.go | 26 - .../connectionmonitors/constants.go | 770 ----- .../id_connectionmonitor.go | 139 - .../id_connectionmonitor_test.go | 327 -- .../connectionmonitors/id_networkwatcher.go | 130 - .../id_networkwatcher_test.go | 282 -- .../method_createorupdate.go | 103 - .../connectionmonitors/method_delete.go | 70 - .../connectionmonitors/method_get.go | 54 - .../connectionmonitors/method_list.go | 55 - .../connectionmonitors/method_query.go | 71 - .../connectionmonitors/method_start.go | 70 - .../connectionmonitors/method_stop.go | 70 - .../connectionmonitors/method_updatetags.go | 58 - .../model_connectionmonitor.go | 10 - .../model_connectionmonitordestination.go | 10 - .../model_connectionmonitorendpoint.go | 14 - .../model_connectionmonitorendpointfilter.go | 9 - ...del_connectionmonitorendpointfilteritem.go | 9 - .../model_connectionmonitorendpointscope.go | 9 - ...odel_connectionmonitorendpointscopeitem.go | 8 - ...odel_connectionmonitorhttpconfiguration.go | 13 - ...odel_connectionmonitoricmpconfiguration.go | 8 - .../model_connectionmonitorlistresult.go | 8 - .../model_connectionmonitoroutput.go | 9 - .../model_connectionmonitorparameters.go | 16 - .../model_connectionmonitorqueryresult.go | 9 - .../model_connectionmonitorresult.go | 14 - ...model_connectionmonitorresultproperties.go | 38 - .../model_connectionmonitorsource.go | 9 - ...model_connectionmonitorsuccessthreshold.go | 9 - ...model_connectionmonitortcpconfiguration.go | 10 - ...odel_connectionmonitortestconfiguration.go | 15 - .../model_connectionmonitortestgroup.go | 12 - ...odel_connectionmonitorworkspacesettings.go | 8 - .../model_connectionstatesnapshot.go | 47 - .../model_connectivityhop.go | 16 - .../model_connectivityissue.go | 11 - .../connectionmonitors/model_hoplink.go | 13 - .../model_hoplinkproperties.go | 10 - .../connectionmonitors/model_httpheader.go | 9 - .../connectionmonitors/model_tagsobject.go | 8 - .../2023-05-01/connectionmonitors/version.go | 12 - .../connectivityconfigurations/README.md | 86 - .../connectivityconfigurations/client.go | 26 - .../connectivityconfigurations/constants.go | 262 -- .../id_connectivityconfiguration.go | 139 - .../id_connectivityconfiguration_test.go | 327 -- .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../method_createorupdate.go | 59 - .../method_delete.go | 99 - .../connectivityconfigurations/method_get.go | 54 - .../connectivityconfigurations/method_list.go | 119 - .../model_connectivityconfiguration.go | 17 - ...del_connectivityconfigurationproperties.go | 15 - .../model_connectivitygroupitem.go | 11 - .../connectivityconfigurations/model_hub.go | 9 - .../connectivityconfigurations/predicates.go | 32 - .../connectivityconfigurations/version.go | 12 - .../2023-05-01/customipprefixes/README.md | 121 - .../2023-05-01/customipprefixes/client.go | 26 - .../2023-05-01/customipprefixes/constants.go | 222 -- .../customipprefixes/id_customipprefix.go | 130 - .../id_customipprefix_test.go | 282 -- .../customipprefixes/method_createorupdate.go | 75 - .../customipprefixes/method_delete.go | 71 - .../2023-05-01/customipprefixes/method_get.go | 83 - .../customipprefixes/method_list.go | 92 - .../customipprefixes/method_listall.go | 92 - .../customipprefixes/method_updatetags.go | 58 - .../customipprefixes/model_customipprefix.go | 21 - .../model_customipprefixpropertiesformat.go | 22 - .../customipprefixes/model_subresource.go | 8 - .../customipprefixes/model_tagsobject.go | 8 - .../2023-05-01/customipprefixes/predicates.go | 37 - .../2023-05-01/customipprefixes/version.go | 12 - .../2023-05-01/ddoscustompolicies/README.md | 86 - .../2023-05-01/ddoscustompolicies/client.go | 26 - .../ddoscustompolicies/constants.go | 57 - .../ddoscustompolicies/id_ddoscustompolicy.go | 130 - .../id_ddoscustompolicy_test.go | 282 -- .../method_createorupdate.go | 75 - .../ddoscustompolicies/method_delete.go | 71 - .../ddoscustompolicies/method_get.go | 54 - .../ddoscustompolicies/method_updatetags.go | 58 - .../model_ddoscustompolicy.go | 14 - .../model_ddoscustompolicypropertiesformat.go | 9 - .../ddoscustompolicies/model_tagsobject.go | 8 - .../2023-05-01/ddoscustompolicies/version.go | 12 - .../2023-05-01/ddosprotectionplans/README.md | 121 - .../2023-05-01/ddosprotectionplans/client.go | 26 - .../ddosprotectionplans/constants.go | 57 - .../id_ddosprotectionplan.go | 130 - .../id_ddosprotectionplan_test.go | 282 -- .../method_createorupdate.go | 75 - .../ddosprotectionplans/method_delete.go | 71 - .../ddosprotectionplans/method_get.go | 54 - .../ddosprotectionplans/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../ddosprotectionplans/method_updatetags.go | 58 - .../model_ddosprotectionplan.go | 14 - ...odel_ddosprotectionplanpropertiesformat.go | 11 - .../ddosprotectionplans/model_subresource.go | 8 - .../ddosprotectionplans/model_tagsobject.go | 8 - .../ddosprotectionplans/predicates.go | 37 - .../2023-05-01/ddosprotectionplans/version.go | 12 - .../2023-05-01/dscpconfiguration/README.md | 65 - .../2023-05-01/dscpconfiguration/client.go | 26 - .../2023-05-01/dscpconfiguration/constants.go | 1213 ------- .../dscpconfiguration/id_dscpconfiguration.go | 130 - .../id_dscpconfiguration_test.go | 282 -- .../method_createorupdate.go | 75 - .../dscpconfiguration/method_delete.go | 71 - .../dscpconfiguration/method_get.go | 54 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../dscpconfiguration/model_ddossettings.go | 9 - .../dscpconfiguration/model_delegation.go | 12 - .../model_dscpconfiguration.go | 14 - ...model_dscpconfigurationpropertiesformat.go | 18 - .../dscpconfiguration/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../dscpconfiguration/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../dscpconfiguration/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../dscpconfiguration/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../dscpconfiguration/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../dscpconfiguration/model_qosdefinition.go | 13 - .../dscpconfiguration/model_qosiprange.go | 9 - .../dscpconfiguration/model_qosportrange.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../dscpconfiguration/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../dscpconfiguration/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../dscpconfiguration/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../dscpconfiguration/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../dscpconfiguration/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../dscpconfiguration/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/dscpconfiguration/version.go | 12 - .../2023-05-01/dscpconfigurations/README.md | 55 - .../2023-05-01/dscpconfigurations/client.go | 26 - .../dscpconfigurations/constants.go | 1213 ------- .../method_dscpconfigurationlist.go | 92 - .../method_dscpconfigurationlistall.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../dscpconfigurations/model_ddossettings.go | 9 - .../dscpconfigurations/model_delegation.go | 12 - .../model_dscpconfiguration.go | 14 - ...model_dscpconfigurationpropertiesformat.go | 18 - .../dscpconfigurations/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../dscpconfigurations/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../dscpconfigurations/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../dscpconfigurations/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../dscpconfigurations/model_qosdefinition.go | 13 - .../dscpconfigurations/model_qosiprange.go | 9 - .../dscpconfigurations/model_qosportrange.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../dscpconfigurations/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../dscpconfigurations/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../dscpconfigurations/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../dscpconfigurations/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../dscpconfigurations/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../dscpconfigurations/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../dscpconfigurations/predicates.go | 37 - .../2023-05-01/dscpconfigurations/version.go | 12 - .../2023-05-01/endpointservices/README.md | 37 - .../2023-05-01/endpointservices/client.go | 26 - .../endpointservices/id_location.go | 121 - .../endpointservices/id_location_test.go | 237 -- .../method_availableendpointserviceslist.go | 91 - .../model_endpointserviceresult.go | 10 - .../2023-05-01/endpointservices/predicates.go | 27 - .../2023-05-01/endpointservices/version.go | 12 - .../expressroutecircuitarptable/README.md | 37 - .../expressroutecircuitarptable/client.go | 26 - .../id_arptable.go | 148 - .../id_arptable_test.go | 372 --- ...method_expressroutecircuitslistarptable.go | 76 - .../model_expressroutecircuitarptable.go | 11 - .../expressroutecircuitarptable/predicates.go | 32 - .../expressroutecircuitarptable/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 98 - .../id_authorization.go | 139 - .../id_authorization_test.go | 327 -- .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_authorizationpropertiesformat.go | 10 - .../model_expressroutecircuitauthorization.go | 12 - .../predicates.go | 32 - .../version.go | 12 - .../expressroutecircuitconnections/README.md | 83 - .../expressroutecircuitconnections/client.go | 26 - .../constants.go | 101 - .../id_peeringconnection.go | 148 - .../id_peeringconnection_test.go | 372 --- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 92 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_ipv6circuitconnectionconfig.go | 9 - .../model_subresource.go | 8 - .../predicates.go | 32 - .../expressroutecircuitconnections/version.go | 12 - .../expressroutecircuitpeerings/README.md | 83 - .../expressroutecircuitpeerings/client.go | 26 - .../expressroutecircuitpeerings/constants.go | 274 -- .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- .../method_createorupdate.go | 76 - .../method_delete.go | 72 - .../expressroutecircuitpeerings/method_get.go | 55 - .../method_list.go | 91 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_expressroutecircuitpeering.go | 12 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...ressroutecircuitpeeringpropertiesformat.go | 27 - .../model_expressroutecircuitstats.go | 11 - .../model_expressrouteconnectionid.go | 8 - .../model_ipv6circuitconnectionconfig.go | 9 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_subresource.go | 8 - .../expressroutecircuitpeerings/predicates.go | 32 - .../expressroutecircuitpeerings/version.go | 12 - .../expressroutecircuitroutestable/README.md | 37 - .../expressroutecircuitroutestable/client.go | 26 - .../id_peeringroutetable.go | 148 - .../id_peeringroutetable_test.go | 372 --- ...hod_expressroutecircuitslistroutestable.go | 76 - .../model_expressroutecircuitroutestable.go | 12 - .../predicates.go | 37 - .../expressroutecircuitroutestable/version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_routetablessummary.go | 148 - .../id_routetablessummary_test.go | 372 --- ...ressroutecircuitslistroutestablesummary.go | 76 - ...l_expressroutecircuitroutestablesummary.go | 12 - .../predicates.go | 37 - .../version.go | 12 - .../2023-05-01/expressroutecircuits/README.md | 121 - .../2023-05-01/expressroutecircuits/client.go | 26 - .../expressroutecircuits/constants.go | 450 --- .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressroutecircuits/method_delete.go | 71 - .../expressroutecircuits/method_get.go | 54 - .../expressroutecircuits/method_list.go | 92 - .../expressroutecircuits/method_listall.go | 92 - .../expressroutecircuits/method_updatetags.go | 58 - .../model_authorizationpropertiesformat.go | 10 - .../model_expressroutecircuit.go | 15 - .../model_expressroutecircuitauthorization.go | 12 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_expressroutecircuitpeering.go | 12 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...ressroutecircuitpeeringpropertiesformat.go | 27 - ...del_expressroutecircuitpropertiesformat.go | 23 - ...ssroutecircuitserviceproviderproperties.go | 10 - .../model_expressroutecircuitsku.go | 10 - .../model_expressroutecircuitstats.go | 11 - .../model_expressrouteconnectionid.go | 8 - .../model_ipv6circuitconnectionconfig.go | 9 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../expressroutecircuits/model_subresource.go | 8 - .../expressroutecircuits/model_tagsobject.go | 8 - .../expressroutecircuits/predicates.go | 37 - .../expressroutecircuits/version.go | 12 - .../expressroutecircuitstats/README.md | 53 - .../expressroutecircuitstats/client.go | 26 - .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- ...hod_expressroutecircuitsgetpeeringstats.go | 56 - .../method_expressroutecircuitsgetstats.go | 55 - .../model_expressroutecircuitstats.go | 11 - .../expressroutecircuitstats/version.go | 12 - .../expressrouteconnections/README.md | 81 - .../expressrouteconnections/client.go | 26 - .../expressrouteconnections/constants.go | 98 - .../id_expressrouteconnection.go | 139 - .../id_expressrouteconnection_test.go | 327 -- .../id_expressroutegateway.go | 130 - .../id_expressroutegateway_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressrouteconnections/method_delete.go | 71 - .../expressrouteconnections/method_get.go | 54 - .../expressrouteconnections/method_list.go | 55 - .../model_expressroutecircuitpeeringid.go | 8 - .../model_expressrouteconnection.go | 10 - .../model_expressrouteconnectionlist.go | 8 - .../model_expressrouteconnectionproperties.go | 15 - .../model_propagatedroutetable.go | 9 - .../model_routingconfiguration.go | 12 - .../model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../model_subresource.go | 8 - .../model_vnetroute.go | 10 - .../expressrouteconnections/version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_peeringarptable.go | 148 - .../id_peeringarptable_test.go | 372 --- ...xpressroutecrossconnectionslistarptable.go | 76 - .../model_expressroutecircuitarptable.go | 11 - .../predicates.go | 32 - .../version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 230 -- .../id_expressroutecrossconnection.go | 130 - .../id_expressroutecrossconnection_test.go | 282 -- .../id_peering.go | 139 - .../id_peering_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...odel_expressroutecrossconnectionpeering.go | 11 - ...ssroutecrossconnectionpeeringproperties.go | 22 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - .../model_subresource.go | 8 - .../predicates.go | 27 - .../version.go | 12 - .../README.md | 37 - .../client.go | 26 - ...ssroutecrossconnectionpeeringroutetable.go | 148 - ...tecrossconnectionpeeringroutetable_test.go | 372 --- ...essroutecrossconnectionslistroutestable.go | 76 - .../model_expressroutecircuitroutestable.go | 12 - .../predicates.go | 37 - .../version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_peeringroutetablessummary.go | 148 - .../id_peeringroutetablessummary_test.go | 372 --- ...ecrossconnectionslistroutestablesummary.go | 76 - ...sroutecrossconnectionroutestablesummary.go | 11 - .../predicates.go | 32 - .../version.go | 12 - .../expressroutecrossconnections/README.md | 109 - .../expressroutecrossconnections/client.go | 26 - .../expressroutecrossconnections/constants.go | 277 -- .../id_expressroutecrossconnection.go | 130 - .../id_expressroutecrossconnection_test.go | 282 -- .../method_createorupdate.go | 74 - .../method_get.go | 54 - .../method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_expressroutecircuitpeeringconfig.go | 13 - .../model_expressroutecircuitreference.go | 8 - .../model_expressroutecrossconnection.go | 14 - ...odel_expressroutecrossconnectionpeering.go | 11 - ...ssroutecrossconnectionpeeringproperties.go | 22 - ...l_expressroutecrossconnectionproperties.go | 17 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../predicates.go | 37 - .../expressroutecrossconnections/version.go | 12 - .../2023-05-01/expressroutegateways/README.md | 115 - .../2023-05-01/expressroutegateways/client.go | 26 - .../expressroutegateways/constants.go | 98 - .../id_expressroutegateway.go | 130 - .../id_expressroutegateway_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressroutegateways/method_delete.go | 71 - .../expressroutegateways/method_get.go | 54 - .../method_listbyresourcegroup.go | 56 - .../method_listbysubscription.go | 56 - .../expressroutegateways/method_updatetags.go | 75 - .../model_expressroutecircuitpeeringid.go | 8 - .../model_expressrouteconnection.go | 10 - .../model_expressrouteconnectionproperties.go | 15 - .../model_expressroutegateway.go | 14 - .../model_expressroutegatewaylist.go | 8 - .../model_expressroutegatewayproperties.go | 12 - ...gatewaypropertiesautoscaleconfiguration.go | 8 - ...ypropertiesautoscaleconfigurationbounds.go | 9 - .../model_propagatedroutetable.go | 9 - .../model_routingconfiguration.go | 12 - .../expressroutegateways/model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../expressroutegateways/model_subresource.go | 8 - .../expressroutegateways/model_tagsobject.go | 8 - .../model_virtualhubid.go | 8 - .../expressroutegateways/model_vnetroute.go | 10 - .../expressroutegateways/version.go | 12 - .../2023-05-01/expressroutelinks/README.md | 53 - .../2023-05-01/expressroutelinks/client.go | 26 - .../2023-05-01/expressroutelinks/constants.go | 227 -- .../expressroutelinks/id_expressrouteport.go | 130 - .../id_expressrouteport_test.go | 282 -- .../2023-05-01/expressroutelinks/id_link.go | 139 - .../expressroutelinks/id_link_test.go | 327 -- .../expressroutelinks/method_get.go | 54 - .../expressroutelinks/method_list.go | 91 - .../model_expressroutelink.go | 11 - .../model_expressroutelinkmacsecconfig.go | 11 - .../model_expressroutelinkpropertiesformat.go | 16 - .../expressroutelinks/predicates.go | 27 - .../2023-05-01/expressroutelinks/version.go | 12 - .../expressrouteportauthorizations/README.md | 82 - .../expressrouteportauthorizations/client.go | 26 - .../constants.go | 98 - .../id_expressrouteport.go | 130 - .../id_expressrouteport_test.go | 282 -- .../id_expressrouteportauthorization.go | 139 - .../id_expressrouteportauthorization_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_expressrouteportauthorization.go | 12 - ...srouteportauthorizationpropertiesformat.go | 11 - .../predicates.go | 32 - .../expressrouteportauthorizations/version.go | 12 - .../2023-05-01/expressrouteports/README.md | 142 - .../2023-05-01/expressrouteports/client.go | 26 - .../2023-05-01/expressrouteports/constants.go | 309 -- .../expressrouteports/id_expressrouteport.go | 130 - .../id_expressrouteport_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressrouteports/method_delete.go | 71 - .../expressrouteports/method_generateloa.go | 59 - .../expressrouteports/method_get.go | 54 - .../expressrouteports/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../expressrouteports/method_updatetags.go | 58 - .../model_expressroutelink.go | 11 - .../model_expressroutelinkmacsecconfig.go | 11 - .../model_expressroutelinkpropertiesformat.go | 16 - .../model_expressrouteport.go | 19 - .../model_expressrouteportpropertiesformat.go | 19 - ...del_generateexpressrouteportsloarequest.go | 8 - ...odel_generateexpressrouteportsloaresult.go | 8 - .../expressrouteports/model_subresource.go | 8 - .../expressrouteports/model_tagsobject.go | 8 - .../expressrouteports/predicates.go | 37 - .../2023-05-01/expressrouteports/version.go | 12 - .../expressrouteportslocations/README.md | 54 - .../expressrouteportslocations/client.go | 26 - .../expressrouteportslocations/constants.go | 57 - .../id_expressrouteportslocation.go | 121 - .../id_expressrouteportslocation_test.go | 237 -- .../expressrouteportslocations/method_get.go | 54 - .../expressrouteportslocations/method_list.go | 92 - .../model_expressrouteportslocation.go | 13 - ...del_expressrouteportslocationbandwidths.go | 9 - ...pressrouteportslocationpropertiesformat.go | 11 - .../expressrouteportslocations/predicates.go | 32 - .../expressrouteportslocations/version.go | 12 - .../expressrouteproviderports/README.md | 54 - .../expressrouteproviderports/client.go | 26 - .../id_expressrouteproviderport.go | 121 - .../id_expressrouteproviderport_test.go | 237 -- .../method_expressrouteproviderport.go | 54 - .../method_locationlist.go | 120 - .../model_expressrouteproviderport.go | 14 - ...odel_expressrouteproviderportproperties.go | 15 - .../expressrouteproviderports/predicates.go | 37 - .../expressrouteproviderports/version.go | 12 - .../expressrouteserviceproviders/README.md | 38 - .../expressrouteserviceproviders/client.go | 26 - .../expressrouteserviceproviders/constants.go | 57 - .../method_list.go | 92 - .../model_expressrouteserviceprovider.go | 13 - ...ssrouteserviceproviderbandwidthsoffered.go | 9 - ...essrouteserviceproviderpropertiesformat.go | 10 - .../predicates.go | 32 - .../expressrouteserviceproviders/version.go | 12 - .../2023-05-01/firewallpolicies/README.md | 237 -- .../2023-05-01/firewallpolicies/client.go | 26 - .../2023-05-01/firewallpolicies/constants.go | 366 --- .../firewallpolicies/id_firewallpolicy.go | 130 - .../id_firewallpolicy_test.go | 282 -- .../firewallpolicies/method_createorupdate.go | 75 - .../firewallpolicies/method_delete.go | 71 - ...allpolicyidpssignaturesfiltervalueslist.go | 59 - ...method_firewallpolicyidpssignatureslist.go | 59 - ...irewallpolicyidpssignaturesoverridesget.go | 55 - ...rewallpolicyidpssignaturesoverrideslist.go | 55 - ...ewallpolicyidpssignaturesoverridespatch.go | 59 - ...irewallpolicyidpssignaturesoverridesput.go | 59 - .../2023-05-01/firewallpolicies/method_get.go | 83 - .../firewallpolicies/method_list.go | 92 - .../firewallpolicies/method_listall.go | 92 - .../firewallpolicies/method_updatetags.go | 58 - .../firewallpolicies/model_dnssettings.go | 10 - .../firewallpolicies/model_explicitproxy.go | 13 - .../firewallpolicies/model_filteritems.go | 9 - .../firewallpolicies/model_firewallpolicy.go | 19 - ...odel_firewallpolicycertificateauthority.go | 9 - .../model_firewallpolicyinsights.go | 10 - .../model_firewallpolicyintrusiondetection.go | 9 - ...iondetectionbypasstrafficspecifications.go | 15 - ...llpolicyintrusiondetectionconfiguration.go | 10 - ...ntrusiondetectionsignaturespecification.go | 9 - ...del_firewallpolicyloganalyticsresources.go | 9 - ...del_firewallpolicyloganalyticsworkspace.go | 9 - .../model_firewallpolicypropertiesformat.go | 23 - .../model_firewallpolicysku.go | 8 - .../model_firewallpolicysnat.go | 9 - .../model_firewallpolicysql.go | 8 - ...odel_firewallpolicythreatintelwhitelist.go | 9 - .../model_firewallpolicytransportsecurity.go | 8 - .../firewallpolicies/model_idpsqueryobject.go | 12 - .../firewallpolicies/model_orderby.go | 9 - .../firewallpolicies/model_queryresults.go | 9 - ...del_signatureoverridesfiltervaluesquery.go | 8 - ..._signatureoverridesfiltervaluesresponse.go | 8 - .../model_signaturesoverrides.go | 11 - .../model_signaturesoverrideslist.go | 8 - .../model_signaturesoverridesproperties.go | 8 - .../model_singlequeryresult.go | 18 - .../firewallpolicies/model_subresource.go | 8 - .../firewallpolicies/model_tagsobject.go | 8 - .../2023-05-01/firewallpolicies/predicates.go | 37 - .../2023-05-01/firewallpolicies/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 309 -- .../id_firewallpolicy.go | 130 - .../id_firewallpolicy_test.go | 282 -- .../id_rulecollectiongroup.go | 139 - .../id_rulecollectiongroup_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_applicationrule.go | 52 - ...odel_firewallpolicyfilterrulecollection.go | 81 - ...irewallpolicyfilterrulecollectionaction.go | 8 - .../model_firewallpolicyhttpheadertoinsert.go | 9 - .../model_firewallpolicynatrulecollection.go | 81 - ...l_firewallpolicynatrulecollectionaction.go | 8 - .../model_firewallpolicyrule.go | 69 - ...l_firewallpolicyruleapplicationprotocol.go | 9 - .../model_firewallpolicyrulecollection.go | 61 - ...model_firewallpolicyrulecollectiongroup.go | 12 - ...wallpolicyrulecollectiongroupproperties.go | 53 - .../model_natrule.go | 50 - .../model_networkrule.go | 49 - .../predicates.go | 32 - .../version.go | 12 - .../network/2023-05-01/flowlogs/README.md | 103 - .../network/2023-05-01/flowlogs/client.go | 26 - .../network/2023-05-01/flowlogs/constants.go | 95 - .../network/2023-05-01/flowlogs/id_flowlog.go | 139 - .../2023-05-01/flowlogs/id_flowlog_test.go | 327 -- .../2023-05-01/flowlogs/id_networkwatcher.go | 130 - .../flowlogs/id_networkwatcher_test.go | 282 -- .../flowlogs/method_createorupdate.go | 75 - .../2023-05-01/flowlogs/method_delete.go | 70 - .../network/2023-05-01/flowlogs/method_get.go | 54 - .../2023-05-01/flowlogs/method_list.go | 91 - .../2023-05-01/flowlogs/method_updatetags.go | 58 - .../2023-05-01/flowlogs/model_flowlog.go | 14 - .../flowlogs/model_flowlogformatparameters.go | 9 - .../flowlogs/model_flowlogpropertiesformat.go | 15 - .../model_retentionpolicyparameters.go | 9 - .../2023-05-01/flowlogs/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../network/2023-05-01/flowlogs/predicates.go | 37 - .../network/2023-05-01/flowlogs/version.go | 12 - .../2023-05-01/ipallocations/README.md | 121 - .../2023-05-01/ipallocations/client.go | 26 - .../2023-05-01/ipallocations/constants.go | 92 - .../ipallocations/id_ipallocation.go | 130 - .../ipallocations/id_ipallocation_test.go | 282 -- .../ipallocations/method_createorupdate.go | 75 - .../2023-05-01/ipallocations/method_delete.go | 71 - .../2023-05-01/ipallocations/method_get.go | 83 - .../2023-05-01/ipallocations/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../ipallocations/method_updatetags.go | 58 - .../ipallocations/model_ipallocation.go | 14 - .../model_ipallocationpropertiesformat.go | 15 - .../ipallocations/model_subresource.go | 8 - .../ipallocations/model_tagsobject.go | 8 - .../2023-05-01/ipallocations/predicates.go | 37 - .../2023-05-01/ipallocations/version.go | 12 - .../network/2023-05-01/ipgroups/README.md | 121 - .../network/2023-05-01/ipgroups/client.go | 26 - .../network/2023-05-01/ipgroups/constants.go | 57 - .../network/2023-05-01/ipgroups/id_ipgroup.go | 130 - .../2023-05-01/ipgroups/id_ipgroup_test.go | 282 -- .../ipgroups/method_createorupdate.go | 75 - .../2023-05-01/ipgroups/method_delete.go | 71 - .../network/2023-05-01/ipgroups/method_get.go | 83 - .../2023-05-01/ipgroups/method_list.go | 92 - .../ipgroups/method_listbyresourcegroup.go | 92 - .../ipgroups/method_updategroups.go | 58 - .../2023-05-01/ipgroups/model_ipgroup.go | 14 - .../ipgroups/model_ipgrouppropertiesformat.go | 11 - .../2023-05-01/ipgroups/model_subresource.go | 8 - .../2023-05-01/ipgroups/model_tagsobject.go | 8 - .../network/2023-05-01/ipgroups/predicates.go | 37 - .../network/2023-05-01/ipgroups/version.go | 12 - .../2023-05-01/loadbalancers/README.md | 449 --- .../2023-05-01/loadbalancers/client.go | 26 - .../2023-05-01/loadbalancers/constants.go | 1368 -------- .../loadbalancers/id_backendaddresspool.go | 139 - .../id_backendaddresspool_test.go | 327 -- .../id_frontendipconfiguration.go | 139 - .../id_frontendipconfiguration_test.go | 327 -- .../loadbalancers/id_inboundnatrule.go | 139 - .../loadbalancers/id_inboundnatrule_test.go | 327 -- .../loadbalancers/id_loadbalancer.go | 130 - .../loadbalancers/id_loadbalancer_test.go | 282 -- .../id_loadbalancerbackendaddresspool.go | 139 - .../id_loadbalancerbackendaddresspool_test.go | 327 -- .../loadbalancers/id_loadbalancingrule.go | 139 - .../id_loadbalancingrule_test.go | 327 -- .../2023-05-01/loadbalancers/id_location.go | 121 - .../loadbalancers/id_location_test.go | 237 -- .../loadbalancers/id_outboundrule.go | 139 - .../loadbalancers/id_outboundrule_test.go | 327 -- .../2023-05-01/loadbalancers/id_probe.go | 139 - .../2023-05-01/loadbalancers/id_probe_test.go | 327 -- .../loadbalancers/id_providerloadbalancer.go | 130 - .../id_providerloadbalancer_test.go | 282 -- .../loadbalancers/method_createorupdate.go | 75 - .../2023-05-01/loadbalancers/method_delete.go | 71 - .../2023-05-01/loadbalancers/method_get.go | 83 - .../method_inboundnatrulescreateorupdate.go | 75 - .../method_inboundnatrulesdelete.go | 71 - .../method_inboundnatrulesget.go | 83 - .../method_inboundnatruleslist.go | 91 - .../2023-05-01/loadbalancers/method_list.go | 92 - .../loadbalancers/method_listall.go | 92 - .../method_listinboundnatruleportmappings.go | 75 - ...lancerbackendaddresspoolscreateorupdate.go | 75 - ...d_loadbalancerbackendaddresspoolsdelete.go | 71 - ...thod_loadbalancerbackendaddresspoolsget.go | 54 - ...hod_loadbalancerbackendaddresspoolslist.go | 91 - ...loadbalancerfrontendipconfigurationsget.go | 54 - ...oadbalancerfrontendipconfigurationslist.go | 91 - ...ethod_loadbalancerloadbalancingrulesget.go | 54 - ...thod_loadbalancerloadbalancingruleslist.go | 91 - ...ethod_loadbalancernetworkinterfaceslist.go | 91 - .../method_loadbalanceroutboundrulesget.go | 54 - .../method_loadbalanceroutboundruleslist.go | 91 - .../method_loadbalancerprobesget.go | 54 - .../method_loadbalancerprobeslist.go | 91 - .../loadbalancers/method_migratetoipbased.go | 59 - .../method_swappublicipaddresses.go | 74 - .../loadbalancers/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - ...ackendaddressinboundnatruleportmappings.go | 8 - .../loadbalancers/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../loadbalancers/model_ddossettings.go | 9 - .../loadbalancers/model_delegation.go | 12 - .../2023-05-01/loadbalancers/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../loadbalancers/model_inboundnatpool.go | 12 - .../model_inboundnatpoolpropertiesformat.go | 16 - .../loadbalancers/model_inboundnatrule.go | 12 - .../model_inboundnatruleportmapping.go | 11 - .../model_inboundnatrulepropertiesformat.go | 19 - .../loadbalancers/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-05-01/loadbalancers/model_iptag.go | 9 - .../loadbalancers/model_loadbalancer.go | 20 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_loadbalancerpropertiesformat.go | 16 - .../loadbalancers/model_loadbalancersku.go | 9 - .../model_loadbalancervipswaprequest.go | 8 - ...ervipswaprequestfrontendipconfiguration.go | 9 - ...equestfrontendipconfigurationproperties.go | 8 - .../loadbalancers/model_loadbalancingrule.go | 12 - ...model_loadbalancingrulepropertiesformat.go | 20 - .../loadbalancers/model_migratedpools.go | 8 - ...del_migrateloadbalancertoipbasedrequest.go | 8 - .../loadbalancers/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../loadbalancers/model_natgatewaysku.go | 8 - .../loadbalancers/model_natruleportmapping.go | 10 - .../loadbalancers/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../loadbalancers/model_outboundrule.go | 12 - .../model_outboundrulepropertiesformat.go | 14 - .../loadbalancers/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../loadbalancers/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../2023-05-01/loadbalancers/model_probe.go | 12 - .../model_probepropertiesformat.go | 15 - .../loadbalancers/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../loadbalancers/model_publicipaddresssku.go | 9 - ...l_queryinboundnatruleportmappingrequest.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../loadbalancers/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-05-01/loadbalancers/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../loadbalancers/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../loadbalancers/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../2023-05-01/loadbalancers/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../loadbalancers/model_subresource.go | 8 - .../loadbalancers/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../loadbalancers/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/loadbalancers/predicates.go | 238 -- .../2023-05-01/loadbalancers/version.go | 12 - .../2023-05-01/localnetworkgateways/README.md | 104 - .../2023-05-01/localnetworkgateways/client.go | 26 - .../localnetworkgateways/constants.go | 57 - .../id_localnetworkgateway.go | 130 - .../id_localnetworkgateway_test.go | 282 -- .../method_createorupdate.go | 75 - .../localnetworkgateways/method_delete.go | 71 - .../localnetworkgateways/method_get.go | 54 - .../localnetworkgateways/method_list.go | 92 - .../localnetworkgateways/method_updatetags.go | 58 - .../model_addressspace.go | 8 - .../localnetworkgateways/model_bgpsettings.go | 11 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_localnetworkgateway.go | 14 - ...del_localnetworkgatewaypropertiesformat.go | 13 - .../localnetworkgateways/model_tagsobject.go | 8 - .../localnetworkgateways/predicates.go | 37 - .../localnetworkgateways/version.go | 12 - .../network/2023-05-01/natgateways/README.md | 121 - .../network/2023-05-01/natgateways/client.go | 26 - .../2023-05-01/natgateways/constants.go | 95 - .../2023-05-01/natgateways/id_natgateway.go | 130 - .../natgateways/id_natgateway_test.go | 282 -- .../natgateways/method_createorupdate.go | 76 - .../2023-05-01/natgateways/method_delete.go | 71 - .../2023-05-01/natgateways/method_get.go | 83 - .../2023-05-01/natgateways/method_list.go | 92 - .../2023-05-01/natgateways/method_listall.go | 92 - .../natgateways/method_updatetags.go | 58 - .../natgateways/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../natgateways/model_natgatewaysku.go | 8 - .../natgateways/model_subresource.go | 8 - .../natgateways/model_tagsobject.go | 8 - .../2023-05-01/natgateways/predicates.go | 37 - .../network/2023-05-01/natgateways/version.go | 12 - .../2023-05-01/networkgroups/README.md | 86 - .../2023-05-01/networkgroups/client.go | 26 - .../2023-05-01/networkgroups/constants.go | 57 - .../networkgroups/id_networkgroup.go | 139 - .../networkgroups/id_networkgroup_test.go | 327 -- .../networkgroups/id_networkmanager.go | 130 - .../networkgroups/id_networkmanager_test.go | 282 -- .../networkgroups/method_createorupdate.go | 88 - .../2023-05-01/networkgroups/method_delete.go | 99 - .../2023-05-01/networkgroups/method_get.go | 54 - .../2023-05-01/networkgroups/method_list.go | 119 - .../networkgroups/model_networkgroup.go | 17 - .../model_networkgroupproperties.go | 10 - .../2023-05-01/networkgroups/predicates.go | 32 - .../2023-05-01/networkgroups/version.go | 12 - .../2023-05-01/networkinterfaces/README.md | 371 --- .../2023-05-01/networkinterfaces/client.go | 26 - .../2023-05-01/networkinterfaces/constants.go | 1500 --------- .../id_providercloudservice.go | 130 - .../id_providercloudservice_test.go | 282 -- .../networkinterfaces/id_roleinstance.go | 139 - .../networkinterfaces/id_roleinstance_test.go | 327 -- .../id_roleinstancenetworkinterface.go | 148 - .../id_roleinstancenetworkinterface_test.go | 372 --- .../networkinterfaces/id_tapconfiguration.go | 139 - .../id_tapconfiguration_test.go | 327 -- .../networkinterfaces/id_virtualmachine.go | 139 - .../id_virtualmachine_test.go | 327 -- .../id_virtualmachinescaleset.go | 130 - .../id_virtualmachinescaleset_test.go | 282 -- .../method_createorupdate.go | 76 - .../networkinterfaces/method_delete.go | 72 - .../networkinterfaces/method_get.go | 84 - .../method_getcloudservicenetworkinterface.go | 83 - .../method_geteffectiveroutetable.go | 77 - ...etvirtualmachinescalesetipconfiguration.go | 84 - ...tvirtualmachinescalesetnetworkinterface.go | 84 - .../networkinterfaces/method_list.go | 92 - .../networkinterfaces/method_listall.go | 92 - ...ethod_listcloudservicenetworkinterfaces.go | 91 - ...oudserviceroleinstancenetworkinterfaces.go | 91 - ...thod_listeffectivenetworksecuritygroups.go | 77 - ...tvirtualmachinescalesetipconfigurations.go | 120 - ...virtualmachinescalesetnetworkinterfaces.go | 91 - ...rtualmachinescalesetvmnetworkinterfaces.go | 91 - ...hod_networkinterfaceipconfigurationsget.go | 55 - ...od_networkinterfaceipconfigurationslist.go | 92 - ...ethod_networkinterfaceloadbalancerslist.go | 92 - ...od_networkinterfacetapconfigurationsget.go | 54 - ...d_networkinterfacetapconfigurationslist.go | 92 - .../networkinterfaces/method_updatetags.go | 59 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../networkinterfaces/model_ddossettings.go | 9 - .../networkinterfaces/model_delegation.go | 12 - .../model_effectivenetworksecuritygroup.go | 11 - ...ffectivenetworksecuritygroupassociation.go | 10 - .../model_effectivenetworksecurityrule.go | 22 - .../networkinterfaces/model_effectiveroute.go | 14 - .../networkinterfaces/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../networkinterfaces/model_inboundnatpool.go | 12 - .../model_inboundnatpoolpropertiesformat.go | 16 - .../networkinterfaces/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../networkinterfaces/model_iptag.go | 9 - .../networkinterfaces/model_loadbalancer.go | 20 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_loadbalancerpropertiesformat.go | 16 - .../model_loadbalancersku.go | 9 - .../model_loadbalancingrule.go | 12 - ...model_loadbalancingrulepropertiesformat.go | 20 - .../networkinterfaces/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../networkinterfaces/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../networkinterfaces/model_outboundrule.go | 12 - .../model_outboundrulepropertiesformat.go | 14 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../networkinterfaces/model_probe.go | 12 - .../model_probepropertiesformat.go | 15 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../networkinterfaces/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../networkinterfaces/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../networkinterfaces/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../networkinterfaces/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../networkinterfaces/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../networkinterfaces/model_subresource.go | 8 - .../networkinterfaces/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../networkinterfaces/predicates.go | 152 - .../2023-05-01/networkinterfaces/version.go | 12 - .../README.md | 41 - .../client.go | 26 - .../constants.go | 277 -- .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../method_listactivesecurityadminrules.go | 59 - .../model_activebasesecurityadminrule.go | 61 - .../model_activeconfigurationparameter.go | 9 - .../model_activedefaultsecurityadminrule.go | 63 - .../model_activesecurityadminrule.go | 63 - ...odel_activesecurityadminruleslistresult.go | 49 - .../model_addressprefixitem.go | 9 - .../model_adminpropertiesformat.go | 18 - .../model_configurationgroup.go | 9 - .../model_defaultadminpropertiesformat.go | 19 - .../model_networkgroupproperties.go | 10 - .../model_networkmanagersecuritygroupitem.go | 8 - .../version.go | 12 - .../README.md | 41 - .../client.go | 26 - .../constants.go | 262 -- .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- ...od_listactiveconnectivityconfigurations.go | 59 - .../model_activeconfigurationparameter.go | 9 - .../model_activeconnectivityconfiguration.go | 30 - ...iveconnectivityconfigurationslistresult.go | 9 - .../model_configurationgroup.go | 9 - ...del_connectivityconfigurationproperties.go | 15 - .../model_connectivitygroupitem.go | 11 - .../model_hub.go | 9 - .../model_networkgroupproperties.go | 10 - .../version.go | 12 - .../networkmanagerconnections/README.md | 161 - .../networkmanagerconnections/client.go | 26 - .../networkmanagerconnections/constants.go | 60 - .../id_networkmanagerconnection.go | 121 - .../id_networkmanagerconnection_test.go | 237 -- .../id_providers2networkmanagerconnection.go | 123 - ...providers2networkmanagerconnection_test.go | 267 -- ...networkmanagerconnectionscreateorupdate.go | 59 - ...entgroupnetworkmanagerconnectionsdelete.go | 47 - ...gementgroupnetworkmanagerconnectionsget.go | 54 - ...ementgroupnetworkmanagerconnectionslist.go | 120 - ...networkmanagerconnectionscreateorupdate.go | 59 - ...criptionnetworkmanagerconnectionsdelete.go | 47 - ...ubscriptionnetworkmanagerconnectionsget.go | 54 - ...bscriptionnetworkmanagerconnectionslist.go | 120 - .../model_networkmanagerconnection.go | 17 - ...odel_networkmanagerconnectionproperties.go | 10 - .../networkmanagerconnections/predicates.go | 32 - .../networkmanagerconnections/version.go | 12 - .../README.md | 42 - .../client.go | 26 - .../constants.go | 262 -- ...agereffectiveconnectivityconfigurations.go | 60 - .../model_configurationgroup.go | 9 - ...del_connectivityconfigurationproperties.go | 15 - .../model_connectivitygroupitem.go | 11 - ...odel_effectiveconnectivityconfiguration.go | 10 - .../model_hub.go | 9 - .../model_networkgroupproperties.go | 10 - ...tiveconnectivityconfigurationlistresult.go | 9 - .../model_queryrequestoptions.go | 8 - .../version.go | 12 - .../README.md | 42 - .../client.go | 26 - .../constants.go | 277 -- ...tworkmanagereffectivesecurityadminrules.go | 60 - .../model_addressprefixitem.go | 9 - .../model_adminpropertiesformat.go | 18 - .../model_configurationgroup.go | 9 - .../model_defaultadminpropertiesformat.go | 19 - .../model_effectivebasesecurityadminrule.go | 61 - ...model_effectivedefaultsecurityadminrule.go | 46 - .../model_effectivesecurityadminrule.go | 46 - .../model_networkgroupproperties.go | 10 - ...ereffectivesecurityadminruleslistresult.go | 49 - .../model_networkmanagersecuritygroupitem.go | 8 - .../model_queryrequestoptions.go | 8 - .../version.go | 12 - .../2023-05-01/networkmanagers/README.md | 163 - .../2023-05-01/networkmanagers/client.go | 26 - .../2023-05-01/networkmanagers/constants.go | 145 - .../networkmanagers/id_networkmanager.go | 130 - .../networkmanagers/id_networkmanager_test.go | 282 -- .../networkmanagers/method_createorupdate.go | 59 - .../networkmanagers/method_delete.go | 99 - .../2023-05-01/networkmanagers/method_get.go | 54 - .../2023-05-01/networkmanagers/method_list.go | 120 - .../method_listbysubscription.go | 120 - .../method_networkmanagercommitspost.go | 75 - ...thod_networkmanagerdeploymentstatuslist.go | 59 - .../networkmanagers/method_patch.go | 58 - .../model_crosstenantscopes.go | 10 - .../networkmanagers/model_networkmanager.go | 19 - .../model_networkmanagercommit.go | 11 - .../model_networkmanagerdeploymentstatus.go | 31 - ...etworkmanagerdeploymentstatuslistresult.go | 9 - ...networkmanagerdeploymentstatusparameter.go | 10 - .../model_networkmanagerproperties.go | 12 - ...rkmanagerpropertiesnetworkmanagerscopes.go | 10 - .../networkmanagers/model_patchobject.go | 8 - .../2023-05-01/networkmanagers/predicates.go | 37 - .../2023-05-01/networkmanagers/version.go | 12 - .../2023-05-01/networkprofiles/README.md | 125 - .../2023-05-01/networkprofiles/client.go | 26 - .../2023-05-01/networkprofiles/constants.go | 1151 ------- .../networkprofiles/id_networkprofile.go | 130 - .../networkprofiles/id_networkprofile_test.go | 282 -- .../networkprofiles/method_createorupdate.go | 59 - .../networkprofiles/method_delete.go | 71 - .../2023-05-01/networkprofiles/method_get.go | 83 - .../2023-05-01/networkprofiles/method_list.go | 92 - .../networkprofiles/method_listall.go | 92 - .../networkprofiles/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_containernetworkinterface.go | 12 - ..._containernetworkinterfaceconfiguration.go | 12 - ...kinterfaceconfigurationpropertiesformat.go | 10 - ...ontainernetworkinterfaceipconfiguration.go | 11 - ...nterfaceipconfigurationpropertiesformat.go | 8 - ...ntainernetworkinterfacepropertiesformat.go | 11 - .../model_customdnsconfigpropertiesformat.go | 9 - .../networkprofiles/model_ddossettings.go | 9 - .../networkprofiles/model_delegation.go | 12 - .../networkprofiles/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../networkprofiles/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../networkprofiles/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-05-01/networkprofiles/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../networkprofiles/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../networkprofiles/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../networkprofiles/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../networkprofiles/model_networkprofile.go | 14 - .../model_networkprofilepropertiesformat.go | 11 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../networkprofiles/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../networkprofiles/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../networkprofiles/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-05-01/networkprofiles/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../networkprofiles/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../networkprofiles/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../networkprofiles/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../networkprofiles/model_subresource.go | 8 - .../networkprofiles/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/networkprofiles/predicates.go | 37 - .../2023-05-01/networkprofiles/version.go | 12 - .../networksecuritygroups/README.md | 121 - .../networksecuritygroups/client.go | 26 - .../networksecuritygroups/constants.go | 1151 ------- .../id_networksecuritygroup.go | 130 - .../id_networksecuritygroup_test.go | 282 -- .../method_createorupdate.go | 75 - .../networksecuritygroups/method_delete.go | 71 - .../networksecuritygroups/method_get.go | 83 - .../networksecuritygroups/method_list.go | 92 - .../networksecuritygroups/method_listall.go | 92 - .../method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../networksecuritygroups/model_delegation.go | 12 - .../networksecuritygroups/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../networksecuritygroups/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../networksecuritygroups/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../networksecuritygroups/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../networksecuritygroups/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../networksecuritygroups/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - .../networksecuritygroups/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../networksecuritygroups/predicates.go | 37 - .../networksecuritygroups/version.go | 12 - .../networkvirtualappliances/README.md | 138 - .../networkvirtualappliances/client.go | 26 - .../networkvirtualappliances/constants.go | 98 - .../id_inboundsecurityrule.go | 139 - .../id_inboundsecurityrule_test.go | 327 -- .../id_networkvirtualappliance.go | 130 - .../id_networkvirtualappliance_test.go | 282 -- .../method_createorupdate.go | 75 - .../networkvirtualappliances/method_delete.go | 71 - .../networkvirtualappliances/method_get.go | 83 - ...ethod_inboundsecurityrulecreateorupdate.go | 75 - .../networkvirtualappliances/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_delegationproperties.go | 9 - .../model_inboundsecurityrule.go | 12 - .../model_inboundsecurityruleproperties.go | 9 - .../model_inboundsecurityrules.go | 10 - .../model_networkvirtualappliance.go | 19 - ...networkvirtualappliancepropertiesformat.go | 23 - .../model_partnermanagedresourceproperties.go | 10 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - ...virtualapplianceadditionalnicproperties.go | 9 - .../model_virtualappliancenicproperties.go | 11 - .../model_virtualapplianceskuproperties.go | 10 - .../networkvirtualappliances/predicates.go | 37 - .../networkvirtualappliances/version.go | 12 - .../2023-05-01/networkwatchers/README.md | 331 -- .../2023-05-01/networkwatchers/client.go | 26 - .../2023-05-01/networkwatchers/constants.go | 855 ----- .../networkwatchers/id_networkwatcher.go | 130 - .../networkwatchers/id_networkwatcher_test.go | 282 -- .../method_checkconnectivity.go | 75 - .../networkwatchers/method_createorupdate.go | 59 - .../networkwatchers/method_delete.go | 70 - .../2023-05-01/networkwatchers/method_get.go | 54 - .../method_getazurereachabilityreport.go | 75 - .../method_getflowlogstatus.go | 75 - ...ethod_getnetworkconfigurationdiagnostic.go | 75 - .../networkwatchers/method_getnexthop.go | 75 - .../networkwatchers/method_gettopology.go | 59 - .../method_gettroubleshooting.go | 75 - .../method_gettroubleshootingresult.go | 75 - .../method_getvmsecurityrules.go | 75 - .../2023-05-01/networkwatchers/method_list.go | 56 - .../networkwatchers/method_listall.go | 56 - .../method_listavailableproviders.go | 75 - .../method_setflowlogconfiguration.go | 75 - .../networkwatchers/method_updatetags.go | 58 - .../networkwatchers/method_verifyipflow.go | 75 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_availableproviderslist.go | 8 - .../model_availableproviderslistcity.go | 9 - .../model_availableproviderslistcountry.go | 10 - .../model_availableproviderslistparameters.go | 11 - .../model_availableprovidersliststate.go | 10 - .../model_azurereachabilityreport.go | 10 - .../model_azurereachabilityreportitem.go | 10 - ...odel_azurereachabilityreportlatencyinfo.go | 27 - .../model_azurereachabilityreportlocation.go | 10 - ...model_azurereachabilityreportparameters.go | 36 - .../model_connectivitydestination.go | 10 - .../networkwatchers/model_connectivityhop.go | 16 - .../model_connectivityinformation.go | 14 - .../model_connectivityissue.go | 11 - .../model_connectivityparameters.go | 12 - .../model_connectivitysource.go | 9 - .../model_effectivenetworksecurityrule.go | 22 - .../model_evaluatednetworksecuritygroup.go | 11 - .../model_flowlogformatparameters.go | 9 - .../model_flowloginformation.go | 10 - .../model_flowlogproperties.go | 11 - .../model_flowlogstatusparameters.go | 8 - .../networkwatchers/model_hoplink.go | 13 - .../model_hoplinkproperties.go | 10 - .../model_httpconfiguration.go | 10 - .../networkwatchers/model_httpheader.go | 9 - .../networkwatchers/model_matchedrule.go | 9 - ...etworkconfigurationdiagnosticparameters.go | 10 - ...l_networkconfigurationdiagnosticprofile.go | 12 - ..._networkconfigurationdiagnosticresponse.go | 8 - ...el_networkconfigurationdiagnosticresult.go | 9 - .../model_networkinterfaceassociation.go | 9 - .../model_networksecuritygroupresult.go | 9 - ...el_networksecurityrulesevaluationresult.go | 13 - .../networkwatchers/model_networkwatcher.go | 14 - .../model_networkwatcherlistresult.go | 8 - .../model_networkwatcherpropertiesformat.go | 8 - .../model_nexthopparameters.go | 11 - .../networkwatchers/model_nexthopresult.go | 10 - .../model_protocolconfiguration.go | 8 - .../model_querytroubleshootingparameters.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_securitygroupnetworkinterface.go | 9 - .../model_securitygroupviewparameters.go | 8 - .../model_securitygroupviewresult.go | 8 - .../networkwatchers/model_securityrule.go | 12 - .../model_securityruleassociations.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetassociation.go | 9 - .../networkwatchers/model_subresource.go | 8 - .../networkwatchers/model_tagsobject.go | 8 - .../networkwatchers/model_topology.go | 41 - .../model_topologyassociation.go | 10 - .../model_topologyparameters.go | 10 - .../networkwatchers/model_topologyresource.go | 11 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_troubleshootingdetails.go | 12 - .../model_troubleshootingparameters.go | 9 - .../model_troubleshootingproperties.go | 9 - ...model_troubleshootingrecommendedactions.go | 11 - .../model_troubleshootingresult.go | 41 - .../model_verificationipflowparameters.go | 15 - .../model_verificationipflowresult.go | 9 - .../2023-05-01/networkwatchers/version.go | 12 - .../2023-05-01/p2svpngateways/README.md | 113 - .../2023-05-01/p2svpngateways/client.go | 26 - .../2023-05-01/p2svpngateways/constants.go | 183 -- .../method_disconnectp2svpnconnections.go | 75 - .../method_generatevpnprofile.go | 76 - .../method_getp2svpnconnectionhealth.go | 72 - ...ethod_getp2svpnconnectionhealthdetailed.go | 76 - .../2023-05-01/p2svpngateways/method_reset.go | 72 - .../p2svpngateways/method_updatetags.go | 76 - .../p2svpngateways/model_addressspace.go | 8 - .../model_p2sconnectionconfiguration.go | 11 - ...el_p2sconnectionconfigurationproperties.go | 13 - .../model_p2svpnconnectionhealth.go | 8 - .../model_p2svpnconnectionhealthrequest.go | 9 - .../model_p2svpnconnectionrequest.go | 8 - .../p2svpngateways/model_p2svpngateway.go | 14 - .../model_p2svpngatewayproperties.go | 15 - .../model_p2svpnprofileparameters.go | 8 - .../model_propagatedroutetable.go | 9 - .../model_routingconfiguration.go | 12 - .../p2svpngateways/model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../p2svpngateways/model_subresource.go | 8 - .../p2svpngateways/model_tagsobject.go | 8 - .../p2svpngateways/model_vnetroute.go | 10 - .../model_vpnclientconnectionhealth.go | 11 - .../model_vpnprofileresponse.go | 8 - ...model_vpnserverconfigurationpolicygroup.go | 12 - ...vpnserverconfigurationpolicygroupmember.go | 10 - ...erverconfigurationpolicygroupproperties.go | 12 - .../2023-05-01/p2svpngateways/version.go | 12 - .../2023-05-01/packetcaptures/README.md | 105 - .../2023-05-01/packetcaptures/client.go | 26 - .../2023-05-01/packetcaptures/constants.go | 242 -- .../packetcaptures/id_networkwatcher.go | 130 - .../packetcaptures/id_networkwatcher_test.go | 282 -- .../packetcaptures/id_packetcapture.go | 139 - .../packetcaptures/id_packetcapture_test.go | 327 -- .../packetcaptures/method_create.go | 74 - .../packetcaptures/method_delete.go | 70 - .../2023-05-01/packetcaptures/method_get.go | 54 - .../packetcaptures/method_getstatus.go | 71 - .../2023-05-01/packetcaptures/method_list.go | 55 - .../2023-05-01/packetcaptures/method_stop.go | 70 - .../packetcaptures/model_packetcapture.go | 8 - .../model_packetcapturefilter.go | 12 - .../model_packetcapturelistresult.go | 8 - .../model_packetcapturemachinescope.go | 9 - .../model_packetcaptureparameters.go | 15 - .../model_packetcapturequerystatusresult.go | 31 - .../model_packetcaptureresult.go | 11 - .../model_packetcaptureresultproperties.go | 16 - .../model_packetcapturestoragelocation.go | 10 - .../2023-05-01/packetcaptures/version.go | 12 - .../README.md | 54 - .../client.go | 26 - .../constants.go | 101 - .../id_peerconnection.go | 148 - .../id_peerconnection_test.go | 372 --- .../method_get.go | 54 - .../method_list.go | 92 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_subresource.go | 8 - .../predicates.go | 32 - .../version.go | 12 - .../2023-05-01/privatednszonegroups/README.md | 82 - .../2023-05-01/privatednszonegroups/client.go | 26 - .../privatednszonegroups/constants.go | 57 - .../id_privatednszonegroup.go | 139 - .../id_privatednszonegroup_test.go | 327 -- .../id_privateendpoint.go | 130 - .../id_privateendpoint_test.go | 282 -- .../method_createorupdate.go | 75 - .../privatednszonegroups/method_delete.go | 71 - .../privatednszonegroups/method_get.go | 54 - .../privatednszonegroups/method_list.go | 91 - .../model_privatednszoneconfig.go | 9 - .../model_privatednszonegroup.go | 11 - ...del_privatednszonegrouppropertiesformat.go | 9 - .../model_privatednszonepropertiesformat.go | 9 - .../privatednszonegroups/model_recordset.go | 13 - .../privatednszonegroups/predicates.go | 27 - .../privatednszonegroups/version.go | 12 - .../2023-05-01/privateendpoints/README.md | 134 - .../2023-05-01/privateendpoints/client.go | 26 - .../2023-05-01/privateendpoints/constants.go | 1151 ------- .../privateendpoints/id_location.go | 121 - .../privateendpoints/id_location_test.go | 237 -- .../privateendpoints/id_privateendpoint.go | 130 - .../id_privateendpoint_test.go | 282 -- .../privateendpoints/id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- ...ethod_availableprivateendpointtypeslist.go | 91 - ...privateendpointtypeslistbyresourcegroup.go | 91 - .../privateendpoints/method_createorupdate.go | 75 - .../privateendpoints/method_delete.go | 71 - .../2023-05-01/privateendpoints/method_get.go | 83 - .../privateendpoints/method_list.go | 92 - .../method_listbysubscription.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_availableprivateendpointtype.go | 12 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../privateendpoints/model_ddossettings.go | 9 - .../privateendpoints/model_delegation.go | 12 - .../privateendpoints/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../privateendpoints/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../privateendpoints/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../privateendpoints/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../privateendpoints/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../privateendpoints/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../privateendpoints/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../privateendpoints/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../privateendpoints/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../privateendpoints/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../privateendpoints/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../privateendpoints/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../privateendpoints/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../privateendpoints/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/privateendpoints/predicates.go | 70 - .../2023-05-01/privateendpoints/version.go | 12 - .../2023-05-01/privatelinkservice/README.md | 37 - .../2023-05-01/privatelinkservice/client.go | 26 - .../privatelinkservice/constants.go | 1151 ------- .../id_privatelinkservice.go | 130 - .../id_privatelinkservice_test.go | 282 -- .../method_createorupdate.go | 75 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../privatelinkservice/model_ddossettings.go | 9 - .../privatelinkservice/model_delegation.go | 12 - .../privatelinkservice/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../privatelinkservice/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../privatelinkservice/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../privatelinkservice/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../privatelinkservice/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../privatelinkservice/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../privatelinkservice/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../privatelinkservice/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../privatelinkservice/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../privatelinkservice/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/privatelinkservice/version.go | 12 - .../2023-05-01/privatelinkservices/README.md | 217 -- .../2023-05-01/privatelinkservices/client.go | 26 - .../privatelinkservices/constants.go | 1151 ------- .../privatelinkservices/id_location.go | 121 - .../privatelinkservices/id_location_test.go | 237 -- .../id_privateendpointconnection.go | 139 - .../id_privateendpointconnection_test.go | 327 -- .../id_privatelinkservice.go | 130 - .../id_privatelinkservice_test.go | 282 -- .../id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- ...ethod_checkprivatelinkservicevisibility.go | 75 - ...atelinkservicevisibilitybyresourcegroup.go | 75 - .../privatelinkservices/method_delete.go | 71 - .../method_deleteprivateendpointconnection.go | 71 - .../privatelinkservices/method_get.go | 83 - .../method_getprivateendpointconnection.go | 83 - .../privatelinkservices/method_list.go | 92 - ...hod_listautoapprovedprivatelinkservices.go | 91 - ...rovedprivatelinkservicesbyresourcegroup.go | 91 - .../method_listbysubscription.go | 92 - .../method_listprivateendpointconnections.go | 91 - .../method_updateprivateendpointconnection.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_autoapprovedprivatelinkservice.go | 8 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - ...heckprivatelinkservicevisibilityrequest.go | 8 - .../model_customdnsconfigpropertiesformat.go | 9 - .../privatelinkservices/model_ddossettings.go | 9 - .../privatelinkservices/model_delegation.go | 12 - .../privatelinkservices/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../privatelinkservices/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../privatelinkservices/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_privatelinkservicevisibility.go | 8 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../privatelinkservices/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../privatelinkservices/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../privatelinkservices/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../privatelinkservices/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../privatelinkservices/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../privatelinkservices/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../privatelinkservices/predicates.go | 78 - .../2023-05-01/privatelinkservices/version.go | 12 - .../2023-05-01/publicipaddresses/README.md | 133 - .../2023-05-01/publicipaddresses/client.go | 26 - .../2023-05-01/publicipaddresses/constants.go | 1192 ------- .../method_createorupdate.go | 76 - .../method_ddosprotectionstatus.go | 72 - .../publicipaddresses/method_delete.go | 72 - .../publicipaddresses/method_get.go | 84 - .../publicipaddresses/method_list.go | 92 - .../publicipaddresses/method_listall.go | 92 - .../publicipaddresses/method_updatetags.go | 59 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../publicipaddresses/model_ddossettings.go | 9 - .../publicipaddresses/model_delegation.go | 12 - .../publicipaddresses/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../publicipaddresses/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../publicipaddresses/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../publicipaddresses/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../publicipaddresses/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - ...odel_publicipddosprotectionstatusresult.go | 11 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../publicipaddresses/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../publicipaddresses/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../publicipaddresses/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../publicipaddresses/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../publicipaddresses/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../publicipaddresses/model_subresource.go | 8 - .../publicipaddresses/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../publicipaddresses/predicates.go | 37 - .../2023-05-01/publicipaddresses/version.go | 12 - .../2023-05-01/publicipprefixes/README.md | 121 - .../2023-05-01/publicipprefixes/client.go | 26 - .../2023-05-01/publicipprefixes/constants.go | 215 -- .../publicipprefixes/id_publicipprefix.go | 130 - .../id_publicipprefix_test.go | 282 -- .../publicipprefixes/method_createorupdate.go | 75 - .../publicipprefixes/method_delete.go | 71 - .../2023-05-01/publicipprefixes/method_get.go | 83 - .../publicipprefixes/method_list.go | 92 - .../publicipprefixes/method_listall.go | 92 - .../publicipprefixes/method_updatetags.go | 58 - .../publicipprefixes/model_iptag.go | 9 - .../publicipprefixes/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../publicipprefixes/model_natgatewaysku.go | 8 - .../publicipprefixes/model_publicipprefix.go | 22 - .../model_publicipprefixpropertiesformat.go | 17 - .../model_publicipprefixsku.go | 9 - .../model_referencedpublicipaddress.go | 8 - .../publicipprefixes/model_subresource.go | 8 - .../publicipprefixes/model_tagsobject.go | 8 - .../2023-05-01/publicipprefixes/predicates.go | 37 - .../2023-05-01/publicipprefixes/version.go | 12 - .../2023-05-01/routefilterrules/README.md | 82 - .../2023-05-01/routefilterrules/client.go | 26 - .../2023-05-01/routefilterrules/constants.go | 136 - .../routefilterrules/id_routefilter.go | 130 - .../routefilterrules/id_routefilter_test.go | 282 -- .../routefilterrules/id_routefilterrule.go | 139 - .../id_routefilterrule_test.go | 327 -- .../routefilterrules/method_createorupdate.go | 75 - .../routefilterrules/method_delete.go | 71 - .../2023-05-01/routefilterrules/method_get.go | 54 - .../method_listbyroutefilter.go | 91 - .../routefilterrules/model_routefilterrule.go | 12 - .../model_routefilterrulepropertiesformat.go | 11 - .../2023-05-01/routefilterrules/predicates.go | 32 - .../2023-05-01/routefilterrules/version.go | 12 - .../network/2023-05-01/routefilters/README.md | 121 - .../network/2023-05-01/routefilters/client.go | 26 - .../2023-05-01/routefilters/constants.go | 353 -- .../2023-05-01/routefilters/id_routefilter.go | 130 - .../routefilters/id_routefilter_test.go | 282 -- .../routefilters/method_createorupdate.go | 75 - .../2023-05-01/routefilters/method_delete.go | 71 - .../2023-05-01/routefilters/method_get.go | 83 - .../2023-05-01/routefilters/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../routefilters/method_updatetags.go | 58 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_expressroutecircuitpeering.go | 12 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...ressroutecircuitpeeringpropertiesformat.go | 27 - .../model_expressroutecircuitstats.go | 11 - .../model_expressrouteconnectionid.go | 8 - .../model_ipv6circuitconnectionconfig.go | 9 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../routefilters/model_routefilter.go | 14 - .../model_routefilterpropertiesformat.go | 11 - .../routefilters/model_routefilterrule.go | 12 - .../model_routefilterrulepropertiesformat.go | 11 - .../routefilters/model_subresource.go | 8 - .../routefilters/model_tagsobject.go | 8 - .../2023-05-01/routefilters/predicates.go | 37 - .../2023-05-01/routefilters/version.go | 12 - .../network/2023-05-01/routes/README.md | 82 - .../network/2023-05-01/routes/client.go | 26 - .../network/2023-05-01/routes/constants.go | 107 - .../network/2023-05-01/routes/id_route.go | 139 - .../2023-05-01/routes/id_route_test.go | 327 -- .../2023-05-01/routes/id_routetable.go | 130 - .../2023-05-01/routes/id_routetable_test.go | 282 -- .../routes/method_createorupdate.go | 75 - .../2023-05-01/routes/method_delete.go | 71 - .../network/2023-05-01/routes/method_get.go | 54 - .../network/2023-05-01/routes/method_list.go | 91 - .../network/2023-05-01/routes/model_route.go | 12 - .../routes/model_routepropertiesformat.go | 12 - .../network/2023-05-01/routes/predicates.go | 32 - .../network/2023-05-01/routes/version.go | 12 - .../network/2023-05-01/routetables/README.md | 121 - .../network/2023-05-01/routetables/client.go | 26 - .../2023-05-01/routetables/constants.go | 1151 ------- .../2023-05-01/routetables/id_routetable.go | 130 - .../routetables/id_routetable_test.go | 282 -- .../routetables/method_createorupdate.go | 75 - .../2023-05-01/routetables/method_delete.go | 71 - .../2023-05-01/routetables/method_get.go | 83 - .../2023-05-01/routetables/method_list.go | 92 - .../2023-05-01/routetables/method_listall.go | 92 - .../routetables/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../routetables/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../routetables/model_ddossettings.go | 9 - .../routetables/model_delegation.go | 12 - .../2023-05-01/routetables/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../routetables/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../routetables/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-05-01/routetables/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../routetables/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../routetables/model_natgatewaysku.go | 8 - .../routetables/model_natruleportmapping.go | 10 - .../routetables/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../routetables/model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../routetables/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../routetables/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../routetables/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../routetables/model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../routetables/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-05-01/routetables/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../routetables/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../routetables/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../2023-05-01/routetables/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../routetables/model_subresource.go | 8 - .../routetables/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../routetables/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/routetables/predicates.go | 37 - .../network/2023-05-01/routetables/version.go | 12 - .../2023-05-01/scopeconnections/README.md | 90 - .../2023-05-01/scopeconnections/client.go | 26 - .../2023-05-01/scopeconnections/constants.go | 60 - .../scopeconnections/id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../scopeconnections/id_scopeconnection.go | 139 - .../id_scopeconnection_test.go | 327 -- .../scopeconnections/method_createorupdate.go | 59 - .../scopeconnections/method_delete.go | 47 - .../2023-05-01/scopeconnections/method_get.go | 54 - .../scopeconnections/method_list.go | 119 - .../scopeconnections/model_scopeconnection.go | 17 - .../model_scopeconnectionproperties.go | 11 - .../2023-05-01/scopeconnections/predicates.go | 32 - .../2023-05-01/scopeconnections/version.go | 12 - .../securityadminconfigurations/README.md | 86 - .../securityadminconfigurations/client.go | 26 - .../securityadminconfigurations/constants.go | 101 - .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../id_securityadminconfiguration.go | 139 - .../id_securityadminconfiguration_test.go | 327 -- .../method_createorupdate.go | 59 - .../method_delete.go | 99 - .../securityadminconfigurations/method_get.go | 54 - .../method_list.go | 119 - .../model_securityadminconfiguration.go | 17 - ...urityadminconfigurationpropertiesformat.go | 11 - .../securityadminconfigurations/predicates.go | 32 - .../securityadminconfigurations/version.go | 12 - .../securitypartnerproviders/README.md | 121 - .../securitypartnerproviders/client.go | 26 - .../securitypartnerproviders/constants.go | 148 - .../id_securitypartnerprovider.go | 130 - .../id_securitypartnerprovider_test.go | 282 -- .../method_createorupdate.go | 75 - .../securitypartnerproviders/method_delete.go | 71 - .../securitypartnerproviders/method_get.go | 54 - .../securitypartnerproviders/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_securitypartnerprovider.go | 14 - ...securitypartnerproviderpropertiesformat.go | 11 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../securitypartnerproviders/predicates.go | 37 - .../securitypartnerproviders/version.go | 12 - .../2023-05-01/securityrules/README.md | 115 - .../2023-05-01/securityrules/client.go | 26 - .../2023-05-01/securityrules/constants.go | 192 -- .../securityrules/id_defaultsecurityrule.go | 139 - .../id_defaultsecurityrule_test.go | 327 -- .../securityrules/id_networksecuritygroup.go | 130 - .../id_networksecuritygroup_test.go | 282 -- .../securityrules/id_securityrule.go | 139 - .../securityrules/id_securityrule_test.go | 327 -- .../securityrules/method_createorupdate.go | 75 - .../method_defaultsecurityrulesget.go | 54 - .../method_defaultsecurityruleslist.go | 91 - .../2023-05-01/securityrules/method_delete.go | 71 - .../2023-05-01/securityrules/method_get.go | 54 - .../2023-05-01/securityrules/method_list.go | 91 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../securityrules/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../2023-05-01/securityrules/predicates.go | 32 - .../2023-05-01/securityrules/version.go | 12 - .../serviceendpointpolicies/README.md | 121 - .../serviceendpointpolicies/client.go | 26 - .../serviceendpointpolicies/constants.go | 1151 ------- .../id_serviceendpointpolicy.go | 130 - .../id_serviceendpointpolicy_test.go | 282 -- .../method_createorupdate.go | 75 - .../serviceendpointpolicies/method_delete.go | 71 - .../serviceendpointpolicies/method_get.go | 83 - .../serviceendpointpolicies/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../serviceendpointpolicies/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../serviceendpointpolicies/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../serviceendpointpolicies/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../serviceendpointpolicies/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../serviceendpointpolicies/predicates.go | 42 - .../serviceendpointpolicies/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 57 - .../id_serviceendpointpolicy.go | 130 - .../id_serviceendpointpolicy_test.go | 282 -- .../id_serviceendpointpolicydefinition.go | 139 - ...id_serviceendpointpolicydefinition_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_listbyresourcegroup.go | 91 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - .../predicates.go | 32 - .../version.go | 12 - .../network/2023-05-01/servicetags/README.md | 53 - .../network/2023-05-01/servicetags/client.go | 26 - .../2023-05-01/servicetags/id_location.go | 121 - .../servicetags/id_location_test.go | 237 -- .../method_servicetaginformationlist.go | 123 - .../servicetags/method_servicetagslist.go | 55 - .../model_servicetaginformation.go | 11 - ...l_servicetaginformationpropertiesformat.go | 12 - .../model_servicetagslistresult.go | 14 - .../2023-05-01/servicetags/predicates.go | 27 - .../network/2023-05-01/servicetags/version.go | 12 - .../2023-05-01/staticmembers/README.md | 90 - .../2023-05-01/staticmembers/client.go | 26 - .../2023-05-01/staticmembers/constants.go | 57 - .../staticmembers/id_networkgroup.go | 139 - .../staticmembers/id_networkgroup_test.go | 327 -- .../staticmembers/id_staticmember.go | 148 - .../staticmembers/id_staticmember_test.go | 372 --- .../staticmembers/method_createorupdate.go | 59 - .../2023-05-01/staticmembers/method_delete.go | 47 - .../2023-05-01/staticmembers/method_get.go | 54 - .../2023-05-01/staticmembers/method_list.go | 119 - .../staticmembers/model_staticmember.go | 17 - .../model_staticmemberproperties.go | 10 - .../2023-05-01/staticmembers/predicates.go | 32 - .../2023-05-01/staticmembers/version.go | 12 - .../network/2023-05-01/subnets/README.md | 83 - .../network/2023-05-01/subnets/client.go | 26 - .../network/2023-05-01/subnets/constants.go | 1151 ------- .../subnets/method_createorupdate.go | 76 - .../2023-05-01/subnets/method_delete.go | 72 - .../network/2023-05-01/subnets/method_get.go | 84 - .../network/2023-05-01/subnets/method_list.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../subnets/model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../subnets/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../2023-05-01/subnets/model_ddossettings.go | 9 - .../2023-05-01/subnets/model_delegation.go | 12 - .../2023-05-01/subnets/model_flowlog.go | 14 - .../subnets/model_flowlogformatparameters.go | 9 - .../subnets/model_flowlogpropertiesformat.go | 15 - .../subnets/model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../subnets/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../subnets/model_ipconfiguration.go | 11 - .../subnets/model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../network/2023-05-01/subnets/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../2023-05-01/subnets/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../2023-05-01/subnets/model_natgatewaysku.go | 8 - .../subnets/model_natruleportmapping.go | 10 - .../subnets/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../subnets/model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../subnets/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../subnets/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../subnets/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../subnets/model_publicipaddresssku.go | 9 - .../subnets/model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../2023-05-01/subnets/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../network/2023-05-01/subnets/model_route.go | 12 - .../subnets/model_routepropertiesformat.go | 12 - .../2023-05-01/subnets/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../2023-05-01/subnets/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../subnets/model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../subnets/model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../2023-05-01/subnets/model_subnet.go | 12 - .../subnets/model_subnetpropertiesformat.go | 27 - .../2023-05-01/subnets/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../subnets/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../network/2023-05-01/subnets/predicates.go | 32 - .../network/2023-05-01/subnets/version.go | 12 - .../2023-05-01/trafficanalytics/README.md | 54 - .../2023-05-01/trafficanalytics/client.go | 26 - .../2023-05-01/trafficanalytics/constants.go | 48 - .../trafficanalytics/id_networkwatcher.go | 130 - .../id_networkwatcher_test.go | 282 -- .../method_networkwatchersgetflowlogstatus.go | 75 - ..._networkwatcherssetflowlogconfiguration.go | 75 - .../model_flowlogformatparameters.go | 9 - .../model_flowloginformation.go | 10 - .../model_flowlogproperties.go | 11 - .../model_flowlogstatusparameters.go | 8 - .../model_retentionpolicyparameters.go | 9 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../2023-05-01/trafficanalytics/version.go | 12 - .../network/2023-05-01/usages/README.md | 37 - .../network/2023-05-01/usages/client.go | 26 - .../network/2023-05-01/usages/constants.go | 48 - .../network/2023-05-01/usages/id_location.go | 121 - .../2023-05-01/usages/id_location_test.go | 237 -- .../network/2023-05-01/usages/method_list.go | 91 - .../network/2023-05-01/usages/model_usage.go | 12 - .../2023-05-01/usages/model_usagename.go | 9 - .../network/2023-05-01/usages/predicates.go | 27 - .../network/2023-05-01/usages/version.go | 12 - .../network/2023-05-01/vipswap/README.md | 69 - .../network/2023-05-01/vipswap/client.go | 26 - .../network/2023-05-01/vipswap/constants.go | 51 - .../2023-05-01/vipswap/id_cloudservice.go | 130 - .../vipswap/id_cloudservice_test.go | 282 -- .../2023-05-01/vipswap/method_create.go | 74 - .../network/2023-05-01/vipswap/method_get.go | 55 - .../network/2023-05-01/vipswap/method_list.go | 55 - .../2023-05-01/vipswap/model_swapresource.go | 11 - .../vipswap/model_swapresourcelistresult.go | 8 - .../vipswap/model_swapresourceproperties.go | 8 - .../network/2023-05-01/vipswap/version.go | 12 - .../virtualappliancesites/README.md | 82 - .../virtualappliancesites/client.go | 26 - .../virtualappliancesites/constants.go | 57 - .../id_networkvirtualappliance.go | 130 - .../id_networkvirtualappliance_test.go | 282 -- .../id_virtualappliancesite.go | 139 - .../id_virtualappliancesite_test.go | 327 -- .../method_createorupdate.go | 75 - .../virtualappliancesites/method_delete.go | 71 - .../virtualappliancesites/method_get.go | 54 - .../virtualappliancesites/method_list.go | 91 - .../model_breakoutcategorypolicies.go | 10 - .../model_office365policyproperties.go | 8 - .../model_virtualappliancesite.go | 12 - .../model_virtualappliancesiteproperties.go | 10 - .../virtualappliancesites/predicates.go | 32 - .../virtualappliancesites/version.go | 12 - .../2023-05-01/virtualapplianceskus/README.md | 54 - .../2023-05-01/virtualapplianceskus/client.go | 26 - .../id_networkvirtualappliancesku.go | 121 - .../id_networkvirtualappliancesku_test.go | 237 -- .../virtualapplianceskus/method_get.go | 54 - .../virtualapplianceskus/method_list.go | 92 - .../model_networkvirtualappliancesku.go | 14 - ...del_networkvirtualapplianceskuinstances.go | 9 - ...workvirtualapplianceskupropertiesformat.go | 10 - .../virtualapplianceskus/predicates.go | 37 - .../virtualapplianceskus/version.go | 12 - .../README.md | 208 -- .../client.go | 26 - .../constants.go | 1178 ------- .../id_connection.go | 130 - .../id_connection_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_getikesas.go | 71 - .../method_getsharedkey.go | 55 - .../method_list.go | 92 - .../method_resetconnection.go | 69 - .../method_resetsharedkey.go | 75 - .../method_setsharedkey.go | 75 - .../method_startpacketcapture.go | 75 - .../method_stoppacketcapture.go | 75 - .../method_updatetags.go | 75 - .../model_addressspace.go | 8 - .../model_bgpsettings.go | 11 - .../model_connectionresetsharedkey.go | 8 - .../model_connectionsharedkey.go | 9 - ...atewaycustombgpipaddressipconfiguration.go | 9 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_ipsecpolicy.go | 15 - .../model_localnetworkgateway.go | 14 - ...del_localnetworkgatewaypropertiesformat.go | 13 - .../model_radiusserver.go | 10 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../model_tunnelconnectionhealth.go | 12 - .../model_virtualnetworkgateway.go | 19 - ...el_virtualnetworkgatewayautoscalebounds.go | 9 - ...ualnetworkgatewayautoscaleconfiguration.go | 8 - .../model_virtualnetworkgatewayconnection.go | 14 - ...etworkgatewayconnectionpropertiesformat.go | 34 - ...el_virtualnetworkgatewayipconfiguration.go | 11 - ...kgatewayipconfigurationpropertiesformat.go | 12 - .../model_virtualnetworkgatewaynatrule.go | 12 - ..._virtualnetworkgatewaynatruleproperties.go | 13 - .../model_virtualnetworkgatewaypolicygroup.go | 11 - ..._virtualnetworkgatewaypolicygroupmember.go | 10 - ...tualnetworkgatewaypolicygroupproperties.go | 12 - ...l_virtualnetworkgatewaypropertiesformat.go | 32 - .../model_virtualnetworkgatewaysku.go | 10 - .../model_vngclientconnectionconfiguration.go | 11 - ...clientconnectionconfigurationproperties.go | 10 - .../model_vpnclientconfiguration.go | 20 - .../model_vpnclientrevokedcertificate.go | 11 - ...lientrevokedcertificatepropertiesformat.go | 9 - .../model_vpnclientrootcertificate.go | 11 - ...pnclientrootcertificatepropertiesformat.go | 9 - .../model_vpnnatrulemapping.go | 9 - .../model_vpnpacketcapturestartparameters.go | 8 - .../model_vpnpacketcapturestopparameters.go | 8 - .../predicates.go | 37 - .../version.go | 12 - .../virtualnetworkgateways/README.md | 414 --- .../virtualnetworkgateways/client.go | 26 - .../virtualnetworkgateways/constants.go | 1310 -------- .../virtualnetworkgateways/id_connection.go | 130 - .../id_connection_test.go | 282 -- .../id_virtualnetworkgateway.go | 130 - .../id_virtualnetworkgateway_test.go | 282 -- .../id_virtualnetworkgatewaynatrule.go | 139 - .../id_virtualnetworkgatewaynatrule_test.go | 327 -- .../method_createorupdate.go | 75 - .../virtualnetworkgateways/method_delete.go | 71 - ...nectvirtualnetworkgatewayvpnconnections.go | 74 - .../method_generatevpnclientpackage.go | 75 - .../method_generatevpnprofile.go | 75 - .../virtualnetworkgateways/method_get.go | 54 - .../method_getadvertisedroutes.go | 99 - .../method_getbgppeerstatus.go | 99 - .../method_getlearnedroutes.go | 71 - .../method_getvpnclientconnectionhealth.go | 71 - .../method_getvpnclientipsecparameters.go | 70 - .../method_getvpnprofilepackageurl.go | 71 - .../virtualnetworkgateways/method_list.go | 92 - .../method_listconnections.go | 91 - .../virtualnetworkgateways/method_reset.go | 99 - .../method_resetvpnclientsharedkey.go | 70 - .../method_setvpnclientipsecparameters.go | 75 - .../method_startpacketcapture.go | 75 - .../method_stoppacketcapture.go | 75 - .../method_supportedvpndevices.go | 55 - .../method_updatetags.go | 75 - ...ualnetworkgatewaynatrulescreateorupdate.go | 75 - ...hod_virtualnetworkgatewaynatrulesdelete.go | 71 - ...method_virtualnetworkgatewaynatrulesget.go | 54 - ...ewaynatruleslistbyvirtualnetworkgateway.go | 91 - .../method_vpndeviceconfigurationscript.go | 59 - .../model_addressspace.go | 8 - .../model_bgppeerstatus.go | 15 - .../model_bgppeerstatuslistresult.go | 8 - .../model_bgpsettings.go | 11 - ...atewaycustombgpipaddressipconfiguration.go | 9 - .../model_gatewayroute.go | 14 - .../model_gatewayroutelistresult.go | 8 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_ipsecpolicy.go | 15 - .../model_p2svpnconnectionrequest.go | 8 - .../model_radiusserver.go | 10 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../model_tunnelconnectionhealth.go | 12 - ...irtualnetworkconnectiongatewayreference.go | 8 - .../model_virtualnetworkgateway.go | 19 - ...el_virtualnetworkgatewayautoscalebounds.go | 9 - ...ualnetworkgatewayautoscaleconfiguration.go | 8 - ...rtualnetworkgatewayconnectionlistentity.go | 14 - ...wayconnectionlistentitypropertiesformat.go | 30 - ...el_virtualnetworkgatewayipconfiguration.go | 11 - ...kgatewayipconfigurationpropertiesformat.go | 12 - .../model_virtualnetworkgatewaynatrule.go | 12 - ..._virtualnetworkgatewaynatruleproperties.go | 13 - .../model_virtualnetworkgatewaypolicygroup.go | 11 - ..._virtualnetworkgatewaypolicygroupmember.go | 10 - ...tualnetworkgatewaypolicygroupproperties.go | 12 - ...l_virtualnetworkgatewaypropertiesformat.go | 32 - .../model_virtualnetworkgatewaysku.go | 10 - .../model_vngclientconnectionconfiguration.go | 11 - ...clientconnectionconfigurationproperties.go | 10 - .../model_vpnclientconfiguration.go | 20 - .../model_vpnclientconnectionhealthdetail.go | 19 - ...nclientconnectionhealthdetaillistresult.go | 8 - .../model_vpnclientipsecparameters.go | 15 - .../model_vpnclientparameters.go | 11 - .../model_vpnclientrevokedcertificate.go | 11 - ...lientrevokedcertificatepropertiesformat.go | 9 - .../model_vpnclientrootcertificate.go | 11 - ...pnclientrootcertificatepropertiesformat.go | 9 - .../model_vpndevicescriptparameters.go | 10 - .../model_vpnnatrulemapping.go | 9 - .../model_vpnpacketcapturestartparameters.go | 8 - .../model_vpnpacketcapturestopparameters.go | 8 - .../virtualnetworkgateways/predicates.go | 98 - .../virtualnetworkgateways/version.go | 12 - .../virtualnetworkpeerings/README.md | 83 - .../virtualnetworkpeerings/client.go | 26 - .../virtualnetworkpeerings/constants.go | 227 -- .../id_virtualnetworkpeering.go | 139 - .../id_virtualnetworkpeering_test.go | 327 -- .../method_createorupdate.go | 103 - .../virtualnetworkpeerings/method_delete.go | 71 - .../virtualnetworkpeerings/method_get.go | 54 - .../virtualnetworkpeerings/method_list.go | 92 - .../model_addressspace.go | 8 - .../model_subresource.go | 8 - .../model_virtualnetworkbgpcommunities.go | 9 - .../model_virtualnetworkencryption.go | 9 - .../model_virtualnetworkpeering.go | 12 - ...l_virtualnetworkpeeringpropertiesformat.go | 21 - .../virtualnetworkpeerings/predicates.go | 32 - .../virtualnetworkpeerings/version.go | 12 - .../2023-05-01/virtualnetworks/README.md | 239 -- .../2023-05-01/virtualnetworks/constants.go | 1324 -------- .../virtualnetworks/method_createorupdate.go | 76 - .../virtualnetworks/method_delete.go | 72 - .../2023-05-01/virtualnetworks/method_get.go | 84 - .../2023-05-01/virtualnetworks/method_list.go | 92 - .../virtualnetworks/method_listall.go | 92 - .../method_resourcenavigationlinkslist.go | 92 - .../method_serviceassociationlinkslist.go | 92 - .../method_subnetspreparenetworkpolicies.go | 75 - .../method_subnetsunpreparenetworkpolicies.go | 75 - .../virtualnetworks/method_updatetags.go | 59 - ...rtualnetworkscheckipaddressavailability.go | 84 - ...virtualnetworkslistddosprotectionstatus.go | 109 - .../method_virtualnetworkslistusage.go | 92 - .../virtualnetworks/model_addressspace.go | 8 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualnetworks/model_ddossettings.go | 9 - .../virtualnetworks/model_delegation.go | 12 - .../virtualnetworks/model_dhcpoptions.go | 8 - .../virtualnetworks/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../virtualnetworks/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipaddressavailabilityresult.go | 10 - .../virtualnetworks/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-05-01/virtualnetworks/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualnetworks/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualnetworks/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkintentpolicy.go | 13 - .../model_networkintentpolicyconfiguration.go | 9 - .../virtualnetworks/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_preparenetworkpoliciesrequest.go | 9 - .../virtualnetworks/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../virtualnetworks/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - ...odel_publicipddosprotectionstatusresult.go | 11 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualnetworks/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-05-01/virtualnetworks/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../virtualnetworks/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualnetworks/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualnetworks/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualnetworks/model_subresource.go | 8 - .../virtualnetworks/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_unpreparenetworkpoliciesrequest.go | 8 - .../virtualnetworks/model_virtualnetwork.go | 19 - .../model_virtualnetworkbgpcommunities.go | 9 - .../model_virtualnetworkencryption.go | 9 - .../model_virtualnetworkpeering.go | 12 - ...l_virtualnetworkpeeringpropertiesformat.go | 21 - .../model_virtualnetworkpropertiesformat.go | 21 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../model_virtualnetworkusage.go | 12 - .../model_virtualnetworkusagename.go | 9 - .../2023-05-01/virtualnetworks/predicates.go | 144 - .../2023-05-01/virtualnetworks/version.go | 12 - .../2023-05-01/virtualnetworktap/README.md | 86 - .../2023-05-01/virtualnetworktap/client.go | 26 - .../2023-05-01/virtualnetworktap/constants.go | 1151 ------- .../virtualnetworktap/id_virtualnetworktap.go | 130 - .../id_virtualnetworktap_test.go | 282 -- .../method_createorupdate.go | 75 - .../virtualnetworktap/method_delete.go | 71 - .../virtualnetworktap/method_get.go | 54 - .../virtualnetworktap/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualnetworktap/model_ddossettings.go | 9 - .../virtualnetworktap/model_delegation.go | 12 - .../virtualnetworktap/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../virtualnetworktap/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../virtualnetworktap/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualnetworktap/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualnetworktap/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualnetworktap/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../virtualnetworktap/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../virtualnetworktap/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualnetworktap/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualnetworktap/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualnetworktap/model_subresource.go | 8 - .../virtualnetworktap/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-05-01/virtualnetworktap/version.go | 12 - .../2023-05-01/virtualnetworktaps/README.md | 55 - .../2023-05-01/virtualnetworktaps/client.go | 26 - .../virtualnetworktaps/constants.go | 1151 ------- .../virtualnetworktaps/method_listall.go | 92 - .../method_listbyresourcegroup.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualnetworktaps/model_ddossettings.go | 9 - .../virtualnetworktaps/model_delegation.go | 12 - .../virtualnetworktaps/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../virtualnetworktaps/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualnetworktaps/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualnetworktaps/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualnetworktaps/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../virtualnetworktaps/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../virtualnetworktaps/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualnetworktaps/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualnetworktaps/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualnetworktaps/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../virtualnetworktaps/predicates.go | 37 - .../2023-05-01/virtualnetworktaps/version.go | 12 - .../virtualrouterpeerings/README.md | 83 - .../virtualrouterpeerings/client.go | 26 - .../virtualrouterpeerings/constants.go | 57 - .../virtualrouterpeerings/id_virtualrouter.go | 130 - .../id_virtualrouter_test.go | 282 -- .../method_createorupdate.go | 76 - .../virtualrouterpeerings/method_delete.go | 72 - .../virtualrouterpeerings/method_get.go | 55 - .../virtualrouterpeerings/method_list.go | 91 - .../model_virtualrouterpeering.go | 12 - .../model_virtualrouterpeeringproperties.go | 10 - .../virtualrouterpeerings/predicates.go | 32 - .../virtualrouterpeerings/version.go | 12 - .../2023-05-01/virtualrouters/README.md | 100 - .../2023-05-01/virtualrouters/client.go | 26 - .../2023-05-01/virtualrouters/constants.go | 57 - .../virtualrouters/id_virtualrouter.go | 130 - .../virtualrouters/id_virtualrouter_test.go | 282 -- .../virtualrouters/method_createorupdate.go | 75 - .../virtualrouters/method_delete.go | 71 - .../2023-05-01/virtualrouters/method_get.go | 83 - .../2023-05-01/virtualrouters/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../virtualrouters/model_subresource.go | 8 - .../virtualrouters/model_virtualrouter.go | 14 - .../model_virtualrouterpropertiesformat.go | 13 - .../2023-05-01/virtualrouters/predicates.go | 37 - .../2023-05-01/virtualrouters/version.go | 12 - .../network/2023-05-01/virtualwans/README.md | 1406 -------- .../network/2023-05-01/virtualwans/client.go | 26 - .../2023-05-01/virtualwans/constants.go | 2335 -------------- .../id_configurationpolicygroup.go | 139 - .../id_configurationpolicygroup_test.go | 327 -- .../virtualwans/id_hubroutetable.go | 139 - .../virtualwans/id_hubroutetable_test.go | 327 -- .../id_hubvirtualnetworkconnection.go | 139 - .../id_hubvirtualnetworkconnection_test.go | 327 -- .../2023-05-01/virtualwans/id_natrule.go | 139 - .../2023-05-01/virtualwans/id_natrule_test.go | 327 -- .../2023-05-01/virtualwans/id_routemap.go | 139 - .../virtualwans/id_routemap_test.go | 327 -- .../virtualwans/id_routingintent.go | 139 - .../virtualwans/id_routingintent_test.go | 327 -- .../2023-05-01/virtualwans/id_virtualhub.go | 130 - .../virtualwans/id_virtualhub_test.go | 282 -- .../virtualwans/id_virtualhubroutetable.go | 139 - .../id_virtualhubroutetable_test.go | 327 -- .../2023-05-01/virtualwans/id_virtualwan.go | 130 - .../virtualwans/id_virtualwan_test.go | 282 -- .../2023-05-01/virtualwans/id_vpngateway.go | 130 - .../virtualwans/id_vpngateway_test.go | 282 -- .../virtualwans/id_vpnlinkconnection.go | 148 - .../virtualwans/id_vpnlinkconnection_test.go | 372 --- .../virtualwans/id_vpnserverconfiguration.go | 130 - .../id_vpnserverconfiguration_test.go | 282 -- .../2023-05-01/virtualwans/id_vpnsite.go | 130 - .../2023-05-01/virtualwans/id_vpnsite_test.go | 282 -- .../2023-05-01/virtualwans/id_vpnsitelink.go | 139 - .../virtualwans/id_vpnsitelink_test.go | 327 -- ...configurationpolicygroupscreateorupdate.go | 75 - .../method_configurationpolicygroupsdelete.go | 71 - .../method_configurationpolicygroupsget.go | 54 - ...olicygroupslistbyvpnserverconfiguration.go | 91 - ...tualwanvpnserverconfigurationvpnprofile.go | 75 - .../method_hubroutetablescreateorupdate.go | 75 - .../method_hubroutetablesdelete.go | 71 - .../virtualwans/method_hubroutetablesget.go | 54 - .../virtualwans/method_hubroutetableslist.go | 91 - ...virtualnetworkconnectionscreateorupdate.go | 75 - ...thod_hubvirtualnetworkconnectionsdelete.go | 71 - .../method_hubvirtualnetworkconnectionsget.go | 54 - ...method_hubvirtualnetworkconnectionslist.go | 91 - .../method_natrulescreateorupdate.go | 75 - .../virtualwans/method_natrulesdelete.go | 71 - .../virtualwans/method_natrulesget.go | 54 - .../method_natruleslistbyvpngateway.go | 91 - .../method_p2svpngatewayscreateorupdate.go | 76 - .../method_p2svpngatewaysdelete.go | 72 - .../virtualwans/method_p2svpngatewaysget.go | 55 - .../virtualwans/method_p2svpngatewayslist.go | 92 - ...ethod_p2svpngatewayslistbyresourcegroup.go | 92 - .../method_routemapscreateorupdate.go | 75 - .../virtualwans/method_routemapsdelete.go | 71 - .../virtualwans/method_routemapsget.go | 54 - .../virtualwans/method_routemapslist.go | 91 - .../method_routingintentcreateorupdate.go | 75 - .../virtualwans/method_routingintentdelete.go | 71 - .../virtualwans/method_routingintentget.go | 54 - .../virtualwans/method_routingintentlist.go | 91 - .../method_supportedsecurityproviders.go | 55 - .../virtualwans/method_updatetags.go | 58 - ...d_virtualhubbgpconnectioncreateorupdate.go | 76 - .../method_virtualhubbgpconnectiondelete.go | 72 - .../method_virtualhubbgpconnectionget.go | 55 - .../method_virtualhubbgpconnectionslist.go | 91 - ...alhubbgpconnectionslistadvertisedroutes.go | 72 - ...rtualhubbgpconnectionslistlearnedroutes.go | 72 - ...virtualhubipconfigurationcreateorupdate.go | 76 - .../method_virtualhubipconfigurationdelete.go | 72 - .../method_virtualhubipconfigurationget.go | 55 - .../method_virtualhubipconfigurationlist.go | 91 - ...d_virtualhubroutetablev2screateorupdate.go | 75 - .../method_virtualhubroutetablev2sdelete.go | 71 - .../method_virtualhubroutetablev2sget.go | 54 - .../method_virtualhubroutetablev2slist.go | 91 - .../method_virtualhubscreateorupdate.go | 75 - .../virtualwans/method_virtualhubsdelete.go | 71 - .../virtualwans/method_virtualhubsget.go | 54 - ...virtualhubsgeteffectivevirtualhubroutes.go | 75 - .../method_virtualhubsgetinboundroutes.go | 75 - .../method_virtualhubsgetoutboundroutes.go | 75 - .../virtualwans/method_virtualhubslist.go | 92 - .../method_virtualhubslistbyresourcegroup.go | 92 - .../method_virtualhubsupdatetags.go | 58 - .../method_virtualwanscreateorupdate.go | 75 - .../virtualwans/method_virtualwansdelete.go | 71 - .../virtualwans/method_virtualwansget.go | 54 - .../virtualwans/method_virtualwanslist.go | 92 - .../method_virtualwanslistbyresourcegroup.go | 92 - .../method_vpnconnectionscreateorupdate.go | 76 - .../method_vpnconnectionsdelete.go | 72 - .../virtualwans/method_vpnconnectionsget.go | 55 - .../method_vpnconnectionslistbyvpngateway.go | 91 - ...method_vpnconnectionsstartpacketcapture.go | 76 - .../method_vpnconnectionsstoppacketcapture.go | 76 - .../method_vpngatewayscreateorupdate.go | 75 - .../virtualwans/method_vpngatewaysdelete.go | 71 - .../virtualwans/method_vpngatewaysget.go | 54 - .../virtualwans/method_vpngatewayslist.go | 92 - .../method_vpngatewayslistbyresourcegroup.go | 92 - .../method_vpnlinkconnectionsgetikesas.go | 71 - ...d_vpnlinkconnectionslistbyvpnconnection.go | 92 - ...figurationsassociatedwithvirtualwanlist.go | 71 - ...d_vpnserverconfigurationscreateorupdate.go | 75 - .../method_vpnserverconfigurationsdelete.go | 71 - .../method_vpnserverconfigurationsget.go | 54 - .../method_vpnserverconfigurationslist.go | 92 - ...serverconfigurationslistbyresourcegroup.go | 92 - .../method_vpnsitelinkconnectionsget.go | 54 - .../virtualwans/method_vpnsitelinksget.go | 54 - .../method_vpnsitelinkslistbyvpnsite.go | 91 - .../method_vpnsitesconfigurationdownload.go | 74 - .../method_vpnsitescreateorupdate.go | 75 - .../virtualwans/method_vpnsitesdelete.go | 71 - .../virtualwans/method_vpnsitesget.go | 54 - .../virtualwans/method_vpnsiteslist.go | 92 - .../method_vpnsiteslistbyresourcegroup.go | 92 - .../model_aadauthenticationparameters.go | 10 - .../2023-05-01/virtualwans/model_action.go | 9 - .../virtualwans/model_addressspace.go | 8 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../virtualwans/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../virtualwans/model_bgpconnection.go | 12 - .../model_bgpconnectionproperties.go | 12 - .../virtualwans/model_bgpsettings.go | 11 - .../2023-05-01/virtualwans/model_criterion.go | 11 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualwans/model_ddossettings.go | 9 - .../virtualwans/model_delegation.go | 12 - .../virtualwans/model_deviceproperties.go | 10 - .../model_effectiveroutemaproute.go | 10 - .../model_effectiveroutemaproutelist.go | 8 - .../model_effectiveroutesparameters.go | 9 - .../2023-05-01/virtualwans/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...atewaycustombgpipaddressipconfiguration.go | 9 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_getinboundroutesparameters.go | 9 - .../model_getoutboundroutesparameters.go | 9 - .../model_getvpnsitesconfigurationrequest.go | 9 - .../virtualwans/model_hubipconfiguration.go | 12 - ...odel_hubipconfigurationpropertiesformat.go | 12 - .../2023-05-01/virtualwans/model_hubroute.go | 12 - .../virtualwans/model_hubroutetable.go | 12 - .../model_hubroutetableproperties.go | 12 - .../model_hubvirtualnetworkconnection.go | 11 - ...l_hubvirtualnetworkconnectionproperties.go | 13 - .../virtualwans/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../virtualwans/model_ipconfiguration.go | 11 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../virtualwans/model_ipsecpolicy.go | 15 - .../2023-05-01/virtualwans/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualwans/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualwans/model_natgatewaysku.go | 8 - .../virtualwans/model_natruleportmapping.go | 10 - .../virtualwans/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../virtualwans/model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_o365breakoutcategorypolicies.go | 10 - .../virtualwans/model_o365policyproperties.go | 8 - .../model_p2sconnectionconfiguration.go | 11 - ...el_p2sconnectionconfigurationproperties.go | 13 - .../virtualwans/model_p2svpngateway.go | 14 - .../model_p2svpngatewayproperties.go | 15 - .../2023-05-01/virtualwans/model_parameter.go | 10 - .../2023-05-01/virtualwans/model_peerroute.go | 14 - .../virtualwans/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../virtualwans/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../virtualwans/model_propagatedroutetable.go | 9 - .../virtualwans/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../virtualwans/model_publicipaddresssku.go | 9 - .../virtualwans/model_radiusserver.go | 10 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualwans/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-05-01/virtualwans/model_route.go | 12 - .../2023-05-01/virtualwans/model_routemap.go | 12 - .../virtualwans/model_routemapproperties.go | 11 - .../virtualwans/model_routemaprule.go | 11 - .../model_routepropertiesformat.go | 12 - .../virtualwans/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualwans/model_routingconfiguration.go | 12 - .../virtualwans/model_routingintent.go | 12 - .../model_routingintentproperties.go | 9 - .../virtualwans/model_routingpolicy.go | 10 - .../virtualwans/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualwans/model_staticroute.go | 10 - .../virtualwans/model_staticroutesconfig.go | 9 - .../2023-05-01/virtualwans/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualwans/model_subresource.go | 8 - .../virtualwans/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../virtualwans/model_virtualhub.go | 15 - .../model_virtualhubeffectiveroute.go | 12 - .../model_virtualhubeffectiveroutelist.go | 8 - .../virtualwans/model_virtualhubproperties.go | 29 - .../virtualwans/model_virtualhubroute.go | 9 - .../virtualwans/model_virtualhubroutetable.go | 8 - .../model_virtualhubroutetablev2.go | 11 - .../model_virtualhubroutetablev2properties.go | 10 - .../virtualwans/model_virtualhubroutev2.go | 11 - .../virtualwans/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - ...del_virtualrouterautoscaleconfiguration.go | 8 - .../virtualwans/model_virtualwan.go | 14 - .../virtualwans/model_virtualwanproperties.go | 15 - .../model_virtualwansecurityprovider.go | 10 - .../model_virtualwansecurityproviders.go | 8 - .../model_virtualwanvpnprofileparameters.go | 9 - .../2023-05-01/virtualwans/model_vnetroute.go | 10 - .../model_vpnclientconnectionhealth.go | 11 - .../virtualwans/model_vpnconnection.go | 11 - ...nconnectionpacketcapturestartparameters.go | 9 - ...pnconnectionpacketcapturestopparameters.go | 9 - .../model_vpnconnectionproperties.go | 26 - .../virtualwans/model_vpngateway.go | 14 - .../model_vpngatewayipconfiguration.go | 10 - .../virtualwans/model_vpngatewaynatrule.go | 12 - .../model_vpngatewaynatruleproperties.go | 15 - .../virtualwans/model_vpngatewayproperties.go | 16 - .../virtualwans/model_vpnlinkbgpsettings.go | 9 - .../model_vpnlinkproviderproperties.go | 9 - .../virtualwans/model_vpnnatrulemapping.go | 9 - .../virtualwans/model_vpnprofileresponse.go | 8 - ...serverconfigradiusclientrootcertificate.go | 9 - ...serverconfigradiusserverrootcertificate.go | 9 - .../model_vpnserverconfiguration.go | 14 - ...model_vpnserverconfigurationpolicygroup.go | 12 - ...vpnserverconfigurationpolicygroupmember.go | 10 - ...erverconfigurationpolicygroupproperties.go | 12 - .../model_vpnserverconfigurationproperties.go | 23 - .../model_vpnserverconfigurationsresponse.go | 8 - ...serverconfigvpnclientrevokedcertificate.go | 9 - ...vpnserverconfigvpnclientrootcertificate.go | 9 - .../2023-05-01/virtualwans/model_vpnsite.go | 14 - .../virtualwans/model_vpnsitelink.go | 12 - .../model_vpnsitelinkconnection.go | 12 - .../model_vpnsitelinkconnectionproperties.go | 25 - .../model_vpnsitelinkproperties.go | 12 - .../virtualwans/model_vpnsiteproperties.go | 17 - .../2023-05-01/virtualwans/predicates.go | 528 --- .../network/2023-05-01/virtualwans/version.go | 12 - .../vmsspublicipaddresses/README.md | 71 - .../vmsspublicipaddresses/client.go | 26 - .../vmsspublicipaddresses/constants.go | 1151 ------- .../id_virtualmachinescaleset.go | 130 - .../id_virtualmachinescaleset_test.go | 282 -- ...etvirtualmachinescalesetpublicipaddress.go | 84 - ...virtualmachinescalesetpublicipaddresses.go | 91 - ...rtualmachinescalesetvmpublicipaddresses.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../vmsspublicipaddresses/model_delegation.go | 12 - .../vmsspublicipaddresses/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../vmsspublicipaddresses/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../vmsspublicipaddresses/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../vmsspublicipaddresses/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../vmsspublicipaddresses/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../vmsspublicipaddresses/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../vmsspublicipaddresses/predicates.go | 37 - .../vmsspublicipaddresses/version.go | 12 - .../network/2023-05-01/vpngateways/README.md | 83 - .../network/2023-05-01/vpngateways/client.go | 26 - .../2023-05-01/vpngateways/constants.go | 657 ---- .../2023-05-01/vpngateways/id_vpngateway.go | 130 - .../vpngateways/id_vpngateway_test.go | 282 -- .../2023-05-01/vpngateways/method_reset.go | 99 - .../vpngateways/method_startpacketcapture.go | 75 - .../vpngateways/method_stoppacketcapture.go | 75 - .../vpngateways/method_updatetags.go | 75 - .../vpngateways/model_bgpsettings.go | 11 - ...atewaycustombgpipaddressipconfiguration.go | 9 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../vpngateways/model_ipsecpolicy.go | 15 - .../vpngateways/model_propagatedroutetable.go | 9 - .../vpngateways/model_routingconfiguration.go | 12 - .../vpngateways/model_staticroute.go | 10 - .../vpngateways/model_staticroutesconfig.go | 9 - .../vpngateways/model_subresource.go | 8 - .../vpngateways/model_tagsobject.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../2023-05-01/vpngateways/model_vnetroute.go | 10 - .../vpngateways/model_vpnconnection.go | 11 - .../model_vpnconnectionproperties.go | 26 - .../vpngateways/model_vpngateway.go | 14 - .../model_vpngatewayipconfiguration.go | 10 - .../vpngateways/model_vpngatewaynatrule.go | 12 - .../model_vpngatewaynatruleproperties.go | 15 - ..._vpngatewaypacketcapturestartparameters.go | 8 - ...l_vpngatewaypacketcapturestopparameters.go | 8 - .../vpngateways/model_vpngatewayproperties.go | 16 - .../vpngateways/model_vpnnatrulemapping.go | 9 - .../model_vpnsitelinkconnection.go | 12 - .../model_vpnsitelinkconnectionproperties.go | 25 - .../network/2023-05-01/vpngateways/version.go | 12 - .../2023-05-01/vpnlinkconnections/client.go | 26 - .../id_vpnlinkconnection.go | 148 - .../id_vpnlinkconnection_test.go | 372 --- .../method_resetconnection.go | 69 - .../2023-05-01/vpnlinkconnections/version.go | 12 - .../vpnserverconfigurations/README.md | 41 - .../vpnserverconfigurations/client.go | 26 - .../vpnserverconfigurations/constants.go | 572 ---- .../id_vpnserverconfiguration.go | 130 - .../id_vpnserverconfiguration_test.go | 282 -- .../method_updatetags.go | 58 - .../model_aadauthenticationparameters.go | 10 - .../model_addressspace.go | 8 - .../model_ipsecpolicy.go | 15 - .../model_p2sconnectionconfiguration.go | 11 - ...el_p2sconnectionconfigurationproperties.go | 13 - .../model_p2svpngateway.go | 14 - .../model_p2svpngatewayproperties.go | 15 - .../model_propagatedroutetable.go | 9 - .../model_radiusserver.go | 10 - .../model_routingconfiguration.go | 12 - .../model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../model_vnetroute.go | 10 - .../model_vpnclientconnectionhealth.go | 11 - ...serverconfigradiusclientrootcertificate.go | 9 - ...serverconfigradiusserverrootcertificate.go | 9 - .../model_vpnserverconfiguration.go | 14 - ...model_vpnserverconfigurationpolicygroup.go | 12 - ...vpnserverconfigurationpolicygroupmember.go | 10 - ...erverconfigurationpolicygroupproperties.go | 12 - .../model_vpnserverconfigurationproperties.go | 23 - ...serverconfigvpnclientrevokedcertificate.go | 9 - ...vpnserverconfigvpnclientrootcertificate.go | 9 - .../vpnserverconfigurations/version.go | 12 - .../network/2023-05-01/vpnsites/README.md | 41 - .../network/2023-05-01/vpnsites/client.go | 26 - .../network/2023-05-01/vpnsites/constants.go | 57 - .../network/2023-05-01/vpnsites/id_vpnsite.go | 130 - .../2023-05-01/vpnsites/id_vpnsite_test.go | 282 -- .../2023-05-01/vpnsites/method_updatetags.go | 58 - .../2023-05-01/vpnsites/model_addressspace.go | 8 - .../2023-05-01/vpnsites/model_bgpsettings.go | 11 - .../vpnsites/model_deviceproperties.go | 10 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_o365breakoutcategorypolicies.go | 10 - .../vpnsites/model_o365policyproperties.go | 8 - .../2023-05-01/vpnsites/model_subresource.go | 8 - .../2023-05-01/vpnsites/model_tagsobject.go | 8 - .../vpnsites/model_vpnlinkbgpsettings.go | 9 - .../model_vpnlinkproviderproperties.go | 9 - .../2023-05-01/vpnsites/model_vpnsite.go | 14 - .../2023-05-01/vpnsites/model_vpnsitelink.go | 12 - .../vpnsites/model_vpnsitelinkproperties.go | 12 - .../vpnsites/model_vpnsiteproperties.go | 17 - .../network/2023-05-01/vpnsites/version.go | 12 - .../webapplicationfirewallpolicies/README.md | 104 - .../webapplicationfirewallpolicies/client.go | 26 - .../constants.go | 2842 ---------------- ...tiongatewaywebapplicationfirewallpolicy.go | 130 - ...atewaywebapplicationfirewallpolicy_test.go | 282 -- .../method_createorupdate.go | 59 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 92 - .../method_listall.go | 92 - .../model_applicationgateway.go | 21 - ...icationgatewayauthenticationcertificate.go | 12 - ...thenticationcertificatepropertiesformat.go | 9 - ...pplicationgatewayautoscaleconfiguration.go | 9 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...l_applicationgatewaybackendhttpsettings.go | 12 - ...ewaybackendhttpsettingspropertiesformat.go | 21 - ...model_applicationgatewaybackendsettings.go | 12 - ...ngatewaybackendsettingspropertiesformat.go | 15 - ...plicationgatewayclientauthconfiguration.go | 9 - ...el_applicationgatewayconnectiondraining.go | 9 - .../model_applicationgatewaycustomerror.go | 9 - ...icationgatewayfirewalldisabledrulegroup.go | 9 - ...del_applicationgatewayfirewallexclusion.go | 10 - ...plicationgatewayfrontendipconfiguration.go | 12 - ...frontendipconfigurationpropertiesformat.go | 13 - .../model_applicationgatewayfrontendport.go | 12 - ...tiongatewayfrontendportpropertiesformat.go | 9 - ...l_applicationgatewayglobalconfiguration.go | 9 - ...l_applicationgatewayheaderconfiguration.go | 9 - .../model_applicationgatewayhttplistener.go | 12 - ...tiongatewayhttplistenerpropertiesformat.go | 18 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationgatewaylistener.go | 12 - ...licationgatewaylistenerpropertiesformat.go | 13 - ...pplicationgatewayloaddistributionpolicy.go | 12 - ...yloaddistributionpolicypropertiesformat.go | 10 - ...pplicationgatewayloaddistributiontarget.go | 12 - ...yloaddistributiontargetpropertiesformat.go | 9 - .../model_applicationgatewaypathrule.go | 12 - ...licationgatewaypathrulepropertiesformat.go | 15 - ...icationgatewayprivateendpointconnection.go | 12 - ...ewayprivateendpointconnectionproperties.go | 11 - ...licationgatewayprivatelinkconfiguration.go | 12 - ...tewayprivatelinkconfigurationproperties.go | 9 - ...cationgatewayprivatelinkipconfiguration.go | 12 - ...wayprivatelinkipconfigurationproperties.go | 12 - .../model_applicationgatewayprobe.go | 12 - ...licationgatewayprobehealthresponsematch.go | 9 - ...applicationgatewayprobepropertiesformat.go | 19 - ...odel_applicationgatewaypropertiesformat.go | 43 - ...applicationgatewayredirectconfiguration.go | 12 - ...ayredirectconfigurationpropertiesformat.go | 15 - ...el_applicationgatewayrequestroutingrule.go | 12 - ...tewayrequestroutingrulepropertiesformat.go | 17 - .../model_applicationgatewayrewriterule.go | 11 - ..._applicationgatewayrewriteruleactionset.go | 10 - ..._applicationgatewayrewriterulecondition.go | 11 - .../model_applicationgatewayrewriteruleset.go | 11 - ...ongatewayrewriterulesetpropertiesformat.go | 9 - .../model_applicationgatewayroutingrule.go | 12 - ...ationgatewayroutingrulepropertiesformat.go | 13 - .../model_applicationgatewaysku.go | 10 - .../model_applicationgatewaysslcertificate.go | 12 - ...ongatewaysslcertificatepropertiesformat.go | 12 - .../model_applicationgatewaysslpolicy.go | 12 - .../model_applicationgatewaysslprofile.go | 12 - ...cationgatewaysslprofilepropertiesformat.go | 11 - ...licationgatewaytrustedclientcertificate.go | 12 - ...rustedclientcertificatepropertiesformat.go | 11 - ...pplicationgatewaytrustedrootcertificate.go | 12 - ...ytrustedrootcertificatepropertiesformat.go | 10 - ...odel_applicationgatewayurlconfiguration.go | 10 - .../model_applicationgatewayurlpathmap.go | 12 - ...cationgatewayurlpathmappropertiesformat.go | 14 - ...ewaywebapplicationfirewallconfiguration.go | 17 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../model_exclusionmanagedrule.go | 8 - .../model_exclusionmanagedrulegroup.go | 9 - .../model_exclusionmanagedruleset.go | 10 - .../model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_groupbyusersession.go | 8 - .../model_groupbyvariable.go | 8 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_managedrulegroupoverride.go | 9 - .../model_managedruleoverride.go | 10 - .../model_managedrulesdefinition.go | 9 - .../model_managedruleset.go | 10 - .../model_matchcondition.go | 12 - .../model_matchvariable.go | 9 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_owaspcrsexclusionentry.go | 11 - .../model_policysettings.go | 18 - .../model_policysettingslogscrubbing.go | 9 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../model_webapplicationfirewallcustomrule.go | 17 - .../model_webapplicationfirewallpolicy.go | 14 - ...plicationfirewallpolicypropertiesformat.go | 15 - ...el_webapplicationfirewallscrubbingrules.go | 11 - .../predicates.go | 37 - .../webapplicationfirewallpolicies/version.go | 12 - .../2023-05-01/webcategories/README.md | 54 - .../2023-05-01/webcategories/client.go | 26 - .../webcategories/id_azurewebcategory.go | 121 - .../webcategories/id_azurewebcategory_test.go | 237 -- .../2023-05-01/webcategories/method_get.go | 83 - .../method_listbysubscription.go | 92 - .../webcategories/model_azurewebcategory.go | 12 - .../model_azurewebcategorypropertiesformat.go | 8 - .../2023-05-01/webcategories/predicates.go | 32 - .../2023-05-01/webcategories/version.go | 12 - .../2023-06-01/adminrulecollections/README.md | 86 - .../2023-06-01/adminrulecollections/client.go | 26 - .../adminrulecollections/constants.go | 57 - .../adminrulecollections/id_rulecollection.go | 148 - .../id_rulecollection_test.go | 372 --- .../id_securityadminconfiguration.go | 139 - .../id_securityadminconfiguration_test.go | 327 -- .../method_createorupdate.go | 59 - .../adminrulecollections/method_delete.go | 99 - .../adminrulecollections/method_get.go | 54 - .../adminrulecollections/method_list.go | 119 - .../model_adminrulecollection.go | 17 - ...del_adminrulecollectionpropertiesformat.go | 11 - .../model_networkmanagersecuritygroupitem.go | 8 - .../adminrulecollections/predicates.go | 32 - .../adminrulecollections/version.go | 12 - .../network/2023-06-01/adminrules/README.md | 86 - .../network/2023-06-01/adminrules/client.go | 26 - .../2023-06-01/adminrules/constants.go | 277 -- .../network/2023-06-01/adminrules/id_rule.go | 157 - .../2023-06-01/adminrules/id_rule_test.go | 417 --- .../adminrules/id_rulecollection.go | 148 - .../adminrules/id_rulecollection_test.go | 372 --- .../adminrules/method_createorupdate.go | 63 - .../2023-06-01/adminrules/method_delete.go | 99 - .../2023-06-01/adminrules/method_get.go | 58 - .../2023-06-01/adminrules/method_list.go | 103 - .../adminrules/model_addressprefixitem.go | 9 - .../adminrules/model_adminpropertiesformat.go | 18 - .../2023-06-01/adminrules/model_adminrule.go | 48 - .../adminrules/model_baseadminrule.go | 61 - .../model_defaultadminpropertiesformat.go | 19 - .../adminrules/model_defaultadminrule.go | 48 - .../2023-06-01/adminrules/predicates.go | 12 - .../network/2023-06-01/adminrules/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 1151 ------- .../id_applicationgateway.go | 130 - .../id_applicationgateway_test.go | 282 -- ...icationgatewayprivateendpointconnection.go | 139 - ...ongatewayprivateendpointconnection_test.go | 327 -- .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../method_update.go | 75 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - ...icationgatewayprivateendpointconnection.go | 12 - ...ewayprivateendpointconnectionproperties.go | 11 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../predicates.go | 32 - .../version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_applicationgateway.go | 130 - .../id_applicationgateway_test.go | 282 -- .../method_list.go | 91 - ...l_applicationgatewayprivatelinkresource.go | 12 - ...iongatewayprivatelinkresourceproperties.go | 10 - .../predicates.go | 32 - .../version.go | 12 - .../2023-06-01/applicationgateways/README.md | 287 -- .../2023-06-01/applicationgateways/client.go | 26 - .../applicationgateways/constants.go | 2119 ------------ .../id_applicationgateway.go | 130 - .../id_applicationgateway_test.go | 282 -- .../id_predefinedpolicy.go | 123 - .../id_predefinedpolicy_test.go | 267 -- .../method_backendhealth.go | 99 - .../method_backendhealthondemand.go | 103 - .../method_createorupdate.go | 75 - .../applicationgateways/method_delete.go | 71 - .../applicationgateways/method_get.go | 54 - .../method_getsslpredefinedpolicy.go | 54 - .../applicationgateways/method_list.go | 92 - .../applicationgateways/method_listall.go | 92 - .../method_listavailablerequestheaders.go | 56 - .../method_listavailableresponseheaders.go | 56 - .../method_listavailableservervariables.go | 56 - .../method_listavailablessloptions.go | 56 - ...thod_listavailablesslpredefinedpolicies.go | 92 - .../method_listavailablewafrulesets.go | 56 - .../applicationgateways/method_start.go | 70 - .../applicationgateways/method_stop.go | 70 - .../applicationgateways/method_updatetags.go | 58 - .../model_applicationgateway.go | 21 - ...icationgatewayauthenticationcertificate.go | 12 - ...thenticationcertificatepropertiesformat.go | 9 - ...pplicationgatewayautoscaleconfiguration.go | 9 - ...l_applicationgatewayavailablessloptions.go | 13 - ...ewayavailablessloptionspropertiesformat.go | 11 - ...cationgatewayavailablewafrulesetsresult.go | 8 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - .../model_applicationgatewaybackendhealth.go | 8 - ...icationgatewaybackendhealthhttpsettings.go | 9 - ...applicationgatewaybackendhealthondemand.go | 9 - ...del_applicationgatewaybackendhealthpool.go | 9 - ...l_applicationgatewaybackendhealthserver.go | 11 - ...l_applicationgatewaybackendhttpsettings.go | 12 - ...ewaybackendhttpsettingspropertiesformat.go | 21 - ...model_applicationgatewaybackendsettings.go | 12 - ...ngatewaybackendsettingspropertiesformat.go | 15 - ...plicationgatewayclientauthconfiguration.go | 9 - ...el_applicationgatewayconnectiondraining.go | 9 - .../model_applicationgatewaycustomerror.go | 9 - ...icationgatewayfirewalldisabledrulegroup.go | 9 - ...del_applicationgatewayfirewallexclusion.go | 10 - .../model_applicationgatewayfirewallrule.go | 12 - ...del_applicationgatewayfirewallrulegroup.go | 10 - ...model_applicationgatewayfirewallruleset.go | 13 - ...ngatewayfirewallrulesetpropertiesformat.go | 12 - ...plicationgatewayfrontendipconfiguration.go | 12 - ...frontendipconfigurationpropertiesformat.go | 13 - .../model_applicationgatewayfrontendport.go | 12 - ...tiongatewayfrontendportpropertiesformat.go | 9 - ...l_applicationgatewayglobalconfiguration.go | 9 - ...l_applicationgatewayheaderconfiguration.go | 9 - .../model_applicationgatewayhttplistener.go | 12 - ...tiongatewayhttplistenerpropertiesformat.go | 18 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationgatewaylistener.go | 12 - ...licationgatewaylistenerpropertiesformat.go | 14 - ...pplicationgatewayloaddistributionpolicy.go | 12 - ...yloaddistributionpolicypropertiesformat.go | 10 - ...pplicationgatewayloaddistributiontarget.go | 12 - ...yloaddistributiontargetpropertiesformat.go | 9 - .../model_applicationgatewayondemandprobe.go | 15 - .../model_applicationgatewaypathrule.go | 12 - ...licationgatewaypathrulepropertiesformat.go | 15 - ...icationgatewayprivateendpointconnection.go | 12 - ...ewayprivateendpointconnectionproperties.go | 11 - ...licationgatewayprivatelinkconfiguration.go | 12 - ...tewayprivatelinkconfigurationproperties.go | 9 - ...cationgatewayprivatelinkipconfiguration.go | 12 - ...wayprivatelinkipconfigurationproperties.go | 12 - .../model_applicationgatewayprobe.go | 12 - ...licationgatewayprobehealthresponsematch.go | 9 - ...applicationgatewayprobepropertiesformat.go | 19 - ...odel_applicationgatewaypropertiesformat.go | 43 - ...applicationgatewayredirectconfiguration.go | 12 - ...ayredirectconfigurationpropertiesformat.go | 15 - ...el_applicationgatewayrequestroutingrule.go | 12 - ...tewayrequestroutingrulepropertiesformat.go | 17 - .../model_applicationgatewayrewriterule.go | 11 - ..._applicationgatewayrewriteruleactionset.go | 10 - ..._applicationgatewayrewriterulecondition.go | 11 - .../model_applicationgatewayrewriteruleset.go | 11 - ...ongatewayrewriterulesetpropertiesformat.go | 9 - .../model_applicationgatewayroutingrule.go | 12 - ...ationgatewayroutingrulepropertiesformat.go | 13 - .../model_applicationgatewaysku.go | 10 - .../model_applicationgatewaysslcertificate.go | 12 - ...ongatewaysslcertificatepropertiesformat.go | 12 - .../model_applicationgatewaysslpolicy.go | 12 - ...l_applicationgatewaysslpredefinedpolicy.go | 10 - ...ewaysslpredefinedpolicypropertiesformat.go | 9 - .../model_applicationgatewaysslprofile.go | 12 - ...cationgatewaysslprofilepropertiesformat.go | 11 - ...licationgatewaytrustedclientcertificate.go | 12 - ...rustedclientcertificatepropertiesformat.go | 11 - ...pplicationgatewaytrustedrootcertificate.go | 12 - ...ytrustedrootcertificatepropertiesformat.go | 10 - ...odel_applicationgatewayurlconfiguration.go | 10 - .../model_applicationgatewayurlpathmap.go | 12 - ...cationgatewayurlpathmappropertiesformat.go | 14 - ...ewaywebapplicationfirewallconfiguration.go | 17 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../applicationgateways/model_ddossettings.go | 9 - .../applicationgateways/model_delegation.go | 12 - .../applicationgateways/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../applicationgateways/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../applicationgateways/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../applicationgateways/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../applicationgateways/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../applicationgateways/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../applicationgateways/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../applicationgateways/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../applicationgateways/model_subresource.go | 8 - .../applicationgateways/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../applicationgateways/predicates.go | 55 - .../2023-06-01/applicationgateways/version.go | 12 - .../README.md | 53 - .../client.go | 26 - .../constants.go | 195 -- .../id_location.go | 121 - .../id_location_test.go | 237 -- .../method_defaultget.go | 55 - .../method_get.go | 91 - ...plicationgatewayfirewallmanifestruleset.go | 12 - .../model_applicationgatewayfirewallrule.go | 12 - ...del_applicationgatewayfirewallrulegroup.go | 10 - ...tewaywafdynamicmanifestpropertiesresult.go | 9 - ...licationgatewaywafdynamicmanifestresult.go | 11 - .../model_defaultrulesetpropertyformat.go | 9 - .../predicates.go | 27 - .../version.go | 12 - .../applicationsecuritygroups/README.md | 121 - .../applicationsecuritygroups/client.go | 26 - .../applicationsecuritygroups/constants.go | 57 - .../id_applicationsecuritygroup.go | 130 - .../id_applicationsecuritygroup_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../applicationsecuritygroups/method_get.go | 54 - .../applicationsecuritygroups/method_list.go | 92 - .../method_listall.go | 92 - .../method_updatetags.go | 58 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_tagsobject.go | 8 - .../applicationsecuritygroups/predicates.go | 37 - .../applicationsecuritygroups/version.go | 12 - .../2023-06-01/availabledelegations/README.md | 54 - .../2023-06-01/availabledelegations/client.go | 26 - .../availabledelegations/id_location.go | 121 - .../availabledelegations/id_location_test.go | 237 -- .../id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../method_availabledelegationslist.go | 91 - ...d_availableresourcegroupdelegationslist.go | 91 - .../model_availabledelegation.go | 12 - .../availabledelegations/predicates.go | 32 - .../availabledelegations/version.go | 12 - .../availableservicealiases/README.md | 54 - .../availableservicealiases/client.go | 26 - .../availableservicealiases/id_location.go | 121 - .../id_location_test.go | 237 -- .../id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../availableservicealiases/method_list.go | 91 - .../method_listbyresourcegroup.go | 91 - .../model_availableservicealias.go | 11 - .../availableservicealiases/predicates.go | 32 - .../availableservicealiases/version.go | 12 - .../2023-06-01/azurefirewalls/README.md | 146 - .../2023-06-01/azurefirewalls/client.go | 26 - .../2023-06-01/azurefirewalls/constants.go | 412 --- .../azurefirewalls/id_azurefirewall.go | 130 - .../azurefirewalls/id_azurefirewall_test.go | 282 -- ...ethod_azurefirewallslistlearnedprefixes.go | 71 - .../azurefirewalls/method_createorupdate.go | 75 - .../azurefirewalls/method_delete.go | 71 - .../2023-06-01/azurefirewalls/method_get.go | 54 - .../2023-06-01/azurefirewalls/method_list.go | 92 - .../azurefirewalls/method_listall.go | 92 - .../azurefirewalls/method_packetcapture.go | 73 - .../azurefirewalls/method_updatetags.go | 75 - .../azurefirewalls/model_azurefirewall.go | 19 - .../model_azurefirewallapplicationrule.go | 14 - ..._azurefirewallapplicationrulecollection.go | 11 - ...plicationrulecollectionpropertiesformat.go | 11 - ...el_azurefirewallapplicationruleprotocol.go | 9 - .../model_azurefirewallipconfiguration.go | 12 - ...firewallipconfigurationpropertiesformat.go | 11 - .../model_azurefirewallipgroups.go | 9 - .../model_azurefirewallnatrcaction.go | 8 - .../model_azurefirewallnatrule.go | 17 - .../model_azurefirewallnatrulecollection.go | 11 - ...zurefirewallnatrulecollectionproperties.go | 11 - .../model_azurefirewallnetworkrule.go | 16 - ...odel_azurefirewallnetworkrulecollection.go | 11 - ...llnetworkrulecollectionpropertiesformat.go | 11 - .../model_azurefirewallpacketcaptureflags.go | 8 - .../model_azurefirewallpacketcapturerule.go | 10 - .../model_azurefirewallpropertiesformat.go | 20 - .../model_azurefirewallpublicipaddress.go | 8 - .../model_azurefirewallrcaction.go | 8 - .../azurefirewalls/model_azurefirewallsku.go | 9 - .../model_firewallpacketcaptureparameters.go | 9 - ...l_firewallpacketcaptureparametersformat.go | 14 - .../azurefirewalls/model_hubipaddresses.go | 9 - .../model_hubpublicipaddresses.go | 9 - .../azurefirewalls/model_ipprefixeslist.go | 8 - .../azurefirewalls/model_subresource.go | 8 - .../azurefirewalls/model_tagsobject.go | 8 - .../2023-06-01/azurefirewalls/predicates.go | 37 - .../2023-06-01/azurefirewalls/version.go | 12 - .../network/2023-06-01/bastionhosts/README.md | 234 -- .../network/2023-06-01/bastionhosts/client.go | 26 - .../2023-06-01/bastionhosts/constants.go | 183 -- .../2023-06-01/bastionhosts/id_bastionhost.go | 130 - .../bastionhosts/id_bastionhost_test.go | 282 -- .../bastionhosts/method_createorupdate.go | 75 - .../2023-06-01/bastionhosts/method_delete.go | 71 - .../method_deletebastionshareablelink.go | 74 - ...ethod_deletebastionshareablelinkbytoken.go | 73 - .../method_disconnectactivesessions.go | 91 - .../2023-06-01/bastionhosts/method_get.go | 54 - .../bastionhosts/method_getactivesessions.go | 76 - .../method_getbastionshareablelink.go | 91 - .../2023-06-01/bastionhosts/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_putbastionshareablelink.go | 80 - .../bastionhosts/method_updatetags.go | 75 - .../model_bastionactivesession.go | 18 - .../bastionhosts/model_bastionhost.go | 15 - .../model_bastionhostipconfiguration.go | 12 - ...tionhostipconfigurationpropertiesformat.go | 11 - .../model_bastionhostpropertiesformat.go | 19 - ..._bastionhostpropertiesformatnetworkacls.go | 8 - .../bastionhosts/model_bastionsessionstate.go | 10 - .../model_bastionshareablelink.go | 11 - .../model_bastionshareablelinklistrequest.go | 8 - ...el_bastionshareablelinktokenlistrequest.go | 8 - .../2023-06-01/bastionhosts/model_iprule.go | 8 - .../2023-06-01/bastionhosts/model_resource.go | 12 - .../bastionhosts/model_sessionids.go | 8 - .../2023-06-01/bastionhosts/model_sku.go | 8 - .../bastionhosts/model_subresource.go | 8 - .../bastionhosts/model_tagsobject.go | 8 - .../2023-06-01/bastionhosts/predicates.go | 141 - .../2023-06-01/bastionhosts/version.go | 12 - .../2023-06-01/bastionshareablelink/README.md | 98 - .../2023-06-01/bastionshareablelink/client.go | 26 - .../bastionshareablelink/id_bastionhost.go | 130 - .../id_bastionhost_test.go | 282 -- .../method_deletebastionshareablelink.go | 74 - ...ethod_deletebastionshareablelinkbytoken.go | 73 - .../method_getbastionshareablelink.go | 91 - .../method_putbastionshareablelink.go | 80 - .../model_bastionshareablelink.go | 11 - .../model_bastionshareablelinklistrequest.go | 8 - ...el_bastionshareablelinktokenlistrequest.go | 8 - .../bastionshareablelink/model_resource.go | 12 - .../bastionshareablelink/predicates.go | 27 - .../bastionshareablelink/version.go | 12 - .../bgpservicecommunities/README.md | 38 - .../bgpservicecommunities/client.go | 26 - .../bgpservicecommunities/method_list.go | 92 - .../model_bgpcommunity.go | 13 - .../model_bgpservicecommunity.go | 13 - ...del_bgpservicecommunitypropertiesformat.go | 9 - .../bgpservicecommunities/predicates.go | 32 - .../bgpservicecommunities/version.go | 12 - .../checkdnsavailabilities/README.md | 36 - .../checkdnsavailabilities/client.go | 26 - .../checkdnsavailabilities/id_location.go | 121 - .../id_location_test.go | 237 -- .../method_checkdnsnameavailability.go | 83 - .../model_dnsnameavailabilityresult.go | 8 - .../checkdnsavailabilities/version.go | 12 - resource-manager/network/2023-06-01/client.go | 982 ------ .../cloudservicepublicipaddresses/README.md | 71 - .../cloudservicepublicipaddresses/client.go | 26 - .../constants.go | 1151 ------- .../id_providercloudservice.go | 130 - .../id_providercloudservice_test.go | 282 -- ...addressesgetcloudservicepublicipaddress.go | 84 - ...resseslistcloudservicepublicipaddresses.go | 91 - ...oudserviceroleinstancepublicipaddresses.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../predicates.go | 37 - .../cloudservicepublicipaddresses/version.go | 12 - .../2023-06-01/connectionmonitors/README.md | 138 - .../2023-06-01/connectionmonitors/client.go | 26 - .../connectionmonitors/constants.go | 770 ----- .../id_connectionmonitor.go | 139 - .../id_connectionmonitor_test.go | 327 -- .../connectionmonitors/id_networkwatcher.go | 130 - .../id_networkwatcher_test.go | 282 -- .../method_createorupdate.go | 103 - .../connectionmonitors/method_delete.go | 70 - .../connectionmonitors/method_get.go | 54 - .../connectionmonitors/method_list.go | 55 - .../connectionmonitors/method_query.go | 71 - .../connectionmonitors/method_start.go | 70 - .../connectionmonitors/method_stop.go | 70 - .../connectionmonitors/method_updatetags.go | 58 - .../model_connectionmonitor.go | 10 - .../model_connectionmonitordestination.go | 10 - .../model_connectionmonitorendpoint.go | 14 - .../model_connectionmonitorendpointfilter.go | 9 - ...del_connectionmonitorendpointfilteritem.go | 9 - .../model_connectionmonitorendpointscope.go | 9 - ...odel_connectionmonitorendpointscopeitem.go | 8 - ...odel_connectionmonitorhttpconfiguration.go | 13 - ...odel_connectionmonitoricmpconfiguration.go | 8 - .../model_connectionmonitorlistresult.go | 8 - .../model_connectionmonitoroutput.go | 9 - .../model_connectionmonitorparameters.go | 16 - .../model_connectionmonitorqueryresult.go | 9 - .../model_connectionmonitorresult.go | 14 - ...model_connectionmonitorresultproperties.go | 38 - .../model_connectionmonitorsource.go | 9 - ...model_connectionmonitorsuccessthreshold.go | 9 - ...model_connectionmonitortcpconfiguration.go | 10 - ...odel_connectionmonitortestconfiguration.go | 15 - .../model_connectionmonitortestgroup.go | 12 - ...odel_connectionmonitorworkspacesettings.go | 8 - .../model_connectionstatesnapshot.go | 47 - .../model_connectivityhop.go | 16 - .../model_connectivityissue.go | 11 - .../connectionmonitors/model_hoplink.go | 13 - .../model_hoplinkproperties.go | 10 - .../connectionmonitors/model_httpheader.go | 9 - .../connectionmonitors/model_tagsobject.go | 8 - .../2023-06-01/connectionmonitors/version.go | 12 - .../connectivityconfigurations/README.md | 86 - .../connectivityconfigurations/client.go | 26 - .../connectivityconfigurations/constants.go | 262 -- .../id_connectivityconfiguration.go | 139 - .../id_connectivityconfiguration_test.go | 327 -- .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../method_createorupdate.go | 59 - .../method_delete.go | 99 - .../connectivityconfigurations/method_get.go | 54 - .../connectivityconfigurations/method_list.go | 119 - .../model_connectivityconfiguration.go | 17 - ...del_connectivityconfigurationproperties.go | 15 - .../model_connectivitygroupitem.go | 11 - .../connectivityconfigurations/model_hub.go | 9 - .../connectivityconfigurations/predicates.go | 32 - .../connectivityconfigurations/version.go | 12 - .../2023-06-01/customipprefixes/README.md | 121 - .../2023-06-01/customipprefixes/client.go | 26 - .../2023-06-01/customipprefixes/constants.go | 222 -- .../customipprefixes/id_customipprefix.go | 130 - .../id_customipprefix_test.go | 282 -- .../customipprefixes/method_createorupdate.go | 75 - .../customipprefixes/method_delete.go | 71 - .../2023-06-01/customipprefixes/method_get.go | 83 - .../customipprefixes/method_list.go | 92 - .../customipprefixes/method_listall.go | 92 - .../customipprefixes/method_updatetags.go | 58 - .../customipprefixes/model_customipprefix.go | 21 - .../model_customipprefixpropertiesformat.go | 22 - .../customipprefixes/model_subresource.go | 8 - .../customipprefixes/model_tagsobject.go | 8 - .../2023-06-01/customipprefixes/predicates.go | 37 - .../2023-06-01/customipprefixes/version.go | 12 - .../2023-06-01/ddoscustompolicies/README.md | 86 - .../2023-06-01/ddoscustompolicies/client.go | 26 - .../ddoscustompolicies/constants.go | 57 - .../ddoscustompolicies/id_ddoscustompolicy.go | 130 - .../id_ddoscustompolicy_test.go | 282 -- .../method_createorupdate.go | 75 - .../ddoscustompolicies/method_delete.go | 71 - .../ddoscustompolicies/method_get.go | 54 - .../ddoscustompolicies/method_updatetags.go | 58 - .../model_ddoscustompolicy.go | 14 - .../model_ddoscustompolicypropertiesformat.go | 9 - .../ddoscustompolicies/model_tagsobject.go | 8 - .../2023-06-01/ddoscustompolicies/version.go | 12 - .../2023-06-01/ddosprotectionplans/README.md | 121 - .../2023-06-01/ddosprotectionplans/client.go | 26 - .../ddosprotectionplans/constants.go | 57 - .../id_ddosprotectionplan.go | 130 - .../id_ddosprotectionplan_test.go | 282 -- .../method_createorupdate.go | 75 - .../ddosprotectionplans/method_delete.go | 71 - .../ddosprotectionplans/method_get.go | 54 - .../ddosprotectionplans/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../ddosprotectionplans/method_updatetags.go | 58 - .../model_ddosprotectionplan.go | 14 - ...odel_ddosprotectionplanpropertiesformat.go | 11 - .../ddosprotectionplans/model_subresource.go | 8 - .../ddosprotectionplans/model_tagsobject.go | 8 - .../ddosprotectionplans/predicates.go | 37 - .../2023-06-01/ddosprotectionplans/version.go | 12 - .../2023-06-01/dscpconfiguration/README.md | 65 - .../2023-06-01/dscpconfiguration/client.go | 26 - .../2023-06-01/dscpconfiguration/constants.go | 1213 ------- .../dscpconfiguration/id_dscpconfiguration.go | 130 - .../id_dscpconfiguration_test.go | 282 -- .../method_createorupdate.go | 75 - .../dscpconfiguration/method_delete.go | 71 - .../dscpconfiguration/method_get.go | 54 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../dscpconfiguration/model_ddossettings.go | 9 - .../dscpconfiguration/model_delegation.go | 12 - .../model_dscpconfiguration.go | 14 - ...model_dscpconfigurationpropertiesformat.go | 18 - .../dscpconfiguration/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../dscpconfiguration/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../dscpconfiguration/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../dscpconfiguration/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../dscpconfiguration/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../dscpconfiguration/model_qosdefinition.go | 13 - .../dscpconfiguration/model_qosiprange.go | 9 - .../dscpconfiguration/model_qosportrange.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../dscpconfiguration/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../dscpconfiguration/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../dscpconfiguration/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../dscpconfiguration/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../dscpconfiguration/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../dscpconfiguration/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/dscpconfiguration/version.go | 12 - .../2023-06-01/dscpconfigurations/README.md | 55 - .../2023-06-01/dscpconfigurations/client.go | 26 - .../dscpconfigurations/constants.go | 1213 ------- .../method_dscpconfigurationlist.go | 92 - .../method_dscpconfigurationlistall.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../dscpconfigurations/model_ddossettings.go | 9 - .../dscpconfigurations/model_delegation.go | 12 - .../model_dscpconfiguration.go | 14 - ...model_dscpconfigurationpropertiesformat.go | 18 - .../dscpconfigurations/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../dscpconfigurations/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../dscpconfigurations/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../dscpconfigurations/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../dscpconfigurations/model_qosdefinition.go | 13 - .../dscpconfigurations/model_qosiprange.go | 9 - .../dscpconfigurations/model_qosportrange.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../dscpconfigurations/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../dscpconfigurations/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../dscpconfigurations/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../dscpconfigurations/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../dscpconfigurations/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../dscpconfigurations/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../dscpconfigurations/predicates.go | 37 - .../2023-06-01/dscpconfigurations/version.go | 12 - .../2023-06-01/endpointservices/README.md | 37 - .../2023-06-01/endpointservices/client.go | 26 - .../endpointservices/id_location.go | 121 - .../endpointservices/id_location_test.go | 237 -- .../method_availableendpointserviceslist.go | 91 - .../model_endpointserviceresult.go | 10 - .../2023-06-01/endpointservices/predicates.go | 27 - .../2023-06-01/endpointservices/version.go | 12 - .../expressroutecircuitarptable/README.md | 37 - .../expressroutecircuitarptable/client.go | 26 - .../id_arptable.go | 148 - .../id_arptable_test.go | 372 --- ...method_expressroutecircuitslistarptable.go | 76 - .../model_expressroutecircuitarptable.go | 11 - .../expressroutecircuitarptable/predicates.go | 32 - .../expressroutecircuitarptable/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 98 - .../id_authorization.go | 139 - .../id_authorization_test.go | 327 -- .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_authorizationpropertiesformat.go | 10 - .../model_expressroutecircuitauthorization.go | 12 - .../predicates.go | 32 - .../version.go | 12 - .../expressroutecircuitconnections/README.md | 83 - .../expressroutecircuitconnections/client.go | 26 - .../constants.go | 101 - .../id_peeringconnection.go | 148 - .../id_peeringconnection_test.go | 372 --- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 92 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_ipv6circuitconnectionconfig.go | 9 - .../model_subresource.go | 8 - .../predicates.go | 32 - .../expressroutecircuitconnections/version.go | 12 - .../expressroutecircuitpeerings/README.md | 83 - .../expressroutecircuitpeerings/client.go | 26 - .../expressroutecircuitpeerings/constants.go | 274 -- .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- .../method_createorupdate.go | 76 - .../method_delete.go | 72 - .../expressroutecircuitpeerings/method_get.go | 55 - .../method_list.go | 91 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_expressroutecircuitpeering.go | 12 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...ressroutecircuitpeeringpropertiesformat.go | 27 - .../model_expressroutecircuitstats.go | 11 - .../model_expressrouteconnectionid.go | 8 - .../model_ipv6circuitconnectionconfig.go | 9 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_subresource.go | 8 - .../expressroutecircuitpeerings/predicates.go | 32 - .../expressroutecircuitpeerings/version.go | 12 - .../expressroutecircuitroutestable/README.md | 37 - .../expressroutecircuitroutestable/client.go | 26 - .../id_peeringroutetable.go | 148 - .../id_peeringroutetable_test.go | 372 --- ...hod_expressroutecircuitslistroutestable.go | 76 - .../model_expressroutecircuitroutestable.go | 12 - .../predicates.go | 37 - .../expressroutecircuitroutestable/version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_routetablessummary.go | 148 - .../id_routetablessummary_test.go | 372 --- ...ressroutecircuitslistroutestablesummary.go | 76 - ...l_expressroutecircuitroutestablesummary.go | 12 - .../predicates.go | 37 - .../version.go | 12 - .../2023-06-01/expressroutecircuits/README.md | 121 - .../2023-06-01/expressroutecircuits/client.go | 26 - .../expressroutecircuits/constants.go | 450 --- .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressroutecircuits/method_delete.go | 71 - .../expressroutecircuits/method_get.go | 54 - .../expressroutecircuits/method_list.go | 92 - .../expressroutecircuits/method_listall.go | 92 - .../expressroutecircuits/method_updatetags.go | 58 - .../model_authorizationpropertiesformat.go | 10 - .../model_expressroutecircuit.go | 15 - .../model_expressroutecircuitauthorization.go | 12 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_expressroutecircuitpeering.go | 12 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...ressroutecircuitpeeringpropertiesformat.go | 27 - ...del_expressroutecircuitpropertiesformat.go | 23 - ...ssroutecircuitserviceproviderproperties.go | 10 - .../model_expressroutecircuitsku.go | 10 - .../model_expressroutecircuitstats.go | 11 - .../model_expressrouteconnectionid.go | 8 - .../model_ipv6circuitconnectionconfig.go | 9 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../expressroutecircuits/model_subresource.go | 8 - .../expressroutecircuits/model_tagsobject.go | 8 - .../expressroutecircuits/predicates.go | 37 - .../expressroutecircuits/version.go | 12 - .../expressroutecircuitstats/README.md | 53 - .../expressroutecircuitstats/client.go | 26 - .../id_expressroutecircuit.go | 130 - .../id_expressroutecircuit_test.go | 282 -- ...hod_expressroutecircuitsgetpeeringstats.go | 56 - .../method_expressroutecircuitsgetstats.go | 55 - .../model_expressroutecircuitstats.go | 11 - .../expressroutecircuitstats/version.go | 12 - .../expressrouteconnections/README.md | 81 - .../expressrouteconnections/client.go | 26 - .../expressrouteconnections/constants.go | 98 - .../id_expressrouteconnection.go | 139 - .../id_expressrouteconnection_test.go | 327 -- .../id_expressroutegateway.go | 130 - .../id_expressroutegateway_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressrouteconnections/method_delete.go | 71 - .../expressrouteconnections/method_get.go | 54 - .../expressrouteconnections/method_list.go | 55 - .../model_expressroutecircuitpeeringid.go | 8 - .../model_expressrouteconnection.go | 10 - .../model_expressrouteconnectionlist.go | 8 - .../model_expressrouteconnectionproperties.go | 15 - .../model_propagatedroutetable.go | 9 - .../model_routingconfiguration.go | 12 - .../model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../model_subresource.go | 8 - .../model_vnetroute.go | 10 - .../expressrouteconnections/version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_peeringarptable.go | 148 - .../id_peeringarptable_test.go | 372 --- ...xpressroutecrossconnectionslistarptable.go | 76 - .../model_expressroutecircuitarptable.go | 11 - .../predicates.go | 32 - .../version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 230 -- .../id_expressroutecrossconnection.go | 130 - .../id_expressroutecrossconnection_test.go | 282 -- .../id_peering.go | 139 - .../id_peering_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...odel_expressroutecrossconnectionpeering.go | 11 - ...ssroutecrossconnectionpeeringproperties.go | 22 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - .../model_subresource.go | 8 - .../predicates.go | 27 - .../version.go | 12 - .../README.md | 37 - .../client.go | 26 - ...ssroutecrossconnectionpeeringroutetable.go | 148 - ...tecrossconnectionpeeringroutetable_test.go | 372 --- ...essroutecrossconnectionslistroutestable.go | 76 - .../model_expressroutecircuitroutestable.go | 12 - .../predicates.go | 37 - .../version.go | 12 - .../README.md | 37 - .../client.go | 26 - .../id_peeringroutetablessummary.go | 148 - .../id_peeringroutetablessummary_test.go | 372 --- ...ecrossconnectionslistroutestablesummary.go | 76 - ...sroutecrossconnectionroutestablesummary.go | 11 - .../predicates.go | 32 - .../version.go | 12 - .../expressroutecrossconnections/README.md | 109 - .../expressroutecrossconnections/client.go | 26 - .../expressroutecrossconnections/constants.go | 277 -- .../id_expressroutecrossconnection.go | 130 - .../id_expressroutecrossconnection_test.go | 282 -- .../method_createorupdate.go | 74 - .../method_get.go | 54 - .../method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_expressroutecircuitpeeringconfig.go | 13 - .../model_expressroutecircuitreference.go | 8 - .../model_expressroutecrossconnection.go | 14 - ...odel_expressroutecrossconnectionpeering.go | 11 - ...ssroutecrossconnectionpeeringproperties.go | 22 - ...l_expressroutecrossconnectionproperties.go | 17 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../predicates.go | 37 - .../expressroutecrossconnections/version.go | 12 - .../2023-06-01/expressroutegateways/README.md | 115 - .../2023-06-01/expressroutegateways/client.go | 26 - .../expressroutegateways/constants.go | 98 - .../id_expressroutegateway.go | 130 - .../id_expressroutegateway_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressroutegateways/method_delete.go | 71 - .../expressroutegateways/method_get.go | 54 - .../method_listbyresourcegroup.go | 56 - .../method_listbysubscription.go | 56 - .../expressroutegateways/method_updatetags.go | 75 - .../model_expressroutecircuitpeeringid.go | 8 - .../model_expressrouteconnection.go | 10 - .../model_expressrouteconnectionproperties.go | 15 - .../model_expressroutegateway.go | 14 - .../model_expressroutegatewaylist.go | 8 - .../model_expressroutegatewayproperties.go | 12 - ...gatewaypropertiesautoscaleconfiguration.go | 8 - ...ypropertiesautoscaleconfigurationbounds.go | 9 - .../model_propagatedroutetable.go | 9 - .../model_routingconfiguration.go | 12 - .../expressroutegateways/model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../expressroutegateways/model_subresource.go | 8 - .../expressroutegateways/model_tagsobject.go | 8 - .../model_virtualhubid.go | 8 - .../expressroutegateways/model_vnetroute.go | 10 - .../expressroutegateways/version.go | 12 - .../2023-06-01/expressroutelinks/README.md | 53 - .../2023-06-01/expressroutelinks/client.go | 26 - .../2023-06-01/expressroutelinks/constants.go | 227 -- .../expressroutelinks/id_expressrouteport.go | 130 - .../id_expressrouteport_test.go | 282 -- .../2023-06-01/expressroutelinks/id_link.go | 139 - .../expressroutelinks/id_link_test.go | 327 -- .../expressroutelinks/method_get.go | 54 - .../expressroutelinks/method_list.go | 91 - .../model_expressroutelink.go | 11 - .../model_expressroutelinkmacsecconfig.go | 11 - .../model_expressroutelinkpropertiesformat.go | 16 - .../expressroutelinks/predicates.go | 27 - .../2023-06-01/expressroutelinks/version.go | 12 - .../expressrouteportauthorizations/README.md | 82 - .../expressrouteportauthorizations/client.go | 26 - .../constants.go | 98 - .../id_expressrouteport.go | 130 - .../id_expressrouteport_test.go | 282 -- .../id_expressrouteportauthorization.go | 139 - .../id_expressrouteportauthorization_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_expressrouteportauthorization.go | 12 - ...srouteportauthorizationpropertiesformat.go | 11 - .../predicates.go | 32 - .../expressrouteportauthorizations/version.go | 12 - .../2023-06-01/expressrouteports/README.md | 142 - .../2023-06-01/expressrouteports/client.go | 26 - .../2023-06-01/expressrouteports/constants.go | 309 -- .../expressrouteports/id_expressrouteport.go | 130 - .../id_expressrouteport_test.go | 282 -- .../method_createorupdate.go | 75 - .../expressrouteports/method_delete.go | 71 - .../expressrouteports/method_generateloa.go | 59 - .../expressrouteports/method_get.go | 54 - .../expressrouteports/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../expressrouteports/method_updatetags.go | 58 - .../model_expressroutelink.go | 11 - .../model_expressroutelinkmacsecconfig.go | 11 - .../model_expressroutelinkpropertiesformat.go | 16 - .../model_expressrouteport.go | 19 - .../model_expressrouteportpropertiesformat.go | 19 - ...del_generateexpressrouteportsloarequest.go | 8 - ...odel_generateexpressrouteportsloaresult.go | 8 - .../expressrouteports/model_subresource.go | 8 - .../expressrouteports/model_tagsobject.go | 8 - .../expressrouteports/predicates.go | 37 - .../2023-06-01/expressrouteports/version.go | 12 - .../expressrouteportslocations/README.md | 54 - .../expressrouteportslocations/client.go | 26 - .../expressrouteportslocations/constants.go | 57 - .../id_expressrouteportslocation.go | 121 - .../id_expressrouteportslocation_test.go | 237 -- .../expressrouteportslocations/method_get.go | 54 - .../expressrouteportslocations/method_list.go | 92 - .../model_expressrouteportslocation.go | 13 - ...del_expressrouteportslocationbandwidths.go | 9 - ...pressrouteportslocationpropertiesformat.go | 11 - .../expressrouteportslocations/predicates.go | 32 - .../expressrouteportslocations/version.go | 12 - .../expressrouteproviderports/README.md | 54 - .../expressrouteproviderports/client.go | 26 - .../id_expressrouteproviderport.go | 121 - .../id_expressrouteproviderport_test.go | 237 -- .../method_expressrouteproviderport.go | 54 - .../method_locationlist.go | 120 - .../model_expressrouteproviderport.go | 14 - ...odel_expressrouteproviderportproperties.go | 15 - .../expressrouteproviderports/predicates.go | 37 - .../expressrouteproviderports/version.go | 12 - .../expressrouteserviceproviders/README.md | 38 - .../expressrouteserviceproviders/client.go | 26 - .../expressrouteserviceproviders/constants.go | 57 - .../method_list.go | 92 - .../model_expressrouteserviceprovider.go | 13 - ...ssrouteserviceproviderbandwidthsoffered.go | 9 - ...essrouteserviceproviderpropertiesformat.go | 10 - .../predicates.go | 32 - .../expressrouteserviceproviders/version.go | 12 - .../2023-06-01/firewallpolicies/README.md | 237 -- .../2023-06-01/firewallpolicies/client.go | 26 - .../2023-06-01/firewallpolicies/constants.go | 417 --- .../firewallpolicies/id_firewallpolicy.go | 130 - .../id_firewallpolicy_test.go | 282 -- .../firewallpolicies/method_createorupdate.go | 75 - .../firewallpolicies/method_delete.go | 71 - ...allpolicyidpssignaturesfiltervalueslist.go | 59 - ...method_firewallpolicyidpssignatureslist.go | 59 - ...irewallpolicyidpssignaturesoverridesget.go | 55 - ...rewallpolicyidpssignaturesoverrideslist.go | 55 - ...ewallpolicyidpssignaturesoverridespatch.go | 59 - ...irewallpolicyidpssignaturesoverridesput.go | 59 - .../2023-06-01/firewallpolicies/method_get.go | 83 - .../firewallpolicies/method_list.go | 92 - .../firewallpolicies/method_listall.go | 92 - .../firewallpolicies/method_updatetags.go | 58 - .../firewallpolicies/model_dnssettings.go | 10 - .../firewallpolicies/model_explicitproxy.go | 13 - .../firewallpolicies/model_filteritems.go | 9 - .../firewallpolicies/model_firewallpolicy.go | 19 - ...odel_firewallpolicycertificateauthority.go | 9 - .../model_firewallpolicyinsights.go | 10 - .../model_firewallpolicyintrusiondetection.go | 10 - ...iondetectionbypasstrafficspecifications.go | 15 - ...llpolicyintrusiondetectionconfiguration.go | 10 - ...ntrusiondetectionsignaturespecification.go | 9 - ...del_firewallpolicyloganalyticsresources.go | 9 - ...del_firewallpolicyloganalyticsworkspace.go | 9 - .../model_firewallpolicypropertiesformat.go | 23 - .../model_firewallpolicysku.go | 8 - .../model_firewallpolicysnat.go | 9 - .../model_firewallpolicysql.go | 8 - ...odel_firewallpolicythreatintelwhitelist.go | 9 - .../model_firewallpolicytransportsecurity.go | 8 - .../firewallpolicies/model_idpsqueryobject.go | 12 - .../firewallpolicies/model_orderby.go | 9 - .../firewallpolicies/model_queryresults.go | 9 - ...del_signatureoverridesfiltervaluesquery.go | 8 - ..._signatureoverridesfiltervaluesresponse.go | 8 - .../model_signaturesoverrides.go | 11 - .../model_signaturesoverrideslist.go | 8 - .../model_signaturesoverridesproperties.go | 8 - .../model_singlequeryresult.go | 18 - .../firewallpolicies/model_subresource.go | 8 - .../firewallpolicies/model_tagsobject.go | 8 - .../2023-06-01/firewallpolicies/predicates.go | 37 - .../2023-06-01/firewallpolicies/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 309 -- .../id_firewallpolicy.go | 130 - .../id_firewallpolicy_test.go | 282 -- .../id_rulecollectiongroup.go | 139 - .../id_rulecollectiongroup_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 91 - .../model_applicationrule.go | 52 - ...odel_firewallpolicyfilterrulecollection.go | 81 - ...irewallpolicyfilterrulecollectionaction.go | 8 - .../model_firewallpolicyhttpheadertoinsert.go | 9 - .../model_firewallpolicynatrulecollection.go | 81 - ...l_firewallpolicynatrulecollectionaction.go | 8 - .../model_firewallpolicyrule.go | 69 - ...l_firewallpolicyruleapplicationprotocol.go | 9 - .../model_firewallpolicyrulecollection.go | 61 - ...model_firewallpolicyrulecollectiongroup.go | 12 - ...wallpolicyrulecollectiongroupproperties.go | 53 - .../model_natrule.go | 50 - .../model_networkrule.go | 49 - .../predicates.go | 32 - .../version.go | 12 - .../network/2023-06-01/flowlogs/README.md | 103 - .../network/2023-06-01/flowlogs/client.go | 26 - .../network/2023-06-01/flowlogs/constants.go | 95 - .../network/2023-06-01/flowlogs/id_flowlog.go | 139 - .../2023-06-01/flowlogs/id_flowlog_test.go | 327 -- .../2023-06-01/flowlogs/id_networkwatcher.go | 130 - .../flowlogs/id_networkwatcher_test.go | 282 -- .../flowlogs/method_createorupdate.go | 75 - .../2023-06-01/flowlogs/method_delete.go | 70 - .../network/2023-06-01/flowlogs/method_get.go | 54 - .../2023-06-01/flowlogs/method_list.go | 91 - .../2023-06-01/flowlogs/method_updatetags.go | 58 - .../2023-06-01/flowlogs/model_flowlog.go | 14 - .../flowlogs/model_flowlogformatparameters.go | 9 - .../flowlogs/model_flowlogpropertiesformat.go | 15 - .../model_retentionpolicyparameters.go | 9 - .../2023-06-01/flowlogs/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../network/2023-06-01/flowlogs/predicates.go | 37 - .../network/2023-06-01/flowlogs/version.go | 12 - .../2023-06-01/ipallocations/README.md | 121 - .../2023-06-01/ipallocations/client.go | 26 - .../2023-06-01/ipallocations/constants.go | 92 - .../ipallocations/id_ipallocation.go | 130 - .../ipallocations/id_ipallocation_test.go | 282 -- .../ipallocations/method_createorupdate.go | 75 - .../2023-06-01/ipallocations/method_delete.go | 71 - .../2023-06-01/ipallocations/method_get.go | 83 - .../2023-06-01/ipallocations/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../ipallocations/method_updatetags.go | 58 - .../ipallocations/model_ipallocation.go | 14 - .../model_ipallocationpropertiesformat.go | 15 - .../ipallocations/model_subresource.go | 8 - .../ipallocations/model_tagsobject.go | 8 - .../2023-06-01/ipallocations/predicates.go | 37 - .../2023-06-01/ipallocations/version.go | 12 - .../network/2023-06-01/ipgroups/README.md | 121 - .../network/2023-06-01/ipgroups/client.go | 26 - .../network/2023-06-01/ipgroups/constants.go | 57 - .../network/2023-06-01/ipgroups/id_ipgroup.go | 130 - .../2023-06-01/ipgroups/id_ipgroup_test.go | 282 -- .../ipgroups/method_createorupdate.go | 75 - .../2023-06-01/ipgroups/method_delete.go | 71 - .../network/2023-06-01/ipgroups/method_get.go | 83 - .../2023-06-01/ipgroups/method_list.go | 92 - .../ipgroups/method_listbyresourcegroup.go | 92 - .../ipgroups/method_updategroups.go | 58 - .../2023-06-01/ipgroups/model_ipgroup.go | 14 - .../ipgroups/model_ipgrouppropertiesformat.go | 11 - .../2023-06-01/ipgroups/model_subresource.go | 8 - .../2023-06-01/ipgroups/model_tagsobject.go | 8 - .../network/2023-06-01/ipgroups/predicates.go | 37 - .../network/2023-06-01/ipgroups/version.go | 12 - .../2023-06-01/loadbalancers/README.md | 449 --- .../2023-06-01/loadbalancers/client.go | 26 - .../2023-06-01/loadbalancers/constants.go | 1368 -------- .../loadbalancers/id_backendaddresspool.go | 139 - .../id_backendaddresspool_test.go | 327 -- .../id_frontendipconfiguration.go | 139 - .../id_frontendipconfiguration_test.go | 327 -- .../loadbalancers/id_inboundnatrule.go | 139 - .../loadbalancers/id_inboundnatrule_test.go | 327 -- .../loadbalancers/id_loadbalancer.go | 130 - .../loadbalancers/id_loadbalancer_test.go | 282 -- .../id_loadbalancerbackendaddresspool.go | 139 - .../id_loadbalancerbackendaddresspool_test.go | 327 -- .../loadbalancers/id_loadbalancingrule.go | 139 - .../id_loadbalancingrule_test.go | 327 -- .../2023-06-01/loadbalancers/id_location.go | 121 - .../loadbalancers/id_location_test.go | 237 -- .../loadbalancers/id_outboundrule.go | 139 - .../loadbalancers/id_outboundrule_test.go | 327 -- .../2023-06-01/loadbalancers/id_probe.go | 139 - .../2023-06-01/loadbalancers/id_probe_test.go | 327 -- .../loadbalancers/id_providerloadbalancer.go | 130 - .../id_providerloadbalancer_test.go | 282 -- .../loadbalancers/method_createorupdate.go | 75 - .../2023-06-01/loadbalancers/method_delete.go | 71 - .../2023-06-01/loadbalancers/method_get.go | 83 - .../method_inboundnatrulescreateorupdate.go | 75 - .../method_inboundnatrulesdelete.go | 71 - .../method_inboundnatrulesget.go | 83 - .../method_inboundnatruleslist.go | 91 - .../2023-06-01/loadbalancers/method_list.go | 92 - .../loadbalancers/method_listall.go | 92 - .../method_listinboundnatruleportmappings.go | 75 - ...lancerbackendaddresspoolscreateorupdate.go | 75 - ...d_loadbalancerbackendaddresspoolsdelete.go | 71 - ...thod_loadbalancerbackendaddresspoolsget.go | 54 - ...hod_loadbalancerbackendaddresspoolslist.go | 91 - ...loadbalancerfrontendipconfigurationsget.go | 54 - ...oadbalancerfrontendipconfigurationslist.go | 91 - ...ethod_loadbalancerloadbalancingrulesget.go | 54 - ...thod_loadbalancerloadbalancingruleslist.go | 91 - ...ethod_loadbalancernetworkinterfaceslist.go | 91 - .../method_loadbalanceroutboundrulesget.go | 54 - .../method_loadbalanceroutboundruleslist.go | 91 - .../method_loadbalancerprobesget.go | 54 - .../method_loadbalancerprobeslist.go | 91 - .../loadbalancers/method_migratetoipbased.go | 59 - .../method_swappublicipaddresses.go | 74 - .../loadbalancers/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - ...ackendaddressinboundnatruleportmappings.go | 8 - .../loadbalancers/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../loadbalancers/model_ddossettings.go | 9 - .../loadbalancers/model_delegation.go | 12 - .../2023-06-01/loadbalancers/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../loadbalancers/model_inboundnatpool.go | 12 - .../model_inboundnatpoolpropertiesformat.go | 16 - .../loadbalancers/model_inboundnatrule.go | 12 - .../model_inboundnatruleportmapping.go | 11 - .../model_inboundnatrulepropertiesformat.go | 19 - .../loadbalancers/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-06-01/loadbalancers/model_iptag.go | 9 - .../loadbalancers/model_loadbalancer.go | 20 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_loadbalancerpropertiesformat.go | 16 - .../loadbalancers/model_loadbalancersku.go | 9 - .../model_loadbalancervipswaprequest.go | 8 - ...ervipswaprequestfrontendipconfiguration.go | 9 - ...equestfrontendipconfigurationproperties.go | 8 - .../loadbalancers/model_loadbalancingrule.go | 12 - ...model_loadbalancingrulepropertiesformat.go | 20 - .../loadbalancers/model_migratedpools.go | 8 - ...del_migrateloadbalancertoipbasedrequest.go | 8 - .../loadbalancers/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../loadbalancers/model_natgatewaysku.go | 8 - .../loadbalancers/model_natruleportmapping.go | 10 - .../loadbalancers/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../loadbalancers/model_outboundrule.go | 12 - .../model_outboundrulepropertiesformat.go | 14 - .../loadbalancers/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../loadbalancers/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../2023-06-01/loadbalancers/model_probe.go | 12 - .../model_probepropertiesformat.go | 15 - .../loadbalancers/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../loadbalancers/model_publicipaddresssku.go | 9 - ...l_queryinboundnatruleportmappingrequest.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../loadbalancers/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-06-01/loadbalancers/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../loadbalancers/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../loadbalancers/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../2023-06-01/loadbalancers/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../loadbalancers/model_subresource.go | 8 - .../loadbalancers/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../loadbalancers/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/loadbalancers/predicates.go | 238 -- .../2023-06-01/loadbalancers/version.go | 12 - .../2023-06-01/localnetworkgateways/README.md | 104 - .../2023-06-01/localnetworkgateways/client.go | 26 - .../localnetworkgateways/constants.go | 57 - .../id_localnetworkgateway.go | 130 - .../id_localnetworkgateway_test.go | 282 -- .../method_createorupdate.go | 75 - .../localnetworkgateways/method_delete.go | 71 - .../localnetworkgateways/method_get.go | 54 - .../localnetworkgateways/method_list.go | 92 - .../localnetworkgateways/method_updatetags.go | 58 - .../model_addressspace.go | 8 - .../localnetworkgateways/model_bgpsettings.go | 11 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_localnetworkgateway.go | 14 - ...del_localnetworkgatewaypropertiesformat.go | 13 - .../localnetworkgateways/model_tagsobject.go | 8 - .../localnetworkgateways/predicates.go | 37 - .../localnetworkgateways/version.go | 12 - .../network/2023-06-01/natgateways/README.md | 121 - .../network/2023-06-01/natgateways/client.go | 26 - .../2023-06-01/natgateways/constants.go | 95 - .../2023-06-01/natgateways/id_natgateway.go | 130 - .../natgateways/id_natgateway_test.go | 282 -- .../natgateways/method_createorupdate.go | 76 - .../2023-06-01/natgateways/method_delete.go | 71 - .../2023-06-01/natgateways/method_get.go | 83 - .../2023-06-01/natgateways/method_list.go | 92 - .../2023-06-01/natgateways/method_listall.go | 92 - .../natgateways/method_updatetags.go | 58 - .../natgateways/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../natgateways/model_natgatewaysku.go | 8 - .../natgateways/model_subresource.go | 8 - .../natgateways/model_tagsobject.go | 8 - .../2023-06-01/natgateways/predicates.go | 37 - .../network/2023-06-01/natgateways/version.go | 12 - .../2023-06-01/networkgroups/README.md | 86 - .../2023-06-01/networkgroups/client.go | 26 - .../2023-06-01/networkgroups/constants.go | 57 - .../networkgroups/id_networkgroup.go | 139 - .../networkgroups/id_networkgroup_test.go | 327 -- .../networkgroups/id_networkmanager.go | 130 - .../networkgroups/id_networkmanager_test.go | 282 -- .../networkgroups/method_createorupdate.go | 88 - .../2023-06-01/networkgroups/method_delete.go | 99 - .../2023-06-01/networkgroups/method_get.go | 54 - .../2023-06-01/networkgroups/method_list.go | 119 - .../networkgroups/model_networkgroup.go | 17 - .../model_networkgroupproperties.go | 10 - .../2023-06-01/networkgroups/predicates.go | 32 - .../2023-06-01/networkgroups/version.go | 12 - .../2023-06-01/networkinterfaces/README.md | 371 --- .../2023-06-01/networkinterfaces/client.go | 26 - .../2023-06-01/networkinterfaces/constants.go | 1500 --------- .../id_providercloudservice.go | 130 - .../id_providercloudservice_test.go | 282 -- .../networkinterfaces/id_roleinstance.go | 139 - .../networkinterfaces/id_roleinstance_test.go | 327 -- .../id_roleinstancenetworkinterface.go | 148 - .../id_roleinstancenetworkinterface_test.go | 372 --- .../networkinterfaces/id_tapconfiguration.go | 139 - .../id_tapconfiguration_test.go | 327 -- .../networkinterfaces/id_virtualmachine.go | 139 - .../id_virtualmachine_test.go | 327 -- .../id_virtualmachinescaleset.go | 130 - .../id_virtualmachinescaleset_test.go | 282 -- .../method_createorupdate.go | 76 - .../networkinterfaces/method_delete.go | 72 - .../networkinterfaces/method_get.go | 84 - .../method_getcloudservicenetworkinterface.go | 83 - .../method_geteffectiveroutetable.go | 77 - ...etvirtualmachinescalesetipconfiguration.go | 84 - ...tvirtualmachinescalesetnetworkinterface.go | 84 - .../networkinterfaces/method_list.go | 92 - .../networkinterfaces/method_listall.go | 92 - ...ethod_listcloudservicenetworkinterfaces.go | 91 - ...oudserviceroleinstancenetworkinterfaces.go | 91 - ...thod_listeffectivenetworksecuritygroups.go | 77 - ...tvirtualmachinescalesetipconfigurations.go | 120 - ...virtualmachinescalesetnetworkinterfaces.go | 91 - ...rtualmachinescalesetvmnetworkinterfaces.go | 91 - ...hod_networkinterfaceipconfigurationsget.go | 55 - ...od_networkinterfaceipconfigurationslist.go | 92 - ...ethod_networkinterfaceloadbalancerslist.go | 92 - ...od_networkinterfacetapconfigurationsget.go | 54 - ...d_networkinterfacetapconfigurationslist.go | 92 - .../networkinterfaces/method_updatetags.go | 59 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../networkinterfaces/model_ddossettings.go | 9 - .../networkinterfaces/model_delegation.go | 12 - .../model_effectivenetworksecuritygroup.go | 11 - ...ffectivenetworksecuritygroupassociation.go | 10 - .../model_effectivenetworksecurityrule.go | 22 - .../networkinterfaces/model_effectiveroute.go | 14 - .../networkinterfaces/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../networkinterfaces/model_inboundnatpool.go | 12 - .../model_inboundnatpoolpropertiesformat.go | 16 - .../networkinterfaces/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../networkinterfaces/model_iptag.go | 9 - .../networkinterfaces/model_loadbalancer.go | 20 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_loadbalancerpropertiesformat.go | 16 - .../model_loadbalancersku.go | 9 - .../model_loadbalancingrule.go | 12 - ...model_loadbalancingrulepropertiesformat.go | 20 - .../networkinterfaces/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../networkinterfaces/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../networkinterfaces/model_outboundrule.go | 12 - .../model_outboundrulepropertiesformat.go | 14 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../networkinterfaces/model_probe.go | 12 - .../model_probepropertiesformat.go | 15 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../networkinterfaces/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../networkinterfaces/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../networkinterfaces/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../networkinterfaces/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../networkinterfaces/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../networkinterfaces/model_subresource.go | 8 - .../networkinterfaces/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../networkinterfaces/predicates.go | 152 - .../2023-06-01/networkinterfaces/version.go | 12 - .../README.md | 41 - .../client.go | 26 - .../constants.go | 277 -- .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../method_listactivesecurityadminrules.go | 59 - .../model_activebasesecurityadminrule.go | 61 - .../model_activeconfigurationparameter.go | 9 - .../model_activedefaultsecurityadminrule.go | 63 - .../model_activesecurityadminrule.go | 63 - ...odel_activesecurityadminruleslistresult.go | 49 - .../model_addressprefixitem.go | 9 - .../model_adminpropertiesformat.go | 18 - .../model_configurationgroup.go | 9 - .../model_defaultadminpropertiesformat.go | 19 - .../model_networkgroupproperties.go | 10 - .../model_networkmanagersecuritygroupitem.go | 8 - .../version.go | 12 - .../README.md | 41 - .../client.go | 26 - .../constants.go | 262 -- .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- ...od_listactiveconnectivityconfigurations.go | 59 - .../model_activeconfigurationparameter.go | 9 - .../model_activeconnectivityconfiguration.go | 30 - ...iveconnectivityconfigurationslistresult.go | 9 - .../model_configurationgroup.go | 9 - ...del_connectivityconfigurationproperties.go | 15 - .../model_connectivitygroupitem.go | 11 - .../model_hub.go | 9 - .../model_networkgroupproperties.go | 10 - .../version.go | 12 - .../networkmanagerconnections/README.md | 161 - .../networkmanagerconnections/client.go | 26 - .../networkmanagerconnections/constants.go | 60 - .../id_networkmanagerconnection.go | 121 - .../id_networkmanagerconnection_test.go | 237 -- .../id_providers2networkmanagerconnection.go | 123 - ...providers2networkmanagerconnection_test.go | 267 -- ...networkmanagerconnectionscreateorupdate.go | 59 - ...entgroupnetworkmanagerconnectionsdelete.go | 47 - ...gementgroupnetworkmanagerconnectionsget.go | 54 - ...ementgroupnetworkmanagerconnectionslist.go | 120 - ...networkmanagerconnectionscreateorupdate.go | 59 - ...criptionnetworkmanagerconnectionsdelete.go | 47 - ...ubscriptionnetworkmanagerconnectionsget.go | 54 - ...bscriptionnetworkmanagerconnectionslist.go | 120 - .../model_networkmanagerconnection.go | 17 - ...odel_networkmanagerconnectionproperties.go | 10 - .../networkmanagerconnections/predicates.go | 32 - .../networkmanagerconnections/version.go | 12 - .../README.md | 42 - .../client.go | 26 - .../constants.go | 262 -- ...agereffectiveconnectivityconfigurations.go | 60 - .../model_configurationgroup.go | 9 - ...del_connectivityconfigurationproperties.go | 15 - .../model_connectivitygroupitem.go | 11 - ...odel_effectiveconnectivityconfiguration.go | 10 - .../model_hub.go | 9 - .../model_networkgroupproperties.go | 10 - ...tiveconnectivityconfigurationlistresult.go | 9 - .../model_queryrequestoptions.go | 8 - .../version.go | 12 - .../README.md | 42 - .../client.go | 26 - .../constants.go | 277 -- ...tworkmanagereffectivesecurityadminrules.go | 60 - .../model_addressprefixitem.go | 9 - .../model_adminpropertiesformat.go | 18 - .../model_configurationgroup.go | 9 - .../model_defaultadminpropertiesformat.go | 19 - .../model_effectivebasesecurityadminrule.go | 61 - ...model_effectivedefaultsecurityadminrule.go | 46 - .../model_effectivesecurityadminrule.go | 46 - .../model_networkgroupproperties.go | 10 - ...ereffectivesecurityadminruleslistresult.go | 49 - .../model_networkmanagersecuritygroupitem.go | 8 - .../model_queryrequestoptions.go | 8 - .../version.go | 12 - .../2023-06-01/networkmanagers/README.md | 163 - .../2023-06-01/networkmanagers/client.go | 26 - .../2023-06-01/networkmanagers/constants.go | 145 - .../networkmanagers/id_networkmanager.go | 130 - .../networkmanagers/id_networkmanager_test.go | 282 -- .../networkmanagers/method_createorupdate.go | 59 - .../networkmanagers/method_delete.go | 99 - .../2023-06-01/networkmanagers/method_get.go | 54 - .../2023-06-01/networkmanagers/method_list.go | 120 - .../method_listbysubscription.go | 120 - .../method_networkmanagercommitspost.go | 75 - ...thod_networkmanagerdeploymentstatuslist.go | 59 - .../networkmanagers/method_patch.go | 58 - .../model_crosstenantscopes.go | 10 - .../networkmanagers/model_networkmanager.go | 19 - .../model_networkmanagercommit.go | 11 - .../model_networkmanagerdeploymentstatus.go | 31 - ...etworkmanagerdeploymentstatuslistresult.go | 9 - ...networkmanagerdeploymentstatusparameter.go | 10 - .../model_networkmanagerproperties.go | 12 - ...rkmanagerpropertiesnetworkmanagerscopes.go | 10 - .../networkmanagers/model_patchobject.go | 8 - .../2023-06-01/networkmanagers/predicates.go | 37 - .../2023-06-01/networkmanagers/version.go | 12 - .../2023-06-01/networkprofiles/README.md | 125 - .../2023-06-01/networkprofiles/client.go | 26 - .../2023-06-01/networkprofiles/constants.go | 1151 ------- .../networkprofiles/id_networkprofile.go | 130 - .../networkprofiles/id_networkprofile_test.go | 282 -- .../networkprofiles/method_createorupdate.go | 59 - .../networkprofiles/method_delete.go | 71 - .../2023-06-01/networkprofiles/method_get.go | 83 - .../2023-06-01/networkprofiles/method_list.go | 92 - .../networkprofiles/method_listall.go | 92 - .../networkprofiles/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_containernetworkinterface.go | 12 - ..._containernetworkinterfaceconfiguration.go | 12 - ...kinterfaceconfigurationpropertiesformat.go | 10 - ...ontainernetworkinterfaceipconfiguration.go | 11 - ...nterfaceipconfigurationpropertiesformat.go | 8 - ...ntainernetworkinterfacepropertiesformat.go | 11 - .../model_customdnsconfigpropertiesformat.go | 9 - .../networkprofiles/model_ddossettings.go | 9 - .../networkprofiles/model_delegation.go | 12 - .../networkprofiles/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../networkprofiles/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../networkprofiles/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-06-01/networkprofiles/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../networkprofiles/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../networkprofiles/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../networkprofiles/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../networkprofiles/model_networkprofile.go | 14 - .../model_networkprofilepropertiesformat.go | 11 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../networkprofiles/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../networkprofiles/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../networkprofiles/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-06-01/networkprofiles/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../networkprofiles/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../networkprofiles/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../networkprofiles/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../networkprofiles/model_subresource.go | 8 - .../networkprofiles/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/networkprofiles/predicates.go | 37 - .../2023-06-01/networkprofiles/version.go | 12 - .../networksecuritygroups/README.md | 121 - .../networksecuritygroups/client.go | 26 - .../networksecuritygroups/constants.go | 1151 ------- .../id_networksecuritygroup.go | 130 - .../id_networksecuritygroup_test.go | 282 -- .../method_createorupdate.go | 75 - .../networksecuritygroups/method_delete.go | 71 - .../networksecuritygroups/method_get.go | 83 - .../networksecuritygroups/method_list.go | 92 - .../networksecuritygroups/method_listall.go | 92 - .../method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../networksecuritygroups/model_delegation.go | 12 - .../networksecuritygroups/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../networksecuritygroups/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../networksecuritygroups/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../networksecuritygroups/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../networksecuritygroups/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../networksecuritygroups/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - .../networksecuritygroups/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../networksecuritygroups/predicates.go | 37 - .../networksecuritygroups/version.go | 12 - .../networkvirtualappliances/README.md | 138 - .../networkvirtualappliances/client.go | 26 - .../networkvirtualappliances/constants.go | 98 - .../id_inboundsecurityrule.go | 139 - .../id_inboundsecurityrule_test.go | 327 -- .../id_networkvirtualappliance.go | 130 - .../id_networkvirtualappliance_test.go | 282 -- .../method_createorupdate.go | 75 - .../networkvirtualappliances/method_delete.go | 71 - .../networkvirtualappliances/method_get.go | 83 - ...ethod_inboundsecurityrulecreateorupdate.go | 75 - .../networkvirtualappliances/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_delegationproperties.go | 9 - .../model_inboundsecurityrule.go | 12 - .../model_inboundsecurityruleproperties.go | 9 - .../model_inboundsecurityrules.go | 10 - ...odel_internetingresspublicipsproperties.go | 8 - .../model_networkvirtualappliance.go | 19 - ...networkvirtualappliancepropertiesformat.go | 25 - .../model_partnermanagedresourceproperties.go | 10 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - ...virtualapplianceadditionalnicproperties.go | 9 - .../model_virtualappliancenicproperties.go | 11 - .../model_virtualapplianceskuproperties.go | 10 - .../networkvirtualappliances/predicates.go | 37 - .../networkvirtualappliances/version.go | 12 - .../2023-06-01/networkwatchers/README.md | 331 -- .../2023-06-01/networkwatchers/client.go | 26 - .../2023-06-01/networkwatchers/constants.go | 855 ----- .../networkwatchers/id_networkwatcher.go | 130 - .../networkwatchers/id_networkwatcher_test.go | 282 -- .../method_checkconnectivity.go | 75 - .../networkwatchers/method_createorupdate.go | 59 - .../networkwatchers/method_delete.go | 70 - .../2023-06-01/networkwatchers/method_get.go | 54 - .../method_getazurereachabilityreport.go | 75 - .../method_getflowlogstatus.go | 75 - ...ethod_getnetworkconfigurationdiagnostic.go | 75 - .../networkwatchers/method_getnexthop.go | 75 - .../networkwatchers/method_gettopology.go | 59 - .../method_gettroubleshooting.go | 75 - .../method_gettroubleshootingresult.go | 75 - .../method_getvmsecurityrules.go | 75 - .../2023-06-01/networkwatchers/method_list.go | 56 - .../networkwatchers/method_listall.go | 56 - .../method_listavailableproviders.go | 75 - .../method_setflowlogconfiguration.go | 75 - .../networkwatchers/method_updatetags.go | 58 - .../networkwatchers/method_verifyipflow.go | 75 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_availableproviderslist.go | 8 - .../model_availableproviderslistcity.go | 9 - .../model_availableproviderslistcountry.go | 10 - .../model_availableproviderslistparameters.go | 11 - .../model_availableprovidersliststate.go | 10 - .../model_azurereachabilityreport.go | 10 - .../model_azurereachabilityreportitem.go | 10 - ...odel_azurereachabilityreportlatencyinfo.go | 27 - .../model_azurereachabilityreportlocation.go | 10 - ...model_azurereachabilityreportparameters.go | 36 - .../model_connectivitydestination.go | 10 - .../networkwatchers/model_connectivityhop.go | 16 - .../model_connectivityinformation.go | 14 - .../model_connectivityissue.go | 11 - .../model_connectivityparameters.go | 12 - .../model_connectivitysource.go | 9 - .../model_effectivenetworksecurityrule.go | 22 - .../model_evaluatednetworksecuritygroup.go | 11 - .../model_flowlogformatparameters.go | 9 - .../model_flowloginformation.go | 10 - .../model_flowlogproperties.go | 11 - .../model_flowlogstatusparameters.go | 8 - .../networkwatchers/model_hoplink.go | 13 - .../model_hoplinkproperties.go | 10 - .../model_httpconfiguration.go | 10 - .../networkwatchers/model_httpheader.go | 9 - .../networkwatchers/model_matchedrule.go | 9 - ...etworkconfigurationdiagnosticparameters.go | 10 - ...l_networkconfigurationdiagnosticprofile.go | 12 - ..._networkconfigurationdiagnosticresponse.go | 8 - ...el_networkconfigurationdiagnosticresult.go | 9 - .../model_networkinterfaceassociation.go | 9 - .../model_networksecuritygroupresult.go | 9 - ...el_networksecurityrulesevaluationresult.go | 13 - .../networkwatchers/model_networkwatcher.go | 14 - .../model_networkwatcherlistresult.go | 8 - .../model_networkwatcherpropertiesformat.go | 8 - .../model_nexthopparameters.go | 11 - .../networkwatchers/model_nexthopresult.go | 10 - .../model_protocolconfiguration.go | 8 - .../model_querytroubleshootingparameters.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_securitygroupnetworkinterface.go | 9 - .../model_securitygroupviewparameters.go | 8 - .../model_securitygroupviewresult.go | 8 - .../networkwatchers/model_securityrule.go | 12 - .../model_securityruleassociations.go | 11 - .../model_securityrulepropertiesformat.go | 23 - .../model_subnetassociation.go | 9 - .../networkwatchers/model_subresource.go | 8 - .../networkwatchers/model_tagsobject.go | 8 - .../networkwatchers/model_topology.go | 41 - .../model_topologyassociation.go | 10 - .../model_topologyparameters.go | 10 - .../networkwatchers/model_topologyresource.go | 11 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_troubleshootingdetails.go | 12 - .../model_troubleshootingparameters.go | 9 - .../model_troubleshootingproperties.go | 9 - ...model_troubleshootingrecommendedactions.go | 11 - .../model_troubleshootingresult.go | 41 - .../model_verificationipflowparameters.go | 15 - .../model_verificationipflowresult.go | 9 - .../2023-06-01/networkwatchers/version.go | 12 - .../2023-06-01/p2svpngateways/README.md | 113 - .../2023-06-01/p2svpngateways/client.go | 26 - .../2023-06-01/p2svpngateways/constants.go | 183 -- .../method_disconnectp2svpnconnections.go | 75 - .../method_generatevpnprofile.go | 76 - .../method_getp2svpnconnectionhealth.go | 72 - ...ethod_getp2svpnconnectionhealthdetailed.go | 76 - .../2023-06-01/p2svpngateways/method_reset.go | 72 - .../p2svpngateways/method_updatetags.go | 76 - .../p2svpngateways/model_addressspace.go | 8 - .../model_p2sconnectionconfiguration.go | 11 - ...el_p2sconnectionconfigurationproperties.go | 13 - .../model_p2svpnconnectionhealth.go | 8 - .../model_p2svpnconnectionhealthrequest.go | 9 - .../model_p2svpnconnectionrequest.go | 8 - .../p2svpngateways/model_p2svpngateway.go | 14 - .../model_p2svpngatewayproperties.go | 15 - .../model_p2svpnprofileparameters.go | 8 - .../model_propagatedroutetable.go | 9 - .../model_routingconfiguration.go | 12 - .../p2svpngateways/model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../p2svpngateways/model_subresource.go | 8 - .../p2svpngateways/model_tagsobject.go | 8 - .../p2svpngateways/model_vnetroute.go | 10 - .../model_vpnclientconnectionhealth.go | 11 - .../model_vpnprofileresponse.go | 8 - ...model_vpnserverconfigurationpolicygroup.go | 12 - ...vpnserverconfigurationpolicygroupmember.go | 10 - ...erverconfigurationpolicygroupproperties.go | 12 - .../2023-06-01/p2svpngateways/version.go | 12 - .../2023-06-01/packetcaptures/README.md | 105 - .../2023-06-01/packetcaptures/client.go | 26 - .../2023-06-01/packetcaptures/constants.go | 242 -- .../packetcaptures/id_networkwatcher.go | 130 - .../packetcaptures/id_networkwatcher_test.go | 282 -- .../packetcaptures/id_packetcapture.go | 139 - .../packetcaptures/id_packetcapture_test.go | 327 -- .../packetcaptures/method_create.go | 74 - .../packetcaptures/method_delete.go | 70 - .../2023-06-01/packetcaptures/method_get.go | 54 - .../packetcaptures/method_getstatus.go | 71 - .../2023-06-01/packetcaptures/method_list.go | 55 - .../2023-06-01/packetcaptures/method_stop.go | 70 - .../packetcaptures/model_packetcapture.go | 8 - .../model_packetcapturefilter.go | 12 - .../model_packetcapturelistresult.go | 8 - .../model_packetcapturemachinescope.go | 9 - .../model_packetcaptureparameters.go | 15 - .../model_packetcapturequerystatusresult.go | 31 - .../model_packetcaptureresult.go | 11 - .../model_packetcaptureresultproperties.go | 16 - .../model_packetcapturestoragelocation.go | 10 - .../2023-06-01/packetcaptures/version.go | 12 - .../README.md | 54 - .../client.go | 26 - .../constants.go | 101 - .../id_peerconnection.go | 148 - .../id_peerconnection_test.go | 372 --- .../method_get.go | 54 - .../method_list.go | 92 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_subresource.go | 8 - .../predicates.go | 32 - .../version.go | 12 - .../2023-06-01/privatednszonegroups/README.md | 82 - .../2023-06-01/privatednszonegroups/client.go | 26 - .../privatednszonegroups/constants.go | 57 - .../id_privatednszonegroup.go | 139 - .../id_privatednszonegroup_test.go | 327 -- .../id_privateendpoint.go | 130 - .../id_privateendpoint_test.go | 282 -- .../method_createorupdate.go | 75 - .../privatednszonegroups/method_delete.go | 71 - .../privatednszonegroups/method_get.go | 54 - .../privatednszonegroups/method_list.go | 91 - .../model_privatednszoneconfig.go | 9 - .../model_privatednszonegroup.go | 11 - ...del_privatednszonegrouppropertiesformat.go | 9 - .../model_privatednszonepropertiesformat.go | 9 - .../privatednszonegroups/model_recordset.go | 13 - .../privatednszonegroups/predicates.go | 27 - .../privatednszonegroups/version.go | 12 - .../2023-06-01/privateendpoints/README.md | 134 - .../2023-06-01/privateendpoints/client.go | 26 - .../2023-06-01/privateendpoints/constants.go | 1151 ------- .../privateendpoints/id_location.go | 121 - .../privateendpoints/id_location_test.go | 237 -- .../privateendpoints/id_privateendpoint.go | 130 - .../id_privateendpoint_test.go | 282 -- .../privateendpoints/id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- ...ethod_availableprivateendpointtypeslist.go | 91 - ...privateendpointtypeslistbyresourcegroup.go | 91 - .../privateendpoints/method_createorupdate.go | 75 - .../privateendpoints/method_delete.go | 71 - .../2023-06-01/privateendpoints/method_get.go | 83 - .../privateendpoints/method_list.go | 92 - .../method_listbysubscription.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_availableprivateendpointtype.go | 12 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../privateendpoints/model_ddossettings.go | 9 - .../privateendpoints/model_delegation.go | 12 - .../privateendpoints/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../privateendpoints/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../privateendpoints/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../privateendpoints/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../privateendpoints/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../privateendpoints/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../privateendpoints/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../privateendpoints/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../privateendpoints/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../privateendpoints/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../privateendpoints/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../privateendpoints/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../privateendpoints/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../privateendpoints/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/privateendpoints/predicates.go | 70 - .../2023-06-01/privateendpoints/version.go | 12 - .../2023-06-01/privatelinkservice/README.md | 37 - .../2023-06-01/privatelinkservice/client.go | 26 - .../privatelinkservice/constants.go | 1151 ------- .../id_privatelinkservice.go | 130 - .../id_privatelinkservice_test.go | 282 -- .../method_createorupdate.go | 75 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../privatelinkservice/model_ddossettings.go | 9 - .../privatelinkservice/model_delegation.go | 12 - .../privatelinkservice/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../privatelinkservice/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../privatelinkservice/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../privatelinkservice/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../privatelinkservice/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../privatelinkservice/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../privatelinkservice/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../privatelinkservice/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../privatelinkservice/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../privatelinkservice/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/privatelinkservice/version.go | 12 - .../2023-06-01/privatelinkservices/README.md | 217 -- .../2023-06-01/privatelinkservices/client.go | 26 - .../privatelinkservices/constants.go | 1151 ------- .../privatelinkservices/id_location.go | 121 - .../privatelinkservices/id_location_test.go | 237 -- .../id_privateendpointconnection.go | 139 - .../id_privateendpointconnection_test.go | 327 -- .../id_privatelinkservice.go | 130 - .../id_privatelinkservice_test.go | 282 -- .../id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- ...ethod_checkprivatelinkservicevisibility.go | 75 - ...atelinkservicevisibilitybyresourcegroup.go | 75 - .../privatelinkservices/method_delete.go | 71 - .../method_deleteprivateendpointconnection.go | 71 - .../privatelinkservices/method_get.go | 83 - .../method_getprivateendpointconnection.go | 83 - .../privatelinkservices/method_list.go | 92 - ...hod_listautoapprovedprivatelinkservices.go | 91 - ...rovedprivatelinkservicesbyresourcegroup.go | 91 - .../method_listbysubscription.go | 92 - .../method_listprivateendpointconnections.go | 91 - .../method_updateprivateendpointconnection.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_autoapprovedprivatelinkservice.go | 8 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - ...heckprivatelinkservicevisibilityrequest.go | 8 - .../model_customdnsconfigpropertiesformat.go | 9 - .../privatelinkservices/model_ddossettings.go | 9 - .../privatelinkservices/model_delegation.go | 12 - .../privatelinkservices/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../privatelinkservices/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../privatelinkservices/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_privatelinkservicevisibility.go | 8 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../privatelinkservices/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../privatelinkservices/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../privatelinkservices/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../privatelinkservices/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../privatelinkservices/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../privatelinkservices/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../privatelinkservices/predicates.go | 78 - .../2023-06-01/privatelinkservices/version.go | 12 - .../2023-06-01/publicipaddresses/README.md | 133 - .../2023-06-01/publicipaddresses/client.go | 26 - .../2023-06-01/publicipaddresses/constants.go | 1192 ------- .../method_createorupdate.go | 76 - .../method_ddosprotectionstatus.go | 72 - .../publicipaddresses/method_delete.go | 72 - .../publicipaddresses/method_get.go | 84 - .../publicipaddresses/method_list.go | 92 - .../publicipaddresses/method_listall.go | 92 - .../publicipaddresses/method_updatetags.go | 59 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../publicipaddresses/model_ddossettings.go | 9 - .../publicipaddresses/model_delegation.go | 12 - .../publicipaddresses/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../publicipaddresses/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../publicipaddresses/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../publicipaddresses/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../publicipaddresses/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - ...odel_publicipddosprotectionstatusresult.go | 11 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../publicipaddresses/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../publicipaddresses/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../publicipaddresses/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../publicipaddresses/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../publicipaddresses/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../publicipaddresses/model_subresource.go | 8 - .../publicipaddresses/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../publicipaddresses/predicates.go | 37 - .../2023-06-01/publicipaddresses/version.go | 12 - .../2023-06-01/publicipprefixes/README.md | 121 - .../2023-06-01/publicipprefixes/client.go | 26 - .../2023-06-01/publicipprefixes/constants.go | 215 -- .../publicipprefixes/id_publicipprefix.go | 130 - .../id_publicipprefix_test.go | 282 -- .../publicipprefixes/method_createorupdate.go | 75 - .../publicipprefixes/method_delete.go | 71 - .../2023-06-01/publicipprefixes/method_get.go | 83 - .../publicipprefixes/method_list.go | 92 - .../publicipprefixes/method_listall.go | 92 - .../publicipprefixes/method_updatetags.go | 58 - .../publicipprefixes/model_iptag.go | 9 - .../publicipprefixes/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../publicipprefixes/model_natgatewaysku.go | 8 - .../publicipprefixes/model_publicipprefix.go | 22 - .../model_publicipprefixpropertiesformat.go | 17 - .../model_publicipprefixsku.go | 9 - .../model_referencedpublicipaddress.go | 8 - .../publicipprefixes/model_subresource.go | 8 - .../publicipprefixes/model_tagsobject.go | 8 - .../2023-06-01/publicipprefixes/predicates.go | 37 - .../2023-06-01/publicipprefixes/version.go | 12 - .../2023-06-01/routefilterrules/README.md | 82 - .../2023-06-01/routefilterrules/client.go | 26 - .../2023-06-01/routefilterrules/constants.go | 136 - .../routefilterrules/id_routefilter.go | 130 - .../routefilterrules/id_routefilter_test.go | 282 -- .../routefilterrules/id_routefilterrule.go | 139 - .../id_routefilterrule_test.go | 327 -- .../routefilterrules/method_createorupdate.go | 75 - .../routefilterrules/method_delete.go | 71 - .../2023-06-01/routefilterrules/method_get.go | 54 - .../method_listbyroutefilter.go | 91 - .../routefilterrules/model_routefilterrule.go | 12 - .../model_routefilterrulepropertiesformat.go | 11 - .../2023-06-01/routefilterrules/predicates.go | 32 - .../2023-06-01/routefilterrules/version.go | 12 - .../network/2023-06-01/routefilters/README.md | 121 - .../network/2023-06-01/routefilters/client.go | 26 - .../2023-06-01/routefilters/constants.go | 353 -- .../2023-06-01/routefilters/id_routefilter.go | 130 - .../routefilters/id_routefilter_test.go | 282 -- .../routefilters/method_createorupdate.go | 75 - .../2023-06-01/routefilters/method_delete.go | 71 - .../2023-06-01/routefilters/method_get.go | 83 - .../2023-06-01/routefilters/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../routefilters/method_updatetags.go | 58 - .../model_expressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../model_expressroutecircuitpeering.go | 12 - .../model_expressroutecircuitpeeringconfig.go | 13 - ...ressroutecircuitpeeringpropertiesformat.go | 27 - .../model_expressroutecircuitstats.go | 11 - .../model_expressrouteconnectionid.go | 8 - .../model_ipv6circuitconnectionconfig.go | 9 - ...el_ipv6expressroutecircuitpeeringconfig.go | 12 - ...model_peerexpressroutecircuitconnection.go | 12 - ...sroutecircuitconnectionpropertiesformat.go | 14 - .../routefilters/model_routefilter.go | 14 - .../model_routefilterpropertiesformat.go | 11 - .../routefilters/model_routefilterrule.go | 12 - .../model_routefilterrulepropertiesformat.go | 11 - .../routefilters/model_subresource.go | 8 - .../routefilters/model_tagsobject.go | 8 - .../2023-06-01/routefilters/predicates.go | 37 - .../2023-06-01/routefilters/version.go | 12 - .../network/2023-06-01/routes/README.md | 82 - .../network/2023-06-01/routes/client.go | 26 - .../network/2023-06-01/routes/constants.go | 107 - .../network/2023-06-01/routes/id_route.go | 139 - .../2023-06-01/routes/id_route_test.go | 327 -- .../2023-06-01/routes/id_routetable.go | 130 - .../2023-06-01/routes/id_routetable_test.go | 282 -- .../routes/method_createorupdate.go | 75 - .../2023-06-01/routes/method_delete.go | 71 - .../network/2023-06-01/routes/method_get.go | 54 - .../network/2023-06-01/routes/method_list.go | 91 - .../network/2023-06-01/routes/model_route.go | 12 - .../routes/model_routepropertiesformat.go | 12 - .../network/2023-06-01/routes/predicates.go | 32 - .../network/2023-06-01/routes/version.go | 12 - .../network/2023-06-01/routetables/README.md | 121 - .../network/2023-06-01/routetables/client.go | 26 - .../2023-06-01/routetables/constants.go | 1151 ------- .../2023-06-01/routetables/id_routetable.go | 130 - .../routetables/id_routetable_test.go | 282 -- .../routetables/method_createorupdate.go | 75 - .../2023-06-01/routetables/method_delete.go | 71 - .../2023-06-01/routetables/method_get.go | 83 - .../2023-06-01/routetables/method_list.go | 92 - .../2023-06-01/routetables/method_listall.go | 92 - .../routetables/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../routetables/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../routetables/model_ddossettings.go | 9 - .../routetables/model_delegation.go | 12 - .../2023-06-01/routetables/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../routetables/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../routetables/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-06-01/routetables/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../routetables/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../routetables/model_natgatewaysku.go | 8 - .../routetables/model_natruleportmapping.go | 10 - .../routetables/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../routetables/model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../routetables/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../routetables/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../routetables/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../routetables/model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../routetables/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-06-01/routetables/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../routetables/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../routetables/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../2023-06-01/routetables/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../routetables/model_subresource.go | 8 - .../routetables/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../routetables/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/routetables/predicates.go | 37 - .../network/2023-06-01/routetables/version.go | 12 - .../2023-06-01/scopeconnections/README.md | 90 - .../2023-06-01/scopeconnections/client.go | 26 - .../2023-06-01/scopeconnections/constants.go | 60 - .../scopeconnections/id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../scopeconnections/id_scopeconnection.go | 139 - .../id_scopeconnection_test.go | 327 -- .../scopeconnections/method_createorupdate.go | 59 - .../scopeconnections/method_delete.go | 47 - .../2023-06-01/scopeconnections/method_get.go | 54 - .../scopeconnections/method_list.go | 119 - .../scopeconnections/model_scopeconnection.go | 17 - .../model_scopeconnectionproperties.go | 11 - .../2023-06-01/scopeconnections/predicates.go | 32 - .../2023-06-01/scopeconnections/version.go | 12 - .../securityadminconfigurations/README.md | 86 - .../securityadminconfigurations/client.go | 26 - .../securityadminconfigurations/constants.go | 101 - .../id_networkmanager.go | 130 - .../id_networkmanager_test.go | 282 -- .../id_securityadminconfiguration.go | 139 - .../id_securityadminconfiguration_test.go | 327 -- .../method_createorupdate.go | 59 - .../method_delete.go | 99 - .../securityadminconfigurations/method_get.go | 54 - .../method_list.go | 119 - .../model_securityadminconfiguration.go | 17 - ...urityadminconfigurationpropertiesformat.go | 11 - .../securityadminconfigurations/predicates.go | 32 - .../securityadminconfigurations/version.go | 12 - .../securitypartnerproviders/README.md | 121 - .../securitypartnerproviders/client.go | 26 - .../securitypartnerproviders/constants.go | 148 - .../id_securitypartnerprovider.go | 130 - .../id_securitypartnerprovider_test.go | 282 -- .../method_createorupdate.go | 75 - .../securitypartnerproviders/method_delete.go | 71 - .../securitypartnerproviders/method_get.go | 54 - .../securitypartnerproviders/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_securitypartnerprovider.go | 14 - ...securitypartnerproviderpropertiesformat.go | 11 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../securitypartnerproviders/predicates.go | 37 - .../securitypartnerproviders/version.go | 12 - .../2023-06-01/securityrules/README.md | 115 - .../2023-06-01/securityrules/client.go | 26 - .../2023-06-01/securityrules/constants.go | 192 -- .../securityrules/id_defaultsecurityrule.go | 139 - .../id_defaultsecurityrule_test.go | 327 -- .../securityrules/id_networksecuritygroup.go | 130 - .../id_networksecuritygroup_test.go | 282 -- .../securityrules/id_securityrule.go | 139 - .../securityrules/id_securityrule_test.go | 327 -- .../securityrules/method_createorupdate.go | 75 - .../method_defaultsecurityrulesget.go | 54 - .../method_defaultsecurityruleslist.go | 91 - .../2023-06-01/securityrules/method_delete.go | 71 - .../2023-06-01/securityrules/method_get.go | 54 - .../2023-06-01/securityrules/method_list.go | 91 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../securityrules/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../2023-06-01/securityrules/predicates.go | 32 - .../2023-06-01/securityrules/version.go | 12 - .../serviceendpointpolicies/README.md | 121 - .../serviceendpointpolicies/client.go | 26 - .../serviceendpointpolicies/constants.go | 1151 ------- .../id_serviceendpointpolicy.go | 130 - .../id_serviceendpointpolicy_test.go | 282 -- .../method_createorupdate.go | 75 - .../serviceendpointpolicies/method_delete.go | 71 - .../serviceendpointpolicies/method_get.go | 83 - .../serviceendpointpolicies/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../serviceendpointpolicies/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../serviceendpointpolicies/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../serviceendpointpolicies/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../serviceendpointpolicies/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../serviceendpointpolicies/predicates.go | 42 - .../serviceendpointpolicies/version.go | 12 - .../README.md | 82 - .../client.go | 26 - .../constants.go | 57 - .../id_serviceendpointpolicy.go | 130 - .../id_serviceendpointpolicy_test.go | 282 -- .../id_serviceendpointpolicydefinition.go | 139 - ...id_serviceendpointpolicydefinition_test.go | 327 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_listbyresourcegroup.go | 91 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - .../predicates.go | 32 - .../version.go | 12 - .../network/2023-06-01/servicetags/README.md | 53 - .../network/2023-06-01/servicetags/client.go | 26 - .../2023-06-01/servicetags/id_location.go | 121 - .../servicetags/id_location_test.go | 237 -- .../method_servicetaginformationlist.go | 123 - .../servicetags/method_servicetagslist.go | 55 - .../model_servicetaginformation.go | 11 - ...l_servicetaginformationpropertiesformat.go | 12 - .../model_servicetagslistresult.go | 14 - .../2023-06-01/servicetags/predicates.go | 27 - .../network/2023-06-01/servicetags/version.go | 12 - .../2023-06-01/staticmembers/README.md | 90 - .../2023-06-01/staticmembers/client.go | 26 - .../2023-06-01/staticmembers/constants.go | 57 - .../staticmembers/id_networkgroup.go | 139 - .../staticmembers/id_networkgroup_test.go | 327 -- .../staticmembers/id_staticmember.go | 148 - .../staticmembers/id_staticmember_test.go | 372 --- .../staticmembers/method_createorupdate.go | 59 - .../2023-06-01/staticmembers/method_delete.go | 47 - .../2023-06-01/staticmembers/method_get.go | 54 - .../2023-06-01/staticmembers/method_list.go | 119 - .../staticmembers/model_staticmember.go | 17 - .../model_staticmemberproperties.go | 10 - .../2023-06-01/staticmembers/predicates.go | 32 - .../2023-06-01/staticmembers/version.go | 12 - .../network/2023-06-01/subnets/README.md | 83 - .../network/2023-06-01/subnets/client.go | 26 - .../network/2023-06-01/subnets/constants.go | 1151 ------- .../subnets/method_createorupdate.go | 76 - .../2023-06-01/subnets/method_delete.go | 72 - .../network/2023-06-01/subnets/method_get.go | 84 - .../network/2023-06-01/subnets/method_list.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../subnets/model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../subnets/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../2023-06-01/subnets/model_ddossettings.go | 9 - .../2023-06-01/subnets/model_delegation.go | 12 - .../2023-06-01/subnets/model_flowlog.go | 14 - .../subnets/model_flowlogformatparameters.go | 9 - .../subnets/model_flowlogpropertiesformat.go | 15 - .../subnets/model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../subnets/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../subnets/model_ipconfiguration.go | 11 - .../subnets/model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../network/2023-06-01/subnets/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../2023-06-01/subnets/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../2023-06-01/subnets/model_natgatewaysku.go | 8 - .../subnets/model_natruleportmapping.go | 10 - .../subnets/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../subnets/model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../subnets/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../subnets/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../subnets/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../subnets/model_publicipaddresssku.go | 9 - .../subnets/model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../2023-06-01/subnets/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../network/2023-06-01/subnets/model_route.go | 12 - .../subnets/model_routepropertiesformat.go | 12 - .../2023-06-01/subnets/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../2023-06-01/subnets/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../subnets/model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../subnets/model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../2023-06-01/subnets/model_subnet.go | 12 - .../subnets/model_subnetpropertiesformat.go | 27 - .../2023-06-01/subnets/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../subnets/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../network/2023-06-01/subnets/predicates.go | 32 - .../network/2023-06-01/subnets/version.go | 12 - .../2023-06-01/trafficanalytics/README.md | 54 - .../2023-06-01/trafficanalytics/client.go | 26 - .../2023-06-01/trafficanalytics/constants.go | 48 - .../trafficanalytics/id_networkwatcher.go | 130 - .../id_networkwatcher_test.go | 282 -- .../method_networkwatchersgetflowlogstatus.go | 75 - ..._networkwatcherssetflowlogconfiguration.go | 75 - .../model_flowlogformatparameters.go | 9 - .../model_flowloginformation.go | 10 - .../model_flowlogproperties.go | 11 - .../model_flowlogstatusparameters.go | 8 - .../model_retentionpolicyparameters.go | 9 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../2023-06-01/trafficanalytics/version.go | 12 - .../network/2023-06-01/usages/README.md | 37 - .../network/2023-06-01/usages/client.go | 26 - .../network/2023-06-01/usages/constants.go | 48 - .../network/2023-06-01/usages/id_location.go | 121 - .../2023-06-01/usages/id_location_test.go | 237 -- .../network/2023-06-01/usages/method_list.go | 91 - .../network/2023-06-01/usages/model_usage.go | 12 - .../2023-06-01/usages/model_usagename.go | 9 - .../network/2023-06-01/usages/predicates.go | 27 - .../network/2023-06-01/usages/version.go | 12 - .../network/2023-06-01/vipswap/README.md | 69 - .../network/2023-06-01/vipswap/client.go | 26 - .../network/2023-06-01/vipswap/constants.go | 51 - .../2023-06-01/vipswap/id_cloudservice.go | 130 - .../vipswap/id_cloudservice_test.go | 282 -- .../2023-06-01/vipswap/method_create.go | 74 - .../network/2023-06-01/vipswap/method_get.go | 55 - .../network/2023-06-01/vipswap/method_list.go | 55 - .../2023-06-01/vipswap/model_swapresource.go | 11 - .../vipswap/model_swapresourcelistresult.go | 8 - .../vipswap/model_swapresourceproperties.go | 8 - .../network/2023-06-01/vipswap/version.go | 12 - .../virtualappliancesites/README.md | 82 - .../virtualappliancesites/client.go | 26 - .../virtualappliancesites/constants.go | 57 - .../id_networkvirtualappliance.go | 130 - .../id_networkvirtualappliance_test.go | 282 -- .../id_virtualappliancesite.go | 139 - .../id_virtualappliancesite_test.go | 327 -- .../method_createorupdate.go | 75 - .../virtualappliancesites/method_delete.go | 71 - .../virtualappliancesites/method_get.go | 54 - .../virtualappliancesites/method_list.go | 91 - .../model_breakoutcategorypolicies.go | 10 - .../model_office365policyproperties.go | 8 - .../model_virtualappliancesite.go | 12 - .../model_virtualappliancesiteproperties.go | 10 - .../virtualappliancesites/predicates.go | 32 - .../virtualappliancesites/version.go | 12 - .../2023-06-01/virtualapplianceskus/README.md | 54 - .../2023-06-01/virtualapplianceskus/client.go | 26 - .../id_networkvirtualappliancesku.go | 121 - .../id_networkvirtualappliancesku_test.go | 237 -- .../virtualapplianceskus/method_get.go | 54 - .../virtualapplianceskus/method_list.go | 92 - .../model_networkvirtualappliancesku.go | 14 - ...del_networkvirtualapplianceskuinstances.go | 9 - ...workvirtualapplianceskupropertiesformat.go | 10 - .../virtualapplianceskus/predicates.go | 37 - .../virtualapplianceskus/version.go | 12 - .../README.md | 208 -- .../client.go | 26 - .../constants.go | 1184 ------- .../id_connection.go | 130 - .../id_connection_test.go | 282 -- .../method_createorupdate.go | 75 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_getikesas.go | 71 - .../method_getsharedkey.go | 55 - .../method_list.go | 92 - .../method_resetconnection.go | 69 - .../method_resetsharedkey.go | 75 - .../method_setsharedkey.go | 75 - .../method_startpacketcapture.go | 75 - .../method_stoppacketcapture.go | 75 - .../method_updatetags.go | 75 - .../model_addressspace.go | 8 - .../model_bgpsettings.go | 11 - .../model_connectionresetsharedkey.go | 8 - .../model_connectionsharedkey.go | 9 - ...atewaycustombgpipaddressipconfiguration.go | 9 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_ipsecpolicy.go | 15 - .../model_localnetworkgateway.go | 14 - ...del_localnetworkgatewaypropertiesformat.go | 13 - .../model_radiusserver.go | 10 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../model_tunnelconnectionhealth.go | 12 - .../model_virtualnetworkgateway.go | 19 - ...el_virtualnetworkgatewayautoscalebounds.go | 9 - ...ualnetworkgatewayautoscaleconfiguration.go | 8 - .../model_virtualnetworkgatewayconnection.go | 14 - ...etworkgatewayconnectionpropertiesformat.go | 34 - ...el_virtualnetworkgatewayipconfiguration.go | 11 - ...kgatewayipconfigurationpropertiesformat.go | 12 - .../model_virtualnetworkgatewaynatrule.go | 12 - ..._virtualnetworkgatewaynatruleproperties.go | 13 - .../model_virtualnetworkgatewaypolicygroup.go | 11 - ..._virtualnetworkgatewaypolicygroupmember.go | 10 - ...tualnetworkgatewaypolicygroupproperties.go | 12 - ...l_virtualnetworkgatewaypropertiesformat.go | 32 - .../model_virtualnetworkgatewaysku.go | 10 - .../model_vngclientconnectionconfiguration.go | 11 - ...clientconnectionconfigurationproperties.go | 10 - .../model_vpnclientconfiguration.go | 20 - .../model_vpnclientrevokedcertificate.go | 11 - ...lientrevokedcertificatepropertiesformat.go | 9 - .../model_vpnclientrootcertificate.go | 11 - ...pnclientrootcertificatepropertiesformat.go | 9 - .../model_vpnnatrulemapping.go | 9 - .../model_vpnpacketcapturestartparameters.go | 8 - .../model_vpnpacketcapturestopparameters.go | 8 - .../predicates.go | 37 - .../version.go | 12 - .../virtualnetworkgateways/README.md | 414 --- .../virtualnetworkgateways/client.go | 26 - .../virtualnetworkgateways/constants.go | 1316 -------- .../virtualnetworkgateways/id_connection.go | 130 - .../id_connection_test.go | 282 -- .../id_virtualnetworkgateway.go | 130 - .../id_virtualnetworkgateway_test.go | 282 -- .../id_virtualnetworkgatewaynatrule.go | 139 - .../id_virtualnetworkgatewaynatrule_test.go | 327 -- .../method_createorupdate.go | 75 - .../virtualnetworkgateways/method_delete.go | 71 - ...nectvirtualnetworkgatewayvpnconnections.go | 74 - .../method_generatevpnclientpackage.go | 75 - .../method_generatevpnprofile.go | 75 - .../virtualnetworkgateways/method_get.go | 54 - .../method_getadvertisedroutes.go | 99 - .../method_getbgppeerstatus.go | 99 - .../method_getlearnedroutes.go | 71 - .../method_getvpnclientconnectionhealth.go | 71 - .../method_getvpnclientipsecparameters.go | 70 - .../method_getvpnprofilepackageurl.go | 71 - .../virtualnetworkgateways/method_list.go | 92 - .../method_listconnections.go | 91 - .../virtualnetworkgateways/method_reset.go | 99 - .../method_resetvpnclientsharedkey.go | 70 - .../method_setvpnclientipsecparameters.go | 75 - .../method_startpacketcapture.go | 75 - .../method_stoppacketcapture.go | 75 - .../method_supportedvpndevices.go | 55 - .../method_updatetags.go | 75 - ...ualnetworkgatewaynatrulescreateorupdate.go | 75 - ...hod_virtualnetworkgatewaynatrulesdelete.go | 71 - ...method_virtualnetworkgatewaynatrulesget.go | 54 - ...ewaynatruleslistbyvirtualnetworkgateway.go | 91 - .../method_vpndeviceconfigurationscript.go | 59 - .../model_addressspace.go | 8 - .../model_bgppeerstatus.go | 15 - .../model_bgppeerstatuslistresult.go | 8 - .../model_bgpsettings.go | 11 - ...atewaycustombgpipaddressipconfiguration.go | 9 - .../model_gatewayroute.go | 14 - .../model_gatewayroutelistresult.go | 8 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_ipsecpolicy.go | 15 - .../model_p2svpnconnectionrequest.go | 8 - .../model_radiusserver.go | 10 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../model_tunnelconnectionhealth.go | 12 - ...irtualnetworkconnectiongatewayreference.go | 8 - .../model_virtualnetworkgateway.go | 19 - ...el_virtualnetworkgatewayautoscalebounds.go | 9 - ...ualnetworkgatewayautoscaleconfiguration.go | 8 - ...rtualnetworkgatewayconnectionlistentity.go | 14 - ...wayconnectionlistentitypropertiesformat.go | 30 - ...el_virtualnetworkgatewayipconfiguration.go | 11 - ...kgatewayipconfigurationpropertiesformat.go | 12 - .../model_virtualnetworkgatewaynatrule.go | 12 - ..._virtualnetworkgatewaynatruleproperties.go | 13 - .../model_virtualnetworkgatewaypolicygroup.go | 11 - ..._virtualnetworkgatewaypolicygroupmember.go | 10 - ...tualnetworkgatewaypolicygroupproperties.go | 12 - ...l_virtualnetworkgatewaypropertiesformat.go | 32 - .../model_virtualnetworkgatewaysku.go | 10 - .../model_vngclientconnectionconfiguration.go | 11 - ...clientconnectionconfigurationproperties.go | 10 - .../model_vpnclientconfiguration.go | 20 - .../model_vpnclientconnectionhealthdetail.go | 19 - ...nclientconnectionhealthdetaillistresult.go | 8 - .../model_vpnclientipsecparameters.go | 15 - .../model_vpnclientparameters.go | 11 - .../model_vpnclientrevokedcertificate.go | 11 - ...lientrevokedcertificatepropertiesformat.go | 9 - .../model_vpnclientrootcertificate.go | 11 - ...pnclientrootcertificatepropertiesformat.go | 9 - .../model_vpndevicescriptparameters.go | 10 - .../model_vpnnatrulemapping.go | 9 - .../model_vpnpacketcapturestartparameters.go | 8 - .../model_vpnpacketcapturestopparameters.go | 8 - .../virtualnetworkgateways/predicates.go | 98 - .../virtualnetworkgateways/version.go | 12 - .../virtualnetworkpeerings/README.md | 83 - .../virtualnetworkpeerings/client.go | 26 - .../virtualnetworkpeerings/constants.go | 227 -- .../id_virtualnetworkpeering.go | 139 - .../id_virtualnetworkpeering_test.go | 327 -- .../method_createorupdate.go | 103 - .../virtualnetworkpeerings/method_delete.go | 71 - .../virtualnetworkpeerings/method_get.go | 54 - .../virtualnetworkpeerings/method_list.go | 92 - .../model_addressspace.go | 8 - .../model_subresource.go | 8 - .../model_virtualnetworkbgpcommunities.go | 9 - .../model_virtualnetworkencryption.go | 9 - .../model_virtualnetworkpeering.go | 12 - ...l_virtualnetworkpeeringpropertiesformat.go | 21 - .../virtualnetworkpeerings/predicates.go | 32 - .../virtualnetworkpeerings/version.go | 12 - .../2023-06-01/virtualnetworks/README.md | 239 -- .../2023-06-01/virtualnetworks/client.go | 26 - .../2023-06-01/virtualnetworks/constants.go | 1324 -------- .../virtualnetworks/method_createorupdate.go | 76 - .../virtualnetworks/method_delete.go | 72 - .../2023-06-01/virtualnetworks/method_get.go | 84 - .../2023-06-01/virtualnetworks/method_list.go | 92 - .../virtualnetworks/method_listall.go | 92 - .../method_resourcenavigationlinkslist.go | 92 - .../method_serviceassociationlinkslist.go | 92 - .../method_subnetspreparenetworkpolicies.go | 75 - .../method_subnetsunpreparenetworkpolicies.go | 75 - .../virtualnetworks/method_updatetags.go | 59 - ...rtualnetworkscheckipaddressavailability.go | 84 - ...virtualnetworkslistddosprotectionstatus.go | 109 - .../method_virtualnetworkslistusage.go | 92 - .../virtualnetworks/model_addressspace.go | 8 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualnetworks/model_ddossettings.go | 9 - .../virtualnetworks/model_delegation.go | 12 - .../virtualnetworks/model_dhcpoptions.go | 8 - .../virtualnetworks/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../virtualnetworks/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipaddressavailabilityresult.go | 10 - .../virtualnetworks/model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../2023-06-01/virtualnetworks/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualnetworks/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualnetworks/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkintentpolicy.go | 13 - .../model_networkintentpolicyconfiguration.go | 9 - .../virtualnetworks/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_preparenetworkpoliciesrequest.go | 9 - .../virtualnetworks/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../virtualnetworks/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - ...odel_publicipddosprotectionstatusresult.go | 11 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualnetworks/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-06-01/virtualnetworks/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../virtualnetworks/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualnetworks/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualnetworks/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualnetworks/model_subresource.go | 8 - .../virtualnetworks/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_unpreparenetworkpoliciesrequest.go | 8 - .../virtualnetworks/model_virtualnetwork.go | 19 - .../model_virtualnetworkbgpcommunities.go | 9 - .../model_virtualnetworkencryption.go | 9 - .../model_virtualnetworkpeering.go | 12 - ...l_virtualnetworkpeeringpropertiesformat.go | 21 - .../model_virtualnetworkpropertiesformat.go | 21 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../model_virtualnetworkusage.go | 12 - .../model_virtualnetworkusagename.go | 9 - .../2023-06-01/virtualnetworks/predicates.go | 144 - .../2023-06-01/virtualnetworks/version.go | 12 - .../2023-06-01/virtualnetworktap/README.md | 86 - .../2023-06-01/virtualnetworktap/client.go | 26 - .../2023-06-01/virtualnetworktap/constants.go | 1151 ------- .../virtualnetworktap/id_virtualnetworktap.go | 130 - .../id_virtualnetworktap_test.go | 282 -- .../method_createorupdate.go | 75 - .../virtualnetworktap/method_delete.go | 71 - .../virtualnetworktap/method_get.go | 54 - .../virtualnetworktap/method_updatetags.go | 58 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualnetworktap/model_ddossettings.go | 9 - .../virtualnetworktap/model_delegation.go | 12 - .../virtualnetworktap/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../virtualnetworktap/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../virtualnetworktap/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualnetworktap/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualnetworktap/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualnetworktap/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../virtualnetworktap/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../virtualnetworktap/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualnetworktap/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualnetworktap/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualnetworktap/model_subresource.go | 8 - .../virtualnetworktap/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../2023-06-01/virtualnetworktap/version.go | 12 - .../2023-06-01/virtualnetworktaps/README.md | 55 - .../2023-06-01/virtualnetworktaps/client.go | 26 - .../virtualnetworktaps/constants.go | 1151 ------- .../virtualnetworktaps/method_listall.go | 92 - .../method_listbyresourcegroup.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualnetworktaps/model_ddossettings.go | 9 - .../virtualnetworktaps/model_delegation.go | 12 - .../virtualnetworktaps/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../virtualnetworktaps/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualnetworktaps/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualnetworktaps/model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualnetworktaps/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../virtualnetworktaps/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../virtualnetworktaps/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualnetworktaps/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualnetworktaps/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualnetworktaps/model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../virtualnetworktaps/predicates.go | 37 - .../2023-06-01/virtualnetworktaps/version.go | 12 - .../virtualrouterpeerings/README.md | 83 - .../virtualrouterpeerings/client.go | 26 - .../virtualrouterpeerings/constants.go | 57 - .../virtualrouterpeerings/id_virtualrouter.go | 130 - .../id_virtualrouter_test.go | 282 -- .../method_createorupdate.go | 76 - .../virtualrouterpeerings/method_delete.go | 72 - .../virtualrouterpeerings/method_get.go | 55 - .../virtualrouterpeerings/method_list.go | 91 - .../model_virtualrouterpeering.go | 12 - .../model_virtualrouterpeeringproperties.go | 10 - .../virtualrouterpeerings/predicates.go | 32 - .../virtualrouterpeerings/version.go | 12 - .../2023-06-01/virtualrouters/README.md | 100 - .../2023-06-01/virtualrouters/client.go | 26 - .../2023-06-01/virtualrouters/constants.go | 57 - .../virtualrouters/id_virtualrouter.go | 130 - .../virtualrouters/id_virtualrouter_test.go | 282 -- .../virtualrouters/method_createorupdate.go | 75 - .../virtualrouters/method_delete.go | 71 - .../2023-06-01/virtualrouters/method_get.go | 83 - .../2023-06-01/virtualrouters/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../virtualrouters/model_subresource.go | 8 - .../virtualrouters/model_virtualrouter.go | 14 - .../model_virtualrouterpropertiesformat.go | 13 - .../2023-06-01/virtualrouters/predicates.go | 37 - .../2023-06-01/virtualrouters/version.go | 12 - .../network/2023-06-01/virtualwans/README.md | 1468 --------- .../network/2023-06-01/virtualwans/client.go | 26 - .../2023-06-01/virtualwans/constants.go | 2335 -------------- .../id_configurationpolicygroup.go | 139 - .../id_configurationpolicygroup_test.go | 327 -- .../virtualwans/id_hubroutetable.go | 139 - .../virtualwans/id_hubroutetable_test.go | 327 -- .../id_hubvirtualnetworkconnection.go | 139 - .../id_hubvirtualnetworkconnection_test.go | 327 -- .../2023-06-01/virtualwans/id_natrule.go | 139 - .../2023-06-01/virtualwans/id_natrule_test.go | 327 -- .../virtualwans/id_networkvirtualappliance.go | 130 - .../id_networkvirtualappliance_test.go | 282 -- .../id_networkvirtualapplianceconnection.go | 139 - ..._networkvirtualapplianceconnection_test.go | 327 -- .../2023-06-01/virtualwans/id_routemap.go | 139 - .../virtualwans/id_routemap_test.go | 327 -- .../virtualwans/id_routingintent.go | 139 - .../virtualwans/id_routingintent_test.go | 327 -- .../2023-06-01/virtualwans/id_virtualhub.go | 130 - .../virtualwans/id_virtualhub_test.go | 282 -- .../virtualwans/id_virtualhubroutetable.go | 139 - .../id_virtualhubroutetable_test.go | 327 -- .../2023-06-01/virtualwans/id_virtualwan.go | 130 - .../virtualwans/id_virtualwan_test.go | 282 -- .../2023-06-01/virtualwans/id_vpngateway.go | 130 - .../virtualwans/id_vpngateway_test.go | 282 -- .../virtualwans/id_vpnlinkconnection.go | 148 - .../virtualwans/id_vpnlinkconnection_test.go | 372 --- .../virtualwans/id_vpnserverconfiguration.go | 130 - .../id_vpnserverconfiguration_test.go | 282 -- .../2023-06-01/virtualwans/id_vpnsite.go | 130 - .../2023-06-01/virtualwans/id_vpnsite_test.go | 282 -- .../2023-06-01/virtualwans/id_vpnsitelink.go | 139 - .../virtualwans/id_vpnsitelink_test.go | 327 -- ...configurationpolicygroupscreateorupdate.go | 75 - .../method_configurationpolicygroupsdelete.go | 71 - .../method_configurationpolicygroupsget.go | 54 - ...olicygroupslistbyvpnserverconfiguration.go | 91 - ...tualwanvpnserverconfigurationvpnprofile.go | 75 - .../method_hubroutetablescreateorupdate.go | 75 - .../method_hubroutetablesdelete.go | 71 - .../virtualwans/method_hubroutetablesget.go | 54 - .../virtualwans/method_hubroutetableslist.go | 91 - ...virtualnetworkconnectionscreateorupdate.go | 75 - ...thod_hubvirtualnetworkconnectionsdelete.go | 71 - .../method_hubvirtualnetworkconnectionsget.go | 54 - ...method_hubvirtualnetworkconnectionslist.go | 91 - .../method_natrulescreateorupdate.go | 75 - .../virtualwans/method_natrulesdelete.go | 71 - .../virtualwans/method_natrulesget.go | 54 - .../method_natruleslistbyvpngateway.go | 91 - ...rtualapplianceconnectionscreateorupdate.go | 75 - ...etworkvirtualapplianceconnectionsdelete.go | 71 - ...d_networkvirtualapplianceconnectionsget.go | 54 - ..._networkvirtualapplianceconnectionslist.go | 91 - .../method_p2svpngatewayscreateorupdate.go | 76 - .../method_p2svpngatewaysdelete.go | 72 - .../virtualwans/method_p2svpngatewaysget.go | 55 - .../virtualwans/method_p2svpngatewayslist.go | 92 - ...ethod_p2svpngatewayslistbyresourcegroup.go | 92 - .../method_routemapscreateorupdate.go | 75 - .../virtualwans/method_routemapsdelete.go | 71 - .../virtualwans/method_routemapsget.go | 54 - .../virtualwans/method_routemapslist.go | 91 - .../method_routingintentcreateorupdate.go | 75 - .../virtualwans/method_routingintentdelete.go | 71 - .../virtualwans/method_routingintentget.go | 54 - .../virtualwans/method_routingintentlist.go | 91 - .../method_supportedsecurityproviders.go | 55 - .../virtualwans/method_updatetags.go | 58 - ...d_virtualhubbgpconnectioncreateorupdate.go | 76 - .../method_virtualhubbgpconnectiondelete.go | 72 - .../method_virtualhubbgpconnectionget.go | 55 - .../method_virtualhubbgpconnectionslist.go | 91 - ...alhubbgpconnectionslistadvertisedroutes.go | 72 - ...rtualhubbgpconnectionslistlearnedroutes.go | 72 - ...virtualhubipconfigurationcreateorupdate.go | 76 - .../method_virtualhubipconfigurationdelete.go | 72 - .../method_virtualhubipconfigurationget.go | 55 - .../method_virtualhubipconfigurationlist.go | 91 - ...d_virtualhubroutetablev2screateorupdate.go | 75 - .../method_virtualhubroutetablev2sdelete.go | 71 - .../method_virtualhubroutetablev2sget.go | 54 - .../method_virtualhubroutetablev2slist.go | 91 - .../method_virtualhubscreateorupdate.go | 75 - .../virtualwans/method_virtualhubsdelete.go | 71 - .../virtualwans/method_virtualhubsget.go | 54 - ...virtualhubsgeteffectivevirtualhubroutes.go | 75 - .../method_virtualhubsgetinboundroutes.go | 75 - .../method_virtualhubsgetoutboundroutes.go | 75 - .../virtualwans/method_virtualhubslist.go | 92 - .../method_virtualhubslistbyresourcegroup.go | 92 - .../method_virtualhubsupdatetags.go | 58 - .../method_virtualwanscreateorupdate.go | 75 - .../virtualwans/method_virtualwansdelete.go | 71 - .../virtualwans/method_virtualwansget.go | 54 - .../virtualwans/method_virtualwanslist.go | 92 - .../method_virtualwanslistbyresourcegroup.go | 92 - .../method_vpnconnectionscreateorupdate.go | 76 - .../method_vpnconnectionsdelete.go | 72 - .../virtualwans/method_vpnconnectionsget.go | 55 - .../method_vpnconnectionslistbyvpngateway.go | 91 - ...method_vpnconnectionsstartpacketcapture.go | 76 - .../method_vpnconnectionsstoppacketcapture.go | 76 - .../method_vpngatewayscreateorupdate.go | 75 - .../virtualwans/method_vpngatewaysdelete.go | 71 - .../virtualwans/method_vpngatewaysget.go | 54 - .../virtualwans/method_vpngatewayslist.go | 92 - .../method_vpngatewayslistbyresourcegroup.go | 92 - .../method_vpnlinkconnectionsgetikesas.go | 71 - ...d_vpnlinkconnectionslistbyvpnconnection.go | 92 - ...figurationsassociatedwithvirtualwanlist.go | 71 - ...d_vpnserverconfigurationscreateorupdate.go | 75 - .../method_vpnserverconfigurationsdelete.go | 71 - .../method_vpnserverconfigurationsget.go | 54 - .../method_vpnserverconfigurationslist.go | 92 - ...serverconfigurationslistbyresourcegroup.go | 92 - .../method_vpnsitelinkconnectionsget.go | 54 - .../virtualwans/method_vpnsitelinksget.go | 54 - .../method_vpnsitelinkslistbyvpnsite.go | 91 - .../method_vpnsitesconfigurationdownload.go | 74 - .../method_vpnsitescreateorupdate.go | 75 - .../virtualwans/method_vpnsitesdelete.go | 71 - .../virtualwans/method_vpnsitesget.go | 54 - .../virtualwans/method_vpnsiteslist.go | 92 - .../method_vpnsiteslistbyresourcegroup.go | 92 - .../model_aadauthenticationparameters.go | 10 - .../2023-06-01/virtualwans/model_action.go | 9 - .../virtualwans/model_addressspace.go | 8 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../virtualwans/model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../virtualwans/model_bgpconnection.go | 12 - .../model_bgpconnectionproperties.go | 12 - .../virtualwans/model_bgpsettings.go | 11 - .../2023-06-01/virtualwans/model_criterion.go | 11 - .../model_customdnsconfigpropertiesformat.go | 9 - .../virtualwans/model_ddossettings.go | 9 - .../virtualwans/model_delegation.go | 12 - .../virtualwans/model_deviceproperties.go | 10 - .../model_effectiveroutemaproute.go | 10 - .../model_effectiveroutemaproutelist.go | 8 - .../model_effectiveroutesparameters.go | 9 - .../2023-06-01/virtualwans/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...atewaycustombgpipaddressipconfiguration.go | 9 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_getinboundroutesparameters.go | 9 - .../model_getoutboundroutesparameters.go | 9 - .../model_getvpnsitesconfigurationrequest.go | 9 - .../virtualwans/model_hubipconfiguration.go | 12 - ...odel_hubipconfigurationpropertiesformat.go | 12 - .../2023-06-01/virtualwans/model_hubroute.go | 12 - .../virtualwans/model_hubroutetable.go | 12 - .../model_hubroutetableproperties.go | 12 - .../model_hubvirtualnetworkconnection.go | 11 - ...l_hubvirtualnetworkconnectionproperties.go | 13 - .../virtualwans/model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../virtualwans/model_ipconfiguration.go | 11 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../virtualwans/model_ipsecpolicy.go | 15 - .../2023-06-01/virtualwans/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../virtualwans/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../virtualwans/model_natgatewaysku.go | 8 - .../virtualwans/model_natruleportmapping.go | 10 - .../virtualwans/model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../virtualwans/model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - ...model_networkvirtualapplianceconnection.go | 10 - ...orkvirtualapplianceconnectionproperties.go | 14 - .../model_o365breakoutcategorypolicies.go | 10 - .../virtualwans/model_o365policyproperties.go | 8 - .../model_p2sconnectionconfiguration.go | 11 - ...el_p2sconnectionconfigurationproperties.go | 13 - .../virtualwans/model_p2svpngateway.go | 14 - .../model_p2svpngatewayproperties.go | 15 - .../2023-06-01/virtualwans/model_parameter.go | 10 - .../2023-06-01/virtualwans/model_peerroute.go | 14 - .../virtualwans/model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../virtualwans/model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../virtualwans/model_propagatedroutetable.go | 9 - .../virtualwans/model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../virtualwans/model_publicipaddresssku.go | 9 - .../virtualwans/model_radiusserver.go | 10 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../virtualwans/model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../2023-06-01/virtualwans/model_route.go | 12 - .../2023-06-01/virtualwans/model_routemap.go | 12 - .../virtualwans/model_routemapproperties.go | 11 - .../virtualwans/model_routemaprule.go | 11 - .../model_routepropertiesformat.go | 12 - .../virtualwans/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../virtualwans/model_routingconfiguration.go | 12 - .../virtualwans/model_routingintent.go | 12 - .../model_routingintentproperties.go | 9 - .../virtualwans/model_routingpolicy.go | 10 - .../virtualwans/model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../virtualwans/model_staticroute.go | 10 - .../virtualwans/model_staticroutesconfig.go | 9 - .../2023-06-01/virtualwans/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../virtualwans/model_subresource.go | 8 - .../virtualwans/model_tagsobject.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../virtualwans/model_virtualhub.go | 15 - .../model_virtualhubeffectiveroute.go | 12 - .../model_virtualhubeffectiveroutelist.go | 8 - .../virtualwans/model_virtualhubproperties.go | 29 - .../virtualwans/model_virtualhubroute.go | 9 - .../virtualwans/model_virtualhubroutetable.go | 8 - .../model_virtualhubroutetablev2.go | 11 - .../model_virtualhubroutetablev2properties.go | 10 - .../virtualwans/model_virtualhubroutev2.go | 11 - .../virtualwans/model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - ...del_virtualrouterautoscaleconfiguration.go | 8 - .../virtualwans/model_virtualwan.go | 14 - .../virtualwans/model_virtualwanproperties.go | 15 - .../model_virtualwansecurityprovider.go | 10 - .../model_virtualwansecurityproviders.go | 8 - .../model_virtualwanvpnprofileparameters.go | 9 - .../2023-06-01/virtualwans/model_vnetroute.go | 10 - .../model_vpnclientconnectionhealth.go | 11 - .../virtualwans/model_vpnconnection.go | 11 - ...nconnectionpacketcapturestartparameters.go | 9 - ...pnconnectionpacketcapturestopparameters.go | 9 - .../model_vpnconnectionproperties.go | 26 - .../virtualwans/model_vpngateway.go | 14 - .../model_vpngatewayipconfiguration.go | 10 - .../virtualwans/model_vpngatewaynatrule.go | 12 - .../model_vpngatewaynatruleproperties.go | 15 - .../virtualwans/model_vpngatewayproperties.go | 16 - .../virtualwans/model_vpnlinkbgpsettings.go | 9 - .../model_vpnlinkproviderproperties.go | 9 - .../virtualwans/model_vpnnatrulemapping.go | 9 - .../virtualwans/model_vpnprofileresponse.go | 8 - ...serverconfigradiusclientrootcertificate.go | 9 - ...serverconfigradiusserverrootcertificate.go | 9 - .../model_vpnserverconfiguration.go | 14 - ...model_vpnserverconfigurationpolicygroup.go | 12 - ...vpnserverconfigurationpolicygroupmember.go | 10 - ...erverconfigurationpolicygroupproperties.go | 12 - .../model_vpnserverconfigurationproperties.go | 23 - .../model_vpnserverconfigurationsresponse.go | 8 - ...serverconfigvpnclientrevokedcertificate.go | 9 - ...vpnserverconfigvpnclientrootcertificate.go | 9 - .../2023-06-01/virtualwans/model_vpnsite.go | 14 - .../virtualwans/model_vpnsitelink.go | 12 - .../model_vpnsitelinkconnection.go | 12 - .../model_vpnsitelinkconnectionproperties.go | 25 - .../model_vpnsitelinkproperties.go | 12 - .../virtualwans/model_vpnsiteproperties.go | 17 - .../2023-06-01/virtualwans/predicates.go | 546 ---- .../network/2023-06-01/virtualwans/version.go | 12 - .../vmsspublicipaddresses/README.md | 71 - .../vmsspublicipaddresses/client.go | 26 - .../vmsspublicipaddresses/constants.go | 1151 ------- .../id_virtualmachinescaleset.go | 130 - .../id_virtualmachinescaleset_test.go | 282 -- ...etvirtualmachinescalesetpublicipaddress.go | 84 - ...virtualmachinescalesetpublicipaddresses.go | 91 - ...rtualmachinescalesetvmpublicipaddresses.go | 92 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../vmsspublicipaddresses/model_delegation.go | 12 - .../vmsspublicipaddresses/model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../vmsspublicipaddresses/model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../vmsspublicipaddresses/model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../vmsspublicipaddresses/model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../vmsspublicipaddresses/model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../vmsspublicipaddresses/model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../vmsspublicipaddresses/predicates.go | 37 - .../vmsspublicipaddresses/version.go | 12 - .../network/2023-06-01/vpngateways/README.md | 83 - .../network/2023-06-01/vpngateways/client.go | 26 - .../2023-06-01/vpngateways/constants.go | 657 ---- .../2023-06-01/vpngateways/id_vpngateway.go | 130 - .../vpngateways/id_vpngateway_test.go | 282 -- .../2023-06-01/vpngateways/method_reset.go | 99 - .../vpngateways/method_startpacketcapture.go | 75 - .../vpngateways/method_stoppacketcapture.go | 75 - .../vpngateways/method_updatetags.go | 75 - .../vpngateways/model_bgpsettings.go | 11 - ...atewaycustombgpipaddressipconfiguration.go | 9 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../vpngateways/model_ipsecpolicy.go | 15 - .../vpngateways/model_propagatedroutetable.go | 9 - .../vpngateways/model_routingconfiguration.go | 12 - .../vpngateways/model_staticroute.go | 10 - .../vpngateways/model_staticroutesconfig.go | 9 - .../vpngateways/model_subresource.go | 8 - .../vpngateways/model_tagsobject.go | 8 - .../model_trafficselectorpolicy.go | 9 - .../2023-06-01/vpngateways/model_vnetroute.go | 10 - .../vpngateways/model_vpnconnection.go | 11 - .../model_vpnconnectionproperties.go | 26 - .../vpngateways/model_vpngateway.go | 14 - .../model_vpngatewayipconfiguration.go | 10 - .../vpngateways/model_vpngatewaynatrule.go | 12 - .../model_vpngatewaynatruleproperties.go | 15 - ..._vpngatewaypacketcapturestartparameters.go | 8 - ...l_vpngatewaypacketcapturestopparameters.go | 8 - .../vpngateways/model_vpngatewayproperties.go | 16 - .../vpngateways/model_vpnnatrulemapping.go | 9 - .../model_vpnsitelinkconnection.go | 12 - .../model_vpnsitelinkconnectionproperties.go | 25 - .../network/2023-06-01/vpngateways/version.go | 12 - .../2023-06-01/vpnlinkconnections/client.go | 26 - .../id_vpnlinkconnection.go | 148 - .../id_vpnlinkconnection_test.go | 372 --- .../method_resetconnection.go | 69 - .../2023-06-01/vpnlinkconnections/version.go | 12 - .../vpnserverconfigurations/README.md | 41 - .../vpnserverconfigurations/client.go | 26 - .../vpnserverconfigurations/constants.go | 572 ---- .../id_vpnserverconfiguration.go | 130 - .../id_vpnserverconfiguration_test.go | 282 -- .../method_updatetags.go | 58 - .../model_aadauthenticationparameters.go | 10 - .../model_addressspace.go | 8 - .../model_ipsecpolicy.go | 15 - .../model_p2sconnectionconfiguration.go | 11 - ...el_p2sconnectionconfigurationproperties.go | 13 - .../model_p2svpngateway.go | 14 - .../model_p2svpngatewayproperties.go | 15 - .../model_propagatedroutetable.go | 9 - .../model_radiusserver.go | 10 - .../model_routingconfiguration.go | 12 - .../model_staticroute.go | 10 - .../model_staticroutesconfig.go | 9 - .../model_subresource.go | 8 - .../model_tagsobject.go | 8 - .../model_vnetroute.go | 10 - .../model_vpnclientconnectionhealth.go | 11 - ...serverconfigradiusclientrootcertificate.go | 9 - ...serverconfigradiusserverrootcertificate.go | 9 - .../model_vpnserverconfiguration.go | 14 - ...model_vpnserverconfigurationpolicygroup.go | 12 - ...vpnserverconfigurationpolicygroupmember.go | 10 - ...erverconfigurationpolicygroupproperties.go | 12 - .../model_vpnserverconfigurationproperties.go | 23 - ...serverconfigvpnclientrevokedcertificate.go | 9 - ...vpnserverconfigvpnclientrootcertificate.go | 9 - .../vpnserverconfigurations/version.go | 12 - .../network/2023-06-01/vpnsites/README.md | 41 - .../network/2023-06-01/vpnsites/client.go | 26 - .../network/2023-06-01/vpnsites/constants.go | 57 - .../network/2023-06-01/vpnsites/id_vpnsite.go | 130 - .../2023-06-01/vpnsites/id_vpnsite_test.go | 282 -- .../2023-06-01/vpnsites/method_updatetags.go | 58 - .../2023-06-01/vpnsites/model_addressspace.go | 8 - .../2023-06-01/vpnsites/model_bgpsettings.go | 11 - .../vpnsites/model_deviceproperties.go | 10 - .../model_ipconfigurationbgppeeringaddress.go | 11 - .../model_o365breakoutcategorypolicies.go | 10 - .../vpnsites/model_o365policyproperties.go | 8 - .../2023-06-01/vpnsites/model_subresource.go | 8 - .../2023-06-01/vpnsites/model_tagsobject.go | 8 - .../vpnsites/model_vpnlinkbgpsettings.go | 9 - .../model_vpnlinkproviderproperties.go | 9 - .../2023-06-01/vpnsites/model_vpnsite.go | 14 - .../2023-06-01/vpnsites/model_vpnsitelink.go | 12 - .../vpnsites/model_vpnsitelinkproperties.go | 12 - .../vpnsites/model_vpnsiteproperties.go | 17 - .../network/2023-06-01/vpnsites/version.go | 12 - .../webapplicationfirewallpolicies/README.md | 104 - .../webapplicationfirewallpolicies/client.go | 26 - .../constants.go | 2848 ----------------- ...tiongatewaywebapplicationfirewallpolicy.go | 130 - ...atewaywebapplicationfirewallpolicy_test.go | 282 -- .../method_createorupdate.go | 59 - .../method_delete.go | 71 - .../method_get.go | 54 - .../method_list.go | 92 - .../method_listall.go | 92 - .../model_applicationgateway.go | 21 - ...icationgatewayauthenticationcertificate.go | 12 - ...thenticationcertificatepropertiesformat.go | 9 - ...pplicationgatewayautoscaleconfiguration.go | 9 - .../model_applicationgatewaybackendaddress.go | 9 - ...el_applicationgatewaybackendaddresspool.go | 12 - ...tewaybackendaddresspoolpropertiesformat.go | 10 - ...l_applicationgatewaybackendhttpsettings.go | 12 - ...ewaybackendhttpsettingspropertiesformat.go | 21 - ...model_applicationgatewaybackendsettings.go | 12 - ...ngatewaybackendsettingspropertiesformat.go | 15 - ...plicationgatewayclientauthconfiguration.go | 9 - ...el_applicationgatewayconnectiondraining.go | 9 - .../model_applicationgatewaycustomerror.go | 9 - ...icationgatewayfirewalldisabledrulegroup.go | 9 - ...del_applicationgatewayfirewallexclusion.go | 10 - ...plicationgatewayfrontendipconfiguration.go | 12 - ...frontendipconfigurationpropertiesformat.go | 13 - .../model_applicationgatewayfrontendport.go | 12 - ...tiongatewayfrontendportpropertiesformat.go | 9 - ...l_applicationgatewayglobalconfiguration.go | 9 - ...l_applicationgatewayheaderconfiguration.go | 9 - .../model_applicationgatewayhttplistener.go | 12 - ...tiongatewayhttplistenerpropertiesformat.go | 18 - ...model_applicationgatewayipconfiguration.go | 12 - ...ngatewayipconfigurationpropertiesformat.go | 9 - .../model_applicationgatewaylistener.go | 12 - ...licationgatewaylistenerpropertiesformat.go | 14 - ...pplicationgatewayloaddistributionpolicy.go | 12 - ...yloaddistributionpolicypropertiesformat.go | 10 - ...pplicationgatewayloaddistributiontarget.go | 12 - ...yloaddistributiontargetpropertiesformat.go | 9 - .../model_applicationgatewaypathrule.go | 12 - ...licationgatewaypathrulepropertiesformat.go | 15 - ...icationgatewayprivateendpointconnection.go | 12 - ...ewayprivateendpointconnectionproperties.go | 11 - ...licationgatewayprivatelinkconfiguration.go | 12 - ...tewayprivatelinkconfigurationproperties.go | 9 - ...cationgatewayprivatelinkipconfiguration.go | 12 - ...wayprivatelinkipconfigurationproperties.go | 12 - .../model_applicationgatewayprobe.go | 12 - ...licationgatewayprobehealthresponsematch.go | 9 - ...applicationgatewayprobepropertiesformat.go | 19 - ...odel_applicationgatewaypropertiesformat.go | 43 - ...applicationgatewayredirectconfiguration.go | 12 - ...ayredirectconfigurationpropertiesformat.go | 15 - ...el_applicationgatewayrequestroutingrule.go | 12 - ...tewayrequestroutingrulepropertiesformat.go | 17 - .../model_applicationgatewayrewriterule.go | 11 - ..._applicationgatewayrewriteruleactionset.go | 10 - ..._applicationgatewayrewriterulecondition.go | 11 - .../model_applicationgatewayrewriteruleset.go | 11 - ...ongatewayrewriterulesetpropertiesformat.go | 9 - .../model_applicationgatewayroutingrule.go | 12 - ...ationgatewayroutingrulepropertiesformat.go | 13 - .../model_applicationgatewaysku.go | 10 - .../model_applicationgatewaysslcertificate.go | 12 - ...ongatewaysslcertificatepropertiesformat.go | 12 - .../model_applicationgatewaysslpolicy.go | 12 - .../model_applicationgatewaysslprofile.go | 12 - ...cationgatewaysslprofilepropertiesformat.go | 11 - ...licationgatewaytrustedclientcertificate.go | 12 - ...rustedclientcertificatepropertiesformat.go | 11 - ...pplicationgatewaytrustedrootcertificate.go | 12 - ...ytrustedrootcertificatepropertiesformat.go | 10 - ...odel_applicationgatewayurlconfiguration.go | 10 - .../model_applicationgatewayurlpathmap.go | 12 - ...cationgatewayurlpathmappropertiesformat.go | 14 - ...ewaywebapplicationfirewallconfiguration.go | 17 - .../model_applicationsecuritygroup.go | 14 - ...pplicationsecuritygrouppropertiesformat.go | 9 - .../model_backendaddresspool.go | 12 - ...odel_backendaddresspoolpropertiesformat.go | 19 - .../model_customdnsconfigpropertiesformat.go | 9 - .../model_ddossettings.go | 9 - .../model_delegation.go | 12 - .../model_exclusionmanagedrule.go | 8 - .../model_exclusionmanagedrulegroup.go | 9 - .../model_exclusionmanagedruleset.go | 10 - .../model_flowlog.go | 14 - .../model_flowlogformatparameters.go | 9 - .../model_flowlogpropertiesformat.go | 15 - .../model_frontendipconfiguration.go | 17 - ...frontendipconfigurationpropertiesformat.go | 19 - ...odel_gatewayloadbalancertunnelinterface.go | 11 - .../model_groupbyusersession.go | 8 - .../model_groupbyvariable.go | 8 - .../model_inboundnatrule.go | 12 - .../model_inboundnatrulepropertiesformat.go | 19 - .../model_ipconfiguration.go | 11 - .../model_ipconfigurationprofile.go | 12 - ..._ipconfigurationprofilepropertiesformat.go | 9 - .../model_ipconfigurationpropertiesformat.go | 12 - .../model_iptag.go | 9 - .../model_loadbalancerbackendaddress.go | 9 - ...dbalancerbackendaddresspropertiesformat.go | 14 - .../model_managedrulegroupoverride.go | 9 - .../model_managedruleoverride.go | 10 - .../model_managedrulesdefinition.go | 9 - .../model_managedruleset.go | 10 - .../model_matchcondition.go | 12 - .../model_matchvariable.go | 9 - .../model_natgateway.go | 20 - .../model_natgatewaypropertiesformat.go | 13 - .../model_natgatewaysku.go | 8 - .../model_natruleportmapping.go | 10 - .../model_networkinterface.go | 19 - .../model_networkinterfacednssettings.go | 12 - .../model_networkinterfaceipconfiguration.go | 12 - ...gurationprivatelinkconnectionproperties.go | 10 - ...nterfaceipconfigurationpropertiesformat.go | 21 - .../model_networkinterfacepropertiesformat.go | 29 - .../model_networkinterfacetapconfiguration.go | 12 - ...terfacetapconfigurationpropertiesformat.go | 9 - .../model_networksecuritygroup.go | 14 - ...el_networksecuritygrouppropertiesformat.go | 15 - .../model_owaspcrsexclusionentry.go | 11 - .../model_policysettings.go | 18 - .../model_policysettingslogscrubbing.go | 9 - .../model_privateendpoint.go | 19 - .../model_privateendpointconnection.go | 12 - ...del_privateendpointconnectionproperties.go | 12 - .../model_privateendpointipconfiguration.go | 11 - ...rivateendpointipconfigurationproperties.go | 10 - .../model_privateendpointproperties.go | 16 - .../model_privatelinkservice.go | 19 - .../model_privatelinkserviceconnection.go | 12 - ..._privatelinkserviceconnectionproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - ...model_privatelinkserviceipconfiguration.go | 12 - ...atelinkserviceipconfigurationproperties.go | 13 - .../model_privatelinkserviceproperties.go | 17 - .../model_publicipaddress.go | 22 - .../model_publicipaddressdnssettings.go | 11 - .../model_publicipaddresspropertiesformat.go | 23 - .../model_publicipaddresssku.go | 9 - .../model_resourcenavigationlink.go | 12 - .../model_resourcenavigationlinkformat.go | 10 - .../model_resourceset.go | 8 - .../model_retentionpolicyparameters.go | 9 - .../model_route.go | 12 - .../model_routepropertiesformat.go | 12 - .../model_routetable.go | 14 - .../model_routetablepropertiesformat.go | 12 - .../model_securityrule.go | 12 - .../model_securityrulepropertiesformat.go | 23 - .../model_serviceassociationlink.go | 12 - ..._serviceassociationlinkpropertiesformat.go | 12 - ...model_servicedelegationpropertiesformat.go | 10 - .../model_serviceendpointpolicy.go | 15 - .../model_serviceendpointpolicydefinition.go | 12 - ...ndpointpolicydefinitionpropertiesformat.go | 11 - ...l_serviceendpointpolicypropertiesformat.go | 13 - .../model_serviceendpointpropertiesformat.go | 10 - .../model_subnet.go | 12 - .../model_subnetpropertiesformat.go | 27 - .../model_subresource.go | 8 - ...trafficanalyticsconfigurationproperties.go | 12 - .../model_trafficanalyticsproperties.go | 8 - .../model_virtualnetworktap.go | 14 - ...model_virtualnetworktappropertiesformat.go | 13 - .../model_webapplicationfirewallcustomrule.go | 17 - .../model_webapplicationfirewallpolicy.go | 14 - ...plicationfirewallpolicypropertiesformat.go | 15 - ...el_webapplicationfirewallscrubbingrules.go | 11 - .../predicates.go | 37 - .../webapplicationfirewallpolicies/version.go | 12 - .../2023-06-01/webcategories/README.md | 54 - .../2023-06-01/webcategories/client.go | 26 - .../webcategories/id_azurewebcategory.go | 121 - .../webcategories/id_azurewebcategory_test.go | 237 -- .../2023-06-01/webcategories/method_get.go | 83 - .../method_listbysubscription.go | 92 - .../webcategories/model_azurewebcategory.go | 12 - .../model_azurewebcategorypropertiesformat.go | 8 - .../2023-06-01/webcategories/predicates.go | 32 - .../2023-06-01/webcategories/version.go | 12 - .../2020-10-05-privatepreview/client.go | 73 - .../configurations/README.md | 87 - .../configurations/client.go | 26 - .../configurations/constants.go | 98 - .../configurations/id_configuration.go | 139 - .../configurations/id_configuration_test.go | 327 -- .../configurations/id_server.go | 139 - .../configurations/id_server_test.go | 327 -- .../configurations/id_servergroupsv2.go | 130 - .../configurations/id_servergroupsv2_test.go | 282 -- .../configurations/method_get.go | 54 - .../configurations/method_listbyserver.go | 91 - .../method_listbyservergroup.go | 91 - .../configurations/method_update.go | 75 - .../model_serverconfiguration.go | 16 - .../model_serverconfigurationproperties.go | 13 - .../model_servergroupconfiguration.go | 16 - ...odel_servergroupconfigurationproperties.go | 11 - .../model_serverrolegroupconfiguration.go | 11 - .../configurations/predicates.go | 50 - .../configurations/version.go | 12 - .../firewallrules/README.md | 81 - .../firewallrules/client.go | 26 - .../firewallrules/id_firewallrule.go | 139 - .../firewallrules/id_firewallrule_test.go | 327 -- .../firewallrules/id_servergroupsv2.go | 130 - .../firewallrules/id_servergroupsv2_test.go | 282 -- .../firewallrules/method_createorupdate.go | 76 - .../firewallrules/method_delete.go | 71 - .../firewallrules/method_get.go | 54 - .../firewallrules/method_listbyservergroup.go | 55 - .../firewallrules/model_firewallrule.go | 16 - .../model_firewallrulelistresult.go | 8 - .../model_firewallruleproperties.go | 9 - .../firewallrules/version.go | 12 - .../2020-10-05-privatepreview/roles/README.md | 65 - .../2020-10-05-privatepreview/roles/client.go | 26 - .../roles/id_role.go | 139 - .../roles/id_role_test.go | 327 -- .../roles/id_servergroupsv2.go | 130 - .../roles/id_servergroupsv2_test.go | 282 -- .../roles/method_create.go | 76 - .../roles/method_delete.go | 71 - .../roles/method_listbyservergroup.go | 55 - .../roles/model_role.go | 16 - .../roles/model_rolelistresult.go | 8 - .../roles/model_roleproperties.go | 8 - .../roles/version.go | 12 - .../servergroupoperations/client.go | 26 - .../id_servergroupsv2.go | 130 - .../id_servergroupsv2_test.go | 282 -- .../method_servergroupsrestart.go | 70 - .../method_servergroupsstart.go | 70 - .../method_servergroupsstop.go | 70 - .../servergroupoperations/version.go | 12 - .../servergroups/README.md | 138 - .../servergroups/client.go | 26 - .../servergroups/constants.go | 371 --- .../servergroups/id_servergroupsv2.go | 130 - .../servergroups/id_servergroupsv2_test.go | 282 -- .../method_checknameavailability.go | 60 - .../servergroups/method_createorupdate.go | 76 - .../servergroups/method_delete.go | 71 - .../servergroups/method_get.go | 54 - .../servergroups/method_list.go | 92 - .../method_listbyresourcegroup.go | 92 - .../servergroups/method_update.go | 75 - .../servergroups/model_maintenancewindow.go | 11 - .../servergroups/model_nameavailability.go | 11 - .../model_nameavailabilityrequest.go | 9 - .../servergroups/model_servergroup.go | 18 - .../model_servergroupforupdate.go | 10 - .../model_servergroupproperties.go | 62 - ...grouppropertiesdelegatedsubnetarguments.go | 8 - .../model_servergrouppropertiesforupdate.go | 16 - ...rgrouppropertiesprivatednszonearguments.go | 8 - .../servergroups/model_servernameitem.go | 9 - .../servergroups/model_serverrolegroup.go | 16 - .../servergroups/predicates.go | 32 - .../servergroups/version.go | 12 - .../servers/README.md | 52 - .../servers/client.go | 26 - .../servers/constants.go | 304 -- .../servers/id_server.go | 139 - .../servers/id_server_test.go | 327 -- .../servers/id_servergroupsv2.go | 130 - .../servers/id_servergroupsv2_test.go | 282 -- .../servers/method_get.go | 54 - .../servers/method_listbyservergroup.go | 55 - .../servers/model_servergroupserver.go | 16 - .../model_servergroupserverlistresult.go | 8 - .../model_servergroupserverproperties.go | 21 - .../servers/version.go | 12 - .../recoveryservices/2023-02-01/client.go | 100 - .../getprivatelinkresources/README.md | 36 - .../getprivatelinkresources/client.go | 26 - .../id_privatelinkresource.go | 139 - .../id_privatelinkresource_test.go | 327 -- .../method_privatelinkresourcesget.go | 54 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../getprivatelinkresources/version.go | 12 - .../listprivatelinkresources/README.md | 37 - .../listprivatelinkresources/client.go | 26 - .../listprivatelinkresources/id_vault.go | 130 - .../listprivatelinkresources/id_vault_test.go | 282 -- .../method_privatelinkresourceslist.go | 91 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../listprivatelinkresources/predicates.go | 27 - .../listprivatelinkresources/version.go | 12 - .../2023-02-01/recoveryservices/README.md | 62 - .../2023-02-01/recoveryservices/client.go | 26 - .../2023-02-01/recoveryservices/constants.go | 54 - .../recoveryservices/id_location.go | 121 - .../recoveryservices/id_location_test.go | 237 -- .../recoveryservices/id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../recoveryservices/method_capabilities.go | 59 - .../method_checknameavailability.go | 59 - .../model_capabilitiesproperties.go | 8 - .../model_capabilitiesresponse.go | 9 - .../model_capabilitiesresponseproperties.go | 8 - .../model_checknameavailabilityparameters.go | 9 - .../model_checknameavailabilityresult.go | 10 - .../recoveryservices/model_dnszone.go | 8 - .../recoveryservices/model_dnszoneresponse.go | 9 - .../model_resourcecapabilities.go | 9 - .../2023-02-01/recoveryservices/version.go | 12 - .../2023-02-01/registeredidentities/client.go | 26 - .../id_registeredidentity.go | 139 - .../id_registeredidentity_test.go | 327 -- .../registeredidentities/method_delete.go | 46 - .../registeredidentities/version.go | 12 - .../2023-02-01/replicationusages/README.md | 36 - .../2023-02-01/replicationusages/client.go | 26 - .../2023-02-01/replicationusages/id_vault.go | 130 - .../replicationusages/id_vault_test.go | 282 -- .../replicationusages/method_list.go | 55 - .../replicationusages/model_jobssummary.go | 10 - .../model_monitoringsummary.go | 13 - .../model_replicationusage.go | 13 - .../model_replicationusagelist.go | 8 - .../2023-02-01/replicationusages/version.go | 12 - .../2023-02-01/vaultcertificates/README.md | 41 - .../2023-02-01/vaultcertificates/client.go | 26 - .../2023-02-01/vaultcertificates/constants.go | 60 - .../vaultcertificates/id_certificate.go | 139 - .../vaultcertificates/id_certificate_test.go | 327 -- .../vaultcertificates/method_create.go | 58 - .../model_certificaterequest.go | 8 - .../model_rawcertificatedata.go | 9 - .../model_resourcecertificateandaaddetails.go | 82 - .../model_resourcecertificateandacsdetails.go | 78 - .../model_resourcecertificatedetails.go | 61 - .../model_vaultcertificateresponse.go | 44 - .../2023-02-01/vaultcertificates/version.go | 12 - .../2023-02-01/vaultextendedinfo/README.md | 78 - .../2023-02-01/vaultextendedinfo/client.go | 26 - .../2023-02-01/vaultextendedinfo/id_vault.go | 130 - .../vaultextendedinfo/id_vault_test.go | 282 -- .../method_createorupdate.go | 59 - .../vaultextendedinfo/method_get.go | 55 - .../vaultextendedinfo/method_update.go | 59 - .../model_vaultextendedinfo.go | 11 - .../model_vaultextendedinforesource.go | 12 - .../2023-02-01/vaultextendedinfo/version.go | 12 - .../2023-02-01/vaults/README.md | 121 - .../2023-02-01/vaults/client.go | 26 - .../2023-02-01/vaults/constants.go | 723 ----- .../2023-02-01/vaults/id_vault.go | 130 - .../2023-02-01/vaults/id_vault_test.go | 282 -- .../vaults/method_createorupdate.go | 75 - .../2023-02-01/vaults/method_delete.go | 46 - .../2023-02-01/vaults/method_get.go | 54 - .../vaults/method_listbyresourcegroup.go | 92 - .../vaults/method_listbysubscriptionid.go | 92 - .../2023-02-01/vaults/method_update.go | 75 - .../vaults/model_azuremonitoralertsettings.go | 8 - .../vaults/model_classicalertsettings.go | 8 - .../2023-02-01/vaults/model_cmkkekidentity.go | 9 - .../vaults/model_cmkkeyvaultproperties.go | 8 - .../model_crosssubscriptionrestoresettings.go | 8 - .../vaults/model_immutabilitysettings.go | 8 - .../vaults/model_monitoringsettings.go | 9 - .../2023-02-01/vaults/model_patchvault.go | 20 - .../vaults/model_privateendpoint.go | 8 - .../vaults/model_privateendpointconnection.go | 11 - ...rivateendpointconnectionvaultproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - .../vaults/model_restoresettings.go | 8 - .../vaults/model_securitysettings.go | 8 - .../2023-02-01/vaults/model_sku.go | 12 - .../2023-02-01/vaults/model_upgradedetails.go | 58 - .../2023-02-01/vaults/model_vault.go | 22 - .../vaults/model_vaultproperties.go | 21 - .../vaults/model_vaultpropertiesencryption.go | 10 - .../model_vaultpropertiesmovedetails.go | 42 - ...model_vaultpropertiesredundancysettings.go | 9 - .../2023-02-01/vaults/predicates.go | 37 - .../2023-02-01/vaults/version.go | 12 - .../2023-02-01/vaultusages/README.md | 36 - .../2023-02-01/vaultusages/client.go | 26 - .../2023-02-01/vaultusages/constants.go | 63 - .../2023-02-01/vaultusages/id_vault.go | 130 - .../2023-02-01/vaultusages/id_vault_test.go | 282 -- .../vaultusages/method_usageslistbyvaults.go | 55 - .../2023-02-01/vaultusages/model_nameinfo.go | 9 - .../vaultusages/model_vaultusage.go | 31 - .../vaultusages/model_vaultusagelist.go | 8 - .../2023-02-01/vaultusages/version.go | 12 - .../recoveryservices/2023-04-01/client.go | 100 - .../getprivatelinkresources/README.md | 36 - .../getprivatelinkresources/client.go | 26 - .../id_privatelinkresource.go | 139 - .../id_privatelinkresource_test.go | 327 -- .../method_privatelinkresourcesget.go | 54 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../getprivatelinkresources/version.go | 12 - .../listprivatelinkresources/README.md | 37 - .../listprivatelinkresources/client.go | 26 - .../listprivatelinkresources/id_vault.go | 130 - .../listprivatelinkresources/id_vault_test.go | 282 -- .../method_privatelinkresourceslist.go | 91 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../listprivatelinkresources/predicates.go | 27 - .../listprivatelinkresources/version.go | 12 - .../2023-04-01/recoveryservices/README.md | 62 - .../2023-04-01/recoveryservices/client.go | 26 - .../2023-04-01/recoveryservices/constants.go | 54 - .../recoveryservices/id_location.go | 121 - .../recoveryservices/id_location_test.go | 237 -- .../recoveryservices/id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../recoveryservices/method_capabilities.go | 59 - .../method_checknameavailability.go | 59 - .../model_capabilitiesproperties.go | 8 - .../model_capabilitiesresponse.go | 9 - .../model_capabilitiesresponseproperties.go | 8 - .../model_checknameavailabilityparameters.go | 9 - .../model_checknameavailabilityresult.go | 10 - .../recoveryservices/model_dnszone.go | 8 - .../recoveryservices/model_dnszoneresponse.go | 9 - .../model_resourcecapabilities.go | 9 - .../2023-04-01/recoveryservices/version.go | 12 - .../2023-04-01/registeredidentities/client.go | 26 - .../id_registeredidentity.go | 139 - .../id_registeredidentity_test.go | 327 -- .../registeredidentities/method_delete.go | 46 - .../registeredidentities/version.go | 12 - .../2023-04-01/replicationusages/README.md | 36 - .../2023-04-01/replicationusages/client.go | 26 - .../2023-04-01/replicationusages/id_vault.go | 130 - .../replicationusages/id_vault_test.go | 282 -- .../replicationusages/method_list.go | 55 - .../replicationusages/model_jobssummary.go | 10 - .../model_monitoringsummary.go | 13 - .../model_replicationusage.go | 13 - .../model_replicationusagelist.go | 8 - .../2023-04-01/replicationusages/version.go | 12 - .../2023-04-01/vaultcertificates/README.md | 41 - .../2023-04-01/vaultcertificates/client.go | 26 - .../2023-04-01/vaultcertificates/constants.go | 60 - .../vaultcertificates/id_certificate.go | 139 - .../vaultcertificates/id_certificate_test.go | 327 -- .../vaultcertificates/method_create.go | 58 - .../model_certificaterequest.go | 8 - .../model_rawcertificatedata.go | 9 - .../model_resourcecertificateandaaddetails.go | 82 - .../model_resourcecertificateandacsdetails.go | 78 - .../model_resourcecertificatedetails.go | 61 - .../model_vaultcertificateresponse.go | 44 - .../2023-04-01/vaultcertificates/version.go | 12 - .../2023-04-01/vaultextendedinfo/README.md | 78 - .../2023-04-01/vaultextendedinfo/client.go | 26 - .../2023-04-01/vaultextendedinfo/id_vault.go | 130 - .../vaultextendedinfo/id_vault_test.go | 282 -- .../method_createorupdate.go | 59 - .../vaultextendedinfo/method_get.go | 55 - .../vaultextendedinfo/method_update.go | 59 - .../model_vaultextendedinfo.go | 11 - .../model_vaultextendedinforesource.go | 12 - .../2023-04-01/vaultextendedinfo/version.go | 12 - .../2023-04-01/vaults/README.md | 121 - .../2023-04-01/vaults/client.go | 26 - .../2023-04-01/vaults/constants.go | 861 ----- .../2023-04-01/vaults/id_vault.go | 130 - .../2023-04-01/vaults/id_vault_test.go | 282 -- .../vaults/method_createorupdate.go | 75 - .../2023-04-01/vaults/method_delete.go | 46 - .../2023-04-01/vaults/method_get.go | 54 - .../vaults/method_listbyresourcegroup.go | 92 - .../vaults/method_listbysubscriptionid.go | 92 - .../2023-04-01/vaults/method_update.go | 75 - .../vaults/model_azuremonitoralertsettings.go | 8 - .../vaults/model_classicalertsettings.go | 8 - .../2023-04-01/vaults/model_cmkkekidentity.go | 9 - .../vaults/model_cmkkeyvaultproperties.go | 8 - .../model_crosssubscriptionrestoresettings.go | 8 - .../vaults/model_immutabilitysettings.go | 8 - .../vaults/model_monitoringsettings.go | 9 - .../2023-04-01/vaults/model_patchvault.go | 20 - .../vaults/model_privateendpoint.go | 8 - .../vaults/model_privateendpointconnection.go | 11 - ...rivateendpointconnectionvaultproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - .../vaults/model_restoresettings.go | 8 - .../vaults/model_securitysettings.go | 10 - .../2023-04-01/vaults/model_sku.go | 12 - .../vaults/model_softdeletesettings.go | 9 - .../2023-04-01/vaults/model_upgradedetails.go | 58 - .../2023-04-01/vaults/model_vault.go | 22 - .../vaults/model_vaultproperties.go | 22 - .../vaults/model_vaultpropertiesencryption.go | 10 - .../model_vaultpropertiesmovedetails.go | 42 - ...model_vaultpropertiesredundancysettings.go | 9 - .../2023-04-01/vaults/predicates.go | 37 - .../2023-04-01/vaults/version.go | 12 - .../2023-04-01/vaultusages/README.md | 36 - .../2023-04-01/vaultusages/client.go | 26 - .../2023-04-01/vaultusages/constants.go | 63 - .../2023-04-01/vaultusages/id_vault.go | 130 - .../2023-04-01/vaultusages/id_vault_test.go | 282 -- .../vaultusages/method_usageslistbyvaults.go | 55 - .../2023-04-01/vaultusages/model_nameinfo.go | 9 - .../vaultusages/model_vaultusage.go | 31 - .../vaultusages/model_vaultusagelist.go | 8 - .../2023-04-01/vaultusages/version.go | 12 - .../recoveryservices/2023-06-01/client.go | 100 - .../getprivatelinkresources/README.md | 36 - .../getprivatelinkresources/client.go | 26 - .../id_privatelinkresource.go | 139 - .../id_privatelinkresource_test.go | 327 -- .../method_privatelinkresourcesget.go | 54 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../getprivatelinkresources/version.go | 12 - .../listprivatelinkresources/README.md | 37 - .../listprivatelinkresources/client.go | 26 - .../listprivatelinkresources/id_vault.go | 130 - .../listprivatelinkresources/id_vault_test.go | 282 -- .../method_privatelinkresourceslist.go | 91 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../listprivatelinkresources/predicates.go | 27 - .../listprivatelinkresources/version.go | 12 - .../2023-06-01/recoveryservices/README.md | 62 - .../2023-06-01/recoveryservices/client.go | 26 - .../2023-06-01/recoveryservices/constants.go | 54 - .../recoveryservices/id_location.go | 121 - .../recoveryservices/id_location_test.go | 237 -- .../recoveryservices/id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../recoveryservices/method_capabilities.go | 59 - .../method_checknameavailability.go | 59 - .../model_capabilitiesproperties.go | 8 - .../model_capabilitiesresponse.go | 9 - .../model_capabilitiesresponseproperties.go | 8 - .../model_checknameavailabilityparameters.go | 9 - .../model_checknameavailabilityresult.go | 10 - .../recoveryservices/model_dnszone.go | 8 - .../recoveryservices/model_dnszoneresponse.go | 9 - .../model_resourcecapabilities.go | 9 - .../2023-06-01/recoveryservices/version.go | 12 - .../2023-06-01/registeredidentities/client.go | 26 - .../id_registeredidentity.go | 139 - .../id_registeredidentity_test.go | 327 -- .../registeredidentities/method_delete.go | 46 - .../registeredidentities/version.go | 12 - .../2023-06-01/replicationusages/README.md | 36 - .../2023-06-01/replicationusages/client.go | 26 - .../2023-06-01/replicationusages/id_vault.go | 130 - .../replicationusages/id_vault_test.go | 282 -- .../replicationusages/method_list.go | 55 - .../replicationusages/model_jobssummary.go | 10 - .../model_monitoringsummary.go | 13 - .../model_replicationusage.go | 13 - .../model_replicationusagelist.go | 8 - .../2023-06-01/replicationusages/version.go | 12 - .../2023-06-01/vaultcertificates/README.md | 41 - .../2023-06-01/vaultcertificates/client.go | 26 - .../2023-06-01/vaultcertificates/constants.go | 60 - .../vaultcertificates/id_certificate.go | 139 - .../vaultcertificates/id_certificate_test.go | 327 -- .../vaultcertificates/method_create.go | 58 - .../model_certificaterequest.go | 8 - .../model_rawcertificatedata.go | 9 - .../model_resourcecertificateandaaddetails.go | 82 - .../model_resourcecertificateandacsdetails.go | 78 - .../model_resourcecertificatedetails.go | 61 - .../model_vaultcertificateresponse.go | 44 - .../2023-06-01/vaultcertificates/version.go | 12 - .../2023-06-01/vaultextendedinfo/README.md | 78 - .../2023-06-01/vaultextendedinfo/client.go | 26 - .../2023-06-01/vaultextendedinfo/id_vault.go | 130 - .../vaultextendedinfo/id_vault_test.go | 282 -- .../method_createorupdate.go | 59 - .../vaultextendedinfo/method_get.go | 55 - .../vaultextendedinfo/method_update.go | 59 - .../model_vaultextendedinfo.go | 11 - .../model_vaultextendedinforesource.go | 12 - .../2023-06-01/vaultextendedinfo/version.go | 12 - .../2023-06-01/vaults/README.md | 121 - .../2023-06-01/vaults/client.go | 26 - .../2023-06-01/vaults/constants.go | 861 ----- .../2023-06-01/vaults/id_vault.go | 130 - .../2023-06-01/vaults/id_vault_test.go | 282 -- .../vaults/method_createorupdate.go | 75 - .../2023-06-01/vaults/method_delete.go | 46 - .../2023-06-01/vaults/method_get.go | 54 - .../vaults/method_listbyresourcegroup.go | 92 - .../vaults/method_listbysubscriptionid.go | 92 - .../2023-06-01/vaults/method_update.go | 75 - .../vaults/model_azuremonitoralertsettings.go | 8 - .../vaults/model_classicalertsettings.go | 8 - .../2023-06-01/vaults/model_cmkkekidentity.go | 9 - .../vaults/model_cmkkeyvaultproperties.go | 8 - .../model_crosssubscriptionrestoresettings.go | 8 - .../vaults/model_immutabilitysettings.go | 8 - .../vaults/model_monitoringsettings.go | 9 - .../2023-06-01/vaults/model_patchvault.go | 20 - .../vaults/model_privateendpoint.go | 8 - .../vaults/model_privateendpointconnection.go | 11 - ...rivateendpointconnectionvaultproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - .../vaults/model_restoresettings.go | 8 - .../vaults/model_securitysettings.go | 10 - .../2023-06-01/vaults/model_sku.go | 12 - .../vaults/model_softdeletesettings.go | 9 - .../2023-06-01/vaults/model_upgradedetails.go | 58 - .../2023-06-01/vaults/model_vault.go | 22 - .../vaults/model_vaultproperties.go | 22 - .../vaults/model_vaultpropertiesencryption.go | 10 - .../model_vaultpropertiesmovedetails.go | 42 - ...model_vaultpropertiesredundancysettings.go | 9 - .../2023-06-01/vaults/predicates.go | 37 - .../2023-06-01/vaults/version.go | 12 - .../2023-06-01/vaultusages/README.md | 36 - .../2023-06-01/vaultusages/client.go | 26 - .../2023-06-01/vaultusages/constants.go | 63 - .../2023-06-01/vaultusages/id_vault.go | 130 - .../2023-06-01/vaultusages/id_vault_test.go | 282 -- .../vaultusages/method_usageslistbyvaults.go | 55 - .../2023-06-01/vaultusages/model_nameinfo.go | 9 - .../vaultusages/model_vaultusage.go | 31 - .../vaultusages/model_vaultusagelist.go | 8 - .../2023-06-01/vaultusages/version.go | 12 - .../recoveryservices/2023-08-01/client.go | 100 - .../getprivatelinkresources/README.md | 36 - .../getprivatelinkresources/client.go | 26 - .../id_privatelinkresource.go | 139 - .../id_privatelinkresource_test.go | 327 -- .../method_privatelinkresourcesget.go | 54 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../getprivatelinkresources/version.go | 12 - .../listprivatelinkresources/README.md | 37 - .../listprivatelinkresources/client.go | 26 - .../listprivatelinkresources/id_vault.go | 130 - .../listprivatelinkresources/id_vault_test.go | 282 -- .../method_privatelinkresourceslist.go | 91 - .../model_privatelinkresource.go | 11 - .../model_privatelinkresourceproperties.go | 10 - .../listprivatelinkresources/predicates.go | 27 - .../listprivatelinkresources/version.go | 12 - .../2023-08-01/recoveryservices/README.md | 62 - .../2023-08-01/recoveryservices/client.go | 26 - .../2023-08-01/recoveryservices/constants.go | 54 - .../recoveryservices/id_location.go | 121 - .../recoveryservices/id_location_test.go | 237 -- .../recoveryservices/id_providerlocation.go | 130 - .../id_providerlocation_test.go | 282 -- .../recoveryservices/method_capabilities.go | 59 - .../method_checknameavailability.go | 59 - .../model_capabilitiesproperties.go | 8 - .../model_capabilitiesresponse.go | 9 - .../model_capabilitiesresponseproperties.go | 8 - .../model_checknameavailabilityparameters.go | 9 - .../model_checknameavailabilityresult.go | 10 - .../recoveryservices/model_dnszone.go | 8 - .../recoveryservices/model_dnszoneresponse.go | 9 - .../model_resourcecapabilities.go | 9 - .../2023-08-01/recoveryservices/version.go | 12 - .../2023-08-01/registeredidentities/client.go | 26 - .../id_registeredidentity.go | 139 - .../id_registeredidentity_test.go | 327 -- .../registeredidentities/method_delete.go | 46 - .../registeredidentities/version.go | 12 - .../2023-08-01/replicationusages/README.md | 36 - .../2023-08-01/replicationusages/client.go | 26 - .../2023-08-01/replicationusages/id_vault.go | 130 - .../replicationusages/id_vault_test.go | 282 -- .../replicationusages/method_list.go | 55 - .../replicationusages/model_jobssummary.go | 10 - .../model_monitoringsummary.go | 13 - .../model_replicationusage.go | 13 - .../model_replicationusagelist.go | 8 - .../2023-08-01/replicationusages/version.go | 12 - .../2023-08-01/vaultcertificates/README.md | 41 - .../2023-08-01/vaultcertificates/client.go | 26 - .../2023-08-01/vaultcertificates/constants.go | 60 - .../vaultcertificates/id_certificate.go | 139 - .../vaultcertificates/id_certificate_test.go | 327 -- .../vaultcertificates/method_create.go | 58 - .../model_certificaterequest.go | 8 - .../model_rawcertificatedata.go | 9 - .../model_resourcecertificateandaaddetails.go | 82 - .../model_resourcecertificateandacsdetails.go | 78 - .../model_resourcecertificatedetails.go | 61 - .../model_vaultcertificateresponse.go | 44 - .../2023-08-01/vaultcertificates/version.go | 12 - .../2023-08-01/vaultextendedinfo/README.md | 78 - .../2023-08-01/vaultextendedinfo/client.go | 26 - .../2023-08-01/vaultextendedinfo/id_vault.go | 130 - .../vaultextendedinfo/id_vault_test.go | 282 -- .../method_createorupdate.go | 59 - .../vaultextendedinfo/method_get.go | 55 - .../vaultextendedinfo/method_update.go | 59 - .../model_vaultextendedinfo.go | 11 - .../model_vaultextendedinforesource.go | 12 - .../2023-08-01/vaultextendedinfo/version.go | 12 - .../2023-08-01/vaults/README.md | 121 - .../2023-08-01/vaults/client.go | 26 - .../2023-08-01/vaults/constants.go | 911 ------ .../2023-08-01/vaults/id_vault.go | 130 - .../2023-08-01/vaults/id_vault_test.go | 282 -- .../vaults/method_createorupdate.go | 75 - .../2023-08-01/vaults/method_delete.go | 46 - .../2023-08-01/vaults/method_get.go | 54 - .../vaults/method_listbyresourcegroup.go | 92 - .../vaults/method_listbysubscriptionid.go | 92 - .../2023-08-01/vaults/method_update.go | 75 - .../vaults/model_azuremonitoralertsettings.go | 8 - .../vaults/model_classicalertsettings.go | 8 - .../2023-08-01/vaults/model_cmkkekidentity.go | 9 - .../vaults/model_cmkkeyvaultproperties.go | 8 - .../model_crosssubscriptionrestoresettings.go | 8 - .../vaults/model_immutabilitysettings.go | 8 - .../vaults/model_monitoringsettings.go | 9 - .../2023-08-01/vaults/model_patchvault.go | 20 - .../vaults/model_privateendpoint.go | 8 - .../vaults/model_privateendpointconnection.go | 11 - ...rivateendpointconnectionvaultproperties.go | 12 - ...model_privatelinkserviceconnectionstate.go | 10 - .../vaults/model_restoresettings.go | 8 - .../vaults/model_securitysettings.go | 10 - .../2023-08-01/vaults/model_sku.go | 12 - .../vaults/model_softdeletesettings.go | 10 - .../2023-08-01/vaults/model_upgradedetails.go | 58 - .../2023-08-01/vaults/model_vault.go | 22 - .../vaults/model_vaultproperties.go | 22 - .../vaults/model_vaultpropertiesencryption.go | 10 - .../model_vaultpropertiesmovedetails.go | 42 - ...model_vaultpropertiesredundancysettings.go | 9 - .../2023-08-01/vaults/predicates.go | 37 - .../2023-08-01/vaults/version.go | 12 - .../2023-08-01/vaultusages/README.md | 36 - .../2023-08-01/vaultusages/client.go | 26 - .../2023-08-01/vaultusages/constants.go | 63 - .../2023-08-01/vaultusages/id_vault.go | 130 - .../2023-08-01/vaultusages/id_vault_test.go | 282 -- .../vaultusages/method_usageslistbyvaults.go | 55 - .../2023-08-01/vaultusages/model_nameinfo.go | 9 - .../vaultusages/model_vaultusage.go | 31 - .../vaultusages/model_vaultusagelist.go | 8 - .../2023-08-01/vaultusages/version.go | 12 - .../2023-01-15/aadproperties/README.md | 36 - .../2023-01-15/aadproperties/client.go | 18 - .../2023-01-15/aadproperties/id_location.go | 121 - .../aadproperties/id_location_test.go | 237 -- .../aadproperties/method_get_autorest.go | 98 - .../aadproperties/model_aadproperties.go | 12 - .../model_aadpropertiesresource.go | 14 - .../2023-01-15/aadproperties/version.go | 12 - .../2023-01-15/backupcrrjobs/README.md | 42 - .../2023-01-15/backupcrrjobs/client.go | 18 - .../2023-01-15/backupcrrjobs/constants.go | 220 -- .../2023-01-15/backupcrrjobs/id_location.go | 121 - .../backupcrrjobs/id_location_test.go | 237 -- .../backupcrrjobs/method_list_autorest.go | 216 -- .../model_azureiaasvmerrorinfo.go | 11 - .../backupcrrjobs/model_azureiaasvmjob.go | 79 - .../model_azureiaasvmjobextendedinfo.go | 13 - .../model_azureiaasvmjobtaskdetails.go | 45 - .../model_azurestorageerrorinfo.go | 10 - .../backupcrrjobs/model_azurestoragejob.go | 80 - .../model_azurestoragejobextendedinfo.go | 10 - .../model_azurestoragejobtaskdetails.go | 9 - .../model_azureworkloaderrorinfo.go | 12 - .../backupcrrjobs/model_azureworkloadjob.go | 79 - .../model_azureworkloadjobextendedinfo.go | 10 - .../model_azureworkloadjobtaskdetails.go | 9 - .../backupcrrjobs/model_crrjobrequest.go | 9 - .../backupcrrjobs/model_dpmerrorinfo.go | 9 - .../2023-01-15/backupcrrjobs/model_dpmjob.go | 82 - .../backupcrrjobs/model_dpmjobextendedinfo.go | 10 - .../backupcrrjobs/model_dpmjobtaskdetails.go | 42 - .../2023-01-15/backupcrrjobs/model_job.go | 85 - .../backupcrrjobs/model_jobresource.go | 50 - .../backupcrrjobs/model_maberrorinfo.go | 9 - .../2023-01-15/backupcrrjobs/model_mabjob.go | 81 - .../backupcrrjobs/model_mabjobextendedinfo.go | 10 - .../backupcrrjobs/model_mabjobtaskdetails.go | 42 - .../2023-01-15/backupcrrjobs/predicates.go | 37 - .../2023-01-15/backupcrrjobs/version.go | 12 - .../backupprotecteditemscrr/README.md | 37 - .../backupprotecteditemscrr/client.go | 18 - .../backupprotecteditemscrr/constants.go | 378 --- .../backupprotecteditemscrr/id_vault.go | 130 - .../backupprotecteditemscrr/id_vault_test.go | 282 -- .../method_list_autorest.go | 215 -- .../model_azurefileshareprotecteditem.go | 89 - ...azurefileshareprotecteditemextendedinfo.go | 42 - ..._azureiaasclassiccomputevmprotecteditem.go | 93 - .../model_azureiaascomputevmprotecteditem.go | 93 - .../model_azureiaasvmprotecteditem.go | 93 - ...el_azureiaasvmprotecteditemextendedinfo.go | 28 - .../model_azuresqlprotecteditem.go | 84 - ...model_azuresqlprotecteditemextendedinfo.go | 28 - .../model_azurevmworkloadprotecteditem.go | 94 - ...zurevmworkloadprotecteditemextendedinfo.go | 28 - ...revmworkloadsapasedatabaseprotecteditem.go | 94 - ...evmworkloadsaphanadatabaseprotecteditem.go | 94 - ...azurevmworkloadsqldatabaseprotecteditem.go | 94 - .../model_diskexclusionproperties.go | 9 - .../model_dpmprotecteditem.go | 85 - .../model_dpmprotecteditemextendedinfo.go | 75 - .../model_errordetail.go | 10 - .../model_extendedproperties.go | 8 - .../model_genericprotecteditem.go | 87 - .../model_kpiresourcehealthdetails.go | 9 - .../model_mabfilefolderprotecteditem.go | 88 - ..._mabfilefolderprotecteditemextendedinfo.go | 40 - .../model_protecteditem.go | 141 - .../model_protecteditemresource.go | 50 - .../model_resourcehealthdetails.go | 11 - .../backupprotecteditemscrr/predicates.go | 37 - .../backupprotecteditemscrr/version.go | 12 - .../backupresourcestorageconfigs/README.md | 78 - .../backupresourcestorageconfigs/client.go | 18 - .../backupresourcestorageconfigs/constants.go | 74 - .../backupresourcestorageconfigs/id_vault.go | 130 - .../id_vault_test.go | 282 -- .../method_get_autorest.go | 69 - .../method_patch_autorest.go | 68 - .../method_update_autorest.go | 70 - .../model_backupresourceconfig.go | 11 - .../model_backupresourceconfigresource.go | 14 - .../backupresourcestorageconfigs/version.go | 12 - .../backupusagesummariescrr/README.md | 36 - .../backupusagesummariescrr/client.go | 18 - .../backupusagesummariescrr/constants.go | 46 - .../backupusagesummariescrr/id_vault.go | 130 - .../backupusagesummariescrr/id_vault_test.go | 282 -- .../method_list_autorest.go | 98 - .../model_backupmanagementusage.go | 31 - .../model_backupmanagementusagelist.go | 8 - .../backupusagesummariescrr/model_nameinfo.go | 9 - .../backupusagesummariescrr/version.go | 12 - .../2023-01-15/client.go | 71 - .../2023-01-15/crossregionrestore/README.md | 37 - .../2023-01-15/crossregionrestore/client.go | 18 - .../crossregionrestore/constants.go | 204 -- .../crossregionrestore/id_location.go | 121 - .../crossregionrestore/id_location_test.go | 237 -- .../method_trigger_autorest.go | 79 - .../model_azurefilesharerestorerequest.go | 46 - ..._azureworkloadpointintimerestorerequest.go | 47 - .../model_azureworkloadrestorerequest.go | 46 - ...orkloadsaphanapointintimerestorerequest.go | 47 - ...odel_azureworkloadsaphanarestorerequest.go | 46 - ...ureworkloadsqlpointintimerestorerequest.go | 50 - .../model_azureworkloadsqlrestorerequest.go | 49 - .../model_crossregionrestorerequest.go | 41 - .../model_crraccesstoken.go | 53 - .../model_encryptiondetails.go | 12 - .../model_iaasvmrestorerequest.go | 62 - .../model_identitybasedrestoredetails.go | 9 - .../crossregionrestore/model_identityinfo.go | 9 - .../model_restorefilespecs.go | 10 - .../model_restorerequest.go | 109 - .../model_sqldatadirectorymapping.go | 11 - .../model_targetafsrestoreinfo.go | 9 - .../model_targetrestoreinfo.go | 11 - .../model_workloadcrraccesstoken.go | 74 - .../2023-01-15/crossregionrestore/version.go | 12 - .../2023-01-15/crrjobdetails/README.md | 41 - .../2023-01-15/crrjobdetails/client.go | 18 - .../2023-01-15/crrjobdetails/constants.go | 220 -- .../2023-01-15/crrjobdetails/id_location.go | 121 - .../crrjobdetails/id_location_test.go | 237 -- .../method_backupcrrjobdetailsget_autorest.go | 70 - .../model_azureiaasvmerrorinfo.go | 11 - .../crrjobdetails/model_azureiaasvmjob.go | 79 - .../model_azureiaasvmjobextendedinfo.go | 13 - .../model_azureiaasvmjobtaskdetails.go | 45 - .../model_azurestorageerrorinfo.go | 10 - .../crrjobdetails/model_azurestoragejob.go | 80 - .../model_azurestoragejobextendedinfo.go | 10 - .../model_azurestoragejobtaskdetails.go | 9 - .../model_azureworkloaderrorinfo.go | 12 - .../crrjobdetails/model_azureworkloadjob.go | 79 - .../model_azureworkloadjobextendedinfo.go | 10 - .../model_azureworkloadjobtaskdetails.go | 9 - .../crrjobdetails/model_crrjobrequest.go | 9 - .../crrjobdetails/model_dpmerrorinfo.go | 9 - .../2023-01-15/crrjobdetails/model_dpmjob.go | 82 - .../crrjobdetails/model_dpmjobextendedinfo.go | 10 - .../crrjobdetails/model_dpmjobtaskdetails.go | 42 - .../2023-01-15/crrjobdetails/model_job.go | 85 - .../crrjobdetails/model_jobresource.go | 50 - .../crrjobdetails/model_maberrorinfo.go | 9 - .../2023-01-15/crrjobdetails/model_mabjob.go | 81 - .../crrjobdetails/model_mabjobextendedinfo.go | 10 - .../crrjobdetails/model_mabjobtaskdetails.go | 42 - .../2023-01-15/crrjobdetails/version.go | 12 - .../2023-01-15/recoverypointscrr/README.md | 53 - .../2023-01-15/recoverypointscrr/client.go | 18 - .../2023-01-15/recoverypointscrr/constants.go | 145 - .../recoverypointscrr/id_protecteditem.go | 157 - .../id_protecteditem_test.go | 417 --- .../recoverypointscrr/id_recoverypoint.go | 166 - .../id_recoverypoint_test.go | 462 --- .../recoverypointscrr/method_get_autorest.go | 68 - .../recoverypointscrr/method_list_autorest.go | 215 -- .../model_azurefilesharerecoverypoint.go | 45 - ...l_azureworkloadpointintimerecoverypoint.go | 46 - .../model_azureworkloadrecoverypoint.go | 45 - ...workloadsaphanapointintimerecoverypoint.go | 46 - ...model_azureworkloadsaphanarecoverypoint.go | 45 - ...zureworkloadsqlpointintimerecoverypoint.go | 47 - .../model_azureworkloadsqlrecoverypoint.go | 46 - ...ureworkloadsqlrecoverypointextendedinfo.go | 27 - .../recoverypointscrr/model_bekdetails.go | 10 - .../model_diskinformation.go | 9 - .../model_genericrecoverypoint.go | 45 - .../model_iaasvmrecoverypoint.go | 58 - .../recoverypointscrr/model_kekdetails.go | 10 - .../model_keyandsecretdetails.go | 10 - .../model_pointintimerange.go | 39 - .../recoverypointscrr/model_recoverypoint.go | 117 - .../model_recoverypointdiskconfiguration.go | 11 - .../model_recoverypointmovereadinessinfo.go | 9 - .../model_recoverypointproperties.go | 10 - .../model_recoverypointresource.go | 50 - .../model_recoverypointtierinformation.go | 10 - .../model_sqldatadirectory.go | 10 - .../recoverypointscrr/predicates.go | 37 - .../2023-01-15/recoverypointscrr/version.go | 12 - .../recoverypointsgetaccesstoken/README.md | 41 - .../recoverypointsgetaccesstoken/client.go | 18 - .../id_recoverypoint.go | 166 - .../id_recoverypoint_test.go | 462 --- ...d_recoverypointsgetaccesstoken_autorest.go | 70 - .../model_aadproperties.go | 12 - .../model_aadpropertiesresource.go | 14 - .../model_crraccesstoken.go | 53 - .../model_crraccesstokenresource.go | 50 - .../model_workloadcrraccesstoken.go | 74 - .../recoverypointsgetaccesstoken/version.go | 12 - .../resources/2024-03-01/client.go | 9 + .../2024-03-01/deploymentstacks/README.md | 306 ++ .../2024-03-01/deploymentstacks/client.go | 26 + .../2024-03-01/deploymentstacks/constants.go | 383 +++ .../deploymentstacks/id_deploymentstack.go | 121 + .../id_deploymentstack_test.go | 237 ++ .../id_providerdeploymentstack.go | 130 + .../id_providerdeploymentstack_test.go | 282 ++ .../id_providers2deploymentstack.go | 123 + .../id_providers2deploymentstack_test.go | 267 ++ .../method_createorupdateatmanagementgroup.go | 75 + .../method_createorupdateatresourcegroup.go | 75 + .../method_createorupdateatsubscription.go | 75 + .../method_deleteatmanagementgroup.go | 111 + .../method_deleteatresourcegroup.go | 111 + .../method_deleteatsubscription.go | 111 + .../method_exporttemplateatmanagementgroup.go | 55 + .../method_exporttemplateatresourcegroup.go | 55 + .../method_exporttemplateatsubscription.go | 55 + .../method_getatmanagementgroup.go | 54 + .../method_getatresourcegroup.go | 54 + .../method_getatsubscription.go | 54 + .../method_listatmanagementgroup.go | 92 + .../method_listatresourcegroup.go | 92 + .../method_listatsubscription.go | 92 + .../method_validatestackatmanagementgroup.go | 75 + .../method_validatestackatresourcegroup.go | 75 + .../method_validatestackatsubscription.go | 75 + .../model_actiononunmanage.go | 10 + .../deploymentstacks/model_denysettings.go | 11 + .../model_deploymentparameter.go | 10 + .../deploymentstacks/model_deploymentstack.go | 18 + .../model_deploymentstackproperties.go | 27 + .../model_deploymentstacksdebugsetting.go | 8 + .../model_deploymentstacksparameterslink.go | 9 + .../model_deploymentstackstemplatelink.go | 12 + ...model_deploymentstacktemplatedefinition.go | 9 + ...model_deploymentstackvalidateproperties.go | 15 + .../model_deploymentstackvalidateresult.go | 17 + .../model_erroradditionalinfo.go | 9 + .../deploymentstacks/model_errordetail.go | 12 + .../model_keyvaultparameterreference.go | 10 + .../model_keyvaultreference.go | 8 + .../model_managedresourcereference.go | 10 + .../model_resourcereference.go | 8 + .../model_resourcereferenceextended.go | 9 + .../2024-03-01/deploymentstacks/predicates.go | 32 + .../2024-03-01/deploymentstacks/version.go | 12 + .../advancedthreatprotection/README.md | 58 - .../advancedthreatprotection/client.go | 26 - .../advancedthreatprotection/method_create.go | 60 - .../advancedthreatprotection/method_get.go | 56 - ...odel_advancedthreatprotectionproperties.go | 8 - .../model_advancedthreatprotectionsetting.go | 11 - .../advancedthreatprotection/version.go | 12 - .../autoprovisioningsettings/README.md | 75 - .../autoprovisioningsettings/client.go | 26 - .../autoprovisioningsettings/constants.go | 51 - .../id_autoprovisioningsetting.go | 121 - .../id_autoprovisioningsetting_test.go | 237 -- .../autoprovisioningsettings/method_create.go | 58 - .../autoprovisioningsettings/method_get.go | 54 - .../autoprovisioningsettings/method_list.go | 92 - .../model_autoprovisioningsetting.go | 11 - ...model_autoprovisioningsettingproperties.go | 8 - .../autoprovisioningsettings/predicates.go | 27 - .../autoprovisioningsettings/version.go | 12 - .../security/2017-08-01-preview/client.go | 118 - .../2017-08-01-preview/compliances/README.md | 54 - .../2017-08-01-preview/compliances/client.go | 26 - .../compliances/id_scopedcompliance.go | 120 - .../compliances/id_scopedcompliance_test.go | 222 -- .../compliances/method_get.go | 54 - .../compliances/method_list.go | 92 - .../compliances/model_compliance.go | 11 - .../compliances/model_complianceproperties.go | 28 - .../compliances/model_compliancesegment.go | 9 - .../compliances/predicates.go | 27 - .../2017-08-01-preview/compliances/version.go | 12 - .../devicesecuritygroups/README.md | 91 - .../devicesecuritygroups/client.go | 26 - .../devicesecuritygroups/constants.go | 51 - .../id_scopeddevicesecuritygroup.go | 120 - .../id_scopeddevicesecuritygroup_test.go | 222 -- .../method_createorupdate.go | 59 - .../devicesecuritygroups/method_delete.go | 47 - .../devicesecuritygroups/method_get.go | 54 - .../devicesecuritygroups/method_list.go | 92 - .../model_allowlistcustomalertrule.go | 13 - .../model_denylistcustomalertrule.go | 13 - .../model_devicesecuritygroup.go | 11 - .../model_devicesecuritygroupproperties.go | 11 - .../model_thresholdcustomalertrule.go | 13 - .../model_timewindowcustomalertrule.go | 14 - .../devicesecuritygroups/predicates.go | 27 - .../devicesecuritygroups/version.go | 12 - .../informationprotectionpolicies/README.md | 75 - .../informationprotectionpolicies/client.go | 26 - .../constants.go | 101 - .../id_scopedinformationprotectionpolicy.go | 128 - ..._scopedinformationprotectionpolicy_test.go | 222 -- .../method_createorupdate.go | 59 - .../method_get.go | 54 - .../method_list.go | 92 - .../model_informationprotectionkeyword.go | 11 - .../model_informationprotectionpolicy.go | 11 - ...l_informationprotectionpolicyproperties.go | 29 - .../model_informationtype.go | 14 - .../model_sensitivitylabel.go | 12 - .../predicates.go | 27 - .../informationprotectionpolicies/version.go | 12 - .../iotsecuritysolutions/README.md | 129 - .../iotsecuritysolutions/client.go | 26 - .../iotsecuritysolutions/constants.go | 251 -- .../id_iotsecuritysolution.go | 130 - .../id_iotsecuritysolution_test.go | 282 -- .../method_iotsecuritysolutioncreate.go | 59 - .../method_iotsecuritysolutiondelete.go | 47 - .../method_iotsecuritysolutionget.go | 54 - .../method_iotsecuritysolutionslist.go | 120 - ...d_iotsecuritysolutionsresourcegrouplist.go | 120 - .../method_iotsecuritysolutionupdate.go | 58 - .../model_iotsecuritysolutionmodel.go | 13 - .../model_iotsecuritysolutionproperties.go | 16 - ...l_recommendationconfigurationproperties.go | 10 - .../model_updateiotsecuritysolutiondata.go | 10 - .../model_userdefinedresourcesproperties.go | 9 - .../iotsecuritysolutions/predicates.go | 32 - .../iotsecuritysolutions/version.go | 12 - .../iotsecuritysolutionsanalytics/README.md | 135 - .../iotsecuritysolutionsanalytics/client.go | 26 - .../constants.go | 57 - .../id_aggregatedalert.go | 141 - .../id_aggregatedalert_test.go | 357 --- .../id_aggregatedrecommendation.go | 141 - .../id_aggregatedrecommendation_test.go | 357 --- .../id_iotsecuritysolution.go | 130 - .../id_iotsecuritysolution_test.go | 282 -- .../method_aggregatedalertdismiss.go | 47 - .../method_aggregatedalertget.go | 54 - .../method_aggregatedalertslist.go | 119 - .../method_getall.go | 91 - .../method_getdefault.go | 55 - .../method_recommendationget.go | 54 - .../method_recommendationslist.go | 119 - .../model_iotsecurityaggregatedalert.go | 12 - ...el_iotsecurityaggregatedalertproperties.go | 19 - ...del_iotsecurityaggregatedrecommendation.go | 12 - ...urityaggregatedrecommendationproperties.go | 17 - .../model_iotsecurityalerteddevice.go | 9 - .../model_iotsecurityalerteddeviceslist.go | 9 - .../model_iotsecuritydevicealert.go | 10 - .../model_iotsecuritydevicealertslist.go | 9 - .../model_iotsecuritydevicerecommendation.go | 10 - ...el_iotsecuritydevicerecommendationslist.go | 9 - ...model_iotsecuritysolutionanalyticsmodel.go | 11 - ...ecuritysolutionanalyticsmodelproperties.go | 13 - ...icsmodelpropertiesdevicesmetricsinlined.go | 27 - .../model_iotseveritymetrics.go | 10 - .../predicates.go | 73 - .../iotsecuritysolutionsanalytics/version.go | 12 - .../2017-08-01-preview/pricings/README.md | 129 - .../2017-08-01-preview/pricings/client.go | 26 - .../2017-08-01-preview/pricings/constants.go | 51 - .../2017-08-01-preview/pricings/id_pricing.go | 121 - .../pricings/id_pricing_test.go | 237 -- .../pricings/id_providerpricing.go | 130 - .../pricings/id_providerpricing_test.go | 282 -- ...thod_createorupdateresourcegrouppricing.go | 58 - .../method_getresourcegrouppricing.go | 54 - .../pricings/method_getsubscriptionpricing.go | 54 - .../pricings/method_list.go | 92 - .../pricings/method_listbyresourcegroup.go | 92 - .../method_updatesubscriptionpricing.go | 58 - .../pricings/model_pricing.go | 11 - .../pricings/model_pricingproperties.go | 8 - .../2017-08-01-preview/pricings/predicates.go | 27 - .../2017-08-01-preview/pricings/version.go | 12 - .../securitycontacts/README.md | 112 - .../securitycontacts/client.go | 26 - .../securitycontacts/constants.go | 92 - .../securitycontacts/id_securitycontact.go | 121 - .../id_securitycontact_test.go | 237 -- .../securitycontacts/method_create.go | 58 - .../securitycontacts/method_delete.go | 46 - .../securitycontacts/method_get.go | 54 - .../securitycontacts/method_list.go | 92 - .../securitycontacts/method_update.go | 58 - .../securitycontacts/model_securitycontact.go | 11 - .../model_securitycontactproperties.go | 11 - .../securitycontacts/predicates.go | 27 - .../securitycontacts/version.go | 12 - .../2017-08-01-preview/settings/README.md | 75 - .../2017-08-01-preview/settings/client.go | 26 - .../2017-08-01-preview/settings/constants.go | 92 - .../2017-08-01-preview/settings/id_setting.go | 129 - .../settings/id_setting_test.go | 237 -- .../2017-08-01-preview/settings/method_get.go | 58 - .../settings/method_list.go | 104 - .../settings/method_update.go | 62 - .../settings/model_dataexportsetting.go | 44 - .../model_dataexportsettingproperties.go | 8 - .../settings/model_setting.go | 53 - .../2017-08-01-preview/settings/predicates.go | 12 - .../2017-08-01-preview/settings/version.go | 12 - .../workspacesettings/README.md | 112 - .../workspacesettings/client.go | 26 - .../workspacesettings/id_workspacesetting.go | 121 - .../id_workspacesetting_test.go | 237 -- .../workspacesettings/method_create.go | 58 - .../workspacesettings/method_delete.go | 46 - .../workspacesettings/method_get.go | 54 - .../workspacesettings/method_list.go | 92 - .../workspacesettings/method_update.go | 58 - .../model_workspacesetting.go | 11 - .../model_workspacesettingproperties.go | 9 - .../workspacesettings/predicates.go | 27 - .../workspacesettings/version.go | 12 - .../advancedthreatprotection/README.md | 58 - .../advancedthreatprotection/client.go | 26 - .../advancedthreatprotection/method_create.go | 60 - .../advancedthreatprotection/method_get.go | 56 - ...odel_advancedthreatprotectionproperties.go | 8 - .../model_advancedthreatprotectionsetting.go | 11 - .../advancedthreatprotection/version.go | 12 - .../security/2019-01-01/alerts/README.md | 185 -- .../security/2019-01-01/alerts/client.go | 26 - .../security/2019-01-01/alerts/constants.go | 57 - .../security/2019-01-01/alerts/id_alert.go | 130 - .../2019-01-01/alerts/id_alert_test.go | 282 -- .../security/2019-01-01/alerts/id_location.go | 121 - .../2019-01-01/alerts/id_location_test.go | 237 -- .../2019-01-01/alerts/id_locationalert.go | 139 - .../alerts/id_locationalert_test.go | 327 -- .../2019-01-01/alerts/id_providerlocation.go | 130 - .../alerts/id_providerlocation_test.go | 282 -- .../method_getresourcegrouplevelalerts.go | 54 - .../method_getsubscriptionlevelalert.go | 54 - .../security/2019-01-01/alerts/method_list.go | 132 - .../alerts/method_listbyresourcegroup.go | 132 - ...od_listresourcegrouplevelalertsbyregion.go | 131 - ...hod_listsubscriptionlevelalertsbyregion.go | 131 - ...teresourcegrouplevelalertstatetodismiss.go | 47 - ...esourcegrouplevelalertstatetoreactivate.go | 47 - ...atesubscriptionlevelalertstatetodismiss.go | 47 - ...subscriptionlevelalertstatetoreactivate.go | 47 - .../security/2019-01-01/alerts/model_alert.go | 11 - .../alerts/model_alertconfidencereason.go | 9 - .../2019-01-01/alerts/model_alertentity.go | 8 - .../alerts/model_alertproperties.go | 60 - .../security/2019-01-01/alerts/predicates.go | 27 - .../security/2019-01-01/alerts/version.go | 12 - .../security/2019-01-01/client.go | 46 - .../security/2019-01-01/settings/README.md | 75 - .../security/2019-01-01/settings/client.go | 26 - .../security/2019-01-01/settings/constants.go | 92 - .../2019-01-01/settings/id_setting.go | 129 - .../2019-01-01/settings/id_setting_test.go | 237 -- .../2019-01-01/settings/method_get.go | 58 - .../2019-01-01/settings/method_list.go | 104 - .../2019-01-01/settings/method_update.go | 62 - .../model_dataexportsettingproperties.go | 8 - .../settings/model_dataexportsettings.go | 44 - .../2019-01-01/settings/model_setting.go | 53 - .../2019-01-01/settings/predicates.go | 12 - .../security/2019-01-01/settings/version.go | 12 - .../2021-09-01-preview/actions/README.md | 90 - .../2021-09-01-preview/actions/client.go | 26 - .../2021-09-01-preview/actions/id_action.go | 150 - .../actions/id_action_test.go | 402 --- .../actions/id_alertrule.go | 141 - .../actions/id_alertrule_test.go | 357 --- .../actions/method_createorupdate.go | 59 - .../actions/method_delete.go | 47 - .../2021-09-01-preview/actions/method_get.go | 54 - .../actions/method_listbyalertrule.go | 91 - .../actions/model_actionrequest.go | 17 - .../actions/model_actionrequestproperties.go | 9 - .../actions/model_actionresponse.go | 17 - .../actions/model_actionresponseproperties.go | 9 - .../2021-09-01-preview/actions/predicates.go | 32 - .../2021-09-01-preview/actions/version.go | 12 - .../2021-09-01-preview/alertrules/README.md | 90 - .../2021-09-01-preview/alertrules/client.go | 26 - .../alertrules/constants.go | 502 --- .../alertrules/id_alertrule.go | 141 - .../alertrules/id_alertrule_test.go | 357 --- .../alertrules/id_workspace.go | 130 - .../alertrules/id_workspace_test.go | 282 -- .../alertrules/method_createorupdate.go | 63 - .../alertrules/method_delete.go | 47 - .../alertrules/method_get.go | 58 - .../alertrules/method_list.go | 103 - .../alertrules/model_alertdetailsoverride.go | 11 - .../alertrules/model_alertrule.go | 93 - .../alertrules/model_entitymapping.go | 9 - .../alertrules/model_eventgroupingsettings.go | 8 - .../alertrules/model_fieldmapping.go | 9 - .../alertrules/model_fusionalertrule.go | 48 - .../model_fusionalertruleproperties.go | 32 - .../alertrules/model_groupingconfiguration.go | 14 - .../alertrules/model_incidentconfiguration.go | 9 - ...rosoftsecurityincidentcreationalertrule.go | 48 - ...rityincidentcreationalertruleproperties.go | 34 - .../model_mlbehavioranalyticsalertrule.go | 48 - ..._mlbehavioranalyticsalertruleproperties.go | 32 - .../alertrules/model_nrtalertrule.go | 48 - .../model_querybasedalertruleproperties.go | 40 - .../alertrules/model_scheduledalertrule.go | 48 - .../model_scheduledalertruleproperties.go | 45 - .../model_threatintelligencealertrule.go | 48 - ...l_threatintelligencealertruleproperties.go | 32 - .../alertrules/predicates.go | 12 - .../2021-09-01-preview/alertrules/version.go | 12 - .../alertruletemplates/README.md | 53 - .../alertruletemplates/client.go | 26 - .../alertruletemplates/constants.go | 461 --- .../id_alertruletemplate.go | 141 - .../id_alertruletemplate_test.go | 357 --- .../alertruletemplates/id_workspace.go | 130 - .../alertruletemplates/id_workspace_test.go | 282 -- .../alertruletemplates/method_get.go | 58 - .../alertruletemplates/method_list.go | 103 - .../model_alertdetailsoverride.go | 11 - .../model_alertruletemplate.go | 93 - .../model_alertruletemplatedatasource.go | 9 - .../alertruletemplates/model_entitymapping.go | 9 - .../model_eventgroupingsettings.go | 8 - .../alertruletemplates/model_fieldmapping.go | 9 - .../model_fusionalertruletemplate.go | 47 - ...model_fusionalertruletemplateproperties.go | 46 - ...curityincidentcreationalertruletemplate.go | 47 - ...dentcreationalertruletemplateproperties.go | 45 - ...el_mlbehavioranalyticsalertruletemplate.go | 47 - ...ioranalyticsalertruletemplateproperties.go | 46 - .../model_nrtalertruletemplate.go | 47 - .../model_nrtalertruletemplateproperties.go | 51 - .../model_scheduledalertruletemplate.go | 47 - ...el_scheduledalertruletemplateproperties.go | 56 - ...del_threatintelligencealertruletemplate.go | 47 - ...intelligencealertruletemplateproperties.go | 46 - .../alertruletemplates/predicates.go | 12 - .../alertruletemplates/version.go | 12 - .../automationrule/client.go | 26 - .../automationrule/id_automationrule.go | 141 - .../automationrule/id_automationrule_test.go | 357 --- .../automationrule/method_delete.go | 47 - .../automationrule/version.go | 12 - .../automationrules/README.md | 74 - .../automationrules/client.go | 26 - .../automationrules/constants.go | 685 ---- .../automationrules/id_automationrule.go | 141 - .../automationrules/id_automationrule_test.go | 357 --- .../automationrules/id_workspace.go | 130 - .../automationrules/id_workspace_test.go | 282 -- .../automationrules/method_createorupdate.go | 59 - .../automationrules/method_get.go | 54 - .../automationrules/method_list.go | 91 - .../automationrules/model_automationrule.go | 17 - .../model_automationruleaction.go | 61 - .../model_automationrulecondition.go | 53 - ...el_automationrulemodifypropertiesaction.go | 42 - ...difypropertiesactionactionconfiguration.go | 14 - .../model_automationruleproperties.go | 88 - ...l_automationrulepropertyvaluescondition.go | 41 - ...pertyvaluesconditionconditionproperties.go | 10 - .../model_automationrulerunplaybookaction.go | 42 - ...ulerunplaybookactionactionconfiguration.go | 9 - .../model_automationruletriggeringlogic.go | 70 - .../automationrules/model_clientinfo.go | 11 - .../automationrules/model_incidentlabel.go | 9 - .../model_incidentownerinfo.go | 12 - .../automationrules/predicates.go | 32 - .../automationrules/version.go | 12 - .../2021-09-01-preview/bookmark/README.md | 41 - .../2021-09-01-preview/bookmark/client.go | 26 - .../2021-09-01-preview/bookmark/constants.go | 108 - .../bookmark/id_bookmark.go | 141 - .../bookmark/id_bookmark_test.go | 357 --- .../bookmark/method_expand.go | 59 - .../model_bookmarkexpandparameters.go | 40 - .../bookmark/model_bookmarkexpandresponse.go | 9 - .../model_bookmarkexpandresponsevalue.go | 9 - .../bookmark/model_connectedentity.go | 9 - .../bookmark/model_entity.go | 16 - .../model_expansionresultaggregation.go | 11 - .../model_expansionresultsmetadata.go | 8 - .../2021-09-01-preview/bookmark/version.go | 12 - .../bookmarkrelations/README.md | 90 - .../bookmarkrelations/client.go | 26 - .../bookmarkrelations/id_bookmark.go | 141 - .../bookmarkrelations/id_bookmark_test.go | 357 --- .../bookmarkrelations/id_bookmarkrelation.go | 150 - .../id_bookmarkrelation_test.go | 402 --- .../method_createorupdate.go | 59 - .../bookmarkrelations/method_delete.go | 47 - .../bookmarkrelations/method_get.go | 54 - .../bookmarkrelations/method_list.go | 127 - .../bookmarkrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../bookmarkrelations/predicates.go | 32 - .../bookmarkrelations/version.go | 12 - .../2021-09-01-preview/bookmarks/README.md | 90 - .../2021-09-01-preview/bookmarks/client.go | 26 - .../2021-09-01-preview/bookmarks/constants.go | 57 - .../bookmarks/id_bookmark.go | 141 - .../bookmarks/id_bookmark_test.go | 357 --- .../bookmarks/id_workspace.go | 130 - .../bookmarks/id_workspace_test.go | 282 -- .../bookmarks/method_createorupdate.go | 59 - .../bookmarks/method_delete.go | 47 - .../bookmarks/method_get.go | 54 - .../bookmarks/method_list.go | 91 - .../bookmarks/model_bookmark.go | 17 - .../bookmarks/model_bookmarkproperties.go | 86 - .../bookmarks/model_incidentinfo.go | 11 - .../bookmarks/model_userinfo.go | 10 - .../bookmarks/predicates.go | 32 - .../2021-09-01-preview/bookmarks/version.go | 12 - .../checkdataconnectorrequirements/README.md | 41 - .../checkdataconnectorrequirements/client.go | 26 - .../constants.go | 181 -- .../id_workspace.go | 130 - .../id_workspace_test.go | 282 -- ...hod_dataconnectorscheckrequirementspost.go | 59 - .../model_aadcheckrequirements.go | 41 - .../model_aatpcheckrequirements.go | 41 - .../model_asccheckrequirements.go | 41 - .../model_asccheckrequirementsproperties.go | 8 - .../model_awscloudtrailcheckrequirements.go | 40 - .../model_awss3checkrequirements.go | 40 - .../model_dataconnectorrequirementsstate.go | 9 - .../model_dataconnectorscheckrequirements.go | 157 - .../model_dataconnectortenantid.go | 8 - .../model_dynamics365checkrequirements.go | 41 - .../model_mcascheckrequirements.go | 41 - .../model_mdatpcheckrequirements.go | 41 - .../model_msticheckrequirements.go | 41 - .../model_mtpcheckrequirements.go | 41 - .../model_officeatpcheckrequirements.go | 41 - .../model_officeirmcheckrequirements.go | 41 - .../model_ticheckrequirements.go | 41 - .../model_titaxiicheckrequirements.go | 41 - .../checkdataconnectorrequirements/version.go | 12 - .../2021-09-01-preview/client.go | 316 -- .../dataconnectors/README.md | 90 - .../dataconnectors/client.go | 26 - .../dataconnectors/constants.go | 372 --- .../dataconnectors/id_dataconnector.go | 141 - .../dataconnectors/id_dataconnector_test.go | 357 --- .../dataconnectors/id_workspace.go | 130 - .../dataconnectors/id_workspace_test.go | 282 -- .../dataconnectors/method_createorupdate.go | 63 - .../dataconnectors/method_delete.go | 47 - .../dataconnectors/method_get.go | 58 - .../dataconnectors/method_list.go | 103 - .../dataconnectors/model_aaddataconnector.go | 48 - .../model_aaddataconnectorproperties.go | 9 - .../dataconnectors/model_aatpdataconnector.go | 48 - .../model_aatpdataconnectorproperties.go | 9 - .../model_alertsdatatypeofdataconnector.go | 8 - .../model_apipollingparameters.go | 9 - .../dataconnectors/model_ascdataconnector.go | 48 - .../model_ascdataconnectorproperties.go | 9 - .../dataconnectors/model_availability.go | 9 - .../model_awscloudtraildataconnector.go | 48 - ...del_awscloudtraildataconnectordatatypes.go | 8 - ...el_awscloudtraildataconnectorproperties.go | 9 - .../model_awss3dataconnector.go | 48 - .../model_awss3dataconnectordatatypes.go | 8 - .../model_awss3dataconnectorproperties.go | 11 - .../model_codelessapipollingdataconnector.go | 48 - ..._codelessconnectorpollingauthproperties.go | 20 - ...odelessconnectorpollingconfigproperties.go | 12 - ...odelessconnectorpollingpagingproperties.go | 16 - ...delessconnectorpollingrequestproperties.go | 19 - ...elessconnectorpollingresponseproperties.go | 11 - .../model_codelessparameters.go | 8 - ...del_codelessuiconnectorconfigproperties.go | 19 - .../model_codelessuidataconnector.go | 48 - .../model_connectivitycriteria.go | 9 - .../model_connectorinstructionmodelbase.go | 9 - .../dataconnectors/model_customspermission.go | 9 - .../dataconnectors/model_dataconnector.go | 181 -- .../model_dataconnectordatatypecommon.go | 8 - .../model_dynamics365dataconnector.go | 48 - ...model_dynamics365dataconnectordatatypes.go | 8 - ...odel_dynamics365dataconnectorproperties.go | 9 - .../dataconnectors/model_graphqueries.go | 10 - .../dataconnectors/model_instructionsteps.go | 10 - .../model_lastdatareceiveddatatype.go | 9 - .../dataconnectors/model_mcasdataconnector.go | 48 - .../model_mcasdataconnectordatatypes.go | 9 - .../model_mcasdataconnectorproperties.go | 9 - .../model_mdatpdataconnector.go | 48 - .../model_mdatpdataconnectorproperties.go | 9 - .../dataconnectors/model_mstidataconnector.go | 48 - .../model_mstidataconnectordatatypes.go | 9 - ...connectordatatypesbingsafetyphishingurl.go | 9 - ...tordatatypesmicrosoftemergingthreatfeed.go | 9 - .../model_mstidataconnectorproperties.go | 9 - .../dataconnectors/model_mtpdataconnector.go | 48 - .../model_mtpdataconnectordatatypes.go | 8 - .../model_mtpdataconnectorproperties.go | 9 - .../model_officeatpdataconnector.go | 48 - .../model_officeatpdataconnectorproperties.go | 9 - .../model_officedataconnector.go | 48 - .../model_officedataconnectordatatypes.go | 10 - .../model_officedataconnectorproperties.go | 9 - .../model_officeirmdataconnector.go | 48 - .../model_officeirmdataconnectorproperties.go | 9 - .../dataconnectors/model_permissions.go | 9 - .../model_requiredpermissions.go | 11 - .../dataconnectors/model_resourceprovider.go | 12 - .../dataconnectors/model_samplequeries.go | 9 - .../dataconnectors/model_tidataconnector.go | 48 - .../model_tidataconnectordatatypes.go | 8 - .../model_tidataconnectorproperties.go | 28 - .../model_titaxiidataconnector.go | 48 - .../model_titaxiidataconnectordatatypes.go | 8 - .../model_titaxiidataconnectorproperties.go | 35 - .../dataconnectors/predicates.go | 12 - .../dataconnectors/version.go | 12 - .../dataconnectorsconnect/README.md | 41 - .../dataconnectorsconnect/client.go | 26 - .../dataconnectorsconnect/constants.go | 54 - .../dataconnectorsconnect/id_dataconnector.go | 141 - .../id_dataconnector_test.go | 357 --- .../method_dataconnectorsconnect.go | 51 - .../model_dataconnectorconnectbody.go | 15 - .../dataconnectorsconnect/version.go | 12 - .../dataconnectorsdisconnect/client.go | 26 - .../id_dataconnector.go | 141 - .../id_dataconnector_test.go | 357 --- .../method_dataconnectorsdisconnect.go | 47 - .../dataconnectorsdisconnect/version.go | 12 - .../2021-09-01-preview/enrichment/README.md | 53 - .../2021-09-01-preview/enrichment/client.go | 26 - .../enrichment/method_domainwhoisget.go | 84 - .../enrichment/method_ipgeodataget.go | 84 - .../enrichment/model_enrichmentdomainwhois.go | 55 - .../model_enrichmentdomainwhoiscontact.go | 17 - .../model_enrichmentdomainwhoiscontacts.go | 11 - .../model_enrichmentdomainwhoisdetails.go | 11 - ...l_enrichmentdomainwhoisregistrardetails.go | 13 - .../enrichment/model_enrichmentipgeodata.go | 24 - .../2021-09-01-preview/enrichment/version.go | 12 - .../2021-09-01-preview/entities/README.md | 132 - .../2021-09-01-preview/entities/client.go | 26 - .../2021-09-01-preview/entities/constants.go | 464 --- .../2021-09-01-preview/entities/id_entity.go | 141 - .../entities/id_entity_test.go | 357 --- .../entities/id_workspace.go | 130 - .../entities/id_workspace_test.go | 282 -- .../entities/method_expand.go | 59 - .../2021-09-01-preview/entities/method_get.go | 54 - .../entities/method_getinsights.go | 59 - .../entities/method_gettimelinelist.go | 59 - .../entities/method_list.go | 91 - .../entities/method_queries.go | 83 - .../entities/model_activitytimelineitem.go | 47 - .../entities/model_bookmarktimelineitem.go | 48 - .../entities/model_entity.go | 16 - .../entities/model_entityedges.go | 9 - .../entities/model_entityexpandparameters.go | 40 - .../entities/model_entityexpandresponse.go | 9 - .../model_entityexpandresponsevalue.go | 9 - .../model_entitygetinsightsparameters.go | 35 - .../model_entitygetinsightsresponse.go | 9 - .../entities/model_entityinsightitem.go | 11 - ...odel_entityinsightitemquerytimeinterval.go | 39 - .../entities/model_entityqueryitem.go | 53 - ...tityqueryitempropertiesdatatypesinlined.go | 8 - .../entities/model_entitytimelineitem.go | 69 - .../model_entitytimelineparameters.go | 35 - .../entities/model_entitytimelineresponse.go | 49 - .../model_expansionresultaggregation.go | 11 - .../model_expansionresultsmetadata.go | 8 - .../entities/model_getinsightserror.go | 10 - .../model_getinsightsresultsmetadata.go | 9 - .../entities/model_getqueriesresponse.go | 41 - .../entities/model_insightqueryitem.go | 44 - .../model_insightqueryitemproperties.go | 19 - ...sightqueryitempropertiesadditionalquery.go | 9 - ...ightqueryitempropertiesdefaulttimerange.go | 9 - ...htqueryitempropertiesreferencetimerange.go | 8 - ...el_insightqueryitempropertiestablequery.go | 9 - ...tiestablequerycolumnsdefinitionsinlined.go | 10 - ...tiestablequeryqueriesdefinitionsinlined.go | 11 - ...onsinlinedlinkcolumnsdefinitionsinlined.go | 9 - .../entities/model_insightstableresult.go | 9 - ...model_insightstableresultcolumnsinlined.go | 9 - .../model_securityalerttimelineitem.go | 49 - .../entities/model_timelineaggregation.go | 9 - .../entities/model_timelineerror.go | 10 - .../entities/model_timelineresultsmetadata.go | 10 - .../entities/model_userinfo.go | 10 - .../2021-09-01-preview/entities/predicates.go | 27 - .../2021-09-01-preview/entities/version.go | 12 - .../entityqueries/README.md | 123 - .../entityqueries/client.go | 26 - .../entityqueries/constants.go | 269 -- .../entityqueries/id_entityquery.go | 141 - .../entityqueries/id_entityquery_test.go | 357 --- .../entityqueries/id_entityquerytemplate.go | 141 - .../id_entityquerytemplate_test.go | 357 --- .../entityqueries/id_workspace.go | 130 - .../entityqueries/id_workspace_test.go | 282 -- .../entityqueries/method_createorupdate.go | 63 - .../entityqueries/method_delete.go | 47 - .../method_entityquerytemplatesget.go | 58 - .../method_entityquerytemplateslist.go | 131 - .../entityqueries/method_get.go | 58 - .../entityqueries/method_list.go | 131 - .../model_activitycustomentityquery.go | 48 - .../model_activityentityqueriesproperties.go | 48 - ...entityqueriespropertiesquerydefinitions.go | 8 - .../model_activityentityquery.go | 48 - .../model_activityentityquerytemplate.go | 47 - ...l_activityentityquerytemplateproperties.go | 15 - ...querytemplatepropertiesquerydefinitions.go | 9 - .../entityqueries/model_customentityquery.go | 53 - .../model_datatypedefinitions.go | 8 - .../entityqueries/model_entityquery.go | 61 - .../model_entityquerytemplate.go | 53 - .../model_expansionentityqueriesproperties.go | 13 - .../model_expansionentityquery.go | 48 - .../entityqueries/predicates.go | 20 - .../entityqueries/version.go | 12 - .../entityrelations/README.md | 53 - .../entityrelations/client.go | 26 - .../entityrelations/id_entity.go | 141 - .../entityrelations/id_entity_test.go | 357 --- .../entityrelations/id_relation.go | 150 - .../entityrelations/id_relation_test.go | 402 --- .../method_entitiesrelationslist.go | 127 - .../entityrelations/method_getrelation.go | 54 - .../entityrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../entityrelations/predicates.go | 32 - .../entityrelations/version.go | 12 - .../2021-09-01-preview/entitytypes/README.md | 21 - .../2021-09-01-preview/entitytypes/client.go | 26 - .../entitytypes/constants.go | 968 ------ .../entitytypes/model_accountentity.go | 45 - .../model_accountentityproperties.go | 21 - .../entitytypes/model_azureresourceentity.go | 45 - .../model_azureresourceentityproperties.go | 11 - .../model_cloudapplicationentity.go | 45 - .../model_cloudapplicationentityproperties.go | 12 - .../entitytypes/model_dnsentity.go | 45 - .../entitytypes/model_dnsentityproperties.go | 13 - .../entitytypes/model_entity.go | 213 -- .../entitytypes/model_fileentity.go | 45 - .../entitytypes/model_fileentityproperties.go | 13 - .../entitytypes/model_filehashentity.go | 45 - .../model_filehashentityproperties.go | 11 - .../entitytypes/model_geolocation.go | 14 - .../entitytypes/model_hostentity.go | 45 - .../entitytypes/model_hostentityproperties.go | 18 - .../entitytypes/model_huntingbookmark.go | 45 - .../model_huntingbookmarkproperties.go | 62 - .../entitytypes/model_incidentinfo.go | 11 - .../entitytypes/model_iotdeviceentity.go | 45 - .../model_iotdeviceentityproperties.go | 26 - .../entitytypes/model_ipentity.go | 45 - .../entitytypes/model_ipentityproperties.go | 12 - .../entitytypes/model_mailboxentity.go | 45 - .../model_mailboxentityproperties.go | 13 - .../entitytypes/model_mailclusterentity.go | 45 - .../model_mailclusterentityproperties.go | 66 - .../entitytypes/model_mailmessageentity.go | 45 - .../model_mailmessageentityproperties.go | 52 - .../entitytypes/model_malwareentity.go | 45 - .../model_malwareentityproperties.go | 13 - .../entitytypes/model_processentity.go | 45 - .../model_processentityproperties.go | 36 - .../entitytypes/model_registrykeyentity.go | 45 - .../model_registrykeyentityproperties.go | 11 - .../entitytypes/model_registryvalueentity.go | 45 - .../model_registryvalueentityproperties.go | 13 - .../entitytypes/model_securityalert.go | 45 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../entitytypes/model_securitygroupentity.go | 45 - .../model_securitygroupentityproperties.go | 12 - .../entitytypes/model_submissionmailentity.go | 45 - .../model_submissionmailentityproperties.go | 49 - .../entitytypes/model_systemdata.go | 43 - .../entitytypes/model_threatintelligence.go | 13 - .../entitytypes/model_urlentity.go | 45 - .../entitytypes/model_urlentityproperties.go | 10 - .../entitytypes/model_userinfo.go | 10 - .../2021-09-01-preview/entitytypes/version.go | 12 - .../incidentalerts/README.md | 36 - .../incidentalerts/client.go | 26 - .../incidentalerts/constants.go | 494 --- .../incidentalerts/id_incident.go | 141 - .../incidentalerts/id_incident_test.go | 357 --- .../method_incidentslistalerts.go | 55 - .../incidentalerts/model_entity.go | 61 - .../incidentalerts/model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../incidentalerts/model_incidentalertlist.go | 8 - .../incidentalerts/model_incidentinfo.go | 11 - .../incidentalerts/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidentalerts/model_userinfo.go | 10 - .../incidentalerts/version.go | 12 - .../incidentbookmarks/README.md | 36 - .../incidentbookmarks/client.go | 26 - .../incidentbookmarks/constants.go | 494 --- .../incidentbookmarks/id_incident.go | 141 - .../incidentbookmarks/id_incident_test.go | 357 --- .../method_incidentslistbookmarks.go | 55 - .../incidentbookmarks/model_entity.go | 61 - .../model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../model_incidentbookmarklist.go | 8 - .../incidentbookmarks/model_incidentinfo.go | 11 - .../incidentbookmarks/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidentbookmarks/model_userinfo.go | 10 - .../incidentbookmarks/version.go | 12 - .../incidentcomments/README.md | 90 - .../incidentcomments/client.go | 26 - .../incidentcomments/id_comment.go | 150 - .../incidentcomments/id_comment_test.go | 402 --- .../incidentcomments/id_incident.go | 141 - .../incidentcomments/id_incident_test.go | 357 --- .../incidentcomments/method_createorupdate.go | 59 - .../incidentcomments/method_delete.go | 47 - .../incidentcomments/method_get.go | 54 - .../incidentcomments/method_list.go | 127 - .../incidentcomments/model_clientinfo.go | 11 - .../incidentcomments/model_incidentcomment.go | 17 - .../model_incidentcommentproperties.go | 41 - .../incidentcomments/predicates.go | 32 - .../incidentcomments/version.go | 12 - .../incidententities/README.md | 36 - .../incidententities/client.go | 26 - .../incidententities/constants.go | 494 --- .../incidententities/id_incident.go | 141 - .../incidententities/id_incident_test.go | 357 --- .../method_incidentslistentities.go | 55 - .../incidententities/model_entity.go | 61 - .../incidententities/model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../model_incidententitiesresponse.go | 49 - .../model_incidententitiesresultsmetadata.go | 9 - .../incidententities/model_incidentinfo.go | 11 - .../incidententities/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidententities/model_userinfo.go | 10 - .../incidententities/version.go | 12 - .../incidentrelations/README.md | 90 - .../incidentrelations/client.go | 26 - .../incidentrelations/id_incident.go | 141 - .../incidentrelations/id_incident_test.go | 357 --- .../incidentrelations/id_incidentrelation.go | 150 - .../id_incidentrelation_test.go | 402 --- .../method_createorupdate.go | 59 - .../incidentrelations/method_delete.go | 47 - .../incidentrelations/method_get.go | 54 - .../incidentrelations/method_list.go | 127 - .../incidentrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../incidentrelations/predicates.go | 32 - .../incidentrelations/version.go | 12 - .../2021-09-01-preview/incidents/README.md | 90 - .../2021-09-01-preview/incidents/client.go | 26 - .../2021-09-01-preview/incidents/constants.go | 354 -- .../incidents/id_incident.go | 141 - .../incidents/id_incident_test.go | 357 --- .../incidents/id_workspace.go | 130 - .../incidents/id_workspace_test.go | 282 -- .../incidents/method_createorupdate.go | 59 - .../incidents/method_delete.go | 47 - .../incidents/method_get.go | 54 - .../incidents/method_list.go | 127 - .../incidents/model_incident.go | 17 - .../incidents/model_incidentadditionaldata.go | 12 - .../incidents/model_incidentlabel.go | 9 - .../incidents/model_incidentownerinfo.go | 12 - .../incidents/model_incidentproperties.go | 81 - .../incidents/model_teaminformation.go | 30 - .../incidents/predicates.go | 32 - .../2021-09-01-preview/incidents/version.go | 12 - .../2021-09-01-preview/incidentteam/README.md | 41 - .../2021-09-01-preview/incidentteam/client.go | 26 - .../incidentteam/id_incident.go | 141 - .../incidentteam/id_incident_test.go | 357 --- .../method_incidentscreateteam.go | 59 - .../incidentteam/model_teaminformation.go | 30 - .../incidentteam/model_teamproperties.go | 11 - .../incidentteam/version.go | 12 - .../2021-09-01-preview/metadata/README.md | 111 - .../2021-09-01-preview/metadata/client.go | 26 - .../2021-09-01-preview/metadata/constants.go | 219 -- .../metadata/id_metadata.go | 141 - .../metadata/id_metadata_test.go | 357 --- .../metadata/id_workspace.go | 130 - .../metadata/id_workspace_test.go | 282 -- .../metadata/method_create.go | 59 - .../metadata/method_delete.go | 47 - .../2021-09-01-preview/metadata/method_get.go | 54 - .../metadata/method_list.go | 131 - .../metadata/method_update.go | 58 - .../metadata/model_metadataauthor.go | 10 - .../metadata/model_metadatacategories.go | 9 - .../metadata/model_metadatadependencies.go | 13 - .../metadata/model_metadatamodel.go | 17 - .../metadata/model_metadatapatch.go | 17 - .../metadata/model_metadataproperties.go | 19 - .../metadata/model_metadatapropertiespatch.go | 19 - .../metadata/model_metadatasource.go | 10 - .../metadata/model_metadatasupport.go | 11 - .../2021-09-01-preview/metadata/predicates.go | 32 - .../2021-09-01-preview/metadata/version.go | 12 - .../officeconsents/README.md | 69 - .../officeconsents/client.go | 26 - .../officeconsents/id_officeconsent.go | 141 - .../officeconsents/id_officeconsent_test.go | 357 --- .../officeconsents/id_workspace.go | 130 - .../officeconsents/id_workspace_test.go | 282 -- .../officeconsents/method_delete.go | 47 - .../officeconsents/method_get.go | 54 - .../officeconsents/method_list.go | 91 - .../officeconsents/model_officeconsent.go | 16 - .../model_officeconsentproperties.go | 9 - .../officeconsents/predicates.go | 27 - .../officeconsents/version.go | 12 - .../2021-09-01-preview/repositories/README.md | 42 - .../2021-09-01-preview/repositories/client.go | 26 - .../repositories/constants.go | 51 - .../repositories/id_workspace.go | 130 - .../repositories/id_workspace_test.go | 282 -- .../method_sourcecontrollistrepositories.go | 91 - .../repositories/model_repo.go | 10 - .../repositories/predicates.go | 22 - .../repositories/version.go | 12 - .../sentinelonboardingstates/README.md | 89 - .../sentinelonboardingstates/client.go | 26 - .../id_onboardingstate.go | 141 - .../id_onboardingstate_test.go | 357 --- .../sentinelonboardingstates/id_workspace.go | 130 - .../id_workspace_test.go | 282 -- .../sentinelonboardingstates/method_create.go | 59 - .../sentinelonboardingstates/method_delete.go | 47 - .../sentinelonboardingstates/method_get.go | 54 - .../sentinelonboardingstates/method_list.go | 55 - .../model_sentinelonboardingstate.go | 17 - ...model_sentinelonboardingstateproperties.go | 8 - .../model_sentinelonboardingstateslist.go | 8 - .../sentinelonboardingstates/version.go | 12 - .../2021-09-01-preview/settings/README.md | 89 - .../2021-09-01-preview/settings/client.go | 26 - .../2021-09-01-preview/settings/constants.go | 104 - .../2021-09-01-preview/settings/id_setting.go | 141 - .../settings/id_setting_test.go | 357 --- .../settings/id_workspace.go | 130 - .../settings/id_workspace_test.go | 282 -- .../settings/method_productsettingsdelete.go | 47 - .../settings/method_productsettingsget.go | 58 - .../settings/method_productsettingslist.go | 55 - .../settings/method_productsettingsupdate.go | 62 - .../settings/model_anomalies.go | 48 - .../model_anomaliessettingsproperties.go | 8 - .../settings/model_entityanalytics.go | 48 - .../model_entityanalyticsproperties.go | 8 - .../settings/model_eyeson.go | 48 - .../model_eyesonsettingsproperties.go | 8 - .../settings/model_settinglist.go | 41 - .../settings/model_settings.go | 77 - .../2021-09-01-preview/settings/model_ueba.go | 48 - .../settings/model_uebaproperties.go | 8 - .../2021-09-01-preview/settings/version.go | 12 - .../sourcecontrols/README.md | 90 - .../sourcecontrols/client.go | 26 - .../sourcecontrols/constants.go | 92 - .../sourcecontrols/id_sourcecontrol.go | 141 - .../sourcecontrols/id_sourcecontrol_test.go | 357 --- .../sourcecontrols/id_workspace.go | 130 - .../sourcecontrols/id_workspace_test.go | 282 -- .../sourcecontrols/method_create.go | 59 - .../sourcecontrols/method_delete.go | 47 - .../sourcecontrols/method_get.go | 54 - .../sourcecontrols/method_list.go | 91 - .../sourcecontrols/model_contentpathmap.go | 9 - .../sourcecontrols/model_repository.go | 12 - .../sourcecontrols/model_sourcecontrol.go | 17 - .../model_sourcecontrolproperties.go | 13 - .../sourcecontrols/predicates.go | 32 - .../sourcecontrols/version.go | 12 - .../threatintelligence/README.md | 191 -- .../threatintelligence/client.go | 26 - .../threatintelligence/constants.go | 92 - .../threatintelligence/id_indicator.go | 143 - .../threatintelligence/id_indicator_test.go | 387 --- .../threatintelligence/id_workspace.go | 130 - .../threatintelligence/id_workspace_test.go | 282 -- .../method_indicatorappendtags.go | 51 - .../method_indicatorcreate.go | 63 - .../method_indicatorcreateindicator.go | 63 - .../method_indicatordelete.go | 47 - .../threatintelligence/method_indicatorget.go | 58 - .../method_indicatormetricslist.go | 55 - .../method_indicatorqueryindicators.go | 103 - .../method_indicatorreplacetags.go | 63 - .../method_indicatorslist.go | 139 - .../model_threatintelligenceappendtags.go | 8 - ...del_threatintelligenceexternalreference.go | 12 - ...del_threatintelligencefilteringcriteria.go | 20 - ..._threatintelligencegranularmarkingmodel.go | 10 - .../model_threatintelligenceindicatormodel.go | 48 - ...ntelligenceindicatormodelforrequestbody.go | 10 - ...l_threatintelligenceindicatorproperties.go | 37 - .../model_threatintelligenceinformation.go | 53 - .../model_threatintelligencekillchainphase.go | 9 - .../model_threatintelligencemetric.go | 11 - .../model_threatintelligencemetricentity.go | 9 - .../model_threatintelligencemetrics.go | 8 - .../model_threatintelligencemetricslist.go | 8 - .../model_threatintelligenceparsedpattern.go | 9 - ...hreatintelligenceparsedpatterntypevalue.go | 9 - ...model_threatintelligencesortingcriteria.go | 9 - .../threatintelligence/predicates.go | 12 - .../threatintelligence/version.go | 12 - .../watchlistitems/README.md | 90 - .../watchlistitems/client.go | 26 - .../watchlistitems/id_watchlist.go | 141 - .../watchlistitems/id_watchlist_test.go | 357 --- .../watchlistitems/id_watchlistitem.go | 150 - .../watchlistitems/id_watchlistitem_test.go | 402 --- .../watchlistitems/method_createorupdate.go | 59 - .../watchlistitems/method_delete.go | 47 - .../watchlistitems/method_get.go | 54 - .../watchlistitems/method_list.go | 91 - .../watchlistitems/model_userinfo.go | 10 - .../watchlistitems/model_watchlistitem.go | 17 - .../model_watchlistitemproperties.go | 47 - .../watchlistitems/predicates.go | 32 - .../watchlistitems/version.go | 12 - .../2021-09-01-preview/watchlists/README.md | 90 - .../2021-09-01-preview/watchlists/client.go | 26 - .../watchlists/constants.go | 51 - .../watchlists/id_watchlist.go | 141 - .../watchlists/id_watchlist_test.go | 357 --- .../watchlists/id_workspace.go | 130 - .../watchlists/id_workspace_test.go | 282 -- .../watchlists/method_createorupdate.go | 59 - .../watchlists/method_delete.go | 47 - .../watchlists/method_get.go | 54 - .../watchlists/method_list.go | 91 - .../watchlists/model_userinfo.go | 10 - .../watchlists/model_watchlist.go | 17 - .../watchlists/model_watchlistproperties.go | 58 - .../watchlists/predicates.go | 32 - .../2021-09-01-preview/watchlists/version.go | 12 - .../2022-07-01-preview/actions/README.md | 90 - .../2022-07-01-preview/actions/client.go | 26 - .../2022-07-01-preview/actions/id_action.go | 150 - .../actions/id_action_test.go | 402 --- .../actions/id_alertrule.go | 141 - .../actions/id_alertrule_test.go | 357 --- .../actions/method_createorupdate.go | 59 - .../actions/method_delete.go | 47 - .../2022-07-01-preview/actions/method_get.go | 54 - .../actions/method_listbyalertrule.go | 91 - .../actions/model_actionrequest.go | 17 - .../actions/model_actionrequestproperties.go | 9 - .../actions/model_actionresponse.go | 17 - .../actions/model_actionresponseproperties.go | 9 - .../2022-07-01-preview/actions/predicates.go | 32 - .../2022-07-01-preview/actions/version.go | 12 - .../2022-07-01-preview/alertrules/README.md | 90 - .../2022-07-01-preview/alertrules/client.go | 26 - .../alertrules/constants.go | 514 --- .../alertrules/id_alertrule.go | 141 - .../alertrules/id_alertrule_test.go | 357 --- .../alertrules/id_workspace.go | 130 - .../alertrules/id_workspace_test.go | 282 -- .../alertrules/method_createorupdate.go | 63 - .../alertrules/method_delete.go | 47 - .../alertrules/method_get.go | 58 - .../alertrules/method_list.go | 103 - .../alertrules/model_alertdetailsoverride.go | 11 - .../alertrules/model_alertrule.go | 93 - .../alertrules/model_entitymapping.go | 9 - .../alertrules/model_eventgroupingsettings.go | 8 - .../alertrules/model_fieldmapping.go | 9 - .../alertrules/model_fusionalertrule.go | 48 - .../model_fusionalertruleproperties.go | 35 - .../model_fusionscenarioexclusionpattern.go | 9 - .../alertrules/model_fusionsourcesettings.go | 10 - .../model_fusionsourcesubtypesetting.go | 11 - .../model_fusionsubtypeseverityfilter.go | 9 - .../model_fusionsubtypeseverityfiltersitem.go | 9 - .../alertrules/model_groupingconfiguration.go | 14 - .../alertrules/model_incidentconfiguration.go | 9 - ...rosoftsecurityincidentcreationalertrule.go | 48 - ...rityincidentcreationalertruleproperties.go | 34 - .../model_mlbehavioranalyticsalertrule.go | 48 - ..._mlbehavioranalyticsalertruleproperties.go | 33 - .../alertrules/model_nrtalertrule.go | 48 - .../model_nrtalertruleproperties.go | 41 - .../alertrules/model_scheduledalertrule.go | 48 - .../model_scheduledalertruleproperties.go | 46 - .../model_threatintelligencealertrule.go | 48 - ...l_threatintelligencealertruleproperties.go | 33 - .../alertrules/predicates.go | 12 - .../2022-07-01-preview/alertrules/version.go | 12 - .../alertruletemplates/README.md | 53 - .../alertruletemplates/client.go | 26 - .../alertruletemplates/constants.go | 473 --- .../id_alertruletemplate.go | 141 - .../id_alertruletemplate_test.go | 357 --- .../alertruletemplates/id_workspace.go | 130 - .../alertruletemplates/id_workspace_test.go | 282 -- .../alertruletemplates/method_get.go | 58 - .../alertruletemplates/method_list.go | 103 - .../model_alertdetailsoverride.go | 11 - .../model_alertruletemplate.go | 93 - .../model_alertruletemplatedatasource.go | 9 - .../alertruletemplates/model_entitymapping.go | 9 - .../model_eventgroupingsettings.go | 8 - .../alertruletemplates/model_fieldmapping.go | 9 - .../model_fusionalertruletemplate.go | 47 - ...model_fusionalertruletemplateproperties.go | 48 - .../model_fusiontemplatesourcesetting.go | 9 - .../model_fusiontemplatesourcesubtype.go | 10 - ...del_fusiontemplatesubtypeseverityfilter.go | 9 - ...curityincidentcreationalertruletemplate.go | 47 - ...dentcreationalertruletemplateproperties.go | 48 - ...el_mlbehavioranalyticsalertruletemplate.go | 47 - ...ioranalyticsalertruletemplateproperties.go | 10 - .../model_nrtalertruletemplate.go | 47 - .../model_nrtalertruletemplateproperties.go | 15 - .../model_scheduledalertruletemplate.go | 47 - ...el_scheduledalertruletemplateproperties.go | 57 - ...del_threatintelligencealertruletemplate.go | 47 - ...intelligencealertruletemplateproperties.go | 10 - .../alertruletemplates/predicates.go | 12 - .../alertruletemplates/version.go | 12 - .../automationrules/README.md | 90 - .../automationrules/client.go | 26 - .../automationrules/constants.go | 876 ----- .../automationrules/id_automationrule.go | 141 - .../automationrules/id_automationrule_test.go | 357 --- .../automationrules/id_workspace.go | 130 - .../automationrules/id_workspace_test.go | 282 -- .../automationrules/method_createorupdate.go | 59 - .../automationrules/method_delete.go | 55 - .../automationrules/method_get.go | 54 - .../automationrules/method_list.go | 91 - .../automationrules/model_automationrule.go | 17 - .../model_automationruleaction.go | 61 - .../model_automationrulecondition.go | 69 - ...el_automationrulemodifypropertiesaction.go | 42 - .../model_automationruleproperties.go | 88 - ...rulepropertyarraychangedvaluescondition.go | 9 - ...ationrulepropertyvalueschangedcondition.go | 11 - ...l_automationrulepropertyvaluescondition.go | 10 - .../model_automationrulerunplaybookaction.go | 42 - .../model_automationruletriggeringlogic.go | 70 - .../automationrules/model_clientinfo.go | 11 - .../automationrules/model_incidentlabel.go | 9 - .../model_incidentownerinfo.go | 12 - .../model_incidentpropertiesaction.go | 14 - .../model_playbookactionproperties.go | 9 - ...propertyarraychangedconditionproperties.go | 41 - ...odel_propertychangedconditionproperties.go | 41 - .../model_propertyconditionproperties.go | 41 - .../automationrules/predicates.go | 32 - .../automationrules/version.go | 12 - .../2022-07-01-preview/bookmark/README.md | 41 - .../2022-07-01-preview/bookmark/client.go | 26 - .../2022-07-01-preview/bookmark/constants.go | 111 - .../bookmark/id_bookmark.go | 141 - .../bookmark/id_bookmark_test.go | 357 --- .../bookmark/method_expand.go | 59 - .../model_bookmarkexpandparameters.go | 40 - .../bookmark/model_bookmarkexpandresponse.go | 9 - .../model_bookmarkexpandresponsevalue.go | 9 - .../bookmark/model_connectedentity.go | 9 - .../bookmark/model_entity.go | 16 - .../model_expansionresultaggregation.go | 11 - .../model_expansionresultsmetadata.go | 8 - .../2022-07-01-preview/bookmark/version.go | 12 - .../bookmarkrelations/README.md | 90 - .../bookmarkrelations/client.go | 26 - .../bookmarkrelations/id_bookmark.go | 141 - .../bookmarkrelations/id_bookmark_test.go | 357 --- .../bookmarkrelations/id_bookmarkrelation.go | 150 - .../id_bookmarkrelation_test.go | 402 --- .../method_createorupdate.go | 59 - .../bookmarkrelations/method_delete.go | 47 - .../bookmarkrelations/method_get.go | 54 - .../bookmarkrelations/method_list.go | 127 - .../bookmarkrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../bookmarkrelations/predicates.go | 32 - .../bookmarkrelations/version.go | 12 - .../2022-07-01-preview/bookmarks/README.md | 90 - .../2022-07-01-preview/bookmarks/client.go | 26 - .../2022-07-01-preview/bookmarks/constants.go | 143 - .../bookmarks/id_bookmark.go | 141 - .../bookmarks/id_bookmark_test.go | 357 --- .../bookmarks/id_workspace.go | 130 - .../bookmarks/id_workspace_test.go | 282 -- .../bookmarks/method_createorupdate.go | 59 - .../bookmarks/method_delete.go | 47 - .../bookmarks/method_get.go | 54 - .../bookmarks/method_list.go | 91 - .../bookmarks/model_bookmark.go | 17 - .../bookmarks/model_bookmarkentitymappings.go | 9 - .../bookmarks/model_bookmarkproperties.go | 89 - .../bookmarks/model_entityfieldmapping.go | 9 - .../bookmarks/model_incidentinfo.go | 11 - .../bookmarks/model_userinfo.go | 10 - .../bookmarks/predicates.go | 32 - .../2022-07-01-preview/bookmarks/version.go | 12 - .../checkdataconnectorrequirements/README.md | 41 - .../checkdataconnectorrequirements/client.go | 26 - .../constants.go | 190 -- .../id_workspace.go | 130 - .../id_workspace_test.go | 282 -- ...hod_dataconnectorscheckrequirementspost.go | 59 - .../model_aadcheckrequirements.go | 41 - .../model_aatpcheckrequirements.go | 41 - .../model_asccheckrequirements.go | 41 - .../model_asccheckrequirementsproperties.go | 8 - .../model_awscloudtrailcheckrequirements.go | 40 - .../model_awss3checkrequirements.go | 40 - .../model_dataconnectorrequirementsstate.go | 9 - .../model_dataconnectorscheckrequirements.go | 181 -- .../model_dataconnectortenantid.go | 8 - .../model_dynamics365checkrequirements.go | 41 - .../model_iotcheckrequirements.go | 41 - .../model_iotcheckrequirementsproperties.go | 8 - .../model_mcascheckrequirements.go | 41 - .../model_mdatpcheckrequirements.go | 41 - .../model_msticheckrequirements.go | 41 - .../model_mtpcheckrequirements.go | 41 - ...model_office365projectcheckrequirements.go | 41 - .../model_officeatpcheckrequirements.go | 41 - .../model_officeirmcheckrequirements.go | 41 - .../model_officepowerbicheckrequirements.go | 41 - .../model_ticheckrequirements.go | 41 - .../model_titaxiicheckrequirements.go | 41 - .../checkdataconnectorrequirements/version.go | 12 - .../2022-07-01-preview/client.go | 325 -- .../dataconnectors/README.md | 90 - .../dataconnectors/client.go | 26 - .../dataconnectors/constants.go | 381 --- .../dataconnectors/id_dataconnector.go | 141 - .../dataconnectors/id_dataconnector_test.go | 357 --- .../dataconnectors/id_workspace.go | 130 - .../dataconnectors/id_workspace_test.go | 282 -- .../dataconnectors/method_createorupdate.go | 63 - .../dataconnectors/method_delete.go | 47 - .../dataconnectors/method_get.go | 58 - .../dataconnectors/method_list.go | 103 - .../dataconnectors/model_aaddataconnector.go | 48 - .../model_aaddataconnectorproperties.go | 9 - .../dataconnectors/model_aatpdataconnector.go | 48 - .../model_aatpdataconnectorproperties.go | 9 - .../model_alertsdatatypeofdataconnector.go | 8 - .../model_apipollingparameters.go | 9 - .../dataconnectors/model_ascdataconnector.go | 48 - .../model_ascdataconnectorproperties.go | 9 - .../dataconnectors/model_availability.go | 9 - .../model_awscloudtraildataconnector.go | 48 - ...del_awscloudtraildataconnectordatatypes.go | 8 - ...el_awscloudtraildataconnectorproperties.go | 9 - .../model_awss3dataconnector.go | 48 - .../model_awss3dataconnectordatatypes.go | 8 - .../model_awss3dataconnectorproperties.go | 11 - .../model_codelessapipollingdataconnector.go | 48 - ..._codelessconnectorpollingauthproperties.go | 20 - ...odelessconnectorpollingconfigproperties.go | 12 - ...odelessconnectorpollingpagingproperties.go | 16 - ...delessconnectorpollingrequestproperties.go | 19 - ...elessconnectorpollingresponseproperties.go | 11 - .../model_codelessparameters.go | 8 - ...del_codelessuiconnectorconfigproperties.go | 19 - .../model_codelessuidataconnector.go | 48 - .../model_connectivitycriteria.go | 9 - .../model_connectorinstructionmodelbase.go | 9 - .../dataconnectors/model_customspermission.go | 9 - .../dataconnectors/model_dataconnector.go | 205 -- .../model_dataconnectordatatypecommon.go | 8 - .../model_dynamics365dataconnector.go | 48 - ...model_dynamics365dataconnectordatatypes.go | 8 - ...odel_dynamics365dataconnectorproperties.go | 9 - .../dataconnectors/model_graphqueries.go | 10 - .../dataconnectors/model_instructionsteps.go | 10 - .../dataconnectors/model_iotdataconnector.go | 48 - .../model_iotdataconnectorproperties.go | 9 - .../model_lastdatareceiveddatatype.go | 9 - .../dataconnectors/model_mcasdataconnector.go | 48 - .../model_mcasdataconnectordatatypes.go | 9 - .../model_mcasdataconnectorproperties.go | 9 - .../model_mdatpdataconnector.go | 48 - .../model_mdatpdataconnectorproperties.go | 9 - .../dataconnectors/model_mstidataconnector.go | 48 - .../model_mstidataconnectordatatypes.go | 9 - ...connectordatatypesbingsafetyphishingurl.go | 9 - ...tordatatypesmicrosoftemergingthreatfeed.go | 9 - .../model_mstidataconnectorproperties.go | 9 - .../dataconnectors/model_mtpdataconnector.go | 48 - .../model_mtpdataconnectordatatypes.go | 8 - .../model_mtpdataconnectorproperties.go | 9 - ...odel_office365projectconnectordatatypes.go | 8 - .../model_office365projectdataconnector.go | 48 - ...office365projectdataconnectorproperties.go | 9 - .../model_officeatpdataconnector.go | 48 - .../model_officeatpdataconnectorproperties.go | 9 - .../model_officedataconnector.go | 48 - .../model_officedataconnectordatatypes.go | 10 - .../model_officedataconnectorproperties.go | 9 - .../model_officeirmdataconnector.go | 48 - .../model_officeirmdataconnectorproperties.go | 9 - .../model_officepowerbiconnectordatatypes.go | 8 - .../model_officepowerbidataconnector.go | 48 - ...el_officepowerbidataconnectorproperties.go | 9 - .../dataconnectors/model_permissions.go | 9 - .../model_requiredpermissions.go | 11 - .../dataconnectors/model_resourceprovider.go | 12 - .../dataconnectors/model_samplequeries.go | 9 - .../dataconnectors/model_tidataconnector.go | 48 - .../model_tidataconnectordatatypes.go | 8 - .../model_tidataconnectorproperties.go | 28 - .../model_titaxiidataconnector.go | 48 - .../model_titaxiidataconnectordatatypes.go | 8 - .../model_titaxiidataconnectorproperties.go | 35 - .../dataconnectors/predicates.go | 12 - .../dataconnectors/version.go | 12 - .../dataconnectorsconnect/README.md | 41 - .../dataconnectorsconnect/client.go | 26 - .../dataconnectorsconnect/constants.go | 54 - .../dataconnectorsconnect/id_dataconnector.go | 141 - .../id_dataconnector_test.go | 357 --- .../method_dataconnectorsconnect.go | 51 - .../model_dataconnectorconnectbody.go | 18 - .../dataconnectorsconnect/version.go | 12 - .../dataconnectorsdisconnect/client.go | 26 - .../id_dataconnector.go | 141 - .../id_dataconnector_test.go | 357 --- .../method_dataconnectorsdisconnect.go | 47 - .../dataconnectorsdisconnect/version.go | 12 - .../2022-07-01-preview/enrichment/README.md | 53 - .../2022-07-01-preview/enrichment/client.go | 26 - .../enrichment/method_domainwhoisget.go | 84 - .../enrichment/method_ipgeodataget.go | 84 - .../enrichment/model_enrichmentdomainwhois.go | 55 - .../model_enrichmentdomainwhoiscontact.go | 17 - .../model_enrichmentdomainwhoiscontacts.go | 11 - .../model_enrichmentdomainwhoisdetails.go | 11 - ...l_enrichmentdomainwhoisregistrardetails.go | 13 - .../enrichment/model_enrichmentipgeodata.go | 24 - .../2022-07-01-preview/enrichment/version.go | 12 - .../2022-07-01-preview/entities/README.md | 132 - .../2022-07-01-preview/entities/client.go | 26 - .../2022-07-01-preview/entities/constants.go | 473 --- .../2022-07-01-preview/entities/id_entity.go | 141 - .../entities/id_entity_test.go | 357 --- .../entities/id_workspace.go | 130 - .../entities/id_workspace_test.go | 282 -- .../entities/method_expand.go | 59 - .../2022-07-01-preview/entities/method_get.go | 54 - .../entities/method_getinsights.go | 59 - .../entities/method_gettimelinelist.go | 59 - .../entities/method_list.go | 91 - .../entities/method_queries.go | 83 - .../entities/model_activitytimelineitem.go | 47 - .../entities/model_anomalytimelineitem.go | 51 - .../entities/model_bookmarktimelineitem.go | 48 - .../entities/model_entity.go | 16 - .../entities/model_entityedges.go | 9 - .../entities/model_entityexpandparameters.go | 40 - .../entities/model_entityexpandresponse.go | 9 - .../model_entityexpandresponsevalue.go | 9 - .../model_entitygetinsightsparameters.go | 35 - .../model_entitygetinsightsresponse.go | 9 - .../entities/model_entityinsightitem.go | 11 - ...odel_entityinsightitemquerytimeinterval.go | 39 - .../entities/model_entityqueryitem.go | 53 - ...tityqueryitempropertiesdatatypesinlined.go | 8 - .../entities/model_entitytimelineitem.go | 77 - .../model_entitytimelineparameters.go | 35 - .../entities/model_entitytimelineresponse.go | 49 - .../model_expansionresultaggregation.go | 11 - .../model_expansionresultsmetadata.go | 8 - .../entities/model_getinsightserrorkind.go | 10 - .../model_getinsightsresultsmetadata.go | 9 - .../entities/model_getqueriesresponse.go | 41 - .../entities/model_insightqueryitem.go | 44 - .../model_insightqueryitemproperties.go | 19 - ...sightqueryitempropertiesadditionalquery.go | 9 - ...ightqueryitempropertiesdefaulttimerange.go | 9 - ...htqueryitempropertiesreferencetimerange.go | 8 - ...el_insightqueryitempropertiestablequery.go | 9 - ...tiestablequerycolumnsdefinitionsinlined.go | 10 - ...tiestablequeryqueriesdefinitionsinlined.go | 11 - ...onsinlinedlinkcolumnsdefinitionsinlined.go | 9 - .../entities/model_insightstableresult.go | 9 - ...model_insightstableresultcolumnsinlined.go | 9 - .../model_securityalerttimelineitem.go | 49 - .../entities/model_timelineaggregation.go | 9 - .../entities/model_timelineerror.go | 10 - .../entities/model_timelineresultsmetadata.go | 10 - .../entities/model_userinfo.go | 10 - .../2022-07-01-preview/entities/predicates.go | 27 - .../2022-07-01-preview/entities/version.go | 12 - .../entityqueries/README.md | 123 - .../entityqueries/client.go | 26 - .../entityqueries/constants.go | 272 -- .../entityqueries/id_entityquery.go | 141 - .../entityqueries/id_entityquery_test.go | 357 --- .../entityqueries/id_entityquerytemplate.go | 141 - .../id_entityquerytemplate_test.go | 357 --- .../entityqueries/id_workspace.go | 130 - .../entityqueries/id_workspace_test.go | 282 -- .../entityqueries/method_createorupdate.go | 63 - .../entityqueries/method_delete.go | 47 - .../method_entityquerytemplatesget.go | 58 - .../method_entityquerytemplateslist.go | 131 - .../entityqueries/method_get.go | 58 - .../entityqueries/method_list.go | 131 - .../model_activitycustomentityquery.go | 48 - .../model_activityentityqueriesproperties.go | 48 - ...entityqueriespropertiesquerydefinitions.go | 8 - .../model_activityentityquery.go | 48 - .../model_activityentityquerytemplate.go | 47 - ...l_activityentityquerytemplateproperties.go | 15 - ...querytemplatepropertiesquerydefinitions.go | 9 - .../entityqueries/model_customentityquery.go | 53 - .../model_datatypedefinitions.go | 8 - .../entityqueries/model_entityquery.go | 61 - .../model_entityquerytemplate.go | 53 - .../model_expansionentityqueriesproperties.go | 13 - .../model_expansionentityquery.go | 48 - .../entityqueries/predicates.go | 20 - .../entityqueries/version.go | 12 - .../entityrelations/README.md | 53 - .../entityrelations/client.go | 26 - .../entityrelations/id_entity.go | 141 - .../entityrelations/id_entity_test.go | 357 --- .../entityrelations/id_relation.go | 150 - .../entityrelations/id_relation_test.go | 402 --- .../method_entitiesrelationslist.go | 127 - .../entityrelations/method_getrelation.go | 54 - .../entityrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../entityrelations/predicates.go | 32 - .../entityrelations/version.go | 12 - .../2022-07-01-preview/entitytypes/README.md | 21 - .../2022-07-01-preview/entitytypes/client.go | 26 - .../entitytypes/constants.go | 1030 ------ .../entitytypes/model_accountentity.go | 45 - .../model_accountentityproperties.go | 21 - .../entitytypes/model_azureresourceentity.go | 45 - .../model_azureresourceentityproperties.go | 11 - .../model_cloudapplicationentity.go | 45 - .../model_cloudapplicationentityproperties.go | 12 - .../entitytypes/model_dnsentity.go | 45 - .../entitytypes/model_dnsentityproperties.go | 13 - .../entitytypes/model_entity.go | 221 -- .../entitytypes/model_fileentity.go | 45 - .../entitytypes/model_fileentityproperties.go | 13 - .../entitytypes/model_filehashentity.go | 45 - .../model_filehashentityproperties.go | 11 - .../entitytypes/model_geolocation.go | 14 - .../entitytypes/model_hostentity.go | 45 - .../entitytypes/model_hostentityproperties.go | 18 - .../entitytypes/model_huntingbookmark.go | 45 - .../model_huntingbookmarkproperties.go | 62 - .../entitytypes/model_incidentinfo.go | 11 - .../entitytypes/model_iotdeviceentity.go | 45 - .../model_iotdeviceentityproperties.go | 37 - .../entitytypes/model_ipentity.go | 45 - .../entitytypes/model_ipentityproperties.go | 12 - .../entitytypes/model_mailboxentity.go | 45 - .../model_mailboxentityproperties.go | 13 - .../entitytypes/model_mailclusterentity.go | 45 - .../model_mailclusterentityproperties.go | 66 - .../entitytypes/model_mailmessageentity.go | 45 - .../model_mailmessageentityproperties.go | 52 - .../entitytypes/model_malwareentity.go | 45 - .../model_malwareentityproperties.go | 13 - .../entitytypes/model_nicentity.go | 45 - .../entitytypes/model_nicentityproperties.go | 12 - .../entitytypes/model_processentity.go | 45 - .../model_processentityproperties.go | 36 - .../entitytypes/model_registrykeyentity.go | 45 - .../model_registrykeyentityproperties.go | 11 - .../entitytypes/model_registryvalueentity.go | 45 - .../model_registryvalueentityproperties.go | 13 - .../entitytypes/model_securityalert.go | 45 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../entitytypes/model_securitygroupentity.go | 45 - .../model_securitygroupentityproperties.go | 12 - .../entitytypes/model_submissionmailentity.go | 45 - .../model_submissionmailentityproperties.go | 49 - .../entitytypes/model_systemdata.go | 43 - .../entitytypes/model_threatintelligence.go | 13 - .../entitytypes/model_urlentity.go | 45 - .../entitytypes/model_urlentityproperties.go | 10 - .../entitytypes/model_userinfo.go | 10 - .../2022-07-01-preview/entitytypes/version.go | 12 - .../incidentalerts/README.md | 36 - .../incidentalerts/client.go | 26 - .../incidentalerts/constants.go | 509 --- .../incidentalerts/id_incident.go | 141 - .../incidentalerts/id_incident_test.go | 357 --- .../method_incidentslistalerts.go | 55 - .../incidentalerts/model_entity.go | 61 - .../incidentalerts/model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../incidentalerts/model_incidentalertlist.go | 8 - .../incidentalerts/model_incidentinfo.go | 11 - .../incidentalerts/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidentalerts/model_userinfo.go | 10 - .../incidentalerts/version.go | 12 - .../incidentbookmarks/README.md | 36 - .../incidentbookmarks/client.go | 26 - .../incidentbookmarks/constants.go | 509 --- .../incidentbookmarks/id_incident.go | 141 - .../incidentbookmarks/id_incident_test.go | 357 --- .../method_incidentslistbookmarks.go | 55 - .../incidentbookmarks/model_entity.go | 61 - .../model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../model_incidentbookmarklist.go | 8 - .../incidentbookmarks/model_incidentinfo.go | 11 - .../incidentbookmarks/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidentbookmarks/model_userinfo.go | 10 - .../incidentbookmarks/version.go | 12 - .../incidentcomments/README.md | 90 - .../incidentcomments/client.go | 26 - .../incidentcomments/id_comment.go | 150 - .../incidentcomments/id_comment_test.go | 402 --- .../incidentcomments/id_incident.go | 141 - .../incidentcomments/id_incident_test.go | 357 --- .../incidentcomments/method_createorupdate.go | 59 - .../incidentcomments/method_delete.go | 47 - .../incidentcomments/method_get.go | 54 - .../incidentcomments/method_list.go | 127 - .../incidentcomments/model_clientinfo.go | 11 - .../incidentcomments/model_incidentcomment.go | 17 - .../model_incidentcommentproperties.go | 41 - .../incidentcomments/predicates.go | 32 - .../incidentcomments/version.go | 12 - .../incidententities/README.md | 36 - .../incidententities/client.go | 26 - .../incidententities/constants.go | 509 --- .../incidententities/id_incident.go | 141 - .../incidententities/id_incident_test.go | 357 --- .../method_incidentslistentities.go | 55 - .../incidententities/model_entity.go | 61 - .../incidententities/model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../model_incidententitiesresponse.go | 49 - .../model_incidententitiesresultsmetadata.go | 9 - .../incidententities/model_incidentinfo.go | 11 - .../incidententities/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidententities/model_userinfo.go | 10 - .../incidententities/version.go | 12 - .../incidentrelations/README.md | 90 - .../incidentrelations/client.go | 26 - .../incidentrelations/id_incident.go | 141 - .../incidentrelations/id_incident_test.go | 357 --- .../incidentrelations/id_incidentrelation.go | 150 - .../id_incidentrelation_test.go | 402 --- .../method_createorupdate.go | 59 - .../incidentrelations/method_delete.go | 47 - .../incidentrelations/method_get.go | 54 - .../incidentrelations/method_list.go | 127 - .../incidentrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../incidentrelations/predicates.go | 32 - .../incidentrelations/version.go | 12 - .../2022-07-01-preview/incidents/README.md | 90 - .../2022-07-01-preview/incidents/client.go | 26 - .../2022-07-01-preview/incidents/constants.go | 366 --- .../incidents/id_incident.go | 141 - .../incidents/id_incident_test.go | 357 --- .../incidents/id_workspace.go | 130 - .../incidents/id_workspace_test.go | 282 -- .../incidents/method_createorupdate.go | 59 - .../incidents/method_delete.go | 47 - .../incidents/method_get.go | 54 - .../incidents/method_list.go | 127 - .../incidents/model_incident.go | 17 - .../incidents/model_incidentadditionaldata.go | 14 - .../incidents/model_incidentlabel.go | 9 - .../incidents/model_incidentownerinfo.go | 12 - .../incidents/model_incidentproperties.go | 81 - .../incidents/model_teaminformation.go | 30 - .../incidents/predicates.go | 32 - .../2022-07-01-preview/incidents/version.go | 12 - .../2022-07-01-preview/incidentteam/README.md | 41 - .../2022-07-01-preview/incidentteam/client.go | 26 - .../incidentteam/id_incident.go | 141 - .../incidentteam/id_incident_test.go | 357 --- .../method_incidentscreateteam.go | 59 - .../incidentteam/model_teaminformation.go | 30 - .../incidentteam/model_teamproperties.go | 11 - .../incidentteam/version.go | 12 - .../manualtrigger/README.md | 41 - .../manualtrigger/client.go | 26 - .../manualtrigger/id_incident.go | 141 - .../manualtrigger/id_incident_test.go | 357 --- .../method_incidentsrunplaybook.go | 59 - .../model_manualtriggerrequestbody.go | 9 - .../manualtrigger/version.go | 12 - .../2022-07-01-preview/metadata/README.md | 111 - .../2022-07-01-preview/metadata/client.go | 26 - .../2022-07-01-preview/metadata/constants.go | 228 -- .../metadata/id_metadata.go | 141 - .../metadata/id_metadata_test.go | 357 --- .../metadata/id_workspace.go | 130 - .../metadata/id_workspace_test.go | 282 -- .../metadata/method_create.go | 59 - .../metadata/method_delete.go | 47 - .../2022-07-01-preview/metadata/method_get.go | 54 - .../metadata/method_list.go | 131 - .../metadata/method_update.go | 58 - .../metadata/model_metadataauthor.go | 10 - .../metadata/model_metadatacategories.go | 9 - .../metadata/model_metadatadependencies.go | 13 - .../metadata/model_metadatamodel.go | 17 - .../metadata/model_metadatapatch.go | 17 - .../metadata/model_metadataproperties.go | 26 - .../metadata/model_metadatapropertiespatch.go | 26 - .../metadata/model_metadatasource.go | 10 - .../metadata/model_metadatasupport.go | 11 - .../2022-07-01-preview/metadata/predicates.go | 32 - .../2022-07-01-preview/metadata/version.go | 12 - .../officeconsents/README.md | 69 - .../officeconsents/client.go | 26 - .../officeconsents/id_officeconsent.go | 141 - .../officeconsents/id_officeconsent_test.go | 357 --- .../officeconsents/id_workspace.go | 130 - .../officeconsents/id_workspace_test.go | 282 -- .../officeconsents/method_delete.go | 47 - .../officeconsents/method_get.go | 54 - .../officeconsents/method_list.go | 91 - .../officeconsents/model_officeconsent.go | 16 - .../model_officeconsentproperties.go | 9 - .../officeconsents/predicates.go | 27 - .../officeconsents/version.go | 12 - .../2022-07-01-preview/repositories/README.md | 42 - .../2022-07-01-preview/repositories/client.go | 26 - .../repositories/constants.go | 51 - .../repositories/id_workspace.go | 130 - .../repositories/id_workspace_test.go | 282 -- .../method_sourcecontrollistrepositories.go | 91 - .../repositories/model_repo.go | 10 - .../repositories/predicates.go | 22 - .../repositories/version.go | 12 - .../securitymlanalyticssettings/README.md | 90 - .../securitymlanalyticssettings/client.go | 26 - .../securitymlanalyticssettings/constants.go | 175 - .../id_securitymlanalyticssetting.go | 141 - .../id_securitymlanalyticssetting_test.go | 357 --- .../id_workspace.go | 130 - .../id_workspace_test.go | 282 -- .../method_createorupdate.go | 63 - .../method_delete.go | 47 - .../securitymlanalyticssettings/method_get.go | 58 - .../method_list.go | 103 - ...odel_anomalysecuritymlanalyticssettings.go | 48 - ...lysecuritymlanalyticssettingsproperties.go | 39 - .../model_securitymlanalyticssetting.go | 53 - ...l_securitymlanalyticssettingsdatasource.go | 9 - .../securitymlanalyticssettings/predicates.go | 12 - .../securitymlanalyticssettings/version.go | 12 - .../sentinelonboardingstates/README.md | 89 - .../sentinelonboardingstates/client.go | 26 - .../id_onboardingstate.go | 141 - .../id_onboardingstate_test.go | 357 --- .../sentinelonboardingstates/id_workspace.go | 130 - .../id_workspace_test.go | 282 -- .../sentinelonboardingstates/method_create.go | 59 - .../sentinelonboardingstates/method_delete.go | 47 - .../sentinelonboardingstates/method_get.go | 54 - .../sentinelonboardingstates/method_list.go | 55 - .../model_sentinelonboardingstate.go | 17 - ...model_sentinelonboardingstateproperties.go | 8 - .../model_sentinelonboardingstateslist.go | 8 - .../sentinelonboardingstates/version.go | 12 - .../2022-07-01-preview/settings/README.md | 89 - .../2022-07-01-preview/settings/client.go | 26 - .../2022-07-01-preview/settings/constants.go | 145 - .../2022-07-01-preview/settings/id_setting.go | 141 - .../settings/id_setting_test.go | 357 --- .../settings/id_workspace.go | 130 - .../settings/id_workspace_test.go | 282 -- .../settings/method_productsettingsdelete.go | 47 - .../settings/method_productsettingsget.go | 58 - .../settings/method_productsettingslist.go | 55 - .../settings/method_productsettingsupdate.go | 62 - .../settings/model_anomalies.go | 48 - .../model_anomaliessettingsproperties.go | 8 - .../settings/model_entityanalytics.go | 48 - .../model_entityanalyticsproperties.go | 8 - .../settings/model_eyeson.go | 48 - .../model_eyesonsettingsproperties.go | 8 - .../settings/model_settinglist.go | 41 - .../settings/model_settings.go | 77 - .../2022-07-01-preview/settings/model_ueba.go | 48 - .../settings/model_uebaproperties.go | 8 - .../2022-07-01-preview/settings/version.go | 12 - .../sourcecontrols/README.md | 90 - .../sourcecontrols/client.go | 26 - .../sourcecontrols/constants.go | 268 -- .../sourcecontrols/id_sourcecontrol.go | 141 - .../sourcecontrols/id_sourcecontrol_test.go | 357 --- .../sourcecontrols/id_workspace.go | 130 - .../sourcecontrols/id_workspace_test.go | 282 -- .../sourcecontrols/method_create.go | 59 - .../sourcecontrols/method_delete.go | 47 - .../sourcecontrols/method_get.go | 54 - .../sourcecontrols/method_list.go | 91 - .../model_azuredevopsresourceinfo.go | 9 - .../sourcecontrols/model_contentpathmap.go | 9 - .../sourcecontrols/model_deployment.go | 30 - .../sourcecontrols/model_deploymentinfo.go | 10 - .../model_githubresourceinfo.go | 8 - .../sourcecontrols/model_repository.go | 12 - .../model_repositoryresourceinfo.go | 10 - .../sourcecontrols/model_sourcecontrol.go | 17 - .../model_sourcecontrolproperties.go | 16 - .../sourcecontrols/model_webhook.go | 11 - .../sourcecontrols/predicates.go | 32 - .../sourcecontrols/version.go | 12 - .../threatintelligence/README.md | 191 -- .../threatintelligence/client.go | 26 - .../threatintelligence/constants.go | 92 - .../threatintelligence/id_indicator.go | 143 - .../threatintelligence/id_indicator_test.go | 387 --- .../threatintelligence/id_workspace.go | 130 - .../threatintelligence/id_workspace_test.go | 282 -- .../method_indicatorappendtags.go | 51 - .../method_indicatorcreate.go | 63 - .../method_indicatorcreateindicator.go | 63 - .../method_indicatordelete.go | 47 - .../threatintelligence/method_indicatorget.go | 58 - .../method_indicatormetricslist.go | 55 - .../method_indicatorqueryindicators.go | 103 - .../method_indicatorreplacetags.go | 63 - .../method_indicatorslist.go | 139 - .../model_threatintelligenceappendtags.go | 8 - ...del_threatintelligenceexternalreference.go | 12 - ...del_threatintelligencefilteringcriteria.go | 20 - ..._threatintelligencegranularmarkingmodel.go | 10 - .../model_threatintelligenceindicatormodel.go | 48 - ...l_threatintelligenceindicatorproperties.go | 37 - .../model_threatintelligenceinformation.go | 53 - .../model_threatintelligencekillchainphase.go | 9 - .../model_threatintelligencemetric.go | 11 - .../model_threatintelligencemetricentity.go | 9 - .../model_threatintelligencemetrics.go | 8 - .../model_threatintelligencemetricslist.go | 8 - .../model_threatintelligenceparsedpattern.go | 9 - ...hreatintelligenceparsedpatterntypevalue.go | 9 - ...model_threatintelligencesortingcriteria.go | 9 - .../threatintelligence/predicates.go | 12 - .../threatintelligence/version.go | 12 - .../watchlistitems/README.md | 90 - .../watchlistitems/client.go | 26 - .../watchlistitems/id_watchlist.go | 141 - .../watchlistitems/id_watchlist_test.go | 357 --- .../watchlistitems/id_watchlistitem.go | 150 - .../watchlistitems/id_watchlistitem_test.go | 402 --- .../watchlistitems/method_createorupdate.go | 59 - .../watchlistitems/method_delete.go | 47 - .../watchlistitems/method_get.go | 54 - .../watchlistitems/method_list.go | 91 - .../watchlistitems/model_userinfo.go | 10 - .../watchlistitems/model_watchlistitem.go | 17 - .../model_watchlistitemproperties.go | 47 - .../watchlistitems/predicates.go | 32 - .../watchlistitems/version.go | 12 - .../2022-07-01-preview/watchlists/README.md | 90 - .../2022-07-01-preview/watchlists/client.go | 26 - .../watchlists/constants.go | 51 - .../watchlists/id_watchlist.go | 141 - .../watchlists/id_watchlist_test.go | 357 --- .../watchlists/id_workspace.go | 130 - .../watchlists/id_workspace_test.go | 282 -- .../watchlists/method_createorupdate.go | 59 - .../watchlists/method_delete.go | 47 - .../watchlists/method_get.go | 54 - .../watchlists/method_list.go | 91 - .../watchlists/model_userinfo.go | 10 - .../watchlists/model_watchlist.go | 17 - .../watchlists/model_watchlistproperties.go | 58 - .../watchlists/predicates.go | 32 - .../2022-07-01-preview/watchlists/version.go | 12 - .../2022-08-01/actions/README.md | 90 - .../2022-08-01/actions/client.go | 26 - .../2022-08-01/actions/id_action.go | 150 - .../2022-08-01/actions/id_action_test.go | 402 --- .../2022-08-01/actions/id_alertrule.go | 141 - .../2022-08-01/actions/id_alertrule_test.go | 357 --- .../actions/method_createorupdate.go | 59 - .../2022-08-01/actions/method_delete.go | 47 - .../2022-08-01/actions/method_get.go | 54 - .../actions/method_listbyalertrule.go | 91 - .../2022-08-01/actions/model_actionrequest.go | 17 - .../actions/model_actionrequestproperties.go | 9 - .../actions/model_actionresponse.go | 17 - .../actions/model_actionresponseproperties.go | 9 - .../2022-08-01/actions/predicates.go | 32 - .../2022-08-01/actions/version.go | 12 - .../2022-08-01/alertrules/README.md | 90 - .../2022-08-01/alertrules/client.go | 26 - .../2022-08-01/alertrules/constants.go | 499 --- .../2022-08-01/alertrules/id_alertrule.go | 141 - .../alertrules/id_alertrule_test.go | 357 --- .../2022-08-01/alertrules/id_workspace.go | 130 - .../alertrules/id_workspace_test.go | 282 -- .../alertrules/method_createorupdate.go | 63 - .../2022-08-01/alertrules/method_delete.go | 47 - .../2022-08-01/alertrules/method_get.go | 58 - .../2022-08-01/alertrules/method_list.go | 103 - .../alertrules/model_alertdetailsoverride.go | 11 - .../2022-08-01/alertrules/model_alertrule.go | 69 - .../alertrules/model_entitymapping.go | 9 - .../alertrules/model_eventgroupingsettings.go | 8 - .../alertrules/model_fieldmapping.go | 9 - .../alertrules/model_fusionalertrule.go | 48 - .../model_fusionalertruleproperties.go | 33 - .../alertrules/model_groupingconfiguration.go | 14 - .../alertrules/model_incidentconfiguration.go | 9 - ...rosoftsecurityincidentcreationalertrule.go | 48 - ...rityincidentcreationalertruleproperties.go | 34 - .../alertrules/model_scheduledalertrule.go | 48 - .../model_scheduledalertruleproperties.go | 46 - .../2022-08-01/alertrules/predicates.go | 12 - .../2022-08-01/alertrules/version.go | 12 - .../2022-08-01/alertruletemplates/README.md | 53 - .../2022-08-01/alertruletemplates/client.go | 26 - .../alertruletemplates/constants.go | 458 --- .../id_alertruletemplate.go | 141 - .../id_alertruletemplate_test.go | 357 --- .../alertruletemplates/id_workspace.go | 130 - .../alertruletemplates/id_workspace_test.go | 282 -- .../alertruletemplates/method_get.go | 58 - .../alertruletemplates/method_list.go | 103 - .../model_alertdetailsoverride.go | 11 - .../model_alertruletemplate.go | 69 - .../model_alertruletemplatedatasource.go | 9 - .../alertruletemplates/model_entitymapping.go | 9 - .../model_eventgroupingsettings.go | 8 - .../alertruletemplates/model_fieldmapping.go | 9 - .../model_fusionalertruletemplate.go | 47 - ...model_fusionalertruletemplateproperties.go | 47 - ...curityincidentcreationalertruletemplate.go | 47 - ...dentcreationalertruletemplateproperties.go | 48 - .../model_scheduledalertruletemplate.go | 47 - ...el_scheduledalertruletemplateproperties.go | 57 - .../alertruletemplates/predicates.go | 12 - .../2022-08-01/alertruletemplates/version.go | 12 - .../2022-08-01/automationrules/README.md | 90 - .../2022-08-01/automationrules/client.go | 26 - .../2022-08-01/automationrules/constants.go | 691 ---- .../automationrules/id_automationrule.go | 141 - .../automationrules/id_automationrule_test.go | 357 --- .../automationrules/id_workspace.go | 130 - .../automationrules/id_workspace_test.go | 282 -- .../automationrules/method_createorupdate.go | 59 - .../automationrules/method_delete.go | 55 - .../2022-08-01/automationrules/method_get.go | 54 - .../2022-08-01/automationrules/method_list.go | 91 - .../automationrules/model_automationrule.go | 17 - .../model_automationruleaction.go | 61 - .../model_automationrulecondition.go | 53 - ...el_automationrulemodifypropertiesaction.go | 42 - .../model_automationruleproperties.go | 88 - ...l_automationrulepropertyvaluescondition.go | 10 - .../model_automationrulerunplaybookaction.go | 42 - .../model_automationruletriggeringlogic.go | 70 - .../automationrules/model_clientinfo.go | 11 - .../automationrules/model_incidentlabel.go | 9 - .../model_incidentownerinfo.go | 12 - .../model_incidentpropertiesaction.go | 14 - .../model_playbookactionproperties.go | 9 - .../model_propertyconditionproperties.go | 41 - .../2022-08-01/automationrules/predicates.go | 32 - .../2022-08-01/automationrules/version.go | 12 - .../2022-08-01/bookmarks/README.md | 90 - .../2022-08-01/bookmarks/client.go | 26 - .../2022-08-01/bookmarks/constants.go | 57 - .../2022-08-01/bookmarks/id_bookmark.go | 141 - .../2022-08-01/bookmarks/id_bookmark_test.go | 357 --- .../2022-08-01/bookmarks/id_workspace.go | 130 - .../2022-08-01/bookmarks/id_workspace_test.go | 282 -- .../bookmarks/method_createorupdate.go | 59 - .../2022-08-01/bookmarks/method_delete.go | 47 - .../2022-08-01/bookmarks/method_get.go | 54 - .../2022-08-01/bookmarks/method_list.go | 91 - .../2022-08-01/bookmarks/model_bookmark.go | 17 - .../bookmarks/model_bookmarkproperties.go | 86 - .../bookmarks/model_incidentinfo.go | 11 - .../2022-08-01/bookmarks/model_userinfo.go | 10 - .../2022-08-01/bookmarks/predicates.go | 32 - .../2022-08-01/bookmarks/version.go | 12 - .../securityinsights/2022-08-01/client.go | 172 - .../2022-08-01/dataconnectors/README.md | 90 - .../2022-08-01/dataconnectors/client.go | 26 - .../2022-08-01/dataconnectors/constants.go | 110 - .../dataconnectors/id_dataconnector.go | 141 - .../dataconnectors/id_dataconnector_test.go | 357 --- .../2022-08-01/dataconnectors/id_workspace.go | 130 - .../dataconnectors/id_workspace_test.go | 282 -- .../dataconnectors/method_createorupdate.go | 63 - .../dataconnectors/method_delete.go | 47 - .../2022-08-01/dataconnectors/method_get.go | 58 - .../2022-08-01/dataconnectors/method_list.go | 103 - .../dataconnectors/model_aaddataconnector.go | 48 - .../model_aaddataconnectorproperties.go | 9 - .../dataconnectors/model_aatpdataconnector.go | 48 - .../model_aatpdataconnectorproperties.go | 9 - .../model_alertsdatatypeofdataconnector.go | 8 - .../dataconnectors/model_ascdataconnector.go | 48 - .../model_ascdataconnectorproperties.go | 9 - .../model_awscloudtraildataconnector.go | 48 - ...del_awscloudtraildataconnectordatatypes.go | 8 - ...el_awscloudtraildataconnectorproperties.go | 9 - .../dataconnectors/model_dataconnector.go | 109 - .../model_dataconnectordatatypecommon.go | 8 - .../dataconnectors/model_mcasdataconnector.go | 48 - .../model_mcasdataconnectordatatypes.go | 9 - .../model_mcasdataconnectorproperties.go | 9 - .../model_mdatpdataconnector.go | 48 - .../model_mdatpdataconnectorproperties.go | 9 - .../model_officedataconnector.go | 48 - .../model_officedataconnectordatatypes.go | 10 - .../model_officedataconnectorproperties.go | 9 - .../dataconnectors/model_tidataconnector.go | 48 - .../model_tidataconnectordatatypes.go | 8 - .../model_tidataconnectorproperties.go | 28 - .../2022-08-01/dataconnectors/predicates.go | 12 - .../2022-08-01/dataconnectors/version.go | 12 - .../2022-08-01/entitytypes/README.md | 21 - .../2022-08-01/entitytypes/client.go | 26 - .../2022-08-01/entitytypes/constants.go | 980 ------ .../entitytypes/model_accountentity.go | 45 - .../model_accountentityproperties.go | 21 - .../entitytypes/model_azureresourceentity.go | 45 - .../model_azureresourceentityproperties.go | 11 - .../model_cloudapplicationentity.go | 45 - .../model_cloudapplicationentityproperties.go | 12 - .../2022-08-01/entitytypes/model_dnsentity.go | 45 - .../entitytypes/model_dnsentityproperties.go | 13 - .../2022-08-01/entitytypes/model_entity.go | 213 -- .../entitytypes/model_fileentity.go | 45 - .../entitytypes/model_fileentityproperties.go | 13 - .../entitytypes/model_filehashentity.go | 45 - .../model_filehashentityproperties.go | 11 - .../entitytypes/model_geolocation.go | 14 - .../entitytypes/model_hostentity.go | 45 - .../entitytypes/model_hostentityproperties.go | 18 - .../entitytypes/model_huntingbookmark.go | 45 - .../model_huntingbookmarkproperties.go | 62 - .../entitytypes/model_incidentinfo.go | 11 - .../entitytypes/model_iotdeviceentity.go | 45 - .../model_iotdeviceentityproperties.go | 26 - .../2022-08-01/entitytypes/model_ipentity.go | 45 - .../entitytypes/model_ipentityproperties.go | 12 - .../entitytypes/model_mailboxentity.go | 45 - .../model_mailboxentityproperties.go | 13 - .../entitytypes/model_mailclusterentity.go | 45 - .../model_mailclusterentityproperties.go | 66 - .../entitytypes/model_mailmessageentity.go | 45 - .../model_mailmessageentityproperties.go | 52 - .../entitytypes/model_malwareentity.go | 45 - .../model_malwareentityproperties.go | 13 - .../entitytypes/model_processentity.go | 45 - .../model_processentityproperties.go | 36 - .../entitytypes/model_registrykeyentity.go | 45 - .../model_registrykeyentityproperties.go | 11 - .../entitytypes/model_registryvalueentity.go | 45 - .../model_registryvalueentityproperties.go | 13 - .../entitytypes/model_securityalert.go | 45 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../entitytypes/model_securitygroupentity.go | 45 - .../model_securitygroupentityproperties.go | 12 - .../entitytypes/model_submissionmailentity.go | 45 - .../model_submissionmailentityproperties.go | 49 - .../entitytypes/model_systemdata.go | 43 - .../entitytypes/model_threatintelligence.go | 13 - .../2022-08-01/entitytypes/model_urlentity.go | 45 - .../entitytypes/model_urlentityproperties.go | 10 - .../2022-08-01/entitytypes/model_userinfo.go | 10 - .../2022-08-01/entitytypes/version.go | 12 - .../2022-08-01/incidentalerts/README.md | 36 - .../2022-08-01/incidentalerts/client.go | 26 - .../2022-08-01/incidentalerts/constants.go | 506 --- .../2022-08-01/incidentalerts/id_incident.go | 141 - .../incidentalerts/id_incident_test.go | 357 --- .../method_incidentslistalerts.go | 55 - .../2022-08-01/incidentalerts/model_entity.go | 61 - .../incidentalerts/model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../incidentalerts/model_incidentalertlist.go | 8 - .../incidentalerts/model_incidentinfo.go | 11 - .../incidentalerts/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidentalerts/model_userinfo.go | 10 - .../2022-08-01/incidentalerts/version.go | 12 - .../2022-08-01/incidentbookmarks/README.md | 36 - .../2022-08-01/incidentbookmarks/client.go | 26 - .../2022-08-01/incidentbookmarks/constants.go | 506 --- .../incidentbookmarks/id_incident.go | 141 - .../incidentbookmarks/id_incident_test.go | 357 --- .../method_incidentslistbookmarks.go | 55 - .../incidentbookmarks/model_entity.go | 61 - .../model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../model_incidentbookmarklist.go | 8 - .../incidentbookmarks/model_incidentinfo.go | 11 - .../incidentbookmarks/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidentbookmarks/model_userinfo.go | 10 - .../2022-08-01/incidentbookmarks/version.go | 12 - .../2022-08-01/incidentcomments/README.md | 90 - .../2022-08-01/incidentcomments/client.go | 26 - .../2022-08-01/incidentcomments/id_comment.go | 150 - .../incidentcomments/id_comment_test.go | 402 --- .../incidentcomments/id_incident.go | 141 - .../incidentcomments/id_incident_test.go | 357 --- .../incidentcomments/method_createorupdate.go | 59 - .../incidentcomments/method_delete.go | 47 - .../2022-08-01/incidentcomments/method_get.go | 54 - .../incidentcomments/method_list.go | 127 - .../incidentcomments/model_clientinfo.go | 11 - .../incidentcomments/model_incidentcomment.go | 17 - .../model_incidentcommentproperties.go | 41 - .../2022-08-01/incidentcomments/predicates.go | 32 - .../2022-08-01/incidentcomments/version.go | 12 - .../2022-08-01/incidententities/README.md | 36 - .../2022-08-01/incidententities/client.go | 26 - .../2022-08-01/incidententities/constants.go | 506 --- .../incidententities/id_incident.go | 141 - .../incidententities/id_incident_test.go | 357 --- .../method_incidentslistentities.go | 55 - .../incidententities/model_entity.go | 61 - .../incidententities/model_huntingbookmark.go | 47 - .../model_huntingbookmarkproperties.go | 62 - .../model_incidententitiesresponse.go | 49 - .../model_incidententitiesresultsmetadata.go | 9 - .../incidententities/model_incidentinfo.go | 11 - .../incidententities/model_securityalert.go | 47 - .../model_securityalertproperties.go | 88 - ...alertpropertiesconfidencereasonsinlined.go | 9 - .../incidententities/model_userinfo.go | 10 - .../2022-08-01/incidententities/version.go | 12 - .../2022-08-01/incidentrelations/README.md | 90 - .../2022-08-01/incidentrelations/client.go | 26 - .../incidentrelations/id_incident.go | 141 - .../incidentrelations/id_incident_test.go | 357 --- .../incidentrelations/id_relation.go | 150 - .../incidentrelations/id_relation_test.go | 402 --- .../method_createorupdate.go | 59 - .../incidentrelations/method_delete.go | 47 - .../incidentrelations/method_get.go | 54 - .../incidentrelations/method_list.go | 127 - .../incidentrelations/model_relation.go | 17 - .../model_relationproperties.go | 11 - .../incidentrelations/predicates.go | 32 - .../2022-08-01/incidentrelations/version.go | 12 - .../2022-08-01/incidents/README.md | 90 - .../2022-08-01/incidents/client.go | 26 - .../2022-08-01/incidents/constants.go | 366 --- .../2022-08-01/incidents/id_incident.go | 141 - .../2022-08-01/incidents/id_incident_test.go | 357 --- .../2022-08-01/incidents/id_workspace.go | 130 - .../2022-08-01/incidents/id_workspace_test.go | 282 -- .../incidents/method_createorupdate.go | 59 - .../2022-08-01/incidents/method_delete.go | 47 - .../2022-08-01/incidents/method_get.go | 54 - .../2022-08-01/incidents/method_list.go | 127 - .../2022-08-01/incidents/model_incident.go | 17 - .../incidents/model_incidentadditionaldata.go | 12 - .../incidents/model_incidentlabel.go | 9 - .../incidents/model_incidentownerinfo.go | 12 - .../incidents/model_incidentproperties.go | 78 - .../2022-08-01/incidents/predicates.go | 32 - .../2022-08-01/incidents/version.go | 12 - .../sentinelonboardingstates/README.md | 89 - .../sentinelonboardingstates/client.go | 26 - .../id_onboardingstate.go | 141 - .../id_onboardingstate_test.go | 357 --- .../sentinelonboardingstates/id_workspace.go | 130 - .../id_workspace_test.go | 282 -- .../sentinelonboardingstates/method_create.go | 59 - .../sentinelonboardingstates/method_delete.go | 47 - .../sentinelonboardingstates/method_get.go | 54 - .../sentinelonboardingstates/method_list.go | 55 - .../model_sentinelonboardingstate.go | 17 - ...model_sentinelonboardingstateproperties.go | 8 - .../model_sentinelonboardingstateslist.go | 8 - .../sentinelonboardingstates/version.go | 12 - .../2022-08-01/threatintelligence/README.md | 191 -- .../2022-08-01/threatintelligence/client.go | 26 - .../threatintelligence/constants.go | 92 - .../threatintelligence/id_indicator.go | 143 - .../threatintelligence/id_indicator_test.go | 387 --- .../threatintelligence/id_workspace.go | 130 - .../threatintelligence/id_workspace_test.go | 282 -- .../method_indicatorappendtags.go | 51 - .../method_indicatorcreate.go | 63 - .../method_indicatorcreateindicator.go | 63 - .../method_indicatordelete.go | 47 - .../threatintelligence/method_indicatorget.go | 58 - .../method_indicatormetricslist.go | 55 - .../method_indicatorqueryindicators.go | 103 - .../method_indicatorreplacetags.go | 63 - .../method_indicatorslist.go | 139 - .../model_threatintelligenceappendtags.go | 8 - ...del_threatintelligenceexternalreference.go | 12 - ...del_threatintelligencefilteringcriteria.go | 20 - ..._threatintelligencegranularmarkingmodel.go | 10 - .../model_threatintelligenceindicatormodel.go | 48 - ...l_threatintelligenceindicatorproperties.go | 37 - .../model_threatintelligenceinformation.go | 53 - .../model_threatintelligencekillchainphase.go | 9 - .../model_threatintelligencemetric.go | 11 - .../model_threatintelligencemetricentity.go | 9 - .../model_threatintelligencemetrics.go | 8 - .../model_threatintelligencemetricslist.go | 8 - .../model_threatintelligenceparsedpattern.go | 9 - ...hreatintelligenceparsedpatterntypevalue.go | 9 - ...model_threatintelligencesortingcriteria.go | 9 - .../threatintelligence/predicates.go | 12 - .../2022-08-01/threatintelligence/version.go | 12 - .../2022-08-01/watchlistitems/README.md | 90 - .../2022-08-01/watchlistitems/client.go | 26 - .../2022-08-01/watchlistitems/id_watchlist.go | 141 - .../watchlistitems/id_watchlist_test.go | 357 --- .../watchlistitems/id_watchlistitem.go | 150 - .../watchlistitems/id_watchlistitem_test.go | 402 --- .../watchlistitems/method_createorupdate.go | 59 - .../watchlistitems/method_delete.go | 47 - .../2022-08-01/watchlistitems/method_get.go | 54 - .../2022-08-01/watchlistitems/method_list.go | 91 - .../watchlistitems/model_userinfo.go | 10 - .../watchlistitems/model_watchlistitem.go | 17 - .../model_watchlistitemproperties.go | 47 - .../2022-08-01/watchlistitems/predicates.go | 32 - .../2022-08-01/watchlistitems/version.go | 12 - .../2022-08-01/watchlists/README.md | 90 - .../2022-08-01/watchlists/client.go | 26 - .../2022-08-01/watchlists/constants.go | 51 - .../2022-08-01/watchlists/id_watchlist.go | 141 - .../watchlists/id_watchlist_test.go | 357 --- .../2022-08-01/watchlists/id_workspace.go | 130 - .../watchlists/id_workspace_test.go | 282 -- .../watchlists/method_createorupdate.go | 59 - .../2022-08-01/watchlists/method_delete.go | 47 - .../2022-08-01/watchlists/method_get.go | 54 - .../2022-08-01/watchlists/method_list.go | 91 - .../2022-08-01/watchlists/model_userinfo.go | 10 - .../2022-08-01/watchlists/model_watchlist.go | 17 - .../watchlists/model_watchlistproperties.go | 57 - .../2022-08-01/watchlists/predicates.go | 32 - .../2022-08-01/watchlists/version.go | 12 - 18828 files changed, 105524 insertions(+), 827632 deletions(-) delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingscreate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsdelete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsget.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingslistbycluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsupdate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_consentandinstalldefaultextensions.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_createidentity.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_generatepassword.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_initializedisableprocess.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponse.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponseproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatch.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatchproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_defaultextensiondetails.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_passwordcredential.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_pernodestate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/arcsettings/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/method_createidentity.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/method_extendsoftwareassurancebenefit.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/method_uploadcertificate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterdesiredproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponse.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponseproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusternode.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterreportedproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_isolatedvmattestationconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_rawcertificatedata.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequest.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequestproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassuranceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/model_uploadcertificaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/cluster/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/method_create.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/method_listbyresourcegroup.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/method_listbysubscription.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterdesiredproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusternode.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatch.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatchproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterreportedproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_isolatedvmattestationconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/model_softwareassuranceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/clusters/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_listbyclusters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_adapterpropertyoverrides.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentdata.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsettingsproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentstatus.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_hostnetwork.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_infrastructurenetwork.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_intents.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_ippools.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_observability.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_optionalservices.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_physicalnodes.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_qospolicyoverrides.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_reportedproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_scaleunits.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_securitysettings.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_step.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storage.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storagenetworks.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_validationstatus.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_virtualswitchconfigurationoverrides.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_validate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_deviceconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedevice.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedeviceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_nicdetail.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validateresponse.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/edgedevices/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/method_create.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/method_listbyarcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/method_upgrade.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extension.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceview.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceviewstatus.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionparameters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatch.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchparameters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionupgradeparameters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/model_pernodeextensionstate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/extensions/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbycluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbypublisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/model_offer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/model_offerproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/model_skumappings.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/offers/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/method_listbycluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisherproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/publishers/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skusget.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skuslistbyoffer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/model_sku.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skumappings.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skuproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/skuses/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_put.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_step.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterun.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterunproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updateruns/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/id_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/id_update_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/method_post.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/method_put.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_packageversioninfo.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresult.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresulttags.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateprerequisite.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/model_updatestateproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updates/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_put.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_packageversioninfo.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresult.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresulttags.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummaries.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummariesproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingscreate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsdelete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsget.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingslistbycluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsupdate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_consentandinstalldefaultextensions.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_createidentity.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_generatepassword.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/method_initializedisableprocess.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponse.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponseproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatch.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatchproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_defaultextensiondetails.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_passwordcredential.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/model_pernodestate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/arcsettings/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/method_createidentity.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/method_extendsoftwareassurancebenefit.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/method_uploadcertificate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_clusterdesiredproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponse.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponseproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_clusternode.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_clusterproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_clusterreportedproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_isolatedvmattestationconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_rawcertificatedata.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequest.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequestproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassuranceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/model_uploadcertificaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/cluster/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/method_create.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/method_listbyresourcegroup.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/method_listbysubscription.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_clusterdesiredproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_clusternode.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatch.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatchproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_clusterproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_clusterreportedproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_isolatedvmattestationconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/model_softwareassuranceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/clusters/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/id_extension.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/id_extension_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/method_create.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/method_listbyarcsetting.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/method_upgrade.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extension.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceview.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceviewstatus.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensionparameters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatch.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchparameters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensionproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_extensionupgradeparameters.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/model_pernodeextensionstate.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/extensions/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/id_offer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/id_offer_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/id_publisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/id_publisher_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/method_listbycluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/method_listbypublisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/model_offer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/model_offerproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/model_skumappings.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/offers/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/id_publisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/id_publisher_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/method_listbycluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/model_publisher.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/model_publisherproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/publishers/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/id_offer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/id_offer_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/id_sku.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/id_sku_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/method_skusget.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/method_skuslistbyoffer.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/model_sku.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/model_skumappings.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/model_skuproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/skuses/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/id_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/id_update_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/method_put.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/model_step.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterun.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterunproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updateruns/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/id_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/id_update_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/method_post.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/method_put.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_packageversioninfo.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_precheckresult.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_precheckresulttags.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_update.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_updateprerequisite.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_updateproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/model_updatestateproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updates/version.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/README.md delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/client.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/constants.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster_test.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/method_put.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/model_packageversioninfo.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresult.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresulttags.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummaries.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummariesproperties.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-08-01/updatesummaries/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage_test.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_listall.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_gallerydiskimage.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageidentifier.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimages.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusdownloadstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagesupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversion.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionstorageprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/galleryimages/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentcreate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentdelete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentget.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestagentproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestcredential.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/guestagents/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadata.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadataproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork_test.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_listall.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippool.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippoolinfo.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkpropertiesdhcpoptions.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworks.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworksupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_route.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routepropertiesformat.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetable.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetablepropertiesformat.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnet.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformat.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformatipconfigurationreferencesinlined.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage_test.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_listall.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_gallerydiskimage.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageidentifier.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversion.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionstorageprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimageproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimages.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusdownloadstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagesupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface_test.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_listall.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_interfacednssettings.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationpropertiessubnet.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaces.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacesupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer_test.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_listall.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainers.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainersupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/client.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk_test.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_listall.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisks.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisksupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/predicates.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/version.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/README.md delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/constants.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_createorupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_delete.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_get.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_list.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_start.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_stop.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_update.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_erroradditionalinfo.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_errordetail.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_extendedlocation.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_guestagentinstallstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_hardwareprofileupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_httpproxyconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_instanceviewstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdatenetworkinterfacesinlined.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatelinuxconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatewindowsconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshpublickey.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdate.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdatedatadisksinlined.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineconfigagentinstanceview.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstance.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofiledynamicmemoryconfig.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofilenetworkinterfacesinlined.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilelinuxconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilewindowsconfiguration.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofileuefisettings.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofile.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofiledatadisksinlined.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileimagereference.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileosdisk.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatusprovisioningstatus.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdaterequest.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceview.go delete mode 100644 resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/version.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/README.md delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/client.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_capabilitytypesget.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_createorupdate.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_delete.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_get.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_list.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capability.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilityproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytype.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypeproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypepropertiesruntimeproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/predicates.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilities/version.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/README.md delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/client.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/method_list.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytype.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypeproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypepropertiesruntimeproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/predicates.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/version.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/client.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/README.md delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/client.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/constants.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_cancel.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_createorupdate.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_delete.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_get.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getexecutiondetails.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getstatus.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_list.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listall.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listallstatuses.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listexecutiondetails.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_start.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/method_update.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_action.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_actionstatus.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branch.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branchstatus.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_continuousaction.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_delayaction.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_discreteaction.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experiment.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentcanceloperationresult.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailserror.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailsproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetails.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailsproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailspropertiesruninformation.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstartoperationresult.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatus.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatusproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentupdate.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_filter.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_keyvaluepair.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_listselector.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_queryselector.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_selector.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilter.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilterparameters.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_step.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_stepstatus.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/model_targetreference.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/predicates.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/experiments/version.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/README.md delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/client.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/method_createorupdate.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/method_delete.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/method_get.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/method_list.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/model_target.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/predicates.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targets/version.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/README.md delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/client.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype_test.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_get.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_list.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettype.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettypeproperties.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/predicates.go delete mode 100644 resource-manager/chaosstudio/2023-04-15-preview/targettypes/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/README.md rename resource-manager/{azurestackhci/2023-08-01-preview => connectedvmware/2023-12-01}/clusters/client.go (100%) create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/id_cluster.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/id_cluster_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/method_delete.go rename resource-manager/{azurestackhci/2023-08-01-preview => connectedvmware/2023-12-01}/clusters/method_get.go (100%) create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/model_cluster.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/model_clusterproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/clusters/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/model_datastore.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/model_datastoreproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/datastores/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/id_host.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/id_host_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/model_host.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/model_hostproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/hosts/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/method_listbyvcenter.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_clusterinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_datastoreinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_hostinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemdetails.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkinterfaceinventory.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkprofileinventory.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_resourcepoolinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_storageprofileinventory.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualdiskinventory.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachineinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachinetemplateinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualnetworkinventoryitem.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/inventoryitems/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepool.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepoolproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/resourcepools/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenter.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenterproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/model_vicredential.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vcenters/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/README.md rename resource-manager/{azurestackhci/2023-09-01-preview => connectedvmware/2023-12-01}/virtualmachineinstances/client.go (100%) create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_createorupdate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_list.go rename resource-manager/{azurestackhci/2023-09-01-preview => connectedvmware/2023-12-01}/virtualmachineinstances/method_restart.go (91%) create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_start.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_stop.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_hardwareprofile.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_infrastructureprofile.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterface.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterfaceupdate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofile.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofileupdate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipaddresssettings.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipsettings.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_osprofileforvminstance.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_placementprofile.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_securityprofile.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_stopvirtualmachineoptions.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofile.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofileupdate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_uefisettings.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdisk.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdiskupdate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstance.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualscsicontroller.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_windowsconfiguration.go rename resource-manager/{azurestackhci/2023-09-01-preview => connectedvmware/2023-12-01}/virtualmachineinstances/predicates.go (100%) create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_networkinterface.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipaddresssettings.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipsettings.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualdisk.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplate.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplateproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/README.md rename resource-manager/{network/2023-04-01 => connectedvmware/2023-12-01}/virtualnetworks/client.go (100%) create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork_test.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_listbyresourcegroup.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_update.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_extendedlocation.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcepatch.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetwork.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetworkproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/virtualnetworks/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_create.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_delete.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_list.go rename resource-manager/{azurestackhci/2023-09-01-preview/guestagents => connectedvmware/2023-12-01/vminstanceguestagents}/model_guestagent.go (94%) create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagentproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestcredential.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_httpproxyconfiguration.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_resourcestatus.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/version.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/README.md create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/client.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/constants.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_get.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_list.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/predicates.go create mode 100644 resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/id_agentpool.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/id_agentpool_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_abortlatestoperation.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_getupgradeprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_list.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/method_upgradenodeimageversion.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpool.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversions.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversionsproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolnetworkprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradesettings.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolwindowsprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_creationdata.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_iptag.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_kubeletconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_linuxosconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_portrange.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_powerstate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/model_sysctlconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/agentpools/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_create.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_listbyfleet.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmember.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmemberproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleetmembers/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_listbysubscription.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_listcredentials.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/method_update.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/model_fleet.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresults.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/model_fleethubprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetpatch.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/fleets/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timeinweek.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timespan.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/id_accessprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/id_accessprofile_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/id_commandresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/id_commandresult_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/id_location.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/id_location_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getaccessprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getcommandresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getosoptions.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_list.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_accessprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolnetworkprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolupgradesettings.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolwindowsprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_azurekeyvaultkms.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_commandresultproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicelinuxprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshconfiguration.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshpublickey.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_creationdata.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_credentialresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_credentialresults.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_endpointdependency.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_endpointdetail.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_guardrailsprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_iptag.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_kubeletconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_linuxosconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedcluster.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraadprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraccessprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraddonprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteragentpoolprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteringressprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusternatgatewayprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentity.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityexception.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersku.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterwindowsprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionproperty.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionpropertylist.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_outboundenvironmentendpoint.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_portrange.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_powerstate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_privatelinkresource.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_resourcereference.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_runcommandrequest.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_runcommandresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_sysctlconfig.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_tagsobject.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_userassignedidentity.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/model_windowsgmsaprofile.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclusters/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_list.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_updatetags.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_creationdata.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersku.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshot.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_tagsobject.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_get.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_update.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpoint.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnection.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privatelinkresources/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/privatelinkresources/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/method_delete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/method_list.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/method_updatetags.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/model_creationdata.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/model_snapshot.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/model_snapshotproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/model_tagsobject.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/snapshots/version.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/client.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/constants.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_location.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_location_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingscreateorupdate.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsdelete.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsget.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_roleslist.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrole.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebinding.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolerule.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/predicates.go delete mode 100644 resource-manager/containerservice/2022-09-02-preview/trustedaccess/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/id_agentpool.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/id_agentpool_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_abortlatestoperation.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_delete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_get.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_getupgradeprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_list.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/method_upgradenodeimageversion.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpool.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversions.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversionsproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolnetworkprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradesettings.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolwindowsprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_creationdata.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_iptag.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_kubeletconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_linuxosconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_portrange.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_powerstate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/model_sysctlconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/predicates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/agentpools/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_delete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_get.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_absolutemonthlyschedule.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_dailyschedule.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_datespan.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenancewindow.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_relativemonthlyschedule.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_schedule.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_timeinweek.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_timespan.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_weeklyschedule.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/predicates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/id_accessprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/id_accessprofile_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/id_commandresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/id_commandresult_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/id_location.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/id_location_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getaccessprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getcommandresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getosoptions.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_list.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listkubernetesversions.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_accessprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolnetworkprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolupgradesettings.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolwindowsprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_azurekeyvaultkms.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_clusterupgradesettings.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_commandresultproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicelinuxprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshconfiguration.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshpublickey.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_creationdata.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_credentialresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_credentialresults.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_endpointdependency.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_endpointdetail.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_guardrailsprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_iptag.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istiocomponents.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioingressgateway.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioservicemesh.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubeletconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetespatchversion.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversion.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversioncapabilities.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversionlistresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_linuxosconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedcluster.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraadprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraccessprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraddonprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteragentpoolprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteringressprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusternatgatewayprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentity.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityexception.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersku.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterwindowsprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionproperty.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionpropertylist.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_outboundenvironmentendpoint.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_portrange.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_powerstate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_privatelinkresource.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_resourcereference.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_runcommandrequest.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_runcommandresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_servicemeshprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_sysctlconfig.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_tagsobject.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_upgradeoverridesettings.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_userassignedidentity.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/model_windowsgmsaprofile.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/predicates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclusters/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_delete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_get.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_list.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_updatetags.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_creationdata.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersku.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshot.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_tagsobject.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/predicates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_delete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_get.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_list.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_update.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpoint.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnection.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privatelinkresources/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privatelinkresources/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privatelinkresources/method_list.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/privatelinkresources/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/method_post.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/method_createorupdate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/method_delete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/method_get.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/method_list.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/method_listbyresourcegroup.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/method_updatetags.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/model_creationdata.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/model_snapshot.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/model_snapshotproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/model_tagsobject.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/predicates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/snapshots/version.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/README.md delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/client.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/constants.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_location.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_location_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingscreateorupdate.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsdelete.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsget.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingslist.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_roleslist.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrole.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebinding.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolerule.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/predicates.go delete mode 100644 resource-manager/containerservice/2023-04-02-preview/trustedaccess/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/constants.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/id_application.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/id_application_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/method_create.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/method_delete.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/method_get.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/method_listbycluster.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_application.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgetendpoint.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgethttpsendpoint.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscale.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalecapacity.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalerecurrence.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaleschedule.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaletimeandcapacity.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_computeprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_datadisksgroups.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_errors.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_hardwareprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_linuxoperatingsystemprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_osprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_role.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_runtimescriptaction.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_scriptaction.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_sshprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_sshpublickey.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/model_virtualnetworkprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/predicates.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/applications/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/constants.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_create.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_delete.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_executescriptactions.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_get.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_getgatewaysettings.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_list.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_listbyresourcegroup.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_resize.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_rotatediskencryptionkey.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_update.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateautoscaleconfiguration.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_updategatewaysettings.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateidentitycertificate.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscale.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalecapacity.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleconfigurationupdateparameter.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalerecurrence.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleschedule.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaletimeandcapacity.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clientgroupinfo.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_cluster.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateparametersextended.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdefinition.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdiskencryptionparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustergetproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterpatchparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterresizeparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeisolationproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_connectivityendpoint.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_datadisksgroups.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_diskencryptionproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_encryptionintransitproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_errors.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_excludedservicesconfig.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_executescriptactionparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_gatewaysettings.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_hardwareprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_kafkarestproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_linuxoperatingsystemprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_networkproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_osprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_quotainfo.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_role.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_runtimescriptaction.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_scriptaction.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_securityprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshpublickey.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageaccount.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_updateclusteridentitycertificateparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_updategatewaysettingsparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/model_virtualnetworkprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/predicates.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/clusters/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/method_get.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/method_list.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/method_update.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/model_clusterconfigurations.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/configurations/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_create.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_delete.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_disableazuremonitor.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_disablemonitoring.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_enableazuremonitor.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_enablemonitoring.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_get.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_getazuremonitorstatus.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/method_getmonitoringstatus.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorrequest.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorresponse.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorselectedconfigurations.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitortableconfiguration.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringrequest.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringresponse.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/model_extension.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/extensions/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/promote/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/promote/method_scriptexecutionhistorypromote.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/promote/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/constants.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/id_location.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/id_location_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsgetcapabilities.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistbillingspecs.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistusages.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsvalidateclustercreaterequest.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_aaddsresourcedetails.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscale.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalecapacity.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalerecurrence.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaleschedule.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaletimeandcapacity.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_billingmeters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresources.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresponselistresult.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_capabilitiesresult.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_clientgroupinfo.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreateproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreaterequestvalidationparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreatevalidationresult.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_clusterdefinition.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_computeisolationproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_computeprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_datadisksgroups.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_diskbillingmeters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_diskencryptionproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_encryptionintransitproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_hardwareprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_kafkarestproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_linuxoperatingsystemprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_localizedname.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckrequestparameters.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckresult.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_networkproperties.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_osprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_quotacapability.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_regionalquotacapability.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_regionscapability.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_role.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_scriptaction.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_securityprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_sshprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_sshpublickey.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_storageaccount.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_storageprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_usage.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_usageslistresult.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_validationerrorinfo.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_versionscapability.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_versionspec.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_virtualnetworkprofile.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilter.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilterv2.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizeproperty.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizescapability.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/regions/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/method_delete.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/method_listbycluster.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/model_runtimescriptactiondetail.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/predicates.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptactions/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory_test.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_listbycluster.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_scriptactionsgetexecutiondetail.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/model_runtimescriptactiondetail.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/predicates.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/version.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/virtualmachines/README.md delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/virtualmachines/client.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_listhosts.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_restarthosts.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/virtualmachines/model_hostinfo.go delete mode 100644 resource-manager/hdinsight/2018-06-01-preview/virtualmachines/version.go create mode 100644 resource-manager/hdinsight/2024-05-01/client.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/README.md create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/client.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/constants.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster_test.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool_test.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/id_location.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/id_location_test.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterpoolversionslistbylocation.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterversionslistbylocation.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusteravailableupgradeslist.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobslist.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobsrunjob.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrarieslist.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrariesmanagelibraries.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolavailableupgradeslist.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolscreateorupdate.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsdelete.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsget.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbyresourcegroup.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbysubscription.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupdatetags.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupgrade.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolupgradehistorieslist.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterscreate.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersdelete.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersget.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersgetinstanceview.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistbyclusterpoolname.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistinstanceviews.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistserviceconfigs.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersresize.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupdate.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrade.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrademanualrollback.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterupgradehistorieslist.go rename resource-manager/hdinsight/{2018-06-01-preview/regions => 2024-05-01/hdinsights}/method_locationschecknameavailability.go (78%) create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_aksclusterprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_authorizationprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_autoscaleprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_catalogoptions.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_cluster.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteraccessprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchversionupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgrade.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeakspatchupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradehotfixupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradepatchversionupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clustercomponentscomponentsinlined.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterconfigfile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgraderollbackhistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewresult.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewstatus.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjob.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjobproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrary.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperation.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperationproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibraryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsapplicationlogs.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatch.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgraderollbackhistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpool.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchversionupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgrade.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeakspatchupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradenodeosupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolcomputeprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolloganalyticsprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnetworkprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosimageupdateproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolresourceproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgrade.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistory.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversion.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversionproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprometheusprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterrangerpluginprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizedata.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresourceproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfig.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfigsprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgrade.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistory.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistoryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradeproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollback.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollbackproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversion.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversionproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_comparisonrule.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_computeprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_computeresourcedefinition.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_connectivityprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_diskstorageprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkcatalogoptions.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkhivecatalogoption.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkstorageprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_hivecatalogoption.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_identityprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaconnectivityendpoints.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_loadbasedconfig.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityspec.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_mavenlibraryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityparameters.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityresult.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_nodeprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_pypilibraryproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspec.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspecdatabase.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerauditspec.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerusersyncspec.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_scalingrule.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_schedule.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_schedulebasedconfig.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_scriptactionprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_secretreference.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_secretsprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultproperties.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultvalueentity.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfigresult.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_servicestatus.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkmetastorespec.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugin.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugins.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_sshconnectivityendpoint.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_sshprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_tagsobject.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinocoordinator.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinodebugconfig.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinotelemetryconfig.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugin.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugins.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinousertelemetry.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoworker.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_updatableclusterprofile.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/model_webconnectivityendpoint.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/predicates.go create mode 100644 resource-manager/hdinsight/2024-05-01/hdinsights/version.go delete mode 100644 resource-manager/insights/2021-04-01/client.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/README.md delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/client.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/constants.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint_test.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/method_create.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/method_delete.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/method_get.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbyresourcegroup.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbysubscription.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/method_update.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/model_configurationaccessendpointspec.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpoint.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpointresource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/model_logsingestionendpointspec.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/model_networkruleset.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/model_resourceforupdate.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/predicates.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionendpoints/version.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/README.md delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/client.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/constants.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule_test.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/method_create.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/method_delete.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/method_get.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyresource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyrule.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociation.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociationproxyonlyresource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/predicates.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionruleassociations/version.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/README.md delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/client.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/constants.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule_test.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/method_create.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/method_delete.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/method_get.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/method_listbyresourcegroup.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/method_listbysubscription.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/method_update.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_azuremonitormetricsdestination.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionrule.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionruleresource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_dataflow.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_datasourcesspec.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_destinationsspec.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_extensiondatasource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_loganalyticsdestination.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_perfcounterdatasource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_resourceforupdate.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_syslogdatasource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/model_windowseventlogdatasource.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/predicates.go delete mode 100644 resource-manager/insights/2021-04-01/datacollectionrules/version.go delete mode 100644 resource-manager/insights/2021-07-01-preview/client.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/client.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/constants.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_createorupdate.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_delete.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_get.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_listbyprivatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpoint.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnection.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privateendpointconnections/version.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/client.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/method_get.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/method_listbyprivatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourcelistresult.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkresources/version.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/client.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_createorupdate.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_delete.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_get.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_listbyprivatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresource.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresourceproperties.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/predicates.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/version.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/client.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesget.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslist.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnection.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_tagsresource.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/predicates.go delete mode 100644 resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/version.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/README.md delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/constants.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension_test.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionscreate.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsdelete.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsget.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionslist.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsupdate.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_erroradditionalinfo.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_errordetail.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extension.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionpropertiesaksassignedidentity.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionstatus.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextension.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextensionproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scope.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopecluster.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopenamespace.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/predicates.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/version.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/README.md delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/constants.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension_test.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_create.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_delete.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_get.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_list.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_update.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_erroradditionalinfo.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_errordetail.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extension.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionpropertiesaksassignedidentity.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionstatus.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextension.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextensionproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scope.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopecluster.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopenamespace.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/predicates.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/extensions/version.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/README.md delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/constants.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration_test.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationscreateorupdate.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsdelete.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsget.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationslist.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsupdate.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketpatchdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfiguration.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatch.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatchproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorydefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorypatchdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_helmreleasepropertiesdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationpatchdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectreferencedefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusconditiondefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/model_repositoryrefdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/predicates.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/flux/version.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/README.md delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/constants.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration_test.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_createorupdate.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_delete.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_get.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_list.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_update.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketpatchdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfiguration.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatch.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatchproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorydefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorypatchdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_helmreleasepropertiesdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationpatchdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectreferencedefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusconditiondefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_repositoryrefdefinition.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/predicates.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/version.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/README.md delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/method_operationstatuslist.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_erroradditionalinfo.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_errordetail.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_operationstatusresult.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/predicates.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/version.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/README.md delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/client.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/constants.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration_test.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_createorupdate.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_delete.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_get.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_list.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_compliancestatus.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_helmoperatorproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfiguration.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/predicates.go delete mode 100644 resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/version.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/README.md delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/constants.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/id_image.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/id_image_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/id_labplan.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/id_labplan_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/method_createorupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/method_get.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/method_listbylabplan.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/method_update.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/model_image.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/model_imageproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/model_imageupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/model_imageupdateproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/predicates.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/image/version.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/README.md delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/constants.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/id_lab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/id_lab_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_createorupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_delete.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_get.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_listbyresourcegroup.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_listbysubscription.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_publish.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_syncgroup.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/method_update.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_autoshutdownprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_connectionprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_credentials.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_imagereference.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_lab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_labnetworkprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_labproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_labupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_labupdateproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_rosterprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_securityprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_sku.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineadditionalcapabilities.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/predicates.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/lab/version.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/README.md delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/constants.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/id_labplan.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/id_labplan_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/method_createorupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/method_delete.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/method_get.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/method_listbyresourcegroup.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/method_listbysubscription.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/method_update.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_autoshutdownprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_connectionprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_labplan.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_labplannetworkprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_labplanproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdateproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/model_supportinfo.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/predicates.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/labplan/version.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/README.md delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/constants.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/id_lab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/id_lab_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/id_schedule.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/id_schedule_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/method_createorupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/method_delete.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/method_get.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/method_listbylab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/method_update.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/model_recurrencepattern.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/model_schedule.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdateproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/predicates.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/schedule/version.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/README.md delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/constants.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/id_lab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/id_lab_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/id_user.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/id_user_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/method_createorupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/method_delete.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/method_get.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/method_invite.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/method_listbylab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/method_update.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/model_invitebody.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/model_user.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/model_userproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/model_userupdate.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/model_userupdateproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/predicates.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/user/version.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/README.md delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/client.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/constants.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine_test.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_get.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_labplanssaveimage.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_listbylab.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_redeploy.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_reimage.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_resetpassword.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_start.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/method_stop.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/model_resetpasswordbody.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/model_saveimagebody.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachine.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineconnectionprofile.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineproperties.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/predicates.go delete mode 100644 resource-manager/labservices/2021-10-01-preview/virtualmachine/version.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/README.md delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/constants.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/method_forresourcegrouplist.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/method_list.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdateproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/model_listapplyupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdate/version.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/README.md delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/constants.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate_test.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdateparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/method_get.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/method_getparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdateproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/applyupdates/version.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/README.md delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment_test.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdateparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_delete.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_deleteparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_get.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_getparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_list.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_listparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_withinsubscriptionlist.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignment.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignmentproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_listconfigurationassignmentsresult.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/configurationassignments/version.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/README.md delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/constants.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_createorupdate.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_delete.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_forresourcegrouplist.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_get.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_list.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_update.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputlinuxparameters.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputpatchconfiguration.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputwindowsparameters.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_listmaintenanceconfigurationsresult.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfiguration.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenancewindow.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_softwareupdateconfigurationtasks.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_taskproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/version.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/README.md delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/constants.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_get.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_list.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputlinuxparameters.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputpatchconfiguration.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputwindowsparameters.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_listmaintenanceconfigurationsresult.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfiguration.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfigurationproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenancewindow.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_softwareupdateconfigurationtasks.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_taskproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/version.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/README.md delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/client.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/constants.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/method_list.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/method_listparent.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/model_listupdatesresult.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/model_update.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/model_updateproperties.go delete mode 100644 resource-manager/maintenance/2022-07-01-preview/updates/version.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/README.md create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/client.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciescreate.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesdelete.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesget.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/method_backuppolicieslist.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesupdate.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicieslist.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicy.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicypatch.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicyproperties.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/model_volumebackups.go create mode 100644 resource-manager/netapp/2023-11-01/backuppolicy/version.go create mode 100644 resource-manager/netapp/2023-11-01/backups/README.md create mode 100644 resource-manager/netapp/2023-11-01/backups/client.go create mode 100644 resource-manager/netapp/2023-11-01/backups/constants.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_backup.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_backup_test.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_backupvault.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/backups/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_create.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_delete.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_get.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_getlateststatus.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_listbyvault.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_underaccountmigratebackups.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_underbackupvaultrestorefiles.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_undervolumemigratebackups.go create mode 100644 resource-manager/netapp/2023-11-01/backups/method_update.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backup.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backuppatch.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backuppatchproperties.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backupproperties.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backuprestorefiles.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backupsmigrationrequest.go create mode 100644 resource-manager/netapp/2023-11-01/backups/model_backupstatus.go create mode 100644 resource-manager/netapp/2023-11-01/backups/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/backups/version.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/README.md create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/client.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/method_createorupdate.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/method_delete.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/method_get.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/method_listbynetappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/method_update.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/model_backupvault.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultpatch.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultproperties.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/backupvaults/version.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/README.md create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/client.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/constants.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/method_poolscreateorupdate.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/method_poolsdelete.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/method_poolsget.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/method_poolslist.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/method_poolsupdate.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/model_capacitypool.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/model_capacitypoolpatch.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/model_poolpatchproperties.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/model_poolproperties.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/capacitypools/version.go create mode 100644 resource-manager/netapp/2023-11-01/client.go create mode 100644 resource-manager/netapp/2023-11-01/filelocks/README.md create mode 100644 resource-manager/netapp/2023-11-01/filelocks/client.go create mode 100644 resource-manager/netapp/2023-11-01/filelocks/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/filelocks/method_volumesbreakfilelocks.go create mode 100644 resource-manager/netapp/2023-11-01/filelocks/model_breakfilelocksrequest.go create mode 100644 resource-manager/netapp/2023-11-01/filelocks/version.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/client.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/method_volumeslistgetgroupidlistforldapuser.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserrequest.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserresponse.go create mode 100644 resource-manager/netapp/2023-11-01/groupidlistforldapuser/version.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/README.md create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/client.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/constants.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountscreateorupdate.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountsdelete.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountsget.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountslist.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountslistbysubscription.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountsrenewcredentials.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/method_accountsupdate.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_accountencryption.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_accountproperties.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_activedirectory.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_encryptionidentity.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_keyvaultproperties.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_ldapsearchscopeopt.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccountpatch.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/netappaccounts/version.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/README.md create mode 100644 resource-manager/netapp/2023-11-01/netappresource/client.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/constants.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/id_location.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/id_location_test.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_checkfilepathavailability.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_checknameavailability.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_checkquotaavailability.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_querynetworksiblingset.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_queryregioninfo.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_quotalimitsget.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_quotalimitslist.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_regioninfosget.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_regioninfoslist.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/method_updatenetworksiblingset.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_checkavailabilityresponse.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_filepathavailabilityrequest.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_networksiblingset.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_nicinfo.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_querynetworksiblingsetrequest.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_quotaavailabilityrequest.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_regioninfo.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_regioninfoavailabilityzonemappingsinlined.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_regioninforesource.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_resourcenameavailabilityrequest.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitem.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemlist.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemproperties.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/model_updatenetworksiblingsetrequest.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/netappresource/version.go create mode 100644 resource-manager/netapp/2023-11-01/poolchange/README.md create mode 100644 resource-manager/netapp/2023-11-01/poolchange/client.go create mode 100644 resource-manager/netapp/2023-11-01/poolchange/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/poolchange/method_volumespoolchange.go create mode 100644 resource-manager/netapp/2023-11-01/poolchange/model_poolchangerequest.go create mode 100644 resource-manager/netapp/2023-11-01/poolchange/version.go create mode 100644 resource-manager/netapp/2023-11-01/resetcifspassword/client.go create mode 100644 resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/resetcifspassword/method_volumesresetcifspassword.go create mode 100644 resource-manager/netapp/2023-11-01/resetcifspassword/version.go create mode 100644 resource-manager/netapp/2023-11-01/restore/README.md create mode 100644 resource-manager/netapp/2023-11-01/restore/client.go create mode 100644 resource-manager/netapp/2023-11-01/restore/constants.go create mode 100644 resource-manager/netapp/2023-11-01/restore/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/restore/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/restore/method_backupsgetvolumelatestrestorestatus.go create mode 100644 resource-manager/netapp/2023-11-01/restore/model_restorestatus.go create mode 100644 resource-manager/netapp/2023-11-01/restore/version.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/README.md create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/client.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciescreate.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesdelete.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesget.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpolicieslist.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesupdate.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_dailyschedule.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_hourlyschedule.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_monthlyschedule.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicieslist.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicypatch.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicyproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/model_weeklyschedule.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicy/version.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/client.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/constants.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/method_snapshotpolicieslistvolumes.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_exportpolicyrule.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_mounttargetproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_placementkeyvaluepairs.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_replicationobject.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_snapshotpolicyvolumelist.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volume.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumebackupproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumeproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesdataprotection.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesexportpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumerelocationproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumesnapshotproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/version.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/README.md rename resource-manager/{containerservice/2022-09-02-preview => netapp/2023-11-01}/snapshots/client.go (100%) create mode 100644 resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/method_create.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/method_delete.go rename resource-manager/{containerservice/2022-09-02-preview => netapp/2023-11-01}/snapshots/method_get.go (100%) create mode 100644 resource-manager/netapp/2023-11-01/snapshots/method_list.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/method_restorefiles.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/method_update.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/model_snapshot.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/model_snapshotproperties.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/model_snapshotrestorefiles.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/model_snapshotslist.go create mode 100644 resource-manager/netapp/2023-11-01/snapshots/version.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/README.md create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/client.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/method_create.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/method_delete.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/method_get.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/method_getmetadata.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/method_listbyvolume.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/method_update.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeinfo.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodel.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodelproperties.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchparams.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchrequest.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeproperties.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/subvolumes/version.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/README.md create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/client.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/constants.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/method_create.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/method_delete.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/method_get.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/method_listbynetappaccount.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_exportpolicyrule.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_mounttargetproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_placementkeyvaluepairs.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_replicationobject.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumebackupproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegroup.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupdetails.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplist.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplistproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupmetadata.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupvolumeproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumeproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesdataprotection.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesexportpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumerelocationproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/model_volumesnapshotproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumegroups/version.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/README.md create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/client.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/constants.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/method_create.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/method_delete.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/method_get.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/method_listbyvolume.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/method_update.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarule.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulepatch.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotaruleslist.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulesproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumequotarules/version.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/README.md create mode 100644 resource-manager/netapp/2023-11-01/volumes/client.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/constants.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/method_createorupdate.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/method_delete.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/method_get.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/method_list.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/method_populateavailabilityzone.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/method_update.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_exportpolicyrule.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_mounttargetproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_placementkeyvaluepairs.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_replicationobject.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volume.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumebackupproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumepatch.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumepatchproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesdataprotection.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesexportpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumeproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesdataprotection.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesexportpolicy.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumerelocationproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/model_volumesnapshotproperties.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/predicates.go create mode 100644 resource-manager/netapp/2023-11-01/volumes/version.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/README.md create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/client.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesfinalizerelocation.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrelocate.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrevertrelocation.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/model_relocatevolumerequest.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrelocation/version.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/README.md create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/client.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/constants.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesauthorizereplication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesbreakreplication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesdeletereplication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumeslistreplications.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreestablishreplication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreinitializereplication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreplicationstatus.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/method_volumesresyncreplication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/model_authorizerequest.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/model_breakreplicationrequest.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/model_listreplications.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/model_reestablishreplicationrequest.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/model_replication.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/model_replicationstatus.go create mode 100644 resource-manager/netapp/2023-11-01/volumesreplication/version.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/README.md create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/client.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/method_volumesrevert.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/model_volumerevert.go create mode 100644 resource-manager/netapp/2023-11-01/volumesrevert/version.go create mode 100644 resource-manager/network/2022-07-01/adminrulecollections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/id_rulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/id_rulecollection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/id_securityadminconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/id_securityadminconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/model_adminrulecollection.go (100%) create mode 100644 resource-manager/network/2022-07-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/model_networkmanagersecuritygroupitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrulecollections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/adminrulecollections/version.go create mode 100644 resource-manager/network/2022-07-01/adminrules/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/id_rule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/id_rule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/id_rulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/id_rulecollection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/model_addressprefixitem.go (100%) create mode 100644 resource-manager/network/2022-07-01/adminrules/model_adminpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/model_adminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/model_baseadminrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/adminrules/model_defaultadminpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/model_defaultadminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/adminrules/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/adminrules/version.go create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/id_applicationgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/method_update.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivateendpointconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/version.go create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/id_applicationgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/id_applicationgateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewayprivatelinkresources/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/version.go create mode 100644 resource-manager/network/2022-07-01/applicationgateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/id_applicationgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/id_applicationgateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/id_predefinedpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/id_predefinedpolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_backendhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_backendhealthondemand.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_getsslpredefinedpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listavailablerequestheaders.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listavailableresponseheaders.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listavailableservervariables.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listavailablessloptions.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listavailablesslpredefinedpolicies.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_listavailablewafrulesets.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_start.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_stop.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayauthenticationcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayautoscaleconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayavailablessloptions.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhealthondemand.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhealthpool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhealthserver.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhttpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayclientauthconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayconnectiondraining.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaycustomerror.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfirewallexclusion.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfirewallrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfirewallrulegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfirewallruleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfrontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfrontendport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayglobalconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayheaderconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayhttplistener.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaylistener.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayloaddistributionpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayloaddistributiontarget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayondemandprobe.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaypathrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprobe.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprobehealthresponsematch.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayprobepropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayredirectconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrequestroutingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrewriterule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrewriteruleactionset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrewriterulecondition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrewriteruleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayroutingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaytrustedclientcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaytrustedrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayurlconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayurlpathmap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgateways/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgateways/version.go create mode 100644 resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/method_defaultget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationgatewaywafdynamicmanifests/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/version.go create mode 100644 resource-manager/network/2022-07-01/applicationsecuritygroups/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/id_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/id_applicationsecuritygroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/applicationsecuritygroups/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/applicationsecuritygroups/version.go create mode 100644 resource-manager/network/2022-07-01/availabledelegations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/id_providerlocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/id_providerlocation_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/method_availabledelegationslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/method_availableresourcegroupdelegationslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/model_availabledelegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availabledelegations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/availabledelegations/version.go create mode 100644 resource-manager/network/2022-07-01/availableservicealiases/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/id_providerlocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/id_providerlocation_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/model_availableservicealias.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/availableservicealiases/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/availableservicealiases/version.go create mode 100644 resource-manager/network/2022-07-01/azurefirewalls/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/azurefirewalls/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/id_azurefirewall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/id_azurefirewall_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_azurefirewallslistlearnedprefixes.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallapplicationrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallapplicationrulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallapplicationruleprotocol.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallipgroups.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnatrcaction.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnatrulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnetworkrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnetworkrulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallpublicipaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallrcaction.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_azurefirewallsku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_hubipaddresses.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_hubpublicipaddresses.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_ipprefixeslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/azurefirewalls/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/azurefirewalls/version.go create mode 100644 resource-manager/network/2022-07-01/bastionhosts/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/id_bastionhost.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/id_bastionhost_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_deletebastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_disconnectactivesessions.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_getactivesessions.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_getbastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_putbastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionactivesession.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionhost.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionhostipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/bastionhosts/model_bastionhostpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionsessionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_bastionshareablelinklistrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_resource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_sessionids.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_sku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionhosts/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/bastionhosts/version.go create mode 100644 resource-manager/network/2022-07-01/bastionshareablelink/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/id_bastionhost.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/id_bastionhost_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/method_deletebastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/method_getbastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/method_putbastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/model_bastionshareablelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/model_bastionshareablelinklistrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/model_resource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bastionshareablelink/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/bastionshareablelink/version.go create mode 100644 resource-manager/network/2022-07-01/bgpservicecommunities/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/bgpservicecommunities/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bgpservicecommunities/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bgpservicecommunities/model_bgpcommunity.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bgpservicecommunities/model_bgpservicecommunity.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/bgpservicecommunities/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/bgpservicecommunities/version.go create mode 100644 resource-manager/network/2022-07-01/checkdnsavailabilities/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/checkdnsavailabilities/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/checkdnsavailabilities/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/checkdnsavailabilities/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/checkdnsavailabilities/method_checkdnsnameavailability.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/checkdnsavailabilities/model_dnsnameavailabilityresult.go (100%) create mode 100644 resource-manager/network/2022-07-01/checkdnsavailabilities/version.go create mode 100644 resource-manager/network/2022-07-01/client.go create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/id_providercloudservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/id_providercloudservice_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/cloudservicepublicipaddresses/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/cloudservicepublicipaddresses/version.go create mode 100644 resource-manager/network/2022-07-01/connectionmonitors/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/id_connectionmonitor.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/id_connectionmonitor_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/id_networkwatcher.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/id_networkwatcher_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_query.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_start.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_stop.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitor.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitordestination.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorendpointfilter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorendpointfilteritem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorendpointscope.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorendpointscopeitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorhttpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitoricmpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorlistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitoroutput.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorqueryresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorresultproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorsource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorsuccessthreshold.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitortcpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitortestconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitortestgroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionmonitorworkspacesettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectionstatesnapshot.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectivityhop.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_connectivityissue.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_hoplink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_hoplinkproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_httpheader.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectionmonitors/model_tagsobject.go (100%) create mode 100644 resource-manager/network/2022-07-01/connectionmonitors/version.go create mode 100644 resource-manager/network/2022-07-01/connectivityconfigurations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/id_connectivityconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/id_connectivityconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/model_connectivityconfiguration.go (100%) create mode 100644 resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivityconfigurationproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/model_connectivitygroupitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/model_hub.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/connectivityconfigurations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/connectivityconfigurations/version.go create mode 100644 resource-manager/network/2022-07-01/customipprefixes/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/id_customipprefix.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/id_customipprefix_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/model_customipprefix.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/model_customipprefixpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/customipprefixes/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/customipprefixes/version.go create mode 100644 resource-manager/network/2022-07-01/ddoscustompolicies/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/id_ddoscustompolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/id_ddoscustompolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/model_ddoscustompolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddoscustompolicies/model_tagsobject.go (100%) create mode 100644 resource-manager/network/2022-07-01/ddoscustompolicies/version.go create mode 100644 resource-manager/network/2022-07-01/ddosprotectionplans/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/id_ddosprotectionplan.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/id_ddosprotectionplan_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/model_ddosprotectionplan.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ddosprotectionplans/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/ddosprotectionplans/version.go create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/id_dscpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/id_dscpconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_dscpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_dscpconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_qosdefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_qosiprange.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_qosportrange.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfiguration/model_virtualnetworktappropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfiguration/version.go create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/method_dscpconfigurationlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/method_dscpconfigurationlistall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_dscpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_dscpconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_qosdefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_qosiprange.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_qosportrange.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/dscpconfigurations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/dscpconfigurations/version.go create mode 100644 resource-manager/network/2022-07-01/endpointservices/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/endpointservices/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/endpointservices/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/endpointservices/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/endpointservices/method_availableendpointserviceslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/endpointservices/model_endpointserviceresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/endpointservices/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/endpointservices/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitarptable/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitarptable/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitarptable/id_arptable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitarptable/id_arptable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitarptable/model_expressroutecircuitarptable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitarptable/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitarptable/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitauthorizations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/id_authorization.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/id_authorization_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/id_expressroutecircuit.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/id_expressroutecircuit_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitauthorizations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitauthorizations/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/id_peeringconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/id_peeringconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/model_expressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitconnections/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitpeerings/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/id_expressroutecircuit.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/id_expressroutecircuit_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressroutecircuitpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressroutecircuitstats.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_expressrouteconnectionid.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitpeerings/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitpeerings/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitroutestable/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestable/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestable/id_peeringroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestable/id_peeringroutetable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestable/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitroutestable/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestablesummary/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestablesummary/id_routetablessummary.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestablesummary/id_routetablessummary_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitroutestablesummary/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuits/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/id_expressroutecircuit.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/id_expressroutecircuit_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_authorizationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuit.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitauthorization.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitsku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressroutecircuitstats.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_expressrouteconnectionid.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_ipv6circuitconnectionconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_peerexpressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuits/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuits/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitstats/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitstats/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitstats/id_expressroutecircuit.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitstats/id_expressroutecircuit_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitstats/method_expressroutecircuitsgetstats.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecircuitstats/model_expressroutecircuitstats.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecircuitstats/version.go create mode 100644 resource-manager/network/2022-07-01/expressrouteconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/id_expressrouteconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/id_expressrouteconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/id_expressroutegateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/id_expressroutegateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_expressroutecircuitpeeringid.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_expressrouteconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_expressrouteconnectionlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_expressrouteconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_propagatedroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_routingconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_staticroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_staticroutesconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteconnections/model_vnetroute.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressrouteconnections/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionarptable/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionarptable/id_peeringarptable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionarptable/id_peeringarptable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionarptable/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/id_peering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/id_peering_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionpeerings/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetable/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetable/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetablesummary/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnectionroutetablesummary/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/id_expressroutecrossconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/id_expressroutecrossconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_expressroutecircuitreference.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_expressroutecrossconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutecrossconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutecrossconnections/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutegateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/id_expressroutegateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/id_expressroutegateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/method_listbysubscription.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressroutecircuitpeeringid.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressrouteconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressrouteconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressroutegateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressroutegatewaylist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressroutegatewayproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_propagatedroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_routingconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_staticroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_staticroutesconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_virtualhubid.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutegateways/model_vnetroute.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutegateways/version.go create mode 100644 resource-manager/network/2022-07-01/expressroutelinks/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/id_expressrouteport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/id_expressrouteport_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/id_link.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/id_link_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/model_expressroutelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/model_expressroutelinkmacsecconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/model_expressroutelinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressroutelinks/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressroutelinks/version.go create mode 100644 resource-manager/network/2022-07-01/expressrouteportauthorizations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/id_expressrouteport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/id_expressrouteport_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/id_expressrouteportauthorization.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/id_expressrouteportauthorization_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/model_expressrouteportauthorization.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportauthorizations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressrouteportauthorizations/version.go create mode 100644 resource-manager/network/2022-07-01/expressrouteports/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/id_expressrouteport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/id_expressrouteport_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_generateloa.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_expressroutelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_expressroutelinkmacsecconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_expressroutelinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_expressrouteport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_expressrouteportpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_generateexpressrouteportsloarequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_generateexpressrouteportsloaresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteports/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressrouteports/version.go create mode 100644 resource-manager/network/2022-07-01/expressrouteportslocations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/id_expressrouteportslocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/id_expressrouteportslocation_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/model_expressrouteportslocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/model_expressrouteportslocationbandwidths.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteportslocations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressrouteportslocations/version.go create mode 100644 resource-manager/network/2022-07-01/expressrouteproviderports/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/id_expressrouteproviderport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/id_expressrouteproviderport_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/method_expressrouteproviderport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/method_locationlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/model_expressrouteproviderport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/model_expressrouteproviderportproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteproviderports/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressrouteproviderports/version.go create mode 100644 resource-manager/network/2022-07-01/expressrouteserviceproviders/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/model_expressrouteserviceprovider.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/expressrouteserviceproviders/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/expressrouteserviceproviders/version.go create mode 100644 resource-manager/network/2022-07-01/firewallpolicies/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/id_firewallpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/id_firewallpolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_firewallpolicyidpssignatureslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_dnssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_explicitproxy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_filteritems.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicycertificateauthority.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyinsights.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyintrusiondetection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyloganalyticsresources.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicysnat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicysql.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicythreatintelwhitelist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_firewallpolicytransportsecurity.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_idpsqueryobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_orderby.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_queryresults.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_signatureoverridesfiltervaluesquery.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_signaturesoverrides.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_signaturesoverrideslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_signaturesoverridesproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_singlequeryresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicies/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/firewallpolicies/version.go create mode 100644 resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/id_firewallpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/method_list.go (100%) create mode 100644 resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_applicationrule.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_natrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/model_networkrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/firewallpolicyrulecollectiongroups/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/version.go create mode 100644 resource-manager/network/2022-07-01/flowlogs/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/id_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/id_flowlog_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/id_networkwatcher.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/id_networkwatcher_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/flowlogs/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/flowlogs/version.go create mode 100644 resource-manager/network/2022-07-01/ipallocations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/id_ipallocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/id_ipallocation_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/model_ipallocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/model_ipallocationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipallocations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/ipallocations/version.go create mode 100644 resource-manager/network/2022-07-01/ipgroups/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/id_ipgroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/id_ipgroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/method_updategroups.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/model_ipgroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/model_ipgrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/ipgroups/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/ipgroups/version.go create mode 100644 resource-manager/network/2022-07-01/loadbalancers/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_backendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_backendaddresspool_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_frontendipconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_inboundnatrule_test.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer.go create mode 100644 resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer_test.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_loadbalancerbackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_loadbalancerbackendaddresspool_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_loadbalancingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_loadbalancingrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_outboundrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_outboundrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_probe.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/id_probe_test.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_createorupdate.go create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_delete.go create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_get.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_inboundnatrulescreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_inboundnatrulesdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_inboundnatrulesget.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_inboundnatruleslist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_listinboundnatruleportmappings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalancerbackendaddresspoolsget.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalancerloadbalancingrulesget.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalanceroutboundrulesget.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_loadbalanceroutboundruleslist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_loadbalancerprobesget.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerprobeslist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/method_swappublicipaddresses.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/method_updatetags.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_backendaddressinboundnatruleportmappings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_inboundnatpool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_inboundnatpoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_inboundnatruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancer.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancerpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancersku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancervipswaprequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_loadbalancingrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_outboundrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_outboundrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_probe.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_probepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_queryinboundnatruleportmappingrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/loadbalancers/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/loadbalancers/version.go create mode 100644 resource-manager/network/2022-07-01/localnetworkgateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/id_localnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/id_localnetworkgateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/model_bgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/model_localnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/localnetworkgateways/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/localnetworkgateways/version.go create mode 100644 resource-manager/network/2022-07-01/natgateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/id_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/id_natgateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/natgateways/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/natgateways/version.go create mode 100644 resource-manager/network/2022-07-01/networkgroups/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/id_networkgroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/id_networkgroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/model_networkgroup.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkgroups/model_networkgroupproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkgroups/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkgroups/version.go create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/README.md rename resource-manager/{azurestackhci/2023-09-01-preview => network/2022-07-01}/networkinterfaces/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_providercloudservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_providercloudservice_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_roleinstance.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_roleinstance_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_roleinstancenetworkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_roleinstancenetworkinterface_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_tapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_tapconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_virtualmachine.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_virtualmachine_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_virtualmachinescaleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/id_virtualmachinescaleset_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_getcloudservicenetworkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_geteffectiveroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listcloudservicenetworkinterfaces.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listeffectivenetworksecuritygroups.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_networkinterfaceipconfigurationsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_networkinterfaceipconfigurationslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_networkinterfaceloadbalancerslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_networkinterfacetapconfigurationsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_networkinterfacetapconfigurationslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_effectivenetworksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_effectivenetworksecuritygroupassociation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_effectivenetworksecurityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_effectiveroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_inboundnatpool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_inboundnatpoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancer.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancerpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancersku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_loadbalancingrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_outboundrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_outboundrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_probe.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_probepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkinterfaces/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkinterfaces/version.go create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconfigurations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_activeconfigurationparameter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_activesecurityadminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_addressprefixitem.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_configurationgroup.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_networkgroupproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconfigurations/version.go create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanageractiveconnectivityconfigurations/model_hub.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go create mode 100644 resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/version.go create mode 100644 resource-manager/network/2022-07-01/networkmanagerconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/id_networkmanagerconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/id_networkmanagerconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/id_providers2networkmanagerconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/id_providers2networkmanagerconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/model_networkmanagerconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/model_networkmanagerconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagerconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagerconnections/version.go create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/model_hub.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/version.go create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_configurationgroup.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/version.go create mode 100644 resource-manager/network/2022-07-01/networkmanagers/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_listbysubscription.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_networkmanagercommitspost.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_networkmanagerdeploymentstatuslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/method_patch.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_crosstenantscopes.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_networkmanagercommit.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_networkmanagerdeploymentstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_networkmanagerdeploymentstatusparameter.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/model_patchobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkmanagers/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkmanagers/version.go create mode 100644 resource-manager/network/2022-07-01/networkprofiles/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/id_networkprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/id_networkprofile_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_containernetworkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_containernetworkinterfaceconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_containernetworkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_containernetworkinterfacepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networkprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkprofiles/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkprofiles/version.go create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/id_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/id_networksecuritygroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networksecuritygroups/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networksecuritygroups/version.go create mode 100644 resource-manager/network/2022-07-01/networkvirtualappliances/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/id_inboundsecurityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/id_inboundsecurityrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/id_networkvirtualappliance.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/id_networkvirtualappliance_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_delegationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_inboundsecurityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_inboundsecurityruleproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_inboundsecurityrules.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_networkvirtualappliance.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_partnermanagedresourceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_tagsobject.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkvirtualappliances/model_virtualappliancenicproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/model_virtualapplianceskuproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkvirtualappliances/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkvirtualappliances/version.go create mode 100644 resource-manager/network/2022-07-01/networkwatchers/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/id_networkwatcher.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/id_networkwatcher_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_checkconnectivity.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_getazurereachabilityreport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_getflowlogstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_getnetworkconfigurationdiagnostic.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_getnexthop.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_gettopology.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_gettroubleshooting.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_gettroubleshootingresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_getvmsecurityrules.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_listavailableproviders.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_setflowlogconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/method_verifyipflow.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_availableproviderslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_availableproviderslistcity.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_availableproviderslistcountry.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_availableproviderslistparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_availableprovidersliststate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_azurereachabilityreport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_azurereachabilityreportitem.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_azurereachabilityreportlatencyinfo.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_azurereachabilityreportlocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_azurereachabilityreportparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_connectivitydestination.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_connectivityhop.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_connectivityinformation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_connectivityissue.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_connectivityparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_connectivitysource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_effectivenetworksecurityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_evaluatednetworksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_flowloginformation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_flowlogproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_flowlogstatusparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_hoplink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_hoplinkproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_httpconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_httpheader.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_matchedrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkconfigurationdiagnosticparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkconfigurationdiagnosticprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkconfigurationdiagnosticresponse.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkconfigurationdiagnosticresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkinterfaceassociation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networksecuritygroupresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networksecurityrulesevaluationresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkwatcher.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkwatcherlistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_networkwatcherpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_nexthopparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_nexthopresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_protocolconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_querytroubleshootingparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_securitygroupnetworkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_securitygroupviewparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_securitygroupviewresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_securityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_securityruleassociations.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkwatchers/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_subnetassociation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_topology.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_topologyassociation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_topologyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_topologyresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_troubleshootingdetails.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_troubleshootingparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_troubleshootingproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_troubleshootingrecommendedactions.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_troubleshootingresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_verificationipflowparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/networkwatchers/model_verificationipflowresult.go (100%) create mode 100644 resource-manager/network/2022-07-01/networkwatchers/version.go create mode 100644 resource-manager/network/2022-07-01/p2svpngateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/method_disconnectp2svpnconnections.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/method_generatevpnprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/method_getp2svpnconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/method_reset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2sconnectionconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2sconnectionconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2svpnconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2svpnconnectionhealthrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2svpnconnectionrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2svpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2svpngatewayproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_p2svpnprofileparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_propagatedroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_routingconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_staticroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_staticroutesconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_vnetroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_vpnclientconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_vpnprofileresponse.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_vpnserverconfigurationpolicygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/p2svpngateways/version.go create mode 100644 resource-manager/network/2022-07-01/packetcaptures/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/id_networkwatcher.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/id_networkwatcher_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/id_packetcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/id_packetcapture_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/method_create.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/method_getstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/method_stop.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcapturefilter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcapturelistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcapturemachinescope.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcaptureparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcapturequerystatusresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcaptureresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcaptureresultproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/packetcaptures/model_packetcapturestoragelocation.go (100%) create mode 100644 resource-manager/network/2022-07-01/packetcaptures/version.go create mode 100644 resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/id_peerconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/id_peerconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/peerexpressroutecircuitconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/version.go create mode 100644 resource-manager/network/2022-07-01/privatednszonegroups/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/id_privatednszonegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/id_privatednszonegroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/id_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/id_privateendpoint_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/model_privatednszoneconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/model_privatednszonegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/model_privatednszonegrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/model_privatednszonepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/model_recordset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatednszonegroups/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatednszonegroups/version.go create mode 100644 resource-manager/network/2022-07-01/privateendpoints/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/id_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/id_privateendpoint_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/id_providerlocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/id_providerlocation_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_availableprivateendpointtypeslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/method_listbysubscription.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_availableprivateendpointtype.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privateendpoints/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/privateendpoints/version.go create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/id_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/id_privatelinkservice_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservice/model_virtualnetworktappropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservice/version.go create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_privateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_privateendpointconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_privatelinkservice_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_providerlocation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/id_providerlocation_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_checkprivatelinkservicevisibility.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_deleteprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_getprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_listautoapprovedprivatelinkservices.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_listbysubscription.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_listprivateendpointconnections.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/method_updateprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_autoapprovedprivatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_privatelinkservicevisibility.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/privatelinkservices/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/privatelinkservices/version.go create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_ddosprotectionstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_publicipddosprotectionstatusresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipaddresses/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipaddresses/version.go create mode 100644 resource-manager/network/2022-07-01/publicipprefixes/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/id_publicipprefix.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/id_publicipprefix_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_publicipprefix.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_publicipprefixpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_publicipprefixsku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_referencedpublicipaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/publicipprefixes/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/publicipprefixes/version.go create mode 100644 resource-manager/network/2022-07-01/routefilterrules/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/id_routefilter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/id_routefilter_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/id_routefilterrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/id_routefilterrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/method_listbyroutefilter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/model_routefilterrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/model_routefilterrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilterrules/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/routefilterrules/version.go create mode 100644 resource-manager/network/2022-07-01/routefilters/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/id_routefilter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/id_routefilter_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressroutecircuitpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressroutecircuitpeeringpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressroutecircuitstats.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_expressrouteconnectionid.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_ipv6circuitconnectionconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_ipv6expressroutecircuitpeeringconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_peerexpressroutecircuitconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_routefilter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_routefilterpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_routefilterrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_routefilterrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routefilters/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/routefilters/version.go create mode 100644 resource-manager/network/2022-07-01/routes/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/id_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/id_route_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/id_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/id_routetable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routes/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/routes/version.go create mode 100644 resource-manager/network/2022-07-01/routetables/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/id_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/id_routetable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/routetables/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/routetables/version.go create mode 100644 resource-manager/network/2022-07-01/scopeconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/id_scopeconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/id_scopeconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/model_scopeconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/model_scopeconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/scopeconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/scopeconnections/version.go create mode 100644 resource-manager/network/2022-07-01/securityadminconfigurations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/id_networkmanager.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/id_networkmanager_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/id_securityadminconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/id_securityadminconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/model_securityadminconfiguration.go (100%) create mode 100644 resource-manager/network/2022-07-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityadminconfigurations/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/securityadminconfigurations/version.go create mode 100644 resource-manager/network/2022-07-01/securitypartnerproviders/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/id_securitypartnerprovider.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/id_securitypartnerprovider_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/model_securitypartnerprovider.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securitypartnerproviders/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/securitypartnerproviders/version.go create mode 100644 resource-manager/network/2022-07-01/securityrules/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/id_defaultsecurityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/id_defaultsecurityrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/id_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/id_networksecuritygroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/id_securityrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/id_securityrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/method_defaultsecurityrulesget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/method_defaultsecurityruleslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/securityrules/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/securityrules/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/securityrules/version.go create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/id_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/id_serviceendpointpolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicies/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicies/version.go create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/serviceendpointpolicydefinitions/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/version.go create mode 100644 resource-manager/network/2022-07-01/servicetags/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/method_servicetaginformationlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/method_servicetagslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/model_servicetaginformation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/model_servicetaginformationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/model_servicetagslistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/servicetags/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/servicetags/version.go create mode 100644 resource-manager/network/2022-07-01/staticmembers/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/id_networkgroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/id_networkgroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/id_staticmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/id_staticmember_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/model_staticmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/model_staticmemberproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/staticmembers/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/staticmembers/version.go create mode 100644 resource-manager/network/2022-07-01/subnets/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/subnets/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/subnets/version.go create mode 100644 resource-manager/network/2022-07-01/trafficanalytics/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/id_networkwatcher.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/id_networkwatcher_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/method_networkwatchersgetflowlogstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_flowloginformation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_flowlogproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_flowlogstatusparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/trafficanalytics/model_trafficanalyticsproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/trafficanalytics/version.go create mode 100644 resource-manager/network/2022-07-01/usages/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/id_location.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/id_location_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/model_usage.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/model_usagename.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/usages/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/usages/version.go create mode 100644 resource-manager/network/2022-07-01/vipswap/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/id_cloudservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/id_cloudservice_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/method_create.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/model_swapresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/model_swapresourcelistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vipswap/model_swapresourceproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/vipswap/version.go create mode 100644 resource-manager/network/2022-07-01/virtualappliancesites/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/id_networkvirtualappliance.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/id_networkvirtualappliance_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/id_virtualappliancesite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/id_virtualappliancesite_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/model_breakoutcategorypolicies.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/model_office365policyproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/model_virtualappliancesite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/model_virtualappliancesiteproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualappliancesites/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualappliancesites/version.go create mode 100644 resource-manager/network/2022-07-01/virtualapplianceskus/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/id_networkvirtualappliancesku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/id_networkvirtualappliancesku_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/model_networkvirtualappliancesku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualapplianceskus/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualapplianceskus/version.go create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/id_connection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/id_connection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_getikesas.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_getsharedkey.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_resetconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_resetsharedkey.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_setsharedkey.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_startpacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_stoppacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_bgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_connectionsharedkey.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_ipsecpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_localnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_radiusserver.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgatewayconnections/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/version.go create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgateways/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/id_connection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/id_connection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/id_virtualnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/id_virtualnetworkgateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_generatevpnclientpackage.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_generatevpnprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_getadvertisedroutes.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_getbgppeerstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_getlearnedroutes.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_getvpnclientconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_getvpnclientipsecparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_getvpnprofilepackageurl.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_listconnections.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_reset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_resetvpnclientsharedkey.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_setvpnclientipsecparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_startpacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_stoppacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_supportedvpndevices.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/method_vpndeviceconfigurationscript.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_bgppeerstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_bgppeerstatuslistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_bgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_gatewayroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_gatewayroutelistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_ipsecpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_p2svpnconnectionrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_radiusserver.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_trafficselectorpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_tunnelconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_virtualnetworkgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vngclientconnectionconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientipsecparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientrevokedcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpndevicescriptparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnnatrulemapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkgateways/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkgateways/version.go create mode 100644 resource-manager/network/2022-07-01/virtualnetworkpeerings/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/id_virtualnetworkpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/id_virtualnetworkpeering_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/model_virtualnetworkencryption.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/model_virtualnetworkpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworkpeerings/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworkpeerings/version.go create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/README.md rename resource-manager/network/{2023-05-01 => 2022-07-01}/virtualnetworks/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_resourcenavigationlinkslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_serviceassociationlinkslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_subnetspreparenetworkpolicies.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_subnetsunpreparenetworkpolicies.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/method_virtualnetworkslistusage.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_dhcpoptions.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_ipaddressavailabilityresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkintentpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkintentpolicyconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_preparenetworkpoliciesrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_publicipddosprotectionstatusresult.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_unpreparenetworkpoliciesrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetwork.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworkbgpcommunities.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworkencryption.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworkpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworkusage.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/model_virtualnetworkusagename.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworks/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworks/version.go create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/id_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/id_virtualnetworktap_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktap/model_virtualnetworktappropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktap/version.go create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualnetworktaps/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualnetworktaps/version.go create mode 100644 resource-manager/network/2022-07-01/virtualrouterpeerings/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/id_virtualrouter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/id_virtualrouter_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/model_virtualrouterpeering.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/model_virtualrouterpeeringproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouterpeerings/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualrouterpeerings/version.go create mode 100644 resource-manager/network/2022-07-01/virtualrouters/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/id_virtualrouter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/id_virtualrouter_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/method_listbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/model_virtualrouter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/model_virtualrouterpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualrouters/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualrouters/version.go create mode 100644 resource-manager/network/2022-07-01/virtualwans/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_configurationpolicygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_configurationpolicygroup_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_hubroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_hubroutetable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_hubvirtualnetworkconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_hubvirtualnetworkconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_natrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_natrule_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_routemap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_routemap_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_routingintent.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_routingintent_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_virtualhub.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_virtualhub_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_virtualhubroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_virtualhubroutetable_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_virtualwan.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_virtualwan_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpngateway_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnlinkconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnlinkconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnserverconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnserverconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnsite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnsite_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnsitelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/id_vpnsitelink_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_configurationpolicygroupscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_configurationpolicygroupsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_configurationpolicygroupsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubroutetablescreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubroutetablesdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubroutetablesget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubroutetableslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubvirtualnetworkconnectionsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubvirtualnetworkconnectionsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_hubvirtualnetworkconnectionslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_natrulescreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_natrulesdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_natrulesget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_natruleslistbyvpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_p2svpngatewayscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_p2svpngatewaysdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_p2svpngatewaysget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_p2svpngatewayslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_p2svpngatewayslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routemapscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routemapsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routemapsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routemapslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routingintentcreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routingintentdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routingintentget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_routingintentlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_supportedsecurityproviders.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubbgpconnectiondelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubbgpconnectionget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubbgpconnectionslist.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go create mode 100644 resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubipconfigurationcreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubipconfigurationdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubipconfigurationget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubipconfigurationlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubroutetablev2screateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubroutetablev2sdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubroutetablev2sget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubroutetablev2slist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubsget.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go create mode 100644 resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetinboundroutes.go create mode 100644 resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetoutboundroutes.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualhubsupdatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualwanscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualwansdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualwansget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualwanslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_virtualwanslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnconnectionscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnconnectionsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnconnectionsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnconnectionslistbyvpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnconnectionsstartpacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnconnectionsstoppacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpngatewayscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpngatewaysdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpngatewaysget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpngatewayslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpngatewayslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnlinkconnectionsgetikesas.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnserverconfigurationscreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnserverconfigurationsdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnserverconfigurationsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnserverconfigurationslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitelinkconnectionsget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitelinksget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitelinkslistbyvpnsite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitesconfigurationdownload.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitescreateorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitesdelete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsitesget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsiteslist.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/method_vpnsiteslistbyresourcegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_aadauthenticationparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_action.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_bgpconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_bgpconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_bgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_criterion.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_deviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_effectiveroutesparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_getinboundroutesparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_getoutboundroutesparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_getvpnsitesconfigurationrequest.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubroutetableproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubvirtualnetworkconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_hubvirtualnetworkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ipconfigurationbgppeeringaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_ipsecpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_o365breakoutcategorypolicies.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_o365policyproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_p2sconnectionconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_p2sconnectionconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_p2svpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_p2svpngatewayproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_parameter.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_peerroute.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_peerroutelist.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_propagatedroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_radiusserver.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routemap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routemapproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routemaprule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routingconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routingintent.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routingintentproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_routingpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_staticroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_staticroutesconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_trafficselectorpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhub.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhubproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhubroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhubroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhubroutetablev2.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhubroutetablev2properties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualhubroutev2.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualrouterautoscaleconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualwan.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualwanproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualwansecurityprovider.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualwansecurityproviders.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_virtualwanvpnprofileparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vnetroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnclientconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnconnectionpacketcapturestartparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnconnectionpacketcapturestopparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpngatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpngatewaynatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpngatewaynatruleproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpngatewayproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnlinkbgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnlinkproviderproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnnatrulemapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnprofileresponse.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigurationpolicygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigurationpolicygroupmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigurationsresponse.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnsite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnsitelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnsitelinkconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnsitelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnsitelinkproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/model_vpnsiteproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/virtualwans/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/virtualwans/version.go create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/id_virtualmachinescaleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/id_virtualmachinescaleset_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vmsspublicipaddresses/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/vmsspublicipaddresses/version.go create mode 100644 resource-manager/network/2022-07-01/vpngateways/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/id_vpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/id_vpngateway_test.go (100%) create mode 100644 resource-manager/network/2022-07-01/vpngateways/method_reset.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/method_startpacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/method_stoppacketcapture.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_bgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_ipconfigurationbgppeeringaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_ipsecpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_propagatedroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_routingconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_staticroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_staticroutesconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_trafficselectorpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vnetroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpnconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpnconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngatewaynatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngatewaynatruleproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngatewaypacketcapturestartparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngatewaypacketcapturestopparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpngatewayproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpnnatrulemapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpnsitelinkconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpngateways/model_vpnsitelinkconnectionproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/vpngateways/version.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnlinkconnections/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnlinkconnections/id_vpnlinkconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnlinkconnections/id_vpnlinkconnection_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnlinkconnections/method_resetconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/vpnlinkconnections/version.go create mode 100644 resource-manager/network/2022-07-01/vpnserverconfigurations/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/id_vpnserverconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/id_vpnserverconfiguration_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_aadauthenticationparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_ipsecpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_p2sconnectionconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_p2svpngateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_p2svpngatewayproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_propagatedroutetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_radiusserver.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_routingconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_staticroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_staticroutesconfig.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vnetroute.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnclientconnectionhealth.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go (100%) create mode 100644 resource-manager/network/2022-07-01/vpnserverconfigurations/version.go create mode 100644 resource-manager/network/2022-07-01/vpnsites/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/constants.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/id_vpnsite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/id_vpnsite_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/method_updatetags.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_addressspace.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_bgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_deviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_ipconfigurationbgppeeringaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_o365breakoutcategorypolicies.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_o365policyproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_tagsobject.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_vpnlinkbgpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_vpnlinkproviderproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_vpnsite.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_vpnsitelink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_vpnsitelinkproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/vpnsites/model_vpnsiteproperties.go (100%) create mode 100644 resource-manager/network/2022-07-01/vpnsites/version.go create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/client.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/constants.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/method_createorupdate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/method_delete.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/method_list.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/method_listall.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaylistener.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprobe.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationsecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_backendaddresspool.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_ddossettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_delegation.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_exclusionmanagedrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_flowlog.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_flowlogformatparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_frontendipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_inboundnatrule.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_ipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_ipconfigurationprofile.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_iptag.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_managedrulegroupoverride.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_managedruleoverride.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_managedrulesdefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_managedruleset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_matchcondition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_matchvariable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_natgateway.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_natgatewaysku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_natruleportmapping.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterface.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterfacednssettings.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networksecuritygroup.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_policysettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privateendpoint.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privateendpointconnection.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privateendpointproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkservice.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_publicipaddress.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_publicipaddresssku.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_resourcenavigationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_resourceset.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_retentionpolicyparameters.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_route.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_routepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_routetable.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_routetablepropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_securityrule.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceassociationlink.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceendpointpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_subnet.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_subresource.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_virtualnetworktap.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webapplicationfirewallpolicies/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/webapplicationfirewallpolicies/version.go create mode 100644 resource-manager/network/2022-07-01/webcategories/README.md rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/client.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/id_azurewebcategory.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/id_azurewebcategory_test.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/method_get.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/method_listbysubscription.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/model_azurewebcategory.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/model_azurewebcategorypropertiesformat.go (100%) rename resource-manager/network/{2023-04-01 => 2022-07-01}/webcategories/predicates.go (100%) create mode 100644 resource-manager/network/2022-07-01/webcategories/version.go delete mode 100644 resource-manager/network/2023-04-01/adminrulecollections/README.md delete mode 100644 resource-manager/network/2023-04-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/adminrulecollections/version.go delete mode 100644 resource-manager/network/2023-04-01/adminrules/README.md delete mode 100644 resource-manager/network/2023-04-01/adminrules/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/adminrules/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/adminrules/version.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/constants.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/README.md delete mode 100644 resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/version.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/README.md delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/constants.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/applicationgateways/version.go delete mode 100644 resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/README.md delete mode 100644 resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/version.go delete mode 100644 resource-manager/network/2023-04-01/applicationsecuritygroups/README.md delete mode 100644 resource-manager/network/2023-04-01/applicationsecuritygroups/version.go delete mode 100644 resource-manager/network/2023-04-01/availabledelegations/README.md delete mode 100644 resource-manager/network/2023-04-01/availabledelegations/version.go delete mode 100644 resource-manager/network/2023-04-01/availableservicealiases/README.md delete mode 100644 resource-manager/network/2023-04-01/availableservicealiases/version.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/README.md delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/constants.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/method_packetcapture.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcapturerule.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparameters.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go delete mode 100644 resource-manager/network/2023-04-01/azurefirewalls/version.go delete mode 100644 resource-manager/network/2023-04-01/bastionhosts/README.md delete mode 100644 resource-manager/network/2023-04-01/bastionhosts/model_bastionhostpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/bastionhosts/version.go delete mode 100644 resource-manager/network/2023-04-01/bastionshareablelink/README.md delete mode 100644 resource-manager/network/2023-04-01/bastionshareablelink/version.go delete mode 100644 resource-manager/network/2023-04-01/bgpservicecommunities/README.md delete mode 100644 resource-manager/network/2023-04-01/bgpservicecommunities/version.go delete mode 100644 resource-manager/network/2023-04-01/checkdnsavailabilities/README.md delete mode 100644 resource-manager/network/2023-04-01/checkdnsavailabilities/version.go delete mode 100644 resource-manager/network/2023-04-01/client.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/README.md delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/cloudservicepublicipaddresses/version.go delete mode 100644 resource-manager/network/2023-04-01/connectionmonitors/README.md delete mode 100644 resource-manager/network/2023-04-01/connectionmonitors/version.go delete mode 100644 resource-manager/network/2023-04-01/connectivityconfigurations/README.md delete mode 100644 resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-04-01/connectivityconfigurations/version.go delete mode 100644 resource-manager/network/2023-04-01/customipprefixes/README.md delete mode 100644 resource-manager/network/2023-04-01/customipprefixes/version.go delete mode 100644 resource-manager/network/2023-04-01/ddoscustompolicies/README.md delete mode 100644 resource-manager/network/2023-04-01/ddoscustompolicies/version.go delete mode 100644 resource-manager/network/2023-04-01/ddosprotectionplans/README.md delete mode 100644 resource-manager/network/2023-04-01/ddosprotectionplans/version.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/README.md delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/constants.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfiguration/version.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/README.md delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/constants.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/dscpconfigurations/version.go delete mode 100644 resource-manager/network/2023-04-01/endpointservices/README.md delete mode 100644 resource-manager/network/2023-04-01/endpointservices/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitarptable/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitarptable/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitauthorizations/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitauthorizations/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitpeerings/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitpeerings/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitroutestable/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitroutestable/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuits/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuits/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitstats/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecircuitstats/version.go delete mode 100644 resource-manager/network/2023-04-01/expressrouteconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/expressrouteconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutecrossconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutegateways/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutegateways/version.go delete mode 100644 resource-manager/network/2023-04-01/expressroutelinks/README.md delete mode 100644 resource-manager/network/2023-04-01/expressroutelinks/version.go delete mode 100644 resource-manager/network/2023-04-01/expressrouteportauthorizations/README.md delete mode 100644 resource-manager/network/2023-04-01/expressrouteportauthorizations/version.go delete mode 100644 resource-manager/network/2023-04-01/expressrouteports/README.md delete mode 100644 resource-manager/network/2023-04-01/expressrouteports/version.go delete mode 100644 resource-manager/network/2023-04-01/expressrouteportslocations/README.md delete mode 100644 resource-manager/network/2023-04-01/expressrouteportslocations/version.go delete mode 100644 resource-manager/network/2023-04-01/expressrouteproviderports/README.md delete mode 100644 resource-manager/network/2023-04-01/expressrouteproviderports/version.go delete mode 100644 resource-manager/network/2023-04-01/expressrouteserviceproviders/README.md delete mode 100644 resource-manager/network/2023-04-01/expressrouteserviceproviders/version.go delete mode 100644 resource-manager/network/2023-04-01/firewallpolicies/README.md delete mode 100644 resource-manager/network/2023-04-01/firewallpolicies/version.go delete mode 100644 resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/README.md delete mode 100644 resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_applicationrule.go delete mode 100644 resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go delete mode 100644 resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/version.go delete mode 100644 resource-manager/network/2023-04-01/flowlogs/README.md delete mode 100644 resource-manager/network/2023-04-01/flowlogs/version.go delete mode 100644 resource-manager/network/2023-04-01/ipallocations/README.md delete mode 100644 resource-manager/network/2023-04-01/ipallocations/version.go delete mode 100644 resource-manager/network/2023-04-01/ipgroups/README.md delete mode 100644 resource-manager/network/2023-04-01/ipgroups/version.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/README.md delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/constants.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer_test.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer_test.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_delete.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_get.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_inboundnatruleslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_loadbalanceroutboundruleslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerprobeslist.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_migratetoipbased.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/method_updatetags.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_migratedpools.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/loadbalancers/version.go delete mode 100644 resource-manager/network/2023-04-01/localnetworkgateways/README.md delete mode 100644 resource-manager/network/2023-04-01/localnetworkgateways/version.go delete mode 100644 resource-manager/network/2023-04-01/natgateways/README.md delete mode 100644 resource-manager/network/2023-04-01/natgateways/version.go delete mode 100644 resource-manager/network/2023-04-01/networkgroups/README.md delete mode 100644 resource-manager/network/2023-04-01/networkgroups/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkgroups/version.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/README.md delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/client.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/constants.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkinterfaces/version.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconfigurations/README.md delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconfigurations/version.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/README.md delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/version.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagerconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/networkmanagerconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/README.md delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/version.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/README.md delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/version.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagers/README.md delete mode 100644 resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkmanagers/version.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/README.md delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/constants.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkprofiles/version.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/README.md delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/constants.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networksecuritygroups/version.go delete mode 100644 resource-manager/network/2023-04-01/networkvirtualappliances/README.md delete mode 100644 resource-manager/network/2023-04-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualappliancenicproperties.go delete mode 100644 resource-manager/network/2023-04-01/networkvirtualappliances/version.go delete mode 100644 resource-manager/network/2023-04-01/networkwatchers/README.md delete mode 100644 resource-manager/network/2023-04-01/networkwatchers/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/networkwatchers/version.go delete mode 100644 resource-manager/network/2023-04-01/p2svpngateways/README.md delete mode 100644 resource-manager/network/2023-04-01/p2svpngateways/version.go delete mode 100644 resource-manager/network/2023-04-01/packetcaptures/README.md delete mode 100644 resource-manager/network/2023-04-01/packetcaptures/version.go delete mode 100644 resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/privatednszonegroups/README.md delete mode 100644 resource-manager/network/2023-04-01/privatednszonegroups/version.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/README.md delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/constants.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privateendpoints/version.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/README.md delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/constants.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservice/version.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/README.md delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/constants.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/privatelinkservices/version.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/README.md delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/publicipaddresses/version.go delete mode 100644 resource-manager/network/2023-04-01/publicipprefixes/README.md delete mode 100644 resource-manager/network/2023-04-01/publicipprefixes/version.go delete mode 100644 resource-manager/network/2023-04-01/routefilterrules/README.md delete mode 100644 resource-manager/network/2023-04-01/routefilterrules/version.go delete mode 100644 resource-manager/network/2023-04-01/routefilters/README.md delete mode 100644 resource-manager/network/2023-04-01/routefilters/version.go delete mode 100644 resource-manager/network/2023-04-01/routes/README.md delete mode 100644 resource-manager/network/2023-04-01/routes/version.go delete mode 100644 resource-manager/network/2023-04-01/routetables/README.md delete mode 100644 resource-manager/network/2023-04-01/routetables/constants.go delete mode 100644 resource-manager/network/2023-04-01/routetables/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/routetables/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/routetables/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/routetables/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/routetables/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/routetables/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/routetables/version.go delete mode 100644 resource-manager/network/2023-04-01/scopeconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/scopeconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/securityadminconfigurations/README.md delete mode 100644 resource-manager/network/2023-04-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/securityadminconfigurations/version.go delete mode 100644 resource-manager/network/2023-04-01/securitypartnerproviders/README.md delete mode 100644 resource-manager/network/2023-04-01/securitypartnerproviders/version.go delete mode 100644 resource-manager/network/2023-04-01/securityrules/README.md delete mode 100644 resource-manager/network/2023-04-01/securityrules/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/securityrules/version.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/README.md delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/constants.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicies/version.go delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/README.md delete mode 100644 resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/version.go delete mode 100644 resource-manager/network/2023-04-01/servicetags/README.md delete mode 100644 resource-manager/network/2023-04-01/servicetags/version.go delete mode 100644 resource-manager/network/2023-04-01/staticmembers/README.md delete mode 100644 resource-manager/network/2023-04-01/staticmembers/version.go delete mode 100644 resource-manager/network/2023-04-01/subnets/README.md delete mode 100644 resource-manager/network/2023-04-01/subnets/constants.go delete mode 100644 resource-manager/network/2023-04-01/subnets/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/subnets/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/subnets/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/subnets/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/subnets/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/subnets/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/subnets/version.go delete mode 100644 resource-manager/network/2023-04-01/trafficanalytics/README.md delete mode 100644 resource-manager/network/2023-04-01/trafficanalytics/version.go delete mode 100644 resource-manager/network/2023-04-01/usages/README.md delete mode 100644 resource-manager/network/2023-04-01/usages/version.go delete mode 100644 resource-manager/network/2023-04-01/vipswap/README.md delete mode 100644 resource-manager/network/2023-04-01/vipswap/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualappliancesites/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualappliancesites/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualapplianceskus/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualapplianceskus/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/constants.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgateways/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgateways/constants.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkgateways/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkpeerings/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualnetworkpeerings/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/constants.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworks/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/constants.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktap/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/constants.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualnetworktaps/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualrouterpeerings/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualrouterpeerings/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualrouters/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualrouters/version.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/README.md delete mode 100644 resource-manager/network/2023-04-01/virtualwans/constants.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetinboundroutes.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetoutboundroutes.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproute.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproutelist.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroute.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroutelist.go delete mode 100644 resource-manager/network/2023-04-01/virtualwans/version.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/README.md delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/vmsspublicipaddresses/version.go delete mode 100644 resource-manager/network/2023-04-01/vpngateways/README.md delete mode 100644 resource-manager/network/2023-04-01/vpngateways/method_reset.go delete mode 100644 resource-manager/network/2023-04-01/vpngateways/version.go delete mode 100644 resource-manager/network/2023-04-01/vpnlinkconnections/version.go delete mode 100644 resource-manager/network/2023-04-01/vpnserverconfigurations/README.md delete mode 100644 resource-manager/network/2023-04-01/vpnserverconfigurations/version.go delete mode 100644 resource-manager/network/2023-04-01/vpnsites/README.md delete mode 100644 resource-manager/network/2023-04-01/vpnsites/version.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/README.md delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/constants.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyusersession.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyvariable.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettings.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go delete mode 100644 resource-manager/network/2023-04-01/webapplicationfirewallpolicies/version.go delete mode 100644 resource-manager/network/2023-04-01/webcategories/README.md delete mode 100644 resource-manager/network/2023-04-01/webcategories/version.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/README.md delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/client.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/constants.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection_test.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/model_networkmanagersecuritygroupitem.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/adminrulecollections/version.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/README.md delete mode 100644 resource-manager/network/2023-05-01/adminrules/client.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/constants.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/id_rule.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/id_rule_test.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/id_rulecollection.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/id_rulecollection_test.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/method_get.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/method_list.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/model_addressprefixitem.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/model_adminrule.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/model_baseadminrule.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/model_defaultadminrule.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/predicates.go delete mode 100644 resource-manager/network/2023-05-01/adminrules/version.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_update.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_route.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/README.md delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/client.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/method_list.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/predicates.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/version.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/README.md delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/client.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_backendhealth.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_backendhealthondemand.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_get.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_getsslpredefinedpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_list.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listavailablerequestheaders.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listavailableresponseheaders.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listavailableservervariables.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listavailablessloptions.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listavailablesslpredefinedpolicies.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_listavailablewafrulesets.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_start.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_stop.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgateway.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptions.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealth.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthpool.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthserver.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayconnectiondraining.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaycustomerror.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallexclusion.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallruleset.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendport.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayglobalconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayheaderconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistener.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistener.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayondemandprobe.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobe.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulecondition.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleset.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofile.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmap.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_route.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/predicates.go delete mode 100644 resource-manager/network/2023-05-01/applicationgateways/version.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/README.md delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/client.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/constants.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_defaultget.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_get.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/predicates.go delete mode 100644 resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/version.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/README.md delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/client.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/constants.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/method_get.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/method_list.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/predicates.go delete mode 100644 resource-manager/network/2023-05-01/applicationsecuritygroups/version.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/README.md delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/client.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/id_location.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/id_providerlocation.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/method_availabledelegationslist.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/method_availableresourcegroupdelegationslist.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/model_availabledelegation.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/availabledelegations/version.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/README.md delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/client.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/id_location.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/method_list.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/model_availableservicealias.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/predicates.go delete mode 100644 resource-manager/network/2023-05-01/availableservicealiases/version.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/README.md delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/client.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/constants.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall_test.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_get.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_list.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_packetcapture.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewall.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrule.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipgroups.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrcaction.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrule.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrule.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcapturerule.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpublicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallrcaction.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallsku.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparameters.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_hubipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_hubpublicipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_ipprefixeslist.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/predicates.go delete mode 100644 resource-manager/network/2023-05-01/azurefirewalls/version.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/README.md delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/client.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/constants.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/id_bastionhost.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/id_bastionhost_test.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_deletebastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_disconnectactivesessions.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_get.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_getactivesessions.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_getbastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_list.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_putbastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionactivesession.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionhost.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionsessionstate.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelinklistrequest.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_iprule.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_resource.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_sessionids.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_sku.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/predicates.go delete mode 100644 resource-manager/network/2023-05-01/bastionhosts/version.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/README.md delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/client.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost_test.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/method_deletebastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/method_getbastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/method_putbastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelink.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelinklistrequest.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/model_resource.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/predicates.go delete mode 100644 resource-manager/network/2023-05-01/bastionshareablelink/version.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/README.md delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/client.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/method_list.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpcommunity.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunity.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/predicates.go delete mode 100644 resource-manager/network/2023-05-01/bgpservicecommunities/version.go delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/README.md delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/client.go delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/id_location.go delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/method_checkdnsnameavailability.go delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go delete mode 100644 resource-manager/network/2023-05-01/checkdnsavailabilities/version.go delete mode 100644 resource-manager/network/2023-05-01/client.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/README.md delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/client.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice_test.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_route.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/predicates.go delete mode 100644 resource-manager/network/2023-05-01/cloudservicepublicipaddresses/version.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/README.md delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/client.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/constants.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor_test.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_get.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_list.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_query.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_start.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_stop.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitor.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitordestination.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpoint.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilter.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscope.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorlistresult.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoroutput.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorparameters.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorqueryresult.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresult.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresultproperties.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsource.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortcpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestgroup.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorworkspacesettings.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectionstatesnapshot.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectivityhop.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_connectivityissue.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_hoplink.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_hoplinkproperties.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_httpheader.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/connectionmonitors/version.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/README.md delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/client.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/constants.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/method_get.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/method_list.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivitygroupitem.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/model_hub.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/connectivityconfigurations/version.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/README.md delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/client.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/constants.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/id_customipprefix.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/id_customipprefix_test.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/method_get.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/method_list.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/model_customipprefix.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/model_customipprefixpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/predicates.go delete mode 100644 resource-manager/network/2023-05-01/customipprefixes/version.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/README.md delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/client.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/constants.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/method_get.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicy.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/ddoscustompolicies/version.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/README.md delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/client.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/constants.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan_test.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/method_get.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/method_list.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplan.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/predicates.go delete mode 100644 resource-manager/network/2023-05-01/ddosprotectionplans/version.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/README.md delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/client.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/constants.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/method_get.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_qosdefinition.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_qosiprange.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_qosportrange.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_route.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfiguration/version.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/README.md delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/client.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/constants.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlist.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlistall.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_qosdefinition.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_qosiprange.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_qosportrange.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_route.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/dscpconfigurations/version.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/README.md delete mode 100644 resource-manager/network/2023-05-01/endpointservices/client.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/id_location.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/method_availableendpointserviceslist.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/model_endpointserviceresult.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/predicates.go delete mode 100644 resource-manager/network/2023-05-01/endpointservices/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitarptable/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestable/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuits/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecircuitstats/version.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_expressroutecircuitpeeringid.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionlist.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_staticroute.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/model_vnetroute.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitreference.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutecrossconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressroutecircuitpeeringid.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnection.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegateway.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaylist.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewayproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_staticroute.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_virtualhubid.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/model_vnetroute.go delete mode 100644 resource-manager/network/2023-05-01/expressroutegateways/version.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/README.md delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/client.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/id_link.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/id_link_test.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelink.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkmacsecconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressroutelinks/version.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/README.md delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/client.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorization.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportauthorizations/version.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/README.md delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/client.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_generateloa.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_expressroutelink.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkmacsecconfig.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_expressrouteport.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_expressrouteportpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloarequest.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloaresult.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteports/version.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/README.md delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/client.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/method_get.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocation.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteportslocations/version.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/README.md delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/client.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport_test.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/method_expressrouteproviderport.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/method_locationlist.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderport.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderportproperties.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteproviderports/version.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/README.md delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/client.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/constants.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/method_list.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/predicates.go delete mode 100644 resource-manager/network/2023-05-01/expressrouteserviceproviders/version.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/README.md delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/client.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/constants.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_get.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_list.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_dnssettings.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_explicitproxy.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_filteritems.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicy.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicycertificateauthority.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyinsights.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetection.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysku.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysnat.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysql.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicytransportsecurity.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_idpsqueryobject.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_orderby.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_queryresults.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrides.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrideslist.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverridesproperties.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_singlequeryresult.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/predicates.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicies/version.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/README.md delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/client.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/constants.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_get.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_list.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_applicationrule.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_natrule.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_networkrule.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/predicates.go delete mode 100644 resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/version.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/README.md delete mode 100644 resource-manager/network/2023-05-01/flowlogs/client.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/constants.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/id_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/id_flowlog_test.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/method_get.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/method_list.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/predicates.go delete mode 100644 resource-manager/network/2023-05-01/flowlogs/version.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/README.md delete mode 100644 resource-manager/network/2023-05-01/ipallocations/client.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/constants.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/id_ipallocation.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/id_ipallocation_test.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/method_get.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/method_list.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/model_ipallocation.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/model_ipallocationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/ipallocations/version.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/README.md delete mode 100644 resource-manager/network/2023-05-01/ipgroups/client.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/constants.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/id_ipgroup.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/id_ipgroup_test.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/method_get.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/method_list.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/method_updategroups.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/model_ipgroup.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/model_ipgrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/predicates.go delete mode 100644 resource-manager/network/2023-05-01/ipgroups/version.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/README.md delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/client.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/constants.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_location.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_outboundrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_outboundrule_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_probe.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_probe_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer_test.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_get.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulescreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesdelete.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesget.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_inboundnatruleslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_list.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_listinboundnatruleportmappings.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundrulesget.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundruleslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobesget.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobeslist.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_migratetoipbased.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_swappublicipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpool.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_inboundnatruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancer.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancersku.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequest.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_migratedpools.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_outboundrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_outboundrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_probe.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_probepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_route.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/predicates.go delete mode 100644 resource-manager/network/2023-05-01/loadbalancers/version.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/README.md delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/client.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway_test.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/method_get.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/method_list.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/predicates.go delete mode 100644 resource-manager/network/2023-05-01/localnetworkgateways/version.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/README.md delete mode 100644 resource-manager/network/2023-05-01/natgateways/client.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/id_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/id_natgateway_test.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/method_get.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/method_list.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/predicates.go delete mode 100644 resource-manager/network/2023-05-01/natgateways/version.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/README.md delete mode 100644 resource-manager/network/2023-05-01/networkgroups/client.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/id_networkgroup.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/id_networkgroup_test.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/model_networkgroup.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networkgroups/version.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/README.md delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/client.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice_test.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance_test.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface_test.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine_test.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset_test.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_getcloudservicenetworkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_geteffectiveroutetable.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecurityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_effectiveroute.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpool.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancer.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancersku.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrule.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_outboundrule.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_outboundrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_probe.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_probepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_route.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networkinterfaces/version.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/README.md delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/client.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_addressprefixitem.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconfigurations/version.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/README.md delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/client.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_hub.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/version.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagerconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/README.md delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/client.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/version.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/README.md delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/client.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/version.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/README.md delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/client.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_networkmanagercommitspost.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/method_patch.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_crosstenantscopes.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanagercommit.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatus.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/model_patchobject.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networkmanagers/version.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/README.md delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/client.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/id_networkprofile.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/id_networkprofile_test.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkprofile.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networkprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_route.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networkprofiles/version.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/README.md delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/client.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/constants.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup_test.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_route.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networksecuritygroups/version.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/README.md delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/client.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule_test.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance_test.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_delegationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityruleproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrules.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_partnermanagedresourceproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualappliancenicproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceskuproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/predicates.go delete mode 100644 resource-manager/network/2023-05-01/networkvirtualappliances/version.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/README.md delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/client.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/constants.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_checkconnectivity.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_get.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_getazurereachabilityreport.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_getflowlogstatus.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_getnexthop.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_gettopology.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshooting.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshootingresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_getvmsecurityrules.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_list.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_listavailableproviders.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_setflowlogconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/method_verifyipflow.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslist.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcity.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcountry.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_availableprovidersliststate.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreport.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportitem.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlocation.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_connectivitydestination.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_connectivityhop.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_connectivityinformation.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_connectivityissue.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_connectivityparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_connectivitysource.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_effectivenetworksecurityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_evaluatednetworksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_flowloginformation.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_flowlogproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_flowlogstatusparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_hoplink.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_hoplinkproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_httpconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_httpheader.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_matchedrule.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkinterfaceassociation.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networksecuritygroupresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networksecurityrulesevaluationresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkwatcher.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherlistresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_nexthopparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_nexthopresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_protocolconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_querytroubleshootingparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_securitygroupnetworkinterface.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_securityruleassociations.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_subnetassociation.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_topology.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_topologyassociation.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_topologyparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_topologyresource.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingdetails.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingproperties.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingrecommendedactions.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowparameters.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowresult.go delete mode 100644 resource-manager/network/2023-05-01/networkwatchers/version.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/README.md delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/client.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/method_disconnectp2svpnconnections.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/method_generatevpnprofile.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/method_reset.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionrequest.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngateway.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngatewayproperties.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnprofileparameters.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_staticroute.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_vnetroute.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_vpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_vpnprofileresponse.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/p2svpngateways/version.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/README.md delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/client.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/constants.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/id_packetcapture.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/id_packetcapture_test.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/method_create.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/method_get.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/method_getstatus.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/method_list.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/method_stop.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcapture.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcapturefilter.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcapturelistresult.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcapturemachinescope.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureparameters.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcapturequerystatusresult.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresult.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresultproperties.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/model_packetcapturestoragelocation.go delete mode 100644 resource-manager/network/2023-05-01/packetcaptures/version.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/README.md delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/client.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/constants.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup_test.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint_test.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/method_get.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/method_list.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszoneconfig.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegroup.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/model_recordset.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/predicates.go delete mode 100644 resource-manager/network/2023-05-01/privatednszonegroups/version.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/README.md delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/client.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/constants.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/id_location.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint_test.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/id_providerlocation.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslist.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_get.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_list.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_availableprivateendpointtype.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_route.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/predicates.go delete mode 100644 resource-manager/network/2023-05-01/privateendpoints/version.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/README.md delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/client.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/constants.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice_test.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_route.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservice/version.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/README.md delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/client.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/constants.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_location.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_privateendpointconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice_test.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibility.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_deleteprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_get.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_getprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_list.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_listprivateendpointconnections.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/method_updateprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_autoapprovedprivatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservicevisibility.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_route.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/predicates.go delete mode 100644 resource-manager/network/2023-05-01/privatelinkservices/version.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/README.md delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/client.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_ddosprotectionstatus.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_get.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_list.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_publicipddosprotectionstatusresult.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_route.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/predicates.go delete mode 100644 resource-manager/network/2023-05-01/publicipaddresses/version.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/README.md delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/client.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/constants.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix_test.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/method_get.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/method_list.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefix.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixsku.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_referencedpublicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/predicates.go delete mode 100644 resource-manager/network/2023-05-01/publicipprefixes/version.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/README.md delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/client.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/constants.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/id_routefilter.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/id_routefilter_test.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule_test.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/method_get.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/method_listbyroutefilter.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/model_routefilterrule.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/model_routefilterrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/predicates.go delete mode 100644 resource-manager/network/2023-05-01/routefilterrules/version.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/README.md delete mode 100644 resource-manager/network/2023-05-01/routefilters/client.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/constants.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/id_routefilter.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/id_routefilter_test.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/method_get.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/method_list.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeering.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_expressrouteconnectionid.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_routefilter.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_routefilterpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_routefilterrule.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_routefilterrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/predicates.go delete mode 100644 resource-manager/network/2023-05-01/routefilters/version.go delete mode 100644 resource-manager/network/2023-05-01/routes/README.md delete mode 100644 resource-manager/network/2023-05-01/routes/client.go delete mode 100644 resource-manager/network/2023-05-01/routes/constants.go delete mode 100644 resource-manager/network/2023-05-01/routes/id_route.go delete mode 100644 resource-manager/network/2023-05-01/routes/id_route_test.go delete mode 100644 resource-manager/network/2023-05-01/routes/id_routetable.go delete mode 100644 resource-manager/network/2023-05-01/routes/id_routetable_test.go delete mode 100644 resource-manager/network/2023-05-01/routes/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/routes/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/routes/method_get.go delete mode 100644 resource-manager/network/2023-05-01/routes/method_list.go delete mode 100644 resource-manager/network/2023-05-01/routes/model_route.go delete mode 100644 resource-manager/network/2023-05-01/routes/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routes/predicates.go delete mode 100644 resource-manager/network/2023-05-01/routes/version.go delete mode 100644 resource-manager/network/2023-05-01/routetables/README.md delete mode 100644 resource-manager/network/2023-05-01/routetables/client.go delete mode 100644 resource-manager/network/2023-05-01/routetables/constants.go delete mode 100644 resource-manager/network/2023-05-01/routetables/id_routetable.go delete mode 100644 resource-manager/network/2023-05-01/routetables/id_routetable_test.go delete mode 100644 resource-manager/network/2023-05-01/routetables/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/routetables/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/routetables/method_get.go delete mode 100644 resource-manager/network/2023-05-01/routetables/method_list.go delete mode 100644 resource-manager/network/2023-05-01/routetables/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/routetables/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_route.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/routetables/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/routetables/predicates.go delete mode 100644 resource-manager/network/2023-05-01/routetables/version.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/model_scopeconnection.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/model_scopeconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/scopeconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/README.md delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/client.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/constants.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/method_get.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/method_list.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/predicates.go delete mode 100644 resource-manager/network/2023-05-01/securityadminconfigurations/version.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/README.md delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/client.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/constants.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider_test.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/method_get.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/method_list.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerprovider.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/predicates.go delete mode 100644 resource-manager/network/2023-05-01/securitypartnerproviders/version.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/README.md delete mode 100644 resource-manager/network/2023-05-01/securityrules/client.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/constants.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule_test.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup_test.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/id_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/id_securityrule_test.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/method_defaultsecurityrulesget.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/method_defaultsecurityruleslist.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/method_get.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/method_list.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/predicates.go delete mode 100644 resource-manager/network/2023-05-01/securityrules/version.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/README.md delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/client.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/constants.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/method_get.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/method_list.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_route.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/predicates.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicies/version.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/README.md delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/client.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/constants.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_get.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/predicates.go delete mode 100644 resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/version.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/README.md delete mode 100644 resource-manager/network/2023-05-01/servicetags/client.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/id_location.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/method_servicetaginformationlist.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/method_servicetagslist.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/model_servicetaginformation.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/model_servicetaginformationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/model_servicetagslistresult.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/predicates.go delete mode 100644 resource-manager/network/2023-05-01/servicetags/version.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/README.md delete mode 100644 resource-manager/network/2023-05-01/staticmembers/client.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/constants.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/id_networkgroup.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/id_networkgroup_test.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/id_staticmember.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/id_staticmember_test.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/method_get.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/method_list.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/model_staticmember.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/model_staticmemberproperties.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/predicates.go delete mode 100644 resource-manager/network/2023-05-01/staticmembers/version.go delete mode 100644 resource-manager/network/2023-05-01/subnets/README.md delete mode 100644 resource-manager/network/2023-05-01/subnets/client.go delete mode 100644 resource-manager/network/2023-05-01/subnets/constants.go delete mode 100644 resource-manager/network/2023-05-01/subnets/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/subnets/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/subnets/method_get.go delete mode 100644 resource-manager/network/2023-05-01/subnets/method_list.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_route.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/subnets/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/subnets/predicates.go delete mode 100644 resource-manager/network/2023-05-01/subnets/version.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/README.md delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/client.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/constants.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_flowloginformation.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_flowlogproperties.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_flowlogstatusparameters.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/trafficanalytics/version.go delete mode 100644 resource-manager/network/2023-05-01/usages/README.md delete mode 100644 resource-manager/network/2023-05-01/usages/client.go delete mode 100644 resource-manager/network/2023-05-01/usages/constants.go delete mode 100644 resource-manager/network/2023-05-01/usages/id_location.go delete mode 100644 resource-manager/network/2023-05-01/usages/id_location_test.go delete mode 100644 resource-manager/network/2023-05-01/usages/method_list.go delete mode 100644 resource-manager/network/2023-05-01/usages/model_usage.go delete mode 100644 resource-manager/network/2023-05-01/usages/model_usagename.go delete mode 100644 resource-manager/network/2023-05-01/usages/predicates.go delete mode 100644 resource-manager/network/2023-05-01/usages/version.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/README.md delete mode 100644 resource-manager/network/2023-05-01/vipswap/client.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/constants.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/id_cloudservice.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/id_cloudservice_test.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/method_create.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/method_get.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/method_list.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/model_swapresource.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/model_swapresourcelistresult.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/model_swapresourceproperties.go delete mode 100644 resource-manager/network/2023-05-01/vipswap/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/model_breakoutcategorypolicies.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/model_office365policyproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesite.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesiteproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualappliancesites/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualappliancesku.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualapplianceskus/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getikesas.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getsharedkey.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetsharedkey.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_setsharedkey.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_startpacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_radiusserver.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnclientpackage.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnprofile.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_getadvertisedroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_getbgppeerstatus.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_getlearnedroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_listconnections.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_reset.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_startpacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_stoppacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_supportedvpndevices.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatus.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroutelistresult.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_radiusserver.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_tunnelconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientipsecparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpndevicescriptparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkgateways/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkencryption.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeering.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworkpeerings/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_resourcenavigationlinkslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_serviceassociationlinkslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_subnetspreparenetworkpolicies.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistusage.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_dhcpoptions.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_ipaddressavailabilityresult.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicyconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_preparenetworkpoliciesrequest.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_publicipddosprotectionstatusresult.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_route.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetwork.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkbgpcommunities.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkencryption.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeering.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusage.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusagename.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworks/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_route.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktap/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_route.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualnetworktaps/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeering.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouterpeerings/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/method_get.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/method_list.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/model_virtualrouter.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/model_virtualrouterpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualrouters/version.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/README.md delete mode 100644 resource-manager/network/2023-05-01/virtualwans/client.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/constants.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_hubroutetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_hubroutetable_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_natrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_natrule_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_routemap.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_routemap_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_routingintent.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_routingintent_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_virtualhub.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_virtualhub_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_virtualwan.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_virtualwan_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpngateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpngateway_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnsite.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnsite_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink_test.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubroutetablescreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubroutetableslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_natrulescreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_natrulesdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_natrulesget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_natruleslistbyvpngateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routemapscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routemapsdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routemapsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routemapslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routingintentcreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routingintentdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routingintentget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_routingintentlist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_supportedsecurityproviders.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectiondelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationlist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2slist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubsdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetinboundroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetoutboundroutes.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualhubsupdatetags.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualwanscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualwansdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualwansget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualwanslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_virtualwanslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionslistbyvpngateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstartpacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstoppacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpngatewayscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionsgetikesas.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkconnectionsget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinksget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitesconfigurationdownload.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitescreateorupdate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitesdelete.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsitesget.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_aadauthenticationparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_action.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_bgpconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_bgpconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_criterion.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_deviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproutelist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_effectiveroutesparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_getinboundroutesparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_getoutboundroutesparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_getvpnsitesconfigurationrequest.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubroutetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubroutetableproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_o365breakoutcategorypolicies.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_o365policyproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_p2svpngateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_p2svpngatewayproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_parameter.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_peerroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_radiusserver.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_route.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routemap.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routemapproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routemaprule.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routingintent.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routingintentproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_routingpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_staticroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhub.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroutelist.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetable.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2properties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutev2.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualrouterautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualwan.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualwanproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityprovider.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityproviders.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_virtualwanvpnprofileparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vnetroute.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpngateway.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpngatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatrule.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpngatewayproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnlinkbgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnlinkproviderproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnprofileresponse.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroup.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationsresponse.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnsite.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnsitelink.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnection.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/model_vpnsiteproperties.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/predicates.go delete mode 100644 resource-manager/network/2023-05-01/virtualwans/version.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/README.md delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/client.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_route.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/predicates.go delete mode 100644 resource-manager/network/2023-05-01/vmsspublicipaddresses/version.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/README.md delete mode 100644 resource-manager/network/2023-05-01/vpngateways/client.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/constants.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/id_vpngateway.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/id_vpngateway_test.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/method_reset.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/method_startpacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/method_stoppacketcapture.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_staticroute.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vnetroute.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpnconnection.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpnconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngateway.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatrule.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpngatewayproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnection.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpngateways/version.go delete mode 100644 resource-manager/network/2023-05-01/vpnlinkconnections/client.go delete mode 100644 resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection.go delete mode 100644 resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection_test.go delete mode 100644 resource-manager/network/2023-05-01/vpnlinkconnections/method_resetconnection.go delete mode 100644 resource-manager/network/2023-05-01/vpnlinkconnections/version.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/README.md delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/client.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/constants.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_aadauthenticationparameters.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngateway.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngatewayproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_radiusserver.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroute.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vnetroute.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/vpnserverconfigurations/version.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/README.md delete mode 100644 resource-manager/network/2023-05-01/vpnsites/client.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/constants.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/id_vpnsite.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/id_vpnsite_test.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/method_updatetags.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_addressspace.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_deviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_o365breakoutcategorypolicies.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_o365policyproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_tagsobject.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_vpnlinkbgpsettings.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_vpnlinkproviderproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_vpnsite.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_vpnsitelink.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_vpnsitelinkproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/model_vpnsiteproperties.go delete mode 100644 resource-manager/network/2023-05-01/vpnsites/version.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/README.md delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/client.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/constants.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_delete.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_get.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_list.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_listall.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgateway.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ddossettings.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_delegation.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlog.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyusersession.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyvariable.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_iptag.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleoverride.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleset.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchcondition.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchvariable.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgateway.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterface.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettings.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourceset.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_route.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetable.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnet.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subresource.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/predicates.go delete mode 100644 resource-manager/network/2023-05-01/webapplicationfirewallpolicies/version.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/README.md delete mode 100644 resource-manager/network/2023-05-01/webcategories/client.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/id_azurewebcategory.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/id_azurewebcategory_test.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/method_get.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/model_azurewebcategory.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/model_azurewebcategorypropertiesformat.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/predicates.go delete mode 100644 resource-manager/network/2023-05-01/webcategories/version.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/README.md delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/client.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/constants.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection_test.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/model_networkmanagersecuritygroupitem.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/adminrulecollections/version.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/README.md delete mode 100644 resource-manager/network/2023-06-01/adminrules/client.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/constants.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/id_rule.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/id_rule_test.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/id_rulecollection.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/id_rulecollection_test.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/method_get.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/method_list.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/model_addressprefixitem.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/model_adminrule.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/model_baseadminrule.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/model_defaultadminrule.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/predicates.go delete mode 100644 resource-manager/network/2023-06-01/adminrules/version.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_update.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_route.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/README.md delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/client.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/method_list.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/predicates.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/version.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/README.md delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/client.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_backendhealth.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_backendhealthondemand.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_get.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_getsslpredefinedpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_list.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listavailablerequestheaders.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listavailableresponseheaders.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listavailableservervariables.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listavailablessloptions.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listavailablesslpredefinedpolicies.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_listavailablewafrulesets.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_start.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_stop.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgateway.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptions.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealth.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthpool.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthserver.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayconnectiondraining.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaycustomerror.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallexclusion.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallruleset.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendport.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayglobalconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayheaderconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistener.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistener.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayondemandprobe.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobe.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulecondition.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleset.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofile.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmap.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_route.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/predicates.go delete mode 100644 resource-manager/network/2023-06-01/applicationgateways/version.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/README.md delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/client.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/constants.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_defaultget.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_get.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/predicates.go delete mode 100644 resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/version.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/README.md delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/client.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/constants.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/method_get.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/method_list.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/predicates.go delete mode 100644 resource-manager/network/2023-06-01/applicationsecuritygroups/version.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/README.md delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/client.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/id_location.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/id_providerlocation.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/method_availabledelegationslist.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/method_availableresourcegroupdelegationslist.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/model_availabledelegation.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/availabledelegations/version.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/README.md delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/client.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/id_location.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/method_list.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/model_availableservicealias.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/predicates.go delete mode 100644 resource-manager/network/2023-06-01/availableservicealiases/version.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/README.md delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/client.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/constants.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall_test.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_get.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_list.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_packetcapture.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewall.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrule.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipgroups.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrcaction.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrule.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrule.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcapturerule.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpublicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallrcaction.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallsku.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparameters.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_hubipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_hubpublicipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_ipprefixeslist.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/predicates.go delete mode 100644 resource-manager/network/2023-06-01/azurefirewalls/version.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/README.md delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/client.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/constants.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/id_bastionhost.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/id_bastionhost_test.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelinkbytoken.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_disconnectactivesessions.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_get.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_getactivesessions.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_getbastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_list.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_putbastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionactivesession.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionhost.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionsessionstate.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinklistrequest.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_iprule.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_resource.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_sessionids.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_sku.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/predicates.go delete mode 100644 resource-manager/network/2023-06-01/bastionhosts/version.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/README.md delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/client.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost_test.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelinkbytoken.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/method_getbastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/method_putbastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelink.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinklistrequest.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinktokenlistrequest.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/model_resource.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/predicates.go delete mode 100644 resource-manager/network/2023-06-01/bastionshareablelink/version.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/README.md delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/client.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/method_list.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpcommunity.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunity.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/predicates.go delete mode 100644 resource-manager/network/2023-06-01/bgpservicecommunities/version.go delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/README.md delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/client.go delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/id_location.go delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/method_checkdnsnameavailability.go delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go delete mode 100644 resource-manager/network/2023-06-01/checkdnsavailabilities/version.go delete mode 100644 resource-manager/network/2023-06-01/client.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/README.md delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/client.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice_test.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_route.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/predicates.go delete mode 100644 resource-manager/network/2023-06-01/cloudservicepublicipaddresses/version.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/README.md delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/client.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/constants.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor_test.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_get.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_list.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_query.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_start.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_stop.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitor.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitordestination.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpoint.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilter.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscope.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorlistresult.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoroutput.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorparameters.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorqueryresult.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresult.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresultproperties.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsource.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortcpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestgroup.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorworkspacesettings.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectionstatesnapshot.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectivityhop.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_connectivityissue.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_hoplink.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_hoplinkproperties.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_httpheader.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/connectionmonitors/version.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/README.md delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/client.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/constants.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/method_get.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/method_list.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivitygroupitem.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/model_hub.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/connectivityconfigurations/version.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/README.md delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/client.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/constants.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/id_customipprefix.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/id_customipprefix_test.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/method_get.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/method_list.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/model_customipprefix.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/model_customipprefixpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/predicates.go delete mode 100644 resource-manager/network/2023-06-01/customipprefixes/version.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/README.md delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/client.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/constants.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/method_get.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicy.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/ddoscustompolicies/version.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/README.md delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/client.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/constants.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan_test.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/method_get.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/method_list.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplan.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/predicates.go delete mode 100644 resource-manager/network/2023-06-01/ddosprotectionplans/version.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/README.md delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/client.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/constants.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/method_get.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_qosdefinition.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_qosiprange.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_qosportrange.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_route.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfiguration/version.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/README.md delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/client.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/constants.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlist.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlistall.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_qosdefinition.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_qosiprange.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_qosportrange.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_route.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/dscpconfigurations/version.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/README.md delete mode 100644 resource-manager/network/2023-06-01/endpointservices/client.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/id_location.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/method_availableendpointserviceslist.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/model_endpointserviceresult.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/predicates.go delete mode 100644 resource-manager/network/2023-06-01/endpointservices/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitarptable/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitauthorizations/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitpeerings/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestable/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_authorizationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitauthorization.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeering.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitsku.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_expressrouteconnectionid.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuits/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecircuitstats/version.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_expressroutecircuitpeeringid.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionlist.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_staticroute.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/model_vnetroute.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitreference.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutecrossconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressroutecircuitpeeringid.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnection.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegateway.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaylist.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewayproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_staticroute.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_virtualhubid.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/model_vnetroute.go delete mode 100644 resource-manager/network/2023-06-01/expressroutegateways/version.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/README.md delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/client.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/id_link.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/id_link_test.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelink.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkmacsecconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressroutelinks/version.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/README.md delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/client.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorization.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportauthorizations/version.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/README.md delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/client.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_generateloa.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_expressroutelink.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkmacsecconfig.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_expressrouteport.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_expressrouteportpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloarequest.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloaresult.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteports/version.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/README.md delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/client.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/method_get.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocation.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteportslocations/version.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/README.md delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/client.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport_test.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/method_expressrouteproviderport.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/method_locationlist.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderport.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderportproperties.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteproviderports/version.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/README.md delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/client.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/constants.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/method_list.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/predicates.go delete mode 100644 resource-manager/network/2023-06-01/expressrouteserviceproviders/version.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/README.md delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/client.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/constants.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_get.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_list.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_dnssettings.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_explicitproxy.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_filteritems.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicy.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicycertificateauthority.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyinsights.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetection.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysku.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysnat.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysql.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicytransportsecurity.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_idpsqueryobject.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_orderby.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_queryresults.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrides.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrideslist.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverridesproperties.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_singlequeryresult.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/predicates.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicies/version.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/README.md delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/client.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/constants.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_get.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_list.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_applicationrule.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_natrule.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_networkrule.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/predicates.go delete mode 100644 resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/version.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/README.md delete mode 100644 resource-manager/network/2023-06-01/flowlogs/client.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/constants.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/id_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/id_flowlog_test.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/method_get.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/method_list.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/predicates.go delete mode 100644 resource-manager/network/2023-06-01/flowlogs/version.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/README.md delete mode 100644 resource-manager/network/2023-06-01/ipallocations/client.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/constants.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/id_ipallocation.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/id_ipallocation_test.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/method_get.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/method_list.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/model_ipallocation.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/model_ipallocationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/ipallocations/version.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/README.md delete mode 100644 resource-manager/network/2023-06-01/ipgroups/client.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/constants.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/id_ipgroup.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/id_ipgroup_test.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/method_get.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/method_list.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/method_updategroups.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/model_ipgroup.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/model_ipgrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/predicates.go delete mode 100644 resource-manager/network/2023-06-01/ipgroups/version.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/README.md delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/client.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/constants.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_location.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_outboundrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_outboundrule_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_probe.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_probe_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer_test.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_get.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulescreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesdelete.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesget.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_inboundnatruleslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_list.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_listinboundnatruleportmappings.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundrulesget.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundruleslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobesget.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobeslist.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_migratetoipbased.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_swappublicipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpool.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_inboundnatruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancer.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancersku.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequest.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_migratedpools.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_outboundrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_outboundrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_probe.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_probepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_route.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/predicates.go delete mode 100644 resource-manager/network/2023-06-01/loadbalancers/version.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/README.md delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/client.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway_test.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/method_get.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/method_list.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/predicates.go delete mode 100644 resource-manager/network/2023-06-01/localnetworkgateways/version.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/README.md delete mode 100644 resource-manager/network/2023-06-01/natgateways/client.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/id_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/id_natgateway_test.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/method_get.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/method_list.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/predicates.go delete mode 100644 resource-manager/network/2023-06-01/natgateways/version.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/README.md delete mode 100644 resource-manager/network/2023-06-01/networkgroups/client.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/id_networkgroup.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/id_networkgroup_test.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/model_networkgroup.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networkgroups/version.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/README.md delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/client.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice_test.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance_test.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface_test.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine_test.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset_test.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_getcloudservicenetworkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_geteffectiveroutetable.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecurityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_effectiveroute.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpool.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancer.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancersku.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrule.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_outboundrule.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_outboundrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_probe.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_probepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_route.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networkinterfaces/version.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/README.md delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/client.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_addressprefixitem.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconfigurations/version.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/README.md delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/client.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_hub.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/version.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagerconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/README.md delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/client.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/version.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/README.md delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/client.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/version.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/README.md delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/client.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_networkmanagercommitspost.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/method_patch.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_crosstenantscopes.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanagercommit.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatus.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/model_patchobject.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networkmanagers/version.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/README.md delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/client.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/id_networkprofile.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/id_networkprofile_test.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkprofile.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networkprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_route.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networkprofiles/version.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/README.md delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/client.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/constants.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup_test.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_route.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networksecuritygroups/version.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/README.md delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/client.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule_test.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance_test.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_delegationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityruleproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrules.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_internetingresspublicipsproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_partnermanagedresourceproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualappliancenicproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceskuproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/predicates.go delete mode 100644 resource-manager/network/2023-06-01/networkvirtualappliances/version.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/README.md delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/client.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/constants.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_checkconnectivity.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_get.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_getazurereachabilityreport.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_getflowlogstatus.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_getnexthop.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_gettopology.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshooting.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshootingresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_getvmsecurityrules.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_list.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_listavailableproviders.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_setflowlogconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/method_verifyipflow.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslist.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcity.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcountry.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_availableprovidersliststate.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreport.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportitem.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlocation.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_connectivitydestination.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_connectivityhop.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_connectivityinformation.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_connectivityissue.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_connectivityparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_connectivitysource.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_effectivenetworksecurityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_evaluatednetworksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_flowloginformation.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_flowlogproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_flowlogstatusparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_hoplink.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_hoplinkproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_httpconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_httpheader.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_matchedrule.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkinterfaceassociation.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networksecuritygroupresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networksecurityrulesevaluationresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkwatcher.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherlistresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_nexthopparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_nexthopresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_protocolconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_querytroubleshootingparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_securitygroupnetworkinterface.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_securityruleassociations.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_subnetassociation.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_topology.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_topologyassociation.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_topologyparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_topologyresource.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingdetails.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingproperties.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingrecommendedactions.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowparameters.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowresult.go delete mode 100644 resource-manager/network/2023-06-01/networkwatchers/version.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/README.md delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/client.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/method_disconnectp2svpnconnections.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/method_generatevpnprofile.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/method_reset.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionrequest.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngateway.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngatewayproperties.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnprofileparameters.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_staticroute.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_vnetroute.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_vpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_vpnprofileresponse.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/p2svpngateways/version.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/README.md delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/client.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/constants.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/id_packetcapture.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/id_packetcapture_test.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/method_create.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/method_get.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/method_getstatus.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/method_list.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/method_stop.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcapture.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcapturefilter.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcapturelistresult.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcapturemachinescope.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureparameters.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcapturequerystatusresult.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresult.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresultproperties.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/model_packetcapturestoragelocation.go delete mode 100644 resource-manager/network/2023-06-01/packetcaptures/version.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/README.md delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/client.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/constants.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup_test.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint_test.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/method_get.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/method_list.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszoneconfig.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegroup.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/model_recordset.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/predicates.go delete mode 100644 resource-manager/network/2023-06-01/privatednszonegroups/version.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/README.md delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/client.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/constants.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/id_location.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint_test.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/id_providerlocation.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslist.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_get.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_list.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_availableprivateendpointtype.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_route.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/predicates.go delete mode 100644 resource-manager/network/2023-06-01/privateendpoints/version.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/README.md delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/client.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/constants.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice_test.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_route.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservice/version.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/README.md delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/client.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/constants.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_location.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_privateendpointconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice_test.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation_test.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibility.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_deleteprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_get.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_getprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_list.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_listprivateendpointconnections.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/method_updateprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_autoapprovedprivatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservicevisibility.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_route.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/predicates.go delete mode 100644 resource-manager/network/2023-06-01/privatelinkservices/version.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/README.md delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/client.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_ddosprotectionstatus.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_get.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_list.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_publicipddosprotectionstatusresult.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_route.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/predicates.go delete mode 100644 resource-manager/network/2023-06-01/publicipaddresses/version.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/README.md delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/client.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/constants.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix_test.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/method_get.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/method_list.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefix.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixsku.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_referencedpublicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/predicates.go delete mode 100644 resource-manager/network/2023-06-01/publicipprefixes/version.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/README.md delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/client.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/constants.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/id_routefilter.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/id_routefilter_test.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule_test.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/method_get.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/method_listbyroutefilter.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/model_routefilterrule.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/model_routefilterrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/predicates.go delete mode 100644 resource-manager/network/2023-06-01/routefilterrules/version.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/README.md delete mode 100644 resource-manager/network/2023-06-01/routefilters/client.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/constants.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/id_routefilter.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/id_routefilter_test.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/method_get.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/method_list.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeering.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitstats.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_expressrouteconnectionid.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_ipv6circuitconnectionconfig.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnection.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_routefilter.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_routefilterpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_routefilterrule.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_routefilterrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/predicates.go delete mode 100644 resource-manager/network/2023-06-01/routefilters/version.go delete mode 100644 resource-manager/network/2023-06-01/routes/README.md delete mode 100644 resource-manager/network/2023-06-01/routes/client.go delete mode 100644 resource-manager/network/2023-06-01/routes/constants.go delete mode 100644 resource-manager/network/2023-06-01/routes/id_route.go delete mode 100644 resource-manager/network/2023-06-01/routes/id_route_test.go delete mode 100644 resource-manager/network/2023-06-01/routes/id_routetable.go delete mode 100644 resource-manager/network/2023-06-01/routes/id_routetable_test.go delete mode 100644 resource-manager/network/2023-06-01/routes/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/routes/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/routes/method_get.go delete mode 100644 resource-manager/network/2023-06-01/routes/method_list.go delete mode 100644 resource-manager/network/2023-06-01/routes/model_route.go delete mode 100644 resource-manager/network/2023-06-01/routes/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routes/predicates.go delete mode 100644 resource-manager/network/2023-06-01/routes/version.go delete mode 100644 resource-manager/network/2023-06-01/routetables/README.md delete mode 100644 resource-manager/network/2023-06-01/routetables/client.go delete mode 100644 resource-manager/network/2023-06-01/routetables/constants.go delete mode 100644 resource-manager/network/2023-06-01/routetables/id_routetable.go delete mode 100644 resource-manager/network/2023-06-01/routetables/id_routetable_test.go delete mode 100644 resource-manager/network/2023-06-01/routetables/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/routetables/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/routetables/method_get.go delete mode 100644 resource-manager/network/2023-06-01/routetables/method_list.go delete mode 100644 resource-manager/network/2023-06-01/routetables/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/routetables/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_route.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/routetables/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/routetables/predicates.go delete mode 100644 resource-manager/network/2023-06-01/routetables/version.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/model_scopeconnection.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/model_scopeconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/scopeconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/README.md delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/client.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/constants.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager_test.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/method_get.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/method_list.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/predicates.go delete mode 100644 resource-manager/network/2023-06-01/securityadminconfigurations/version.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/README.md delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/client.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/constants.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider_test.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/method_get.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/method_list.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerprovider.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/predicates.go delete mode 100644 resource-manager/network/2023-06-01/securitypartnerproviders/version.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/README.md delete mode 100644 resource-manager/network/2023-06-01/securityrules/client.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/constants.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule_test.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup_test.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/id_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/id_securityrule_test.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/method_defaultsecurityrulesget.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/method_defaultsecurityruleslist.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/method_get.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/method_list.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/predicates.go delete mode 100644 resource-manager/network/2023-06-01/securityrules/version.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/README.md delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/client.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/constants.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/method_get.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/method_list.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_route.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/predicates.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicies/version.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/README.md delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/client.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/constants.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_get.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/predicates.go delete mode 100644 resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/version.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/README.md delete mode 100644 resource-manager/network/2023-06-01/servicetags/client.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/id_location.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/method_servicetaginformationlist.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/method_servicetagslist.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/model_servicetaginformation.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/model_servicetaginformationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/model_servicetagslistresult.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/predicates.go delete mode 100644 resource-manager/network/2023-06-01/servicetags/version.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/README.md delete mode 100644 resource-manager/network/2023-06-01/staticmembers/client.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/constants.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/id_networkgroup.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/id_networkgroup_test.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/id_staticmember.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/id_staticmember_test.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/method_get.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/method_list.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/model_staticmember.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/model_staticmemberproperties.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/predicates.go delete mode 100644 resource-manager/network/2023-06-01/staticmembers/version.go delete mode 100644 resource-manager/network/2023-06-01/subnets/README.md delete mode 100644 resource-manager/network/2023-06-01/subnets/client.go delete mode 100644 resource-manager/network/2023-06-01/subnets/constants.go delete mode 100644 resource-manager/network/2023-06-01/subnets/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/subnets/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/subnets/method_get.go delete mode 100644 resource-manager/network/2023-06-01/subnets/method_list.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_route.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/subnets/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/subnets/predicates.go delete mode 100644 resource-manager/network/2023-06-01/subnets/version.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/README.md delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/client.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/constants.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher_test.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_flowloginformation.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_flowlogproperties.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_flowlogstatusparameters.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/trafficanalytics/version.go delete mode 100644 resource-manager/network/2023-06-01/usages/README.md delete mode 100644 resource-manager/network/2023-06-01/usages/client.go delete mode 100644 resource-manager/network/2023-06-01/usages/constants.go delete mode 100644 resource-manager/network/2023-06-01/usages/id_location.go delete mode 100644 resource-manager/network/2023-06-01/usages/id_location_test.go delete mode 100644 resource-manager/network/2023-06-01/usages/method_list.go delete mode 100644 resource-manager/network/2023-06-01/usages/model_usage.go delete mode 100644 resource-manager/network/2023-06-01/usages/model_usagename.go delete mode 100644 resource-manager/network/2023-06-01/usages/predicates.go delete mode 100644 resource-manager/network/2023-06-01/usages/version.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/README.md delete mode 100644 resource-manager/network/2023-06-01/vipswap/client.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/constants.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/id_cloudservice.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/id_cloudservice_test.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/method_create.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/method_get.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/method_list.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/model_swapresource.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/model_swapresourcelistresult.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/model_swapresourceproperties.go delete mode 100644 resource-manager/network/2023-06-01/vipswap/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/model_breakoutcategorypolicies.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/model_office365policyproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesite.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesiteproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualappliancesites/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualappliancesku.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualapplianceskus/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getikesas.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getsharedkey.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetsharedkey.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_setsharedkey.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_startpacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_radiusserver.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnclientpackage.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnprofile.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_getadvertisedroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_getbgppeerstatus.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_getlearnedroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_listconnections.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_reset.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_startpacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_stoppacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_supportedvpndevices.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatus.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroutelistresult.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_radiusserver.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_tunnelconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientipsecparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpndevicescriptparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkgateways/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkencryption.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeering.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworkpeerings/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_resourcenavigationlinkslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_serviceassociationlinkslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_subnetspreparenetworkpolicies.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistusage.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_dhcpoptions.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_ipaddressavailabilityresult.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicyconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_preparenetworkpoliciesrequest.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_publicipddosprotectionstatusresult.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_route.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetwork.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkbgpcommunities.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkencryption.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeering.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusage.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusagename.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworks/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_route.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktap/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_route.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualnetworktaps/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeering.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouterpeerings/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/method_get.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/method_list.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/method_listbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/model_virtualrouter.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/model_virtualrouterpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualrouters/version.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/README.md delete mode 100644 resource-manager/network/2023-06-01/virtualwans/client.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/constants.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_hubroutetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_hubroutetable_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_natrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_natrule_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_routemap.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_routemap_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_routingintent.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_routingintent_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_virtualhub.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_virtualhub_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_virtualwan.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_virtualwan_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpngateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpngateway_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnsite.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnsite_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink_test.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubroutetablescreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubroutetableslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_natrulescreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_natrulesdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_natrulesget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_natruleslistbyvpngateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routemapscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routemapsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routemapsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routemapslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routingintentcreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routingintentdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routingintentget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_routingintentlist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_supportedsecurityproviders.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectiondelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationlist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2slist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetinboundroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetoutboundroutes.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualhubsupdatetags.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualwanscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualwansdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualwansget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualwanslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_virtualwanslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionslistbyvpngateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstartpacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstoppacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpngatewayscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionsgetikesas.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkconnectionsget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinksget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitesconfigurationdownload.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitescreateorupdate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitesdelete.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsitesget.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslistbyresourcegroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_aadauthenticationparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_action.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_bgpconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_bgpconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_criterion.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_deviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproutelist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_effectiveroutesparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_getinboundroutesparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_getoutboundroutesparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_getvpnsitesconfigurationrequest.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubroutetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubroutetableproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_o365breakoutcategorypolicies.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_o365policyproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_p2svpngateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_p2svpngatewayproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_parameter.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_peerroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_radiusserver.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_route.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routemap.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routemapproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routemaprule.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routingintent.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routingintentproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_routingpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_staticroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhub.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroutelist.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetable.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2properties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutev2.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualrouterautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualwan.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualwanproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityprovider.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityproviders.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_virtualwanvpnprofileparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vnetroute.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpngateway.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpngatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatrule.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpngatewayproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnlinkbgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnlinkproviderproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnprofileresponse.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroup.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationsresponse.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnsite.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnsitelink.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnection.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/model_vpnsiteproperties.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/predicates.go delete mode 100644 resource-manager/network/2023-06-01/virtualwans/version.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/README.md delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/client.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/constants.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_route.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/predicates.go delete mode 100644 resource-manager/network/2023-06-01/vmsspublicipaddresses/version.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/README.md delete mode 100644 resource-manager/network/2023-06-01/vpngateways/client.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/constants.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/id_vpngateway.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/id_vpngateway_test.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/method_reset.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/method_startpacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/method_stoppacketcapture.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_staticroute.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_trafficselectorpolicy.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vnetroute.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpnconnection.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpnconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngateway.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatrule.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatruleproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpngatewayproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpnnatrulemapping.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnection.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpngateways/version.go delete mode 100644 resource-manager/network/2023-06-01/vpnlinkconnections/client.go delete mode 100644 resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection.go delete mode 100644 resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection_test.go delete mode 100644 resource-manager/network/2023-06-01/vpnlinkconnections/method_resetconnection.go delete mode 100644 resource-manager/network/2023-06-01/vpnlinkconnections/version.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/README.md delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/client.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/constants.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_aadauthenticationparameters.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_ipsecpolicy.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngateway.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngatewayproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_propagatedroutetable.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_radiusserver.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_routingconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroute.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroutesconfig.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vnetroute.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/vpnserverconfigurations/version.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/README.md delete mode 100644 resource-manager/network/2023-06-01/vpnsites/client.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/constants.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/id_vpnsite.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/id_vpnsite_test.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/method_updatetags.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_addressspace.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_bgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_deviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_ipconfigurationbgppeeringaddress.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_o365breakoutcategorypolicies.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_o365policyproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_tagsobject.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_vpnlinkbgpsettings.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_vpnlinkproviderproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_vpnsite.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_vpnsitelink.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_vpnsitelinkproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/model_vpnsiteproperties.go delete mode 100644 resource-manager/network/2023-06-01/vpnsites/version.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/README.md delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/client.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/constants.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_createorupdate.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_delete.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_get.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_list.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_listall.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgateway.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspool.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ddossettings.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_delegation.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlog.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyusersession.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyvariable.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_iptag.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleoverride.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleset.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchcondition.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchvariable.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgateway.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaysku.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natruleportmapping.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterface.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygroup.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettings.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpoint.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnection.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkservice.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddress.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresssku.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourceset.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_route.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetable.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlink.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnet.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subresource.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktap.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/predicates.go delete mode 100644 resource-manager/network/2023-06-01/webapplicationfirewallpolicies/version.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/README.md delete mode 100644 resource-manager/network/2023-06-01/webcategories/client.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/id_azurewebcategory.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/id_azurewebcategory_test.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/method_get.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/method_listbysubscription.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/model_azurewebcategory.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/model_azurewebcategorypropertiesformat.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/predicates.go delete mode 100644 resource-manager/network/2023-06-01/webcategories/version.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/README.md delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/constants.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_get.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyserver.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyservergroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_update.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfiguration.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfigurationproperties.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfiguration.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfigurationproperties.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverrolegroupconfiguration.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/predicates.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/version.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/README.md delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_createorupdate.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_delete.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_get.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_listbyservergroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrule.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrulelistresult.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallruleproperties.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/version.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/README.md delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_create.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_delete.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_listbyservergroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_role.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_rolelistresult.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_roleproperties.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/version.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsrestart.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstart.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstop.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/version.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/README.md delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/constants.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_checknameavailability.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_createorupdate.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_delete.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_get.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_list.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_listbyresourcegroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_update.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_maintenancewindow.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailability.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailabilityrequest.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupforupdate.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupproperties.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesdelegatedsubnetarguments.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesforupdate.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesprivatednszonearguments.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servernameitem.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_serverrolegroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/predicates.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/version.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/README.md delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/client.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/constants.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2_test.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_get.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_listbyservergroup.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserver.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverlistresult.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverproperties.go delete mode 100644 resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/method_privatelinkresourcesget.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/method_privatelinkresourceslist.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/constants.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/method_capabilities.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/method_checknameavailability.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponse.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponseproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityparameters.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityresult.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszone.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszoneresponse.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/model_resourcecapabilities.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/recoveryservices/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/registeredidentities/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/registeredidentities/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/registeredidentities/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/method_list.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/model_jobssummary.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/model_monitoringsummary.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusage.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/replicationusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/constants.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/method_create.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_certificaterequest.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_rawcertificatedata.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandaaddetails.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandacsdetails.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificatedetails.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_vaultcertificateresponse.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultcertificates/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinfo.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinforesource.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/constants.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/method_listbyresourcegroup.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/method_listbysubscriptionid.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_azuremonitoralertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_classicalertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkekidentity.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkeyvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_crosssubscriptionrestoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_immutabilitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_monitoringsettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_patchvault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpoint.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnection.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnectionvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_restoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_securitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_sku.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_upgradedetails.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_vault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_vaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesencryption.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesmovedetails.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesredundancysettings.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaults/version.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/constants.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/method_usageslistbyvaults.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/model_nameinfo.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusage.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-02-01/vaultusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/method_privatelinkresourcesget.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/method_privatelinkresourceslist.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/constants.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/method_capabilities.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/method_checknameavailability.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponse.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponseproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityparameters.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityresult.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszone.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszoneresponse.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/model_resourcecapabilities.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/recoveryservices/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/registeredidentities/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/registeredidentities/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/registeredidentities/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/method_list.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/model_jobssummary.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/model_monitoringsummary.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusage.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/replicationusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/constants.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/method_create.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_certificaterequest.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_rawcertificatedata.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandaaddetails.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandacsdetails.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificatedetails.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_vaultcertificateresponse.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultcertificates/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinfo.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinforesource.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/constants.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/method_listbyresourcegroup.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/method_listbysubscriptionid.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_azuremonitoralertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_classicalertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkekidentity.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkeyvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_crosssubscriptionrestoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_immutabilitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_monitoringsettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_patchvault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpoint.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnection.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnectionvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_restoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_securitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_sku.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_softdeletesettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_upgradedetails.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_vault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_vaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesencryption.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesmovedetails.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesredundancysettings.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaults/version.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/constants.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/method_usageslistbyvaults.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/model_nameinfo.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusage.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-04-01/vaultusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/method_privatelinkresourcesget.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/method_privatelinkresourceslist.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/constants.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/method_capabilities.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/method_checknameavailability.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponse.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponseproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityparameters.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityresult.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszone.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszoneresponse.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/model_resourcecapabilities.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/recoveryservices/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/registeredidentities/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/registeredidentities/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/registeredidentities/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/method_list.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/model_jobssummary.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/model_monitoringsummary.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusage.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/replicationusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/constants.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/method_create.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_certificaterequest.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_rawcertificatedata.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandaaddetails.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandacsdetails.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificatedetails.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_vaultcertificateresponse.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultcertificates/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinfo.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinforesource.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/constants.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/method_listbyresourcegroup.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/method_listbysubscriptionid.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_azuremonitoralertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_classicalertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkekidentity.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkeyvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_crosssubscriptionrestoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_immutabilitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_monitoringsettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_patchvault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpoint.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnection.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnectionvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_restoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_securitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_sku.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_softdeletesettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_upgradedetails.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_vault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_vaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesencryption.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesmovedetails.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesredundancysettings.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaults/version.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/constants.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/method_usageslistbyvaults.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/model_nameinfo.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusage.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-06-01/vaultusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/method_privatelinkresourcesget.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/method_privatelinkresourceslist.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresource.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresourceproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/constants.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/method_capabilities.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/method_checknameavailability.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponse.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponseproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityparameters.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityresult.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszone.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszoneresponse.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/model_resourcecapabilities.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/recoveryservices/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/registeredidentities/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/registeredidentities/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/registeredidentities/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/method_list.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/model_jobssummary.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/model_monitoringsummary.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusage.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/replicationusages/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/constants.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/method_create.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_certificaterequest.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_rawcertificatedata.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandaaddetails.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandacsdetails.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificatedetails.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_vaultcertificateresponse.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultcertificates/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinfo.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinforesource.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/constants.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/method_createorupdate.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/method_delete.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/method_get.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/method_listbyresourcegroup.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/method_listbysubscriptionid.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/method_update.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_azuremonitoralertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_classicalertsettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkekidentity.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkeyvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_crosssubscriptionrestoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_immutabilitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_monitoringsettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_patchvault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpoint.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnection.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnectionvaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_privatelinkserviceconnectionstate.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_restoresettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_securitysettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_sku.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_softdeletesettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_upgradedetails.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_vault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_vaultproperties.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesencryption.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesmovedetails.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesredundancysettings.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/predicates.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaults/version.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/README.md delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/client.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/constants.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault_test.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/method_usageslistbyvaults.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/model_nameinfo.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusage.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusagelist.go delete mode 100644 resource-manager/recoveryservices/2023-08-01/vaultusages/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/method_get_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadproperties.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadpropertiesresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/method_list_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmerrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestorageerrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloaderrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_crrjobrequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmerrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_job.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_jobresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_maberrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/predicates.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/method_list_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditemextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasclassiccomputevmprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaascomputevmprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditemextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditemextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditemextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsapasedatabaseprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsaphanadatabaseprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsqldatabaseprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_diskexclusionproperties.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditemextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_errordetail.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_extendedproperties.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_genericprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_kpiresourcehealthdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditemextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditemresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_resourcehealthdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/predicates.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_get_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_patch_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_update_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfig.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfigresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/method_list_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusage.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusagelist.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_nameinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/method_trigger_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azurefilesharerestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadpointintimerestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadrestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanapointintimerestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanarestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlpointintimerestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlrestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crossregionrestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crraccesstoken.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_encryptiondetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_iaasvmrestorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identitybasedrestoredetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identityinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorefilespecs.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorerequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_sqldatadirectorymapping.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetafsrestoreinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetrestoreinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_workloadcrraccesstoken.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/method_backupcrrjobdetailsget_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmerrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestorageerrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloaderrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_crrjobrequest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmerrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_job.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_jobresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_maberrorinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjob.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobtaskdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/constants.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_get_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_list_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azurefilesharerecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadpointintimerecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadrecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanapointintimerecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanarecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlpointintimerecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypointextendedinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_bekdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_diskinformation.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_genericrecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_iaasvmrecoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_kekdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_keyandsecretdetails.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_pointintimerange.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointdiskconfiguration.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointmovereadinessinfo.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointproperties.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointtierinformation.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_sqldatadirectory.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/predicates.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/version.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/README.md delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/client.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint_test.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/method_recoverypointsgetaccesstoken_autorest.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadproperties.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadpropertiesresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstoken.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstokenresource.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_workloadcrraccesstoken.go delete mode 100644 resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/version.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/README.md create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/client.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/constants.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack_test.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack_test.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack_test.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatmanagementgroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatresourcegroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatsubscription.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatmanagementgroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatresourcegroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatsubscription.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatmanagementgroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatresourcegroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatsubscription.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_getatmanagementgroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_getatresourcegroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_getatsubscription.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_listatmanagementgroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_listatresourcegroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_listatsubscription.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatmanagementgroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatresourcegroup.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatsubscription.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_actiononunmanage.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_denysettings.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentparameter.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstack.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackproperties.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksdebugsetting.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksparameterslink.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackstemplatelink.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacktemplatedefinition.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateproperties.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateresult.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_erroradditionalinfo.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_errordetail.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultparameterreference.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultreference.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_managedresourcereference.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereference.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereferenceextended.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/predicates.go create mode 100644 resource-manager/resources/2024-03-01/deploymentstacks/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_create.go delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionsetting.go delete mode 100644 resource-manager/security/2017-08-01-preview/advancedthreatprotection/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_create.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsetting.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsettingproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/autoprovisioningsettings/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/model_compliance.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/model_complianceproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/model_compliancesegment.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/compliances/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_createorupdate.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_delete.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_allowlistcustomalertrule.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_denylistcustomalertrule.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroup.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroupproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_thresholdcustomalertrule.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_timewindowcustomalertrule.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/devicesecuritygroups/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_createorupdate.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionkeyword.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicy.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicyproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationtype.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_sensitivitylabel.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/informationprotectionpolicies/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutioncreate.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutiondelete.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionget.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionslist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionsresourcegrouplist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionupdate.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionmodel.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_recommendationconfigurationproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_updateiotsecuritysolutiondata.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_userdefinedresourcesproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutions/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertdismiss.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertget.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertslist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getall.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getdefault.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationget.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationslist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalert.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalertproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendation.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendationproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddevice.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddeviceslist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealert.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealertslist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendation.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendationslist.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodel.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelpropertiesdevicesmetricsinlined.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotseveritymetrics.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/id_pricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/id_pricing_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/id_providerpricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/id_providerpricing_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/method_createorupdateresourcegrouppricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/method_getresourcegrouppricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/method_getsubscriptionpricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/method_listbyresourcegroup.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/method_updatesubscriptionpricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/model_pricing.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/model_pricingproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/pricings/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/method_create.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/method_delete.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/method_update.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontact.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontactproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/securitycontacts/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/settings/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/constants.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/id_setting.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/id_setting_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/method_update.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/model_dataexportsetting.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/model_dataexportsettingproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/model_setting.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/settings/version.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/README.md delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/client.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting_test.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/method_create.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/method_delete.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/method_get.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/method_list.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/method_update.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesetting.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesettingproperties.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/predicates.go delete mode 100644 resource-manager/security/2017-08-01-preview/workspacesettings/version.go delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/README.md delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/client.go delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/method_create.go delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/method_get.go delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionproperties.go delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionsetting.go delete mode 100644 resource-manager/security/2019-01-01/advancedthreatprotection/version.go delete mode 100644 resource-manager/security/2019-01-01/alerts/README.md delete mode 100644 resource-manager/security/2019-01-01/alerts/client.go delete mode 100644 resource-manager/security/2019-01-01/alerts/constants.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_alert.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_alert_test.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_location.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_location_test.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_locationalert.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_locationalert_test.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_providerlocation.go delete mode 100644 resource-manager/security/2019-01-01/alerts/id_providerlocation_test.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_getresourcegrouplevelalerts.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_getsubscriptionlevelalert.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_list.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_listbyresourcegroup.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_listresourcegrouplevelalertsbyregion.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_listsubscriptionlevelalertsbyregion.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetodismiss.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetoreactivate.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetodismiss.go delete mode 100644 resource-manager/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetoreactivate.go delete mode 100644 resource-manager/security/2019-01-01/alerts/model_alert.go delete mode 100644 resource-manager/security/2019-01-01/alerts/model_alertconfidencereason.go delete mode 100644 resource-manager/security/2019-01-01/alerts/model_alertentity.go delete mode 100644 resource-manager/security/2019-01-01/alerts/model_alertproperties.go delete mode 100644 resource-manager/security/2019-01-01/alerts/predicates.go delete mode 100644 resource-manager/security/2019-01-01/alerts/version.go delete mode 100644 resource-manager/security/2019-01-01/client.go delete mode 100644 resource-manager/security/2019-01-01/settings/README.md delete mode 100644 resource-manager/security/2019-01-01/settings/client.go delete mode 100644 resource-manager/security/2019-01-01/settings/constants.go delete mode 100644 resource-manager/security/2019-01-01/settings/id_setting.go delete mode 100644 resource-manager/security/2019-01-01/settings/id_setting_test.go delete mode 100644 resource-manager/security/2019-01-01/settings/method_get.go delete mode 100644 resource-manager/security/2019-01-01/settings/method_list.go delete mode 100644 resource-manager/security/2019-01-01/settings/method_update.go delete mode 100644 resource-manager/security/2019-01-01/settings/model_dataexportsettingproperties.go delete mode 100644 resource-manager/security/2019-01-01/settings/model_dataexportsettings.go delete mode 100644 resource-manager/security/2019-01-01/settings/model_setting.go delete mode 100644 resource-manager/security/2019-01-01/settings/predicates.go delete mode 100644 resource-manager/security/2019-01-01/settings/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/id_action.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/id_action_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/method_listbyalertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequest.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequestproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponseproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/actions/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertdetailsoverride.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_entitymapping.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_eventgroupingsettings.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fieldmapping.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_groupingconfiguration.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_incidentconfiguration.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_nrtalertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_querybasedalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertrules/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrule/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrule/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrule/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrule.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleaction.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulecondition.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesaction.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesactionactionconfiguration.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluescondition.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluesconditionconditionproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookaction.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookactionactionconfiguration.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruletriggeringlogic.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_clientinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentlabel.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentownerinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/automationrules/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/method_expand.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandparameters.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponsevalue.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_connectedentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultaggregation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmark/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/bookmarks/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_apipollingparameters.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_availability.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessapipollingdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessparameters.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuidataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectivitycriteria.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectorinstructionmodelbase.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_customspermission.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnectordatatypecommon.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_graphqueries.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_instructionsteps.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_lastdatareceiveddatatype.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_permissions.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_requiredpermissions.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_resourceprovider.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_samplequeries.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectors/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/method_domainwhoisget.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/method_ipgeodataget.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhois.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentipgeodata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/enrichment/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/id_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/id_entity_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/method_expand.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/method_getinsights.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/method_gettimelinelist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/method_queries.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_activitytimelineitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_bookmarktimelineitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityedges.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandparameters.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponsevalue.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsparameters.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitemquerytimeinterval.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineparameters.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultaggregation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightserror.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightsresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_getqueriesresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitemproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresult.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresultcolumnsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_securityalerttimelineitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineaggregation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineerror.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entities/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplatesget.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplateslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activitycustomentityquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriesproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_customentityquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_datatypedefinitions.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquerytemplate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityqueriesproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityquery.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityqueries/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_entitiesrelationslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_getrelation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entityrelations/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_geolocation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_systemdata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_threatintelligence.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentityproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/entitytypes/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/method_incidentslistalerts.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentalertlist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentalerts/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/method_incidentslistbookmarks.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentbookmarklist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_clientinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcomment.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcommentproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentcomments/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/method_incidentslistentities.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_entity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresponse.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidententities/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentrelations/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/model_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentadditionaldata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentlabel.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentownerinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/model_teaminformation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidents/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/method_incidentscreateteam.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teaminformation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teamproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/incidentteam/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/method_create.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/method_update.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataauthor.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatacategories.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatadependencies.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatamodel.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapatch.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapropertiespatch.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasource.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasupport.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/metadata/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsent.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsentproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/officeconsents/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/method_sourcecontrollistrepositories.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/model_repo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/repositories/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_create.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/id_setting.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/id_setting_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsdelete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsget.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_anomalies.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_anomaliessettingsproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalytics.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalyticsproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_eyeson.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_eyesonsettingsproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_settinglist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_settings.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_ueba.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/model_uebaproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/settings/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_create.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_contentpathmap.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_repository.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrol.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrolproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorappendtags.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreateindicator.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatordelete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorget.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatormetricslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorqueryindicators.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorreplacetags.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceappendtags.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceexternalreference.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodelforrequestbody.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceinformation.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencekillchainphase.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetric.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricentity.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetrics.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricslist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/threatintelligence/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitem.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitemproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlistitems/version.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/README.md delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/client.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/constants.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/method_delete.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/method_get.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/method_list.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlist.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlistproperties.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/predicates.go delete mode 100644 resource-manager/securityinsights/2021-09-01-preview/watchlists/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/id_action.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/id_action_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/method_listbyalertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequest.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequestproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponseproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/actions/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertdetailsoverride.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_entitymapping.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_eventgroupingsettings.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fieldmapping.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionscenarioexclusionpattern.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesettings.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesubtypesetting.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfilter.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfiltersitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_groupingconfiguration.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_incidentconfiguration.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertrules/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertdetailsoverride.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplatedatasource.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_entitymapping.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_eventgroupingsettings.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fieldmapping.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesetting.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesubtype.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesubtypeseverityfilter.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrule.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleaction.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulecondition.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulemodifypropertiesaction.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyarraychangedvaluescondition.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvalueschangedcondition.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvaluescondition.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulerunplaybookaction.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruletriggeringlogic.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_clientinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentlabel.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentownerinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentpropertiesaction.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_playbookactionproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyarraychangedconditionproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertychangedconditionproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyconditionproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/automationrules/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/method_expand.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandparameters.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponsevalue.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_connectedentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultaggregation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmark/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkentitymappings.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_entityfieldmapping.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/bookmarks/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirementsproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_office365projectcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officepowerbicheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_apipollingparameters.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_availability.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessapipollingdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessparameters.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuidataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectivitycriteria.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectorinstructionmodelbase.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_customspermission.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnectordatatypecommon.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_graphqueries.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_instructionsteps.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_lastdatareceiveddatatype.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbiconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_permissions.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_requiredpermissions.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_resourceprovider.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_samplequeries.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectors/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/method_domainwhoisget.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/method_ipgeodataget.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhois.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentipgeodata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/enrichment/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/id_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/id_entity_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/method_expand.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/method_getinsights.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/method_gettimelinelist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/method_queries.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_activitytimelineitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_anomalytimelineitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_bookmarktimelineitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityedges.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandparameters.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponsevalue.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsparameters.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitemquerytimeinterval.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineparameters.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultaggregation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightserrorkind.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightsresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_getqueriesresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitemproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresult.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresultcolumnsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_securityalerttimelineitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineaggregation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineerror.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entities/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplatesget.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplateslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activitycustomentityquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriesproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_customentityquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_datatypedefinitions.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquerytemplate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityqueriesproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityquery.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityqueries/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_entitiesrelationslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_getrelation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entityrelations/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_geolocation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_systemdata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_threatintelligence.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/entitytypes/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/method_incidentslistalerts.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentalertlist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentalerts/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/method_incidentslistbookmarks.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentbookmarklist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_clientinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcomment.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcommentproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentcomments/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/method_incidentslistentities.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresponse.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidententities/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentrelations/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/model_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentadditionaldata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentlabel.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentownerinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/model_teaminformation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidents/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/method_incidentscreateteam.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teaminformation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teamproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/incidentteam/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/method_incidentsrunplaybook.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/model_manualtriggerrequestbody.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/manualtrigger/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/method_create.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/method_update.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataauthor.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatacategories.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatadependencies.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatamodel.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapatch.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapropertiespatch.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasource.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasupport.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/metadata/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsent.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsentproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/officeconsents/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/method_sourcecontrollistrepositories.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/model_repo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/repositories/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssetting.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_create.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/id_setting.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/id_setting_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsdelete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsget.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_anomalies.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_anomaliessettingsproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalytics.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalyticsproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_eyeson.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_eyesonsettingsproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_settinglist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_settings.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_ueba.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/model_uebaproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/settings/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_create.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_azuredevopsresourceinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_contentpathmap.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deployment.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deploymentinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_githubresourceinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repository.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repositoryresourceinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrol.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrolproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_webhook.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorappendtags.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreateindicator.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatordelete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorget.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatormetricslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorqueryindicators.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorreplacetags.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceappendtags.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceexternalreference.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceinformation.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencekillchainphase.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetric.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricentity.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetrics.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricslist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/threatintelligence/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitem.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitemproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlistitems/version.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/README.md delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/client.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/constants.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/method_get.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/method_list.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlist.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlistproperties.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/predicates.go delete mode 100644 resource-manager/securityinsights/2022-07-01-preview/watchlists/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/id_action.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/id_action_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/id_alertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/id_alertrule_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/method_listbyalertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/model_actionrequest.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/model_actionrequestproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/model_actionresponse.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/model_actionresponseproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/actions/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_alertdetailsoverride.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_alertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_entitymapping.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_eventgroupingsettings.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_fieldmapping.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_groupingconfiguration.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_incidentconfiguration.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertrules/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertdetailsoverride.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplatedatasource.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_entitymapping.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_eventgroupingsettings.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fieldmapping.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplateproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/alertruletemplates/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationrule.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleaction.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulecondition.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulemodifypropertiesaction.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulepropertyvaluescondition.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulerunplaybookaction.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_automationruletriggeringlogic.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_clientinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_incidentlabel.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_incidentownerinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_incidentpropertiesaction.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_playbookactionproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/model_propertyconditionproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/automationrules/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmark.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/bookmarks/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_alertsdatatypeofdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnectordatatypecommon.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnector.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectordatatypes.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/dataconnectors/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_geolocation.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_processentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_processentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_systemdata.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_threatintelligence.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentityproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/entitytypes/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/method_incidentslistalerts.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentalertlist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentalerts/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/method_incidentslistbookmarks.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentbookmarklist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentbookmarks/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/model_clientinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcomment.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcommentproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentcomments/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/method_incidentslistentities.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_entity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmark.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmarkproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresponse.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresultsmetadata.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_incidentinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_securityalert.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidententities/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/model_relation.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/model_relationproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidentrelations/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/id_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/id_incident_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/model_incident.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/model_incidentadditionaldata.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/model_incidentlabel.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/model_incidentownerinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/model_incidentproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/incidents/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_create.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateslist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorappendtags.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreateindicator.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatordelete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorget.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatormetricslist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorqueryindicators.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorreplacetags.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorslist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceappendtags.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceexternalreference.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencefilteringcriteria.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatormodel.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatorproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceinformation.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencekillchainphase.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetric.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricentity.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetrics.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricslist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpattern.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencesortingcriteria.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/threatintelligence/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitem.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitemproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlistitems/version.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/README.md delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/client.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/constants.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/id_workspace.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/id_workspace_test.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/method_createorupdate.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/method_delete.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/method_get.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/method_list.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/model_userinfo.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/model_watchlist.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/model_watchlistproperties.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/predicates.go delete mode 100644 resource-manager/securityinsights/2022-08-01/watchlists/version.go diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/README.md b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/README.md deleted file mode 100644 index 2b46df0ea4e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/README.md +++ /dev/null @@ -1,163 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/arcsettings` Documentation - -The `arcsettings` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/arcsettings" -``` - - -### Client Initialization - -```go -client := arcsettings.NewArcSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsCreate` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -payload := arcsettings.ArcSetting{ - // ... -} - - -read, err := client.ArcSettingsCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsDelete` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -if err := client.ArcSettingsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsGet` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -read, err := client.ArcSettingsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsListByCluster` - -```go -ctx := context.TODO() -id := arcsettings.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ArcSettingsListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ArcSettingsListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsUpdate` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -payload := arcsettings.ArcSettingsPatch{ - // ... -} - - -read, err := client.ArcSettingsUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.ConsentAndInstallDefaultExtensions` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -read, err := client.ConsentAndInstallDefaultExtensions(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.CreateIdentity` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -if err := client.CreateIdentityThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ArcSettingsClient.GeneratePassword` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -read, err := client.GeneratePassword(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.InitializeDisableProcess` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -if err := client.InitializeDisableProcessThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/client.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/client.go deleted file mode 100644 index bf76b03a6da..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package arcsettings - -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 ArcSettingsClient struct { - Client *resourcemanager.Client -} - -func NewArcSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*ArcSettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "arcsettings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ArcSettingsClient: %+v", err) - } - - return &ArcSettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/constants.go deleted file mode 100644 index 9783fea054f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package arcsettings - -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 ArcSettingAggregateState string - -const ( - ArcSettingAggregateStateAccepted ArcSettingAggregateState = "Accepted" - ArcSettingAggregateStateCanceled ArcSettingAggregateState = "Canceled" - ArcSettingAggregateStateConnected ArcSettingAggregateState = "Connected" - ArcSettingAggregateStateCreating ArcSettingAggregateState = "Creating" - ArcSettingAggregateStateDeleted ArcSettingAggregateState = "Deleted" - ArcSettingAggregateStateDeleting ArcSettingAggregateState = "Deleting" - ArcSettingAggregateStateDisableInProgress ArcSettingAggregateState = "DisableInProgress" - ArcSettingAggregateStateDisconnected ArcSettingAggregateState = "Disconnected" - ArcSettingAggregateStateError ArcSettingAggregateState = "Error" - ArcSettingAggregateStateFailed ArcSettingAggregateState = "Failed" - ArcSettingAggregateStateInProgress ArcSettingAggregateState = "InProgress" - ArcSettingAggregateStateMoving ArcSettingAggregateState = "Moving" - ArcSettingAggregateStateNotSpecified ArcSettingAggregateState = "NotSpecified" - ArcSettingAggregateStatePartiallyConnected ArcSettingAggregateState = "PartiallyConnected" - ArcSettingAggregateStatePartiallySucceeded ArcSettingAggregateState = "PartiallySucceeded" - ArcSettingAggregateStateProvisioning ArcSettingAggregateState = "Provisioning" - ArcSettingAggregateStateSucceeded ArcSettingAggregateState = "Succeeded" - ArcSettingAggregateStateUpdating ArcSettingAggregateState = "Updating" -) - -func PossibleValuesForArcSettingAggregateState() []string { - return []string{ - string(ArcSettingAggregateStateAccepted), - string(ArcSettingAggregateStateCanceled), - string(ArcSettingAggregateStateConnected), - string(ArcSettingAggregateStateCreating), - string(ArcSettingAggregateStateDeleted), - string(ArcSettingAggregateStateDeleting), - string(ArcSettingAggregateStateDisableInProgress), - string(ArcSettingAggregateStateDisconnected), - string(ArcSettingAggregateStateError), - string(ArcSettingAggregateStateFailed), - string(ArcSettingAggregateStateInProgress), - string(ArcSettingAggregateStateMoving), - string(ArcSettingAggregateStateNotSpecified), - string(ArcSettingAggregateStatePartiallyConnected), - string(ArcSettingAggregateStatePartiallySucceeded), - string(ArcSettingAggregateStateProvisioning), - string(ArcSettingAggregateStateSucceeded), - string(ArcSettingAggregateStateUpdating), - } -} - -func (s *ArcSettingAggregateState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseArcSettingAggregateState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseArcSettingAggregateState(input string) (*ArcSettingAggregateState, error) { - vals := map[string]ArcSettingAggregateState{ - "accepted": ArcSettingAggregateStateAccepted, - "canceled": ArcSettingAggregateStateCanceled, - "connected": ArcSettingAggregateStateConnected, - "creating": ArcSettingAggregateStateCreating, - "deleted": ArcSettingAggregateStateDeleted, - "deleting": ArcSettingAggregateStateDeleting, - "disableinprogress": ArcSettingAggregateStateDisableInProgress, - "disconnected": ArcSettingAggregateStateDisconnected, - "error": ArcSettingAggregateStateError, - "failed": ArcSettingAggregateStateFailed, - "inprogress": ArcSettingAggregateStateInProgress, - "moving": ArcSettingAggregateStateMoving, - "notspecified": ArcSettingAggregateStateNotSpecified, - "partiallyconnected": ArcSettingAggregateStatePartiallyConnected, - "partiallysucceeded": ArcSettingAggregateStatePartiallySucceeded, - "provisioning": ArcSettingAggregateStateProvisioning, - "succeeded": ArcSettingAggregateStateSucceeded, - "updating": ArcSettingAggregateStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ArcSettingAggregateState(input) - return &out, nil -} - -type NodeArcState string - -const ( - NodeArcStateAccepted NodeArcState = "Accepted" - NodeArcStateCanceled NodeArcState = "Canceled" - NodeArcStateConnected NodeArcState = "Connected" - NodeArcStateCreating NodeArcState = "Creating" - NodeArcStateDeleted NodeArcState = "Deleted" - NodeArcStateDeleting NodeArcState = "Deleting" - NodeArcStateDisableInProgress NodeArcState = "DisableInProgress" - NodeArcStateDisconnected NodeArcState = "Disconnected" - NodeArcStateError NodeArcState = "Error" - NodeArcStateFailed NodeArcState = "Failed" - NodeArcStateInProgress NodeArcState = "InProgress" - NodeArcStateMoving NodeArcState = "Moving" - NodeArcStateNotSpecified NodeArcState = "NotSpecified" - NodeArcStatePartiallyConnected NodeArcState = "PartiallyConnected" - NodeArcStatePartiallySucceeded NodeArcState = "PartiallySucceeded" - NodeArcStateProvisioning NodeArcState = "Provisioning" - NodeArcStateSucceeded NodeArcState = "Succeeded" - NodeArcStateUpdating NodeArcState = "Updating" -) - -func PossibleValuesForNodeArcState() []string { - return []string{ - string(NodeArcStateAccepted), - string(NodeArcStateCanceled), - string(NodeArcStateConnected), - string(NodeArcStateCreating), - string(NodeArcStateDeleted), - string(NodeArcStateDeleting), - string(NodeArcStateDisableInProgress), - string(NodeArcStateDisconnected), - string(NodeArcStateError), - string(NodeArcStateFailed), - string(NodeArcStateInProgress), - string(NodeArcStateMoving), - string(NodeArcStateNotSpecified), - string(NodeArcStatePartiallyConnected), - string(NodeArcStatePartiallySucceeded), - string(NodeArcStateProvisioning), - string(NodeArcStateSucceeded), - string(NodeArcStateUpdating), - } -} - -func (s *NodeArcState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNodeArcState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNodeArcState(input string) (*NodeArcState, error) { - vals := map[string]NodeArcState{ - "accepted": NodeArcStateAccepted, - "canceled": NodeArcStateCanceled, - "connected": NodeArcStateConnected, - "creating": NodeArcStateCreating, - "deleted": NodeArcStateDeleted, - "deleting": NodeArcStateDeleting, - "disableinprogress": NodeArcStateDisableInProgress, - "disconnected": NodeArcStateDisconnected, - "error": NodeArcStateError, - "failed": NodeArcStateFailed, - "inprogress": NodeArcStateInProgress, - "moving": NodeArcStateMoving, - "notspecified": NodeArcStateNotSpecified, - "partiallyconnected": NodeArcStatePartiallyConnected, - "partiallysucceeded": NodeArcStatePartiallySucceeded, - "provisioning": NodeArcStateProvisioning, - "succeeded": NodeArcStateSucceeded, - "updating": NodeArcStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NodeArcState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateError ProvisioningState = "Error" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisableInProgress), - string(ProvisioningStateDisconnected), - string(ProvisioningStateError), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disableinprogress": ProvisioningStateDisableInProgress, - "disconnected": ProvisioningStateDisconnected, - "error": ProvisioningStateError, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting.go deleted file mode 100644 index 1d17d3a2b54..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting.go +++ /dev/null @@ -1,139 +0,0 @@ -package arcsettings - -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(&ArcSettingId{}) -} - -var _ resourceids.ResourceId = &ArcSettingId{} - -// ArcSettingId is a struct representing the Resource ID for a Arc Setting -type ArcSettingId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ArcSettingName string -} - -// NewArcSettingID returns a new ArcSettingId struct -func NewArcSettingID(subscriptionId string, resourceGroupName string, clusterName string, arcSettingName string) ArcSettingId { - return ArcSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ArcSettingName: arcSettingName, - } -} - -// ParseArcSettingID parses 'input' into a ArcSettingId -func ParseArcSettingID(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseArcSettingIDInsensitively parses 'input' case-insensitively into a ArcSettingId -// note: this method should only be used for API response data and not user input -func ParseArcSettingIDInsensitively(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ArcSettingId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ArcSettingName, ok = input.Parsed["arcSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arcSettingName", input) - } - - return nil -} - -// ValidateArcSettingID checks that 'input' can be parsed as a Arc Setting ID -func ValidateArcSettingID(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 := ParseArcSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Arc Setting ID -func (id ArcSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/arcSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ArcSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Arc Setting ID -func (id ArcSettingId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticArcSettings", "arcSettings", "arcSettings"), - resourceids.UserSpecifiedSegment("arcSettingName", "arcSettingValue"), - } -} - -// String returns a human-readable description of this Arc Setting ID -func (id ArcSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Arc Setting Name: %q", id.ArcSettingName), - } - return fmt.Sprintf("Arc Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting_test.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting_test.go deleted file mode 100644 index ee3f47acf2f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_arcsetting_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package arcsettings - -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 = &ArcSettingId{} - -func TestNewArcSettingID(t *testing.T) { - id := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ArcSettingName != "arcSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArcSettingName'", id.ArcSettingName, "arcSettingValue") - } -} - -func TestFormatArcSettingID(t *testing.T) { - actual := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseArcSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestParseArcSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ArcSettingName: "aRcSeTtInGvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestSegmentsForArcSettingId(t *testing.T) { - segments := ArcSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ArcSettingId 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/azurestackhci/2023-08-01-preview/arcsettings/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster.go deleted file mode 100644 index efec5d31747..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package arcsettings - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster_test.go deleted file mode 100644 index ca61c45c616..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package arcsettings - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingscreate.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingscreate.go deleted file mode 100644 index e23e135a7a4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingscreate.go +++ /dev/null @@ -1,58 +0,0 @@ -package arcsettings - -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 ArcSettingsCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ArcSettingsCreate ... -func (c ArcSettingsClient) ArcSettingsCreate(ctx context.Context, id ArcSettingId, input ArcSetting) (result ArcSettingsCreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsdelete.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsdelete.go deleted file mode 100644 index c7d5b6dd8d0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package arcsettings - -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 ArcSettingsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ArcSettingsDelete ... -func (c ArcSettingsClient) ArcSettingsDelete(ctx context.Context, id ArcSettingId) (result ArcSettingsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// ArcSettingsDeleteThenPoll performs ArcSettingsDelete then polls until it's completed -func (c ArcSettingsClient) ArcSettingsDeleteThenPoll(ctx context.Context, id ArcSettingId) error { - result, err := c.ArcSettingsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing ArcSettingsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ArcSettingsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsget.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsget.go deleted file mode 100644 index da38efd7c84..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package arcsettings - -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 ArcSettingsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ArcSettingsGet ... -func (c ArcSettingsClient) ArcSettingsGet(ctx context.Context, id ArcSettingId) (result ArcSettingsGetOperationResponse, 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingslistbycluster.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingslistbycluster.go deleted file mode 100644 index 908176e84fa..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingslistbycluster.go +++ /dev/null @@ -1,91 +0,0 @@ -package arcsettings - -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 ArcSettingsListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ArcSetting -} - -type ArcSettingsListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []ArcSetting -} - -// ArcSettingsListByCluster ... -func (c ArcSettingsClient) ArcSettingsListByCluster(ctx context.Context, id ClusterId) (result ArcSettingsListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/arcSettings", 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 *[]ArcSetting `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ArcSettingsListByClusterComplete retrieves all the results into a single object -func (c ArcSettingsClient) ArcSettingsListByClusterComplete(ctx context.Context, id ClusterId) (ArcSettingsListByClusterCompleteResult, error) { - return c.ArcSettingsListByClusterCompleteMatchingPredicate(ctx, id, ArcSettingOperationPredicate{}) -} - -// ArcSettingsListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ArcSettingsClient) ArcSettingsListByClusterCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ArcSettingOperationPredicate) (result ArcSettingsListByClusterCompleteResult, err error) { - items := make([]ArcSetting, 0) - - resp, err := c.ArcSettingsListByCluster(ctx, id) - if err != nil { - 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 = ArcSettingsListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsupdate.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsupdate.go deleted file mode 100644 index 6b942fa5f05..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_arcsettingsupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package arcsettings - -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 ArcSettingsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ArcSettingsUpdate ... -func (c ArcSettingsClient) ArcSettingsUpdate(ctx context.Context, id ArcSettingId, input ArcSettingsPatch) (result ArcSettingsUpdateOperationResponse, 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_consentandinstalldefaultextensions.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_consentandinstalldefaultextensions.go deleted file mode 100644 index 59282809851..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_consentandinstalldefaultextensions.go +++ /dev/null @@ -1,55 +0,0 @@ -package arcsettings - -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 ConsentAndInstallDefaultExtensionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ConsentAndInstallDefaultExtensions ... -func (c ArcSettingsClient) ConsentAndInstallDefaultExtensions(ctx context.Context, id ArcSettingId) (result ConsentAndInstallDefaultExtensionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/consentAndInstallDefaultExtensions", 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_createidentity.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_createidentity.go deleted file mode 100644 index 1a9bc34c033..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_createidentity.go +++ /dev/null @@ -1,71 +0,0 @@ -package arcsettings - -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 CreateIdentityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ArcIdentityResponse -} - -// CreateIdentity ... -func (c ArcSettingsClient) CreateIdentity(ctx context.Context, id ArcSettingId) (result CreateIdentityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createArcIdentity", 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 -} - -// CreateIdentityThenPoll performs CreateIdentity then polls until it's completed -func (c ArcSettingsClient) CreateIdentityThenPoll(ctx context.Context, id ArcSettingId) error { - result, err := c.CreateIdentity(ctx, id) - if err != nil { - return fmt.Errorf("performing CreateIdentity: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateIdentity: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_generatepassword.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_generatepassword.go deleted file mode 100644 index 4f9aaacb077..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_generatepassword.go +++ /dev/null @@ -1,55 +0,0 @@ -package arcsettings - -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 GeneratePasswordOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PasswordCredential -} - -// GeneratePassword ... -func (c ArcSettingsClient) GeneratePassword(ctx context.Context, id ArcSettingId) (result GeneratePasswordOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatePassword", 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 PasswordCredential - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_initializedisableprocess.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_initializedisableprocess.go deleted file mode 100644 index 206fd88abb1..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/method_initializedisableprocess.go +++ /dev/null @@ -1,70 +0,0 @@ -package arcsettings - -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 InitializeDisableProcessOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// InitializeDisableProcess ... -func (c ArcSettingsClient) InitializeDisableProcess(ctx context.Context, id ArcSettingId) (result InitializeDisableProcessOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/initializeDisableProcess", 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 -} - -// InitializeDisableProcessThenPoll performs InitializeDisableProcess then polls until it's completed -func (c ArcSettingsClient) InitializeDisableProcessThenPoll(ctx context.Context, id ArcSettingId) error { - result, err := c.InitializeDisableProcess(ctx, id) - if err != nil { - return fmt.Errorf("performing InitializeDisableProcess: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InitializeDisableProcess: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponse.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponse.go deleted file mode 100644 index 08d1275ea50..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcIdentityResponse struct { - Properties *ArcIdentityResponseProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponseproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponseproperties.go deleted file mode 100644 index 4e33abb10de..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcidentityresponseproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcIdentityResponseProperties struct { - ArcApplicationClientId *string `json:"arcApplicationClientId,omitempty"` - ArcApplicationObjectId *string `json:"arcApplicationObjectId,omitempty"` - ArcApplicationTenantId *string `json:"arcApplicationTenantId,omitempty"` - ArcServicePrincipalObjectId *string `json:"arcServicePrincipalObjectId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsetting.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsetting.go deleted file mode 100644 index 792133291a2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsetting.go +++ /dev/null @@ -1,16 +0,0 @@ -package arcsettings - -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 ArcSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ArcSettingProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingproperties.go deleted file mode 100644 index 436656a1d00..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingProperties struct { - AggregateState *ArcSettingAggregateState `json:"aggregateState,omitempty"` - ArcApplicationClientId *string `json:"arcApplicationClientId,omitempty"` - ArcApplicationObjectId *string `json:"arcApplicationObjectId,omitempty"` - ArcApplicationTenantId *string `json:"arcApplicationTenantId,omitempty"` - ArcInstanceResourceGroup *string `json:"arcInstanceResourceGroup,omitempty"` - ArcServicePrincipalObjectId *string `json:"arcServicePrincipalObjectId,omitempty"` - ConnectivityProperties *interface{} `json:"connectivityProperties,omitempty"` - DefaultExtensions *[]DefaultExtensionDetails `json:"defaultExtensions,omitempty"` - PerNodeDetails *[]PerNodeState `json:"perNodeDetails,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatch.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatch.go deleted file mode 100644 index ff9c88a3664..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatch.go +++ /dev/null @@ -1,9 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingsPatch struct { - Properties *ArcSettingsPatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatchproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatchproperties.go deleted file mode 100644 index 7a806bba490..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_arcsettingspatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingsPatchProperties struct { - ConnectivityProperties *interface{} `json:"connectivityProperties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_defaultextensiondetails.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_defaultextensiondetails.go deleted file mode 100644 index 392d04915bb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_defaultextensiondetails.go +++ /dev/null @@ -1,27 +0,0 @@ -package arcsettings - -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 DefaultExtensionDetails struct { - Category *string `json:"category,omitempty"` - ConsentTime *string `json:"consentTime,omitempty"` -} - -func (o *DefaultExtensionDetails) GetConsentTimeAsTime() (*time.Time, error) { - if o.ConsentTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ConsentTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DefaultExtensionDetails) SetConsentTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ConsentTime = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_passwordcredential.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_passwordcredential.go deleted file mode 100644 index cf56a2624c0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_passwordcredential.go +++ /dev/null @@ -1,41 +0,0 @@ -package arcsettings - -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 PasswordCredential struct { - EndDateTime *string `json:"endDateTime,omitempty"` - KeyId *string `json:"keyId,omitempty"` - SecretText *string `json:"secretText,omitempty"` - StartDateTime *string `json:"startDateTime,omitempty"` -} - -func (o *PasswordCredential) GetEndDateTimeAsTime() (*time.Time, error) { - if o.EndDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PasswordCredential) SetEndDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndDateTime = &formatted -} - -func (o *PasswordCredential) GetStartDateTimeAsTime() (*time.Time, error) { - if o.StartDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PasswordCredential) SetStartDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartDateTime = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_pernodestate.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_pernodestate.go deleted file mode 100644 index 9b79465a5d3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/model_pernodestate.go +++ /dev/null @@ -1,11 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PerNodeState struct { - ArcInstance *string `json:"arcInstance,omitempty"` - ArcNodeServicePrincipalObjectId *string `json:"arcNodeServicePrincipalObjectId,omitempty"` - Name *string `json:"name,omitempty"` - State *NodeArcState `json:"state,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/predicates.go deleted file mode 100644 index 98d1fe0a836..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ArcSettingOperationPredicate) Matches(input ArcSetting) 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/azurestackhci/2023-08-01-preview/arcsettings/version.go b/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/version.go deleted file mode 100644 index 3c8ed4cb113..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/arcsettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package arcsettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/arcsettings/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/client.go b/resource-manager/azurestackhci/2023-08-01-preview/client.go deleted file mode 100644 index dd03bede13f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/client.go +++ /dev/null @@ -1,127 +0,0 @@ -package v2023_08_01_preview - -// 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/azurestackhci/2023-08-01-preview/arcsettings" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/cluster" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/clusters" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/edgedevices" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/extensions" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/offers" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/publishers" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/skuses" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/updateruns" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/updates" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - ArcSettings *arcsettings.ArcSettingsClient - Cluster *cluster.ClusterClient - Clusters *clusters.ClustersClient - DeploymentSettings *deploymentsettings.DeploymentSettingsClient - EdgeDevices *edgedevices.EdgeDevicesClient - Extensions *extensions.ExtensionsClient - Offers *offers.OffersClient - Publishers *publishers.PublishersClient - Skuses *skuses.SkusesClient - UpdateRuns *updateruns.UpdateRunsClient - UpdateSummaries *updatesummaries.UpdateSummariesClient - Updates *updates.UpdatesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - arcSettingsClient, err := arcsettings.NewArcSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ArcSettings client: %+v", err) - } - configureFunc(arcSettingsClient.Client) - - clusterClient, err := cluster.NewClusterClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Cluster client: %+v", err) - } - configureFunc(clusterClient.Client) - - clustersClient, err := clusters.NewClustersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Clusters client: %+v", err) - } - configureFunc(clustersClient.Client) - - deploymentSettingsClient, err := deploymentsettings.NewDeploymentSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DeploymentSettings client: %+v", err) - } - configureFunc(deploymentSettingsClient.Client) - - edgeDevicesClient, err := edgedevices.NewEdgeDevicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EdgeDevices client: %+v", err) - } - configureFunc(edgeDevicesClient.Client) - - extensionsClient, err := extensions.NewExtensionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Extensions client: %+v", err) - } - configureFunc(extensionsClient.Client) - - offersClient, err := offers.NewOffersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Offers client: %+v", err) - } - configureFunc(offersClient.Client) - - publishersClient, err := publishers.NewPublishersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Publishers client: %+v", err) - } - configureFunc(publishersClient.Client) - - skusesClient, err := skuses.NewSkusesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Skuses client: %+v", err) - } - configureFunc(skusesClient.Client) - - updateRunsClient, err := updateruns.NewUpdateRunsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building UpdateRuns client: %+v", err) - } - configureFunc(updateRunsClient.Client) - - updateSummariesClient, err := updatesummaries.NewUpdateSummariesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building UpdateSummaries client: %+v", err) - } - configureFunc(updateSummariesClient.Client) - - updatesClient, err := updates.NewUpdatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Updates client: %+v", err) - } - configureFunc(updatesClient.Client) - - return &Client{ - ArcSettings: arcSettingsClient, - Cluster: clusterClient, - Clusters: clustersClient, - DeploymentSettings: deploymentSettingsClient, - EdgeDevices: edgeDevicesClient, - Extensions: extensionsClient, - Offers: offersClient, - Publishers: publishersClient, - Skuses: skusesClient, - UpdateRuns: updateRunsClient, - UpdateSummaries: updateSummariesClient, - Updates: updatesClient, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/README.md b/resource-manager/azurestackhci/2023-08-01-preview/cluster/README.md deleted file mode 100644 index 7ea2c435245..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/README.md +++ /dev/null @@ -1,66 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/cluster` Documentation - -The `cluster` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/cluster" -``` - - -### Client Initialization - -```go -client := cluster.NewClusterClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ClusterClient.CreateIdentity` - -```go -ctx := context.TODO() -id := cluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.CreateIdentityThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClusterClient.ExtendSoftwareAssuranceBenefit` - -```go -ctx := context.TODO() -id := cluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := cluster.SoftwareAssuranceChangeRequest{ - // ... -} - - -if err := client.ExtendSoftwareAssuranceBenefitThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClusterClient.UploadCertificate` - -```go -ctx := context.TODO() -id := cluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := cluster.UploadCertificateRequest{ - // ... -} - - -if err := client.UploadCertificateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/client.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/client.go deleted file mode 100644 index 2a0e60ffb2b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package cluster - -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 ClusterClient struct { - Client *resourcemanager.Client -} - -func NewClusterClientWithBaseURI(sdkApi sdkEnv.Api) (*ClusterClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "cluster", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ClusterClient: %+v", err) - } - - return &ClusterClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/constants.go deleted file mode 100644 index dafab9b8d70..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/constants.go +++ /dev/null @@ -1,510 +0,0 @@ -package cluster - -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 ClusterNodeType string - -const ( - ClusterNodeTypeFirstParty ClusterNodeType = "FirstParty" - ClusterNodeTypeThirdParty ClusterNodeType = "ThirdParty" -) - -func PossibleValuesForClusterNodeType() []string { - return []string{ - string(ClusterNodeTypeFirstParty), - string(ClusterNodeTypeThirdParty), - } -} - -func (s *ClusterNodeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseClusterNodeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseClusterNodeType(input string) (*ClusterNodeType, error) { - vals := map[string]ClusterNodeType{ - "firstparty": ClusterNodeTypeFirstParty, - "thirdparty": ClusterNodeTypeThirdParty, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ClusterNodeType(input) - return &out, nil -} - -type ConnectivityStatus string - -const ( - ConnectivityStatusConnected ConnectivityStatus = "Connected" - ConnectivityStatusDisconnected ConnectivityStatus = "Disconnected" - ConnectivityStatusNotConnectedRecently ConnectivityStatus = "NotConnectedRecently" - ConnectivityStatusNotSpecified ConnectivityStatus = "NotSpecified" - ConnectivityStatusNotYetRegistered ConnectivityStatus = "NotYetRegistered" - ConnectivityStatusPartiallyConnected ConnectivityStatus = "PartiallyConnected" -) - -func PossibleValuesForConnectivityStatus() []string { - return []string{ - string(ConnectivityStatusConnected), - string(ConnectivityStatusDisconnected), - string(ConnectivityStatusNotConnectedRecently), - string(ConnectivityStatusNotSpecified), - string(ConnectivityStatusNotYetRegistered), - string(ConnectivityStatusPartiallyConnected), - } -} - -func (s *ConnectivityStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityStatus(input string) (*ConnectivityStatus, error) { - vals := map[string]ConnectivityStatus{ - "connected": ConnectivityStatusConnected, - "disconnected": ConnectivityStatusDisconnected, - "notconnectedrecently": ConnectivityStatusNotConnectedRecently, - "notspecified": ConnectivityStatusNotSpecified, - "notyetregistered": ConnectivityStatusNotYetRegistered, - "partiallyconnected": ConnectivityStatusPartiallyConnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityStatus(input) - return &out, nil -} - -type DiagnosticLevel string - -const ( - DiagnosticLevelBasic DiagnosticLevel = "Basic" - DiagnosticLevelEnhanced DiagnosticLevel = "Enhanced" - DiagnosticLevelOff DiagnosticLevel = "Off" -) - -func PossibleValuesForDiagnosticLevel() []string { - return []string{ - string(DiagnosticLevelBasic), - string(DiagnosticLevelEnhanced), - string(DiagnosticLevelOff), - } -} - -func (s *DiagnosticLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiagnosticLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiagnosticLevel(input string) (*DiagnosticLevel, error) { - vals := map[string]DiagnosticLevel{ - "basic": DiagnosticLevelBasic, - "enhanced": DiagnosticLevelEnhanced, - "off": DiagnosticLevelOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiagnosticLevel(input) - return &out, nil -} - -type ImdsAttestation string - -const ( - ImdsAttestationDisabled ImdsAttestation = "Disabled" - ImdsAttestationEnabled ImdsAttestation = "Enabled" -) - -func PossibleValuesForImdsAttestation() []string { - return []string{ - string(ImdsAttestationDisabled), - string(ImdsAttestationEnabled), - } -} - -func (s *ImdsAttestation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImdsAttestation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImdsAttestation(input string) (*ImdsAttestation, error) { - vals := map[string]ImdsAttestation{ - "disabled": ImdsAttestationDisabled, - "enabled": ImdsAttestationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImdsAttestation(input) - return &out, nil -} - -type OemActivation string - -const ( - OemActivationDisabled OemActivation = "Disabled" - OemActivationEnabled OemActivation = "Enabled" -) - -func PossibleValuesForOemActivation() []string { - return []string{ - string(OemActivationDisabled), - string(OemActivationEnabled), - } -} - -func (s *OemActivation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOemActivation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOemActivation(input string) (*OemActivation, error) { - vals := map[string]OemActivation{ - "disabled": OemActivationDisabled, - "enabled": OemActivationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OemActivation(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisableInProgress), - string(ProvisioningStateDisconnected), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disableinprogress": ProvisioningStateDisableInProgress, - "disconnected": ProvisioningStateDisconnected, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SoftwareAssuranceIntent string - -const ( - SoftwareAssuranceIntentDisable SoftwareAssuranceIntent = "Disable" - SoftwareAssuranceIntentEnable SoftwareAssuranceIntent = "Enable" -) - -func PossibleValuesForSoftwareAssuranceIntent() []string { - return []string{ - string(SoftwareAssuranceIntentDisable), - string(SoftwareAssuranceIntentEnable), - } -} - -func (s *SoftwareAssuranceIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceIntent(input string) (*SoftwareAssuranceIntent, error) { - vals := map[string]SoftwareAssuranceIntent{ - "disable": SoftwareAssuranceIntentDisable, - "enable": SoftwareAssuranceIntentEnable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceIntent(input) - return &out, nil -} - -type SoftwareAssuranceStatus string - -const ( - SoftwareAssuranceStatusDisabled SoftwareAssuranceStatus = "Disabled" - SoftwareAssuranceStatusEnabled SoftwareAssuranceStatus = "Enabled" -) - -func PossibleValuesForSoftwareAssuranceStatus() []string { - return []string{ - string(SoftwareAssuranceStatusDisabled), - string(SoftwareAssuranceStatusEnabled), - } -} - -func (s *SoftwareAssuranceStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceStatus(input string) (*SoftwareAssuranceStatus, error) { - vals := map[string]SoftwareAssuranceStatus{ - "disabled": SoftwareAssuranceStatusDisabled, - "enabled": SoftwareAssuranceStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceStatus(input) - return &out, nil -} - -type Status string - -const ( - StatusConnectedRecently Status = "ConnectedRecently" - StatusDeploymentFailed Status = "DeploymentFailed" - StatusDeploymentInProgress Status = "DeploymentInProgress" - StatusDeploymentSuccess Status = "DeploymentSuccess" - StatusDisconnected Status = "Disconnected" - StatusError Status = "Error" - StatusNotConnectedRecently Status = "NotConnectedRecently" - StatusNotSpecified Status = "NotSpecified" - StatusNotYetRegistered Status = "NotYetRegistered" - StatusValidationFailed Status = "ValidationFailed" - StatusValidationInProgress Status = "ValidationInProgress" - StatusValidationSuccess Status = "ValidationSuccess" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusConnectedRecently), - string(StatusDeploymentFailed), - string(StatusDeploymentInProgress), - string(StatusDeploymentSuccess), - string(StatusDisconnected), - string(StatusError), - string(StatusNotConnectedRecently), - string(StatusNotSpecified), - string(StatusNotYetRegistered), - string(StatusValidationFailed), - string(StatusValidationInProgress), - string(StatusValidationSuccess), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "connectedrecently": StatusConnectedRecently, - "deploymentfailed": StatusDeploymentFailed, - "deploymentinprogress": StatusDeploymentInProgress, - "deploymentsuccess": StatusDeploymentSuccess, - "disconnected": StatusDisconnected, - "error": StatusError, - "notconnectedrecently": StatusNotConnectedRecently, - "notspecified": StatusNotSpecified, - "notyetregistered": StatusNotYetRegistered, - "validationfailed": StatusValidationFailed, - "validationinprogress": StatusValidationInProgress, - "validationsuccess": StatusValidationSuccess, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type WindowsServerSubscription string - -const ( - WindowsServerSubscriptionDisabled WindowsServerSubscription = "Disabled" - WindowsServerSubscriptionEnabled WindowsServerSubscription = "Enabled" -) - -func PossibleValuesForWindowsServerSubscription() []string { - return []string{ - string(WindowsServerSubscriptionDisabled), - string(WindowsServerSubscriptionEnabled), - } -} - -func (s *WindowsServerSubscription) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWindowsServerSubscription(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWindowsServerSubscription(input string) (*WindowsServerSubscription, error) { - vals := map[string]WindowsServerSubscription{ - "disabled": WindowsServerSubscriptionDisabled, - "enabled": WindowsServerSubscriptionEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WindowsServerSubscription(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster.go deleted file mode 100644 index d9ee18cbcc4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package cluster - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster_test.go deleted file mode 100644 index 9b70ca2f6bd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package cluster - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/cluster/method_createidentity.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_createidentity.go deleted file mode 100644 index 76c9822e828..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_createidentity.go +++ /dev/null @@ -1,71 +0,0 @@ -package cluster - -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 CreateIdentityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ClusterIdentityResponse -} - -// CreateIdentity ... -func (c ClusterClient) CreateIdentity(ctx context.Context, id ClusterId) (result CreateIdentityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createClusterIdentity", 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 -} - -// CreateIdentityThenPoll performs CreateIdentity then polls until it's completed -func (c ClusterClient) CreateIdentityThenPoll(ctx context.Context, id ClusterId) error { - result, err := c.CreateIdentity(ctx, id) - if err != nil { - return fmt.Errorf("performing CreateIdentity: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateIdentity: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_extendsoftwareassurancebenefit.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_extendsoftwareassurancebenefit.go deleted file mode 100644 index 3e2ec35d364..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_extendsoftwareassurancebenefit.go +++ /dev/null @@ -1,75 +0,0 @@ -package cluster - -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 ExtendSoftwareAssuranceBenefitOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// ExtendSoftwareAssuranceBenefit ... -func (c ClusterClient) ExtendSoftwareAssuranceBenefit(ctx context.Context, id ClusterId, input SoftwareAssuranceChangeRequest) (result ExtendSoftwareAssuranceBenefitOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/extendSoftwareAssuranceBenefit", 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 -} - -// ExtendSoftwareAssuranceBenefitThenPoll performs ExtendSoftwareAssuranceBenefit then polls until it's completed -func (c ClusterClient) ExtendSoftwareAssuranceBenefitThenPoll(ctx context.Context, id ClusterId, input SoftwareAssuranceChangeRequest) error { - result, err := c.ExtendSoftwareAssuranceBenefit(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ExtendSoftwareAssuranceBenefit: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExtendSoftwareAssuranceBenefit: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_uploadcertificate.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_uploadcertificate.go deleted file mode 100644 index 7bf2cea2c85..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/method_uploadcertificate.go +++ /dev/null @@ -1,73 +0,0 @@ -package cluster - -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 UploadCertificateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// UploadCertificate ... -func (c ClusterClient) UploadCertificate(ctx context.Context, id ClusterId, input UploadCertificateRequest) (result UploadCertificateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/uploadCertificate", 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 -} - -// UploadCertificateThenPoll performs UploadCertificate then polls until it's completed -func (c ClusterClient) UploadCertificateThenPoll(ctx context.Context, id ClusterId, input UploadCertificateRequest) error { - result, err := c.UploadCertificate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing UploadCertificate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after UploadCertificate: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_cluster.go deleted file mode 100644 index e41f174485b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_cluster.go +++ /dev/null @@ -1,20 +0,0 @@ -package cluster - -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 Cluster struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ClusterProperties `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/azurestackhci/2023-08-01-preview/cluster/model_clusterdesiredproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterdesiredproperties.go deleted file mode 100644 index 7ff21e52a48..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterdesiredproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDesiredProperties struct { - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponse.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponse.go deleted file mode 100644 index 7e64cb4e35a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterIdentityResponse struct { - Properties *ClusterIdentityResponseProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponseproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponseproperties.go deleted file mode 100644 index 1ba7404ca10..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusteridentityresponseproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterIdentityResponseProperties struct { - AadApplicationObjectId *string `json:"aadApplicationObjectId,omitempty"` - AadClientId *string `json:"aadClientId,omitempty"` - AadServicePrincipalObjectId *string `json:"aadServicePrincipalObjectId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusternode.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusternode.go deleted file mode 100644 index ed63418454c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusternode.go +++ /dev/null @@ -1,40 +0,0 @@ -package cluster - -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 ClusterNode struct { - CoreCount *float64 `json:"coreCount,omitempty"` - EhcResourceId *string `json:"ehcResourceId,omitempty"` - Id *float64 `json:"id,omitempty"` - LastLicensingTimestamp *string `json:"lastLicensingTimestamp,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - MemoryInGiB *float64 `json:"memoryInGiB,omitempty"` - Model *string `json:"model,omitempty"` - Name *string `json:"name,omitempty"` - NodeType *ClusterNodeType `json:"nodeType,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - OsDisplayVersion *string `json:"osDisplayVersion,omitempty"` - OsName *string `json:"osName,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} - -func (o *ClusterNode) GetLastLicensingTimestampAsTime() (*time.Time, error) { - if o.LastLicensingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastLicensingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterNode) SetLastLicensingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastLicensingTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterproperties.go deleted file mode 100644 index bf4887b14dd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterproperties.go +++ /dev/null @@ -1,69 +0,0 @@ -package cluster - -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 ClusterProperties struct { - AadApplicationObjectId *string `json:"aadApplicationObjectId,omitempty"` - AadClientId *string `json:"aadClientId,omitempty"` - AadServicePrincipalObjectId *string `json:"aadServicePrincipalObjectId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` - BillingModel *string `json:"billingModel,omitempty"` - CloudId *string `json:"cloudId,omitempty"` - CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` - ConnectivityStatus *ConnectivityStatus `json:"connectivityStatus,omitempty"` - DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` - IsolatedVMAttestationConfiguration *IsolatedVMAttestationConfiguration `json:"isolatedVmAttestationConfiguration,omitempty"` - LastBillingTimestamp *string `json:"lastBillingTimestamp,omitempty"` - LastSyncTimestamp *string `json:"lastSyncTimestamp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RegistrationTimestamp *string `json:"registrationTimestamp,omitempty"` - ReportedProperties *ClusterReportedProperties `json:"reportedProperties,omitempty"` - ResourceProviderObjectId *string `json:"resourceProviderObjectId,omitempty"` - ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` - SoftwareAssuranceProperties *SoftwareAssuranceProperties `json:"softwareAssuranceProperties,omitempty"` - Status *Status `json:"status,omitempty"` - TrialDaysRemaining *float64 `json:"trialDaysRemaining,omitempty"` -} - -func (o *ClusterProperties) GetLastBillingTimestampAsTime() (*time.Time, error) { - if o.LastBillingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastBillingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastBillingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastBillingTimestamp = &formatted -} - -func (o *ClusterProperties) GetLastSyncTimestampAsTime() (*time.Time, error) { - if o.LastSyncTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastSyncTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastSyncTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastSyncTimestamp = &formatted -} - -func (o *ClusterProperties) GetRegistrationTimestampAsTime() (*time.Time, error) { - if o.RegistrationTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.RegistrationTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetRegistrationTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.RegistrationTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterreportedproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterreportedproperties.go deleted file mode 100644 index bf51621f6ad..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_clusterreportedproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package cluster - -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 ClusterReportedProperties struct { - ClusterId *string `json:"clusterId,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterType *ClusterNodeType `json:"clusterType,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - ImdsAttestation *ImdsAttestation `json:"imdsAttestation,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - Nodes *[]ClusterNode `json:"nodes,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - SupportedCapabilities *[]string `json:"supportedCapabilities,omitempty"` -} - -func (o *ClusterReportedProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterReportedProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_isolatedvmattestationconfiguration.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_isolatedvmattestationconfiguration.go deleted file mode 100644 index 878a67cd16c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_isolatedvmattestationconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IsolatedVMAttestationConfiguration struct { - AttestationResourceId *string `json:"attestationResourceId,omitempty"` - AttestationServiceEndpoint *string `json:"attestationServiceEndpoint,omitempty"` - RelyingPartyServiceEndpoint *string `json:"relyingPartyServiceEndpoint,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_rawcertificatedata.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_rawcertificatedata.go deleted file mode 100644 index d2a4c0aa21f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_rawcertificatedata.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RawCertificateData struct { - Certificates *[]string `json:"certificates,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequest.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequest.go deleted file mode 100644 index 61ed38159fe..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftwareAssuranceChangeRequest struct { - Properties *SoftwareAssuranceChangeRequestProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequestproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequestproperties.go deleted file mode 100644 index b7dd0dcb80c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassurancechangerequestproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftwareAssuranceChangeRequestProperties struct { - SoftwareAssuranceIntent *SoftwareAssuranceIntent `json:"softwareAssuranceIntent,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassuranceproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassuranceproperties.go deleted file mode 100644 index 671a0e62dee..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_softwareassuranceproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package cluster - -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 SoftwareAssuranceProperties struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - SoftwareAssuranceIntent *SoftwareAssuranceIntent `json:"softwareAssuranceIntent,omitempty"` - SoftwareAssuranceStatus *SoftwareAssuranceStatus `json:"softwareAssuranceStatus,omitempty"` -} - -func (o *SoftwareAssuranceProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SoftwareAssuranceProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_uploadcertificaterequest.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_uploadcertificaterequest.go deleted file mode 100644 index fc979a96d24..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/model_uploadcertificaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UploadCertificateRequest struct { - Properties *RawCertificateData `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/cluster/version.go b/resource-manager/azurestackhci/2023-08-01-preview/cluster/version.go deleted file mode 100644 index 3e343252347..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/cluster/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package cluster - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/cluster/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/README.md b/resource-manager/azurestackhci/2023-08-01-preview/clusters/README.md deleted file mode 100644 index fced02ee849..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/clusters` Documentation - -The `clusters` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/clusters" -``` - - -### Client Initialization - -```go -client := clusters.NewClustersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ClustersClient.Create` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.Cluster{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ClustersClient.Delete` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.Get` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -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: `ClustersClient.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: `ClustersClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ClustersClient.Update` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ClusterPatch{ - // ... -} - - -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/azurestackhci/2023-08-01-preview/clusters/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/constants.go deleted file mode 100644 index 134cb526978..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/constants.go +++ /dev/null @@ -1,510 +0,0 @@ -package clusters - -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 ClusterNodeType string - -const ( - ClusterNodeTypeFirstParty ClusterNodeType = "FirstParty" - ClusterNodeTypeThirdParty ClusterNodeType = "ThirdParty" -) - -func PossibleValuesForClusterNodeType() []string { - return []string{ - string(ClusterNodeTypeFirstParty), - string(ClusterNodeTypeThirdParty), - } -} - -func (s *ClusterNodeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseClusterNodeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseClusterNodeType(input string) (*ClusterNodeType, error) { - vals := map[string]ClusterNodeType{ - "firstparty": ClusterNodeTypeFirstParty, - "thirdparty": ClusterNodeTypeThirdParty, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ClusterNodeType(input) - return &out, nil -} - -type ConnectivityStatus string - -const ( - ConnectivityStatusConnected ConnectivityStatus = "Connected" - ConnectivityStatusDisconnected ConnectivityStatus = "Disconnected" - ConnectivityStatusNotConnectedRecently ConnectivityStatus = "NotConnectedRecently" - ConnectivityStatusNotSpecified ConnectivityStatus = "NotSpecified" - ConnectivityStatusNotYetRegistered ConnectivityStatus = "NotYetRegistered" - ConnectivityStatusPartiallyConnected ConnectivityStatus = "PartiallyConnected" -) - -func PossibleValuesForConnectivityStatus() []string { - return []string{ - string(ConnectivityStatusConnected), - string(ConnectivityStatusDisconnected), - string(ConnectivityStatusNotConnectedRecently), - string(ConnectivityStatusNotSpecified), - string(ConnectivityStatusNotYetRegistered), - string(ConnectivityStatusPartiallyConnected), - } -} - -func (s *ConnectivityStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityStatus(input string) (*ConnectivityStatus, error) { - vals := map[string]ConnectivityStatus{ - "connected": ConnectivityStatusConnected, - "disconnected": ConnectivityStatusDisconnected, - "notconnectedrecently": ConnectivityStatusNotConnectedRecently, - "notspecified": ConnectivityStatusNotSpecified, - "notyetregistered": ConnectivityStatusNotYetRegistered, - "partiallyconnected": ConnectivityStatusPartiallyConnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityStatus(input) - return &out, nil -} - -type DiagnosticLevel string - -const ( - DiagnosticLevelBasic DiagnosticLevel = "Basic" - DiagnosticLevelEnhanced DiagnosticLevel = "Enhanced" - DiagnosticLevelOff DiagnosticLevel = "Off" -) - -func PossibleValuesForDiagnosticLevel() []string { - return []string{ - string(DiagnosticLevelBasic), - string(DiagnosticLevelEnhanced), - string(DiagnosticLevelOff), - } -} - -func (s *DiagnosticLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiagnosticLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiagnosticLevel(input string) (*DiagnosticLevel, error) { - vals := map[string]DiagnosticLevel{ - "basic": DiagnosticLevelBasic, - "enhanced": DiagnosticLevelEnhanced, - "off": DiagnosticLevelOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiagnosticLevel(input) - return &out, nil -} - -type ImdsAttestation string - -const ( - ImdsAttestationDisabled ImdsAttestation = "Disabled" - ImdsAttestationEnabled ImdsAttestation = "Enabled" -) - -func PossibleValuesForImdsAttestation() []string { - return []string{ - string(ImdsAttestationDisabled), - string(ImdsAttestationEnabled), - } -} - -func (s *ImdsAttestation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImdsAttestation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImdsAttestation(input string) (*ImdsAttestation, error) { - vals := map[string]ImdsAttestation{ - "disabled": ImdsAttestationDisabled, - "enabled": ImdsAttestationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImdsAttestation(input) - return &out, nil -} - -type OemActivation string - -const ( - OemActivationDisabled OemActivation = "Disabled" - OemActivationEnabled OemActivation = "Enabled" -) - -func PossibleValuesForOemActivation() []string { - return []string{ - string(OemActivationDisabled), - string(OemActivationEnabled), - } -} - -func (s *OemActivation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOemActivation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOemActivation(input string) (*OemActivation, error) { - vals := map[string]OemActivation{ - "disabled": OemActivationDisabled, - "enabled": OemActivationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OemActivation(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisableInProgress), - string(ProvisioningStateDisconnected), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disableinprogress": ProvisioningStateDisableInProgress, - "disconnected": ProvisioningStateDisconnected, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SoftwareAssuranceIntent string - -const ( - SoftwareAssuranceIntentDisable SoftwareAssuranceIntent = "Disable" - SoftwareAssuranceIntentEnable SoftwareAssuranceIntent = "Enable" -) - -func PossibleValuesForSoftwareAssuranceIntent() []string { - return []string{ - string(SoftwareAssuranceIntentDisable), - string(SoftwareAssuranceIntentEnable), - } -} - -func (s *SoftwareAssuranceIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceIntent(input string) (*SoftwareAssuranceIntent, error) { - vals := map[string]SoftwareAssuranceIntent{ - "disable": SoftwareAssuranceIntentDisable, - "enable": SoftwareAssuranceIntentEnable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceIntent(input) - return &out, nil -} - -type SoftwareAssuranceStatus string - -const ( - SoftwareAssuranceStatusDisabled SoftwareAssuranceStatus = "Disabled" - SoftwareAssuranceStatusEnabled SoftwareAssuranceStatus = "Enabled" -) - -func PossibleValuesForSoftwareAssuranceStatus() []string { - return []string{ - string(SoftwareAssuranceStatusDisabled), - string(SoftwareAssuranceStatusEnabled), - } -} - -func (s *SoftwareAssuranceStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceStatus(input string) (*SoftwareAssuranceStatus, error) { - vals := map[string]SoftwareAssuranceStatus{ - "disabled": SoftwareAssuranceStatusDisabled, - "enabled": SoftwareAssuranceStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceStatus(input) - return &out, nil -} - -type Status string - -const ( - StatusConnectedRecently Status = "ConnectedRecently" - StatusDeploymentFailed Status = "DeploymentFailed" - StatusDeploymentInProgress Status = "DeploymentInProgress" - StatusDeploymentSuccess Status = "DeploymentSuccess" - StatusDisconnected Status = "Disconnected" - StatusError Status = "Error" - StatusNotConnectedRecently Status = "NotConnectedRecently" - StatusNotSpecified Status = "NotSpecified" - StatusNotYetRegistered Status = "NotYetRegistered" - StatusValidationFailed Status = "ValidationFailed" - StatusValidationInProgress Status = "ValidationInProgress" - StatusValidationSuccess Status = "ValidationSuccess" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusConnectedRecently), - string(StatusDeploymentFailed), - string(StatusDeploymentInProgress), - string(StatusDeploymentSuccess), - string(StatusDisconnected), - string(StatusError), - string(StatusNotConnectedRecently), - string(StatusNotSpecified), - string(StatusNotYetRegistered), - string(StatusValidationFailed), - string(StatusValidationInProgress), - string(StatusValidationSuccess), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "connectedrecently": StatusConnectedRecently, - "deploymentfailed": StatusDeploymentFailed, - "deploymentinprogress": StatusDeploymentInProgress, - "deploymentsuccess": StatusDeploymentSuccess, - "disconnected": StatusDisconnected, - "error": StatusError, - "notconnectedrecently": StatusNotConnectedRecently, - "notspecified": StatusNotSpecified, - "notyetregistered": StatusNotYetRegistered, - "validationfailed": StatusValidationFailed, - "validationinprogress": StatusValidationInProgress, - "validationsuccess": StatusValidationSuccess, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type WindowsServerSubscription string - -const ( - WindowsServerSubscriptionDisabled WindowsServerSubscription = "Disabled" - WindowsServerSubscriptionEnabled WindowsServerSubscription = "Enabled" -) - -func PossibleValuesForWindowsServerSubscription() []string { - return []string{ - string(WindowsServerSubscriptionDisabled), - string(WindowsServerSubscriptionEnabled), - } -} - -func (s *WindowsServerSubscription) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWindowsServerSubscription(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWindowsServerSubscription(input string) (*WindowsServerSubscription, error) { - vals := map[string]WindowsServerSubscription{ - "disabled": WindowsServerSubscriptionDisabled, - "enabled": WindowsServerSubscriptionEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WindowsServerSubscription(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster.go deleted file mode 100644 index a930aa56ef5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package clusters - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster_test.go deleted file mode 100644 index 94a9e1ae438..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package clusters - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/clusters/method_create.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_create.go deleted file mode 100644 index 337ea36a215..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package clusters - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// Create ... -func (c ClustersClient) Create(ctx context.Context, id ClusterId, input Cluster) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_delete.go deleted file mode 100644 index 13e2610ffd6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package clusters - -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 ClustersClient) Delete(ctx context.Context, id ClusterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ClustersClient) DeleteThenPoll(ctx context.Context, id ClusterId) 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/azurestackhci/2023-08-01-preview/clusters/method_listbyresourcegroup.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_listbyresourcegroup.go deleted file mode 100644 index ad6828ab30c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusters - -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 *[]Cluster -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Cluster -} - -// ListByResourceGroup ... -func (c ClustersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/clusters", 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 *[]Cluster `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 ClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ClusterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Cluster, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01-preview/clusters/method_listbysubscription.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_listbysubscription.go deleted file mode 100644 index 6c551f757cc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusters - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Cluster -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []Cluster -} - -// ListBySubscription ... -func (c ClustersClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/clusters", 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 *[]Cluster `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c ClustersClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClustersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ClusterOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]Cluster, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_update.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_update.go deleted file mode 100644 index 80edce4b64f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package clusters - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// Update ... -func (c ClustersClient) Update(ctx context.Context, id ClusterId, input ClusterPatch) (result UpdateOperationResponse, 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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_cluster.go deleted file mode 100644 index d5b851dff01..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_cluster.go +++ /dev/null @@ -1,20 +0,0 @@ -package clusters - -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 Cluster struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ClusterProperties `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/azurestackhci/2023-08-01-preview/clusters/model_clusterdesiredproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterdesiredproperties.go deleted file mode 100644 index 3572f7c6d22..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterdesiredproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDesiredProperties struct { - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusternode.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusternode.go deleted file mode 100644 index ecd9442123c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusternode.go +++ /dev/null @@ -1,40 +0,0 @@ -package clusters - -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 ClusterNode struct { - CoreCount *float64 `json:"coreCount,omitempty"` - EhcResourceId *string `json:"ehcResourceId,omitempty"` - Id *float64 `json:"id,omitempty"` - LastLicensingTimestamp *string `json:"lastLicensingTimestamp,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - MemoryInGiB *float64 `json:"memoryInGiB,omitempty"` - Model *string `json:"model,omitempty"` - Name *string `json:"name,omitempty"` - NodeType *ClusterNodeType `json:"nodeType,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - OsDisplayVersion *string `json:"osDisplayVersion,omitempty"` - OsName *string `json:"osName,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} - -func (o *ClusterNode) GetLastLicensingTimestampAsTime() (*time.Time, error) { - if o.LastLicensingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastLicensingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterNode) SetLastLicensingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastLicensingTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatch.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatch.go deleted file mode 100644 index 5f0c8dc17eb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatch.go +++ /dev/null @@ -1,14 +0,0 @@ -package clusters - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterPatch struct { - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Properties *ClusterPatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatchproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatchproperties.go deleted file mode 100644 index 04c86c75b34..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterpatchproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterPatchProperties struct { - AadClientId *string `json:"aadClientId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` - CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` - DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterproperties.go deleted file mode 100644 index 5f058ff9f5c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterproperties.go +++ /dev/null @@ -1,69 +0,0 @@ -package clusters - -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 ClusterProperties struct { - AadApplicationObjectId *string `json:"aadApplicationObjectId,omitempty"` - AadClientId *string `json:"aadClientId,omitempty"` - AadServicePrincipalObjectId *string `json:"aadServicePrincipalObjectId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` - BillingModel *string `json:"billingModel,omitempty"` - CloudId *string `json:"cloudId,omitempty"` - CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` - ConnectivityStatus *ConnectivityStatus `json:"connectivityStatus,omitempty"` - DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` - IsolatedVMAttestationConfiguration *IsolatedVMAttestationConfiguration `json:"isolatedVmAttestationConfiguration,omitempty"` - LastBillingTimestamp *string `json:"lastBillingTimestamp,omitempty"` - LastSyncTimestamp *string `json:"lastSyncTimestamp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RegistrationTimestamp *string `json:"registrationTimestamp,omitempty"` - ReportedProperties *ClusterReportedProperties `json:"reportedProperties,omitempty"` - ResourceProviderObjectId *string `json:"resourceProviderObjectId,omitempty"` - ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` - SoftwareAssuranceProperties *SoftwareAssuranceProperties `json:"softwareAssuranceProperties,omitempty"` - Status *Status `json:"status,omitempty"` - TrialDaysRemaining *float64 `json:"trialDaysRemaining,omitempty"` -} - -func (o *ClusterProperties) GetLastBillingTimestampAsTime() (*time.Time, error) { - if o.LastBillingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastBillingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastBillingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastBillingTimestamp = &formatted -} - -func (o *ClusterProperties) GetLastSyncTimestampAsTime() (*time.Time, error) { - if o.LastSyncTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastSyncTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastSyncTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastSyncTimestamp = &formatted -} - -func (o *ClusterProperties) GetRegistrationTimestampAsTime() (*time.Time, error) { - if o.RegistrationTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.RegistrationTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetRegistrationTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.RegistrationTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterreportedproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterreportedproperties.go deleted file mode 100644 index 732f0efd40a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_clusterreportedproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package clusters - -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 ClusterReportedProperties struct { - ClusterId *string `json:"clusterId,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterType *ClusterNodeType `json:"clusterType,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - ImdsAttestation *ImdsAttestation `json:"imdsAttestation,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - Nodes *[]ClusterNode `json:"nodes,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - SupportedCapabilities *[]string `json:"supportedCapabilities,omitempty"` -} - -func (o *ClusterReportedProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterReportedProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_isolatedvmattestationconfiguration.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_isolatedvmattestationconfiguration.go deleted file mode 100644 index e6fb467b2dc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_isolatedvmattestationconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IsolatedVMAttestationConfiguration struct { - AttestationResourceId *string `json:"attestationResourceId,omitempty"` - AttestationServiceEndpoint *string `json:"attestationServiceEndpoint,omitempty"` - RelyingPartyServiceEndpoint *string `json:"relyingPartyServiceEndpoint,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_softwareassuranceproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_softwareassuranceproperties.go deleted file mode 100644 index 5d2953809b5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/model_softwareassuranceproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package clusters - -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 SoftwareAssuranceProperties struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - SoftwareAssuranceIntent *SoftwareAssuranceIntent `json:"softwareAssuranceIntent,omitempty"` - SoftwareAssuranceStatus *SoftwareAssuranceStatus `json:"softwareAssuranceStatus,omitempty"` -} - -func (o *SoftwareAssuranceProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SoftwareAssuranceProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/clusters/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/predicates.go deleted file mode 100644 index cc13b7c6220..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ClusterOperationPredicate) Matches(input Cluster) 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/azurestackhci/2023-08-01-preview/clusters/version.go b/resource-manager/azurestackhci/2023-08-01-preview/clusters/version.go deleted file mode 100644 index 7813dcbbff9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/clusters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/clusters/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/README.md b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/README.md deleted file mode 100644 index ea04727bcc8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings` Documentation - -The `deploymentsettings` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/deploymentsettings" -``` - - -### Client Initialization - -```go -client := deploymentsettings.NewDeploymentSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DeploymentSettingsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "deploymentSettingValue") - -payload := deploymentsettings.DeploymentSetting{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DeploymentSettingsClient.Delete` - -```go -ctx := context.TODO() -id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "deploymentSettingValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DeploymentSettingsClient.Get` - -```go -ctx := context.TODO() -id := deploymentsettings.NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "deploymentSettingValue") - -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: `DeploymentSettingsClient.ListByClusters` - -```go -ctx := context.TODO() -id := deploymentsettings.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByClusters(ctx, id)` can be used to do batched pagination -items, err := client.ListByClustersComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/client.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/client.go deleted file mode 100644 index 2d772172804..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package deploymentsettings - -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 DeploymentSettingsClient struct { - Client *resourcemanager.Client -} - -func NewDeploymentSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*DeploymentSettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "deploymentsettings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DeploymentSettingsClient: %+v", err) - } - - return &DeploymentSettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/constants.go deleted file mode 100644 index a572b56aa22..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/constants.go +++ /dev/null @@ -1,110 +0,0 @@ -package deploymentsettings - -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 DeploymentMode string - -const ( - DeploymentModeDeploy DeploymentMode = "Deploy" - DeploymentModeValidate DeploymentMode = "Validate" -) - -func PossibleValuesForDeploymentMode() []string { - return []string{ - string(DeploymentModeDeploy), - string(DeploymentModeValidate), - } -} - -func (s *DeploymentMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeploymentMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeploymentMode(input string) (*DeploymentMode, error) { - vals := map[string]DeploymentMode{ - "deploy": DeploymentModeDeploy, - "validate": DeploymentModeValidate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeploymentMode(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateNotSpecified), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "notspecified": ProvisioningStateNotSpecified, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster.go deleted file mode 100644 index f580320c6be..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package deploymentsettings - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster_test.go deleted file mode 100644 index 8fff3ee0215..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package deploymentsettings - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting.go deleted file mode 100644 index bc33385e35a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting.go +++ /dev/null @@ -1,139 +0,0 @@ -package deploymentsettings - -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(&DeploymentSettingId{}) -} - -var _ resourceids.ResourceId = &DeploymentSettingId{} - -// DeploymentSettingId is a struct representing the Resource ID for a Deployment Setting -type DeploymentSettingId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - DeploymentSettingName string -} - -// NewDeploymentSettingID returns a new DeploymentSettingId struct -func NewDeploymentSettingID(subscriptionId string, resourceGroupName string, clusterName string, deploymentSettingName string) DeploymentSettingId { - return DeploymentSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - DeploymentSettingName: deploymentSettingName, - } -} - -// ParseDeploymentSettingID parses 'input' into a DeploymentSettingId -func ParseDeploymentSettingID(input string) (*DeploymentSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&DeploymentSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DeploymentSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDeploymentSettingIDInsensitively parses 'input' case-insensitively into a DeploymentSettingId -// note: this method should only be used for API response data and not user input -func ParseDeploymentSettingIDInsensitively(input string) (*DeploymentSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&DeploymentSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DeploymentSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DeploymentSettingId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.DeploymentSettingName, ok = input.Parsed["deploymentSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "deploymentSettingName", input) - } - - return nil -} - -// ValidateDeploymentSettingID checks that 'input' can be parsed as a Deployment Setting ID -func ValidateDeploymentSettingID(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 := ParseDeploymentSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Deployment Setting ID -func (id DeploymentSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/deploymentSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.DeploymentSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Deployment Setting ID -func (id DeploymentSettingId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticDeploymentSettings", "deploymentSettings", "deploymentSettings"), - resourceids.UserSpecifiedSegment("deploymentSettingName", "deploymentSettingValue"), - } -} - -// String returns a human-readable description of this Deployment Setting ID -func (id DeploymentSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Deployment Setting Name: %q", id.DeploymentSettingName), - } - return fmt.Sprintf("Deployment Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting_test.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting_test.go deleted file mode 100644 index 1901472bcd4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/id_deploymentsetting_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package deploymentsettings - -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 = &DeploymentSettingId{} - -func TestNewDeploymentSettingID(t *testing.T) { - id := NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "deploymentSettingValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.DeploymentSettingName != "deploymentSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'DeploymentSettingName'", id.DeploymentSettingName, "deploymentSettingValue") - } -} - -func TestFormatDeploymentSettingID(t *testing.T) { - actual := NewDeploymentSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "deploymentSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings/deploymentSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDeploymentSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DeploymentSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings/deploymentSettingValue", - Expected: &DeploymentSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - DeploymentSettingName: "deploymentSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings/deploymentSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDeploymentSettingID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.DeploymentSettingName != v.Expected.DeploymentSettingName { - t.Fatalf("Expected %q but got %q for DeploymentSettingName", v.Expected.DeploymentSettingName, actual.DeploymentSettingName) - } - - } -} - -func TestParseDeploymentSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DeploymentSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/dEpLoYmEnTsEtTiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings/deploymentSettingValue", - Expected: &DeploymentSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - DeploymentSettingName: "deploymentSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/deploymentSettings/deploymentSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/dEpLoYmEnTsEtTiNgS/dEpLoYmEnTsEtTiNgVaLuE", - Expected: &DeploymentSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - DeploymentSettingName: "dEpLoYmEnTsEtTiNgVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/dEpLoYmEnTsEtTiNgS/dEpLoYmEnTsEtTiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDeploymentSettingIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.DeploymentSettingName != v.Expected.DeploymentSettingName { - t.Fatalf("Expected %q but got %q for DeploymentSettingName", v.Expected.DeploymentSettingName, actual.DeploymentSettingName) - } - - } -} - -func TestSegmentsForDeploymentSettingId(t *testing.T) { - segments := DeploymentSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DeploymentSettingId 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/azurestackhci/2023-08-01-preview/deploymentsettings/method_createorupdate.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_createorupdate.go deleted file mode 100644 index 1338dda3db5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package deploymentsettings - -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 *DeploymentSetting -} - -// CreateOrUpdate ... -func (c DeploymentSettingsClient) CreateOrUpdate(ctx context.Context, id DeploymentSettingId, input DeploymentSetting) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DeploymentSettingsClient) CreateOrUpdateThenPoll(ctx context.Context, id DeploymentSettingId, input DeploymentSetting) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-08-01-preview/deploymentsettings/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_delete.go deleted file mode 100644 index 89e29cd7e90..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package deploymentsettings - -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 DeploymentSettingsClient) Delete(ctx context.Context, id DeploymentSettingId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c DeploymentSettingsClient) DeleteThenPoll(ctx context.Context, id DeploymentSettingId) 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/azurestackhci/2023-08-01-preview/deploymentsettings/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_get.go deleted file mode 100644 index c87af231c1b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package deploymentsettings - -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 *DeploymentSetting -} - -// Get ... -func (c DeploymentSettingsClient) Get(ctx context.Context, id DeploymentSettingId) (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 DeploymentSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_listbyclusters.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_listbyclusters.go deleted file mode 100644 index 124423cbf9a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/method_listbyclusters.go +++ /dev/null @@ -1,91 +0,0 @@ -package deploymentsettings - -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 ListByClustersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DeploymentSetting -} - -type ListByClustersCompleteResult struct { - LatestHttpResponse *http.Response - Items []DeploymentSetting -} - -// ListByClusters ... -func (c DeploymentSettingsClient) ListByClusters(ctx context.Context, id ClusterId) (result ListByClustersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/deploymentSettings", 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 *[]DeploymentSetting `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClustersComplete retrieves all the results into a single object -func (c DeploymentSettingsClient) ListByClustersComplete(ctx context.Context, id ClusterId) (ListByClustersCompleteResult, error) { - return c.ListByClustersCompleteMatchingPredicate(ctx, id, DeploymentSettingOperationPredicate{}) -} - -// ListByClustersCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DeploymentSettingsClient) ListByClustersCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate DeploymentSettingOperationPredicate) (result ListByClustersCompleteResult, err error) { - items := make([]DeploymentSetting, 0) - - resp, err := c.ListByClusters(ctx, id) - if err != nil { - 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 = ListByClustersCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_adapterpropertyoverrides.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_adapterpropertyoverrides.go deleted file mode 100644 index 57b6e9dc686..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_adapterpropertyoverrides.go +++ /dev/null @@ -1,10 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdapterPropertyOverrides struct { - JumboPacket *string `json:"jumboPacket,omitempty"` - NetworkDirect *string `json:"networkDirect,omitempty"` - NetworkDirectTechnology *string `json:"networkDirectTechnology,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_cluster.go deleted file mode 100644 index 19ca2741a93..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_cluster.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Cluster struct { - AzureServiceEndpoint *string `json:"azureServiceEndpoint,omitempty"` - CloudAccountName *string `json:"cloudAccountName,omitempty"` - Name *string `json:"name,omitempty"` - WitnessPath *string `json:"witnessPath,omitempty"` - WitnessType *string `json:"witnessType,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentconfiguration.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentconfiguration.go deleted file mode 100644 index 2725ef47249..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeploymentConfiguration struct { - ScaleUnits []ScaleUnits `json:"scaleUnits"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentdata.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentdata.go deleted file mode 100644 index fa9cc4addd2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentdata.go +++ /dev/null @@ -1,19 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeploymentData struct { - AdouPath *string `json:"adouPath,omitempty"` - Cluster *Cluster `json:"cluster,omitempty"` - DomainFqdn *string `json:"domainFqdn,omitempty"` - HostNetwork *HostNetwork `json:"hostNetwork,omitempty"` - InfrastructureNetwork *[]InfrastructureNetwork `json:"infrastructureNetwork,omitempty"` - NamingPrefix *string `json:"namingPrefix,omitempty"` - Observability *Observability `json:"observability,omitempty"` - OptionalServices *OptionalServices `json:"optionalServices,omitempty"` - PhysicalNodes *[]PhysicalNodes `json:"physicalNodes,omitempty"` - SecretsLocation *string `json:"secretsLocation,omitempty"` - SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"` - Storage *Storage `json:"storage,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsetting.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsetting.go deleted file mode 100644 index 9f687fa2dfd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsetting.go +++ /dev/null @@ -1,16 +0,0 @@ -package deploymentsettings - -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 DeploymentSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DeploymentSettingsProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsettingsproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsettingsproperties.go deleted file mode 100644 index cd74013705d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentsettingsproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeploymentSettingsProperties struct { - ArcNodeResourceIds []string `json:"arcNodeResourceIds"` - DeploymentConfiguration DeploymentConfiguration `json:"deploymentConfiguration"` - DeploymentMode DeploymentMode `json:"deploymentMode"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ReportedProperties *ReportedProperties `json:"reportedProperties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentstatus.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentstatus.go deleted file mode 100644 index 5a043950d68..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_deploymentstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeploymentStatus struct { - Status *string `json:"status,omitempty"` - Steps *[]Step `json:"steps,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_hostnetwork.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_hostnetwork.go deleted file mode 100644 index 8bd87a42076..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_hostnetwork.go +++ /dev/null @@ -1,11 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostNetwork struct { - EnableStorageAutoIP *bool `json:"enableStorageAutoIp,omitempty"` - Intents *[]Intents `json:"intents,omitempty"` - StorageConnectivitySwitchless *bool `json:"storageConnectivitySwitchless,omitempty"` - StorageNetworks *[]StorageNetworks `json:"storageNetworks,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_infrastructurenetwork.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_infrastructurenetwork.go deleted file mode 100644 index b19bbf287a4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_infrastructurenetwork.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InfrastructureNetwork struct { - DnsServers *[]string `json:"dnsServers,omitempty"` - Gateway *string `json:"gateway,omitempty"` - IPPools *[]IPPools `json:"ipPools,omitempty"` - SubnetMask *string `json:"subnetMask,omitempty"` - UseDhcp *bool `json:"useDhcp,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_intents.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_intents.go deleted file mode 100644 index 6e43eb8be88..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_intents.go +++ /dev/null @@ -1,16 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Intents struct { - Adapter *[]string `json:"adapter,omitempty"` - AdapterPropertyOverrides *AdapterPropertyOverrides `json:"adapterPropertyOverrides,omitempty"` - Name *string `json:"name,omitempty"` - OverrideAdapterProperty *bool `json:"overrideAdapterProperty,omitempty"` - OverrideQosPolicy *bool `json:"overrideQosPolicy,omitempty"` - OverrideVirtualSwitchConfiguration *bool `json:"overrideVirtualSwitchConfiguration,omitempty"` - QosPolicyOverrides *QosPolicyOverrides `json:"qosPolicyOverrides,omitempty"` - TrafficType *[]string `json:"trafficType,omitempty"` - VirtualSwitchConfigurationOverrides *VirtualSwitchConfigurationOverrides `json:"virtualSwitchConfigurationOverrides,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_ippools.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_ippools.go deleted file mode 100644 index 9b95a1dce7b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_ippools.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPPools struct { - EndingAddress *string `json:"endingAddress,omitempty"` - StartingAddress *string `json:"startingAddress,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_observability.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_observability.go deleted file mode 100644 index 350c5bb85fd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_observability.go +++ /dev/null @@ -1,10 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Observability struct { - EpisodicDataUpload *bool `json:"episodicDataUpload,omitempty"` - EuLocation *bool `json:"euLocation,omitempty"` - StreamingDataClient *bool `json:"streamingDataClient,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_optionalservices.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_optionalservices.go deleted file mode 100644 index 9176350170c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_optionalservices.go +++ /dev/null @@ -1,8 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OptionalServices struct { - CustomLocation *string `json:"customLocation,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_physicalnodes.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_physicalnodes.go deleted file mode 100644 index 75473c3a914..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_physicalnodes.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PhysicalNodes struct { - IPv4Address *string `json:"ipv4Address,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_qospolicyoverrides.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_qospolicyoverrides.go deleted file mode 100644 index c523de45ee6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_qospolicyoverrides.go +++ /dev/null @@ -1,10 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosPolicyOverrides struct { - BandwidthPercentageSMB *string `json:"bandwidthPercentage_SMB,omitempty"` - PriorityValue8021ActionCluster *string `json:"priorityValue8021Action_Cluster,omitempty"` - PriorityValue8021ActionSMB *string `json:"priorityValue8021Action_SMB,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_reportedproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_reportedproperties.go deleted file mode 100644 index 959d1a3c5d2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_reportedproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReportedProperties struct { - DeploymentStatus *DeploymentStatus `json:"deploymentStatus,omitempty"` - ValidationStatus *ValidationStatus `json:"validationStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_scaleunits.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_scaleunits.go deleted file mode 100644 index 196b7cfe805..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_scaleunits.go +++ /dev/null @@ -1,8 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScaleUnits struct { - DeploymentData DeploymentData `json:"deploymentData"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_securitysettings.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_securitysettings.go deleted file mode 100644 index e4927952af6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_securitysettings.go +++ /dev/null @@ -1,17 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecuritySettings struct { - BitlockerBootVolume *bool `json:"bitlockerBootVolume,omitempty"` - BitlockerDataVolumes *bool `json:"bitlockerDataVolumes,omitempty"` - CredentialGuardEnforced *bool `json:"credentialGuardEnforced,omitempty"` - DriftControlEnforced *bool `json:"driftControlEnforced,omitempty"` - DrtmProtection *bool `json:"drtmProtection,omitempty"` - HvciProtection *bool `json:"hvciProtection,omitempty"` - SideChannelMitigationEnforced *bool `json:"sideChannelMitigationEnforced,omitempty"` - SmbClusterEncryption *bool `json:"smbClusterEncryption,omitempty"` - SmbSigningEnforced *bool `json:"smbSigningEnforced,omitempty"` - WdacEnforced *bool `json:"wdacEnforced,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_step.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_step.go deleted file mode 100644 index 25d97dccefe..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_step.go +++ /dev/null @@ -1,15 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Step struct { - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - Exception *[]string `json:"exception,omitempty"` - FullStepIndex *string `json:"fullStepIndex,omitempty"` - Name *string `json:"name,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *string `json:"status,omitempty"` - Steps *[]Step `json:"steps,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storage.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storage.go deleted file mode 100644 index 75bcd02c64f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storage.go +++ /dev/null @@ -1,8 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Storage struct { - ConfigurationMode *string `json:"configurationMode,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storagenetworks.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storagenetworks.go deleted file mode 100644 index 1ac4234d92c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_storagenetworks.go +++ /dev/null @@ -1,10 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageNetworks struct { - Name *string `json:"name,omitempty"` - NetworkAdapterName *string `json:"networkAdapterName,omitempty"` - VlanId *string `json:"vlanId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_validationstatus.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_validationstatus.go deleted file mode 100644 index cf0ea1c6b80..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_validationstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ValidationStatus struct { - Status *string `json:"status,omitempty"` - Steps *[]Step `json:"steps,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_virtualswitchconfigurationoverrides.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_virtualswitchconfigurationoverrides.go deleted file mode 100644 index 11d87905241..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/model_virtualswitchconfigurationoverrides.go +++ /dev/null @@ -1,9 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualSwitchConfigurationOverrides struct { - EnableIov *string `json:"enableIov,omitempty"` - LoadBalancingAlgorithm *string `json:"loadBalancingAlgorithm,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/predicates.go deleted file mode 100644 index 5b37f41b7b5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package deploymentsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeploymentSettingOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p DeploymentSettingOperationPredicate) Matches(input DeploymentSetting) 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/azurestackhci/2023-08-01-preview/deploymentsettings/version.go b/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/version.go deleted file mode 100644 index a2310bb17d2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/deploymentsettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package deploymentsettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/deploymentsettings/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/README.md b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/README.md deleted file mode 100644 index 44beb4189bd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/edgedevices` Documentation - -The `edgedevices` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/edgedevices" -``` - - -### Client Initialization - -```go -client := edgedevices.NewEdgeDevicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EdgeDevicesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := edgedevices.NewScopedEdgeDeviceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "edgeDeviceValue") - -payload := edgedevices.EdgeDevice{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `EdgeDevicesClient.Delete` - -```go -ctx := context.TODO() -id := edgedevices.NewScopedEdgeDeviceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "edgeDeviceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `EdgeDevicesClient.Get` - -```go -ctx := context.TODO() -id := edgedevices.NewScopedEdgeDeviceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "edgeDeviceValue") - -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: `EdgeDevicesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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: `EdgeDevicesClient.Validate` - -```go -ctx := context.TODO() -id := edgedevices.NewScopedEdgeDeviceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "edgeDeviceValue") - -payload := edgedevices.ValidateRequest{ - // ... -} - - -if err := client.ValidateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/client.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/client.go deleted file mode 100644 index 629b201ceec..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package edgedevices - -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 EdgeDevicesClient struct { - Client *resourcemanager.Client -} - -func NewEdgeDevicesClientWithBaseURI(sdkApi sdkEnv.Api) (*EdgeDevicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "edgedevices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EdgeDevicesClient: %+v", err) - } - - return &EdgeDevicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/constants.go deleted file mode 100644 index 0a9012702bd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/constants.go +++ /dev/null @@ -1,69 +0,0 @@ -package edgedevices - -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 ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateNotSpecified), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "notspecified": ProvisioningStateNotSpecified, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice.go deleted file mode 100644 index 9ba7d872398..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice.go +++ /dev/null @@ -1,120 +0,0 @@ -package edgedevices - -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(&ScopedEdgeDeviceId{}) -} - -var _ resourceids.ResourceId = &ScopedEdgeDeviceId{} - -// ScopedEdgeDeviceId is a struct representing the Resource ID for a Scoped Edge Device -type ScopedEdgeDeviceId struct { - ResourceUri string - EdgeDeviceName string -} - -// NewScopedEdgeDeviceID returns a new ScopedEdgeDeviceId struct -func NewScopedEdgeDeviceID(resourceUri string, edgeDeviceName string) ScopedEdgeDeviceId { - return ScopedEdgeDeviceId{ - ResourceUri: resourceUri, - EdgeDeviceName: edgeDeviceName, - } -} - -// ParseScopedEdgeDeviceID parses 'input' into a ScopedEdgeDeviceId -func ParseScopedEdgeDeviceID(input string) (*ScopedEdgeDeviceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedEdgeDeviceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedEdgeDeviceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedEdgeDeviceIDInsensitively parses 'input' case-insensitively into a ScopedEdgeDeviceId -// note: this method should only be used for API response data and not user input -func ParseScopedEdgeDeviceIDInsensitively(input string) (*ScopedEdgeDeviceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedEdgeDeviceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedEdgeDeviceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedEdgeDeviceId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.ResourceUri, ok = input.Parsed["resourceUri"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceUri", input) - } - - if id.EdgeDeviceName, ok = input.Parsed["edgeDeviceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "edgeDeviceName", input) - } - - return nil -} - -// ValidateScopedEdgeDeviceID checks that 'input' can be parsed as a Scoped Edge Device ID -func ValidateScopedEdgeDeviceID(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 := ParseScopedEdgeDeviceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Edge Device ID -func (id ScopedEdgeDeviceId) ID() string { - fmtString := "/%s/providers/Microsoft.AzureStackHCI/edgeDevices/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.ResourceUri, "/"), id.EdgeDeviceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Edge Device ID -func (id ScopedEdgeDeviceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("resourceUri", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticEdgeDevices", "edgeDevices", "edgeDevices"), - resourceids.UserSpecifiedSegment("edgeDeviceName", "edgeDeviceValue"), - } -} - -// String returns a human-readable description of this Scoped Edge Device ID -func (id ScopedEdgeDeviceId) String() string { - components := []string{ - fmt.Sprintf("Resource Uri: %q", id.ResourceUri), - fmt.Sprintf("Edge Device Name: %q", id.EdgeDeviceName), - } - return fmt.Sprintf("Scoped Edge Device (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice_test.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice_test.go deleted file mode 100644 index 92654604c47..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/id_scopededgedevice_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package edgedevices - -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 = &ScopedEdgeDeviceId{} - -func TestNewScopedEdgeDeviceID(t *testing.T) { - id := NewScopedEdgeDeviceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "edgeDeviceValue") - - if id.ResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceUri'", id.ResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.EdgeDeviceName != "edgeDeviceValue" { - t.Fatalf("Expected %q but got %q for Segment 'EdgeDeviceName'", id.EdgeDeviceName, "edgeDeviceValue") - } -} - -func TestFormatScopedEdgeDeviceID(t *testing.T) { - actual := NewScopedEdgeDeviceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "edgeDeviceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices/edgeDeviceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedEdgeDeviceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedEdgeDeviceId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices/edgeDeviceValue", - Expected: &ScopedEdgeDeviceId{ - ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - EdgeDeviceName: "edgeDeviceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices/edgeDeviceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedEdgeDeviceID(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.ResourceUri != v.Expected.ResourceUri { - t.Fatalf("Expected %q but got %q for ResourceUri", v.Expected.ResourceUri, actual.ResourceUri) - } - - if actual.EdgeDeviceName != v.Expected.EdgeDeviceName { - t.Fatalf("Expected %q but got %q for EdgeDeviceName", v.Expected.EdgeDeviceName, actual.EdgeDeviceName) - } - - } -} - -func TestParseScopedEdgeDeviceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedEdgeDeviceId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/eDgEdEvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices/edgeDeviceValue", - Expected: &ScopedEdgeDeviceId{ - ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - EdgeDeviceName: "edgeDeviceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.AzureStackHCI/edgeDevices/edgeDeviceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/eDgEdEvIcEs/eDgEdEvIcEvAlUe", - Expected: &ScopedEdgeDeviceId{ - ResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - EdgeDeviceName: "eDgEdEvIcEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/eDgEdEvIcEs/eDgEdEvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedEdgeDeviceIDInsensitively(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.ResourceUri != v.Expected.ResourceUri { - t.Fatalf("Expected %q but got %q for ResourceUri", v.Expected.ResourceUri, actual.ResourceUri) - } - - if actual.EdgeDeviceName != v.Expected.EdgeDeviceName { - t.Fatalf("Expected %q but got %q for EdgeDeviceName", v.Expected.EdgeDeviceName, actual.EdgeDeviceName) - } - - } -} - -func TestSegmentsForScopedEdgeDeviceId(t *testing.T) { - segments := ScopedEdgeDeviceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedEdgeDeviceId 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/azurestackhci/2023-08-01-preview/edgedevices/method_createorupdate.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_createorupdate.go deleted file mode 100644 index 23058042e19..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package edgedevices - -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 *EdgeDevice -} - -// CreateOrUpdate ... -func (c EdgeDevicesClient) CreateOrUpdate(ctx context.Context, id ScopedEdgeDeviceId, input EdgeDevice) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c EdgeDevicesClient) CreateOrUpdateThenPoll(ctx context.Context, id ScopedEdgeDeviceId, input EdgeDevice) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-08-01-preview/edgedevices/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_delete.go deleted file mode 100644 index 22cea7a6138..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package edgedevices - -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 EdgeDevicesClient) Delete(ctx context.Context, id ScopedEdgeDeviceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 EdgeDevicesClient) DeleteThenPoll(ctx context.Context, id ScopedEdgeDeviceId) 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/azurestackhci/2023-08-01-preview/edgedevices/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_get.go deleted file mode 100644 index b689f330ce3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package edgedevices - -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 *EdgeDevice -} - -// Get ... -func (c EdgeDevicesClient) Get(ctx context.Context, id ScopedEdgeDeviceId) (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 EdgeDevice - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_list.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_list.go deleted file mode 100644 index 8d62a20d743..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package edgedevices - -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 *[]EdgeDevice -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EdgeDevice -} - -// List ... -func (c EdgeDevicesClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/edgeDevices", 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 *[]EdgeDevice `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 EdgeDevicesClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, EdgeDeviceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EdgeDevicesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate EdgeDeviceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]EdgeDevice, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01-preview/edgedevices/method_validate.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_validate.go deleted file mode 100644 index d27edbf6a8e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/method_validate.go +++ /dev/null @@ -1,75 +0,0 @@ -package edgedevices - -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 ValidateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ValidateResponse -} - -// Validate ... -func (c EdgeDevicesClient) Validate(ctx context.Context, id ScopedEdgeDeviceId, input ValidateRequest) (result ValidateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/validate", 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 -} - -// ValidateThenPoll performs Validate then polls until it's completed -func (c EdgeDevicesClient) ValidateThenPoll(ctx context.Context, id ScopedEdgeDeviceId, input ValidateRequest) error { - result, err := c.Validate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Validate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Validate: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_deviceconfiguration.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_deviceconfiguration.go deleted file mode 100644 index c22933f040d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_deviceconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package edgedevices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceConfiguration struct { - DeviceMetadata *string `json:"deviceMetadata,omitempty"` - NicDetails []NicDetail `json:"nicDetails"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedevice.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedevice.go deleted file mode 100644 index 02a3e9f4e27..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedevice.go +++ /dev/null @@ -1,16 +0,0 @@ -package edgedevices - -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 EdgeDevice struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *EdgeDeviceProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedeviceproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedeviceproperties.go deleted file mode 100644 index 09b93829e17..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_edgedeviceproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package edgedevices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EdgeDeviceProperties struct { - DeviceConfiguration DeviceConfiguration `json:"deviceConfiguration"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_nicdetail.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_nicdetail.go deleted file mode 100644 index dfa392749d0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_nicdetail.go +++ /dev/null @@ -1,16 +0,0 @@ -package edgedevices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NicDetail struct { - AdapterName string `json:"adapterName"` - ComponentId *string `json:"componentId,omitempty"` - DefaultGateway *string `json:"defaultGateway,omitempty"` - DefaultIsolationId *string `json:"defaultIsolationId,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - DriverVersion *string `json:"driverVersion,omitempty"` - IP4Address *string `json:"ip4Address,omitempty"` - InterfaceDescription *string `json:"interfaceDescription,omitempty"` - SubnetMask *string `json:"subnetMask,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validaterequest.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validaterequest.go deleted file mode 100644 index 3bbd45293f3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validaterequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package edgedevices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ValidateRequest struct { - AdditionalInfo *string `json:"additionalInfo,omitempty"` - EdgeDeviceIds []string `json:"edgeDeviceIds"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validateresponse.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validateresponse.go deleted file mode 100644 index d9d470839e1..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/model_validateresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package edgedevices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ValidateResponse struct { - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/predicates.go deleted file mode 100644 index 662e3d34a4d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package edgedevices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EdgeDeviceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EdgeDeviceOperationPredicate) Matches(input EdgeDevice) 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/azurestackhci/2023-08-01-preview/edgedevices/version.go b/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/version.go deleted file mode 100644 index 25929b787b1..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/edgedevices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package edgedevices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/edgedevices/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/README.md b/resource-manager/azurestackhci/2023-08-01-preview/extensions/README.md deleted file mode 100644 index b9932aca7f4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/README.md +++ /dev/null @@ -1,116 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/extensions` Documentation - -The `extensions` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/extensions" -``` - - -### Client Initialization - -```go -client := extensions.NewExtensionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExtensionsClient.Create` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -payload := extensions.Extension{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Delete` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Get` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -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: `ExtensionsClient.ListByArcSetting` - -```go -ctx := context.TODO() -id := extensions.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -// alternatively `client.ListByArcSetting(ctx, id)` can be used to do batched pagination -items, err := client.ListByArcSettingComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExtensionsClient.Update` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -payload := extensions.ExtensionPatch{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Upgrade` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -payload := extensions.ExtensionUpgradeParameters{ - // ... -} - - -if err := client.UpgradeThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/client.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/client.go deleted file mode 100644 index 44725ac0e84..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package extensions - -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 ExtensionsClient struct { - Client *resourcemanager.Client -} - -func NewExtensionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExtensionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "extensions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExtensionsClient: %+v", err) - } - - return &ExtensionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/constants.go deleted file mode 100644 index 638dc8a39de..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/constants.go +++ /dev/null @@ -1,356 +0,0 @@ -package extensions - -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 ExtensionAggregateState string - -const ( - ExtensionAggregateStateAccepted ExtensionAggregateState = "Accepted" - ExtensionAggregateStateCanceled ExtensionAggregateState = "Canceled" - ExtensionAggregateStateConnected ExtensionAggregateState = "Connected" - ExtensionAggregateStateCreating ExtensionAggregateState = "Creating" - ExtensionAggregateStateDeleted ExtensionAggregateState = "Deleted" - ExtensionAggregateStateDeleting ExtensionAggregateState = "Deleting" - ExtensionAggregateStateDisconnected ExtensionAggregateState = "Disconnected" - ExtensionAggregateStateError ExtensionAggregateState = "Error" - ExtensionAggregateStateFailed ExtensionAggregateState = "Failed" - ExtensionAggregateStateInProgress ExtensionAggregateState = "InProgress" - ExtensionAggregateStateMoving ExtensionAggregateState = "Moving" - ExtensionAggregateStateNotSpecified ExtensionAggregateState = "NotSpecified" - ExtensionAggregateStatePartiallyConnected ExtensionAggregateState = "PartiallyConnected" - ExtensionAggregateStatePartiallySucceeded ExtensionAggregateState = "PartiallySucceeded" - ExtensionAggregateStateProvisioning ExtensionAggregateState = "Provisioning" - ExtensionAggregateStateSucceeded ExtensionAggregateState = "Succeeded" - ExtensionAggregateStateUpdating ExtensionAggregateState = "Updating" - ExtensionAggregateStateUpgradeFailedRollbackSucceeded ExtensionAggregateState = "UpgradeFailedRollbackSucceeded" -) - -func PossibleValuesForExtensionAggregateState() []string { - return []string{ - string(ExtensionAggregateStateAccepted), - string(ExtensionAggregateStateCanceled), - string(ExtensionAggregateStateConnected), - string(ExtensionAggregateStateCreating), - string(ExtensionAggregateStateDeleted), - string(ExtensionAggregateStateDeleting), - string(ExtensionAggregateStateDisconnected), - string(ExtensionAggregateStateError), - string(ExtensionAggregateStateFailed), - string(ExtensionAggregateStateInProgress), - string(ExtensionAggregateStateMoving), - string(ExtensionAggregateStateNotSpecified), - string(ExtensionAggregateStatePartiallyConnected), - string(ExtensionAggregateStatePartiallySucceeded), - string(ExtensionAggregateStateProvisioning), - string(ExtensionAggregateStateSucceeded), - string(ExtensionAggregateStateUpdating), - string(ExtensionAggregateStateUpgradeFailedRollbackSucceeded), - } -} - -func (s *ExtensionAggregateState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtensionAggregateState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtensionAggregateState(input string) (*ExtensionAggregateState, error) { - vals := map[string]ExtensionAggregateState{ - "accepted": ExtensionAggregateStateAccepted, - "canceled": ExtensionAggregateStateCanceled, - "connected": ExtensionAggregateStateConnected, - "creating": ExtensionAggregateStateCreating, - "deleted": ExtensionAggregateStateDeleted, - "deleting": ExtensionAggregateStateDeleting, - "disconnected": ExtensionAggregateStateDisconnected, - "error": ExtensionAggregateStateError, - "failed": ExtensionAggregateStateFailed, - "inprogress": ExtensionAggregateStateInProgress, - "moving": ExtensionAggregateStateMoving, - "notspecified": ExtensionAggregateStateNotSpecified, - "partiallyconnected": ExtensionAggregateStatePartiallyConnected, - "partiallysucceeded": ExtensionAggregateStatePartiallySucceeded, - "provisioning": ExtensionAggregateStateProvisioning, - "succeeded": ExtensionAggregateStateSucceeded, - "updating": ExtensionAggregateStateUpdating, - "upgradefailedrollbacksucceeded": ExtensionAggregateStateUpgradeFailedRollbackSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtensionAggregateState(input) - return &out, nil -} - -type ExtensionManagedBy string - -const ( - ExtensionManagedByAzure ExtensionManagedBy = "Azure" - ExtensionManagedByUser ExtensionManagedBy = "User" -) - -func PossibleValuesForExtensionManagedBy() []string { - return []string{ - string(ExtensionManagedByAzure), - string(ExtensionManagedByUser), - } -} - -func (s *ExtensionManagedBy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtensionManagedBy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtensionManagedBy(input string) (*ExtensionManagedBy, error) { - vals := map[string]ExtensionManagedBy{ - "azure": ExtensionManagedByAzure, - "user": ExtensionManagedByUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtensionManagedBy(input) - return &out, nil -} - -type NodeExtensionState string - -const ( - NodeExtensionStateAccepted NodeExtensionState = "Accepted" - NodeExtensionStateCanceled NodeExtensionState = "Canceled" - NodeExtensionStateConnected NodeExtensionState = "Connected" - NodeExtensionStateCreating NodeExtensionState = "Creating" - NodeExtensionStateDeleted NodeExtensionState = "Deleted" - NodeExtensionStateDeleting NodeExtensionState = "Deleting" - NodeExtensionStateDisconnected NodeExtensionState = "Disconnected" - NodeExtensionStateError NodeExtensionState = "Error" - NodeExtensionStateFailed NodeExtensionState = "Failed" - NodeExtensionStateInProgress NodeExtensionState = "InProgress" - NodeExtensionStateMoving NodeExtensionState = "Moving" - NodeExtensionStateNotSpecified NodeExtensionState = "NotSpecified" - NodeExtensionStatePartiallyConnected NodeExtensionState = "PartiallyConnected" - NodeExtensionStatePartiallySucceeded NodeExtensionState = "PartiallySucceeded" - NodeExtensionStateProvisioning NodeExtensionState = "Provisioning" - NodeExtensionStateSucceeded NodeExtensionState = "Succeeded" - NodeExtensionStateUpdating NodeExtensionState = "Updating" -) - -func PossibleValuesForNodeExtensionState() []string { - return []string{ - string(NodeExtensionStateAccepted), - string(NodeExtensionStateCanceled), - string(NodeExtensionStateConnected), - string(NodeExtensionStateCreating), - string(NodeExtensionStateDeleted), - string(NodeExtensionStateDeleting), - string(NodeExtensionStateDisconnected), - string(NodeExtensionStateError), - string(NodeExtensionStateFailed), - string(NodeExtensionStateInProgress), - string(NodeExtensionStateMoving), - string(NodeExtensionStateNotSpecified), - string(NodeExtensionStatePartiallyConnected), - string(NodeExtensionStatePartiallySucceeded), - string(NodeExtensionStateProvisioning), - string(NodeExtensionStateSucceeded), - string(NodeExtensionStateUpdating), - } -} - -func (s *NodeExtensionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNodeExtensionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNodeExtensionState(input string) (*NodeExtensionState, error) { - vals := map[string]NodeExtensionState{ - "accepted": NodeExtensionStateAccepted, - "canceled": NodeExtensionStateCanceled, - "connected": NodeExtensionStateConnected, - "creating": NodeExtensionStateCreating, - "deleted": NodeExtensionStateDeleted, - "deleting": NodeExtensionStateDeleting, - "disconnected": NodeExtensionStateDisconnected, - "error": NodeExtensionStateError, - "failed": NodeExtensionStateFailed, - "inprogress": NodeExtensionStateInProgress, - "moving": NodeExtensionStateMoving, - "notspecified": NodeExtensionStateNotSpecified, - "partiallyconnected": NodeExtensionStatePartiallyConnected, - "partiallysucceeded": NodeExtensionStatePartiallySucceeded, - "provisioning": NodeExtensionStateProvisioning, - "succeeded": NodeExtensionStateSucceeded, - "updating": NodeExtensionStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NodeExtensionState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateError ProvisioningState = "Error" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisconnected), - string(ProvisioningStateError), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disconnected": ProvisioningStateDisconnected, - "error": ProvisioningStateError, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type StatusLevelTypes string - -const ( - StatusLevelTypesError StatusLevelTypes = "Error" - StatusLevelTypesInfo StatusLevelTypes = "Info" - StatusLevelTypesWarning StatusLevelTypes = "Warning" -) - -func PossibleValuesForStatusLevelTypes() []string { - return []string{ - string(StatusLevelTypesError), - string(StatusLevelTypesInfo), - string(StatusLevelTypesWarning), - } -} - -func (s *StatusLevelTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatusLevelTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { - vals := map[string]StatusLevelTypes{ - "error": StatusLevelTypesError, - "info": StatusLevelTypesInfo, - "warning": StatusLevelTypesWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StatusLevelTypes(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting.go deleted file mode 100644 index 2a1f9ffc60c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting.go +++ /dev/null @@ -1,139 +0,0 @@ -package extensions - -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(&ArcSettingId{}) -} - -var _ resourceids.ResourceId = &ArcSettingId{} - -// ArcSettingId is a struct representing the Resource ID for a Arc Setting -type ArcSettingId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ArcSettingName string -} - -// NewArcSettingID returns a new ArcSettingId struct -func NewArcSettingID(subscriptionId string, resourceGroupName string, clusterName string, arcSettingName string) ArcSettingId { - return ArcSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ArcSettingName: arcSettingName, - } -} - -// ParseArcSettingID parses 'input' into a ArcSettingId -func ParseArcSettingID(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseArcSettingIDInsensitively parses 'input' case-insensitively into a ArcSettingId -// note: this method should only be used for API response data and not user input -func ParseArcSettingIDInsensitively(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ArcSettingId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ArcSettingName, ok = input.Parsed["arcSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arcSettingName", input) - } - - return nil -} - -// ValidateArcSettingID checks that 'input' can be parsed as a Arc Setting ID -func ValidateArcSettingID(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 := ParseArcSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Arc Setting ID -func (id ArcSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/arcSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ArcSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Arc Setting ID -func (id ArcSettingId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticArcSettings", "arcSettings", "arcSettings"), - resourceids.UserSpecifiedSegment("arcSettingName", "arcSettingValue"), - } -} - -// String returns a human-readable description of this Arc Setting ID -func (id ArcSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Arc Setting Name: %q", id.ArcSettingName), - } - return fmt.Sprintf("Arc Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting_test.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting_test.go deleted file mode 100644 index b3bc46d3bc2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_arcsetting_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package extensions - -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 = &ArcSettingId{} - -func TestNewArcSettingID(t *testing.T) { - id := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ArcSettingName != "arcSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArcSettingName'", id.ArcSettingName, "arcSettingValue") - } -} - -func TestFormatArcSettingID(t *testing.T) { - actual := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseArcSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestParseArcSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ArcSettingName: "aRcSeTtInGvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestSegmentsForArcSettingId(t *testing.T) { - segments := ArcSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ArcSettingId 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/azurestackhci/2023-08-01-preview/extensions/id_extension.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension.go deleted file mode 100644 index b4cafce315f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension.go +++ /dev/null @@ -1,148 +0,0 @@ -package extensions - -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(&ExtensionId{}) -} - -var _ resourceids.ResourceId = &ExtensionId{} - -// ExtensionId is a struct representing the Resource ID for a Extension -type ExtensionId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ArcSettingName string - ExtensionName string -} - -// NewExtensionID returns a new ExtensionId struct -func NewExtensionID(subscriptionId string, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) ExtensionId { - return ExtensionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ArcSettingName: arcSettingName, - ExtensionName: extensionName, - } -} - -// ParseExtensionID parses 'input' into a ExtensionId -func ParseExtensionID(input string) (*ExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExtensionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExtensionIDInsensitively parses 'input' case-insensitively into a ExtensionId -// note: this method should only be used for API response data and not user input -func ParseExtensionIDInsensitively(input string) (*ExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExtensionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExtensionId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ArcSettingName, ok = input.Parsed["arcSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arcSettingName", input) - } - - if id.ExtensionName, ok = input.Parsed["extensionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "extensionName", input) - } - - return nil -} - -// ValidateExtensionID checks that 'input' can be parsed as a Extension ID -func ValidateExtensionID(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 := ParseExtensionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Extension ID -func (id ExtensionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/arcSettings/%s/extensions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ArcSettingName, id.ExtensionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Extension ID -func (id ExtensionId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticArcSettings", "arcSettings", "arcSettings"), - resourceids.UserSpecifiedSegment("arcSettingName", "arcSettingValue"), - resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "extensionValue"), - } -} - -// String returns a human-readable description of this Extension ID -func (id ExtensionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Arc Setting Name: %q", id.ArcSettingName), - fmt.Sprintf("Extension Name: %q", id.ExtensionName), - } - return fmt.Sprintf("Extension (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension_test.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension_test.go deleted file mode 100644 index bb42f56d91c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/id_extension_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package extensions - -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 = &ExtensionId{} - -func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ArcSettingName != "arcSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArcSettingName'", id.ArcSettingName, "arcSettingValue") - } - - if id.ExtensionName != "extensionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionValue") - } -} - -func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExtensionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExtensionId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExtensionID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestParseExtensionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExtensionId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/eXtEnSiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/eXtEnSiOnS/eXtEnSiOnVaLuE", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ArcSettingName: "aRcSeTtInGvAlUe", - ExtensionName: "eXtEnSiOnVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/eXtEnSiOnS/eXtEnSiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExtensionIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestSegmentsForExtensionId(t *testing.T) { - segments := ExtensionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExtensionId 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/azurestackhci/2023-08-01-preview/extensions/method_create.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_create.go deleted file mode 100644 index 272c77674e8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// Create ... -func (c ExtensionsClient) Create(ctx context.Context, id ExtensionId, input Extension) (result CreateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ExtensionsClient) CreateThenPoll(ctx context.Context, id ExtensionId, input Extension) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_delete.go deleted file mode 100644 index 00a5692b6d4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package extensions - -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 ExtensionsClient) Delete(ctx context.Context, id ExtensionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExtensionsClient) DeleteThenPoll(ctx context.Context, id ExtensionId) 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/azurestackhci/2023-08-01-preview/extensions/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_get.go deleted file mode 100644 index 2555add1944..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package extensions - -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 *Extension -} - -// Get ... -func (c ExtensionsClient) Get(ctx context.Context, id ExtensionId) (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 Extension - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_listbyarcsetting.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_listbyarcsetting.go deleted file mode 100644 index f92097a0588..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_listbyarcsetting.go +++ /dev/null @@ -1,91 +0,0 @@ -package extensions - -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 ListByArcSettingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Extension -} - -type ListByArcSettingCompleteResult struct { - LatestHttpResponse *http.Response - Items []Extension -} - -// ListByArcSetting ... -func (c ExtensionsClient) ListByArcSetting(ctx context.Context, id ArcSettingId) (result ListByArcSettingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extensions", 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 *[]Extension `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByArcSettingComplete retrieves all the results into a single object -func (c ExtensionsClient) ListByArcSettingComplete(ctx context.Context, id ArcSettingId) (ListByArcSettingCompleteResult, error) { - return c.ListByArcSettingCompleteMatchingPredicate(ctx, id, ExtensionOperationPredicate{}) -} - -// ListByArcSettingCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExtensionsClient) ListByArcSettingCompleteMatchingPredicate(ctx context.Context, id ArcSettingId, predicate ExtensionOperationPredicate) (result ListByArcSettingCompleteResult, err error) { - items := make([]Extension, 0) - - resp, err := c.ListByArcSetting(ctx, id) - if err != nil { - 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 = ListByArcSettingCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_update.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_update.go deleted file mode 100644 index 448e08ce7d8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// Update ... -func (c ExtensionsClient) Update(ctx context.Context, id ExtensionId, input ExtensionPatch) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ExtensionsClient) UpdateThenPoll(ctx context.Context, id ExtensionId, input ExtensionPatch) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_upgrade.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_upgrade.go deleted file mode 100644 index 22d59b202cb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/method_upgrade.go +++ /dev/null @@ -1,73 +0,0 @@ -package extensions - -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 UpgradeOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Upgrade ... -func (c ExtensionsClient) Upgrade(ctx context.Context, id ExtensionId, input ExtensionUpgradeParameters) (result UpgradeOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/upgrade", 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 -} - -// UpgradeThenPoll performs Upgrade then polls until it's completed -func (c ExtensionsClient) UpgradeThenPoll(ctx context.Context, id ExtensionId, input ExtensionUpgradeParameters) error { - result, err := c.Upgrade(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Upgrade: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Upgrade: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extension.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extension.go deleted file mode 100644 index 7979b4827b5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extension.go +++ /dev/null @@ -1,16 +0,0 @@ -package extensions - -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 Extension struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExtensionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceview.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceview.go deleted file mode 100644 index 8ef17ccd617..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceview.go +++ /dev/null @@ -1,11 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionInstanceView struct { - Name *string `json:"name,omitempty"` - Status *ExtensionInstanceViewStatus `json:"status,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceviewstatus.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceviewstatus.go deleted file mode 100644 index 6af4bdef7ff..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensioninstanceviewstatus.go +++ /dev/null @@ -1,30 +0,0 @@ -package extensions - -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 ExtensionInstanceViewStatus struct { - Code *string `json:"code,omitempty"` - DisplayStatus *string `json:"displayStatus,omitempty"` - Level *StatusLevelTypes `json:"level,omitempty"` - Message *string `json:"message,omitempty"` - Time *string `json:"time,omitempty"` -} - -func (o *ExtensionInstanceViewStatus) GetTimeAsTime() (*time.Time, error) { - if o.Time == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExtensionInstanceViewStatus) SetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Time = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionparameters.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionparameters.go deleted file mode 100644 index b267acba8cc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionParameters struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatch.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatch.go deleted file mode 100644 index a1640065bf9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPatch struct { - Properties *ExtensionPatchProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchparameters.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchparameters.go deleted file mode 100644 index 7ef03b42f20..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPatchParameters struct { - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchproperties.go deleted file mode 100644 index f4fea88c801..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionpatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPatchProperties struct { - ExtensionParameters *ExtensionPatchParameters `json:"extensionParameters,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionproperties.go deleted file mode 100644 index 79e09cb07f2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionProperties struct { - AggregateState *ExtensionAggregateState `json:"aggregateState,omitempty"` - ExtensionParameters *ExtensionParameters `json:"extensionParameters,omitempty"` - ManagedBy *ExtensionManagedBy `json:"managedBy,omitempty"` - PerNodeExtensionDetails *[]PerNodeExtensionState `json:"perNodeExtensionDetails,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionupgradeparameters.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionupgradeparameters.go deleted file mode 100644 index 7a45b84de73..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_extensionupgradeparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionUpgradeParameters struct { - TargetVersion *string `json:"targetVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_pernodeextensionstate.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_pernodeextensionstate.go deleted file mode 100644 index d60ad7ca9dc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/model_pernodeextensionstate.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PerNodeExtensionState struct { - Extension *string `json:"extension,omitempty"` - InstanceView *ExtensionInstanceView `json:"instanceView,omitempty"` - Name *string `json:"name,omitempty"` - State *NodeExtensionState `json:"state,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/extensions/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/predicates.go deleted file mode 100644 index 41d2fee4d9b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ExtensionOperationPredicate) Matches(input Extension) 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/azurestackhci/2023-08-01-preview/extensions/version.go b/resource-manager/azurestackhci/2023-08-01-preview/extensions/version.go deleted file mode 100644 index a1d6badb871..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/extensions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/extensions/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/README.md b/resource-manager/azurestackhci/2023-08-01-preview/offers/README.md deleted file mode 100644 index 5936dba945b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/README.md +++ /dev/null @@ -1,70 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/offers` Documentation - -The `offers` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/offers" -``` - - -### Client Initialization - -```go -client := offers.NewOffersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OffersClient.Get` - -```go -ctx := context.TODO() -id := offers.NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - -read, err := client.Get(ctx, id, offers.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OffersClient.ListByCluster` - -```go -ctx := context.TODO() -id := offers.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id, offers.DefaultListByClusterOperationOptions())` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id, offers.DefaultListByClusterOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `OffersClient.ListByPublisher` - -```go -ctx := context.TODO() -id := offers.NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - -// alternatively `client.ListByPublisher(ctx, id, offers.DefaultListByPublisherOperationOptions())` can be used to do batched pagination -items, err := client.ListByPublisherComplete(ctx, id, offers.DefaultListByPublisherOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/client.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/client.go deleted file mode 100644 index 77b5dddcd7b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package offers - -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 OffersClient struct { - Client *resourcemanager.Client -} - -func NewOffersClientWithBaseURI(sdkApi sdkEnv.Api) (*OffersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "offers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating OffersClient: %+v", err) - } - - return &OffersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster.go deleted file mode 100644 index d14118c2987..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package offers - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster_test.go deleted file mode 100644 index 54aa1fe5b8e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package offers - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/offers/id_offer.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer.go deleted file mode 100644 index 1d00693f32b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer.go +++ /dev/null @@ -1,148 +0,0 @@ -package offers - -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(&OfferId{}) -} - -var _ resourceids.ResourceId = &OfferId{} - -// OfferId is a struct representing the Resource ID for a Offer -type OfferId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string - OfferName string -} - -// NewOfferID returns a new OfferId struct -func NewOfferID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string, offerName string) OfferId { - return OfferId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - OfferName: offerName, - } -} - -// ParseOfferID parses 'input' into a OfferId -func ParseOfferID(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOfferIDInsensitively parses 'input' case-insensitively into a OfferId -// note: this method should only be used for API response data and not user input -func ParseOfferIDInsensitively(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OfferId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - if id.OfferName, ok = input.Parsed["offerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "offerName", input) - } - - return nil -} - -// ValidateOfferID checks that 'input' can be parsed as a Offer ID -func ValidateOfferID(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 := ParseOfferID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Offer ID -func (id OfferId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s/offers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName, id.OfferName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Offer ID -func (id OfferId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offerValue"), - } -} - -// String returns a human-readable description of this Offer ID -func (id OfferId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - fmt.Sprintf("Offer Name: %q", id.OfferName), - } - return fmt.Sprintf("Offer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer_test.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer_test.go deleted file mode 100644 index 19f11c58fd6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_offer_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package offers - -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 = &OfferId{} - -func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } - - if id.OfferName != "offerValue" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerValue") - } -} - -func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOfferID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestParseOfferIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - OfferName: "oFfErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestSegmentsForOfferId(t *testing.T) { - segments := OfferId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OfferId 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/azurestackhci/2023-08-01-preview/offers/id_publisher.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher.go deleted file mode 100644 index e42b6673518..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher.go +++ /dev/null @@ -1,139 +0,0 @@ -package offers - -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(&PublisherId{}) -} - -var _ resourceids.ResourceId = &PublisherId{} - -// PublisherId is a struct representing the Resource ID for a Publisher -type PublisherId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string -} - -// NewPublisherID returns a new PublisherId struct -func NewPublisherID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string) PublisherId { - return PublisherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - } -} - -// ParsePublisherID parses 'input' into a PublisherId -func ParsePublisherID(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublisherIDInsensitively parses 'input' case-insensitively into a PublisherId -// note: this method should only be used for API response data and not user input -func ParsePublisherIDInsensitively(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublisherId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - return nil -} - -// ValidatePublisherID checks that 'input' can be parsed as a Publisher ID -func ValidatePublisherID(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 := ParsePublisherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Publisher ID -func (id PublisherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Publisher ID -func (id PublisherId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - } -} - -// String returns a human-readable description of this Publisher ID -func (id PublisherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - } - return fmt.Sprintf("Publisher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher_test.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher_test.go deleted file mode 100644 index cbf8f7759e9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/id_publisher_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package offers - -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 = &PublisherId{} - -func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } -} - -func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublisherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestParsePublisherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestSegmentsForPublisherId(t *testing.T) { - segments := PublisherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublisherId 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/azurestackhci/2023-08-01-preview/offers/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/method_get.go deleted file mode 100644 index d23785a91f3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package offers - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Offer -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c OffersClient) Get(ctx context.Context, id OfferId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 Offer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbycluster.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbycluster.go deleted file mode 100644 index 3da0fcf6cbf..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbycluster.go +++ /dev/null @@ -1,119 +0,0 @@ -package offers - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Offer -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []Offer -} - -type ListByClusterOperationOptions struct { - Expand *string -} - -func DefaultListByClusterOperationOptions() ListByClusterOperationOptions { - return ListByClusterOperationOptions{} -} - -func (o ListByClusterOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListByClusterOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListByClusterOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// ListByCluster ... -func (c OffersClient) ListByCluster(ctx context.Context, id ClusterId, options ListByClusterOperationOptions) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/offers", id.ID()), - OptionsObject: options, - } - - 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 *[]Offer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c OffersClient) ListByClusterComplete(ctx context.Context, id ClusterId, options ListByClusterOperationOptions) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, options, OfferOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OffersClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id ClusterId, options ListByClusterOperationOptions, predicate OfferOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]Offer, 0) - - resp, err := c.ListByCluster(ctx, id, options) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbypublisher.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbypublisher.go deleted file mode 100644 index dde705ba35d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/method_listbypublisher.go +++ /dev/null @@ -1,119 +0,0 @@ -package offers - -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 ListByPublisherOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Offer -} - -type ListByPublisherCompleteResult struct { - LatestHttpResponse *http.Response - Items []Offer -} - -type ListByPublisherOperationOptions struct { - Expand *string -} - -func DefaultListByPublisherOperationOptions() ListByPublisherOperationOptions { - return ListByPublisherOperationOptions{} -} - -func (o ListByPublisherOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListByPublisherOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListByPublisherOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// ListByPublisher ... -func (c OffersClient) ListByPublisher(ctx context.Context, id PublisherId, options ListByPublisherOperationOptions) (result ListByPublisherOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/offers", id.ID()), - OptionsObject: options, - } - - 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 *[]Offer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByPublisherComplete retrieves all the results into a single object -func (c OffersClient) ListByPublisherComplete(ctx context.Context, id PublisherId, options ListByPublisherOperationOptions) (ListByPublisherCompleteResult, error) { - return c.ListByPublisherCompleteMatchingPredicate(ctx, id, options, OfferOperationPredicate{}) -} - -// ListByPublisherCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OffersClient) ListByPublisherCompleteMatchingPredicate(ctx context.Context, id PublisherId, options ListByPublisherOperationOptions, predicate OfferOperationPredicate) (result ListByPublisherCompleteResult, err error) { - items := make([]Offer, 0) - - resp, err := c.ListByPublisher(ctx, id, options) - if err != nil { - 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 = ListByPublisherCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/model_offer.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/model_offer.go deleted file mode 100644 index e2c246d643b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/model_offer.go +++ /dev/null @@ -1,16 +0,0 @@ -package offers - -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 Offer struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OfferProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/model_offerproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/model_offerproperties.go deleted file mode 100644 index a53c23229aa..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/model_offerproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package offers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfferProperties struct { - Content *string `json:"content,omitempty"` - ContentVersion *string `json:"contentVersion,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublisherId *string `json:"publisherId,omitempty"` - SkuMappings *[]SkuMappings `json:"skuMappings,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/model_skumappings.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/model_skumappings.go deleted file mode 100644 index a2c8233a121..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/model_skumappings.go +++ /dev/null @@ -1,10 +0,0 @@ -package offers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuMappings struct { - CatalogPlanId *string `json:"catalogPlanId,omitempty"` - MarketplaceSkuId *string `json:"marketplaceSkuId,omitempty"` - MarketplaceSkuVersions *[]string `json:"marketplaceSkuVersions,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/offers/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/predicates.go deleted file mode 100644 index 75da90fe272..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package offers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfferOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p OfferOperationPredicate) Matches(input Offer) 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/azurestackhci/2023-08-01-preview/offers/version.go b/resource-manager/azurestackhci/2023-08-01-preview/offers/version.go deleted file mode 100644 index 7ebcb6ca2de..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/offers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package offers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/offers/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/README.md b/resource-manager/azurestackhci/2023-08-01-preview/publishers/README.md deleted file mode 100644 index 9d976ba9a6c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/publishers` Documentation - -The `publishers` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/publishers" -``` - - -### Client Initialization - -```go -client := publishers.NewPublishersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublishersClient.Get` - -```go -ctx := context.TODO() -id := publishers.NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - -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: `PublishersClient.ListByCluster` - -```go -ctx := context.TODO() -id := publishers.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/client.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/client.go deleted file mode 100644 index ea59faa9c8e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publishers - -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 PublishersClient struct { - Client *resourcemanager.Client -} - -func NewPublishersClientWithBaseURI(sdkApi sdkEnv.Api) (*PublishersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publishers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublishersClient: %+v", err) - } - - return &PublishersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster.go deleted file mode 100644 index 3a7fff3ea9d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package publishers - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster_test.go deleted file mode 100644 index 282f6f51a1e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package publishers - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/publishers/id_publisher.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher.go deleted file mode 100644 index d8b7a773e80..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher.go +++ /dev/null @@ -1,139 +0,0 @@ -package publishers - -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(&PublisherId{}) -} - -var _ resourceids.ResourceId = &PublisherId{} - -// PublisherId is a struct representing the Resource ID for a Publisher -type PublisherId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string -} - -// NewPublisherID returns a new PublisherId struct -func NewPublisherID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string) PublisherId { - return PublisherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - } -} - -// ParsePublisherID parses 'input' into a PublisherId -func ParsePublisherID(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublisherIDInsensitively parses 'input' case-insensitively into a PublisherId -// note: this method should only be used for API response data and not user input -func ParsePublisherIDInsensitively(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublisherId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - return nil -} - -// ValidatePublisherID checks that 'input' can be parsed as a Publisher ID -func ValidatePublisherID(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 := ParsePublisherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Publisher ID -func (id PublisherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Publisher ID -func (id PublisherId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - } -} - -// String returns a human-readable description of this Publisher ID -func (id PublisherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - } - return fmt.Sprintf("Publisher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher_test.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher_test.go deleted file mode 100644 index 65a77ac1734..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/id_publisher_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package publishers - -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 = &PublisherId{} - -func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } -} - -func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublisherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestParsePublisherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestSegmentsForPublisherId(t *testing.T) { - segments := PublisherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublisherId 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/azurestackhci/2023-08-01-preview/publishers/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/method_get.go deleted file mode 100644 index 850e3f895f2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package publishers - -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 *Publisher -} - -// Get ... -func (c PublishersClient) Get(ctx context.Context, id PublisherId) (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 Publisher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/method_listbycluster.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/method_listbycluster.go deleted file mode 100644 index afab97cd637..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/method_listbycluster.go +++ /dev/null @@ -1,91 +0,0 @@ -package publishers - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Publisher -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []Publisher -} - -// ListByCluster ... -func (c PublishersClient) ListByCluster(ctx context.Context, id ClusterId) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publishers", 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 *[]Publisher `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c PublishersClient) ListByClusterComplete(ctx context.Context, id ClusterId) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, PublisherOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublishersClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate PublisherOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]Publisher, 0) - - resp, err := c.ListByCluster(ctx, id) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisher.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisher.go deleted file mode 100644 index 70fef995140..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisher.go +++ /dev/null @@ -1,16 +0,0 @@ -package publishers - -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 Publisher struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublisherProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisherproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisherproperties.go deleted file mode 100644 index 7aa30888f26..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/model_publisherproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package publishers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublisherProperties struct { - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/publishers/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/predicates.go deleted file mode 100644 index efccddd2512..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package publishers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublisherOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PublisherOperationPredicate) Matches(input Publisher) 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/azurestackhci/2023-08-01-preview/publishers/version.go b/resource-manager/azurestackhci/2023-08-01-preview/publishers/version.go deleted file mode 100644 index d75a6944181..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/publishers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publishers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publishers/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/README.md b/resource-manager/azurestackhci/2023-08-01-preview/skuses/README.md deleted file mode 100644 index 7f18442704c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/skuses` Documentation - -The `skuses` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/skuses" -``` - - -### Client Initialization - -```go -client := skuses.NewSkusesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SkusesClient.SkusGet` - -```go -ctx := context.TODO() -id := skuses.NewSkuID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue", "skuValue") - -read, err := client.SkusGet(ctx, id, skuses.DefaultSkusGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SkusesClient.SkusListByOffer` - -```go -ctx := context.TODO() -id := skuses.NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - -// alternatively `client.SkusListByOffer(ctx, id, skuses.DefaultSkusListByOfferOperationOptions())` can be used to do batched pagination -items, err := client.SkusListByOfferComplete(ctx, id, skuses.DefaultSkusListByOfferOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/client.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/client.go deleted file mode 100644 index 85bd1abeccf..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package skuses - -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 SkusesClient struct { - Client *resourcemanager.Client -} - -func NewSkusesClientWithBaseURI(sdkApi sdkEnv.Api) (*SkusesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "skuses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SkusesClient: %+v", err) - } - - return &SkusesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer.go deleted file mode 100644 index 2c3a4c1b840..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer.go +++ /dev/null @@ -1,148 +0,0 @@ -package skuses - -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(&OfferId{}) -} - -var _ resourceids.ResourceId = &OfferId{} - -// OfferId is a struct representing the Resource ID for a Offer -type OfferId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string - OfferName string -} - -// NewOfferID returns a new OfferId struct -func NewOfferID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string, offerName string) OfferId { - return OfferId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - OfferName: offerName, - } -} - -// ParseOfferID parses 'input' into a OfferId -func ParseOfferID(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOfferIDInsensitively parses 'input' case-insensitively into a OfferId -// note: this method should only be used for API response data and not user input -func ParseOfferIDInsensitively(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OfferId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - if id.OfferName, ok = input.Parsed["offerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "offerName", input) - } - - return nil -} - -// ValidateOfferID checks that 'input' can be parsed as a Offer ID -func ValidateOfferID(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 := ParseOfferID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Offer ID -func (id OfferId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s/offers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName, id.OfferName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Offer ID -func (id OfferId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offerValue"), - } -} - -// String returns a human-readable description of this Offer ID -func (id OfferId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - fmt.Sprintf("Offer Name: %q", id.OfferName), - } - return fmt.Sprintf("Offer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer_test.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer_test.go deleted file mode 100644 index 296f838b580..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_offer_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package skuses - -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 = &OfferId{} - -func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } - - if id.OfferName != "offerValue" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerValue") - } -} - -func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOfferID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestParseOfferIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - OfferName: "oFfErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestSegmentsForOfferId(t *testing.T) { - segments := OfferId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OfferId 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/azurestackhci/2023-08-01-preview/skuses/id_sku.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku.go deleted file mode 100644 index d4e78d7c558..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku.go +++ /dev/null @@ -1,157 +0,0 @@ -package skuses - -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(&SkuId{}) -} - -var _ resourceids.ResourceId = &SkuId{} - -// SkuId is a struct representing the Resource ID for a Sku -type SkuId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string - OfferName string - SkuName string -} - -// NewSkuID returns a new SkuId struct -func NewSkuID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string, offerName string, skuName string) SkuId { - return SkuId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - OfferName: offerName, - SkuName: skuName, - } -} - -// ParseSkuID parses 'input' into a SkuId -func ParseSkuID(input string) (*SkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&SkuId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSkuIDInsensitively parses 'input' case-insensitively into a SkuId -// note: this method should only be used for API response data and not user input -func ParseSkuIDInsensitively(input string) (*SkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&SkuId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SkuId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - if id.OfferName, ok = input.Parsed["offerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "offerName", input) - } - - if id.SkuName, ok = input.Parsed["skuName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "skuName", input) - } - - return nil -} - -// ValidateSkuID checks that 'input' can be parsed as a Sku ID -func ValidateSkuID(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 := ParseSkuID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Sku ID -func (id SkuId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s/offers/%s/skus/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName, id.OfferName, id.SkuName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Sku ID -func (id SkuId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offerValue"), - resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skuValue"), - } -} - -// String returns a human-readable description of this Sku ID -func (id SkuId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - fmt.Sprintf("Offer Name: %q", id.OfferName), - fmt.Sprintf("Sku Name: %q", id.SkuName), - } - return fmt.Sprintf("Sku (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku_test.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku_test.go deleted file mode 100644 index 3c8c14ebd3c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/id_sku_test.go +++ /dev/null @@ -1,417 +0,0 @@ -package skuses - -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 = &SkuId{} - -func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue", "skuValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } - - if id.OfferName != "offerValue" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerValue") - } - - if id.SkuName != "skuValue" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuValue") - } -} - -func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue", "skuValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSkuID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SkuId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue", - Expected: &SkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - SkuName: "skuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSkuID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - if actual.SkuName != v.Expected.SkuName { - t.Fatalf("Expected %q but got %q for SkuName", v.Expected.SkuName, actual.SkuName) - } - - } -} - -func TestParseSkuIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SkuId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/sKuS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue", - Expected: &SkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - SkuName: "skuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/sKuS/sKuVaLuE", - Expected: &SkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - OfferName: "oFfErVaLuE", - SkuName: "sKuVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/sKuS/sKuVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSkuIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - if actual.SkuName != v.Expected.SkuName { - t.Fatalf("Expected %q but got %q for SkuName", v.Expected.SkuName, actual.SkuName) - } - - } -} - -func TestSegmentsForSkuId(t *testing.T) { - segments := SkuId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SkuId 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/azurestackhci/2023-08-01-preview/skuses/method_skusget.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skusget.go deleted file mode 100644 index 5ae2a348d5b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skusget.go +++ /dev/null @@ -1,83 +0,0 @@ -package skuses - -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 SkusGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Sku -} - -type SkusGetOperationOptions struct { - Expand *string -} - -func DefaultSkusGetOperationOptions() SkusGetOperationOptions { - return SkusGetOperationOptions{} -} - -func (o SkusGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o SkusGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o SkusGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// SkusGet ... -func (c SkusesClient) SkusGet(ctx context.Context, id SkuId, options SkusGetOperationOptions) (result SkusGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 Sku - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skuslistbyoffer.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skuslistbyoffer.go deleted file mode 100644 index b767e801788..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/method_skuslistbyoffer.go +++ /dev/null @@ -1,119 +0,0 @@ -package skuses - -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 SkusListByOfferOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Sku -} - -type SkusListByOfferCompleteResult struct { - LatestHttpResponse *http.Response - Items []Sku -} - -type SkusListByOfferOperationOptions struct { - Expand *string -} - -func DefaultSkusListByOfferOperationOptions() SkusListByOfferOperationOptions { - return SkusListByOfferOperationOptions{} -} - -func (o SkusListByOfferOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o SkusListByOfferOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o SkusListByOfferOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// SkusListByOffer ... -func (c SkusesClient) SkusListByOffer(ctx context.Context, id OfferId, options SkusListByOfferOperationOptions) (result SkusListByOfferOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/skus", id.ID()), - OptionsObject: options, - } - - 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 *[]Sku `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SkusListByOfferComplete retrieves all the results into a single object -func (c SkusesClient) SkusListByOfferComplete(ctx context.Context, id OfferId, options SkusListByOfferOperationOptions) (SkusListByOfferCompleteResult, error) { - return c.SkusListByOfferCompleteMatchingPredicate(ctx, id, options, SkuOperationPredicate{}) -} - -// SkusListByOfferCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SkusesClient) SkusListByOfferCompleteMatchingPredicate(ctx context.Context, id OfferId, options SkusListByOfferOperationOptions, predicate SkuOperationPredicate) (result SkusListByOfferCompleteResult, err error) { - items := make([]Sku, 0) - - resp, err := c.SkusListByOffer(ctx, id, options) - if err != nil { - 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 = SkusListByOfferCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_sku.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_sku.go deleted file mode 100644 index cef2062f1bb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_sku.go +++ /dev/null @@ -1,16 +0,0 @@ -package skuses - -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 Sku struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SkuProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skumappings.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skumappings.go deleted file mode 100644 index fd05acdaf7d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skumappings.go +++ /dev/null @@ -1,10 +0,0 @@ -package skuses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuMappings struct { - CatalogPlanId *string `json:"catalogPlanId,omitempty"` - MarketplaceSkuId *string `json:"marketplaceSkuId,omitempty"` - MarketplaceSkuVersions *[]string `json:"marketplaceSkuVersions,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skuproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skuproperties.go deleted file mode 100644 index bc60d0aec34..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/model_skuproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package skuses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuProperties struct { - Content *string `json:"content,omitempty"` - ContentVersion *string `json:"contentVersion,omitempty"` - OfferId *string `json:"offerId,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublisherId *string `json:"publisherId,omitempty"` - SkuMappings *[]SkuMappings `json:"skuMappings,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/skuses/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/predicates.go deleted file mode 100644 index 77c587da8fa..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package skuses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p SkuOperationPredicate) Matches(input Sku) 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/azurestackhci/2023-08-01-preview/skuses/version.go b/resource-manager/azurestackhci/2023-08-01-preview/skuses/version.go deleted file mode 100644 index 4e405d68444..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/skuses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package skuses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/skuses/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/README.md b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/README.md deleted file mode 100644 index eb8bd654d36..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/updateruns` Documentation - -The `updateruns` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/updateruns" -``` - - -### Client Initialization - -```go -client := updateruns.NewUpdateRunsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdateRunsClient.Delete` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdateRunsClient.Get` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - -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: `UpdateRunsClient.List` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -// 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: `UpdateRunsClient.Put` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - -payload := updateruns.UpdateRun{ - // ... -} - - -read, err := client.Put(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/azurestackhci/2023-08-01-preview/updateruns/client.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/client.go deleted file mode 100644 index a5becca3c6b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updateruns - -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 UpdateRunsClient struct { - Client *resourcemanager.Client -} - -func NewUpdateRunsClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdateRunsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updateruns", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdateRunsClient: %+v", err) - } - - return &UpdateRunsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/constants.go deleted file mode 100644 index ff4039a367d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/constants.go +++ /dev/null @@ -1,107 +0,0 @@ -package updateruns - -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 ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateFailed), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "failed": ProvisioningStateFailed, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UpdateRunPropertiesState string - -const ( - UpdateRunPropertiesStateFailed UpdateRunPropertiesState = "Failed" - UpdateRunPropertiesStateInProgress UpdateRunPropertiesState = "InProgress" - UpdateRunPropertiesStateSucceeded UpdateRunPropertiesState = "Succeeded" - UpdateRunPropertiesStateUnknown UpdateRunPropertiesState = "Unknown" -) - -func PossibleValuesForUpdateRunPropertiesState() []string { - return []string{ - string(UpdateRunPropertiesStateFailed), - string(UpdateRunPropertiesStateInProgress), - string(UpdateRunPropertiesStateSucceeded), - string(UpdateRunPropertiesStateUnknown), - } -} - -func (s *UpdateRunPropertiesState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateRunPropertiesState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateRunPropertiesState(input string) (*UpdateRunPropertiesState, error) { - vals := map[string]UpdateRunPropertiesState{ - "failed": UpdateRunPropertiesStateFailed, - "inprogress": UpdateRunPropertiesStateInProgress, - "succeeded": UpdateRunPropertiesStateSucceeded, - "unknown": UpdateRunPropertiesStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateRunPropertiesState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update.go deleted file mode 100644 index f8744304b63..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update.go +++ /dev/null @@ -1,139 +0,0 @@ -package updateruns - -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(&UpdateId{}) -} - -var _ resourceids.ResourceId = &UpdateId{} - -// UpdateId is a struct representing the Resource ID for a Update -type UpdateId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - UpdateName string -} - -// NewUpdateID returns a new UpdateId struct -func NewUpdateID(subscriptionId string, resourceGroupName string, clusterName string, updateName string) UpdateId { - return UpdateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - UpdateName: updateName, - } -} - -// ParseUpdateID parses 'input' into a UpdateId -func ParseUpdateID(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUpdateIDInsensitively parses 'input' case-insensitively into a UpdateId -// note: this method should only be used for API response data and not user input -func ParseUpdateIDInsensitively(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UpdateId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.UpdateName, ok = input.Parsed["updateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateName", input) - } - - return nil -} - -// ValidateUpdateID checks that 'input' can be parsed as a Update ID -func ValidateUpdateID(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 := ParseUpdateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Update ID -func (id UpdateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/updates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.UpdateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Update ID -func (id UpdateId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticUpdates", "updates", "updates"), - resourceids.UserSpecifiedSegment("updateName", "updateValue"), - } -} - -// String returns a human-readable description of this Update ID -func (id UpdateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Update Name: %q", id.UpdateName), - } - return fmt.Sprintf("Update (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update_test.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update_test.go deleted file mode 100644 index d861fbd5428..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_update_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package updateruns - -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 = &UpdateId{} - -func TestNewUpdateID(t *testing.T) { - id := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.UpdateName != "updateValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateName'", id.UpdateName, "updateValue") - } -} - -func TestFormatUpdateID(t *testing.T) { - actual := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUpdateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestParseUpdateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - UpdateName: "uPdAtEvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestSegmentsForUpdateId(t *testing.T) { - segments := UpdateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UpdateId 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/azurestackhci/2023-08-01-preview/updateruns/id_updaterun.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun.go deleted file mode 100644 index 14b2180425f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun.go +++ /dev/null @@ -1,148 +0,0 @@ -package updateruns - -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(&UpdateRunId{}) -} - -var _ resourceids.ResourceId = &UpdateRunId{} - -// UpdateRunId is a struct representing the Resource ID for a Update Run -type UpdateRunId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - UpdateName string - UpdateRunName string -} - -// NewUpdateRunID returns a new UpdateRunId struct -func NewUpdateRunID(subscriptionId string, resourceGroupName string, clusterName string, updateName string, updateRunName string) UpdateRunId { - return UpdateRunId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - UpdateName: updateName, - UpdateRunName: updateRunName, - } -} - -// ParseUpdateRunID parses 'input' into a UpdateRunId -func ParseUpdateRunID(input string) (*UpdateRunId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateRunId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateRunId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUpdateRunIDInsensitively parses 'input' case-insensitively into a UpdateRunId -// note: this method should only be used for API response data and not user input -func ParseUpdateRunIDInsensitively(input string) (*UpdateRunId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateRunId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateRunId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UpdateRunId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.UpdateName, ok = input.Parsed["updateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateName", input) - } - - if id.UpdateRunName, ok = input.Parsed["updateRunName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateRunName", input) - } - - return nil -} - -// ValidateUpdateRunID checks that 'input' can be parsed as a Update Run ID -func ValidateUpdateRunID(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 := ParseUpdateRunID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Update Run ID -func (id UpdateRunId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/updates/%s/updateRuns/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.UpdateName, id.UpdateRunName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Update Run ID -func (id UpdateRunId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticUpdates", "updates", "updates"), - resourceids.UserSpecifiedSegment("updateName", "updateValue"), - resourceids.StaticSegment("staticUpdateRuns", "updateRuns", "updateRuns"), - resourceids.UserSpecifiedSegment("updateRunName", "updateRunValue"), - } -} - -// String returns a human-readable description of this Update Run ID -func (id UpdateRunId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Update Name: %q", id.UpdateName), - fmt.Sprintf("Update Run Name: %q", id.UpdateRunName), - } - return fmt.Sprintf("Update Run (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun_test.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun_test.go deleted file mode 100644 index fa0b09aab3e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/id_updaterun_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package updateruns - -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 = &UpdateRunId{} - -func TestNewUpdateRunID(t *testing.T) { - id := NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.UpdateName != "updateValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateName'", id.UpdateName, "updateValue") - } - - if id.UpdateRunName != "updateRunValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateRunName'", id.UpdateRunName, "updateRunValue") - } -} - -func TestFormatUpdateRunID(t *testing.T) { - actual := NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUpdateRunID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateRunId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue", - Expected: &UpdateRunId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - UpdateRunName: "updateRunValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateRunID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - if actual.UpdateRunName != v.Expected.UpdateRunName { - t.Fatalf("Expected %q but got %q for UpdateRunName", v.Expected.UpdateRunName, actual.UpdateRunName) - } - - } -} - -func TestParseUpdateRunIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateRunId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/uPdAtErUnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue", - Expected: &UpdateRunId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - UpdateRunName: "updateRunValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/uPdAtErUnS/uPdAtErUnVaLuE", - Expected: &UpdateRunId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - UpdateName: "uPdAtEvAlUe", - UpdateRunName: "uPdAtErUnVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/uPdAtErUnS/uPdAtErUnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateRunIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - if actual.UpdateRunName != v.Expected.UpdateRunName { - t.Fatalf("Expected %q but got %q for UpdateRunName", v.Expected.UpdateRunName, actual.UpdateRunName) - } - - } -} - -func TestSegmentsForUpdateRunId(t *testing.T) { - segments := UpdateRunId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UpdateRunId 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/azurestackhci/2023-08-01-preview/updateruns/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_delete.go deleted file mode 100644 index 93881d05ad3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package updateruns - -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 UpdateRunsClient) Delete(ctx context.Context, id UpdateRunId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 UpdateRunsClient) DeleteThenPoll(ctx context.Context, id UpdateRunId) 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/azurestackhci/2023-08-01-preview/updateruns/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_get.go deleted file mode 100644 index 674bbb589e9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package updateruns - -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 *UpdateRun -} - -// Get ... -func (c UpdateRunsClient) Get(ctx context.Context, id UpdateRunId) (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 UpdateRun - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_list.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_list.go deleted file mode 100644 index f530acd5f28..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package updateruns - -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 *[]UpdateRun -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []UpdateRun -} - -// List ... -func (c UpdateRunsClient) List(ctx context.Context, id UpdateId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updateRuns", 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 *[]UpdateRun `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 UpdateRunsClient) ListComplete(ctx context.Context, id UpdateId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UpdateRunOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UpdateRunsClient) ListCompleteMatchingPredicate(ctx context.Context, id UpdateId, predicate UpdateRunOperationPredicate) (result ListCompleteResult, err error) { - items := make([]UpdateRun, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01-preview/updateruns/method_put.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_put.go deleted file mode 100644 index 58f21298c0f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/method_put.go +++ /dev/null @@ -1,58 +0,0 @@ -package updateruns - -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 PutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UpdateRun -} - -// Put ... -func (c UpdateRunsClient) Put(ctx context.Context, id UpdateRunId, input UpdateRun) (result PutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 UpdateRun - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_step.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_step.go deleted file mode 100644 index ece5d657342..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_step.go +++ /dev/null @@ -1,57 +0,0 @@ -package updateruns - -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 Step struct { - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Name *string `json:"name,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *string `json:"status,omitempty"` - Steps *[]Step `json:"steps,omitempty"` -} - -func (o *Step) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *Step) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *Step) GetLastUpdatedTimeUtcAsTime() (*time.Time, error) { - if o.LastUpdatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *Step) SetLastUpdatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTimeUtc = &formatted -} - -func (o *Step) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *Step) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterun.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterun.go deleted file mode 100644 index d8fbe7ca6b7..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterun.go +++ /dev/null @@ -1,17 +0,0 @@ -package updateruns - -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 UpdateRun struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *UpdateRunProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterunproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterunproperties.go deleted file mode 100644 index a2500945de0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/model_updaterunproperties.go +++ /dev/null @@ -1,43 +0,0 @@ -package updateruns - -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 UpdateRunProperties struct { - Duration *string `json:"duration,omitempty"` - LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"` - Progress *Step `json:"progress,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - State *UpdateRunPropertiesState `json:"state,omitempty"` - TimeStarted *string `json:"timeStarted,omitempty"` -} - -func (o *UpdateRunProperties) GetLastUpdatedTimeAsTime() (*time.Time, error) { - if o.LastUpdatedTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateRunProperties) SetLastUpdatedTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTime = &formatted -} - -func (o *UpdateRunProperties) GetTimeStartedAsTime() (*time.Time, error) { - if o.TimeStarted == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeStarted, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateRunProperties) SetTimeStartedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeStarted = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/predicates.go deleted file mode 100644 index 3634b9136ba..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package updateruns - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateRunOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p UpdateRunOperationPredicate) Matches(input UpdateRun) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/azurestackhci/2023-08-01-preview/updateruns/version.go b/resource-manager/azurestackhci/2023-08-01-preview/updateruns/version.go deleted file mode 100644 index 4c835a70132..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updateruns/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updateruns - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updateruns/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/README.md b/resource-manager/azurestackhci/2023-08-01-preview/updates/README.md deleted file mode 100644 index d60a7e18b1d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/README.md +++ /dev/null @@ -1,98 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/updates` Documentation - -The `updates` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/updates" -``` - - -### Client Initialization - -```go -client := updates.NewUpdatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdatesClient.Delete` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdatesClient.Get` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -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: `UpdatesClient.List` - -```go -ctx := context.TODO() -id := updates.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// 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: `UpdatesClient.Post` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -if err := client.PostThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdatesClient.Put` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -payload := updates.Update{ - // ... -} - - -read, err := client.Put(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/azurestackhci/2023-08-01-preview/updates/client.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/client.go deleted file mode 100644 index f8438b80656..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updates - -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 UpdatesClient struct { - Client *resourcemanager.Client -} - -func NewUpdatesClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdatesClient: %+v", err) - } - - return &UpdatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/constants.go deleted file mode 100644 index 648846294a9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/constants.go +++ /dev/null @@ -1,381 +0,0 @@ -package updates - -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 AvailabilityType string - -const ( - AvailabilityTypeLocal AvailabilityType = "Local" - AvailabilityTypeNotify AvailabilityType = "Notify" - AvailabilityTypeOnline AvailabilityType = "Online" -) - -func PossibleValuesForAvailabilityType() []string { - return []string{ - string(AvailabilityTypeLocal), - string(AvailabilityTypeNotify), - string(AvailabilityTypeOnline), - } -} - -func (s *AvailabilityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAvailabilityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAvailabilityType(input string) (*AvailabilityType, error) { - vals := map[string]AvailabilityType{ - "local": AvailabilityTypeLocal, - "notify": AvailabilityTypeNotify, - "online": AvailabilityTypeOnline, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvailabilityType(input) - return &out, nil -} - -type HealthState string - -const ( - HealthStateError HealthState = "Error" - HealthStateFailure HealthState = "Failure" - HealthStateInProgress HealthState = "InProgress" - HealthStateSuccess HealthState = "Success" - HealthStateUnknown HealthState = "Unknown" - HealthStateWarning HealthState = "Warning" -) - -func PossibleValuesForHealthState() []string { - return []string{ - string(HealthStateError), - string(HealthStateFailure), - string(HealthStateInProgress), - string(HealthStateSuccess), - string(HealthStateUnknown), - string(HealthStateWarning), - } -} - -func (s *HealthState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHealthState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHealthState(input string) (*HealthState, error) { - vals := map[string]HealthState{ - "error": HealthStateError, - "failure": HealthStateFailure, - "inprogress": HealthStateInProgress, - "success": HealthStateSuccess, - "unknown": HealthStateUnknown, - "warning": HealthStateWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HealthState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateFailed), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "failed": ProvisioningStateFailed, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RebootRequirement string - -const ( - RebootRequirementFalse RebootRequirement = "False" - RebootRequirementTrue RebootRequirement = "True" - RebootRequirementUnknown RebootRequirement = "Unknown" -) - -func PossibleValuesForRebootRequirement() []string { - return []string{ - string(RebootRequirementFalse), - string(RebootRequirementTrue), - string(RebootRequirementUnknown), - } -} - -func (s *RebootRequirement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRebootRequirement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRebootRequirement(input string) (*RebootRequirement, error) { - vals := map[string]RebootRequirement{ - "false": RebootRequirementFalse, - "true": RebootRequirementTrue, - "unknown": RebootRequirementUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RebootRequirement(input) - return &out, nil -} - -type Severity string - -const ( - SeverityCritical Severity = "Critical" - SeverityHidden Severity = "Hidden" - SeverityInformational Severity = "Informational" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityCritical), - string(SeverityHidden), - string(SeverityInformational), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "critical": SeverityCritical, - "hidden": SeverityHidden, - "informational": SeverityInformational, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} - -type State string - -const ( - StateDownloadFailed State = "DownloadFailed" - StateDownloading State = "Downloading" - StateHasPrerequisite State = "HasPrerequisite" - StateHealthCheckFailed State = "HealthCheckFailed" - StateHealthChecking State = "HealthChecking" - StateInstallationFailed State = "InstallationFailed" - StateInstalled State = "Installed" - StateInstalling State = "Installing" - StateInvalid State = "Invalid" - StateNotApplicableBecauseAnotherUpdateIsInProgress State = "NotApplicableBecauseAnotherUpdateIsInProgress" - StateObsolete State = "Obsolete" - StatePreparationFailed State = "PreparationFailed" - StatePreparing State = "Preparing" - StateReady State = "Ready" - StateReadyToInstall State = "ReadyToInstall" - StateRecalled State = "Recalled" - StateScanFailed State = "ScanFailed" - StateScanInProgress State = "ScanInProgress" -) - -func PossibleValuesForState() []string { - return []string{ - string(StateDownloadFailed), - string(StateDownloading), - string(StateHasPrerequisite), - string(StateHealthCheckFailed), - string(StateHealthChecking), - string(StateInstallationFailed), - string(StateInstalled), - string(StateInstalling), - string(StateInvalid), - string(StateNotApplicableBecauseAnotherUpdateIsInProgress), - string(StateObsolete), - string(StatePreparationFailed), - string(StatePreparing), - string(StateReady), - string(StateReadyToInstall), - string(StateRecalled), - string(StateScanFailed), - string(StateScanInProgress), - } -} - -func (s *State) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseState(input string) (*State, error) { - vals := map[string]State{ - "downloadfailed": StateDownloadFailed, - "downloading": StateDownloading, - "hasprerequisite": StateHasPrerequisite, - "healthcheckfailed": StateHealthCheckFailed, - "healthchecking": StateHealthChecking, - "installationfailed": StateInstallationFailed, - "installed": StateInstalled, - "installing": StateInstalling, - "invalid": StateInvalid, - "notapplicablebecauseanotherupdateisinprogress": StateNotApplicableBecauseAnotherUpdateIsInProgress, - "obsolete": StateObsolete, - "preparationfailed": StatePreparationFailed, - "preparing": StatePreparing, - "ready": StateReady, - "readytoinstall": StateReadyToInstall, - "recalled": StateRecalled, - "scanfailed": StateScanFailed, - "scaninprogress": StateScanInProgress, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := State(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster.go deleted file mode 100644 index 1b34e01fffc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package updates - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster_test.go deleted file mode 100644 index 8555f39fa7e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package updates - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/updates/id_update.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/id_update.go deleted file mode 100644 index 1588a8a86ff..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_update.go +++ /dev/null @@ -1,139 +0,0 @@ -package updates - -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(&UpdateId{}) -} - -var _ resourceids.ResourceId = &UpdateId{} - -// UpdateId is a struct representing the Resource ID for a Update -type UpdateId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - UpdateName string -} - -// NewUpdateID returns a new UpdateId struct -func NewUpdateID(subscriptionId string, resourceGroupName string, clusterName string, updateName string) UpdateId { - return UpdateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - UpdateName: updateName, - } -} - -// ParseUpdateID parses 'input' into a UpdateId -func ParseUpdateID(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUpdateIDInsensitively parses 'input' case-insensitively into a UpdateId -// note: this method should only be used for API response data and not user input -func ParseUpdateIDInsensitively(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UpdateId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.UpdateName, ok = input.Parsed["updateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateName", input) - } - - return nil -} - -// ValidateUpdateID checks that 'input' can be parsed as a Update ID -func ValidateUpdateID(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 := ParseUpdateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Update ID -func (id UpdateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/updates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.UpdateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Update ID -func (id UpdateId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticUpdates", "updates", "updates"), - resourceids.UserSpecifiedSegment("updateName", "updateValue"), - } -} - -// String returns a human-readable description of this Update ID -func (id UpdateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Update Name: %q", id.UpdateName), - } - return fmt.Sprintf("Update (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_update_test.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/id_update_test.go deleted file mode 100644 index a0c73c81ba2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/id_update_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package updates - -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 = &UpdateId{} - -func TestNewUpdateID(t *testing.T) { - id := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.UpdateName != "updateValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateName'", id.UpdateName, "updateValue") - } -} - -func TestFormatUpdateID(t *testing.T) { - actual := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUpdateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestParseUpdateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - UpdateName: "uPdAtEvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestSegmentsForUpdateId(t *testing.T) { - segments := UpdateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UpdateId 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/azurestackhci/2023-08-01-preview/updates/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/method_delete.go deleted file mode 100644 index e2977fac7f9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package updates - -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 UpdatesClient) Delete(ctx context.Context, id UpdateId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 UpdatesClient) DeleteThenPoll(ctx context.Context, id UpdateId) 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/azurestackhci/2023-08-01-preview/updates/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/method_get.go deleted file mode 100644 index 7608d9b1fdd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package updates - -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 *Update -} - -// Get ... -func (c UpdatesClient) Get(ctx context.Context, id UpdateId) (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 Update - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_list.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/method_list.go deleted file mode 100644 index c0ef9b34fe6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package updates - -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 *[]Update -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Update -} - -// List ... -func (c UpdatesClient) List(ctx context.Context, id ClusterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updates", 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 *[]Update `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 UpdatesClient) ListComplete(ctx context.Context, id ClusterId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UpdateOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UpdatesClient) ListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate UpdateOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Update, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01-preview/updates/method_post.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/method_post.go deleted file mode 100644 index b41ccb849bb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_post.go +++ /dev/null @@ -1,70 +0,0 @@ -package updates - -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 PostOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Post ... -func (c UpdatesClient) Post(ctx context.Context, id UpdateId) (result PostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/apply", 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 -} - -// PostThenPoll performs Post then polls until it's completed -func (c UpdatesClient) PostThenPoll(ctx context.Context, id UpdateId) error { - result, err := c.Post(ctx, id) - if err != nil { - return fmt.Errorf("performing Post: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Post: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_put.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/method_put.go deleted file mode 100644 index 1da3ed2ae54..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/method_put.go +++ /dev/null @@ -1,58 +0,0 @@ -package updates - -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 PutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Update -} - -// Put ... -func (c UpdatesClient) Put(ctx context.Context, id UpdateId, input Update) (result PutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Update - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_packageversioninfo.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_packageversioninfo.go deleted file mode 100644 index 2376b23ed11..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_packageversioninfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package updates - -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 PackageVersionInfo struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - PackageType *string `json:"packageType,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *PackageVersionInfo) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *PackageVersionInfo) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresult.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresult.go deleted file mode 100644 index 22b924a1d10..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresult.go +++ /dev/null @@ -1,37 +0,0 @@ -package updates - -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 PrecheckResult struct { - AdditionalData *string `json:"additionalData,omitempty"` - Description *string `json:"description,omitempty"` - HealthCheckSource *string `json:"healthCheckSource,omitempty"` - Name *string `json:"name,omitempty"` - Remediation *string `json:"remediation,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Status *Status `json:"status,omitempty"` - Tags *PrecheckResultTags `json:"tags,omitempty"` - TargetResourceID *string `json:"targetResourceID,omitempty"` - TargetResourceName *string `json:"targetResourceName,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (o *PrecheckResult) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *PrecheckResult) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresulttags.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresulttags.go deleted file mode 100644 index eac41de78dc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_precheckresulttags.go +++ /dev/null @@ -1,9 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrecheckResultTags struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_update.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_update.go deleted file mode 100644 index c5722f69cb2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_update.go +++ /dev/null @@ -1,17 +0,0 @@ -package updates - -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 Update struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *UpdateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateprerequisite.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateprerequisite.go deleted file mode 100644 index 42904efc591..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateprerequisite.go +++ /dev/null @@ -1,10 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdatePrerequisite struct { - PackageName *string `json:"packageName,omitempty"` - UpdateType *string `json:"updateType,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateproperties.go deleted file mode 100644 index 7c2ffff7e51..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updateproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -package updates - -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 UpdateProperties struct { - AdditionalProperties *string `json:"additionalProperties,omitempty"` - AvailabilityType *AvailabilityType `json:"availabilityType,omitempty"` - ComponentVersions *[]PackageVersionInfo `json:"componentVersions,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - HealthCheckDate *string `json:"healthCheckDate,omitempty"` - HealthCheckResult *[]PrecheckResult `json:"healthCheckResult,omitempty"` - HealthState *HealthState `json:"healthState,omitempty"` - InstalledDate *string `json:"installedDate,omitempty"` - PackagePath *string `json:"packagePath,omitempty"` - PackageSizeInMb *float64 `json:"packageSizeInMb,omitempty"` - PackageType *string `json:"packageType,omitempty"` - Prerequisites *[]UpdatePrerequisite `json:"prerequisites,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Publisher *string `json:"publisher,omitempty"` - RebootRequired *RebootRequirement `json:"rebootRequired,omitempty"` - ReleaseLink *string `json:"releaseLink,omitempty"` - State *State `json:"state,omitempty"` - UpdateStateProperties *UpdateStateProperties `json:"updateStateProperties,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *UpdateProperties) GetHealthCheckDateAsTime() (*time.Time, error) { - if o.HealthCheckDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.HealthCheckDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateProperties) SetHealthCheckDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.HealthCheckDate = &formatted -} - -func (o *UpdateProperties) GetInstalledDateAsTime() (*time.Time, error) { - if o.InstalledDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.InstalledDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateProperties) SetInstalledDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.InstalledDate = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updatestateproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updatestateproperties.go deleted file mode 100644 index 4a17ca955a8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/model_updatestateproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateStateProperties struct { - NotifyMessage *string `json:"notifyMessage,omitempty"` - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updates/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/predicates.go deleted file mode 100644 index d64c5b9063f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p UpdateOperationPredicate) Matches(input Update) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/azurestackhci/2023-08-01-preview/updates/version.go b/resource-manager/azurestackhci/2023-08-01-preview/updates/version.go deleted file mode 100644 index 578234a3474..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updates/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/README.md b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/README.md deleted file mode 100644 index e63f282d7d7..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries` Documentation - -The `updatesummaries` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-01-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/azurestackhci/2023-08-01-preview/updatesummaries" -``` - - -### Client Initialization - -```go -client := updatesummaries.NewUpdateSummariesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdateSummariesClient.Delete` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdateSummariesClient.Get` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -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: `UpdateSummariesClient.List` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// 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: `UpdateSummariesClient.Put` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := updatesummaries.UpdateSummaries{ - // ... -} - - -read, err := client.Put(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/azurestackhci/2023-08-01-preview/updatesummaries/client.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/client.go deleted file mode 100644 index 869223878e1..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updatesummaries - -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 UpdateSummariesClient struct { - Client *resourcemanager.Client -} - -func NewUpdateSummariesClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdateSummariesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updatesummaries", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdateSummariesClient: %+v", err) - } - - return &UpdateSummariesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/constants.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/constants.go deleted file mode 100644 index ddc5ca86b5c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/constants.go +++ /dev/null @@ -1,263 +0,0 @@ -package updatesummaries - -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 HealthState string - -const ( - HealthStateError HealthState = "Error" - HealthStateFailure HealthState = "Failure" - HealthStateInProgress HealthState = "InProgress" - HealthStateSuccess HealthState = "Success" - HealthStateUnknown HealthState = "Unknown" - HealthStateWarning HealthState = "Warning" -) - -func PossibleValuesForHealthState() []string { - return []string{ - string(HealthStateError), - string(HealthStateFailure), - string(HealthStateInProgress), - string(HealthStateSuccess), - string(HealthStateUnknown), - string(HealthStateWarning), - } -} - -func (s *HealthState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHealthState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHealthState(input string) (*HealthState, error) { - vals := map[string]HealthState{ - "error": HealthStateError, - "failure": HealthStateFailure, - "inprogress": HealthStateInProgress, - "success": HealthStateSuccess, - "unknown": HealthStateUnknown, - "warning": HealthStateWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HealthState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateFailed), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "failed": ProvisioningStateFailed, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type Severity string - -const ( - SeverityCritical Severity = "Critical" - SeverityHidden Severity = "Hidden" - SeverityInformational Severity = "Informational" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityCritical), - string(SeverityHidden), - string(SeverityInformational), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "critical": SeverityCritical, - "hidden": SeverityHidden, - "informational": SeverityInformational, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type UpdateSummariesPropertiesState string - -const ( - UpdateSummariesPropertiesStateAppliedSuccessfully UpdateSummariesPropertiesState = "AppliedSuccessfully" - UpdateSummariesPropertiesStateNeedsAttention UpdateSummariesPropertiesState = "NeedsAttention" - UpdateSummariesPropertiesStatePreparationFailed UpdateSummariesPropertiesState = "PreparationFailed" - UpdateSummariesPropertiesStatePreparationInProgress UpdateSummariesPropertiesState = "PreparationInProgress" - UpdateSummariesPropertiesStateUnknown UpdateSummariesPropertiesState = "Unknown" - UpdateSummariesPropertiesStateUpdateAvailable UpdateSummariesPropertiesState = "UpdateAvailable" - UpdateSummariesPropertiesStateUpdateFailed UpdateSummariesPropertiesState = "UpdateFailed" - UpdateSummariesPropertiesStateUpdateInProgress UpdateSummariesPropertiesState = "UpdateInProgress" -) - -func PossibleValuesForUpdateSummariesPropertiesState() []string { - return []string{ - string(UpdateSummariesPropertiesStateAppliedSuccessfully), - string(UpdateSummariesPropertiesStateNeedsAttention), - string(UpdateSummariesPropertiesStatePreparationFailed), - string(UpdateSummariesPropertiesStatePreparationInProgress), - string(UpdateSummariesPropertiesStateUnknown), - string(UpdateSummariesPropertiesStateUpdateAvailable), - string(UpdateSummariesPropertiesStateUpdateFailed), - string(UpdateSummariesPropertiesStateUpdateInProgress), - } -} - -func (s *UpdateSummariesPropertiesState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateSummariesPropertiesState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateSummariesPropertiesState(input string) (*UpdateSummariesPropertiesState, error) { - vals := map[string]UpdateSummariesPropertiesState{ - "appliedsuccessfully": UpdateSummariesPropertiesStateAppliedSuccessfully, - "needsattention": UpdateSummariesPropertiesStateNeedsAttention, - "preparationfailed": UpdateSummariesPropertiesStatePreparationFailed, - "preparationinprogress": UpdateSummariesPropertiesStatePreparationInProgress, - "unknown": UpdateSummariesPropertiesStateUnknown, - "updateavailable": UpdateSummariesPropertiesStateUpdateAvailable, - "updatefailed": UpdateSummariesPropertiesStateUpdateFailed, - "updateinprogress": UpdateSummariesPropertiesStateUpdateInProgress, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateSummariesPropertiesState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster.go deleted file mode 100644 index 42e4632b7b8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package updatesummaries - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster_test.go deleted file mode 100644 index 6e7ce084f3a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package updatesummaries - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01-preview/updatesummaries/method_delete.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_delete.go deleted file mode 100644 index b3ba841c6be..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package updatesummaries - -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 UpdateSummariesClient) Delete(ctx context.Context, id ClusterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: fmt.Sprintf("%s/updateSummaries/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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c UpdateSummariesClient) DeleteThenPoll(ctx context.Context, id ClusterId) 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/azurestackhci/2023-08-01-preview/updatesummaries/method_get.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_get.go deleted file mode 100644 index 874fcd2d831..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package updatesummaries - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UpdateSummaries -} - -// Get ... -func (c UpdateSummariesClient) Get(ctx context.Context, id ClusterId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updateSummaries/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 UpdateSummaries - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_list.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_list.go deleted file mode 100644 index 59c86bf4570..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package updatesummaries - -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 *[]UpdateSummaries -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []UpdateSummaries -} - -// List ... -func (c UpdateSummariesClient) List(ctx context.Context, id ClusterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updateSummaries", 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 *[]UpdateSummaries `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 UpdateSummariesClient) ListComplete(ctx context.Context, id ClusterId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UpdateSummariesOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UpdateSummariesClient) ListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate UpdateSummariesOperationPredicate) (result ListCompleteResult, err error) { - items := make([]UpdateSummaries, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01-preview/updatesummaries/method_put.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_put.go deleted file mode 100644 index a8b151c8e57..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/method_put.go +++ /dev/null @@ -1,59 +0,0 @@ -package updatesummaries - -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 PutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UpdateSummaries -} - -// Put ... -func (c UpdateSummariesClient) Put(ctx context.Context, id ClusterId, input UpdateSummaries) (result PutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/updateSummaries/default", 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 UpdateSummaries - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_packageversioninfo.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_packageversioninfo.go deleted file mode 100644 index 33735a82452..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_packageversioninfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package updatesummaries - -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 PackageVersionInfo struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - PackageType *string `json:"packageType,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *PackageVersionInfo) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *PackageVersionInfo) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresult.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresult.go deleted file mode 100644 index 877f1918f9e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresult.go +++ /dev/null @@ -1,37 +0,0 @@ -package updatesummaries - -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 PrecheckResult struct { - AdditionalData *string `json:"additionalData,omitempty"` - Description *string `json:"description,omitempty"` - HealthCheckSource *string `json:"healthCheckSource,omitempty"` - Name *string `json:"name,omitempty"` - Remediation *string `json:"remediation,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Status *Status `json:"status,omitempty"` - Tags *PrecheckResultTags `json:"tags,omitempty"` - TargetResourceID *string `json:"targetResourceID,omitempty"` - TargetResourceName *string `json:"targetResourceName,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (o *PrecheckResult) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *PrecheckResult) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresulttags.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresulttags.go deleted file mode 100644 index 4dffe374f28..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_precheckresulttags.go +++ /dev/null @@ -1,9 +0,0 @@ -package updatesummaries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrecheckResultTags struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummaries.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummaries.go deleted file mode 100644 index 2c73541f2ed..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummaries.go +++ /dev/null @@ -1,17 +0,0 @@ -package updatesummaries - -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 UpdateSummaries struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *UpdateSummariesProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummariesproperties.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummariesproperties.go deleted file mode 100644 index f6a0a7b4441..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/model_updatesummariesproperties.go +++ /dev/null @@ -1,60 +0,0 @@ -package updatesummaries - -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 UpdateSummariesProperties struct { - CurrentVersion *string `json:"currentVersion,omitempty"` - HardwareModel *string `json:"hardwareModel,omitempty"` - HealthCheckDate *string `json:"healthCheckDate,omitempty"` - HealthCheckResult *[]PrecheckResult `json:"healthCheckResult,omitempty"` - HealthState *HealthState `json:"healthState,omitempty"` - LastChecked *string `json:"lastChecked,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - OemFamily *string `json:"oemFamily,omitempty"` - PackageVersions *[]PackageVersionInfo `json:"packageVersions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - State *UpdateSummariesPropertiesState `json:"state,omitempty"` -} - -func (o *UpdateSummariesProperties) GetHealthCheckDateAsTime() (*time.Time, error) { - if o.HealthCheckDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.HealthCheckDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSummariesProperties) SetHealthCheckDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.HealthCheckDate = &formatted -} - -func (o *UpdateSummariesProperties) GetLastCheckedAsTime() (*time.Time, error) { - if o.LastChecked == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastChecked, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSummariesProperties) SetLastCheckedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastChecked = &formatted -} - -func (o *UpdateSummariesProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSummariesProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/predicates.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/predicates.go deleted file mode 100644 index ec256ccef50..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package updatesummaries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateSummariesOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p UpdateSummariesOperationPredicate) Matches(input UpdateSummaries) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/azurestackhci/2023-08-01-preview/updatesummaries/version.go b/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/version.go deleted file mode 100644 index ed77687702b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01-preview/updatesummaries/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updatesummaries - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updatesummaries/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/README.md b/resource-manager/azurestackhci/2023-08-01/arcsettings/README.md deleted file mode 100644 index f6088558485..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/README.md +++ /dev/null @@ -1,163 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/arcsettings` Documentation - -The `arcsettings` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/arcsettings" -``` - - -### Client Initialization - -```go -client := arcsettings.NewArcSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsCreate` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -payload := arcsettings.ArcSetting{ - // ... -} - - -read, err := client.ArcSettingsCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsDelete` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -if err := client.ArcSettingsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsGet` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -read, err := client.ArcSettingsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsListByCluster` - -```go -ctx := context.TODO() -id := arcsettings.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ArcSettingsListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ArcSettingsListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ArcSettingsClient.ArcSettingsUpdate` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -payload := arcsettings.ArcSettingsPatch{ - // ... -} - - -read, err := client.ArcSettingsUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.ConsentAndInstallDefaultExtensions` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -read, err := client.ConsentAndInstallDefaultExtensions(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.CreateIdentity` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -if err := client.CreateIdentityThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ArcSettingsClient.GeneratePassword` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -read, err := client.GeneratePassword(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ArcSettingsClient.InitializeDisableProcess` - -```go -ctx := context.TODO() -id := arcsettings.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -if err := client.InitializeDisableProcessThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/client.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/client.go deleted file mode 100644 index bf76b03a6da..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package arcsettings - -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 ArcSettingsClient struct { - Client *resourcemanager.Client -} - -func NewArcSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*ArcSettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "arcsettings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ArcSettingsClient: %+v", err) - } - - return &ArcSettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/constants.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/constants.go deleted file mode 100644 index 9783fea054f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package arcsettings - -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 ArcSettingAggregateState string - -const ( - ArcSettingAggregateStateAccepted ArcSettingAggregateState = "Accepted" - ArcSettingAggregateStateCanceled ArcSettingAggregateState = "Canceled" - ArcSettingAggregateStateConnected ArcSettingAggregateState = "Connected" - ArcSettingAggregateStateCreating ArcSettingAggregateState = "Creating" - ArcSettingAggregateStateDeleted ArcSettingAggregateState = "Deleted" - ArcSettingAggregateStateDeleting ArcSettingAggregateState = "Deleting" - ArcSettingAggregateStateDisableInProgress ArcSettingAggregateState = "DisableInProgress" - ArcSettingAggregateStateDisconnected ArcSettingAggregateState = "Disconnected" - ArcSettingAggregateStateError ArcSettingAggregateState = "Error" - ArcSettingAggregateStateFailed ArcSettingAggregateState = "Failed" - ArcSettingAggregateStateInProgress ArcSettingAggregateState = "InProgress" - ArcSettingAggregateStateMoving ArcSettingAggregateState = "Moving" - ArcSettingAggregateStateNotSpecified ArcSettingAggregateState = "NotSpecified" - ArcSettingAggregateStatePartiallyConnected ArcSettingAggregateState = "PartiallyConnected" - ArcSettingAggregateStatePartiallySucceeded ArcSettingAggregateState = "PartiallySucceeded" - ArcSettingAggregateStateProvisioning ArcSettingAggregateState = "Provisioning" - ArcSettingAggregateStateSucceeded ArcSettingAggregateState = "Succeeded" - ArcSettingAggregateStateUpdating ArcSettingAggregateState = "Updating" -) - -func PossibleValuesForArcSettingAggregateState() []string { - return []string{ - string(ArcSettingAggregateStateAccepted), - string(ArcSettingAggregateStateCanceled), - string(ArcSettingAggregateStateConnected), - string(ArcSettingAggregateStateCreating), - string(ArcSettingAggregateStateDeleted), - string(ArcSettingAggregateStateDeleting), - string(ArcSettingAggregateStateDisableInProgress), - string(ArcSettingAggregateStateDisconnected), - string(ArcSettingAggregateStateError), - string(ArcSettingAggregateStateFailed), - string(ArcSettingAggregateStateInProgress), - string(ArcSettingAggregateStateMoving), - string(ArcSettingAggregateStateNotSpecified), - string(ArcSettingAggregateStatePartiallyConnected), - string(ArcSettingAggregateStatePartiallySucceeded), - string(ArcSettingAggregateStateProvisioning), - string(ArcSettingAggregateStateSucceeded), - string(ArcSettingAggregateStateUpdating), - } -} - -func (s *ArcSettingAggregateState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseArcSettingAggregateState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseArcSettingAggregateState(input string) (*ArcSettingAggregateState, error) { - vals := map[string]ArcSettingAggregateState{ - "accepted": ArcSettingAggregateStateAccepted, - "canceled": ArcSettingAggregateStateCanceled, - "connected": ArcSettingAggregateStateConnected, - "creating": ArcSettingAggregateStateCreating, - "deleted": ArcSettingAggregateStateDeleted, - "deleting": ArcSettingAggregateStateDeleting, - "disableinprogress": ArcSettingAggregateStateDisableInProgress, - "disconnected": ArcSettingAggregateStateDisconnected, - "error": ArcSettingAggregateStateError, - "failed": ArcSettingAggregateStateFailed, - "inprogress": ArcSettingAggregateStateInProgress, - "moving": ArcSettingAggregateStateMoving, - "notspecified": ArcSettingAggregateStateNotSpecified, - "partiallyconnected": ArcSettingAggregateStatePartiallyConnected, - "partiallysucceeded": ArcSettingAggregateStatePartiallySucceeded, - "provisioning": ArcSettingAggregateStateProvisioning, - "succeeded": ArcSettingAggregateStateSucceeded, - "updating": ArcSettingAggregateStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ArcSettingAggregateState(input) - return &out, nil -} - -type NodeArcState string - -const ( - NodeArcStateAccepted NodeArcState = "Accepted" - NodeArcStateCanceled NodeArcState = "Canceled" - NodeArcStateConnected NodeArcState = "Connected" - NodeArcStateCreating NodeArcState = "Creating" - NodeArcStateDeleted NodeArcState = "Deleted" - NodeArcStateDeleting NodeArcState = "Deleting" - NodeArcStateDisableInProgress NodeArcState = "DisableInProgress" - NodeArcStateDisconnected NodeArcState = "Disconnected" - NodeArcStateError NodeArcState = "Error" - NodeArcStateFailed NodeArcState = "Failed" - NodeArcStateInProgress NodeArcState = "InProgress" - NodeArcStateMoving NodeArcState = "Moving" - NodeArcStateNotSpecified NodeArcState = "NotSpecified" - NodeArcStatePartiallyConnected NodeArcState = "PartiallyConnected" - NodeArcStatePartiallySucceeded NodeArcState = "PartiallySucceeded" - NodeArcStateProvisioning NodeArcState = "Provisioning" - NodeArcStateSucceeded NodeArcState = "Succeeded" - NodeArcStateUpdating NodeArcState = "Updating" -) - -func PossibleValuesForNodeArcState() []string { - return []string{ - string(NodeArcStateAccepted), - string(NodeArcStateCanceled), - string(NodeArcStateConnected), - string(NodeArcStateCreating), - string(NodeArcStateDeleted), - string(NodeArcStateDeleting), - string(NodeArcStateDisableInProgress), - string(NodeArcStateDisconnected), - string(NodeArcStateError), - string(NodeArcStateFailed), - string(NodeArcStateInProgress), - string(NodeArcStateMoving), - string(NodeArcStateNotSpecified), - string(NodeArcStatePartiallyConnected), - string(NodeArcStatePartiallySucceeded), - string(NodeArcStateProvisioning), - string(NodeArcStateSucceeded), - string(NodeArcStateUpdating), - } -} - -func (s *NodeArcState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNodeArcState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNodeArcState(input string) (*NodeArcState, error) { - vals := map[string]NodeArcState{ - "accepted": NodeArcStateAccepted, - "canceled": NodeArcStateCanceled, - "connected": NodeArcStateConnected, - "creating": NodeArcStateCreating, - "deleted": NodeArcStateDeleted, - "deleting": NodeArcStateDeleting, - "disableinprogress": NodeArcStateDisableInProgress, - "disconnected": NodeArcStateDisconnected, - "error": NodeArcStateError, - "failed": NodeArcStateFailed, - "inprogress": NodeArcStateInProgress, - "moving": NodeArcStateMoving, - "notspecified": NodeArcStateNotSpecified, - "partiallyconnected": NodeArcStatePartiallyConnected, - "partiallysucceeded": NodeArcStatePartiallySucceeded, - "provisioning": NodeArcStateProvisioning, - "succeeded": NodeArcStateSucceeded, - "updating": NodeArcStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NodeArcState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateError ProvisioningState = "Error" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisableInProgress), - string(ProvisioningStateDisconnected), - string(ProvisioningStateError), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disableinprogress": ProvisioningStateDisableInProgress, - "disconnected": ProvisioningStateDisconnected, - "error": ProvisioningStateError, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting.go deleted file mode 100644 index 1d17d3a2b54..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting.go +++ /dev/null @@ -1,139 +0,0 @@ -package arcsettings - -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(&ArcSettingId{}) -} - -var _ resourceids.ResourceId = &ArcSettingId{} - -// ArcSettingId is a struct representing the Resource ID for a Arc Setting -type ArcSettingId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ArcSettingName string -} - -// NewArcSettingID returns a new ArcSettingId struct -func NewArcSettingID(subscriptionId string, resourceGroupName string, clusterName string, arcSettingName string) ArcSettingId { - return ArcSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ArcSettingName: arcSettingName, - } -} - -// ParseArcSettingID parses 'input' into a ArcSettingId -func ParseArcSettingID(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseArcSettingIDInsensitively parses 'input' case-insensitively into a ArcSettingId -// note: this method should only be used for API response data and not user input -func ParseArcSettingIDInsensitively(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ArcSettingId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ArcSettingName, ok = input.Parsed["arcSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arcSettingName", input) - } - - return nil -} - -// ValidateArcSettingID checks that 'input' can be parsed as a Arc Setting ID -func ValidateArcSettingID(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 := ParseArcSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Arc Setting ID -func (id ArcSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/arcSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ArcSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Arc Setting ID -func (id ArcSettingId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticArcSettings", "arcSettings", "arcSettings"), - resourceids.UserSpecifiedSegment("arcSettingName", "arcSettingValue"), - } -} - -// String returns a human-readable description of this Arc Setting ID -func (id ArcSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Arc Setting Name: %q", id.ArcSettingName), - } - return fmt.Sprintf("Arc Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting_test.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting_test.go deleted file mode 100644 index ee3f47acf2f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_arcsetting_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package arcsettings - -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 = &ArcSettingId{} - -func TestNewArcSettingID(t *testing.T) { - id := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ArcSettingName != "arcSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArcSettingName'", id.ArcSettingName, "arcSettingValue") - } -} - -func TestFormatArcSettingID(t *testing.T) { - actual := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseArcSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestParseArcSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ArcSettingName: "aRcSeTtInGvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestSegmentsForArcSettingId(t *testing.T) { - segments := ArcSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ArcSettingId 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/azurestackhci/2023-08-01/arcsettings/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster.go deleted file mode 100644 index efec5d31747..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package arcsettings - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster_test.go deleted file mode 100644 index ca61c45c616..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package arcsettings - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/arcsettings/method_arcsettingscreate.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingscreate.go deleted file mode 100644 index e23e135a7a4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingscreate.go +++ /dev/null @@ -1,58 +0,0 @@ -package arcsettings - -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 ArcSettingsCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ArcSettingsCreate ... -func (c ArcSettingsClient) ArcSettingsCreate(ctx context.Context, id ArcSettingId, input ArcSetting) (result ArcSettingsCreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsdelete.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsdelete.go deleted file mode 100644 index c7d5b6dd8d0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package arcsettings - -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 ArcSettingsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ArcSettingsDelete ... -func (c ArcSettingsClient) ArcSettingsDelete(ctx context.Context, id ArcSettingId) (result ArcSettingsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// ArcSettingsDeleteThenPoll performs ArcSettingsDelete then polls until it's completed -func (c ArcSettingsClient) ArcSettingsDeleteThenPoll(ctx context.Context, id ArcSettingId) error { - result, err := c.ArcSettingsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing ArcSettingsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ArcSettingsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsget.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsget.go deleted file mode 100644 index da38efd7c84..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package arcsettings - -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 ArcSettingsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ArcSettingsGet ... -func (c ArcSettingsClient) ArcSettingsGet(ctx context.Context, id ArcSettingId) (result ArcSettingsGetOperationResponse, 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingslistbycluster.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingslistbycluster.go deleted file mode 100644 index 908176e84fa..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingslistbycluster.go +++ /dev/null @@ -1,91 +0,0 @@ -package arcsettings - -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 ArcSettingsListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ArcSetting -} - -type ArcSettingsListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []ArcSetting -} - -// ArcSettingsListByCluster ... -func (c ArcSettingsClient) ArcSettingsListByCluster(ctx context.Context, id ClusterId) (result ArcSettingsListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/arcSettings", 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 *[]ArcSetting `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ArcSettingsListByClusterComplete retrieves all the results into a single object -func (c ArcSettingsClient) ArcSettingsListByClusterComplete(ctx context.Context, id ClusterId) (ArcSettingsListByClusterCompleteResult, error) { - return c.ArcSettingsListByClusterCompleteMatchingPredicate(ctx, id, ArcSettingOperationPredicate{}) -} - -// ArcSettingsListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ArcSettingsClient) ArcSettingsListByClusterCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ArcSettingOperationPredicate) (result ArcSettingsListByClusterCompleteResult, err error) { - items := make([]ArcSetting, 0) - - resp, err := c.ArcSettingsListByCluster(ctx, id) - if err != nil { - 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 = ArcSettingsListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsupdate.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsupdate.go deleted file mode 100644 index 6b942fa5f05..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_arcsettingsupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package arcsettings - -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 ArcSettingsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ArcSettingsUpdate ... -func (c ArcSettingsClient) ArcSettingsUpdate(ctx context.Context, id ArcSettingId, input ArcSettingsPatch) (result ArcSettingsUpdateOperationResponse, 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_consentandinstalldefaultextensions.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_consentandinstalldefaultextensions.go deleted file mode 100644 index 59282809851..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_consentandinstalldefaultextensions.go +++ /dev/null @@ -1,55 +0,0 @@ -package arcsettings - -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 ConsentAndInstallDefaultExtensionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ArcSetting -} - -// ConsentAndInstallDefaultExtensions ... -func (c ArcSettingsClient) ConsentAndInstallDefaultExtensions(ctx context.Context, id ArcSettingId) (result ConsentAndInstallDefaultExtensionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/consentAndInstallDefaultExtensions", 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 ArcSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_createidentity.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_createidentity.go deleted file mode 100644 index 1a9bc34c033..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_createidentity.go +++ /dev/null @@ -1,71 +0,0 @@ -package arcsettings - -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 CreateIdentityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ArcIdentityResponse -} - -// CreateIdentity ... -func (c ArcSettingsClient) CreateIdentity(ctx context.Context, id ArcSettingId) (result CreateIdentityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createArcIdentity", 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 -} - -// CreateIdentityThenPoll performs CreateIdentity then polls until it's completed -func (c ArcSettingsClient) CreateIdentityThenPoll(ctx context.Context, id ArcSettingId) error { - result, err := c.CreateIdentity(ctx, id) - if err != nil { - return fmt.Errorf("performing CreateIdentity: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateIdentity: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_generatepassword.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_generatepassword.go deleted file mode 100644 index 4f9aaacb077..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_generatepassword.go +++ /dev/null @@ -1,55 +0,0 @@ -package arcsettings - -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 GeneratePasswordOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PasswordCredential -} - -// GeneratePassword ... -func (c ArcSettingsClient) GeneratePassword(ctx context.Context, id ArcSettingId) (result GeneratePasswordOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatePassword", 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 PasswordCredential - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_initializedisableprocess.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/method_initializedisableprocess.go deleted file mode 100644 index 206fd88abb1..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/method_initializedisableprocess.go +++ /dev/null @@ -1,70 +0,0 @@ -package arcsettings - -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 InitializeDisableProcessOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// InitializeDisableProcess ... -func (c ArcSettingsClient) InitializeDisableProcess(ctx context.Context, id ArcSettingId) (result InitializeDisableProcessOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/initializeDisableProcess", 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 -} - -// InitializeDisableProcessThenPoll performs InitializeDisableProcess then polls until it's completed -func (c ArcSettingsClient) InitializeDisableProcessThenPoll(ctx context.Context, id ArcSettingId) error { - result, err := c.InitializeDisableProcess(ctx, id) - if err != nil { - return fmt.Errorf("performing InitializeDisableProcess: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InitializeDisableProcess: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponse.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponse.go deleted file mode 100644 index 08d1275ea50..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcIdentityResponse struct { - Properties *ArcIdentityResponseProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponseproperties.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponseproperties.go deleted file mode 100644 index 4e33abb10de..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcidentityresponseproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcIdentityResponseProperties struct { - ArcApplicationClientId *string `json:"arcApplicationClientId,omitempty"` - ArcApplicationObjectId *string `json:"arcApplicationObjectId,omitempty"` - ArcApplicationTenantId *string `json:"arcApplicationTenantId,omitempty"` - ArcServicePrincipalObjectId *string `json:"arcServicePrincipalObjectId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsetting.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsetting.go deleted file mode 100644 index 792133291a2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsetting.go +++ /dev/null @@ -1,16 +0,0 @@ -package arcsettings - -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 ArcSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ArcSettingProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingproperties.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingproperties.go deleted file mode 100644 index 436656a1d00..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingProperties struct { - AggregateState *ArcSettingAggregateState `json:"aggregateState,omitempty"` - ArcApplicationClientId *string `json:"arcApplicationClientId,omitempty"` - ArcApplicationObjectId *string `json:"arcApplicationObjectId,omitempty"` - ArcApplicationTenantId *string `json:"arcApplicationTenantId,omitempty"` - ArcInstanceResourceGroup *string `json:"arcInstanceResourceGroup,omitempty"` - ArcServicePrincipalObjectId *string `json:"arcServicePrincipalObjectId,omitempty"` - ConnectivityProperties *interface{} `json:"connectivityProperties,omitempty"` - DefaultExtensions *[]DefaultExtensionDetails `json:"defaultExtensions,omitempty"` - PerNodeDetails *[]PerNodeState `json:"perNodeDetails,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatch.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatch.go deleted file mode 100644 index ff9c88a3664..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatch.go +++ /dev/null @@ -1,9 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingsPatch struct { - Properties *ArcSettingsPatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatchproperties.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatchproperties.go deleted file mode 100644 index 7a806bba490..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_arcsettingspatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingsPatchProperties struct { - ConnectivityProperties *interface{} `json:"connectivityProperties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_defaultextensiondetails.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_defaultextensiondetails.go deleted file mode 100644 index 392d04915bb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_defaultextensiondetails.go +++ /dev/null @@ -1,27 +0,0 @@ -package arcsettings - -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 DefaultExtensionDetails struct { - Category *string `json:"category,omitempty"` - ConsentTime *string `json:"consentTime,omitempty"` -} - -func (o *DefaultExtensionDetails) GetConsentTimeAsTime() (*time.Time, error) { - if o.ConsentTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ConsentTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DefaultExtensionDetails) SetConsentTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ConsentTime = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_passwordcredential.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_passwordcredential.go deleted file mode 100644 index cf56a2624c0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_passwordcredential.go +++ /dev/null @@ -1,41 +0,0 @@ -package arcsettings - -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 PasswordCredential struct { - EndDateTime *string `json:"endDateTime,omitempty"` - KeyId *string `json:"keyId,omitempty"` - SecretText *string `json:"secretText,omitempty"` - StartDateTime *string `json:"startDateTime,omitempty"` -} - -func (o *PasswordCredential) GetEndDateTimeAsTime() (*time.Time, error) { - if o.EndDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PasswordCredential) SetEndDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndDateTime = &formatted -} - -func (o *PasswordCredential) GetStartDateTimeAsTime() (*time.Time, error) { - if o.StartDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PasswordCredential) SetStartDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartDateTime = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_pernodestate.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/model_pernodestate.go deleted file mode 100644 index 22f862fc357..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/model_pernodestate.go +++ /dev/null @@ -1,10 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PerNodeState struct { - ArcInstance *string `json:"arcInstance,omitempty"` - Name *string `json:"name,omitempty"` - State *NodeArcState `json:"state,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/arcsettings/predicates.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/predicates.go deleted file mode 100644 index 98d1fe0a836..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package arcsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ArcSettingOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ArcSettingOperationPredicate) Matches(input ArcSetting) 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/azurestackhci/2023-08-01/arcsettings/version.go b/resource-manager/azurestackhci/2023-08-01/arcsettings/version.go deleted file mode 100644 index 2de594bb31f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/arcsettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package arcsettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/arcsettings/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/client.go b/resource-manager/azurestackhci/2023-08-01/client.go deleted file mode 100644 index 8113caa4ff2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/client.go +++ /dev/null @@ -1,109 +0,0 @@ -package v2023_08_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/azurestackhci/2023-08-01/arcsettings" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/cluster" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/clusters" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/extensions" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/offers" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/publishers" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/skuses" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/updateruns" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/updates" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/updatesummaries" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - ArcSettings *arcsettings.ArcSettingsClient - Cluster *cluster.ClusterClient - Clusters *clusters.ClustersClient - Extensions *extensions.ExtensionsClient - Offers *offers.OffersClient - Publishers *publishers.PublishersClient - Skuses *skuses.SkusesClient - UpdateRuns *updateruns.UpdateRunsClient - UpdateSummaries *updatesummaries.UpdateSummariesClient - Updates *updates.UpdatesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - arcSettingsClient, err := arcsettings.NewArcSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ArcSettings client: %+v", err) - } - configureFunc(arcSettingsClient.Client) - - clusterClient, err := cluster.NewClusterClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Cluster client: %+v", err) - } - configureFunc(clusterClient.Client) - - clustersClient, err := clusters.NewClustersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Clusters client: %+v", err) - } - configureFunc(clustersClient.Client) - - extensionsClient, err := extensions.NewExtensionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Extensions client: %+v", err) - } - configureFunc(extensionsClient.Client) - - offersClient, err := offers.NewOffersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Offers client: %+v", err) - } - configureFunc(offersClient.Client) - - publishersClient, err := publishers.NewPublishersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Publishers client: %+v", err) - } - configureFunc(publishersClient.Client) - - skusesClient, err := skuses.NewSkusesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Skuses client: %+v", err) - } - configureFunc(skusesClient.Client) - - updateRunsClient, err := updateruns.NewUpdateRunsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building UpdateRuns client: %+v", err) - } - configureFunc(updateRunsClient.Client) - - updateSummariesClient, err := updatesummaries.NewUpdateSummariesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building UpdateSummaries client: %+v", err) - } - configureFunc(updateSummariesClient.Client) - - updatesClient, err := updates.NewUpdatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Updates client: %+v", err) - } - configureFunc(updatesClient.Client) - - return &Client{ - ArcSettings: arcSettingsClient, - Cluster: clusterClient, - Clusters: clustersClient, - Extensions: extensionsClient, - Offers: offersClient, - Publishers: publishersClient, - Skuses: skusesClient, - UpdateRuns: updateRunsClient, - UpdateSummaries: updateSummariesClient, - Updates: updatesClient, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/README.md b/resource-manager/azurestackhci/2023-08-01/cluster/README.md deleted file mode 100644 index 1132697f460..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/README.md +++ /dev/null @@ -1,66 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/cluster` Documentation - -The `cluster` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/cluster" -``` - - -### Client Initialization - -```go -client := cluster.NewClusterClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ClusterClient.CreateIdentity` - -```go -ctx := context.TODO() -id := cluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.CreateIdentityThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClusterClient.ExtendSoftwareAssuranceBenefit` - -```go -ctx := context.TODO() -id := cluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := cluster.SoftwareAssuranceChangeRequest{ - // ... -} - - -if err := client.ExtendSoftwareAssuranceBenefitThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClusterClient.UploadCertificate` - -```go -ctx := context.TODO() -id := cluster.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := cluster.UploadCertificateRequest{ - // ... -} - - -if err := client.UploadCertificateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/client.go b/resource-manager/azurestackhci/2023-08-01/cluster/client.go deleted file mode 100644 index 2a0e60ffb2b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package cluster - -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 ClusterClient struct { - Client *resourcemanager.Client -} - -func NewClusterClientWithBaseURI(sdkApi sdkEnv.Api) (*ClusterClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "cluster", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ClusterClient: %+v", err) - } - - return &ClusterClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/constants.go b/resource-manager/azurestackhci/2023-08-01/cluster/constants.go deleted file mode 100644 index 0c0ca3fed94..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/constants.go +++ /dev/null @@ -1,492 +0,0 @@ -package cluster - -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 ClusterNodeType string - -const ( - ClusterNodeTypeFirstParty ClusterNodeType = "FirstParty" - ClusterNodeTypeThirdParty ClusterNodeType = "ThirdParty" -) - -func PossibleValuesForClusterNodeType() []string { - return []string{ - string(ClusterNodeTypeFirstParty), - string(ClusterNodeTypeThirdParty), - } -} - -func (s *ClusterNodeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseClusterNodeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseClusterNodeType(input string) (*ClusterNodeType, error) { - vals := map[string]ClusterNodeType{ - "firstparty": ClusterNodeTypeFirstParty, - "thirdparty": ClusterNodeTypeThirdParty, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ClusterNodeType(input) - return &out, nil -} - -type ConnectivityStatus string - -const ( - ConnectivityStatusConnected ConnectivityStatus = "Connected" - ConnectivityStatusDisconnected ConnectivityStatus = "Disconnected" - ConnectivityStatusNotConnectedRecently ConnectivityStatus = "NotConnectedRecently" - ConnectivityStatusNotSpecified ConnectivityStatus = "NotSpecified" - ConnectivityStatusNotYetRegistered ConnectivityStatus = "NotYetRegistered" - ConnectivityStatusPartiallyConnected ConnectivityStatus = "PartiallyConnected" -) - -func PossibleValuesForConnectivityStatus() []string { - return []string{ - string(ConnectivityStatusConnected), - string(ConnectivityStatusDisconnected), - string(ConnectivityStatusNotConnectedRecently), - string(ConnectivityStatusNotSpecified), - string(ConnectivityStatusNotYetRegistered), - string(ConnectivityStatusPartiallyConnected), - } -} - -func (s *ConnectivityStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityStatus(input string) (*ConnectivityStatus, error) { - vals := map[string]ConnectivityStatus{ - "connected": ConnectivityStatusConnected, - "disconnected": ConnectivityStatusDisconnected, - "notconnectedrecently": ConnectivityStatusNotConnectedRecently, - "notspecified": ConnectivityStatusNotSpecified, - "notyetregistered": ConnectivityStatusNotYetRegistered, - "partiallyconnected": ConnectivityStatusPartiallyConnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityStatus(input) - return &out, nil -} - -type DiagnosticLevel string - -const ( - DiagnosticLevelBasic DiagnosticLevel = "Basic" - DiagnosticLevelEnhanced DiagnosticLevel = "Enhanced" - DiagnosticLevelOff DiagnosticLevel = "Off" -) - -func PossibleValuesForDiagnosticLevel() []string { - return []string{ - string(DiagnosticLevelBasic), - string(DiagnosticLevelEnhanced), - string(DiagnosticLevelOff), - } -} - -func (s *DiagnosticLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiagnosticLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiagnosticLevel(input string) (*DiagnosticLevel, error) { - vals := map[string]DiagnosticLevel{ - "basic": DiagnosticLevelBasic, - "enhanced": DiagnosticLevelEnhanced, - "off": DiagnosticLevelOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiagnosticLevel(input) - return &out, nil -} - -type ImdsAttestation string - -const ( - ImdsAttestationDisabled ImdsAttestation = "Disabled" - ImdsAttestationEnabled ImdsAttestation = "Enabled" -) - -func PossibleValuesForImdsAttestation() []string { - return []string{ - string(ImdsAttestationDisabled), - string(ImdsAttestationEnabled), - } -} - -func (s *ImdsAttestation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImdsAttestation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImdsAttestation(input string) (*ImdsAttestation, error) { - vals := map[string]ImdsAttestation{ - "disabled": ImdsAttestationDisabled, - "enabled": ImdsAttestationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImdsAttestation(input) - return &out, nil -} - -type OemActivation string - -const ( - OemActivationDisabled OemActivation = "Disabled" - OemActivationEnabled OemActivation = "Enabled" -) - -func PossibleValuesForOemActivation() []string { - return []string{ - string(OemActivationDisabled), - string(OemActivationEnabled), - } -} - -func (s *OemActivation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOemActivation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOemActivation(input string) (*OemActivation, error) { - vals := map[string]OemActivation{ - "disabled": OemActivationDisabled, - "enabled": OemActivationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OemActivation(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisableInProgress), - string(ProvisioningStateDisconnected), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disableinprogress": ProvisioningStateDisableInProgress, - "disconnected": ProvisioningStateDisconnected, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SoftwareAssuranceIntent string - -const ( - SoftwareAssuranceIntentDisable SoftwareAssuranceIntent = "Disable" - SoftwareAssuranceIntentEnable SoftwareAssuranceIntent = "Enable" -) - -func PossibleValuesForSoftwareAssuranceIntent() []string { - return []string{ - string(SoftwareAssuranceIntentDisable), - string(SoftwareAssuranceIntentEnable), - } -} - -func (s *SoftwareAssuranceIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceIntent(input string) (*SoftwareAssuranceIntent, error) { - vals := map[string]SoftwareAssuranceIntent{ - "disable": SoftwareAssuranceIntentDisable, - "enable": SoftwareAssuranceIntentEnable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceIntent(input) - return &out, nil -} - -type SoftwareAssuranceStatus string - -const ( - SoftwareAssuranceStatusDisabled SoftwareAssuranceStatus = "Disabled" - SoftwareAssuranceStatusEnabled SoftwareAssuranceStatus = "Enabled" -) - -func PossibleValuesForSoftwareAssuranceStatus() []string { - return []string{ - string(SoftwareAssuranceStatusDisabled), - string(SoftwareAssuranceStatusEnabled), - } -} - -func (s *SoftwareAssuranceStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceStatus(input string) (*SoftwareAssuranceStatus, error) { - vals := map[string]SoftwareAssuranceStatus{ - "disabled": SoftwareAssuranceStatusDisabled, - "enabled": SoftwareAssuranceStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceStatus(input) - return &out, nil -} - -type Status string - -const ( - StatusConnectedRecently Status = "ConnectedRecently" - StatusDisconnected Status = "Disconnected" - StatusError Status = "Error" - StatusNotConnectedRecently Status = "NotConnectedRecently" - StatusNotSpecified Status = "NotSpecified" - StatusNotYetRegistered Status = "NotYetRegistered" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusConnectedRecently), - string(StatusDisconnected), - string(StatusError), - string(StatusNotConnectedRecently), - string(StatusNotSpecified), - string(StatusNotYetRegistered), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "connectedrecently": StatusConnectedRecently, - "disconnected": StatusDisconnected, - "error": StatusError, - "notconnectedrecently": StatusNotConnectedRecently, - "notspecified": StatusNotSpecified, - "notyetregistered": StatusNotYetRegistered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type WindowsServerSubscription string - -const ( - WindowsServerSubscriptionDisabled WindowsServerSubscription = "Disabled" - WindowsServerSubscriptionEnabled WindowsServerSubscription = "Enabled" -) - -func PossibleValuesForWindowsServerSubscription() []string { - return []string{ - string(WindowsServerSubscriptionDisabled), - string(WindowsServerSubscriptionEnabled), - } -} - -func (s *WindowsServerSubscription) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWindowsServerSubscription(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWindowsServerSubscription(input string) (*WindowsServerSubscription, error) { - vals := map[string]WindowsServerSubscription{ - "disabled": WindowsServerSubscriptionDisabled, - "enabled": WindowsServerSubscriptionEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WindowsServerSubscription(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/cluster/id_cluster.go deleted file mode 100644 index d9ee18cbcc4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package cluster - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/cluster/id_cluster_test.go deleted file mode 100644 index 9b70ca2f6bd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package cluster - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/cluster/method_createidentity.go b/resource-manager/azurestackhci/2023-08-01/cluster/method_createidentity.go deleted file mode 100644 index 76c9822e828..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/method_createidentity.go +++ /dev/null @@ -1,71 +0,0 @@ -package cluster - -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 CreateIdentityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ClusterIdentityResponse -} - -// CreateIdentity ... -func (c ClusterClient) CreateIdentity(ctx context.Context, id ClusterId) (result CreateIdentityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createClusterIdentity", 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 -} - -// CreateIdentityThenPoll performs CreateIdentity then polls until it's completed -func (c ClusterClient) CreateIdentityThenPoll(ctx context.Context, id ClusterId) error { - result, err := c.CreateIdentity(ctx, id) - if err != nil { - return fmt.Errorf("performing CreateIdentity: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CreateIdentity: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/method_extendsoftwareassurancebenefit.go b/resource-manager/azurestackhci/2023-08-01/cluster/method_extendsoftwareassurancebenefit.go deleted file mode 100644 index 3e2ec35d364..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/method_extendsoftwareassurancebenefit.go +++ /dev/null @@ -1,75 +0,0 @@ -package cluster - -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 ExtendSoftwareAssuranceBenefitOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// ExtendSoftwareAssuranceBenefit ... -func (c ClusterClient) ExtendSoftwareAssuranceBenefit(ctx context.Context, id ClusterId, input SoftwareAssuranceChangeRequest) (result ExtendSoftwareAssuranceBenefitOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/extendSoftwareAssuranceBenefit", 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 -} - -// ExtendSoftwareAssuranceBenefitThenPoll performs ExtendSoftwareAssuranceBenefit then polls until it's completed -func (c ClusterClient) ExtendSoftwareAssuranceBenefitThenPoll(ctx context.Context, id ClusterId, input SoftwareAssuranceChangeRequest) error { - result, err := c.ExtendSoftwareAssuranceBenefit(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ExtendSoftwareAssuranceBenefit: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExtendSoftwareAssuranceBenefit: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/method_uploadcertificate.go b/resource-manager/azurestackhci/2023-08-01/cluster/method_uploadcertificate.go deleted file mode 100644 index 7bf2cea2c85..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/method_uploadcertificate.go +++ /dev/null @@ -1,73 +0,0 @@ -package cluster - -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 UploadCertificateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// UploadCertificate ... -func (c ClusterClient) UploadCertificate(ctx context.Context, id ClusterId, input UploadCertificateRequest) (result UploadCertificateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/uploadCertificate", 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 -} - -// UploadCertificateThenPoll performs UploadCertificate then polls until it's completed -func (c ClusterClient) UploadCertificateThenPoll(ctx context.Context, id ClusterId, input UploadCertificateRequest) error { - result, err := c.UploadCertificate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing UploadCertificate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after UploadCertificate: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_cluster.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_cluster.go deleted file mode 100644 index e41f174485b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_cluster.go +++ /dev/null @@ -1,20 +0,0 @@ -package cluster - -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 Cluster struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ClusterProperties `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/azurestackhci/2023-08-01/cluster/model_clusterdesiredproperties.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterdesiredproperties.go deleted file mode 100644 index 7ff21e52a48..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterdesiredproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDesiredProperties struct { - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponse.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponse.go deleted file mode 100644 index 7e64cb4e35a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterIdentityResponse struct { - Properties *ClusterIdentityResponseProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponseproperties.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponseproperties.go deleted file mode 100644 index 1ba7404ca10..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusteridentityresponseproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterIdentityResponseProperties struct { - AadApplicationObjectId *string `json:"aadApplicationObjectId,omitempty"` - AadClientId *string `json:"aadClientId,omitempty"` - AadServicePrincipalObjectId *string `json:"aadServicePrincipalObjectId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusternode.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_clusternode.go deleted file mode 100644 index ed63418454c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusternode.go +++ /dev/null @@ -1,40 +0,0 @@ -package cluster - -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 ClusterNode struct { - CoreCount *float64 `json:"coreCount,omitempty"` - EhcResourceId *string `json:"ehcResourceId,omitempty"` - Id *float64 `json:"id,omitempty"` - LastLicensingTimestamp *string `json:"lastLicensingTimestamp,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - MemoryInGiB *float64 `json:"memoryInGiB,omitempty"` - Model *string `json:"model,omitempty"` - Name *string `json:"name,omitempty"` - NodeType *ClusterNodeType `json:"nodeType,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - OsDisplayVersion *string `json:"osDisplayVersion,omitempty"` - OsName *string `json:"osName,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} - -func (o *ClusterNode) GetLastLicensingTimestampAsTime() (*time.Time, error) { - if o.LastLicensingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastLicensingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterNode) SetLastLicensingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastLicensingTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterproperties.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterproperties.go deleted file mode 100644 index bf4887b14dd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterproperties.go +++ /dev/null @@ -1,69 +0,0 @@ -package cluster - -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 ClusterProperties struct { - AadApplicationObjectId *string `json:"aadApplicationObjectId,omitempty"` - AadClientId *string `json:"aadClientId,omitempty"` - AadServicePrincipalObjectId *string `json:"aadServicePrincipalObjectId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` - BillingModel *string `json:"billingModel,omitempty"` - CloudId *string `json:"cloudId,omitempty"` - CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` - ConnectivityStatus *ConnectivityStatus `json:"connectivityStatus,omitempty"` - DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` - IsolatedVMAttestationConfiguration *IsolatedVMAttestationConfiguration `json:"isolatedVmAttestationConfiguration,omitempty"` - LastBillingTimestamp *string `json:"lastBillingTimestamp,omitempty"` - LastSyncTimestamp *string `json:"lastSyncTimestamp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RegistrationTimestamp *string `json:"registrationTimestamp,omitempty"` - ReportedProperties *ClusterReportedProperties `json:"reportedProperties,omitempty"` - ResourceProviderObjectId *string `json:"resourceProviderObjectId,omitempty"` - ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` - SoftwareAssuranceProperties *SoftwareAssuranceProperties `json:"softwareAssuranceProperties,omitempty"` - Status *Status `json:"status,omitempty"` - TrialDaysRemaining *float64 `json:"trialDaysRemaining,omitempty"` -} - -func (o *ClusterProperties) GetLastBillingTimestampAsTime() (*time.Time, error) { - if o.LastBillingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastBillingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastBillingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastBillingTimestamp = &formatted -} - -func (o *ClusterProperties) GetLastSyncTimestampAsTime() (*time.Time, error) { - if o.LastSyncTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastSyncTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastSyncTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastSyncTimestamp = &formatted -} - -func (o *ClusterProperties) GetRegistrationTimestampAsTime() (*time.Time, error) { - if o.RegistrationTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.RegistrationTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetRegistrationTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.RegistrationTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterreportedproperties.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterreportedproperties.go deleted file mode 100644 index bf51621f6ad..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_clusterreportedproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package cluster - -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 ClusterReportedProperties struct { - ClusterId *string `json:"clusterId,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterType *ClusterNodeType `json:"clusterType,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - ImdsAttestation *ImdsAttestation `json:"imdsAttestation,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - Nodes *[]ClusterNode `json:"nodes,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - SupportedCapabilities *[]string `json:"supportedCapabilities,omitempty"` -} - -func (o *ClusterReportedProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterReportedProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_isolatedvmattestationconfiguration.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_isolatedvmattestationconfiguration.go deleted file mode 100644 index 878a67cd16c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_isolatedvmattestationconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IsolatedVMAttestationConfiguration struct { - AttestationResourceId *string `json:"attestationResourceId,omitempty"` - AttestationServiceEndpoint *string `json:"attestationServiceEndpoint,omitempty"` - RelyingPartyServiceEndpoint *string `json:"relyingPartyServiceEndpoint,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_rawcertificatedata.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_rawcertificatedata.go deleted file mode 100644 index d2a4c0aa21f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_rawcertificatedata.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RawCertificateData struct { - Certificates *[]string `json:"certificates,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequest.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequest.go deleted file mode 100644 index 61ed38159fe..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftwareAssuranceChangeRequest struct { - Properties *SoftwareAssuranceChangeRequestProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequestproperties.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequestproperties.go deleted file mode 100644 index b7dd0dcb80c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassurancechangerequestproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftwareAssuranceChangeRequestProperties struct { - SoftwareAssuranceIntent *SoftwareAssuranceIntent `json:"softwareAssuranceIntent,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassuranceproperties.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassuranceproperties.go deleted file mode 100644 index 671a0e62dee..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_softwareassuranceproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package cluster - -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 SoftwareAssuranceProperties struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - SoftwareAssuranceIntent *SoftwareAssuranceIntent `json:"softwareAssuranceIntent,omitempty"` - SoftwareAssuranceStatus *SoftwareAssuranceStatus `json:"softwareAssuranceStatus,omitempty"` -} - -func (o *SoftwareAssuranceProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SoftwareAssuranceProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/model_uploadcertificaterequest.go b/resource-manager/azurestackhci/2023-08-01/cluster/model_uploadcertificaterequest.go deleted file mode 100644 index fc979a96d24..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/model_uploadcertificaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package cluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UploadCertificateRequest struct { - Properties *RawCertificateData `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/cluster/version.go b/resource-manager/azurestackhci/2023-08-01/cluster/version.go deleted file mode 100644 index 523af36b0ca..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/cluster/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package cluster - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/cluster/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/README.md b/resource-manager/azurestackhci/2023-08-01/clusters/README.md deleted file mode 100644 index 57d4c0da981..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/clusters` Documentation - -The `clusters` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/clusters" -``` - - -### Client Initialization - -```go -client := clusters.NewClustersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ClustersClient.Create` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.Cluster{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ClustersClient.Delete` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.Get` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -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: `ClustersClient.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: `ClustersClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ClustersClient.Update` - -```go -ctx := context.TODO() -id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ClusterPatch{ - // ... -} - - -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/azurestackhci/2023-08-01/clusters/client.go b/resource-manager/azurestackhci/2023-08-01/clusters/client.go deleted file mode 100644 index e4ab7fd89ad..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package clusters - -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 ClustersClient struct { - Client *resourcemanager.Client -} - -func NewClustersClientWithBaseURI(sdkApi sdkEnv.Api) (*ClustersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "clusters", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ClustersClient: %+v", err) - } - - return &ClustersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/constants.go b/resource-manager/azurestackhci/2023-08-01/clusters/constants.go deleted file mode 100644 index c644f0c0b8a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/constants.go +++ /dev/null @@ -1,492 +0,0 @@ -package clusters - -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 ClusterNodeType string - -const ( - ClusterNodeTypeFirstParty ClusterNodeType = "FirstParty" - ClusterNodeTypeThirdParty ClusterNodeType = "ThirdParty" -) - -func PossibleValuesForClusterNodeType() []string { - return []string{ - string(ClusterNodeTypeFirstParty), - string(ClusterNodeTypeThirdParty), - } -} - -func (s *ClusterNodeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseClusterNodeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseClusterNodeType(input string) (*ClusterNodeType, error) { - vals := map[string]ClusterNodeType{ - "firstparty": ClusterNodeTypeFirstParty, - "thirdparty": ClusterNodeTypeThirdParty, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ClusterNodeType(input) - return &out, nil -} - -type ConnectivityStatus string - -const ( - ConnectivityStatusConnected ConnectivityStatus = "Connected" - ConnectivityStatusDisconnected ConnectivityStatus = "Disconnected" - ConnectivityStatusNotConnectedRecently ConnectivityStatus = "NotConnectedRecently" - ConnectivityStatusNotSpecified ConnectivityStatus = "NotSpecified" - ConnectivityStatusNotYetRegistered ConnectivityStatus = "NotYetRegistered" - ConnectivityStatusPartiallyConnected ConnectivityStatus = "PartiallyConnected" -) - -func PossibleValuesForConnectivityStatus() []string { - return []string{ - string(ConnectivityStatusConnected), - string(ConnectivityStatusDisconnected), - string(ConnectivityStatusNotConnectedRecently), - string(ConnectivityStatusNotSpecified), - string(ConnectivityStatusNotYetRegistered), - string(ConnectivityStatusPartiallyConnected), - } -} - -func (s *ConnectivityStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityStatus(input string) (*ConnectivityStatus, error) { - vals := map[string]ConnectivityStatus{ - "connected": ConnectivityStatusConnected, - "disconnected": ConnectivityStatusDisconnected, - "notconnectedrecently": ConnectivityStatusNotConnectedRecently, - "notspecified": ConnectivityStatusNotSpecified, - "notyetregistered": ConnectivityStatusNotYetRegistered, - "partiallyconnected": ConnectivityStatusPartiallyConnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityStatus(input) - return &out, nil -} - -type DiagnosticLevel string - -const ( - DiagnosticLevelBasic DiagnosticLevel = "Basic" - DiagnosticLevelEnhanced DiagnosticLevel = "Enhanced" - DiagnosticLevelOff DiagnosticLevel = "Off" -) - -func PossibleValuesForDiagnosticLevel() []string { - return []string{ - string(DiagnosticLevelBasic), - string(DiagnosticLevelEnhanced), - string(DiagnosticLevelOff), - } -} - -func (s *DiagnosticLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiagnosticLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiagnosticLevel(input string) (*DiagnosticLevel, error) { - vals := map[string]DiagnosticLevel{ - "basic": DiagnosticLevelBasic, - "enhanced": DiagnosticLevelEnhanced, - "off": DiagnosticLevelOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiagnosticLevel(input) - return &out, nil -} - -type ImdsAttestation string - -const ( - ImdsAttestationDisabled ImdsAttestation = "Disabled" - ImdsAttestationEnabled ImdsAttestation = "Enabled" -) - -func PossibleValuesForImdsAttestation() []string { - return []string{ - string(ImdsAttestationDisabled), - string(ImdsAttestationEnabled), - } -} - -func (s *ImdsAttestation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImdsAttestation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImdsAttestation(input string) (*ImdsAttestation, error) { - vals := map[string]ImdsAttestation{ - "disabled": ImdsAttestationDisabled, - "enabled": ImdsAttestationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImdsAttestation(input) - return &out, nil -} - -type OemActivation string - -const ( - OemActivationDisabled OemActivation = "Disabled" - OemActivationEnabled OemActivation = "Enabled" -) - -func PossibleValuesForOemActivation() []string { - return []string{ - string(OemActivationDisabled), - string(OemActivationEnabled), - } -} - -func (s *OemActivation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOemActivation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOemActivation(input string) (*OemActivation, error) { - vals := map[string]OemActivation{ - "disabled": OemActivationDisabled, - "enabled": OemActivationEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OemActivation(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisableInProgress ProvisioningState = "DisableInProgress" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisableInProgress), - string(ProvisioningStateDisconnected), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disableinprogress": ProvisioningStateDisableInProgress, - "disconnected": ProvisioningStateDisconnected, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SoftwareAssuranceIntent string - -const ( - SoftwareAssuranceIntentDisable SoftwareAssuranceIntent = "Disable" - SoftwareAssuranceIntentEnable SoftwareAssuranceIntent = "Enable" -) - -func PossibleValuesForSoftwareAssuranceIntent() []string { - return []string{ - string(SoftwareAssuranceIntentDisable), - string(SoftwareAssuranceIntentEnable), - } -} - -func (s *SoftwareAssuranceIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceIntent(input string) (*SoftwareAssuranceIntent, error) { - vals := map[string]SoftwareAssuranceIntent{ - "disable": SoftwareAssuranceIntentDisable, - "enable": SoftwareAssuranceIntentEnable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceIntent(input) - return &out, nil -} - -type SoftwareAssuranceStatus string - -const ( - SoftwareAssuranceStatusDisabled SoftwareAssuranceStatus = "Disabled" - SoftwareAssuranceStatusEnabled SoftwareAssuranceStatus = "Enabled" -) - -func PossibleValuesForSoftwareAssuranceStatus() []string { - return []string{ - string(SoftwareAssuranceStatusDisabled), - string(SoftwareAssuranceStatusEnabled), - } -} - -func (s *SoftwareAssuranceStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftwareAssuranceStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftwareAssuranceStatus(input string) (*SoftwareAssuranceStatus, error) { - vals := map[string]SoftwareAssuranceStatus{ - "disabled": SoftwareAssuranceStatusDisabled, - "enabled": SoftwareAssuranceStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftwareAssuranceStatus(input) - return &out, nil -} - -type Status string - -const ( - StatusConnectedRecently Status = "ConnectedRecently" - StatusDisconnected Status = "Disconnected" - StatusError Status = "Error" - StatusNotConnectedRecently Status = "NotConnectedRecently" - StatusNotSpecified Status = "NotSpecified" - StatusNotYetRegistered Status = "NotYetRegistered" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusConnectedRecently), - string(StatusDisconnected), - string(StatusError), - string(StatusNotConnectedRecently), - string(StatusNotSpecified), - string(StatusNotYetRegistered), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "connectedrecently": StatusConnectedRecently, - "disconnected": StatusDisconnected, - "error": StatusError, - "notconnectedrecently": StatusNotConnectedRecently, - "notspecified": StatusNotSpecified, - "notyetregistered": StatusNotYetRegistered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type WindowsServerSubscription string - -const ( - WindowsServerSubscriptionDisabled WindowsServerSubscription = "Disabled" - WindowsServerSubscriptionEnabled WindowsServerSubscription = "Enabled" -) - -func PossibleValuesForWindowsServerSubscription() []string { - return []string{ - string(WindowsServerSubscriptionDisabled), - string(WindowsServerSubscriptionEnabled), - } -} - -func (s *WindowsServerSubscription) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWindowsServerSubscription(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWindowsServerSubscription(input string) (*WindowsServerSubscription, error) { - vals := map[string]WindowsServerSubscription{ - "disabled": WindowsServerSubscriptionDisabled, - "enabled": WindowsServerSubscriptionEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WindowsServerSubscription(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/clusters/id_cluster.go deleted file mode 100644 index a930aa56ef5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package clusters - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/clusters/id_cluster_test.go deleted file mode 100644 index 94a9e1ae438..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package clusters - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/clusters/method_create.go b/resource-manager/azurestackhci/2023-08-01/clusters/method_create.go deleted file mode 100644 index 337ea36a215..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package clusters - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// Create ... -func (c ClustersClient) Create(ctx context.Context, id ClusterId, input Cluster) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/method_delete.go b/resource-manager/azurestackhci/2023-08-01/clusters/method_delete.go deleted file mode 100644 index 13e2610ffd6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package clusters - -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 ClustersClient) Delete(ctx context.Context, id ClusterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ClustersClient) DeleteThenPoll(ctx context.Context, id ClusterId) 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/azurestackhci/2023-08-01/clusters/method_get.go b/resource-manager/azurestackhci/2023-08-01/clusters/method_get.go deleted file mode 100644 index 73c53aa936b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package clusters - -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 *Cluster -} - -// Get ... -func (c ClustersClient) Get(ctx context.Context, id ClusterId) (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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/method_listbyresourcegroup.go b/resource-manager/azurestackhci/2023-08-01/clusters/method_listbyresourcegroup.go deleted file mode 100644 index ad6828ab30c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusters - -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 *[]Cluster -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Cluster -} - -// ListByResourceGroup ... -func (c ClustersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/clusters", 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 *[]Cluster `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 ClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ClusterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Cluster, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01/clusters/method_listbysubscription.go b/resource-manager/azurestackhci/2023-08-01/clusters/method_listbysubscription.go deleted file mode 100644 index 6c551f757cc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusters - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Cluster -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []Cluster -} - -// ListBySubscription ... -func (c ClustersClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/clusters", 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 *[]Cluster `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c ClustersClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClustersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ClusterOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]Cluster, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/method_update.go b/resource-manager/azurestackhci/2023-08-01/clusters/method_update.go deleted file mode 100644 index 80edce4b64f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package clusters - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// Update ... -func (c ClustersClient) Update(ctx context.Context, id ClusterId, input ClusterPatch) (result UpdateOperationResponse, 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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_cluster.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_cluster.go deleted file mode 100644 index d5b851dff01..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_cluster.go +++ /dev/null @@ -1,20 +0,0 @@ -package clusters - -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 Cluster struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ClusterProperties `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/azurestackhci/2023-08-01/clusters/model_clusterdesiredproperties.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterdesiredproperties.go deleted file mode 100644 index 3572f7c6d22..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterdesiredproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDesiredProperties struct { - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusternode.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_clusternode.go deleted file mode 100644 index ecd9442123c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusternode.go +++ /dev/null @@ -1,40 +0,0 @@ -package clusters - -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 ClusterNode struct { - CoreCount *float64 `json:"coreCount,omitempty"` - EhcResourceId *string `json:"ehcResourceId,omitempty"` - Id *float64 `json:"id,omitempty"` - LastLicensingTimestamp *string `json:"lastLicensingTimestamp,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - MemoryInGiB *float64 `json:"memoryInGiB,omitempty"` - Model *string `json:"model,omitempty"` - Name *string `json:"name,omitempty"` - NodeType *ClusterNodeType `json:"nodeType,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - OsDisplayVersion *string `json:"osDisplayVersion,omitempty"` - OsName *string `json:"osName,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - WindowsServerSubscription *WindowsServerSubscription `json:"windowsServerSubscription,omitempty"` -} - -func (o *ClusterNode) GetLastLicensingTimestampAsTime() (*time.Time, error) { - if o.LastLicensingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastLicensingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterNode) SetLastLicensingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastLicensingTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatch.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatch.go deleted file mode 100644 index 5f0c8dc17eb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatch.go +++ /dev/null @@ -1,14 +0,0 @@ -package clusters - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterPatch struct { - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Properties *ClusterPatchProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatchproperties.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatchproperties.go deleted file mode 100644 index 04c86c75b34..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterpatchproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterPatchProperties struct { - AadClientId *string `json:"aadClientId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` - CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` - DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterproperties.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterproperties.go deleted file mode 100644 index 5f058ff9f5c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterproperties.go +++ /dev/null @@ -1,69 +0,0 @@ -package clusters - -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 ClusterProperties struct { - AadApplicationObjectId *string `json:"aadApplicationObjectId,omitempty"` - AadClientId *string `json:"aadClientId,omitempty"` - AadServicePrincipalObjectId *string `json:"aadServicePrincipalObjectId,omitempty"` - AadTenantId *string `json:"aadTenantId,omitempty"` - BillingModel *string `json:"billingModel,omitempty"` - CloudId *string `json:"cloudId,omitempty"` - CloudManagementEndpoint *string `json:"cloudManagementEndpoint,omitempty"` - ConnectivityStatus *ConnectivityStatus `json:"connectivityStatus,omitempty"` - DesiredProperties *ClusterDesiredProperties `json:"desiredProperties,omitempty"` - IsolatedVMAttestationConfiguration *IsolatedVMAttestationConfiguration `json:"isolatedVmAttestationConfiguration,omitempty"` - LastBillingTimestamp *string `json:"lastBillingTimestamp,omitempty"` - LastSyncTimestamp *string `json:"lastSyncTimestamp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RegistrationTimestamp *string `json:"registrationTimestamp,omitempty"` - ReportedProperties *ClusterReportedProperties `json:"reportedProperties,omitempty"` - ResourceProviderObjectId *string `json:"resourceProviderObjectId,omitempty"` - ServiceEndpoint *string `json:"serviceEndpoint,omitempty"` - SoftwareAssuranceProperties *SoftwareAssuranceProperties `json:"softwareAssuranceProperties,omitempty"` - Status *Status `json:"status,omitempty"` - TrialDaysRemaining *float64 `json:"trialDaysRemaining,omitempty"` -} - -func (o *ClusterProperties) GetLastBillingTimestampAsTime() (*time.Time, error) { - if o.LastBillingTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastBillingTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastBillingTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastBillingTimestamp = &formatted -} - -func (o *ClusterProperties) GetLastSyncTimestampAsTime() (*time.Time, error) { - if o.LastSyncTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastSyncTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetLastSyncTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastSyncTimestamp = &formatted -} - -func (o *ClusterProperties) GetRegistrationTimestampAsTime() (*time.Time, error) { - if o.RegistrationTimestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.RegistrationTimestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterProperties) SetRegistrationTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.RegistrationTimestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterreportedproperties.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterreportedproperties.go deleted file mode 100644 index 732f0efd40a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_clusterreportedproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package clusters - -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 ClusterReportedProperties struct { - ClusterId *string `json:"clusterId,omitempty"` - ClusterName *string `json:"clusterName,omitempty"` - ClusterType *ClusterNodeType `json:"clusterType,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - DiagnosticLevel *DiagnosticLevel `json:"diagnosticLevel,omitempty"` - ImdsAttestation *ImdsAttestation `json:"imdsAttestation,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - Nodes *[]ClusterNode `json:"nodes,omitempty"` - OemActivation *OemActivation `json:"oemActivation,omitempty"` - SupportedCapabilities *[]string `json:"supportedCapabilities,omitempty"` -} - -func (o *ClusterReportedProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *ClusterReportedProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_isolatedvmattestationconfiguration.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_isolatedvmattestationconfiguration.go deleted file mode 100644 index e6fb467b2dc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_isolatedvmattestationconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IsolatedVMAttestationConfiguration struct { - AttestationResourceId *string `json:"attestationResourceId,omitempty"` - AttestationServiceEndpoint *string `json:"attestationServiceEndpoint,omitempty"` - RelyingPartyServiceEndpoint *string `json:"relyingPartyServiceEndpoint,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/model_softwareassuranceproperties.go b/resource-manager/azurestackhci/2023-08-01/clusters/model_softwareassuranceproperties.go deleted file mode 100644 index 5d2953809b5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/model_softwareassuranceproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package clusters - -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 SoftwareAssuranceProperties struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - SoftwareAssuranceIntent *SoftwareAssuranceIntent `json:"softwareAssuranceIntent,omitempty"` - SoftwareAssuranceStatus *SoftwareAssuranceStatus `json:"softwareAssuranceStatus,omitempty"` -} - -func (o *SoftwareAssuranceProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SoftwareAssuranceProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/clusters/predicates.go b/resource-manager/azurestackhci/2023-08-01/clusters/predicates.go deleted file mode 100644 index cc13b7c6220..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ClusterOperationPredicate) Matches(input Cluster) 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/azurestackhci/2023-08-01/clusters/version.go b/resource-manager/azurestackhci/2023-08-01/clusters/version.go deleted file mode 100644 index 408113306d7..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/clusters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/clusters/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/README.md b/resource-manager/azurestackhci/2023-08-01/extensions/README.md deleted file mode 100644 index d63393dcb23..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/README.md +++ /dev/null @@ -1,116 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/extensions` Documentation - -The `extensions` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/extensions" -``` - - -### Client Initialization - -```go -client := extensions.NewExtensionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExtensionsClient.Create` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -payload := extensions.Extension{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Delete` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Get` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -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: `ExtensionsClient.ListByArcSetting` - -```go -ctx := context.TODO() -id := extensions.NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - -// alternatively `client.ListByArcSetting(ctx, id)` can be used to do batched pagination -items, err := client.ListByArcSettingComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExtensionsClient.Update` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -payload := extensions.ExtensionPatch{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Upgrade` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - -payload := extensions.ExtensionUpgradeParameters{ - // ... -} - - -if err := client.UpgradeThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/client.go b/resource-manager/azurestackhci/2023-08-01/extensions/client.go deleted file mode 100644 index 44725ac0e84..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package extensions - -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 ExtensionsClient struct { - Client *resourcemanager.Client -} - -func NewExtensionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExtensionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "extensions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExtensionsClient: %+v", err) - } - - return &ExtensionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/constants.go b/resource-manager/azurestackhci/2023-08-01/extensions/constants.go deleted file mode 100644 index 638dc8a39de..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/constants.go +++ /dev/null @@ -1,356 +0,0 @@ -package extensions - -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 ExtensionAggregateState string - -const ( - ExtensionAggregateStateAccepted ExtensionAggregateState = "Accepted" - ExtensionAggregateStateCanceled ExtensionAggregateState = "Canceled" - ExtensionAggregateStateConnected ExtensionAggregateState = "Connected" - ExtensionAggregateStateCreating ExtensionAggregateState = "Creating" - ExtensionAggregateStateDeleted ExtensionAggregateState = "Deleted" - ExtensionAggregateStateDeleting ExtensionAggregateState = "Deleting" - ExtensionAggregateStateDisconnected ExtensionAggregateState = "Disconnected" - ExtensionAggregateStateError ExtensionAggregateState = "Error" - ExtensionAggregateStateFailed ExtensionAggregateState = "Failed" - ExtensionAggregateStateInProgress ExtensionAggregateState = "InProgress" - ExtensionAggregateStateMoving ExtensionAggregateState = "Moving" - ExtensionAggregateStateNotSpecified ExtensionAggregateState = "NotSpecified" - ExtensionAggregateStatePartiallyConnected ExtensionAggregateState = "PartiallyConnected" - ExtensionAggregateStatePartiallySucceeded ExtensionAggregateState = "PartiallySucceeded" - ExtensionAggregateStateProvisioning ExtensionAggregateState = "Provisioning" - ExtensionAggregateStateSucceeded ExtensionAggregateState = "Succeeded" - ExtensionAggregateStateUpdating ExtensionAggregateState = "Updating" - ExtensionAggregateStateUpgradeFailedRollbackSucceeded ExtensionAggregateState = "UpgradeFailedRollbackSucceeded" -) - -func PossibleValuesForExtensionAggregateState() []string { - return []string{ - string(ExtensionAggregateStateAccepted), - string(ExtensionAggregateStateCanceled), - string(ExtensionAggregateStateConnected), - string(ExtensionAggregateStateCreating), - string(ExtensionAggregateStateDeleted), - string(ExtensionAggregateStateDeleting), - string(ExtensionAggregateStateDisconnected), - string(ExtensionAggregateStateError), - string(ExtensionAggregateStateFailed), - string(ExtensionAggregateStateInProgress), - string(ExtensionAggregateStateMoving), - string(ExtensionAggregateStateNotSpecified), - string(ExtensionAggregateStatePartiallyConnected), - string(ExtensionAggregateStatePartiallySucceeded), - string(ExtensionAggregateStateProvisioning), - string(ExtensionAggregateStateSucceeded), - string(ExtensionAggregateStateUpdating), - string(ExtensionAggregateStateUpgradeFailedRollbackSucceeded), - } -} - -func (s *ExtensionAggregateState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtensionAggregateState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtensionAggregateState(input string) (*ExtensionAggregateState, error) { - vals := map[string]ExtensionAggregateState{ - "accepted": ExtensionAggregateStateAccepted, - "canceled": ExtensionAggregateStateCanceled, - "connected": ExtensionAggregateStateConnected, - "creating": ExtensionAggregateStateCreating, - "deleted": ExtensionAggregateStateDeleted, - "deleting": ExtensionAggregateStateDeleting, - "disconnected": ExtensionAggregateStateDisconnected, - "error": ExtensionAggregateStateError, - "failed": ExtensionAggregateStateFailed, - "inprogress": ExtensionAggregateStateInProgress, - "moving": ExtensionAggregateStateMoving, - "notspecified": ExtensionAggregateStateNotSpecified, - "partiallyconnected": ExtensionAggregateStatePartiallyConnected, - "partiallysucceeded": ExtensionAggregateStatePartiallySucceeded, - "provisioning": ExtensionAggregateStateProvisioning, - "succeeded": ExtensionAggregateStateSucceeded, - "updating": ExtensionAggregateStateUpdating, - "upgradefailedrollbacksucceeded": ExtensionAggregateStateUpgradeFailedRollbackSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtensionAggregateState(input) - return &out, nil -} - -type ExtensionManagedBy string - -const ( - ExtensionManagedByAzure ExtensionManagedBy = "Azure" - ExtensionManagedByUser ExtensionManagedBy = "User" -) - -func PossibleValuesForExtensionManagedBy() []string { - return []string{ - string(ExtensionManagedByAzure), - string(ExtensionManagedByUser), - } -} - -func (s *ExtensionManagedBy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtensionManagedBy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtensionManagedBy(input string) (*ExtensionManagedBy, error) { - vals := map[string]ExtensionManagedBy{ - "azure": ExtensionManagedByAzure, - "user": ExtensionManagedByUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtensionManagedBy(input) - return &out, nil -} - -type NodeExtensionState string - -const ( - NodeExtensionStateAccepted NodeExtensionState = "Accepted" - NodeExtensionStateCanceled NodeExtensionState = "Canceled" - NodeExtensionStateConnected NodeExtensionState = "Connected" - NodeExtensionStateCreating NodeExtensionState = "Creating" - NodeExtensionStateDeleted NodeExtensionState = "Deleted" - NodeExtensionStateDeleting NodeExtensionState = "Deleting" - NodeExtensionStateDisconnected NodeExtensionState = "Disconnected" - NodeExtensionStateError NodeExtensionState = "Error" - NodeExtensionStateFailed NodeExtensionState = "Failed" - NodeExtensionStateInProgress NodeExtensionState = "InProgress" - NodeExtensionStateMoving NodeExtensionState = "Moving" - NodeExtensionStateNotSpecified NodeExtensionState = "NotSpecified" - NodeExtensionStatePartiallyConnected NodeExtensionState = "PartiallyConnected" - NodeExtensionStatePartiallySucceeded NodeExtensionState = "PartiallySucceeded" - NodeExtensionStateProvisioning NodeExtensionState = "Provisioning" - NodeExtensionStateSucceeded NodeExtensionState = "Succeeded" - NodeExtensionStateUpdating NodeExtensionState = "Updating" -) - -func PossibleValuesForNodeExtensionState() []string { - return []string{ - string(NodeExtensionStateAccepted), - string(NodeExtensionStateCanceled), - string(NodeExtensionStateConnected), - string(NodeExtensionStateCreating), - string(NodeExtensionStateDeleted), - string(NodeExtensionStateDeleting), - string(NodeExtensionStateDisconnected), - string(NodeExtensionStateError), - string(NodeExtensionStateFailed), - string(NodeExtensionStateInProgress), - string(NodeExtensionStateMoving), - string(NodeExtensionStateNotSpecified), - string(NodeExtensionStatePartiallyConnected), - string(NodeExtensionStatePartiallySucceeded), - string(NodeExtensionStateProvisioning), - string(NodeExtensionStateSucceeded), - string(NodeExtensionStateUpdating), - } -} - -func (s *NodeExtensionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNodeExtensionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNodeExtensionState(input string) (*NodeExtensionState, error) { - vals := map[string]NodeExtensionState{ - "accepted": NodeExtensionStateAccepted, - "canceled": NodeExtensionStateCanceled, - "connected": NodeExtensionStateConnected, - "creating": NodeExtensionStateCreating, - "deleted": NodeExtensionStateDeleted, - "deleting": NodeExtensionStateDeleting, - "disconnected": NodeExtensionStateDisconnected, - "error": NodeExtensionStateError, - "failed": NodeExtensionStateFailed, - "inprogress": NodeExtensionStateInProgress, - "moving": NodeExtensionStateMoving, - "notspecified": NodeExtensionStateNotSpecified, - "partiallyconnected": NodeExtensionStatePartiallyConnected, - "partiallysucceeded": NodeExtensionStatePartiallySucceeded, - "provisioning": NodeExtensionStateProvisioning, - "succeeded": NodeExtensionStateSucceeded, - "updating": NodeExtensionStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NodeExtensionState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateConnected ProvisioningState = "Connected" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleted ProvisioningState = "Deleted" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateDisconnected ProvisioningState = "Disconnected" - ProvisioningStateError ProvisioningState = "Error" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateInProgress ProvisioningState = "InProgress" - ProvisioningStateMoving ProvisioningState = "Moving" - ProvisioningStateNotSpecified ProvisioningState = "NotSpecified" - ProvisioningStatePartiallyConnected ProvisioningState = "PartiallyConnected" - ProvisioningStatePartiallySucceeded ProvisioningState = "PartiallySucceeded" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateConnected), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleted), - string(ProvisioningStateDeleting), - string(ProvisioningStateDisconnected), - string(ProvisioningStateError), - string(ProvisioningStateFailed), - string(ProvisioningStateInProgress), - string(ProvisioningStateMoving), - string(ProvisioningStateNotSpecified), - string(ProvisioningStatePartiallyConnected), - string(ProvisioningStatePartiallySucceeded), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "connected": ProvisioningStateConnected, - "creating": ProvisioningStateCreating, - "deleted": ProvisioningStateDeleted, - "deleting": ProvisioningStateDeleting, - "disconnected": ProvisioningStateDisconnected, - "error": ProvisioningStateError, - "failed": ProvisioningStateFailed, - "inprogress": ProvisioningStateInProgress, - "moving": ProvisioningStateMoving, - "notspecified": ProvisioningStateNotSpecified, - "partiallyconnected": ProvisioningStatePartiallyConnected, - "partiallysucceeded": ProvisioningStatePartiallySucceeded, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type StatusLevelTypes string - -const ( - StatusLevelTypesError StatusLevelTypes = "Error" - StatusLevelTypesInfo StatusLevelTypes = "Info" - StatusLevelTypesWarning StatusLevelTypes = "Warning" -) - -func PossibleValuesForStatusLevelTypes() []string { - return []string{ - string(StatusLevelTypesError), - string(StatusLevelTypesInfo), - string(StatusLevelTypesWarning), - } -} - -func (s *StatusLevelTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatusLevelTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { - vals := map[string]StatusLevelTypes{ - "error": StatusLevelTypesError, - "info": StatusLevelTypesInfo, - "warning": StatusLevelTypesWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StatusLevelTypes(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting.go b/resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting.go deleted file mode 100644 index 2a1f9ffc60c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting.go +++ /dev/null @@ -1,139 +0,0 @@ -package extensions - -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(&ArcSettingId{}) -} - -var _ resourceids.ResourceId = &ArcSettingId{} - -// ArcSettingId is a struct representing the Resource ID for a Arc Setting -type ArcSettingId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ArcSettingName string -} - -// NewArcSettingID returns a new ArcSettingId struct -func NewArcSettingID(subscriptionId string, resourceGroupName string, clusterName string, arcSettingName string) ArcSettingId { - return ArcSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ArcSettingName: arcSettingName, - } -} - -// ParseArcSettingID parses 'input' into a ArcSettingId -func ParseArcSettingID(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseArcSettingIDInsensitively parses 'input' case-insensitively into a ArcSettingId -// note: this method should only be used for API response data and not user input -func ParseArcSettingIDInsensitively(input string) (*ArcSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArcSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArcSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ArcSettingId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ArcSettingName, ok = input.Parsed["arcSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arcSettingName", input) - } - - return nil -} - -// ValidateArcSettingID checks that 'input' can be parsed as a Arc Setting ID -func ValidateArcSettingID(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 := ParseArcSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Arc Setting ID -func (id ArcSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/arcSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ArcSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Arc Setting ID -func (id ArcSettingId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticArcSettings", "arcSettings", "arcSettings"), - resourceids.UserSpecifiedSegment("arcSettingName", "arcSettingValue"), - } -} - -// String returns a human-readable description of this Arc Setting ID -func (id ArcSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Arc Setting Name: %q", id.ArcSettingName), - } - return fmt.Sprintf("Arc Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting_test.go b/resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting_test.go deleted file mode 100644 index b3bc46d3bc2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/id_arcsetting_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package extensions - -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 = &ArcSettingId{} - -func TestNewArcSettingID(t *testing.T) { - id := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ArcSettingName != "arcSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArcSettingName'", id.ArcSettingName, "arcSettingValue") - } -} - -func TestFormatArcSettingID(t *testing.T) { - actual := NewArcSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseArcSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestParseArcSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArcSettingId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe", - Expected: &ArcSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ArcSettingName: "aRcSeTtInGvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArcSettingIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - } -} - -func TestSegmentsForArcSettingId(t *testing.T) { - segments := ArcSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ArcSettingId 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/azurestackhci/2023-08-01/extensions/id_extension.go b/resource-manager/azurestackhci/2023-08-01/extensions/id_extension.go deleted file mode 100644 index b4cafce315f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/id_extension.go +++ /dev/null @@ -1,148 +0,0 @@ -package extensions - -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(&ExtensionId{}) -} - -var _ resourceids.ResourceId = &ExtensionId{} - -// ExtensionId is a struct representing the Resource ID for a Extension -type ExtensionId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ArcSettingName string - ExtensionName string -} - -// NewExtensionID returns a new ExtensionId struct -func NewExtensionID(subscriptionId string, resourceGroupName string, clusterName string, arcSettingName string, extensionName string) ExtensionId { - return ExtensionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ArcSettingName: arcSettingName, - ExtensionName: extensionName, - } -} - -// ParseExtensionID parses 'input' into a ExtensionId -func ParseExtensionID(input string) (*ExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExtensionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExtensionIDInsensitively parses 'input' case-insensitively into a ExtensionId -// note: this method should only be used for API response data and not user input -func ParseExtensionIDInsensitively(input string) (*ExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExtensionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExtensionId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ArcSettingName, ok = input.Parsed["arcSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arcSettingName", input) - } - - if id.ExtensionName, ok = input.Parsed["extensionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "extensionName", input) - } - - return nil -} - -// ValidateExtensionID checks that 'input' can be parsed as a Extension ID -func ValidateExtensionID(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 := ParseExtensionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Extension ID -func (id ExtensionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/arcSettings/%s/extensions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ArcSettingName, id.ExtensionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Extension ID -func (id ExtensionId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticArcSettings", "arcSettings", "arcSettings"), - resourceids.UserSpecifiedSegment("arcSettingName", "arcSettingValue"), - resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "extensionValue"), - } -} - -// String returns a human-readable description of this Extension ID -func (id ExtensionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Arc Setting Name: %q", id.ArcSettingName), - fmt.Sprintf("Extension Name: %q", id.ExtensionName), - } - return fmt.Sprintf("Extension (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/id_extension_test.go b/resource-manager/azurestackhci/2023-08-01/extensions/id_extension_test.go deleted file mode 100644 index bb42f56d91c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/id_extension_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package extensions - -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 = &ExtensionId{} - -func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ArcSettingName != "arcSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArcSettingName'", id.ArcSettingName, "arcSettingValue") - } - - if id.ExtensionName != "extensionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionValue") - } -} - -func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "arcSettingValue", "extensionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExtensionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExtensionId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExtensionID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestParseExtensionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExtensionId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/eXtEnSiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ArcSettingName: "arcSettingValue", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/arcSettings/arcSettingValue/extensions/extensionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/eXtEnSiOnS/eXtEnSiOnVaLuE", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ArcSettingName: "aRcSeTtInGvAlUe", - ExtensionName: "eXtEnSiOnVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/aRcSeTtInGs/aRcSeTtInGvAlUe/eXtEnSiOnS/eXtEnSiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExtensionIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ArcSettingName != v.Expected.ArcSettingName { - t.Fatalf("Expected %q but got %q for ArcSettingName", v.Expected.ArcSettingName, actual.ArcSettingName) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestSegmentsForExtensionId(t *testing.T) { - segments := ExtensionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExtensionId 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/azurestackhci/2023-08-01/extensions/method_create.go b/resource-manager/azurestackhci/2023-08-01/extensions/method_create.go deleted file mode 100644 index 272c77674e8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// Create ... -func (c ExtensionsClient) Create(ctx context.Context, id ExtensionId, input Extension) (result CreateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ExtensionsClient) CreateThenPoll(ctx context.Context, id ExtensionId, input Extension) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/method_delete.go b/resource-manager/azurestackhci/2023-08-01/extensions/method_delete.go deleted file mode 100644 index 00a5692b6d4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package extensions - -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 ExtensionsClient) Delete(ctx context.Context, id ExtensionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExtensionsClient) DeleteThenPoll(ctx context.Context, id ExtensionId) 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/azurestackhci/2023-08-01/extensions/method_get.go b/resource-manager/azurestackhci/2023-08-01/extensions/method_get.go deleted file mode 100644 index 2555add1944..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package extensions - -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 *Extension -} - -// Get ... -func (c ExtensionsClient) Get(ctx context.Context, id ExtensionId) (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 Extension - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/method_listbyarcsetting.go b/resource-manager/azurestackhci/2023-08-01/extensions/method_listbyarcsetting.go deleted file mode 100644 index f92097a0588..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/method_listbyarcsetting.go +++ /dev/null @@ -1,91 +0,0 @@ -package extensions - -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 ListByArcSettingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Extension -} - -type ListByArcSettingCompleteResult struct { - LatestHttpResponse *http.Response - Items []Extension -} - -// ListByArcSetting ... -func (c ExtensionsClient) ListByArcSetting(ctx context.Context, id ArcSettingId) (result ListByArcSettingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extensions", 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 *[]Extension `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByArcSettingComplete retrieves all the results into a single object -func (c ExtensionsClient) ListByArcSettingComplete(ctx context.Context, id ArcSettingId) (ListByArcSettingCompleteResult, error) { - return c.ListByArcSettingCompleteMatchingPredicate(ctx, id, ExtensionOperationPredicate{}) -} - -// ListByArcSettingCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExtensionsClient) ListByArcSettingCompleteMatchingPredicate(ctx context.Context, id ArcSettingId, predicate ExtensionOperationPredicate) (result ListByArcSettingCompleteResult, err error) { - items := make([]Extension, 0) - - resp, err := c.ListByArcSetting(ctx, id) - if err != nil { - 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 = ListByArcSettingCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/method_update.go b/resource-manager/azurestackhci/2023-08-01/extensions/method_update.go deleted file mode 100644 index 448e08ce7d8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// Update ... -func (c ExtensionsClient) Update(ctx context.Context, id ExtensionId, input ExtensionPatch) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ExtensionsClient) UpdateThenPoll(ctx context.Context, id ExtensionId, input ExtensionPatch) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/method_upgrade.go b/resource-manager/azurestackhci/2023-08-01/extensions/method_upgrade.go deleted file mode 100644 index 22d59b202cb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/method_upgrade.go +++ /dev/null @@ -1,73 +0,0 @@ -package extensions - -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 UpgradeOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Upgrade ... -func (c ExtensionsClient) Upgrade(ctx context.Context, id ExtensionId, input ExtensionUpgradeParameters) (result UpgradeOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/upgrade", 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 -} - -// UpgradeThenPoll performs Upgrade then polls until it's completed -func (c ExtensionsClient) UpgradeThenPoll(ctx context.Context, id ExtensionId, input ExtensionUpgradeParameters) error { - result, err := c.Upgrade(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Upgrade: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Upgrade: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extension.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extension.go deleted file mode 100644 index 7979b4827b5..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extension.go +++ /dev/null @@ -1,16 +0,0 @@ -package extensions - -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 Extension struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExtensionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceview.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceview.go deleted file mode 100644 index 8ef17ccd617..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceview.go +++ /dev/null @@ -1,11 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionInstanceView struct { - Name *string `json:"name,omitempty"` - Status *ExtensionInstanceViewStatus `json:"status,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceviewstatus.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceviewstatus.go deleted file mode 100644 index 6af4bdef7ff..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensioninstanceviewstatus.go +++ /dev/null @@ -1,30 +0,0 @@ -package extensions - -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 ExtensionInstanceViewStatus struct { - Code *string `json:"code,omitempty"` - DisplayStatus *string `json:"displayStatus,omitempty"` - Level *StatusLevelTypes `json:"level,omitempty"` - Message *string `json:"message,omitempty"` - Time *string `json:"time,omitempty"` -} - -func (o *ExtensionInstanceViewStatus) GetTimeAsTime() (*time.Time, error) { - if o.Time == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExtensionInstanceViewStatus) SetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Time = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionparameters.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionparameters.go deleted file mode 100644 index b267acba8cc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionParameters struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - Type *string `json:"type,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatch.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatch.go deleted file mode 100644 index a1640065bf9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPatch struct { - Properties *ExtensionPatchProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchparameters.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchparameters.go deleted file mode 100644 index 7ef03b42f20..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPatchParameters struct { - EnableAutomaticUpgrade *bool `json:"enableAutomaticUpgrade,omitempty"` - ProtectedSettings *interface{} `json:"protectedSettings,omitempty"` - Settings *interface{} `json:"settings,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchproperties.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchproperties.go deleted file mode 100644 index f4fea88c801..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionpatchproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPatchProperties struct { - ExtensionParameters *ExtensionPatchParameters `json:"extensionParameters,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionproperties.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionproperties.go deleted file mode 100644 index 79e09cb07f2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionProperties struct { - AggregateState *ExtensionAggregateState `json:"aggregateState,omitempty"` - ExtensionParameters *ExtensionParameters `json:"extensionParameters,omitempty"` - ManagedBy *ExtensionManagedBy `json:"managedBy,omitempty"` - PerNodeExtensionDetails *[]PerNodeExtensionState `json:"perNodeExtensionDetails,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionupgradeparameters.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionupgradeparameters.go deleted file mode 100644 index 7a45b84de73..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_extensionupgradeparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionUpgradeParameters struct { - TargetVersion *string `json:"targetVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/model_pernodeextensionstate.go b/resource-manager/azurestackhci/2023-08-01/extensions/model_pernodeextensionstate.go deleted file mode 100644 index d60ad7ca9dc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/model_pernodeextensionstate.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PerNodeExtensionState struct { - Extension *string `json:"extension,omitempty"` - InstanceView *ExtensionInstanceView `json:"instanceView,omitempty"` - Name *string `json:"name,omitempty"` - State *NodeExtensionState `json:"state,omitempty"` - TypeHandlerVersion *string `json:"typeHandlerVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/extensions/predicates.go b/resource-manager/azurestackhci/2023-08-01/extensions/predicates.go deleted file mode 100644 index 41d2fee4d9b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ExtensionOperationPredicate) Matches(input Extension) 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/azurestackhci/2023-08-01/extensions/version.go b/resource-manager/azurestackhci/2023-08-01/extensions/version.go deleted file mode 100644 index 71695326edf..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/extensions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/extensions/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/README.md b/resource-manager/azurestackhci/2023-08-01/offers/README.md deleted file mode 100644 index d6c2e4e3f6f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/README.md +++ /dev/null @@ -1,70 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/offers` Documentation - -The `offers` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/offers" -``` - - -### Client Initialization - -```go -client := offers.NewOffersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OffersClient.Get` - -```go -ctx := context.TODO() -id := offers.NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - -read, err := client.Get(ctx, id, offers.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `OffersClient.ListByCluster` - -```go -ctx := context.TODO() -id := offers.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id, offers.DefaultListByClusterOperationOptions())` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id, offers.DefaultListByClusterOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `OffersClient.ListByPublisher` - -```go -ctx := context.TODO() -id := offers.NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - -// alternatively `client.ListByPublisher(ctx, id, offers.DefaultListByPublisherOperationOptions())` can be used to do batched pagination -items, err := client.ListByPublisherComplete(ctx, id, offers.DefaultListByPublisherOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01/offers/client.go b/resource-manager/azurestackhci/2023-08-01/offers/client.go deleted file mode 100644 index 77b5dddcd7b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package offers - -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 OffersClient struct { - Client *resourcemanager.Client -} - -func NewOffersClientWithBaseURI(sdkApi sdkEnv.Api) (*OffersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "offers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating OffersClient: %+v", err) - } - - return &OffersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/offers/id_cluster.go deleted file mode 100644 index d14118c2987..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package offers - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/offers/id_cluster_test.go deleted file mode 100644 index 54aa1fe5b8e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package offers - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/offers/id_offer.go b/resource-manager/azurestackhci/2023-08-01/offers/id_offer.go deleted file mode 100644 index 1d00693f32b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/id_offer.go +++ /dev/null @@ -1,148 +0,0 @@ -package offers - -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(&OfferId{}) -} - -var _ resourceids.ResourceId = &OfferId{} - -// OfferId is a struct representing the Resource ID for a Offer -type OfferId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string - OfferName string -} - -// NewOfferID returns a new OfferId struct -func NewOfferID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string, offerName string) OfferId { - return OfferId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - OfferName: offerName, - } -} - -// ParseOfferID parses 'input' into a OfferId -func ParseOfferID(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOfferIDInsensitively parses 'input' case-insensitively into a OfferId -// note: this method should only be used for API response data and not user input -func ParseOfferIDInsensitively(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OfferId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - if id.OfferName, ok = input.Parsed["offerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "offerName", input) - } - - return nil -} - -// ValidateOfferID checks that 'input' can be parsed as a Offer ID -func ValidateOfferID(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 := ParseOfferID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Offer ID -func (id OfferId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s/offers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName, id.OfferName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Offer ID -func (id OfferId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offerValue"), - } -} - -// String returns a human-readable description of this Offer ID -func (id OfferId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - fmt.Sprintf("Offer Name: %q", id.OfferName), - } - return fmt.Sprintf("Offer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/id_offer_test.go b/resource-manager/azurestackhci/2023-08-01/offers/id_offer_test.go deleted file mode 100644 index 19f11c58fd6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/id_offer_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package offers - -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 = &OfferId{} - -func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } - - if id.OfferName != "offerValue" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerValue") - } -} - -func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOfferID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestParseOfferIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - OfferName: "oFfErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestSegmentsForOfferId(t *testing.T) { - segments := OfferId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OfferId 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/azurestackhci/2023-08-01/offers/id_publisher.go b/resource-manager/azurestackhci/2023-08-01/offers/id_publisher.go deleted file mode 100644 index e42b6673518..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/id_publisher.go +++ /dev/null @@ -1,139 +0,0 @@ -package offers - -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(&PublisherId{}) -} - -var _ resourceids.ResourceId = &PublisherId{} - -// PublisherId is a struct representing the Resource ID for a Publisher -type PublisherId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string -} - -// NewPublisherID returns a new PublisherId struct -func NewPublisherID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string) PublisherId { - return PublisherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - } -} - -// ParsePublisherID parses 'input' into a PublisherId -func ParsePublisherID(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublisherIDInsensitively parses 'input' case-insensitively into a PublisherId -// note: this method should only be used for API response data and not user input -func ParsePublisherIDInsensitively(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublisherId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - return nil -} - -// ValidatePublisherID checks that 'input' can be parsed as a Publisher ID -func ValidatePublisherID(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 := ParsePublisherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Publisher ID -func (id PublisherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Publisher ID -func (id PublisherId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - } -} - -// String returns a human-readable description of this Publisher ID -func (id PublisherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - } - return fmt.Sprintf("Publisher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/id_publisher_test.go b/resource-manager/azurestackhci/2023-08-01/offers/id_publisher_test.go deleted file mode 100644 index cbf8f7759e9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/id_publisher_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package offers - -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 = &PublisherId{} - -func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } -} - -func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublisherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestParsePublisherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestSegmentsForPublisherId(t *testing.T) { - segments := PublisherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublisherId 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/azurestackhci/2023-08-01/offers/method_get.go b/resource-manager/azurestackhci/2023-08-01/offers/method_get.go deleted file mode 100644 index d23785a91f3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package offers - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Offer -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c OffersClient) Get(ctx context.Context, id OfferId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 Offer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/method_listbycluster.go b/resource-manager/azurestackhci/2023-08-01/offers/method_listbycluster.go deleted file mode 100644 index 3da0fcf6cbf..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/method_listbycluster.go +++ /dev/null @@ -1,119 +0,0 @@ -package offers - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Offer -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []Offer -} - -type ListByClusterOperationOptions struct { - Expand *string -} - -func DefaultListByClusterOperationOptions() ListByClusterOperationOptions { - return ListByClusterOperationOptions{} -} - -func (o ListByClusterOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListByClusterOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListByClusterOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// ListByCluster ... -func (c OffersClient) ListByCluster(ctx context.Context, id ClusterId, options ListByClusterOperationOptions) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/offers", id.ID()), - OptionsObject: options, - } - - 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 *[]Offer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c OffersClient) ListByClusterComplete(ctx context.Context, id ClusterId, options ListByClusterOperationOptions) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, options, OfferOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OffersClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id ClusterId, options ListByClusterOperationOptions, predicate OfferOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]Offer, 0) - - resp, err := c.ListByCluster(ctx, id, options) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/method_listbypublisher.go b/resource-manager/azurestackhci/2023-08-01/offers/method_listbypublisher.go deleted file mode 100644 index dde705ba35d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/method_listbypublisher.go +++ /dev/null @@ -1,119 +0,0 @@ -package offers - -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 ListByPublisherOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Offer -} - -type ListByPublisherCompleteResult struct { - LatestHttpResponse *http.Response - Items []Offer -} - -type ListByPublisherOperationOptions struct { - Expand *string -} - -func DefaultListByPublisherOperationOptions() ListByPublisherOperationOptions { - return ListByPublisherOperationOptions{} -} - -func (o ListByPublisherOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListByPublisherOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListByPublisherOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// ListByPublisher ... -func (c OffersClient) ListByPublisher(ctx context.Context, id PublisherId, options ListByPublisherOperationOptions) (result ListByPublisherOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/offers", id.ID()), - OptionsObject: options, - } - - 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 *[]Offer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByPublisherComplete retrieves all the results into a single object -func (c OffersClient) ListByPublisherComplete(ctx context.Context, id PublisherId, options ListByPublisherOperationOptions) (ListByPublisherCompleteResult, error) { - return c.ListByPublisherCompleteMatchingPredicate(ctx, id, options, OfferOperationPredicate{}) -} - -// ListByPublisherCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OffersClient) ListByPublisherCompleteMatchingPredicate(ctx context.Context, id PublisherId, options ListByPublisherOperationOptions, predicate OfferOperationPredicate) (result ListByPublisherCompleteResult, err error) { - items := make([]Offer, 0) - - resp, err := c.ListByPublisher(ctx, id, options) - if err != nil { - 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 = ListByPublisherCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/model_offer.go b/resource-manager/azurestackhci/2023-08-01/offers/model_offer.go deleted file mode 100644 index e2c246d643b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/model_offer.go +++ /dev/null @@ -1,16 +0,0 @@ -package offers - -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 Offer struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OfferProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/model_offerproperties.go b/resource-manager/azurestackhci/2023-08-01/offers/model_offerproperties.go deleted file mode 100644 index a53c23229aa..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/model_offerproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package offers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfferProperties struct { - Content *string `json:"content,omitempty"` - ContentVersion *string `json:"contentVersion,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublisherId *string `json:"publisherId,omitempty"` - SkuMappings *[]SkuMappings `json:"skuMappings,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/model_skumappings.go b/resource-manager/azurestackhci/2023-08-01/offers/model_skumappings.go deleted file mode 100644 index a2c8233a121..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/model_skumappings.go +++ /dev/null @@ -1,10 +0,0 @@ -package offers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuMappings struct { - CatalogPlanId *string `json:"catalogPlanId,omitempty"` - MarketplaceSkuId *string `json:"marketplaceSkuId,omitempty"` - MarketplaceSkuVersions *[]string `json:"marketplaceSkuVersions,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/offers/predicates.go b/resource-manager/azurestackhci/2023-08-01/offers/predicates.go deleted file mode 100644 index 75da90fe272..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package offers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfferOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p OfferOperationPredicate) Matches(input Offer) 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/azurestackhci/2023-08-01/offers/version.go b/resource-manager/azurestackhci/2023-08-01/offers/version.go deleted file mode 100644 index 9e668719bf2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/offers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package offers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/offers/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/README.md b/resource-manager/azurestackhci/2023-08-01/publishers/README.md deleted file mode 100644 index 3173db44d96..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/publishers` Documentation - -The `publishers` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/publishers" -``` - - -### Client Initialization - -```go -client := publishers.NewPublishersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublishersClient.Get` - -```go -ctx := context.TODO() -id := publishers.NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - -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: `PublishersClient.ListByCluster` - -```go -ctx := context.TODO() -id := publishers.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/client.go b/resource-manager/azurestackhci/2023-08-01/publishers/client.go deleted file mode 100644 index ea59faa9c8e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publishers - -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 PublishersClient struct { - Client *resourcemanager.Client -} - -func NewPublishersClientWithBaseURI(sdkApi sdkEnv.Api) (*PublishersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publishers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublishersClient: %+v", err) - } - - return &PublishersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/publishers/id_cluster.go deleted file mode 100644 index 3a7fff3ea9d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package publishers - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/publishers/id_cluster_test.go deleted file mode 100644 index 282f6f51a1e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package publishers - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/publishers/id_publisher.go b/resource-manager/azurestackhci/2023-08-01/publishers/id_publisher.go deleted file mode 100644 index d8b7a773e80..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/id_publisher.go +++ /dev/null @@ -1,139 +0,0 @@ -package publishers - -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(&PublisherId{}) -} - -var _ resourceids.ResourceId = &PublisherId{} - -// PublisherId is a struct representing the Resource ID for a Publisher -type PublisherId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string -} - -// NewPublisherID returns a new PublisherId struct -func NewPublisherID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string) PublisherId { - return PublisherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - } -} - -// ParsePublisherID parses 'input' into a PublisherId -func ParsePublisherID(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublisherIDInsensitively parses 'input' case-insensitively into a PublisherId -// note: this method should only be used for API response data and not user input -func ParsePublisherIDInsensitively(input string) (*PublisherId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublisherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublisherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublisherId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - return nil -} - -// ValidatePublisherID checks that 'input' can be parsed as a Publisher ID -func ValidatePublisherID(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 := ParsePublisherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Publisher ID -func (id PublisherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Publisher ID -func (id PublisherId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - } -} - -// String returns a human-readable description of this Publisher ID -func (id PublisherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - } - return fmt.Sprintf("Publisher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/id_publisher_test.go b/resource-manager/azurestackhci/2023-08-01/publishers/id_publisher_test.go deleted file mode 100644 index 65a77ac1734..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/id_publisher_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package publishers - -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 = &PublisherId{} - -func TestNewPublisherID(t *testing.T) { - id := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } -} - -func TestFormatPublisherID(t *testing.T) { - actual := NewPublisherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublisherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestParsePublisherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublisherId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Expected: &PublisherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublisherIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - } -} - -func TestSegmentsForPublisherId(t *testing.T) { - segments := PublisherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublisherId 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/azurestackhci/2023-08-01/publishers/method_get.go b/resource-manager/azurestackhci/2023-08-01/publishers/method_get.go deleted file mode 100644 index 850e3f895f2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package publishers - -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 *Publisher -} - -// Get ... -func (c PublishersClient) Get(ctx context.Context, id PublisherId) (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 Publisher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/method_listbycluster.go b/resource-manager/azurestackhci/2023-08-01/publishers/method_listbycluster.go deleted file mode 100644 index afab97cd637..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/method_listbycluster.go +++ /dev/null @@ -1,91 +0,0 @@ -package publishers - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Publisher -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []Publisher -} - -// ListByCluster ... -func (c PublishersClient) ListByCluster(ctx context.Context, id ClusterId) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publishers", 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 *[]Publisher `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c PublishersClient) ListByClusterComplete(ctx context.Context, id ClusterId) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, PublisherOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublishersClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate PublisherOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]Publisher, 0) - - resp, err := c.ListByCluster(ctx, id) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/model_publisher.go b/resource-manager/azurestackhci/2023-08-01/publishers/model_publisher.go deleted file mode 100644 index 70fef995140..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/model_publisher.go +++ /dev/null @@ -1,16 +0,0 @@ -package publishers - -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 Publisher struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublisherProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/model_publisherproperties.go b/resource-manager/azurestackhci/2023-08-01/publishers/model_publisherproperties.go deleted file mode 100644 index 7aa30888f26..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/model_publisherproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package publishers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublisherProperties struct { - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/publishers/predicates.go b/resource-manager/azurestackhci/2023-08-01/publishers/predicates.go deleted file mode 100644 index efccddd2512..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package publishers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublisherOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PublisherOperationPredicate) Matches(input Publisher) 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/azurestackhci/2023-08-01/publishers/version.go b/resource-manager/azurestackhci/2023-08-01/publishers/version.go deleted file mode 100644 index 29aedb3666c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/publishers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publishers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publishers/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/README.md b/resource-manager/azurestackhci/2023-08-01/skuses/README.md deleted file mode 100644 index f60c400b5fe..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/skuses` Documentation - -The `skuses` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/skuses" -``` - - -### Client Initialization - -```go -client := skuses.NewSkusesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SkusesClient.SkusGet` - -```go -ctx := context.TODO() -id := skuses.NewSkuID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue", "skuValue") - -read, err := client.SkusGet(ctx, id, skuses.DefaultSkusGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SkusesClient.SkusListByOffer` - -```go -ctx := context.TODO() -id := skuses.NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - -// alternatively `client.SkusListByOffer(ctx, id, skuses.DefaultSkusListByOfferOperationOptions())` can be used to do batched pagination -items, err := client.SkusListByOfferComplete(ctx, id, skuses.DefaultSkusListByOfferOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/client.go b/resource-manager/azurestackhci/2023-08-01/skuses/client.go deleted file mode 100644 index 85bd1abeccf..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package skuses - -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 SkusesClient struct { - Client *resourcemanager.Client -} - -func NewSkusesClientWithBaseURI(sdkApi sdkEnv.Api) (*SkusesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "skuses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SkusesClient: %+v", err) - } - - return &SkusesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/id_offer.go b/resource-manager/azurestackhci/2023-08-01/skuses/id_offer.go deleted file mode 100644 index 2c3a4c1b840..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/id_offer.go +++ /dev/null @@ -1,148 +0,0 @@ -package skuses - -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(&OfferId{}) -} - -var _ resourceids.ResourceId = &OfferId{} - -// OfferId is a struct representing the Resource ID for a Offer -type OfferId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string - OfferName string -} - -// NewOfferID returns a new OfferId struct -func NewOfferID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string, offerName string) OfferId { - return OfferId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - OfferName: offerName, - } -} - -// ParseOfferID parses 'input' into a OfferId -func ParseOfferID(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOfferIDInsensitively parses 'input' case-insensitively into a OfferId -// note: this method should only be used for API response data and not user input -func ParseOfferIDInsensitively(input string) (*OfferId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfferId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfferId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OfferId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - if id.OfferName, ok = input.Parsed["offerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "offerName", input) - } - - return nil -} - -// ValidateOfferID checks that 'input' can be parsed as a Offer ID -func ValidateOfferID(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 := ParseOfferID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Offer ID -func (id OfferId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s/offers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName, id.OfferName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Offer ID -func (id OfferId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offerValue"), - } -} - -// String returns a human-readable description of this Offer ID -func (id OfferId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - fmt.Sprintf("Offer Name: %q", id.OfferName), - } - return fmt.Sprintf("Offer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/id_offer_test.go b/resource-manager/azurestackhci/2023-08-01/skuses/id_offer_test.go deleted file mode 100644 index 296f838b580..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/id_offer_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package skuses - -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 = &OfferId{} - -func TestNewOfferID(t *testing.T) { - id := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } - - if id.OfferName != "offerValue" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerValue") - } -} - -func TestFormatOfferID(t *testing.T) { - actual := NewOfferID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOfferID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestParseOfferIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfferId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE", - Expected: &OfferId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - OfferName: "oFfErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfferIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - } -} - -func TestSegmentsForOfferId(t *testing.T) { - segments := OfferId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OfferId 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/azurestackhci/2023-08-01/skuses/id_sku.go b/resource-manager/azurestackhci/2023-08-01/skuses/id_sku.go deleted file mode 100644 index d4e78d7c558..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/id_sku.go +++ /dev/null @@ -1,157 +0,0 @@ -package skuses - -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(&SkuId{}) -} - -var _ resourceids.ResourceId = &SkuId{} - -// SkuId is a struct representing the Resource ID for a Sku -type SkuId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - PublisherName string - OfferName string - SkuName string -} - -// NewSkuID returns a new SkuId struct -func NewSkuID(subscriptionId string, resourceGroupName string, clusterName string, publisherName string, offerName string, skuName string) SkuId { - return SkuId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - PublisherName: publisherName, - OfferName: offerName, - SkuName: skuName, - } -} - -// ParseSkuID parses 'input' into a SkuId -func ParseSkuID(input string) (*SkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&SkuId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSkuIDInsensitively parses 'input' case-insensitively into a SkuId -// note: this method should only be used for API response data and not user input -func ParseSkuIDInsensitively(input string) (*SkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&SkuId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SkuId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.PublisherName, ok = input.Parsed["publisherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publisherName", input) - } - - if id.OfferName, ok = input.Parsed["offerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "offerName", input) - } - - if id.SkuName, ok = input.Parsed["skuName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "skuName", input) - } - - return nil -} - -// ValidateSkuID checks that 'input' can be parsed as a Sku ID -func ValidateSkuID(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 := ParseSkuID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Sku ID -func (id SkuId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/publishers/%s/offers/%s/skus/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.PublisherName, id.OfferName, id.SkuName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Sku ID -func (id SkuId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticPublishers", "publishers", "publishers"), - resourceids.UserSpecifiedSegment("publisherName", "publisherValue"), - resourceids.StaticSegment("staticOffers", "offers", "offers"), - resourceids.UserSpecifiedSegment("offerName", "offerValue"), - resourceids.StaticSegment("staticSkus", "skus", "skus"), - resourceids.UserSpecifiedSegment("skuName", "skuValue"), - } -} - -// String returns a human-readable description of this Sku ID -func (id SkuId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Publisher Name: %q", id.PublisherName), - fmt.Sprintf("Offer Name: %q", id.OfferName), - fmt.Sprintf("Sku Name: %q", id.SkuName), - } - return fmt.Sprintf("Sku (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/id_sku_test.go b/resource-manager/azurestackhci/2023-08-01/skuses/id_sku_test.go deleted file mode 100644 index 3c8c14ebd3c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/id_sku_test.go +++ /dev/null @@ -1,417 +0,0 @@ -package skuses - -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 = &SkuId{} - -func TestNewSkuID(t *testing.T) { - id := NewSkuID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue", "skuValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.PublisherName != "publisherValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublisherName'", id.PublisherName, "publisherValue") - } - - if id.OfferName != "offerValue" { - t.Fatalf("Expected %q but got %q for Segment 'OfferName'", id.OfferName, "offerValue") - } - - if id.SkuName != "skuValue" { - t.Fatalf("Expected %q but got %q for Segment 'SkuName'", id.SkuName, "skuValue") - } -} - -func TestFormatSkuID(t *testing.T) { - actual := NewSkuID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "publisherValue", "offerValue", "skuValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSkuID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SkuId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue", - Expected: &SkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - SkuName: "skuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSkuID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - if actual.SkuName != v.Expected.SkuName { - t.Fatalf("Expected %q but got %q for SkuName", v.Expected.SkuName, actual.SkuName) - } - - } -} - -func TestParseSkuIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SkuId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/sKuS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue", - Expected: &SkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - PublisherName: "publisherValue", - OfferName: "offerValue", - SkuName: "skuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/publishers/publisherValue/offers/offerValue/skus/skuValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/sKuS/sKuVaLuE", - Expected: &SkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - PublisherName: "pUbLiShErVaLuE", - OfferName: "oFfErVaLuE", - SkuName: "sKuVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/pUbLiShErS/pUbLiShErVaLuE/oFfErS/oFfErVaLuE/sKuS/sKuVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSkuIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.PublisherName != v.Expected.PublisherName { - t.Fatalf("Expected %q but got %q for PublisherName", v.Expected.PublisherName, actual.PublisherName) - } - - if actual.OfferName != v.Expected.OfferName { - t.Fatalf("Expected %q but got %q for OfferName", v.Expected.OfferName, actual.OfferName) - } - - if actual.SkuName != v.Expected.SkuName { - t.Fatalf("Expected %q but got %q for SkuName", v.Expected.SkuName, actual.SkuName) - } - - } -} - -func TestSegmentsForSkuId(t *testing.T) { - segments := SkuId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SkuId 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/azurestackhci/2023-08-01/skuses/method_skusget.go b/resource-manager/azurestackhci/2023-08-01/skuses/method_skusget.go deleted file mode 100644 index 5ae2a348d5b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/method_skusget.go +++ /dev/null @@ -1,83 +0,0 @@ -package skuses - -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 SkusGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Sku -} - -type SkusGetOperationOptions struct { - Expand *string -} - -func DefaultSkusGetOperationOptions() SkusGetOperationOptions { - return SkusGetOperationOptions{} -} - -func (o SkusGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o SkusGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o SkusGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// SkusGet ... -func (c SkusesClient) SkusGet(ctx context.Context, id SkuId, options SkusGetOperationOptions) (result SkusGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 Sku - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/method_skuslistbyoffer.go b/resource-manager/azurestackhci/2023-08-01/skuses/method_skuslistbyoffer.go deleted file mode 100644 index b767e801788..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/method_skuslistbyoffer.go +++ /dev/null @@ -1,119 +0,0 @@ -package skuses - -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 SkusListByOfferOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Sku -} - -type SkusListByOfferCompleteResult struct { - LatestHttpResponse *http.Response - Items []Sku -} - -type SkusListByOfferOperationOptions struct { - Expand *string -} - -func DefaultSkusListByOfferOperationOptions() SkusListByOfferOperationOptions { - return SkusListByOfferOperationOptions{} -} - -func (o SkusListByOfferOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o SkusListByOfferOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o SkusListByOfferOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// SkusListByOffer ... -func (c SkusesClient) SkusListByOffer(ctx context.Context, id OfferId, options SkusListByOfferOperationOptions) (result SkusListByOfferOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/skus", id.ID()), - OptionsObject: options, - } - - 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 *[]Sku `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SkusListByOfferComplete retrieves all the results into a single object -func (c SkusesClient) SkusListByOfferComplete(ctx context.Context, id OfferId, options SkusListByOfferOperationOptions) (SkusListByOfferCompleteResult, error) { - return c.SkusListByOfferCompleteMatchingPredicate(ctx, id, options, SkuOperationPredicate{}) -} - -// SkusListByOfferCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SkusesClient) SkusListByOfferCompleteMatchingPredicate(ctx context.Context, id OfferId, options SkusListByOfferOperationOptions, predicate SkuOperationPredicate) (result SkusListByOfferCompleteResult, err error) { - items := make([]Sku, 0) - - resp, err := c.SkusListByOffer(ctx, id, options) - if err != nil { - 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 = SkusListByOfferCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/model_sku.go b/resource-manager/azurestackhci/2023-08-01/skuses/model_sku.go deleted file mode 100644 index cef2062f1bb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/model_sku.go +++ /dev/null @@ -1,16 +0,0 @@ -package skuses - -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 Sku struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SkuProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/model_skumappings.go b/resource-manager/azurestackhci/2023-08-01/skuses/model_skumappings.go deleted file mode 100644 index fd05acdaf7d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/model_skumappings.go +++ /dev/null @@ -1,10 +0,0 @@ -package skuses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuMappings struct { - CatalogPlanId *string `json:"catalogPlanId,omitempty"` - MarketplaceSkuId *string `json:"marketplaceSkuId,omitempty"` - MarketplaceSkuVersions *[]string `json:"marketplaceSkuVersions,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/model_skuproperties.go b/resource-manager/azurestackhci/2023-08-01/skuses/model_skuproperties.go deleted file mode 100644 index bc60d0aec34..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/model_skuproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package skuses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuProperties struct { - Content *string `json:"content,omitempty"` - ContentVersion *string `json:"contentVersion,omitempty"` - OfferId *string `json:"offerId,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublisherId *string `json:"publisherId,omitempty"` - SkuMappings *[]SkuMappings `json:"skuMappings,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/skuses/predicates.go b/resource-manager/azurestackhci/2023-08-01/skuses/predicates.go deleted file mode 100644 index 77c587da8fa..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package skuses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SkuOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p SkuOperationPredicate) Matches(input Sku) 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/azurestackhci/2023-08-01/skuses/version.go b/resource-manager/azurestackhci/2023-08-01/skuses/version.go deleted file mode 100644 index a4a17e5b542..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/skuses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package skuses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/skuses/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/README.md b/resource-manager/azurestackhci/2023-08-01/updateruns/README.md deleted file mode 100644 index 2341f358f0a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/updateruns` Documentation - -The `updateruns` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/updateruns" -``` - - -### Client Initialization - -```go -client := updateruns.NewUpdateRunsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdateRunsClient.Delete` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdateRunsClient.Get` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - -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: `UpdateRunsClient.List` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -// 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: `UpdateRunsClient.Put` - -```go -ctx := context.TODO() -id := updateruns.NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - -payload := updateruns.UpdateRun{ - // ... -} - - -read, err := client.Put(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/azurestackhci/2023-08-01/updateruns/client.go b/resource-manager/azurestackhci/2023-08-01/updateruns/client.go deleted file mode 100644 index a5becca3c6b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updateruns - -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 UpdateRunsClient struct { - Client *resourcemanager.Client -} - -func NewUpdateRunsClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdateRunsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updateruns", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdateRunsClient: %+v", err) - } - - return &UpdateRunsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/constants.go b/resource-manager/azurestackhci/2023-08-01/updateruns/constants.go deleted file mode 100644 index ff4039a367d..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/constants.go +++ /dev/null @@ -1,107 +0,0 @@ -package updateruns - -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 ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateFailed), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "failed": ProvisioningStateFailed, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UpdateRunPropertiesState string - -const ( - UpdateRunPropertiesStateFailed UpdateRunPropertiesState = "Failed" - UpdateRunPropertiesStateInProgress UpdateRunPropertiesState = "InProgress" - UpdateRunPropertiesStateSucceeded UpdateRunPropertiesState = "Succeeded" - UpdateRunPropertiesStateUnknown UpdateRunPropertiesState = "Unknown" -) - -func PossibleValuesForUpdateRunPropertiesState() []string { - return []string{ - string(UpdateRunPropertiesStateFailed), - string(UpdateRunPropertiesStateInProgress), - string(UpdateRunPropertiesStateSucceeded), - string(UpdateRunPropertiesStateUnknown), - } -} - -func (s *UpdateRunPropertiesState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateRunPropertiesState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateRunPropertiesState(input string) (*UpdateRunPropertiesState, error) { - vals := map[string]UpdateRunPropertiesState{ - "failed": UpdateRunPropertiesStateFailed, - "inprogress": UpdateRunPropertiesStateInProgress, - "succeeded": UpdateRunPropertiesStateSucceeded, - "unknown": UpdateRunPropertiesStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateRunPropertiesState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/id_update.go b/resource-manager/azurestackhci/2023-08-01/updateruns/id_update.go deleted file mode 100644 index f8744304b63..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/id_update.go +++ /dev/null @@ -1,139 +0,0 @@ -package updateruns - -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(&UpdateId{}) -} - -var _ resourceids.ResourceId = &UpdateId{} - -// UpdateId is a struct representing the Resource ID for a Update -type UpdateId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - UpdateName string -} - -// NewUpdateID returns a new UpdateId struct -func NewUpdateID(subscriptionId string, resourceGroupName string, clusterName string, updateName string) UpdateId { - return UpdateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - UpdateName: updateName, - } -} - -// ParseUpdateID parses 'input' into a UpdateId -func ParseUpdateID(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUpdateIDInsensitively parses 'input' case-insensitively into a UpdateId -// note: this method should only be used for API response data and not user input -func ParseUpdateIDInsensitively(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UpdateId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.UpdateName, ok = input.Parsed["updateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateName", input) - } - - return nil -} - -// ValidateUpdateID checks that 'input' can be parsed as a Update ID -func ValidateUpdateID(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 := ParseUpdateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Update ID -func (id UpdateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/updates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.UpdateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Update ID -func (id UpdateId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticUpdates", "updates", "updates"), - resourceids.UserSpecifiedSegment("updateName", "updateValue"), - } -} - -// String returns a human-readable description of this Update ID -func (id UpdateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Update Name: %q", id.UpdateName), - } - return fmt.Sprintf("Update (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/id_update_test.go b/resource-manager/azurestackhci/2023-08-01/updateruns/id_update_test.go deleted file mode 100644 index d861fbd5428..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/id_update_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package updateruns - -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 = &UpdateId{} - -func TestNewUpdateID(t *testing.T) { - id := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.UpdateName != "updateValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateName'", id.UpdateName, "updateValue") - } -} - -func TestFormatUpdateID(t *testing.T) { - actual := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUpdateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestParseUpdateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - UpdateName: "uPdAtEvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestSegmentsForUpdateId(t *testing.T) { - segments := UpdateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UpdateId 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/azurestackhci/2023-08-01/updateruns/id_updaterun.go b/resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun.go deleted file mode 100644 index 14b2180425f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun.go +++ /dev/null @@ -1,148 +0,0 @@ -package updateruns - -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(&UpdateRunId{}) -} - -var _ resourceids.ResourceId = &UpdateRunId{} - -// UpdateRunId is a struct representing the Resource ID for a Update Run -type UpdateRunId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - UpdateName string - UpdateRunName string -} - -// NewUpdateRunID returns a new UpdateRunId struct -func NewUpdateRunID(subscriptionId string, resourceGroupName string, clusterName string, updateName string, updateRunName string) UpdateRunId { - return UpdateRunId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - UpdateName: updateName, - UpdateRunName: updateRunName, - } -} - -// ParseUpdateRunID parses 'input' into a UpdateRunId -func ParseUpdateRunID(input string) (*UpdateRunId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateRunId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateRunId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUpdateRunIDInsensitively parses 'input' case-insensitively into a UpdateRunId -// note: this method should only be used for API response data and not user input -func ParseUpdateRunIDInsensitively(input string) (*UpdateRunId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateRunId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateRunId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UpdateRunId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.UpdateName, ok = input.Parsed["updateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateName", input) - } - - if id.UpdateRunName, ok = input.Parsed["updateRunName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateRunName", input) - } - - return nil -} - -// ValidateUpdateRunID checks that 'input' can be parsed as a Update Run ID -func ValidateUpdateRunID(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 := ParseUpdateRunID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Update Run ID -func (id UpdateRunId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/updates/%s/updateRuns/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.UpdateName, id.UpdateRunName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Update Run ID -func (id UpdateRunId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticUpdates", "updates", "updates"), - resourceids.UserSpecifiedSegment("updateName", "updateValue"), - resourceids.StaticSegment("staticUpdateRuns", "updateRuns", "updateRuns"), - resourceids.UserSpecifiedSegment("updateRunName", "updateRunValue"), - } -} - -// String returns a human-readable description of this Update Run ID -func (id UpdateRunId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Update Name: %q", id.UpdateName), - fmt.Sprintf("Update Run Name: %q", id.UpdateRunName), - } - return fmt.Sprintf("Update Run (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun_test.go b/resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun_test.go deleted file mode 100644 index fa0b09aab3e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/id_updaterun_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package updateruns - -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 = &UpdateRunId{} - -func TestNewUpdateRunID(t *testing.T) { - id := NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.UpdateName != "updateValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateName'", id.UpdateName, "updateValue") - } - - if id.UpdateRunName != "updateRunValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateRunName'", id.UpdateRunName, "updateRunValue") - } -} - -func TestFormatUpdateRunID(t *testing.T) { - actual := NewUpdateRunID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue", "updateRunValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUpdateRunID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateRunId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue", - Expected: &UpdateRunId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - UpdateRunName: "updateRunValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateRunID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - if actual.UpdateRunName != v.Expected.UpdateRunName { - t.Fatalf("Expected %q but got %q for UpdateRunName", v.Expected.UpdateRunName, actual.UpdateRunName) - } - - } -} - -func TestParseUpdateRunIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateRunId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/uPdAtErUnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue", - Expected: &UpdateRunId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - UpdateRunName: "updateRunValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/updateRuns/updateRunValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/uPdAtErUnS/uPdAtErUnVaLuE", - Expected: &UpdateRunId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - UpdateName: "uPdAtEvAlUe", - UpdateRunName: "uPdAtErUnVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/uPdAtErUnS/uPdAtErUnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateRunIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - if actual.UpdateRunName != v.Expected.UpdateRunName { - t.Fatalf("Expected %q but got %q for UpdateRunName", v.Expected.UpdateRunName, actual.UpdateRunName) - } - - } -} - -func TestSegmentsForUpdateRunId(t *testing.T) { - segments := UpdateRunId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UpdateRunId 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/azurestackhci/2023-08-01/updateruns/method_delete.go b/resource-manager/azurestackhci/2023-08-01/updateruns/method_delete.go deleted file mode 100644 index 93881d05ad3..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package updateruns - -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 UpdateRunsClient) Delete(ctx context.Context, id UpdateRunId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 UpdateRunsClient) DeleteThenPoll(ctx context.Context, id UpdateRunId) 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/azurestackhci/2023-08-01/updateruns/method_get.go b/resource-manager/azurestackhci/2023-08-01/updateruns/method_get.go deleted file mode 100644 index 674bbb589e9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package updateruns - -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 *UpdateRun -} - -// Get ... -func (c UpdateRunsClient) Get(ctx context.Context, id UpdateRunId) (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 UpdateRun - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/method_list.go b/resource-manager/azurestackhci/2023-08-01/updateruns/method_list.go deleted file mode 100644 index f530acd5f28..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package updateruns - -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 *[]UpdateRun -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []UpdateRun -} - -// List ... -func (c UpdateRunsClient) List(ctx context.Context, id UpdateId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updateRuns", 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 *[]UpdateRun `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 UpdateRunsClient) ListComplete(ctx context.Context, id UpdateId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UpdateRunOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UpdateRunsClient) ListCompleteMatchingPredicate(ctx context.Context, id UpdateId, predicate UpdateRunOperationPredicate) (result ListCompleteResult, err error) { - items := make([]UpdateRun, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01/updateruns/method_put.go b/resource-manager/azurestackhci/2023-08-01/updateruns/method_put.go deleted file mode 100644 index 58f21298c0f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/method_put.go +++ /dev/null @@ -1,58 +0,0 @@ -package updateruns - -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 PutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UpdateRun -} - -// Put ... -func (c UpdateRunsClient) Put(ctx context.Context, id UpdateRunId, input UpdateRun) (result PutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 UpdateRun - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/model_step.go b/resource-manager/azurestackhci/2023-08-01/updateruns/model_step.go deleted file mode 100644 index ece5d657342..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/model_step.go +++ /dev/null @@ -1,57 +0,0 @@ -package updateruns - -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 Step struct { - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Name *string `json:"name,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *string `json:"status,omitempty"` - Steps *[]Step `json:"steps,omitempty"` -} - -func (o *Step) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *Step) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *Step) GetLastUpdatedTimeUtcAsTime() (*time.Time, error) { - if o.LastUpdatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *Step) SetLastUpdatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTimeUtc = &formatted -} - -func (o *Step) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *Step) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterun.go b/resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterun.go deleted file mode 100644 index d8fbe7ca6b7..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterun.go +++ /dev/null @@ -1,17 +0,0 @@ -package updateruns - -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 UpdateRun struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *UpdateRunProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterunproperties.go b/resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterunproperties.go deleted file mode 100644 index a2500945de0..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/model_updaterunproperties.go +++ /dev/null @@ -1,43 +0,0 @@ -package updateruns - -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 UpdateRunProperties struct { - Duration *string `json:"duration,omitempty"` - LastUpdatedTime *string `json:"lastUpdatedTime,omitempty"` - Progress *Step `json:"progress,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - State *UpdateRunPropertiesState `json:"state,omitempty"` - TimeStarted *string `json:"timeStarted,omitempty"` -} - -func (o *UpdateRunProperties) GetLastUpdatedTimeAsTime() (*time.Time, error) { - if o.LastUpdatedTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateRunProperties) SetLastUpdatedTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTime = &formatted -} - -func (o *UpdateRunProperties) GetTimeStartedAsTime() (*time.Time, error) { - if o.TimeStarted == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeStarted, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateRunProperties) SetTimeStartedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeStarted = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updateruns/predicates.go b/resource-manager/azurestackhci/2023-08-01/updateruns/predicates.go deleted file mode 100644 index 3634b9136ba..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package updateruns - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateRunOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p UpdateRunOperationPredicate) Matches(input UpdateRun) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/azurestackhci/2023-08-01/updateruns/version.go b/resource-manager/azurestackhci/2023-08-01/updateruns/version.go deleted file mode 100644 index 41042b37934..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updateruns/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updateruns - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updateruns/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/README.md b/resource-manager/azurestackhci/2023-08-01/updates/README.md deleted file mode 100644 index cd761e488e4..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/README.md +++ /dev/null @@ -1,98 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/updates` Documentation - -The `updates` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/updates" -``` - - -### Client Initialization - -```go -client := updates.NewUpdatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdatesClient.Delete` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdatesClient.Get` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -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: `UpdatesClient.List` - -```go -ctx := context.TODO() -id := updates.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// 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: `UpdatesClient.Post` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -if err := client.PostThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdatesClient.Put` - -```go -ctx := context.TODO() -id := updates.NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - -payload := updates.Update{ - // ... -} - - -read, err := client.Put(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/azurestackhci/2023-08-01/updates/client.go b/resource-manager/azurestackhci/2023-08-01/updates/client.go deleted file mode 100644 index f8438b80656..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updates - -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 UpdatesClient struct { - Client *resourcemanager.Client -} - -func NewUpdatesClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdatesClient: %+v", err) - } - - return &UpdatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/constants.go b/resource-manager/azurestackhci/2023-08-01/updates/constants.go deleted file mode 100644 index 648846294a9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/constants.go +++ /dev/null @@ -1,381 +0,0 @@ -package updates - -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 AvailabilityType string - -const ( - AvailabilityTypeLocal AvailabilityType = "Local" - AvailabilityTypeNotify AvailabilityType = "Notify" - AvailabilityTypeOnline AvailabilityType = "Online" -) - -func PossibleValuesForAvailabilityType() []string { - return []string{ - string(AvailabilityTypeLocal), - string(AvailabilityTypeNotify), - string(AvailabilityTypeOnline), - } -} - -func (s *AvailabilityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAvailabilityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAvailabilityType(input string) (*AvailabilityType, error) { - vals := map[string]AvailabilityType{ - "local": AvailabilityTypeLocal, - "notify": AvailabilityTypeNotify, - "online": AvailabilityTypeOnline, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AvailabilityType(input) - return &out, nil -} - -type HealthState string - -const ( - HealthStateError HealthState = "Error" - HealthStateFailure HealthState = "Failure" - HealthStateInProgress HealthState = "InProgress" - HealthStateSuccess HealthState = "Success" - HealthStateUnknown HealthState = "Unknown" - HealthStateWarning HealthState = "Warning" -) - -func PossibleValuesForHealthState() []string { - return []string{ - string(HealthStateError), - string(HealthStateFailure), - string(HealthStateInProgress), - string(HealthStateSuccess), - string(HealthStateUnknown), - string(HealthStateWarning), - } -} - -func (s *HealthState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHealthState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHealthState(input string) (*HealthState, error) { - vals := map[string]HealthState{ - "error": HealthStateError, - "failure": HealthStateFailure, - "inprogress": HealthStateInProgress, - "success": HealthStateSuccess, - "unknown": HealthStateUnknown, - "warning": HealthStateWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HealthState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateFailed), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "failed": ProvisioningStateFailed, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RebootRequirement string - -const ( - RebootRequirementFalse RebootRequirement = "False" - RebootRequirementTrue RebootRequirement = "True" - RebootRequirementUnknown RebootRequirement = "Unknown" -) - -func PossibleValuesForRebootRequirement() []string { - return []string{ - string(RebootRequirementFalse), - string(RebootRequirementTrue), - string(RebootRequirementUnknown), - } -} - -func (s *RebootRequirement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRebootRequirement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRebootRequirement(input string) (*RebootRequirement, error) { - vals := map[string]RebootRequirement{ - "false": RebootRequirementFalse, - "true": RebootRequirementTrue, - "unknown": RebootRequirementUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RebootRequirement(input) - return &out, nil -} - -type Severity string - -const ( - SeverityCritical Severity = "Critical" - SeverityHidden Severity = "Hidden" - SeverityInformational Severity = "Informational" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityCritical), - string(SeverityHidden), - string(SeverityInformational), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "critical": SeverityCritical, - "hidden": SeverityHidden, - "informational": SeverityInformational, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} - -type State string - -const ( - StateDownloadFailed State = "DownloadFailed" - StateDownloading State = "Downloading" - StateHasPrerequisite State = "HasPrerequisite" - StateHealthCheckFailed State = "HealthCheckFailed" - StateHealthChecking State = "HealthChecking" - StateInstallationFailed State = "InstallationFailed" - StateInstalled State = "Installed" - StateInstalling State = "Installing" - StateInvalid State = "Invalid" - StateNotApplicableBecauseAnotherUpdateIsInProgress State = "NotApplicableBecauseAnotherUpdateIsInProgress" - StateObsolete State = "Obsolete" - StatePreparationFailed State = "PreparationFailed" - StatePreparing State = "Preparing" - StateReady State = "Ready" - StateReadyToInstall State = "ReadyToInstall" - StateRecalled State = "Recalled" - StateScanFailed State = "ScanFailed" - StateScanInProgress State = "ScanInProgress" -) - -func PossibleValuesForState() []string { - return []string{ - string(StateDownloadFailed), - string(StateDownloading), - string(StateHasPrerequisite), - string(StateHealthCheckFailed), - string(StateHealthChecking), - string(StateInstallationFailed), - string(StateInstalled), - string(StateInstalling), - string(StateInvalid), - string(StateNotApplicableBecauseAnotherUpdateIsInProgress), - string(StateObsolete), - string(StatePreparationFailed), - string(StatePreparing), - string(StateReady), - string(StateReadyToInstall), - string(StateRecalled), - string(StateScanFailed), - string(StateScanInProgress), - } -} - -func (s *State) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseState(input string) (*State, error) { - vals := map[string]State{ - "downloadfailed": StateDownloadFailed, - "downloading": StateDownloading, - "hasprerequisite": StateHasPrerequisite, - "healthcheckfailed": StateHealthCheckFailed, - "healthchecking": StateHealthChecking, - "installationfailed": StateInstallationFailed, - "installed": StateInstalled, - "installing": StateInstalling, - "invalid": StateInvalid, - "notapplicablebecauseanotherupdateisinprogress": StateNotApplicableBecauseAnotherUpdateIsInProgress, - "obsolete": StateObsolete, - "preparationfailed": StatePreparationFailed, - "preparing": StatePreparing, - "ready": StateReady, - "readytoinstall": StateReadyToInstall, - "recalled": StateRecalled, - "scanfailed": StateScanFailed, - "scaninprogress": StateScanInProgress, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := State(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/updates/id_cluster.go deleted file mode 100644 index 1b34e01fffc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package updates - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/updates/id_cluster_test.go deleted file mode 100644 index 8555f39fa7e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package updates - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/updates/id_update.go b/resource-manager/azurestackhci/2023-08-01/updates/id_update.go deleted file mode 100644 index 1588a8a86ff..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/id_update.go +++ /dev/null @@ -1,139 +0,0 @@ -package updates - -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(&UpdateId{}) -} - -var _ resourceids.ResourceId = &UpdateId{} - -// UpdateId is a struct representing the Resource ID for a Update -type UpdateId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - UpdateName string -} - -// NewUpdateID returns a new UpdateId struct -func NewUpdateID(subscriptionId string, resourceGroupName string, clusterName string, updateName string) UpdateId { - return UpdateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - UpdateName: updateName, - } -} - -// ParseUpdateID parses 'input' into a UpdateId -func ParseUpdateID(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUpdateIDInsensitively parses 'input' case-insensitively into a UpdateId -// note: this method should only be used for API response data and not user input -func ParseUpdateIDInsensitively(input string) (*UpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&UpdateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UpdateId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.UpdateName, ok = input.Parsed["updateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "updateName", input) - } - - return nil -} - -// ValidateUpdateID checks that 'input' can be parsed as a Update ID -func ValidateUpdateID(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 := ParseUpdateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Update ID -func (id UpdateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s/updates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.UpdateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Update ID -func (id UpdateId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticUpdates", "updates", "updates"), - resourceids.UserSpecifiedSegment("updateName", "updateValue"), - } -} - -// String returns a human-readable description of this Update ID -func (id UpdateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Update Name: %q", id.UpdateName), - } - return fmt.Sprintf("Update (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/id_update_test.go b/resource-manager/azurestackhci/2023-08-01/updates/id_update_test.go deleted file mode 100644 index a0c73c81ba2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/id_update_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package updates - -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 = &UpdateId{} - -func TestNewUpdateID(t *testing.T) { - id := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.UpdateName != "updateValue" { - t.Fatalf("Expected %q but got %q for Segment 'UpdateName'", id.UpdateName, "updateValue") - } -} - -func TestFormatUpdateID(t *testing.T) { - actual := NewUpdateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "updateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUpdateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestParseUpdateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UpdateId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - UpdateName: "updateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/updates/updateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe", - Expected: &UpdateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - UpdateName: "uPdAtEvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/uPdAtEs/uPdAtEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUpdateIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.UpdateName != v.Expected.UpdateName { - t.Fatalf("Expected %q but got %q for UpdateName", v.Expected.UpdateName, actual.UpdateName) - } - - } -} - -func TestSegmentsForUpdateId(t *testing.T) { - segments := UpdateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UpdateId 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/azurestackhci/2023-08-01/updates/method_delete.go b/resource-manager/azurestackhci/2023-08-01/updates/method_delete.go deleted file mode 100644 index e2977fac7f9..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package updates - -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 UpdatesClient) Delete(ctx context.Context, id UpdateId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 UpdatesClient) DeleteThenPoll(ctx context.Context, id UpdateId) 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/azurestackhci/2023-08-01/updates/method_get.go b/resource-manager/azurestackhci/2023-08-01/updates/method_get.go deleted file mode 100644 index 7608d9b1fdd..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package updates - -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 *Update -} - -// Get ... -func (c UpdatesClient) Get(ctx context.Context, id UpdateId) (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 Update - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/method_list.go b/resource-manager/azurestackhci/2023-08-01/updates/method_list.go deleted file mode 100644 index c0ef9b34fe6..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package updates - -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 *[]Update -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Update -} - -// List ... -func (c UpdatesClient) List(ctx context.Context, id ClusterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updates", 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 *[]Update `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 UpdatesClient) ListComplete(ctx context.Context, id ClusterId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UpdateOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UpdatesClient) ListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate UpdateOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Update, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01/updates/method_post.go b/resource-manager/azurestackhci/2023-08-01/updates/method_post.go deleted file mode 100644 index b41ccb849bb..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/method_post.go +++ /dev/null @@ -1,70 +0,0 @@ -package updates - -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 PostOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Post ... -func (c UpdatesClient) Post(ctx context.Context, id UpdateId) (result PostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/apply", 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 -} - -// PostThenPoll performs Post then polls until it's completed -func (c UpdatesClient) PostThenPoll(ctx context.Context, id UpdateId) error { - result, err := c.Post(ctx, id) - if err != nil { - return fmt.Errorf("performing Post: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Post: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/method_put.go b/resource-manager/azurestackhci/2023-08-01/updates/method_put.go deleted file mode 100644 index 1da3ed2ae54..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/method_put.go +++ /dev/null @@ -1,58 +0,0 @@ -package updates - -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 PutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Update -} - -// Put ... -func (c UpdatesClient) Put(ctx context.Context, id UpdateId, input Update) (result PutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Update - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_packageversioninfo.go b/resource-manager/azurestackhci/2023-08-01/updates/model_packageversioninfo.go deleted file mode 100644 index 2376b23ed11..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_packageversioninfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package updates - -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 PackageVersionInfo struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - PackageType *string `json:"packageType,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *PackageVersionInfo) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *PackageVersionInfo) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_precheckresult.go b/resource-manager/azurestackhci/2023-08-01/updates/model_precheckresult.go deleted file mode 100644 index 22b924a1d10..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_precheckresult.go +++ /dev/null @@ -1,37 +0,0 @@ -package updates - -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 PrecheckResult struct { - AdditionalData *string `json:"additionalData,omitempty"` - Description *string `json:"description,omitempty"` - HealthCheckSource *string `json:"healthCheckSource,omitempty"` - Name *string `json:"name,omitempty"` - Remediation *string `json:"remediation,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Status *Status `json:"status,omitempty"` - Tags *PrecheckResultTags `json:"tags,omitempty"` - TargetResourceID *string `json:"targetResourceID,omitempty"` - TargetResourceName *string `json:"targetResourceName,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (o *PrecheckResult) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *PrecheckResult) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_precheckresulttags.go b/resource-manager/azurestackhci/2023-08-01/updates/model_precheckresulttags.go deleted file mode 100644 index eac41de78dc..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_precheckresulttags.go +++ /dev/null @@ -1,9 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrecheckResultTags struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_update.go b/resource-manager/azurestackhci/2023-08-01/updates/model_update.go deleted file mode 100644 index c5722f69cb2..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_update.go +++ /dev/null @@ -1,17 +0,0 @@ -package updates - -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 Update struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *UpdateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_updateprerequisite.go b/resource-manager/azurestackhci/2023-08-01/updates/model_updateprerequisite.go deleted file mode 100644 index 42904efc591..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_updateprerequisite.go +++ /dev/null @@ -1,10 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdatePrerequisite struct { - PackageName *string `json:"packageName,omitempty"` - UpdateType *string `json:"updateType,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_updateproperties.go b/resource-manager/azurestackhci/2023-08-01/updates/model_updateproperties.go deleted file mode 100644 index 7c2ffff7e51..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_updateproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -package updates - -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 UpdateProperties struct { - AdditionalProperties *string `json:"additionalProperties,omitempty"` - AvailabilityType *AvailabilityType `json:"availabilityType,omitempty"` - ComponentVersions *[]PackageVersionInfo `json:"componentVersions,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - HealthCheckDate *string `json:"healthCheckDate,omitempty"` - HealthCheckResult *[]PrecheckResult `json:"healthCheckResult,omitempty"` - HealthState *HealthState `json:"healthState,omitempty"` - InstalledDate *string `json:"installedDate,omitempty"` - PackagePath *string `json:"packagePath,omitempty"` - PackageSizeInMb *float64 `json:"packageSizeInMb,omitempty"` - PackageType *string `json:"packageType,omitempty"` - Prerequisites *[]UpdatePrerequisite `json:"prerequisites,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Publisher *string `json:"publisher,omitempty"` - RebootRequired *RebootRequirement `json:"rebootRequired,omitempty"` - ReleaseLink *string `json:"releaseLink,omitempty"` - State *State `json:"state,omitempty"` - UpdateStateProperties *UpdateStateProperties `json:"updateStateProperties,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *UpdateProperties) GetHealthCheckDateAsTime() (*time.Time, error) { - if o.HealthCheckDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.HealthCheckDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateProperties) SetHealthCheckDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.HealthCheckDate = &formatted -} - -func (o *UpdateProperties) GetInstalledDateAsTime() (*time.Time, error) { - if o.InstalledDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.InstalledDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateProperties) SetInstalledDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.InstalledDate = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/model_updatestateproperties.go b/resource-manager/azurestackhci/2023-08-01/updates/model_updatestateproperties.go deleted file mode 100644 index 4a17ca955a8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/model_updatestateproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateStateProperties struct { - NotifyMessage *string `json:"notifyMessage,omitempty"` - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updates/predicates.go b/resource-manager/azurestackhci/2023-08-01/updates/predicates.go deleted file mode 100644 index d64c5b9063f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p UpdateOperationPredicate) Matches(input Update) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/azurestackhci/2023-08-01/updates/version.go b/resource-manager/azurestackhci/2023-08-01/updates/version.go deleted file mode 100644 index 5cc2633fd5f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updates/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/README.md b/resource-manager/azurestackhci/2023-08-01/updatesummaries/README.md deleted file mode 100644 index fdabe651d0b..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-08-01/updatesummaries` Documentation - -The `updatesummaries` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-08-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/azurestackhci/2023-08-01/updatesummaries" -``` - - -### Client Initialization - -```go -client := updatesummaries.NewUpdateSummariesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdateSummariesClient.Delete` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UpdateSummariesClient.Get` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -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: `UpdateSummariesClient.List` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// 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: `UpdateSummariesClient.Put` - -```go -ctx := context.TODO() -id := updatesummaries.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := updatesummaries.UpdateSummaries{ - // ... -} - - -read, err := client.Put(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/azurestackhci/2023-08-01/updatesummaries/client.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/client.go deleted file mode 100644 index 869223878e1..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updatesummaries - -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 UpdateSummariesClient struct { - Client *resourcemanager.Client -} - -func NewUpdateSummariesClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdateSummariesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updatesummaries", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdateSummariesClient: %+v", err) - } - - return &UpdateSummariesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/constants.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/constants.go deleted file mode 100644 index ddc5ca86b5c..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/constants.go +++ /dev/null @@ -1,263 +0,0 @@ -package updatesummaries - -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 HealthState string - -const ( - HealthStateError HealthState = "Error" - HealthStateFailure HealthState = "Failure" - HealthStateInProgress HealthState = "InProgress" - HealthStateSuccess HealthState = "Success" - HealthStateUnknown HealthState = "Unknown" - HealthStateWarning HealthState = "Warning" -) - -func PossibleValuesForHealthState() []string { - return []string{ - string(HealthStateError), - string(HealthStateFailure), - string(HealthStateInProgress), - string(HealthStateSuccess), - string(HealthStateUnknown), - string(HealthStateWarning), - } -} - -func (s *HealthState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHealthState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHealthState(input string) (*HealthState, error) { - vals := map[string]HealthState{ - "error": HealthStateError, - "failure": HealthStateFailure, - "inprogress": HealthStateInProgress, - "success": HealthStateSuccess, - "unknown": HealthStateUnknown, - "warning": HealthStateWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HealthState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateAccepted ProvisioningState = "Accepted" - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateProvisioning ProvisioningState = "Provisioning" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateAccepted), - string(ProvisioningStateCanceled), - string(ProvisioningStateFailed), - string(ProvisioningStateProvisioning), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "accepted": ProvisioningStateAccepted, - "canceled": ProvisioningStateCanceled, - "failed": ProvisioningStateFailed, - "provisioning": ProvisioningStateProvisioning, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type Severity string - -const ( - SeverityCritical Severity = "Critical" - SeverityHidden Severity = "Hidden" - SeverityInformational Severity = "Informational" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityCritical), - string(SeverityHidden), - string(SeverityInformational), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "critical": SeverityCritical, - "hidden": SeverityHidden, - "informational": SeverityInformational, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type UpdateSummariesPropertiesState string - -const ( - UpdateSummariesPropertiesStateAppliedSuccessfully UpdateSummariesPropertiesState = "AppliedSuccessfully" - UpdateSummariesPropertiesStateNeedsAttention UpdateSummariesPropertiesState = "NeedsAttention" - UpdateSummariesPropertiesStatePreparationFailed UpdateSummariesPropertiesState = "PreparationFailed" - UpdateSummariesPropertiesStatePreparationInProgress UpdateSummariesPropertiesState = "PreparationInProgress" - UpdateSummariesPropertiesStateUnknown UpdateSummariesPropertiesState = "Unknown" - UpdateSummariesPropertiesStateUpdateAvailable UpdateSummariesPropertiesState = "UpdateAvailable" - UpdateSummariesPropertiesStateUpdateFailed UpdateSummariesPropertiesState = "UpdateFailed" - UpdateSummariesPropertiesStateUpdateInProgress UpdateSummariesPropertiesState = "UpdateInProgress" -) - -func PossibleValuesForUpdateSummariesPropertiesState() []string { - return []string{ - string(UpdateSummariesPropertiesStateAppliedSuccessfully), - string(UpdateSummariesPropertiesStateNeedsAttention), - string(UpdateSummariesPropertiesStatePreparationFailed), - string(UpdateSummariesPropertiesStatePreparationInProgress), - string(UpdateSummariesPropertiesStateUnknown), - string(UpdateSummariesPropertiesStateUpdateAvailable), - string(UpdateSummariesPropertiesStateUpdateFailed), - string(UpdateSummariesPropertiesStateUpdateInProgress), - } -} - -func (s *UpdateSummariesPropertiesState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateSummariesPropertiesState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateSummariesPropertiesState(input string) (*UpdateSummariesPropertiesState, error) { - vals := map[string]UpdateSummariesPropertiesState{ - "appliedsuccessfully": UpdateSummariesPropertiesStateAppliedSuccessfully, - "needsattention": UpdateSummariesPropertiesStateNeedsAttention, - "preparationfailed": UpdateSummariesPropertiesStatePreparationFailed, - "preparationinprogress": UpdateSummariesPropertiesStatePreparationInProgress, - "unknown": UpdateSummariesPropertiesStateUnknown, - "updateavailable": UpdateSummariesPropertiesStateUpdateAvailable, - "updatefailed": UpdateSummariesPropertiesStateUpdateFailed, - "updateinprogress": UpdateSummariesPropertiesStateUpdateInProgress, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateSummariesPropertiesState(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster.go deleted file mode 100644 index 42e4632b7b8..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster.go +++ /dev/null @@ -1,130 +0,0 @@ -package updatesummaries - -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(&ClusterId{}) -} - -var _ resourceids.ResourceId = &ClusterId{} - -// ClusterId is a struct representing the Resource ID for a Cluster -type ClusterId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string -} - -// NewClusterID returns a new ClusterId struct -func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { - return ClusterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - } -} - -// ParseClusterID parses 'input' into a ClusterId -func ParseClusterID(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId -// note: this method should only be used for API response data and not user input -func ParseClusterIDInsensitively(input string) (*ClusterId, error) { - parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ClusterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - return nil -} - -// ValidateClusterID checks that 'input' can be parsed as a Cluster ID -func ValidateClusterID(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 := ParseClusterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cluster ID -func (id ClusterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/clusters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cluster ID -func (id ClusterId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - } -} - -// String returns a human-readable description of this Cluster ID -func (id ClusterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - } - return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster_test.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster_test.go deleted file mode 100644 index 6e7ce084f3a..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/id_cluster_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package updatesummaries - -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 = &ClusterId{} - -func TestNewClusterID(t *testing.T) { - id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } -} - -func TestFormatClusterID(t *testing.T) { - actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseClusterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestParseClusterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ClusterId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/clusters/clusterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE", - Expected: &ClusterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/cLuStErS/cLuStErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - } -} - -func TestSegmentsForClusterId(t *testing.T) { - segments := ClusterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ClusterId 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/azurestackhci/2023-08-01/updatesummaries/method_delete.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_delete.go deleted file mode 100644 index b3ba841c6be..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package updatesummaries - -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 UpdateSummariesClient) Delete(ctx context.Context, id ClusterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: fmt.Sprintf("%s/updateSummaries/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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c UpdateSummariesClient) DeleteThenPoll(ctx context.Context, id ClusterId) 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/azurestackhci/2023-08-01/updatesummaries/method_get.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_get.go deleted file mode 100644 index 874fcd2d831..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package updatesummaries - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UpdateSummaries -} - -// Get ... -func (c UpdateSummariesClient) Get(ctx context.Context, id ClusterId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updateSummaries/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 UpdateSummaries - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_list.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_list.go deleted file mode 100644 index 59c86bf4570..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package updatesummaries - -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 *[]UpdateSummaries -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []UpdateSummaries -} - -// List ... -func (c UpdateSummariesClient) List(ctx context.Context, id ClusterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/updateSummaries", 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 *[]UpdateSummaries `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 UpdateSummariesClient) ListComplete(ctx context.Context, id ClusterId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UpdateSummariesOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UpdateSummariesClient) ListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate UpdateSummariesOperationPredicate) (result ListCompleteResult, err error) { - items := make([]UpdateSummaries, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-08-01/updatesummaries/method_put.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_put.go deleted file mode 100644 index a8b151c8e57..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/method_put.go +++ /dev/null @@ -1,59 +0,0 @@ -package updatesummaries - -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 PutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UpdateSummaries -} - -// Put ... -func (c UpdateSummariesClient) Put(ctx context.Context, id ClusterId, input UpdateSummaries) (result PutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/updateSummaries/default", 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 UpdateSummaries - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_packageversioninfo.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_packageversioninfo.go deleted file mode 100644 index 33735a82452..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_packageversioninfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package updatesummaries - -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 PackageVersionInfo struct { - LastUpdated *string `json:"lastUpdated,omitempty"` - PackageType *string `json:"packageType,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *PackageVersionInfo) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *PackageVersionInfo) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresult.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresult.go deleted file mode 100644 index 877f1918f9e..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresult.go +++ /dev/null @@ -1,37 +0,0 @@ -package updatesummaries - -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 PrecheckResult struct { - AdditionalData *string `json:"additionalData,omitempty"` - Description *string `json:"description,omitempty"` - HealthCheckSource *string `json:"healthCheckSource,omitempty"` - Name *string `json:"name,omitempty"` - Remediation *string `json:"remediation,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Status *Status `json:"status,omitempty"` - Tags *PrecheckResultTags `json:"tags,omitempty"` - TargetResourceID *string `json:"targetResourceID,omitempty"` - TargetResourceName *string `json:"targetResourceName,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (o *PrecheckResult) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *PrecheckResult) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresulttags.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresulttags.go deleted file mode 100644 index 4dffe374f28..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_precheckresulttags.go +++ /dev/null @@ -1,9 +0,0 @@ -package updatesummaries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrecheckResultTags struct { - Key *string `json:"key,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummaries.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummaries.go deleted file mode 100644 index 2c73541f2ed..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummaries.go +++ /dev/null @@ -1,17 +0,0 @@ -package updatesummaries - -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 UpdateSummaries struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *UpdateSummariesProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummariesproperties.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummariesproperties.go deleted file mode 100644 index f6a0a7b4441..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/model_updatesummariesproperties.go +++ /dev/null @@ -1,60 +0,0 @@ -package updatesummaries - -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 UpdateSummariesProperties struct { - CurrentVersion *string `json:"currentVersion,omitempty"` - HardwareModel *string `json:"hardwareModel,omitempty"` - HealthCheckDate *string `json:"healthCheckDate,omitempty"` - HealthCheckResult *[]PrecheckResult `json:"healthCheckResult,omitempty"` - HealthState *HealthState `json:"healthState,omitempty"` - LastChecked *string `json:"lastChecked,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - OemFamily *string `json:"oemFamily,omitempty"` - PackageVersions *[]PackageVersionInfo `json:"packageVersions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - State *UpdateSummariesPropertiesState `json:"state,omitempty"` -} - -func (o *UpdateSummariesProperties) GetHealthCheckDateAsTime() (*time.Time, error) { - if o.HealthCheckDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.HealthCheckDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSummariesProperties) SetHealthCheckDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.HealthCheckDate = &formatted -} - -func (o *UpdateSummariesProperties) GetLastCheckedAsTime() (*time.Time, error) { - if o.LastChecked == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastChecked, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSummariesProperties) SetLastCheckedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastChecked = &formatted -} - -func (o *UpdateSummariesProperties) GetLastUpdatedAsTime() (*time.Time, error) { - if o.LastUpdated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdated, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpdateSummariesProperties) SetLastUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdated = &formatted -} diff --git a/resource-manager/azurestackhci/2023-08-01/updatesummaries/predicates.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/predicates.go deleted file mode 100644 index ec256ccef50..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package updatesummaries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateSummariesOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p UpdateSummariesOperationPredicate) Matches(input UpdateSummaries) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/azurestackhci/2023-08-01/updatesummaries/version.go b/resource-manager/azurestackhci/2023-08-01/updatesummaries/version.go deleted file mode 100644 index ffeebf3e56f..00000000000 --- a/resource-manager/azurestackhci/2023-08-01/updatesummaries/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updatesummaries - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updatesummaries/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/client.go b/resource-manager/azurestackhci/2023-09-01-preview/client.go deleted file mode 100644 index 582ccab1f32..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_09_01_preview - -// 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/azurestackhci/2023-09-01-preview/galleryimages" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/guestagents" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks" - "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - GalleryImages *galleryimages.GalleryImagesClient - GuestAgents *guestagents.GuestAgentsClient - HybridIdentityMetadata *hybrididentitymetadata.HybridIdentityMetadataClient - LogicalNetworks *logicalnetworks.LogicalNetworksClient - MarketplaceGalleryImages *marketplacegalleryimages.MarketplaceGalleryImagesClient - NetworkInterfaces *networkinterfaces.NetworkInterfacesClient - StorageContainers *storagecontainers.StorageContainersClient - VirtualHardDisks *virtualharddisks.VirtualHardDisksClient - VirtualMachineInstances *virtualmachineinstances.VirtualMachineInstancesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - galleryImagesClient, err := galleryimages.NewGalleryImagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building GalleryImages client: %+v", err) - } - configureFunc(galleryImagesClient.Client) - - guestAgentsClient, err := guestagents.NewGuestAgentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building GuestAgents client: %+v", err) - } - configureFunc(guestAgentsClient.Client) - - hybridIdentityMetadataClient, err := hybrididentitymetadata.NewHybridIdentityMetadataClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building HybridIdentityMetadata client: %+v", err) - } - configureFunc(hybridIdentityMetadataClient.Client) - - logicalNetworksClient, err := logicalnetworks.NewLogicalNetworksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LogicalNetworks client: %+v", err) - } - configureFunc(logicalNetworksClient.Client) - - marketplaceGalleryImagesClient, err := marketplacegalleryimages.NewMarketplaceGalleryImagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building MarketplaceGalleryImages client: %+v", err) - } - configureFunc(marketplaceGalleryImagesClient.Client) - - networkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkInterfaces client: %+v", err) - } - configureFunc(networkInterfacesClient.Client) - - storageContainersClient, err := storagecontainers.NewStorageContainersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building StorageContainers client: %+v", err) - } - configureFunc(storageContainersClient.Client) - - virtualHardDisksClient, err := virtualharddisks.NewVirtualHardDisksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualHardDisks client: %+v", err) - } - configureFunc(virtualHardDisksClient.Client) - - virtualMachineInstancesClient, err := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualMachineInstances client: %+v", err) - } - configureFunc(virtualMachineInstancesClient.Client) - - return &Client{ - GalleryImages: galleryImagesClient, - GuestAgents: guestAgentsClient, - HybridIdentityMetadata: hybridIdentityMetadataClient, - LogicalNetworks: logicalNetworksClient, - MarketplaceGalleryImages: marketplaceGalleryImagesClient, - NetworkInterfaces: networkInterfacesClient, - StorageContainers: storageContainersClient, - VirtualHardDisks: virtualHardDisksClient, - VirtualMachineInstances: virtualMachineInstancesClient, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/README.md b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/README.md deleted file mode 100644 index 3b6082bbe21..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/galleryimages` Documentation - -The `galleryimages` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/galleryimages" -``` - - -### Client Initialization - -```go -client := galleryimages.NewGalleryImagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `GalleryImagesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue") - -payload := galleryimages.GalleryImages{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `GalleryImagesClient.Delete` - -```go -ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `GalleryImagesClient.Get` - -```go -ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue") - -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: `GalleryImagesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `GalleryImagesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `GalleryImagesClient.Update` - -```go -ctx := context.TODO() -id := galleryimages.NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue") - -payload := galleryimages.GalleryImagesUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/client.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/client.go deleted file mode 100644 index 59b9c848dbd..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package galleryimages - -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 GalleryImagesClient struct { - Client *resourcemanager.Client -} - -func NewGalleryImagesClientWithBaseURI(sdkApi sdkEnv.Api) (*GalleryImagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "galleryimages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating GalleryImagesClient: %+v", err) - } - - return &GalleryImagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/constants.go deleted file mode 100644 index 57bfe8f301b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/constants.go +++ /dev/null @@ -1,268 +0,0 @@ -package galleryimages - -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 CloudInitDataSource string - -const ( - CloudInitDataSourceAzure CloudInitDataSource = "Azure" - CloudInitDataSourceNoCloud CloudInitDataSource = "NoCloud" -) - -func PossibleValuesForCloudInitDataSource() []string { - return []string{ - string(CloudInitDataSourceAzure), - string(CloudInitDataSourceNoCloud), - } -} - -func (s *CloudInitDataSource) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCloudInitDataSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCloudInitDataSource(input string) (*CloudInitDataSource, error) { - vals := map[string]CloudInitDataSource{ - "azure": CloudInitDataSourceAzure, - "nocloud": CloudInitDataSourceNoCloud, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CloudInitDataSource(input) - return &out, nil -} - -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type HyperVGeneration string - -const ( - HyperVGenerationVOne HyperVGeneration = "V1" - HyperVGenerationVTwo HyperVGeneration = "V2" -) - -func PossibleValuesForHyperVGeneration() []string { - return []string{ - string(HyperVGenerationVOne), - string(HyperVGenerationVTwo), - } -} - -func (s *HyperVGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHyperVGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHyperVGeneration(input string) (*HyperVGeneration, error) { - vals := map[string]HyperVGeneration{ - "v1": HyperVGenerationVOne, - "v2": HyperVGenerationVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HyperVGeneration(input) - return &out, nil -} - -type OperatingSystemTypes string - -const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -func PossibleValuesForOperatingSystemTypes() []string { - return []string{ - string(OperatingSystemTypesLinux), - string(OperatingSystemTypesWindows), - } -} - -func (s *OperatingSystemTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperatingSystemTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperatingSystemTypes(input string) (*OperatingSystemTypes, error) { - vals := map[string]OperatingSystemTypes{ - "linux": OperatingSystemTypesLinux, - "windows": OperatingSystemTypesWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OperatingSystemTypes(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage.go deleted file mode 100644 index 46d8f90b280..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage.go +++ /dev/null @@ -1,130 +0,0 @@ -package galleryimages - -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(&GalleryImageId{}) -} - -var _ resourceids.ResourceId = &GalleryImageId{} - -// GalleryImageId is a struct representing the Resource ID for a Gallery Image -type GalleryImageId struct { - SubscriptionId string - ResourceGroupName string - GalleryImageName string -} - -// NewGalleryImageID returns a new GalleryImageId struct -func NewGalleryImageID(subscriptionId string, resourceGroupName string, galleryImageName string) GalleryImageId { - return GalleryImageId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - GalleryImageName: galleryImageName, - } -} - -// ParseGalleryImageID parses 'input' into a GalleryImageId -func ParseGalleryImageID(input string) (*GalleryImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&GalleryImageId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := GalleryImageId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseGalleryImageIDInsensitively parses 'input' case-insensitively into a GalleryImageId -// note: this method should only be used for API response data and not user input -func ParseGalleryImageIDInsensitively(input string) (*GalleryImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&GalleryImageId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := GalleryImageId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *GalleryImageId) 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.GalleryImageName, ok = input.Parsed["galleryImageName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "galleryImageName", input) - } - - return nil -} - -// ValidateGalleryImageID checks that 'input' can be parsed as a Gallery Image ID -func ValidateGalleryImageID(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 := ParseGalleryImageID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Gallery Image ID -func (id GalleryImageId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/galleryImages/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.GalleryImageName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Gallery Image ID -func (id GalleryImageId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticGalleryImages", "galleryImages", "galleryImages"), - resourceids.UserSpecifiedSegment("galleryImageName", "galleryImageValue"), - } -} - -// String returns a human-readable description of this Gallery Image ID -func (id GalleryImageId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Gallery Image Name: %q", id.GalleryImageName), - } - return fmt.Sprintf("Gallery Image (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage_test.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage_test.go deleted file mode 100644 index 0051a069209..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/id_galleryimage_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package galleryimages - -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 = &GalleryImageId{} - -func TestNewGalleryImageID(t *testing.T) { - id := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue") - - 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.GalleryImageName != "galleryImageValue" { - t.Fatalf("Expected %q but got %q for Segment 'GalleryImageName'", id.GalleryImageName, "galleryImageValue") - } -} - -func TestFormatGalleryImageID(t *testing.T) { - actual := NewGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "galleryImageValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages/galleryImageValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseGalleryImageID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *GalleryImageId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages/galleryImageValue", - Expected: &GalleryImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - GalleryImageName: "galleryImageValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages/galleryImageValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseGalleryImageID(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.GalleryImageName != v.Expected.GalleryImageName { - t.Fatalf("Expected %q but got %q for GalleryImageName", v.Expected.GalleryImageName, actual.GalleryImageName) - } - - } -} - -func TestParseGalleryImageIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *GalleryImageId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/gAlLeRyImAgEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages/galleryImageValue", - Expected: &GalleryImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - GalleryImageName: "galleryImageValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/galleryImages/galleryImageValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/gAlLeRyImAgEs/gAlLeRyImAgEvAlUe", - Expected: &GalleryImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - GalleryImageName: "gAlLeRyImAgEvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/gAlLeRyImAgEs/gAlLeRyImAgEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseGalleryImageIDInsensitively(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.GalleryImageName != v.Expected.GalleryImageName { - t.Fatalf("Expected %q but got %q for GalleryImageName", v.Expected.GalleryImageName, actual.GalleryImageName) - } - - } -} - -func TestSegmentsForGalleryImageId(t *testing.T) { - segments := GalleryImageId{}.Segments() - if len(segments) == 0 { - t.Fatalf("GalleryImageId 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/azurestackhci/2023-09-01-preview/galleryimages/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_createorupdate.go deleted file mode 100644 index 306463b223b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package galleryimages - -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 *GalleryImages -} - -// CreateOrUpdate ... -func (c GalleryImagesClient) CreateOrUpdate(ctx context.Context, id GalleryImageId, input GalleryImages) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c GalleryImagesClient) CreateOrUpdateThenPoll(ctx context.Context, id GalleryImageId, input GalleryImages) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/galleryimages/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_delete.go deleted file mode 100644 index 635a0f9294d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package galleryimages - -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 GalleryImagesClient) Delete(ctx context.Context, id GalleryImageId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c GalleryImagesClient) DeleteThenPoll(ctx context.Context, id GalleryImageId) 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/azurestackhci/2023-09-01-preview/galleryimages/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_get.go deleted file mode 100644 index 213453f768a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package galleryimages - -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 *GalleryImages -} - -// Get ... -func (c GalleryImagesClient) Get(ctx context.Context, id GalleryImageId) (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 GalleryImages - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_list.go deleted file mode 100644 index e171f62e8ce..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package galleryimages - -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 *[]GalleryImages -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []GalleryImages -} - -// List ... -func (c GalleryImagesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/galleryImages", 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 *[]GalleryImages `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 GalleryImagesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, GalleryImagesOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c GalleryImagesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate GalleryImagesOperationPredicate) (result ListCompleteResult, err error) { - items := make([]GalleryImages, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/galleryimages/method_listall.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_listall.go deleted file mode 100644 index e39e2388d80..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package galleryimages - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]GalleryImages -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []GalleryImages -} - -// ListAll ... -func (c GalleryImagesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/galleryImages", 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 *[]GalleryImages `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c GalleryImagesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, GalleryImagesOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c GalleryImagesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate GalleryImagesOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]GalleryImages, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_update.go deleted file mode 100644 index 817f5c803d1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package galleryimages - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GalleryImages -} - -// Update ... -func (c GalleryImagesClient) Update(ctx context.Context, id GalleryImageId, input GalleryImagesUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c GalleryImagesClient) UpdateThenPoll(ctx context.Context, id GalleryImageId, input GalleryImagesUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_extendedlocation.go deleted file mode 100644 index de4007c5034..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_gallerydiskimage.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_gallerydiskimage.go deleted file mode 100644 index 9586c039d4d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_gallerydiskimage.go +++ /dev/null @@ -1,8 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryDiskImage struct { - SizeInMB *int64 `json:"sizeInMB,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageidentifier.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageidentifier.go deleted file mode 100644 index c4ba59a4105..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageidentifier.go +++ /dev/null @@ -1,10 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageIdentifier struct { - Offer string `json:"offer"` - Publisher string `json:"publisher"` - Sku string `json:"sku"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageproperties.go deleted file mode 100644 index 01b92688cc8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageProperties struct { - CloudInitDataSource *CloudInitDataSource `json:"cloudInitDataSource,omitempty"` - ContainerId *string `json:"containerId,omitempty"` - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - ImagePath *string `json:"imagePath,omitempty"` - OsType OperatingSystemTypes `json:"osType"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - Status *GalleryImageStatus `json:"status,omitempty"` - Version *GalleryImageVersion `json:"version,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimages.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimages.go deleted file mode 100644 index 2822280c55b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimages.go +++ /dev/null @@ -1,19 +0,0 @@ -package galleryimages - -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 GalleryImages struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *GalleryImageProperties `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/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatus.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatus.go deleted file mode 100644 index 8a966e4b8f0..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageStatus struct { - DownloadStatus *GalleryImageStatusDownloadStatus `json:"downloadStatus,omitempty"` - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProgressPercentage *int64 `json:"progressPercentage,omitempty"` - ProvisioningStatus *GalleryImageStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusdownloadstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusdownloadstatus.go deleted file mode 100644 index c395a6d3a9a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusdownloadstatus.go +++ /dev/null @@ -1,8 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageStatusDownloadStatus struct { - DownloadSizeInMB *int64 `json:"downloadSizeInMB,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusprovisioningstatus.go deleted file mode 100644 index b28f2566755..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagestatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagesupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagesupdaterequest.go deleted file mode 100644 index 9e6dd0452e8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimagesupdaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImagesUpdateRequest struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversion.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversion.go deleted file mode 100644 index 13ec192bd64..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversion.go +++ /dev/null @@ -1,9 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageVersion struct { - Name *string `json:"name,omitempty"` - Properties *GalleryImageVersionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionproperties.go deleted file mode 100644 index 3790dd0595a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageVersionProperties struct { - StorageProfile GalleryImageVersionStorageProfile `json:"storageProfile"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionstorageprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionstorageprofile.go deleted file mode 100644 index c6775223724..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/model_galleryimageversionstorageprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageVersionStorageProfile struct { - OsDiskImage *GalleryDiskImage `json:"osDiskImage,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/predicates.go deleted file mode 100644 index 63c56669688..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package galleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImagesOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p GalleryImagesOperationPredicate) Matches(input GalleryImages) 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/azurestackhci/2023-09-01-preview/galleryimages/version.go b/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/version.go deleted file mode 100644 index ae078f48a6d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/galleryimages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package galleryimages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/galleryimages/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/README.md b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/README.md deleted file mode 100644 index 84853f78950..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/guestagents` Documentation - -The `guestagents` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/guestagents" -``` - - -### Client Initialization - -```go -client := guestagents.NewGuestAgentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `GuestAgentsClient.GuestAgentCreate` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -payload := guestagents.GuestAgent{ - // ... -} - - -if err := client.GuestAgentCreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `GuestAgentsClient.GuestAgentDelete` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -if err := client.GuestAgentDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `GuestAgentsClient.GuestAgentGet` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -read, err := client.GuestAgentGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `GuestAgentsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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/azurestackhci/2023-09-01-preview/guestagents/client.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/client.go deleted file mode 100644 index 8b3899fa940..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package guestagents - -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 GuestAgentsClient struct { - Client *resourcemanager.Client -} - -func NewGuestAgentsClientWithBaseURI(sdkApi sdkEnv.Api) (*GuestAgentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "guestagents", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating GuestAgentsClient: %+v", err) - } - - return &GuestAgentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/constants.go deleted file mode 100644 index 148c2721b51..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package guestagents - -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 ProvisioningAction string - -const ( - ProvisioningActionInstall ProvisioningAction = "install" - ProvisioningActionRepair ProvisioningAction = "repair" - ProvisioningActionUninstall ProvisioningAction = "uninstall" -) - -func PossibleValuesForProvisioningAction() []string { - return []string{ - string(ProvisioningActionInstall), - string(ProvisioningActionRepair), - string(ProvisioningActionUninstall), - } -} - -func (s *ProvisioningAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningAction(input string) (*ProvisioningAction, error) { - vals := map[string]ProvisioningAction{ - "install": ProvisioningActionInstall, - "repair": ProvisioningActionRepair, - "uninstall": ProvisioningActionUninstall, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningAction(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentcreate.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentcreate.go deleted file mode 100644 index b9461107c6b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentcreate.go +++ /dev/null @@ -1,76 +0,0 @@ -package guestagents - -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 GuestAgentCreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GuestAgent -} - -// GuestAgentCreate ... -func (c GuestAgentsClient) GuestAgentCreate(ctx context.Context, id commonids.ScopeId, input GuestAgent) (result GuestAgentCreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/default", 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 -} - -// GuestAgentCreateThenPoll performs GuestAgentCreate then polls until it's completed -func (c GuestAgentsClient) GuestAgentCreateThenPoll(ctx context.Context, id commonids.ScopeId, input GuestAgent) error { - result, err := c.GuestAgentCreate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GuestAgentCreate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GuestAgentCreate: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentdelete.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentdelete.go deleted file mode 100644 index 7f9080a2a63..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package guestagents - -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 GuestAgentDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// GuestAgentDelete ... -func (c GuestAgentsClient) GuestAgentDelete(ctx context.Context, id commonids.ScopeId) (result GuestAgentDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - }, - HttpMethod: http.MethodDelete, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// GuestAgentDeleteThenPoll performs GuestAgentDelete then polls until it's completed -func (c GuestAgentsClient) GuestAgentDeleteThenPoll(ctx context.Context, id commonids.ScopeId) error { - result, err := c.GuestAgentDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing GuestAgentDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GuestAgentDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentget.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentget.go deleted file mode 100644 index 0e039b2086d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_guestagentget.go +++ /dev/null @@ -1,56 +0,0 @@ -package guestagents - -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 GuestAgentGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *GuestAgent -} - -// GuestAgentGet ... -func (c GuestAgentsClient) GuestAgentGet(ctx context.Context, id commonids.ScopeId) (result GuestAgentGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents/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 GuestAgent - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_list.go deleted file mode 100644 index 05786b10336..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package guestagents - -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 *[]GuestAgent -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []GuestAgent -} - -// List ... -func (c GuestAgentsClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/guestAgents", 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 *[]GuestAgent `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 GuestAgentsClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, GuestAgentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c GuestAgentsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate GuestAgentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]GuestAgent, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/guestagents/model_guestagentproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestagentproperties.go deleted file mode 100644 index 7e671a9f75b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestagentproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package guestagents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GuestAgentProperties struct { - Credentials *GuestCredential `json:"credentials,omitempty"` - ProvisioningAction *ProvisioningAction `json:"provisioningAction,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestcredential.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestcredential.go deleted file mode 100644 index 98dcf0b76f4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestcredential.go +++ /dev/null @@ -1,9 +0,0 @@ -package guestagents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GuestCredential struct { - Password *string `json:"password,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/predicates.go deleted file mode 100644 index f51a9dcf2c9..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package guestagents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GuestAgentOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p GuestAgentOperationPredicate) Matches(input GuestAgent) 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/azurestackhci/2023-09-01-preview/guestagents/version.go b/resource-manager/azurestackhci/2023-09-01-preview/guestagents/version.go deleted file mode 100644 index 2c04bfe4f0a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package guestagents - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/guestagents/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/README.md b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/README.md deleted file mode 100644 index 1e40328c6f5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata` Documentation - -The `hybrididentitymetadata` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata" -``` - - -### Client Initialization - -```go -client := hybrididentitymetadata.NewHybridIdentityMetadataClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `HybridIdentityMetadataClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -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: `HybridIdentityMetadataClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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/azurestackhci/2023-09-01-preview/hybrididentitymetadata/client.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/client.go deleted file mode 100644 index 597657e5901..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package hybrididentitymetadata - -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 HybridIdentityMetadataClient struct { - Client *resourcemanager.Client -} - -func NewHybridIdentityMetadataClientWithBaseURI(sdkApi sdkEnv.Api) (*HybridIdentityMetadataClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "hybrididentitymetadata", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating HybridIdentityMetadataClient: %+v", err) - } - - return &HybridIdentityMetadataClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_get.go deleted file mode 100644 index 759c20ac51b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_get.go +++ /dev/null @@ -1,56 +0,0 @@ -package hybrididentitymetadata - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HybridIdentityMetadata -} - -// Get ... -func (c HybridIdentityMetadataClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata/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 HybridIdentityMetadata - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_list.go deleted file mode 100644 index 12cf31659ea..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package hybrididentitymetadata - -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 *[]HybridIdentityMetadata -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HybridIdentityMetadata -} - -// List ... -func (c HybridIdentityMetadataClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/hybridIdentityMetadata", 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 *[]HybridIdentityMetadata `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 HybridIdentityMetadataClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, HybridIdentityMetadataOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c HybridIdentityMetadataClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate HybridIdentityMetadataOperationPredicate) (result ListCompleteResult, err error) { - items := make([]HybridIdentityMetadata, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadata.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadata.go deleted file mode 100644 index 301219b821b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadata.go +++ /dev/null @@ -1,16 +0,0 @@ -package hybrididentitymetadata - -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 HybridIdentityMetadata struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties HybridIdentityMetadataProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadataproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadataproperties.go deleted file mode 100644 index b04d4756658..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/model_hybrididentitymetadataproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package hybrididentitymetadata - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HybridIdentityMetadataProperties struct { - Identity *identity.SystemAssigned `json:"identity,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicKey *string `json:"publicKey,omitempty"` - ResourceUid *string `json:"resourceUid,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/predicates.go deleted file mode 100644 index 5e9f9c439d5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package hybrididentitymetadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HybridIdentityMetadataOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p HybridIdentityMetadataOperationPredicate) Matches(input HybridIdentityMetadata) 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/azurestackhci/2023-09-01-preview/hybrididentitymetadata/version.go b/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/version.go deleted file mode 100644 index df1b600862b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/hybrididentitymetadata/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package hybrididentitymetadata - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/hybrididentitymetadata/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/README.md b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/README.md deleted file mode 100644 index 30a5036274a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks` Documentation - -The `logicalnetworks` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks" -``` - - -### Client Initialization - -```go -client := logicalnetworks.NewLogicalNetworksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LogicalNetworksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := logicalnetworks.NewLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "logicalNetworkValue") - -payload := logicalnetworks.LogicalNetworks{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LogicalNetworksClient.Delete` - -```go -ctx := context.TODO() -id := logicalnetworks.NewLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "logicalNetworkValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LogicalNetworksClient.Get` - -```go -ctx := context.TODO() -id := logicalnetworks.NewLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "logicalNetworkValue") - -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: `LogicalNetworksClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LogicalNetworksClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LogicalNetworksClient.Update` - -```go -ctx := context.TODO() -id := logicalnetworks.NewLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "logicalNetworkValue") - -payload := logicalnetworks.LogicalNetworksUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/client.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/client.go deleted file mode 100644 index 1ab7fafbcfe..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package logicalnetworks - -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 LogicalNetworksClient struct { - Client *resourcemanager.Client -} - -func NewLogicalNetworksClientWithBaseURI(sdkApi sdkEnv.Api) (*LogicalNetworksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "logicalnetworks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LogicalNetworksClient: %+v", err) - } - - return &LogicalNetworksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/constants.go deleted file mode 100644 index a67025636ed..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package logicalnetworks - -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 ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type IPAllocationMethodEnum string - -const ( - IPAllocationMethodEnumDynamic IPAllocationMethodEnum = "Dynamic" - IPAllocationMethodEnumStatic IPAllocationMethodEnum = "Static" -) - -func PossibleValuesForIPAllocationMethodEnum() []string { - return []string{ - string(IPAllocationMethodEnumDynamic), - string(IPAllocationMethodEnumStatic), - } -} - -func (s *IPAllocationMethodEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethodEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethodEnum(input string) (*IPAllocationMethodEnum, error) { - vals := map[string]IPAllocationMethodEnum{ - "dynamic": IPAllocationMethodEnumDynamic, - "static": IPAllocationMethodEnumStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethodEnum(input) - return &out, nil -} - -type IPPoolTypeEnum string - -const ( - IPPoolTypeEnumVM IPPoolTypeEnum = "vm" - IPPoolTypeEnumVippool IPPoolTypeEnum = "vippool" -) - -func PossibleValuesForIPPoolTypeEnum() []string { - return []string{ - string(IPPoolTypeEnumVM), - string(IPPoolTypeEnumVippool), - } -} - -func (s *IPPoolTypeEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPPoolTypeEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPPoolTypeEnum(input string) (*IPPoolTypeEnum, error) { - vals := map[string]IPPoolTypeEnum{ - "vm": IPPoolTypeEnumVM, - "vippool": IPPoolTypeEnumVippool, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPPoolTypeEnum(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork.go deleted file mode 100644 index 8de178f8122..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork.go +++ /dev/null @@ -1,130 +0,0 @@ -package logicalnetworks - -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(&LogicalNetworkId{}) -} - -var _ resourceids.ResourceId = &LogicalNetworkId{} - -// LogicalNetworkId is a struct representing the Resource ID for a Logical Network -type LogicalNetworkId struct { - SubscriptionId string - ResourceGroupName string - LogicalNetworkName string -} - -// NewLogicalNetworkID returns a new LogicalNetworkId struct -func NewLogicalNetworkID(subscriptionId string, resourceGroupName string, logicalNetworkName string) LogicalNetworkId { - return LogicalNetworkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LogicalNetworkName: logicalNetworkName, - } -} - -// ParseLogicalNetworkID parses 'input' into a LogicalNetworkId -func ParseLogicalNetworkID(input string) (*LogicalNetworkId, error) { - parser := resourceids.NewParserFromResourceIdType(&LogicalNetworkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LogicalNetworkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLogicalNetworkIDInsensitively parses 'input' case-insensitively into a LogicalNetworkId -// note: this method should only be used for API response data and not user input -func ParseLogicalNetworkIDInsensitively(input string) (*LogicalNetworkId, error) { - parser := resourceids.NewParserFromResourceIdType(&LogicalNetworkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LogicalNetworkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LogicalNetworkId) 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.LogicalNetworkName, ok = input.Parsed["logicalNetworkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "logicalNetworkName", input) - } - - return nil -} - -// ValidateLogicalNetworkID checks that 'input' can be parsed as a Logical Network ID -func ValidateLogicalNetworkID(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 := ParseLogicalNetworkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Logical Network ID -func (id LogicalNetworkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/logicalNetworks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LogicalNetworkName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Logical Network ID -func (id LogicalNetworkId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticLogicalNetworks", "logicalNetworks", "logicalNetworks"), - resourceids.UserSpecifiedSegment("logicalNetworkName", "logicalNetworkValue"), - } -} - -// String returns a human-readable description of this Logical Network ID -func (id LogicalNetworkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Logical Network Name: %q", id.LogicalNetworkName), - } - return fmt.Sprintf("Logical Network (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork_test.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork_test.go deleted file mode 100644 index c2a4f46af95..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/id_logicalnetwork_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package logicalnetworks - -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 = &LogicalNetworkId{} - -func TestNewLogicalNetworkID(t *testing.T) { - id := NewLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "logicalNetworkValue") - - 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.LogicalNetworkName != "logicalNetworkValue" { - t.Fatalf("Expected %q but got %q for Segment 'LogicalNetworkName'", id.LogicalNetworkName, "logicalNetworkValue") - } -} - -func TestFormatLogicalNetworkID(t *testing.T) { - actual := NewLogicalNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "logicalNetworkValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks/logicalNetworkValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLogicalNetworkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LogicalNetworkId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks/logicalNetworkValue", - Expected: &LogicalNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LogicalNetworkName: "logicalNetworkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks/logicalNetworkValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLogicalNetworkID(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.LogicalNetworkName != v.Expected.LogicalNetworkName { - t.Fatalf("Expected %q but got %q for LogicalNetworkName", v.Expected.LogicalNetworkName, actual.LogicalNetworkName) - } - - } -} - -func TestParseLogicalNetworkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LogicalNetworkId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/lOgIcAlNeTwOrKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks/logicalNetworkValue", - Expected: &LogicalNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LogicalNetworkName: "logicalNetworkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/logicalNetworks/logicalNetworkValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/lOgIcAlNeTwOrKs/lOgIcAlNeTwOrKvAlUe", - Expected: &LogicalNetworkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LogicalNetworkName: "lOgIcAlNeTwOrKvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/lOgIcAlNeTwOrKs/lOgIcAlNeTwOrKvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLogicalNetworkIDInsensitively(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.LogicalNetworkName != v.Expected.LogicalNetworkName { - t.Fatalf("Expected %q but got %q for LogicalNetworkName", v.Expected.LogicalNetworkName, actual.LogicalNetworkName) - } - - } -} - -func TestSegmentsForLogicalNetworkId(t *testing.T) { - segments := LogicalNetworkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LogicalNetworkId 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/azurestackhci/2023-09-01-preview/logicalnetworks/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_createorupdate.go deleted file mode 100644 index e81cab5a952..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package logicalnetworks - -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 *LogicalNetworks -} - -// CreateOrUpdate ... -func (c LogicalNetworksClient) CreateOrUpdate(ctx context.Context, id LogicalNetworkId, input LogicalNetworks) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LogicalNetworksClient) CreateOrUpdateThenPoll(ctx context.Context, id LogicalNetworkId, input LogicalNetworks) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/logicalnetworks/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_delete.go deleted file mode 100644 index 7a0b121dca6..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package logicalnetworks - -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 LogicalNetworksClient) Delete(ctx context.Context, id LogicalNetworkId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c LogicalNetworksClient) DeleteThenPoll(ctx context.Context, id LogicalNetworkId) 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/azurestackhci/2023-09-01-preview/logicalnetworks/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_get.go deleted file mode 100644 index 8e6d89f1c64..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package logicalnetworks - -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 *LogicalNetworks -} - -// Get ... -func (c LogicalNetworksClient) Get(ctx context.Context, id LogicalNetworkId) (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 LogicalNetworks - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_list.go deleted file mode 100644 index ac44ca1f776..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package logicalnetworks - -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 *[]LogicalNetworks -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LogicalNetworks -} - -// List ... -func (c LogicalNetworksClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/logicalNetworks", 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 *[]LogicalNetworks `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 LogicalNetworksClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, LogicalNetworksOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LogicalNetworksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LogicalNetworksOperationPredicate) (result ListCompleteResult, err error) { - items := make([]LogicalNetworks, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/logicalnetworks/method_listall.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_listall.go deleted file mode 100644 index 02e39aff2b8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package logicalnetworks - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LogicalNetworks -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []LogicalNetworks -} - -// ListAll ... -func (c LogicalNetworksClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/logicalNetworks", 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 *[]LogicalNetworks `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c LogicalNetworksClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, LogicalNetworksOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LogicalNetworksClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LogicalNetworksOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]LogicalNetworks, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_update.go deleted file mode 100644 index cd2fc98c9f4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package logicalnetworks - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *LogicalNetworks -} - -// Update ... -func (c LogicalNetworksClient) Update(ctx context.Context, id LogicalNetworkId, input LogicalNetworksUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c LogicalNetworksClient) UpdateThenPoll(ctx context.Context, id LogicalNetworkId, input LogicalNetworksUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_extendedlocation.go deleted file mode 100644 index 1b8aaf852e3..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippool.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippool.go deleted file mode 100644 index a38aebc47ca..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippool.go +++ /dev/null @@ -1,12 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPPool struct { - End *string `json:"end,omitempty"` - IPPoolType *IPPoolTypeEnum `json:"ipPoolType,omitempty"` - Info *IPPoolInfo `json:"info,omitempty"` - Name *string `json:"name,omitempty"` - Start *string `json:"start,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippoolinfo.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippoolinfo.go deleted file mode 100644 index ea018cf572c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_ippoolinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPPoolInfo struct { - Available *string `json:"available,omitempty"` - Used *string `json:"used,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkproperties.go deleted file mode 100644 index 82b4ee030f7..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogicalNetworkProperties struct { - DhcpOptions *LogicalNetworkPropertiesDhcpOptions `json:"dhcpOptions,omitempty"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - Status *LogicalNetworkStatus `json:"status,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` - VMSwitchName *string `json:"vmSwitchName,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkpropertiesdhcpoptions.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkpropertiesdhcpoptions.go deleted file mode 100644 index b7f824ae587..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkpropertiesdhcpoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogicalNetworkPropertiesDhcpOptions struct { - DnsServers *[]string `json:"dnsServers,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworks.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworks.go deleted file mode 100644 index df65bd28854..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworks.go +++ /dev/null @@ -1,19 +0,0 @@ -package logicalnetworks - -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 LogicalNetworks struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *LogicalNetworkProperties `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/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatus.go deleted file mode 100644 index c4c6bfcb65d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatus.go +++ /dev/null @@ -1,10 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogicalNetworkStatus struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProvisioningStatus *LogicalNetworkStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatusprovisioningstatus.go deleted file mode 100644 index 4b42c07e7e8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworkstatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogicalNetworkStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworksupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworksupdaterequest.go deleted file mode 100644 index f3ea7229f10..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_logicalnetworksupdaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogicalNetworksUpdateRequest struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_route.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_route.go deleted file mode 100644 index 605cfd736c3..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_route.go +++ /dev/null @@ -1,9 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routepropertiesformat.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routepropertiesformat.go deleted file mode 100644 index 77c4db98967..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetable.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetable.go deleted file mode 100644 index f0c1ba0b0b8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetable.go +++ /dev/null @@ -1,11 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetablepropertiesformat.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetablepropertiesformat.go deleted file mode 100644 index ade39099b0c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_routetablepropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - Routes *[]Route `json:"routes,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnet.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnet.go deleted file mode 100644 index ba19efff89a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnet.go +++ /dev/null @@ -1,9 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformat.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformat.go deleted file mode 100644 index cc1154dcad4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - IPAllocationMethod *IPAllocationMethodEnum `json:"ipAllocationMethod,omitempty"` - IPConfigurationReferences *[]SubnetPropertiesFormatIPConfigurationReferencesInlined `json:"ipConfigurationReferences,omitempty"` - IPPools *[]IPPool `json:"ipPools,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - Vlan *int64 `json:"vlan,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformatipconfigurationreferencesinlined.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformatipconfigurationreferencesinlined.go deleted file mode 100644 index 538aac7d7d8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/model_subnetpropertiesformatipconfigurationreferencesinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormatIPConfigurationReferencesInlined struct { - ID *string `json:"ID,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/predicates.go deleted file mode 100644 index afe2fed4d99..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package logicalnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogicalNetworksOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p LogicalNetworksOperationPredicate) Matches(input LogicalNetworks) 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/azurestackhci/2023-09-01-preview/logicalnetworks/version.go b/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/version.go deleted file mode 100644 index 0d4370fd389..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/logicalnetworks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package logicalnetworks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/logicalnetworks/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/README.md b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/README.md deleted file mode 100644 index 6efed4cd832..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages` Documentation - -The `marketplacegalleryimages` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages" -``` - - -### Client Initialization - -```go -client := marketplacegalleryimages.NewMarketplaceGalleryImagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `MarketplaceGalleryImagesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := marketplacegalleryimages.NewMarketplaceGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "marketplaceGalleryImageValue") - -payload := marketplacegalleryimages.MarketplaceGalleryImages{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `MarketplaceGalleryImagesClient.Delete` - -```go -ctx := context.TODO() -id := marketplacegalleryimages.NewMarketplaceGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "marketplaceGalleryImageValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `MarketplaceGalleryImagesClient.Get` - -```go -ctx := context.TODO() -id := marketplacegalleryimages.NewMarketplaceGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "marketplaceGalleryImageValue") - -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: `MarketplaceGalleryImagesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `MarketplaceGalleryImagesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `MarketplaceGalleryImagesClient.Update` - -```go -ctx := context.TODO() -id := marketplacegalleryimages.NewMarketplaceGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "marketplaceGalleryImageValue") - -payload := marketplacegalleryimages.MarketplaceGalleryImagesUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/client.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/client.go deleted file mode 100644 index d999cf677f8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package marketplacegalleryimages - -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 MarketplaceGalleryImagesClient struct { - Client *resourcemanager.Client -} - -func NewMarketplaceGalleryImagesClientWithBaseURI(sdkApi sdkEnv.Api) (*MarketplaceGalleryImagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "marketplacegalleryimages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating MarketplaceGalleryImagesClient: %+v", err) - } - - return &MarketplaceGalleryImagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/constants.go deleted file mode 100644 index d93c2349a0c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/constants.go +++ /dev/null @@ -1,268 +0,0 @@ -package marketplacegalleryimages - -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 CloudInitDataSource string - -const ( - CloudInitDataSourceAzure CloudInitDataSource = "Azure" - CloudInitDataSourceNoCloud CloudInitDataSource = "NoCloud" -) - -func PossibleValuesForCloudInitDataSource() []string { - return []string{ - string(CloudInitDataSourceAzure), - string(CloudInitDataSourceNoCloud), - } -} - -func (s *CloudInitDataSource) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCloudInitDataSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCloudInitDataSource(input string) (*CloudInitDataSource, error) { - vals := map[string]CloudInitDataSource{ - "azure": CloudInitDataSourceAzure, - "nocloud": CloudInitDataSourceNoCloud, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CloudInitDataSource(input) - return &out, nil -} - -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type HyperVGeneration string - -const ( - HyperVGenerationVOne HyperVGeneration = "V1" - HyperVGenerationVTwo HyperVGeneration = "V2" -) - -func PossibleValuesForHyperVGeneration() []string { - return []string{ - string(HyperVGenerationVOne), - string(HyperVGenerationVTwo), - } -} - -func (s *HyperVGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHyperVGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHyperVGeneration(input string) (*HyperVGeneration, error) { - vals := map[string]HyperVGeneration{ - "v1": HyperVGenerationVOne, - "v2": HyperVGenerationVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HyperVGeneration(input) - return &out, nil -} - -type OperatingSystemTypes string - -const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -func PossibleValuesForOperatingSystemTypes() []string { - return []string{ - string(OperatingSystemTypesLinux), - string(OperatingSystemTypesWindows), - } -} - -func (s *OperatingSystemTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperatingSystemTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperatingSystemTypes(input string) (*OperatingSystemTypes, error) { - vals := map[string]OperatingSystemTypes{ - "linux": OperatingSystemTypesLinux, - "windows": OperatingSystemTypesWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OperatingSystemTypes(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage.go deleted file mode 100644 index e8d23f4ad49..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage.go +++ /dev/null @@ -1,130 +0,0 @@ -package marketplacegalleryimages - -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(&MarketplaceGalleryImageId{}) -} - -var _ resourceids.ResourceId = &MarketplaceGalleryImageId{} - -// MarketplaceGalleryImageId is a struct representing the Resource ID for a Marketplace Gallery Image -type MarketplaceGalleryImageId struct { - SubscriptionId string - ResourceGroupName string - MarketplaceGalleryImageName string -} - -// NewMarketplaceGalleryImageID returns a new MarketplaceGalleryImageId struct -func NewMarketplaceGalleryImageID(subscriptionId string, resourceGroupName string, marketplaceGalleryImageName string) MarketplaceGalleryImageId { - return MarketplaceGalleryImageId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - MarketplaceGalleryImageName: marketplaceGalleryImageName, - } -} - -// ParseMarketplaceGalleryImageID parses 'input' into a MarketplaceGalleryImageId -func ParseMarketplaceGalleryImageID(input string) (*MarketplaceGalleryImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&MarketplaceGalleryImageId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MarketplaceGalleryImageId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseMarketplaceGalleryImageIDInsensitively parses 'input' case-insensitively into a MarketplaceGalleryImageId -// note: this method should only be used for API response data and not user input -func ParseMarketplaceGalleryImageIDInsensitively(input string) (*MarketplaceGalleryImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&MarketplaceGalleryImageId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MarketplaceGalleryImageId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *MarketplaceGalleryImageId) 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.MarketplaceGalleryImageName, ok = input.Parsed["marketplaceGalleryImageName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "marketplaceGalleryImageName", input) - } - - return nil -} - -// ValidateMarketplaceGalleryImageID checks that 'input' can be parsed as a Marketplace Gallery Image ID -func ValidateMarketplaceGalleryImageID(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 := ParseMarketplaceGalleryImageID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Marketplace Gallery Image ID -func (id MarketplaceGalleryImageId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.MarketplaceGalleryImageName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Marketplace Gallery Image ID -func (id MarketplaceGalleryImageId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticMarketplaceGalleryImages", "marketplaceGalleryImages", "marketplaceGalleryImages"), - resourceids.UserSpecifiedSegment("marketplaceGalleryImageName", "marketplaceGalleryImageValue"), - } -} - -// String returns a human-readable description of this Marketplace Gallery Image ID -func (id MarketplaceGalleryImageId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Marketplace Gallery Image Name: %q", id.MarketplaceGalleryImageName), - } - return fmt.Sprintf("Marketplace Gallery Image (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage_test.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage_test.go deleted file mode 100644 index 2efd70c631f..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/id_marketplacegalleryimage_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package marketplacegalleryimages - -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 = &MarketplaceGalleryImageId{} - -func TestNewMarketplaceGalleryImageID(t *testing.T) { - id := NewMarketplaceGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "marketplaceGalleryImageValue") - - 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.MarketplaceGalleryImageName != "marketplaceGalleryImageValue" { - t.Fatalf("Expected %q but got %q for Segment 'MarketplaceGalleryImageName'", id.MarketplaceGalleryImageName, "marketplaceGalleryImageValue") - } -} - -func TestFormatMarketplaceGalleryImageID(t *testing.T) { - actual := NewMarketplaceGalleryImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "marketplaceGalleryImageValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/marketplaceGalleryImageValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseMarketplaceGalleryImageID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MarketplaceGalleryImageId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/marketplaceGalleryImageValue", - Expected: &MarketplaceGalleryImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - MarketplaceGalleryImageName: "marketplaceGalleryImageValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/marketplaceGalleryImageValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMarketplaceGalleryImageID(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.MarketplaceGalleryImageName != v.Expected.MarketplaceGalleryImageName { - t.Fatalf("Expected %q but got %q for MarketplaceGalleryImageName", v.Expected.MarketplaceGalleryImageName, actual.MarketplaceGalleryImageName) - } - - } -} - -func TestParseMarketplaceGalleryImageIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MarketplaceGalleryImageId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/mArKeTpLaCeGaLlErYiMaGeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/marketplaceGalleryImageValue", - Expected: &MarketplaceGalleryImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - MarketplaceGalleryImageName: "marketplaceGalleryImageValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages/marketplaceGalleryImageValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/mArKeTpLaCeGaLlErYiMaGeS/mArKeTpLaCeGaLlErYiMaGeVaLuE", - Expected: &MarketplaceGalleryImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MarketplaceGalleryImageName: "mArKeTpLaCeGaLlErYiMaGeVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/mArKeTpLaCeGaLlErYiMaGeS/mArKeTpLaCeGaLlErYiMaGeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMarketplaceGalleryImageIDInsensitively(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.MarketplaceGalleryImageName != v.Expected.MarketplaceGalleryImageName { - t.Fatalf("Expected %q but got %q for MarketplaceGalleryImageName", v.Expected.MarketplaceGalleryImageName, actual.MarketplaceGalleryImageName) - } - - } -} - -func TestSegmentsForMarketplaceGalleryImageId(t *testing.T) { - segments := MarketplaceGalleryImageId{}.Segments() - if len(segments) == 0 { - t.Fatalf("MarketplaceGalleryImageId 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/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_createorupdate.go deleted file mode 100644 index 0e5370f7054..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package marketplacegalleryimages - -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 *MarketplaceGalleryImages -} - -// CreateOrUpdate ... -func (c MarketplaceGalleryImagesClient) CreateOrUpdate(ctx context.Context, id MarketplaceGalleryImageId, input MarketplaceGalleryImages) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c MarketplaceGalleryImagesClient) CreateOrUpdateThenPoll(ctx context.Context, id MarketplaceGalleryImageId, input MarketplaceGalleryImages) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_delete.go deleted file mode 100644 index c9ef757cc54..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package marketplacegalleryimages - -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 MarketplaceGalleryImagesClient) Delete(ctx context.Context, id MarketplaceGalleryImageId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c MarketplaceGalleryImagesClient) DeleteThenPoll(ctx context.Context, id MarketplaceGalleryImageId) 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/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_get.go deleted file mode 100644 index 9398502879e..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package marketplacegalleryimages - -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 *MarketplaceGalleryImages -} - -// Get ... -func (c MarketplaceGalleryImagesClient) Get(ctx context.Context, id MarketplaceGalleryImageId) (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 MarketplaceGalleryImages - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_list.go deleted file mode 100644 index e7fd62764d1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package marketplacegalleryimages - -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 *[]MarketplaceGalleryImages -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []MarketplaceGalleryImages -} - -// List ... -func (c MarketplaceGalleryImagesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages", 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 *[]MarketplaceGalleryImages `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 MarketplaceGalleryImagesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, MarketplaceGalleryImagesOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c MarketplaceGalleryImagesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate MarketplaceGalleryImagesOperationPredicate) (result ListCompleteResult, err error) { - items := make([]MarketplaceGalleryImages, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_listall.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_listall.go deleted file mode 100644 index fa398ccfe08..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package marketplacegalleryimages - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]MarketplaceGalleryImages -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []MarketplaceGalleryImages -} - -// ListAll ... -func (c MarketplaceGalleryImagesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/marketplaceGalleryImages", 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 *[]MarketplaceGalleryImages `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c MarketplaceGalleryImagesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, MarketplaceGalleryImagesOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c MarketplaceGalleryImagesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate MarketplaceGalleryImagesOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]MarketplaceGalleryImages, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_update.go deleted file mode 100644 index c5bb089a731..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package marketplacegalleryimages - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *MarketplaceGalleryImages -} - -// Update ... -func (c MarketplaceGalleryImagesClient) Update(ctx context.Context, id MarketplaceGalleryImageId, input MarketplaceGalleryImagesUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c MarketplaceGalleryImagesClient) UpdateThenPoll(ctx context.Context, id MarketplaceGalleryImageId, input MarketplaceGalleryImagesUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_extendedlocation.go deleted file mode 100644 index 53cadae95d5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_gallerydiskimage.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_gallerydiskimage.go deleted file mode 100644 index 317f9e6cfb1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_gallerydiskimage.go +++ /dev/null @@ -1,8 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryDiskImage struct { - SizeInMB *int64 `json:"sizeInMB,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageidentifier.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageidentifier.go deleted file mode 100644 index 0f3541e5338..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageidentifier.go +++ /dev/null @@ -1,10 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageIdentifier struct { - Offer string `json:"offer"` - Publisher string `json:"publisher"` - Sku string `json:"sku"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversion.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversion.go deleted file mode 100644 index ac6e38f6b41..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversion.go +++ /dev/null @@ -1,9 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageVersion struct { - Name *string `json:"name,omitempty"` - Properties *GalleryImageVersionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionproperties.go deleted file mode 100644 index c9ed2934420..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageVersionProperties struct { - StorageProfile GalleryImageVersionStorageProfile `json:"storageProfile"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionstorageprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionstorageprofile.go deleted file mode 100644 index 74c0cb1cf13..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_galleryimageversionstorageprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GalleryImageVersionStorageProfile struct { - OsDiskImage *GalleryDiskImage `json:"osDiskImage,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimageproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimageproperties.go deleted file mode 100644 index 97b773ae78f..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimageproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceGalleryImageProperties struct { - CloudInitDataSource *CloudInitDataSource `json:"cloudInitDataSource,omitempty"` - ContainerId *string `json:"containerId,omitempty"` - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - Identifier *GalleryImageIdentifier `json:"identifier,omitempty"` - OsType OperatingSystemTypes `json:"osType"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - Status *MarketplaceGalleryImageStatus `json:"status,omitempty"` - Version *GalleryImageVersion `json:"version,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimages.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimages.go deleted file mode 100644 index cc450d9462f..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimages.go +++ /dev/null @@ -1,19 +0,0 @@ -package marketplacegalleryimages - -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 MarketplaceGalleryImages struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *MarketplaceGalleryImageProperties `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/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatus.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatus.go deleted file mode 100644 index 527539725df..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceGalleryImageStatus struct { - DownloadStatus *MarketplaceGalleryImageStatusDownloadStatus `json:"downloadStatus,omitempty"` - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProgressPercentage *int64 `json:"progressPercentage,omitempty"` - ProvisioningStatus *MarketplaceGalleryImageStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusdownloadstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusdownloadstatus.go deleted file mode 100644 index 85c57796050..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusdownloadstatus.go +++ /dev/null @@ -1,8 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceGalleryImageStatusDownloadStatus struct { - DownloadSizeInMB *int64 `json:"downloadSizeInMB,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusprovisioningstatus.go deleted file mode 100644 index 9ddfb9caf2c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagestatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceGalleryImageStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagesupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagesupdaterequest.go deleted file mode 100644 index 6639391a1a6..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/model_marketplacegalleryimagesupdaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceGalleryImagesUpdateRequest struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/predicates.go deleted file mode 100644 index 5d612f67073..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package marketplacegalleryimages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MarketplaceGalleryImagesOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p MarketplaceGalleryImagesOperationPredicate) Matches(input MarketplaceGalleryImages) 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/azurestackhci/2023-09-01-preview/marketplacegalleryimages/version.go b/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/version.go deleted file mode 100644 index 44f2cd2385e..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/marketplacegalleryimages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package marketplacegalleryimages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/marketplacegalleryimages/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/README.md b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/README.md deleted file mode 100644 index 0bad09ceef3..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces` Documentation - -The `networkinterfaces` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces" -``` - - -### Client Initialization - -```go -client := networkinterfaces.NewNetworkInterfacesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkInterfacesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkinterfaces.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.NetworkInterfaces{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Delete` - -```go -ctx := context.TODO() -id := networkinterfaces.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Get` - -```go -ctx := context.TODO() -id := networkinterfaces.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -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: `NetworkInterfacesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkInterfacesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.Update` - -```go -ctx := context.TODO() -id := networkinterfaces.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.NetworkInterfacesUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/constants.go deleted file mode 100644 index ade27d81ffc..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -package networkinterfaces - -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 ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface.go deleted file mode 100644 index d29ee8040c9..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkinterfaces - -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(&NetworkInterfaceId{}) -} - -var _ resourceids.ResourceId = &NetworkInterfaceId{} - -// NetworkInterfaceId is a struct representing the Resource ID for a Network Interface -type NetworkInterfaceId struct { - SubscriptionId string - ResourceGroupName string - NetworkInterfaceName string -} - -// NewNetworkInterfaceID returns a new NetworkInterfaceId struct -func NewNetworkInterfaceID(subscriptionId string, resourceGroupName string, networkInterfaceName string) NetworkInterfaceId { - return NetworkInterfaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkInterfaceName: networkInterfaceName, - } -} - -// ParseNetworkInterfaceID parses 'input' into a NetworkInterfaceId -func ParseNetworkInterfaceID(input string) (*NetworkInterfaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkInterfaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkInterfaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkInterfaceIDInsensitively parses 'input' case-insensitively into a NetworkInterfaceId -// note: this method should only be used for API response data and not user input -func ParseNetworkInterfaceIDInsensitively(input string) (*NetworkInterfaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkInterfaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkInterfaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkInterfaceId) 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.NetworkInterfaceName, ok = input.Parsed["networkInterfaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkInterfaceName", input) - } - - return nil -} - -// ValidateNetworkInterfaceID checks that 'input' can be parsed as a Network Interface ID -func ValidateNetworkInterfaceID(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 := ParseNetworkInterfaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Interface ID -func (id NetworkInterfaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/networkInterfaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkInterfaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Interface ID -func (id NetworkInterfaceId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticNetworkInterfaces", "networkInterfaces", "networkInterfaces"), - resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), - } -} - -// String returns a human-readable description of this Network Interface ID -func (id NetworkInterfaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), - } - return fmt.Sprintf("Network Interface (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface_test.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface_test.go deleted file mode 100644 index a37ca6e894b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/id_networkinterface_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkinterfaces - -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 = &NetworkInterfaceId{} - -func TestNewNetworkInterfaceID(t *testing.T) { - id := NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - - 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.NetworkInterfaceName != "networkInterfaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkInterfaceName'", id.NetworkInterfaceName, "networkInterfaceValue") - } -} - -func TestFormatNetworkInterfaceID(t *testing.T) { - actual := NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces/networkInterfaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkInterfaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkInterfaceId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces/networkInterfaceValue", - Expected: &NetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkInterfaceName: "networkInterfaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces/networkInterfaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkInterfaceID(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.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - } -} - -func TestParseNetworkInterfaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkInterfaceId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/nEtWoRkInTeRfAcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces/networkInterfaceValue", - Expected: &NetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkInterfaceName: "networkInterfaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/networkInterfaces/networkInterfaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe", - Expected: &NetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkInterfaceName: "nEtWoRkInTeRfAcEvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkInterfaceIDInsensitively(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.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - } -} - -func TestSegmentsForNetworkInterfaceId(t *testing.T) { - segments := NetworkInterfaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkInterfaceId 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/azurestackhci/2023-09-01-preview/networkinterfaces/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_createorupdate.go deleted file mode 100644 index 7291691166c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkinterfaces - -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 *NetworkInterfaces -} - -// CreateOrUpdate ... -func (c NetworkInterfacesClient) CreateOrUpdate(ctx context.Context, id NetworkInterfaceId, input NetworkInterfaces) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkInterfacesClient) CreateOrUpdateThenPoll(ctx context.Context, id NetworkInterfaceId, input NetworkInterfaces) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/networkinterfaces/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_delete.go deleted file mode 100644 index 7b815712bf2..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package networkinterfaces - -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 NetworkInterfacesClient) Delete(ctx context.Context, id NetworkInterfaceId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c NetworkInterfacesClient) DeleteThenPoll(ctx context.Context, id NetworkInterfaceId) 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/azurestackhci/2023-09-01-preview/networkinterfaces/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_get.go deleted file mode 100644 index 33da90ee600..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkinterfaces - -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 *NetworkInterfaces -} - -// Get ... -func (c NetworkInterfacesClient) Get(ctx context.Context, id NetworkInterfaceId) (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 NetworkInterfaces - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_list.go deleted file mode 100644 index f9bc06e5631..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 *[]NetworkInterfaces -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaces -} - -// List ... -func (c NetworkInterfacesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/networkInterfaces", 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 *[]NetworkInterfaces `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 NetworkInterfacesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkInterfacesOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkInterfacesOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkInterfaces, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/networkinterfaces/method_listall.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_listall.go deleted file mode 100644 index 26c2889a8f2..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaces -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaces -} - -// ListAll ... -func (c NetworkInterfacesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/networkInterfaces", 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 *[]NetworkInterfaces `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkInterfacesOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkInterfacesOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkInterfaces, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_update.go deleted file mode 100644 index 7c6f6d80cdd..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkinterfaces - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaces -} - -// Update ... -func (c NetworkInterfacesClient) Update(ctx context.Context, id NetworkInterfaceId, input NetworkInterfacesUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c NetworkInterfacesClient) UpdateThenPoll(ctx context.Context, id NetworkInterfaceId, input NetworkInterfacesUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_extendedlocation.go deleted file mode 100644 index b2fc7d38b2d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_interfacednssettings.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_interfacednssettings.go deleted file mode 100644 index cb2f42c0967..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_interfacednssettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InterfaceDNSSettings struct { - DnsServers *[]string `json:"dnsServers,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfiguration.go deleted file mode 100644 index 4dba57abec2..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationproperties.go deleted file mode 100644 index 9a6acce3482..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProperties struct { - Gateway *string `json:"gateway,omitempty"` - PrefixLength *string `json:"prefixLength,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - Subnet *IPConfigurationPropertiesSubnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationpropertiessubnet.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationpropertiessubnet.go deleted file mode 100644 index b87520c7872..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_ipconfigurationpropertiessubnet.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesSubnet struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaceproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaceproperties.go deleted file mode 100644 index c39cb163aad..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaceproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceProperties struct { - DnsSettings *InterfaceDNSSettings `json:"dnsSettings,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - Status *NetworkInterfaceStatus `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaces.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaces.go deleted file mode 100644 index 5c01ce90c80..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfaces.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaces struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceProperties `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/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatus.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatus.go deleted file mode 100644 index eace96b9616..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatus.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceStatus struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProvisioningStatus *NetworkInterfaceStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatusprovisioningstatus.go deleted file mode 100644 index 37d22bd02a5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacestatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacesupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacesupdaterequest.go deleted file mode 100644 index f6cb091d079..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/model_networkinterfacesupdaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacesUpdateRequest struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/predicates.go deleted file mode 100644 index 9e8cac5d9c5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacesOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkInterfacesOperationPredicate) Matches(input NetworkInterfaces) 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/azurestackhci/2023-09-01-preview/networkinterfaces/version.go b/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/version.go deleted file mode 100644 index d316b816337..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkinterfaces/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/README.md b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/README.md deleted file mode 100644 index 2ec1710f22d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers` Documentation - -The `storagecontainers` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers" -``` - - -### Client Initialization - -```go -client := storagecontainers.NewStorageContainersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `StorageContainersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := storagecontainers.NewStorageContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageContainerValue") - -payload := storagecontainers.StorageContainers{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `StorageContainersClient.Delete` - -```go -ctx := context.TODO() -id := storagecontainers.NewStorageContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageContainerValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `StorageContainersClient.Get` - -```go -ctx := context.TODO() -id := storagecontainers.NewStorageContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageContainerValue") - -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: `StorageContainersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `StorageContainersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `StorageContainersClient.Update` - -```go -ctx := context.TODO() -id := storagecontainers.NewStorageContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageContainerValue") - -payload := storagecontainers.StorageContainersUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/client.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/client.go deleted file mode 100644 index db251da0046..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package storagecontainers - -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 StorageContainersClient struct { - Client *resourcemanager.Client -} - -func NewStorageContainersClientWithBaseURI(sdkApi sdkEnv.Api) (*StorageContainersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "storagecontainers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating StorageContainersClient: %+v", err) - } - - return &StorageContainersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/constants.go deleted file mode 100644 index eeeeb0bb775..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -package storagecontainers - -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 ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer.go deleted file mode 100644 index 0600ddd1b9a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer.go +++ /dev/null @@ -1,130 +0,0 @@ -package storagecontainers - -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(&StorageContainerId{}) -} - -var _ resourceids.ResourceId = &StorageContainerId{} - -// StorageContainerId is a struct representing the Resource ID for a Storage Container -type StorageContainerId struct { - SubscriptionId string - ResourceGroupName string - StorageContainerName string -} - -// NewStorageContainerID returns a new StorageContainerId struct -func NewStorageContainerID(subscriptionId string, resourceGroupName string, storageContainerName string) StorageContainerId { - return StorageContainerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - StorageContainerName: storageContainerName, - } -} - -// ParseStorageContainerID parses 'input' into a StorageContainerId -func ParseStorageContainerID(input string) (*StorageContainerId, error) { - parser := resourceids.NewParserFromResourceIdType(&StorageContainerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StorageContainerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseStorageContainerIDInsensitively parses 'input' case-insensitively into a StorageContainerId -// note: this method should only be used for API response data and not user input -func ParseStorageContainerIDInsensitively(input string) (*StorageContainerId, error) { - parser := resourceids.NewParserFromResourceIdType(&StorageContainerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StorageContainerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *StorageContainerId) 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.StorageContainerName, ok = input.Parsed["storageContainerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "storageContainerName", input) - } - - return nil -} - -// ValidateStorageContainerID checks that 'input' can be parsed as a Storage Container ID -func ValidateStorageContainerID(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 := ParseStorageContainerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Storage Container ID -func (id StorageContainerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/storageContainers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.StorageContainerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Storage Container ID -func (id StorageContainerId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticStorageContainers", "storageContainers", "storageContainers"), - resourceids.UserSpecifiedSegment("storageContainerName", "storageContainerValue"), - } -} - -// String returns a human-readable description of this Storage Container ID -func (id StorageContainerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Storage Container Name: %q", id.StorageContainerName), - } - return fmt.Sprintf("Storage Container (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer_test.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer_test.go deleted file mode 100644 index 72d31dfd4ea..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/id_storagecontainer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package storagecontainers - -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 = &StorageContainerId{} - -func TestNewStorageContainerID(t *testing.T) { - id := NewStorageContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageContainerValue") - - 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.StorageContainerName != "storageContainerValue" { - t.Fatalf("Expected %q but got %q for Segment 'StorageContainerName'", id.StorageContainerName, "storageContainerValue") - } -} - -func TestFormatStorageContainerID(t *testing.T) { - actual := NewStorageContainerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "storageContainerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers/storageContainerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseStorageContainerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StorageContainerId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers/storageContainerValue", - Expected: &StorageContainerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - StorageContainerName: "storageContainerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers/storageContainerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStorageContainerID(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.StorageContainerName != v.Expected.StorageContainerName { - t.Fatalf("Expected %q but got %q for StorageContainerName", v.Expected.StorageContainerName, actual.StorageContainerName) - } - - } -} - -func TestParseStorageContainerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StorageContainerId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/sToRaGeCoNtAiNeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers/storageContainerValue", - Expected: &StorageContainerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - StorageContainerName: "storageContainerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/storageContainers/storageContainerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/sToRaGeCoNtAiNeRs/sToRaGeCoNtAiNeRvAlUe", - Expected: &StorageContainerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - StorageContainerName: "sToRaGeCoNtAiNeRvAlUe", - }, - }, - { - // 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.aZuReStAcKhCi/sToRaGeCoNtAiNeRs/sToRaGeCoNtAiNeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStorageContainerIDInsensitively(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.StorageContainerName != v.Expected.StorageContainerName { - t.Fatalf("Expected %q but got %q for StorageContainerName", v.Expected.StorageContainerName, actual.StorageContainerName) - } - - } -} - -func TestSegmentsForStorageContainerId(t *testing.T) { - segments := StorageContainerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("StorageContainerId 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/azurestackhci/2023-09-01-preview/storagecontainers/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_createorupdate.go deleted file mode 100644 index 224d388ec6c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package storagecontainers - -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 *StorageContainers -} - -// CreateOrUpdate ... -func (c StorageContainersClient) CreateOrUpdate(ctx context.Context, id StorageContainerId, input StorageContainers) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c StorageContainersClient) CreateOrUpdateThenPoll(ctx context.Context, id StorageContainerId, input StorageContainers) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/storagecontainers/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_delete.go deleted file mode 100644 index 4c2f5715cf4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package storagecontainers - -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 StorageContainersClient) Delete(ctx context.Context, id StorageContainerId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c StorageContainersClient) DeleteThenPoll(ctx context.Context, id StorageContainerId) 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/azurestackhci/2023-09-01-preview/storagecontainers/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_get.go deleted file mode 100644 index 3ead82b221b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package storagecontainers - -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 *StorageContainers -} - -// Get ... -func (c StorageContainersClient) Get(ctx context.Context, id StorageContainerId) (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 StorageContainers - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_list.go deleted file mode 100644 index 6c64a2ba76f..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package storagecontainers - -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 *[]StorageContainers -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []StorageContainers -} - -// List ... -func (c StorageContainersClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/storageContainers", 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 *[]StorageContainers `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 StorageContainersClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, StorageContainersOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c StorageContainersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate StorageContainersOperationPredicate) (result ListCompleteResult, err error) { - items := make([]StorageContainers, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/storagecontainers/method_listall.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_listall.go deleted file mode 100644 index c924bd0169d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package storagecontainers - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]StorageContainers -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []StorageContainers -} - -// ListAll ... -func (c StorageContainersClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/storageContainers", 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 *[]StorageContainers `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c StorageContainersClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, StorageContainersOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c StorageContainersClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate StorageContainersOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]StorageContainers, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_update.go deleted file mode 100644 index 796a838c3be..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package storagecontainers - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *StorageContainers -} - -// Update ... -func (c StorageContainersClient) Update(ctx context.Context, id StorageContainerId, input StorageContainersUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c StorageContainersClient) UpdateThenPoll(ctx context.Context, id StorageContainerId, input StorageContainersUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_extendedlocation.go deleted file mode 100644 index e1936c7961a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package storagecontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerproperties.go deleted file mode 100644 index 6cdde28e1f2..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package storagecontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageContainerProperties struct { - Path string `json:"path"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - Status *StorageContainerStatus `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainers.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainers.go deleted file mode 100644 index f669724072d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainers.go +++ /dev/null @@ -1,19 +0,0 @@ -package storagecontainers - -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 StorageContainers struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *StorageContainerProperties `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/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatus.go deleted file mode 100644 index f4ee8603c33..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package storagecontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageContainerStatus struct { - AvailableSizeMB *int64 `json:"availableSizeMB,omitempty"` - ContainerSizeMB *int64 `json:"containerSizeMB,omitempty"` - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProvisioningStatus *StorageContainerStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatusprovisioningstatus.go deleted file mode 100644 index ae2e6ebaff8..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainerstatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package storagecontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageContainerStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainersupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainersupdaterequest.go deleted file mode 100644 index f7961c17b3c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/model_storagecontainersupdaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package storagecontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageContainersUpdateRequest struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/predicates.go deleted file mode 100644 index 0ca6fa52190..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package storagecontainers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageContainersOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p StorageContainersOperationPredicate) Matches(input StorageContainers) 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/azurestackhci/2023-09-01-preview/storagecontainers/version.go b/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/version.go deleted file mode 100644 index 83dbdaf7dd4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/storagecontainers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package storagecontainers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/storagecontainers/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/README.md b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/README.md deleted file mode 100644 index 89d9a4b7947..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks` Documentation - -The `virtualharddisks` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks" -``` - - -### Client Initialization - -```go -client := virtualharddisks.NewVirtualHardDisksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualHardDisksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualharddisks.NewVirtualHardDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHardDiskValue") - -payload := virtualharddisks.VirtualHardDisks{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualHardDisksClient.Delete` - -```go -ctx := context.TODO() -id := virtualharddisks.NewVirtualHardDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHardDiskValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualHardDisksClient.Get` - -```go -ctx := context.TODO() -id := virtualharddisks.NewVirtualHardDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHardDiskValue") - -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: `VirtualHardDisksClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualHardDisksClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualHardDisksClient.Update` - -```go -ctx := context.TODO() -id := virtualharddisks.NewVirtualHardDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHardDiskValue") - -payload := virtualharddisks.VirtualHardDisksUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/client.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/client.go deleted file mode 100644 index 337d4efa659..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualharddisks - -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 VirtualHardDisksClient struct { - Client *resourcemanager.Client -} - -func NewVirtualHardDisksClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualHardDisksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualharddisks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualHardDisksClient: %+v", err) - } - - return &VirtualHardDisksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/constants.go deleted file mode 100644 index 6387b527b49..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package virtualharddisks - -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 DiskFileFormat string - -const ( - DiskFileFormatVhd DiskFileFormat = "vhd" - DiskFileFormatVhdx DiskFileFormat = "vhdx" -) - -func PossibleValuesForDiskFileFormat() []string { - return []string{ - string(DiskFileFormatVhd), - string(DiskFileFormatVhdx), - } -} - -func (s *DiskFileFormat) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDiskFileFormat(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDiskFileFormat(input string) (*DiskFileFormat, error) { - vals := map[string]DiskFileFormat{ - "vhd": DiskFileFormatVhd, - "vhdx": DiskFileFormatVhdx, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DiskFileFormat(input) - return &out, nil -} - -type ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type HyperVGeneration string - -const ( - HyperVGenerationVOne HyperVGeneration = "V1" - HyperVGenerationVTwo HyperVGeneration = "V2" -) - -func PossibleValuesForHyperVGeneration() []string { - return []string{ - string(HyperVGenerationVOne), - string(HyperVGenerationVTwo), - } -} - -func (s *HyperVGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHyperVGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHyperVGeneration(input string) (*HyperVGeneration, error) { - vals := map[string]HyperVGeneration{ - "v1": HyperVGenerationVOne, - "v2": HyperVGenerationVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HyperVGeneration(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk.go deleted file mode 100644 index 7f18540e453..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualharddisks - -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(&VirtualHardDiskId{}) -} - -var _ resourceids.ResourceId = &VirtualHardDiskId{} - -// VirtualHardDiskId is a struct representing the Resource ID for a Virtual Hard Disk -type VirtualHardDiskId struct { - SubscriptionId string - ResourceGroupName string - VirtualHardDiskName string -} - -// NewVirtualHardDiskID returns a new VirtualHardDiskId struct -func NewVirtualHardDiskID(subscriptionId string, resourceGroupName string, virtualHardDiskName string) VirtualHardDiskId { - return VirtualHardDiskId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHardDiskName: virtualHardDiskName, - } -} - -// ParseVirtualHardDiskID parses 'input' into a VirtualHardDiskId -func ParseVirtualHardDiskID(input string) (*VirtualHardDiskId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHardDiskId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHardDiskId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualHardDiskIDInsensitively parses 'input' case-insensitively into a VirtualHardDiskId -// note: this method should only be used for API response data and not user input -func ParseVirtualHardDiskIDInsensitively(input string) (*VirtualHardDiskId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHardDiskId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHardDiskId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualHardDiskId) 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.VirtualHardDiskName, ok = input.Parsed["virtualHardDiskName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHardDiskName", input) - } - - return nil -} - -// ValidateVirtualHardDiskID checks that 'input' can be parsed as a Virtual Hard Disk ID -func ValidateVirtualHardDiskID(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 := ParseVirtualHardDiskID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Hard Disk ID -func (id VirtualHardDiskId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.AzureStackHCI/virtualHardDisks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHardDiskName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Hard Disk ID -func (id VirtualHardDiskId) 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("staticMicrosoftAzureStackHCI", "Microsoft.AzureStackHCI", "Microsoft.AzureStackHCI"), - resourceids.StaticSegment("staticVirtualHardDisks", "virtualHardDisks", "virtualHardDisks"), - resourceids.UserSpecifiedSegment("virtualHardDiskName", "virtualHardDiskValue"), - } -} - -// String returns a human-readable description of this Virtual Hard Disk ID -func (id VirtualHardDiskId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hard Disk Name: %q", id.VirtualHardDiskName), - } - return fmt.Sprintf("Virtual Hard Disk (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk_test.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk_test.go deleted file mode 100644 index 3ba0ea2c25b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/id_virtualharddisk_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualharddisks - -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 = &VirtualHardDiskId{} - -func TestNewVirtualHardDiskID(t *testing.T) { - id := NewVirtualHardDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHardDiskValue") - - 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.VirtualHardDiskName != "virtualHardDiskValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHardDiskName'", id.VirtualHardDiskName, "virtualHardDiskValue") - } -} - -func TestFormatVirtualHardDiskID(t *testing.T) { - actual := NewVirtualHardDiskID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHardDiskValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks/virtualHardDiskValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualHardDiskID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHardDiskId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks/virtualHardDiskValue", - Expected: &VirtualHardDiskId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHardDiskName: "virtualHardDiskValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks/virtualHardDiskValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHardDiskID(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.VirtualHardDiskName != v.Expected.VirtualHardDiskName { - t.Fatalf("Expected %q but got %q for VirtualHardDiskName", v.Expected.VirtualHardDiskName, actual.VirtualHardDiskName) - } - - } -} - -func TestParseVirtualHardDiskIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHardDiskId - }{ - { - // 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.AzureStackHCI", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/vIrTuAlHaRdDiSkS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks/virtualHardDiskValue", - Expected: &VirtualHardDiskId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHardDiskName: "virtualHardDiskValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.AzureStackHCI/virtualHardDisks/virtualHardDiskValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.aZuReStAcKhCi/vIrTuAlHaRdDiSkS/vIrTuAlHaRdDiSkVaLuE", - Expected: &VirtualHardDiskId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHardDiskName: "vIrTuAlHaRdDiSkVaLuE", - }, - }, - { - // 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.aZuReStAcKhCi/vIrTuAlHaRdDiSkS/vIrTuAlHaRdDiSkVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHardDiskIDInsensitively(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.VirtualHardDiskName != v.Expected.VirtualHardDiskName { - t.Fatalf("Expected %q but got %q for VirtualHardDiskName", v.Expected.VirtualHardDiskName, actual.VirtualHardDiskName) - } - - } -} - -func TestSegmentsForVirtualHardDiskId(t *testing.T) { - segments := VirtualHardDiskId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualHardDiskId 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/azurestackhci/2023-09-01-preview/virtualharddisks/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_createorupdate.go deleted file mode 100644 index fe36930d428..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualharddisks - -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 *VirtualHardDisks -} - -// CreateOrUpdate ... -func (c VirtualHardDisksClient) CreateOrUpdate(ctx context.Context, id VirtualHardDiskId, input VirtualHardDisks) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualHardDisksClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualHardDiskId, input VirtualHardDisks) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/virtualharddisks/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_delete.go deleted file mode 100644 index 6abc2528822..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualharddisks - -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 VirtualHardDisksClient) Delete(ctx context.Context, id VirtualHardDiskId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c VirtualHardDisksClient) DeleteThenPoll(ctx context.Context, id VirtualHardDiskId) 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/azurestackhci/2023-09-01-preview/virtualharddisks/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_get.go deleted file mode 100644 index 7917d287d9b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualharddisks - -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 *VirtualHardDisks -} - -// Get ... -func (c VirtualHardDisksClient) Get(ctx context.Context, id VirtualHardDiskId) (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 VirtualHardDisks - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_list.go deleted file mode 100644 index 4988494c02e..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualharddisks - -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 *[]VirtualHardDisks -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHardDisks -} - -// List ... -func (c VirtualHardDisksClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualHardDisks", 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 *[]VirtualHardDisks `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 VirtualHardDisksClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualHardDisksOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualHardDisksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualHardDisksOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualHardDisks, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/virtualharddisks/method_listall.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_listall.go deleted file mode 100644 index e8b12a2784d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualharddisks - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHardDisks -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHardDisks -} - -// ListAll ... -func (c VirtualHardDisksClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualHardDisks", 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 *[]VirtualHardDisks `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c VirtualHardDisksClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, VirtualHardDisksOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualHardDisksClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualHardDisksOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]VirtualHardDisks, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_update.go deleted file mode 100644 index 8ce1cd790ad..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualharddisks - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHardDisks -} - -// Update ... -func (c VirtualHardDisksClient) Update(ctx context.Context, id VirtualHardDiskId, input VirtualHardDisksUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VirtualHardDisksClient) UpdateThenPoll(ctx context.Context, id VirtualHardDiskId, input VirtualHardDisksUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_extendedlocation.go deleted file mode 100644 index 1769d210ca7..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualharddisks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskproperties.go deleted file mode 100644 index 94361608585..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualharddisks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHardDiskProperties struct { - BlockSizeBytes *int64 `json:"blockSizeBytes,omitempty"` - ContainerId *string `json:"containerId,omitempty"` - DiskFileFormat *DiskFileFormat `json:"diskFileFormat,omitempty"` - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - Dynamic *bool `json:"dynamic,omitempty"` - HyperVGeneration *HyperVGeneration `json:"hyperVGeneration,omitempty"` - LogicalSectorBytes *int64 `json:"logicalSectorBytes,omitempty"` - PhysicalSectorBytes *int64 `json:"physicalSectorBytes,omitempty"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - Status *VirtualHardDiskStatus `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisks.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisks.go deleted file mode 100644 index 761800d5c3c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisks.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualharddisks - -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 VirtualHardDisks struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *VirtualHardDiskProperties `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/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatus.go deleted file mode 100644 index 589b9607ee1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatus.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualharddisks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHardDiskStatus struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - ProvisioningStatus *VirtualHardDiskStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatusprovisioningstatus.go deleted file mode 100644 index 66fd03afc8b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddiskstatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualharddisks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHardDiskStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisksupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisksupdaterequest.go deleted file mode 100644 index 1de25f7b8de..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/model_virtualharddisksupdaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualharddisks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHardDisksUpdateRequest struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/predicates.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/predicates.go deleted file mode 100644 index 793ce512e65..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualharddisks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHardDisksOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualHardDisksOperationPredicate) Matches(input VirtualHardDisks) 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/azurestackhci/2023-09-01-preview/virtualharddisks/version.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/version.go deleted file mode 100644 index d907d3d025a..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualharddisks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualharddisks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualharddisks/%s", defaultApiVersion) -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/README.md b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/README.md deleted file mode 100644 index 15103c2b522..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/README.md +++ /dev/null @@ -1,136 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances` Documentation - -The `virtualmachineinstances` SDK allows for interaction with the Azure Resource Manager Service `azurestackhci` (API Version `2023-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances" -``` - - -### Client Initialization - -```go -client := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualMachineInstancesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -payload := virtualmachineinstances.VirtualMachineInstance{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineInstancesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineInstancesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -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: `VirtualMachineInstancesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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: `VirtualMachineInstancesClient.Restart` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -if err := client.RestartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineInstancesClient.Start` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineInstancesClient.Stop` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineInstancesClient.Update` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -payload := virtualmachineinstances.VirtualMachineInstanceUpdateRequest{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/constants.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/constants.go deleted file mode 100644 index ecc73bd57b0..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/constants.go +++ /dev/null @@ -1,475 +0,0 @@ -package virtualmachineinstances - -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 ExtendedLocationTypes string - -const ( - ExtendedLocationTypesCustomLocation ExtendedLocationTypes = "CustomLocation" -) - -func PossibleValuesForExtendedLocationTypes() []string { - return []string{ - string(ExtendedLocationTypesCustomLocation), - } -} - -func (s *ExtendedLocationTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExtendedLocationTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExtendedLocationTypes(input string) (*ExtendedLocationTypes, error) { - vals := map[string]ExtendedLocationTypes{ - "customlocation": ExtendedLocationTypesCustomLocation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExtendedLocationTypes(input) - return &out, nil -} - -type OperatingSystemTypes string - -const ( - OperatingSystemTypesLinux OperatingSystemTypes = "Linux" - OperatingSystemTypesWindows OperatingSystemTypes = "Windows" -) - -func PossibleValuesForOperatingSystemTypes() []string { - return []string{ - string(OperatingSystemTypesLinux), - string(OperatingSystemTypesWindows), - } -} - -func (s *OperatingSystemTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperatingSystemTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperatingSystemTypes(input string) (*OperatingSystemTypes, error) { - vals := map[string]OperatingSystemTypes{ - "linux": OperatingSystemTypesLinux, - "windows": OperatingSystemTypesWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OperatingSystemTypes(input) - return &out, nil -} - -type PowerStateEnum string - -const ( - PowerStateEnumDeallocated PowerStateEnum = "Deallocated" - PowerStateEnumDeallocating PowerStateEnum = "Deallocating" - PowerStateEnumRunning PowerStateEnum = "Running" - PowerStateEnumStarting PowerStateEnum = "Starting" - PowerStateEnumStopped PowerStateEnum = "Stopped" - PowerStateEnumStopping PowerStateEnum = "Stopping" - PowerStateEnumUnknown PowerStateEnum = "Unknown" -) - -func PossibleValuesForPowerStateEnum() []string { - return []string{ - string(PowerStateEnumDeallocated), - string(PowerStateEnumDeallocating), - string(PowerStateEnumRunning), - string(PowerStateEnumStarting), - string(PowerStateEnumStopped), - string(PowerStateEnumStopping), - string(PowerStateEnumUnknown), - } -} - -func (s *PowerStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePowerStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePowerStateEnum(input string) (*PowerStateEnum, error) { - vals := map[string]PowerStateEnum{ - "deallocated": PowerStateEnumDeallocated, - "deallocating": PowerStateEnumDeallocating, - "running": PowerStateEnumRunning, - "starting": PowerStateEnumStarting, - "stopped": PowerStateEnumStopped, - "stopping": PowerStateEnumStopping, - "unknown": PowerStateEnumUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PowerStateEnum(input) - return &out, nil -} - -type ProvisioningStateEnum string - -const ( - ProvisioningStateEnumAccepted ProvisioningStateEnum = "Accepted" - ProvisioningStateEnumCanceled ProvisioningStateEnum = "Canceled" - ProvisioningStateEnumDeleting ProvisioningStateEnum = "Deleting" - ProvisioningStateEnumFailed ProvisioningStateEnum = "Failed" - ProvisioningStateEnumInProgress ProvisioningStateEnum = "InProgress" - ProvisioningStateEnumSucceeded ProvisioningStateEnum = "Succeeded" -) - -func PossibleValuesForProvisioningStateEnum() []string { - return []string{ - string(ProvisioningStateEnumAccepted), - string(ProvisioningStateEnumCanceled), - string(ProvisioningStateEnumDeleting), - string(ProvisioningStateEnumFailed), - string(ProvisioningStateEnumInProgress), - string(ProvisioningStateEnumSucceeded), - } -} - -func (s *ProvisioningStateEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateEnum(input string) (*ProvisioningStateEnum, error) { - vals := map[string]ProvisioningStateEnum{ - "accepted": ProvisioningStateEnumAccepted, - "canceled": ProvisioningStateEnumCanceled, - "deleting": ProvisioningStateEnumDeleting, - "failed": ProvisioningStateEnumFailed, - "inprogress": ProvisioningStateEnumInProgress, - "succeeded": ProvisioningStateEnumSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateEnum(input) - return &out, nil -} - -type SecurityTypes string - -const ( - SecurityTypesConfidentialVM SecurityTypes = "ConfidentialVM" - SecurityTypesTrustedLaunch SecurityTypes = "TrustedLaunch" -) - -func PossibleValuesForSecurityTypes() []string { - return []string{ - string(SecurityTypesConfidentialVM), - string(SecurityTypesTrustedLaunch), - } -} - -func (s *SecurityTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityTypes(input string) (*SecurityTypes, error) { - vals := map[string]SecurityTypes{ - "confidentialvm": SecurityTypesConfidentialVM, - "trustedlaunch": SecurityTypesTrustedLaunch, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityTypes(input) - return &out, nil -} - -type Status string - -const ( - StatusFailed Status = "Failed" - StatusInProgress Status = "InProgress" - StatusSucceeded Status = "Succeeded" -) - -func PossibleValuesForStatus() []string { - return []string{ - string(StatusFailed), - string(StatusInProgress), - string(StatusSucceeded), - } -} - -func (s *Status) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatus(input string) (*Status, error) { - vals := map[string]Status{ - "failed": StatusFailed, - "inprogress": StatusInProgress, - "succeeded": StatusSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Status(input) - return &out, nil -} - -type StatusLevelTypes string - -const ( - StatusLevelTypesError StatusLevelTypes = "Error" - StatusLevelTypesInfo StatusLevelTypes = "Info" - StatusLevelTypesWarning StatusLevelTypes = "Warning" -) - -func PossibleValuesForStatusLevelTypes() []string { - return []string{ - string(StatusLevelTypesError), - string(StatusLevelTypesInfo), - string(StatusLevelTypesWarning), - } -} - -func (s *StatusLevelTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatusLevelTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatusLevelTypes(input string) (*StatusLevelTypes, error) { - vals := map[string]StatusLevelTypes{ - "error": StatusLevelTypesError, - "info": StatusLevelTypesInfo, - "warning": StatusLevelTypesWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StatusLevelTypes(input) - return &out, nil -} - -type StatusTypes string - -const ( - StatusTypesFailed StatusTypes = "Failed" - StatusTypesInProgress StatusTypes = "InProgress" - StatusTypesSucceeded StatusTypes = "Succeeded" -) - -func PossibleValuesForStatusTypes() []string { - return []string{ - string(StatusTypesFailed), - string(StatusTypesInProgress), - string(StatusTypesSucceeded), - } -} - -func (s *StatusTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStatusTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStatusTypes(input string) (*StatusTypes, error) { - vals := map[string]StatusTypes{ - "failed": StatusTypesFailed, - "inprogress": StatusTypesInProgress, - "succeeded": StatusTypesSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StatusTypes(input) - return &out, nil -} - -type VMSizeEnum string - -const ( - VMSizeEnumCustom VMSizeEnum = "Custom" - VMSizeEnumDefault VMSizeEnum = "Default" - VMSizeEnumStandardAFourVTwo VMSizeEnum = "Standard_A4_v2" - VMSizeEnumStandardATwoVTwo VMSizeEnum = "Standard_A2_v2" - VMSizeEnumStandardDEightsVThree VMSizeEnum = "Standard_D8s_v3" - VMSizeEnumStandardDFoursVThree VMSizeEnum = "Standard_D4s_v3" - VMSizeEnumStandardDOneSixsVThree VMSizeEnum = "Standard_D16s_v3" - VMSizeEnumStandardDSFiveVTwo VMSizeEnum = "Standard_DS5_v2" - VMSizeEnumStandardDSFourVTwo VMSizeEnum = "Standard_DS4_v2" - VMSizeEnumStandardDSOneThreeVTwo VMSizeEnum = "Standard_DS13_v2" - VMSizeEnumStandardDSThreeVTwo VMSizeEnum = "Standard_DS3_v2" - VMSizeEnumStandardDSTwoVTwo VMSizeEnum = "Standard_DS2_v2" - VMSizeEnumStandardDThreeTwosVThree VMSizeEnum = "Standard_D32s_v3" - VMSizeEnumStandardDTwosVThree VMSizeEnum = "Standard_D2s_v3" - VMSizeEnumStandardKEightSFiveVOne VMSizeEnum = "Standard_K8S5_v1" - VMSizeEnumStandardKEightSFourVOne VMSizeEnum = "Standard_K8S4_v1" - VMSizeEnumStandardKEightSThreeVOne VMSizeEnum = "Standard_K8S3_v1" - VMSizeEnumStandardKEightSTwoVOne VMSizeEnum = "Standard_K8S2_v1" - VMSizeEnumStandardKEightSVOne VMSizeEnum = "Standard_K8S_v1" - VMSizeEnumStandardNKOneTwo VMSizeEnum = "Standard_NK12" - VMSizeEnumStandardNKSix VMSizeEnum = "Standard_NK6" - VMSizeEnumStandardNVOneTwo VMSizeEnum = "Standard_NV12" - VMSizeEnumStandardNVSix VMSizeEnum = "Standard_NV6" -) - -func PossibleValuesForVMSizeEnum() []string { - return []string{ - string(VMSizeEnumCustom), - string(VMSizeEnumDefault), - string(VMSizeEnumStandardAFourVTwo), - string(VMSizeEnumStandardATwoVTwo), - string(VMSizeEnumStandardDEightsVThree), - string(VMSizeEnumStandardDFoursVThree), - string(VMSizeEnumStandardDOneSixsVThree), - string(VMSizeEnumStandardDSFiveVTwo), - string(VMSizeEnumStandardDSFourVTwo), - string(VMSizeEnumStandardDSOneThreeVTwo), - string(VMSizeEnumStandardDSThreeVTwo), - string(VMSizeEnumStandardDSTwoVTwo), - string(VMSizeEnumStandardDThreeTwosVThree), - string(VMSizeEnumStandardDTwosVThree), - string(VMSizeEnumStandardKEightSFiveVOne), - string(VMSizeEnumStandardKEightSFourVOne), - string(VMSizeEnumStandardKEightSThreeVOne), - string(VMSizeEnumStandardKEightSTwoVOne), - string(VMSizeEnumStandardKEightSVOne), - string(VMSizeEnumStandardNKOneTwo), - string(VMSizeEnumStandardNKSix), - string(VMSizeEnumStandardNVOneTwo), - string(VMSizeEnumStandardNVSix), - } -} - -func (s *VMSizeEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVMSizeEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVMSizeEnum(input string) (*VMSizeEnum, error) { - vals := map[string]VMSizeEnum{ - "custom": VMSizeEnumCustom, - "default": VMSizeEnumDefault, - "standard_a4_v2": VMSizeEnumStandardAFourVTwo, - "standard_a2_v2": VMSizeEnumStandardATwoVTwo, - "standard_d8s_v3": VMSizeEnumStandardDEightsVThree, - "standard_d4s_v3": VMSizeEnumStandardDFoursVThree, - "standard_d16s_v3": VMSizeEnumStandardDOneSixsVThree, - "standard_ds5_v2": VMSizeEnumStandardDSFiveVTwo, - "standard_ds4_v2": VMSizeEnumStandardDSFourVTwo, - "standard_ds13_v2": VMSizeEnumStandardDSOneThreeVTwo, - "standard_ds3_v2": VMSizeEnumStandardDSThreeVTwo, - "standard_ds2_v2": VMSizeEnumStandardDSTwoVTwo, - "standard_d32s_v3": VMSizeEnumStandardDThreeTwosVThree, - "standard_d2s_v3": VMSizeEnumStandardDTwosVThree, - "standard_k8s5_v1": VMSizeEnumStandardKEightSFiveVOne, - "standard_k8s4_v1": VMSizeEnumStandardKEightSFourVOne, - "standard_k8s3_v1": VMSizeEnumStandardKEightSThreeVOne, - "standard_k8s2_v1": VMSizeEnumStandardKEightSTwoVOne, - "standard_k8s_v1": VMSizeEnumStandardKEightSVOne, - "standard_nk12": VMSizeEnumStandardNKOneTwo, - "standard_nk6": VMSizeEnumStandardNKSix, - "standard_nv12": VMSizeEnumStandardNVOneTwo, - "standard_nv6": VMSizeEnumStandardNVSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VMSizeEnum(input) - return &out, nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_createorupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_createorupdate.go deleted file mode 100644 index 3101b431759..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualmachineinstances - -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 *VirtualMachineInstance -} - -// CreateOrUpdate ... -func (c VirtualMachineInstancesClient) CreateOrUpdate(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstance) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", 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 VirtualMachineInstancesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstance) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_delete.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_delete.go deleted file mode 100644 index e71f0c564c7..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualmachineinstances - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c VirtualMachineInstancesClient) Delete(ctx context.Context, id commonids.ScopeId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - }, - HttpMethod: http.MethodDelete, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c VirtualMachineInstancesClient) DeleteThenPoll(ctx context.Context, id commonids.ScopeId) 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_get.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_get.go deleted file mode 100644 index 083f0bcc7a1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_get.go +++ /dev/null @@ -1,56 +0,0 @@ -package virtualmachineinstances - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualMachineInstance -} - -// Get ... -func (c VirtualMachineInstancesClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/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 VirtualMachineInstance - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_list.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_list.go deleted file mode 100644 index 266c91df4a1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualmachineinstances - -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 *[]VirtualMachineInstance -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualMachineInstance -} - -// List ... -func (c VirtualMachineInstancesClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances", 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 *[]VirtualMachineInstance `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 VirtualMachineInstancesClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualMachineInstanceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualMachineInstancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate VirtualMachineInstanceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualMachineInstance, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_start.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_start.go deleted file mode 100644 index df64e7711d5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_start.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualmachineinstances - -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 - Model *VirtualMachineInstance -} - -// Start ... -func (c VirtualMachineInstancesClient) Start(ctx context.Context, id commonids.ScopeId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/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 VirtualMachineInstancesClient) StartThenPoll(ctx context.Context, id commonids.ScopeId) 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_stop.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_stop.go deleted file mode 100644 index dff3ddd04d6..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_stop.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualmachineinstances - -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 - Model *VirtualMachineInstance -} - -// Stop ... -func (c VirtualMachineInstancesClient) Stop(ctx context.Context, id commonids.ScopeId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/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 VirtualMachineInstancesClient) StopThenPoll(ctx context.Context, id commonids.ScopeId) 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_update.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_update.go deleted file mode 100644 index 9e5a68b37e4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_update.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualmachineinstances - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualMachineInstance -} - -// Update ... -func (c VirtualMachineInstancesClient) Update(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstanceUpdateRequest) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default", 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 -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VirtualMachineInstancesClient) UpdateThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstanceUpdateRequest) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_erroradditionalinfo.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_erroradditionalinfo.go deleted file mode 100644 index 4bc54a9ce01..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_errordetail.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_errordetail.go deleted file mode 100644 index 27f74262121..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_errordetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachineinstances - -// 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_extendedlocation.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_extendedlocation.go deleted file mode 100644 index 91c570023b0..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_extendedlocation.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedLocation struct { - Name *string `json:"name,omitempty"` - Type *ExtendedLocationTypes `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_guestagentinstallstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_guestagentinstallstatus.go deleted file mode 100644 index d840ed26b08..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_guestagentinstallstatus.go +++ /dev/null @@ -1,30 +0,0 @@ -package virtualmachineinstances - -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 GuestAgentInstallStatus struct { - AgentVersion *string `json:"agentVersion,omitempty"` - ErrorDetails *[]ErrorDetail `json:"errorDetails,omitempty"` - LastStatusChange *string `json:"lastStatusChange,omitempty"` - Status *StatusTypes `json:"status,omitempty"` - VMUuid *string `json:"vmUuid,omitempty"` -} - -func (o *GuestAgentInstallStatus) GetLastStatusChangeAsTime() (*time.Time, error) { - if o.LastStatusChange == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastStatusChange, "2006-01-02T15:04:05Z07:00") -} - -func (o *GuestAgentInstallStatus) SetLastStatusChangeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastStatusChange = &formatted -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_hardwareprofileupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_hardwareprofileupdate.go deleted file mode 100644 index 8ac33a2aac2..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_hardwareprofileupdate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HardwareProfileUpdate struct { - MemoryMB *int64 `json:"memoryMB,omitempty"` - Processors *int64 `json:"processors,omitempty"` - VMSize *VMSizeEnum `json:"vmSize,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_httpproxyconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_httpproxyconfiguration.go deleted file mode 100644 index e6b9fe48464..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_httpproxyconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPProxyConfiguration 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_instanceviewstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_instanceviewstatus.go deleted file mode 100644 index cf090359480..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_instanceviewstatus.go +++ /dev/null @@ -1,30 +0,0 @@ -package virtualmachineinstances - -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 InstanceViewStatus struct { - Code *string `json:"code,omitempty"` - DisplayStatus *string `json:"displayStatus,omitempty"` - Level *StatusLevelTypes `json:"level,omitempty"` - Message *string `json:"message,omitempty"` - Time *string `json:"time,omitempty"` -} - -func (o *InstanceViewStatus) GetTimeAsTime() (*time.Time, error) { - if o.Time == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Time, "2006-01-02T15:04:05Z07:00") -} - -func (o *InstanceViewStatus) SetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Time = &formatted -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdate.go deleted file mode 100644 index 38d8b2ce83b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfileUpdate struct { - NetworkInterfaces *[]NetworkProfileUpdateNetworkInterfacesInlined `json:"networkInterfaces,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdatenetworkinterfacesinlined.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdatenetworkinterfacesinlined.go deleted file mode 100644 index 06e4797a9eb..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_networkprofileupdatenetworkinterfacesinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfileUpdateNetworkInterfacesInlined struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdate.go deleted file mode 100644 index 68fb327421e..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OsProfileUpdate struct { - ComputerName *string `json:"computerName,omitempty"` - LinuxConfiguration *OsProfileUpdateLinuxConfiguration `json:"linuxConfiguration,omitempty"` - WindowsConfiguration *OsProfileUpdateWindowsConfiguration `json:"windowsConfiguration,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatelinuxconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatelinuxconfiguration.go deleted file mode 100644 index 771d0cad563..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatelinuxconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OsProfileUpdateLinuxConfiguration struct { - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - ProvisionVMConfigAgent *bool `json:"provisionVMConfigAgent,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatewindowsconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatewindowsconfiguration.go deleted file mode 100644 index 556f6158585..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_osprofileupdatewindowsconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OsProfileUpdateWindowsConfiguration struct { - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - ProvisionVMConfigAgent *bool `json:"provisionVMConfigAgent,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshconfiguration.go deleted file mode 100644 index 65cfc412539..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshConfiguration struct { - PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshpublickey.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshpublickey.go deleted file mode 100644 index 24b2239ea7e..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_sshpublickey.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshPublicKey struct { - KeyData *string `json:"keyData,omitempty"` - Path *string `json:"path,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdate.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdate.go deleted file mode 100644 index f9315c680f4..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageProfileUpdate struct { - DataDisks *[]StorageProfileUpdateDataDisksInlined `json:"dataDisks,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdatedatadisksinlined.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdatedatadisksinlined.go deleted file mode 100644 index 53c62f6a338..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_storageprofileupdatedatadisksinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageProfileUpdateDataDisksInlined struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineconfigagentinstanceview.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineconfigagentinstanceview.go deleted file mode 100644 index 17a3de99b14..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineconfigagentinstanceview.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineConfigAgentInstanceView struct { - Statuses *[]InstanceViewStatus `json:"statuses,omitempty"` - VMConfigAgentVersion *string `json:"vmConfigAgentVersion,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstance.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstance.go deleted file mode 100644 index c7042f00115..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstance.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualmachineinstances - -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 VirtualMachineInstance struct { - ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualMachineInstanceProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceproperties.go deleted file mode 100644 index 2958663da50..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstanceProperties struct { - GuestAgentInstallStatus *GuestAgentInstallStatus `json:"guestAgentInstallStatus,omitempty"` - HTTPProxyConfig *HTTPProxyConfiguration `json:"httpProxyConfig,omitempty"` - HardwareProfile *VirtualMachineInstancePropertiesHardwareProfile `json:"hardwareProfile,omitempty"` - InstanceView *VirtualMachineInstanceView `json:"instanceView,omitempty"` - NetworkProfile *VirtualMachineInstancePropertiesNetworkProfile `json:"networkProfile,omitempty"` - OsProfile *VirtualMachineInstancePropertiesOsProfile `json:"osProfile,omitempty"` - ProvisioningState *ProvisioningStateEnum `json:"provisioningState,omitempty"` - ResourceUid *string `json:"resourceUid,omitempty"` - SecurityProfile *VirtualMachineInstancePropertiesSecurityProfile `json:"securityProfile,omitempty"` - Status *VirtualMachineInstanceStatus `json:"status,omitempty"` - StorageProfile *VirtualMachineInstancePropertiesStorageProfile `json:"storageProfile,omitempty"` - VMId *string `json:"vmId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofile.go deleted file mode 100644 index 6477a3e0e82..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesHardwareProfile struct { - DynamicMemoryConfig *VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig `json:"dynamicMemoryConfig,omitempty"` - MemoryMB *int64 `json:"memoryMB,omitempty"` - Processors *int64 `json:"processors,omitempty"` - VMSize *VMSizeEnum `json:"vmSize,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofiledynamicmemoryconfig.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofiledynamicmemoryconfig.go deleted file mode 100644 index 71edd879165..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertieshardwareprofiledynamicmemoryconfig.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesHardwareProfileDynamicMemoryConfig struct { - MaximumMemoryMB *int64 `json:"maximumMemoryMB,omitempty"` - MinimumMemoryMB *int64 `json:"minimumMemoryMB,omitempty"` - TargetMemoryBuffer *int64 `json:"targetMemoryBuffer,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofile.go deleted file mode 100644 index 66c9a793447..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesNetworkProfile struct { - NetworkInterfaces *[]VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesInlined `json:"networkInterfaces,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofilenetworkinterfacesinlined.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofilenetworkinterfacesinlined.go deleted file mode 100644 index 4b7bfad467f..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesnetworkprofilenetworkinterfacesinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesNetworkProfileNetworkInterfacesInlined struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofile.go deleted file mode 100644 index 9e3a604396d..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesOsProfile struct { - AdminPassword *string `json:"adminPassword,omitempty"` - AdminUsername *string `json:"adminUsername,omitempty"` - ComputerName *string `json:"computerName,omitempty"` - LinuxConfiguration *VirtualMachineInstancePropertiesOsProfileLinuxConfiguration `json:"linuxConfiguration,omitempty"` - WindowsConfiguration *VirtualMachineInstancePropertiesOsProfileWindowsConfiguration `json:"windowsConfiguration,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilelinuxconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilelinuxconfiguration.go deleted file mode 100644 index 795bef56661..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilelinuxconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesOsProfileLinuxConfiguration struct { - DisablePasswordAuthentication *bool `json:"disablePasswordAuthentication,omitempty"` - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - ProvisionVMConfigAgent *bool `json:"provisionVMConfigAgent,omitempty"` - Ssh *SshConfiguration `json:"ssh,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilewindowsconfiguration.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilewindowsconfiguration.go deleted file mode 100644 index bee8ebecd07..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesosprofilewindowsconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesOsProfileWindowsConfiguration struct { - EnableAutomaticUpdates *bool `json:"enableAutomaticUpdates,omitempty"` - ProvisionVMAgent *bool `json:"provisionVMAgent,omitempty"` - ProvisionVMConfigAgent *bool `json:"provisionVMConfigAgent,omitempty"` - Ssh *SshConfiguration `json:"ssh,omitempty"` - TimeZone *string `json:"timeZone,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofile.go deleted file mode 100644 index 606e35a685c..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesSecurityProfile struct { - EnableTPM *bool `json:"enableTPM,omitempty"` - SecurityType *SecurityTypes `json:"securityType,omitempty"` - UefiSettings *VirtualMachineInstancePropertiesSecurityProfileUefiSettings `json:"uefiSettings,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofileuefisettings.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofileuefisettings.go deleted file mode 100644 index 575c3806034..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiessecurityprofileuefisettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesSecurityProfileUefiSettings struct { - SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofile.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofile.go deleted file mode 100644 index a3ca01aa2f3..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesStorageProfile struct { - DataDisks *[]VirtualMachineInstancePropertiesStorageProfileDataDisksInlined `json:"dataDisks,omitempty"` - ImageReference *VirtualMachineInstancePropertiesStorageProfileImageReference `json:"imageReference,omitempty"` - OsDisk *VirtualMachineInstancePropertiesStorageProfileOsDisk `json:"osDisk,omitempty"` - VMConfigStoragePathId *string `json:"vmConfigStoragePathId,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofiledatadisksinlined.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofiledatadisksinlined.go deleted file mode 100644 index e53aab331c1..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofiledatadisksinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesStorageProfileDataDisksInlined struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileimagereference.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileimagereference.go deleted file mode 100644 index e2b09c81d5b..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileimagereference.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesStorageProfileImageReference struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileosdisk.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileosdisk.go deleted file mode 100644 index a2817dfd294..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancepropertiesstorageprofileosdisk.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstancePropertiesStorageProfileOsDisk struct { - Id *string `json:"id,omitempty"` - OsType *OperatingSystemTypes `json:"osType,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatus.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatus.go deleted file mode 100644 index 692614617be..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatus.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstanceStatus struct { - ErrorCode *string `json:"errorCode,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - PowerState *PowerStateEnum `json:"powerState,omitempty"` - ProvisioningStatus *VirtualMachineInstanceStatusProvisioningStatus `json:"provisioningStatus,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatusprovisioningstatus.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatusprovisioningstatus.go deleted file mode 100644 index 01216f61012..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstancestatusprovisioningstatus.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstanceStatusProvisioningStatus struct { - OperationId *string `json:"operationId,omitempty"` - Status *Status `json:"status,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go deleted file mode 100644 index 3cef824dba6..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstanceUpdateProperties struct { - HardwareProfile *HardwareProfileUpdate `json:"hardwareProfile,omitempty"` - NetworkProfile *NetworkProfileUpdate `json:"networkProfile,omitempty"` - OsProfile *OsProfileUpdate `json:"osProfile,omitempty"` - StorageProfile *StorageProfileUpdate `json:"storageProfile,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdaterequest.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdaterequest.go deleted file mode 100644 index 4bc62e74041..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceupdaterequest.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualmachineinstances - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstanceUpdateRequest struct { - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Properties *VirtualMachineInstanceUpdateProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceview.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceview.go deleted file mode 100644 index 06414a259e5..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/model_virtualmachineinstanceview.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualmachineinstances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineInstanceView struct { - VMAgent *VirtualMachineConfigAgentInstanceView `json:"vmAgent,omitempty"` -} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/version.go b/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/version.go deleted file mode 100644 index 366beef0998..00000000000 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachineinstances - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachineinstances/%s", defaultApiVersion) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/README.md b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/README.md deleted file mode 100644 index ce4b63a6b94..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/README.md +++ /dev/null @@ -1,107 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/capabilities` Documentation - -The `capabilities` SDK allows for interaction with the Azure Resource Manager Service `chaosstudio` (API Version `2023-04-15-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/capabilities" -``` - - -### Client Initialization - -```go -client := capabilities.NewCapabilitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CapabilitiesClient.CapabilityTypesGet` - -```go -ctx := context.TODO() -id := capabilities.NewCapabilityTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue", "capabilityTypeValue") - -read, err := client.CapabilityTypesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CapabilitiesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioCapabilityID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue", "capabilityValue") - -payload := capabilities.Capability{ - // ... -} - - -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: `CapabilitiesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioCapabilityID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue", "capabilityValue") - -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: `CapabilitiesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioCapabilityID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue", "capabilityValue") - -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: `CapabilitiesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue") - -// alternatively `client.List(ctx, id, capabilities.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, capabilities.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/client.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/client.go deleted file mode 100644 index a2e1031ed38..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package capabilities - -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 CapabilitiesClient struct { - Client *resourcemanager.Client -} - -func NewCapabilitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*CapabilitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "capabilities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CapabilitiesClient: %+v", err) - } - - return &CapabilitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype.go deleted file mode 100644 index 9f4c9074969..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype.go +++ /dev/null @@ -1,139 +0,0 @@ -package capabilities - -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(&CapabilityTypeId{}) -} - -var _ resourceids.ResourceId = &CapabilityTypeId{} - -// CapabilityTypeId is a struct representing the Resource ID for a Capability Type -type CapabilityTypeId struct { - SubscriptionId string - LocationName string - TargetTypeName string - CapabilityTypeName string -} - -// NewCapabilityTypeID returns a new CapabilityTypeId struct -func NewCapabilityTypeID(subscriptionId string, locationName string, targetTypeName string, capabilityTypeName string) CapabilityTypeId { - return CapabilityTypeId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - TargetTypeName: targetTypeName, - CapabilityTypeName: capabilityTypeName, - } -} - -// ParseCapabilityTypeID parses 'input' into a CapabilityTypeId -func ParseCapabilityTypeID(input string) (*CapabilityTypeId, error) { - parser := resourceids.NewParserFromResourceIdType(&CapabilityTypeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CapabilityTypeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCapabilityTypeIDInsensitively parses 'input' case-insensitively into a CapabilityTypeId -// note: this method should only be used for API response data and not user input -func ParseCapabilityTypeIDInsensitively(input string) (*CapabilityTypeId, error) { - parser := resourceids.NewParserFromResourceIdType(&CapabilityTypeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CapabilityTypeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CapabilityTypeId) 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.TargetTypeName, ok = input.Parsed["targetTypeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "targetTypeName", input) - } - - if id.CapabilityTypeName, ok = input.Parsed["capabilityTypeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "capabilityTypeName", input) - } - - return nil -} - -// ValidateCapabilityTypeID checks that 'input' can be parsed as a Capability Type ID -func ValidateCapabilityTypeID(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 := ParseCapabilityTypeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Capability Type ID -func (id CapabilityTypeId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Chaos/locations/%s/targetTypes/%s/capabilityTypes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.TargetTypeName, id.CapabilityTypeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Capability Type ID -func (id CapabilityTypeId) 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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - resourceids.StaticSegment("staticTargetTypes", "targetTypes", "targetTypes"), - resourceids.UserSpecifiedSegment("targetTypeName", "targetTypeValue"), - resourceids.StaticSegment("staticCapabilityTypes", "capabilityTypes", "capabilityTypes"), - resourceids.UserSpecifiedSegment("capabilityTypeName", "capabilityTypeValue"), - } -} - -// String returns a human-readable description of this Capability Type ID -func (id CapabilityTypeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - fmt.Sprintf("Target Type Name: %q", id.TargetTypeName), - fmt.Sprintf("Capability Type Name: %q", id.CapabilityTypeName), - } - return fmt.Sprintf("Capability Type (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype_test.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype_test.go deleted file mode 100644 index 5e9f08dae07..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/id_capabilitytype_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package capabilities - -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 = &CapabilityTypeId{} - -func TestNewCapabilityTypeID(t *testing.T) { - id := NewCapabilityTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue", "capabilityTypeValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } - - if id.TargetTypeName != "targetTypeValue" { - t.Fatalf("Expected %q but got %q for Segment 'TargetTypeName'", id.TargetTypeName, "targetTypeValue") - } - - if id.CapabilityTypeName != "capabilityTypeValue" { - t.Fatalf("Expected %q but got %q for Segment 'CapabilityTypeName'", id.CapabilityTypeName, "capabilityTypeValue") - } -} - -func TestFormatCapabilityTypeID(t *testing.T) { - actual := NewCapabilityTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue", "capabilityTypeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes/capabilityTypeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCapabilityTypeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CapabilityTypeId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes/capabilityTypeValue", - Expected: &CapabilityTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - TargetTypeName: "targetTypeValue", - CapabilityTypeName: "capabilityTypeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes/capabilityTypeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCapabilityTypeID(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.TargetTypeName != v.Expected.TargetTypeName { - t.Fatalf("Expected %q but got %q for TargetTypeName", v.Expected.TargetTypeName, actual.TargetTypeName) - } - - if actual.CapabilityTypeName != v.Expected.CapabilityTypeName { - t.Fatalf("Expected %q but got %q for CapabilityTypeName", v.Expected.CapabilityTypeName, actual.CapabilityTypeName) - } - - } -} - -func TestParseCapabilityTypeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CapabilityTypeId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe/cApAbIlItYtYpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes/capabilityTypeValue", - Expected: &CapabilityTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - TargetTypeName: "targetTypeValue", - CapabilityTypeName: "capabilityTypeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/capabilityTypes/capabilityTypeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe/cApAbIlItYtYpEs/cApAbIlItYtYpEvAlUe", - Expected: &CapabilityTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - TargetTypeName: "tArGeTtYpEvAlUe", - CapabilityTypeName: "cApAbIlItYtYpEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe/cApAbIlItYtYpEs/cApAbIlItYtYpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCapabilityTypeIDInsensitively(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.TargetTypeName != v.Expected.TargetTypeName { - t.Fatalf("Expected %q but got %q for TargetTypeName", v.Expected.TargetTypeName, actual.TargetTypeName) - } - - if actual.CapabilityTypeName != v.Expected.CapabilityTypeName { - t.Fatalf("Expected %q but got %q for CapabilityTypeName", v.Expected.CapabilityTypeName, actual.CapabilityTypeName) - } - - } -} - -func TestSegmentsForCapabilityTypeId(t *testing.T) { - segments := CapabilityTypeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CapabilityTypeId 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/chaosstudio/2023-04-15-preview/capabilities/method_capabilitytypesget.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_capabilitytypesget.go deleted file mode 100644 index 6b25107514c..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_capabilitytypesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package capabilities - -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 CapabilityTypesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CapabilityType -} - -// CapabilityTypesGet ... -func (c CapabilitiesClient) CapabilityTypesGet(ctx context.Context, id CapabilityTypeId) (result CapabilityTypesGetOperationResponse, 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 CapabilityType - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_createorupdate.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_createorupdate.go deleted file mode 100644 index 00ffa4a57a8..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package capabilities - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Capability -} - -// CreateOrUpdate ... -func (c CapabilitiesClient) CreateOrUpdate(ctx context.Context, id commonids.ChaosStudioCapabilityId, input Capability) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Capability - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_delete.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_delete.go deleted file mode 100644 index 5b1dcb3a174..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_delete.go +++ /dev/null @@ -1,48 +0,0 @@ -package capabilities - -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 DeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c CapabilitiesClient) Delete(ctx context.Context, id commonids.ChaosStudioCapabilityId) (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/chaosstudio/2023-04-15-preview/capabilities/method_get.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_get.go deleted file mode 100644 index 1a3631bef9d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package capabilities - -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 *Capability -} - -// Get ... -func (c CapabilitiesClient) Get(ctx context.Context, id commonids.ChaosStudioCapabilityId) (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 Capability - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_list.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_list.go deleted file mode 100644 index c04bbab8b4e..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/method_list.go +++ /dev/null @@ -1,120 +0,0 @@ -package capabilities - -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 *[]Capability -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Capability -} - -type ListOperationOptions struct { - ContinuationToken *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ContinuationToken != nil { - out.Append("continuationToken", fmt.Sprintf("%v", *o.ContinuationToken)) - } - return &out -} - -// List ... -func (c CapabilitiesClient) List(ctx context.Context, id commonids.ChaosStudioTargetId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/capabilities", id.ID()), - OptionsObject: options, - } - - 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 *[]Capability `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 CapabilitiesClient) ListComplete(ctx context.Context, id commonids.ChaosStudioTargetId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, CapabilityOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CapabilitiesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ChaosStudioTargetId, options ListOperationOptions, predicate CapabilityOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Capability, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/chaosstudio/2023-04-15-preview/capabilities/model_capability.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capability.go deleted file mode 100644 index a5f688167f3..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capability.go +++ /dev/null @@ -1,16 +0,0 @@ -package capabilities - -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 Capability struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *CapabilityProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilityproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilityproperties.go deleted file mode 100644 index e691d6069a1..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package capabilities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityProperties struct { - Description *string `json:"description,omitempty"` - ParametersSchema *string `json:"parametersSchema,omitempty"` - Publisher *string `json:"publisher,omitempty"` - TargetType *string `json:"targetType,omitempty"` - Urn *string `json:"urn,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytype.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytype.go deleted file mode 100644 index b6b93fbe934..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytype.go +++ /dev/null @@ -1,17 +0,0 @@ -package capabilities - -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 CapabilityType struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *CapabilityTypeProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypeproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypeproperties.go deleted file mode 100644 index cb11ed6b978..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypeproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package capabilities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityTypeProperties struct { - AzureRbacActions *[]string `json:"azureRbacActions,omitempty"` - AzureRbacDataActions *[]string `json:"azureRbacDataActions,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Kind *string `json:"kind,omitempty"` - ParametersSchema *string `json:"parametersSchema,omitempty"` - Publisher *string `json:"publisher,omitempty"` - RuntimeProperties *CapabilityTypePropertiesRuntimeProperties `json:"runtimeProperties,omitempty"` - TargetType *string `json:"targetType,omitempty"` - Urn *string `json:"urn,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypepropertiesruntimeproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypepropertiesruntimeproperties.go deleted file mode 100644 index f1f7b35bf97..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/model_capabilitytypepropertiesruntimeproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package capabilities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityTypePropertiesRuntimeProperties struct { - Kind *string `json:"kind,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/predicates.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/predicates.go deleted file mode 100644 index 4e83d4f0034..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package capabilities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p CapabilityOperationPredicate) Matches(input Capability) 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/chaosstudio/2023-04-15-preview/capabilities/version.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilities/version.go deleted file mode 100644 index 1926115fc66..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package capabilities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-15-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/capabilities/%s", defaultApiVersion) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/README.md b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/README.md deleted file mode 100644 index e8bf56b36e5..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes` Documentation - -The `capabilitytypes` SDK allows for interaction with the Azure Resource Manager Service `chaosstudio` (API Version `2023-04-15-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/chaosstudio/2023-04-15-preview/capabilitytypes" -``` - - -### Client Initialization - -```go -client := capabilitytypes.NewCapabilityTypesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CapabilityTypesClient.List` - -```go -ctx := context.TODO() -id := capabilitytypes.NewTargetTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue") - -// alternatively `client.List(ctx, id, capabilitytypes.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, capabilitytypes.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/client.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/client.go deleted file mode 100644 index 3dc8b841e5d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package capabilitytypes - -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 CapabilityTypesClient struct { - Client *resourcemanager.Client -} - -func NewCapabilityTypesClientWithBaseURI(sdkApi sdkEnv.Api) (*CapabilityTypesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "capabilitytypes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CapabilityTypesClient: %+v", err) - } - - return &CapabilityTypesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype.go deleted file mode 100644 index 3a4bcf5410c..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype.go +++ /dev/null @@ -1,130 +0,0 @@ -package capabilitytypes - -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(&TargetTypeId{}) -} - -var _ resourceids.ResourceId = &TargetTypeId{} - -// TargetTypeId is a struct representing the Resource ID for a Target Type -type TargetTypeId struct { - SubscriptionId string - LocationName string - TargetTypeName string -} - -// NewTargetTypeID returns a new TargetTypeId struct -func NewTargetTypeID(subscriptionId string, locationName string, targetTypeName string) TargetTypeId { - return TargetTypeId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - TargetTypeName: targetTypeName, - } -} - -// ParseTargetTypeID parses 'input' into a TargetTypeId -func ParseTargetTypeID(input string) (*TargetTypeId, error) { - parser := resourceids.NewParserFromResourceIdType(&TargetTypeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TargetTypeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseTargetTypeIDInsensitively parses 'input' case-insensitively into a TargetTypeId -// note: this method should only be used for API response data and not user input -func ParseTargetTypeIDInsensitively(input string) (*TargetTypeId, error) { - parser := resourceids.NewParserFromResourceIdType(&TargetTypeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TargetTypeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *TargetTypeId) 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.TargetTypeName, ok = input.Parsed["targetTypeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "targetTypeName", input) - } - - return nil -} - -// ValidateTargetTypeID checks that 'input' can be parsed as a Target Type ID -func ValidateTargetTypeID(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 := ParseTargetTypeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Target Type ID -func (id TargetTypeId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Chaos/locations/%s/targetTypes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.TargetTypeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Target Type ID -func (id TargetTypeId) 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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - resourceids.StaticSegment("staticTargetTypes", "targetTypes", "targetTypes"), - resourceids.UserSpecifiedSegment("targetTypeName", "targetTypeValue"), - } -} - -// String returns a human-readable description of this Target Type ID -func (id TargetTypeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - fmt.Sprintf("Target Type Name: %q", id.TargetTypeName), - } - return fmt.Sprintf("Target Type (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype_test.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype_test.go deleted file mode 100644 index 2cbc27fd00a..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/id_targettype_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package capabilitytypes - -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 = &TargetTypeId{} - -func TestNewTargetTypeID(t *testing.T) { - id := NewTargetTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } - - if id.TargetTypeName != "targetTypeValue" { - t.Fatalf("Expected %q but got %q for Segment 'TargetTypeName'", id.TargetTypeName, "targetTypeValue") - } -} - -func TestFormatTargetTypeID(t *testing.T) { - actual := NewTargetTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseTargetTypeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TargetTypeId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue", - Expected: &TargetTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - TargetTypeName: "targetTypeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTargetTypeID(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.TargetTypeName != v.Expected.TargetTypeName { - t.Fatalf("Expected %q but got %q for TargetTypeName", v.Expected.TargetTypeName, actual.TargetTypeName) - } - - } -} - -func TestParseTargetTypeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TargetTypeId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue", - Expected: &TargetTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - TargetTypeName: "targetTypeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe", - Expected: &TargetTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - TargetTypeName: "tArGeTtYpEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTargetTypeIDInsensitively(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.TargetTypeName != v.Expected.TargetTypeName { - t.Fatalf("Expected %q but got %q for TargetTypeName", v.Expected.TargetTypeName, actual.TargetTypeName) - } - - } -} - -func TestSegmentsForTargetTypeId(t *testing.T) { - segments := TargetTypeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("TargetTypeId 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/chaosstudio/2023-04-15-preview/capabilitytypes/method_list.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/method_list.go deleted file mode 100644 index b7ad0f798e7..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package capabilitytypes - -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 *[]CapabilityType -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []CapabilityType -} - -type ListOperationOptions struct { - ContinuationToken *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ContinuationToken != nil { - out.Append("continuationToken", fmt.Sprintf("%v", *o.ContinuationToken)) - } - return &out -} - -// List ... -func (c CapabilityTypesClient) List(ctx context.Context, id TargetTypeId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/capabilityTypes", id.ID()), - OptionsObject: options, - } - - 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 *[]CapabilityType `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 CapabilityTypesClient) ListComplete(ctx context.Context, id TargetTypeId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, CapabilityTypeOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CapabilityTypesClient) ListCompleteMatchingPredicate(ctx context.Context, id TargetTypeId, options ListOperationOptions, predicate CapabilityTypeOperationPredicate) (result ListCompleteResult, err error) { - items := make([]CapabilityType, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytype.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytype.go deleted file mode 100644 index fec9365d92c..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytype.go +++ /dev/null @@ -1,17 +0,0 @@ -package capabilitytypes - -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 CapabilityType struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *CapabilityTypeProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypeproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypeproperties.go deleted file mode 100644 index 7d2ad8abe15..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypeproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package capabilitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityTypeProperties struct { - AzureRbacActions *[]string `json:"azureRbacActions,omitempty"` - AzureRbacDataActions *[]string `json:"azureRbacDataActions,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Kind *string `json:"kind,omitempty"` - ParametersSchema *string `json:"parametersSchema,omitempty"` - Publisher *string `json:"publisher,omitempty"` - RuntimeProperties *CapabilityTypePropertiesRuntimeProperties `json:"runtimeProperties,omitempty"` - TargetType *string `json:"targetType,omitempty"` - Urn *string `json:"urn,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypepropertiesruntimeproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypepropertiesruntimeproperties.go deleted file mode 100644 index 7b3b89e7708..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/model_capabilitytypepropertiesruntimeproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package capabilitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityTypePropertiesRuntimeProperties struct { - Kind *string `json:"kind,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/predicates.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/predicates.go deleted file mode 100644 index 39d040ae4dc..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package capabilitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilityTypeOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p CapabilityTypeOperationPredicate) Matches(input CapabilityType) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/chaosstudio/2023-04-15-preview/capabilitytypes/version.go b/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/version.go deleted file mode 100644 index b5a429ec6ef..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package capabilitytypes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-15-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/capabilitytypes/%s", defaultApiVersion) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/client.go b/resource-manager/chaosstudio/2023-04-15-preview/client.go deleted file mode 100644 index 72b9ec55ea9..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/client.go +++ /dev/null @@ -1,64 +0,0 @@ -package v2023_04_15_preview - -// 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/chaosstudio/2023-04-15-preview/capabilities" - "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/capabilitytypes" - "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/experiments" - "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/targets" - "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/targettypes" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Capabilities *capabilities.CapabilitiesClient - CapabilityTypes *capabilitytypes.CapabilityTypesClient - Experiments *experiments.ExperimentsClient - TargetTypes *targettypes.TargetTypesClient - Targets *targets.TargetsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - capabilitiesClient, err := capabilities.NewCapabilitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Capabilities client: %+v", err) - } - configureFunc(capabilitiesClient.Client) - - capabilityTypesClient, err := capabilitytypes.NewCapabilityTypesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CapabilityTypes client: %+v", err) - } - configureFunc(capabilityTypesClient.Client) - - experimentsClient, err := experiments.NewExperimentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Experiments client: %+v", err) - } - configureFunc(experimentsClient.Client) - - targetTypesClient, err := targettypes.NewTargetTypesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building TargetTypes client: %+v", err) - } - configureFunc(targetTypesClient.Client) - - targetsClient, err := targets.NewTargetsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Targets client: %+v", err) - } - configureFunc(targetsClient.Client) - - return &Client{ - Capabilities: capabilitiesClient, - CapabilityTypes: capabilityTypesClient, - Experiments: experimentsClient, - TargetTypes: targetTypesClient, - Targets: targetsClient, - }, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/README.md b/resource-manager/chaosstudio/2023-04-15-preview/experiments/README.md deleted file mode 100644 index b37859d6af1..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/README.md +++ /dev/null @@ -1,227 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/experiments` Documentation - -The `experiments` SDK allows for interaction with the Azure Resource Manager Service `chaosstudio` (API Version `2023-04-15-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/experiments" -``` - - -### Client Initialization - -```go -client := experiments.NewExperimentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExperimentsClient.Cancel` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -read, err := client.Cancel(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExperimentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -payload := experiments.Experiment{ - // ... -} - - -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: `ExperimentsClient.Delete` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -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: `ExperimentsClient.Get` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -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: `ExperimentsClient.GetExecutionDetails` - -```go -ctx := context.TODO() -id := experiments.NewExecutionDetailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue", "executionDetailsIdValue") - -read, err := client.GetExecutionDetails(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExperimentsClient.GetStatus` - -```go -ctx := context.TODO() -id := experiments.NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue", "statusIdValue") - -read, err := client.GetStatus(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExperimentsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.List(ctx, id, experiments.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, experiments.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExperimentsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id, experiments.DefaultListAllOperationOptions())` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id, experiments.DefaultListAllOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExperimentsClient.ListAllStatuses` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -// alternatively `client.ListAllStatuses(ctx, id)` can be used to do batched pagination -items, err := client.ListAllStatusesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExperimentsClient.ListExecutionDetails` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -// alternatively `client.ListExecutionDetails(ctx, id)` can be used to do batched pagination -items, err := client.ListExecutionDetailsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExperimentsClient.Start` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -read, err := client.Start(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExperimentsClient.Update` - -```go -ctx := context.TODO() -id := experiments.NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - -payload := experiments.ExperimentUpdate{ - // ... -} - - -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/chaosstudio/2023-04-15-preview/experiments/client.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/client.go deleted file mode 100644 index d2642af9418..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package experiments - -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 ExperimentsClient struct { - Client *resourcemanager.Client -} - -func NewExperimentsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExperimentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "experiments", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExperimentsClient: %+v", err) - } - - return &ExperimentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/constants.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/constants.go deleted file mode 100644 index 17185d92a99..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/constants.go +++ /dev/null @@ -1,127 +0,0 @@ -package experiments - -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 FilterType string - -const ( - FilterTypeSimple FilterType = "Simple" -) - -func PossibleValuesForFilterType() []string { - return []string{ - string(FilterTypeSimple), - } -} - -func (s *FilterType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFilterType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFilterType(input string) (*FilterType, error) { - vals := map[string]FilterType{ - "simple": FilterTypeSimple, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FilterType(input) - return &out, nil -} - -type SelectorType string - -const ( - SelectorTypeList SelectorType = "List" - SelectorTypeQuery SelectorType = "Query" -) - -func PossibleValuesForSelectorType() []string { - return []string{ - string(SelectorTypeList), - string(SelectorTypeQuery), - } -} - -func (s *SelectorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSelectorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSelectorType(input string) (*SelectorType, error) { - vals := map[string]SelectorType{ - "list": SelectorTypeList, - "query": SelectorTypeQuery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SelectorType(input) - return &out, nil -} - -type TargetReferenceType string - -const ( - TargetReferenceTypeChaosTarget TargetReferenceType = "ChaosTarget" -) - -func PossibleValuesForTargetReferenceType() []string { - return []string{ - string(TargetReferenceTypeChaosTarget), - } -} - -func (s *TargetReferenceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTargetReferenceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTargetReferenceType(input string) (*TargetReferenceType, error) { - vals := map[string]TargetReferenceType{ - "chaostarget": TargetReferenceTypeChaosTarget, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TargetReferenceType(input) - return &out, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail.go deleted file mode 100644 index 314cb26be83..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail.go +++ /dev/null @@ -1,139 +0,0 @@ -package experiments - -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(&ExecutionDetailId{}) -} - -var _ resourceids.ResourceId = &ExecutionDetailId{} - -// ExecutionDetailId is a struct representing the Resource ID for a Execution Detail -type ExecutionDetailId struct { - SubscriptionId string - ResourceGroupName string - ExperimentName string - ExecutionDetailsId string -} - -// NewExecutionDetailID returns a new ExecutionDetailId struct -func NewExecutionDetailID(subscriptionId string, resourceGroupName string, experimentName string, executionDetailsId string) ExecutionDetailId { - return ExecutionDetailId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExperimentName: experimentName, - ExecutionDetailsId: executionDetailsId, - } -} - -// ParseExecutionDetailID parses 'input' into a ExecutionDetailId -func ParseExecutionDetailID(input string) (*ExecutionDetailId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExecutionDetailId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExecutionDetailId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExecutionDetailIDInsensitively parses 'input' case-insensitively into a ExecutionDetailId -// note: this method should only be used for API response data and not user input -func ParseExecutionDetailIDInsensitively(input string) (*ExecutionDetailId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExecutionDetailId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExecutionDetailId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExecutionDetailId) 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.ExperimentName, ok = input.Parsed["experimentName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "experimentName", input) - } - - if id.ExecutionDetailsId, ok = input.Parsed["executionDetailsId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "executionDetailsId", input) - } - - return nil -} - -// ValidateExecutionDetailID checks that 'input' can be parsed as a Execution Detail ID -func ValidateExecutionDetailID(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 := ParseExecutionDetailID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Execution Detail ID -func (id ExecutionDetailId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Chaos/experiments/%s/executionDetails/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExperimentName, id.ExecutionDetailsId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Execution Detail ID -func (id ExecutionDetailId) 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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticExperiments", "experiments", "experiments"), - resourceids.UserSpecifiedSegment("experimentName", "experimentValue"), - resourceids.StaticSegment("staticExecutionDetails", "executionDetails", "executionDetails"), - resourceids.UserSpecifiedSegment("executionDetailsId", "executionDetailsIdValue"), - } -} - -// String returns a human-readable description of this Execution Detail ID -func (id ExecutionDetailId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Experiment Name: %q", id.ExperimentName), - fmt.Sprintf("Execution Details: %q", id.ExecutionDetailsId), - } - return fmt.Sprintf("Execution Detail (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail_test.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail_test.go deleted file mode 100644 index 3e3e84119bf..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_executiondetail_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package experiments - -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 = &ExecutionDetailId{} - -func TestNewExecutionDetailID(t *testing.T) { - id := NewExecutionDetailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue", "executionDetailsIdValue") - - 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.ExperimentName != "experimentValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExperimentName'", id.ExperimentName, "experimentValue") - } - - if id.ExecutionDetailsId != "executionDetailsIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExecutionDetailsId'", id.ExecutionDetailsId, "executionDetailsIdValue") - } -} - -func TestFormatExecutionDetailID(t *testing.T) { - actual := NewExecutionDetailID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue", "executionDetailsIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails/executionDetailsIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExecutionDetailID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExecutionDetailId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails/executionDetailsIdValue", - Expected: &ExecutionDetailId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExperimentName: "experimentValue", - ExecutionDetailsId: "executionDetailsIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails/executionDetailsIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExecutionDetailID(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.ExperimentName != v.Expected.ExperimentName { - t.Fatalf("Expected %q but got %q for ExperimentName", v.Expected.ExperimentName, actual.ExperimentName) - } - - if actual.ExecutionDetailsId != v.Expected.ExecutionDetailsId { - t.Fatalf("Expected %q but got %q for ExecutionDetailsId", v.Expected.ExecutionDetailsId, actual.ExecutionDetailsId) - } - - } -} - -func TestParseExecutionDetailIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExecutionDetailId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/eXeCuTiOnDeTaIlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails/executionDetailsIdValue", - Expected: &ExecutionDetailId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExperimentName: "experimentValue", - ExecutionDetailsId: "executionDetailsIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/executionDetails/executionDetailsIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/eXeCuTiOnDeTaIlS/eXeCuTiOnDeTaIlSiDvAlUe", - Expected: &ExecutionDetailId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExperimentName: "eXpErImEnTvAlUe", - ExecutionDetailsId: "eXeCuTiOnDeTaIlSiDvAlUe", - }, - }, - { - // 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.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/eXeCuTiOnDeTaIlS/eXeCuTiOnDeTaIlSiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExecutionDetailIDInsensitively(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.ExperimentName != v.Expected.ExperimentName { - t.Fatalf("Expected %q but got %q for ExperimentName", v.Expected.ExperimentName, actual.ExperimentName) - } - - if actual.ExecutionDetailsId != v.Expected.ExecutionDetailsId { - t.Fatalf("Expected %q but got %q for ExecutionDetailsId", v.Expected.ExecutionDetailsId, actual.ExecutionDetailsId) - } - - } -} - -func TestSegmentsForExecutionDetailId(t *testing.T) { - segments := ExecutionDetailId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExecutionDetailId 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/chaosstudio/2023-04-15-preview/experiments/id_experiment.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment.go deleted file mode 100644 index 087913b115c..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment.go +++ /dev/null @@ -1,130 +0,0 @@ -package experiments - -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(&ExperimentId{}) -} - -var _ resourceids.ResourceId = &ExperimentId{} - -// ExperimentId is a struct representing the Resource ID for a Experiment -type ExperimentId struct { - SubscriptionId string - ResourceGroupName string - ExperimentName string -} - -// NewExperimentID returns a new ExperimentId struct -func NewExperimentID(subscriptionId string, resourceGroupName string, experimentName string) ExperimentId { - return ExperimentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExperimentName: experimentName, - } -} - -// ParseExperimentID parses 'input' into a ExperimentId -func ParseExperimentID(input string) (*ExperimentId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExperimentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExperimentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExperimentIDInsensitively parses 'input' case-insensitively into a ExperimentId -// note: this method should only be used for API response data and not user input -func ParseExperimentIDInsensitively(input string) (*ExperimentId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExperimentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExperimentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExperimentId) 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.ExperimentName, ok = input.Parsed["experimentName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "experimentName", input) - } - - return nil -} - -// ValidateExperimentID checks that 'input' can be parsed as a Experiment ID -func ValidateExperimentID(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 := ParseExperimentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Experiment ID -func (id ExperimentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Chaos/experiments/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExperimentName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Experiment ID -func (id ExperimentId) 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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticExperiments", "experiments", "experiments"), - resourceids.UserSpecifiedSegment("experimentName", "experimentValue"), - } -} - -// String returns a human-readable description of this Experiment ID -func (id ExperimentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Experiment Name: %q", id.ExperimentName), - } - return fmt.Sprintf("Experiment (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment_test.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment_test.go deleted file mode 100644 index eeee25d4e17..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_experiment_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package experiments - -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 = &ExperimentId{} - -func TestNewExperimentID(t *testing.T) { - id := NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue") - - 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.ExperimentName != "experimentValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExperimentName'", id.ExperimentName, "experimentValue") - } -} - -func TestFormatExperimentID(t *testing.T) { - actual := NewExperimentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExperimentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExperimentId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue", - Expected: &ExperimentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExperimentName: "experimentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExperimentID(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.ExperimentName != v.Expected.ExperimentName { - t.Fatalf("Expected %q but got %q for ExperimentName", v.Expected.ExperimentName, actual.ExperimentName) - } - - } -} - -func TestParseExperimentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExperimentId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue", - Expected: &ExperimentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExperimentName: "experimentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe", - Expected: &ExperimentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExperimentName: "eXpErImEnTvAlUe", - }, - }, - { - // 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.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExperimentIDInsensitively(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.ExperimentName != v.Expected.ExperimentName { - t.Fatalf("Expected %q but got %q for ExperimentName", v.Expected.ExperimentName, actual.ExperimentName) - } - - } -} - -func TestSegmentsForExperimentId(t *testing.T) { - segments := ExperimentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExperimentId 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/chaosstudio/2023-04-15-preview/experiments/id_status.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status.go deleted file mode 100644 index fdd7aa5598d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status.go +++ /dev/null @@ -1,139 +0,0 @@ -package experiments - -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(&StatusId{}) -} - -var _ resourceids.ResourceId = &StatusId{} - -// StatusId is a struct representing the Resource ID for a Status -type StatusId struct { - SubscriptionId string - ResourceGroupName string - ExperimentName string - StatusId string -} - -// NewStatusID returns a new StatusId struct -func NewStatusID(subscriptionId string, resourceGroupName string, experimentName string, statusId string) StatusId { - return StatusId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExperimentName: experimentName, - StatusId: statusId, - } -} - -// ParseStatusID parses 'input' into a StatusId -func ParseStatusID(input string) (*StatusId, error) { - parser := resourceids.NewParserFromResourceIdType(&StatusId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StatusId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseStatusIDInsensitively parses 'input' case-insensitively into a StatusId -// note: this method should only be used for API response data and not user input -func ParseStatusIDInsensitively(input string) (*StatusId, error) { - parser := resourceids.NewParserFromResourceIdType(&StatusId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StatusId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *StatusId) 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.ExperimentName, ok = input.Parsed["experimentName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "experimentName", input) - } - - if id.StatusId, ok = input.Parsed["statusId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "statusId", input) - } - - return nil -} - -// ValidateStatusID checks that 'input' can be parsed as a Status ID -func ValidateStatusID(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 := ParseStatusID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Status ID -func (id StatusId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Chaos/experiments/%s/statuses/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExperimentName, id.StatusId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Status ID -func (id StatusId) 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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticExperiments", "experiments", "experiments"), - resourceids.UserSpecifiedSegment("experimentName", "experimentValue"), - resourceids.StaticSegment("staticStatuses", "statuses", "statuses"), - resourceids.UserSpecifiedSegment("statusId", "statusIdValue"), - } -} - -// String returns a human-readable description of this Status ID -func (id StatusId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Experiment Name: %q", id.ExperimentName), - fmt.Sprintf("Status: %q", id.StatusId), - } - return fmt.Sprintf("Status (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status_test.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status_test.go deleted file mode 100644 index 4dafdc67099..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/id_status_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package experiments - -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 = &StatusId{} - -func TestNewStatusID(t *testing.T) { - id := NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue", "statusIdValue") - - 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.ExperimentName != "experimentValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExperimentName'", id.ExperimentName, "experimentValue") - } - - if id.StatusId != "statusIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'StatusId'", id.StatusId, "statusIdValue") - } -} - -func TestFormatStatusID(t *testing.T) { - actual := NewStatusID("12345678-1234-9876-4563-123456789012", "example-resource-group", "experimentValue", "statusIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses/statusIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseStatusID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StatusId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses/statusIdValue", - Expected: &StatusId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExperimentName: "experimentValue", - StatusId: "statusIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses/statusIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStatusID(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.ExperimentName != v.Expected.ExperimentName { - t.Fatalf("Expected %q but got %q for ExperimentName", v.Expected.ExperimentName, actual.ExperimentName) - } - - if actual.StatusId != v.Expected.StatusId { - t.Fatalf("Expected %q but got %q for StatusId", v.Expected.StatusId, actual.StatusId) - } - - } -} - -func TestParseStatusIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StatusId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/sTaTuSeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses/statusIdValue", - Expected: &StatusId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExperimentName: "experimentValue", - StatusId: "statusIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Chaos/experiments/experimentValue/statuses/statusIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/sTaTuSeS/sTaTuSiDvAlUe", - Expected: &StatusId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExperimentName: "eXpErImEnTvAlUe", - StatusId: "sTaTuSiDvAlUe", - }, - }, - { - // 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.cHaOs/eXpErImEnTs/eXpErImEnTvAlUe/sTaTuSeS/sTaTuSiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStatusIDInsensitively(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.ExperimentName != v.Expected.ExperimentName { - t.Fatalf("Expected %q but got %q for ExperimentName", v.Expected.ExperimentName, actual.ExperimentName) - } - - if actual.StatusId != v.Expected.StatusId { - t.Fatalf("Expected %q but got %q for StatusId", v.Expected.StatusId, actual.StatusId) - } - - } -} - -func TestSegmentsForStatusId(t *testing.T) { - segments := StatusId{}.Segments() - if len(segments) == 0 { - t.Fatalf("StatusId 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/chaosstudio/2023-04-15-preview/experiments/method_cancel.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_cancel.go deleted file mode 100644 index 8bf19a19b1e..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_cancel.go +++ /dev/null @@ -1,55 +0,0 @@ -package experiments - -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 CancelOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExperimentCancelOperationResult -} - -// Cancel ... -func (c ExperimentsClient) Cancel(ctx context.Context, id ExperimentId) (result CancelOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/cancel", 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 ExperimentCancelOperationResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_createorupdate.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_createorupdate.go deleted file mode 100644 index a1594c0e19e..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_createorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package experiments - -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 *Experiment -} - -// CreateOrUpdate ... -func (c ExperimentsClient) CreateOrUpdate(ctx context.Context, id ExperimentId, input Experiment) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Experiment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_delete.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_delete.go deleted file mode 100644 index f82a9171e8e..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package experiments - -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 ExperimentsClient) Delete(ctx context.Context, id ExperimentId) (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/chaosstudio/2023-04-15-preview/experiments/method_get.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_get.go deleted file mode 100644 index 92e7fb7c52a..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package experiments - -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 *Experiment -} - -// Get ... -func (c ExperimentsClient) Get(ctx context.Context, id ExperimentId) (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 Experiment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getexecutiondetails.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getexecutiondetails.go deleted file mode 100644 index 67ff69107ef..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getexecutiondetails.go +++ /dev/null @@ -1,54 +0,0 @@ -package experiments - -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 GetExecutionDetailsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExperimentExecutionDetails -} - -// GetExecutionDetails ... -func (c ExperimentsClient) GetExecutionDetails(ctx context.Context, id ExecutionDetailId) (result GetExecutionDetailsOperationResponse, 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 ExperimentExecutionDetails - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getstatus.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getstatus.go deleted file mode 100644 index 1bf7c03181f..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_getstatus.go +++ /dev/null @@ -1,54 +0,0 @@ -package experiments - -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 GetStatusOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExperimentStatus -} - -// GetStatus ... -func (c ExperimentsClient) GetStatus(ctx context.Context, id StatusId) (result GetStatusOperationResponse, 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 ExperimentStatus - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_list.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_list.go deleted file mode 100644 index fb9fa9b264a..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_list.go +++ /dev/null @@ -1,124 +0,0 @@ -package experiments - -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 *[]Experiment -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Experiment -} - -type ListOperationOptions struct { - ContinuationToken *string - Running *bool -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ContinuationToken != nil { - out.Append("continuationToken", fmt.Sprintf("%v", *o.ContinuationToken)) - } - if o.Running != nil { - out.Append("running", fmt.Sprintf("%v", *o.Running)) - } - return &out -} - -// List ... -func (c ExperimentsClient) List(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Chaos/experiments", id.ID()), - OptionsObject: options, - } - - 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 *[]Experiment `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 ExperimentsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, ExperimentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExperimentsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions, predicate ExperimentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Experiment, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/chaosstudio/2023-04-15-preview/experiments/method_listall.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listall.go deleted file mode 100644 index ac3dc1b5b33..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listall.go +++ /dev/null @@ -1,124 +0,0 @@ -package experiments - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Experiment -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []Experiment -} - -type ListAllOperationOptions struct { - ContinuationToken *string - Running *bool -} - -func DefaultListAllOperationOptions() ListAllOperationOptions { - return ListAllOperationOptions{} -} - -func (o ListAllOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListAllOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListAllOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ContinuationToken != nil { - out.Append("continuationToken", fmt.Sprintf("%v", *o.ContinuationToken)) - } - if o.Running != nil { - out.Append("running", fmt.Sprintf("%v", *o.Running)) - } - return &out -} - -// ListAll ... -func (c ExperimentsClient) ListAll(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Chaos/experiments", id.ID()), - OptionsObject: options, - } - - 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 *[]Experiment `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ExperimentsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, options, ExperimentOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExperimentsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListAllOperationOptions, predicate ExperimentOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]Experiment, 0) - - resp, err := c.ListAll(ctx, id, options) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listallstatuses.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listallstatuses.go deleted file mode 100644 index b70435e0d8d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listallstatuses.go +++ /dev/null @@ -1,91 +0,0 @@ -package experiments - -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 ListAllStatusesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ExperimentStatus -} - -type ListAllStatusesCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExperimentStatus -} - -// ListAllStatuses ... -func (c ExperimentsClient) ListAllStatuses(ctx context.Context, id ExperimentId) (result ListAllStatusesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/statuses", 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 *[]ExperimentStatus `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllStatusesComplete retrieves all the results into a single object -func (c ExperimentsClient) ListAllStatusesComplete(ctx context.Context, id ExperimentId) (ListAllStatusesCompleteResult, error) { - return c.ListAllStatusesCompleteMatchingPredicate(ctx, id, ExperimentStatusOperationPredicate{}) -} - -// ListAllStatusesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExperimentsClient) ListAllStatusesCompleteMatchingPredicate(ctx context.Context, id ExperimentId, predicate ExperimentStatusOperationPredicate) (result ListAllStatusesCompleteResult, err error) { - items := make([]ExperimentStatus, 0) - - resp, err := c.ListAllStatuses(ctx, id) - if err != nil { - 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 = ListAllStatusesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listexecutiondetails.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listexecutiondetails.go deleted file mode 100644 index b45e15585b2..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_listexecutiondetails.go +++ /dev/null @@ -1,91 +0,0 @@ -package experiments - -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 ListExecutionDetailsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ExperimentExecutionDetails -} - -type ListExecutionDetailsCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExperimentExecutionDetails -} - -// ListExecutionDetails ... -func (c ExperimentsClient) ListExecutionDetails(ctx context.Context, id ExperimentId) (result ListExecutionDetailsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/executionDetails", 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 *[]ExperimentExecutionDetails `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListExecutionDetailsComplete retrieves all the results into a single object -func (c ExperimentsClient) ListExecutionDetailsComplete(ctx context.Context, id ExperimentId) (ListExecutionDetailsCompleteResult, error) { - return c.ListExecutionDetailsCompleteMatchingPredicate(ctx, id, ExperimentExecutionDetailsOperationPredicate{}) -} - -// ListExecutionDetailsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExperimentsClient) ListExecutionDetailsCompleteMatchingPredicate(ctx context.Context, id ExperimentId, predicate ExperimentExecutionDetailsOperationPredicate) (result ListExecutionDetailsCompleteResult, err error) { - items := make([]ExperimentExecutionDetails, 0) - - resp, err := c.ListExecutionDetails(ctx, id) - if err != nil { - 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 = ListExecutionDetailsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_start.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_start.go deleted file mode 100644 index 09f189ecedd..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_start.go +++ /dev/null @@ -1,55 +0,0 @@ -package experiments - -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 StartOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExperimentStartOperationResult -} - -// Start ... -func (c ExperimentsClient) Start(ctx context.Context, id ExperimentId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - 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 - } - - var model ExperimentStartOperationResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_update.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_update.go deleted file mode 100644 index 205a39af9b4..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package experiments - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Experiment -} - -// Update ... -func (c ExperimentsClient) Update(ctx context.Context, id ExperimentId, input ExperimentUpdate) (result UpdateOperationResponse, 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 Experiment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_action.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_action.go deleted file mode 100644 index 1a02c7cd9e4..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_action.go +++ /dev/null @@ -1,69 +0,0 @@ -package experiments - -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 Action interface { -} - -// RawActionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawActionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalActionImplementation(input []byte) (Action, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Action into map[string]interface: %+v", err) - } - - value, ok := temp["type"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "continuous") { - var out ContinuousAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ContinuousAction: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "delay") { - var out DelayAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DelayAction: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "discrete") { - var out DiscreteAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DiscreteAction: %+v", err) - } - return out, nil - } - - out := RawActionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_actionstatus.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_actionstatus.go deleted file mode 100644 index 4a666eb2a4a..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_actionstatus.go +++ /dev/null @@ -1,43 +0,0 @@ -package experiments - -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 ActionStatus struct { - ActionId *string `json:"actionId,omitempty"` - ActionName *string `json:"actionName,omitempty"` - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - Targets *[]ExperimentExecutionActionTargetDetailsProperties `json:"targets,omitempty"` -} - -func (o *ActionStatus) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActionStatus) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *ActionStatus) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActionStatus) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branch.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branch.go deleted file mode 100644 index fca191b3c5b..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branch.go +++ /dev/null @@ -1,49 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Branch struct { - Actions []Action `json:"actions"` - Name string `json:"name"` -} - -var _ json.Unmarshaler = &Branch{} - -func (s *Branch) UnmarshalJSON(bytes []byte) error { - type alias Branch - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into Branch: %+v", err) - } - - s.Name = decoded.Name - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling Branch into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["actions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Actions into list []json.RawMessage: %+v", err) - } - - output := make([]Action, 0) - for i, val := range listTemp { - impl, err := unmarshalActionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Actions' for 'Branch': %+v", i, err) - } - output = append(output, impl) - } - s.Actions = output - } - return nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branchstatus.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branchstatus.go deleted file mode 100644 index d350c128f95..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_branchstatus.go +++ /dev/null @@ -1,11 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BranchStatus struct { - Actions *[]ActionStatus `json:"actions,omitempty"` - BranchId *string `json:"branchId,omitempty"` - BranchName *string `json:"branchName,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_continuousaction.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_continuousaction.go deleted file mode 100644 index f323d393ea0..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_continuousaction.go +++ /dev/null @@ -1,44 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Action = ContinuousAction{} - -type ContinuousAction struct { - Duration string `json:"duration"` - Parameters []KeyValuePair `json:"parameters"` - SelectorId string `json:"selectorId"` - - // Fields inherited from Action - Name string `json:"name"` -} - -var _ json.Marshaler = ContinuousAction{} - -func (s ContinuousAction) MarshalJSON() ([]byte, error) { - type wrapper ContinuousAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ContinuousAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ContinuousAction: %+v", err) - } - decoded["type"] = "continuous" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ContinuousAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_delayaction.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_delayaction.go deleted file mode 100644 index 59420382b38..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_delayaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Action = DelayAction{} - -type DelayAction struct { - Duration string `json:"duration"` - - // Fields inherited from Action - Name string `json:"name"` -} - -var _ json.Marshaler = DelayAction{} - -func (s DelayAction) MarshalJSON() ([]byte, error) { - type wrapper DelayAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DelayAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DelayAction: %+v", err) - } - decoded["type"] = "delay" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DelayAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_discreteaction.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_discreteaction.go deleted file mode 100644 index 7df537a2a57..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_discreteaction.go +++ /dev/null @@ -1,43 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Action = DiscreteAction{} - -type DiscreteAction struct { - Parameters []KeyValuePair `json:"parameters"` - SelectorId string `json:"selectorId"` - - // Fields inherited from Action - Name string `json:"name"` -} - -var _ json.Marshaler = DiscreteAction{} - -func (s DiscreteAction) MarshalJSON() ([]byte, error) { - type wrapper DiscreteAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DiscreteAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DiscreteAction: %+v", err) - } - decoded["type"] = "discrete" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DiscreteAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experiment.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experiment.go deleted file mode 100644 index b61e3184f3f..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experiment.go +++ /dev/null @@ -1,20 +0,0 @@ -package experiments - -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 Experiment struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemOrUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties ExperimentProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentcanceloperationresult.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentcanceloperationresult.go deleted file mode 100644 index c60df9bace8..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentcanceloperationresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentCancelOperationResult struct { - Name *string `json:"name,omitempty"` - StatusUrl *string `json:"statusUrl,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailserror.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailserror.go deleted file mode 100644 index ddb509c95f9..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailserror.go +++ /dev/null @@ -1,9 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentExecutionActionTargetDetailsError struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailsproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailsproperties.go deleted file mode 100644 index f9eb28e064d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutionactiontargetdetailsproperties.go +++ /dev/null @@ -1,42 +0,0 @@ -package experiments - -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 ExperimentExecutionActionTargetDetailsProperties struct { - Error *ExperimentExecutionActionTargetDetailsError `json:"error,omitempty"` - Status *string `json:"status,omitempty"` - Target *string `json:"target,omitempty"` - TargetCompletedTime *string `json:"targetCompletedTime,omitempty"` - TargetFailedTime *string `json:"targetFailedTime,omitempty"` -} - -func (o *ExperimentExecutionActionTargetDetailsProperties) GetTargetCompletedTimeAsTime() (*time.Time, error) { - if o.TargetCompletedTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TargetCompletedTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentExecutionActionTargetDetailsProperties) SetTargetCompletedTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TargetCompletedTime = &formatted -} - -func (o *ExperimentExecutionActionTargetDetailsProperties) GetTargetFailedTimeAsTime() (*time.Time, error) { - if o.TargetFailedTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TargetFailedTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentExecutionActionTargetDetailsProperties) SetTargetFailedTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TargetFailedTime = &formatted -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetails.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetails.go deleted file mode 100644 index a519ac5bbd1..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetails.go +++ /dev/null @@ -1,11 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentExecutionDetails struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExperimentExecutionDetailsProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailsproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailsproperties.go deleted file mode 100644 index 0e04f813e8c..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailsproperties.go +++ /dev/null @@ -1,69 +0,0 @@ -package experiments - -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 ExperimentExecutionDetailsProperties struct { - CreatedDateTime *string `json:"createdDateTime,omitempty"` - ExperimentId *string `json:"experimentId,omitempty"` - FailureReason *string `json:"failureReason,omitempty"` - LastActionDateTime *string `json:"lastActionDateTime,omitempty"` - RunInformation *ExperimentExecutionDetailsPropertiesRunInformation `json:"runInformation,omitempty"` - StartDateTime *string `json:"startDateTime,omitempty"` - Status *string `json:"status,omitempty"` - StopDateTime *string `json:"stopDateTime,omitempty"` -} - -func (o *ExperimentExecutionDetailsProperties) GetCreatedDateTimeAsTime() (*time.Time, error) { - if o.CreatedDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentExecutionDetailsProperties) SetCreatedDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateTime = &formatted -} - -func (o *ExperimentExecutionDetailsProperties) GetLastActionDateTimeAsTime() (*time.Time, error) { - if o.LastActionDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastActionDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentExecutionDetailsProperties) SetLastActionDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastActionDateTime = &formatted -} - -func (o *ExperimentExecutionDetailsProperties) GetStartDateTimeAsTime() (*time.Time, error) { - if o.StartDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentExecutionDetailsProperties) SetStartDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartDateTime = &formatted -} - -func (o *ExperimentExecutionDetailsProperties) GetStopDateTimeAsTime() (*time.Time, error) { - if o.StopDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StopDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentExecutionDetailsProperties) SetStopDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StopDateTime = &formatted -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailspropertiesruninformation.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailspropertiesruninformation.go deleted file mode 100644 index d82c701f77b..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentexecutiondetailspropertiesruninformation.go +++ /dev/null @@ -1,8 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentExecutionDetailsPropertiesRunInformation struct { - Steps *[]StepStatus `json:"steps,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentproperties.go deleted file mode 100644 index e76582a4371..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentproperties.go +++ /dev/null @@ -1,51 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentProperties struct { - Selectors []Selector `json:"selectors"` - StartOnCreation *bool `json:"startOnCreation,omitempty"` - Steps []Step `json:"steps"` -} - -var _ json.Unmarshaler = &ExperimentProperties{} - -func (s *ExperimentProperties) UnmarshalJSON(bytes []byte) error { - type alias ExperimentProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into ExperimentProperties: %+v", err) - } - - s.StartOnCreation = decoded.StartOnCreation - s.Steps = decoded.Steps - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling ExperimentProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["selectors"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Selectors into list []json.RawMessage: %+v", err) - } - - output := make([]Selector, 0) - for i, val := range listTemp { - impl, err := unmarshalSelectorImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Selectors' for 'ExperimentProperties': %+v", i, err) - } - output = append(output, impl) - } - s.Selectors = output - } - return nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstartoperationresult.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstartoperationresult.go deleted file mode 100644 index fcc0a0a6e27..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstartoperationresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentStartOperationResult struct { - Name *string `json:"name,omitempty"` - StatusUrl *string `json:"statusUrl,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatus.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatus.go deleted file mode 100644 index 487375fb807..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatus.go +++ /dev/null @@ -1,11 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentStatus struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExperimentStatusProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatusproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatusproperties.go deleted file mode 100644 index 19252a07126..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentstatusproperties.go +++ /dev/null @@ -1,40 +0,0 @@ -package experiments - -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 ExperimentStatusProperties struct { - CreatedDateUtc *string `json:"createdDateUtc,omitempty"` - EndDateUtc *string `json:"endDateUtc,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *ExperimentStatusProperties) GetCreatedDateUtcAsTime() (*time.Time, error) { - if o.CreatedDateUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentStatusProperties) SetCreatedDateUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUtc = &formatted -} - -func (o *ExperimentStatusProperties) GetEndDateUtcAsTime() (*time.Time, error) { - if o.EndDateUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndDateUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ExperimentStatusProperties) SetEndDateUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndDateUtc = &formatted -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentupdate.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentupdate.go deleted file mode 100644 index 965b4a08d48..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_experimentupdate.go +++ /dev/null @@ -1,12 +0,0 @@ -package experiments - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentUpdate struct { - Identity *identity.SystemOrUserAssignedMap `json:"identity,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_filter.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_filter.go deleted file mode 100644 index 2ad944f2346..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_filter.go +++ /dev/null @@ -1,53 +0,0 @@ -package experiments - -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 Filter interface { -} - -// RawFilterImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawFilterImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalFilterImplementation(input []byte) (Filter, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Filter into map[string]interface: %+v", err) - } - - value, ok := temp["type"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Simple") { - var out SimpleFilter - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SimpleFilter: %+v", err) - } - return out, nil - } - - out := RawFilterImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_keyvaluepair.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_keyvaluepair.go deleted file mode 100644 index 2c564092367..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_keyvaluepair.go +++ /dev/null @@ -1,9 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyValuePair struct { - Key string `json:"key"` - Value string `json:"value"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_listselector.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_listselector.go deleted file mode 100644 index e55a65ae39c..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_listselector.go +++ /dev/null @@ -1,70 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Selector = ListSelector{} - -type ListSelector struct { - Targets []TargetReference `json:"targets"` - - // Fields inherited from Selector - Filter Filter `json:"filter"` - Id string `json:"id"` -} - -var _ json.Marshaler = ListSelector{} - -func (s ListSelector) MarshalJSON() ([]byte, error) { - type wrapper ListSelector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ListSelector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ListSelector: %+v", err) - } - decoded["type"] = "List" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ListSelector: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &ListSelector{} - -func (s *ListSelector) UnmarshalJSON(bytes []byte) error { - type alias ListSelector - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into ListSelector: %+v", err) - } - - s.Id = decoded.Id - s.Targets = decoded.Targets - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling ListSelector into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["filter"]; ok { - impl, err := unmarshalFilterImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Filter' for 'ListSelector': %+v", err) - } - s.Filter = impl - } - return nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_queryselector.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_queryselector.go deleted file mode 100644 index 32d8ce0331b..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_queryselector.go +++ /dev/null @@ -1,72 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Selector = QuerySelector{} - -type QuerySelector struct { - QueryString string `json:"queryString"` - SubscriptionIds []string `json:"subscriptionIds"` - - // Fields inherited from Selector - Filter Filter `json:"filter"` - Id string `json:"id"` -} - -var _ json.Marshaler = QuerySelector{} - -func (s QuerySelector) MarshalJSON() ([]byte, error) { - type wrapper QuerySelector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling QuerySelector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling QuerySelector: %+v", err) - } - decoded["type"] = "Query" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling QuerySelector: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &QuerySelector{} - -func (s *QuerySelector) UnmarshalJSON(bytes []byte) error { - type alias QuerySelector - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into QuerySelector: %+v", err) - } - - s.Id = decoded.Id - s.QueryString = decoded.QueryString - s.SubscriptionIds = decoded.SubscriptionIds - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling QuerySelector into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["filter"]; ok { - impl, err := unmarshalFilterImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Filter' for 'QuerySelector': %+v", err) - } - s.Filter = impl - } - return nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_selector.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_selector.go deleted file mode 100644 index 03f67eca833..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_selector.go +++ /dev/null @@ -1,61 +0,0 @@ -package experiments - -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 Selector interface { -} - -// RawSelectorImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSelectorImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalSelectorImplementation(input []byte) (Selector, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Selector into map[string]interface: %+v", err) - } - - value, ok := temp["type"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "List") { - var out ListSelector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ListSelector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Query") { - var out QuerySelector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into QuerySelector: %+v", err) - } - return out, nil - } - - out := RawSelectorImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilter.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilter.go deleted file mode 100644 index f8de91d5e03..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilter.go +++ /dev/null @@ -1,41 +0,0 @@ -package experiments - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Filter = SimpleFilter{} - -type SimpleFilter struct { - Parameters *SimpleFilterParameters `json:"parameters,omitempty"` - - // Fields inherited from Filter -} - -var _ json.Marshaler = SimpleFilter{} - -func (s SimpleFilter) MarshalJSON() ([]byte, error) { - type wrapper SimpleFilter - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SimpleFilter: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SimpleFilter: %+v", err) - } - decoded["type"] = "Simple" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SimpleFilter: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilterparameters.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilterparameters.go deleted file mode 100644 index a69b07a3e68..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_simplefilterparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SimpleFilterParameters struct { - Zones *[]string `json:"zones,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_step.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_step.go deleted file mode 100644 index 791521bad2f..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_step.go +++ /dev/null @@ -1,9 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Step struct { - Branches []Branch `json:"branches"` - Name string `json:"name"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_stepstatus.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_stepstatus.go deleted file mode 100644 index f24804ea7f1..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_stepstatus.go +++ /dev/null @@ -1,11 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StepStatus struct { - Branches *[]BranchStatus `json:"branches,omitempty"` - Status *string `json:"status,omitempty"` - StepId *string `json:"stepId,omitempty"` - StepName *string `json:"stepName,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_targetreference.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_targetreference.go deleted file mode 100644 index 5c13b2cadc2..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/model_targetreference.go +++ /dev/null @@ -1,9 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TargetReference struct { - Id string `json:"id"` - Type TargetReferenceType `json:"type"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/experiments/predicates.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/predicates.go deleted file mode 100644 index c986cc9cb77..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/predicates.go +++ /dev/null @@ -1,78 +0,0 @@ -package experiments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExperimentOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ExperimentOperationPredicate) Matches(input Experiment) 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 -} - -type ExperimentExecutionDetailsOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ExperimentExecutionDetailsOperationPredicate) Matches(input ExperimentExecutionDetails) 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 ExperimentStatusOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ExperimentStatusOperationPredicate) Matches(input ExperimentStatus) 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/chaosstudio/2023-04-15-preview/experiments/version.go b/resource-manager/chaosstudio/2023-04-15-preview/experiments/version.go deleted file mode 100644 index f457116fe08..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/experiments/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package experiments - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-15-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/experiments/%s", defaultApiVersion) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/README.md b/resource-manager/chaosstudio/2023-04-15-preview/targets/README.md deleted file mode 100644 index f7f1ba139fd..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/README.md +++ /dev/null @@ -1,91 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/targets` Documentation - -The `targets` SDK allows for interaction with the Azure Resource Manager Service `chaosstudio` (API Version `2023-04-15-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/targets" -``` - - -### Client Initialization - -```go -client := targets.NewTargetsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `TargetsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue") - -payload := targets.Target{ - // ... -} - - -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: `TargetsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue") - -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: `TargetsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewChaosStudioTargetID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "targetValue") - -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: `TargetsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// alternatively `client.List(ctx, id, targets.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, targets.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/client.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/client.go deleted file mode 100644 index 4fa378b2dbc..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package targets - -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 TargetsClient struct { - Client *resourcemanager.Client -} - -func NewTargetsClientWithBaseURI(sdkApi sdkEnv.Api) (*TargetsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "targets", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating TargetsClient: %+v", err) - } - - return &TargetsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_createorupdate.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/method_createorupdate.go deleted file mode 100644 index 7eeb7528da3..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package targets - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Target -} - -// CreateOrUpdate ... -func (c TargetsClient) CreateOrUpdate(ctx context.Context, id commonids.ChaosStudioTargetId, input Target) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Target - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_delete.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/method_delete.go deleted file mode 100644 index 0b5645f6bd2..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_delete.go +++ /dev/null @@ -1,48 +0,0 @@ -package targets - -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 DeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c TargetsClient) Delete(ctx context.Context, id commonids.ChaosStudioTargetId) (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/chaosstudio/2023-04-15-preview/targets/method_get.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/method_get.go deleted file mode 100644 index e16ab315976..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package targets - -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 *Target -} - -// Get ... -func (c TargetsClient) Get(ctx context.Context, id commonids.ChaosStudioTargetId) (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 Target - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_list.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/method_list.go deleted file mode 100644 index 3fed8bc2f9f..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/method_list.go +++ /dev/null @@ -1,120 +0,0 @@ -package targets - -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 *[]Target -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Target -} - -type ListOperationOptions struct { - ContinuationToken *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ContinuationToken != nil { - out.Append("continuationToken", fmt.Sprintf("%v", *o.ContinuationToken)) - } - return &out -} - -// List ... -func (c TargetsClient) List(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Chaos/targets", id.ID()), - OptionsObject: options, - } - - 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 *[]Target `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 TargetsClient) ListComplete(ctx context.Context, id commonids.ScopeId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, TargetOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c TargetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, options ListOperationOptions, predicate TargetOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Target, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/chaosstudio/2023-04-15-preview/targets/model_target.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/model_target.go deleted file mode 100644 index 92e4e94254d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/model_target.go +++ /dev/null @@ -1,17 +0,0 @@ -package targets - -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 Target struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties interface{} `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/predicates.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/predicates.go deleted file mode 100644 index d3325e9406e..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package targets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TargetOperationPredicate struct { - Id *string - Location *string - Name *string - Properties *interface{} - Type *string -} - -func (p TargetOperationPredicate) Matches(input Target) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.Location == nil || *p.Location != *input.Location) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - if p.Properties != nil && *p.Properties != input.Properties { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targets/version.go b/resource-manager/chaosstudio/2023-04-15-preview/targets/version.go deleted file mode 100644 index 3ee9998b81f..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targets/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package targets - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-15-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/targets/%s", defaultApiVersion) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/README.md b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/README.md deleted file mode 100644 index 2fb1ef8b2ca..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/chaosstudio/2023-04-15-preview/targettypes` Documentation - -The `targettypes` SDK allows for interaction with the Azure Resource Manager Service `chaosstudio` (API Version `2023-04-15-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/chaosstudio/2023-04-15-preview/targettypes" -``` - - -### Client Initialization - -```go -client := targettypes.NewTargetTypesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `TargetTypesClient.Get` - -```go -ctx := context.TODO() -id := targettypes.NewTargetTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue") - -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: `TargetTypesClient.List` - -```go -ctx := context.TODO() -id := targettypes.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.List(ctx, id, targettypes.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, targettypes.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/client.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/client.go deleted file mode 100644 index ab93296dfcb..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package targettypes - -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 TargetTypesClient struct { - Client *resourcemanager.Client -} - -func NewTargetTypesClientWithBaseURI(sdkApi sdkEnv.Api) (*TargetTypesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "targettypes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating TargetTypesClient: %+v", err) - } - - return &TargetTypesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location.go deleted file mode 100644 index ff2ac33008d..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package targettypes - -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.Chaos/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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/chaosstudio/2023-04-15-preview/targettypes/id_location_test.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location_test.go deleted file mode 100644 index e4b781e35a4..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package targettypes - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue" - 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/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/chaosstudio/2023-04-15-preview/targettypes/id_targettype.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype.go deleted file mode 100644 index 0c73bed2e05..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype.go +++ /dev/null @@ -1,130 +0,0 @@ -package targettypes - -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(&TargetTypeId{}) -} - -var _ resourceids.ResourceId = &TargetTypeId{} - -// TargetTypeId is a struct representing the Resource ID for a Target Type -type TargetTypeId struct { - SubscriptionId string - LocationName string - TargetTypeName string -} - -// NewTargetTypeID returns a new TargetTypeId struct -func NewTargetTypeID(subscriptionId string, locationName string, targetTypeName string) TargetTypeId { - return TargetTypeId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - TargetTypeName: targetTypeName, - } -} - -// ParseTargetTypeID parses 'input' into a TargetTypeId -func ParseTargetTypeID(input string) (*TargetTypeId, error) { - parser := resourceids.NewParserFromResourceIdType(&TargetTypeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TargetTypeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseTargetTypeIDInsensitively parses 'input' case-insensitively into a TargetTypeId -// note: this method should only be used for API response data and not user input -func ParseTargetTypeIDInsensitively(input string) (*TargetTypeId, error) { - parser := resourceids.NewParserFromResourceIdType(&TargetTypeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TargetTypeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *TargetTypeId) 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.TargetTypeName, ok = input.Parsed["targetTypeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "targetTypeName", input) - } - - return nil -} - -// ValidateTargetTypeID checks that 'input' can be parsed as a Target Type ID -func ValidateTargetTypeID(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 := ParseTargetTypeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Target Type ID -func (id TargetTypeId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Chaos/locations/%s/targetTypes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.TargetTypeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Target Type ID -func (id TargetTypeId) 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("staticMicrosoftChaos", "Microsoft.Chaos", "Microsoft.Chaos"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - resourceids.StaticSegment("staticTargetTypes", "targetTypes", "targetTypes"), - resourceids.UserSpecifiedSegment("targetTypeName", "targetTypeValue"), - } -} - -// String returns a human-readable description of this Target Type ID -func (id TargetTypeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - fmt.Sprintf("Target Type Name: %q", id.TargetTypeName), - } - return fmt.Sprintf("Target Type (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype_test.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype_test.go deleted file mode 100644 index 0af94ccfd26..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/id_targettype_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package targettypes - -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 = &TargetTypeId{} - -func TestNewTargetTypeID(t *testing.T) { - id := NewTargetTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } - - if id.TargetTypeName != "targetTypeValue" { - t.Fatalf("Expected %q but got %q for Segment 'TargetTypeName'", id.TargetTypeName, "targetTypeValue") - } -} - -func TestFormatTargetTypeID(t *testing.T) { - actual := NewTargetTypeID("12345678-1234-9876-4563-123456789012", "locationValue", "targetTypeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseTargetTypeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TargetTypeId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue", - Expected: &TargetTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - TargetTypeName: "targetTypeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTargetTypeID(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.TargetTypeName != v.Expected.TargetTypeName { - t.Fatalf("Expected %q but got %q for TargetTypeName", v.Expected.TargetTypeName, actual.TargetTypeName) - } - - } -} - -func TestParseTargetTypeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TargetTypeId - }{ - { - // 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.Chaos", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue", - Expected: &TargetTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - TargetTypeName: "targetTypeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Chaos/locations/locationValue/targetTypes/targetTypeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe", - Expected: &TargetTypeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - TargetTypeName: "tArGeTtYpEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cHaOs/lOcAtIoNs/lOcAtIoNvAlUe/tArGeTtYpEs/tArGeTtYpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTargetTypeIDInsensitively(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.TargetTypeName != v.Expected.TargetTypeName { - t.Fatalf("Expected %q but got %q for TargetTypeName", v.Expected.TargetTypeName, actual.TargetTypeName) - } - - } -} - -func TestSegmentsForTargetTypeId(t *testing.T) { - segments := TargetTypeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("TargetTypeId 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/chaosstudio/2023-04-15-preview/targettypes/method_get.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_get.go deleted file mode 100644 index 6ff56a33ce6..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package targettypes - -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 *TargetType -} - -// Get ... -func (c TargetTypesClient) Get(ctx context.Context, id TargetTypeId) (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 TargetType - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_list.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_list.go deleted file mode 100644 index 3aed30bcc1f..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package targettypes - -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 *[]TargetType -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []TargetType -} - -type ListOperationOptions struct { - ContinuationToken *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ContinuationToken != nil { - out.Append("continuationToken", fmt.Sprintf("%v", *o.ContinuationToken)) - } - return &out -} - -// List ... -func (c TargetTypesClient) List(ctx context.Context, id LocationId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/targetTypes", id.ID()), - OptionsObject: options, - } - - 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 *[]TargetType `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 TargetTypesClient) ListComplete(ctx context.Context, id LocationId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, TargetTypeOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c TargetTypesClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, options ListOperationOptions, predicate TargetTypeOperationPredicate) (result ListCompleteResult, err error) { - items := make([]TargetType, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/chaosstudio/2023-04-15-preview/targettypes/model_targettype.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettype.go deleted file mode 100644 index 8572edd35e4..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettype.go +++ /dev/null @@ -1,17 +0,0 @@ -package targettypes - -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 TargetType struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties TargetTypeProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettypeproperties.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettypeproperties.go deleted file mode 100644 index aa3a5e69fdd..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/model_targettypeproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package targettypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TargetTypeProperties struct { - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - PropertiesSchema *string `json:"propertiesSchema,omitempty"` - ResourceTypes *[]string `json:"resourceTypes,omitempty"` -} diff --git a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/predicates.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/predicates.go deleted file mode 100644 index 2e7238df56b..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package targettypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TargetTypeOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p TargetTypeOperationPredicate) Matches(input TargetType) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/chaosstudio/2023-04-15-preview/targettypes/version.go b/resource-manager/chaosstudio/2023-04-15-preview/targettypes/version.go deleted file mode 100644 index e59b6041176..00000000000 --- a/resource-manager/chaosstudio/2023-04-15-preview/targettypes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package targettypes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-15-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/targettypes/%s", defaultApiVersion) -} diff --git a/resource-manager/connectedvmware/2023-12-01/client.go b/resource-manager/connectedvmware/2023-12-01/client.go new file mode 100644 index 00000000000..0ea5faa80c9 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/client.go @@ -0,0 +1,118 @@ +package v2023_12_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/connectedvmware/2023-12-01/clusters" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/datastores" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/hosts" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/inventoryitems" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/resourcepools" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/vcenters" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/virtualnetworks" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents" + "github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + Clusters *clusters.ClustersClient + DataStores *datastores.DataStoresClient + Hosts *hosts.HostsClient + InventoryItems *inventoryitems.InventoryItemsClient + ResourcePools *resourcepools.ResourcePoolsClient + VCenters *vcenters.VCentersClient + VMInstanceGuestAgents *vminstanceguestagents.VMInstanceGuestAgentsClient + VMInstanceHybridIdentityMetadata *vminstancehybrididentitymetadata.VMInstanceHybridIdentityMetadataClient + VirtualMachineInstances *virtualmachineinstances.VirtualMachineInstancesClient + VirtualMachineTemplates *virtualmachinetemplates.VirtualMachineTemplatesClient + VirtualNetworks *virtualnetworks.VirtualNetworksClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + clustersClient, err := clusters.NewClustersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Clusters client: %+v", err) + } + configureFunc(clustersClient.Client) + + dataStoresClient, err := datastores.NewDataStoresClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DataStores client: %+v", err) + } + configureFunc(dataStoresClient.Client) + + hostsClient, err := hosts.NewHostsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Hosts client: %+v", err) + } + configureFunc(hostsClient.Client) + + inventoryItemsClient, err := inventoryitems.NewInventoryItemsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building InventoryItems client: %+v", err) + } + configureFunc(inventoryItemsClient.Client) + + resourcePoolsClient, err := resourcepools.NewResourcePoolsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ResourcePools client: %+v", err) + } + configureFunc(resourcePoolsClient.Client) + + vCentersClient, err := vcenters.NewVCentersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VCenters client: %+v", err) + } + configureFunc(vCentersClient.Client) + + vMInstanceGuestAgentsClient, err := vminstanceguestagents.NewVMInstanceGuestAgentsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VMInstanceGuestAgents client: %+v", err) + } + configureFunc(vMInstanceGuestAgentsClient.Client) + + vMInstanceHybridIdentityMetadataClient, err := vminstancehybrididentitymetadata.NewVMInstanceHybridIdentityMetadataClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VMInstanceHybridIdentityMetadata client: %+v", err) + } + configureFunc(vMInstanceHybridIdentityMetadataClient.Client) + + virtualMachineInstancesClient, err := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualMachineInstances client: %+v", err) + } + configureFunc(virtualMachineInstancesClient.Client) + + virtualMachineTemplatesClient, err := virtualmachinetemplates.NewVirtualMachineTemplatesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualMachineTemplates client: %+v", err) + } + configureFunc(virtualMachineTemplatesClient.Client) + + virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) + } + configureFunc(virtualNetworksClient.Client) + + return &Client{ + Clusters: clustersClient, + DataStores: dataStoresClient, + Hosts: hostsClient, + InventoryItems: inventoryItemsClient, + ResourcePools: resourcePoolsClient, + VCenters: vCentersClient, + VMInstanceGuestAgents: vMInstanceGuestAgentsClient, + VMInstanceHybridIdentityMetadata: vMInstanceHybridIdentityMetadataClient, + VirtualMachineInstances: virtualMachineInstancesClient, + VirtualMachineTemplates: virtualMachineTemplatesClient, + VirtualNetworks: virtualNetworksClient, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/README.md b/resource-manager/connectedvmware/2023-12-01/clusters/README.md new file mode 100644 index 00000000000..7e287fe1c29 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/clusters` Documentation + +The `clusters` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/clusters" +``` + + +### Client Initialization + +```go +client := clusters.NewClustersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ClustersClient.Create` + +```go +ctx := context.TODO() +id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") + +payload := clusters.Cluster{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ClustersClient.Delete` + +```go +ctx := context.TODO() +id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") + +if err := client.DeleteThenPoll(ctx, id, clusters.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ClustersClient.Get` + +```go +ctx := context.TODO() +id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") + +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: `ClustersClient.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: `ClustersClient.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: `ClustersClient.Update` + +```go +ctx := context.TODO() +id := clusters.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") + +payload := clusters.ResourcePatch{ + // ... +} + + +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/azurestackhci/2023-08-01-preview/clusters/client.go b/resource-manager/connectedvmware/2023-12-01/clusters/client.go similarity index 100% rename from resource-manager/azurestackhci/2023-08-01-preview/clusters/client.go rename to resource-manager/connectedvmware/2023-12-01/clusters/client.go diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/constants.go b/resource-manager/connectedvmware/2023-12-01/clusters/constants.go new file mode 100644 index 00000000000..f10a62dbf55 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/constants.go @@ -0,0 +1,69 @@ +package clusters + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/id_cluster.go b/resource-manager/connectedvmware/2023-12-01/clusters/id_cluster.go new file mode 100644 index 00000000000..ccbaf362f6d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/id_cluster.go @@ -0,0 +1,130 @@ +package clusters + +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(&ClusterId{}) +} + +var _ resourceids.ResourceId = &ClusterId{} + +// ClusterId is a struct representing the Resource ID for a Cluster +type ClusterId struct { + SubscriptionId string + ResourceGroupName string + ClusterName string +} + +// NewClusterID returns a new ClusterId struct +func NewClusterID(subscriptionId string, resourceGroupName string, clusterName string) ClusterId { + return ClusterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ClusterName: clusterName, + } +} + +// ParseClusterID parses 'input' into a ClusterId +func ParseClusterID(input string) (*ClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ClusterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId +// note: this method should only be used for API response data and not user input +func ParseClusterIDInsensitively(input string) (*ClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ClusterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ClusterId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) + } + + return nil +} + +// ValidateClusterID checks that 'input' can be parsed as a Cluster ID +func ValidateClusterID(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 := ParseClusterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cluster ID +func (id ClusterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/clusters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cluster ID +func (id ClusterId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticClusters", "clusters", "clusters"), + resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), + } +} + +// String returns a human-readable description of this Cluster ID +func (id ClusterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cluster Name: %q", id.ClusterName), + } + return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/id_cluster_test.go b/resource-manager/connectedvmware/2023-12-01/clusters/id_cluster_test.go new file mode 100644 index 00000000000..263f9ae9928 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/id_cluster_test.go @@ -0,0 +1,282 @@ +package clusters + +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 = &ClusterId{} + +func TestNewClusterID(t *testing.T) { + id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") + + 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.ClusterName != "clusterValue" { + t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") + } +} + +func TestFormatClusterID(t *testing.T) { + actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters/clusterValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseClusterID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ClusterId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters/clusterValue", + Expected: &ClusterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ClusterName: "clusterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters/clusterValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseClusterID(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.ClusterName != v.Expected.ClusterName { + t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) + } + + } +} + +func TestParseClusterIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ClusterId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/cLuStErS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters/clusterValue", + Expected: &ClusterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ClusterName: "clusterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/clusters/clusterValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/cLuStErS/cLuStErVaLuE", + Expected: &ClusterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ClusterName: "cLuStErVaLuE", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/cLuStErS/cLuStErVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseClusterIDInsensitively(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.ClusterName != v.Expected.ClusterName { + t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) + } + + } +} + +func TestSegmentsForClusterId(t *testing.T) { + segments := ClusterId{}.Segments() + if len(segments) == 0 { + t.Fatalf("ClusterId 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/connectedvmware/2023-12-01/clusters/method_create.go b/resource-manager/connectedvmware/2023-12-01/clusters/method_create.go new file mode 100644 index 00000000000..ce27f1d6d2f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/method_create.go @@ -0,0 +1,75 @@ +package clusters + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// Create ... +func (c ClustersClient) Create(ctx context.Context, id ClusterId, input Cluster) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c ClustersClient) CreateThenPoll(ctx context.Context, id ClusterId, input Cluster) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/method_delete.go b/resource-manager/connectedvmware/2023-12-01/clusters/method_delete.go new file mode 100644 index 00000000000..b135bc37328 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/method_delete.go @@ -0,0 +1,99 @@ +package clusters + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 ClustersClient) Delete(ctx context.Context, id ClusterId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 ClustersClient) DeleteThenPoll(ctx context.Context, id ClusterId, 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/azurestackhci/2023-08-01-preview/clusters/method_get.go b/resource-manager/connectedvmware/2023-12-01/clusters/method_get.go similarity index 100% rename from resource-manager/azurestackhci/2023-08-01-preview/clusters/method_get.go rename to resource-manager/connectedvmware/2023-12-01/clusters/method_get.go diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/method_list.go b/resource-manager/connectedvmware/2023-12-01/clusters/method_list.go new file mode 100644 index 00000000000..94055a56031 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/method_list.go @@ -0,0 +1,92 @@ +package clusters + +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 *[]Cluster +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Cluster +} + +// List ... +func (c ClustersClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/clusters", 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 *[]Cluster `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 ClustersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ClustersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ClusterOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Cluster, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/clusters/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/clusters/method_listbyresourcegroup.go new file mode 100644 index 00000000000..6ffd75cacfb --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package clusters + +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 *[]Cluster +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []Cluster +} + +// ListByResourceGroup ... +func (c ClustersClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/clusters", 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 *[]Cluster `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 ClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ClusterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Cluster, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/clusters/method_update.go b/resource-manager/connectedvmware/2023-12-01/clusters/method_update.go new file mode 100644 index 00000000000..f6061c7bbf9 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/method_update.go @@ -0,0 +1,58 @@ +package clusters + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// Update ... +func (c ClustersClient) Update(ctx context.Context, id ClusterId, input ResourcePatch) (result UpdateOperationResponse, 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 Cluster + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/model_cluster.go b/resource-manager/connectedvmware/2023-12-01/clusters/model_cluster.go new file mode 100644 index 00000000000..e66fe949e75 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/model_cluster.go @@ -0,0 +1,20 @@ +package clusters + +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 Cluster struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties ClusterProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/model_clusterproperties.go b/resource-manager/connectedvmware/2023-12-01/clusters/model_clusterproperties.go new file mode 100644 index 00000000000..07350c798e1 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/model_clusterproperties.go @@ -0,0 +1,21 @@ +package clusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterProperties struct { + CustomResourceName *string `json:"customResourceName,omitempty"` + DatastoreIds *[]string `json:"datastoreIds,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + NetworkIds *[]string `json:"networkIds,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + TotalCPUMHz *int64 `json:"totalCpuMHz,omitempty"` + TotalMemoryGB *int64 `json:"totalMemoryGB,omitempty"` + UsedCPUMHz *int64 `json:"usedCpuMHz,omitempty"` + UsedMemoryGB *int64 `json:"usedMemoryGB,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/clusters/model_extendedlocation.go new file mode 100644 index 00000000000..57c160850ba --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/model_extendedlocation.go @@ -0,0 +1,9 @@ +package clusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/clusters/model_resourcepatch.go new file mode 100644 index 00000000000..0feb63142e2 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/model_resourcepatch.go @@ -0,0 +1,8 @@ +package clusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/clusters/model_resourcestatus.go new file mode 100644 index 00000000000..26e8be1ce04 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/model_resourcestatus.go @@ -0,0 +1,31 @@ +package clusters + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/clusters/predicates.go b/resource-manager/connectedvmware/2023-12-01/clusters/predicates.go new file mode 100644 index 00000000000..f697676777a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/predicates.go @@ -0,0 +1,37 @@ +package clusters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p ClusterOperationPredicate) Matches(input Cluster) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/clusters/version.go b/resource-manager/connectedvmware/2023-12-01/clusters/version.go new file mode 100644 index 00000000000..1aecef56a8d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/clusters/version.go @@ -0,0 +1,12 @@ +package clusters + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/clusters/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/README.md b/resource-manager/connectedvmware/2023-12-01/datastores/README.md new file mode 100644 index 00000000000..c82996b853e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/datastores` Documentation + +The `datastores` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/datastores" +``` + + +### Client Initialization + +```go +client := datastores.NewDataStoresClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DataStoresClient.Create` + +```go +ctx := context.TODO() +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreValue") + +payload := datastores.Datastore{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DataStoresClient.Delete` + +```go +ctx := context.TODO() +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreValue") + +if err := client.DeleteThenPoll(ctx, id, datastores.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `DataStoresClient.Get` + +```go +ctx := context.TODO() +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreValue") + +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: `DataStoresClient.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: `DataStoresClient.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: `DataStoresClient.Update` + +```go +ctx := context.TODO() +id := datastores.NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreValue") + +payload := datastores.ResourcePatch{ + // ... +} + + +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/connectedvmware/2023-12-01/datastores/client.go b/resource-manager/connectedvmware/2023-12-01/datastores/client.go new file mode 100644 index 00000000000..02d0d9669e0 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/client.go @@ -0,0 +1,26 @@ +package datastores + +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 DataStoresClient struct { + Client *resourcemanager.Client +} + +func NewDataStoresClientWithBaseURI(sdkApi sdkEnv.Api) (*DataStoresClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "datastores", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DataStoresClient: %+v", err) + } + + return &DataStoresClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/constants.go b/resource-manager/connectedvmware/2023-12-01/datastores/constants.go new file mode 100644 index 00000000000..c5c2dfe83f6 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/constants.go @@ -0,0 +1,69 @@ +package datastores + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go new file mode 100644 index 00000000000..4fda75496d0 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore.go @@ -0,0 +1,130 @@ +package datastores + +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(&DataStoreId{}) +} + +var _ resourceids.ResourceId = &DataStoreId{} + +// DataStoreId is a struct representing the Resource ID for a Data Store +type DataStoreId struct { + SubscriptionId string + ResourceGroupName string + DataStoreName string +} + +// NewDataStoreID returns a new DataStoreId struct +func NewDataStoreID(subscriptionId string, resourceGroupName string, dataStoreName string) DataStoreId { + return DataStoreId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DataStoreName: dataStoreName, + } +} + +// ParseDataStoreID parses 'input' into a DataStoreId +func ParseDataStoreID(input string) (*DataStoreId, error) { + parser := resourceids.NewParserFromResourceIdType(&DataStoreId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DataStoreId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDataStoreIDInsensitively parses 'input' case-insensitively into a DataStoreId +// note: this method should only be used for API response data and not user input +func ParseDataStoreIDInsensitively(input string) (*DataStoreId, error) { + parser := resourceids.NewParserFromResourceIdType(&DataStoreId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DataStoreId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DataStoreId) 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.DataStoreName, ok = input.Parsed["dataStoreName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "dataStoreName", input) + } + + return nil +} + +// ValidateDataStoreID checks that 'input' can be parsed as a Data Store ID +func ValidateDataStoreID(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 := ParseDataStoreID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Data Store ID +func (id DataStoreId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/dataStores/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DataStoreName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Data Store ID +func (id DataStoreId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticDataStores", "dataStores", "dataStores"), + resourceids.UserSpecifiedSegment("dataStoreName", "dataStoreValue"), + } +} + +// String returns a human-readable description of this Data Store ID +func (id DataStoreId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Data Store Name: %q", id.DataStoreName), + } + return fmt.Sprintf("Data Store (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go new file mode 100644 index 00000000000..98a133be22a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/id_datastore_test.go @@ -0,0 +1,282 @@ +package datastores + +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 = &DataStoreId{} + +func TestNewDataStoreID(t *testing.T) { + id := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreValue") + + 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.DataStoreName != "dataStoreValue" { + t.Fatalf("Expected %q but got %q for Segment 'DataStoreName'", id.DataStoreName, "dataStoreValue") + } +} + +func TestFormatDataStoreID(t *testing.T) { + actual := NewDataStoreID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataStoreValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseDataStoreID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DataStoreId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreValue", + Expected: &DataStoreId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DataStoreName: "dataStoreValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDataStoreID(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.DataStoreName != v.Expected.DataStoreName { + t.Fatalf("Expected %q but got %q for DataStoreName", v.Expected.DataStoreName, actual.DataStoreName) + } + + } +} + +func TestParseDataStoreIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DataStoreId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/dAtAsToReS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreValue", + Expected: &DataStoreId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DataStoreName: "dataStoreValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/dataStores/dataStoreValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/dAtAsToReS/dAtAsToReVaLuE", + Expected: &DataStoreId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + DataStoreName: "dAtAsToReVaLuE", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/dAtAsToReS/dAtAsToReVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDataStoreIDInsensitively(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.DataStoreName != v.Expected.DataStoreName { + t.Fatalf("Expected %q but got %q for DataStoreName", v.Expected.DataStoreName, actual.DataStoreName) + } + + } +} + +func TestSegmentsForDataStoreId(t *testing.T) { + segments := DataStoreId{}.Segments() + if len(segments) == 0 { + t.Fatalf("DataStoreId 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/connectedvmware/2023-12-01/datastores/method_create.go b/resource-manager/connectedvmware/2023-12-01/datastores/method_create.go new file mode 100644 index 00000000000..a6693e1d81f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/method_create.go @@ -0,0 +1,75 @@ +package datastores + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Datastore +} + +// Create ... +func (c DataStoresClient) Create(ctx context.Context, id DataStoreId, input Datastore) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c DataStoresClient) CreateThenPoll(ctx context.Context, id DataStoreId, input Datastore) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/method_delete.go b/resource-manager/connectedvmware/2023-12-01/datastores/method_delete.go new file mode 100644 index 00000000000..110aad8b00b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/method_delete.go @@ -0,0 +1,99 @@ +package datastores + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 DataStoresClient) Delete(ctx context.Context, id DataStoreId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 DataStoresClient) DeleteThenPoll(ctx context.Context, id DataStoreId, 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/connectedvmware/2023-12-01/datastores/method_get.go b/resource-manager/connectedvmware/2023-12-01/datastores/method_get.go new file mode 100644 index 00000000000..299db22f775 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/method_get.go @@ -0,0 +1,54 @@ +package datastores + +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 *Datastore +} + +// Get ... +func (c DataStoresClient) Get(ctx context.Context, id DataStoreId) (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 Datastore + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/method_list.go b/resource-manager/connectedvmware/2023-12-01/datastores/method_list.go new file mode 100644 index 00000000000..150f5c9d0ab --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/method_list.go @@ -0,0 +1,92 @@ +package datastores + +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 *[]Datastore +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Datastore +} + +// List ... +func (c DataStoresClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/dataStores", 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 *[]Datastore `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 DataStoresClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, DatastoreOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DataStoresClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DatastoreOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Datastore, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/datastores/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/datastores/method_listbyresourcegroup.go new file mode 100644 index 00000000000..eb622f7b55d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package datastores + +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 *[]Datastore +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []Datastore +} + +// ListByResourceGroup ... +func (c DataStoresClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/dataStores", 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 *[]Datastore `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 DataStoresClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DatastoreOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DataStoresClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DatastoreOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Datastore, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/datastores/method_update.go b/resource-manager/connectedvmware/2023-12-01/datastores/method_update.go new file mode 100644 index 00000000000..96ce4801235 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/method_update.go @@ -0,0 +1,58 @@ +package datastores + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Datastore +} + +// Update ... +func (c DataStoresClient) Update(ctx context.Context, id DataStoreId, input ResourcePatch) (result UpdateOperationResponse, 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 Datastore + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/model_datastore.go b/resource-manager/connectedvmware/2023-12-01/datastores/model_datastore.go new file mode 100644 index 00000000000..741491d97f4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/model_datastore.go @@ -0,0 +1,20 @@ +package datastores + +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 Datastore struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties DatastoreProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/model_datastoreproperties.go b/resource-manager/connectedvmware/2023-12-01/datastores/model_datastoreproperties.go new file mode 100644 index 00000000000..fa5c555eb62 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/model_datastoreproperties.go @@ -0,0 +1,17 @@ +package datastores + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatastoreProperties struct { + CapacityGB *int64 `json:"capacityGB,omitempty"` + CustomResourceName *string `json:"customResourceName,omitempty"` + FreeSpaceGB *int64 `json:"freeSpaceGB,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/datastores/model_extendedlocation.go new file mode 100644 index 00000000000..c1764a50ee2 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/model_extendedlocation.go @@ -0,0 +1,9 @@ +package datastores + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/datastores/model_resourcepatch.go new file mode 100644 index 00000000000..20d3ff91ba3 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/model_resourcepatch.go @@ -0,0 +1,8 @@ +package datastores + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/datastores/model_resourcestatus.go new file mode 100644 index 00000000000..47878f7f5b4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/model_resourcestatus.go @@ -0,0 +1,31 @@ +package datastores + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/datastores/predicates.go b/resource-manager/connectedvmware/2023-12-01/datastores/predicates.go new file mode 100644 index 00000000000..e2c15429e76 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/predicates.go @@ -0,0 +1,37 @@ +package datastores + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DatastoreOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p DatastoreOperationPredicate) Matches(input Datastore) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/datastores/version.go b/resource-manager/connectedvmware/2023-12-01/datastores/version.go new file mode 100644 index 00000000000..a6fa40055b9 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/datastores/version.go @@ -0,0 +1,12 @@ +package datastores + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/datastores/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/README.md b/resource-manager/connectedvmware/2023-12-01/hosts/README.md new file mode 100644 index 00000000000..64e3e75c13c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/hosts` Documentation + +The `hosts` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/hosts" +``` + + +### Client Initialization + +```go +client := hosts.NewHostsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `HostsClient.Create` + +```go +ctx := context.TODO() +id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostValue") + +payload := hosts.Host{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HostsClient.Delete` + +```go +ctx := context.TODO() +id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostValue") + +if err := client.DeleteThenPoll(ctx, id, hosts.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `HostsClient.Get` + +```go +ctx := context.TODO() +id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostValue") + +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: `HostsClient.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: `HostsClient.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: `HostsClient.Update` + +```go +ctx := context.TODO() +id := hosts.NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostValue") + +payload := hosts.ResourcePatch{ + // ... +} + + +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/connectedvmware/2023-12-01/hosts/client.go b/resource-manager/connectedvmware/2023-12-01/hosts/client.go new file mode 100644 index 00000000000..47294adfe7f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/client.go @@ -0,0 +1,26 @@ +package hosts + +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 HostsClient struct { + Client *resourcemanager.Client +} + +func NewHostsClientWithBaseURI(sdkApi sdkEnv.Api) (*HostsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "hosts", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating HostsClient: %+v", err) + } + + return &HostsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/constants.go b/resource-manager/connectedvmware/2023-12-01/hosts/constants.go new file mode 100644 index 00000000000..10733d788b4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/constants.go @@ -0,0 +1,69 @@ +package hosts + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/id_host.go b/resource-manager/connectedvmware/2023-12-01/hosts/id_host.go new file mode 100644 index 00000000000..95adc6e4b2a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/id_host.go @@ -0,0 +1,130 @@ +package hosts + +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(&HostId{}) +} + +var _ resourceids.ResourceId = &HostId{} + +// HostId is a struct representing the Resource ID for a Host +type HostId struct { + SubscriptionId string + ResourceGroupName string + HostName string +} + +// NewHostID returns a new HostId struct +func NewHostID(subscriptionId string, resourceGroupName string, hostName string) HostId { + return HostId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + HostName: hostName, + } +} + +// ParseHostID parses 'input' into a HostId +func ParseHostID(input string) (*HostId, error) { + parser := resourceids.NewParserFromResourceIdType(&HostId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := HostId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseHostIDInsensitively parses 'input' case-insensitively into a HostId +// note: this method should only be used for API response data and not user input +func ParseHostIDInsensitively(input string) (*HostId, error) { + parser := resourceids.NewParserFromResourceIdType(&HostId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := HostId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *HostId) 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.HostName, ok = input.Parsed["hostName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "hostName", input) + } + + return nil +} + +// ValidateHostID checks that 'input' can be parsed as a Host ID +func ValidateHostID(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 := ParseHostID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Host ID +func (id HostId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/hosts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.HostName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Host ID +func (id HostId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticHosts", "hosts", "hosts"), + resourceids.UserSpecifiedSegment("hostName", "hostValue"), + } +} + +// String returns a human-readable description of this Host ID +func (id HostId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Host Name: %q", id.HostName), + } + return fmt.Sprintf("Host (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/id_host_test.go b/resource-manager/connectedvmware/2023-12-01/hosts/id_host_test.go new file mode 100644 index 00000000000..8b54cce27e1 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/id_host_test.go @@ -0,0 +1,282 @@ +package hosts + +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 = &HostId{} + +func TestNewHostID(t *testing.T) { + id := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostValue") + + 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.HostName != "hostValue" { + t.Fatalf("Expected %q but got %q for Segment 'HostName'", id.HostName, "hostValue") + } +} + +func TestFormatHostID(t *testing.T) { + actual := NewHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "hostValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts/hostValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseHostID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *HostId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts/hostValue", + Expected: &HostId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + HostName: "hostValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts/hostValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseHostID(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.HostName != v.Expected.HostName { + t.Fatalf("Expected %q but got %q for HostName", v.Expected.HostName, actual.HostName) + } + + } +} + +func TestParseHostIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *HostId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/hOsTs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts/hostValue", + Expected: &HostId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + HostName: "hostValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/hosts/hostValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/hOsTs/hOsTvAlUe", + Expected: &HostId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + HostName: "hOsTvAlUe", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/hOsTs/hOsTvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseHostIDInsensitively(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.HostName != v.Expected.HostName { + t.Fatalf("Expected %q but got %q for HostName", v.Expected.HostName, actual.HostName) + } + + } +} + +func TestSegmentsForHostId(t *testing.T) { + segments := HostId{}.Segments() + if len(segments) == 0 { + t.Fatalf("HostId 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/connectedvmware/2023-12-01/hosts/method_create.go b/resource-manager/connectedvmware/2023-12-01/hosts/method_create.go new file mode 100644 index 00000000000..2cc829b2f2f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/method_create.go @@ -0,0 +1,75 @@ +package hosts + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Host +} + +// Create ... +func (c HostsClient) Create(ctx context.Context, id HostId, input Host) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c HostsClient) CreateThenPoll(ctx context.Context, id HostId, input Host) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/method_delete.go b/resource-manager/connectedvmware/2023-12-01/hosts/method_delete.go new file mode 100644 index 00000000000..8da7fe57253 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/method_delete.go @@ -0,0 +1,99 @@ +package hosts + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 HostsClient) Delete(ctx context.Context, id HostId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 HostsClient) DeleteThenPoll(ctx context.Context, id HostId, 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/connectedvmware/2023-12-01/hosts/method_get.go b/resource-manager/connectedvmware/2023-12-01/hosts/method_get.go new file mode 100644 index 00000000000..f9a9efb6940 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/method_get.go @@ -0,0 +1,54 @@ +package hosts + +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 *Host +} + +// Get ... +func (c HostsClient) Get(ctx context.Context, id HostId) (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 Host + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/method_list.go b/resource-manager/connectedvmware/2023-12-01/hosts/method_list.go new file mode 100644 index 00000000000..13bbe92069e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/method_list.go @@ -0,0 +1,92 @@ +package hosts + +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 *[]Host +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Host +} + +// List ... +func (c HostsClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/hosts", 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 *[]Host `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 HostsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, HostOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HostsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate HostOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Host, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/hosts/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/hosts/method_listbyresourcegroup.go new file mode 100644 index 00000000000..67585629e94 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package hosts + +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 *[]Host +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []Host +} + +// ListByResourceGroup ... +func (c HostsClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/hosts", 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 *[]Host `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 HostsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, HostOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HostsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate HostOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]Host, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/hosts/method_update.go b/resource-manager/connectedvmware/2023-12-01/hosts/method_update.go new file mode 100644 index 00000000000..eb34aa8fa32 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/method_update.go @@ -0,0 +1,58 @@ +package hosts + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Host +} + +// Update ... +func (c HostsClient) Update(ctx context.Context, id HostId, input ResourcePatch) (result UpdateOperationResponse, 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 Host + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/hosts/model_extendedlocation.go new file mode 100644 index 00000000000..5fe8fa107b9 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/model_extendedlocation.go @@ -0,0 +1,9 @@ +package hosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/model_host.go b/resource-manager/connectedvmware/2023-12-01/hosts/model_host.go new file mode 100644 index 00000000000..06b697d6ee5 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/model_host.go @@ -0,0 +1,20 @@ +package hosts + +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 Host struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties HostProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/model_hostproperties.go b/resource-manager/connectedvmware/2023-12-01/hosts/model_hostproperties.go new file mode 100644 index 00000000000..e9719953d3c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/model_hostproperties.go @@ -0,0 +1,21 @@ +package hosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostProperties struct { + CpuMhz *int64 `json:"cpuMhz,omitempty"` + CustomResourceName *string `json:"customResourceName,omitempty"` + DatastoreIds *[]string `json:"datastoreIds,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MemorySizeGB *int64 `json:"memorySizeGB,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + NetworkIds *[]string `json:"networkIds,omitempty"` + OverallCPUUsageMHz *int64 `json:"overallCpuUsageMHz,omitempty"` + OverallMemoryUsageGB *int64 `json:"overallMemoryUsageGB,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/hosts/model_resourcepatch.go new file mode 100644 index 00000000000..5d072af462f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/model_resourcepatch.go @@ -0,0 +1,8 @@ +package hosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/hosts/model_resourcestatus.go new file mode 100644 index 00000000000..39e0eec8099 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/model_resourcestatus.go @@ -0,0 +1,31 @@ +package hosts + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/hosts/predicates.go b/resource-manager/connectedvmware/2023-12-01/hosts/predicates.go new file mode 100644 index 00000000000..ab2992cdf31 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/predicates.go @@ -0,0 +1,37 @@ +package hosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HostOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p HostOperationPredicate) Matches(input Host) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/hosts/version.go b/resource-manager/connectedvmware/2023-12-01/hosts/version.go new file mode 100644 index 00000000000..0fdbe59f07d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/hosts/version.go @@ -0,0 +1,12 @@ +package hosts + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/hosts/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md b/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md new file mode 100644 index 00000000000..8067f22f91c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/inventoryitems` Documentation + +The `inventoryitems` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/inventoryitems" +``` + + +### Client Initialization + +```go +client := inventoryitems.NewInventoryItemsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `InventoryItemsClient.Create` + +```go +ctx := context.TODO() +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue", "inventoryItemValue") + +payload := inventoryitems.InventoryItem{ + // ... +} + + +read, err := client.Create(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `InventoryItemsClient.Delete` + +```go +ctx := context.TODO() +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue", "inventoryItemValue") + +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: `InventoryItemsClient.Get` + +```go +ctx := context.TODO() +id := inventoryitems.NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue", "inventoryItemValue") + +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: `InventoryItemsClient.ListByVCenter` + +```go +ctx := context.TODO() +id := inventoryitems.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + +// alternatively `client.ListByVCenter(ctx, id)` can be used to do batched pagination +items, err := client.ListByVCenterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/client.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/client.go new file mode 100644 index 00000000000..fbe00f649cc --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/client.go @@ -0,0 +1,26 @@ +package inventoryitems + +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 InventoryItemsClient struct { + Client *resourcemanager.Client +} + +func NewInventoryItemsClientWithBaseURI(sdkApi sdkEnv.Api) (*InventoryItemsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "inventoryitems", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating InventoryItemsClient: %+v", err) + } + + return &InventoryItemsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/constants.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/constants.go new file mode 100644 index 00000000000..d221377f40a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/constants.go @@ -0,0 +1,363 @@ +package inventoryitems + +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 DiskMode string + +const ( + DiskModeIndependentNonpersistent DiskMode = "independent_nonpersistent" + DiskModeIndependentPersistent DiskMode = "independent_persistent" + DiskModePersistent DiskMode = "persistent" +) + +func PossibleValuesForDiskMode() []string { + return []string{ + string(DiskModeIndependentNonpersistent), + string(DiskModeIndependentPersistent), + string(DiskModePersistent), + } +} + +func (s *DiskMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskMode(input string) (*DiskMode, error) { + vals := map[string]DiskMode{ + "independent_nonpersistent": DiskModeIndependentNonpersistent, + "independent_persistent": DiskModeIndependentPersistent, + "persistent": DiskModePersistent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskMode(input) + return &out, nil +} + +type DiskType string + +const ( + DiskTypeFlat DiskType = "flat" + DiskTypePmem DiskType = "pmem" + DiskTypeRawphysical DiskType = "rawphysical" + DiskTypeRawvirtual DiskType = "rawvirtual" + DiskTypeSesparse DiskType = "sesparse" + DiskTypeSparse DiskType = "sparse" + DiskTypeUnknown DiskType = "unknown" +) + +func PossibleValuesForDiskType() []string { + return []string{ + string(DiskTypeFlat), + string(DiskTypePmem), + string(DiskTypeRawphysical), + string(DiskTypeRawvirtual), + string(DiskTypeSesparse), + string(DiskTypeSparse), + string(DiskTypeUnknown), + } +} + +func (s *DiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskType(input string) (*DiskType, error) { + vals := map[string]DiskType{ + "flat": DiskTypeFlat, + "pmem": DiskTypePmem, + "rawphysical": DiskTypeRawphysical, + "rawvirtual": DiskTypeRawvirtual, + "sesparse": DiskTypeSesparse, + "sparse": DiskTypeSparse, + "unknown": DiskTypeUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskType(input) + return &out, nil +} + +type FirmwareType string + +const ( + FirmwareTypeBios FirmwareType = "bios" + FirmwareTypeEfi FirmwareType = "efi" +) + +func PossibleValuesForFirmwareType() []string { + return []string{ + string(FirmwareTypeBios), + string(FirmwareTypeEfi), + } +} + +func (s *FirmwareType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFirmwareType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFirmwareType(input string) (*FirmwareType, error) { + vals := map[string]FirmwareType{ + "bios": FirmwareTypeBios, + "efi": FirmwareTypeEfi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FirmwareType(input) + return &out, nil +} + +type InventoryType string + +const ( + InventoryTypeCluster InventoryType = "Cluster" + InventoryTypeDatastore InventoryType = "Datastore" + InventoryTypeHost InventoryType = "Host" + InventoryTypeResourcePool InventoryType = "ResourcePool" + InventoryTypeVirtualMachine InventoryType = "VirtualMachine" + InventoryTypeVirtualMachineTemplate InventoryType = "VirtualMachineTemplate" + InventoryTypeVirtualNetwork InventoryType = "VirtualNetwork" +) + +func PossibleValuesForInventoryType() []string { + return []string{ + string(InventoryTypeCluster), + string(InventoryTypeDatastore), + string(InventoryTypeHost), + string(InventoryTypeResourcePool), + string(InventoryTypeVirtualMachine), + string(InventoryTypeVirtualMachineTemplate), + string(InventoryTypeVirtualNetwork), + } +} + +func (s *InventoryType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseInventoryType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseInventoryType(input string) (*InventoryType, error) { + vals := map[string]InventoryType{ + "cluster": InventoryTypeCluster, + "datastore": InventoryTypeDatastore, + "host": InventoryTypeHost, + "resourcepool": InventoryTypeResourcePool, + "virtualmachine": InventoryTypeVirtualMachine, + "virtualmachinetemplate": InventoryTypeVirtualMachineTemplate, + "virtualnetwork": InventoryTypeVirtualNetwork, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InventoryType(input) + return &out, nil +} + +type NICType string + +const ( + NICTypeEOneThousand NICType = "e1000" + NICTypeEOneThousande NICType = "e1000e" + NICTypePcnetThreeTwo NICType = "pcnet32" + NICTypeVMxnet NICType = "vmxnet" + NICTypeVMxnetThree NICType = "vmxnet3" + NICTypeVMxnetTwo NICType = "vmxnet2" +) + +func PossibleValuesForNICType() []string { + return []string{ + string(NICTypeEOneThousand), + string(NICTypeEOneThousande), + string(NICTypePcnetThreeTwo), + string(NICTypeVMxnet), + string(NICTypeVMxnetThree), + string(NICTypeVMxnetTwo), + } +} + +func (s *NICType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNICType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNICType(input string) (*NICType, error) { + vals := map[string]NICType{ + "e1000": NICTypeEOneThousand, + "e1000e": NICTypeEOneThousande, + "pcnet32": NICTypePcnetThreeTwo, + "vmxnet": NICTypeVMxnet, + "vmxnet3": NICTypeVMxnetThree, + "vmxnet2": NICTypeVMxnetTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NICType(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeOther OsType = "Other" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeOther), + 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, + "other": OsTypeOther, + "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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go new file mode 100644 index 00000000000..466a0d2f1fc --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem.go @@ -0,0 +1,139 @@ +package inventoryitems + +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(&InventoryItemId{}) +} + +var _ resourceids.ResourceId = &InventoryItemId{} + +// InventoryItemId is a struct representing the Resource ID for a Inventory Item +type InventoryItemId struct { + SubscriptionId string + ResourceGroupName string + VCenterName string + InventoryItemName string +} + +// NewInventoryItemID returns a new InventoryItemId struct +func NewInventoryItemID(subscriptionId string, resourceGroupName string, vCenterName string, inventoryItemName string) InventoryItemId { + return InventoryItemId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VCenterName: vCenterName, + InventoryItemName: inventoryItemName, + } +} + +// ParseInventoryItemID parses 'input' into a InventoryItemId +func ParseInventoryItemID(input string) (*InventoryItemId, error) { + parser := resourceids.NewParserFromResourceIdType(&InventoryItemId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := InventoryItemId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseInventoryItemIDInsensitively parses 'input' case-insensitively into a InventoryItemId +// note: this method should only be used for API response data and not user input +func ParseInventoryItemIDInsensitively(input string) (*InventoryItemId, error) { + parser := resourceids.NewParserFromResourceIdType(&InventoryItemId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := InventoryItemId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *InventoryItemId) 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.VCenterName, ok = input.Parsed["vCenterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "vCenterName", input) + } + + if id.InventoryItemName, ok = input.Parsed["inventoryItemName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "inventoryItemName", input) + } + + return nil +} + +// ValidateInventoryItemID checks that 'input' can be parsed as a Inventory Item ID +func ValidateInventoryItemID(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 := ParseInventoryItemID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Inventory Item ID +func (id InventoryItemId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/vCenters/%s/inventoryItems/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VCenterName, id.InventoryItemName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Inventory Item ID +func (id InventoryItemId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterValue"), + resourceids.StaticSegment("staticInventoryItems", "inventoryItems", "inventoryItems"), + resourceids.UserSpecifiedSegment("inventoryItemName", "inventoryItemValue"), + } +} + +// String returns a human-readable description of this Inventory Item ID +func (id InventoryItemId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("V Center Name: %q", id.VCenterName), + fmt.Sprintf("Inventory Item Name: %q", id.InventoryItemName), + } + return fmt.Sprintf("Inventory Item (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go new file mode 100644 index 00000000000..660ce51958e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_inventoryitem_test.go @@ -0,0 +1,327 @@ +package inventoryitems + +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 = &InventoryItemId{} + +func TestNewInventoryItemID(t *testing.T) { + id := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue", "inventoryItemValue") + + 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.VCenterName != "vCenterValue" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterValue") + } + + if id.InventoryItemName != "inventoryItemValue" { + t.Fatalf("Expected %q but got %q for Segment 'InventoryItemName'", id.InventoryItemName, "inventoryItemValue") + } +} + +func TestFormatInventoryItemID(t *testing.T) { + actual := NewInventoryItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue", "inventoryItemValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems/inventoryItemValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseInventoryItemID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *InventoryItemId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems/inventoryItemValue", + Expected: &InventoryItemId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VCenterName: "vCenterValue", + InventoryItemName: "inventoryItemValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems/inventoryItemValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseInventoryItemID(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.VCenterName != v.Expected.VCenterName { + t.Fatalf("Expected %q but got %q for VCenterName", v.Expected.VCenterName, actual.VCenterName) + } + + if actual.InventoryItemName != v.Expected.InventoryItemName { + t.Fatalf("Expected %q but got %q for InventoryItemName", v.Expected.InventoryItemName, actual.InventoryItemName) + } + + } +} + +func TestParseInventoryItemIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *InventoryItemId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE/iNvEnToRyItEmS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems/inventoryItemValue", + Expected: &InventoryItemId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VCenterName: "vCenterValue", + InventoryItemName: "inventoryItemValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/inventoryItems/inventoryItemValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE/iNvEnToRyItEmS/iNvEnToRyItEmVaLuE", + Expected: &InventoryItemId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + VCenterName: "vCeNtErVaLuE", + InventoryItemName: "iNvEnToRyItEmVaLuE", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE/iNvEnToRyItEmS/iNvEnToRyItEmVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseInventoryItemIDInsensitively(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.VCenterName != v.Expected.VCenterName { + t.Fatalf("Expected %q but got %q for VCenterName", v.Expected.VCenterName, actual.VCenterName) + } + + if actual.InventoryItemName != v.Expected.InventoryItemName { + t.Fatalf("Expected %q but got %q for InventoryItemName", v.Expected.InventoryItemName, actual.InventoryItemName) + } + + } +} + +func TestSegmentsForInventoryItemId(t *testing.T) { + segments := InventoryItemId{}.Segments() + if len(segments) == 0 { + t.Fatalf("InventoryItemId 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/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go new file mode 100644 index 00000000000..2bdff43b9bb --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter.go @@ -0,0 +1,130 @@ +package inventoryitems + +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(&VCenterId{}) +} + +var _ resourceids.ResourceId = &VCenterId{} + +// VCenterId is a struct representing the Resource ID for a V Center +type VCenterId struct { + SubscriptionId string + ResourceGroupName string + VCenterName string +} + +// NewVCenterID returns a new VCenterId struct +func NewVCenterID(subscriptionId string, resourceGroupName string, vCenterName string) VCenterId { + return VCenterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VCenterName: vCenterName, + } +} + +// ParseVCenterID parses 'input' into a VCenterId +func ParseVCenterID(input string) (*VCenterId, error) { + parser := resourceids.NewParserFromResourceIdType(&VCenterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VCenterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVCenterIDInsensitively parses 'input' case-insensitively into a VCenterId +// note: this method should only be used for API response data and not user input +func ParseVCenterIDInsensitively(input string) (*VCenterId, error) { + parser := resourceids.NewParserFromResourceIdType(&VCenterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VCenterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VCenterId) 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.VCenterName, ok = input.Parsed["vCenterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "vCenterName", input) + } + + return nil +} + +// ValidateVCenterID checks that 'input' can be parsed as a V Center ID +func ValidateVCenterID(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 := ParseVCenterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted V Center ID +func (id VCenterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/vCenters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VCenterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this V Center ID +func (id VCenterId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterValue"), + } +} + +// String returns a human-readable description of this V Center ID +func (id VCenterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("V Center Name: %q", id.VCenterName), + } + return fmt.Sprintf("V Center (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go new file mode 100644 index 00000000000..511fced0fa4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/id_vcenter_test.go @@ -0,0 +1,282 @@ +package inventoryitems + +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 = &VCenterId{} + +func TestNewVCenterID(t *testing.T) { + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + + 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.VCenterName != "vCenterValue" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterValue") + } +} + +func TestFormatVCenterID(t *testing.T) { + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVCenterID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VCenterId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue", + Expected: &VCenterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VCenterName: "vCenterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVCenterID(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.VCenterName != v.Expected.VCenterName { + t.Fatalf("Expected %q but got %q for VCenterName", v.Expected.VCenterName, actual.VCenterName) + } + + } +} + +func TestParseVCenterIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VCenterId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue", + Expected: &VCenterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VCenterName: "vCenterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE", + Expected: &VCenterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + VCenterName: "vCeNtErVaLuE", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVCenterIDInsensitively(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.VCenterName != v.Expected.VCenterName { + t.Fatalf("Expected %q but got %q for VCenterName", v.Expected.VCenterName, actual.VCenterName) + } + + } +} + +func TestSegmentsForVCenterId(t *testing.T) { + segments := VCenterId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VCenterId 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/connectedvmware/2023-12-01/inventoryitems/method_create.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_create.go new file mode 100644 index 00000000000..05ee4a39269 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_create.go @@ -0,0 +1,58 @@ +package inventoryitems + +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 CreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *InventoryItem +} + +// Create ... +func (c InventoryItemsClient) Create(ctx context.Context, id InventoryItemId, input InventoryItem) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + 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 InventoryItem + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_delete.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_delete.go new file mode 100644 index 00000000000..12d36256668 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_delete.go @@ -0,0 +1,47 @@ +package inventoryitems + +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 InventoryItemsClient) Delete(ctx context.Context, id InventoryItemId) (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/connectedvmware/2023-12-01/inventoryitems/method_get.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_get.go new file mode 100644 index 00000000000..4df52d77cdc --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_get.go @@ -0,0 +1,54 @@ +package inventoryitems + +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 *InventoryItem +} + +// Get ... +func (c InventoryItemsClient) Get(ctx context.Context, id InventoryItemId) (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 InventoryItem + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_listbyvcenter.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_listbyvcenter.go new file mode 100644 index 00000000000..80710e1d140 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/method_listbyvcenter.go @@ -0,0 +1,91 @@ +package inventoryitems + +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 ListByVCenterOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]InventoryItem +} + +type ListByVCenterCompleteResult struct { + LatestHttpResponse *http.Response + Items []InventoryItem +} + +// ListByVCenter ... +func (c InventoryItemsClient) ListByVCenter(ctx context.Context, id VCenterId) (result ListByVCenterOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/inventoryItems", 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 *[]InventoryItem `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByVCenterComplete retrieves all the results into a single object +func (c InventoryItemsClient) ListByVCenterComplete(ctx context.Context, id VCenterId) (ListByVCenterCompleteResult, error) { + return c.ListByVCenterCompleteMatchingPredicate(ctx, id, InventoryItemOperationPredicate{}) +} + +// ListByVCenterCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c InventoryItemsClient) ListByVCenterCompleteMatchingPredicate(ctx context.Context, id VCenterId, predicate InventoryItemOperationPredicate) (result ListByVCenterCompleteResult, err error) { + items := make([]InventoryItem, 0) + + resp, err := c.ListByVCenter(ctx, id) + if err != nil { + 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 = ListByVCenterCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_clusterinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_clusterinventoryitem.go new file mode 100644 index 00000000000..57560e84429 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_clusterinventoryitem.go @@ -0,0 +1,44 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = ClusterInventoryItem{} + +type ClusterInventoryItem struct { + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = ClusterInventoryItem{} + +func (s ClusterInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper ClusterInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterInventoryItem: %+v", err) + } + decoded["inventoryType"] = "Cluster" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_datastoreinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_datastoreinventoryitem.go new file mode 100644 index 00000000000..8024d751803 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_datastoreinventoryitem.go @@ -0,0 +1,46 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = DatastoreInventoryItem{} + +type DatastoreInventoryItem struct { + CapacityGB *int64 `json:"capacityGB,omitempty"` + FreeSpaceGB *int64 `json:"freeSpaceGB,omitempty"` + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = DatastoreInventoryItem{} + +func (s DatastoreInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper DatastoreInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling DatastoreInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling DatastoreInventoryItem: %+v", err) + } + decoded["inventoryType"] = "Datastore" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling DatastoreInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_hostinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_hostinventoryitem.go new file mode 100644 index 00000000000..105ccd94358 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_hostinventoryitem.go @@ -0,0 +1,51 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = HostInventoryItem{} + +type HostInventoryItem struct { + CpuModel *string `json:"cpuModel,omitempty"` + MemorySizeGB *int64 `json:"memorySizeGB,omitempty"` + NumCoresPerSocket *int64 `json:"numCoresPerSocket,omitempty"` + NumSockets *int64 `json:"numSockets,omitempty"` + Parent *InventoryItemDetails `json:"parent,omitempty"` + PowerState *string `json:"powerState,omitempty"` + Version *string `json:"version,omitempty"` + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = HostInventoryItem{} + +func (s HostInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper HostInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling HostInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling HostInventoryItem: %+v", err) + } + decoded["inventoryType"] = "Host" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling HostInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitem.go new file mode 100644 index 00000000000..92f80c1062d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitem.go @@ -0,0 +1,50 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" + + "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 InventoryItem struct { + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Name *string `json:"name,omitempty"` + Properties InventoryItemProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &InventoryItem{} + +func (s *InventoryItem) UnmarshalJSON(bytes []byte) error { + type alias InventoryItem + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into InventoryItem: %+v", err) + } + + s.Id = decoded.Id + s.Kind = decoded.Kind + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling InventoryItem into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalInventoryItemPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'InventoryItem': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemdetails.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemdetails.go new file mode 100644 index 00000000000..000706c1234 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemdetails.go @@ -0,0 +1,10 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InventoryItemDetails struct { + InventoryItemId *string `json:"inventoryItemId,omitempty"` + InventoryType *InventoryType `json:"inventoryType,omitempty"` + MoName *string `json:"moName,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemproperties.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemproperties.go new file mode 100644 index 00000000000..585d050785c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_inventoryitemproperties.go @@ -0,0 +1,101 @@ +package inventoryitems + +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 InventoryItemProperties interface { +} + +// RawInventoryItemPropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawInventoryItemPropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalInventoryItemPropertiesImplementation(input []byte) (InventoryItemProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling InventoryItemProperties into map[string]interface: %+v", err) + } + + value, ok := temp["inventoryType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "Cluster") { + var out ClusterInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Datastore") { + var out DatastoreInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into DatastoreInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "Host") { + var out HostInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into HostInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "ResourcePool") { + var out ResourcePoolInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ResourcePoolInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualMachine") { + var out VirtualMachineInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualMachineInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualMachineTemplate") { + var out VirtualMachineTemplateInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualMachineTemplateInventoryItem: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "VirtualNetwork") { + var out VirtualNetworkInventoryItem + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into VirtualNetworkInventoryItem: %+v", err) + } + return out, nil + } + + out := RawInventoryItemPropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkinterfaceinventory.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkinterfaceinventory.go new file mode 100644 index 00000000000..c3ebbad2d3a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkinterfaceinventory.go @@ -0,0 +1,14 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceInventory struct { + DeviceKey *int64 `json:"deviceKey,omitempty"` + IPAddresses *[]string `json:"ipAddresses,omitempty"` + Label *string `json:"label,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + NetworkMoName *string `json:"networkMoName,omitempty"` + NetworkMoRefId *string `json:"networkMoRefId,omitempty"` + NicType *NICType `json:"nicType,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkprofileinventory.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkprofileinventory.go new file mode 100644 index 00000000000..08e8d6cd027 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_networkprofileinventory.go @@ -0,0 +1,8 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfileInventory struct { + NetworkInterfaces *[]NetworkInterfaceInventory `json:"networkInterfaces,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_resourcepoolinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_resourcepoolinventoryitem.go new file mode 100644 index 00000000000..34355eafd17 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_resourcepoolinventoryitem.go @@ -0,0 +1,45 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = ResourcePoolInventoryItem{} + +type ResourcePoolInventoryItem struct { + Parent *InventoryItemDetails `json:"parent,omitempty"` + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = ResourcePoolInventoryItem{} + +func (s ResourcePoolInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper ResourcePoolInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ResourcePoolInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ResourcePoolInventoryItem: %+v", err) + } + decoded["inventoryType"] = "ResourcePool" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ResourcePoolInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_storageprofileinventory.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_storageprofileinventory.go new file mode 100644 index 00000000000..c4f5f3515aa --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_storageprofileinventory.go @@ -0,0 +1,8 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfileInventory struct { + Disks *[]VirtualDiskInventory `json:"disks,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualdiskinventory.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualdiskinventory.go new file mode 100644 index 00000000000..ca4d5567233 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualdiskinventory.go @@ -0,0 +1,21 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDiskInventory struct { + ControllerKey *int64 `json:"controllerKey,omitempty"` + ControllerType *string `json:"controllerType,omitempty"` + DeviceKey *int64 `json:"deviceKey,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DiskMode *DiskMode `json:"diskMode,omitempty"` + DiskName *string `json:"diskName,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DiskType *DiskType `json:"diskType,omitempty"` + EagerlyScrub *bool `json:"eagerlyScrub,omitempty"` + FileName *string `json:"fileName,omitempty"` + Label *string `json:"label,omitempty"` + ThinProvisioned *bool `json:"thinProvisioned,omitempty"` + UnitNumber *int64 `json:"unitNumber,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachineinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachineinventoryitem.go new file mode 100644 index 00000000000..69846868efa --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachineinventoryitem.go @@ -0,0 +1,68 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = VirtualMachineInventoryItem{} + +type VirtualMachineInventoryItem struct { + ChangeTrackingEnabled *bool `json:"changeTrackingEnabled,omitempty"` + ChangeTrackingSupported *bool `json:"changeTrackingSupported,omitempty"` + Cluster *InventoryItemDetails `json:"cluster,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + DiskEnabledUuid *string `json:"diskEnabledUuid,omitempty"` + FirmwareType *FirmwareType `json:"firmwareType,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + Host *InventoryItemDetails `json:"host,omitempty"` + IPAddresses *[]string `json:"ipAddresses,omitempty"` + InstanceUuid *string `json:"instanceUuid,omitempty"` + MaxSnapshots *int64 `json:"maxSnapshots,omitempty"` + MemorySizeMB *int64 `json:"memorySizeMB,omitempty"` + NetworkProfile *NetworkProfileInventory `json:"networkProfile,omitempty"` + NumCPUs *int64 `json:"numCPUs,omitempty"` + NumberOfSnapshots *int64 `json:"numberOfSnapshots,omitempty"` + OsName *string `json:"osName,omitempty"` + OsType *OsType `json:"osType,omitempty"` + PowerState *string `json:"powerState,omitempty"` + ResourcePool *InventoryItemDetails `json:"resourcePool,omitempty"` + SmbiosUuid *string `json:"smbiosUuid,omitempty"` + StorageProfile *StorageProfileInventory `json:"storageProfile,omitempty"` + ToolsRunningStatus *string `json:"toolsRunningStatus,omitempty"` + ToolsVersion *string `json:"toolsVersion,omitempty"` + ToolsVersionStatus *string `json:"toolsVersionStatus,omitempty"` + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = VirtualMachineInventoryItem{} + +func (s VirtualMachineInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper VirtualMachineInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualMachineInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualMachineInventoryItem: %+v", err) + } + decoded["inventoryType"] = "VirtualMachine" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualMachineInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachinetemplateinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachinetemplateinventoryitem.go new file mode 100644 index 00000000000..8ff1acbe1d8 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualmachinetemplateinventoryitem.go @@ -0,0 +1,52 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = VirtualMachineTemplateInventoryItem{} + +type VirtualMachineTemplateInventoryItem struct { + FolderPath *string `json:"folderPath,omitempty"` + MemorySizeMB *int64 `json:"memorySizeMB,omitempty"` + NumCPUs *int64 `json:"numCPUs,omitempty"` + NumCoresPerSocket *int64 `json:"numCoresPerSocket,omitempty"` + OsName *string `json:"osName,omitempty"` + OsType *OsType `json:"osType,omitempty"` + ToolsVersion *string `json:"toolsVersion,omitempty"` + ToolsVersionStatus *string `json:"toolsVersionStatus,omitempty"` + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = VirtualMachineTemplateInventoryItem{} + +func (s VirtualMachineTemplateInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper VirtualMachineTemplateInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualMachineTemplateInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualMachineTemplateInventoryItem: %+v", err) + } + decoded["inventoryType"] = "VirtualMachineTemplate" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualMachineTemplateInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualnetworkinventoryitem.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualnetworkinventoryitem.go new file mode 100644 index 00000000000..3f57ca228b4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/model_virtualnetworkinventoryitem.go @@ -0,0 +1,44 @@ +package inventoryitems + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ InventoryItemProperties = VirtualNetworkInventoryItem{} + +type VirtualNetworkInventoryItem struct { + + // Fields inherited from InventoryItemProperties + ManagedResourceId *string `json:"managedResourceId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} + +var _ json.Marshaler = VirtualNetworkInventoryItem{} + +func (s VirtualNetworkInventoryItem) MarshalJSON() ([]byte, error) { + type wrapper VirtualNetworkInventoryItem + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling VirtualNetworkInventoryItem: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling VirtualNetworkInventoryItem: %+v", err) + } + decoded["inventoryType"] = "VirtualNetwork" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling VirtualNetworkInventoryItem: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/inventoryitems/predicates.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/predicates.go new file mode 100644 index 00000000000..228f404a376 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/predicates.go @@ -0,0 +1,32 @@ +package inventoryitems + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InventoryItemOperationPredicate struct { + Id *string + Kind *string + Name *string + Type *string +} + +func (p InventoryItemOperationPredicate) Matches(input InventoryItem) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/inventoryitems/version.go b/resource-manager/connectedvmware/2023-12-01/inventoryitems/version.go new file mode 100644 index 00000000000..c177504dcae --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/inventoryitems/version.go @@ -0,0 +1,12 @@ +package inventoryitems + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/inventoryitems/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/README.md b/resource-manager/connectedvmware/2023-12-01/resourcepools/README.md new file mode 100644 index 00000000000..13f9bcf1204 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/resourcepools` Documentation + +The `resourcepools` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/resourcepools" +``` + + +### Client Initialization + +```go +client := resourcepools.NewResourcePoolsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ResourcePoolsClient.Create` + +```go +ctx := context.TODO() +id := resourcepools.NewResourcePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourcePoolValue") + +payload := resourcepools.ResourcePool{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ResourcePoolsClient.Delete` + +```go +ctx := context.TODO() +id := resourcepools.NewResourcePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourcePoolValue") + +if err := client.DeleteThenPoll(ctx, id, resourcepools.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ResourcePoolsClient.Get` + +```go +ctx := context.TODO() +id := resourcepools.NewResourcePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourcePoolValue") + +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: `ResourcePoolsClient.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: `ResourcePoolsClient.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: `ResourcePoolsClient.Update` + +```go +ctx := context.TODO() +id := resourcepools.NewResourcePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourcePoolValue") + +payload := resourcepools.ResourcePatch{ + // ... +} + + +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/connectedvmware/2023-12-01/resourcepools/client.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/client.go new file mode 100644 index 00000000000..e62fc2bf47f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/client.go @@ -0,0 +1,26 @@ +package resourcepools + +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 ResourcePoolsClient struct { + Client *resourcemanager.Client +} + +func NewResourcePoolsClientWithBaseURI(sdkApi sdkEnv.Api) (*ResourcePoolsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "resourcepools", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ResourcePoolsClient: %+v", err) + } + + return &ResourcePoolsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/constants.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/constants.go new file mode 100644 index 00000000000..150add9dd52 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/constants.go @@ -0,0 +1,69 @@ +package resourcepools + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool.go new file mode 100644 index 00000000000..d12b87a8394 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool.go @@ -0,0 +1,130 @@ +package resourcepools + +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(&ResourcePoolId{}) +} + +var _ resourceids.ResourceId = &ResourcePoolId{} + +// ResourcePoolId is a struct representing the Resource ID for a Resource Pool +type ResourcePoolId struct { + SubscriptionId string + ResourceGroupName string + ResourcePoolName string +} + +// NewResourcePoolID returns a new ResourcePoolId struct +func NewResourcePoolID(subscriptionId string, resourceGroupName string, resourcePoolName string) ResourcePoolId { + return ResourcePoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ResourcePoolName: resourcePoolName, + } +} + +// ParseResourcePoolID parses 'input' into a ResourcePoolId +func ParseResourcePoolID(input string) (*ResourcePoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&ResourcePoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ResourcePoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseResourcePoolIDInsensitively parses 'input' case-insensitively into a ResourcePoolId +// note: this method should only be used for API response data and not user input +func ParseResourcePoolIDInsensitively(input string) (*ResourcePoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&ResourcePoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ResourcePoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ResourcePoolId) 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.ResourcePoolName, ok = input.Parsed["resourcePoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "resourcePoolName", input) + } + + return nil +} + +// ValidateResourcePoolID checks that 'input' can be parsed as a Resource Pool ID +func ValidateResourcePoolID(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 := ParseResourcePoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Resource Pool ID +func (id ResourcePoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ResourcePoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Resource Pool ID +func (id ResourcePoolId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticResourcePools", "resourcePools", "resourcePools"), + resourceids.UserSpecifiedSegment("resourcePoolName", "resourcePoolValue"), + } +} + +// String returns a human-readable description of this Resource Pool ID +func (id ResourcePoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Resource Pool Name: %q", id.ResourcePoolName), + } + return fmt.Sprintf("Resource Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool_test.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool_test.go new file mode 100644 index 00000000000..2b5012c6dff --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/id_resourcepool_test.go @@ -0,0 +1,282 @@ +package resourcepools + +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 = &ResourcePoolId{} + +func TestNewResourcePoolID(t *testing.T) { + id := NewResourcePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourcePoolValue") + + 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.ResourcePoolName != "resourcePoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'ResourcePoolName'", id.ResourcePoolName, "resourcePoolValue") + } +} + +func TestFormatResourcePoolID(t *testing.T) { + actual := NewResourcePoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "resourcePoolValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/resourcePoolValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseResourcePoolID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ResourcePoolId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/resourcePoolValue", + Expected: &ResourcePoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ResourcePoolName: "resourcePoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/resourcePoolValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseResourcePoolID(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.ResourcePoolName != v.Expected.ResourcePoolName { + t.Fatalf("Expected %q but got %q for ResourcePoolName", v.Expected.ResourcePoolName, actual.ResourcePoolName) + } + + } +} + +func TestParseResourcePoolIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ResourcePoolId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/rEsOuRcEpOoLs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/resourcePoolValue", + Expected: &ResourcePoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ResourcePoolName: "resourcePoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/resourcePools/resourcePoolValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/rEsOuRcEpOoLs/rEsOuRcEpOoLvAlUe", + Expected: &ResourcePoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ResourcePoolName: "rEsOuRcEpOoLvAlUe", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/rEsOuRcEpOoLs/rEsOuRcEpOoLvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseResourcePoolIDInsensitively(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.ResourcePoolName != v.Expected.ResourcePoolName { + t.Fatalf("Expected %q but got %q for ResourcePoolName", v.Expected.ResourcePoolName, actual.ResourcePoolName) + } + + } +} + +func TestSegmentsForResourcePoolId(t *testing.T) { + segments := ResourcePoolId{}.Segments() + if len(segments) == 0 { + t.Fatalf("ResourcePoolId 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/connectedvmware/2023-12-01/resourcepools/method_create.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_create.go new file mode 100644 index 00000000000..1c8588d53d6 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_create.go @@ -0,0 +1,75 @@ +package resourcepools + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ResourcePool +} + +// Create ... +func (c ResourcePoolsClient) Create(ctx context.Context, id ResourcePoolId, input ResourcePool) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c ResourcePoolsClient) CreateThenPoll(ctx context.Context, id ResourcePoolId, input ResourcePool) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/method_delete.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_delete.go new file mode 100644 index 00000000000..2658dafaec0 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_delete.go @@ -0,0 +1,99 @@ +package resourcepools + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 ResourcePoolsClient) Delete(ctx context.Context, id ResourcePoolId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 ResourcePoolsClient) DeleteThenPoll(ctx context.Context, id ResourcePoolId, 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/connectedvmware/2023-12-01/resourcepools/method_get.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_get.go new file mode 100644 index 00000000000..d08e1e3323b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_get.go @@ -0,0 +1,54 @@ +package resourcepools + +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 *ResourcePool +} + +// Get ... +func (c ResourcePoolsClient) Get(ctx context.Context, id ResourcePoolId) (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 ResourcePool + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/method_list.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_list.go new file mode 100644 index 00000000000..6b5d9f91a32 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_list.go @@ -0,0 +1,92 @@ +package resourcepools + +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 *[]ResourcePool +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ResourcePool +} + +// List ... +func (c ResourcePoolsClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/resourcePools", 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 *[]ResourcePool `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 ResourcePoolsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, ResourcePoolOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ResourcePoolsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ResourcePoolOperationPredicate) (result ListCompleteResult, err error) { + items := make([]ResourcePool, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/resourcepools/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_listbyresourcegroup.go new file mode 100644 index 00000000000..dfc67986485 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package resourcepools + +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 *[]ResourcePool +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []ResourcePool +} + +// ListByResourceGroup ... +func (c ResourcePoolsClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/resourcePools", 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 *[]ResourcePool `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 ResourcePoolsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ResourcePoolOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c ResourcePoolsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ResourcePoolOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]ResourcePool, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/resourcepools/method_update.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_update.go new file mode 100644 index 00000000000..58628b6cb6c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/method_update.go @@ -0,0 +1,58 @@ +package resourcepools + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ResourcePool +} + +// Update ... +func (c ResourcePoolsClient) Update(ctx context.Context, id ResourcePoolId, input ResourcePatch) (result UpdateOperationResponse, 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 ResourcePool + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_extendedlocation.go new file mode 100644 index 00000000000..f5d2f0065c8 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_extendedlocation.go @@ -0,0 +1,9 @@ +package resourcepools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepatch.go new file mode 100644 index 00000000000..0d0be58fbdc --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepatch.go @@ -0,0 +1,8 @@ +package resourcepools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepool.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepool.go new file mode 100644 index 00000000000..8c3b4a9c006 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepool.go @@ -0,0 +1,20 @@ +package resourcepools + +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 ResourcePool struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties ResourcePoolProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepoolproperties.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepoolproperties.go new file mode 100644 index 00000000000..a8fe33ea0e2 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcepoolproperties.go @@ -0,0 +1,27 @@ +package resourcepools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePoolProperties struct { + CpuCapacityMHz *int64 `json:"cpuCapacityMHz,omitempty"` + CpuLimitMHz *int64 `json:"cpuLimitMHz,omitempty"` + CpuOverallUsageMHz *int64 `json:"cpuOverallUsageMHz,omitempty"` + CpuReservationMHz *int64 `json:"cpuReservationMHz,omitempty"` + CpuSharesLevel *string `json:"cpuSharesLevel,omitempty"` + CustomResourceName *string `json:"customResourceName,omitempty"` + DatastoreIds *[]string `json:"datastoreIds,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MemCapacityGB *int64 `json:"memCapacityGB,omitempty"` + MemLimitMB *int64 `json:"memLimitMB,omitempty"` + MemOverallUsageGB *int64 `json:"memOverallUsageGB,omitempty"` + MemReservationMB *int64 `json:"memReservationMB,omitempty"` + MemSharesLevel *string `json:"memSharesLevel,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + NetworkIds *[]string `json:"networkIds,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcestatus.go new file mode 100644 index 00000000000..5993d1b9826 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/model_resourcestatus.go @@ -0,0 +1,31 @@ +package resourcepools + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/resourcepools/predicates.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/predicates.go new file mode 100644 index 00000000000..d1b9f4ac5de --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/predicates.go @@ -0,0 +1,37 @@ +package resourcepools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePoolOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p ResourcePoolOperationPredicate) Matches(input ResourcePool) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/resourcepools/version.go b/resource-manager/connectedvmware/2023-12-01/resourcepools/version.go new file mode 100644 index 00000000000..beaa1f58e31 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/resourcepools/version.go @@ -0,0 +1,12 @@ +package resourcepools + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/resourcepools/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/README.md b/resource-manager/connectedvmware/2023-12-01/vcenters/README.md new file mode 100644 index 00000000000..873b01390c0 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/vcenters` Documentation + +The `vcenters` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/vcenters" +``` + + +### Client Initialization + +```go +client := vcenters.NewVCentersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VCentersClient.Create` + +```go +ctx := context.TODO() +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + +payload := vcenters.VCenter{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VCentersClient.Delete` + +```go +ctx := context.TODO() +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + +if err := client.DeleteThenPoll(ctx, id, vcenters.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VCentersClient.Get` + +```go +ctx := context.TODO() +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + +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: `VCentersClient.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: `VCentersClient.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: `VCentersClient.Update` + +```go +ctx := context.TODO() +id := vcenters.NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + +payload := vcenters.ResourcePatch{ + // ... +} + + +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/connectedvmware/2023-12-01/vcenters/client.go b/resource-manager/connectedvmware/2023-12-01/vcenters/client.go new file mode 100644 index 00000000000..2ac439c076d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/client.go @@ -0,0 +1,26 @@ +package vcenters + +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 VCentersClient struct { + Client *resourcemanager.Client +} + +func NewVCentersClientWithBaseURI(sdkApi sdkEnv.Api) (*VCentersClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vcenters", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VCentersClient: %+v", err) + } + + return &VCentersClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/constants.go b/resource-manager/connectedvmware/2023-12-01/vcenters/constants.go new file mode 100644 index 00000000000..04b29330915 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/constants.go @@ -0,0 +1,69 @@ +package vcenters + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go new file mode 100644 index 00000000000..1cc53342784 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter.go @@ -0,0 +1,130 @@ +package vcenters + +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(&VCenterId{}) +} + +var _ resourceids.ResourceId = &VCenterId{} + +// VCenterId is a struct representing the Resource ID for a V Center +type VCenterId struct { + SubscriptionId string + ResourceGroupName string + VCenterName string +} + +// NewVCenterID returns a new VCenterId struct +func NewVCenterID(subscriptionId string, resourceGroupName string, vCenterName string) VCenterId { + return VCenterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VCenterName: vCenterName, + } +} + +// ParseVCenterID parses 'input' into a VCenterId +func ParseVCenterID(input string) (*VCenterId, error) { + parser := resourceids.NewParserFromResourceIdType(&VCenterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VCenterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVCenterIDInsensitively parses 'input' case-insensitively into a VCenterId +// note: this method should only be used for API response data and not user input +func ParseVCenterIDInsensitively(input string) (*VCenterId, error) { + parser := resourceids.NewParserFromResourceIdType(&VCenterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VCenterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VCenterId) 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.VCenterName, ok = input.Parsed["vCenterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "vCenterName", input) + } + + return nil +} + +// ValidateVCenterID checks that 'input' can be parsed as a V Center ID +func ValidateVCenterID(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 := ParseVCenterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted V Center ID +func (id VCenterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/vCenters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VCenterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this V Center ID +func (id VCenterId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticVCenters", "vCenters", "vCenters"), + resourceids.UserSpecifiedSegment("vCenterName", "vCenterValue"), + } +} + +// String returns a human-readable description of this V Center ID +func (id VCenterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("V Center Name: %q", id.VCenterName), + } + return fmt.Sprintf("V Center (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go new file mode 100644 index 00000000000..b91aa9e30af --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/id_vcenter_test.go @@ -0,0 +1,282 @@ +package vcenters + +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 = &VCenterId{} + +func TestNewVCenterID(t *testing.T) { + id := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue") + + 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.VCenterName != "vCenterValue" { + t.Fatalf("Expected %q but got %q for Segment 'VCenterName'", id.VCenterName, "vCenterValue") + } +} + +func TestFormatVCenterID(t *testing.T) { + actual := NewVCenterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vCenterValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVCenterID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VCenterId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue", + Expected: &VCenterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VCenterName: "vCenterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVCenterID(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.VCenterName != v.Expected.VCenterName { + t.Fatalf("Expected %q but got %q for VCenterName", v.Expected.VCenterName, actual.VCenterName) + } + + } +} + +func TestParseVCenterIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VCenterId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue", + Expected: &VCenterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VCenterName: "vCenterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/vCenters/vCenterValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE", + Expected: &VCenterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + VCenterName: "vCeNtErVaLuE", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/vCeNtErS/vCeNtErVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVCenterIDInsensitively(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.VCenterName != v.Expected.VCenterName { + t.Fatalf("Expected %q but got %q for VCenterName", v.Expected.VCenterName, actual.VCenterName) + } + + } +} + +func TestSegmentsForVCenterId(t *testing.T) { + segments := VCenterId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VCenterId 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/connectedvmware/2023-12-01/vcenters/method_create.go b/resource-manager/connectedvmware/2023-12-01/vcenters/method_create.go new file mode 100644 index 00000000000..dde8f2fee99 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/method_create.go @@ -0,0 +1,75 @@ +package vcenters + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VCenter +} + +// Create ... +func (c VCentersClient) Create(ctx context.Context, id VCenterId, input VCenter) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VCentersClient) CreateThenPoll(ctx context.Context, id VCenterId, input VCenter) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/method_delete.go b/resource-manager/connectedvmware/2023-12-01/vcenters/method_delete.go new file mode 100644 index 00000000000..84e20463573 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/method_delete.go @@ -0,0 +1,99 @@ +package vcenters + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 VCentersClient) Delete(ctx context.Context, id VCenterId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 VCentersClient) DeleteThenPoll(ctx context.Context, id VCenterId, 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/connectedvmware/2023-12-01/vcenters/method_get.go b/resource-manager/connectedvmware/2023-12-01/vcenters/method_get.go new file mode 100644 index 00000000000..acb1d306643 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/method_get.go @@ -0,0 +1,54 @@ +package vcenters + +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 *VCenter +} + +// Get ... +func (c VCentersClient) Get(ctx context.Context, id VCenterId) (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 VCenter + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/method_list.go b/resource-manager/connectedvmware/2023-12-01/vcenters/method_list.go new file mode 100644 index 00000000000..5b5232cf552 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/method_list.go @@ -0,0 +1,92 @@ +package vcenters + +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 *[]VCenter +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []VCenter +} + +// List ... +func (c VCentersClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/vCenters", 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 *[]VCenter `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 VCentersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VCenterOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VCentersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VCenterOperationPredicate) (result ListCompleteResult, err error) { + items := make([]VCenter, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/vcenters/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/vcenters/method_listbyresourcegroup.go new file mode 100644 index 00000000000..bd3c95fa4ea --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package vcenters + +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 *[]VCenter +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []VCenter +} + +// ListByResourceGroup ... +func (c VCentersClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/vCenters", 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 *[]VCenter `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 VCentersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VCenterOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VCentersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VCenterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VCenter, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/vcenters/method_update.go b/resource-manager/connectedvmware/2023-12-01/vcenters/method_update.go new file mode 100644 index 00000000000..e670bfec2f8 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/method_update.go @@ -0,0 +1,58 @@ +package vcenters + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VCenter +} + +// Update ... +func (c VCentersClient) Update(ctx context.Context, id VCenterId, input ResourcePatch) (result UpdateOperationResponse, 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 VCenter + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/vcenters/model_extendedlocation.go new file mode 100644 index 00000000000..c93190e9ed6 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/model_extendedlocation.go @@ -0,0 +1,9 @@ +package vcenters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcepatch.go new file mode 100644 index 00000000000..f33e17da99c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcepatch.go @@ -0,0 +1,8 @@ +package vcenters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcestatus.go new file mode 100644 index 00000000000..81ff16453ba --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/model_resourcestatus.go @@ -0,0 +1,31 @@ +package vcenters + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenter.go b/resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenter.go new file mode 100644 index 00000000000..ff007fe7fd2 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenter.go @@ -0,0 +1,20 @@ +package vcenters + +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 VCenter struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VCenterProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenterproperties.go b/resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenterproperties.go new file mode 100644 index 00000000000..0ec135ba6f0 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/model_vcenterproperties.go @@ -0,0 +1,17 @@ +package vcenters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VCenterProperties struct { + ConnectionStatus *string `json:"connectionStatus,omitempty"` + Credentials *VICredential `json:"credentials,omitempty"` + CustomResourceName *string `json:"customResourceName,omitempty"` + Fqdn string `json:"fqdn"` + InstanceUuid *string `json:"instanceUuid,omitempty"` + Port *int64 `json:"port,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + Uuid *string `json:"uuid,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/model_vicredential.go b/resource-manager/connectedvmware/2023-12-01/vcenters/model_vicredential.go new file mode 100644 index 00000000000..da7c9ec0515 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/model_vicredential.go @@ -0,0 +1,9 @@ +package vcenters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VICredential struct { + Password *string `json:"password,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vcenters/predicates.go b/resource-manager/connectedvmware/2023-12-01/vcenters/predicates.go new file mode 100644 index 00000000000..18c08c33685 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/predicates.go @@ -0,0 +1,37 @@ +package vcenters + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VCenterOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p VCenterOperationPredicate) Matches(input VCenter) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/vcenters/version.go b/resource-manager/connectedvmware/2023-12-01/vcenters/version.go new file mode 100644 index 00000000000..7a42a880dfc --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vcenters/version.go @@ -0,0 +1,12 @@ +package vcenters + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vcenters/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/README.md b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/README.md new file mode 100644 index 00000000000..fa7ad6648db --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/README.md @@ -0,0 +1,141 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances` Documentation + +The `virtualmachineinstances` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/virtualmachineinstances" +``` + + +### Client Initialization + +```go +client := virtualmachineinstances.NewVirtualMachineInstancesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualMachineInstancesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineInstance{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.DeleteThenPoll(ctx, id, virtualmachineinstances.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +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: `VirtualMachineInstancesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// 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: `VirtualMachineInstancesClient.Restart` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.RestartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Start` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.StartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Stop` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.StopVirtualMachineOptions{ + // ... +} + + +if err := client.StopThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineInstancesClient.Update` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := virtualmachineinstances.VirtualMachineInstanceUpdate{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/client.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/client.go similarity index 100% rename from resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/client.go rename to resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/client.go diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/constants.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/constants.go new file mode 100644 index 00000000000..dc8b7ce62c8 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/constants.go @@ -0,0 +1,492 @@ +package virtualmachineinstances + +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 DiskMode string + +const ( + DiskModeIndependentNonpersistent DiskMode = "independent_nonpersistent" + DiskModeIndependentPersistent DiskMode = "independent_persistent" + DiskModePersistent DiskMode = "persistent" +) + +func PossibleValuesForDiskMode() []string { + return []string{ + string(DiskModeIndependentNonpersistent), + string(DiskModeIndependentPersistent), + string(DiskModePersistent), + } +} + +func (s *DiskMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskMode(input string) (*DiskMode, error) { + vals := map[string]DiskMode{ + "independent_nonpersistent": DiskModeIndependentNonpersistent, + "independent_persistent": DiskModeIndependentPersistent, + "persistent": DiskModePersistent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskMode(input) + return &out, nil +} + +type DiskType string + +const ( + DiskTypeFlat DiskType = "flat" + DiskTypePmem DiskType = "pmem" + DiskTypeRawphysical DiskType = "rawphysical" + DiskTypeRawvirtual DiskType = "rawvirtual" + DiskTypeSesparse DiskType = "sesparse" + DiskTypeSparse DiskType = "sparse" + DiskTypeUnknown DiskType = "unknown" +) + +func PossibleValuesForDiskType() []string { + return []string{ + string(DiskTypeFlat), + string(DiskTypePmem), + string(DiskTypeRawphysical), + string(DiskTypeRawvirtual), + string(DiskTypeSesparse), + string(DiskTypeSparse), + string(DiskTypeUnknown), + } +} + +func (s *DiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskType(input string) (*DiskType, error) { + vals := map[string]DiskType{ + "flat": DiskTypeFlat, + "pmem": DiskTypePmem, + "rawphysical": DiskTypeRawphysical, + "rawvirtual": DiskTypeRawvirtual, + "sesparse": DiskTypeSesparse, + "sparse": DiskTypeSparse, + "unknown": DiskTypeUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskType(input) + return &out, nil +} + +type FirmwareType string + +const ( + FirmwareTypeBios FirmwareType = "bios" + FirmwareTypeEfi FirmwareType = "efi" +) + +func PossibleValuesForFirmwareType() []string { + return []string{ + string(FirmwareTypeBios), + string(FirmwareTypeEfi), + } +} + +func (s *FirmwareType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFirmwareType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFirmwareType(input string) (*FirmwareType, error) { + vals := map[string]FirmwareType{ + "bios": FirmwareTypeBios, + "efi": FirmwareTypeEfi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FirmwareType(input) + return &out, nil +} + +type IPAddressAllocationMethod string + +const ( + IPAddressAllocationMethodDynamic IPAddressAllocationMethod = "dynamic" + IPAddressAllocationMethodLinklayer IPAddressAllocationMethod = "linklayer" + IPAddressAllocationMethodOther IPAddressAllocationMethod = "other" + IPAddressAllocationMethodRandom IPAddressAllocationMethod = "random" + IPAddressAllocationMethodStatic IPAddressAllocationMethod = "static" + IPAddressAllocationMethodUnset IPAddressAllocationMethod = "unset" +) + +func PossibleValuesForIPAddressAllocationMethod() []string { + return []string{ + string(IPAddressAllocationMethodDynamic), + string(IPAddressAllocationMethodLinklayer), + string(IPAddressAllocationMethodOther), + string(IPAddressAllocationMethodRandom), + string(IPAddressAllocationMethodStatic), + string(IPAddressAllocationMethodUnset), + } +} + +func (s *IPAddressAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAddressAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAddressAllocationMethod(input string) (*IPAddressAllocationMethod, error) { + vals := map[string]IPAddressAllocationMethod{ + "dynamic": IPAddressAllocationMethodDynamic, + "linklayer": IPAddressAllocationMethodLinklayer, + "other": IPAddressAllocationMethodOther, + "random": IPAddressAllocationMethodRandom, + "static": IPAddressAllocationMethodStatic, + "unset": IPAddressAllocationMethodUnset, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAddressAllocationMethod(input) + return &out, nil +} + +type NICType string + +const ( + NICTypeEOneThousand NICType = "e1000" + NICTypeEOneThousande NICType = "e1000e" + NICTypePcnetThreeTwo NICType = "pcnet32" + NICTypeVMxnet NICType = "vmxnet" + NICTypeVMxnetThree NICType = "vmxnet3" + NICTypeVMxnetTwo NICType = "vmxnet2" +) + +func PossibleValuesForNICType() []string { + return []string{ + string(NICTypeEOneThousand), + string(NICTypeEOneThousande), + string(NICTypePcnetThreeTwo), + string(NICTypeVMxnet), + string(NICTypeVMxnetThree), + string(NICTypeVMxnetTwo), + } +} + +func (s *NICType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNICType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNICType(input string) (*NICType, error) { + vals := map[string]NICType{ + "e1000": NICTypeEOneThousand, + "e1000e": NICTypeEOneThousande, + "pcnet32": NICTypePcnetThreeTwo, + "vmxnet": NICTypeVMxnet, + "vmxnet3": NICTypeVMxnetThree, + "vmxnet2": NICTypeVMxnetTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NICType(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeOther OsType = "Other" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeOther), + 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, + "other": OsTypeOther, + "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 PowerOnBootOption string + +const ( + PowerOnBootOptionDisabled PowerOnBootOption = "disabled" + PowerOnBootOptionEnabled PowerOnBootOption = "enabled" +) + +func PossibleValuesForPowerOnBootOption() []string { + return []string{ + string(PowerOnBootOptionDisabled), + string(PowerOnBootOptionEnabled), + } +} + +func (s *PowerOnBootOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePowerOnBootOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePowerOnBootOption(input string) (*PowerOnBootOption, error) { + vals := map[string]PowerOnBootOption{ + "disabled": PowerOnBootOptionDisabled, + "enabled": PowerOnBootOptionEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PowerOnBootOption(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type SCSIControllerType string + +const ( + SCSIControllerTypeBuslogic SCSIControllerType = "buslogic" + SCSIControllerTypeLsilogic SCSIControllerType = "lsilogic" + SCSIControllerTypeLsilogicsas SCSIControllerType = "lsilogicsas" + SCSIControllerTypePvscsi SCSIControllerType = "pvscsi" +) + +func PossibleValuesForSCSIControllerType() []string { + return []string{ + string(SCSIControllerTypeBuslogic), + string(SCSIControllerTypeLsilogic), + string(SCSIControllerTypeLsilogicsas), + string(SCSIControllerTypePvscsi), + } +} + +func (s *SCSIControllerType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSCSIControllerType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSCSIControllerType(input string) (*SCSIControllerType, error) { + vals := map[string]SCSIControllerType{ + "buslogic": SCSIControllerTypeBuslogic, + "lsilogic": SCSIControllerTypeLsilogic, + "lsilogicsas": SCSIControllerTypeLsilogicsas, + "pvscsi": SCSIControllerTypePvscsi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SCSIControllerType(input) + return &out, nil +} + +type VirtualSCSISharing string + +const ( + VirtualSCSISharingNoSharing VirtualSCSISharing = "noSharing" + VirtualSCSISharingPhysicalSharing VirtualSCSISharing = "physicalSharing" + VirtualSCSISharingVirtualSharing VirtualSCSISharing = "virtualSharing" +) + +func PossibleValuesForVirtualSCSISharing() []string { + return []string{ + string(VirtualSCSISharingNoSharing), + string(VirtualSCSISharingPhysicalSharing), + string(VirtualSCSISharingVirtualSharing), + } +} + +func (s *VirtualSCSISharing) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualSCSISharing(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualSCSISharing(input string) (*VirtualSCSISharing, error) { + vals := map[string]VirtualSCSISharing{ + "nosharing": VirtualSCSISharingNoSharing, + "physicalsharing": VirtualSCSISharingPhysicalSharing, + "virtualsharing": VirtualSCSISharingVirtualSharing, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualSCSISharing(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_createorupdate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_createorupdate.go new file mode 100644 index 00000000000..196eb38e236 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_createorupdate.go @@ -0,0 +1,76 @@ +package virtualmachineinstances + +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 *VirtualMachineInstance +} + +// CreateOrUpdate ... +func (c VirtualMachineInstancesClient) CreateOrUpdate(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstance) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default", 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 VirtualMachineInstancesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstance) error { + result, err := c.CreateOrUpdate(ctx, id, input) + 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/connectedvmware/2023-12-01/virtualmachineinstances/method_delete.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_delete.go new file mode 100644 index 00000000000..9e6b59648f4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_delete.go @@ -0,0 +1,103 @@ +package virtualmachineinstances + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +type DeleteOperationOptions struct { + DeleteFromHost *bool + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.DeleteFromHost != nil { + out.Append("deleteFromHost", fmt.Sprintf("%v", *o.DeleteFromHost)) + } + if o.Force != nil { + out.Append("force", fmt.Sprintf("%v", *o.Force)) + } + return &out +} + +// Delete ... +func (c VirtualMachineInstancesClient) Delete(ctx context.Context, id commonids.ScopeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default", id.ID()), + OptionsObject: options, + } + + 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 VirtualMachineInstancesClient) DeleteThenPoll(ctx context.Context, id commonids.ScopeId, 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/connectedvmware/2023-12-01/virtualmachineinstances/method_get.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_get.go new file mode 100644 index 00000000000..07c230080f8 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_get.go @@ -0,0 +1,56 @@ +package virtualmachineinstances + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualMachineInstance +} + +// Get ... +func (c VirtualMachineInstancesClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/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 VirtualMachineInstance + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_list.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_list.go new file mode 100644 index 00000000000..6b41535aace --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_list.go @@ -0,0 +1,92 @@ +package virtualmachineinstances + +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 *[]VirtualMachineInstance +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualMachineInstance +} + +// List ... +func (c VirtualMachineInstancesClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances", 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 *[]VirtualMachineInstance `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 VirtualMachineInstancesClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VirtualMachineInstanceOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualMachineInstancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate VirtualMachineInstanceOperationPredicate) (result ListCompleteResult, err error) { + items := make([]VirtualMachineInstance, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_restart.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_restart.go similarity index 91% rename from resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_restart.go rename to resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_restart.go index 34a84430c7c..f728dd445d7 100644 --- a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/method_restart.go +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_restart.go @@ -19,7 +19,6 @@ type RestartOperationResponse struct { Poller pollers.Poller HttpResponse *http.Response OData *odata.OData - Model *VirtualMachineInstance } // Restart ... @@ -28,10 +27,9 @@ func (c VirtualMachineInstancesClient) Restart(ctx context.Context, id commonids ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ http.StatusAccepted, - http.StatusOK, }, HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.AzureStackHCI/virtualMachineInstances/default/restart", id.ID()), + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/restart", id.ID()), } req, err := c.Client.NewRequest(ctx, opts) diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_start.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_start.go new file mode 100644 index 00000000000..d47c51754ef --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_start.go @@ -0,0 +1,70 @@ +package virtualmachineinstances + +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 VirtualMachineInstancesClient) Start(ctx context.Context, id commonids.ScopeId) (result StartOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/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 VirtualMachineInstancesClient) StartThenPoll(ctx context.Context, id commonids.ScopeId) 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/connectedvmware/2023-12-01/virtualmachineinstances/method_stop.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_stop.go new file mode 100644 index 00000000000..0498fa3d8f5 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_stop.go @@ -0,0 +1,74 @@ +package virtualmachineinstances + +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 VirtualMachineInstancesClient) Stop(ctx context.Context, id commonids.ScopeId, input StopVirtualMachineOptions) (result StopOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/stop", 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 +} + +// StopThenPoll performs Stop then polls until it's completed +func (c VirtualMachineInstancesClient) StopThenPoll(ctx context.Context, id commonids.ScopeId, input StopVirtualMachineOptions) error { + result, err := c.Stop(ctx, id, input) + 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/connectedvmware/2023-12-01/virtualmachineinstances/method_update.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_update.go new file mode 100644 index 00000000000..7d18d7a2e1c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/method_update.go @@ -0,0 +1,76 @@ +package virtualmachineinstances + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VirtualMachineInstance +} + +// Update ... +func (c VirtualMachineInstancesClient) Update(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstanceUpdate) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPatch, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default", 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 +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VirtualMachineInstancesClient) UpdateThenPoll(ctx context.Context, id commonids.ScopeId, input VirtualMachineInstanceUpdate) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_extendedlocation.go new file mode 100644 index 00000000000..a86814d6f62 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_extendedlocation.go @@ -0,0 +1,9 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_hardwareprofile.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_hardwareprofile.go new file mode 100644 index 00000000000..68f1bc17e56 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_hardwareprofile.go @@ -0,0 +1,13 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HardwareProfile struct { + CpuHotAddEnabled *bool `json:"cpuHotAddEnabled,omitempty"` + CpuHotRemoveEnabled *bool `json:"cpuHotRemoveEnabled,omitempty"` + MemoryHotAddEnabled *bool `json:"memoryHotAddEnabled,omitempty"` + MemorySizeMB *int64 `json:"memorySizeMB,omitempty"` + NumCPUs *int64 `json:"numCPUs,omitempty"` + NumCoresPerSocket *int64 `json:"numCoresPerSocket,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_infrastructureprofile.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_infrastructureprofile.go new file mode 100644 index 00000000000..0a8bd09f3c5 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_infrastructureprofile.go @@ -0,0 +1,17 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type InfrastructureProfile struct { + CustomResourceName *string `json:"customResourceName,omitempty"` + FirmwareType *FirmwareType `json:"firmwareType,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + InstanceUuid *string `json:"instanceUuid,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + SmbiosUuid *string `json:"smbiosUuid,omitempty"` + TemplateId *string `json:"templateId,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterface.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterface.go new file mode 100644 index 00000000000..6bfa3c4309e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterface.go @@ -0,0 +1,18 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterface struct { + DeviceKey *int64 `json:"deviceKey,omitempty"` + IPAddresses *[]string `json:"ipAddresses,omitempty"` + IPSettings *NicIPSettings `json:"ipSettings,omitempty"` + Label *string `json:"label,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Name *string `json:"name,omitempty"` + NetworkId *string `json:"networkId,omitempty"` + NetworkMoName *string `json:"networkMoName,omitempty"` + NetworkMoRefId *string `json:"networkMoRefId,omitempty"` + NicType *NICType `json:"nicType,omitempty"` + PowerOnBoot *PowerOnBootOption `json:"powerOnBoot,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterfaceupdate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterfaceupdate.go new file mode 100644 index 00000000000..6d2fef32e83 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkinterfaceupdate.go @@ -0,0 +1,12 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfaceUpdate struct { + DeviceKey *int64 `json:"deviceKey,omitempty"` + Name *string `json:"name,omitempty"` + NetworkId *string `json:"networkId,omitempty"` + NicType *NICType `json:"nicType,omitempty"` + PowerOnBoot *PowerOnBootOption `json:"powerOnBoot,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofile.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofile.go new file mode 100644 index 00000000000..b1085e716f8 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofile.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfile struct { + NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofileupdate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofileupdate.go new file mode 100644 index 00000000000..dcc323d7f68 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_networkprofileupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkProfileUpdate struct { + NetworkInterfaces *[]NetworkInterfaceUpdate `json:"networkInterfaces,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipaddresssettings.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipaddresssettings.go new file mode 100644 index 00000000000..9daaf3ed819 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipaddresssettings.go @@ -0,0 +1,10 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicIPAddressSettings struct { + AllocationMethod *string `json:"allocationMethod,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + SubnetMask *string `json:"subnetMask,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipsettings.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipsettings.go new file mode 100644 index 00000000000..8bd5ebcb93c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_nicipsettings.go @@ -0,0 +1,15 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicIPSettings struct { + AllocationMethod *IPAddressAllocationMethod `json:"allocationMethod,omitempty"` + DnsServers *[]string `json:"dnsServers,omitempty"` + Gateway *[]string `json:"gateway,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + IPAddressInfo *[]NicIPAddressSettings `json:"ipAddressInfo,omitempty"` + PrimaryWinsServer *string `json:"primaryWinsServer,omitempty"` + SecondaryWinsServer *string `json:"secondaryWinsServer,omitempty"` + SubnetMask *string `json:"subnetMask,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_osprofileforvminstance.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_osprofileforvminstance.go new file mode 100644 index 00000000000..a38e84a904d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_osprofileforvminstance.go @@ -0,0 +1,17 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type OsProfileForVMInstance struct { + AdminPassword *string `json:"adminPassword,omitempty"` + AdminUsername *string `json:"adminUsername,omitempty"` + ComputerName *string `json:"computerName,omitempty"` + GuestId *string `json:"guestId,omitempty"` + OsSku *string `json:"osSku,omitempty"` + OsType *OsType `json:"osType,omitempty"` + ToolsRunningStatus *string `json:"toolsRunningStatus,omitempty"` + ToolsVersion *string `json:"toolsVersion,omitempty"` + ToolsVersionStatus *string `json:"toolsVersionStatus,omitempty"` + WindowsConfiguration *WindowsConfiguration `json:"windowsConfiguration,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_placementprofile.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_placementprofile.go new file mode 100644 index 00000000000..158107ee61d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_placementprofile.go @@ -0,0 +1,11 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementProfile struct { + ClusterId *string `json:"clusterId,omitempty"` + DatastoreId *string `json:"datastoreId,omitempty"` + HostId *string `json:"hostId,omitempty"` + ResourcePoolId *string `json:"resourcePoolId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_resourcestatus.go new file mode 100644 index 00000000000..1d8bd272860 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_resourcestatus.go @@ -0,0 +1,31 @@ +package virtualmachineinstances + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_securityprofile.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_securityprofile.go new file mode 100644 index 00000000000..3de5f0ee0e2 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_securityprofile.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityProfile struct { + UefiSettings *UefiSettings `json:"uefiSettings,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_stopvirtualmachineoptions.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_stopvirtualmachineoptions.go new file mode 100644 index 00000000000..bfc338be073 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_stopvirtualmachineoptions.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StopVirtualMachineOptions struct { + SkipShutdown *bool `json:"skipShutdown,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofile.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofile.go new file mode 100644 index 00000000000..bafb1993d25 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofile.go @@ -0,0 +1,9 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfile struct { + Disks *[]VirtualDisk `json:"disks,omitempty"` + ScsiControllers *[]VirtualSCSIController `json:"scsiControllers,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofileupdate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofileupdate.go new file mode 100644 index 00000000000..c9b1f05dc0c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_storageprofileupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type StorageProfileUpdate struct { + Disks *[]VirtualDiskUpdate `json:"disks,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_uefisettings.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_uefisettings.go new file mode 100644 index 00000000000..63fccf4553b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_uefisettings.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UefiSettings struct { + SecureBootEnabled *bool `json:"secureBootEnabled,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdisk.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdisk.go new file mode 100644 index 00000000000..7b248f25a5b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdisk.go @@ -0,0 +1,17 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDisk struct { + ControllerKey *int64 `json:"controllerKey,omitempty"` + DeviceKey *int64 `json:"deviceKey,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DiskMode *DiskMode `json:"diskMode,omitempty"` + DiskObjectId *string `json:"diskObjectId,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DiskType *DiskType `json:"diskType,omitempty"` + Label *string `json:"label,omitempty"` + Name *string `json:"name,omitempty"` + UnitNumber *int64 `json:"unitNumber,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdiskupdate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdiskupdate.go new file mode 100644 index 00000000000..3fdf4158a70 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualdiskupdate.go @@ -0,0 +1,15 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDiskUpdate struct { + ControllerKey *int64 `json:"controllerKey,omitempty"` + DeviceKey *int64 `json:"deviceKey,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DiskMode *DiskMode `json:"diskMode,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DiskType *DiskType `json:"diskType,omitempty"` + Name *string `json:"name,omitempty"` + UnitNumber *int64 `json:"unitNumber,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstance.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstance.go new file mode 100644 index 00000000000..087d1197bea --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstance.go @@ -0,0 +1,17 @@ +package virtualmachineinstances + +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 VirtualMachineInstance struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VirtualMachineInstanceProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceproperties.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceproperties.go new file mode 100644 index 00000000000..7cfb03f9cdd --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceproperties.go @@ -0,0 +1,18 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceProperties struct { + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + InfrastructureProfile *InfrastructureProfile `json:"infrastructureProfile,omitempty"` + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + OsProfile *OsProfileForVMInstance `json:"osProfile,omitempty"` + PlacementProfile *PlacementProfile `json:"placementProfile,omitempty"` + PowerState *string `json:"powerState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceUid *string `json:"resourceUid,omitempty"` + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + StorageProfile *StorageProfile `json:"storageProfile,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdate.go new file mode 100644 index 00000000000..f95bd091276 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdate.go @@ -0,0 +1,8 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceUpdate struct { + Properties *VirtualMachineInstanceUpdateProperties `json:"properties,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go new file mode 100644 index 00000000000..a5e190d27b2 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualmachineinstanceupdateproperties.go @@ -0,0 +1,10 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineInstanceUpdateProperties struct { + HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` + NetworkProfile *NetworkProfileUpdate `json:"networkProfile,omitempty"` + StorageProfile *StorageProfileUpdate `json:"storageProfile,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualscsicontroller.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualscsicontroller.go new file mode 100644 index 00000000000..df96b63fec9 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_virtualscsicontroller.go @@ -0,0 +1,12 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualSCSIController struct { + BusNumber *int64 `json:"busNumber,omitempty"` + ControllerKey *int64 `json:"controllerKey,omitempty"` + ScsiCtlrUnitNumber *int64 `json:"scsiCtlrUnitNumber,omitempty"` + Sharing *VirtualSCSISharing `json:"sharing,omitempty"` + Type *SCSIControllerType `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_windowsconfiguration.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_windowsconfiguration.go new file mode 100644 index 00000000000..525843284e4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/model_windowsconfiguration.go @@ -0,0 +1,18 @@ +package virtualmachineinstances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WindowsConfiguration struct { + AutoLogon *bool `json:"autoLogon,omitempty"` + AutoLogonCount *int64 `json:"autoLogonCount,omitempty"` + DomainName *string `json:"domainName,omitempty"` + DomainUserPassword *string `json:"domainUserPassword,omitempty"` + DomainUsername *string `json:"domainUsername,omitempty"` + FirstLogonCommands *[]string `json:"firstLogonCommands,omitempty"` + FullName *string `json:"fullName,omitempty"` + OrgName *string `json:"orgName,omitempty"` + ProductId *string `json:"productId,omitempty"` + TimeZone *string `json:"timeZone,omitempty"` + WorkGroupName *string `json:"workGroupName,omitempty"` +} diff --git a/resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/predicates.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/predicates.go similarity index 100% rename from resource-manager/azurestackhci/2023-09-01-preview/virtualmachineinstances/predicates.go rename to resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/predicates.go diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/version.go b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/version.go new file mode 100644 index 00000000000..e9fdffdfd71 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachineinstances/version.go @@ -0,0 +1,12 @@ +package virtualmachineinstances + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachineinstances/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/README.md b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/README.md new file mode 100644 index 00000000000..163646fc43f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates` Documentation + +The `virtualmachinetemplates` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/virtualmachinetemplates" +``` + + +### Client Initialization + +```go +client := virtualmachinetemplates.NewVirtualMachineTemplatesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualMachineTemplatesClient.Create` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +payload := virtualmachinetemplates.VirtualMachineTemplate{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineTemplatesClient.Delete` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +if err := client.DeleteThenPoll(ctx, id, virtualmachinetemplates.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualMachineTemplatesClient.Get` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +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: `VirtualMachineTemplatesClient.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: `VirtualMachineTemplatesClient.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: `VirtualMachineTemplatesClient.Update` + +```go +ctx := context.TODO() +id := virtualmachinetemplates.NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + +payload := virtualmachinetemplates.ResourcePatch{ + // ... +} + + +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/connectedvmware/2023-12-01/virtualmachinetemplates/client.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/client.go new file mode 100644 index 00000000000..12c5314c789 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/client.go @@ -0,0 +1,26 @@ +package virtualmachinetemplates + +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 VirtualMachineTemplatesClient struct { + Client *resourcemanager.Client +} + +func NewVirtualMachineTemplatesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachineTemplatesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualmachinetemplates", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VirtualMachineTemplatesClient: %+v", err) + } + + return &VirtualMachineTemplatesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/constants.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/constants.go new file mode 100644 index 00000000000..567ae8de9ca --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/constants.go @@ -0,0 +1,401 @@ +package virtualmachinetemplates + +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 DiskMode string + +const ( + DiskModeIndependentNonpersistent DiskMode = "independent_nonpersistent" + DiskModeIndependentPersistent DiskMode = "independent_persistent" + DiskModePersistent DiskMode = "persistent" +) + +func PossibleValuesForDiskMode() []string { + return []string{ + string(DiskModeIndependentNonpersistent), + string(DiskModeIndependentPersistent), + string(DiskModePersistent), + } +} + +func (s *DiskMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskMode(input string) (*DiskMode, error) { + vals := map[string]DiskMode{ + "independent_nonpersistent": DiskModeIndependentNonpersistent, + "independent_persistent": DiskModeIndependentPersistent, + "persistent": DiskModePersistent, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskMode(input) + return &out, nil +} + +type DiskType string + +const ( + DiskTypeFlat DiskType = "flat" + DiskTypePmem DiskType = "pmem" + DiskTypeRawphysical DiskType = "rawphysical" + DiskTypeRawvirtual DiskType = "rawvirtual" + DiskTypeSesparse DiskType = "sesparse" + DiskTypeSparse DiskType = "sparse" + DiskTypeUnknown DiskType = "unknown" +) + +func PossibleValuesForDiskType() []string { + return []string{ + string(DiskTypeFlat), + string(DiskTypePmem), + string(DiskTypeRawphysical), + string(DiskTypeRawvirtual), + string(DiskTypeSesparse), + string(DiskTypeSparse), + string(DiskTypeUnknown), + } +} + +func (s *DiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDiskType(input string) (*DiskType, error) { + vals := map[string]DiskType{ + "flat": DiskTypeFlat, + "pmem": DiskTypePmem, + "rawphysical": DiskTypeRawphysical, + "rawvirtual": DiskTypeRawvirtual, + "sesparse": DiskTypeSesparse, + "sparse": DiskTypeSparse, + "unknown": DiskTypeUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DiskType(input) + return &out, nil +} + +type FirmwareType string + +const ( + FirmwareTypeBios FirmwareType = "bios" + FirmwareTypeEfi FirmwareType = "efi" +) + +func PossibleValuesForFirmwareType() []string { + return []string{ + string(FirmwareTypeBios), + string(FirmwareTypeEfi), + } +} + +func (s *FirmwareType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFirmwareType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFirmwareType(input string) (*FirmwareType, error) { + vals := map[string]FirmwareType{ + "bios": FirmwareTypeBios, + "efi": FirmwareTypeEfi, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FirmwareType(input) + return &out, nil +} + +type IPAddressAllocationMethod string + +const ( + IPAddressAllocationMethodDynamic IPAddressAllocationMethod = "dynamic" + IPAddressAllocationMethodLinklayer IPAddressAllocationMethod = "linklayer" + IPAddressAllocationMethodOther IPAddressAllocationMethod = "other" + IPAddressAllocationMethodRandom IPAddressAllocationMethod = "random" + IPAddressAllocationMethodStatic IPAddressAllocationMethod = "static" + IPAddressAllocationMethodUnset IPAddressAllocationMethod = "unset" +) + +func PossibleValuesForIPAddressAllocationMethod() []string { + return []string{ + string(IPAddressAllocationMethodDynamic), + string(IPAddressAllocationMethodLinklayer), + string(IPAddressAllocationMethodOther), + string(IPAddressAllocationMethodRandom), + string(IPAddressAllocationMethodStatic), + string(IPAddressAllocationMethodUnset), + } +} + +func (s *IPAddressAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAddressAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAddressAllocationMethod(input string) (*IPAddressAllocationMethod, error) { + vals := map[string]IPAddressAllocationMethod{ + "dynamic": IPAddressAllocationMethodDynamic, + "linklayer": IPAddressAllocationMethodLinklayer, + "other": IPAddressAllocationMethodOther, + "random": IPAddressAllocationMethodRandom, + "static": IPAddressAllocationMethodStatic, + "unset": IPAddressAllocationMethodUnset, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAddressAllocationMethod(input) + return &out, nil +} + +type NICType string + +const ( + NICTypeEOneThousand NICType = "e1000" + NICTypeEOneThousande NICType = "e1000e" + NICTypePcnetThreeTwo NICType = "pcnet32" + NICTypeVMxnet NICType = "vmxnet" + NICTypeVMxnetThree NICType = "vmxnet3" + NICTypeVMxnetTwo NICType = "vmxnet2" +) + +func PossibleValuesForNICType() []string { + return []string{ + string(NICTypeEOneThousand), + string(NICTypeEOneThousande), + string(NICTypePcnetThreeTwo), + string(NICTypeVMxnet), + string(NICTypeVMxnetThree), + string(NICTypeVMxnetTwo), + } +} + +func (s *NICType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNICType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNICType(input string) (*NICType, error) { + vals := map[string]NICType{ + "e1000": NICTypeEOneThousand, + "e1000e": NICTypeEOneThousande, + "pcnet32": NICTypePcnetThreeTwo, + "vmxnet": NICTypeVMxnet, + "vmxnet3": NICTypeVMxnetThree, + "vmxnet2": NICTypeVMxnetTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NICType(input) + return &out, nil +} + +type OsType string + +const ( + OsTypeLinux OsType = "Linux" + OsTypeOther OsType = "Other" + OsTypeWindows OsType = "Windows" +) + +func PossibleValuesForOsType() []string { + return []string{ + string(OsTypeLinux), + string(OsTypeOther), + 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, + "other": OsTypeOther, + "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 PowerOnBootOption string + +const ( + PowerOnBootOptionDisabled PowerOnBootOption = "disabled" + PowerOnBootOptionEnabled PowerOnBootOption = "enabled" +) + +func PossibleValuesForPowerOnBootOption() []string { + return []string{ + string(PowerOnBootOptionDisabled), + string(PowerOnBootOptionEnabled), + } +} + +func (s *PowerOnBootOption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePowerOnBootOption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePowerOnBootOption(input string) (*PowerOnBootOption, error) { + vals := map[string]PowerOnBootOption{ + "disabled": PowerOnBootOptionDisabled, + "enabled": PowerOnBootOptionEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PowerOnBootOption(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate.go new file mode 100644 index 00000000000..6cb805ff3db --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate.go @@ -0,0 +1,130 @@ +package virtualmachinetemplates + +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(&VirtualMachineTemplateId{}) +} + +var _ resourceids.ResourceId = &VirtualMachineTemplateId{} + +// VirtualMachineTemplateId is a struct representing the Resource ID for a Virtual Machine Template +type VirtualMachineTemplateId struct { + SubscriptionId string + ResourceGroupName string + VirtualMachineTemplateName string +} + +// NewVirtualMachineTemplateID returns a new VirtualMachineTemplateId struct +func NewVirtualMachineTemplateID(subscriptionId string, resourceGroupName string, virtualMachineTemplateName string) VirtualMachineTemplateId { + return VirtualMachineTemplateId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VirtualMachineTemplateName: virtualMachineTemplateName, + } +} + +// ParseVirtualMachineTemplateID parses 'input' into a VirtualMachineTemplateId +func ParseVirtualMachineTemplateID(input string) (*VirtualMachineTemplateId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualMachineTemplateId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualMachineTemplateId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVirtualMachineTemplateIDInsensitively parses 'input' case-insensitively into a VirtualMachineTemplateId +// note: this method should only be used for API response data and not user input +func ParseVirtualMachineTemplateIDInsensitively(input string) (*VirtualMachineTemplateId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualMachineTemplateId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualMachineTemplateId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VirtualMachineTemplateId) 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.VirtualMachineTemplateName, ok = input.Parsed["virtualMachineTemplateName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineTemplateName", input) + } + + return nil +} + +// ValidateVirtualMachineTemplateID checks that 'input' can be parsed as a Virtual Machine Template ID +func ValidateVirtualMachineTemplateID(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 := ParseVirtualMachineTemplateID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Machine Template ID +func (id VirtualMachineTemplateId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineTemplateName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Template ID +func (id VirtualMachineTemplateId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticVirtualMachineTemplates", "virtualMachineTemplates", "virtualMachineTemplates"), + resourceids.UserSpecifiedSegment("virtualMachineTemplateName", "virtualMachineTemplateValue"), + } +} + +// String returns a human-readable description of this Virtual Machine Template ID +func (id VirtualMachineTemplateId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Virtual Machine Template Name: %q", id.VirtualMachineTemplateName), + } + return fmt.Sprintf("Virtual Machine Template (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate_test.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate_test.go new file mode 100644 index 00000000000..82d5342bd6a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/id_virtualmachinetemplate_test.go @@ -0,0 +1,282 @@ +package virtualmachinetemplates + +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 = &VirtualMachineTemplateId{} + +func TestNewVirtualMachineTemplateID(t *testing.T) { + id := NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue") + + 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.VirtualMachineTemplateName != "virtualMachineTemplateValue" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineTemplateName'", id.VirtualMachineTemplateName, "virtualMachineTemplateValue") + } +} + +func TestFormatVirtualMachineTemplateID(t *testing.T) { + actual := NewVirtualMachineTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineTemplateValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/virtualMachineTemplateValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVirtualMachineTemplateID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VirtualMachineTemplateId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/virtualMachineTemplateValue", + Expected: &VirtualMachineTemplateId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VirtualMachineTemplateName: "virtualMachineTemplateValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/virtualMachineTemplateValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVirtualMachineTemplateID(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.VirtualMachineTemplateName != v.Expected.VirtualMachineTemplateName { + t.Fatalf("Expected %q but got %q for VirtualMachineTemplateName", v.Expected.VirtualMachineTemplateName, actual.VirtualMachineTemplateName) + } + + } +} + +func TestParseVirtualMachineTemplateIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VirtualMachineTemplateId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEtEmPlAtEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/virtualMachineTemplateValue", + Expected: &VirtualMachineTemplateId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VirtualMachineTemplateName: "virtualMachineTemplateValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates/virtualMachineTemplateValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEtEmPlAtEs/vIrTuAlMaChInEtEmPlAtEvAlUe", + Expected: &VirtualMachineTemplateId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + VirtualMachineTemplateName: "vIrTuAlMaChInEtEmPlAtEvAlUe", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/vIrTuAlMaChInEtEmPlAtEs/vIrTuAlMaChInEtEmPlAtEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVirtualMachineTemplateIDInsensitively(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.VirtualMachineTemplateName != v.Expected.VirtualMachineTemplateName { + t.Fatalf("Expected %q but got %q for VirtualMachineTemplateName", v.Expected.VirtualMachineTemplateName, actual.VirtualMachineTemplateName) + } + + } +} + +func TestSegmentsForVirtualMachineTemplateId(t *testing.T) { + segments := VirtualMachineTemplateId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VirtualMachineTemplateId 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/connectedvmware/2023-12-01/virtualmachinetemplates/method_create.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_create.go new file mode 100644 index 00000000000..a29aa4c0b9f --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_create.go @@ -0,0 +1,75 @@ +package virtualmachinetemplates + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VirtualMachineTemplate +} + +// Create ... +func (c VirtualMachineTemplatesClient) Create(ctx context.Context, id VirtualMachineTemplateId, input VirtualMachineTemplate) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VirtualMachineTemplatesClient) CreateThenPoll(ctx context.Context, id VirtualMachineTemplateId, input VirtualMachineTemplate) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_delete.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_delete.go new file mode 100644 index 00000000000..fd4c13d2e02 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_delete.go @@ -0,0 +1,99 @@ +package virtualmachinetemplates + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 VirtualMachineTemplatesClient) Delete(ctx context.Context, id VirtualMachineTemplateId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 VirtualMachineTemplatesClient) DeleteThenPoll(ctx context.Context, id VirtualMachineTemplateId, 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/connectedvmware/2023-12-01/virtualmachinetemplates/method_get.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_get.go new file mode 100644 index 00000000000..9792aa1db2b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_get.go @@ -0,0 +1,54 @@ +package virtualmachinetemplates + +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 *VirtualMachineTemplate +} + +// Get ... +func (c VirtualMachineTemplatesClient) Get(ctx context.Context, id VirtualMachineTemplateId) (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 VirtualMachineTemplate + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_list.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_list.go new file mode 100644 index 00000000000..60ceee6dc84 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_list.go @@ -0,0 +1,92 @@ +package virtualmachinetemplates + +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 *[]VirtualMachineTemplate +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualMachineTemplate +} + +// List ... +func (c VirtualMachineTemplatesClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates", 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 *[]VirtualMachineTemplate `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 VirtualMachineTemplatesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VirtualMachineTemplateOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualMachineTemplatesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualMachineTemplateOperationPredicate) (result ListCompleteResult, err error) { + items := make([]VirtualMachineTemplate, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/virtualmachinetemplates/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_listbyresourcegroup.go new file mode 100644 index 00000000000..cca1bde57a4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package virtualmachinetemplates + +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 *[]VirtualMachineTemplate +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualMachineTemplate +} + +// ListByResourceGroup ... +func (c VirtualMachineTemplatesClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineTemplates", 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 *[]VirtualMachineTemplate `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 VirtualMachineTemplatesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualMachineTemplateOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualMachineTemplatesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualMachineTemplateOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VirtualMachineTemplate, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/virtualmachinetemplates/method_update.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_update.go new file mode 100644 index 00000000000..3dd48db9cfe --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/method_update.go @@ -0,0 +1,58 @@ +package virtualmachinetemplates + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualMachineTemplate +} + +// Update ... +func (c VirtualMachineTemplatesClient) Update(ctx context.Context, id VirtualMachineTemplateId, input ResourcePatch) (result UpdateOperationResponse, 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 VirtualMachineTemplate + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_extendedlocation.go new file mode 100644 index 00000000000..7be44f38373 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_extendedlocation.go @@ -0,0 +1,9 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_networkinterface.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_networkinterface.go new file mode 100644 index 00000000000..a3509e8df12 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_networkinterface.go @@ -0,0 +1,18 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterface struct { + DeviceKey *int64 `json:"deviceKey,omitempty"` + IPAddresses *[]string `json:"ipAddresses,omitempty"` + IPSettings *NicIPSettings `json:"ipSettings,omitempty"` + Label *string `json:"label,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + Name *string `json:"name,omitempty"` + NetworkId *string `json:"networkId,omitempty"` + NetworkMoName *string `json:"networkMoName,omitempty"` + NetworkMoRefId *string `json:"networkMoRefId,omitempty"` + NicType *NICType `json:"nicType,omitempty"` + PowerOnBoot *PowerOnBootOption `json:"powerOnBoot,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipaddresssettings.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipaddresssettings.go new file mode 100644 index 00000000000..d86dada01c6 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipaddresssettings.go @@ -0,0 +1,10 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicIPAddressSettings struct { + AllocationMethod *string `json:"allocationMethod,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + SubnetMask *string `json:"subnetMask,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipsettings.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipsettings.go new file mode 100644 index 00000000000..ec91683b51d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_nicipsettings.go @@ -0,0 +1,15 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicIPSettings struct { + AllocationMethod *IPAddressAllocationMethod `json:"allocationMethod,omitempty"` + DnsServers *[]string `json:"dnsServers,omitempty"` + Gateway *[]string `json:"gateway,omitempty"` + IPAddress *string `json:"ipAddress,omitempty"` + IPAddressInfo *[]NicIPAddressSettings `json:"ipAddressInfo,omitempty"` + PrimaryWinsServer *string `json:"primaryWinsServer,omitempty"` + SecondaryWinsServer *string `json:"secondaryWinsServer,omitempty"` + SubnetMask *string `json:"subnetMask,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcepatch.go new file mode 100644 index 00000000000..9158fc48b41 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcepatch.go @@ -0,0 +1,8 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcestatus.go new file mode 100644 index 00000000000..ddbd55ac149 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_resourcestatus.go @@ -0,0 +1,31 @@ +package virtualmachinetemplates + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualdisk.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualdisk.go new file mode 100644 index 00000000000..0fba6726f2b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualdisk.go @@ -0,0 +1,17 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualDisk struct { + ControllerKey *int64 `json:"controllerKey,omitempty"` + DeviceKey *int64 `json:"deviceKey,omitempty"` + DeviceName *string `json:"deviceName,omitempty"` + DiskMode *DiskMode `json:"diskMode,omitempty"` + DiskObjectId *string `json:"diskObjectId,omitempty"` + DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` + DiskType *DiskType `json:"diskType,omitempty"` + Label *string `json:"label,omitempty"` + Name *string `json:"name,omitempty"` + UnitNumber *int64 `json:"unitNumber,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplate.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplate.go new file mode 100644 index 00000000000..2f4eb05fd52 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplate.go @@ -0,0 +1,20 @@ +package virtualmachinetemplates + +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 VirtualMachineTemplate struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VirtualMachineTemplateProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplateproperties.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplateproperties.go new file mode 100644 index 00000000000..23b2c1f8803 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/model_virtualmachinetemplateproperties.go @@ -0,0 +1,26 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineTemplateProperties struct { + CustomResourceName *string `json:"customResourceName,omitempty"` + Disks *[]VirtualDisk `json:"disks,omitempty"` + FirmwareType *FirmwareType `json:"firmwareType,omitempty"` + FolderPath *string `json:"folderPath,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MemorySizeMB *int64 `json:"memorySizeMB,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` + NumCPUs *int64 `json:"numCPUs,omitempty"` + NumCoresPerSocket *int64 `json:"numCoresPerSocket,omitempty"` + OsName *string `json:"osName,omitempty"` + OsType *OsType `json:"osType,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + ToolsVersion *string `json:"toolsVersion,omitempty"` + ToolsVersionStatus *string `json:"toolsVersionStatus,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/predicates.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/predicates.go new file mode 100644 index 00000000000..cbc608a1cd4 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/predicates.go @@ -0,0 +1,37 @@ +package virtualmachinetemplates + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualMachineTemplateOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p VirtualMachineTemplateOperationPredicate) Matches(input VirtualMachineTemplate) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/virtualmachinetemplates/version.go b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/version.go new file mode 100644 index 00000000000..69547ee4f7b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualmachinetemplates/version.go @@ -0,0 +1,12 @@ +package virtualmachinetemplates + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachinetemplates/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/README.md b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/README.md new file mode 100644 index 00000000000..f917af8fce3 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/virtualnetworks` Documentation + +The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/virtualnetworks" +``` + + +### Client Initialization + +```go +client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworksClient.Create` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.VirtualNetwork{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +if err := client.DeleteThenPoll(ctx, id, virtualnetworks.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +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: `VirtualNetworksClient.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: `VirtualNetworksClient.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: `VirtualNetworksClient.Update` + +```go +ctx := context.TODO() +id := virtualnetworks.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.ResourcePatch{ + // ... +} + + +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/network/2023-04-01/virtualnetworks/client.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/client.go rename to resource-manager/connectedvmware/2023-12-01/virtualnetworks/client.go diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/constants.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/constants.go new file mode 100644 index 00000000000..2a6b80bdddd --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/constants.go @@ -0,0 +1,69 @@ +package virtualnetworks + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork.go new file mode 100644 index 00000000000..3295c21af0e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork.go @@ -0,0 +1,130 @@ +package virtualnetworks + +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(&VirtualNetworkId{}) +} + +var _ resourceids.ResourceId = &VirtualNetworkId{} + +// VirtualNetworkId is a struct representing the Resource ID for a Virtual Network +type VirtualNetworkId struct { + SubscriptionId string + ResourceGroupName string + VirtualNetworkName string +} + +// NewVirtualNetworkID returns a new VirtualNetworkId struct +func NewVirtualNetworkID(subscriptionId string, resourceGroupName string, virtualNetworkName string) VirtualNetworkId { + return VirtualNetworkId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + VirtualNetworkName: virtualNetworkName, + } +} + +// ParseVirtualNetworkID parses 'input' into a VirtualNetworkId +func ParseVirtualNetworkID(input string) (*VirtualNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualNetworkId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVirtualNetworkIDInsensitively parses 'input' case-insensitively into a VirtualNetworkId +// note: this method should only be used for API response data and not user input +func ParseVirtualNetworkIDInsensitively(input string) (*VirtualNetworkId, error) { + parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VirtualNetworkId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VirtualNetworkId) 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.VirtualNetworkName, ok = input.Parsed["virtualNetworkName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", input) + } + + return nil +} + +// ValidateVirtualNetworkID checks that 'input' can be parsed as a Virtual Network ID +func ValidateVirtualNetworkID(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 := ParseVirtualNetworkID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Virtual Network ID +func (id VirtualNetworkId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Virtual Network ID +func (id VirtualNetworkId) 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("staticMicrosoftConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere", "Microsoft.ConnectedVMwarevSphere"), + resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), + resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkValue"), + } +} + +// String returns a human-readable description of this Virtual Network ID +func (id VirtualNetworkId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Virtual Network Name: %q", id.VirtualNetworkName), + } + return fmt.Sprintf("Virtual Network (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork_test.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork_test.go new file mode 100644 index 00000000000..233f77ab66e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/id_virtualnetwork_test.go @@ -0,0 +1,282 @@ +package virtualnetworks + +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 = &VirtualNetworkId{} + +func TestNewVirtualNetworkID(t *testing.T) { + id := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + + 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.VirtualNetworkName != "virtualNetworkValue" { + t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkName'", id.VirtualNetworkName, "virtualNetworkValue") + } +} + +func TestFormatVirtualNetworkID(t *testing.T) { + actual := NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/virtualNetworkValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVirtualNetworkID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VirtualNetworkId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/virtualNetworkValue", + Expected: &VirtualNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VirtualNetworkName: "virtualNetworkValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/virtualNetworkValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVirtualNetworkID(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.VirtualNetworkName != v.Expected.VirtualNetworkName { + t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) + } + + } +} + +func TestParseVirtualNetworkIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VirtualNetworkId + }{ + { + // 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.ConnectedVMwarevSphere", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlNeTwOrKs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/virtualNetworkValue", + Expected: &VirtualNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + VirtualNetworkName: "virtualNetworkValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks/virtualNetworkValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnNeCtEdVmWaReVsPhErE/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe", + Expected: &VirtualNetworkId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + VirtualNetworkName: "vIrTuAlNeTwOrKvAlUe", + }, + }, + { + // 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.cOnNeCtEdVmWaReVsPhErE/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVirtualNetworkIDInsensitively(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.VirtualNetworkName != v.Expected.VirtualNetworkName { + t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) + } + + } +} + +func TestSegmentsForVirtualNetworkId(t *testing.T) { + segments := VirtualNetworkId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VirtualNetworkId 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/connectedvmware/2023-12-01/virtualnetworks/method_create.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_create.go new file mode 100644 index 00000000000..045fcc4f3a6 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_create.go @@ -0,0 +1,75 @@ +package virtualnetworks + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetwork +} + +// Create ... +func (c VirtualNetworksClient) Create(ctx context.Context, id VirtualNetworkId, input VirtualNetwork) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VirtualNetworksClient) CreateThenPoll(ctx context.Context, id VirtualNetworkId, input VirtualNetwork) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_delete.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_delete.go new file mode 100644 index 00000000000..18adc6a2100 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_delete.go @@ -0,0 +1,99 @@ +package virtualnetworks + +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 { + Force *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +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 VirtualNetworksClient) Delete(ctx context.Context, id VirtualNetworkId, 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, + Path: id.ID(), + OptionsObject: options, + } + + 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 VirtualNetworksClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkId, 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/connectedvmware/2023-12-01/virtualnetworks/method_get.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_get.go new file mode 100644 index 00000000000..a27c17c1604 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_get.go @@ -0,0 +1,54 @@ +package virtualnetworks + +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 *VirtualNetwork +} + +// Get ... +func (c VirtualNetworksClient) Get(ctx context.Context, id VirtualNetworkId) (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 VirtualNetwork + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_list.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_list.go new file mode 100644 index 00000000000..a066e15eb27 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_list.go @@ -0,0 +1,92 @@ +package virtualnetworks + +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 *[]VirtualNetwork +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualNetwork +} + +// List ... +func (c VirtualNetworksClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks", 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 *[]VirtualNetwork `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 VirtualNetworksClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkOperationPredicate) (result ListCompleteResult, err error) { + items := make([]VirtualNetwork, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/virtualnetworks/method_listbyresourcegroup.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_listbyresourcegroup.go new file mode 100644 index 00000000000..ab851f71157 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_listbyresourcegroup.go @@ -0,0 +1,92 @@ +package virtualnetworks + +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 *[]VirtualNetwork +} + +type ListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []VirtualNetwork +} + +// ListByResourceGroup ... +func (c VirtualNetworksClient) 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, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualNetworks", 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 *[]VirtualNetwork `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 VirtualNetworksClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { + return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) +} + +// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VirtualNetworksClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { + items := make([]VirtualNetwork, 0) + + resp, err := c.ListByResourceGroup(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/virtualnetworks/method_update.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_update.go new file mode 100644 index 00000000000..21e8697a539 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/method_update.go @@ -0,0 +1,58 @@ +package virtualnetworks + +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 UpdateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VirtualNetwork +} + +// Update ... +func (c VirtualNetworksClient) Update(ctx context.Context, id VirtualNetworkId, input ResourcePatch) (result UpdateOperationResponse, 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 VirtualNetwork + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_extendedlocation.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_extendedlocation.go new file mode 100644 index 00000000000..a3a28fb038c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_extendedlocation.go @@ -0,0 +1,9 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExtendedLocation struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcepatch.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcepatch.go new file mode 100644 index 00000000000..b8e4e3ef99a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcepatch.go @@ -0,0 +1,8 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourcePatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcestatus.go new file mode 100644 index 00000000000..f7cadc7d82c --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_resourcestatus.go @@ -0,0 +1,31 @@ +package virtualnetworks + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetwork.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetwork.go new file mode 100644 index 00000000000..68e411fce26 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetwork.go @@ -0,0 +1,20 @@ +package virtualnetworks + +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 VirtualNetwork struct { + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + Id *string `json:"id,omitempty"` + Kind *string `json:"kind,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VirtualNetworkProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetworkproperties.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetworkproperties.go new file mode 100644 index 00000000000..4dd8ece8379 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/model_virtualnetworkproperties.go @@ -0,0 +1,15 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkProperties struct { + CustomResourceName *string `json:"customResourceName,omitempty"` + InventoryItemId *string `json:"inventoryItemId,omitempty"` + MoName *string `json:"moName,omitempty"` + MoRefId *string `json:"moRefId,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + Uuid *string `json:"uuid,omitempty"` + VCenterId *string `json:"vCenterId,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/virtualnetworks/predicates.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/predicates.go new file mode 100644 index 00000000000..a70f81e7e7d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/predicates.go @@ -0,0 +1,37 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkOperationPredicate struct { + Id *string + Kind *string + Location *string + Name *string + Type *string +} + +func (p VirtualNetworkOperationPredicate) Matches(input VirtualNetwork) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { + 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/connectedvmware/2023-12-01/virtualnetworks/version.go b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/version.go new file mode 100644 index 00000000000..6ab5eb46b6e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/virtualnetworks/version.go @@ -0,0 +1,12 @@ +package virtualnetworks + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/README.md b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/README.md new file mode 100644 index 00000000000..aac866dc8bc --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents` Documentation + +The `vminstanceguestagents` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/vminstanceguestagents" +``` + + +### Client Initialization + +```go +client := vminstanceguestagents.NewVMInstanceGuestAgentsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VMInstanceGuestAgentsClient.Create` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +payload := vminstanceguestagents.GuestAgent{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VMInstanceGuestAgentsClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VMInstanceGuestAgentsClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +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: `VMInstanceGuestAgentsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// 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/connectedvmware/2023-12-01/vminstanceguestagents/client.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/client.go new file mode 100644 index 00000000000..c50f6663706 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/client.go @@ -0,0 +1,26 @@ +package vminstanceguestagents + +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 VMInstanceGuestAgentsClient struct { + Client *resourcemanager.Client +} + +func NewVMInstanceGuestAgentsClientWithBaseURI(sdkApi sdkEnv.Api) (*VMInstanceGuestAgentsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vminstanceguestagents", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VMInstanceGuestAgentsClient: %+v", err) + } + + return &VMInstanceGuestAgentsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/constants.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/constants.go new file mode 100644 index 00000000000..03950ff6bc5 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/constants.go @@ -0,0 +1,113 @@ +package vminstanceguestagents + +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 ProvisioningAction string + +const ( + ProvisioningActionInstall ProvisioningAction = "install" + ProvisioningActionRepair ProvisioningAction = "repair" + ProvisioningActionUninstall ProvisioningAction = "uninstall" +) + +func PossibleValuesForProvisioningAction() []string { + return []string{ + string(ProvisioningActionInstall), + string(ProvisioningActionRepair), + string(ProvisioningActionUninstall), + } +} + +func (s *ProvisioningAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningAction(input string) (*ProvisioningAction, error) { + vals := map[string]ProvisioningAction{ + "install": ProvisioningActionInstall, + "repair": ProvisioningActionRepair, + "uninstall": ProvisioningActionUninstall, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningAction(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_create.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_create.go new file mode 100644 index 00000000000..be40f3ec65a --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_create.go @@ -0,0 +1,76 @@ +package vminstanceguestagents + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *GuestAgent +} + +// Create ... +func (c VMInstanceGuestAgentsClient) Create(ctx context.Context, id commonids.ScopeId, input GuestAgent) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + http.StatusOK, + }, + HttpMethod: http.MethodPut, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/default", 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 +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VMInstanceGuestAgentsClient) CreateThenPoll(ctx context.Context, id commonids.ScopeId, input GuestAgent) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_delete.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_delete.go new file mode 100644 index 00000000000..8fcf35c0f3d --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_delete.go @@ -0,0 +1,71 @@ +package vminstanceguestagents + +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 DeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// Delete ... +func (c VMInstanceGuestAgentsClient) Delete(ctx context.Context, id commonids.ScopeId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c VMInstanceGuestAgentsClient) DeleteThenPoll(ctx context.Context, id commonids.ScopeId) 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/connectedvmware/2023-12-01/vminstanceguestagents/method_get.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_get.go new file mode 100644 index 00000000000..d7a3e6c3250 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_get.go @@ -0,0 +1,56 @@ +package vminstanceguestagents + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *GuestAgent +} + +// Get ... +func (c VMInstanceGuestAgentsClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents/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 GuestAgent + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_list.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_list.go new file mode 100644 index 00000000000..b37c741501e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/method_list.go @@ -0,0 +1,92 @@ +package vminstanceguestagents + +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 *[]GuestAgent +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []GuestAgent +} + +// List ... +func (c VMInstanceGuestAgentsClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/guestAgents", 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 *[]GuestAgent `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 VMInstanceGuestAgentsClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, GuestAgentOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VMInstanceGuestAgentsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate GuestAgentOperationPredicate) (result ListCompleteResult, err error) { + items := make([]GuestAgent, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/azurestackhci/2023-09-01-preview/guestagents/model_guestagent.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagent.go similarity index 94% rename from resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestagent.go rename to resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagent.go index 9614c14071c..195f7e64aae 100644 --- a/resource-manager/azurestackhci/2023-09-01-preview/guestagents/model_guestagent.go +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagent.go @@ -1,4 +1,4 @@ -package guestagents +package vminstanceguestagents import ( "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagentproperties.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagentproperties.go new file mode 100644 index 00000000000..b1dd894a02e --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestagentproperties.go @@ -0,0 +1,16 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestAgentProperties struct { + Credentials *GuestCredential `json:"credentials,omitempty"` + CustomResourceName *string `json:"customResourceName,omitempty"` + HTTPProxyConfig *HTTPProxyConfiguration `json:"httpProxyConfig,omitempty"` + PrivateLinkScopeResourceId *string `json:"privateLinkScopeResourceId,omitempty"` + ProvisioningAction *ProvisioningAction `json:"provisioningAction,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Status *string `json:"status,omitempty"` + Statuses *[]ResourceStatus `json:"statuses,omitempty"` + Uuid *string `json:"uuid,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestcredential.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestcredential.go new file mode 100644 index 00000000000..fd3927861e3 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_guestcredential.go @@ -0,0 +1,10 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestCredential struct { + Password *string `json:"password,omitempty"` + PrivateKey *string `json:"privateKey,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_httpproxyconfiguration.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_httpproxyconfiguration.go new file mode 100644 index 00000000000..bc2cbf6e776 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_httpproxyconfiguration.go @@ -0,0 +1,8 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HTTPProxyConfiguration struct { + HTTPSProxy *string `json:"httpsProxy,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_resourcestatus.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_resourcestatus.go new file mode 100644 index 00000000000..3959db96b5b --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/model_resourcestatus.go @@ -0,0 +1,31 @@ +package vminstanceguestagents + +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 ResourceStatus struct { + LastUpdatedAt *string `json:"lastUpdatedAt,omitempty"` + Message *string `json:"message,omitempty"` + Reason *string `json:"reason,omitempty"` + Severity *string `json:"severity,omitempty"` + Status *string `json:"status,omitempty"` + Type *string `json:"type,omitempty"` +} + +func (o *ResourceStatus) GetLastUpdatedAtAsTime() (*time.Time, error) { + if o.LastUpdatedAt == nil { + return nil, nil + } + return dates.ParseAsFormat(o.LastUpdatedAt, "2006-01-02T15:04:05Z07:00") +} + +func (o *ResourceStatus) SetLastUpdatedAtAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.LastUpdatedAt = &formatted +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/predicates.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/predicates.go new file mode 100644 index 00000000000..74808365900 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/predicates.go @@ -0,0 +1,27 @@ +package vminstanceguestagents + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GuestAgentOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p GuestAgentOperationPredicate) Matches(input GuestAgent) 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/connectedvmware/2023-12-01/vminstanceguestagents/version.go b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/version.go new file mode 100644 index 00000000000..d08bbb0f731 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstanceguestagents/version.go @@ -0,0 +1,12 @@ +package vminstanceguestagents + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vminstanceguestagents/%s", defaultApiVersion) +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/README.md b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/README.md new file mode 100644 index 00000000000..4793af430ea --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata` Documentation + +The `vminstancehybrididentitymetadata` SDK allows for interaction with the Azure Resource Manager Service `connectedvmware` (API Version `2023-12-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/connectedvmware/2023-12-01/vminstancehybrididentitymetadata" +``` + + +### Client Initialization + +```go +client := vminstancehybrididentitymetadata.NewVMInstanceHybridIdentityMetadataClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VMInstanceHybridIdentityMetadataClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +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: `VMInstanceHybridIdentityMetadataClient.List` + +```go +ctx := context.TODO() +id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") + +// 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/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/client.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/client.go new file mode 100644 index 00000000000..605e66135cb --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/client.go @@ -0,0 +1,26 @@ +package vminstancehybrididentitymetadata + +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 VMInstanceHybridIdentityMetadataClient struct { + Client *resourcemanager.Client +} + +func NewVMInstanceHybridIdentityMetadataClientWithBaseURI(sdkApi sdkEnv.Api) (*VMInstanceHybridIdentityMetadataClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vminstancehybrididentitymetadata", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VMInstanceHybridIdentityMetadataClient: %+v", err) + } + + return &VMInstanceHybridIdentityMetadataClient{ + Client: client, + }, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/constants.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/constants.go new file mode 100644 index 00000000000..09f22289913 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/constants.go @@ -0,0 +1,69 @@ +package vminstancehybrididentitymetadata + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCanceled ProvisioningState = "Canceled" + ProvisioningStateCreated ProvisioningState = "Created" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateProvisioning ProvisioningState = "Provisioning" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCanceled), + string(ProvisioningStateCreated), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateProvisioning), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "canceled": ProvisioningStateCanceled, + "created": ProvisioningStateCreated, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "provisioning": ProvisioningStateProvisioning, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_get.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_get.go new file mode 100644 index 00000000000..6425f87dff1 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_get.go @@ -0,0 +1,56 @@ +package vminstancehybrididentitymetadata + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VMInstanceHybridIdentityMetadata +} + +// Get ... +func (c VMInstanceHybridIdentityMetadataClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/hybridIdentityMetadata/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 VMInstanceHybridIdentityMetadata + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_list.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_list.go new file mode 100644 index 00000000000..ce54b9b9a39 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/method_list.go @@ -0,0 +1,92 @@ +package vminstancehybrididentitymetadata + +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 *[]VMInstanceHybridIdentityMetadata +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []VMInstanceHybridIdentityMetadata +} + +// List ... +func (c VMInstanceHybridIdentityMetadataClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.ConnectedVMwarevSphere/virtualMachineInstances/default/hybridIdentityMetadata", 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 *[]VMInstanceHybridIdentityMetadata `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 VMInstanceHybridIdentityMetadataClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VMInstanceHybridIdentityMetadataOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VMInstanceHybridIdentityMetadataClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate VMInstanceHybridIdentityMetadataOperationPredicate) (result ListCompleteResult, err error) { + items := make([]VMInstanceHybridIdentityMetadata, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go new file mode 100644 index 00000000000..c84683e1219 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadata.go @@ -0,0 +1,16 @@ +package vminstancehybrididentitymetadata + +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 VMInstanceHybridIdentityMetadata struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VMInstanceHybridIdentityMetadataProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go new file mode 100644 index 00000000000..67e5598fff7 --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/model_vminstancehybrididentitymetadataproperties.go @@ -0,0 +1,10 @@ +package vminstancehybrididentitymetadata + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMInstanceHybridIdentityMetadataProperties struct { + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + PublicKey *string `json:"publicKey,omitempty"` + ResourceUid *string `json:"resourceUid,omitempty"` +} diff --git a/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/predicates.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/predicates.go new file mode 100644 index 00000000000..2b14e1e41ff --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/predicates.go @@ -0,0 +1,27 @@ +package vminstancehybrididentitymetadata + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VMInstanceHybridIdentityMetadataOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p VMInstanceHybridIdentityMetadataOperationPredicate) Matches(input VMInstanceHybridIdentityMetadata) 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/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/version.go b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/version.go new file mode 100644 index 00000000000..9ec9b40d6aa --- /dev/null +++ b/resource-manager/connectedvmware/2023-12-01/vminstancehybrididentitymetadata/version.go @@ -0,0 +1,12 @@ +package vminstancehybrididentitymetadata + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-12-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vminstancehybrididentitymetadata/%s", defaultApiVersion) +} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md b/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md deleted file mode 100644 index 4cbb3afed85..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/README.md +++ /dev/null @@ -1,143 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/agentpools` Documentation - -The `agentpools` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue", "agentPoolValue") - -read, err := client.AbortLatestOperation(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AgentPoolsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - -payload := agentpools.AgentPool{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AgentPoolsClient.Delete` - -```go -ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - -if err := client.DeleteThenPoll(ctx, id, agentpools.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AgentPoolsClient.Get` - -```go -ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - -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", "managedClusterValue") - -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", "managedClusterValue", "agentPoolValue") - -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", "managedClusterValue") - -// 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", "managedClusterValue", "agentPoolValue") - -if err := client.UpgradeNodeImageVersionThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/client.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/client.go deleted file mode 100644 index 2edad36c005..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/agentpools/constants.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/constants.go deleted file mode 100644 index c73e2223e5c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/constants.go +++ /dev/null @@ -1,561 +0,0 @@ -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 ( - OSSKUCBLMariner OSSKU = "CBLMariner" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUCBLMariner), - string(OSSKUMariner), - 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{ - "cblmariner": OSSKUCBLMariner, - "mariner": OSSKUMariner, - "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/2022-09-02-preview/agentpools/id_agentpool.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/id_agentpool.go deleted file mode 100644 index 3f847038351..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/id_agentpool.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), - resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolValue"), - } -} - -// 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/containerservice/2022-09-02-preview/agentpools/id_agentpool_test.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/id_agentpool_test.go deleted file mode 100644 index 4c32bcb833f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/id_agentpool_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package agentpools - -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 = &AgentPoolId{} - -func TestNewAgentPoolID(t *testing.T) { - id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.AgentPoolName != "agentPoolValue" { - t.Fatalf("Expected %q but got %q for Segment 'AgentPoolName'", id.AgentPoolName, "agentPoolValue") - } -} - -func TestFormatAgentPoolID(t *testing.T) { - actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAgentPoolID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AgentPoolId - }{ - { - // 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue", - Expected: &AgentPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AgentPoolName: "agentPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAgentPoolID(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) - } - - } -} - -func TestParseAgentPoolIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AgentPoolId - }{ - { - // 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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/aGeNtPoOlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue", - Expected: &AgentPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AgentPoolName: "agentPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue/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/mAnAgEdClUsTeRvAlUe/aGeNtPoOlS/aGeNtPoOlVaLuE", - Expected: &AgentPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - AgentPoolName: "aGeNtPoOlVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/aGeNtPoOlS/aGeNtPoOlVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAgentPoolIDInsensitively(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) - } - - } -} - -func TestSegmentsForAgentPoolId(t *testing.T) { - segments := AgentPoolId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AgentPoolId 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/2022-09-02-preview/agentpools/method_abortlatestoperation.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_abortlatestoperation.go deleted file mode 100644 index 73ed62c1100..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_abortlatestoperation.go +++ /dev/null @@ -1,47 +0,0 @@ -package agentpools - -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 AbortLatestOperationOperationResponse struct { - 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.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 - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_createorupdate.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_createorupdate.go deleted file mode 100644 index 8df06205d3a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -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 -} - -// CreateOrUpdate ... -func (c AgentPoolsClient) CreateOrUpdate(ctx context.Context, id AgentPoolId, input AgentPool) (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 - } - - 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) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/2022-09-02-preview/agentpools/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_delete.go deleted file mode 100644 index d628abea0ea..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_delete.go +++ /dev/null @@ -1,98 +0,0 @@ -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 { - IgnorePodDisruptionBudget *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - 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, - Path: id.ID(), - OptionsObject: options, - } - - 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/containerservice/2022-09-02-preview/agentpools/method_get.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_get.go deleted file mode 100644 index 97eecd6a97a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package agentpools - -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 *AgentPool -} - -// Get ... -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: 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 AgentPool - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions.go deleted file mode 100644 index 81aa1c660a4..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getavailableagentpoolversions.go +++ /dev/null @@ -1,56 +0,0 @@ -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/containerservice/2022-09-02-preview/agentpools/method_getupgradeprofile.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getupgradeprofile.go deleted file mode 100644 index e8d8a91ceed..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_getupgradeprofile.go +++ /dev/null @@ -1,55 +0,0 @@ -package agentpools - -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 GetUpgradeProfileOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AgentPoolUpgradeProfile -} - -// 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/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 AgentPoolUpgradeProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list.go deleted file mode 100644 index d4f58e969de..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2022-09-02-preview/agentpools/method_upgradenodeimageversion.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/method_upgradenodeimageversion.go deleted file mode 100644 index fa6b0240a55..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/method_upgradenodeimageversion.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpool.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpool.go deleted file mode 100644 index c67ae33e826..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpool.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolavailableversions.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversions.go deleted file mode 100644 index 0b65a05c663..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversions.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolavailableversionsproperties.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversionsproperties.go deleted file mode 100644 index a8369deaba7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversionsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go deleted file mode 100644 index 1631b3137d1..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go +++ /dev/null @@ -1,10 +0,0 @@ -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/containerservice/2022-09-02-preview/agentpools/model_agentpoolnetworkprofile.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolnetworkprofile.go deleted file mode 100644 index db217a29cc5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolnetworkprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolupgradeprofile.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofile.go deleted file mode 100644 index 23cc2927f28..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go deleted file mode 100644 index 5df00c96762..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go deleted file mode 100644 index b45442f6cf0..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/agentpools/model_agentpoolupgradesettings.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradesettings.go deleted file mode 100644 index 4b7613a093f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - MaxSurge *string `json:"maxSurge,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolwindowsprofile.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolwindowsprofile.go deleted file mode 100644 index d7ad07f7f69..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_agentpoolwindowsprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/containerservice/2022-09-02-preview/agentpools/model_creationdata.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_creationdata.go deleted file mode 100644 index 88a8fe8123b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -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 CreationData struct { - SourceResourceId *string `json:"sourceResourceId,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_iptag.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_iptag.go deleted file mode 100644 index 8a805afc241..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/agentpools/model_kubeletconfig.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_kubeletconfig.go deleted file mode 100644 index 7d56f79880c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_kubeletconfig.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2022-09-02-preview/agentpools/model_linuxosconfig.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_linuxosconfig.go deleted file mode 100644 index 8256b210a85..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_linuxosconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go deleted file mode 100644 index bbb0fddd066..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -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"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` - EnableCustomCATrust *bool `json:"enableCustomCATrust,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"` - MessageOfTheDay *string `json:"messageOfTheDay,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"` - 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/2022-09-02-preview/agentpools/model_portrange.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_portrange.go deleted file mode 100644 index 45b2a562032..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_portrange.go +++ /dev/null @@ -1,10 +0,0 @@ -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/containerservice/2022-09-02-preview/agentpools/model_powerstate.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_powerstate.go deleted file mode 100644 index c5939d90672..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_powerstate.go +++ /dev/null @@ -1,8 +0,0 @@ -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 PowerState struct { - Code *Code `json:"code,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_sysctlconfig.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/model_sysctlconfig.go deleted file mode 100644 index aa739bf4f68..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/model_sysctlconfig.go +++ /dev/null @@ -1,35 +0,0 @@ -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/containerservice/2022-09-02-preview/agentpools/predicates.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/predicates.go deleted file mode 100644 index 94a2db5c63b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -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 AgentPoolOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p AgentPoolOperationPredicate) Matches(input AgentPool) 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/2022-09-02-preview/agentpools/version.go b/resource-manager/containerservice/2022-09-02-preview/agentpools/version.go deleted file mode 100644 index d1510daf9fb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/agentpools/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package agentpools - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/agentpools/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/client.go b/resource-manager/containerservice/2022-09-02-preview/client.go deleted file mode 100644 index 772fd31c63d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/client.go +++ /dev/null @@ -1,118 +0,0 @@ -package v2022_09_02_preview - -// 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/2022-09-02-preview/agentpools" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/fleetmembers" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/fleets" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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 - FleetMembers *fleetmembers.FleetMembersClient - Fleets *fleets.FleetsClient - MaintenanceConfigurations *maintenanceconfigurations.MaintenanceConfigurationsClient - ManagedClusterSnapshots *managedclustersnapshots.ManagedClusterSnapshotsClient - 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) - - fleetMembersClient, err := fleetmembers.NewFleetMembersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FleetMembers client: %+v", err) - } - configureFunc(fleetMembersClient.Client) - - fleetsClient, err := fleets.NewFleetsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Fleets client: %+v", err) - } - configureFunc(fleetsClient.Client) - - maintenanceConfigurationsClient, err := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building MaintenanceConfigurations client: %+v", err) - } - configureFunc(maintenanceConfigurationsClient.Client) - - managedClusterSnapshotsClient, err := managedclustersnapshots.NewManagedClusterSnapshotsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ManagedClusterSnapshots client: %+v", err) - } - configureFunc(managedClusterSnapshotsClient.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, - FleetMembers: fleetMembersClient, - Fleets: fleetsClient, - MaintenanceConfigurations: maintenanceConfigurationsClient, - ManagedClusterSnapshots: managedClusterSnapshotsClient, - ManagedClusters: managedClustersClient, - PrivateEndpointConnections: privateEndpointConnectionsClient, - PrivateLinkResources: privateLinkResourcesClient, - ResolvePrivateLinkServiceId: resolvePrivateLinkServiceIdClient, - Snapshots: snapshotsClient, - TrustedAccess: trustedAccessClient, - }, nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/README.md b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/README.md deleted file mode 100644 index fbfef714ff2..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/fleetmembers` Documentation - -The `fleetmembers` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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/containerservice/2022-09-02-preview/fleetmembers" -``` - - -### Client Initialization - -```go -client := fleetmembers.NewFleetMembersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FleetMembersClient.Create` - -```go -ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue", "memberValue") - -payload := fleetmembers.FleetMember{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload, fleetmembers.DefaultCreateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `FleetMembersClient.Delete` - -```go -ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue", "memberValue") - -if err := client.DeleteThenPoll(ctx, id, fleetmembers.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `FleetMembersClient.Get` - -```go -ctx := context.TODO() -id := fleetmembers.NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue", "memberValue") - -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: `FleetMembersClient.ListByFleet` - -```go -ctx := context.TODO() -id := fleetmembers.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - -// alternatively `client.ListByFleet(ctx, id)` can be used to do batched pagination -items, err := client.ListByFleetComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/client.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/client.go deleted file mode 100644 index 1f2556b8743..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package fleetmembers - -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 FleetMembersClient struct { - Client *resourcemanager.Client -} - -func NewFleetMembersClientWithBaseURI(sdkApi sdkEnv.Api) (*FleetMembersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "fleetmembers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FleetMembersClient: %+v", err) - } - - return &FleetMembersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/constants.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/constants.go deleted file mode 100644 index e8a926a9d44..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package fleetmembers - -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 FleetMemberProvisioningState string - -const ( - FleetMemberProvisioningStateCanceled FleetMemberProvisioningState = "Canceled" - FleetMemberProvisioningStateFailed FleetMemberProvisioningState = "Failed" - FleetMemberProvisioningStateJoining FleetMemberProvisioningState = "Joining" - FleetMemberProvisioningStateLeaving FleetMemberProvisioningState = "Leaving" - FleetMemberProvisioningStateSucceeded FleetMemberProvisioningState = "Succeeded" - FleetMemberProvisioningStateUpdating FleetMemberProvisioningState = "Updating" -) - -func PossibleValuesForFleetMemberProvisioningState() []string { - return []string{ - string(FleetMemberProvisioningStateCanceled), - string(FleetMemberProvisioningStateFailed), - string(FleetMemberProvisioningStateJoining), - string(FleetMemberProvisioningStateLeaving), - string(FleetMemberProvisioningStateSucceeded), - string(FleetMemberProvisioningStateUpdating), - } -} - -func (s *FleetMemberProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFleetMemberProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFleetMemberProvisioningState(input string) (*FleetMemberProvisioningState, error) { - vals := map[string]FleetMemberProvisioningState{ - "canceled": FleetMemberProvisioningStateCanceled, - "failed": FleetMemberProvisioningStateFailed, - "joining": FleetMemberProvisioningStateJoining, - "leaving": FleetMemberProvisioningStateLeaving, - "succeeded": FleetMemberProvisioningStateSucceeded, - "updating": FleetMemberProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FleetMemberProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet.go deleted file mode 100644 index 2795f9626bd..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet.go +++ /dev/null @@ -1,130 +0,0 @@ -package fleetmembers - -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(&FleetId{}) -} - -var _ resourceids.ResourceId = &FleetId{} - -// FleetId is a struct representing the Resource ID for a Fleet -type FleetId struct { - SubscriptionId string - ResourceGroupName string - FleetName string -} - -// NewFleetID returns a new FleetId struct -func NewFleetID(subscriptionId string, resourceGroupName string, fleetName string) FleetId { - return FleetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FleetName: fleetName, - } -} - -// ParseFleetID parses 'input' into a FleetId -func ParseFleetID(input string) (*FleetId, error) { - parser := resourceids.NewParserFromResourceIdType(&FleetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FleetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFleetIDInsensitively parses 'input' case-insensitively into a FleetId -// note: this method should only be used for API response data and not user input -func ParseFleetIDInsensitively(input string) (*FleetId, error) { - parser := resourceids.NewParserFromResourceIdType(&FleetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FleetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FleetId) 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.FleetName, ok = input.Parsed["fleetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "fleetName", input) - } - - return nil -} - -// ValidateFleetID checks that 'input' can be parsed as a Fleet ID -func ValidateFleetID(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 := ParseFleetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Fleet ID -func (id FleetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/fleets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FleetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Fleet ID -func (id FleetId) 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("staticFleets", "fleets", "fleets"), - resourceids.UserSpecifiedSegment("fleetName", "fleetValue"), - } -} - -// String returns a human-readable description of this Fleet ID -func (id FleetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Fleet Name: %q", id.FleetName), - } - return fmt.Sprintf("Fleet (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet_test.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet_test.go deleted file mode 100644 index 3ec2e4b6255..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_fleet_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package fleetmembers - -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 = &FleetId{} - -func TestNewFleetID(t *testing.T) { - id := NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - - 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.FleetName != "fleetValue" { - t.Fatalf("Expected %q but got %q for Segment 'FleetName'", id.FleetName, "fleetValue") - } -} - -func TestFormatFleetID(t *testing.T) { - actual := NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFleetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FleetId - }{ - { - // 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/fleets", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue", - Expected: &FleetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FleetName: "fleetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFleetID(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.FleetName != v.Expected.FleetName { - t.Fatalf("Expected %q but got %q for FleetName", v.Expected.FleetName, actual.FleetName) - } - - } -} - -func TestParseFleetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FleetId - }{ - { - // 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/fleets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue", - Expected: &FleetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FleetName: "fleetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/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/fLeEtS/fLeEtVaLuE", - Expected: &FleetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FleetName: "fLeEtVaLuE", - }, - }, - { - // 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/fLeEtS/fLeEtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFleetIDInsensitively(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.FleetName != v.Expected.FleetName { - t.Fatalf("Expected %q but got %q for FleetName", v.Expected.FleetName, actual.FleetName) - } - - } -} - -func TestSegmentsForFleetId(t *testing.T) { - segments := FleetId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FleetId 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/2022-09-02-preview/fleetmembers/id_member.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member.go deleted file mode 100644 index 4363bf1487a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member.go +++ /dev/null @@ -1,139 +0,0 @@ -package fleetmembers - -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(&MemberId{}) -} - -var _ resourceids.ResourceId = &MemberId{} - -// MemberId is a struct representing the Resource ID for a Member -type MemberId struct { - SubscriptionId string - ResourceGroupName string - FleetName string - MemberName string -} - -// NewMemberID returns a new MemberId struct -func NewMemberID(subscriptionId string, resourceGroupName string, fleetName string, memberName string) MemberId { - return MemberId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FleetName: fleetName, - MemberName: memberName, - } -} - -// ParseMemberID parses 'input' into a MemberId -func ParseMemberID(input string) (*MemberId, error) { - parser := resourceids.NewParserFromResourceIdType(&MemberId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MemberId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseMemberIDInsensitively parses 'input' case-insensitively into a MemberId -// note: this method should only be used for API response data and not user input -func ParseMemberIDInsensitively(input string) (*MemberId, error) { - parser := resourceids.NewParserFromResourceIdType(&MemberId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MemberId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *MemberId) 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.FleetName, ok = input.Parsed["fleetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "fleetName", input) - } - - if id.MemberName, ok = input.Parsed["memberName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "memberName", input) - } - - return nil -} - -// ValidateMemberID checks that 'input' can be parsed as a Member ID -func ValidateMemberID(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 := ParseMemberID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Member ID -func (id MemberId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/fleets/%s/members/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FleetName, id.MemberName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Member ID -func (id MemberId) 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("staticFleets", "fleets", "fleets"), - resourceids.UserSpecifiedSegment("fleetName", "fleetValue"), - resourceids.StaticSegment("staticMembers", "members", "members"), - resourceids.UserSpecifiedSegment("memberName", "memberValue"), - } -} - -// String returns a human-readable description of this Member ID -func (id MemberId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Fleet Name: %q", id.FleetName), - fmt.Sprintf("Member Name: %q", id.MemberName), - } - return fmt.Sprintf("Member (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member_test.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member_test.go deleted file mode 100644 index bbcb8208bc5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/id_member_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package fleetmembers - -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 = &MemberId{} - -func TestNewMemberID(t *testing.T) { - id := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue", "memberValue") - - 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.FleetName != "fleetValue" { - t.Fatalf("Expected %q but got %q for Segment 'FleetName'", id.FleetName, "fleetValue") - } - - if id.MemberName != "memberValue" { - t.Fatalf("Expected %q but got %q for Segment 'MemberName'", id.MemberName, "memberValue") - } -} - -func TestFormatMemberID(t *testing.T) { - actual := NewMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue", "memberValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members/memberValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseMemberID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MemberId - }{ - { - // 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/fleets", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members/memberValue", - Expected: &MemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FleetName: "fleetValue", - MemberName: "memberValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members/memberValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMemberID(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.FleetName != v.Expected.FleetName { - t.Fatalf("Expected %q but got %q for FleetName", v.Expected.FleetName, actual.FleetName) - } - - if actual.MemberName != v.Expected.MemberName { - t.Fatalf("Expected %q but got %q for MemberName", v.Expected.MemberName, actual.MemberName) - } - - } -} - -func TestParseMemberIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MemberId - }{ - { - // 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/fleets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS/fLeEtVaLuE/mEmBeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members/memberValue", - Expected: &MemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FleetName: "fleetValue", - MemberName: "memberValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/members/memberValue/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/fLeEtS/fLeEtVaLuE/mEmBeRs/mEmBeRvAlUe", - Expected: &MemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FleetName: "fLeEtVaLuE", - MemberName: "mEmBeRvAlUe", - }, - }, - { - // 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/fLeEtS/fLeEtVaLuE/mEmBeRs/mEmBeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMemberIDInsensitively(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.FleetName != v.Expected.FleetName { - t.Fatalf("Expected %q but got %q for FleetName", v.Expected.FleetName, actual.FleetName) - } - - if actual.MemberName != v.Expected.MemberName { - t.Fatalf("Expected %q but got %q for MemberName", v.Expected.MemberName, actual.MemberName) - } - - } -} - -func TestSegmentsForMemberId(t *testing.T) { - segments := MemberId{}.Segments() - if len(segments) == 0 { - t.Fatalf("MemberId 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/2022-09-02-preview/fleetmembers/method_create.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_create.go deleted file mode 100644 index 1a5991834f7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_create.go +++ /dev/null @@ -1,107 +0,0 @@ -package fleetmembers - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FleetMember -} - -type CreateOperationOptions struct { - IfMatch *string - IfNoneMatch *string -} - -func DefaultCreateOperationOptions() CreateOperationOptions { - return CreateOperationOptions{} -} - -func (o CreateOperationOptions) 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 CreateOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CreateOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// Create ... -func (c FleetMembersClient) Create(ctx context.Context, id MemberId, input FleetMember, options CreateOperationOptions) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: id.ID(), - OptionsObject: options, - } - - 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 -} - -// CreateThenPoll performs Create then polls until it's completed -func (c FleetMembersClient) CreateThenPoll(ctx context.Context, id MemberId, input FleetMember, options CreateOperationOptions) error { - result, err := c.Create(ctx, id, input, options) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_delete.go deleted file mode 100644 index 7006a5abe50..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package fleetmembers - -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 -} - -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{} - - return &out -} - -// Delete ... -func (c FleetMembersClient) Delete(ctx context.Context, id MemberId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 FleetMembersClient) DeleteThenPoll(ctx context.Context, id MemberId, 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/2022-09-02-preview/fleetmembers/method_get.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_get.go deleted file mode 100644 index 3987fc968d2..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package fleetmembers - -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 *FleetMember -} - -// Get ... -func (c FleetMembersClient) Get(ctx context.Context, id MemberId) (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 FleetMember - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_listbyfleet.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_listbyfleet.go deleted file mode 100644 index 5347ee73830..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/method_listbyfleet.go +++ /dev/null @@ -1,91 +0,0 @@ -package fleetmembers - -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 ListByFleetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FleetMember -} - -type ListByFleetCompleteResult struct { - LatestHttpResponse *http.Response - Items []FleetMember -} - -// ListByFleet ... -func (c FleetMembersClient) ListByFleet(ctx context.Context, id FleetId) (result ListByFleetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/members", 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 *[]FleetMember `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByFleetComplete retrieves all the results into a single object -func (c FleetMembersClient) ListByFleetComplete(ctx context.Context, id FleetId) (ListByFleetCompleteResult, error) { - return c.ListByFleetCompleteMatchingPredicate(ctx, id, FleetMemberOperationPredicate{}) -} - -// ListByFleetCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FleetMembersClient) ListByFleetCompleteMatchingPredicate(ctx context.Context, id FleetId, predicate FleetMemberOperationPredicate) (result ListByFleetCompleteResult, err error) { - items := make([]FleetMember, 0) - - resp, err := c.ListByFleet(ctx, id) - if err != nil { - 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 = ListByFleetCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmember.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmember.go deleted file mode 100644 index 8ed0d565be4..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmember.go +++ /dev/null @@ -1,17 +0,0 @@ -package fleetmembers - -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 FleetMember struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FleetMemberProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmemberproperties.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmemberproperties.go deleted file mode 100644 index 3469b39211f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/model_fleetmemberproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package fleetmembers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetMemberProperties struct { - ClusterResourceId string `json:"clusterResourceId"` - ProvisioningState *FleetMemberProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/predicates.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/predicates.go deleted file mode 100644 index 944173ec74b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package fleetmembers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetMemberOperationPredicate struct { - ETag *string - Id *string - Name *string - Type *string -} - -func (p FleetMemberOperationPredicate) Matches(input FleetMember) 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.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/2022-09-02-preview/fleetmembers/version.go b/resource-manager/containerservice/2022-09-02-preview/fleetmembers/version.go deleted file mode 100644 index 6184fff66a9..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleetmembers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package fleetmembers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/fleetmembers/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/README.md b/resource-manager/containerservice/2022-09-02-preview/fleets/README.md deleted file mode 100644 index fc58af20c70..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/README.md +++ /dev/null @@ -1,137 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/fleets` Documentation - -The `fleets` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/fleets" -``` - - -### Client Initialization - -```go -client := fleets.NewFleetsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FleetsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - -payload := fleets.Fleet{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, fleets.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `FleetsClient.Delete` - -```go -ctx := context.TODO() -id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - -if err := client.DeleteThenPoll(ctx, id, fleets.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `FleetsClient.Get` - -```go -ctx := context.TODO() -id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - -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: `FleetsClient.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: `FleetsClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `FleetsClient.ListCredentials` - -```go -ctx := context.TODO() -id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - -read, err := client.ListCredentials(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FleetsClient.Update` - -```go -ctx := context.TODO() -id := fleets.NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - -payload := fleets.FleetPatch{ - // ... -} - - -read, err := client.Update(ctx, id, payload, fleets.DefaultUpdateOperationOptions()) -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/2022-09-02-preview/fleets/client.go b/resource-manager/containerservice/2022-09-02-preview/fleets/client.go deleted file mode 100644 index 199fd2ac0ed..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package fleets - -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 FleetsClient struct { - Client *resourcemanager.Client -} - -func NewFleetsClientWithBaseURI(sdkApi sdkEnv.Api) (*FleetsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "fleets", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FleetsClient: %+v", err) - } - - return &FleetsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/constants.go b/resource-manager/containerservice/2022-09-02-preview/fleets/constants.go deleted file mode 100644 index 1828806155f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package fleets - -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 FleetProvisioningState string - -const ( - FleetProvisioningStateCanceled FleetProvisioningState = "Canceled" - FleetProvisioningStateCreating FleetProvisioningState = "Creating" - FleetProvisioningStateDeleting FleetProvisioningState = "Deleting" - FleetProvisioningStateFailed FleetProvisioningState = "Failed" - FleetProvisioningStateSucceeded FleetProvisioningState = "Succeeded" - FleetProvisioningStateUpdating FleetProvisioningState = "Updating" -) - -func PossibleValuesForFleetProvisioningState() []string { - return []string{ - string(FleetProvisioningStateCanceled), - string(FleetProvisioningStateCreating), - string(FleetProvisioningStateDeleting), - string(FleetProvisioningStateFailed), - string(FleetProvisioningStateSucceeded), - string(FleetProvisioningStateUpdating), - } -} - -func (s *FleetProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFleetProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFleetProvisioningState(input string) (*FleetProvisioningState, error) { - vals := map[string]FleetProvisioningState{ - "canceled": FleetProvisioningStateCanceled, - "creating": FleetProvisioningStateCreating, - "deleting": FleetProvisioningStateDeleting, - "failed": FleetProvisioningStateFailed, - "succeeded": FleetProvisioningStateSucceeded, - "updating": FleetProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FleetProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet.go b/resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet.go deleted file mode 100644 index 6fce8b8ea59..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet.go +++ /dev/null @@ -1,130 +0,0 @@ -package fleets - -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(&FleetId{}) -} - -var _ resourceids.ResourceId = &FleetId{} - -// FleetId is a struct representing the Resource ID for a Fleet -type FleetId struct { - SubscriptionId string - ResourceGroupName string - FleetName string -} - -// NewFleetID returns a new FleetId struct -func NewFleetID(subscriptionId string, resourceGroupName string, fleetName string) FleetId { - return FleetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FleetName: fleetName, - } -} - -// ParseFleetID parses 'input' into a FleetId -func ParseFleetID(input string) (*FleetId, error) { - parser := resourceids.NewParserFromResourceIdType(&FleetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FleetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFleetIDInsensitively parses 'input' case-insensitively into a FleetId -// note: this method should only be used for API response data and not user input -func ParseFleetIDInsensitively(input string) (*FleetId, error) { - parser := resourceids.NewParserFromResourceIdType(&FleetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FleetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FleetId) 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.FleetName, ok = input.Parsed["fleetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "fleetName", input) - } - - return nil -} - -// ValidateFleetID checks that 'input' can be parsed as a Fleet ID -func ValidateFleetID(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 := ParseFleetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Fleet ID -func (id FleetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/fleets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FleetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Fleet ID -func (id FleetId) 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("staticFleets", "fleets", "fleets"), - resourceids.UserSpecifiedSegment("fleetName", "fleetValue"), - } -} - -// String returns a human-readable description of this Fleet ID -func (id FleetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Fleet Name: %q", id.FleetName), - } - return fmt.Sprintf("Fleet (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet_test.go b/resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet_test.go deleted file mode 100644 index 5b11dbe34c9..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/id_fleet_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package fleets - -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 = &FleetId{} - -func TestNewFleetID(t *testing.T) { - id := NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue") - - 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.FleetName != "fleetValue" { - t.Fatalf("Expected %q but got %q for Segment 'FleetName'", id.FleetName, "fleetValue") - } -} - -func TestFormatFleetID(t *testing.T) { - actual := NewFleetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "fleetValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFleetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FleetId - }{ - { - // 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/fleets", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue", - Expected: &FleetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FleetName: "fleetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFleetID(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.FleetName != v.Expected.FleetName { - t.Fatalf("Expected %q but got %q for FleetName", v.Expected.FleetName, actual.FleetName) - } - - } -} - -func TestParseFleetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FleetId - }{ - { - // 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/fleets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/fLeEtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue", - Expected: &FleetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FleetName: "fleetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/fleets/fleetValue/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/fLeEtS/fLeEtVaLuE", - Expected: &FleetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FleetName: "fLeEtVaLuE", - }, - }, - { - // 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/fLeEtS/fLeEtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFleetIDInsensitively(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.FleetName != v.Expected.FleetName { - t.Fatalf("Expected %q but got %q for FleetName", v.Expected.FleetName, actual.FleetName) - } - - } -} - -func TestSegmentsForFleetId(t *testing.T) { - segments := FleetId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FleetId 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/2022-09-02-preview/fleets/method_createorupdate.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_createorupdate.go deleted file mode 100644 index 1903621e2e5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_createorupdate.go +++ /dev/null @@ -1,107 +0,0 @@ -package fleets - -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 *Fleet -} - -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 FleetsClient) CreateOrUpdate(ctx context.Context, id FleetId, input Fleet, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 FleetsClient) CreateOrUpdateThenPoll(ctx context.Context, id FleetId, input Fleet, 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/2022-09-02-preview/fleets/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_delete.go deleted file mode 100644 index af583413da9..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package fleets - -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 -} - -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{} - - return &out -} - -// Delete ... -func (c FleetsClient) Delete(ctx context.Context, id FleetId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 FleetsClient) DeleteThenPoll(ctx context.Context, id FleetId, 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/2022-09-02-preview/fleets/method_get.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_get.go deleted file mode 100644 index 146f057c861..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package fleets - -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 *Fleet -} - -// Get ... -func (c FleetsClient) Get(ctx context.Context, id FleetId) (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 Fleet - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/method_listbyresourcegroup.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_listbyresourcegroup.go deleted file mode 100644 index 34e0ca6a6cb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package fleets - -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 *[]Fleet -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Fleet -} - -// ListByResourceGroup ... -func (c FleetsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/fleets", 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 *[]Fleet `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 FleetsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, FleetOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FleetsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate FleetOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Fleet, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/2022-09-02-preview/fleets/method_listbysubscription.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_listbysubscription.go deleted file mode 100644 index b8af61b449c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package fleets - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Fleet -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []Fleet -} - -// ListBySubscription ... -func (c FleetsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/fleets", 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 *[]Fleet `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c FleetsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, FleetOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FleetsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate FleetOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]Fleet, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/method_listcredentials.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_listcredentials.go deleted file mode 100644 index 1e024cb076c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_listcredentials.go +++ /dev/null @@ -1,55 +0,0 @@ -package fleets - -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 ListCredentialsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FleetCredentialResults -} - -// ListCredentials ... -func (c FleetsClient) ListCredentials(ctx context.Context, id FleetId) (result ListCredentialsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listCredentials", 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 FleetCredentialResults - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/method_update.go b/resource-manager/containerservice/2022-09-02-preview/fleets/method_update.go deleted file mode 100644 index e02ad565cdf..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/method_update.go +++ /dev/null @@ -1,87 +0,0 @@ -package fleets - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Fleet -} - -type UpdateOperationOptions struct { - IfMatch *string -} - -func DefaultUpdateOperationOptions() UpdateOperationOptions { - return UpdateOperationOptions{} -} - -func (o UpdateOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - if o.IfMatch != nil { - out.Append("If-Match", fmt.Sprintf("%v", *o.IfMatch)) - } - return &out -} - -func (o UpdateOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o UpdateOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - - return &out -} - -// Update ... -func (c FleetsClient) Update(ctx context.Context, id FleetId, input FleetPatch, options UpdateOperationOptions) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: id.ID(), - OptionsObject: options, - } - - 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 Fleet - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleet.go b/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleet.go deleted file mode 100644 index a8a1792e44c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleet.go +++ /dev/null @@ -1,19 +0,0 @@ -package fleets - -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 Fleet struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *FleetProperties `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/2022-09-02-preview/fleets/model_fleetcredentialresult.go b/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresult.go deleted file mode 100644 index 099dbbf799a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package fleets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetCredentialResult struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresults.go b/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresults.go deleted file mode 100644 index e612aeac12d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetcredentialresults.go +++ /dev/null @@ -1,8 +0,0 @@ -package fleets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetCredentialResults struct { - Kubeconfigs *[]FleetCredentialResult `json:"kubeconfigs,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleethubprofile.go b/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleethubprofile.go deleted file mode 100644 index dda498b252f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleethubprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package fleets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetHubProfile struct { - DnsPrefix string `json:"dnsPrefix"` - Fqdn *string `json:"fqdn,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetpatch.go b/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetpatch.go deleted file mode 100644 index 76a64e869b5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package fleets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetPatch struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetproperties.go b/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetproperties.go deleted file mode 100644 index fd1c7418209..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/model_fleetproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package fleets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetProperties struct { - HubProfile *FleetHubProfile `json:"hubProfile,omitempty"` - ProvisioningState *FleetProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/predicates.go b/resource-manager/containerservice/2022-09-02-preview/fleets/predicates.go deleted file mode 100644 index 2e3f46e0dbb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package fleets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FleetOperationPredicate struct { - ETag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p FleetOperationPredicate) Matches(input Fleet) 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 -} diff --git a/resource-manager/containerservice/2022-09-02-preview/fleets/version.go b/resource-manager/containerservice/2022-09-02-preview/fleets/version.go deleted file mode 100644 index 6c6bbe1db09..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/fleets/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package fleets - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/fleets/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md deleted file mode 100644 index 836e32a4632..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/README.md +++ /dev/null @@ -1,91 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations` Documentation - -The `maintenanceconfigurations` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue", "maintenanceConfigurationValue") - -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", "managedClusterValue", "maintenanceConfigurationValue") - -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", "managedClusterValue", "maintenanceConfigurationValue") - -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", "managedClusterValue") - -// 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/2022-09-02-preview/maintenanceconfigurations/client.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/client.go deleted file mode 100644 index 4d799de617c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/maintenanceconfigurations/constants.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/constants.go deleted file mode 100644 index 5de31c62f8d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/constants.go +++ /dev/null @@ -1,66 +0,0 @@ -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 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/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go deleted file mode 100644 index cb172f6bd60..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), - resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationValue"), - } -} - -// 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/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go deleted file mode 100644 index 6931501293c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "maintenanceConfigurationValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.MaintenanceConfigurationName != "maintenanceConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationValue") - } -} - -func TestFormatMaintenanceConfigurationID(t *testing.T) { - actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "maintenanceConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - MaintenanceConfigurationName: "maintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/mAiNtEnAnCeCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - MaintenanceConfigurationName: "maintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue/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/mAnAgEdClUsTeRvAlUe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNvAlUe/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/containerservice/2022-09-02-preview/maintenanceconfigurations/method_createorupdate.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_createorupdate.go deleted file mode 100644 index 726183cac89..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_createorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package maintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// CreateOrUpdate ... -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{ - 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_delete.go deleted file mode 100644 index 5993be4c15a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package maintenanceconfigurations - -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 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.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/2022-09-02-preview/maintenanceconfigurations/method_get.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_get.go deleted file mode 100644 index 6ea658ab6d5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package maintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// Get ... -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: 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go deleted file mode 100644 index dae38e85821..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go deleted file mode 100644 index 9066e53bff3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -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/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go deleted file mode 100644 index f51d6917710..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -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 { - NotAllowedTime *[]TimeSpan `json:"notAllowedTime,omitempty"` - TimeInWeek *[]TimeInWeek `json:"timeInWeek,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timeinweek.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timeinweek.go deleted file mode 100644 index cba259f76fc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timeinweek.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/maintenanceconfigurations/model_timespan.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timespan.go deleted file mode 100644 index 7bbc8c5ba72..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/model_timespan.go +++ /dev/null @@ -1,39 +0,0 @@ -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/2022-09-02-preview/maintenanceconfigurations/predicates.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/predicates.go deleted file mode 100644 index c7eedb4fa7b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -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 MaintenanceConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p MaintenanceConfigurationOperationPredicate) Matches(input MaintenanceConfiguration) 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/2022-09-02-preview/maintenanceconfigurations/version.go b/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/version.go deleted file mode 100644 index 6731a6170f5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/maintenanceconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package maintenanceconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/maintenanceconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md b/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md deleted file mode 100644 index 33dbb5bed90..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/README.md +++ /dev/null @@ -1,361 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclusters` Documentation - -The `managedclusters` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue") - -read, err := client.AbortLatestOperation(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ManagedClustersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -payload := managedclusters.ManagedCluster{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue", "accessProfileValue") - -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", "managedClusterValue", "commandIdValue") - -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.GetOSOptions` - -```go -ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.GetOSOptions(ctx, id, managedclusters.DefaultGetOSOptionsOperationOptions()) -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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.ListOutboundNetworkDependenciesEndpoints` - -```go -ctx := context.TODO() -id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -// 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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -payload := managedclusters.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/client.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/client.go deleted file mode 100644 index 5081c63c8e6..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/managedclusters/constants.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/constants.go deleted file mode 100644 index c3162091200..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/constants.go +++ /dev/null @@ -1,1537 +0,0 @@ -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 ControlledValues string - -const ( - ControlledValuesRequestsAndLimits ControlledValues = "RequestsAndLimits" - ControlledValuesRequestsOnly ControlledValues = "RequestsOnly" -) - -func PossibleValuesForControlledValues() []string { - return []string{ - string(ControlledValuesRequestsAndLimits), - string(ControlledValuesRequestsOnly), - } -} - -func (s *ControlledValues) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseControlledValues(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseControlledValues(input string) (*ControlledValues, error) { - vals := map[string]ControlledValues{ - "requestsandlimits": ControlledValuesRequestsAndLimits, - "requestsonly": ControlledValuesRequestsOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ControlledValues(input) - return &out, nil -} - -type EbpfDataplane string - -const ( - EbpfDataplaneCilium EbpfDataplane = "cilium" -) - -func PossibleValuesForEbpfDataplane() []string { - return []string{ - string(EbpfDataplaneCilium), - } -} - -func (s *EbpfDataplane) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEbpfDataplane(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEbpfDataplane(input string) (*EbpfDataplane, error) { - vals := map[string]EbpfDataplane{ - "cilium": EbpfDataplaneCilium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EbpfDataplane(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 IPvsScheduler string - -const ( - IPvsSchedulerLeastConnection IPvsScheduler = "LeastConnection" - IPvsSchedulerRoundRobin IPvsScheduler = "RoundRobin" -) - -func PossibleValuesForIPvsScheduler() []string { - return []string{ - string(IPvsSchedulerLeastConnection), - string(IPvsSchedulerRoundRobin), - } -} - -func (s *IPvsScheduler) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPvsScheduler(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPvsScheduler(input string) (*IPvsScheduler, error) { - vals := map[string]IPvsScheduler{ - "leastconnection": IPvsSchedulerLeastConnection, - "roundrobin": IPvsSchedulerRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPvsScheduler(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 Level string - -const ( - LevelEnforcement Level = "Enforcement" - LevelOff Level = "Off" - LevelWarning Level = "Warning" -) - -func PossibleValuesForLevel() []string { - return []string{ - string(LevelEnforcement), - string(LevelOff), - string(LevelWarning), - } -} - -func (s *Level) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLevel(input string) (*Level, error) { - vals := map[string]Level{ - "enforcement": LevelEnforcement, - "off": LevelOff, - "warning": LevelWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Level(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" - ManagedClusterPodIdentityProvisioningStateDeleting ManagedClusterPodIdentityProvisioningState = "Deleting" - ManagedClusterPodIdentityProvisioningStateFailed ManagedClusterPodIdentityProvisioningState = "Failed" - ManagedClusterPodIdentityProvisioningStateUpdating ManagedClusterPodIdentityProvisioningState = "Updating" -) - -func PossibleValuesForManagedClusterPodIdentityProvisioningState() []string { - return []string{ - string(ManagedClusterPodIdentityProvisioningStateAssigned), - string(ManagedClusterPodIdentityProvisioningStateDeleting), - string(ManagedClusterPodIdentityProvisioningStateFailed), - 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, - "deleting": ManagedClusterPodIdentityProvisioningStateDeleting, - "failed": ManagedClusterPodIdentityProvisioningStateFailed, - "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 ( - ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" -) - -func PossibleValuesForManagedClusterSKUName() []string { - return []string{ - string(ManagedClusterSKUNameBasic), - } -} - -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{ - "basic": ManagedClusterSKUNameBasic, - } - 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" - ManagedClusterSKUTierPaid ManagedClusterSKUTier = "Paid" -) - -func PossibleValuesForManagedClusterSKUTier() []string { - return []string{ - string(ManagedClusterSKUTierFree), - string(ManagedClusterSKUTierPaid), - } -} - -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, - "paid": ManagedClusterSKUTierPaid, - } - 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 Mode string - -const ( - ModeIPTABLES Mode = "IPTABLES" - ModeIPVS Mode = "IPVS" -) - -func PossibleValuesForMode() []string { - return []string{ - string(ModeIPTABLES), - string(ModeIPVS), - } -} - -func (s *Mode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMode(input string) (*Mode, error) { - vals := map[string]Mode{ - "iptables": ModeIPTABLES, - "ipvs": ModeIPVS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Mode(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" -) - -func PossibleValuesForNetworkPolicy() []string { - return []string{ - string(NetworkPolicyAzure), - string(NetworkPolicyCalico), - } -} - -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, - } - 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 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 ( - OSSKUCBLMariner OSSKU = "CBLMariner" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUCBLMariner), - string(OSSKUMariner), - 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{ - "cblmariner": OSSKUCBLMariner, - "mariner": OSSKUMariner, - "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" - PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" -) - -func PossibleValuesForPublicNetworkAccess() []string { - return []string{ - string(PublicNetworkAccessDisabled), - string(PublicNetworkAccessEnabled), - string(PublicNetworkAccessSecuredByPerimeter), - } -} - -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, - "securedbyperimeter": PublicNetworkAccessSecuredByPerimeter, - } - 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 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 UpdateMode string - -const ( - UpdateModeAuto UpdateMode = "Auto" - UpdateModeInitial UpdateMode = "Initial" - UpdateModeOff UpdateMode = "Off" - UpdateModeRecreate UpdateMode = "Recreate" -) - -func PossibleValuesForUpdateMode() []string { - return []string{ - string(UpdateModeAuto), - string(UpdateModeInitial), - string(UpdateModeOff), - string(UpdateModeRecreate), - } -} - -func (s *UpdateMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateMode(input string) (*UpdateMode, error) { - vals := map[string]UpdateMode{ - "auto": UpdateModeAuto, - "initial": UpdateModeInitial, - "off": UpdateModeOff, - "recreate": UpdateModeRecreate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateMode(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/2022-09-02-preview/managedclusters/id_accessprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_accessprofile.go deleted file mode 100644 index 6719ccebee1..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_accessprofile.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), - resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileValue"), - } -} - -// 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/2022-09-02-preview/managedclusters/id_accessprofile_test.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_accessprofile_test.go deleted file mode 100644 index ae85155dd07..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_accessprofile_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "accessProfileValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.AccessProfileName != "accessProfileValue" { - t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "accessProfileValue") - } -} - -func TestFormatAccessProfileID(t *testing.T) { - actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "accessProfileValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue", - Expected: &AccessProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AccessProfileName: "accessProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/aCcEsSpRoFiLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue", - Expected: &AccessProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AccessProfileName: "accessProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue/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/mAnAgEdClUsTeRvAlUe/aCcEsSpRoFiLeS/aCcEsSpRoFiLeVaLuE", - Expected: &AccessProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - AccessProfileName: "aCcEsSpRoFiLeVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/aCcEsSpRoFiLeS/aCcEsSpRoFiLeVaLuE/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/2022-09-02-preview/managedclusters/id_commandresult.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_commandresult.go deleted file mode 100644 index 8cad7061547..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_commandresult.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticCommandResults", "commandResults", "commandResults"), - resourceids.UserSpecifiedSegment("commandId", "commandIdValue"), - } -} - -// 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/containerservice/2022-09-02-preview/managedclusters/id_commandresult_test.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_commandresult_test.go deleted file mode 100644 index 708a5b3b98d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_commandresult_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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 = &CommandResultId{} - -func TestNewCommandResultID(t *testing.T) { - id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "commandIdValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.CommandId != "commandIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'CommandId'", id.CommandId, "commandIdValue") - } -} - -func TestFormatCommandResultID(t *testing.T) { - actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "commandIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCommandResultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommandResultId - }{ - { - // 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue", - Expected: &CommandResultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - CommandId: "commandIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommandResultID(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.CommandId != v.Expected.CommandId { - t.Fatalf("Expected %q but got %q for CommandId", v.Expected.CommandId, actual.CommandId) - } - - } -} - -func TestParseCommandResultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommandResultId - }{ - { - // 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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/cOmMaNdReSuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue", - Expected: &CommandResultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - CommandId: "commandIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue/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/mAnAgEdClUsTeRvAlUe/cOmMaNdReSuLtS/cOmMaNdIdVaLuE", - Expected: &CommandResultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - CommandId: "cOmMaNdIdVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/cOmMaNdReSuLtS/cOmMaNdIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommandResultIDInsensitively(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.CommandId != v.Expected.CommandId { - t.Fatalf("Expected %q but got %q for CommandId", v.Expected.CommandId, actual.CommandId) - } - - } -} - -func TestSegmentsForCommandResultId(t *testing.T) { - segments := CommandResultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CommandResultId 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/2022-09-02-preview/managedclusters/id_location.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_location.go deleted file mode 100644 index 2a97028d499..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -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", "locationValue"), - } -} - -// 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/2022-09-02-preview/managedclusters/id_location_test.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_location_test.go deleted file mode 100644 index 1d6af703274..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue" - 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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe/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/2022-09-02-preview/managedclusters/method_abortlatestoperation.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation.go deleted file mode 100644 index 635c6bcc2ab..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_abortlatestoperation.go +++ /dev/null @@ -1,48 +0,0 @@ -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 AbortLatestOperationOperationResponse struct { - 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.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 - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate.go deleted file mode 100644 index c32d75d0be9..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -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 -} - -// CreateOrUpdate ... -func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) (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 - } - - 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) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/2022-09-02-preview/managedclusters/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete.go deleted file mode 100644 index 53bf6a9ac7c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -type DeleteOperationOptions struct { - IgnorePodDisruptionBudget *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - 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 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, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - OptionsObject: options, - } - - 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 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/2022-09-02-preview/managedclusters/method_get.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get.go deleted file mode 100644 index 7962c50ca93..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_getaccessprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getaccessprofile.go deleted file mode 100644 index fb2fd875c42..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getaccessprofile.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_getcommandresult.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getcommandresult.go deleted file mode 100644 index 3f6f4f1f00f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getcommandresult.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_getosoptions.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getosoptions.go deleted file mode 100644 index 8f4f629fc4d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getosoptions.go +++ /dev/null @@ -1,83 +0,0 @@ -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 GetOSOptionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *OSOptionProfile -} - -type GetOSOptionsOperationOptions struct { - ResourceType *string -} - -func DefaultGetOSOptionsOperationOptions() GetOSOptionsOperationOptions { - return GetOSOptionsOperationOptions{} -} - -func (o GetOSOptionsOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOSOptionsOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOSOptionsOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ResourceType != nil { - out.Append("resource-type", fmt.Sprintf("%v", *o.ResourceType)) - } - return &out -} - -// GetOSOptions ... -func (c ManagedClustersClient) GetOSOptions(ctx context.Context, id LocationId, options GetOSOptionsOperationOptions) (result GetOSOptionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/osOptions/default", id.ID()), - OptionsObject: options, - } - - 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 OSOptionProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile.go deleted file mode 100644 index 9b500de8b58..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_getupgradeprofile.go +++ /dev/null @@ -1,56 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_list.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_list.go deleted file mode 100644 index 17fb5e8fb68..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2022-09-02-preview/managedclusters/method_listbyresourcegroup.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listbyresourcegroup.go deleted file mode 100644 index ee4658b5e0f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2022-09-02-preview/managedclusters/method_listclusteradmincredentials.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials.go deleted file mode 100644 index ffd25c8f6ec..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusteradmincredentials.go +++ /dev/null @@ -1,84 +0,0 @@ -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, - Path: fmt.Sprintf("%s/listClusterAdminCredential", id.ID()), - OptionsObject: options, - } - - 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/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials.go deleted file mode 100644 index 085c52f9396..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclustermonitoringusercredentials.go +++ /dev/null @@ -1,84 +0,0 @@ -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, - Path: fmt.Sprintf("%s/listClusterMonitoringUserCredential", id.ID()), - OptionsObject: options, - } - - 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/2022-09-02-preview/managedclusters/method_listclusterusercredentials.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials.go deleted file mode 100644 index b0a714473bd..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listclusterusercredentials.go +++ /dev/null @@ -1,88 +0,0 @@ -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, - Path: fmt.Sprintf("%s/listClusterUserCredential", id.ID()), - OptionsObject: options, - } - - 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/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go deleted file mode 100644 index 759383196b8..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile.go deleted file mode 100644 index abdbb59c018..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetaadprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -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 ResetAADProfileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// 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/resetAADProfile", 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 -} - -// 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 ResetAADProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetAADProfile: %+v", err) - } - - return nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile.go deleted file mode 100644 index 54589acaf03..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_resetserviceprincipalprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_rotateclustercertificates.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates.go deleted file mode 100644 index 3d04938f645..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateclustercertificates.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go deleted file mode 100644 index b4cecc16d85..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_runcommand.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand.go deleted file mode 100644 index b64b4ec1b20..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_runcommand.go +++ /dev/null @@ -1,76 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_start.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start.go deleted file mode 100644 index ba4549e7615..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_start.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_stop.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop.go deleted file mode 100644 index 3bec609e3b4..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_stop.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2022-09-02-preview/managedclusters/method_updatetags.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags.go deleted file mode 100644 index 1ed48544bf9..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -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 -} - -// UpdateTags ... -func (c ManagedClustersClient) UpdateTags(ctx context.Context, id commonids.KubernetesClusterId, 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 - } - - 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) error { - result, err := c.UpdateTags(ctx, id, input) - 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/2022-09-02-preview/managedclusters/model_accessprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_accessprofile.go deleted file mode 100644 index c13b64ab25d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_accessprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_agentpoolnetworkprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolnetworkprofile.go deleted file mode 100644 index 1a5b19f5db1..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolnetworkprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_agentpoolupgradesettings.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolupgradesettings.go deleted file mode 100644 index 461cb4361b0..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - MaxSurge *string `json:"maxSurge,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolwindowsprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolwindowsprofile.go deleted file mode 100644 index 5558f04ed00..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_agentpoolwindowsprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_azurekeyvaultkms.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_azurekeyvaultkms.go deleted file mode 100644 index 57c4e7848f3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_azurekeyvaultkms.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_commandresultproperties.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_commandresultproperties.go deleted file mode 100644 index 745a87ae4ea..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_commandresultproperties.go +++ /dev/null @@ -1,43 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_containerservicelinuxprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicelinuxprofile.go deleted file mode 100644 index a3abf14adeb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicelinuxprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_containerservicenetworkprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofile.go deleted file mode 100644 index fdcd8b00931..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofile.go +++ /dev/null @@ -1,24 +0,0 @@ -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 { - DnsServiceIP *string `json:"dnsServiceIP,omitempty"` - DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` - EbpfDataplane *EbpfDataplane `json:"ebpfDataplane,omitempty"` - IPFamilies *[]IPFamily `json:"ipFamilies,omitempty"` - KubeProxyConfig *ContainerServiceNetworkProfileKubeProxyConfig `json:"kubeProxyConfig,omitempty"` - LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` - LoadBalancerSku *LoadBalancerSku `json:"loadBalancerSku,omitempty"` - NatGatewayProfile *ManagedClusterNATGatewayProfile `json:"natGatewayProfile,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/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go deleted file mode 100644 index 5be387f7c40..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go +++ /dev/null @@ -1,10 +0,0 @@ -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 ContainerServiceNetworkProfileKubeProxyConfig struct { - Enabled *bool `json:"enabled,omitempty"` - IPvsConfig *ContainerServiceNetworkProfileKubeProxyConfigIPvsConfig `json:"ipvsConfig,omitempty"` - Mode *Mode `json:"mode,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go deleted file mode 100644 index 96dc155e9d5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -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 ContainerServiceNetworkProfileKubeProxyConfigIPvsConfig struct { - Scheduler *IPvsScheduler `json:"scheduler,omitempty"` - TcpFinTimeoutSeconds *int64 `json:"tcpFinTimeoutSeconds,omitempty"` - TcpTimeoutSeconds *int64 `json:"tcpTimeoutSeconds,omitempty"` - UdpTimeoutSeconds *int64 `json:"udpTimeoutSeconds,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshconfiguration.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshconfiguration.go deleted file mode 100644 index 4bf259bd15d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_containerservicesshpublickey.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshpublickey.go deleted file mode 100644 index 7796cdf6a90..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_containerservicesshpublickey.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_creationdata.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_creationdata.go deleted file mode 100644 index f2f19907006..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_credentialresult.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_credentialresult.go deleted file mode 100644 index 7002f56084e..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_credentialresult.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_credentialresults.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_credentialresults.go deleted file mode 100644 index c572432888e..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_credentialresults.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_endpointdependency.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_endpointdependency.go deleted file mode 100644 index ae8639b529b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_endpointdependency.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_endpointdetail.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_endpointdetail.go deleted file mode 100644 index de73a2e9168..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_endpointdetail.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_guardrailsprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_guardrailsprofile.go deleted file mode 100644 index 6875f54cbbe..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_guardrailsprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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 GuardrailsProfile struct { - ExcludedNamespaces *[]string `json:"excludedNamespaces,omitempty"` - Level Level `json:"level"` - SystemExcludedNamespaces *[]string `json:"systemExcludedNamespaces,omitempty"` - Version string `json:"version"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_iptag.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_iptag.go deleted file mode 100644 index 0aefb50d15f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -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/containerservice/2022-09-02-preview/managedclusters/model_kubeletconfig.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_kubeletconfig.go deleted file mode 100644 index 0f4036b4e7c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_kubeletconfig.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_linuxosconfig.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_linuxosconfig.go deleted file mode 100644 index 431f6faa2aa..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_linuxosconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedcluster.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedcluster.go deleted file mode 100644 index 96f028c8024..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedcluster.go +++ /dev/null @@ -1,23 +0,0 @@ -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 { - 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/2022-09-02-preview/managedclusters/model_managedclusteraadprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraadprofile.go deleted file mode 100644 index 271addb1fd4..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraadprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusteraccessprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraccessprofile.go deleted file mode 100644 index e248b2a253b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraccessprofile.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusteraddonprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraddonprofile.go deleted file mode 100644 index 7dc1f865d9d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteraddonprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusteragentpoolprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteragentpoolprofile.go deleted file mode 100644 index 747121cce22..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteragentpoolprofile.go +++ /dev/null @@ -1,58 +0,0 @@ -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"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` - EnableCustomCATrust *bool `json:"enableCustomCATrust,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"` - MessageOfTheDay *string `json:"messageOfTheDay,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"` - 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/2022-09-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go deleted file mode 100644 index 69b53ef85a7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` - EnableVnetIntegration *bool `json:"enableVnetIntegration,omitempty"` - PrivateDNSZone *string `json:"privateDNSZone,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go deleted file mode 100644 index 9c3598b8b39..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - UpgradeChannel *UpgradeChannel `json:"upgradeChannel,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go deleted file mode 100644 index 8a18140e45a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go deleted file mode 100644 index ef0fb9066e2..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go deleted file mode 100644 index 5c173441517..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go deleted file mode 100644 index b9f46785387..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -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 { - EffectiveNoProxy *[]string `json:"effectiveNoProxy,omitempty"` - 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/2022-09-02-preview/managedclusters/model_managedclusteringressprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteringressprofile.go deleted file mode 100644 index ef54c8e8069..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteringressprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go deleted file mode 100644 index 32d89b35971..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go +++ /dev/null @@ -1,9 +0,0 @@ -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 { - DnsZoneResourceId *string `json:"dnsZoneResourceId,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go deleted file mode 100644 index 0d2207851bd..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go +++ /dev/null @@ -1,15 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go deleted file mode 100644 index b8d24680fed..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go deleted file mode 100644 index 76893c76d85..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go deleted file mode 100644 index f0a60f5817e..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go deleted file mode 100644 index ec079b6cdf4..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusternatgatewayprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusternatgatewayprofile.go deleted file mode 100644 index a7e37699c62..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusternatgatewayprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go deleted file mode 100644 index b5d3be88f7d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpodidentity.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentity.go deleted file mode 100644 index 3bfb6799645..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentity.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpodidentityexception.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityexception.go deleted file mode 100644 index 28a710f9b5c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityexception.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprofile.go deleted file mode 100644 index e32db30028a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go deleted file mode 100644 index 1fb66d9034f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go deleted file mode 100644 index db4466f80bf..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go deleted file mode 100644 index 60464e39c82..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go deleted file mode 100644 index 7bafa5df972..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go deleted file mode 100644 index ccc02dd9957..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterproperties.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterproperties.go deleted file mode 100644 index b69cdd6fddb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -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"` - CreationData *CreationData `json:"creationData,omitempty"` - CurrentKubernetesVersion *string `json:"currentKubernetesVersion,omitempty"` - DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` - DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` - DnsPrefix *string `json:"dnsPrefix,omitempty"` - EnableNamespaceResources *bool `json:"enableNamespaceResources,omitempty"` - EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` - EnableRBAC *bool `json:"enableRBAC,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"` - GuardrailsProfile *GuardrailsProfile `json:"guardrailsProfile,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"` - NetworkProfile *ContainerServiceNetworkProfile `json:"networkProfile,omitempty"` - NodeResourceGroup *string `json:"nodeResourceGroup,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"` - SecurityProfile *ManagedClusterSecurityProfile `json:"securityProfile,omitempty"` - ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` - StorageProfile *ManagedClusterStorageProfile `json:"storageProfile,omitempty"` - WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` - WorkloadAutoScalerProfile *ManagedClusterWorkloadAutoScalerProfile `json:"workloadAutoScalerProfile,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go deleted file mode 100644 index 17fe396efa8..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go +++ /dev/null @@ -1,24 +0,0 @@ -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"` - Expander *Expander `json:"expander,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/2022-09-02-preview/managedclusters/model_managedclustersecurityprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofile.go deleted file mode 100644 index aecfd2517c1..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofile.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` - CustomCATrustCertificates *[]string `json:"customCATrustCertificates,omitempty"` - Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` - ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` - NodeRestriction *ManagedClusterSecurityProfileNodeRestriction `json:"nodeRestriction,omitempty"` - WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go deleted file mode 100644 index c63debde097..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go deleted file mode 100644 index de84c795fec..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go deleted file mode 100644 index eb3e2ea7007..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go deleted file mode 100644 index 6730a946379..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go +++ /dev/null @@ -1,8 +0,0 @@ -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 ManagedClusterSecurityProfileNodeRestriction struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go deleted file mode 100644 index 84f0312767b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go deleted file mode 100644 index 2a03beecdcc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclustersku.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersku.go deleted file mode 100644 index a4dcf9c50d3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclustersku.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterstorageprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofile.go deleted file mode 100644 index 11073ae103d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go deleted file mode 100644 index dc0e951be6b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go deleted file mode 100644 index 5a12e13453f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go +++ /dev/null @@ -1,9 +0,0 @@ -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"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go deleted file mode 100644 index 986ece9d933..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go deleted file mode 100644 index d46ee10b683..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofile.go deleted file mode 100644 index 86274cdb14a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go deleted file mode 100644 index 4db4b126760..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterwindowsprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterwindowsprofile.go deleted file mode 100644 index 8e3cffdace8..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterwindowsprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go deleted file mode 100644 index 891a44a0084..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go deleted file mode 100644 index 7115a06bfb3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go deleted file mode 100644 index de1c2badc46..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go +++ /dev/null @@ -1,10 +0,0 @@ -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 { - ControlledValues ControlledValues `json:"controlledValues"` - Enabled bool `json:"enabled"` - UpdateMode UpdateMode `json:"updateMode"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionprofile.go deleted file mode 100644 index 27b0bbc0c20..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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 OSOptionProfile struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties OSOptionPropertyList `json:"properties"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionproperty.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionproperty.go deleted file mode 100644 index 4c8a976ae2d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionproperty.go +++ /dev/null @@ -1,9 +0,0 @@ -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 OSOptionProperty struct { - EnableFipsImage bool `json:"enable-fips-image"` - OsType string `json:"os-type"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionpropertylist.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionpropertylist.go deleted file mode 100644 index 5c126250b2c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_osoptionpropertylist.go +++ /dev/null @@ -1,8 +0,0 @@ -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 OSOptionPropertyList struct { - OsOptionPropertyList []OSOptionProperty `json:"osOptionPropertyList"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_outboundenvironmentendpoint.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_outboundenvironmentendpoint.go deleted file mode 100644 index a4f0d234bc8..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_outboundenvironmentendpoint.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_portrange.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_portrange.go deleted file mode 100644 index 0a44c59e9c8..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_portrange.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_powerstate.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_powerstate.go deleted file mode 100644 index d5abeb15b66..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_powerstate.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_privatelinkresource.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_privatelinkresource.go deleted file mode 100644 index 14d827574be..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_resourcereference.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_resourcereference.go deleted file mode 100644 index dbb05bb4711..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_resourcereference.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_runcommandrequest.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_runcommandrequest.go deleted file mode 100644 index caa9ae3d0cd..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_runcommandrequest.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_runcommandresult.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_runcommandresult.go deleted file mode 100644 index 59cfc374de3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_runcommandresult.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_sysctlconfig.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_sysctlconfig.go deleted file mode 100644 index 00f3cc50224..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_sysctlconfig.go +++ /dev/null @@ -1,35 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_tagsobject.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_tagsobject.go deleted file mode 100644 index 69f1454e3b1..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/managedclusters/model_userassignedidentity.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_userassignedidentity.go deleted file mode 100644 index b1eecd7085a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_userassignedidentity.go +++ /dev/null @@ -1,10 +0,0 @@ -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 UserAssignedIdentity struct { - ClientId *string `json:"clientId,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_windowsgmsaprofile.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_windowsgmsaprofile.go deleted file mode 100644 index 742f96764d4..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/model_windowsgmsaprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/managedclusters/predicates.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/predicates.go deleted file mode 100644 index c2d99eb9b4b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/predicates.go +++ /dev/null @@ -1,45 +0,0 @@ -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 { - Id *string - Location *string - Name *string - Type *string -} - -func (p ManagedClusterOperationPredicate) Matches(input ManagedCluster) 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 -} - -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/2022-09-02-preview/managedclusters/version.go b/resource-manager/containerservice/2022-09-02-preview/managedclusters/version.go deleted file mode 100644 index 007f75b28d2..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclusters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclusters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/managedclusters/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/README.md b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/README.md deleted file mode 100644 index ece26b75a1c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots` Documentation - -The `managedclustersnapshots` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots" -``` - - -### Client Initialization - -```go -client := managedclustersnapshots.NewManagedClusterSnapshotsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ManagedClusterSnapshotsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -payload := managedclustersnapshots.ManagedClusterSnapshot{ - // ... -} - - -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: `ManagedClusterSnapshotsClient.Delete` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -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: `ManagedClusterSnapshotsClient.Get` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -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: `ManagedClusterSnapshotsClient.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: `ManagedClusterSnapshotsClient.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: `ManagedClusterSnapshotsClient.UpdateTags` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -payload := managedclustersnapshots.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/2022-09-02-preview/managedclustersnapshots/client.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/client.go deleted file mode 100644 index 939ebd0b984..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package managedclustersnapshots - -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 ManagedClusterSnapshotsClient struct { - Client *resourcemanager.Client -} - -func NewManagedClusterSnapshotsClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagedClusterSnapshotsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "managedclustersnapshots", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ManagedClusterSnapshotsClient: %+v", err) - } - - return &ManagedClusterSnapshotsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/constants.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/constants.go deleted file mode 100644 index ed2cfee4a4a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/constants.go +++ /dev/null @@ -1,335 +0,0 @@ -package managedclustersnapshots - -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 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 ManagedClusterSKUName string - -const ( - ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" -) - -func PossibleValuesForManagedClusterSKUName() []string { - return []string{ - string(ManagedClusterSKUNameBasic), - } -} - -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{ - "basic": ManagedClusterSKUNameBasic, - } - 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" - ManagedClusterSKUTierPaid ManagedClusterSKUTier = "Paid" -) - -func PossibleValuesForManagedClusterSKUTier() []string { - return []string{ - string(ManagedClusterSKUTierFree), - string(ManagedClusterSKUTierPaid), - } -} - -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, - "paid": ManagedClusterSKUTierPaid, - } - 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 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" -) - -func PossibleValuesForNetworkPolicy() []string { - return []string{ - string(NetworkPolicyAzure), - string(NetworkPolicyCalico), - } -} - -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, - } - 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 SnapshotType string - -const ( - SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" - SnapshotTypeNodePool SnapshotType = "NodePool" -) - -func PossibleValuesForSnapshotType() []string { - return []string{ - string(SnapshotTypeManagedCluster), - 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{ - "managedcluster": SnapshotTypeManagedCluster, - "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/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot.go deleted file mode 100644 index bd22899cf08..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot.go +++ /dev/null @@ -1,130 +0,0 @@ -package managedclustersnapshots - -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(&ManagedClusterSnapshotId{}) -} - -var _ resourceids.ResourceId = &ManagedClusterSnapshotId{} - -// ManagedClusterSnapshotId is a struct representing the Resource ID for a Managed Cluster Snapshot -type ManagedClusterSnapshotId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterSnapshotName string -} - -// NewManagedClusterSnapshotID returns a new ManagedClusterSnapshotId struct -func NewManagedClusterSnapshotID(subscriptionId string, resourceGroupName string, managedClusterSnapshotName string) ManagedClusterSnapshotId { - return ManagedClusterSnapshotId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterSnapshotName: managedClusterSnapshotName, - } -} - -// ParseManagedClusterSnapshotID parses 'input' into a ManagedClusterSnapshotId -func ParseManagedClusterSnapshotID(input string) (*ManagedClusterSnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(&ManagedClusterSnapshotId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ManagedClusterSnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseManagedClusterSnapshotIDInsensitively parses 'input' case-insensitively into a ManagedClusterSnapshotId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterSnapshotIDInsensitively(input string) (*ManagedClusterSnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(&ManagedClusterSnapshotId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ManagedClusterSnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ManagedClusterSnapshotId) 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.ManagedClusterSnapshotName, ok = input.Parsed["managedClusterSnapshotName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterSnapshotName", input) - } - - return nil -} - -// ValidateManagedClusterSnapshotID checks that 'input' can be parsed as a Managed Cluster Snapshot ID -func ValidateManagedClusterSnapshotID(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 := ParseManagedClusterSnapshotID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster Snapshot ID -func (id ManagedClusterSnapshotId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusterSnapshots/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterSnapshotName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster Snapshot ID -func (id ManagedClusterSnapshotId) 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("staticManagedClusterSnapshots", "managedClusterSnapshots", "managedClusterSnapshots"), - resourceids.UserSpecifiedSegment("managedClusterSnapshotName", "managedClusterSnapshotValue"), - } -} - -// String returns a human-readable description of this Managed Cluster Snapshot ID -func (id ManagedClusterSnapshotId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Snapshot Name: %q", id.ManagedClusterSnapshotName), - } - return fmt.Sprintf("Managed Cluster Snapshot (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go deleted file mode 100644 index 13021711720..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package managedclustersnapshots - -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 = &ManagedClusterSnapshotId{} - -func TestNewManagedClusterSnapshotID(t *testing.T) { - id := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - - 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.ManagedClusterSnapshotName != "managedClusterSnapshotValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterSnapshotName'", id.ManagedClusterSnapshotName, "managedClusterSnapshotValue") - } -} - -func TestFormatManagedClusterSnapshotID(t *testing.T) { - actual := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseManagedClusterSnapshotID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ManagedClusterSnapshotId - }{ - { - // 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/managedClusterSnapshots", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue", - Expected: &ManagedClusterSnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterSnapshotName: "managedClusterSnapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseManagedClusterSnapshotID(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.ManagedClusterSnapshotName != v.Expected.ManagedClusterSnapshotName { - t.Fatalf("Expected %q but got %q for ManagedClusterSnapshotName", v.Expected.ManagedClusterSnapshotName, actual.ManagedClusterSnapshotName) - } - - } -} - -func TestParseManagedClusterSnapshotIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ManagedClusterSnapshotId - }{ - { - // 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/managedClusterSnapshots", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRsNaPsHoTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue", - Expected: &ManagedClusterSnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterSnapshotName: "managedClusterSnapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue/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/mAnAgEdClUsTeRsNaPsHoTs/mAnAgEdClUsTeRsNaPsHoTvAlUe", - Expected: &ManagedClusterSnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterSnapshotName: "mAnAgEdClUsTeRsNaPsHoTvAlUe", - }, - }, - { - // 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/mAnAgEdClUsTeRsNaPsHoTs/mAnAgEdClUsTeRsNaPsHoTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseManagedClusterSnapshotIDInsensitively(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.ManagedClusterSnapshotName != v.Expected.ManagedClusterSnapshotName { - t.Fatalf("Expected %q but got %q for ManagedClusterSnapshotName", v.Expected.ManagedClusterSnapshotName, actual.ManagedClusterSnapshotName) - } - - } -} - -func TestSegmentsForManagedClusterSnapshotId(t *testing.T) { - segments := ManagedClusterSnapshotId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ManagedClusterSnapshotId 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/2022-09-02-preview/managedclustersnapshots/method_createorupdate.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_createorupdate.go deleted file mode 100644 index 1041144ec50..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package managedclustersnapshots - -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 *ManagedClusterSnapshot -} - -// CreateOrUpdate ... -func (c ManagedClusterSnapshotsClient) CreateOrUpdate(ctx context.Context, id ManagedClusterSnapshotId, input ManagedClusterSnapshot) (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 ManagedClusterSnapshot - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_delete.go deleted file mode 100644 index 3b8fc26cc15..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package managedclustersnapshots - -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 ManagedClusterSnapshotsClient) Delete(ctx context.Context, id ManagedClusterSnapshotId) (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/2022-09-02-preview/managedclustersnapshots/method_get.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_get.go deleted file mode 100644 index ead8643d9dc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package managedclustersnapshots - -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 *ManagedClusterSnapshot -} - -// Get ... -func (c ManagedClusterSnapshotsClient) Get(ctx context.Context, id ManagedClusterSnapshotId) (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 ManagedClusterSnapshot - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_list.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_list.go deleted file mode 100644 index 9f0d4dec699..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package managedclustersnapshots - -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 *[]ManagedClusterSnapshot -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ManagedClusterSnapshot -} - -// List ... -func (c ManagedClusterSnapshotsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusterSnapshots", 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 *[]ManagedClusterSnapshot `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 ManagedClusterSnapshotsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ManagedClusterSnapshotOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ManagedClusterSnapshotsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ManagedClusterSnapshotOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ManagedClusterSnapshot, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/2022-09-02-preview/managedclustersnapshots/method_listbyresourcegroup.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_listbyresourcegroup.go deleted file mode 100644 index 4b28f6c8a05..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package managedclustersnapshots - -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 *[]ManagedClusterSnapshot -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ManagedClusterSnapshot -} - -// ListByResourceGroup ... -func (c ManagedClusterSnapshotsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusterSnapshots", 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 *[]ManagedClusterSnapshot `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 ManagedClusterSnapshotsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ManagedClusterSnapshotOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ManagedClusterSnapshotsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ManagedClusterSnapshotOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ManagedClusterSnapshot, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/2022-09-02-preview/managedclustersnapshots/method_updatetags.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_updatetags.go deleted file mode 100644 index f6dcaa5a53e..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package managedclustersnapshots - -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 *ManagedClusterSnapshot -} - -// UpdateTags ... -func (c ManagedClusterSnapshotsClient) UpdateTags(ctx context.Context, id ManagedClusterSnapshotId, 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 ManagedClusterSnapshot - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_creationdata.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_creationdata.go deleted file mode 100644 index 8fb59d8abec..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclustersnapshots - -// 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/2022-09-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go deleted file mode 100644 index fcf682d5789..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPropertiesForSnapshot struct { - EnableRbac *bool `json:"enableRbac,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty"` - NetworkProfile *NetworkProfileForSnapshot `json:"networkProfile,omitempty"` - Sku *ManagedClusterSKU `json:"sku,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersku.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersku.go deleted file mode 100644 index e3e12587809..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclustersnapshots - -// 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/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshot.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshot.go deleted file mode 100644 index 43b8096001b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshot.go +++ /dev/null @@ -1,18 +0,0 @@ -package managedclustersnapshots - -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 ManagedClusterSnapshot struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ManagedClusterSnapshotProperties `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/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go deleted file mode 100644 index 0710501e092..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSnapshotProperties struct { - CreationData *CreationData `json:"creationData,omitempty"` - ManagedClusterPropertiesReadOnly *ManagedClusterPropertiesForSnapshot `json:"managedClusterPropertiesReadOnly,omitempty"` - SnapshotType *SnapshotType `json:"snapshotType,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go deleted file mode 100644 index 02c1c65f57a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfileForSnapshot struct { - LoadBalancerSku *LoadBalancerSku `json:"loadBalancerSku,omitempty"` - NetworkMode *NetworkMode `json:"networkMode,omitempty"` - NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` - NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` - NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_tagsobject.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_tagsobject.go deleted file mode 100644 index a9e96162848..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclustersnapshots - -// 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/2022-09-02-preview/managedclustersnapshots/predicates.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/predicates.go deleted file mode 100644 index 665969defbb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSnapshotOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ManagedClusterSnapshotOperationPredicate) Matches(input ManagedClusterSnapshot) 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/2022-09-02-preview/managedclustersnapshots/version.go b/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/version.go deleted file mode 100644 index 9b743c02dfc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/managedclustersnapshots/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclustersnapshots - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/managedclustersnapshots/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md deleted file mode 100644 index 151dc69b1c3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections` Documentation - -The `privateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue", "privateEndpointConnectionValue") - -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", "managedClusterValue", "privateEndpointConnectionValue") - -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", "managedClusterValue") - -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", "managedClusterValue", "privateEndpointConnectionValue") - -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/2022-09-02-preview/privateendpointconnections/client.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/client.go deleted file mode 100644 index 3bf7a6afe1f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/privateendpointconnections/constants.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/constants.go deleted file mode 100644 index 2fca3d8c93b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/constants.go +++ /dev/null @@ -1,104 +0,0 @@ -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 ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { - return []string{ - 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{ - "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/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection.go deleted file mode 100644 index c682166f416..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// 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/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection_test.go deleted file mode 100644 index a2eb3acf095..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "privateEndpointConnectionValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue/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/mAnAgEdClUsTeRvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/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/2022-09-02-preview/privateendpointconnections/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_delete.go deleted file mode 100644 index 2b9a343bdf0..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/method_get.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_get.go deleted file mode 100644 index 8dc28d7ff7a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/method_list.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list.go deleted file mode 100644 index bd4dd26e8bb..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -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/containerservice/2022-09-02-preview/privateendpointconnections/method_update.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_update.go deleted file mode 100644 index c118ecada7d..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// Update ... -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.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 PrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpoint.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpoint.go deleted file mode 100644 index 1bc8cf2a97c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/model_privateendpointconnection.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnection.go deleted file mode 100644 index fde7f4db0fc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go deleted file mode 100644 index 92a9ecb105a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index 549d255f069..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 677cab99f90..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2022-09-02-preview/privateendpointconnections/version.go b/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/version.go deleted file mode 100644 index 4224d092f96..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpointconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpointconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md b/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md deleted file mode 100644 index eef49432cf7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/privatelinkresources` Documentation - -The `privatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue") - -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/2022-09-02-preview/privatelinkresources/client.go b/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/client.go deleted file mode 100644 index e6e22caa746..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/privatelinkresources/method_list.go b/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list.go deleted file mode 100644 index 836fd220ae3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -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/2022-09-02-preview/privatelinkresources/model_privatelinkresource.go b/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 3490b3d4e87..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2022-09-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go b/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go deleted file mode 100644 index 52cfe88b6e2..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/privatelinkresources/version.go b/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/version.go deleted file mode 100644 index 0604c3beab7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/privatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md b/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md deleted file mode 100644 index 90b07995a2f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid` Documentation - -The `resolveprivatelinkserviceid` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue") - -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/2022-09-02-preview/resolveprivatelinkserviceid/client.go b/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/client.go deleted file mode 100644 index dd21ffc0b6b..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/resolveprivatelinkserviceid/method_post.go b/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post.go deleted file mode 100644 index f583a77cede..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/method_post.go +++ /dev/null @@ -1,60 +0,0 @@ -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/2022-09-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go b/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go deleted file mode 100644 index 4ff07dba897..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2022-09-02-preview/resolveprivatelinkserviceid/version.go b/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/version.go deleted file mode 100644 index 71666bb3eba..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/resolveprivatelinkserviceid/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package resolveprivatelinkserviceid - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/resolveprivatelinkserviceid/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/snapshots/README.md b/resource-manager/containerservice/2022-09-02-preview/snapshots/README.md deleted file mode 100644 index 200e91d54c6..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/snapshots` Documentation - -The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "snapshotValue") - -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", "snapshotValue") - -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", "snapshotValue") - -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", "snapshotValue") - -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/2022-09-02-preview/snapshots/constants.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/constants.go deleted file mode 100644 index 74b099079a0..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/constants.go +++ /dev/null @@ -1,142 +0,0 @@ -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 ( - OSSKUCBLMariner OSSKU = "CBLMariner" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUCBLMariner), - string(OSSKUMariner), - 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{ - "cblmariner": OSSKUCBLMariner, - "mariner": OSSKUMariner, - "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 ( - SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" - SnapshotTypeNodePool SnapshotType = "NodePool" -) - -func PossibleValuesForSnapshotType() []string { - return []string{ - string(SnapshotTypeManagedCluster), - 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{ - "managedcluster": SnapshotTypeManagedCluster, - "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/containerservice/2022-09-02-preview/snapshots/id_snapshot.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot.go deleted file mode 100644 index 36f5d370bdf..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot.go +++ /dev/null @@ -1,130 +0,0 @@ -package snapshots - -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(&SnapshotId{}) -} - -var _ resourceids.ResourceId = &SnapshotId{} - -// SnapshotId is a struct representing the Resource ID for a Snapshot -type SnapshotId struct { - SubscriptionId string - ResourceGroupName string - SnapshotName string -} - -// NewSnapshotID returns a new SnapshotId struct -func NewSnapshotID(subscriptionId string, resourceGroupName string, snapshotName string) SnapshotId { - return SnapshotId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - SnapshotName: snapshotName, - } -} - -// 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 := SnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId -// note: this method should only be used for API response data and not user input -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 := SnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SnapshotId) 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.SnapshotName, ok = input.Parsed["snapshotName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "snapshotName", input) - } - - return nil -} - -// 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 := ParseSnapshotID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// 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 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), - resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), - } -} - -// 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("Snapshot Name: %q", id.SnapshotName), - } - return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot_test.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot_test.go deleted file mode 100644 index 656f7bba56a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/id_snapshot_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package snapshots - -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 = &SnapshotId{} - -func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotValue") - - 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.SnapshotName != "snapshotValue" { - t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "snapshotValue") - } -} - -func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSnapshotID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SnapshotId - }{ - { - // 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/snapshots", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue", - Expected: &SnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SnapshotName: "snapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSnapshotID(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.SnapshotName != v.Expected.SnapshotName { - t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) - } - - } -} - -func TestParseSnapshotIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SnapshotId - }{ - { - // 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/snapshots", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - 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.ContainerService/snapshots/snapshotValue", - Expected: &SnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SnapshotName: "snapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue/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/sNaPsHoTs/sNaPsHoTvAlUe", - Expected: &SnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SnapshotName: "sNaPsHoTvAlUe", - }, - }, - { - // 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/sNaPsHoTs/sNaPsHoTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSnapshotIDInsensitively(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.SnapshotName != v.Expected.SnapshotName { - t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) - } - - } -} - -func TestSegmentsForSnapshotId(t *testing.T) { - segments := SnapshotId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SnapshotId 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/2022-09-02-preview/snapshots/method_createorupdate.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/method_createorupdate.go deleted file mode 100644 index 201c0eaedc7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -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/2022-09-02-preview/snapshots/method_delete.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/method_delete.go deleted file mode 100644 index 575cb8a6929..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -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/2022-09-02-preview/snapshots/method_list.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/method_list.go deleted file mode 100644 index bdefce6bb90..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2022-09-02-preview/snapshots/method_listbyresourcegroup.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/method_listbyresourcegroup.go deleted file mode 100644 index 824b8dc7cb6..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2022-09-02-preview/snapshots/method_updatetags.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/method_updatetags.go deleted file mode 100644 index 60346d7cddc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -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/2022-09-02-preview/snapshots/model_creationdata.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/model_creationdata.go deleted file mode 100644 index 132e3459c82..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/snapshots/model_snapshot.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/model_snapshot.go deleted file mode 100644 index b2feb4ccdae..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/model_snapshot.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2022-09-02-preview/snapshots/model_snapshotproperties.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/model_snapshotproperties.go deleted file mode 100644 index 962aa32598f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/model_snapshotproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -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/2022-09-02-preview/snapshots/model_tagsobject.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/model_tagsobject.go deleted file mode 100644 index 30f646c1c9f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2022-09-02-preview/snapshots/predicates.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/predicates.go deleted file mode 100644 index 832503e3b26..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -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/2022-09-02-preview/snapshots/version.go b/resource-manager/containerservice/2022-09-02-preview/snapshots/version.go deleted file mode 100644 index 5c6c24a71de..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/snapshots/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshots - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md deleted file mode 100644 index eb3b3c2629f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/README.md +++ /dev/null @@ -1,108 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/trustedaccess` Documentation - -The `trustedaccess` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2022-09-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2022-09-02-preview/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", "managedClusterValue", "trustedAccessRoleBindingValue") - -payload := trustedaccess.TrustedAccessRoleBinding{ - // ... -} - - -read, err := client.RoleBindingsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `TrustedAccessClient.RoleBindingsDelete` - -```go -ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "trustedAccessRoleBindingValue") - -read, err := client.RoleBindingsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `TrustedAccessClient.RoleBindingsGet` - -```go -ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "trustedAccessRoleBindingValue") - -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", "managedClusterValue") - -// 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", "locationValue") - -// 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/2022-09-02-preview/trustedaccess/client.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/client.go deleted file mode 100644 index 3478bfc5e37..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2022-09-02-preview/trustedaccess/constants.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/constants.go deleted file mode 100644 index 0f6f9d3df1f..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -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 ( - TrustedAccessRoleBindingProvisioningStateDeleting TrustedAccessRoleBindingProvisioningState = "Deleting" - TrustedAccessRoleBindingProvisioningStateFailed TrustedAccessRoleBindingProvisioningState = "Failed" - TrustedAccessRoleBindingProvisioningStateSucceeded TrustedAccessRoleBindingProvisioningState = "Succeeded" - TrustedAccessRoleBindingProvisioningStateUpdating TrustedAccessRoleBindingProvisioningState = "Updating" -) - -func PossibleValuesForTrustedAccessRoleBindingProvisioningState() []string { - return []string{ - 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{ - "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/2022-09-02-preview/trustedaccess/id_location.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_location.go deleted file mode 100644 index f2c540d6e65..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -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", "locationValue"), - } -} - -// 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/2022-09-02-preview/trustedaccess/id_location_test.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_location_test.go deleted file mode 100644 index 4c581421df5..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue" - 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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe/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/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding.go deleted file mode 100644 index 18c1e6b10f3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticTrustedAccessRoleBindings", "trustedAccessRoleBindings", "trustedAccessRoleBindings"), - resourceids.UserSpecifiedSegment("trustedAccessRoleBindingName", "trustedAccessRoleBindingValue"), - } -} - -// 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/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go deleted file mode 100644 index e35fdf7c516..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "trustedAccessRoleBindingValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.TrustedAccessRoleBindingName != "trustedAccessRoleBindingValue" { - t.Fatalf("Expected %q but got %q for Segment 'TrustedAccessRoleBindingName'", id.TrustedAccessRoleBindingName, "trustedAccessRoleBindingValue") - } -} - -func TestFormatTrustedAccessRoleBindingID(t *testing.T) { - actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "trustedAccessRoleBindingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue", - Expected: &TrustedAccessRoleBindingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - TrustedAccessRoleBindingName: "trustedAccessRoleBindingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/tRuStEdAcCeSsRoLeBiNdInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue", - Expected: &TrustedAccessRoleBindingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - TrustedAccessRoleBindingName: "trustedAccessRoleBindingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue/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/mAnAgEdClUsTeRvAlUe/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGvAlUe", - Expected: &TrustedAccessRoleBindingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - TrustedAccessRoleBindingName: "tRuStEdAcCeSsRoLeBiNdInGvAlUe", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGvAlUe/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/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingscreateorupdate.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingscreateorupdate.go deleted file mode 100644 index a8371698581..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingscreateorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -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 RoleBindingsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *TrustedAccessRoleBinding -} - -// 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{ - 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 TrustedAccessRoleBinding - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsdelete.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsdelete.go deleted file mode 100644 index 6f782d1a92c..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -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 RoleBindingsDeleteOperationResponse struct { - 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.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/2022-09-02-preview/trustedaccess/method_rolebindingsget.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsget.go deleted file mode 100644 index a0b81891af6..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingsget.go +++ /dev/null @@ -1,54 +0,0 @@ -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/2022-09-02-preview/trustedaccess/method_rolebindingslist.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist.go deleted file mode 100644 index 4fc3b544dc0..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_rolebindingslist.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/containerservice/2022-09-02-preview/trustedaccess/method_roleslist.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_roleslist.go deleted file mode 100644 index 124133a7f5e..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/method_roleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package trustedaccess - -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 RolesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]TrustedAccessRole -} - -type RolesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []TrustedAccessRole -} - -// 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, - Path: fmt.Sprintf("%s/trustedAccessRoles", 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 *[]TrustedAccessRole `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// 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{}) -} - -// 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.RolesList(ctx, id) - if err != nil { - 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 = RolesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrole.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrole.go deleted file mode 100644 index a24a7344c12..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrole.go +++ /dev/null @@ -1,10 +0,0 @@ -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/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebinding.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebinding.go deleted file mode 100644 index 36c110999f6..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebinding.go +++ /dev/null @@ -1,16 +0,0 @@ -package trustedaccess - -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 TrustedAccessRoleBinding struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties TrustedAccessRoleBindingProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go deleted file mode 100644 index b432519d7cc..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2022-09-02-preview/trustedaccess/model_trustedaccessrolerule.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolerule.go deleted file mode 100644 index 808af096d0a..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/model_trustedaccessrolerule.go +++ /dev/null @@ -1,12 +0,0 @@ -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/2022-09-02-preview/trustedaccess/predicates.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/predicates.go deleted file mode 100644 index 6bab96a78b7..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/predicates.go +++ /dev/null @@ -1,45 +0,0 @@ -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/2022-09-02-preview/trustedaccess/version.go b/resource-manager/containerservice/2022-09-02-preview/trustedaccess/version.go deleted file mode 100644 index 2c4f619bec3..00000000000 --- a/resource-manager/containerservice/2022-09-02-preview/trustedaccess/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package trustedaccess - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-09-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/trustedaccess/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md b/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md deleted file mode 100644 index beb88b8ed13..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/README.md +++ /dev/null @@ -1,139 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/agentpools` Documentation - -The `agentpools` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue", "agentPoolValue") - -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", "managedClusterValue", "agentPoolValue") - -payload := agentpools.AgentPool{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AgentPoolsClient.Delete` - -```go -ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - -if err := client.DeleteThenPoll(ctx, id, agentpools.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AgentPoolsClient.Get` - -```go -ctx := context.TODO() -id := agentpools.NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - -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", "managedClusterValue") - -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", "managedClusterValue", "agentPoolValue") - -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", "managedClusterValue") - -// 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", "managedClusterValue", "agentPoolValue") - -if err := client.UpgradeNodeImageVersionThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/client.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/client.go deleted file mode 100644 index 2edad36c005..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/agentpools/constants.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/constants.go deleted file mode 100644 index 5710c699a9f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/constants.go +++ /dev/null @@ -1,567 +0,0 @@ -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" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUAzureLinux), - string(OSSKUCBLMariner), - string(OSSKUMariner), - 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, - "mariner": OSSKUMariner, - "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 ( - WorkloadRuntimeKataMshvVMIsolation WorkloadRuntime = "KataMshvVmIsolation" - WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" - WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi" -) - -func PossibleValuesForWorkloadRuntime() []string { - return []string{ - string(WorkloadRuntimeKataMshvVMIsolation), - 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{ - "katamshvvmisolation": WorkloadRuntimeKataMshvVMIsolation, - "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/2023-04-02-preview/agentpools/id_agentpool.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/id_agentpool.go deleted file mode 100644 index 3f847038351..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/id_agentpool.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticAgentPools", "agentPools", "agentPools"), - resourceids.UserSpecifiedSegment("agentPoolName", "agentPoolValue"), - } -} - -// 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/containerservice/2023-04-02-preview/agentpools/id_agentpool_test.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/id_agentpool_test.go deleted file mode 100644 index 4c32bcb833f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/id_agentpool_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package agentpools - -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 = &AgentPoolId{} - -func TestNewAgentPoolID(t *testing.T) { - id := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.AgentPoolName != "agentPoolValue" { - t.Fatalf("Expected %q but got %q for Segment 'AgentPoolName'", id.AgentPoolName, "agentPoolValue") - } -} - -func TestFormatAgentPoolID(t *testing.T) { - actual := NewAgentPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "agentPoolValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAgentPoolID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AgentPoolId - }{ - { - // 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue", - Expected: &AgentPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AgentPoolName: "agentPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAgentPoolID(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) - } - - } -} - -func TestParseAgentPoolIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AgentPoolId - }{ - { - // 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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/aGeNtPoOlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue", - Expected: &AgentPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AgentPoolName: "agentPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/agentPools/agentPoolValue/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/mAnAgEdClUsTeRvAlUe/aGeNtPoOlS/aGeNtPoOlVaLuE", - Expected: &AgentPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - AgentPoolName: "aGeNtPoOlVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/aGeNtPoOlS/aGeNtPoOlVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAgentPoolIDInsensitively(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) - } - - } -} - -func TestSegmentsForAgentPoolId(t *testing.T) { - segments := AgentPoolId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AgentPoolId 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/2023-04-02-preview/agentpools/method_abortlatestoperation.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_abortlatestoperation.go deleted file mode 100644 index bb6d06d7487..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_abortlatestoperation.go +++ /dev/null @@ -1,70 +0,0 @@ -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/2023-04-02-preview/agentpools/method_createorupdate.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_createorupdate.go deleted file mode 100644 index 8df06205d3a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -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 -} - -// CreateOrUpdate ... -func (c AgentPoolsClient) CreateOrUpdate(ctx context.Context, id AgentPoolId, input AgentPool) (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 - } - - 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) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/2023-04-02-preview/agentpools/method_delete.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_delete.go deleted file mode 100644 index d628abea0ea..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_delete.go +++ /dev/null @@ -1,98 +0,0 @@ -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 { - IgnorePodDisruptionBudget *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - 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, - Path: id.ID(), - OptionsObject: options, - } - - 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/containerservice/2023-04-02-preview/agentpools/method_get.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_get.go deleted file mode 100644 index 97eecd6a97a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package agentpools - -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 *AgentPool -} - -// Get ... -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: 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 AgentPool - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions.go deleted file mode 100644 index 81aa1c660a4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getavailableagentpoolversions.go +++ /dev/null @@ -1,56 +0,0 @@ -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/containerservice/2023-04-02-preview/agentpools/method_getupgradeprofile.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getupgradeprofile.go deleted file mode 100644 index e8d8a91ceed..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_getupgradeprofile.go +++ /dev/null @@ -1,55 +0,0 @@ -package agentpools - -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 GetUpgradeProfileOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AgentPoolUpgradeProfile -} - -// 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/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 AgentPoolUpgradeProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list.go deleted file mode 100644 index d4f58e969de..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2023-04-02-preview/agentpools/method_upgradenodeimageversion.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/method_upgradenodeimageversion.go deleted file mode 100644 index fa6b0240a55..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/method_upgradenodeimageversion.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpool.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpool.go deleted file mode 100644 index c67ae33e826..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpool.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolavailableversions.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversions.go deleted file mode 100644 index 0b65a05c663..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversions.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolavailableversionsproperties.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversionsproperties.go deleted file mode 100644 index a8369deaba7..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversionsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go deleted file mode 100644 index 1631b3137d1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolavailableversionspropertiesagentpoolversionsinlined.go +++ /dev/null @@ -1,10 +0,0 @@ -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/containerservice/2023-04-02-preview/agentpools/model_agentpoolnetworkprofile.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolnetworkprofile.go deleted file mode 100644 index db217a29cc5..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolnetworkprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolupgradeprofile.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofile.go deleted file mode 100644 index 23cc2927f28..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go deleted file mode 100644 index 5df00c96762..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofileproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go deleted file mode 100644 index b45442f6cf0..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradeprofilepropertiesupgradesinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/agentpools/model_agentpoolupgradesettings.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradesettings.go deleted file mode 100644 index 4b7613a093f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - MaxSurge *string `json:"maxSurge,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolwindowsprofile.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolwindowsprofile.go deleted file mode 100644 index d7ad07f7f69..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_agentpoolwindowsprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/containerservice/2023-04-02-preview/agentpools/model_creationdata.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_creationdata.go deleted file mode 100644 index 88a8fe8123b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -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 CreationData struct { - SourceResourceId *string `json:"sourceResourceId,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_iptag.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_iptag.go deleted file mode 100644 index 8a805afc241..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/agentpools/model_kubeletconfig.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_kubeletconfig.go deleted file mode 100644 index 7d56f79880c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_kubeletconfig.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2023-04-02-preview/agentpools/model_linuxosconfig.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_linuxosconfig.go deleted file mode 100644 index 8256b210a85..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_linuxosconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go deleted file mode 100644 index bbb0fddd066..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_managedclusteragentpoolprofileproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -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"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` - EnableCustomCATrust *bool `json:"enableCustomCATrust,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"` - MessageOfTheDay *string `json:"messageOfTheDay,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"` - 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/2023-04-02-preview/agentpools/model_portrange.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_portrange.go deleted file mode 100644 index 45b2a562032..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_portrange.go +++ /dev/null @@ -1,10 +0,0 @@ -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/containerservice/2023-04-02-preview/agentpools/model_powerstate.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_powerstate.go deleted file mode 100644 index c5939d90672..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_powerstate.go +++ /dev/null @@ -1,8 +0,0 @@ -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 PowerState struct { - Code *Code `json:"code,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_sysctlconfig.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/model_sysctlconfig.go deleted file mode 100644 index aa739bf4f68..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/model_sysctlconfig.go +++ /dev/null @@ -1,35 +0,0 @@ -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/containerservice/2023-04-02-preview/agentpools/predicates.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/predicates.go deleted file mode 100644 index 94a2db5c63b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -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 AgentPoolOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p AgentPoolOperationPredicate) Matches(input AgentPool) 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/2023-04-02-preview/agentpools/version.go b/resource-manager/containerservice/2023-04-02-preview/agentpools/version.go deleted file mode 100644 index 259cae1c0d6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/agentpools/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package agentpools - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/agentpools/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/client.go b/resource-manager/containerservice/2023-04-02-preview/client.go deleted file mode 100644 index 21c6fec56c1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_04_02_preview - -// 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/2023-04-02-preview/agentpools" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/privatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/snapshots" - "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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 - MaintenanceConfigurations *maintenanceconfigurations.MaintenanceConfigurationsClient - ManagedClusterSnapshots *managedclustersnapshots.ManagedClusterSnapshotsClient - 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) - - maintenanceConfigurationsClient, err := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building MaintenanceConfigurations client: %+v", err) - } - configureFunc(maintenanceConfigurationsClient.Client) - - managedClusterSnapshotsClient, err := managedclustersnapshots.NewManagedClusterSnapshotsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ManagedClusterSnapshots client: %+v", err) - } - configureFunc(managedClusterSnapshotsClient.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, - MaintenanceConfigurations: maintenanceConfigurationsClient, - ManagedClusterSnapshots: managedClusterSnapshotsClient, - ManagedClusters: managedClustersClient, - PrivateEndpointConnections: privateEndpointConnectionsClient, - PrivateLinkResources: privateLinkResourcesClient, - ResolvePrivateLinkServiceId: resolvePrivateLinkServiceIdClient, - Snapshots: snapshotsClient, - TrustedAccess: trustedAccessClient, - }, nil -} diff --git a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md deleted file mode 100644 index bffd20b7f66..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/README.md +++ /dev/null @@ -1,91 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations` Documentation - -The `maintenanceconfigurations` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue", "maintenanceConfigurationValue") - -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", "managedClusterValue", "maintenanceConfigurationValue") - -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", "managedClusterValue", "maintenanceConfigurationValue") - -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", "managedClusterValue") - -// 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/2023-04-02-preview/maintenanceconfigurations/client.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/client.go deleted file mode 100644 index 4d799de617c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/maintenanceconfigurations/constants.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/constants.go deleted file mode 100644 index 2fdd49e9763..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/constants.go +++ /dev/null @@ -1,116 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go deleted file mode 100644 index cb172f6bd60..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), - resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationValue"), - } -} - -// 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/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go deleted file mode 100644 index 6931501293c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "maintenanceConfigurationValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.MaintenanceConfigurationName != "maintenanceConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationValue") - } -} - -func TestFormatMaintenanceConfigurationID(t *testing.T) { - actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "maintenanceConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - MaintenanceConfigurationName: "maintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/mAiNtEnAnCeCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - MaintenanceConfigurationName: "maintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/maintenanceConfigurations/maintenanceConfigurationValue/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/mAnAgEdClUsTeRvAlUe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNvAlUe/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/containerservice/2023-04-02-preview/maintenanceconfigurations/method_createorupdate.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_createorupdate.go deleted file mode 100644 index 726183cac89..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_createorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package maintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// CreateOrUpdate ... -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{ - 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_delete.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_delete.go deleted file mode 100644 index 5993be4c15a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package maintenanceconfigurations - -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 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.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/2023-04-02-preview/maintenanceconfigurations/method_get.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_get.go deleted file mode 100644 index 6ea658ab6d5..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package maintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// Get ... -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: 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go deleted file mode 100644 index dae38e85821..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/method_listbymanagedcluster.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2023-04-02-preview/maintenanceconfigurations/model_absolutemonthlyschedule.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_absolutemonthlyschedule.go deleted file mode 100644 index ca6966896ff..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_absolutemonthlyschedule.go +++ /dev/null @@ -1,9 +0,0 @@ -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/containerservice/2023-04-02-preview/maintenanceconfigurations/model_dailyschedule.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_dailyschedule.go deleted file mode 100644 index 57fb3e994dd..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_dailyschedule.go +++ /dev/null @@ -1,8 +0,0 @@ -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 DailySchedule struct { - IntervalDays int64 `json:"intervalDays"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_datespan.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_datespan.go deleted file mode 100644 index 863c4704427..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_datespan.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go deleted file mode 100644 index 9066e53bff3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go deleted file mode 100644 index d7c91bcf9f6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_maintenancewindow.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenancewindow.go deleted file mode 100644 index 8f1a42f818c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_maintenancewindow.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_relativemonthlyschedule.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_relativemonthlyschedule.go deleted file mode 100644 index 0dfc104da98..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_relativemonthlyschedule.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_schedule.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_schedule.go deleted file mode 100644 index cc4397aba4c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_schedule.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_timeinweek.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_timeinweek.go deleted file mode 100644 index cba259f76fc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_timeinweek.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_timespan.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_timespan.go deleted file mode 100644 index 7bbc8c5ba72..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_timespan.go +++ /dev/null @@ -1,39 +0,0 @@ -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/2023-04-02-preview/maintenanceconfigurations/model_weeklyschedule.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_weeklyschedule.go deleted file mode 100644 index ed775ad784e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/model_weeklyschedule.go +++ /dev/null @@ -1,9 +0,0 @@ -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/containerservice/2023-04-02-preview/maintenanceconfigurations/predicates.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/predicates.go deleted file mode 100644 index c7eedb4fa7b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -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 MaintenanceConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p MaintenanceConfigurationOperationPredicate) Matches(input MaintenanceConfiguration) 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/2023-04-02-preview/maintenanceconfigurations/version.go b/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/version.go deleted file mode 100644 index be53abe1756..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/maintenanceconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package maintenanceconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/maintenanceconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md b/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md deleted file mode 100644 index cc9f90e9220..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/README.md +++ /dev/null @@ -1,373 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclusters` Documentation - -The `managedclusters` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue") - -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", "managedClusterValue") - -payload := managedclusters.ManagedCluster{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ManagedClustersClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue", "accessProfileValue") - -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", "managedClusterValue", "commandIdValue") - -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.GetOSOptions` - -```go -ctx := context.TODO() -id := managedclusters.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.GetOSOptions(ctx, id, managedclusters.DefaultGetOSOptionsOperationOptions()) -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "locationValue") - -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.ListOutboundNetworkDependenciesEndpoints` - -```go -ctx := context.TODO() -id := commonids.NewKubernetesClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue") - -// 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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -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", "managedClusterValue") - -payload := managedclusters.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/client.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/client.go deleted file mode 100644 index 5081c63c8e6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/managedclusters/constants.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/constants.go deleted file mode 100644 index c892e00661f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/constants.go +++ /dev/null @@ -1,1807 +0,0 @@ -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 ControlPlaneUpgradeOverride string - -const ( - ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations ControlPlaneUpgradeOverride = "IgnoreKubernetesDeprecations" -) - -func PossibleValuesForControlPlaneUpgradeOverride() []string { - return []string{ - string(ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations), - } -} - -func (s *ControlPlaneUpgradeOverride) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseControlPlaneUpgradeOverride(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseControlPlaneUpgradeOverride(input string) (*ControlPlaneUpgradeOverride, error) { - vals := map[string]ControlPlaneUpgradeOverride{ - "ignorekubernetesdeprecations": ControlPlaneUpgradeOverrideIgnoreKubernetesDeprecations, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ControlPlaneUpgradeOverride(input) - return &out, nil -} - -type ControlledValues string - -const ( - ControlledValuesRequestsAndLimits ControlledValues = "RequestsAndLimits" - ControlledValuesRequestsOnly ControlledValues = "RequestsOnly" -) - -func PossibleValuesForControlledValues() []string { - return []string{ - string(ControlledValuesRequestsAndLimits), - string(ControlledValuesRequestsOnly), - } -} - -func (s *ControlledValues) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseControlledValues(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseControlledValues(input string) (*ControlledValues, error) { - vals := map[string]ControlledValues{ - "requestsandlimits": ControlledValuesRequestsAndLimits, - "requestsonly": ControlledValuesRequestsOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ControlledValues(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 IPvsScheduler string - -const ( - IPvsSchedulerLeastConnection IPvsScheduler = "LeastConnection" - IPvsSchedulerRoundRobin IPvsScheduler = "RoundRobin" -) - -func PossibleValuesForIPvsScheduler() []string { - return []string{ - string(IPvsSchedulerLeastConnection), - string(IPvsSchedulerRoundRobin), - } -} - -func (s *IPvsScheduler) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPvsScheduler(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPvsScheduler(input string) (*IPvsScheduler, error) { - vals := map[string]IPvsScheduler{ - "leastconnection": IPvsSchedulerLeastConnection, - "roundrobin": IPvsSchedulerRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPvsScheduler(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 Level string - -const ( - LevelEnforcement Level = "Enforcement" - LevelOff Level = "Off" - LevelWarning Level = "Warning" -) - -func PossibleValuesForLevel() []string { - return []string{ - string(LevelEnforcement), - string(LevelOff), - string(LevelWarning), - } -} - -func (s *Level) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLevel(input string) (*Level, error) { - vals := map[string]Level{ - "enforcement": LevelEnforcement, - "off": LevelOff, - "warning": LevelWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Level(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 Mode string - -const ( - ModeIPTABLES Mode = "IPTABLES" - ModeIPVS Mode = "IPVS" -) - -func PossibleValuesForMode() []string { - return []string{ - string(ModeIPTABLES), - string(ModeIPVS), - } -} - -func (s *Mode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMode(input string) (*Mode, error) { - vals := map[string]Mode{ - "iptables": ModeIPTABLES, - "ipvs": ModeIPVS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Mode(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" -) - -func PossibleValuesForNetworkPolicy() []string { - return []string{ - string(NetworkPolicyAzure), - string(NetworkPolicyCalico), - string(NetworkPolicyCilium), - } -} - -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, - } - 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" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUAzureLinux), - string(OSSKUCBLMariner), - string(OSSKUMariner), - 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, - "mariner": OSSKUMariner, - "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" - PublicNetworkAccessSecuredByPerimeter PublicNetworkAccess = "SecuredByPerimeter" -) - -func PossibleValuesForPublicNetworkAccess() []string { - return []string{ - string(PublicNetworkAccessDisabled), - string(PublicNetworkAccessEnabled), - string(PublicNetworkAccessSecuredByPerimeter), - } -} - -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, - "securedbyperimeter": PublicNetworkAccessSecuredByPerimeter, - } - 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 UpdateMode string - -const ( - UpdateModeAuto UpdateMode = "Auto" - UpdateModeInitial UpdateMode = "Initial" - UpdateModeOff UpdateMode = "Off" - UpdateModeRecreate UpdateMode = "Recreate" -) - -func PossibleValuesForUpdateMode() []string { - return []string{ - string(UpdateModeAuto), - string(UpdateModeInitial), - string(UpdateModeOff), - string(UpdateModeRecreate), - } -} - -func (s *UpdateMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateMode(input string) (*UpdateMode, error) { - vals := map[string]UpdateMode{ - "auto": UpdateModeAuto, - "initial": UpdateModeInitial, - "off": UpdateModeOff, - "recreate": UpdateModeRecreate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateMode(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 ( - WorkloadRuntimeKataMshvVMIsolation WorkloadRuntime = "KataMshvVmIsolation" - WorkloadRuntimeOCIContainer WorkloadRuntime = "OCIContainer" - WorkloadRuntimeWasmWasi WorkloadRuntime = "WasmWasi" -) - -func PossibleValuesForWorkloadRuntime() []string { - return []string{ - string(WorkloadRuntimeKataMshvVMIsolation), - 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{ - "katamshvvmisolation": WorkloadRuntimeKataMshvVMIsolation, - "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/2023-04-02-preview/managedclusters/id_accessprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_accessprofile.go deleted file mode 100644 index 6719ccebee1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_accessprofile.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticAccessProfiles", "accessProfiles", "accessProfiles"), - resourceids.UserSpecifiedSegment("accessProfileName", "accessProfileValue"), - } -} - -// 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/2023-04-02-preview/managedclusters/id_accessprofile_test.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_accessprofile_test.go deleted file mode 100644 index ae85155dd07..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_accessprofile_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "accessProfileValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.AccessProfileName != "accessProfileValue" { - t.Fatalf("Expected %q but got %q for Segment 'AccessProfileName'", id.AccessProfileName, "accessProfileValue") - } -} - -func TestFormatAccessProfileID(t *testing.T) { - actual := NewAccessProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "accessProfileValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue", - Expected: &AccessProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AccessProfileName: "accessProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/aCcEsSpRoFiLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue", - Expected: &AccessProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - AccessProfileName: "accessProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/accessProfiles/accessProfileValue/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/mAnAgEdClUsTeRvAlUe/aCcEsSpRoFiLeS/aCcEsSpRoFiLeVaLuE", - Expected: &AccessProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - AccessProfileName: "aCcEsSpRoFiLeVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/aCcEsSpRoFiLeS/aCcEsSpRoFiLeVaLuE/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/2023-04-02-preview/managedclusters/id_commandresult.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_commandresult.go deleted file mode 100644 index 8cad7061547..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_commandresult.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticCommandResults", "commandResults", "commandResults"), - resourceids.UserSpecifiedSegment("commandId", "commandIdValue"), - } -} - -// 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/containerservice/2023-04-02-preview/managedclusters/id_commandresult_test.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_commandresult_test.go deleted file mode 100644 index 708a5b3b98d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_commandresult_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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 = &CommandResultId{} - -func TestNewCommandResultID(t *testing.T) { - id := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "commandIdValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.CommandId != "commandIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'CommandId'", id.CommandId, "commandIdValue") - } -} - -func TestFormatCommandResultID(t *testing.T) { - actual := NewCommandResultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "commandIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCommandResultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommandResultId - }{ - { - // 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue", - Expected: &CommandResultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - CommandId: "commandIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommandResultID(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.CommandId != v.Expected.CommandId { - t.Fatalf("Expected %q but got %q for CommandId", v.Expected.CommandId, actual.CommandId) - } - - } -} - -func TestParseCommandResultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommandResultId - }{ - { - // 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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/cOmMaNdReSuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue", - Expected: &CommandResultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - CommandId: "commandIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/commandResults/commandIdValue/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/mAnAgEdClUsTeRvAlUe/cOmMaNdReSuLtS/cOmMaNdIdVaLuE", - Expected: &CommandResultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - CommandId: "cOmMaNdIdVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/cOmMaNdReSuLtS/cOmMaNdIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommandResultIDInsensitively(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.CommandId != v.Expected.CommandId { - t.Fatalf("Expected %q but got %q for CommandId", v.Expected.CommandId, actual.CommandId) - } - - } -} - -func TestSegmentsForCommandResultId(t *testing.T) { - segments := CommandResultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CommandResultId 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/2023-04-02-preview/managedclusters/id_location.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_location.go deleted file mode 100644 index 2a97028d499..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -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", "locationValue"), - } -} - -// 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/2023-04-02-preview/managedclusters/id_location_test.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_location_test.go deleted file mode 100644 index 1d6af703274..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue" - 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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe/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/2023-04-02-preview/managedclusters/method_abortlatestoperation.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation.go deleted file mode 100644 index a37480f49c9..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_abortlatestoperation.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_createorupdate.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate.go deleted file mode 100644 index c32d75d0be9..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -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 -} - -// CreateOrUpdate ... -func (c ManagedClustersClient) CreateOrUpdate(ctx context.Context, id commonids.KubernetesClusterId, input ManagedCluster) (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 - } - - 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) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/2023-04-02-preview/managedclusters/method_delete.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete.go deleted file mode 100644 index 53bf6a9ac7c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -type DeleteOperationOptions struct { - IgnorePodDisruptionBudget *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - 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 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, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - OptionsObject: options, - } - - 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 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/2023-04-02-preview/managedclusters/method_get.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get.go deleted file mode 100644 index 7962c50ca93..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_getaccessprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getaccessprofile.go deleted file mode 100644 index fb2fd875c42..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getaccessprofile.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_getcommandresult.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getcommandresult.go deleted file mode 100644 index 3f6f4f1f00f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getcommandresult.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_getosoptions.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getosoptions.go deleted file mode 100644 index 8f4f629fc4d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getosoptions.go +++ /dev/null @@ -1,83 +0,0 @@ -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 GetOSOptionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *OSOptionProfile -} - -type GetOSOptionsOperationOptions struct { - ResourceType *string -} - -func DefaultGetOSOptionsOperationOptions() GetOSOptionsOperationOptions { - return GetOSOptionsOperationOptions{} -} - -func (o GetOSOptionsOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOSOptionsOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOSOptionsOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ResourceType != nil { - out.Append("resource-type", fmt.Sprintf("%v", *o.ResourceType)) - } - return &out -} - -// GetOSOptions ... -func (c ManagedClustersClient) GetOSOptions(ctx context.Context, id LocationId, options GetOSOptionsOperationOptions) (result GetOSOptionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/osOptions/default", id.ID()), - OptionsObject: options, - } - - 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 OSOptionProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile.go deleted file mode 100644 index 9b500de8b58..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_getupgradeprofile.go +++ /dev/null @@ -1,56 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_list.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_list.go deleted file mode 100644 index 17fb5e8fb68..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2023-04-02-preview/managedclusters/method_listbyresourcegroup.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listbyresourcegroup.go deleted file mode 100644 index ee4658b5e0f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2023-04-02-preview/managedclusters/method_listclusteradmincredentials.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials.go deleted file mode 100644 index ffd25c8f6ec..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusteradmincredentials.go +++ /dev/null @@ -1,84 +0,0 @@ -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, - Path: fmt.Sprintf("%s/listClusterAdminCredential", id.ID()), - OptionsObject: options, - } - - 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/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials.go deleted file mode 100644 index 085c52f9396..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclustermonitoringusercredentials.go +++ /dev/null @@ -1,84 +0,0 @@ -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, - Path: fmt.Sprintf("%s/listClusterMonitoringUserCredential", id.ID()), - OptionsObject: options, - } - - 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/2023-04-02-preview/managedclusters/method_listclusterusercredentials.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials.go deleted file mode 100644 index b0a714473bd..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listclusterusercredentials.go +++ /dev/null @@ -1,88 +0,0 @@ -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, - Path: fmt.Sprintf("%s/listClusterUserCredential", id.ID()), - OptionsObject: options, - } - - 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/2023-04-02-preview/managedclusters/method_listkubernetesversions.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listkubernetesversions.go deleted file mode 100644 index 4de425a9201..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listkubernetesversions.go +++ /dev/null @@ -1,55 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go deleted file mode 100644 index 759383196b8..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_listoutboundnetworkdependenciesendpoints.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile.go deleted file mode 100644 index abdbb59c018..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetaadprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -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 ResetAADProfileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// 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/resetAADProfile", 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 -} - -// 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 ResetAADProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetAADProfile: %+v", err) - } - - return nil -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile.go deleted file mode 100644 index 54589acaf03..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_resetserviceprincipalprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_rotateclustercertificates.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates.go deleted file mode 100644 index 3d04938f645..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateclustercertificates.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go deleted file mode 100644 index b4cecc16d85..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_rotateserviceaccountsigningkeys.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_runcommand.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand.go deleted file mode 100644 index b64b4ec1b20..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_runcommand.go +++ /dev/null @@ -1,76 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_start.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start.go deleted file mode 100644 index ba4549e7615..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_start.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_stop.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop.go deleted file mode 100644 index 3bec609e3b4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_stop.go +++ /dev/null @@ -1,71 +0,0 @@ -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/2023-04-02-preview/managedclusters/method_updatetags.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags.go deleted file mode 100644 index 1ed48544bf9..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -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 -} - -// UpdateTags ... -func (c ManagedClustersClient) UpdateTags(ctx context.Context, id commonids.KubernetesClusterId, 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 - } - - 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) error { - result, err := c.UpdateTags(ctx, id, input) - 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/2023-04-02-preview/managedclusters/model_accessprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_accessprofile.go deleted file mode 100644 index c13b64ab25d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_accessprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_agentpoolnetworkprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolnetworkprofile.go deleted file mode 100644 index 1a5b19f5db1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolnetworkprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_agentpoolupgradesettings.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolupgradesettings.go deleted file mode 100644 index 461cb4361b0..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - MaxSurge *string `json:"maxSurge,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolwindowsprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolwindowsprofile.go deleted file mode 100644 index 5558f04ed00..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_agentpoolwindowsprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_azurekeyvaultkms.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_azurekeyvaultkms.go deleted file mode 100644 index 57c4e7848f3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_azurekeyvaultkms.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_clusterupgradesettings.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_clusterupgradesettings.go deleted file mode 100644 index 1510493ca17..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_clusterupgradesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_commandresultproperties.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_commandresultproperties.go deleted file mode 100644 index 745a87ae4ea..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_commandresultproperties.go +++ /dev/null @@ -1,43 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_containerservicelinuxprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicelinuxprofile.go deleted file mode 100644 index a3abf14adeb..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicelinuxprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_containerservicenetworkprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofile.go deleted file mode 100644 index 7c0d5122dfe..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofile.go +++ /dev/null @@ -1,23 +0,0 @@ -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 { - DnsServiceIP *string `json:"dnsServiceIP,omitempty"` - IPFamilies *[]IPFamily `json:"ipFamilies,omitempty"` - KubeProxyConfig *ContainerServiceNetworkProfileKubeProxyConfig `json:"kubeProxyConfig,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/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go deleted file mode 100644 index 5be387f7c40..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfig.go +++ /dev/null @@ -1,10 +0,0 @@ -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 ContainerServiceNetworkProfileKubeProxyConfig struct { - Enabled *bool `json:"enabled,omitempty"` - IPvsConfig *ContainerServiceNetworkProfileKubeProxyConfigIPvsConfig `json:"ipvsConfig,omitempty"` - Mode *Mode `json:"mode,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go deleted file mode 100644 index 96dc155e9d5..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicenetworkprofilekubeproxyconfigipvsconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -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 ContainerServiceNetworkProfileKubeProxyConfigIPvsConfig struct { - Scheduler *IPvsScheduler `json:"scheduler,omitempty"` - TcpFinTimeoutSeconds *int64 `json:"tcpFinTimeoutSeconds,omitempty"` - TcpTimeoutSeconds *int64 `json:"tcpTimeoutSeconds,omitempty"` - UdpTimeoutSeconds *int64 `json:"udpTimeoutSeconds,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshconfiguration.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshconfiguration.go deleted file mode 100644 index 4bf259bd15d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_containerservicesshpublickey.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshpublickey.go deleted file mode 100644 index 7796cdf6a90..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_containerservicesshpublickey.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_creationdata.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_creationdata.go deleted file mode 100644 index f2f19907006..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_credentialresult.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_credentialresult.go deleted file mode 100644 index 7002f56084e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_credentialresult.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_credentialresults.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_credentialresults.go deleted file mode 100644 index c572432888e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_credentialresults.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_endpointdependency.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_endpointdependency.go deleted file mode 100644 index ae8639b529b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_endpointdependency.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_endpointdetail.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_endpointdetail.go deleted file mode 100644 index de73a2e9168..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_endpointdetail.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_guardrailsprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_guardrailsprofile.go deleted file mode 100644 index 6875f54cbbe..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_guardrailsprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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 GuardrailsProfile struct { - ExcludedNamespaces *[]string `json:"excludedNamespaces,omitempty"` - Level Level `json:"level"` - SystemExcludedNamespaces *[]string `json:"systemExcludedNamespaces,omitempty"` - Version string `json:"version"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_iptag.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_iptag.go deleted file mode 100644 index 0aefb50d15f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -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/containerservice/2023-04-02-preview/managedclusters/model_istiocomponents.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istiocomponents.go deleted file mode 100644 index 0cd74a814a3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istiocomponents.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - IngressGateways *[]IstioIngressGateway `json:"ingressGateways,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioingressgateway.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioingressgateway.go deleted file mode 100644 index 12832f48114..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioingressgateway.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_istioservicemesh.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioservicemesh.go deleted file mode 100644 index 3677b77d2d6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_istioservicemesh.go +++ /dev/null @@ -1,8 +0,0 @@ -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 { - Components *IstioComponents `json:"components,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubeletconfig.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubeletconfig.go deleted file mode 100644 index 0f4036b4e7c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubeletconfig.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_kubernetespatchversion.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetespatchversion.go deleted file mode 100644 index 017737dac6a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetespatchversion.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_kubernetesversion.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversion.go deleted file mode 100644 index 2bb83ce16ee..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversion.go +++ /dev/null @@ -1,11 +0,0 @@ -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"` - IsPreview *bool `json:"isPreview,omitempty"` - PatchVersions *map[string]KubernetesPatchVersion `json:"patchVersions,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversioncapabilities.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversioncapabilities.go deleted file mode 100644 index b5729422404..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversioncapabilities.go +++ /dev/null @@ -1,8 +0,0 @@ -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 KubernetesVersionCapabilities struct { - SupportPlan *[]KubernetesSupportPlan `json:"supportPlan,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversionlistresult.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversionlistresult.go deleted file mode 100644 index a8b1127a230..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_kubernetesversionlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_linuxosconfig.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_linuxosconfig.go deleted file mode 100644 index 431f6faa2aa..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_linuxosconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedcluster.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedcluster.go deleted file mode 100644 index 96f028c8024..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedcluster.go +++ /dev/null @@ -1,23 +0,0 @@ -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 { - 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/2023-04-02-preview/managedclusters/model_managedclusteraadprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraadprofile.go deleted file mode 100644 index 271addb1fd4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraadprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusteraccessprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraccessprofile.go deleted file mode 100644 index e248b2a253b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraccessprofile.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusteraddonprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraddonprofile.go deleted file mode 100644 index 7dc1f865d9d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteraddonprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusteragentpoolprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteragentpoolprofile.go deleted file mode 100644 index 747121cce22..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteragentpoolprofile.go +++ /dev/null @@ -1,58 +0,0 @@ -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"` - EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` - EnableCustomCATrust *bool `json:"enableCustomCATrust,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"` - MessageOfTheDay *string `json:"messageOfTheDay,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"` - 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/2023-04-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go deleted file mode 100644 index 69b53ef85a7..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterapiserveraccessprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -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"` - EnableVnetIntegration *bool `json:"enableVnetIntegration,omitempty"` - PrivateDNSZone *string `json:"privateDNSZone,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go deleted file mode 100644 index e43a6df257f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterautoupgradeprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go deleted file mode 100644 index 8a18140e45a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go deleted file mode 100644 index ef0fb9066e2..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilekubestatemetrics.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go deleted file mode 100644 index 5c173441517..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterazuremonitorprofilemetrics.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go deleted file mode 100644 index b9f46785387..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterhttpproxyconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -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 { - EffectiveNoProxy *[]string `json:"effectiveNoProxy,omitempty"` - 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/2023-04-02-preview/managedclusters/model_managedclusteringressprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteringressprofile.go deleted file mode 100644 index ef54c8e8069..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteringressprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go deleted file mode 100644 index d45f66de762..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteringressprofilewebapprouting.go +++ /dev/null @@ -1,10 +0,0 @@ -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 { - DnsZoneResourceId *string `json:"dnsZoneResourceId,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Identity *UserAssignedIdentity `json:"identity,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go deleted file mode 100644 index 0d2207851bd..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofile.go +++ /dev/null @@ -1,15 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go deleted file mode 100644 index b8d24680fed..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofilemanagedoutboundips.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go deleted file mode 100644 index 76893c76d85..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundipprefixes.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go deleted file mode 100644 index f0a60f5817e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterloadbalancerprofileoutboundips.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go deleted file mode 100644 index ec079b6cdf4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustermanagedoutboundipprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusternatgatewayprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusternatgatewayprofile.go deleted file mode 100644 index a7e37699c62..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusternatgatewayprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go deleted file mode 100644 index 1ae3147c267..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusternoderesourcegroupprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go deleted file mode 100644 index b5d3be88f7d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusteroidcissuerprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpodidentity.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentity.go deleted file mode 100644 index 3bfb6799645..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentity.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpodidentityexception.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityexception.go deleted file mode 100644 index 28a710f9b5c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityexception.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprofile.go deleted file mode 100644 index e32db30028a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go deleted file mode 100644 index 1fb66d9034f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerror.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go deleted file mode 100644 index db4466f80bf..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioningerrorbody.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go deleted file mode 100644 index 60464e39c82..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpodidentityprovisioninginfo.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go deleted file mode 100644 index 7bafa5df972..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go deleted file mode 100644 index ccc02dd9957..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpoolupgradeprofileupgradesinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterproperties.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterproperties.go deleted file mode 100644 index 6c9e5762bcc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterproperties.go +++ /dev/null @@ -1,50 +0,0 @@ -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"` - CreationData *CreationData `json:"creationData,omitempty"` - CurrentKubernetesVersion *string `json:"currentKubernetesVersion,omitempty"` - DisableLocalAccounts *bool `json:"disableLocalAccounts,omitempty"` - DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` - DnsPrefix *string `json:"dnsPrefix,omitempty"` - EnableNamespaceResources *bool `json:"enableNamespaceResources,omitempty"` - EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` - EnableRBAC *bool `json:"enableRBAC,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - FqdnSubdomain *string `json:"fqdnSubdomain,omitempty"` - GuardrailsProfile *GuardrailsProfile `json:"guardrailsProfile,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"` - 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"` - 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/2023-04-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go deleted file mode 100644 index 17fe396efa8..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterpropertiesautoscalerprofile.go +++ /dev/null @@ -1,24 +0,0 @@ -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"` - Expander *Expander `json:"expander,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/2023-04-02-preview/managedclusters/model_managedclustersecurityprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofile.go deleted file mode 100644 index aecfd2517c1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofile.go +++ /dev/null @@ -1,13 +0,0 @@ -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"` - CustomCATrustCertificates *[]string `json:"customCATrustCertificates,omitempty"` - Defender *ManagedClusterSecurityProfileDefender `json:"defender,omitempty"` - ImageCleaner *ManagedClusterSecurityProfileImageCleaner `json:"imageCleaner,omitempty"` - NodeRestriction *ManagedClusterSecurityProfileNodeRestriction `json:"nodeRestriction,omitempty"` - WorkloadIdentity *ManagedClusterSecurityProfileWorkloadIdentity `json:"workloadIdentity,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go deleted file mode 100644 index c63debde097..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefender.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go deleted file mode 100644 index de84c795fec..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofiledefendersecuritymonitoring.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go deleted file mode 100644 index eb3e2ea7007..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileimagecleaner.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go deleted file mode 100644 index 6730a946379..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofilenoderestriction.go +++ /dev/null @@ -1,8 +0,0 @@ -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 ManagedClusterSecurityProfileNodeRestriction struct { - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go deleted file mode 100644 index 84f0312767b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersecurityprofileworkloadidentity.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go deleted file mode 100644 index 2a03beecdcc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterserviceprincipalprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclustersku.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersku.go deleted file mode 100644 index a4dcf9c50d3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclustersku.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterstorageprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofile.go deleted file mode 100644 index 11073ae103d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go deleted file mode 100644 index dc0e951be6b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofileblobcsidriver.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go deleted file mode 100644 index 5a12e13453f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilediskcsidriver.go +++ /dev/null @@ -1,9 +0,0 @@ -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"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go deleted file mode 100644 index 986ece9d933..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilefilecsidriver.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go deleted file mode 100644 index d46ee10b683..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterstorageprofilesnapshotcontroller.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofile.go deleted file mode 100644 index 86274cdb14a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go deleted file mode 100644 index 4db4b126760..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterupgradeprofileproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterwindowsprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterwindowsprofile.go deleted file mode 100644 index 8e3cffdace8..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterwindowsprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go deleted file mode 100644 index 891a44a0084..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go deleted file mode 100644 index 7115a06bfb3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofilekeda.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go deleted file mode 100644 index de1c2badc46..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_managedclusterworkloadautoscalerprofileverticalpodautoscaler.go +++ /dev/null @@ -1,10 +0,0 @@ -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 { - ControlledValues ControlledValues `json:"controlledValues"` - Enabled bool `json:"enabled"` - UpdateMode UpdateMode `json:"updateMode"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionprofile.go deleted file mode 100644 index 27b0bbc0c20..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -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 OSOptionProfile struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties OSOptionPropertyList `json:"properties"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionproperty.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionproperty.go deleted file mode 100644 index 4c8a976ae2d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionproperty.go +++ /dev/null @@ -1,9 +0,0 @@ -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 OSOptionProperty struct { - EnableFipsImage bool `json:"enable-fips-image"` - OsType string `json:"os-type"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionpropertylist.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionpropertylist.go deleted file mode 100644 index 5c126250b2c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_osoptionpropertylist.go +++ /dev/null @@ -1,8 +0,0 @@ -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 OSOptionPropertyList struct { - OsOptionPropertyList []OSOptionProperty `json:"osOptionPropertyList"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_outboundenvironmentendpoint.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_outboundenvironmentendpoint.go deleted file mode 100644 index a4f0d234bc8..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_outboundenvironmentendpoint.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_portrange.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_portrange.go deleted file mode 100644 index 0a44c59e9c8..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_portrange.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_powerstate.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_powerstate.go deleted file mode 100644 index d5abeb15b66..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_powerstate.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_privatelinkresource.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_privatelinkresource.go deleted file mode 100644 index 14d827574be..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_resourcereference.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_resourcereference.go deleted file mode 100644 index dbb05bb4711..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_resourcereference.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_runcommandrequest.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_runcommandrequest.go deleted file mode 100644 index caa9ae3d0cd..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_runcommandrequest.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_runcommandresult.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_runcommandresult.go deleted file mode 100644 index 59cfc374de3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_runcommandresult.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_servicemeshprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_servicemeshprofile.go deleted file mode 100644 index 781365d16f3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_servicemeshprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_sysctlconfig.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_sysctlconfig.go deleted file mode 100644 index 00f3cc50224..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_sysctlconfig.go +++ /dev/null @@ -1,35 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_tagsobject.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_tagsobject.go deleted file mode 100644 index 69f1454e3b1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/managedclusters/model_upgradeoverridesettings.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_upgradeoverridesettings.go deleted file mode 100644 index d3537c3f2ce..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_upgradeoverridesettings.go +++ /dev/null @@ -1,27 +0,0 @@ -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 { - ControlPlaneOverrides *[]ControlPlaneUpgradeOverride `json:"controlPlaneOverrides,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/containerservice/2023-04-02-preview/managedclusters/model_userassignedidentity.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_userassignedidentity.go deleted file mode 100644 index b1eecd7085a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_userassignedidentity.go +++ /dev/null @@ -1,10 +0,0 @@ -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 UserAssignedIdentity struct { - ClientId *string `json:"clientId,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_windowsgmsaprofile.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_windowsgmsaprofile.go deleted file mode 100644 index 742f96764d4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/model_windowsgmsaprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/managedclusters/predicates.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/predicates.go deleted file mode 100644 index c2d99eb9b4b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/predicates.go +++ /dev/null @@ -1,45 +0,0 @@ -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 { - Id *string - Location *string - Name *string - Type *string -} - -func (p ManagedClusterOperationPredicate) Matches(input ManagedCluster) 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 -} - -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/2023-04-02-preview/managedclusters/version.go b/resource-manager/containerservice/2023-04-02-preview/managedclusters/version.go deleted file mode 100644 index 21c65d99a7a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclusters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclusters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/managedclusters/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/README.md b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/README.md deleted file mode 100644 index be44e68dc68..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots` Documentation - -The `managedclustersnapshots` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots" -``` - - -### Client Initialization - -```go -client := managedclustersnapshots.NewManagedClusterSnapshotsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ManagedClusterSnapshotsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -payload := managedclustersnapshots.ManagedClusterSnapshot{ - // ... -} - - -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: `ManagedClusterSnapshotsClient.Delete` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -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: `ManagedClusterSnapshotsClient.Get` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -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: `ManagedClusterSnapshotsClient.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: `ManagedClusterSnapshotsClient.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: `ManagedClusterSnapshotsClient.UpdateTags` - -```go -ctx := context.TODO() -id := managedclustersnapshots.NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - -payload := managedclustersnapshots.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/2023-04-02-preview/managedclustersnapshots/client.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/client.go deleted file mode 100644 index 939ebd0b984..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package managedclustersnapshots - -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 ManagedClusterSnapshotsClient struct { - Client *resourcemanager.Client -} - -func NewManagedClusterSnapshotsClientWithBaseURI(sdkApi sdkEnv.Api) (*ManagedClusterSnapshotsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "managedclustersnapshots", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ManagedClusterSnapshotsClient: %+v", err) - } - - return &ManagedClusterSnapshotsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/constants.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/constants.go deleted file mode 100644 index c65f5433e0b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/constants.go +++ /dev/null @@ -1,341 +0,0 @@ -package managedclustersnapshots - -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 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 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 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" -) - -func PossibleValuesForNetworkPolicy() []string { - return []string{ - string(NetworkPolicyAzure), - string(NetworkPolicyCalico), - string(NetworkPolicyCilium), - } -} - -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, - } - 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 SnapshotType string - -const ( - SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" - SnapshotTypeNodePool SnapshotType = "NodePool" -) - -func PossibleValuesForSnapshotType() []string { - return []string{ - string(SnapshotTypeManagedCluster), - 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{ - "managedcluster": SnapshotTypeManagedCluster, - "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/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot.go deleted file mode 100644 index bd22899cf08..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot.go +++ /dev/null @@ -1,130 +0,0 @@ -package managedclustersnapshots - -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(&ManagedClusterSnapshotId{}) -} - -var _ resourceids.ResourceId = &ManagedClusterSnapshotId{} - -// ManagedClusterSnapshotId is a struct representing the Resource ID for a Managed Cluster Snapshot -type ManagedClusterSnapshotId struct { - SubscriptionId string - ResourceGroupName string - ManagedClusterSnapshotName string -} - -// NewManagedClusterSnapshotID returns a new ManagedClusterSnapshotId struct -func NewManagedClusterSnapshotID(subscriptionId string, resourceGroupName string, managedClusterSnapshotName string) ManagedClusterSnapshotId { - return ManagedClusterSnapshotId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ManagedClusterSnapshotName: managedClusterSnapshotName, - } -} - -// ParseManagedClusterSnapshotID parses 'input' into a ManagedClusterSnapshotId -func ParseManagedClusterSnapshotID(input string) (*ManagedClusterSnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(&ManagedClusterSnapshotId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ManagedClusterSnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseManagedClusterSnapshotIDInsensitively parses 'input' case-insensitively into a ManagedClusterSnapshotId -// note: this method should only be used for API response data and not user input -func ParseManagedClusterSnapshotIDInsensitively(input string) (*ManagedClusterSnapshotId, error) { - parser := resourceids.NewParserFromResourceIdType(&ManagedClusterSnapshotId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ManagedClusterSnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ManagedClusterSnapshotId) 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.ManagedClusterSnapshotName, ok = input.Parsed["managedClusterSnapshotName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "managedClusterSnapshotName", input) - } - - return nil -} - -// ValidateManagedClusterSnapshotID checks that 'input' can be parsed as a Managed Cluster Snapshot ID -func ValidateManagedClusterSnapshotID(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 := ParseManagedClusterSnapshotID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Managed Cluster Snapshot ID -func (id ManagedClusterSnapshotId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.ContainerService/managedClusterSnapshots/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ManagedClusterSnapshotName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Managed Cluster Snapshot ID -func (id ManagedClusterSnapshotId) 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("staticManagedClusterSnapshots", "managedClusterSnapshots", "managedClusterSnapshots"), - resourceids.UserSpecifiedSegment("managedClusterSnapshotName", "managedClusterSnapshotValue"), - } -} - -// String returns a human-readable description of this Managed Cluster Snapshot ID -func (id ManagedClusterSnapshotId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Managed Cluster Snapshot Name: %q", id.ManagedClusterSnapshotName), - } - return fmt.Sprintf("Managed Cluster Snapshot (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go deleted file mode 100644 index 13021711720..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/id_managedclustersnapshot_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package managedclustersnapshots - -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 = &ManagedClusterSnapshotId{} - -func TestNewManagedClusterSnapshotID(t *testing.T) { - id := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue") - - 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.ManagedClusterSnapshotName != "managedClusterSnapshotValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterSnapshotName'", id.ManagedClusterSnapshotName, "managedClusterSnapshotValue") - } -} - -func TestFormatManagedClusterSnapshotID(t *testing.T) { - actual := NewManagedClusterSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterSnapshotValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseManagedClusterSnapshotID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ManagedClusterSnapshotId - }{ - { - // 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/managedClusterSnapshots", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue", - Expected: &ManagedClusterSnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterSnapshotName: "managedClusterSnapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseManagedClusterSnapshotID(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.ManagedClusterSnapshotName != v.Expected.ManagedClusterSnapshotName { - t.Fatalf("Expected %q but got %q for ManagedClusterSnapshotName", v.Expected.ManagedClusterSnapshotName, actual.ManagedClusterSnapshotName) - } - - } -} - -func TestParseManagedClusterSnapshotIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ManagedClusterSnapshotId - }{ - { - // 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/managedClusterSnapshots", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/mAnAgEdClUsTeRsNaPsHoTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue", - Expected: &ManagedClusterSnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterSnapshotName: "managedClusterSnapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusterSnapshots/managedClusterSnapshotValue/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/mAnAgEdClUsTeRsNaPsHoTs/mAnAgEdClUsTeRsNaPsHoTvAlUe", - Expected: &ManagedClusterSnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterSnapshotName: "mAnAgEdClUsTeRsNaPsHoTvAlUe", - }, - }, - { - // 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/mAnAgEdClUsTeRsNaPsHoTs/mAnAgEdClUsTeRsNaPsHoTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseManagedClusterSnapshotIDInsensitively(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.ManagedClusterSnapshotName != v.Expected.ManagedClusterSnapshotName { - t.Fatalf("Expected %q but got %q for ManagedClusterSnapshotName", v.Expected.ManagedClusterSnapshotName, actual.ManagedClusterSnapshotName) - } - - } -} - -func TestSegmentsForManagedClusterSnapshotId(t *testing.T) { - segments := ManagedClusterSnapshotId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ManagedClusterSnapshotId 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/2023-04-02-preview/managedclustersnapshots/method_createorupdate.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_createorupdate.go deleted file mode 100644 index 1041144ec50..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package managedclustersnapshots - -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 *ManagedClusterSnapshot -} - -// CreateOrUpdate ... -func (c ManagedClusterSnapshotsClient) CreateOrUpdate(ctx context.Context, id ManagedClusterSnapshotId, input ManagedClusterSnapshot) (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 ManagedClusterSnapshot - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_delete.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_delete.go deleted file mode 100644 index 3b8fc26cc15..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package managedclustersnapshots - -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 ManagedClusterSnapshotsClient) Delete(ctx context.Context, id ManagedClusterSnapshotId) (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/2023-04-02-preview/managedclustersnapshots/method_get.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_get.go deleted file mode 100644 index ead8643d9dc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package managedclustersnapshots - -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 *ManagedClusterSnapshot -} - -// Get ... -func (c ManagedClusterSnapshotsClient) Get(ctx context.Context, id ManagedClusterSnapshotId) (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 ManagedClusterSnapshot - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_list.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_list.go deleted file mode 100644 index 9f0d4dec699..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package managedclustersnapshots - -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 *[]ManagedClusterSnapshot -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ManagedClusterSnapshot -} - -// List ... -func (c ManagedClusterSnapshotsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusterSnapshots", 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 *[]ManagedClusterSnapshot `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 ManagedClusterSnapshotsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ManagedClusterSnapshotOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ManagedClusterSnapshotsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ManagedClusterSnapshotOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ManagedClusterSnapshot, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/2023-04-02-preview/managedclustersnapshots/method_listbyresourcegroup.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_listbyresourcegroup.go deleted file mode 100644 index 4b28f6c8a05..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package managedclustersnapshots - -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 *[]ManagedClusterSnapshot -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ManagedClusterSnapshot -} - -// ListByResourceGroup ... -func (c ManagedClusterSnapshotsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.ContainerService/managedClusterSnapshots", 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 *[]ManagedClusterSnapshot `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 ManagedClusterSnapshotsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ManagedClusterSnapshotOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ManagedClusterSnapshotsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ManagedClusterSnapshotOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ManagedClusterSnapshot, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/2023-04-02-preview/managedclustersnapshots/method_updatetags.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_updatetags.go deleted file mode 100644 index f6dcaa5a53e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package managedclustersnapshots - -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 *ManagedClusterSnapshot -} - -// UpdateTags ... -func (c ManagedClusterSnapshotsClient) UpdateTags(ctx context.Context, id ManagedClusterSnapshotId, 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 ManagedClusterSnapshot - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_creationdata.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_creationdata.go deleted file mode 100644 index 8fb59d8abec..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclustersnapshots - -// 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/2023-04-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go deleted file mode 100644 index fcf682d5789..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclusterpropertiesforsnapshot.go +++ /dev/null @@ -1,11 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterPropertiesForSnapshot struct { - EnableRbac *bool `json:"enableRbac,omitempty"` - KubernetesVersion *string `json:"kubernetesVersion,omitempty"` - NetworkProfile *NetworkProfileForSnapshot `json:"networkProfile,omitempty"` - Sku *ManagedClusterSKU `json:"sku,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersku.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersku.go deleted file mode 100644 index e3e12587809..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package managedclustersnapshots - -// 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/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshot.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshot.go deleted file mode 100644 index 43b8096001b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshot.go +++ /dev/null @@ -1,18 +0,0 @@ -package managedclustersnapshots - -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 ManagedClusterSnapshot struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ManagedClusterSnapshotProperties `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/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go deleted file mode 100644 index 0710501e092..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_managedclustersnapshotproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSnapshotProperties struct { - CreationData *CreationData `json:"creationData,omitempty"` - ManagedClusterPropertiesReadOnly *ManagedClusterPropertiesForSnapshot `json:"managedClusterPropertiesReadOnly,omitempty"` - SnapshotType *SnapshotType `json:"snapshotType,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go deleted file mode 100644 index 02c1c65f57a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_networkprofileforsnapshot.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfileForSnapshot struct { - LoadBalancerSku *LoadBalancerSku `json:"loadBalancerSku,omitempty"` - NetworkMode *NetworkMode `json:"networkMode,omitempty"` - NetworkPlugin *NetworkPlugin `json:"networkPlugin,omitempty"` - NetworkPluginMode *NetworkPluginMode `json:"networkPluginMode,omitempty"` - NetworkPolicy *NetworkPolicy `json:"networkPolicy,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_tagsobject.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_tagsobject.go deleted file mode 100644 index a9e96162848..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package managedclustersnapshots - -// 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/2023-04-02-preview/managedclustersnapshots/predicates.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/predicates.go deleted file mode 100644 index 665969defbb..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package managedclustersnapshots - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedClusterSnapshotOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ManagedClusterSnapshotOperationPredicate) Matches(input ManagedClusterSnapshot) 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/2023-04-02-preview/managedclustersnapshots/version.go b/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/version.go deleted file mode 100644 index 7acc68218b1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/managedclustersnapshots/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package managedclustersnapshots - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/managedclustersnapshots/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/README.md b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/README.md deleted file mode 100644 index bf1f09aef56..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections` Documentation - -The `privateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue", "privateEndpointConnectionValue") - -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", "managedClusterValue", "privateEndpointConnectionValue") - -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", "managedClusterValue") - -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", "managedClusterValue", "privateEndpointConnectionValue") - -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/2023-04-02-preview/privateendpointconnections/client.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/client.go deleted file mode 100644 index 3bf7a6afe1f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/privateendpointconnections/constants.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/constants.go deleted file mode 100644 index 20cf74bcad4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/constants.go +++ /dev/null @@ -1,107 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection.go deleted file mode 100644 index c682166f416..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// 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/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection_test.go deleted file mode 100644 index a2eb3acf095..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "privateEndpointConnectionValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/privateEndpointConnections/privateEndpointConnectionValue/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/mAnAgEdClUsTeRvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/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/2023-04-02-preview/privateendpointconnections/method_delete.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_delete.go deleted file mode 100644 index 2b9a343bdf0..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/method_get.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_get.go deleted file mode 100644 index 8dc28d7ff7a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/method_list.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_list.go deleted file mode 100644 index bd4dd26e8bb..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -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/containerservice/2023-04-02-preview/privateendpointconnections/method_update.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_update.go deleted file mode 100644 index c118ecada7d..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// Update ... -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.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 PrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpoint.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpoint.go deleted file mode 100644 index 1bc8cf2a97c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/model_privateendpointconnection.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnection.go deleted file mode 100644 index fde7f4db0fc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go deleted file mode 100644 index 92a9ecb105a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index 549d255f069..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 677cab99f90..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,9 +0,0 @@ -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/2023-04-02-preview/privateendpointconnections/version.go b/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/version.go deleted file mode 100644 index 30aa0b304e4..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpointconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpointconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/README.md b/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/README.md deleted file mode 100644 index 08b3005a53c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/privatelinkresources` Documentation - -The `privatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue") - -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/2023-04-02-preview/privatelinkresources/client.go b/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/client.go deleted file mode 100644 index e6e22caa746..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/privatelinkresources/method_list.go b/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/method_list.go deleted file mode 100644 index 836fd220ae3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -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/2023-04-02-preview/privatelinkresources/model_privatelinkresource.go b/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 3490b3d4e87..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2023-04-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go b/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go deleted file mode 100644 index 52cfe88b6e2..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/model_privatelinkresourceslistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/privatelinkresources/version.go b/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/version.go deleted file mode 100644 index 041a4250db1..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/privatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/README.md b/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/README.md deleted file mode 100644 index 799f2cb87a0..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid` Documentation - -The `resolveprivatelinkserviceid` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue") - -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/2023-04-02-preview/resolveprivatelinkserviceid/client.go b/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/client.go deleted file mode 100644 index dd21ffc0b6b..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/resolveprivatelinkserviceid/method_post.go b/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/method_post.go deleted file mode 100644 index f583a77cede..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/method_post.go +++ /dev/null @@ -1,60 +0,0 @@ -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/2023-04-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go b/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go deleted file mode 100644 index 4ff07dba897..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/model_privatelinkresource.go +++ /dev/null @@ -1,13 +0,0 @@ -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/2023-04-02-preview/resolveprivatelinkserviceid/version.go b/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/version.go deleted file mode 100644 index 12c252d818e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/resolveprivatelinkserviceid/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package resolveprivatelinkserviceid - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/resolveprivatelinkserviceid/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/snapshots/README.md b/resource-manager/containerservice/2023-04-02-preview/snapshots/README.md deleted file mode 100644 index d9a8a590292..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/snapshots` Documentation - -The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "snapshotValue") - -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", "snapshotValue") - -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", "snapshotValue") - -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", "snapshotValue") - -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/2023-04-02-preview/snapshots/client.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/client.go deleted file mode 100644 index 620b7900eab..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/snapshots/constants.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/constants.go deleted file mode 100644 index 73e6fa357a6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -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" - OSSKUMariner OSSKU = "Mariner" - OSSKUUbuntu OSSKU = "Ubuntu" - OSSKUWindowsTwoZeroOneNine OSSKU = "Windows2019" - OSSKUWindowsTwoZeroTwoTwo OSSKU = "Windows2022" -) - -func PossibleValuesForOSSKU() []string { - return []string{ - string(OSSKUAzureLinux), - string(OSSKUCBLMariner), - string(OSSKUMariner), - 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, - "mariner": OSSKUMariner, - "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 ( - SnapshotTypeManagedCluster SnapshotType = "ManagedCluster" - SnapshotTypeNodePool SnapshotType = "NodePool" -) - -func PossibleValuesForSnapshotType() []string { - return []string{ - string(SnapshotTypeManagedCluster), - 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{ - "managedcluster": SnapshotTypeManagedCluster, - "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/containerservice/2023-04-02-preview/snapshots/id_snapshot.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot.go deleted file mode 100644 index 36f5d370bdf..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot.go +++ /dev/null @@ -1,130 +0,0 @@ -package snapshots - -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(&SnapshotId{}) -} - -var _ resourceids.ResourceId = &SnapshotId{} - -// SnapshotId is a struct representing the Resource ID for a Snapshot -type SnapshotId struct { - SubscriptionId string - ResourceGroupName string - SnapshotName string -} - -// NewSnapshotID returns a new SnapshotId struct -func NewSnapshotID(subscriptionId string, resourceGroupName string, snapshotName string) SnapshotId { - return SnapshotId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - SnapshotName: snapshotName, - } -} - -// 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 := SnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId -// note: this method should only be used for API response data and not user input -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 := SnapshotId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SnapshotId) 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.SnapshotName, ok = input.Parsed["snapshotName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "snapshotName", input) - } - - return nil -} - -// 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 := ParseSnapshotID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// 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 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("staticMicrosoftContainerService", "Microsoft.ContainerService", "Microsoft.ContainerService"), - resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), - resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), - } -} - -// 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("Snapshot Name: %q", id.SnapshotName), - } - return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot_test.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot_test.go deleted file mode 100644 index 656f7bba56a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/id_snapshot_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package snapshots - -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 = &SnapshotId{} - -func TestNewSnapshotID(t *testing.T) { - id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotValue") - - 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.SnapshotName != "snapshotValue" { - t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "snapshotValue") - } -} - -func TestFormatSnapshotID(t *testing.T) { - actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "snapshotValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSnapshotID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SnapshotId - }{ - { - // 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/snapshots", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue", - Expected: &SnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SnapshotName: "snapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSnapshotID(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.SnapshotName != v.Expected.SnapshotName { - t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) - } - - } -} - -func TestParseSnapshotIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SnapshotId - }{ - { - // 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/snapshots", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - 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.ContainerService/snapshots/snapshotValue", - Expected: &SnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SnapshotName: "snapshotValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/snapshots/snapshotValue/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/sNaPsHoTs/sNaPsHoTvAlUe", - Expected: &SnapshotId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SnapshotName: "sNaPsHoTvAlUe", - }, - }, - { - // 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/sNaPsHoTs/sNaPsHoTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSnapshotIDInsensitively(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.SnapshotName != v.Expected.SnapshotName { - t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) - } - - } -} - -func TestSegmentsForSnapshotId(t *testing.T) { - segments := SnapshotId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SnapshotId 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/2023-04-02-preview/snapshots/method_createorupdate.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/method_createorupdate.go deleted file mode 100644 index 201c0eaedc7..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -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/2023-04-02-preview/snapshots/method_delete.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/method_delete.go deleted file mode 100644 index 575cb8a6929..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -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/2023-04-02-preview/snapshots/method_get.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/method_get.go deleted file mode 100644 index d020538006a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -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/2023-04-02-preview/snapshots/method_list.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/method_list.go deleted file mode 100644 index bdefce6bb90..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2023-04-02-preview/snapshots/method_listbyresourcegroup.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/method_listbyresourcegroup.go deleted file mode 100644 index 824b8dc7cb6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/2023-04-02-preview/snapshots/method_updatetags.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/method_updatetags.go deleted file mode 100644 index 60346d7cddc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -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/2023-04-02-preview/snapshots/model_creationdata.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/model_creationdata.go deleted file mode 100644 index 132e3459c82..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/model_creationdata.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/snapshots/model_snapshot.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/model_snapshot.go deleted file mode 100644 index b2feb4ccdae..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/model_snapshot.go +++ /dev/null @@ -1,18 +0,0 @@ -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/2023-04-02-preview/snapshots/model_snapshotproperties.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/model_snapshotproperties.go deleted file mode 100644 index 962aa32598f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/model_snapshotproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -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/2023-04-02-preview/snapshots/model_tagsobject.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/model_tagsobject.go deleted file mode 100644 index 30f646c1c9f..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -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/2023-04-02-preview/snapshots/predicates.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/predicates.go deleted file mode 100644 index 832503e3b26..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -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/2023-04-02-preview/snapshots/version.go b/resource-manager/containerservice/2023-04-02-preview/snapshots/version.go deleted file mode 100644 index 406fa48931c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/snapshots/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package snapshots - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) -} diff --git a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/README.md b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/README.md deleted file mode 100644 index b4217980ee6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/README.md +++ /dev/null @@ -1,108 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/trustedaccess` Documentation - -The `trustedaccess` SDK allows for interaction with the Azure Resource Manager Service `containerservice` (API Version `2023-04-02-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/containerservice/2023-04-02-preview/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", "managedClusterValue", "trustedAccessRoleBindingValue") - -payload := trustedaccess.TrustedAccessRoleBinding{ - // ... -} - - -read, err := client.RoleBindingsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `TrustedAccessClient.RoleBindingsDelete` - -```go -ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "trustedAccessRoleBindingValue") - -read, err := client.RoleBindingsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `TrustedAccessClient.RoleBindingsGet` - -```go -ctx := context.TODO() -id := trustedaccess.NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "trustedAccessRoleBindingValue") - -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", "managedClusterValue") - -// 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", "locationValue") - -// 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/2023-04-02-preview/trustedaccess/client.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/client.go deleted file mode 100644 index 3478bfc5e37..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(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/2023-04-02-preview/trustedaccess/constants.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/constants.go deleted file mode 100644 index 8ab993f971c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -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/2023-04-02-preview/trustedaccess/id_location.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_location.go deleted file mode 100644 index f2c540d6e65..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -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", "locationValue"), - } -} - -// 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/2023-04-02-preview/trustedaccess/id_location_test.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_location_test.go deleted file mode 100644 index 4c581421df5..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue" - 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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/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/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.ContainerService/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.cOnTaInErSeRvIcE/lOcAtIoNs/lOcAtIoNvAlUe/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/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding.go deleted file mode 100644 index 18c1e6b10f3..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding.go +++ /dev/null @@ -1,139 +0,0 @@ -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", "managedClusterValue"), - resourceids.StaticSegment("staticTrustedAccessRoleBindings", "trustedAccessRoleBindings", "trustedAccessRoleBindings"), - resourceids.UserSpecifiedSegment("trustedAccessRoleBindingName", "trustedAccessRoleBindingValue"), - } -} - -// 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/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go deleted file mode 100644 index e35fdf7c516..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/id_trustedaccessrolebinding_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "managedClusterValue", "trustedAccessRoleBindingValue") - - 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 != "managedClusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagedClusterName'", id.ManagedClusterName, "managedClusterValue") - } - - if id.TrustedAccessRoleBindingName != "trustedAccessRoleBindingValue" { - t.Fatalf("Expected %q but got %q for Segment 'TrustedAccessRoleBindingName'", id.TrustedAccessRoleBindingName, "trustedAccessRoleBindingValue") - } -} - -func TestFormatTrustedAccessRoleBindingID(t *testing.T) { - actual := NewTrustedAccessRoleBindingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "managedClusterValue", "trustedAccessRoleBindingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue" - 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/managedClusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue", - Expected: &TrustedAccessRoleBindingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - TrustedAccessRoleBindingName: "trustedAccessRoleBindingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue/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/managedClusterValue", - 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/mAnAgEdClUsTeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/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/mAnAgEdClUsTeRvAlUe/tRuStEdAcCeSsRoLeBiNdInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue", - Expected: &TrustedAccessRoleBindingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ManagedClusterName: "managedClusterValue", - TrustedAccessRoleBindingName: "trustedAccessRoleBindingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.ContainerService/managedClusters/managedClusterValue/trustedAccessRoleBindings/trustedAccessRoleBindingValue/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/mAnAgEdClUsTeRvAlUe/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGvAlUe", - Expected: &TrustedAccessRoleBindingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ManagedClusterName: "mAnAgEdClUsTeRvAlUe", - TrustedAccessRoleBindingName: "tRuStEdAcCeSsRoLeBiNdInGvAlUe", - }, - }, - { - // 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/mAnAgEdClUsTeRvAlUe/tRuStEdAcCeSsRoLeBiNdInGs/tRuStEdAcCeSsRoLeBiNdInGvAlUe/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/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingscreateorupdate.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingscreateorupdate.go deleted file mode 100644 index a8371698581..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingscreateorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -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 RoleBindingsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *TrustedAccessRoleBinding -} - -// 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{ - 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 TrustedAccessRoleBinding - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsdelete.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsdelete.go deleted file mode 100644 index 6f782d1a92c..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -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 RoleBindingsDeleteOperationResponse struct { - 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.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/2023-04-02-preview/trustedaccess/method_rolebindingsget.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsget.go deleted file mode 100644 index a0b81891af6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingsget.go +++ /dev/null @@ -1,54 +0,0 @@ -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/2023-04-02-preview/trustedaccess/method_rolebindingslist.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingslist.go deleted file mode 100644 index 4fc3b544dc0..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_rolebindingslist.go +++ /dev/null @@ -1,92 +0,0 @@ -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 -} - -// 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, - 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 { - 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/containerservice/2023-04-02-preview/trustedaccess/method_roleslist.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_roleslist.go deleted file mode 100644 index 124133a7f5e..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/method_roleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package trustedaccess - -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 RolesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]TrustedAccessRole -} - -type RolesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []TrustedAccessRole -} - -// 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, - Path: fmt.Sprintf("%s/trustedAccessRoles", 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 *[]TrustedAccessRole `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// 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{}) -} - -// 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.RolesList(ctx, id) - if err != nil { - 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 = RolesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrole.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrole.go deleted file mode 100644 index a24a7344c12..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrole.go +++ /dev/null @@ -1,10 +0,0 @@ -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/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebinding.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebinding.go deleted file mode 100644 index 36c110999f6..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebinding.go +++ /dev/null @@ -1,16 +0,0 @@ -package trustedaccess - -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 TrustedAccessRoleBinding struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties TrustedAccessRoleBindingProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go deleted file mode 100644 index b432519d7cc..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolebindingproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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/2023-04-02-preview/trustedaccess/model_trustedaccessrolerule.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolerule.go deleted file mode 100644 index 808af096d0a..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/model_trustedaccessrolerule.go +++ /dev/null @@ -1,12 +0,0 @@ -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/2023-04-02-preview/trustedaccess/predicates.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/predicates.go deleted file mode 100644 index 6bab96a78b7..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/predicates.go +++ /dev/null @@ -1,45 +0,0 @@ -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/2023-04-02-preview/trustedaccess/version.go b/resource-manager/containerservice/2023-04-02-preview/trustedaccess/version.go deleted file mode 100644 index 398801ebc34..00000000000 --- a/resource-manager/containerservice/2023-04-02-preview/trustedaccess/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package trustedaccess - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-02-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/trustedaccess/%s", defaultApiVersion) -} diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/constants.go b/resource-manager/datafactory/2018-06-01/linkedservices/constants.go index 4dec6ae6369..efcde8598bb 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/constants.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/constants.go @@ -9,6 +9,188 @@ import ( // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See NOTICE.txt in the project root for license information. +type AmazonRdsForSqlAuthenticationType string + +const ( + AmazonRdsForSqlAuthenticationTypeSQL AmazonRdsForSqlAuthenticationType = "SQL" + AmazonRdsForSqlAuthenticationTypeWindows AmazonRdsForSqlAuthenticationType = "Windows" +) + +func PossibleValuesForAmazonRdsForSqlAuthenticationType() []string { + return []string{ + string(AmazonRdsForSqlAuthenticationTypeSQL), + string(AmazonRdsForSqlAuthenticationTypeWindows), + } +} + +func (s *AmazonRdsForSqlAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAmazonRdsForSqlAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAmazonRdsForSqlAuthenticationType(input string) (*AmazonRdsForSqlAuthenticationType, error) { + vals := map[string]AmazonRdsForSqlAuthenticationType{ + "sql": AmazonRdsForSqlAuthenticationTypeSQL, + "windows": AmazonRdsForSqlAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AmazonRdsForSqlAuthenticationType(input) + return &out, nil +} + +type AzureSqlDWAuthenticationType string + +const ( + AzureSqlDWAuthenticationTypeSQL AzureSqlDWAuthenticationType = "SQL" + AzureSqlDWAuthenticationTypeServicePrincipal AzureSqlDWAuthenticationType = "ServicePrincipal" + AzureSqlDWAuthenticationTypeSystemAssignedManagedIdentity AzureSqlDWAuthenticationType = "SystemAssignedManagedIdentity" + AzureSqlDWAuthenticationTypeUserAssignedManagedIdentity AzureSqlDWAuthenticationType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForAzureSqlDWAuthenticationType() []string { + return []string{ + string(AzureSqlDWAuthenticationTypeSQL), + string(AzureSqlDWAuthenticationTypeServicePrincipal), + string(AzureSqlDWAuthenticationTypeSystemAssignedManagedIdentity), + string(AzureSqlDWAuthenticationTypeUserAssignedManagedIdentity), + } +} + +func (s *AzureSqlDWAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureSqlDWAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureSqlDWAuthenticationType(input string) (*AzureSqlDWAuthenticationType, error) { + vals := map[string]AzureSqlDWAuthenticationType{ + "sql": AzureSqlDWAuthenticationTypeSQL, + "serviceprincipal": AzureSqlDWAuthenticationTypeServicePrincipal, + "systemassignedmanagedidentity": AzureSqlDWAuthenticationTypeSystemAssignedManagedIdentity, + "userassignedmanagedidentity": AzureSqlDWAuthenticationTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureSqlDWAuthenticationType(input) + return &out, nil +} + +type AzureSqlDatabaseAuthenticationType string + +const ( + AzureSqlDatabaseAuthenticationTypeSQL AzureSqlDatabaseAuthenticationType = "SQL" + AzureSqlDatabaseAuthenticationTypeServicePrincipal AzureSqlDatabaseAuthenticationType = "ServicePrincipal" + AzureSqlDatabaseAuthenticationTypeSystemAssignedManagedIdentity AzureSqlDatabaseAuthenticationType = "SystemAssignedManagedIdentity" + AzureSqlDatabaseAuthenticationTypeUserAssignedManagedIdentity AzureSqlDatabaseAuthenticationType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForAzureSqlDatabaseAuthenticationType() []string { + return []string{ + string(AzureSqlDatabaseAuthenticationTypeSQL), + string(AzureSqlDatabaseAuthenticationTypeServicePrincipal), + string(AzureSqlDatabaseAuthenticationTypeSystemAssignedManagedIdentity), + string(AzureSqlDatabaseAuthenticationTypeUserAssignedManagedIdentity), + } +} + +func (s *AzureSqlDatabaseAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureSqlDatabaseAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureSqlDatabaseAuthenticationType(input string) (*AzureSqlDatabaseAuthenticationType, error) { + vals := map[string]AzureSqlDatabaseAuthenticationType{ + "sql": AzureSqlDatabaseAuthenticationTypeSQL, + "serviceprincipal": AzureSqlDatabaseAuthenticationTypeServicePrincipal, + "systemassignedmanagedidentity": AzureSqlDatabaseAuthenticationTypeSystemAssignedManagedIdentity, + "userassignedmanagedidentity": AzureSqlDatabaseAuthenticationTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureSqlDatabaseAuthenticationType(input) + return &out, nil +} + +type AzureSqlMIAuthenticationType string + +const ( + AzureSqlMIAuthenticationTypeSQL AzureSqlMIAuthenticationType = "SQL" + AzureSqlMIAuthenticationTypeServicePrincipal AzureSqlMIAuthenticationType = "ServicePrincipal" + AzureSqlMIAuthenticationTypeSystemAssignedManagedIdentity AzureSqlMIAuthenticationType = "SystemAssignedManagedIdentity" + AzureSqlMIAuthenticationTypeUserAssignedManagedIdentity AzureSqlMIAuthenticationType = "UserAssignedManagedIdentity" +) + +func PossibleValuesForAzureSqlMIAuthenticationType() []string { + return []string{ + string(AzureSqlMIAuthenticationTypeSQL), + string(AzureSqlMIAuthenticationTypeServicePrincipal), + string(AzureSqlMIAuthenticationTypeSystemAssignedManagedIdentity), + string(AzureSqlMIAuthenticationTypeUserAssignedManagedIdentity), + } +} + +func (s *AzureSqlMIAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureSqlMIAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureSqlMIAuthenticationType(input string) (*AzureSqlMIAuthenticationType, error) { + vals := map[string]AzureSqlMIAuthenticationType{ + "sql": AzureSqlMIAuthenticationTypeSQL, + "serviceprincipal": AzureSqlMIAuthenticationTypeServicePrincipal, + "systemassignedmanagedidentity": AzureSqlMIAuthenticationTypeSystemAssignedManagedIdentity, + "userassignedmanagedidentity": AzureSqlMIAuthenticationTypeUserAssignedManagedIdentity, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureSqlMIAuthenticationType(input) + return &out, nil +} + type AzureStorageAuthenticationType string const ( @@ -1361,6 +1543,47 @@ func parseSqlAlwaysEncryptedAkvAuthType(input string) (*SqlAlwaysEncryptedAkvAut return &out, nil } +type SqlServerAuthenticationType string + +const ( + SqlServerAuthenticationTypeSQL SqlServerAuthenticationType = "SQL" + SqlServerAuthenticationTypeWindows SqlServerAuthenticationType = "Windows" +) + +func PossibleValuesForSqlServerAuthenticationType() []string { + return []string{ + string(SqlServerAuthenticationTypeSQL), + string(SqlServerAuthenticationTypeWindows), + } +} + +func (s *SqlServerAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSqlServerAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSqlServerAuthenticationType(input string) (*SqlServerAuthenticationType, error) { + vals := map[string]SqlServerAuthenticationType{ + "sql": SqlServerAuthenticationTypeSQL, + "windows": SqlServerAuthenticationTypeWindows, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SqlServerAuthenticationType(input) + return &out, nil +} + type SybaseAuthenticationType string const ( diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforsqlserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforsqlserverlinkedservicetypeproperties.go index 75aeca4d8d0..f48ff5204e8 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforsqlserverlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_amazonrdsforsqlserverlinkedservicetypeproperties.go @@ -9,11 +9,31 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AmazonRdsForSqlServerLinkedServiceTypeProperties struct { - AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` - ConnectionString interface{} `json:"connectionString"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password SecretBase `json:"password"` - UserName *interface{} `json:"userName,omitempty"` + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *interface{} `json:"applicationIntent,omitempty"` + AuthenticationType *AmazonRdsForSqlAuthenticationType `json:"authenticationType,omitempty"` + CommandTimeout *interface{} `json:"commandTimeout,omitempty"` + ConnectRetryCount *interface{} `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *interface{} `json:"connectRetryInterval,omitempty"` + ConnectTimeout *interface{} `json:"connectTimeout,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + Database *interface{} `json:"database,omitempty"` + Encrypt *interface{} `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *interface{} `json:"failoverPartner,omitempty"` + HostNameInCertificate *interface{} `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *interface{} `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *interface{} `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *interface{} `json:"maxPoolSize,omitempty"` + MinPoolSize *interface{} `json:"minPoolSize,omitempty"` + MultiSubnetFailover *interface{} `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *interface{} `json:"multipleActiveResultSets,omitempty"` + PacketSize *interface{} `json:"packetSize,omitempty"` + Password SecretBase `json:"password"` + Pooling *interface{} `json:"pooling,omitempty"` + Server *interface{} `json:"server,omitempty"` + TrustServerCertificate *interface{} `json:"trustServerCertificate,omitempty"` + UserName *interface{} `json:"userName,omitempty"` } var _ json.Unmarshaler = &AmazonRdsForSqlServerLinkedServiceTypeProperties{} @@ -26,8 +46,28 @@ func (s *AmazonRdsForSqlServerLinkedServiceTypeProperties) UnmarshalJSON(bytes [ } s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout s.ConnectionString = decoded.ConnectionString + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.TrustServerCertificate = decoded.TrustServerCertificate s.UserName = decoded.UserName var temp map[string]json.RawMessage diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldatabaselinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldatabaselinkedservicetypeproperties.go index 6eb4ff46600..a5d232fe2f4 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldatabaselinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldatabaselinkedservicetypeproperties.go @@ -9,15 +9,38 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AzureSqlDatabaseLinkedServiceTypeProperties struct { - AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` - AzureCloudType *interface{} `json:"azureCloudType,omitempty"` - ConnectionString interface{} `json:"connectionString"` - Credential *CredentialReference `json:"credential,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password *AzureKeyVaultSecretReference `json:"password,omitempty"` - ServicePrincipalId *interface{} `json:"servicePrincipalId,omitempty"` - ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` - Tenant *interface{} `json:"tenant,omitempty"` + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *interface{} `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlDatabaseAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *interface{} `json:"azureCloudType,omitempty"` + CommandTimeout *interface{} `json:"commandTimeout,omitempty"` + ConnectRetryCount *interface{} `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *interface{} `json:"connectRetryInterval,omitempty"` + ConnectTimeout *interface{} `json:"connectTimeout,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *interface{} `json:"database,omitempty"` + Encrypt *interface{} `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *interface{} `json:"failoverPartner,omitempty"` + HostNameInCertificate *interface{} `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *interface{} `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *interface{} `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *interface{} `json:"maxPoolSize,omitempty"` + MinPoolSize *interface{} `json:"minPoolSize,omitempty"` + MultiSubnetFailover *interface{} `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *interface{} `json:"multipleActiveResultSets,omitempty"` + PacketSize *interface{} `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *interface{} `json:"pooling,omitempty"` + Server *interface{} `json:"server,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *interface{} `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *interface{} `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *interface{} `json:"tenant,omitempty"` + TrustServerCertificate *interface{} `json:"trustServerCertificate,omitempty"` + UserName *interface{} `json:"userName,omitempty"` } var _ json.Unmarshaler = &AzureSqlDatabaseLinkedServiceTypeProperties{} @@ -30,19 +53,49 @@ func (s *AzureSqlDatabaseLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte } s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType s.AzureCloudType = decoded.AzureCloudType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout s.ConnectionString = decoded.ConnectionString s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize s.Password = decoded.Password + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType s.ServicePrincipalId = decoded.ServicePrincipalId s.Tenant = decoded.Tenant + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { return fmt.Errorf("unmarshaling AzureSqlDatabaseLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) } + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := unmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureSqlDatabaseLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + if v, ok := temp["servicePrincipalKey"]; ok { impl, err := unmarshalSecretBaseImplementation(v) if err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldwlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldwlinkedservicetypeproperties.go index bc06df4648b..ff399ef8166 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldwlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqldwlinkedservicetypeproperties.go @@ -9,14 +9,37 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AzureSqlDWLinkedServiceTypeProperties struct { - AzureCloudType *interface{} `json:"azureCloudType,omitempty"` - ConnectionString interface{} `json:"connectionString"` - Credential *CredentialReference `json:"credential,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password *AzureKeyVaultSecretReference `json:"password,omitempty"` - ServicePrincipalId *interface{} `json:"servicePrincipalId,omitempty"` - ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` - Tenant *interface{} `json:"tenant,omitempty"` + ApplicationIntent *interface{} `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlDWAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *interface{} `json:"azureCloudType,omitempty"` + CommandTimeout *interface{} `json:"commandTimeout,omitempty"` + ConnectRetryCount *interface{} `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *interface{} `json:"connectRetryInterval,omitempty"` + ConnectTimeout *interface{} `json:"connectTimeout,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *interface{} `json:"database,omitempty"` + Encrypt *interface{} `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *interface{} `json:"failoverPartner,omitempty"` + HostNameInCertificate *interface{} `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *interface{} `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *interface{} `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *interface{} `json:"maxPoolSize,omitempty"` + MinPoolSize *interface{} `json:"minPoolSize,omitempty"` + MultiSubnetFailover *interface{} `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *interface{} `json:"multipleActiveResultSets,omitempty"` + PacketSize *interface{} `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *interface{} `json:"pooling,omitempty"` + Server *interface{} `json:"server,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *interface{} `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *interface{} `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *interface{} `json:"tenant,omitempty"` + TrustServerCertificate *interface{} `json:"trustServerCertificate,omitempty"` + UserName *interface{} `json:"userName,omitempty"` } var _ json.Unmarshaler = &AzureSqlDWLinkedServiceTypeProperties{} @@ -28,19 +51,49 @@ func (s *AzureSqlDWLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) erro return fmt.Errorf("unmarshaling into AzureSqlDWLinkedServiceTypeProperties: %+v", err) } + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType s.AzureCloudType = decoded.AzureCloudType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout s.ConnectionString = decoded.ConnectionString s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize s.Password = decoded.Password + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType s.ServicePrincipalId = decoded.ServicePrincipalId s.Tenant = decoded.Tenant + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { return fmt.Errorf("unmarshaling AzureSqlDWLinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) } + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := unmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureSqlDWLinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + if v, ok := temp["servicePrincipalKey"]; ok { impl, err := unmarshalSecretBaseImplementation(v) if err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqlmilinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqlmilinkedservicetypeproperties.go index cb7e4849871..cf32f57f010 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqlmilinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_azuresqlmilinkedservicetypeproperties.go @@ -9,15 +9,38 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type AzureSqlMILinkedServiceTypeProperties struct { - AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` - AzureCloudType *interface{} `json:"azureCloudType,omitempty"` - ConnectionString interface{} `json:"connectionString"` - Credential *CredentialReference `json:"credential,omitempty"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password *AzureKeyVaultSecretReference `json:"password,omitempty"` - ServicePrincipalId *interface{} `json:"servicePrincipalId,omitempty"` - ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` - Tenant *interface{} `json:"tenant,omitempty"` + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *interface{} `json:"applicationIntent,omitempty"` + AuthenticationType *AzureSqlMIAuthenticationType `json:"authenticationType,omitempty"` + AzureCloudType *interface{} `json:"azureCloudType,omitempty"` + CommandTimeout *interface{} `json:"commandTimeout,omitempty"` + ConnectRetryCount *interface{} `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *interface{} `json:"connectRetryInterval,omitempty"` + ConnectTimeout *interface{} `json:"connectTimeout,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + Credential *CredentialReference `json:"credential,omitempty"` + Database *interface{} `json:"database,omitempty"` + Encrypt *interface{} `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *interface{} `json:"failoverPartner,omitempty"` + HostNameInCertificate *interface{} `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *interface{} `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *interface{} `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *interface{} `json:"maxPoolSize,omitempty"` + MinPoolSize *interface{} `json:"minPoolSize,omitempty"` + MultiSubnetFailover *interface{} `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *interface{} `json:"multipleActiveResultSets,omitempty"` + PacketSize *interface{} `json:"packetSize,omitempty"` + Password *AzureKeyVaultSecretReference `json:"password,omitempty"` + Pooling *interface{} `json:"pooling,omitempty"` + Server *interface{} `json:"server,omitempty"` + ServicePrincipalCredential SecretBase `json:"servicePrincipalCredential"` + ServicePrincipalCredentialType *interface{} `json:"servicePrincipalCredentialType,omitempty"` + ServicePrincipalId *interface{} `json:"servicePrincipalId,omitempty"` + ServicePrincipalKey SecretBase `json:"servicePrincipalKey"` + Tenant *interface{} `json:"tenant,omitempty"` + TrustServerCertificate *interface{} `json:"trustServerCertificate,omitempty"` + UserName *interface{} `json:"userName,omitempty"` } var _ json.Unmarshaler = &AzureSqlMILinkedServiceTypeProperties{} @@ -30,19 +53,49 @@ func (s *AzureSqlMILinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) erro } s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType s.AzureCloudType = decoded.AzureCloudType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout s.ConnectionString = decoded.ConnectionString s.Credential = decoded.Credential + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize s.Password = decoded.Password + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.ServicePrincipalCredentialType = decoded.ServicePrincipalCredentialType s.ServicePrincipalId = decoded.ServicePrincipalId s.Tenant = decoded.Tenant + s.TrustServerCertificate = decoded.TrustServerCertificate + s.UserName = decoded.UserName var temp map[string]json.RawMessage if err := json.Unmarshal(bytes, &temp); err != nil { return fmt.Errorf("unmarshaling AzureSqlMILinkedServiceTypeProperties into map[string]json.RawMessage: %+v", err) } + if v, ok := temp["servicePrincipalCredential"]; ok { + impl, err := unmarshalSecretBaseImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'ServicePrincipalCredential' for 'AzureSqlMILinkedServiceTypeProperties': %+v", err) + } + s.ServicePrincipalCredential = impl + } + if v, ok := temp["servicePrincipalKey"]; ok { impl, err := unmarshalSecretBaseImplementation(v) if err != nil { diff --git a/resource-manager/datafactory/2018-06-01/linkedservices/model_sqlserverlinkedservicetypeproperties.go b/resource-manager/datafactory/2018-06-01/linkedservices/model_sqlserverlinkedservicetypeproperties.go index 1f5e67613e7..56e7d7b1851 100644 --- a/resource-manager/datafactory/2018-06-01/linkedservices/model_sqlserverlinkedservicetypeproperties.go +++ b/resource-manager/datafactory/2018-06-01/linkedservices/model_sqlserverlinkedservicetypeproperties.go @@ -9,11 +9,31 @@ import ( // Licensed under the MIT License. See NOTICE.txt in the project root for license information. type SqlServerLinkedServiceTypeProperties struct { - AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` - ConnectionString interface{} `json:"connectionString"` - EncryptedCredential *string `json:"encryptedCredential,omitempty"` - Password SecretBase `json:"password"` - UserName *interface{} `json:"userName,omitempty"` + AlwaysEncryptedSettings *SqlAlwaysEncryptedProperties `json:"alwaysEncryptedSettings,omitempty"` + ApplicationIntent *interface{} `json:"applicationIntent,omitempty"` + AuthenticationType *SqlServerAuthenticationType `json:"authenticationType,omitempty"` + CommandTimeout *interface{} `json:"commandTimeout,omitempty"` + ConnectRetryCount *interface{} `json:"connectRetryCount,omitempty"` + ConnectRetryInterval *interface{} `json:"connectRetryInterval,omitempty"` + ConnectTimeout *interface{} `json:"connectTimeout,omitempty"` + ConnectionString *interface{} `json:"connectionString,omitempty"` + Database *interface{} `json:"database,omitempty"` + Encrypt *interface{} `json:"encrypt,omitempty"` + EncryptedCredential *string `json:"encryptedCredential,omitempty"` + FailoverPartner *interface{} `json:"failoverPartner,omitempty"` + HostNameInCertificate *interface{} `json:"hostNameInCertificate,omitempty"` + IntegratedSecurity *interface{} `json:"integratedSecurity,omitempty"` + LoadBalanceTimeout *interface{} `json:"loadBalanceTimeout,omitempty"` + MaxPoolSize *interface{} `json:"maxPoolSize,omitempty"` + MinPoolSize *interface{} `json:"minPoolSize,omitempty"` + MultiSubnetFailover *interface{} `json:"multiSubnetFailover,omitempty"` + MultipleActiveResultSets *interface{} `json:"multipleActiveResultSets,omitempty"` + PacketSize *interface{} `json:"packetSize,omitempty"` + Password SecretBase `json:"password"` + Pooling *interface{} `json:"pooling,omitempty"` + Server *interface{} `json:"server,omitempty"` + TrustServerCertificate *interface{} `json:"trustServerCertificate,omitempty"` + UserName *interface{} `json:"userName,omitempty"` } var _ json.Unmarshaler = &SqlServerLinkedServiceTypeProperties{} @@ -26,8 +46,28 @@ func (s *SqlServerLinkedServiceTypeProperties) UnmarshalJSON(bytes []byte) error } s.AlwaysEncryptedSettings = decoded.AlwaysEncryptedSettings + s.ApplicationIntent = decoded.ApplicationIntent + s.AuthenticationType = decoded.AuthenticationType + s.CommandTimeout = decoded.CommandTimeout + s.ConnectRetryCount = decoded.ConnectRetryCount + s.ConnectRetryInterval = decoded.ConnectRetryInterval + s.ConnectTimeout = decoded.ConnectTimeout s.ConnectionString = decoded.ConnectionString + s.Database = decoded.Database + s.Encrypt = decoded.Encrypt s.EncryptedCredential = decoded.EncryptedCredential + s.FailoverPartner = decoded.FailoverPartner + s.HostNameInCertificate = decoded.HostNameInCertificate + s.IntegratedSecurity = decoded.IntegratedSecurity + s.LoadBalanceTimeout = decoded.LoadBalanceTimeout + s.MaxPoolSize = decoded.MaxPoolSize + s.MinPoolSize = decoded.MinPoolSize + s.MultiSubnetFailover = decoded.MultiSubnetFailover + s.MultipleActiveResultSets = decoded.MultipleActiveResultSets + s.PacketSize = decoded.PacketSize + s.Pooling = decoded.Pooling + s.Server = decoded.Server + s.TrustServerCertificate = decoded.TrustServerCertificate s.UserName = decoded.UserName var temp map[string]json.RawMessage diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/README.md b/resource-manager/hdinsight/2018-06-01-preview/applications/README.md deleted file mode 100644 index aec2af7c9b6..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/applications` Documentation - -The `applications` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/applications" -``` - - -### Client Initialization - -```go -client := applications.NewApplicationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationsClient.Create` - -```go -ctx := context.TODO() -id := applications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue") - -payload := applications.Application{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationsClient.Delete` - -```go -ctx := context.TODO() -id := applications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationsClient.Get` - -```go -ctx := context.TODO() -id := applications.NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue") - -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: `ApplicationsClient.ListByCluster` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/client.go b/resource-manager/hdinsight/2018-06-01-preview/applications/client.go deleted file mode 100644 index f4ad56ad4d2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applications - -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 ApplicationsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applications", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationsClient: %+v", err) - } - - return &ApplicationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/constants.go b/resource-manager/hdinsight/2018-06-01-preview/applications/constants.go deleted file mode 100644 index 32698edfc98..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/constants.go +++ /dev/null @@ -1,66 +0,0 @@ -package applications - -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 DaysOfWeek string - -const ( - DaysOfWeekFriday DaysOfWeek = "Friday" - DaysOfWeekMonday DaysOfWeek = "Monday" - DaysOfWeekSaturday DaysOfWeek = "Saturday" - DaysOfWeekSunday DaysOfWeek = "Sunday" - DaysOfWeekThursday DaysOfWeek = "Thursday" - DaysOfWeekTuesday DaysOfWeek = "Tuesday" - DaysOfWeekWednesday DaysOfWeek = "Wednesday" -) - -func PossibleValuesForDaysOfWeek() []string { - return []string{ - string(DaysOfWeekFriday), - string(DaysOfWeekMonday), - string(DaysOfWeekSaturday), - string(DaysOfWeekSunday), - string(DaysOfWeekThursday), - string(DaysOfWeekTuesday), - string(DaysOfWeekWednesday), - } -} - -func (s *DaysOfWeek) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDaysOfWeek(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDaysOfWeek(input string) (*DaysOfWeek, error) { - vals := map[string]DaysOfWeek{ - "friday": DaysOfWeekFriday, - "monday": DaysOfWeekMonday, - "saturday": DaysOfWeekSaturday, - "sunday": DaysOfWeekSunday, - "thursday": DaysOfWeekThursday, - "tuesday": DaysOfWeekTuesday, - "wednesday": DaysOfWeekWednesday, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DaysOfWeek(input) - return &out, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/id_application.go b/resource-manager/hdinsight/2018-06-01-preview/applications/id_application.go deleted file mode 100644 index eb1b16c8c76..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/id_application.go +++ /dev/null @@ -1,139 +0,0 @@ -package applications - -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(&ApplicationId{}) -} - -var _ resourceids.ResourceId = &ApplicationId{} - -// ApplicationId is a struct representing the Resource ID for a Application -type ApplicationId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ApplicationName string -} - -// NewApplicationID returns a new ApplicationId struct -func NewApplicationID(subscriptionId string, resourceGroupName string, clusterName string, applicationName string) ApplicationId { - return ApplicationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ApplicationName: applicationName, - } -} - -// ParseApplicationID parses 'input' into a ApplicationId -func ParseApplicationID(input string) (*ApplicationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationIDInsensitively parses 'input' case-insensitively into a ApplicationId -// note: this method should only be used for API response data and not user input -func ParseApplicationIDInsensitively(input string) (*ApplicationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ApplicationName, ok = input.Parsed["applicationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationName", input) - } - - return nil -} - -// ValidateApplicationID checks that 'input' can be parsed as a Application ID -func ValidateApplicationID(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 := ParseApplicationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application ID -func (id ApplicationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusters/%s/applications/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ApplicationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application ID -func (id ApplicationId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticApplications", "applications", "applications"), - resourceids.UserSpecifiedSegment("applicationName", "applicationValue"), - } -} - -// String returns a human-readable description of this Application ID -func (id ApplicationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Application Name: %q", id.ApplicationName), - } - return fmt.Sprintf("Application (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/id_application_test.go b/resource-manager/hdinsight/2018-06-01-preview/applications/id_application_test.go deleted file mode 100644 index f0a70cc35b2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/id_application_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package applications - -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 = &ApplicationId{} - -func TestNewApplicationID(t *testing.T) { - id := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ApplicationName != "applicationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationName'", id.ApplicationName, "applicationValue") - } -} - -func TestFormatApplicationID(t *testing.T) { - actual := NewApplicationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "applicationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications/applicationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications/applicationValue", - Expected: &ApplicationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ApplicationName: "applicationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications/applicationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ApplicationName != v.Expected.ApplicationName { - t.Fatalf("Expected %q but got %q for ApplicationName", v.Expected.ApplicationName, actual.ApplicationName) - } - - } -} - -func TestParseApplicationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/aPpLiCaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications/applicationValue", - Expected: &ApplicationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ApplicationName: "applicationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/applications/applicationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/aPpLiCaTiOnS/aPpLiCaTiOnVaLuE", - Expected: &ApplicationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ApplicationName: "aPpLiCaTiOnVaLuE", - }, - }, - { - // 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.hDiNsIgHt/cLuStErS/cLuStErVaLuE/aPpLiCaTiOnS/aPpLiCaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ApplicationName != v.Expected.ApplicationName { - t.Fatalf("Expected %q but got %q for ApplicationName", v.Expected.ApplicationName, actual.ApplicationName) - } - - } -} - -func TestSegmentsForApplicationId(t *testing.T) { - segments := ApplicationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationId 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/hdinsight/2018-06-01-preview/applications/method_create.go b/resource-manager/hdinsight/2018-06-01-preview/applications/method_create.go deleted file mode 100644 index 54d0da200fe..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/method_create.go +++ /dev/null @@ -1,74 +0,0 @@ -package applications - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Application -} - -// Create ... -func (c ApplicationsClient) Create(ctx context.Context, id ApplicationId, input Application) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ApplicationsClient) CreateThenPoll(ctx context.Context, id ApplicationId, input Application) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/method_delete.go b/resource-manager/hdinsight/2018-06-01-preview/applications/method_delete.go deleted file mode 100644 index a4e7e81c0e5..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applications - -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 ApplicationsClient) Delete(ctx context.Context, id ApplicationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationsClient) DeleteThenPoll(ctx context.Context, id ApplicationId) 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/hdinsight/2018-06-01-preview/applications/method_get.go b/resource-manager/hdinsight/2018-06-01-preview/applications/method_get.go deleted file mode 100644 index f15c3c0bf9f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applications - -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 *Application -} - -// Get ... -func (c ApplicationsClient) Get(ctx context.Context, id ApplicationId) (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 Application - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/method_listbycluster.go b/resource-manager/hdinsight/2018-06-01-preview/applications/method_listbycluster.go deleted file mode 100644 index 9483f9788fd..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/method_listbycluster.go +++ /dev/null @@ -1,92 +0,0 @@ -package applications - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Application -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []Application -} - -// ListByCluster ... -func (c ApplicationsClient) ListByCluster(ctx context.Context, id commonids.HDInsightClusterId) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/applications", 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 *[]Application `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c ApplicationsClient) ListByClusterComplete(ctx context.Context, id commonids.HDInsightClusterId) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, ApplicationOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationsClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id commonids.HDInsightClusterId, predicate ApplicationOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]Application, 0) - - resp, err := c.ListByCluster(ctx, id) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_application.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_application.go deleted file mode 100644 index 59859045f29..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_application.go +++ /dev/null @@ -1,13 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Application struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgetendpoint.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgetendpoint.go deleted file mode 100644 index cc9d34c9a0d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgetendpoint.go +++ /dev/null @@ -1,11 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGetEndpoint struct { - DestinationPort *int64 `json:"destinationPort,omitempty"` - Location *string `json:"location,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PublicPort *int64 `json:"publicPort,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgethttpsendpoint.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgethttpsendpoint.go deleted file mode 100644 index 015d62ea18c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationgethttpsendpoint.go +++ /dev/null @@ -1,14 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGetHTTPSEndpoint struct { - AccessModes *[]string `json:"accessModes,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - DisableGatewayAuth *bool `json:"disableGatewayAuth,omitempty"` - Location *string `json:"location,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PublicPort *int64 `json:"publicPort,omitempty"` - SubDomainSuffix *string `json:"subDomainSuffix,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationproperties.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationproperties.go deleted file mode 100644 index b2f154a1617..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_applicationproperties.go +++ /dev/null @@ -1,18 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationProperties struct { - ApplicationState *string `json:"applicationState,omitempty"` - ApplicationType *string `json:"applicationType,omitempty"` - ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` - CreatedDate *string `json:"createdDate,omitempty"` - Errors *[]Errors `json:"errors,omitempty"` - HTTPSEndpoints *[]ApplicationGetHTTPSEndpoint `json:"httpsEndpoints,omitempty"` - InstallScriptActions *[]RuntimeScriptAction `json:"installScriptActions,omitempty"` - MarketplaceIdentifier *string `json:"marketplaceIdentifier,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - SshEndpoints *[]ApplicationGetEndpoint `json:"sshEndpoints,omitempty"` - UninstallScriptActions *[]RuntimeScriptAction `json:"uninstallScriptActions,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscale.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscale.go deleted file mode 100644 index 0d0f808799a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscale.go +++ /dev/null @@ -1,9 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Autoscale struct { - Capacity *AutoscaleCapacity `json:"capacity,omitempty"` - Recurrence *AutoscaleRecurrence `json:"recurrence,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalecapacity.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalecapacity.go deleted file mode 100644 index 4cb1551415d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalecapacity.go +++ /dev/null @@ -1,9 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleCapacity struct { - MaxInstanceCount *int64 `json:"maxInstanceCount,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalerecurrence.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalerecurrence.go deleted file mode 100644 index 3231de53750..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscalerecurrence.go +++ /dev/null @@ -1,9 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleRecurrence struct { - Schedule *[]AutoscaleSchedule `json:"schedule,omitempty"` - TimeZone *string `json:"timeZone,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaleschedule.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaleschedule.go deleted file mode 100644 index 93ad90ee464..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaleschedule.go +++ /dev/null @@ -1,9 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleSchedule struct { - Days *[]DaysOfWeek `json:"days,omitempty"` - TimeAndCapacity *AutoscaleTimeAndCapacity `json:"timeAndCapacity,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaletimeandcapacity.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaletimeandcapacity.go deleted file mode 100644 index 62e6a9cad4a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_autoscaletimeandcapacity.go +++ /dev/null @@ -1,10 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleTimeAndCapacity struct { - MaxInstanceCount *int64 `json:"maxInstanceCount,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` - Time *string `json:"time,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_computeprofile.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_computeprofile.go deleted file mode 100644 index e1bc8b501be..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_computeprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComputeProfile struct { - Roles *[]Role `json:"roles,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_datadisksgroups.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_datadisksgroups.go deleted file mode 100644 index 7e5512dceeb..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_datadisksgroups.go +++ /dev/null @@ -1,10 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataDisksGroups struct { - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - DisksPerNode *int64 `json:"disksPerNode,omitempty"` - StorageAccountType *string `json:"storageAccountType,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_errors.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_errors.go deleted file mode 100644 index 487b4228be1..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_errors.go +++ /dev/null @@ -1,9 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Errors struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_hardwareprofile.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_hardwareprofile.go deleted file mode 100644 index 32413a61fab..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_hardwareprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HardwareProfile struct { - VMSize *string `json:"vmSize,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_linuxoperatingsystemprofile.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_linuxoperatingsystemprofile.go deleted file mode 100644 index 1a9e7fe149d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_linuxoperatingsystemprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LinuxOperatingSystemProfile struct { - Password *string `json:"password,omitempty"` - SshProfile *SshProfile `json:"sshProfile,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_osprofile.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_osprofile.go deleted file mode 100644 index 37e793a7a8b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_osprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OsProfile struct { - LinuxOperatingSystemProfile *LinuxOperatingSystemProfile `json:"linuxOperatingSystemProfile,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_role.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_role.go deleted file mode 100644 index 0aca2feec36..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_role.go +++ /dev/null @@ -1,18 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Role struct { - Autoscale *Autoscale `json:"autoscale,omitempty"` - DataDisksGroups *[]DataDisksGroups `json:"dataDisksGroups,omitempty"` - EncryptDataDisks *bool `json:"encryptDataDisks,omitempty"` - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` - Name *string `json:"name,omitempty"` - OsProfile *OsProfile `json:"osProfile,omitempty"` - ScriptActions *[]ScriptAction `json:"scriptActions,omitempty"` - TargetInstanceCount *int64 `json:"targetInstanceCount,omitempty"` - VMGroupName *string `json:"VMGroupName,omitempty"` - VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_runtimescriptaction.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_runtimescriptaction.go deleted file mode 100644 index f89054ebe3d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_runtimescriptaction.go +++ /dev/null @@ -1,12 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RuntimeScriptAction struct { - ApplicationName *string `json:"applicationName,omitempty"` - Name string `json:"name"` - Parameters *string `json:"parameters,omitempty"` - Roles []string `json:"roles"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_scriptaction.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_scriptaction.go deleted file mode 100644 index e9b5e997dd1..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_scriptaction.go +++ /dev/null @@ -1,10 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScriptAction struct { - Name string `json:"name"` - Parameters string `json:"parameters"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_sshprofile.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_sshprofile.go deleted file mode 100644 index b86172e5490..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_sshprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshProfile struct { - PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_sshpublickey.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_sshpublickey.go deleted file mode 100644 index 61c65683bdf..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_sshpublickey.go +++ /dev/null @@ -1,8 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshPublicKey struct { - CertificateData *string `json:"certificateData,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/model_virtualnetworkprofile.go b/resource-manager/hdinsight/2018-06-01-preview/applications/model_virtualnetworkprofile.go deleted file mode 100644 index a4a87f052ae..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/model_virtualnetworkprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkProfile struct { - Id *string `json:"id,omitempty"` - Subnet *string `json:"subnet,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/applications/predicates.go b/resource-manager/hdinsight/2018-06-01-preview/applications/predicates.go deleted file mode 100644 index 05ce0f966d3..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package applications - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ApplicationOperationPredicate) Matches(input Application) 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.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/hdinsight/2018-06-01-preview/applications/version.go b/resource-manager/hdinsight/2018-06-01-preview/applications/version.go deleted file mode 100644 index 647645f6010..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/applications/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applications - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applications/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/client.go b/resource-manager/hdinsight/2018-06-01-preview/client.go deleted file mode 100644 index 0527dec2035..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2018_06_01_preview - -// 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/hdinsight/2018-06-01-preview/applications" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/clusters" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/configurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/extensions" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/promote" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/regions" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/scriptactions" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory" - "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/virtualmachines" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Applications *applications.ApplicationsClient - Clusters *clusters.ClustersClient - Configurations *configurations.ConfigurationsClient - Extensions *extensions.ExtensionsClient - Promote *promote.PromoteClient - Regions *regions.RegionsClient - ScriptActions *scriptactions.ScriptActionsClient - ScriptExecutionHistory *scriptexecutionhistory.ScriptExecutionHistoryClient - VirtualMachines *virtualmachines.VirtualMachinesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - applicationsClient, err := applications.NewApplicationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Applications client: %+v", err) - } - configureFunc(applicationsClient.Client) - - clustersClient, err := clusters.NewClustersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Clusters client: %+v", err) - } - configureFunc(clustersClient.Client) - - configurationsClient, err := configurations.NewConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Configurations client: %+v", err) - } - configureFunc(configurationsClient.Client) - - extensionsClient, err := extensions.NewExtensionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Extensions client: %+v", err) - } - configureFunc(extensionsClient.Client) - - promoteClient, err := promote.NewPromoteClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Promote client: %+v", err) - } - configureFunc(promoteClient.Client) - - regionsClient, err := regions.NewRegionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Regions client: %+v", err) - } - configureFunc(regionsClient.Client) - - scriptActionsClient, err := scriptactions.NewScriptActionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ScriptActions client: %+v", err) - } - configureFunc(scriptActionsClient.Client) - - scriptExecutionHistoryClient, err := scriptexecutionhistory.NewScriptExecutionHistoryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ScriptExecutionHistory client: %+v", err) - } - configureFunc(scriptExecutionHistoryClient.Client) - - virtualMachinesClient, err := virtualmachines.NewVirtualMachinesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualMachines client: %+v", err) - } - configureFunc(virtualMachinesClient.Client) - - return &Client{ - Applications: applicationsClient, - Clusters: clustersClient, - Configurations: configurationsClient, - Extensions: extensionsClient, - Promote: promoteClient, - Regions: regionsClient, - ScriptActions: scriptActionsClient, - ScriptExecutionHistory: scriptExecutionHistoryClient, - VirtualMachines: virtualMachinesClient, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/README.md b/resource-manager/hdinsight/2018-06-01-preview/clusters/README.md deleted file mode 100644 index 08aa31fd498..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/README.md +++ /dev/null @@ -1,239 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/clusters` Documentation - -The `clusters` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/clusters" -``` - - -### Client Initialization - -```go -client := clusters.NewClustersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ClustersClient.Create` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ClusterCreateParametersExtended{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.ExecuteScriptActions` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ExecuteScriptActionParameters{ - // ... -} - - -if err := client.ExecuteScriptActionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -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: `ClustersClient.GetGatewaySettings` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -read, err := client.GetGatewaySettings(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ClustersClient.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: `ClustersClient.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: `ClustersClient.Resize` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ClusterResizeParameters{ - // ... -} - - -if err := client.ResizeThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.RotateDiskEncryptionKey` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ClusterDiskEncryptionParameters{ - // ... -} - - -if err := client.RotateDiskEncryptionKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.Update` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.ClusterPatchParameters{ - // ... -} - - -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: `ClustersClient.UpdateAutoScaleConfiguration` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.AutoscaleConfigurationUpdateParameter{ - // ... -} - - -if err := client.UpdateAutoScaleConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.UpdateGatewaySettings` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.UpdateGatewaySettingsParameters{ - // ... -} - - -if err := client.UpdateGatewaySettingsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClustersClient.UpdateIdentityCertificate` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := clusters.UpdateClusterIdentityCertificateParameters{ - // ... -} - - -if err := client.UpdateIdentityCertificateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/client.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/client.go deleted file mode 100644 index e4ab7fd89ad..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package clusters - -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 ClustersClient struct { - Client *resourcemanager.Client -} - -func NewClustersClientWithBaseURI(sdkApi sdkEnv.Api) (*ClustersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "clusters", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ClustersClient: %+v", err) - } - - return &ClustersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/constants.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/constants.go deleted file mode 100644 index dd1b5d45da8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/constants.go +++ /dev/null @@ -1,412 +0,0 @@ -package clusters - -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 ClusterKind string - -const ( - ClusterKindHBase ClusterKind = "HBASE" - ClusterKindHadoop ClusterKind = "HADOOP" - ClusterKindInteractiveHive ClusterKind = "INTERACTIVEHIVE" - ClusterKindKafka ClusterKind = "KAFKA" - ClusterKindSpark ClusterKind = "SPARK" -) - -func PossibleValuesForClusterKind() []string { - return []string{ - string(ClusterKindHBase), - string(ClusterKindHadoop), - string(ClusterKindInteractiveHive), - string(ClusterKindKafka), - string(ClusterKindSpark), - } -} - -func (s *ClusterKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseClusterKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseClusterKind(input string) (*ClusterKind, error) { - vals := map[string]ClusterKind{ - "hbase": ClusterKindHBase, - "hadoop": ClusterKindHadoop, - "interactivehive": ClusterKindInteractiveHive, - "kafka": ClusterKindKafka, - "spark": ClusterKindSpark, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ClusterKind(input) - return &out, nil -} - -type DaysOfWeek string - -const ( - DaysOfWeekFriday DaysOfWeek = "Friday" - DaysOfWeekMonday DaysOfWeek = "Monday" - DaysOfWeekSaturday DaysOfWeek = "Saturday" - DaysOfWeekSunday DaysOfWeek = "Sunday" - DaysOfWeekThursday DaysOfWeek = "Thursday" - DaysOfWeekTuesday DaysOfWeek = "Tuesday" - DaysOfWeekWednesday DaysOfWeek = "Wednesday" -) - -func PossibleValuesForDaysOfWeek() []string { - return []string{ - string(DaysOfWeekFriday), - string(DaysOfWeekMonday), - string(DaysOfWeekSaturday), - string(DaysOfWeekSunday), - string(DaysOfWeekThursday), - string(DaysOfWeekTuesday), - string(DaysOfWeekWednesday), - } -} - -func (s *DaysOfWeek) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDaysOfWeek(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDaysOfWeek(input string) (*DaysOfWeek, error) { - vals := map[string]DaysOfWeek{ - "friday": DaysOfWeekFriday, - "monday": DaysOfWeekMonday, - "saturday": DaysOfWeekSaturday, - "sunday": DaysOfWeekSunday, - "thursday": DaysOfWeekThursday, - "tuesday": DaysOfWeekTuesday, - "wednesday": DaysOfWeekWednesday, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DaysOfWeek(input) - return &out, nil -} - -type DirectoryType string - -const ( - DirectoryTypeActiveDirectory DirectoryType = "ActiveDirectory" -) - -func PossibleValuesForDirectoryType() []string { - return []string{ - string(DirectoryTypeActiveDirectory), - } -} - -func (s *DirectoryType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDirectoryType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDirectoryType(input string) (*DirectoryType, error) { - vals := map[string]DirectoryType{ - "activedirectory": DirectoryTypeActiveDirectory, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DirectoryType(input) - return &out, nil -} - -type HDInsightClusterProvisioningState string - -const ( - HDInsightClusterProvisioningStateCanceled HDInsightClusterProvisioningState = "Canceled" - HDInsightClusterProvisioningStateDeleting HDInsightClusterProvisioningState = "Deleting" - HDInsightClusterProvisioningStateFailed HDInsightClusterProvisioningState = "Failed" - HDInsightClusterProvisioningStateInProgress HDInsightClusterProvisioningState = "InProgress" - HDInsightClusterProvisioningStateSucceeded HDInsightClusterProvisioningState = "Succeeded" -) - -func PossibleValuesForHDInsightClusterProvisioningState() []string { - return []string{ - string(HDInsightClusterProvisioningStateCanceled), - string(HDInsightClusterProvisioningStateDeleting), - string(HDInsightClusterProvisioningStateFailed), - string(HDInsightClusterProvisioningStateInProgress), - string(HDInsightClusterProvisioningStateSucceeded), - } -} - -func (s *HDInsightClusterProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHDInsightClusterProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHDInsightClusterProvisioningState(input string) (*HDInsightClusterProvisioningState, error) { - vals := map[string]HDInsightClusterProvisioningState{ - "canceled": HDInsightClusterProvisioningStateCanceled, - "deleting": HDInsightClusterProvisioningStateDeleting, - "failed": HDInsightClusterProvisioningStateFailed, - "inprogress": HDInsightClusterProvisioningStateInProgress, - "succeeded": HDInsightClusterProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HDInsightClusterProvisioningState(input) - return &out, nil -} - -type JsonWebKeyEncryptionAlgorithm string - -const ( - JsonWebKeyEncryptionAlgorithmRSANegativeOAEP JsonWebKeyEncryptionAlgorithm = "RSA-OAEP" - JsonWebKeyEncryptionAlgorithmRSANegativeOAEPNegativeTwoFiveSix JsonWebKeyEncryptionAlgorithm = "RSA-OAEP-256" - JsonWebKeyEncryptionAlgorithmRSAOneFive JsonWebKeyEncryptionAlgorithm = "RSA1_5" -) - -func PossibleValuesForJsonWebKeyEncryptionAlgorithm() []string { - return []string{ - string(JsonWebKeyEncryptionAlgorithmRSANegativeOAEP), - string(JsonWebKeyEncryptionAlgorithmRSANegativeOAEPNegativeTwoFiveSix), - string(JsonWebKeyEncryptionAlgorithmRSAOneFive), - } -} - -func (s *JsonWebKeyEncryptionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseJsonWebKeyEncryptionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseJsonWebKeyEncryptionAlgorithm(input string) (*JsonWebKeyEncryptionAlgorithm, error) { - vals := map[string]JsonWebKeyEncryptionAlgorithm{ - "rsa-oaep": JsonWebKeyEncryptionAlgorithmRSANegativeOAEP, - "rsa-oaep-256": JsonWebKeyEncryptionAlgorithmRSANegativeOAEPNegativeTwoFiveSix, - "rsa1_5": JsonWebKeyEncryptionAlgorithmRSAOneFive, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := JsonWebKeyEncryptionAlgorithm(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 PrivateLink string - -const ( - PrivateLinkDisabled PrivateLink = "Disabled" - PrivateLinkEnabled PrivateLink = "Enabled" -) - -func PossibleValuesForPrivateLink() []string { - return []string{ - string(PrivateLinkDisabled), - string(PrivateLinkEnabled), - } -} - -func (s *PrivateLink) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateLink(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateLink(input string) (*PrivateLink, error) { - vals := map[string]PrivateLink{ - "disabled": PrivateLinkDisabled, - "enabled": PrivateLinkEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateLink(input) - return &out, nil -} - -type ResourceProviderConnection string - -const ( - ResourceProviderConnectionInbound ResourceProviderConnection = "Inbound" - ResourceProviderConnectionOutbound ResourceProviderConnection = "Outbound" -) - -func PossibleValuesForResourceProviderConnection() []string { - return []string{ - string(ResourceProviderConnectionInbound), - string(ResourceProviderConnectionOutbound), - } -} - -func (s *ResourceProviderConnection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceProviderConnection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceProviderConnection(input string) (*ResourceProviderConnection, error) { - vals := map[string]ResourceProviderConnection{ - "inbound": ResourceProviderConnectionInbound, - "outbound": ResourceProviderConnectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceProviderConnection(input) - return &out, nil -} - -type Tier string - -const ( - TierPremium Tier = "Premium" - TierStandard Tier = "Standard" -) - -func PossibleValuesForTier() []string { - return []string{ - string(TierPremium), - string(TierStandard), - } -} - -func (s *Tier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTier(input string) (*Tier, error) { - vals := map[string]Tier{ - "premium": TierPremium, - "standard": TierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Tier(input) - return &out, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_create.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_create.go deleted file mode 100644 index 17a984afebf..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// Create ... -func (c ClustersClient) Create(ctx context.Context, id commonids.HDInsightClusterId, input ClusterCreateParametersExtended) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ClustersClient) CreateThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input ClusterCreateParametersExtended) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_delete.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_delete.go deleted file mode 100644 index 7bbdbda8faa..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package clusters - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c ClustersClient) Delete(ctx context.Context, id commonids.HDInsightClusterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ClustersClient) DeleteThenPoll(ctx context.Context, id commonids.HDInsightClusterId) 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/hdinsight/2018-06-01-preview/clusters/method_executescriptactions.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_executescriptactions.go deleted file mode 100644 index eda922a33cc..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_executescriptactions.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 ExecuteScriptActionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ExecuteScriptActions ... -func (c ClustersClient) ExecuteScriptActions(ctx context.Context, id commonids.HDInsightClusterId, input ExecuteScriptActionParameters) (result ExecuteScriptActionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/executeScriptActions", 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 -} - -// ExecuteScriptActionsThenPoll performs ExecuteScriptActions then polls until it's completed -func (c ClustersClient) ExecuteScriptActionsThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input ExecuteScriptActionParameters) error { - result, err := c.ExecuteScriptActions(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ExecuteScriptActions: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExecuteScriptActions: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_get.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_get.go deleted file mode 100644 index 0a09f2c6cd0..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package clusters - -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 *Cluster -} - -// Get ... -func (c ClustersClient) Get(ctx context.Context, id commonids.HDInsightClusterId) (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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_getgatewaysettings.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_getgatewaysettings.go deleted file mode 100644 index b51901a3c3b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_getgatewaysettings.go +++ /dev/null @@ -1,56 +0,0 @@ -package clusters - -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 GetGatewaySettingsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *GatewaySettings -} - -// GetGatewaySettings ... -func (c ClustersClient) GetGatewaySettings(ctx context.Context, id commonids.HDInsightClusterId) (result GetGatewaySettingsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getGatewaySettings", 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 GatewaySettings - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_list.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_list.go deleted file mode 100644 index f8fa403db04..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusters - -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 *[]Cluster -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Cluster -} - -// List ... -func (c ClustersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.HDInsight/clusters", 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 *[]Cluster `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 ClustersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClustersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ClusterOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Cluster, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/hdinsight/2018-06-01-preview/clusters/method_listbyresourcegroup.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_listbyresourcegroup.go deleted file mode 100644 index 1fee17adb7f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusters - -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 *[]Cluster -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Cluster -} - -// ListByResourceGroup ... -func (c ClustersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.HDInsight/clusters", 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 *[]Cluster `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 ClustersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClustersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ClusterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Cluster, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/hdinsight/2018-06-01-preview/clusters/method_resize.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_resize.go deleted file mode 100644 index 7018e155e8f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_resize.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 ResizeOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Resize ... -func (c ClustersClient) Resize(ctx context.Context, id commonids.HDInsightClusterId, input ClusterResizeParameters) (result ResizeOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/roles/workernode/resize", 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 -} - -// ResizeThenPoll performs Resize then polls until it's completed -func (c ClustersClient) ResizeThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input ClusterResizeParameters) error { - result, err := c.Resize(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Resize: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Resize: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_rotatediskencryptionkey.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_rotatediskencryptionkey.go deleted file mode 100644 index dd4a09426b7..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_rotatediskencryptionkey.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 RotateDiskEncryptionKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RotateDiskEncryptionKey ... -func (c ClustersClient) RotateDiskEncryptionKey(ctx context.Context, id commonids.HDInsightClusterId, input ClusterDiskEncryptionParameters) (result RotateDiskEncryptionKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/rotatediskencryptionkey", 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 -} - -// RotateDiskEncryptionKeyThenPoll performs RotateDiskEncryptionKey then polls until it's completed -func (c ClustersClient) RotateDiskEncryptionKeyThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input ClusterDiskEncryptionParameters) error { - result, err := c.RotateDiskEncryptionKey(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RotateDiskEncryptionKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RotateDiskEncryptionKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_update.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_update.go deleted file mode 100644 index cd283d4c493..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_update.go +++ /dev/null @@ -1,59 +0,0 @@ -package clusters - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Cluster -} - -// Update ... -func (c ClustersClient) Update(ctx context.Context, id commonids.HDInsightClusterId, input ClusterPatchParameters) (result UpdateOperationResponse, 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 Cluster - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateautoscaleconfiguration.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateautoscaleconfiguration.go deleted file mode 100644 index 897c24845e2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateautoscaleconfiguration.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 UpdateAutoScaleConfigurationOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateAutoScaleConfiguration ... -func (c ClustersClient) UpdateAutoScaleConfiguration(ctx context.Context, id commonids.HDInsightClusterId, input AutoscaleConfigurationUpdateParameter) (result UpdateAutoScaleConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/roles/workernode/autoscale", 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 -} - -// UpdateAutoScaleConfigurationThenPoll performs UpdateAutoScaleConfiguration then polls until it's completed -func (c ClustersClient) UpdateAutoScaleConfigurationThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input AutoscaleConfigurationUpdateParameter) error { - result, err := c.UpdateAutoScaleConfiguration(ctx, id, input) - if err != nil { - return fmt.Errorf("performing UpdateAutoScaleConfiguration: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after UpdateAutoScaleConfiguration: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updategatewaysettings.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updategatewaysettings.go deleted file mode 100644 index 594912387bc..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updategatewaysettings.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 UpdateGatewaySettingsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateGatewaySettings ... -func (c ClustersClient) UpdateGatewaySettings(ctx context.Context, id commonids.HDInsightClusterId, input UpdateGatewaySettingsParameters) (result UpdateGatewaySettingsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/updateGatewaySettings", 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 -} - -// UpdateGatewaySettingsThenPoll performs UpdateGatewaySettings then polls until it's completed -func (c ClustersClient) UpdateGatewaySettingsThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input UpdateGatewaySettingsParameters) error { - result, err := c.UpdateGatewaySettings(ctx, id, input) - if err != nil { - return fmt.Errorf("performing UpdateGatewaySettings: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after UpdateGatewaySettings: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateidentitycertificate.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateidentitycertificate.go deleted file mode 100644 index 4c0a00e68e0..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/method_updateidentitycertificate.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusters - -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 UpdateIdentityCertificateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateIdentityCertificate ... -func (c ClustersClient) UpdateIdentityCertificate(ctx context.Context, id commonids.HDInsightClusterId, input UpdateClusterIdentityCertificateParameters) (result UpdateIdentityCertificateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/updateClusterIdentityCertificate", 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 -} - -// UpdateIdentityCertificateThenPoll performs UpdateIdentityCertificate then polls until it's completed -func (c ClustersClient) UpdateIdentityCertificateThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input UpdateClusterIdentityCertificateParameters) error { - result, err := c.UpdateIdentityCertificate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing UpdateIdentityCertificate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after UpdateIdentityCertificate: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscale.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscale.go deleted file mode 100644 index 2d29e499ffc..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscale.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Autoscale struct { - Capacity *AutoscaleCapacity `json:"capacity,omitempty"` - Recurrence *AutoscaleRecurrence `json:"recurrence,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalecapacity.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalecapacity.go deleted file mode 100644 index 3d689bdd534..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalecapacity.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleCapacity struct { - MaxInstanceCount *int64 `json:"maxInstanceCount,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleconfigurationupdateparameter.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleconfigurationupdateparameter.go deleted file mode 100644 index edc6dbb2e29..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleconfigurationupdateparameter.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleConfigurationUpdateParameter struct { - Autoscale *Autoscale `json:"autoscale,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalerecurrence.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalerecurrence.go deleted file mode 100644 index c89ea0cc3ce..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscalerecurrence.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleRecurrence struct { - Schedule *[]AutoscaleSchedule `json:"schedule,omitempty"` - TimeZone *string `json:"timeZone,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleschedule.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleschedule.go deleted file mode 100644 index e7d2fcdc07f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaleschedule.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleSchedule struct { - Days *[]DaysOfWeek `json:"days,omitempty"` - TimeAndCapacity *AutoscaleTimeAndCapacity `json:"timeAndCapacity,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaletimeandcapacity.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaletimeandcapacity.go deleted file mode 100644 index 6797a44861b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_autoscaletimeandcapacity.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleTimeAndCapacity struct { - MaxInstanceCount *int64 `json:"maxInstanceCount,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` - Time *string `json:"time,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clientgroupinfo.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clientgroupinfo.go deleted file mode 100644 index 5fcf2187306..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clientgroupinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientGroupInfo struct { - GroupId *string `json:"groupId,omitempty"` - GroupName *string `json:"groupName,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_cluster.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_cluster.go deleted file mode 100644 index e6ccc0524e2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_cluster.go +++ /dev/null @@ -1,19 +0,0 @@ -package clusters - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Cluster struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ClusterGetProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateparametersextended.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateparametersextended.go deleted file mode 100644 index f6548ef5630..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateparametersextended.go +++ /dev/null @@ -1,15 +0,0 @@ -package clusters - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterCreateParametersExtended struct { - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Properties *ClusterCreateProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateproperties.go deleted file mode 100644 index a900d973dd1..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustercreateproperties.go +++ /dev/null @@ -1,20 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterCreateProperties struct { - ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - ComputeIsolationProperties *ComputeIsolationProperties `json:"computeIsolationProperties,omitempty"` - ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` - DiskEncryptionProperties *DiskEncryptionProperties `json:"diskEncryptionProperties,omitempty"` - EncryptionInTransitProperties *EncryptionInTransitProperties `json:"encryptionInTransitProperties,omitempty"` - KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` - MinSupportedTlsVersion *string `json:"minSupportedTlsVersion,omitempty"` - NetworkProperties *NetworkProperties `json:"networkProperties,omitempty"` - OsType *OSType `json:"osType,omitempty"` - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - Tier *Tier `json:"tier,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdefinition.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdefinition.go deleted file mode 100644 index d62f157cc34..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdefinition.go +++ /dev/null @@ -1,11 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDefinition struct { - Blueprint *string `json:"blueprint,omitempty"` - ComponentVersion *map[string]string `json:"componentVersion,omitempty"` - Configurations *interface{} `json:"configurations,omitempty"` - Kind *ClusterKind `json:"kind,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdiskencryptionparameters.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdiskencryptionparameters.go deleted file mode 100644 index 663fe0b05da..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterdiskencryptionparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDiskEncryptionParameters struct { - KeyName *string `json:"keyName,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - VaultUri *string `json:"vaultUri,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustergetproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustergetproperties.go deleted file mode 100644 index 908418a0329..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clustergetproperties.go +++ /dev/null @@ -1,29 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterGetProperties struct { - ClusterDefinition ClusterDefinition `json:"clusterDefinition"` - ClusterHdpVersion *string `json:"clusterHdpVersion,omitempty"` - ClusterId *string `json:"clusterId,omitempty"` - ClusterState *string `json:"clusterState,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - ComputeIsolationProperties *ComputeIsolationProperties `json:"computeIsolationProperties,omitempty"` - ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` - ConnectivityEndpoints *[]ConnectivityEndpoint `json:"connectivityEndpoints,omitempty"` - CreatedDate *string `json:"createdDate,omitempty"` - DiskEncryptionProperties *DiskEncryptionProperties `json:"diskEncryptionProperties,omitempty"` - EncryptionInTransitProperties *EncryptionInTransitProperties `json:"encryptionInTransitProperties,omitempty"` - Errors *[]Errors `json:"errors,omitempty"` - ExcludedServicesConfig *ExcludedServicesConfig `json:"excludedServicesConfig,omitempty"` - KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` - MinSupportedTlsVersion *string `json:"minSupportedTlsVersion,omitempty"` - NetworkProperties *NetworkProperties `json:"networkProperties,omitempty"` - OsType *OSType `json:"osType,omitempty"` - ProvisioningState *HDInsightClusterProvisioningState `json:"provisioningState,omitempty"` - QuotaInfo *QuotaInfo `json:"quotaInfo,omitempty"` - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - Tier *Tier `json:"tier,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterpatchparameters.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterpatchparameters.go deleted file mode 100644 index 3668a071110..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterpatchparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterPatchParameters struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterresizeparameters.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterresizeparameters.go deleted file mode 100644 index 8a4f4726840..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_clusterresizeparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterResizeParameters struct { - TargetInstanceCount *int64 `json:"targetInstanceCount,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeisolationproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeisolationproperties.go deleted file mode 100644 index fe38a3b231f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeisolationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComputeIsolationProperties struct { - EnableComputeIsolation *bool `json:"enableComputeIsolation,omitempty"` - HostSku *string `json:"hostSku,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeprofile.go deleted file mode 100644 index c2d25db791a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_computeprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComputeProfile struct { - Roles *[]Role `json:"roles,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_connectivityendpoint.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_connectivityendpoint.go deleted file mode 100644 index bdffabe4c31..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_connectivityendpoint.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityEndpoint struct { - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Port *int64 `json:"port,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - Protocol *string `json:"protocol,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_datadisksgroups.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_datadisksgroups.go deleted file mode 100644 index 58c86429923..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_datadisksgroups.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataDisksGroups struct { - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - DisksPerNode *int64 `json:"disksPerNode,omitempty"` - StorageAccountType *string `json:"storageAccountType,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_diskencryptionproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_diskencryptionproperties.go deleted file mode 100644 index b5bf01bc106..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_diskencryptionproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskEncryptionProperties struct { - EncryptionAlgorithm *JsonWebKeyEncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` - EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - MsiResourceId *string `json:"msiResourceId,omitempty"` - VaultUri *string `json:"vaultUri,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_encryptionintransitproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_encryptionintransitproperties.go deleted file mode 100644 index 2e9fab45788..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_encryptionintransitproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionInTransitProperties struct { - IsEncryptionInTransitEnabled *bool `json:"isEncryptionInTransitEnabled,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_errors.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_errors.go deleted file mode 100644 index 9ba00e7a438..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_errors.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Errors struct { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_excludedservicesconfig.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_excludedservicesconfig.go deleted file mode 100644 index d9aed9c68a8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_excludedservicesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExcludedServicesConfig struct { - ExcludedServicesConfigId *string `json:"excludedServicesConfigId,omitempty"` - ExcludedServicesList *string `json:"excludedServicesList,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_executescriptactionparameters.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_executescriptactionparameters.go deleted file mode 100644 index bf03a59ff5a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_executescriptactionparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExecuteScriptActionParameters struct { - PersistOnSuccess bool `json:"persistOnSuccess"` - ScriptActions *[]RuntimeScriptAction `json:"scriptActions,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_gatewaysettings.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_gatewaysettings.go deleted file mode 100644 index 4cff76ff73d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_gatewaysettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewaySettings struct { - RestAuthCredentialIsEnabled *string `json:"restAuthCredential.isEnabled,omitempty"` - RestAuthCredentialPassword *string `json:"restAuthCredential.password,omitempty"` - RestAuthCredentialUsername *string `json:"restAuthCredential.username,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_hardwareprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_hardwareprofile.go deleted file mode 100644 index 1d1fda9c48c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_hardwareprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HardwareProfile struct { - VMSize *string `json:"vmSize,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_kafkarestproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_kafkarestproperties.go deleted file mode 100644 index d1827046e21..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_kafkarestproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KafkaRestProperties struct { - ClientGroupInfo *ClientGroupInfo `json:"clientGroupInfo,omitempty"` - ConfigurationOverride *map[string]string `json:"configurationOverride,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_linuxoperatingsystemprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_linuxoperatingsystemprofile.go deleted file mode 100644 index fe365a40816..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_linuxoperatingsystemprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LinuxOperatingSystemProfile struct { - Password *string `json:"password,omitempty"` - SshProfile *SshProfile `json:"sshProfile,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_networkproperties.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_networkproperties.go deleted file mode 100644 index 9252d1a6d18..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_networkproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProperties struct { - PrivateLink *PrivateLink `json:"privateLink,omitempty"` - ResourceProviderConnection *ResourceProviderConnection `json:"resourceProviderConnection,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_osprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_osprofile.go deleted file mode 100644 index 4bf10e282d0..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_osprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OsProfile struct { - LinuxOperatingSystemProfile *LinuxOperatingSystemProfile `json:"linuxOperatingSystemProfile,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_quotainfo.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_quotainfo.go deleted file mode 100644 index f6b2d6671ac..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_quotainfo.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QuotaInfo struct { - CoresUsed *int64 `json:"coresUsed,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_role.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_role.go deleted file mode 100644 index 3aff48dbd90..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_role.go +++ /dev/null @@ -1,18 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Role struct { - Autoscale *Autoscale `json:"autoscale,omitempty"` - DataDisksGroups *[]DataDisksGroups `json:"dataDisksGroups,omitempty"` - EncryptDataDisks *bool `json:"encryptDataDisks,omitempty"` - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` - Name *string `json:"name,omitempty"` - OsProfile *OsProfile `json:"osProfile,omitempty"` - ScriptActions *[]ScriptAction `json:"scriptActions,omitempty"` - TargetInstanceCount *int64 `json:"targetInstanceCount,omitempty"` - VMGroupName *string `json:"VMGroupName,omitempty"` - VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_runtimescriptaction.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_runtimescriptaction.go deleted file mode 100644 index b8f12d59e59..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_runtimescriptaction.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RuntimeScriptAction struct { - ApplicationName *string `json:"applicationName,omitempty"` - Name string `json:"name"` - Parameters *string `json:"parameters,omitempty"` - Roles []string `json:"roles"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_scriptaction.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_scriptaction.go deleted file mode 100644 index 9d6faf4d316..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_scriptaction.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScriptAction struct { - Name string `json:"name"` - Parameters string `json:"parameters"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_securityprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_securityprofile.go deleted file mode 100644 index 1253c24e306..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_securityprofile.go +++ /dev/null @@ -1,16 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityProfile struct { - AaddsResourceId *string `json:"aaddsResourceId,omitempty"` - ClusterUsersGroupDNs *[]string `json:"clusterUsersGroupDNs,omitempty"` - DirectoryType *DirectoryType `json:"directoryType,omitempty"` - Domain *string `json:"domain,omitempty"` - DomainUserPassword *string `json:"domainUserPassword,omitempty"` - DomainUsername *string `json:"domainUsername,omitempty"` - LdapsUrls *[]string `json:"ldapsUrls,omitempty"` - MsiResourceId *string `json:"msiResourceId,omitempty"` - OrganizationalUnitDN *string `json:"organizationalUnitDN,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshprofile.go deleted file mode 100644 index 0b3fe3a4ca8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshProfile struct { - PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshpublickey.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshpublickey.go deleted file mode 100644 index 019740051cf..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_sshpublickey.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshPublicKey struct { - CertificateData *string `json:"certificateData,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageaccount.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageaccount.go deleted file mode 100644 index 2260b334bb5..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageaccount.go +++ /dev/null @@ -1,16 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageAccount struct { - Container *string `json:"container,omitempty"` - FileSystem *string `json:"fileSystem,omitempty"` - Fileshare *string `json:"fileshare,omitempty"` - IsDefault *bool `json:"isDefault,omitempty"` - Key *string `json:"key,omitempty"` - MsiResourceId *string `json:"msiResourceId,omitempty"` - Name *string `json:"name,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Saskey *string `json:"saskey,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageprofile.go deleted file mode 100644 index fce6f787347..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_storageprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageProfile struct { - Storageaccounts *[]StorageAccount `json:"storageaccounts,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_updateclusteridentitycertificateparameters.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_updateclusteridentitycertificateparameters.go deleted file mode 100644 index fcb56e3731f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_updateclusteridentitycertificateparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateClusterIdentityCertificateParameters struct { - ApplicationId *string `json:"applicationId,omitempty"` - Certificate *string `json:"certificate,omitempty"` - CertificatePassword *string `json:"certificatePassword,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_updategatewaysettingsparameters.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_updategatewaysettingsparameters.go deleted file mode 100644 index 21d81c01161..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_updategatewaysettingsparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateGatewaySettingsParameters struct { - RestAuthCredentialIsEnabled *bool `json:"restAuthCredential.isEnabled,omitempty"` - RestAuthCredentialPassword *string `json:"restAuthCredential.password,omitempty"` - RestAuthCredentialUsername *string `json:"restAuthCredential.username,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_virtualnetworkprofile.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/model_virtualnetworkprofile.go deleted file mode 100644 index 63f56f332d3..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/model_virtualnetworkprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkProfile struct { - Id *string `json:"id,omitempty"` - Subnet *string `json:"subnet,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/clusters/predicates.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/predicates.go deleted file mode 100644 index 2d93344a6b8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package clusters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ClusterOperationPredicate) Matches(input Cluster) 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 && (input.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/hdinsight/2018-06-01-preview/clusters/version.go b/resource-manager/hdinsight/2018-06-01-preview/clusters/version.go deleted file mode 100644 index 1f18844c128..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/clusters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/clusters/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/README.md b/resource-manager/hdinsight/2018-06-01-preview/configurations/README.md deleted file mode 100644 index 310a2f99b76..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/README.md +++ /dev/null @@ -1,66 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/configurations` Documentation - -The `configurations` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/configurations" -``` - - -### Client Initialization - -```go -client := configurations.NewConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "configurationValue") - -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: `ConfigurationsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -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: `ConfigurationsClient.Update` - -```go -ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "configurationValue") -var payload map[string]string - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/client.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/client.go deleted file mode 100644 index 3ced22d176b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package configurations - -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 ConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "configurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConfigurationsClient: %+v", err) - } - - return &ConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration.go deleted file mode 100644 index 30f4ded8d4a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration.go +++ /dev/null @@ -1,139 +0,0 @@ -package configurations - -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(&ConfigurationId{}) -} - -var _ resourceids.ResourceId = &ConfigurationId{} - -// ConfigurationId is a struct representing the Resource ID for a Configuration -type ConfigurationId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ConfigurationName string -} - -// NewConfigurationID returns a new ConfigurationId struct -func NewConfigurationID(subscriptionId string, resourceGroupName string, clusterName string, configurationName string) ConfigurationId { - return ConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ConfigurationName: configurationName, - } -} - -// ParseConfigurationID parses 'input' into a ConfigurationId -func ParseConfigurationID(input string) (*ConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConfigurationIDInsensitively parses 'input' case-insensitively into a ConfigurationId -// note: this method should only be used for API response data and not user input -func ParseConfigurationIDInsensitively(input string) (*ConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConfigurationId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ConfigurationName, ok = input.Parsed["configurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "configurationName", input) - } - - return nil -} - -// ValidateConfigurationID checks that 'input' can be parsed as a Configuration ID -func ValidateConfigurationID(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 := ParseConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Configuration ID -func (id ConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusters/%s/configurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Configuration ID -func (id ConfigurationId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), - resourceids.UserSpecifiedSegment("configurationName", "configurationValue"), - } -} - -// String returns a human-readable description of this Configuration ID -func (id ConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Configuration Name: %q", id.ConfigurationName), - } - return fmt.Sprintf("Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration_test.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration_test.go deleted file mode 100644 index 3852326d581..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/id_configuration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package configurations - -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 = &ConfigurationId{} - -func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "configurationValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ConfigurationName != "configurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationName'", id.ConfigurationName, "configurationValue") - } -} - -func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "configurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations/configurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations/configurationValue", - Expected: &ConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ConfigurationName: "configurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations/configurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ConfigurationName != v.Expected.ConfigurationName { - t.Fatalf("Expected %q but got %q for ConfigurationName", v.Expected.ConfigurationName, actual.ConfigurationName) - } - - } -} - -func TestParseConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/cOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations/configurationValue", - Expected: &ConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ConfigurationName: "configurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/configurations/configurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnVaLuE", - Expected: &ConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ConfigurationName: "cOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.hDiNsIgHt/cLuStErS/cLuStErVaLuE/cOnFiGuRaTiOnS/cOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ConfigurationName != v.Expected.ConfigurationName { - t.Fatalf("Expected %q but got %q for ConfigurationName", v.Expected.ConfigurationName, actual.ConfigurationName) - } - - } -} - -func TestSegmentsForConfigurationId(t *testing.T) { - segments := ConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConfigurationId 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/hdinsight/2018-06-01-preview/configurations/method_get.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/method_get.go deleted file mode 100644 index 9fad4c707b6..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package configurations - -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 *map[string]string -} - -// Get ... -func (c ConfigurationsClient) Get(ctx context.Context, id ConfigurationId) (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 map[string]string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/method_list.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/method_list.go deleted file mode 100644 index 03c02af9480..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package configurations - -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 *ClusterConfigurations -} - -// List ... -func (c ConfigurationsClient) List(ctx context.Context, id commonids.HDInsightClusterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/configurations", 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 ClusterConfigurations - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/method_update.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/method_update.go deleted file mode 100644 index 938f2535578..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package configurations - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Update ... -func (c ConfigurationsClient) Update(ctx context.Context, id ConfigurationId, input map[string]string) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ConfigurationsClient) UpdateThenPoll(ctx context.Context, id ConfigurationId, input map[string]string) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/model_clusterconfigurations.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/model_clusterconfigurations.go deleted file mode 100644 index d410803d0ed..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/model_clusterconfigurations.go +++ /dev/null @@ -1,8 +0,0 @@ -package configurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterConfigurations struct { - Configurations *map[string]map[string]string `json:"configurations,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/configurations/version.go b/resource-manager/hdinsight/2018-06-01-preview/configurations/version.go deleted file mode 100644 index a671fc0ce61..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/configurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package configurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/configurations/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/README.md b/resource-manager/hdinsight/2018-06-01-preview/extensions/README.md deleted file mode 100644 index 3cb2b2b72d4..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/README.md +++ /dev/null @@ -1,156 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/extensions` Documentation - -The `extensions` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/extensions" -``` - - -### Client Initialization - -```go -client := extensions.NewExtensionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExtensionsClient.Create` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "extensionValue") - -payload := extensions.Extension{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Delete` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "extensionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.DisableAzureMonitor` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DisableAzureMonitorThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.DisableMonitoring` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -if err := client.DisableMonitoringThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.EnableAzureMonitor` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := extensions.AzureMonitorRequest{ - // ... -} - - -if err := client.EnableAzureMonitorThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.EnableMonitoring` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -payload := extensions.ClusterMonitoringRequest{ - // ... -} - - -if err := client.EnableMonitoringThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Get` - -```go -ctx := context.TODO() -id := extensions.NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "extensionValue") - -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: `ExtensionsClient.GetAzureMonitorStatus` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -read, err := client.GetAzureMonitorStatus(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExtensionsClient.GetMonitoringStatus` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -read, err := client.GetMonitoringStatus(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/hdinsight/2018-06-01-preview/extensions/client.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/client.go deleted file mode 100644 index 44725ac0e84..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package extensions - -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 ExtensionsClient struct { - Client *resourcemanager.Client -} - -func NewExtensionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExtensionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "extensions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExtensionsClient: %+v", err) - } - - return &ExtensionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension.go deleted file mode 100644 index ecf63cf79f9..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension.go +++ /dev/null @@ -1,139 +0,0 @@ -package extensions - -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(&ExtensionId{}) -} - -var _ resourceids.ResourceId = &ExtensionId{} - -// ExtensionId is a struct representing the Resource ID for a Extension -type ExtensionId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ExtensionName string -} - -// NewExtensionID returns a new ExtensionId struct -func NewExtensionID(subscriptionId string, resourceGroupName string, clusterName string, extensionName string) ExtensionId { - return ExtensionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ExtensionName: extensionName, - } -} - -// ParseExtensionID parses 'input' into a ExtensionId -func ParseExtensionID(input string) (*ExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExtensionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExtensionIDInsensitively parses 'input' case-insensitively into a ExtensionId -// note: this method should only be used for API response data and not user input -func ParseExtensionIDInsensitively(input string) (*ExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExtensionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExtensionId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ExtensionName, ok = input.Parsed["extensionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "extensionName", input) - } - - return nil -} - -// ValidateExtensionID checks that 'input' can be parsed as a Extension ID -func ValidateExtensionID(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 := ParseExtensionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Extension ID -func (id ExtensionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusters/%s/extensions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ExtensionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Extension ID -func (id ExtensionId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "extensionValue"), - } -} - -// String returns a human-readable description of this Extension ID -func (id ExtensionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Extension Name: %q", id.ExtensionName), - } - return fmt.Sprintf("Extension (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension_test.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension_test.go deleted file mode 100644 index 35c92365b8a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/id_extension_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package extensions - -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 = &ExtensionId{} - -func TestNewExtensionID(t *testing.T) { - id := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "extensionValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ExtensionName != "extensionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionValue") - } -} - -func TestFormatExtensionID(t *testing.T) { - actual := NewExtensionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "extensionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions/extensionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExtensionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExtensionId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions/extensionValue", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions/extensionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExtensionID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestParseExtensionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExtensionId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/eXtEnSiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions/extensionValue", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/extensions/extensionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/eXtEnSiOnS/eXtEnSiOnVaLuE", - Expected: &ExtensionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ExtensionName: "eXtEnSiOnVaLuE", - }, - }, - { - // 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.hDiNsIgHt/cLuStErS/cLuStErVaLuE/eXtEnSiOnS/eXtEnSiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExtensionIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestSegmentsForExtensionId(t *testing.T) { - segments := ExtensionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExtensionId 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/hdinsight/2018-06-01-preview/extensions/method_create.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_create.go deleted file mode 100644 index 20f9f5e52d7..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_create.go +++ /dev/null @@ -1,74 +0,0 @@ -package extensions - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Create ... -func (c ExtensionsClient) Create(ctx context.Context, id ExtensionId, input Extension) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ExtensionsClient) CreateThenPoll(ctx context.Context, id ExtensionId, input Extension) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_delete.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_delete.go deleted file mode 100644 index 00a5692b6d4..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package extensions - -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 ExtensionsClient) Delete(ctx context.Context, id ExtensionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExtensionsClient) DeleteThenPoll(ctx context.Context, id ExtensionId) 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/hdinsight/2018-06-01-preview/extensions/method_disableazuremonitor.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_disableazuremonitor.go deleted file mode 100644 index 7ae8f89a439..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_disableazuremonitor.go +++ /dev/null @@ -1,72 +0,0 @@ -package extensions - -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 DisableAzureMonitorOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DisableAzureMonitor ... -func (c ExtensionsClient) DisableAzureMonitor(ctx context.Context, id commonids.HDInsightClusterId) (result DisableAzureMonitorOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: fmt.Sprintf("%s/extensions/azureMonitor", 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 -} - -// DisableAzureMonitorThenPoll performs DisableAzureMonitor then polls until it's completed -func (c ExtensionsClient) DisableAzureMonitorThenPoll(ctx context.Context, id commonids.HDInsightClusterId) error { - result, err := c.DisableAzureMonitor(ctx, id) - if err != nil { - return fmt.Errorf("performing DisableAzureMonitor: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DisableAzureMonitor: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_disablemonitoring.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_disablemonitoring.go deleted file mode 100644 index 60458f0d4bb..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_disablemonitoring.go +++ /dev/null @@ -1,72 +0,0 @@ -package extensions - -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 DisableMonitoringOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DisableMonitoring ... -func (c ExtensionsClient) DisableMonitoring(ctx context.Context, id commonids.HDInsightClusterId) (result DisableMonitoringOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: fmt.Sprintf("%s/extensions/clustermonitoring", 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 -} - -// DisableMonitoringThenPoll performs DisableMonitoring then polls until it's completed -func (c ExtensionsClient) DisableMonitoringThenPoll(ctx context.Context, id commonids.HDInsightClusterId) error { - result, err := c.DisableMonitoring(ctx, id) - if err != nil { - return fmt.Errorf("performing DisableMonitoring: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DisableMonitoring: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_enableazuremonitor.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_enableazuremonitor.go deleted file mode 100644 index ec8e372ed9a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_enableazuremonitor.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 EnableAzureMonitorOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// EnableAzureMonitor ... -func (c ExtensionsClient) EnableAzureMonitor(ctx context.Context, id commonids.HDInsightClusterId, input AzureMonitorRequest) (result EnableAzureMonitorOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/extensions/azureMonitor", 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 -} - -// EnableAzureMonitorThenPoll performs EnableAzureMonitor then polls until it's completed -func (c ExtensionsClient) EnableAzureMonitorThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input AzureMonitorRequest) error { - result, err := c.EnableAzureMonitor(ctx, id, input) - if err != nil { - return fmt.Errorf("performing EnableAzureMonitor: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after EnableAzureMonitor: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_enablemonitoring.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_enablemonitoring.go deleted file mode 100644 index 15c39af83b1..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_enablemonitoring.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 EnableMonitoringOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// EnableMonitoring ... -func (c ExtensionsClient) EnableMonitoring(ctx context.Context, id commonids.HDInsightClusterId, input ClusterMonitoringRequest) (result EnableMonitoringOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/extensions/clustermonitoring", 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 -} - -// EnableMonitoringThenPoll performs EnableMonitoring then polls until it's completed -func (c ExtensionsClient) EnableMonitoringThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input ClusterMonitoringRequest) error { - result, err := c.EnableMonitoring(ctx, id, input) - if err != nil { - return fmt.Errorf("performing EnableMonitoring: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after EnableMonitoring: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_get.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_get.go deleted file mode 100644 index 6fea38894ed..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package extensions - -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 *ClusterMonitoringResponse -} - -// Get ... -func (c ExtensionsClient) Get(ctx context.Context, id ExtensionId) (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 ClusterMonitoringResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_getazuremonitorstatus.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_getazuremonitorstatus.go deleted file mode 100644 index f034befb9f2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_getazuremonitorstatus.go +++ /dev/null @@ -1,56 +0,0 @@ -package extensions - -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 GetAzureMonitorStatusOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AzureMonitorResponse -} - -// GetAzureMonitorStatus ... -func (c ExtensionsClient) GetAzureMonitorStatus(ctx context.Context, id commonids.HDInsightClusterId) (result GetAzureMonitorStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extensions/azureMonitor", 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 AzureMonitorResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_getmonitoringstatus.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/method_getmonitoringstatus.go deleted file mode 100644 index 01c294bb17b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/method_getmonitoringstatus.go +++ /dev/null @@ -1,56 +0,0 @@ -package extensions - -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 GetMonitoringStatusOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ClusterMonitoringResponse -} - -// GetMonitoringStatus ... -func (c ExtensionsClient) GetMonitoringStatus(ctx context.Context, id commonids.HDInsightClusterId) (result GetMonitoringStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extensions/clustermonitoring", 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 ClusterMonitoringResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorrequest.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorrequest.go deleted file mode 100644 index 45e6c1a81fc..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorrequest.go +++ /dev/null @@ -1,10 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorRequest struct { - PrimaryKey *string `json:"primaryKey,omitempty"` - SelectedConfigurations *AzureMonitorSelectedConfigurations `json:"selectedConfigurations,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorresponse.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorresponse.go deleted file mode 100644 index a15dcfaec7e..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorresponse.go +++ /dev/null @@ -1,10 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorResponse struct { - ClusterMonitoringEnabled *bool `json:"clusterMonitoringEnabled,omitempty"` - SelectedConfigurations *AzureMonitorSelectedConfigurations `json:"selectedConfigurations,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorselectedconfigurations.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorselectedconfigurations.go deleted file mode 100644 index 3b756232619..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitorselectedconfigurations.go +++ /dev/null @@ -1,10 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorSelectedConfigurations struct { - ConfigurationVersion *string `json:"configurationVersion,omitempty"` - GlobalConfigurations *map[string]string `json:"globalConfigurations,omitempty"` - TableList *[]AzureMonitorTableConfiguration `json:"tableList,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitortableconfiguration.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitortableconfiguration.go deleted file mode 100644 index eb225e60015..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_azuremonitortableconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorTableConfiguration struct { - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringrequest.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringrequest.go deleted file mode 100644 index 053229915b6..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterMonitoringRequest struct { - PrimaryKey *string `json:"primaryKey,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringresponse.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringresponse.go deleted file mode 100644 index b147640546c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_clustermonitoringresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterMonitoringResponse struct { - ClusterMonitoringEnabled *bool `json:"clusterMonitoringEnabled,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_extension.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/model_extension.go deleted file mode 100644 index 408a49c93c5..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/model_extension.go +++ /dev/null @@ -1,9 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Extension struct { - PrimaryKey *string `json:"primaryKey,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/extensions/version.go b/resource-manager/hdinsight/2018-06-01-preview/extensions/version.go deleted file mode 100644 index b378ae43cbe..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/extensions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/extensions/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/promote/client.go b/resource-manager/hdinsight/2018-06-01-preview/promote/client.go deleted file mode 100644 index 1b9c9beb2ac..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/promote/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package promote - -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 PromoteClient struct { - Client *resourcemanager.Client -} - -func NewPromoteClientWithBaseURI(sdkApi sdkEnv.Api) (*PromoteClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "promote", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PromoteClient: %+v", err) - } - - return &PromoteClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory.go b/resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory.go deleted file mode 100644 index c1311218fc5..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory.go +++ /dev/null @@ -1,139 +0,0 @@ -package promote - -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(&ScriptExecutionHistoryId{}) -} - -var _ resourceids.ResourceId = &ScriptExecutionHistoryId{} - -// ScriptExecutionHistoryId is a struct representing the Resource ID for a Script Execution History -type ScriptExecutionHistoryId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ScriptExecutionId string -} - -// NewScriptExecutionHistoryID returns a new ScriptExecutionHistoryId struct -func NewScriptExecutionHistoryID(subscriptionId string, resourceGroupName string, clusterName string, scriptExecutionId string) ScriptExecutionHistoryId { - return ScriptExecutionHistoryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ScriptExecutionId: scriptExecutionId, - } -} - -// ParseScriptExecutionHistoryID parses 'input' into a ScriptExecutionHistoryId -func ParseScriptExecutionHistoryID(input string) (*ScriptExecutionHistoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScriptExecutionHistoryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScriptExecutionHistoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScriptExecutionHistoryIDInsensitively parses 'input' case-insensitively into a ScriptExecutionHistoryId -// note: this method should only be used for API response data and not user input -func ParseScriptExecutionHistoryIDInsensitively(input string) (*ScriptExecutionHistoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScriptExecutionHistoryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScriptExecutionHistoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScriptExecutionHistoryId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ScriptExecutionId, ok = input.Parsed["scriptExecutionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scriptExecutionId", input) - } - - return nil -} - -// ValidateScriptExecutionHistoryID checks that 'input' can be parsed as a Script Execution History ID -func ValidateScriptExecutionHistoryID(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 := ParseScriptExecutionHistoryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Script Execution History ID -func (id ScriptExecutionHistoryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusters/%s/scriptExecutionHistory/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ScriptExecutionId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Script Execution History ID -func (id ScriptExecutionHistoryId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticScriptExecutionHistory", "scriptExecutionHistory", "scriptExecutionHistory"), - resourceids.UserSpecifiedSegment("scriptExecutionId", "scriptExecutionIdValue"), - } -} - -// String returns a human-readable description of this Script Execution History ID -func (id ScriptExecutionHistoryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Script Execution: %q", id.ScriptExecutionId), - } - return fmt.Sprintf("Script Execution History (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory_test.go b/resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory_test.go deleted file mode 100644 index 37a7f038660..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/promote/id_scriptexecutionhistory_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package promote - -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 = &ScriptExecutionHistoryId{} - -func TestNewScriptExecutionHistoryID(t *testing.T) { - id := NewScriptExecutionHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptExecutionIdValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ScriptExecutionId != "scriptExecutionIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScriptExecutionId'", id.ScriptExecutionId, "scriptExecutionIdValue") - } -} - -func TestFormatScriptExecutionHistoryID(t *testing.T) { - actual := NewScriptExecutionHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptExecutionIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScriptExecutionHistoryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScriptExecutionHistoryId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue", - Expected: &ScriptExecutionHistoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ScriptExecutionId: "scriptExecutionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScriptExecutionHistoryID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ScriptExecutionId != v.Expected.ScriptExecutionId { - t.Fatalf("Expected %q but got %q for ScriptExecutionId", v.Expected.ScriptExecutionId, actual.ScriptExecutionId) - } - - } -} - -func TestParseScriptExecutionHistoryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScriptExecutionHistoryId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTeXeCuTiOnHiStOrY", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue", - Expected: &ScriptExecutionHistoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ScriptExecutionId: "scriptExecutionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTeXeCuTiOnHiStOrY/sCrIpTeXeCuTiOnIdVaLuE", - Expected: &ScriptExecutionHistoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ScriptExecutionId: "sCrIpTeXeCuTiOnIdVaLuE", - }, - }, - { - // 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.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTeXeCuTiOnHiStOrY/sCrIpTeXeCuTiOnIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScriptExecutionHistoryIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ScriptExecutionId != v.Expected.ScriptExecutionId { - t.Fatalf("Expected %q but got %q for ScriptExecutionId", v.Expected.ScriptExecutionId, actual.ScriptExecutionId) - } - - } -} - -func TestSegmentsForScriptExecutionHistoryId(t *testing.T) { - segments := ScriptExecutionHistoryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScriptExecutionHistoryId 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/hdinsight/2018-06-01-preview/promote/method_scriptexecutionhistorypromote.go b/resource-manager/hdinsight/2018-06-01-preview/promote/method_scriptexecutionhistorypromote.go deleted file mode 100644 index 4956b7d05e9..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/promote/method_scriptexecutionhistorypromote.go +++ /dev/null @@ -1,47 +0,0 @@ -package promote - -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 ScriptExecutionHistoryPromoteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// ScriptExecutionHistoryPromote ... -func (c PromoteClient) ScriptExecutionHistoryPromote(ctx context.Context, id ScriptExecutionHistoryId) (result ScriptExecutionHistoryPromoteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/promote", 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/hdinsight/2018-06-01-preview/promote/version.go b/resource-manager/hdinsight/2018-06-01-preview/promote/version.go deleted file mode 100644 index e21a70e93be..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/promote/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package promote - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/promote/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/README.md b/resource-manager/hdinsight/2018-06-01-preview/regions/README.md deleted file mode 100644 index 1ca132cad6a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/README.md +++ /dev/null @@ -1,110 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/regions` Documentation - -The `regions` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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/hdinsight/2018-06-01-preview/regions" -``` - - -### Client Initialization - -```go -client := regions.NewRegionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RegionsClient.LocationsCheckNameAvailability` - -```go -ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := regions.NameAvailabilityCheckRequestParameters{ - // ... -} - - -read, err := client.LocationsCheckNameAvailability(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegionsClient.LocationsGetCapabilities` - -```go -ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.LocationsGetCapabilities(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegionsClient.LocationsListBillingSpecs` - -```go -ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.LocationsListBillingSpecs(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegionsClient.LocationsListUsages` - -```go -ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.LocationsListUsages(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RegionsClient.LocationsValidateClusterCreateRequest` - -```go -ctx := context.TODO() -id := regions.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := regions.ClusterCreateRequestValidationParameters{ - // ... -} - - -read, err := client.LocationsValidateClusterCreateRequest(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/hdinsight/2018-06-01-preview/regions/client.go b/resource-manager/hdinsight/2018-06-01-preview/regions/client.go deleted file mode 100644 index cf8027ad9e1..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package regions - -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 RegionsClient struct { - Client *resourcemanager.Client -} - -func NewRegionsClientWithBaseURI(sdkApi sdkEnv.Api) (*RegionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "regions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RegionsClient: %+v", err) - } - - return &RegionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/constants.go b/resource-manager/hdinsight/2018-06-01-preview/regions/constants.go deleted file mode 100644 index 49c3269cd5a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/constants.go +++ /dev/null @@ -1,359 +0,0 @@ -package regions - -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 DaysOfWeek string - -const ( - DaysOfWeekFriday DaysOfWeek = "Friday" - DaysOfWeekMonday DaysOfWeek = "Monday" - DaysOfWeekSaturday DaysOfWeek = "Saturday" - DaysOfWeekSunday DaysOfWeek = "Sunday" - DaysOfWeekThursday DaysOfWeek = "Thursday" - DaysOfWeekTuesday DaysOfWeek = "Tuesday" - DaysOfWeekWednesday DaysOfWeek = "Wednesday" -) - -func PossibleValuesForDaysOfWeek() []string { - return []string{ - string(DaysOfWeekFriday), - string(DaysOfWeekMonday), - string(DaysOfWeekSaturday), - string(DaysOfWeekSunday), - string(DaysOfWeekThursday), - string(DaysOfWeekTuesday), - string(DaysOfWeekWednesday), - } -} - -func (s *DaysOfWeek) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDaysOfWeek(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDaysOfWeek(input string) (*DaysOfWeek, error) { - vals := map[string]DaysOfWeek{ - "friday": DaysOfWeekFriday, - "monday": DaysOfWeekMonday, - "saturday": DaysOfWeekSaturday, - "sunday": DaysOfWeekSunday, - "thursday": DaysOfWeekThursday, - "tuesday": DaysOfWeekTuesday, - "wednesday": DaysOfWeekWednesday, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DaysOfWeek(input) - return &out, nil -} - -type DirectoryType string - -const ( - DirectoryTypeActiveDirectory DirectoryType = "ActiveDirectory" -) - -func PossibleValuesForDirectoryType() []string { - return []string{ - string(DirectoryTypeActiveDirectory), - } -} - -func (s *DirectoryType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDirectoryType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDirectoryType(input string) (*DirectoryType, error) { - vals := map[string]DirectoryType{ - "activedirectory": DirectoryTypeActiveDirectory, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DirectoryType(input) - return &out, nil -} - -type FilterMode string - -const ( - FilterModeDefault FilterMode = "Default" - FilterModeExclude FilterMode = "Exclude" - FilterModeInclude FilterMode = "Include" - FilterModeRecommend FilterMode = "Recommend" -) - -func PossibleValuesForFilterMode() []string { - return []string{ - string(FilterModeDefault), - string(FilterModeExclude), - string(FilterModeInclude), - string(FilterModeRecommend), - } -} - -func (s *FilterMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFilterMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFilterMode(input string) (*FilterMode, error) { - vals := map[string]FilterMode{ - "default": FilterModeDefault, - "exclude": FilterModeExclude, - "include": FilterModeInclude, - "recommend": FilterModeRecommend, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FilterMode(input) - return &out, nil -} - -type JsonWebKeyEncryptionAlgorithm string - -const ( - JsonWebKeyEncryptionAlgorithmRSANegativeOAEP JsonWebKeyEncryptionAlgorithm = "RSA-OAEP" - JsonWebKeyEncryptionAlgorithmRSANegativeOAEPNegativeTwoFiveSix JsonWebKeyEncryptionAlgorithm = "RSA-OAEP-256" - JsonWebKeyEncryptionAlgorithmRSAOneFive JsonWebKeyEncryptionAlgorithm = "RSA1_5" -) - -func PossibleValuesForJsonWebKeyEncryptionAlgorithm() []string { - return []string{ - string(JsonWebKeyEncryptionAlgorithmRSANegativeOAEP), - string(JsonWebKeyEncryptionAlgorithmRSANegativeOAEPNegativeTwoFiveSix), - string(JsonWebKeyEncryptionAlgorithmRSAOneFive), - } -} - -func (s *JsonWebKeyEncryptionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseJsonWebKeyEncryptionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseJsonWebKeyEncryptionAlgorithm(input string) (*JsonWebKeyEncryptionAlgorithm, error) { - vals := map[string]JsonWebKeyEncryptionAlgorithm{ - "rsa-oaep": JsonWebKeyEncryptionAlgorithmRSANegativeOAEP, - "rsa-oaep-256": JsonWebKeyEncryptionAlgorithmRSANegativeOAEPNegativeTwoFiveSix, - "rsa1_5": JsonWebKeyEncryptionAlgorithmRSAOneFive, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := JsonWebKeyEncryptionAlgorithm(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 PrivateLink string - -const ( - PrivateLinkDisabled PrivateLink = "Disabled" - PrivateLinkEnabled PrivateLink = "Enabled" -) - -func PossibleValuesForPrivateLink() []string { - return []string{ - string(PrivateLinkDisabled), - string(PrivateLinkEnabled), - } -} - -func (s *PrivateLink) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateLink(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateLink(input string) (*PrivateLink, error) { - vals := map[string]PrivateLink{ - "disabled": PrivateLinkDisabled, - "enabled": PrivateLinkEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateLink(input) - return &out, nil -} - -type ResourceProviderConnection string - -const ( - ResourceProviderConnectionInbound ResourceProviderConnection = "Inbound" - ResourceProviderConnectionOutbound ResourceProviderConnection = "Outbound" -) - -func PossibleValuesForResourceProviderConnection() []string { - return []string{ - string(ResourceProviderConnectionInbound), - string(ResourceProviderConnectionOutbound), - } -} - -func (s *ResourceProviderConnection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceProviderConnection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceProviderConnection(input string) (*ResourceProviderConnection, error) { - vals := map[string]ResourceProviderConnection{ - "inbound": ResourceProviderConnectionInbound, - "outbound": ResourceProviderConnectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceProviderConnection(input) - return &out, nil -} - -type Tier string - -const ( - TierPremium Tier = "Premium" - TierStandard Tier = "Standard" -) - -func PossibleValuesForTier() []string { - return []string{ - string(TierPremium), - string(TierStandard), - } -} - -func (s *Tier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTier(input string) (*Tier, error) { - vals := map[string]Tier{ - "premium": TierPremium, - "standard": TierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Tier(input) - return &out, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/id_location.go b/resource-manager/hdinsight/2018-06-01-preview/regions/id_location.go deleted file mode 100644 index b33830b248b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package regions - -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.HDInsight/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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/hdinsight/2018-06-01-preview/regions/id_location_test.go b/resource-manager/hdinsight/2018-06-01-preview/regions/id_location_test.go deleted file mode 100644 index cd77d0f503c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package regions - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue" - 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue/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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoNvAlUe/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/hdinsight/2018-06-01-preview/regions/method_locationsgetcapabilities.go b/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsgetcapabilities.go deleted file mode 100644 index 13b192e5582..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsgetcapabilities.go +++ /dev/null @@ -1,55 +0,0 @@ -package regions - -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 LocationsGetCapabilitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CapabilitiesResult -} - -// LocationsGetCapabilities ... -func (c RegionsClient) LocationsGetCapabilities(ctx context.Context, id LocationId) (result LocationsGetCapabilitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/capabilities", 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 CapabilitiesResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistbillingspecs.go b/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistbillingspecs.go deleted file mode 100644 index d5f73e16183..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistbillingspecs.go +++ /dev/null @@ -1,55 +0,0 @@ -package regions - -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 LocationsListBillingSpecsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BillingResponseListResult -} - -// LocationsListBillingSpecs ... -func (c RegionsClient) LocationsListBillingSpecs(ctx context.Context, id LocationId) (result LocationsListBillingSpecsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/billingSpecs", 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 BillingResponseListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistusages.go b/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistusages.go deleted file mode 100644 index d731ee1fe6b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationslistusages.go +++ /dev/null @@ -1,55 +0,0 @@ -package regions - -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 LocationsListUsagesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *UsagesListResult -} - -// LocationsListUsages ... -func (c RegionsClient) LocationsListUsages(ctx context.Context, id LocationId) (result LocationsListUsagesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 UsagesListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsvalidateclustercreaterequest.go b/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsvalidateclustercreaterequest.go deleted file mode 100644 index b39422afc5b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationsvalidateclustercreaterequest.go +++ /dev/null @@ -1,59 +0,0 @@ -package regions - -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 LocationsValidateClusterCreateRequestOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ClusterCreateValidationResult -} - -// LocationsValidateClusterCreateRequest ... -func (c RegionsClient) LocationsValidateClusterCreateRequest(ctx context.Context, id LocationId, input ClusterCreateRequestValidationParameters) (result LocationsValidateClusterCreateRequestOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/validateCreateRequest", 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 ClusterCreateValidationResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_aaddsresourcedetails.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_aaddsresourcedetails.go deleted file mode 100644 index 8bceaed05d8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_aaddsresourcedetails.go +++ /dev/null @@ -1,14 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AaddsResourceDetails struct { - DomainName *string `json:"domainName,omitempty"` - InitialSyncComplete *bool `json:"initialSyncComplete,omitempty"` - LdapsEnabled *bool `json:"ldapsEnabled,omitempty"` - LdapsPublicCertificateInBase64 *string `json:"ldapsPublicCertificateInBase64,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscale.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscale.go deleted file mode 100644 index a89a4e971f2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscale.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Autoscale struct { - Capacity *AutoscaleCapacity `json:"capacity,omitempty"` - Recurrence *AutoscaleRecurrence `json:"recurrence,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalecapacity.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalecapacity.go deleted file mode 100644 index f7648191ddb..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalecapacity.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleCapacity struct { - MaxInstanceCount *int64 `json:"maxInstanceCount,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalerecurrence.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalerecurrence.go deleted file mode 100644 index f1a9d3cec7d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscalerecurrence.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleRecurrence struct { - Schedule *[]AutoscaleSchedule `json:"schedule,omitempty"` - TimeZone *string `json:"timeZone,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaleschedule.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaleschedule.go deleted file mode 100644 index 29bab5d2002..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaleschedule.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleSchedule struct { - Days *[]DaysOfWeek `json:"days,omitempty"` - TimeAndCapacity *AutoscaleTimeAndCapacity `json:"timeAndCapacity,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaletimeandcapacity.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaletimeandcapacity.go deleted file mode 100644 index 49884509a49..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_autoscaletimeandcapacity.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoscaleTimeAndCapacity struct { - MaxInstanceCount *int64 `json:"maxInstanceCount,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` - Time *string `json:"time,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingmeters.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingmeters.go deleted file mode 100644 index 55c13e12d56..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingmeters.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BillingMeters struct { - Meter *string `json:"meter,omitempty"` - MeterParameter *string `json:"meterParameter,omitempty"` - Unit *string `json:"unit,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresources.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresources.go deleted file mode 100644 index 06f4682db43..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresources.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BillingResources struct { - BillingMeters *[]BillingMeters `json:"billingMeters,omitempty"` - DiskBillingMeters *[]DiskBillingMeters `json:"diskBillingMeters,omitempty"` - Region *string `json:"region,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresponselistresult.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresponselistresult.go deleted file mode 100644 index 16c70f07da3..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_billingresponselistresult.go +++ /dev/null @@ -1,12 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BillingResponseListResult struct { - BillingResources *[]BillingResources `json:"billingResources,omitempty"` - VMSizeFilters *[]VMSizeCompatibilityFilterV2 `json:"vmSizeFilters,omitempty"` - VMSizeProperties *[]VMSizeProperty `json:"vmSizeProperties,omitempty"` - VMSizes *[]string `json:"vmSizes,omitempty"` - VMSizesWithEncryptionAtHost *[]string `json:"vmSizesWithEncryptionAtHost,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_capabilitiesresult.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_capabilitiesresult.go deleted file mode 100644 index 3bf3a28f8b8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_capabilitiesresult.go +++ /dev/null @@ -1,13 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResult struct { - Features *[]string `json:"features,omitempty"` - Quota *QuotaCapability `json:"quota,omitempty"` - Regions *map[string]RegionsCapability `json:"regions,omitempty"` - VMsizeFilters *[]VMSizeCompatibilityFilter `json:"vmsize_filters,omitempty"` - VMsizes *map[string]VMSizesCapability `json:"vmsizes,omitempty"` - Versions *map[string]VersionsCapability `json:"versions,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clientgroupinfo.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_clientgroupinfo.go deleted file mode 100644 index a0efa3df3ce..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clientgroupinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientGroupInfo struct { - GroupId *string `json:"groupId,omitempty"` - GroupName *string `json:"groupName,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreateproperties.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreateproperties.go deleted file mode 100644 index fbfb58c517b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreateproperties.go +++ /dev/null @@ -1,20 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterCreateProperties struct { - ClusterDefinition *ClusterDefinition `json:"clusterDefinition,omitempty"` - ClusterVersion *string `json:"clusterVersion,omitempty"` - ComputeIsolationProperties *ComputeIsolationProperties `json:"computeIsolationProperties,omitempty"` - ComputeProfile *ComputeProfile `json:"computeProfile,omitempty"` - DiskEncryptionProperties *DiskEncryptionProperties `json:"diskEncryptionProperties,omitempty"` - EncryptionInTransitProperties *EncryptionInTransitProperties `json:"encryptionInTransitProperties,omitempty"` - KafkaRestProperties *KafkaRestProperties `json:"kafkaRestProperties,omitempty"` - MinSupportedTlsVersion *string `json:"minSupportedTlsVersion,omitempty"` - NetworkProperties *NetworkProperties `json:"networkProperties,omitempty"` - OsType *OSType `json:"osType,omitempty"` - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - StorageProfile *StorageProfile `json:"storageProfile,omitempty"` - Tier *Tier `json:"tier,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreaterequestvalidationparameters.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreaterequestvalidationparameters.go deleted file mode 100644 index d264d1410fd..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreaterequestvalidationparameters.go +++ /dev/null @@ -1,19 +0,0 @@ -package regions - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterCreateRequestValidationParameters struct { - FetchAaddsResource *bool `json:"fetchAaddsResource,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ClusterCreateProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - TenantId *string `json:"tenantId,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreatevalidationresult.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreatevalidationresult.go deleted file mode 100644 index 356f300fc31..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clustercreatevalidationresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterCreateValidationResult struct { - AaddsResourcesDetails *[]AaddsResourceDetails `json:"aaddsResourcesDetails,omitempty"` - EstimatedCreationDuration *string `json:"estimatedCreationDuration,omitempty"` - ValidationErrors *[]ValidationErrorInfo `json:"validationErrors,omitempty"` - ValidationWarnings *[]ValidationErrorInfo `json:"validationWarnings,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clusterdefinition.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_clusterdefinition.go deleted file mode 100644 index 38ffae5b83f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_clusterdefinition.go +++ /dev/null @@ -1,11 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClusterDefinition struct { - Blueprint *string `json:"blueprint,omitempty"` - ComponentVersion *map[string]string `json:"componentVersion,omitempty"` - Configurations *interface{} `json:"configurations,omitempty"` - Kind *string `json:"kind,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_computeisolationproperties.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_computeisolationproperties.go deleted file mode 100644 index 3a68e876bbc..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_computeisolationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComputeIsolationProperties struct { - EnableComputeIsolation *bool `json:"enableComputeIsolation,omitempty"` - HostSku *string `json:"hostSku,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_computeprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_computeprofile.go deleted file mode 100644 index 48fd3cd3ab4..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_computeprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComputeProfile struct { - Roles *[]Role `json:"roles,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_datadisksgroups.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_datadisksgroups.go deleted file mode 100644 index 3f9de6dc15c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_datadisksgroups.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataDisksGroups struct { - DiskSizeGB *int64 `json:"diskSizeGB,omitempty"` - DisksPerNode *int64 `json:"disksPerNode,omitempty"` - StorageAccountType *string `json:"storageAccountType,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_diskbillingmeters.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_diskbillingmeters.go deleted file mode 100644 index e785d25ea18..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_diskbillingmeters.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskBillingMeters struct { - DiskRpMeter *string `json:"diskRpMeter,omitempty"` - Sku *string `json:"sku,omitempty"` - Tier *Tier `json:"tier,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_diskencryptionproperties.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_diskencryptionproperties.go deleted file mode 100644 index 00fa49af5fe..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_diskencryptionproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskEncryptionProperties struct { - EncryptionAlgorithm *JsonWebKeyEncryptionAlgorithm `json:"encryptionAlgorithm,omitempty"` - EncryptionAtHost *bool `json:"encryptionAtHost,omitempty"` - KeyName *string `json:"keyName,omitempty"` - KeyVersion *string `json:"keyVersion,omitempty"` - MsiResourceId *string `json:"msiResourceId,omitempty"` - VaultUri *string `json:"vaultUri,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_encryptionintransitproperties.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_encryptionintransitproperties.go deleted file mode 100644 index 2238c23eecb..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_encryptionintransitproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionInTransitProperties struct { - IsEncryptionInTransitEnabled *bool `json:"isEncryptionInTransitEnabled,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_hardwareprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_hardwareprofile.go deleted file mode 100644 index f63e9bd2de2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_hardwareprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HardwareProfile struct { - VMSize *string `json:"vmSize,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_kafkarestproperties.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_kafkarestproperties.go deleted file mode 100644 index 20631521dc3..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_kafkarestproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KafkaRestProperties struct { - ClientGroupInfo *ClientGroupInfo `json:"clientGroupInfo,omitempty"` - ConfigurationOverride *map[string]string `json:"configurationOverride,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_linuxoperatingsystemprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_linuxoperatingsystemprofile.go deleted file mode 100644 index d7805b5eb65..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_linuxoperatingsystemprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LinuxOperatingSystemProfile struct { - Password *string `json:"password,omitempty"` - SshProfile *SshProfile `json:"sshProfile,omitempty"` - Username *string `json:"username,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_localizedname.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_localizedname.go deleted file mode 100644 index f3bf93bbe83..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_localizedname.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalizedName struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckrequestparameters.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckrequestparameters.go deleted file mode 100644 index 22b7acd2243..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckrequestparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameAvailabilityCheckRequestParameters struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckresult.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckresult.go deleted file mode 100644 index d857e48a188..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_nameavailabilitycheckresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameAvailabilityCheckResult struct { - Message *string `json:"message,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason *string `json:"reason,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_networkproperties.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_networkproperties.go deleted file mode 100644 index 456bc6fce80..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_networkproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProperties struct { - PrivateLink *PrivateLink `json:"privateLink,omitempty"` - ResourceProviderConnection *ResourceProviderConnection `json:"resourceProviderConnection,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_osprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_osprofile.go deleted file mode 100644 index d076d902557..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_osprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OsProfile struct { - LinuxOperatingSystemProfile *LinuxOperatingSystemProfile `json:"linuxOperatingSystemProfile,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_quotacapability.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_quotacapability.go deleted file mode 100644 index 912d428aec0..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_quotacapability.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QuotaCapability struct { - CoresUsed *int64 `json:"cores_used,omitempty"` - MaxCoresAllowed *int64 `json:"max_cores_allowed,omitempty"` - RegionalQuotas *[]RegionalQuotaCapability `json:"regionalQuotas,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_regionalquotacapability.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_regionalquotacapability.go deleted file mode 100644 index 2db640f164c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_regionalquotacapability.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegionalQuotaCapability struct { - CoresAvailable *int64 `json:"cores_available,omitempty"` - CoresUsed *int64 `json:"cores_used,omitempty"` - RegionName *string `json:"region_name,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_regionscapability.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_regionscapability.go deleted file mode 100644 index a1b1b58a610..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_regionscapability.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegionsCapability struct { - Available *[]string `json:"available,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_role.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_role.go deleted file mode 100644 index 7ca54a82c98..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_role.go +++ /dev/null @@ -1,18 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Role struct { - Autoscale *Autoscale `json:"autoscale,omitempty"` - DataDisksGroups *[]DataDisksGroups `json:"dataDisksGroups,omitempty"` - EncryptDataDisks *bool `json:"encryptDataDisks,omitempty"` - HardwareProfile *HardwareProfile `json:"hardwareProfile,omitempty"` - MinInstanceCount *int64 `json:"minInstanceCount,omitempty"` - Name *string `json:"name,omitempty"` - OsProfile *OsProfile `json:"osProfile,omitempty"` - ScriptActions *[]ScriptAction `json:"scriptActions,omitempty"` - TargetInstanceCount *int64 `json:"targetInstanceCount,omitempty"` - VMGroupName *string `json:"VMGroupName,omitempty"` - VirtualNetworkProfile *VirtualNetworkProfile `json:"virtualNetworkProfile,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_scriptaction.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_scriptaction.go deleted file mode 100644 index 5d8122012ca..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_scriptaction.go +++ /dev/null @@ -1,10 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScriptAction struct { - Name string `json:"name"` - Parameters string `json:"parameters"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_securityprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_securityprofile.go deleted file mode 100644 index d744d3f8c91..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_securityprofile.go +++ /dev/null @@ -1,16 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityProfile struct { - AaddsResourceId *string `json:"aaddsResourceId,omitempty"` - ClusterUsersGroupDNs *[]string `json:"clusterUsersGroupDNs,omitempty"` - DirectoryType *DirectoryType `json:"directoryType,omitempty"` - Domain *string `json:"domain,omitempty"` - DomainUserPassword *string `json:"domainUserPassword,omitempty"` - DomainUsername *string `json:"domainUsername,omitempty"` - LdapsUrls *[]string `json:"ldapsUrls,omitempty"` - MsiResourceId *string `json:"msiResourceId,omitempty"` - OrganizationalUnitDN *string `json:"organizationalUnitDN,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_sshprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_sshprofile.go deleted file mode 100644 index 72f9736b47e..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_sshprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshProfile struct { - PublicKeys *[]SshPublicKey `json:"publicKeys,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_sshpublickey.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_sshpublickey.go deleted file mode 100644 index de1f8eff402..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_sshpublickey.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SshPublicKey struct { - CertificateData *string `json:"certificateData,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_storageaccount.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_storageaccount.go deleted file mode 100644 index 87c0c472364..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_storageaccount.go +++ /dev/null @@ -1,16 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageAccount struct { - Container *string `json:"container,omitempty"` - FileSystem *string `json:"fileSystem,omitempty"` - Fileshare *string `json:"fileshare,omitempty"` - IsDefault *bool `json:"isDefault,omitempty"` - Key *string `json:"key,omitempty"` - MsiResourceId *string `json:"msiResourceId,omitempty"` - Name *string `json:"name,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Saskey *string `json:"saskey,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_storageprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_storageprofile.go deleted file mode 100644 index 13a2dc19a01..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_storageprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageProfile struct { - Storageaccounts *[]StorageAccount `json:"storageaccounts,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_usage.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_usage.go deleted file mode 100644 index 86aaf243426..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_usage.go +++ /dev/null @@ -1,11 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Usage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *LocalizedName `json:"name,omitempty"` - Unit *string `json:"unit,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_usageslistresult.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_usageslistresult.go deleted file mode 100644 index a15d01276b8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_usageslistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UsagesListResult struct { - Value *[]Usage `json:"value,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_validationerrorinfo.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_validationerrorinfo.go deleted file mode 100644 index 9e2bae7dd28..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_validationerrorinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ValidationErrorInfo struct { - Code *string `json:"code,omitempty"` - ErrorResource *string `json:"errorResource,omitempty"` - Message *string `json:"message,omitempty"` - MessageArguments *[]string `json:"messageArguments,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_versionscapability.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_versionscapability.go deleted file mode 100644 index 1f7b452a36c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_versionscapability.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VersionsCapability struct { - Available *[]VersionSpec `json:"available,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_versionspec.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_versionspec.go deleted file mode 100644 index 76bcea4c2ad..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_versionspec.go +++ /dev/null @@ -1,11 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VersionSpec struct { - ComponentVersions *map[string]string `json:"componentVersions,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IsDefault *bool `json:"isDefault,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_virtualnetworkprofile.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_virtualnetworkprofile.go deleted file mode 100644 index fc09df754c1..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_virtualnetworkprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkProfile struct { - Id *string `json:"id,omitempty"` - Subnet *string `json:"subnet,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilter.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilter.go deleted file mode 100644 index 7b93b528aaa..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilter.go +++ /dev/null @@ -1,16 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VMSizeCompatibilityFilter struct { - ClusterFlavors *[]string `json:"ClusterFlavors,omitempty"` - ClusterVersions *[]string `json:"ClusterVersions,omitempty"` - ComputeIsolationSupported *string `json:"ComputeIsolationSupported,omitempty"` - ESPApplied *string `json:"ESPApplied,omitempty"` - FilterMode *string `json:"FilterMode,omitempty"` - NodeTypes *[]string `json:"NodeTypes,omitempty"` - OsType *[]string `json:"OsType,omitempty"` - Regions *[]string `json:"Regions,omitempty"` - VMSizes *[]string `json:"VMSizes,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilterv2.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilterv2.go deleted file mode 100644 index 6156bdf348f..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizecompatibilityfilterv2.go +++ /dev/null @@ -1,14 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VMSizeCompatibilityFilterV2 struct { - ClusterFlavors *[]string `json:"clusterFlavors,omitempty"` - ClusterVersions *[]string `json:"clusterVersions,omitempty"` - FilterMode *FilterMode `json:"filterMode,omitempty"` - NodeTypes *[]string `json:"nodeTypes,omitempty"` - OsType *[]OSType `json:"osType,omitempty"` - Regions *[]string `json:"regions,omitempty"` - VMSizes *[]string `json:"vmSizes,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizeproperty.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizeproperty.go deleted file mode 100644 index 6973d758ffc..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizeproperty.go +++ /dev/null @@ -1,17 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VMSizeProperty struct { - Cores *int64 `json:"cores,omitempty"` - DataDiskStorageTier *string `json:"dataDiskStorageTier,omitempty"` - Label *string `json:"label,omitempty"` - MaxDataDiskCount *int64 `json:"maxDataDiskCount,omitempty"` - MemoryInMb *int64 `json:"memoryInMb,omitempty"` - Name *string `json:"name,omitempty"` - SupportedByVirtualMachines *bool `json:"supportedByVirtualMachines,omitempty"` - SupportedByWebWorkerRoles *bool `json:"supportedByWebWorkerRoles,omitempty"` - VirtualMachineResourceDiskSizeInMb *int64 `json:"virtualMachineResourceDiskSizeInMb,omitempty"` - WebWorkerResourceDiskSizeInMb *int64 `json:"webWorkerResourceDiskSizeInMb,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizescapability.go b/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizescapability.go deleted file mode 100644 index 11d746bd36a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/model_vmsizescapability.go +++ /dev/null @@ -1,8 +0,0 @@ -package regions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VMSizesCapability struct { - Available *[]string `json:"available,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/version.go b/resource-manager/hdinsight/2018-06-01-preview/regions/version.go deleted file mode 100644 index 706816e2472..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package regions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/regions/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/README.md b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/README.md deleted file mode 100644 index 1f7afb9e3aa..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/scriptactions` Documentation - -The `scriptactions` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/scriptactions" -``` - - -### Client Initialization - -```go -client := scriptactions.NewScriptActionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScriptActionsClient.Delete` - -```go -ctx := context.TODO() -id := scriptactions.NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptActionValue") - -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: `ScriptActionsClient.ListByCluster` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/client.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/client.go deleted file mode 100644 index 6d46261fc0c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package scriptactions - -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 ScriptActionsClient struct { - Client *resourcemanager.Client -} - -func NewScriptActionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ScriptActionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "scriptactions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ScriptActionsClient: %+v", err) - } - - return &ScriptActionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction.go deleted file mode 100644 index 2cc2a99e2d2..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction.go +++ /dev/null @@ -1,139 +0,0 @@ -package scriptactions - -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(&ScriptActionId{}) -} - -var _ resourceids.ResourceId = &ScriptActionId{} - -// ScriptActionId is a struct representing the Resource ID for a Script Action -type ScriptActionId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ScriptActionName string -} - -// NewScriptActionID returns a new ScriptActionId struct -func NewScriptActionID(subscriptionId string, resourceGroupName string, clusterName string, scriptActionName string) ScriptActionId { - return ScriptActionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ScriptActionName: scriptActionName, - } -} - -// ParseScriptActionID parses 'input' into a ScriptActionId -func ParseScriptActionID(input string) (*ScriptActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScriptActionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScriptActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScriptActionIDInsensitively parses 'input' case-insensitively into a ScriptActionId -// note: this method should only be used for API response data and not user input -func ParseScriptActionIDInsensitively(input string) (*ScriptActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScriptActionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScriptActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScriptActionId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ScriptActionName, ok = input.Parsed["scriptActionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scriptActionName", input) - } - - return nil -} - -// ValidateScriptActionID checks that 'input' can be parsed as a Script Action ID -func ValidateScriptActionID(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 := ParseScriptActionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Script Action ID -func (id ScriptActionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusters/%s/scriptActions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ScriptActionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Script Action ID -func (id ScriptActionId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticScriptActions", "scriptActions", "scriptActions"), - resourceids.UserSpecifiedSegment("scriptActionName", "scriptActionValue"), - } -} - -// String returns a human-readable description of this Script Action ID -func (id ScriptActionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Script Action Name: %q", id.ScriptActionName), - } - return fmt.Sprintf("Script Action (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction_test.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction_test.go deleted file mode 100644 index a0f2c9611b5..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/id_scriptaction_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package scriptactions - -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 = &ScriptActionId{} - -func TestNewScriptActionID(t *testing.T) { - id := NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptActionValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ScriptActionName != "scriptActionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScriptActionName'", id.ScriptActionName, "scriptActionValue") - } -} - -func TestFormatScriptActionID(t *testing.T) { - actual := NewScriptActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptActionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions/scriptActionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScriptActionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScriptActionId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions/scriptActionValue", - Expected: &ScriptActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ScriptActionName: "scriptActionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions/scriptActionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScriptActionID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ScriptActionName != v.Expected.ScriptActionName { - t.Fatalf("Expected %q but got %q for ScriptActionName", v.Expected.ScriptActionName, actual.ScriptActionName) - } - - } -} - -func TestParseScriptActionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScriptActionId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTaCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions/scriptActionValue", - Expected: &ScriptActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ScriptActionName: "scriptActionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptActions/scriptActionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTaCtIoNs/sCrIpTaCtIoNvAlUe", - Expected: &ScriptActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ScriptActionName: "sCrIpTaCtIoNvAlUe", - }, - }, - { - // 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.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTaCtIoNs/sCrIpTaCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScriptActionIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ScriptActionName != v.Expected.ScriptActionName { - t.Fatalf("Expected %q but got %q for ScriptActionName", v.Expected.ScriptActionName, actual.ScriptActionName) - } - - } -} - -func TestSegmentsForScriptActionId(t *testing.T) { - segments := ScriptActionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScriptActionId 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/hdinsight/2018-06-01-preview/scriptactions/method_delete.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/method_delete.go deleted file mode 100644 index 77954b80148..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package scriptactions - -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 ScriptActionsClient) Delete(ctx context.Context, id ScriptActionId) (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/hdinsight/2018-06-01-preview/scriptactions/method_listbycluster.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/method_listbycluster.go deleted file mode 100644 index e611da64b2a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/method_listbycluster.go +++ /dev/null @@ -1,92 +0,0 @@ -package scriptactions - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RuntimeScriptActionDetail -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []RuntimeScriptActionDetail -} - -// ListByCluster ... -func (c ScriptActionsClient) ListByCluster(ctx context.Context, id commonids.HDInsightClusterId) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/scriptActions", 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 *[]RuntimeScriptActionDetail `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c ScriptActionsClient) ListByClusterComplete(ctx context.Context, id commonids.HDInsightClusterId) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, RuntimeScriptActionDetailOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ScriptActionsClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id commonids.HDInsightClusterId, predicate RuntimeScriptActionDetailOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]RuntimeScriptActionDetail, 0) - - resp, err := c.ListByCluster(ctx, id) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/model_runtimescriptactiondetail.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/model_runtimescriptactiondetail.go deleted file mode 100644 index 434e983c98d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/model_runtimescriptactiondetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package scriptactions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RuntimeScriptActionDetail struct { - ApplicationName *string `json:"applicationName,omitempty"` - Name string `json:"name"` - Parameters *string `json:"parameters,omitempty"` - Roles []string `json:"roles"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/predicates.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/predicates.go deleted file mode 100644 index 51b7b07dfdb..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package scriptactions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RuntimeScriptActionDetailOperationPredicate struct { - ApplicationName *string - Name *string - Parameters *string - Uri *string -} - -func (p RuntimeScriptActionDetailOperationPredicate) Matches(input RuntimeScriptActionDetail) bool { - - if p.ApplicationName != nil && (input.ApplicationName == nil || *p.ApplicationName != *input.ApplicationName) { - return false - } - - if p.Name != nil && *p.Name != input.Name { - return false - } - - if p.Parameters != nil && (input.Parameters == nil || *p.Parameters != *input.Parameters) { - return false - } - - if p.Uri != nil && *p.Uri != input.Uri { - return false - } - - return true -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/version.go b/resource-manager/hdinsight/2018-06-01-preview/scriptactions/version.go deleted file mode 100644 index f702b9442aa..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptactions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package scriptactions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/scriptactions/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/README.md b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/README.md deleted file mode 100644 index e6c09db4e0a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory` Documentation - -The `scriptexecutionhistory` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory" -``` - - -### Client Initialization - -```go -client := scriptexecutionhistory.NewScriptExecutionHistoryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScriptExecutionHistoryClient.ListByCluster` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -// alternatively `client.ListByCluster(ctx, id)` can be used to do batched pagination -items, err := client.ListByClusterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ScriptExecutionHistoryClient.ScriptActionsGetExecutionDetail` - -```go -ctx := context.TODO() -id := scriptexecutionhistory.NewScriptExecutionHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptExecutionIdValue") - -read, err := client.ScriptActionsGetExecutionDetail(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/hdinsight/2018-06-01-preview/scriptexecutionhistory/client.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/client.go deleted file mode 100644 index bfe9d6db50b..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package scriptexecutionhistory - -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 ScriptExecutionHistoryClient struct { - Client *resourcemanager.Client -} - -func NewScriptExecutionHistoryClientWithBaseURI(sdkApi sdkEnv.Api) (*ScriptExecutionHistoryClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "scriptexecutionhistory", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ScriptExecutionHistoryClient: %+v", err) - } - - return &ScriptExecutionHistoryClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory.go deleted file mode 100644 index 002457c647c..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory.go +++ /dev/null @@ -1,139 +0,0 @@ -package scriptexecutionhistory - -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(&ScriptExecutionHistoryId{}) -} - -var _ resourceids.ResourceId = &ScriptExecutionHistoryId{} - -// ScriptExecutionHistoryId is a struct representing the Resource ID for a Script Execution History -type ScriptExecutionHistoryId struct { - SubscriptionId string - ResourceGroupName string - ClusterName string - ScriptExecutionId string -} - -// NewScriptExecutionHistoryID returns a new ScriptExecutionHistoryId struct -func NewScriptExecutionHistoryID(subscriptionId string, resourceGroupName string, clusterName string, scriptExecutionId string) ScriptExecutionHistoryId { - return ScriptExecutionHistoryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ClusterName: clusterName, - ScriptExecutionId: scriptExecutionId, - } -} - -// ParseScriptExecutionHistoryID parses 'input' into a ScriptExecutionHistoryId -func ParseScriptExecutionHistoryID(input string) (*ScriptExecutionHistoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScriptExecutionHistoryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScriptExecutionHistoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScriptExecutionHistoryIDInsensitively parses 'input' case-insensitively into a ScriptExecutionHistoryId -// note: this method should only be used for API response data and not user input -func ParseScriptExecutionHistoryIDInsensitively(input string) (*ScriptExecutionHistoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScriptExecutionHistoryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScriptExecutionHistoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScriptExecutionHistoryId) 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.ClusterName, ok = input.Parsed["clusterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) - } - - if id.ScriptExecutionId, ok = input.Parsed["scriptExecutionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scriptExecutionId", input) - } - - return nil -} - -// ValidateScriptExecutionHistoryID checks that 'input' can be parsed as a Script Execution History ID -func ValidateScriptExecutionHistoryID(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 := ParseScriptExecutionHistoryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Script Execution History ID -func (id ScriptExecutionHistoryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusters/%s/scriptExecutionHistory/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterName, id.ScriptExecutionId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Script Execution History ID -func (id ScriptExecutionHistoryId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), - resourceids.StaticSegment("staticClusters", "clusters", "clusters"), - resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), - resourceids.StaticSegment("staticScriptExecutionHistory", "scriptExecutionHistory", "scriptExecutionHistory"), - resourceids.UserSpecifiedSegment("scriptExecutionId", "scriptExecutionIdValue"), - } -} - -// String returns a human-readable description of this Script Execution History ID -func (id ScriptExecutionHistoryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cluster Name: %q", id.ClusterName), - fmt.Sprintf("Script Execution: %q", id.ScriptExecutionId), - } - return fmt.Sprintf("Script Execution History (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory_test.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory_test.go deleted file mode 100644 index de80d899d5a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/id_scriptexecutionhistory_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package scriptexecutionhistory - -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 = &ScriptExecutionHistoryId{} - -func TestNewScriptExecutionHistoryID(t *testing.T) { - id := NewScriptExecutionHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptExecutionIdValue") - - 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.ClusterName != "clusterValue" { - t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") - } - - if id.ScriptExecutionId != "scriptExecutionIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScriptExecutionId'", id.ScriptExecutionId, "scriptExecutionIdValue") - } -} - -func TestFormatScriptExecutionHistoryID(t *testing.T) { - actual := NewScriptExecutionHistoryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue", "scriptExecutionIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScriptExecutionHistoryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScriptExecutionHistoryId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue", - Expected: &ScriptExecutionHistoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ScriptExecutionId: "scriptExecutionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScriptExecutionHistoryID(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ScriptExecutionId != v.Expected.ScriptExecutionId { - t.Fatalf("Expected %q but got %q for ScriptExecutionId", v.Expected.ScriptExecutionId, actual.ScriptExecutionId) - } - - } -} - -func TestParseScriptExecutionHistoryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScriptExecutionHistoryId - }{ - { - // 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.HDInsight", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTeXeCuTiOnHiStOrY", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue", - Expected: &ScriptExecutionHistoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ClusterName: "clusterValue", - ScriptExecutionId: "scriptExecutionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusters/clusterValue/scriptExecutionHistory/scriptExecutionIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTeXeCuTiOnHiStOrY/sCrIpTeXeCuTiOnIdVaLuE", - Expected: &ScriptExecutionHistoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ClusterName: "cLuStErVaLuE", - ScriptExecutionId: "sCrIpTeXeCuTiOnIdVaLuE", - }, - }, - { - // 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.hDiNsIgHt/cLuStErS/cLuStErVaLuE/sCrIpTeXeCuTiOnHiStOrY/sCrIpTeXeCuTiOnIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScriptExecutionHistoryIDInsensitively(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.ClusterName != v.Expected.ClusterName { - t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) - } - - if actual.ScriptExecutionId != v.Expected.ScriptExecutionId { - t.Fatalf("Expected %q but got %q for ScriptExecutionId", v.Expected.ScriptExecutionId, actual.ScriptExecutionId) - } - - } -} - -func TestSegmentsForScriptExecutionHistoryId(t *testing.T) { - segments := ScriptExecutionHistoryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScriptExecutionHistoryId 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/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_listbycluster.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_listbycluster.go deleted file mode 100644 index fb077dc885a..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_listbycluster.go +++ /dev/null @@ -1,92 +0,0 @@ -package scriptexecutionhistory - -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 ListByClusterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RuntimeScriptActionDetail -} - -type ListByClusterCompleteResult struct { - LatestHttpResponse *http.Response - Items []RuntimeScriptActionDetail -} - -// ListByCluster ... -func (c ScriptExecutionHistoryClient) ListByCluster(ctx context.Context, id commonids.HDInsightClusterId) (result ListByClusterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/scriptExecutionHistory", 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 *[]RuntimeScriptActionDetail `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByClusterComplete retrieves all the results into a single object -func (c ScriptExecutionHistoryClient) ListByClusterComplete(ctx context.Context, id commonids.HDInsightClusterId) (ListByClusterCompleteResult, error) { - return c.ListByClusterCompleteMatchingPredicate(ctx, id, RuntimeScriptActionDetailOperationPredicate{}) -} - -// ListByClusterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ScriptExecutionHistoryClient) ListByClusterCompleteMatchingPredicate(ctx context.Context, id commonids.HDInsightClusterId, predicate RuntimeScriptActionDetailOperationPredicate) (result ListByClusterCompleteResult, err error) { - items := make([]RuntimeScriptActionDetail, 0) - - resp, err := c.ListByCluster(ctx, id) - if err != nil { - 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 = ListByClusterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_scriptactionsgetexecutiondetail.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_scriptactionsgetexecutiondetail.go deleted file mode 100644 index 91705d726d9..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/method_scriptactionsgetexecutiondetail.go +++ /dev/null @@ -1,54 +0,0 @@ -package scriptexecutionhistory - -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 ScriptActionsGetExecutionDetailOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RuntimeScriptActionDetail -} - -// ScriptActionsGetExecutionDetail ... -func (c ScriptExecutionHistoryClient) ScriptActionsGetExecutionDetail(ctx context.Context, id ScriptExecutionHistoryId) (result ScriptActionsGetExecutionDetailOperationResponse, 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 RuntimeScriptActionDetail - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/model_runtimescriptactiondetail.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/model_runtimescriptactiondetail.go deleted file mode 100644 index e5fee578f9d..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/model_runtimescriptactiondetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package scriptexecutionhistory - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RuntimeScriptActionDetail struct { - ApplicationName *string `json:"applicationName,omitempty"` - Name string `json:"name"` - Parameters *string `json:"parameters,omitempty"` - Roles []string `json:"roles"` - Uri string `json:"uri"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/predicates.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/predicates.go deleted file mode 100644 index ba90df986fb..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package scriptexecutionhistory - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RuntimeScriptActionDetailOperationPredicate struct { - ApplicationName *string - Name *string - Parameters *string - Uri *string -} - -func (p RuntimeScriptActionDetailOperationPredicate) Matches(input RuntimeScriptActionDetail) bool { - - if p.ApplicationName != nil && (input.ApplicationName == nil || *p.ApplicationName != *input.ApplicationName) { - return false - } - - if p.Name != nil && *p.Name != input.Name { - return false - } - - if p.Parameters != nil && (input.Parameters == nil || *p.Parameters != *input.Parameters) { - return false - } - - if p.Uri != nil && *p.Uri != input.Uri { - return false - } - - return true -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/version.go b/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/version.go deleted file mode 100644 index 30983c6f078..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/scriptexecutionhistory/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package scriptexecutionhistory - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/scriptexecutionhistory/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/README.md b/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/README.md deleted file mode 100644 index 3d2d39b24d4..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/README.md +++ /dev/null @@ -1,50 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/virtualmachines` Documentation - -The `virtualmachines` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2018-06-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2018-06-01-preview/virtualmachines" -``` - - -### Client Initialization - -```go -client := virtualmachines.NewVirtualMachinesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualMachinesClient.ListHosts` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") - -read, err := client.ListHosts(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualMachinesClient.RestartHosts` - -```go -ctx := context.TODO() -id := commonids.NewHDInsightClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterValue") -var payload []string - -if err := client.RestartHostsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/client.go b/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/client.go deleted file mode 100644 index 29f57e611e8..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualmachines - -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 VirtualMachinesClient struct { - Client *resourcemanager.Client -} - -func NewVirtualMachinesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachinesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualmachines", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualMachinesClient: %+v", err) - } - - return &VirtualMachinesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_listhosts.go b/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_listhosts.go deleted file mode 100644 index 1d9bfdfaf47..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_listhosts.go +++ /dev/null @@ -1,56 +0,0 @@ -package virtualmachines - -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 ListHostsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HostInfo -} - -// ListHosts ... -func (c VirtualMachinesClient) ListHosts(ctx context.Context, id commonids.HDInsightClusterId) (result ListHostsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listHosts", 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 []HostInfo - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_restarthosts.go b/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_restarthosts.go deleted file mode 100644 index c7268c622a4..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/method_restarthosts.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualmachines - -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 RestartHostsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RestartHosts ... -func (c VirtualMachinesClient) RestartHosts(ctx context.Context, id commonids.HDInsightClusterId, input []string) (result RestartHostsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/restartHosts", 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 -} - -// RestartHostsThenPoll performs RestartHosts then polls until it's completed -func (c VirtualMachinesClient) RestartHostsThenPoll(ctx context.Context, id commonids.HDInsightClusterId, input []string) error { - result, err := c.RestartHosts(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RestartHosts: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RestartHosts: %+v", err) - } - - return nil -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/model_hostinfo.go b/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/model_hostinfo.go deleted file mode 100644 index 46c3fc54159..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/model_hostinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualmachines - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostInfo struct { - EffectiveDiskEncryptionKeyUrl *string `json:"effectiveDiskEncryptionKeyUrl,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/version.go b/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/version.go deleted file mode 100644 index 049ce3aa940..00000000000 --- a/resource-manager/hdinsight/2018-06-01-preview/virtualmachines/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachines - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2018-06-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachines/%s", defaultApiVersion) -} diff --git a/resource-manager/hdinsight/2024-05-01/client.go b/resource-manager/hdinsight/2024-05-01/client.go new file mode 100644 index 00000000000..792f4bf0839 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/client.go @@ -0,0 +1,28 @@ +package v2024_05_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/hdinsight/2024-05-01/hdinsights" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + Hdinsights *hdinsights.HdinsightsClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + hdinsightsClient, err := hdinsights.NewHdinsightsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Hdinsights client: %+v", err) + } + configureFunc(hdinsightsClient.Client) + + return &Client{ + Hdinsights: hdinsightsClient, + }, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/README.md b/resource-manager/hdinsight/2024-05-01/hdinsights/README.md new file mode 100644 index 00000000000..789b4af8a96 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/README.md @@ -0,0 +1,505 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/hdinsight/2024-05-01/hdinsights` Documentation + +The `hdinsights` SDK allows for interaction with the Azure Resource Manager Service `hdinsight` (API Version `2024-05-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/hdinsight/2024-05-01/hdinsights" +``` + + +### Client Initialization + +```go +client := hdinsights.NewHdinsightsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `HdinsightsClient.AvailableClusterPoolVersionsListByLocation` + +```go +ctx := context.TODO() +id := hdinsights.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.AvailableClusterPoolVersionsListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.AvailableClusterPoolVersionsListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.AvailableClusterVersionsListByLocation` + +```go +ctx := context.TODO() +id := hdinsights.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.AvailableClusterVersionsListByLocation(ctx, id)` can be used to do batched pagination +items, err := client.AvailableClusterVersionsListByLocationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterAvailableUpgradesList` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +// alternatively `client.ClusterAvailableUpgradesList(ctx, id)` can be used to do batched pagination +items, err := client.ClusterAvailableUpgradesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterJobsList` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +// alternatively `client.ClusterJobsList(ctx, id, hdinsights.DefaultClusterJobsListOperationOptions())` can be used to do batched pagination +items, err := client.ClusterJobsListComplete(ctx, id, hdinsights.DefaultClusterJobsListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterJobsRunJob` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.ClusterJob{ + // ... +} + + +if err := client.ClusterJobsRunJobThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClusterLibrariesList` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +// alternatively `client.ClusterLibrariesList(ctx, id, hdinsights.DefaultClusterLibrariesListOperationOptions())` can be used to do batched pagination +items, err := client.ClusterLibrariesListComplete(ctx, id, hdinsights.DefaultClusterLibrariesListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterLibrariesManageLibraries` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.ClusterLibraryManagementOperation{ + // ... +} + + +if err := client.ClusterLibrariesManageLibrariesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolAvailableUpgradesList` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +// alternatively `client.ClusterPoolAvailableUpgradesList(ctx, id)` can be used to do batched pagination +items, err := client.ClusterPoolAvailableUpgradesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolUpgradeHistoriesList` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +// alternatively `client.ClusterPoolUpgradeHistoriesList(ctx, id)` can be used to do batched pagination +items, err := client.ClusterPoolUpgradeHistoriesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsCreateOrUpdate` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +payload := hdinsights.ClusterPool{ + // ... +} + + +if err := client.ClusterPoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsDelete` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +if err := client.ClusterPoolsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsGet` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +read, err := client.ClusterPoolsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ClusterPoolsListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ClusterPoolsListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ClusterPoolsListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ClusterPoolsListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsUpdateTags` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +payload := hdinsights.TagsObject{ + // ... +} + + +if err := client.ClusterPoolsUpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClusterPoolsUpgrade` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +payload := hdinsights.ClusterPoolUpgrade{ + // ... +} + + +if err := client.ClusterPoolsUpgradeThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClusterUpgradeHistoriesList` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +// alternatively `client.ClusterUpgradeHistoriesList(ctx, id)` can be used to do batched pagination +items, err := client.ClusterUpgradeHistoriesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClustersCreate` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.Cluster{ + // ... +} + + +if err := client.ClustersCreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClustersDelete` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +if err := client.ClustersDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClustersGet` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +read, err := client.ClustersGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `HdinsightsClient.ClustersGetInstanceView` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +read, err := client.ClustersGetInstanceView(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `HdinsightsClient.ClustersListByClusterPoolName` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + +// alternatively `client.ClustersListByClusterPoolName(ctx, id)` can be used to do batched pagination +items, err := client.ClustersListByClusterPoolNameComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClustersListInstanceViews` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +// alternatively `client.ClustersListInstanceViews(ctx, id)` can be used to do batched pagination +items, err := client.ClustersListInstanceViewsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClustersListServiceConfigs` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +// alternatively `client.ClustersListServiceConfigs(ctx, id)` can be used to do batched pagination +items, err := client.ClustersListServiceConfigsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `HdinsightsClient.ClustersResize` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.ClusterResizeData{ + // ... +} + + +if err := client.ClustersResizeThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClustersUpdate` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.ClusterPatch{ + // ... +} + + +if err := client.ClustersUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClustersUpgrade` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.ClusterUpgrade{ + // ... +} + + +if err := client.ClustersUpgradeThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.ClustersUpgradeManualRollback` + +```go +ctx := context.TODO() +id := hdinsights.NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + +payload := hdinsights.ClusterUpgradeRollback{ + // ... +} + + +if err := client.ClustersUpgradeManualRollbackThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `HdinsightsClient.LocationsCheckNameAvailability` + +```go +ctx := context.TODO() +id := hdinsights.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := hdinsights.NameAvailabilityParameters{ + // ... +} + + +read, err := client.LocationsCheckNameAvailability(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/hdinsight/2024-05-01/hdinsights/client.go b/resource-manager/hdinsight/2024-05-01/hdinsights/client.go new file mode 100644 index 00000000000..889d9e08e72 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/client.go @@ -0,0 +1,26 @@ +package hdinsights + +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 HdinsightsClient struct { + Client *resourcemanager.Client +} + +func NewHdinsightsClientWithBaseURI(sdkApi sdkEnv.Api) (*HdinsightsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "hdinsights", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating HdinsightsClient: %+v", err) + } + + return &HdinsightsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/constants.go b/resource-manager/hdinsight/2024-05-01/hdinsights/constants.go new file mode 100644 index 00000000000..34273c08491 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/constants.go @@ -0,0 +1,1471 @@ +package hdinsights + +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 Action string + +const ( + ActionCANCEL Action = "CANCEL" + ActionDELETE Action = "DELETE" + ActionLASTSTATEUPDATE Action = "LAST_STATE_UPDATE" + ActionLISTSAVEPOINT Action = "LIST_SAVEPOINT" + ActionNEW Action = "NEW" + ActionRELAUNCH Action = "RE_LAUNCH" + ActionSAVEPOINT Action = "SAVEPOINT" + ActionSTART Action = "START" + ActionSTATELESSUPDATE Action = "STATELESS_UPDATE" + ActionSTOP Action = "STOP" + ActionUPDATE Action = "UPDATE" +) + +func PossibleValuesForAction() []string { + return []string{ + string(ActionCANCEL), + string(ActionDELETE), + string(ActionLASTSTATEUPDATE), + string(ActionLISTSAVEPOINT), + string(ActionNEW), + string(ActionRELAUNCH), + string(ActionSAVEPOINT), + string(ActionSTART), + string(ActionSTATELESSUPDATE), + string(ActionSTOP), + string(ActionUPDATE), + } +} + +func (s *Action) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAction(input string) (*Action, error) { + vals := map[string]Action{ + "cancel": ActionCANCEL, + "delete": ActionDELETE, + "last_state_update": ActionLASTSTATEUPDATE, + "list_savepoint": ActionLISTSAVEPOINT, + "new": ActionNEW, + "re_launch": ActionRELAUNCH, + "savepoint": ActionSAVEPOINT, + "start": ActionSTART, + "stateless_update": ActionSTATELESSUPDATE, + "stop": ActionSTOP, + "update": ActionUPDATE, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Action(input) + return &out, nil +} + +type AutoscaleType string + +const ( + AutoscaleTypeLoadBased AutoscaleType = "LoadBased" + AutoscaleTypeScheduleBased AutoscaleType = "ScheduleBased" +) + +func PossibleValuesForAutoscaleType() []string { + return []string{ + string(AutoscaleTypeLoadBased), + string(AutoscaleTypeScheduleBased), + } +} + +func (s *AutoscaleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAutoscaleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAutoscaleType(input string) (*AutoscaleType, error) { + vals := map[string]AutoscaleType{ + "loadbased": AutoscaleTypeLoadBased, + "schedulebased": AutoscaleTypeScheduleBased, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AutoscaleType(input) + return &out, nil +} + +type Category string + +const ( + CategoryCustom Category = "custom" + CategoryPredefined Category = "predefined" +) + +func PossibleValuesForCategory() []string { + return []string{ + string(CategoryCustom), + string(CategoryPredefined), + } +} + +func (s *Category) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCategory(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCategory(input string) (*Category, error) { + vals := map[string]Category{ + "custom": CategoryCustom, + "predefined": CategoryPredefined, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Category(input) + return &out, nil +} + +type ClusterAvailableUpgradeType string + +const ( + ClusterAvailableUpgradeTypeAKSPatchUpgrade ClusterAvailableUpgradeType = "AKSPatchUpgrade" + ClusterAvailableUpgradeTypeHotfixUpgrade ClusterAvailableUpgradeType = "HotfixUpgrade" + ClusterAvailableUpgradeTypePatchVersionUpgrade ClusterAvailableUpgradeType = "PatchVersionUpgrade" +) + +func PossibleValuesForClusterAvailableUpgradeType() []string { + return []string{ + string(ClusterAvailableUpgradeTypeAKSPatchUpgrade), + string(ClusterAvailableUpgradeTypeHotfixUpgrade), + string(ClusterAvailableUpgradeTypePatchVersionUpgrade), + } +} + +func (s *ClusterAvailableUpgradeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterAvailableUpgradeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterAvailableUpgradeType(input string) (*ClusterAvailableUpgradeType, error) { + vals := map[string]ClusterAvailableUpgradeType{ + "akspatchupgrade": ClusterAvailableUpgradeTypeAKSPatchUpgrade, + "hotfixupgrade": ClusterAvailableUpgradeTypeHotfixUpgrade, + "patchversionupgrade": ClusterAvailableUpgradeTypePatchVersionUpgrade, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterAvailableUpgradeType(input) + return &out, nil +} + +type ClusterPoolAvailableUpgradeType string + +const ( + ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade ClusterPoolAvailableUpgradeType = "AKSPatchUpgrade" + ClusterPoolAvailableUpgradeTypeNodeOsUpgrade ClusterPoolAvailableUpgradeType = "NodeOsUpgrade" +) + +func PossibleValuesForClusterPoolAvailableUpgradeType() []string { + return []string{ + string(ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade), + string(ClusterPoolAvailableUpgradeTypeNodeOsUpgrade), + } +} + +func (s *ClusterPoolAvailableUpgradeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterPoolAvailableUpgradeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterPoolAvailableUpgradeType(input string) (*ClusterPoolAvailableUpgradeType, error) { + vals := map[string]ClusterPoolAvailableUpgradeType{ + "akspatchupgrade": ClusterPoolAvailableUpgradeTypeAKSPatchUpgrade, + "nodeosupgrade": ClusterPoolAvailableUpgradeTypeNodeOsUpgrade, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterPoolAvailableUpgradeType(input) + return &out, nil +} + +type ClusterPoolUpgradeHistoryType string + +const ( + ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade ClusterPoolUpgradeHistoryType = "AKSPatchUpgrade" + ClusterPoolUpgradeHistoryTypeNodeOsUpgrade ClusterPoolUpgradeHistoryType = "NodeOsUpgrade" +) + +func PossibleValuesForClusterPoolUpgradeHistoryType() []string { + return []string{ + string(ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade), + string(ClusterPoolUpgradeHistoryTypeNodeOsUpgrade), + } +} + +func (s *ClusterPoolUpgradeHistoryType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterPoolUpgradeHistoryType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterPoolUpgradeHistoryType(input string) (*ClusterPoolUpgradeHistoryType, error) { + vals := map[string]ClusterPoolUpgradeHistoryType{ + "akspatchupgrade": ClusterPoolUpgradeHistoryTypeAKSPatchUpgrade, + "nodeosupgrade": ClusterPoolUpgradeHistoryTypeNodeOsUpgrade, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterPoolUpgradeHistoryType(input) + return &out, nil +} + +type ClusterPoolUpgradeHistoryUpgradeResultType string + +const ( + ClusterPoolUpgradeHistoryUpgradeResultTypeFailed ClusterPoolUpgradeHistoryUpgradeResultType = "Failed" + ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed ClusterPoolUpgradeHistoryUpgradeResultType = "Succeed" +) + +func PossibleValuesForClusterPoolUpgradeHistoryUpgradeResultType() []string { + return []string{ + string(ClusterPoolUpgradeHistoryUpgradeResultTypeFailed), + string(ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed), + } +} + +func (s *ClusterPoolUpgradeHistoryUpgradeResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterPoolUpgradeHistoryUpgradeResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterPoolUpgradeHistoryUpgradeResultType(input string) (*ClusterPoolUpgradeHistoryUpgradeResultType, error) { + vals := map[string]ClusterPoolUpgradeHistoryUpgradeResultType{ + "failed": ClusterPoolUpgradeHistoryUpgradeResultTypeFailed, + "succeed": ClusterPoolUpgradeHistoryUpgradeResultTypeSucceed, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterPoolUpgradeHistoryUpgradeResultType(input) + return &out, nil +} + +type ClusterPoolUpgradeType string + +const ( + ClusterPoolUpgradeTypeAKSPatchUpgrade ClusterPoolUpgradeType = "AKSPatchUpgrade" + ClusterPoolUpgradeTypeNodeOsUpgrade ClusterPoolUpgradeType = "NodeOsUpgrade" +) + +func PossibleValuesForClusterPoolUpgradeType() []string { + return []string{ + string(ClusterPoolUpgradeTypeAKSPatchUpgrade), + string(ClusterPoolUpgradeTypeNodeOsUpgrade), + } +} + +func (s *ClusterPoolUpgradeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterPoolUpgradeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterPoolUpgradeType(input string) (*ClusterPoolUpgradeType, error) { + vals := map[string]ClusterPoolUpgradeType{ + "akspatchupgrade": ClusterPoolUpgradeTypeAKSPatchUpgrade, + "nodeosupgrade": ClusterPoolUpgradeTypeNodeOsUpgrade, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterPoolUpgradeType(input) + return &out, nil +} + +type ClusterUpgradeHistorySeverityType string + +const ( + ClusterUpgradeHistorySeverityTypeCritical ClusterUpgradeHistorySeverityType = "critical" + ClusterUpgradeHistorySeverityTypeHigh ClusterUpgradeHistorySeverityType = "high" + ClusterUpgradeHistorySeverityTypeLow ClusterUpgradeHistorySeverityType = "low" + ClusterUpgradeHistorySeverityTypeMedium ClusterUpgradeHistorySeverityType = "medium" +) + +func PossibleValuesForClusterUpgradeHistorySeverityType() []string { + return []string{ + string(ClusterUpgradeHistorySeverityTypeCritical), + string(ClusterUpgradeHistorySeverityTypeHigh), + string(ClusterUpgradeHistorySeverityTypeLow), + string(ClusterUpgradeHistorySeverityTypeMedium), + } +} + +func (s *ClusterUpgradeHistorySeverityType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterUpgradeHistorySeverityType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterUpgradeHistorySeverityType(input string) (*ClusterUpgradeHistorySeverityType, error) { + vals := map[string]ClusterUpgradeHistorySeverityType{ + "critical": ClusterUpgradeHistorySeverityTypeCritical, + "high": ClusterUpgradeHistorySeverityTypeHigh, + "low": ClusterUpgradeHistorySeverityTypeLow, + "medium": ClusterUpgradeHistorySeverityTypeMedium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterUpgradeHistorySeverityType(input) + return &out, nil +} + +type ClusterUpgradeHistoryType string + +const ( + ClusterUpgradeHistoryTypeAKSPatchUpgrade ClusterUpgradeHistoryType = "AKSPatchUpgrade" + ClusterUpgradeHistoryTypeHotfixUpgrade ClusterUpgradeHistoryType = "HotfixUpgrade" + ClusterUpgradeHistoryTypeHotfixUpgradeRollback ClusterUpgradeHistoryType = "HotfixUpgradeRollback" + ClusterUpgradeHistoryTypePatchVersionUpgrade ClusterUpgradeHistoryType = "PatchVersionUpgrade" + ClusterUpgradeHistoryTypePatchVersionUpgradeRollback ClusterUpgradeHistoryType = "PatchVersionUpgradeRollback" +) + +func PossibleValuesForClusterUpgradeHistoryType() []string { + return []string{ + string(ClusterUpgradeHistoryTypeAKSPatchUpgrade), + string(ClusterUpgradeHistoryTypeHotfixUpgrade), + string(ClusterUpgradeHistoryTypeHotfixUpgradeRollback), + string(ClusterUpgradeHistoryTypePatchVersionUpgrade), + string(ClusterUpgradeHistoryTypePatchVersionUpgradeRollback), + } +} + +func (s *ClusterUpgradeHistoryType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterUpgradeHistoryType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterUpgradeHistoryType(input string) (*ClusterUpgradeHistoryType, error) { + vals := map[string]ClusterUpgradeHistoryType{ + "akspatchupgrade": ClusterUpgradeHistoryTypeAKSPatchUpgrade, + "hotfixupgrade": ClusterUpgradeHistoryTypeHotfixUpgrade, + "hotfixupgraderollback": ClusterUpgradeHistoryTypeHotfixUpgradeRollback, + "patchversionupgrade": ClusterUpgradeHistoryTypePatchVersionUpgrade, + "patchversionupgraderollback": ClusterUpgradeHistoryTypePatchVersionUpgradeRollback, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterUpgradeHistoryType(input) + return &out, nil +} + +type ClusterUpgradeHistoryUpgradeResultType string + +const ( + ClusterUpgradeHistoryUpgradeResultTypeFailed ClusterUpgradeHistoryUpgradeResultType = "Failed" + ClusterUpgradeHistoryUpgradeResultTypeSucceed ClusterUpgradeHistoryUpgradeResultType = "Succeed" +) + +func PossibleValuesForClusterUpgradeHistoryUpgradeResultType() []string { + return []string{ + string(ClusterUpgradeHistoryUpgradeResultTypeFailed), + string(ClusterUpgradeHistoryUpgradeResultTypeSucceed), + } +} + +func (s *ClusterUpgradeHistoryUpgradeResultType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterUpgradeHistoryUpgradeResultType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterUpgradeHistoryUpgradeResultType(input string) (*ClusterUpgradeHistoryUpgradeResultType, error) { + vals := map[string]ClusterUpgradeHistoryUpgradeResultType{ + "failed": ClusterUpgradeHistoryUpgradeResultTypeFailed, + "succeed": ClusterUpgradeHistoryUpgradeResultTypeSucceed, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterUpgradeHistoryUpgradeResultType(input) + return &out, nil +} + +type ClusterUpgradeType string + +const ( + ClusterUpgradeTypeAKSPatchUpgrade ClusterUpgradeType = "AKSPatchUpgrade" + ClusterUpgradeTypeHotfixUpgrade ClusterUpgradeType = "HotfixUpgrade" + ClusterUpgradeTypePatchVersionUpgrade ClusterUpgradeType = "PatchVersionUpgrade" +) + +func PossibleValuesForClusterUpgradeType() []string { + return []string{ + string(ClusterUpgradeTypeAKSPatchUpgrade), + string(ClusterUpgradeTypeHotfixUpgrade), + string(ClusterUpgradeTypePatchVersionUpgrade), + } +} + +func (s *ClusterUpgradeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseClusterUpgradeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseClusterUpgradeType(input string) (*ClusterUpgradeType, error) { + vals := map[string]ClusterUpgradeType{ + "akspatchupgrade": ClusterUpgradeTypeAKSPatchUpgrade, + "hotfixupgrade": ClusterUpgradeTypeHotfixUpgrade, + "patchversionupgrade": ClusterUpgradeTypePatchVersionUpgrade, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ClusterUpgradeType(input) + return &out, nil +} + +type ComparisonOperator string + +const ( + ComparisonOperatorGreaterThan ComparisonOperator = "greaterThan" + ComparisonOperatorGreaterThanOrEqual ComparisonOperator = "greaterThanOrEqual" + ComparisonOperatorLessThan ComparisonOperator = "lessThan" + ComparisonOperatorLessThanOrEqual ComparisonOperator = "lessThanOrEqual" +) + +func PossibleValuesForComparisonOperator() []string { + return []string{ + string(ComparisonOperatorGreaterThan), + string(ComparisonOperatorGreaterThanOrEqual), + string(ComparisonOperatorLessThan), + string(ComparisonOperatorLessThanOrEqual), + } +} + +func (s *ComparisonOperator) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseComparisonOperator(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseComparisonOperator(input string) (*ComparisonOperator, error) { + vals := map[string]ComparisonOperator{ + "greaterthan": ComparisonOperatorGreaterThan, + "greaterthanorequal": ComparisonOperatorGreaterThanOrEqual, + "lessthan": ComparisonOperatorLessThan, + "lessthanorequal": ComparisonOperatorLessThanOrEqual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ComparisonOperator(input) + return &out, nil +} + +type ContentEncoding string + +const ( + ContentEncodingBaseSixFour ContentEncoding = "Base64" + ContentEncodingNone ContentEncoding = "None" +) + +func PossibleValuesForContentEncoding() []string { + return []string{ + string(ContentEncodingBaseSixFour), + string(ContentEncodingNone), + } +} + +func (s *ContentEncoding) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseContentEncoding(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseContentEncoding(input string) (*ContentEncoding, error) { + vals := map[string]ContentEncoding{ + "base64": ContentEncodingBaseSixFour, + "none": ContentEncodingNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ContentEncoding(input) + return &out, nil +} + +type CurrentClusterAksVersionStatus string + +const ( + CurrentClusterAksVersionStatusDeprecated CurrentClusterAksVersionStatus = "Deprecated" + CurrentClusterAksVersionStatusSupported CurrentClusterAksVersionStatus = "Supported" +) + +func PossibleValuesForCurrentClusterAksVersionStatus() []string { + return []string{ + string(CurrentClusterAksVersionStatusDeprecated), + string(CurrentClusterAksVersionStatusSupported), + } +} + +func (s *CurrentClusterAksVersionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCurrentClusterAksVersionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCurrentClusterAksVersionStatus(input string) (*CurrentClusterAksVersionStatus, error) { + vals := map[string]CurrentClusterAksVersionStatus{ + "deprecated": CurrentClusterAksVersionStatusDeprecated, + "supported": CurrentClusterAksVersionStatusSupported, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CurrentClusterAksVersionStatus(input) + return &out, nil +} + +type CurrentClusterPoolAksVersionStatus string + +const ( + CurrentClusterPoolAksVersionStatusDeprecated CurrentClusterPoolAksVersionStatus = "Deprecated" + CurrentClusterPoolAksVersionStatusSupported CurrentClusterPoolAksVersionStatus = "Supported" +) + +func PossibleValuesForCurrentClusterPoolAksVersionStatus() []string { + return []string{ + string(CurrentClusterPoolAksVersionStatusDeprecated), + string(CurrentClusterPoolAksVersionStatusSupported), + } +} + +func (s *CurrentClusterPoolAksVersionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCurrentClusterPoolAksVersionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCurrentClusterPoolAksVersionStatus(input string) (*CurrentClusterPoolAksVersionStatus, error) { + vals := map[string]CurrentClusterPoolAksVersionStatus{ + "deprecated": CurrentClusterPoolAksVersionStatusDeprecated, + "supported": CurrentClusterPoolAksVersionStatusSupported, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CurrentClusterPoolAksVersionStatus(input) + return &out, nil +} + +type DataDiskType string + +const ( + DataDiskTypePremiumSSDLRS DataDiskType = "Premium_SSD_LRS" + DataDiskTypePremiumSSDVTwoLRS DataDiskType = "Premium_SSD_v2_LRS" + DataDiskTypePremiumSSDZRS DataDiskType = "Premium_SSD_ZRS" + DataDiskTypeStandardHDDLRS DataDiskType = "Standard_HDD_LRS" + DataDiskTypeStandardSSDLRS DataDiskType = "Standard_SSD_LRS" + DataDiskTypeStandardSSDZRS DataDiskType = "Standard_SSD_ZRS" +) + +func PossibleValuesForDataDiskType() []string { + return []string{ + string(DataDiskTypePremiumSSDLRS), + string(DataDiskTypePremiumSSDVTwoLRS), + string(DataDiskTypePremiumSSDZRS), + string(DataDiskTypeStandardHDDLRS), + string(DataDiskTypeStandardSSDLRS), + string(DataDiskTypeStandardSSDZRS), + } +} + +func (s *DataDiskType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDataDiskType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDataDiskType(input string) (*DataDiskType, error) { + vals := map[string]DataDiskType{ + "premium_ssd_lrs": DataDiskTypePremiumSSDLRS, + "premium_ssd_v2_lrs": DataDiskTypePremiumSSDVTwoLRS, + "premium_ssd_zrs": DataDiskTypePremiumSSDZRS, + "standard_hdd_lrs": DataDiskTypeStandardHDDLRS, + "standard_ssd_lrs": DataDiskTypeStandardSSDLRS, + "standard_ssd_zrs": DataDiskTypeStandardSSDZRS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DataDiskType(input) + return &out, nil +} + +type DbConnectionAuthenticationMode string + +const ( + DbConnectionAuthenticationModeIdentityAuth DbConnectionAuthenticationMode = "IdentityAuth" + DbConnectionAuthenticationModeSqlAuth DbConnectionAuthenticationMode = "SqlAuth" +) + +func PossibleValuesForDbConnectionAuthenticationMode() []string { + return []string{ + string(DbConnectionAuthenticationModeIdentityAuth), + string(DbConnectionAuthenticationModeSqlAuth), + } +} + +func (s *DbConnectionAuthenticationMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDbConnectionAuthenticationMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDbConnectionAuthenticationMode(input string) (*DbConnectionAuthenticationMode, error) { + vals := map[string]DbConnectionAuthenticationMode{ + "identityauth": DbConnectionAuthenticationModeIdentityAuth, + "sqlauth": DbConnectionAuthenticationModeSqlAuth, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DbConnectionAuthenticationMode(input) + return &out, nil +} + +type DeploymentMode string + +const ( + DeploymentModeApplication DeploymentMode = "Application" + DeploymentModeSession DeploymentMode = "Session" +) + +func PossibleValuesForDeploymentMode() []string { + return []string{ + string(DeploymentModeApplication), + string(DeploymentModeSession), + } +} + +func (s *DeploymentMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeploymentMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeploymentMode(input string) (*DeploymentMode, error) { + vals := map[string]DeploymentMode{ + "application": DeploymentModeApplication, + "session": DeploymentModeSession, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeploymentMode(input) + return &out, nil +} + +type JobType string + +const ( + JobTypeFlinkJob JobType = "FlinkJob" +) + +func PossibleValuesForJobType() []string { + return []string{ + string(JobTypeFlinkJob), + } +} + +func (s *JobType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseJobType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseJobType(input string) (*JobType, error) { + vals := map[string]JobType{ + "flinkjob": JobTypeFlinkJob, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := JobType(input) + return &out, nil +} + +type KeyVaultObjectType string + +const ( + KeyVaultObjectTypeCertificate KeyVaultObjectType = "Certificate" + KeyVaultObjectTypeKey KeyVaultObjectType = "Key" + KeyVaultObjectTypeSecret KeyVaultObjectType = "Secret" +) + +func PossibleValuesForKeyVaultObjectType() []string { + return []string{ + string(KeyVaultObjectTypeCertificate), + string(KeyVaultObjectTypeKey), + string(KeyVaultObjectTypeSecret), + } +} + +func (s *KeyVaultObjectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKeyVaultObjectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKeyVaultObjectType(input string) (*KeyVaultObjectType, error) { + vals := map[string]KeyVaultObjectType{ + "certificate": KeyVaultObjectTypeCertificate, + "key": KeyVaultObjectTypeKey, + "secret": KeyVaultObjectTypeSecret, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeyVaultObjectType(input) + return &out, nil +} + +type LibraryManagementAction string + +const ( + LibraryManagementActionInstall LibraryManagementAction = "Install" + LibraryManagementActionUninstall LibraryManagementAction = "Uninstall" +) + +func PossibleValuesForLibraryManagementAction() []string { + return []string{ + string(LibraryManagementActionInstall), + string(LibraryManagementActionUninstall), + } +} + +func (s *LibraryManagementAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLibraryManagementAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLibraryManagementAction(input string) (*LibraryManagementAction, error) { + vals := map[string]LibraryManagementAction{ + "install": LibraryManagementActionInstall, + "uninstall": LibraryManagementActionUninstall, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LibraryManagementAction(input) + return &out, nil +} + +type ManagedIdentityType string + +const ( + ManagedIdentityTypeCluster ManagedIdentityType = "cluster" + ManagedIdentityTypeInternal ManagedIdentityType = "internal" + ManagedIdentityTypeUser ManagedIdentityType = "user" +) + +func PossibleValuesForManagedIdentityType() []string { + return []string{ + string(ManagedIdentityTypeCluster), + string(ManagedIdentityTypeInternal), + string(ManagedIdentityTypeUser), + } +} + +func (s *ManagedIdentityType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedIdentityType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseManagedIdentityType(input string) (*ManagedIdentityType, error) { + vals := map[string]ManagedIdentityType{ + "cluster": ManagedIdentityTypeCluster, + "internal": ManagedIdentityTypeInternal, + "user": ManagedIdentityTypeUser, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ManagedIdentityType(input) + return &out, nil +} + +type MetastoreDbConnectionAuthenticationMode string + +const ( + MetastoreDbConnectionAuthenticationModeIdentityAuth MetastoreDbConnectionAuthenticationMode = "IdentityAuth" + MetastoreDbConnectionAuthenticationModeSqlAuth MetastoreDbConnectionAuthenticationMode = "SqlAuth" +) + +func PossibleValuesForMetastoreDbConnectionAuthenticationMode() []string { + return []string{ + string(MetastoreDbConnectionAuthenticationModeIdentityAuth), + string(MetastoreDbConnectionAuthenticationModeSqlAuth), + } +} + +func (s *MetastoreDbConnectionAuthenticationMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMetastoreDbConnectionAuthenticationMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMetastoreDbConnectionAuthenticationMode(input string) (*MetastoreDbConnectionAuthenticationMode, error) { + vals := map[string]MetastoreDbConnectionAuthenticationMode{ + "identityauth": MetastoreDbConnectionAuthenticationModeIdentityAuth, + "sqlauth": MetastoreDbConnectionAuthenticationModeSqlAuth, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MetastoreDbConnectionAuthenticationMode(input) + return &out, nil +} + +type OutboundType string + +const ( + OutboundTypeLoadBalancer OutboundType = "loadBalancer" + OutboundTypeUserDefinedRouting OutboundType = "userDefinedRouting" +) + +func PossibleValuesForOutboundType() []string { + return []string{ + string(OutboundTypeLoadBalancer), + 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, + "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 ProvisioningStatus string + +const ( + ProvisioningStatusAccepted ProvisioningStatus = "Accepted" + ProvisioningStatusCanceled ProvisioningStatus = "Canceled" + ProvisioningStatusFailed ProvisioningStatus = "Failed" + ProvisioningStatusSucceeded ProvisioningStatus = "Succeeded" +) + +func PossibleValuesForProvisioningStatus() []string { + return []string{ + string(ProvisioningStatusAccepted), + string(ProvisioningStatusCanceled), + string(ProvisioningStatusFailed), + string(ProvisioningStatusSucceeded), + } +} + +func (s *ProvisioningStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningStatus(input string) (*ProvisioningStatus, error) { + vals := map[string]ProvisioningStatus{ + "accepted": ProvisioningStatusAccepted, + "canceled": ProvisioningStatusCanceled, + "failed": ProvisioningStatusFailed, + "succeeded": ProvisioningStatusSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningStatus(input) + return &out, nil +} + +type RangerUsersyncMode string + +const ( + RangerUsersyncModeAutomatic RangerUsersyncMode = "automatic" + RangerUsersyncModeStatic RangerUsersyncMode = "static" +) + +func PossibleValuesForRangerUsersyncMode() []string { + return []string{ + string(RangerUsersyncModeAutomatic), + string(RangerUsersyncModeStatic), + } +} + +func (s *RangerUsersyncMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRangerUsersyncMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRangerUsersyncMode(input string) (*RangerUsersyncMode, error) { + vals := map[string]RangerUsersyncMode{ + "automatic": RangerUsersyncModeAutomatic, + "static": RangerUsersyncModeStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RangerUsersyncMode(input) + return &out, nil +} + +type ScaleActionType string + +const ( + ScaleActionTypeScaledown ScaleActionType = "scaledown" + ScaleActionTypeScaleup ScaleActionType = "scaleup" +) + +func PossibleValuesForScaleActionType() []string { + return []string{ + string(ScaleActionTypeScaledown), + string(ScaleActionTypeScaleup), + } +} + +func (s *ScaleActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScaleActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScaleActionType(input string) (*ScaleActionType, error) { + vals := map[string]ScaleActionType{ + "scaledown": ScaleActionTypeScaledown, + "scaleup": ScaleActionTypeScaleup, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScaleActionType(input) + return &out, nil +} + +type ScheduleDay string + +const ( + ScheduleDayFriday ScheduleDay = "Friday" + ScheduleDayMonday ScheduleDay = "Monday" + ScheduleDaySaturday ScheduleDay = "Saturday" + ScheduleDaySunday ScheduleDay = "Sunday" + ScheduleDayThursday ScheduleDay = "Thursday" + ScheduleDayTuesday ScheduleDay = "Tuesday" + ScheduleDayWednesday ScheduleDay = "Wednesday" +) + +func PossibleValuesForScheduleDay() []string { + return []string{ + string(ScheduleDayFriday), + string(ScheduleDayMonday), + string(ScheduleDaySaturday), + string(ScheduleDaySunday), + string(ScheduleDayThursday), + string(ScheduleDayTuesday), + string(ScheduleDayWednesday), + } +} + +func (s *ScheduleDay) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseScheduleDay(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseScheduleDay(input string) (*ScheduleDay, error) { + vals := map[string]ScheduleDay{ + "friday": ScheduleDayFriday, + "monday": ScheduleDayMonday, + "saturday": ScheduleDaySaturday, + "sunday": ScheduleDaySunday, + "thursday": ScheduleDayThursday, + "tuesday": ScheduleDayTuesday, + "wednesday": ScheduleDayWednesday, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ScheduleDay(input) + return &out, nil +} + +type Severity string + +const ( + SeverityCritical Severity = "critical" + SeverityHigh Severity = "high" + SeverityLow Severity = "low" + SeverityMedium Severity = "medium" +) + +func PossibleValuesForSeverity() []string { + return []string{ + string(SeverityCritical), + string(SeverityHigh), + string(SeverityLow), + string(SeverityMedium), + } +} + +func (s *Severity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSeverity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSeverity(input string) (*Severity, error) { + vals := map[string]Severity{ + "critical": SeverityCritical, + "high": SeverityHigh, + "low": SeverityLow, + "medium": SeverityMedium, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Severity(input) + return &out, nil +} + +type Status string + +const ( + StatusINSTALLED Status = "INSTALLED" + StatusINSTALLFAILED Status = "INSTALL_FAILED" + StatusINSTALLING Status = "INSTALLING" + StatusUNINSTALLFAILED Status = "UNINSTALL_FAILED" + StatusUNINSTALLING Status = "UNINSTALLING" +) + +func PossibleValuesForStatus() []string { + return []string{ + string(StatusINSTALLED), + string(StatusINSTALLFAILED), + string(StatusINSTALLING), + string(StatusUNINSTALLFAILED), + string(StatusUNINSTALLING), + } +} + +func (s *Status) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseStatus(input string) (*Status, error) { + vals := map[string]Status{ + "installed": StatusINSTALLED, + "install_failed": StatusINSTALLFAILED, + "installing": StatusINSTALLING, + "uninstall_failed": StatusUNINSTALLFAILED, + "uninstalling": StatusUNINSTALLING, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := Status(input) + return &out, nil +} + +type Type string + +const ( + TypeMaven Type = "maven" + TypePypi Type = "pypi" +) + +func PossibleValuesForType() []string { + return []string{ + string(TypeMaven), + string(TypePypi), + } +} + +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{ + "maven": TypeMaven, + "pypi": TypePypi, + } + 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 UpgradeMode string + +const ( + UpgradeModeLASTSTATEUPDATE UpgradeMode = "LAST_STATE_UPDATE" + UpgradeModeSTATELESSUPDATE UpgradeMode = "STATELESS_UPDATE" + UpgradeModeUPDATE UpgradeMode = "UPDATE" +) + +func PossibleValuesForUpgradeMode() []string { + return []string{ + string(UpgradeModeLASTSTATEUPDATE), + string(UpgradeModeSTATELESSUPDATE), + string(UpgradeModeUPDATE), + } +} + +func (s *UpgradeMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUpgradeMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUpgradeMode(input string) (*UpgradeMode, error) { + vals := map[string]UpgradeMode{ + "last_state_update": UpgradeModeLASTSTATEUPDATE, + "stateless_update": UpgradeModeSTATELESSUPDATE, + "update": UpgradeModeUPDATE, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UpgradeMode(input) + return &out, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster.go b/resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster.go new file mode 100644 index 00000000000..838bcc9d92a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster.go @@ -0,0 +1,139 @@ +package hdinsights + +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(&ClusterId{}) +} + +var _ resourceids.ResourceId = &ClusterId{} + +// ClusterId is a struct representing the Resource ID for a Cluster +type ClusterId struct { + SubscriptionId string + ResourceGroupName string + ClusterPoolName string + ClusterName string +} + +// NewClusterID returns a new ClusterId struct +func NewClusterID(subscriptionId string, resourceGroupName string, clusterPoolName string, clusterName string) ClusterId { + return ClusterId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ClusterPoolName: clusterPoolName, + ClusterName: clusterName, + } +} + +// ParseClusterID parses 'input' into a ClusterId +func ParseClusterID(input string) (*ClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ClusterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseClusterIDInsensitively parses 'input' case-insensitively into a ClusterId +// note: this method should only be used for API response data and not user input +func ParseClusterIDInsensitively(input string) (*ClusterId, error) { + parser := resourceids.NewParserFromResourceIdType(&ClusterId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ClusterId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ClusterId) 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.ClusterPoolName, ok = input.Parsed["clusterPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "clusterPoolName", input) + } + + if id.ClusterName, ok = input.Parsed["clusterName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "clusterName", input) + } + + return nil +} + +// ValidateClusterID checks that 'input' can be parsed as a Cluster ID +func ValidateClusterID(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 := ParseClusterID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cluster ID +func (id ClusterId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusterPools/%s/clusters/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterPoolName, id.ClusterName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cluster ID +func (id ClusterId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), + resourceids.StaticSegment("staticClusterPools", "clusterPools", "clusterPools"), + resourceids.UserSpecifiedSegment("clusterPoolName", "clusterPoolValue"), + resourceids.StaticSegment("staticClusters", "clusters", "clusters"), + resourceids.UserSpecifiedSegment("clusterName", "clusterValue"), + } +} + +// String returns a human-readable description of this Cluster ID +func (id ClusterId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cluster Pool Name: %q", id.ClusterPoolName), + fmt.Sprintf("Cluster Name: %q", id.ClusterName), + } + return fmt.Sprintf("Cluster (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster_test.go b/resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster_test.go new file mode 100644 index 00000000000..0232380fe70 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/id_cluster_test.go @@ -0,0 +1,327 @@ +package hdinsights + +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 = &ClusterId{} + +func TestNewClusterID(t *testing.T) { + id := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue") + + 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.ClusterPoolName != "clusterPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'ClusterPoolName'", id.ClusterPoolName, "clusterPoolValue") + } + + if id.ClusterName != "clusterValue" { + t.Fatalf("Expected %q but got %q for Segment 'ClusterName'", id.ClusterName, "clusterValue") + } +} + +func TestFormatClusterID(t *testing.T) { + actual := NewClusterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue", "clusterValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters/clusterValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseClusterID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ClusterId + }{ + { + // 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.HDInsight", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters/clusterValue", + Expected: &ClusterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ClusterPoolName: "clusterPoolValue", + ClusterName: "clusterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters/clusterValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseClusterID(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.ClusterPoolName != v.Expected.ClusterPoolName { + t.Fatalf("Expected %q but got %q for ClusterPoolName", v.Expected.ClusterPoolName, actual.ClusterPoolName) + } + + if actual.ClusterName != v.Expected.ClusterName { + t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) + } + + } +} + +func TestParseClusterIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ClusterId + }{ + { + // 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.HDInsight", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErPoOlS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErPoOlS/cLuStErPoOlVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErPoOlS/cLuStErPoOlVaLuE/cLuStErS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters/clusterValue", + Expected: &ClusterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ClusterPoolName: "clusterPoolValue", + ClusterName: "clusterValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/clusters/clusterValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErPoOlS/cLuStErPoOlVaLuE/cLuStErS/cLuStErVaLuE", + Expected: &ClusterId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ClusterPoolName: "cLuStErPoOlVaLuE", + ClusterName: "cLuStErVaLuE", + }, + }, + { + // 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.hDiNsIgHt/cLuStErPoOlS/cLuStErPoOlVaLuE/cLuStErS/cLuStErVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseClusterIDInsensitively(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.ClusterPoolName != v.Expected.ClusterPoolName { + t.Fatalf("Expected %q but got %q for ClusterPoolName", v.Expected.ClusterPoolName, actual.ClusterPoolName) + } + + if actual.ClusterName != v.Expected.ClusterName { + t.Fatalf("Expected %q but got %q for ClusterName", v.Expected.ClusterName, actual.ClusterName) + } + + } +} + +func TestSegmentsForClusterId(t *testing.T) { + segments := ClusterId{}.Segments() + if len(segments) == 0 { + t.Fatalf("ClusterId 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/hdinsight/2024-05-01/hdinsights/id_clusterpool.go b/resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool.go new file mode 100644 index 00000000000..2beedab67dd --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool.go @@ -0,0 +1,130 @@ +package hdinsights + +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(&ClusterPoolId{}) +} + +var _ resourceids.ResourceId = &ClusterPoolId{} + +// ClusterPoolId is a struct representing the Resource ID for a Cluster Pool +type ClusterPoolId struct { + SubscriptionId string + ResourceGroupName string + ClusterPoolName string +} + +// NewClusterPoolID returns a new ClusterPoolId struct +func NewClusterPoolID(subscriptionId string, resourceGroupName string, clusterPoolName string) ClusterPoolId { + return ClusterPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + ClusterPoolName: clusterPoolName, + } +} + +// ParseClusterPoolID parses 'input' into a ClusterPoolId +func ParseClusterPoolID(input string) (*ClusterPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&ClusterPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ClusterPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseClusterPoolIDInsensitively parses 'input' case-insensitively into a ClusterPoolId +// note: this method should only be used for API response data and not user input +func ParseClusterPoolIDInsensitively(input string) (*ClusterPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&ClusterPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ClusterPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ClusterPoolId) 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.ClusterPoolName, ok = input.Parsed["clusterPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "clusterPoolName", input) + } + + return nil +} + +// ValidateClusterPoolID checks that 'input' can be parsed as a Cluster Pool ID +func ValidateClusterPoolID(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 := ParseClusterPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Cluster Pool ID +func (id ClusterPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.HDInsight/clusterPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ClusterPoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Cluster Pool ID +func (id ClusterPoolId) 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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), + resourceids.StaticSegment("staticClusterPools", "clusterPools", "clusterPools"), + resourceids.UserSpecifiedSegment("clusterPoolName", "clusterPoolValue"), + } +} + +// String returns a human-readable description of this Cluster Pool ID +func (id ClusterPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Cluster Pool Name: %q", id.ClusterPoolName), + } + return fmt.Sprintf("Cluster Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool_test.go b/resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool_test.go new file mode 100644 index 00000000000..925f924ff77 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/id_clusterpool_test.go @@ -0,0 +1,282 @@ +package hdinsights + +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 = &ClusterPoolId{} + +func TestNewClusterPoolID(t *testing.T) { + id := NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue") + + 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.ClusterPoolName != "clusterPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'ClusterPoolName'", id.ClusterPoolName, "clusterPoolValue") + } +} + +func TestFormatClusterPoolID(t *testing.T) { + actual := NewClusterPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "clusterPoolValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseClusterPoolID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ClusterPoolId + }{ + { + // 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.HDInsight", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue", + Expected: &ClusterPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ClusterPoolName: "clusterPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseClusterPoolID(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.ClusterPoolName != v.Expected.ClusterPoolName { + t.Fatalf("Expected %q but got %q for ClusterPoolName", v.Expected.ClusterPoolName, actual.ClusterPoolName) + } + + } +} + +func TestParseClusterPoolIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ClusterPoolId + }{ + { + // 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.HDInsight", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErPoOlS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue", + Expected: &ClusterPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + ClusterPoolName: "clusterPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.HDInsight/clusterPools/clusterPoolValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/cLuStErPoOlS/cLuStErPoOlVaLuE", + Expected: &ClusterPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + ClusterPoolName: "cLuStErPoOlVaLuE", + }, + }, + { + // 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.hDiNsIgHt/cLuStErPoOlS/cLuStErPoOlVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseClusterPoolIDInsensitively(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.ClusterPoolName != v.Expected.ClusterPoolName { + t.Fatalf("Expected %q but got %q for ClusterPoolName", v.Expected.ClusterPoolName, actual.ClusterPoolName) + } + + } +} + +func TestSegmentsForClusterPoolId(t *testing.T) { + segments := ClusterPoolId{}.Segments() + if len(segments) == 0 { + t.Fatalf("ClusterPoolId 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/hdinsight/2024-05-01/hdinsights/id_location.go b/resource-manager/hdinsight/2024-05-01/hdinsights/id_location.go new file mode 100644 index 00000000000..dc1e2cb9cfe --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/id_location.go @@ -0,0 +1,121 @@ +package hdinsights + +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.HDInsight/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("staticMicrosoftHDInsight", "Microsoft.HDInsight", "Microsoft.HDInsight"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationValue"), + } +} + +// 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/hdinsight/2024-05-01/hdinsights/id_location_test.go b/resource-manager/hdinsight/2024-05-01/hdinsights/id_location_test.go new file mode 100644 index 00000000000..a4b1173e0b2 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/id_location_test.go @@ -0,0 +1,237 @@ +package hdinsights + +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", "locationValue") + + 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 != "locationValue" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") + } +} + +func TestFormatLocationID(t *testing.T) { + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue" + 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.HDInsight", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue/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.HDInsight", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.HDInsight/locations/locationValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoNvAlUe", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "lOcAtIoNvAlUe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.hDiNsIgHt/lOcAtIoNs/lOcAtIoNvAlUe/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/hdinsight/2024-05-01/hdinsights/method_availableclusterpoolversionslistbylocation.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterpoolversionslistbylocation.go new file mode 100644 index 00000000000..53bd78e1332 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterpoolversionslistbylocation.go @@ -0,0 +1,91 @@ +package hdinsights + +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 AvailableClusterPoolVersionsListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterPoolVersion +} + +type AvailableClusterPoolVersionsListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterPoolVersion +} + +// AvailableClusterPoolVersionsListByLocation ... +func (c HdinsightsClient) AvailableClusterPoolVersionsListByLocation(ctx context.Context, id LocationId) (result AvailableClusterPoolVersionsListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/availableClusterPoolVersions", 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 *[]ClusterPoolVersion `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// AvailableClusterPoolVersionsListByLocationComplete retrieves all the results into a single object +func (c HdinsightsClient) AvailableClusterPoolVersionsListByLocationComplete(ctx context.Context, id LocationId) (AvailableClusterPoolVersionsListByLocationCompleteResult, error) { + return c.AvailableClusterPoolVersionsListByLocationCompleteMatchingPredicate(ctx, id, ClusterPoolVersionOperationPredicate{}) +} + +// AvailableClusterPoolVersionsListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) AvailableClusterPoolVersionsListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate ClusterPoolVersionOperationPredicate) (result AvailableClusterPoolVersionsListByLocationCompleteResult, err error) { + items := make([]ClusterPoolVersion, 0) + + resp, err := c.AvailableClusterPoolVersionsListByLocation(ctx, id) + if err != nil { + 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 = AvailableClusterPoolVersionsListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterversionslistbylocation.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterversionslistbylocation.go new file mode 100644 index 00000000000..8f2fc96f36d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_availableclusterversionslistbylocation.go @@ -0,0 +1,91 @@ +package hdinsights + +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 AvailableClusterVersionsListByLocationOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterVersion +} + +type AvailableClusterVersionsListByLocationCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterVersion +} + +// AvailableClusterVersionsListByLocation ... +func (c HdinsightsClient) AvailableClusterVersionsListByLocation(ctx context.Context, id LocationId) (result AvailableClusterVersionsListByLocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/availableClusterVersions", 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 *[]ClusterVersion `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// AvailableClusterVersionsListByLocationComplete retrieves all the results into a single object +func (c HdinsightsClient) AvailableClusterVersionsListByLocationComplete(ctx context.Context, id LocationId) (AvailableClusterVersionsListByLocationCompleteResult, error) { + return c.AvailableClusterVersionsListByLocationCompleteMatchingPredicate(ctx, id, ClusterVersionOperationPredicate{}) +} + +// AvailableClusterVersionsListByLocationCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) AvailableClusterVersionsListByLocationCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate ClusterVersionOperationPredicate) (result AvailableClusterVersionsListByLocationCompleteResult, err error) { + items := make([]ClusterVersion, 0) + + resp, err := c.AvailableClusterVersionsListByLocation(ctx, id) + if err != nil { + 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 = AvailableClusterVersionsListByLocationCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusteravailableupgradeslist.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusteravailableupgradeslist.go new file mode 100644 index 00000000000..76ee858439c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusteravailableupgradeslist.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClusterAvailableUpgradesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterAvailableUpgrade +} + +type ClusterAvailableUpgradesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterAvailableUpgrade +} + +// ClusterAvailableUpgradesList ... +func (c HdinsightsClient) ClusterAvailableUpgradesList(ctx context.Context, id ClusterId) (result ClusterAvailableUpgradesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/availableUpgrades", 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 *[]ClusterAvailableUpgrade `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterAvailableUpgradesListComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterAvailableUpgradesListComplete(ctx context.Context, id ClusterId) (ClusterAvailableUpgradesListCompleteResult, error) { + return c.ClusterAvailableUpgradesListCompleteMatchingPredicate(ctx, id, ClusterAvailableUpgradeOperationPredicate{}) +} + +// ClusterAvailableUpgradesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterAvailableUpgradesListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ClusterAvailableUpgradeOperationPredicate) (result ClusterAvailableUpgradesListCompleteResult, err error) { + items := make([]ClusterAvailableUpgrade, 0) + + resp, err := c.ClusterAvailableUpgradesList(ctx, id) + if err != nil { + 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 = ClusterAvailableUpgradesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobslist.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobslist.go new file mode 100644 index 00000000000..1604bb08a21 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobslist.go @@ -0,0 +1,119 @@ +package hdinsights + +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 ClusterJobsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterJob +} + +type ClusterJobsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterJob +} + +type ClusterJobsListOperationOptions struct { + Filter *string +} + +func DefaultClusterJobsListOperationOptions() ClusterJobsListOperationOptions { + return ClusterJobsListOperationOptions{} +} + +func (o ClusterJobsListOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ClusterJobsListOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ClusterJobsListOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ClusterJobsList ... +func (c HdinsightsClient) ClusterJobsList(ctx context.Context, id ClusterId, options ClusterJobsListOperationOptions) (result ClusterJobsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/jobs", id.ID()), + OptionsObject: options, + } + + 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 *[]ClusterJob `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterJobsListComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterJobsListComplete(ctx context.Context, id ClusterId, options ClusterJobsListOperationOptions) (ClusterJobsListCompleteResult, error) { + return c.ClusterJobsListCompleteMatchingPredicate(ctx, id, options, ClusterJobOperationPredicate{}) +} + +// ClusterJobsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterJobsListCompleteMatchingPredicate(ctx context.Context, id ClusterId, options ClusterJobsListOperationOptions, predicate ClusterJobOperationPredicate) (result ClusterJobsListCompleteResult, err error) { + items := make([]ClusterJob, 0) + + resp, err := c.ClusterJobsList(ctx, id, options) + if err != nil { + 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 = ClusterJobsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobsrunjob.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobsrunjob.go new file mode 100644 index 00000000000..8cb0b836527 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterjobsrunjob.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClusterJobsRunJobOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ClusterJob +} + +// ClusterJobsRunJob ... +func (c HdinsightsClient) ClusterJobsRunJob(ctx context.Context, id ClusterId, input ClusterJob) (result ClusterJobsRunJobOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/runJob", 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 +} + +// ClusterJobsRunJobThenPoll performs ClusterJobsRunJob then polls until it's completed +func (c HdinsightsClient) ClusterJobsRunJobThenPoll(ctx context.Context, id ClusterId, input ClusterJob) error { + result, err := c.ClusterJobsRunJob(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClusterJobsRunJob: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClusterJobsRunJob: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrarieslist.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrarieslist.go new file mode 100644 index 00000000000..c25a7c2eae5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrarieslist.go @@ -0,0 +1,119 @@ +package hdinsights + +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 ClusterLibrariesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterLibrary +} + +type ClusterLibrariesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterLibrary +} + +type ClusterLibrariesListOperationOptions struct { + Category *Category +} + +func DefaultClusterLibrariesListOperationOptions() ClusterLibrariesListOperationOptions { + return ClusterLibrariesListOperationOptions{} +} + +func (o ClusterLibrariesListOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ClusterLibrariesListOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ClusterLibrariesListOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Category != nil { + out.Append("$category", fmt.Sprintf("%v", *o.Category)) + } + return &out +} + +// ClusterLibrariesList ... +func (c HdinsightsClient) ClusterLibrariesList(ctx context.Context, id ClusterId, options ClusterLibrariesListOperationOptions) (result ClusterLibrariesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/libraries", id.ID()), + OptionsObject: options, + } + + 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 *[]ClusterLibrary `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterLibrariesListComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterLibrariesListComplete(ctx context.Context, id ClusterId, options ClusterLibrariesListOperationOptions) (ClusterLibrariesListCompleteResult, error) { + return c.ClusterLibrariesListCompleteMatchingPredicate(ctx, id, options, ClusterLibraryOperationPredicate{}) +} + +// ClusterLibrariesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterLibrariesListCompleteMatchingPredicate(ctx context.Context, id ClusterId, options ClusterLibrariesListOperationOptions, predicate ClusterLibraryOperationPredicate) (result ClusterLibrariesListCompleteResult, err error) { + items := make([]ClusterLibrary, 0) + + resp, err := c.ClusterLibrariesList(ctx, id, options) + if err != nil { + 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 = ClusterLibrariesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrariesmanagelibraries.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrariesmanagelibraries.go new file mode 100644 index 00000000000..356c435a7e4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterlibrariesmanagelibraries.go @@ -0,0 +1,73 @@ +package hdinsights + +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 ClusterLibrariesManageLibrariesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ClusterLibrariesManageLibraries ... +func (c HdinsightsClient) ClusterLibrariesManageLibraries(ctx context.Context, id ClusterId, input ClusterLibraryManagementOperation) (result ClusterLibrariesManageLibrariesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/manageLibraries", 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 +} + +// ClusterLibrariesManageLibrariesThenPoll performs ClusterLibrariesManageLibraries then polls until it's completed +func (c HdinsightsClient) ClusterLibrariesManageLibrariesThenPoll(ctx context.Context, id ClusterId, input ClusterLibraryManagementOperation) error { + result, err := c.ClusterLibrariesManageLibraries(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClusterLibrariesManageLibraries: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClusterLibrariesManageLibraries: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolavailableupgradeslist.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolavailableupgradeslist.go new file mode 100644 index 00000000000..068cbb65ffa --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolavailableupgradeslist.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClusterPoolAvailableUpgradesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterPoolAvailableUpgrade +} + +type ClusterPoolAvailableUpgradesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterPoolAvailableUpgrade +} + +// ClusterPoolAvailableUpgradesList ... +func (c HdinsightsClient) ClusterPoolAvailableUpgradesList(ctx context.Context, id ClusterPoolId) (result ClusterPoolAvailableUpgradesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/availableUpgrades", 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 *[]ClusterPoolAvailableUpgrade `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterPoolAvailableUpgradesListComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterPoolAvailableUpgradesListComplete(ctx context.Context, id ClusterPoolId) (ClusterPoolAvailableUpgradesListCompleteResult, error) { + return c.ClusterPoolAvailableUpgradesListCompleteMatchingPredicate(ctx, id, ClusterPoolAvailableUpgradeOperationPredicate{}) +} + +// ClusterPoolAvailableUpgradesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterPoolAvailableUpgradesListCompleteMatchingPredicate(ctx context.Context, id ClusterPoolId, predicate ClusterPoolAvailableUpgradeOperationPredicate) (result ClusterPoolAvailableUpgradesListCompleteResult, err error) { + items := make([]ClusterPoolAvailableUpgrade, 0) + + resp, err := c.ClusterPoolAvailableUpgradesList(ctx, id) + if err != nil { + 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 = ClusterPoolAvailableUpgradesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolscreateorupdate.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolscreateorupdate.go new file mode 100644 index 00000000000..87418dfa671 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolscreateorupdate.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClusterPoolsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ClusterPool +} + +// ClusterPoolsCreateOrUpdate ... +func (c HdinsightsClient) ClusterPoolsCreateOrUpdate(ctx context.Context, id ClusterPoolId, input ClusterPool) (result ClusterPoolsCreateOrUpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ClusterPoolsCreateOrUpdateThenPoll performs ClusterPoolsCreateOrUpdate then polls until it's completed +func (c HdinsightsClient) ClusterPoolsCreateOrUpdateThenPoll(ctx context.Context, id ClusterPoolId, input ClusterPool) error { + result, err := c.ClusterPoolsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClusterPoolsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClusterPoolsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsdelete.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsdelete.go new file mode 100644 index 00000000000..bed6128986f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsdelete.go @@ -0,0 +1,71 @@ +package hdinsights + +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 ClusterPoolsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ClusterPoolsDelete ... +func (c HdinsightsClient) ClusterPoolsDelete(ctx context.Context, id ClusterPoolId) (result ClusterPoolsDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 +} + +// ClusterPoolsDeleteThenPoll performs ClusterPoolsDelete then polls until it's completed +func (c HdinsightsClient) ClusterPoolsDeleteThenPoll(ctx context.Context, id ClusterPoolId) error { + result, err := c.ClusterPoolsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing ClusterPoolsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClusterPoolsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsget.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsget.go new file mode 100644 index 00000000000..cae158d84f2 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsget.go @@ -0,0 +1,54 @@ +package hdinsights + +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 ClusterPoolsGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ClusterPool +} + +// ClusterPoolsGet ... +func (c HdinsightsClient) ClusterPoolsGet(ctx context.Context, id ClusterPoolId) (result ClusterPoolsGetOperationResponse, 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 ClusterPool + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbyresourcegroup.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbyresourcegroup.go new file mode 100644 index 00000000000..5723bbdb922 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbyresourcegroup.go @@ -0,0 +1,92 @@ +package hdinsights + +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 ClusterPoolsListByResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterPool +} + +type ClusterPoolsListByResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterPool +} + +// ClusterPoolsListByResourceGroup ... +func (c HdinsightsClient) ClusterPoolsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ClusterPoolsListByResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HDInsight/clusterPools", 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 *[]ClusterPool `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterPoolsListByResourceGroupComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterPoolsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ClusterPoolsListByResourceGroupCompleteResult, error) { + return c.ClusterPoolsListByResourceGroupCompleteMatchingPredicate(ctx, id, ClusterPoolOperationPredicate{}) +} + +// ClusterPoolsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterPoolsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ClusterPoolOperationPredicate) (result ClusterPoolsListByResourceGroupCompleteResult, err error) { + items := make([]ClusterPool, 0) + + resp, err := c.ClusterPoolsListByResourceGroup(ctx, id) + if err != nil { + 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 = ClusterPoolsListByResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbysubscription.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbysubscription.go new file mode 100644 index 00000000000..acbc3f6a28c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolslistbysubscription.go @@ -0,0 +1,92 @@ +package hdinsights + +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 ClusterPoolsListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterPool +} + +type ClusterPoolsListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterPool +} + +// ClusterPoolsListBySubscription ... +func (c HdinsightsClient) ClusterPoolsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ClusterPoolsListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.HDInsight/clusterPools", 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 *[]ClusterPool `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterPoolsListBySubscriptionComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterPoolsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ClusterPoolsListBySubscriptionCompleteResult, error) { + return c.ClusterPoolsListBySubscriptionCompleteMatchingPredicate(ctx, id, ClusterPoolOperationPredicate{}) +} + +// ClusterPoolsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterPoolsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ClusterPoolOperationPredicate) (result ClusterPoolsListBySubscriptionCompleteResult, err error) { + items := make([]ClusterPool, 0) + + resp, err := c.ClusterPoolsListBySubscription(ctx, id) + if err != nil { + 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 = ClusterPoolsListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupdatetags.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupdatetags.go new file mode 100644 index 00000000000..f9cad6f0f9e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupdatetags.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClusterPoolsUpdateTagsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ClusterPool +} + +// ClusterPoolsUpdateTags ... +func (c HdinsightsClient) ClusterPoolsUpdateTags(ctx context.Context, id ClusterPoolId, input TagsObject) (result ClusterPoolsUpdateTagsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ClusterPoolsUpdateTagsThenPoll performs ClusterPoolsUpdateTags then polls until it's completed +func (c HdinsightsClient) ClusterPoolsUpdateTagsThenPoll(ctx context.Context, id ClusterPoolId, input TagsObject) error { + result, err := c.ClusterPoolsUpdateTags(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClusterPoolsUpdateTags: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClusterPoolsUpdateTags: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupgrade.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupgrade.go new file mode 100644 index 00000000000..531ec4096a6 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolsupgrade.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClusterPoolsUpgradeOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *ClusterPool +} + +// ClusterPoolsUpgrade ... +func (c HdinsightsClient) ClusterPoolsUpgrade(ctx context.Context, id ClusterPoolId, input ClusterPoolUpgrade) (result ClusterPoolsUpgradeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/upgrade", 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 +} + +// ClusterPoolsUpgradeThenPoll performs ClusterPoolsUpgrade then polls until it's completed +func (c HdinsightsClient) ClusterPoolsUpgradeThenPoll(ctx context.Context, id ClusterPoolId, input ClusterPoolUpgrade) error { + result, err := c.ClusterPoolsUpgrade(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClusterPoolsUpgrade: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClusterPoolsUpgrade: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolupgradehistorieslist.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolupgradehistorieslist.go new file mode 100644 index 00000000000..6f5d18c8234 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterpoolupgradehistorieslist.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClusterPoolUpgradeHistoriesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterPoolUpgradeHistory +} + +type ClusterPoolUpgradeHistoriesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterPoolUpgradeHistory +} + +// ClusterPoolUpgradeHistoriesList ... +func (c HdinsightsClient) ClusterPoolUpgradeHistoriesList(ctx context.Context, id ClusterPoolId) (result ClusterPoolUpgradeHistoriesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/upgradeHistories", 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 *[]ClusterPoolUpgradeHistory `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterPoolUpgradeHistoriesListComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterPoolUpgradeHistoriesListComplete(ctx context.Context, id ClusterPoolId) (ClusterPoolUpgradeHistoriesListCompleteResult, error) { + return c.ClusterPoolUpgradeHistoriesListCompleteMatchingPredicate(ctx, id, ClusterPoolUpgradeHistoryOperationPredicate{}) +} + +// ClusterPoolUpgradeHistoriesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterPoolUpgradeHistoriesListCompleteMatchingPredicate(ctx context.Context, id ClusterPoolId, predicate ClusterPoolUpgradeHistoryOperationPredicate) (result ClusterPoolUpgradeHistoriesListCompleteResult, err error) { + items := make([]ClusterPoolUpgradeHistory, 0) + + resp, err := c.ClusterPoolUpgradeHistoriesList(ctx, id) + if err != nil { + 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 = ClusterPoolUpgradeHistoriesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterscreate.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterscreate.go new file mode 100644 index 00000000000..0253bcc95e2 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterscreate.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClustersCreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// ClustersCreate ... +func (c HdinsightsClient) ClustersCreate(ctx context.Context, id ClusterId, input Cluster) (result ClustersCreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ClustersCreateThenPoll performs ClustersCreate then polls until it's completed +func (c HdinsightsClient) ClustersCreateThenPoll(ctx context.Context, id ClusterId, input Cluster) error { + result, err := c.ClustersCreate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClustersCreate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClustersCreate: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersdelete.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersdelete.go new file mode 100644 index 00000000000..238ddf71419 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersdelete.go @@ -0,0 +1,71 @@ +package hdinsights + +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 ClustersDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// ClustersDelete ... +func (c HdinsightsClient) ClustersDelete(ctx context.Context, id ClusterId) (result ClustersDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 +} + +// ClustersDeleteThenPoll performs ClustersDelete then polls until it's completed +func (c HdinsightsClient) ClustersDeleteThenPoll(ctx context.Context, id ClusterId) error { + result, err := c.ClustersDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing ClustersDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClustersDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersget.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersget.go new file mode 100644 index 00000000000..d38f3d7a77e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersget.go @@ -0,0 +1,54 @@ +package hdinsights + +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 ClustersGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// ClustersGet ... +func (c HdinsightsClient) ClustersGet(ctx context.Context, id ClusterId) (result ClustersGetOperationResponse, 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 Cluster + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersgetinstanceview.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersgetinstanceview.go new file mode 100644 index 00000000000..44b87c6005d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersgetinstanceview.go @@ -0,0 +1,55 @@ +package hdinsights + +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 ClustersGetInstanceViewOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ClusterInstanceViewResult +} + +// ClustersGetInstanceView ... +func (c HdinsightsClient) ClustersGetInstanceView(ctx context.Context, id ClusterId) (result ClustersGetInstanceViewOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/instanceViews/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 ClusterInstanceViewResult + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistbyclusterpoolname.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistbyclusterpoolname.go new file mode 100644 index 00000000000..5e19c410d3f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistbyclusterpoolname.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClustersListByClusterPoolNameOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Cluster +} + +type ClustersListByClusterPoolNameCompleteResult struct { + LatestHttpResponse *http.Response + Items []Cluster +} + +// ClustersListByClusterPoolName ... +func (c HdinsightsClient) ClustersListByClusterPoolName(ctx context.Context, id ClusterPoolId) (result ClustersListByClusterPoolNameOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/clusters", 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 *[]Cluster `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClustersListByClusterPoolNameComplete retrieves all the results into a single object +func (c HdinsightsClient) ClustersListByClusterPoolNameComplete(ctx context.Context, id ClusterPoolId) (ClustersListByClusterPoolNameCompleteResult, error) { + return c.ClustersListByClusterPoolNameCompleteMatchingPredicate(ctx, id, ClusterOperationPredicate{}) +} + +// ClustersListByClusterPoolNameCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClustersListByClusterPoolNameCompleteMatchingPredicate(ctx context.Context, id ClusterPoolId, predicate ClusterOperationPredicate) (result ClustersListByClusterPoolNameCompleteResult, err error) { + items := make([]Cluster, 0) + + resp, err := c.ClustersListByClusterPoolName(ctx, id) + if err != nil { + 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 = ClustersListByClusterPoolNameCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistinstanceviews.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistinstanceviews.go new file mode 100644 index 00000000000..e6687d7ef75 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistinstanceviews.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClustersListInstanceViewsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterInstanceViewResult +} + +type ClustersListInstanceViewsCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterInstanceViewResult +} + +// ClustersListInstanceViews ... +func (c HdinsightsClient) ClustersListInstanceViews(ctx context.Context, id ClusterId) (result ClustersListInstanceViewsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/instanceViews", 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 *[]ClusterInstanceViewResult `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClustersListInstanceViewsComplete retrieves all the results into a single object +func (c HdinsightsClient) ClustersListInstanceViewsComplete(ctx context.Context, id ClusterId) (ClustersListInstanceViewsCompleteResult, error) { + return c.ClustersListInstanceViewsCompleteMatchingPredicate(ctx, id, ClusterInstanceViewResultOperationPredicate{}) +} + +// ClustersListInstanceViewsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClustersListInstanceViewsCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ClusterInstanceViewResultOperationPredicate) (result ClustersListInstanceViewsCompleteResult, err error) { + items := make([]ClusterInstanceViewResult, 0) + + resp, err := c.ClustersListInstanceViews(ctx, id) + if err != nil { + 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 = ClustersListInstanceViewsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistserviceconfigs.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistserviceconfigs.go new file mode 100644 index 00000000000..9c235f0b739 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterslistserviceconfigs.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClustersListServiceConfigsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ServiceConfigResult +} + +type ClustersListServiceConfigsCompleteResult struct { + LatestHttpResponse *http.Response + Items []ServiceConfigResult +} + +// ClustersListServiceConfigs ... +func (c HdinsightsClient) ClustersListServiceConfigs(ctx context.Context, id ClusterId) (result ClustersListServiceConfigsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/serviceConfigs", 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 *[]ServiceConfigResult `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClustersListServiceConfigsComplete retrieves all the results into a single object +func (c HdinsightsClient) ClustersListServiceConfigsComplete(ctx context.Context, id ClusterId) (ClustersListServiceConfigsCompleteResult, error) { + return c.ClustersListServiceConfigsCompleteMatchingPredicate(ctx, id, ServiceConfigResultOperationPredicate{}) +} + +// ClustersListServiceConfigsCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClustersListServiceConfigsCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ServiceConfigResultOperationPredicate) (result ClustersListServiceConfigsCompleteResult, err error) { + items := make([]ServiceConfigResult, 0) + + resp, err := c.ClustersListServiceConfigs(ctx, id) + if err != nil { + 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 = ClustersListServiceConfigsCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersresize.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersresize.go new file mode 100644 index 00000000000..57787fbfc8a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersresize.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClustersResizeOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// ClustersResize ... +func (c HdinsightsClient) ClustersResize(ctx context.Context, id ClusterId, input ClusterResizeData) (result ClustersResizeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resize", 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 +} + +// ClustersResizeThenPoll performs ClustersResize then polls until it's completed +func (c HdinsightsClient) ClustersResizeThenPoll(ctx context.Context, id ClusterId, input ClusterResizeData) error { + result, err := c.ClustersResize(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClustersResize: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClustersResize: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupdate.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupdate.go new file mode 100644 index 00000000000..ea9e7bc5bbf --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupdate.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClustersUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// ClustersUpdate ... +func (c HdinsightsClient) ClustersUpdate(ctx context.Context, id ClusterId, input ClusterPatch) (result ClustersUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// ClustersUpdateThenPoll performs ClustersUpdate then polls until it's completed +func (c HdinsightsClient) ClustersUpdateThenPoll(ctx context.Context, id ClusterId, input ClusterPatch) error { + result, err := c.ClustersUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClustersUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClustersUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrade.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrade.go new file mode 100644 index 00000000000..c1dad094835 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrade.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClustersUpgradeOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// ClustersUpgrade ... +func (c HdinsightsClient) ClustersUpgrade(ctx context.Context, id ClusterId, input ClusterUpgrade) (result ClustersUpgradeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/upgrade", 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 +} + +// ClustersUpgradeThenPoll performs ClustersUpgrade then polls until it's completed +func (c HdinsightsClient) ClustersUpgradeThenPoll(ctx context.Context, id ClusterId, input ClusterUpgrade) error { + result, err := c.ClustersUpgrade(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClustersUpgrade: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClustersUpgrade: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrademanualrollback.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrademanualrollback.go new file mode 100644 index 00000000000..706e95c716c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clustersupgrademanualrollback.go @@ -0,0 +1,75 @@ +package hdinsights + +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 ClustersUpgradeManualRollbackOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Cluster +} + +// ClustersUpgradeManualRollback ... +func (c HdinsightsClient) ClustersUpgradeManualRollback(ctx context.Context, id ClusterId, input ClusterUpgradeRollback) (result ClustersUpgradeManualRollbackOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/rollback", 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 +} + +// ClustersUpgradeManualRollbackThenPoll performs ClustersUpgradeManualRollback then polls until it's completed +func (c HdinsightsClient) ClustersUpgradeManualRollbackThenPoll(ctx context.Context, id ClusterId, input ClusterUpgradeRollback) error { + result, err := c.ClustersUpgradeManualRollback(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ClustersUpgradeManualRollback: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ClustersUpgradeManualRollback: %+v", err) + } + + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterupgradehistorieslist.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterupgradehistorieslist.go new file mode 100644 index 00000000000..a84c8cb2db6 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_clusterupgradehistorieslist.go @@ -0,0 +1,91 @@ +package hdinsights + +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 ClusterUpgradeHistoriesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]ClusterUpgradeHistory +} + +type ClusterUpgradeHistoriesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []ClusterUpgradeHistory +} + +// ClusterUpgradeHistoriesList ... +func (c HdinsightsClient) ClusterUpgradeHistoriesList(ctx context.Context, id ClusterId) (result ClusterUpgradeHistoriesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/upgradeHistories", 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 *[]ClusterUpgradeHistory `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ClusterUpgradeHistoriesListComplete retrieves all the results into a single object +func (c HdinsightsClient) ClusterUpgradeHistoriesListComplete(ctx context.Context, id ClusterId) (ClusterUpgradeHistoriesListCompleteResult, error) { + return c.ClusterUpgradeHistoriesListCompleteMatchingPredicate(ctx, id, ClusterUpgradeHistoryOperationPredicate{}) +} + +// ClusterUpgradeHistoriesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c HdinsightsClient) ClusterUpgradeHistoriesListCompleteMatchingPredicate(ctx context.Context, id ClusterId, predicate ClusterUpgradeHistoryOperationPredicate) (result ClusterUpgradeHistoriesListCompleteResult, err error) { + items := make([]ClusterUpgradeHistory, 0) + + resp, err := c.ClusterUpgradeHistoriesList(ctx, id) + if err != nil { + 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 = ClusterUpgradeHistoriesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationschecknameavailability.go b/resource-manager/hdinsight/2024-05-01/hdinsights/method_locationschecknameavailability.go similarity index 78% rename from resource-manager/hdinsight/2018-06-01-preview/regions/method_locationschecknameavailability.go rename to resource-manager/hdinsight/2024-05-01/hdinsights/method_locationschecknameavailability.go index cc65edb2c84..cffddc9496a 100644 --- a/resource-manager/hdinsight/2018-06-01-preview/regions/method_locationschecknameavailability.go +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/method_locationschecknameavailability.go @@ -1,4 +1,4 @@ -package regions +package hdinsights import ( "context" @@ -15,11 +15,11 @@ import ( type LocationsCheckNameAvailabilityOperationResponse struct { HttpResponse *http.Response OData *odata.OData - Model *NameAvailabilityCheckResult + Model *NameAvailabilityResult } // LocationsCheckNameAvailability ... -func (c RegionsClient) LocationsCheckNameAvailability(ctx context.Context, id LocationId, input NameAvailabilityCheckRequestParameters) (result LocationsCheckNameAvailabilityOperationResponse, err error) { +func (c HdinsightsClient) LocationsCheckNameAvailability(ctx context.Context, id LocationId, input NameAvailabilityParameters) (result LocationsCheckNameAvailabilityOperationResponse, err error) { opts := client.RequestOptions{ ContentType: "application/json; charset=utf-8", ExpectedStatusCodes: []int{ @@ -48,7 +48,7 @@ func (c RegionsClient) LocationsCheckNameAvailability(ctx context.Context, id Lo return } - var model NameAvailabilityCheckResult + var model NameAvailabilityResult result.Model = &model if err = resp.Unmarshal(result.Model); err != nil { diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_aksclusterprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_aksclusterprofile.go new file mode 100644 index 00000000000..fc47692ac51 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_aksclusterprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AksClusterProfile struct { + AksClusterAgentPoolIdentityProfile *IdentityProfile `json:"aksClusterAgentPoolIdentityProfile,omitempty"` + AksClusterResourceId *string `json:"aksClusterResourceId,omitempty"` + AksVersion *string `json:"aksVersion,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_authorizationprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_authorizationprofile.go new file mode 100644 index 00000000000..45454a28509 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_authorizationprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizationProfile struct { + GroupIds *[]string `json:"groupIds,omitempty"` + UserIds *[]string `json:"userIds,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_autoscaleprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_autoscaleprofile.go new file mode 100644 index 00000000000..b279fbd5305 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_autoscaleprofile.go @@ -0,0 +1,12 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AutoscaleProfile struct { + AutoscaleType *AutoscaleType `json:"autoscaleType,omitempty"` + Enabled bool `json:"enabled"` + GracefulDecommissionTimeout *int64 `json:"gracefulDecommissionTimeout,omitempty"` + LoadBasedConfig *LoadBasedConfig `json:"loadBasedConfig,omitempty"` + ScheduleBasedConfig *ScheduleBasedConfig `json:"scheduleBasedConfig,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_catalogoptions.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_catalogoptions.go new file mode 100644 index 00000000000..62ba01e4de4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_catalogoptions.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CatalogOptions struct { + Hive *[]HiveCatalogOption `json:"hive,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_cluster.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_cluster.go new file mode 100644 index 00000000000..8b6ab5fa77b --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_cluster.go @@ -0,0 +1,18 @@ +package hdinsights + +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 Cluster struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ClusterResourceProperties `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/hdinsight/2024-05-01/hdinsights/model_clusteraccessprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteraccessprofile.go new file mode 100644 index 00000000000..0b5a7c0606a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteraccessprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterAccessProfile struct { + EnableInternalIngress bool `json:"enableInternalIngress"` + PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchupgradehistoryproperties.go new file mode 100644 index 00000000000..5c108c15cc9 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchupgradehistoryproperties.go @@ -0,0 +1,44 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeHistoryProperties = ClusterAksPatchUpgradeHistoryProperties{} + +type ClusterAksPatchUpgradeHistoryProperties struct { + NewVersion *string `json:"newVersion,omitempty"` + OriginalVersion *string `json:"originalVersion,omitempty"` + + // Fields inherited from ClusterUpgradeHistoryProperties + UpgradeResult ClusterUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterAksPatchUpgradeHistoryProperties{} + +func (s ClusterAksPatchUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterAksPatchUpgradeHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterAksPatchUpgradeHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterAksPatchUpgradeHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "AKSPatchUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterAksPatchUpgradeHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchversionupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchversionupgradeproperties.go new file mode 100644 index 00000000000..10fd1641cc4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterakspatchversionupgradeproperties.go @@ -0,0 +1,40 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeProperties = ClusterAKSPatchVersionUpgradeProperties{} + +type ClusterAKSPatchVersionUpgradeProperties struct { + + // Fields inherited from ClusterUpgradeProperties +} + +var _ json.Marshaler = ClusterAKSPatchVersionUpgradeProperties{} + +func (s ClusterAKSPatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterAKSPatchVersionUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterAKSPatchVersionUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterAKSPatchVersionUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "AKSPatchUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterAKSPatchVersionUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgrade.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgrade.go new file mode 100644 index 00000000000..b0788bf8653 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgrade.go @@ -0,0 +1,48 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + + "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 ClusterAvailableUpgrade struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterAvailableUpgradeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ClusterAvailableUpgrade{} + +func (s *ClusterAvailableUpgrade) UnmarshalJSON(bytes []byte) error { + type alias ClusterAvailableUpgrade + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ClusterAvailableUpgrade: %+v", err) + } + + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterAvailableUpgrade into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterAvailableUpgradePropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterAvailableUpgrade': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeakspatchupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeakspatchupgradeproperties.go new file mode 100644 index 00000000000..161473b338e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeakspatchupgradeproperties.go @@ -0,0 +1,43 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterAvailableUpgradeProperties = ClusterAvailableUpgradeAksPatchUpgradeProperties{} + +type ClusterAvailableUpgradeAksPatchUpgradeProperties struct { + CurrentVersion *string `json:"currentVersion,omitempty"` + CurrentVersionStatus *CurrentClusterAksVersionStatus `json:"currentVersionStatus,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + + // Fields inherited from ClusterAvailableUpgradeProperties +} + +var _ json.Marshaler = ClusterAvailableUpgradeAksPatchUpgradeProperties{} + +func (s ClusterAvailableUpgradeAksPatchUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterAvailableUpgradeAksPatchUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "AKSPatchUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradehotfixupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradehotfixupgradeproperties.go new file mode 100644 index 00000000000..9b0edf566d4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradehotfixupgradeproperties.go @@ -0,0 +1,51 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterAvailableUpgradeProperties = ClusterAvailableUpgradeHotfixUpgradeProperties{} + +type ClusterAvailableUpgradeHotfixUpgradeProperties struct { + ComponentName *string `json:"componentName,omitempty"` + CreatedTime *string `json:"createdTime,omitempty"` + Description *string `json:"description,omitempty"` + ExtendedProperties *string `json:"extendedProperties,omitempty"` + Severity *Severity `json:"severity,omitempty"` + SourceBuildNumber *string `json:"sourceBuildNumber,omitempty"` + SourceClusterVersion *string `json:"sourceClusterVersion,omitempty"` + SourceOssVersion *string `json:"sourceOssVersion,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterAvailableUpgradeProperties +} + +var _ json.Marshaler = ClusterAvailableUpgradeHotfixUpgradeProperties{} + +func (s ClusterAvailableUpgradeHotfixUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterAvailableUpgradeHotfixUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterAvailableUpgradeHotfixUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterAvailableUpgradeHotfixUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "HotfixUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterAvailableUpgradeHotfixUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradepatchversionupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradepatchversionupgradeproperties.go new file mode 100644 index 00000000000..4cf64b01e36 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradepatchversionupgradeproperties.go @@ -0,0 +1,51 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterAvailableUpgradeProperties = ClusterAvailableUpgradePatchVersionUpgradeProperties{} + +type ClusterAvailableUpgradePatchVersionUpgradeProperties struct { + ComponentName *string `json:"componentName,omitempty"` + CreatedTime *string `json:"createdTime,omitempty"` + Description *string `json:"description,omitempty"` + ExtendedProperties *string `json:"extendedProperties,omitempty"` + Severity *Severity `json:"severity,omitempty"` + SourceBuildNumber *string `json:"sourceBuildNumber,omitempty"` + SourceClusterVersion *string `json:"sourceClusterVersion,omitempty"` + SourceOssVersion *string `json:"sourceOssVersion,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterAvailableUpgradeProperties +} + +var _ json.Marshaler = ClusterAvailableUpgradePatchVersionUpgradeProperties{} + +func (s ClusterAvailableUpgradePatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterAvailableUpgradePatchVersionUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterAvailableUpgradePatchVersionUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterAvailableUpgradePatchVersionUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "PatchVersionUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterAvailableUpgradePatchVersionUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeproperties.go new file mode 100644 index 00000000000..b64fb74340b --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusteravailableupgradeproperties.go @@ -0,0 +1,69 @@ +package hdinsights + +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 ClusterAvailableUpgradeProperties interface { +} + +// RawClusterAvailableUpgradePropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterAvailableUpgradePropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterAvailableUpgradePropertiesImplementation(input []byte) (ClusterAvailableUpgradeProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterAvailableUpgradeProperties into map[string]interface: %+v", err) + } + + value, ok := temp["upgradeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKSPatchUpgrade") { + var out ClusterAvailableUpgradeAksPatchUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HotfixUpgrade") { + var out ClusterAvailableUpgradeHotfixUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterAvailableUpgradeHotfixUpgradeProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PatchVersionUpgrade") { + var out ClusterAvailableUpgradePatchVersionUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterAvailableUpgradePatchVersionUpgradeProperties: %+v", err) + } + return out, nil + } + + out := RawClusterAvailableUpgradePropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clustercomponentscomponentsinlined.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clustercomponentscomponentsinlined.go new file mode 100644 index 00000000000..303f607a612 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clustercomponentscomponentsinlined.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterComponentsComponentsInlined struct { + Name *string `json:"name,omitempty"` + Version *string `json:"version,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterconfigfile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterconfigfile.go new file mode 100644 index 00000000000..8a26042b173 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterconfigfile.go @@ -0,0 +1,12 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterConfigFile struct { + Content *string `json:"content,omitempty"` + Encoding *ContentEncoding `json:"encoding,omitempty"` + FileName string `json:"fileName"` + Path *string `json:"path,omitempty"` + Values *map[string]string `json:"values,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradehistoryproperties.go new file mode 100644 index 00000000000..46ffd148dd4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradehistoryproperties.go @@ -0,0 +1,50 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeHistoryProperties = ClusterHotfixUpgradeHistoryProperties{} + +type ClusterHotfixUpgradeHistoryProperties struct { + ComponentName *string `json:"componentName,omitempty"` + Severity *ClusterUpgradeHistorySeverityType `json:"severity,omitempty"` + SourceBuildNumber *string `json:"sourceBuildNumber,omitempty"` + SourceClusterVersion *string `json:"sourceClusterVersion,omitempty"` + SourceOssVersion *string `json:"sourceOssVersion,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterUpgradeHistoryProperties + UpgradeResult ClusterUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterHotfixUpgradeHistoryProperties{} + +func (s ClusterHotfixUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterHotfixUpgradeHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterHotfixUpgradeHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterHotfixUpgradeHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "HotfixUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterHotfixUpgradeHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradeproperties.go new file mode 100644 index 00000000000..5ca374b432f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgradeproperties.go @@ -0,0 +1,44 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeProperties = ClusterHotfixUpgradeProperties{} + +type ClusterHotfixUpgradeProperties struct { + ComponentName *string `json:"componentName,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterUpgradeProperties +} + +var _ json.Marshaler = ClusterHotfixUpgradeProperties{} + +func (s ClusterHotfixUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterHotfixUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterHotfixUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterHotfixUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "HotfixUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterHotfixUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgraderollbackhistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgraderollbackhistoryproperties.go new file mode 100644 index 00000000000..fea1d9620ed --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterhotfixupgraderollbackhistoryproperties.go @@ -0,0 +1,50 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeHistoryProperties = ClusterHotfixUpgradeRollbackHistoryProperties{} + +type ClusterHotfixUpgradeRollbackHistoryProperties struct { + ComponentName *string `json:"componentName,omitempty"` + Severity *ClusterUpgradeHistorySeverityType `json:"severity,omitempty"` + SourceBuildNumber *string `json:"sourceBuildNumber,omitempty"` + SourceClusterVersion *string `json:"sourceClusterVersion,omitempty"` + SourceOssVersion *string `json:"sourceOssVersion,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterUpgradeHistoryProperties + UpgradeResult ClusterUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterHotfixUpgradeRollbackHistoryProperties{} + +func (s ClusterHotfixUpgradeRollbackHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterHotfixUpgradeRollbackHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterHotfixUpgradeRollbackHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterHotfixUpgradeRollbackHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "HotfixUpgradeRollback" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterHotfixUpgradeRollbackHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewproperties.go new file mode 100644 index 00000000000..240b0f0719b --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewproperties.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterInstanceViewProperties struct { + ServiceStatuses []ServiceStatus `json:"serviceStatuses"` + Status ClusterInstanceViewStatus `json:"status"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewresult.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewresult.go new file mode 100644 index 00000000000..45dd431b982 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewresult.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterInstanceViewResult struct { + Name string `json:"name"` + Properties ClusterInstanceViewProperties `json:"properties"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewstatus.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewstatus.go new file mode 100644 index 00000000000..b3673800c1c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterinstanceviewstatus.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterInstanceViewStatus struct { + Message *string `json:"message,omitempty"` + Ready string `json:"ready"` + Reason *string `json:"reason,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjob.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjob.go new file mode 100644 index 00000000000..940c6adafc0 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjob.go @@ -0,0 +1,48 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + + "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 ClusterJob struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterJobProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ClusterJob{} + +func (s *ClusterJob) UnmarshalJSON(bytes []byte) error { + type alias ClusterJob + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ClusterJob: %+v", err) + } + + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterJob into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterJobPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterJob': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjobproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjobproperties.go new file mode 100644 index 00000000000..28ccc111fe3 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterjobproperties.go @@ -0,0 +1,53 @@ +package hdinsights + +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 ClusterJobProperties interface { +} + +// RawClusterJobPropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterJobPropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterJobPropertiesImplementation(input []byte) (ClusterJobProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterJobProperties into map[string]interface: %+v", err) + } + + value, ok := temp["jobType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "FlinkJob") { + var out FlinkJobProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into FlinkJobProperties: %+v", err) + } + return out, nil + } + + out := RawClusterJobPropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrary.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrary.go new file mode 100644 index 00000000000..0d7fa3095d3 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrary.go @@ -0,0 +1,48 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + + "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 ClusterLibrary struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterLibraryProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ClusterLibrary{} + +func (s *ClusterLibrary) UnmarshalJSON(bytes []byte) error { + type alias ClusterLibrary + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ClusterLibrary: %+v", err) + } + + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterLibrary into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterLibraryPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterLibrary': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperation.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperation.go new file mode 100644 index 00000000000..d5696a3732e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperation.go @@ -0,0 +1,16 @@ +package hdinsights + +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 ClusterLibraryManagementOperation struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterLibraryManagementOperationProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperationproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperationproperties.go new file mode 100644 index 00000000000..457881bb87b --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibrarymanagementoperationproperties.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterLibraryManagementOperationProperties struct { + Action LibraryManagementAction `json:"action"` + Libraries []ClusterLibrary `json:"libraries"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibraryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibraryproperties.go new file mode 100644 index 00000000000..be46b55aa0a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterlibraryproperties.go @@ -0,0 +1,61 @@ +package hdinsights + +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 ClusterLibraryProperties interface { +} + +// RawClusterLibraryPropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterLibraryPropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterLibraryPropertiesImplementation(input []byte) (ClusterLibraryProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterLibraryProperties into map[string]interface: %+v", err) + } + + value, ok := temp["type"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "maven") { + var out MavenLibraryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into MavenLibraryProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "pypi") { + var out PyPiLibraryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into PyPiLibraryProperties: %+v", err) + } + return out, nil + } + + out := RawClusterLibraryPropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsapplicationlogs.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsapplicationlogs.go new file mode 100644 index 00000000000..3e4f66994ee --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsapplicationlogs.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterLogAnalyticsApplicationLogs struct { + StdErrorEnabled *bool `json:"stdErrorEnabled,omitempty"` + StdOutEnabled *bool `json:"stdOutEnabled,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsprofile.go new file mode 100644 index 00000000000..0f01876bab7 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterloganalyticsprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterLogAnalyticsProfile struct { + ApplicationLogs *ClusterLogAnalyticsApplicationLogs `json:"applicationLogs,omitempty"` + Enabled bool `json:"enabled"` + MetricsEnabled *bool `json:"metricsEnabled,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatch.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatch.go new file mode 100644 index 00000000000..cc10e8e4679 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatch.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPatch struct { + Properties *ClusterPatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchproperties.go new file mode 100644 index 00000000000..23f927742e9 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchproperties.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPatchProperties struct { + ClusterProfile *UpdatableClusterProfile `json:"clusterProfile,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradehistoryproperties.go new file mode 100644 index 00000000000..7ac26a583a1 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradehistoryproperties.go @@ -0,0 +1,50 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeHistoryProperties = ClusterPatchVersionUpgradeHistoryProperties{} + +type ClusterPatchVersionUpgradeHistoryProperties struct { + ComponentName *string `json:"componentName,omitempty"` + Severity *ClusterUpgradeHistorySeverityType `json:"severity,omitempty"` + SourceBuildNumber *string `json:"sourceBuildNumber,omitempty"` + SourceClusterVersion *string `json:"sourceClusterVersion,omitempty"` + SourceOssVersion *string `json:"sourceOssVersion,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterUpgradeHistoryProperties + UpgradeResult ClusterUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterPatchVersionUpgradeHistoryProperties{} + +func (s ClusterPatchVersionUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPatchVersionUpgradeHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPatchVersionUpgradeHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPatchVersionUpgradeHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "PatchVersionUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPatchVersionUpgradeHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradeproperties.go new file mode 100644 index 00000000000..5fb9eb471b1 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgradeproperties.go @@ -0,0 +1,44 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeProperties = ClusterPatchVersionUpgradeProperties{} + +type ClusterPatchVersionUpgradeProperties struct { + ComponentName *string `json:"componentName,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterUpgradeProperties +} + +var _ json.Marshaler = ClusterPatchVersionUpgradeProperties{} + +func (s ClusterPatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPatchVersionUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPatchVersionUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPatchVersionUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "PatchVersionUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPatchVersionUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgraderollbackhistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgraderollbackhistoryproperties.go new file mode 100644 index 00000000000..092c5c31145 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpatchversionupgraderollbackhistoryproperties.go @@ -0,0 +1,50 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterUpgradeHistoryProperties = ClusterPatchVersionUpgradeRollbackHistoryProperties{} + +type ClusterPatchVersionUpgradeRollbackHistoryProperties struct { + ComponentName *string `json:"componentName,omitempty"` + Severity *ClusterUpgradeHistorySeverityType `json:"severity,omitempty"` + SourceBuildNumber *string `json:"sourceBuildNumber,omitempty"` + SourceClusterVersion *string `json:"sourceClusterVersion,omitempty"` + SourceOssVersion *string `json:"sourceOssVersion,omitempty"` + TargetBuildNumber *string `json:"targetBuildNumber,omitempty"` + TargetClusterVersion *string `json:"targetClusterVersion,omitempty"` + TargetOssVersion *string `json:"targetOssVersion,omitempty"` + + // Fields inherited from ClusterUpgradeHistoryProperties + UpgradeResult ClusterUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterPatchVersionUpgradeRollbackHistoryProperties{} + +func (s ClusterPatchVersionUpgradeRollbackHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPatchVersionUpgradeRollbackHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPatchVersionUpgradeRollbackHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPatchVersionUpgradeRollbackHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "PatchVersionUpgradeRollback" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPatchVersionUpgradeRollbackHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpool.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpool.go new file mode 100644 index 00000000000..c48e37e8c8d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpool.go @@ -0,0 +1,18 @@ +package hdinsights + +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 ClusterPool struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ClusterPoolResourceProperties `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/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchupgradehistoryproperties.go new file mode 100644 index 00000000000..cf8663e44a3 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchupgradehistoryproperties.go @@ -0,0 +1,46 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterPoolUpgradeHistoryProperties = ClusterPoolAksPatchUpgradeHistoryProperties{} + +type ClusterPoolAksPatchUpgradeHistoryProperties struct { + NewVersion *string `json:"newVersion,omitempty"` + OriginalVersion *string `json:"originalVersion,omitempty"` + UpgradeAllClusterNodes *bool `json:"upgradeAllClusterNodes,omitempty"` + UpgradeClusterPool *bool `json:"upgradeClusterPool,omitempty"` + + // Fields inherited from ClusterPoolUpgradeHistoryProperties + UpgradeResult ClusterPoolUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterPoolAksPatchUpgradeHistoryProperties{} + +func (s ClusterPoolAksPatchUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPoolAksPatchUpgradeHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPoolAksPatchUpgradeHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolAksPatchUpgradeHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "AKSPatchUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPoolAksPatchUpgradeHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchversionupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchversionupgradeproperties.go new file mode 100644 index 00000000000..f005ddafaef --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolakspatchversionupgradeproperties.go @@ -0,0 +1,43 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterPoolUpgradeProperties = ClusterPoolAKSPatchVersionUpgradeProperties{} + +type ClusterPoolAKSPatchVersionUpgradeProperties struct { + TargetAksVersion *string `json:"targetAksVersion,omitempty"` + UpgradeAllClusterNodes *bool `json:"upgradeAllClusterNodes,omitempty"` + UpgradeClusterPool *bool `json:"upgradeClusterPool,omitempty"` + + // Fields inherited from ClusterPoolUpgradeProperties +} + +var _ json.Marshaler = ClusterPoolAKSPatchVersionUpgradeProperties{} + +func (s ClusterPoolAKSPatchVersionUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPoolAKSPatchVersionUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPoolAKSPatchVersionUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolAKSPatchVersionUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "AKSPatchUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPoolAKSPatchVersionUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgrade.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgrade.go new file mode 100644 index 00000000000..6b9d124d518 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgrade.go @@ -0,0 +1,48 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + + "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 ClusterPoolAvailableUpgrade struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterPoolAvailableUpgradeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ClusterPoolAvailableUpgrade{} + +func (s *ClusterPoolAvailableUpgrade) UnmarshalJSON(bytes []byte) error { + type alias ClusterPoolAvailableUpgrade + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ClusterPoolAvailableUpgrade: %+v", err) + } + + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterPoolAvailableUpgrade into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterPoolAvailableUpgradePropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterPoolAvailableUpgrade': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeakspatchupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeakspatchupgradeproperties.go new file mode 100644 index 00000000000..37dacb30a4f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeakspatchupgradeproperties.go @@ -0,0 +1,43 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterPoolAvailableUpgradeProperties = ClusterPoolAvailableUpgradeAksPatchUpgradeProperties{} + +type ClusterPoolAvailableUpgradeAksPatchUpgradeProperties struct { + CurrentVersion *string `json:"currentVersion,omitempty"` + CurrentVersionStatus *CurrentClusterPoolAksVersionStatus `json:"currentVersionStatus,omitempty"` + LatestVersion *string `json:"latestVersion,omitempty"` + + // Fields inherited from ClusterPoolAvailableUpgradeProperties +} + +var _ json.Marshaler = ClusterPoolAvailableUpgradeAksPatchUpgradeProperties{} + +func (s ClusterPoolAvailableUpgradeAksPatchUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPoolAvailableUpgradeAksPatchUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPoolAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "AKSPatchUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPoolAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradenodeosupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradenodeosupgradeproperties.go new file mode 100644 index 00000000000..68b49b86548 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradenodeosupgradeproperties.go @@ -0,0 +1,41 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterPoolAvailableUpgradeProperties = ClusterPoolAvailableUpgradeNodeOsUpgradeProperties{} + +type ClusterPoolAvailableUpgradeNodeOsUpgradeProperties struct { + LatestVersion *string `json:"latestVersion,omitempty"` + + // Fields inherited from ClusterPoolAvailableUpgradeProperties +} + +var _ json.Marshaler = ClusterPoolAvailableUpgradeNodeOsUpgradeProperties{} + +func (s ClusterPoolAvailableUpgradeNodeOsUpgradeProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPoolAvailableUpgradeNodeOsUpgradeProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPoolAvailableUpgradeNodeOsUpgradeProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolAvailableUpgradeNodeOsUpgradeProperties: %+v", err) + } + decoded["upgradeType"] = "NodeOsUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPoolAvailableUpgradeNodeOsUpgradeProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeproperties.go new file mode 100644 index 00000000000..4cefc05b96a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolavailableupgradeproperties.go @@ -0,0 +1,61 @@ +package hdinsights + +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 ClusterPoolAvailableUpgradeProperties interface { +} + +// RawClusterPoolAvailableUpgradePropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterPoolAvailableUpgradePropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterPoolAvailableUpgradePropertiesImplementation(input []byte) (ClusterPoolAvailableUpgradeProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolAvailableUpgradeProperties into map[string]interface: %+v", err) + } + + value, ok := temp["upgradeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKSPatchUpgrade") { + var out ClusterPoolAvailableUpgradeAksPatchUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPoolAvailableUpgradeAksPatchUpgradeProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "NodeOsUpgrade") { + var out ClusterPoolAvailableUpgradeNodeOsUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPoolAvailableUpgradeNodeOsUpgradeProperties: %+v", err) + } + return out, nil + } + + out := RawClusterPoolAvailableUpgradePropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolcomputeprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolcomputeprofile.go new file mode 100644 index 00000000000..8541da1b180 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolcomputeprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolComputeProfile struct { + Count *int64 `json:"count,omitempty"` + VMSize string `json:"vmSize"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolloganalyticsprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolloganalyticsprofile.go new file mode 100644 index 00000000000..85de6637a4a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolloganalyticsprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolLogAnalyticsProfile struct { + Enabled bool `json:"enabled"` + WorkspaceId *string `json:"workspaceId,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnetworkprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnetworkprofile.go new file mode 100644 index 00000000000..0c3bced1e36 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnetworkprofile.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolNetworkProfile struct { + ApiServerAuthorizedIPRanges *[]string `json:"apiServerAuthorizedIpRanges,omitempty"` + EnablePrivateApiServer *bool `json:"enablePrivateApiServer,omitempty"` + OutboundType *OutboundType `json:"outboundType,omitempty"` + SubnetId string `json:"subnetId"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosimageupdateproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosimageupdateproperties.go new file mode 100644 index 00000000000..3db894ddc47 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosimageupdateproperties.go @@ -0,0 +1,40 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterPoolUpgradeProperties = ClusterPoolNodeOsImageUpdateProperties{} + +type ClusterPoolNodeOsImageUpdateProperties struct { + + // Fields inherited from ClusterPoolUpgradeProperties +} + +var _ json.Marshaler = ClusterPoolNodeOsImageUpdateProperties{} + +func (s ClusterPoolNodeOsImageUpdateProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPoolNodeOsImageUpdateProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPoolNodeOsImageUpdateProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolNodeOsImageUpdateProperties: %+v", err) + } + decoded["upgradeType"] = "NodeOsUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPoolNodeOsImageUpdateProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosupgradehistoryproperties.go new file mode 100644 index 00000000000..b60679dceed --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolnodeosupgradehistoryproperties.go @@ -0,0 +1,43 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterPoolUpgradeHistoryProperties = ClusterPoolNodeOsUpgradeHistoryProperties{} + +type ClusterPoolNodeOsUpgradeHistoryProperties struct { + NewNodeOs *string `json:"newNodeOs,omitempty"` + + // Fields inherited from ClusterPoolUpgradeHistoryProperties + UpgradeResult ClusterPoolUpgradeHistoryUpgradeResultType `json:"upgradeResult"` + UtcTime string `json:"utcTime"` +} + +var _ json.Marshaler = ClusterPoolNodeOsUpgradeHistoryProperties{} + +func (s ClusterPoolNodeOsUpgradeHistoryProperties) MarshalJSON() ([]byte, error) { + type wrapper ClusterPoolNodeOsUpgradeHistoryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ClusterPoolNodeOsUpgradeHistoryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolNodeOsUpgradeHistoryProperties: %+v", err) + } + decoded["upgradeType"] = "NodeOsUpgrade" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ClusterPoolNodeOsUpgradeHistoryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolprofile.go new file mode 100644 index 00000000000..c15e6891cd5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolprofile.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolProfile struct { + ClusterPoolVersion string `json:"clusterPoolVersion"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolresourceproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolresourceproperties.go new file mode 100644 index 00000000000..c7c30874ee8 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolresourceproperties.go @@ -0,0 +1,17 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolResourceProperties struct { + AksClusterProfile *AksClusterProfile `json:"aksClusterProfile,omitempty"` + AksManagedResourceGroupName *string `json:"aksManagedResourceGroupName,omitempty"` + ClusterPoolProfile *ClusterPoolProfile `json:"clusterPoolProfile,omitempty"` + ComputeProfile ClusterPoolComputeProfile `json:"computeProfile"` + DeploymentId *string `json:"deploymentId,omitempty"` + LogAnalyticsProfile *ClusterPoolLogAnalyticsProfile `json:"logAnalyticsProfile,omitempty"` + ManagedResourceGroupName *string `json:"managedResourceGroupName,omitempty"` + NetworkProfile *ClusterPoolNetworkProfile `json:"networkProfile,omitempty"` + ProvisioningState *ProvisioningStatus `json:"provisioningState,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgrade.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgrade.go new file mode 100644 index 00000000000..d0de912e386 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgrade.go @@ -0,0 +1,32 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolUpgrade struct { + Properties ClusterPoolUpgradeProperties `json:"properties"` +} + +var _ json.Unmarshaler = &ClusterPoolUpgrade{} + +func (s *ClusterPoolUpgrade) UnmarshalJSON(bytes []byte) error { + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterPoolUpgrade into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterPoolUpgradePropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterPoolUpgrade': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistory.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistory.go new file mode 100644 index 00000000000..ed7e4162f70 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistory.go @@ -0,0 +1,48 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + + "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 ClusterPoolUpgradeHistory struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterPoolUpgradeHistoryProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ClusterPoolUpgradeHistory{} + +func (s *ClusterPoolUpgradeHistory) UnmarshalJSON(bytes []byte) error { + type alias ClusterPoolUpgradeHistory + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ClusterPoolUpgradeHistory: %+v", err) + } + + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterPoolUpgradeHistory into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterPoolUpgradeHistoryPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterPoolUpgradeHistory': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistoryproperties.go new file mode 100644 index 00000000000..c952042032c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradehistoryproperties.go @@ -0,0 +1,61 @@ +package hdinsights + +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 ClusterPoolUpgradeHistoryProperties interface { +} + +// RawClusterPoolUpgradeHistoryPropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterPoolUpgradeHistoryPropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterPoolUpgradeHistoryPropertiesImplementation(input []byte) (ClusterPoolUpgradeHistoryProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolUpgradeHistoryProperties into map[string]interface: %+v", err) + } + + value, ok := temp["upgradeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKSPatchUpgrade") { + var out ClusterPoolAksPatchUpgradeHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPoolAksPatchUpgradeHistoryProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "NodeOsUpgrade") { + var out ClusterPoolNodeOsUpgradeHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPoolNodeOsUpgradeHistoryProperties: %+v", err) + } + return out, nil + } + + out := RawClusterPoolUpgradeHistoryPropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradeproperties.go new file mode 100644 index 00000000000..c444d09be25 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolupgradeproperties.go @@ -0,0 +1,61 @@ +package hdinsights + +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 ClusterPoolUpgradeProperties interface { +} + +// RawClusterPoolUpgradePropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterPoolUpgradePropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterPoolUpgradePropertiesImplementation(input []byte) (ClusterPoolUpgradeProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterPoolUpgradeProperties into map[string]interface: %+v", err) + } + + value, ok := temp["upgradeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKSPatchUpgrade") { + var out ClusterPoolAKSPatchVersionUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPoolAKSPatchVersionUpgradeProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "NodeOsUpgrade") { + var out ClusterPoolNodeOsImageUpdateProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPoolNodeOsImageUpdateProperties: %+v", err) + } + return out, nil + } + + out := RawClusterPoolUpgradePropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversion.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversion.go new file mode 100644 index 00000000000..105feba1701 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversion.go @@ -0,0 +1,16 @@ +package hdinsights + +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 ClusterPoolVersion struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ClusterPoolVersionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversionproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversionproperties.go new file mode 100644 index 00000000000..1dfb2c6f686 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterpoolversionproperties.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPoolVersionProperties struct { + AksVersion *string `json:"aksVersion,omitempty"` + ClusterPoolVersion *string `json:"clusterPoolVersion,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprofile.go new file mode 100644 index 00000000000..b54feb673ce --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprofile.go @@ -0,0 +1,30 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterProfile struct { + AuthorizationProfile AuthorizationProfile `json:"authorizationProfile"` + AutoscaleProfile *AutoscaleProfile `json:"autoscaleProfile,omitempty"` + ClusterAccessProfile *ClusterAccessProfile `json:"clusterAccessProfile,omitempty"` + ClusterVersion string `json:"clusterVersion"` + Components *[]ClusterComponentsComponentsInlined `json:"components,omitempty"` + ConnectivityProfile *ConnectivityProfile `json:"connectivityProfile,omitempty"` + FlinkProfile *FlinkProfile `json:"flinkProfile,omitempty"` + IdentityProfile *IdentityProfile `json:"identityProfile,omitempty"` + KafkaProfile *KafkaProfile `json:"kafkaProfile,omitempty"` + LlapProfile *interface{} `json:"llapProfile,omitempty"` + LogAnalyticsProfile *ClusterLogAnalyticsProfile `json:"logAnalyticsProfile,omitempty"` + ManagedIdentityProfile *ManagedIdentityProfile `json:"managedIdentityProfile,omitempty"` + OssVersion string `json:"ossVersion"` + PrometheusProfile *ClusterPrometheusProfile `json:"prometheusProfile,omitempty"` + RangerPluginProfile *ClusterRangerPluginProfile `json:"rangerPluginProfile,omitempty"` + RangerProfile *RangerProfile `json:"rangerProfile,omitempty"` + ScriptActionProfiles *[]ScriptActionProfile `json:"scriptActionProfiles,omitempty"` + SecretsProfile *SecretsProfile `json:"secretsProfile,omitempty"` + ServiceConfigsProfiles *[]ClusterServiceConfigsProfile `json:"serviceConfigsProfiles,omitempty"` + SparkProfile *SparkProfile `json:"sparkProfile,omitempty"` + SshProfile *SshProfile `json:"sshProfile,omitempty"` + StubProfile *interface{} `json:"stubProfile,omitempty"` + TrinoProfile *TrinoProfile `json:"trinoProfile,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprometheusprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprometheusprofile.go new file mode 100644 index 00000000000..1cfb01e4a7d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterprometheusprofile.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterPrometheusProfile struct { + Enabled bool `json:"enabled"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterrangerpluginprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterrangerpluginprofile.go new file mode 100644 index 00000000000..cbffe2d4913 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterrangerpluginprofile.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterRangerPluginProfile struct { + Enabled bool `json:"enabled"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizedata.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizedata.go new file mode 100644 index 00000000000..7d354c24c6d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizedata.go @@ -0,0 +1,18 @@ +package hdinsights + +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 ClusterResizeData struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *ClusterResizeProperties `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/hdinsight/2024-05-01/hdinsights/model_clusterresizeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizeproperties.go new file mode 100644 index 00000000000..c78b3bf3677 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresizeproperties.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterResizeProperties struct { + TargetWorkerNodeCount int64 `json:"targetWorkerNodeCount"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresourceproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresourceproperties.go new file mode 100644 index 00000000000..80711e54b48 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterresourceproperties.go @@ -0,0 +1,13 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterResourceProperties struct { + ClusterProfile ClusterProfile `json:"clusterProfile"` + ClusterType string `json:"clusterType"` + ComputeProfile ComputeProfile `json:"computeProfile"` + DeploymentId *string `json:"deploymentId,omitempty"` + ProvisioningState *ProvisioningStatus `json:"provisioningState,omitempty"` + Status *string `json:"status,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfig.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfig.go new file mode 100644 index 00000000000..31a4e0c3454 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfig.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterServiceConfig struct { + Component string `json:"component"` + Files []ClusterConfigFile `json:"files"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfigsprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfigsprofile.go new file mode 100644 index 00000000000..52703080768 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterserviceconfigsprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterServiceConfigsProfile struct { + Configs []ClusterServiceConfig `json:"configs"` + ServiceName string `json:"serviceName"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgrade.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgrade.go new file mode 100644 index 00000000000..5cd7c3a0321 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgrade.go @@ -0,0 +1,32 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterUpgrade struct { + Properties ClusterUpgradeProperties `json:"properties"` +} + +var _ json.Unmarshaler = &ClusterUpgrade{} + +func (s *ClusterUpgrade) UnmarshalJSON(bytes []byte) error { + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterUpgrade into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterUpgradePropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterUpgrade': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistory.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistory.go new file mode 100644 index 00000000000..6bd7d5aa368 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistory.go @@ -0,0 +1,48 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + + "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 ClusterUpgradeHistory struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties ClusterUpgradeHistoryProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} + +var _ json.Unmarshaler = &ClusterUpgradeHistory{} + +func (s *ClusterUpgradeHistory) UnmarshalJSON(bytes []byte) error { + type alias ClusterUpgradeHistory + var decoded alias + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling into ClusterUpgradeHistory: %+v", err) + } + + s.Id = decoded.Id + s.Name = decoded.Name + s.SystemData = decoded.SystemData + s.Type = decoded.Type + + var temp map[string]json.RawMessage + if err := json.Unmarshal(bytes, &temp); err != nil { + return fmt.Errorf("unmarshaling ClusterUpgradeHistory into map[string]json.RawMessage: %+v", err) + } + + if v, ok := temp["properties"]; ok { + impl, err := unmarshalClusterUpgradeHistoryPropertiesImplementation(v) + if err != nil { + return fmt.Errorf("unmarshaling field 'Properties' for 'ClusterUpgradeHistory': %+v", err) + } + s.Properties = impl + } + return nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistoryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistoryproperties.go new file mode 100644 index 00000000000..e12aead629d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradehistoryproperties.go @@ -0,0 +1,85 @@ +package hdinsights + +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 ClusterUpgradeHistoryProperties interface { +} + +// RawClusterUpgradeHistoryPropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterUpgradeHistoryPropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterUpgradeHistoryPropertiesImplementation(input []byte) (ClusterUpgradeHistoryProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterUpgradeHistoryProperties into map[string]interface: %+v", err) + } + + value, ok := temp["upgradeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKSPatchUpgrade") { + var out ClusterAksPatchUpgradeHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterAksPatchUpgradeHistoryProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HotfixUpgrade") { + var out ClusterHotfixUpgradeHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterHotfixUpgradeHistoryProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HotfixUpgradeRollback") { + var out ClusterHotfixUpgradeRollbackHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterHotfixUpgradeRollbackHistoryProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PatchVersionUpgrade") { + var out ClusterPatchVersionUpgradeHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPatchVersionUpgradeHistoryProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PatchVersionUpgradeRollback") { + var out ClusterPatchVersionUpgradeRollbackHistoryProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPatchVersionUpgradeRollbackHistoryProperties: %+v", err) + } + return out, nil + } + + out := RawClusterUpgradeHistoryPropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradeproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradeproperties.go new file mode 100644 index 00000000000..5f9f7066294 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgradeproperties.go @@ -0,0 +1,69 @@ +package hdinsights + +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 ClusterUpgradeProperties interface { +} + +// RawClusterUpgradePropertiesImpl is returned when the Discriminated Value +// doesn't match any of the defined types +// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) +// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). +type RawClusterUpgradePropertiesImpl struct { + Type string + Values map[string]interface{} +} + +func unmarshalClusterUpgradePropertiesImplementation(input []byte) (ClusterUpgradeProperties, error) { + if input == nil { + return nil, nil + } + + var temp map[string]interface{} + if err := json.Unmarshal(input, &temp); err != nil { + return nil, fmt.Errorf("unmarshaling ClusterUpgradeProperties into map[string]interface: %+v", err) + } + + value, ok := temp["upgradeType"].(string) + if !ok { + return nil, nil + } + + if strings.EqualFold(value, "AKSPatchUpgrade") { + var out ClusterAKSPatchVersionUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterAKSPatchVersionUpgradeProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "HotfixUpgrade") { + var out ClusterHotfixUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterHotfixUpgradeProperties: %+v", err) + } + return out, nil + } + + if strings.EqualFold(value, "PatchVersionUpgrade") { + var out ClusterPatchVersionUpgradeProperties + if err := json.Unmarshal(input, &out); err != nil { + return nil, fmt.Errorf("unmarshaling into ClusterPatchVersionUpgradeProperties: %+v", err) + } + return out, nil + } + + out := RawClusterUpgradePropertiesImpl{ + Type: value, + Values: temp, + } + return out, nil + +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollback.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollback.go new file mode 100644 index 00000000000..7d9286fc46f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollback.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterUpgradeRollback struct { + Properties ClusterUpgradeRollbackProperties `json:"properties"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollbackproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollbackproperties.go new file mode 100644 index 00000000000..58cd5a0bd9a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterupgraderollbackproperties.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterUpgradeRollbackProperties struct { + UpgradeHistory string `json:"upgradeHistory"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversion.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversion.go new file mode 100644 index 00000000000..a88913df28e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversion.go @@ -0,0 +1,16 @@ +package hdinsights + +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 ClusterVersion struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *ClusterVersionProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversionproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversionproperties.go new file mode 100644 index 00000000000..7e0bc05059e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_clusterversionproperties.go @@ -0,0 +1,13 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterVersionProperties struct { + ClusterPoolVersion *string `json:"clusterPoolVersion,omitempty"` + ClusterType *string `json:"clusterType,omitempty"` + ClusterVersion *string `json:"clusterVersion,omitempty"` + Components *[]ClusterComponentsComponentsInlined `json:"components,omitempty"` + IsPreview *bool `json:"isPreview,omitempty"` + OssVersion *string `json:"ossVersion,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_comparisonrule.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_comparisonrule.go new file mode 100644 index 00000000000..5b122f53b00 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_comparisonrule.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComparisonRule struct { + Operator ComparisonOperator `json:"operator"` + Threshold float64 `json:"threshold"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_computeprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_computeprofile.go new file mode 100644 index 00000000000..d0c3ece7527 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_computeprofile.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeProfile struct { + Nodes []NodeProfile `json:"nodes"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_computeresourcedefinition.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_computeresourcedefinition.go new file mode 100644 index 00000000000..bbee9356524 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_computeresourcedefinition.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ComputeResourceDefinition struct { + Cpu float64 `json:"cpu"` + Memory int64 `json:"memory"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_connectivityprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_connectivityprofile.go new file mode 100644 index 00000000000..4ab92056283 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_connectivityprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectivityProfile struct { + Ssh *[]SshConnectivityEndpoint `json:"ssh,omitempty"` + Web WebConnectivityEndpoint `json:"web"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_diskstorageprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_diskstorageprofile.go new file mode 100644 index 00000000000..537587d0de0 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_diskstorageprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DiskStorageProfile struct { + DataDiskSize int64 `json:"dataDiskSize"` + DataDiskType DataDiskType `json:"dataDiskType"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkcatalogoptions.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkcatalogoptions.go new file mode 100644 index 00000000000..f2bdef2eb70 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkcatalogoptions.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FlinkCatalogOptions struct { + Hive *FlinkHiveCatalogOption `json:"hive,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkhivecatalogoption.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkhivecatalogoption.go new file mode 100644 index 00000000000..9794658c1b5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkhivecatalogoption.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FlinkHiveCatalogOption struct { + MetastoreDbConnectionAuthenticationMode *MetastoreDbConnectionAuthenticationMode `json:"metastoreDbConnectionAuthenticationMode,omitempty"` + MetastoreDbConnectionPasswordSecret *string `json:"metastoreDbConnectionPasswordSecret,omitempty"` + MetastoreDbConnectionURL string `json:"metastoreDbConnectionURL"` + MetastoreDbConnectionUserName *string `json:"metastoreDbConnectionUserName,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobprofile.go new file mode 100644 index 00000000000..76a41e0cb5e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobprofile.go @@ -0,0 +1,13 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FlinkJobProfile struct { + Args *string `json:"args,omitempty"` + EntryClass *string `json:"entryClass,omitempty"` + JarName string `json:"jarName"` + JobJarDirectory string `json:"jobJarDirectory"` + SavePointName *string `json:"savePointName,omitempty"` + UpgradeMode UpgradeMode `json:"upgradeMode"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobproperties.go new file mode 100644 index 00000000000..64d94feb6a3 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkjobproperties.go @@ -0,0 +1,54 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ ClusterJobProperties = FlinkJobProperties{} + +type FlinkJobProperties struct { + Action *Action `json:"action,omitempty"` + ActionResult *string `json:"actionResult,omitempty"` + Args *string `json:"args,omitempty"` + EntryClass *string `json:"entryClass,omitempty"` + FlinkConfiguration *map[string]string `json:"flinkConfiguration,omitempty"` + JarName *string `json:"jarName,omitempty"` + JobId *string `json:"jobId,omitempty"` + JobJarDirectory *string `json:"jobJarDirectory,omitempty"` + JobName *string `json:"jobName,omitempty"` + JobOutput *string `json:"jobOutput,omitempty"` + LastSavePoint *string `json:"lastSavePoint,omitempty"` + RunId *string `json:"runId,omitempty"` + SavePointName *string `json:"savePointName,omitempty"` + Status *string `json:"status,omitempty"` + + // Fields inherited from ClusterJobProperties +} + +var _ json.Marshaler = FlinkJobProperties{} + +func (s FlinkJobProperties) MarshalJSON() ([]byte, error) { + type wrapper FlinkJobProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling FlinkJobProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling FlinkJobProperties: %+v", err) + } + decoded["jobType"] = "FlinkJob" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling FlinkJobProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkprofile.go new file mode 100644 index 00000000000..204b6b89964 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkprofile.go @@ -0,0 +1,15 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FlinkProfile struct { + CatalogOptions *FlinkCatalogOptions `json:"catalogOptions,omitempty"` + DeploymentMode *DeploymentMode `json:"deploymentMode,omitempty"` + HistoryServer *ComputeResourceDefinition `json:"historyServer,omitempty"` + JobManager ComputeResourceDefinition `json:"jobManager"` + JobSpec *FlinkJobProfile `json:"jobSpec,omitempty"` + NumReplicas *int64 `json:"numReplicas,omitempty"` + Storage FlinkStorageProfile `json:"storage"` + TaskManager ComputeResourceDefinition `json:"taskManager"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkstorageprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkstorageprofile.go new file mode 100644 index 00000000000..a42a43f26c3 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_flinkstorageprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FlinkStorageProfile struct { + StorageUri string `json:"storageUri"` + Storagekey *string `json:"storagekey,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_hivecatalogoption.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_hivecatalogoption.go new file mode 100644 index 00000000000..69c7ff71ff7 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_hivecatalogoption.go @@ -0,0 +1,13 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HiveCatalogOption struct { + CatalogName string `json:"catalogName"` + MetastoreDbConnectionAuthenticationMode *MetastoreDbConnectionAuthenticationMode `json:"metastoreDbConnectionAuthenticationMode,omitempty"` + MetastoreDbConnectionPasswordSecret *string `json:"metastoreDbConnectionPasswordSecret,omitempty"` + MetastoreDbConnectionURL string `json:"metastoreDbConnectionURL"` + MetastoreDbConnectionUserName *string `json:"metastoreDbConnectionUserName,omitempty"` + MetastoreWarehouseDir string `json:"metastoreWarehouseDir"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_identityprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_identityprofile.go new file mode 100644 index 00000000000..b97ff7d5eac --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_identityprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type IdentityProfile struct { + MsiClientId string `json:"msiClientId"` + MsiObjectId string `json:"msiObjectId"` + MsiResourceId string `json:"msiResourceId"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaconnectivityendpoints.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaconnectivityendpoints.go new file mode 100644 index 00000000000..c8a0bdfc071 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaconnectivityendpoints.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KafkaConnectivityEndpoints struct { + BootstrapServerEndpoint *string `json:"bootstrapServerEndpoint,omitempty"` + BrokerEndpoints *[]string `json:"brokerEndpoints,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaprofile.go new file mode 100644 index 00000000000..b5233a52f94 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_kafkaprofile.go @@ -0,0 +1,12 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KafkaProfile struct { + ConnectivityEndpoints *KafkaConnectivityEndpoints `json:"connectivityEndpoints,omitempty"` + DiskStorage DiskStorageProfile `json:"diskStorage"` + EnableKRaft *bool `json:"enableKRaft,omitempty"` + EnablePublicEndpoints *bool `json:"enablePublicEndpoints,omitempty"` + RemoteStorageUri *string `json:"remoteStorageUri,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_loadbasedconfig.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_loadbasedconfig.go new file mode 100644 index 00000000000..b4f09bce5e2 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_loadbasedconfig.go @@ -0,0 +1,12 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LoadBasedConfig struct { + CooldownPeriod *int64 `json:"cooldownPeriod,omitempty"` + MaxNodes int64 `json:"maxNodes"` + MinNodes int64 `json:"minNodes"` + PollInterval *int64 `json:"pollInterval,omitempty"` + ScalingRules []ScalingRule `json:"scalingRules"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityprofile.go new file mode 100644 index 00000000000..177384cd86c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityprofile.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedIdentityProfile struct { + IdentityList []ManagedIdentitySpec `json:"identityList"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityspec.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityspec.go new file mode 100644 index 00000000000..7b940f288f3 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_managedidentityspec.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedIdentitySpec struct { + ClientId string `json:"clientId"` + ObjectId string `json:"objectId"` + ResourceId string `json:"resourceId"` + Type ManagedIdentityType `json:"type"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_mavenlibraryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_mavenlibraryproperties.go new file mode 100644 index 00000000000..3d5df1938a8 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_mavenlibraryproperties.go @@ -0,0 +1,62 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + "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. + +var _ ClusterLibraryProperties = MavenLibraryProperties{} + +type MavenLibraryProperties struct { + GroupId string `json:"groupId"` + Name string `json:"name"` + Version *string `json:"version,omitempty"` + + // Fields inherited from ClusterLibraryProperties + Message *string `json:"message,omitempty"` + Remarks *string `json:"remarks,omitempty"` + Status *Status `json:"status,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *MavenLibraryProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *MavenLibraryProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} + +var _ json.Marshaler = MavenLibraryProperties{} + +func (s MavenLibraryProperties) MarshalJSON() ([]byte, error) { + type wrapper MavenLibraryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling MavenLibraryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling MavenLibraryProperties: %+v", err) + } + decoded["type"] = "maven" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling MavenLibraryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityparameters.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityparameters.go new file mode 100644 index 00000000000..ac59a1a31fb --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityparameters.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NameAvailabilityParameters struct { + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityresult.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityresult.go new file mode 100644 index 00000000000..c9e9ff1c6c4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_nameavailabilityresult.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NameAvailabilityResult struct { + Message *string `json:"message,omitempty"` + NameAvailable *bool `json:"nameAvailable,omitempty"` + Reason *string `json:"reason,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_nodeprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_nodeprofile.go new file mode 100644 index 00000000000..fe96f4438fc --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_nodeprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NodeProfile struct { + Count int64 `json:"count"` + Type string `json:"type"` + VMSize string `json:"vmSize"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_pypilibraryproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_pypilibraryproperties.go new file mode 100644 index 00000000000..501a1045768 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_pypilibraryproperties.go @@ -0,0 +1,61 @@ +package hdinsights + +import ( + "encoding/json" + "fmt" + "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. + +var _ ClusterLibraryProperties = PyPiLibraryProperties{} + +type PyPiLibraryProperties struct { + Name string `json:"name"` + Version *string `json:"version,omitempty"` + + // Fields inherited from ClusterLibraryProperties + Message *string `json:"message,omitempty"` + Remarks *string `json:"remarks,omitempty"` + Status *Status `json:"status,omitempty"` + Timestamp *string `json:"timestamp,omitempty"` +} + +func (o *PyPiLibraryProperties) GetTimestampAsTime() (*time.Time, error) { + if o.Timestamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *PyPiLibraryProperties) SetTimestampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Timestamp = &formatted +} + +var _ json.Marshaler = PyPiLibraryProperties{} + +func (s PyPiLibraryProperties) MarshalJSON() ([]byte, error) { + type wrapper PyPiLibraryProperties + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling PyPiLibraryProperties: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling PyPiLibraryProperties: %+v", err) + } + decoded["type"] = "pypi" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling PyPiLibraryProperties: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspec.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspec.go new file mode 100644 index 00000000000..cbda9776e8f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspec.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RangerAdminSpec struct { + Admins []string `json:"admins"` + Database RangerAdminSpecDatabase `json:"database"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspecdatabase.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspecdatabase.go new file mode 100644 index 00000000000..950f0b0874a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangeradminspecdatabase.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RangerAdminSpecDatabase struct { + Host string `json:"host"` + Name string `json:"name"` + PasswordSecretRef *string `json:"passwordSecretRef,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerauditspec.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerauditspec.go new file mode 100644 index 00000000000..5ed6c56c39f --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerauditspec.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RangerAuditSpec struct { + StorageAccount *string `json:"storageAccount,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerprofile.go new file mode 100644 index 00000000000..2569b74a563 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RangerProfile struct { + RangerAdmin RangerAdminSpec `json:"rangerAdmin"` + RangerAudit *RangerAuditSpec `json:"rangerAudit,omitempty"` + RangerUsersync RangerUsersyncSpec `json:"rangerUsersync"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerusersyncspec.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerusersyncspec.go new file mode 100644 index 00000000000..619562a8bd2 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_rangerusersyncspec.go @@ -0,0 +1,12 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RangerUsersyncSpec struct { + Enabled *bool `json:"enabled,omitempty"` + Groups *[]string `json:"groups,omitempty"` + Mode *RangerUsersyncMode `json:"mode,omitempty"` + UserMappingLocation *string `json:"userMappingLocation,omitempty"` + Users *[]string `json:"users,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_scalingrule.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_scalingrule.go new file mode 100644 index 00000000000..42ac004d527 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_scalingrule.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScalingRule struct { + ActionType ScaleActionType `json:"actionType"` + ComparisonRule ComparisonRule `json:"comparisonRule"` + EvaluationCount int64 `json:"evaluationCount"` + ScalingMetric string `json:"scalingMetric"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_schedule.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_schedule.go new file mode 100644 index 00000000000..cd9b92eb657 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_schedule.go @@ -0,0 +1,11 @@ +package hdinsights + +// 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 { + Count int64 `json:"count"` + Days []ScheduleDay `json:"days"` + EndTime string `json:"endTime"` + StartTime string `json:"startTime"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_schedulebasedconfig.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_schedulebasedconfig.go new file mode 100644 index 00000000000..dc6aa759b97 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_schedulebasedconfig.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScheduleBasedConfig struct { + DefaultCount int64 `json:"defaultCount"` + Schedules []Schedule `json:"schedules"` + TimeZone string `json:"timeZone"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_scriptactionprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_scriptactionprofile.go new file mode 100644 index 00000000000..de937ddb267 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_scriptactionprofile.go @@ -0,0 +1,14 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ScriptActionProfile struct { + Name string `json:"name"` + Parameters *string `json:"parameters,omitempty"` + Services []string `json:"services"` + ShouldPersist *bool `json:"shouldPersist,omitempty"` + TimeoutInMinutes *int64 `json:"timeoutInMinutes,omitempty"` + Type string `json:"type"` + Url string `json:"url"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_secretreference.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_secretreference.go new file mode 100644 index 00000000000..4939216b9eb --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_secretreference.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecretReference struct { + KeyVaultObjectName string `json:"keyVaultObjectName"` + ReferenceName string `json:"referenceName"` + Type KeyVaultObjectType `json:"type"` + Version *string `json:"version,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_secretsprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_secretsprofile.go new file mode 100644 index 00000000000..4256220f428 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_secretsprofile.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecretsProfile struct { + KeyVaultResourceId string `json:"keyVaultResourceId"` + Secrets *[]SecretReference `json:"secrets,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultproperties.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultproperties.go new file mode 100644 index 00000000000..668d8d3396c --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultproperties.go @@ -0,0 +1,15 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceConfigListResultProperties struct { + ComponentName string `json:"componentName"` + Content *string `json:"content,omitempty"` + CustomKeys *map[string]string `json:"customKeys,omitempty"` + DefaultKeys *map[string]ServiceConfigListResultValueEntity `json:"defaultKeys,omitempty"` + FileName string `json:"fileName"` + Path *string `json:"path,omitempty"` + ServiceName string `json:"serviceName"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultvalueentity.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultvalueentity.go new file mode 100644 index 00000000000..a714004a92d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfiglistresultvalueentity.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceConfigListResultValueEntity struct { + Description *string `json:"description,omitempty"` + Value string `json:"value"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfigresult.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfigresult.go new file mode 100644 index 00000000000..f62f4b32505 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_serviceconfigresult.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceConfigResult struct { + Properties *ServiceConfigListResultProperties `json:"properties,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_servicestatus.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_servicestatus.go new file mode 100644 index 00000000000..60b91c19fa5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_servicestatus.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ServiceStatus struct { + Kind string `json:"kind"` + Message *string `json:"message,omitempty"` + Ready string `json:"ready"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkmetastorespec.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkmetastorespec.go new file mode 100644 index 00000000000..0f4f1e5faa5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkmetastorespec.go @@ -0,0 +1,14 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SparkMetastoreSpec struct { + DbConnectionAuthenticationMode *DbConnectionAuthenticationMode `json:"dbConnectionAuthenticationMode,omitempty"` + DbName string `json:"dbName"` + DbPasswordSecretName *string `json:"dbPasswordSecretName,omitempty"` + DbServerHost string `json:"dbServerHost"` + DbUserName *string `json:"dbUserName,omitempty"` + KeyVaultId *string `json:"keyVaultId,omitempty"` + ThriftUrl *string `json:"thriftUrl,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkprofile.go new file mode 100644 index 00000000000..eb7dcf5586a --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SparkProfile struct { + DefaultStorageUrl *string `json:"defaultStorageUrl,omitempty"` + MetastoreSpec *SparkMetastoreSpec `json:"metastoreSpec,omitempty"` + UserPluginsSpec *SparkUserPlugins `json:"userPluginsSpec,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugin.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugin.go new file mode 100644 index 00000000000..4ca213c492d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugin.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SparkUserPlugin struct { + Path string `json:"path"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugins.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugins.go new file mode 100644 index 00000000000..efad120f188 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sparkuserplugins.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SparkUserPlugins struct { + Plugins *[]SparkUserPlugin `json:"plugins,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_sshconnectivityendpoint.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sshconnectivityendpoint.go new file mode 100644 index 00000000000..c02d8aceb70 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sshconnectivityendpoint.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshConnectivityEndpoint struct { + Endpoint string `json:"endpoint"` + PrivateSshEndpoint *string `json:"privateSshEndpoint,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_sshprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sshprofile.go new file mode 100644 index 00000000000..565961a32f4 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_sshprofile.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SshProfile struct { + Count int64 `json:"count"` + PodPrefix *string `json:"podPrefix,omitempty"` + VMSize *string `json:"vmSize,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_tagsobject.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_tagsobject.go new file mode 100644 index 00000000000..01c6624701b --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_tagsobject.go @@ -0,0 +1,8 @@ +package hdinsights + +// 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/hdinsight/2024-05-01/hdinsights/model_trinocoordinator.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinocoordinator.go new file mode 100644 index 00000000000..e3ccf15e51e --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinocoordinator.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoCoordinator struct { + Debug *TrinoDebugConfig `json:"debug,omitempty"` + HighAvailabilityEnabled *bool `json:"highAvailabilityEnabled,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinodebugconfig.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinodebugconfig.go new file mode 100644 index 00000000000..3f049766688 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinodebugconfig.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoDebugConfig struct { + Enable *bool `json:"enable,omitempty"` + Port *int64 `json:"port,omitempty"` + Suspend *bool `json:"suspend,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoprofile.go new file mode 100644 index 00000000000..01845c9f621 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoprofile.go @@ -0,0 +1,12 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoProfile struct { + CatalogOptions *CatalogOptions `json:"catalogOptions,omitempty"` + Coordinator *TrinoCoordinator `json:"coordinator,omitempty"` + UserPluginsSpec *TrinoUserPlugins `json:"userPluginsSpec,omitempty"` + UserTelemetrySpec *TrinoUserTelemetry `json:"userTelemetrySpec,omitempty"` + Worker *TrinoWorker `json:"worker,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinotelemetryconfig.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinotelemetryconfig.go new file mode 100644 index 00000000000..16e47ef03a9 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinotelemetryconfig.go @@ -0,0 +1,11 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoTelemetryConfig struct { + HivecatalogName *string `json:"hivecatalogName,omitempty"` + HivecatalogSchema *string `json:"hivecatalogSchema,omitempty"` + PartitionRetentionInDays *int64 `json:"partitionRetentionInDays,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugin.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugin.go new file mode 100644 index 00000000000..687061549f5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugin.go @@ -0,0 +1,10 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoUserPlugin struct { + Enabled *bool `json:"enabled,omitempty"` + Name *string `json:"name,omitempty"` + Path *string `json:"path,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugins.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugins.go new file mode 100644 index 00000000000..943388c0430 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinouserplugins.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoUserPlugins struct { + Plugins *[]TrinoUserPlugin `json:"plugins,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinousertelemetry.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinousertelemetry.go new file mode 100644 index 00000000000..cae3ab104b5 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinousertelemetry.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoUserTelemetry struct { + Storage *TrinoTelemetryConfig `json:"storage,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoworker.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoworker.go new file mode 100644 index 00000000000..28afe0313d0 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_trinoworker.go @@ -0,0 +1,8 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type TrinoWorker struct { + Debug *TrinoDebugConfig `json:"debug,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_updatableclusterprofile.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_updatableclusterprofile.go new file mode 100644 index 00000000000..b703c72733d --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_updatableclusterprofile.go @@ -0,0 +1,18 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdatableClusterProfile struct { + AuthorizationProfile *AuthorizationProfile `json:"authorizationProfile,omitempty"` + AutoscaleProfile *AutoscaleProfile `json:"autoscaleProfile,omitempty"` + LogAnalyticsProfile *ClusterLogAnalyticsProfile `json:"logAnalyticsProfile,omitempty"` + PrometheusProfile *ClusterPrometheusProfile `json:"prometheusProfile,omitempty"` + RangerPluginProfile *ClusterRangerPluginProfile `json:"rangerPluginProfile,omitempty"` + RangerProfile *RangerProfile `json:"rangerProfile,omitempty"` + ScriptActionProfiles *[]ScriptActionProfile `json:"scriptActionProfiles,omitempty"` + SecretsProfile *SecretsProfile `json:"secretsProfile,omitempty"` + ServiceConfigsProfiles *[]ClusterServiceConfigsProfile `json:"serviceConfigsProfiles,omitempty"` + SshProfile *SshProfile `json:"sshProfile,omitempty"` + TrinoProfile *TrinoProfile `json:"trinoProfile,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/model_webconnectivityendpoint.go b/resource-manager/hdinsight/2024-05-01/hdinsights/model_webconnectivityendpoint.go new file mode 100644 index 00000000000..693f951d9d6 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/model_webconnectivityendpoint.go @@ -0,0 +1,9 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebConnectivityEndpoint struct { + Fqdn string `json:"fqdn"` + PrivateFqdn *string `json:"privateFqdn,omitempty"` +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/predicates.go b/resource-manager/hdinsight/2024-05-01/hdinsights/predicates.go new file mode 100644 index 00000000000..b1f9f1a2151 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/predicates.go @@ -0,0 +1,265 @@ +package hdinsights + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ClusterOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p ClusterOperationPredicate) Matches(input Cluster) 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 +} + +type ClusterAvailableUpgradeOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterAvailableUpgradeOperationPredicate) Matches(input ClusterAvailableUpgrade) 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 ClusterInstanceViewResultOperationPredicate struct { + Name *string +} + +func (p ClusterInstanceViewResultOperationPredicate) Matches(input ClusterInstanceViewResult) bool { + + if p.Name != nil && *p.Name != input.Name { + return false + } + + return true +} + +type ClusterJobOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterJobOperationPredicate) Matches(input ClusterJob) 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 ClusterLibraryOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterLibraryOperationPredicate) Matches(input ClusterLibrary) 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 ClusterPoolOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p ClusterPoolOperationPredicate) Matches(input ClusterPool) 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 +} + +type ClusterPoolAvailableUpgradeOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterPoolAvailableUpgradeOperationPredicate) Matches(input ClusterPoolAvailableUpgrade) 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 ClusterPoolUpgradeHistoryOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterPoolUpgradeHistoryOperationPredicate) Matches(input ClusterPoolUpgradeHistory) 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 ClusterPoolVersionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterPoolVersionOperationPredicate) Matches(input ClusterPoolVersion) 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 ClusterUpgradeHistoryOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterUpgradeHistoryOperationPredicate) Matches(input ClusterUpgradeHistory) 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 ClusterVersionOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p ClusterVersionOperationPredicate) Matches(input ClusterVersion) 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 ServiceConfigResultOperationPredicate struct { +} + +func (p ServiceConfigResultOperationPredicate) Matches(input ServiceConfigResult) bool { + + return true +} diff --git a/resource-manager/hdinsight/2024-05-01/hdinsights/version.go b/resource-manager/hdinsight/2024-05-01/hdinsights/version.go new file mode 100644 index 00000000000..1da5591ea32 --- /dev/null +++ b/resource-manager/hdinsight/2024-05-01/hdinsights/version.go @@ -0,0 +1,12 @@ +package hdinsights + +import "fmt" + +// 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-05-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/hdinsights/%s", defaultApiVersion) +} diff --git a/resource-manager/insights/2021-04-01/client.go b/resource-manager/insights/2021-04-01/client.go deleted file mode 100644 index f2fec116180..00000000000 --- a/resource-manager/insights/2021-04-01/client.go +++ /dev/null @@ -1,46 +0,0 @@ -package v2021_04_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/insights/2021-04-01/datacollectionendpoints" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionruleassociations" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionrules" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - DataCollectionEndpoints *datacollectionendpoints.DataCollectionEndpointsClient - DataCollectionRuleAssociations *datacollectionruleassociations.DataCollectionRuleAssociationsClient - DataCollectionRules *datacollectionrules.DataCollectionRulesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - dataCollectionEndpointsClient, err := datacollectionendpoints.NewDataCollectionEndpointsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataCollectionEndpoints client: %+v", err) - } - configureFunc(dataCollectionEndpointsClient.Client) - - dataCollectionRuleAssociationsClient, err := datacollectionruleassociations.NewDataCollectionRuleAssociationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataCollectionRuleAssociations client: %+v", err) - } - configureFunc(dataCollectionRuleAssociationsClient.Client) - - dataCollectionRulesClient, err := datacollectionrules.NewDataCollectionRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataCollectionRules client: %+v", err) - } - configureFunc(dataCollectionRulesClient.Client) - - return &Client{ - DataCollectionEndpoints: dataCollectionEndpointsClient, - DataCollectionRuleAssociations: dataCollectionRuleAssociationsClient, - DataCollectionRules: dataCollectionRulesClient, - }, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/README.md b/resource-manager/insights/2021-04-01/datacollectionendpoints/README.md deleted file mode 100644 index 099e735ae95..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionendpoints` Documentation - -The `datacollectionendpoints` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-04-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/insights/2021-04-01/datacollectionendpoints" -``` - - -### Client Initialization - -```go -client := datacollectionendpoints.NewDataCollectionEndpointsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataCollectionEndpointsClient.Create` - -```go -ctx := context.TODO() -id := datacollectionendpoints.NewDataCollectionEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionEndpointValue") - -payload := datacollectionendpoints.DataCollectionEndpointResource{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DataCollectionEndpointsClient.Delete` - -```go -ctx := context.TODO() -id := datacollectionendpoints.NewDataCollectionEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionEndpointValue") - -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: `DataCollectionEndpointsClient.Get` - -```go -ctx := context.TODO() -id := datacollectionendpoints.NewDataCollectionEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionEndpointValue") - -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: `DataCollectionEndpointsClient.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: `DataCollectionEndpointsClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DataCollectionEndpointsClient.Update` - -```go -ctx := context.TODO() -id := datacollectionendpoints.NewDataCollectionEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionEndpointValue") - -payload := datacollectionendpoints.ResourceForUpdate{ - // ... -} - - -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/insights/2021-04-01/datacollectionendpoints/client.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/client.go deleted file mode 100644 index 87bdf893d44..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package datacollectionendpoints - -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 DataCollectionEndpointsClient struct { - Client *resourcemanager.Client -} - -func NewDataCollectionEndpointsClientWithBaseURI(sdkApi sdkEnv.Api) (*DataCollectionEndpointsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "datacollectionendpoints", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataCollectionEndpointsClient: %+v", err) - } - - return &DataCollectionEndpointsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/constants.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/constants.go deleted file mode 100644 index 494546d9a63..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/constants.go +++ /dev/null @@ -1,142 +0,0 @@ -package datacollectionendpoints - -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 KnownDataCollectionEndpointProvisioningState string - -const ( - KnownDataCollectionEndpointProvisioningStateCreating KnownDataCollectionEndpointProvisioningState = "Creating" - KnownDataCollectionEndpointProvisioningStateDeleting KnownDataCollectionEndpointProvisioningState = "Deleting" - KnownDataCollectionEndpointProvisioningStateFailed KnownDataCollectionEndpointProvisioningState = "Failed" - KnownDataCollectionEndpointProvisioningStateSucceeded KnownDataCollectionEndpointProvisioningState = "Succeeded" - KnownDataCollectionEndpointProvisioningStateUpdating KnownDataCollectionEndpointProvisioningState = "Updating" -) - -func PossibleValuesForKnownDataCollectionEndpointProvisioningState() []string { - return []string{ - string(KnownDataCollectionEndpointProvisioningStateCreating), - string(KnownDataCollectionEndpointProvisioningStateDeleting), - string(KnownDataCollectionEndpointProvisioningStateFailed), - string(KnownDataCollectionEndpointProvisioningStateSucceeded), - string(KnownDataCollectionEndpointProvisioningStateUpdating), - } -} - -func (s *KnownDataCollectionEndpointProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownDataCollectionEndpointProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownDataCollectionEndpointProvisioningState(input string) (*KnownDataCollectionEndpointProvisioningState, error) { - vals := map[string]KnownDataCollectionEndpointProvisioningState{ - "creating": KnownDataCollectionEndpointProvisioningStateCreating, - "deleting": KnownDataCollectionEndpointProvisioningStateDeleting, - "failed": KnownDataCollectionEndpointProvisioningStateFailed, - "succeeded": KnownDataCollectionEndpointProvisioningStateSucceeded, - "updating": KnownDataCollectionEndpointProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownDataCollectionEndpointProvisioningState(input) - return &out, nil -} - -type KnownDataCollectionEndpointResourceKind string - -const ( - KnownDataCollectionEndpointResourceKindLinux KnownDataCollectionEndpointResourceKind = "Linux" - KnownDataCollectionEndpointResourceKindWindows KnownDataCollectionEndpointResourceKind = "Windows" -) - -func PossibleValuesForKnownDataCollectionEndpointResourceKind() []string { - return []string{ - string(KnownDataCollectionEndpointResourceKindLinux), - string(KnownDataCollectionEndpointResourceKindWindows), - } -} - -func (s *KnownDataCollectionEndpointResourceKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownDataCollectionEndpointResourceKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownDataCollectionEndpointResourceKind(input string) (*KnownDataCollectionEndpointResourceKind, error) { - vals := map[string]KnownDataCollectionEndpointResourceKind{ - "linux": KnownDataCollectionEndpointResourceKindLinux, - "windows": KnownDataCollectionEndpointResourceKindWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownDataCollectionEndpointResourceKind(input) - return &out, nil -} - -type KnownPublicNetworkAccessOptions string - -const ( - KnownPublicNetworkAccessOptionsDisabled KnownPublicNetworkAccessOptions = "Disabled" - KnownPublicNetworkAccessOptionsEnabled KnownPublicNetworkAccessOptions = "Enabled" -) - -func PossibleValuesForKnownPublicNetworkAccessOptions() []string { - return []string{ - string(KnownPublicNetworkAccessOptionsDisabled), - string(KnownPublicNetworkAccessOptionsEnabled), - } -} - -func (s *KnownPublicNetworkAccessOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownPublicNetworkAccessOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownPublicNetworkAccessOptions(input string) (*KnownPublicNetworkAccessOptions, error) { - vals := map[string]KnownPublicNetworkAccessOptions{ - "disabled": KnownPublicNetworkAccessOptionsDisabled, - "enabled": KnownPublicNetworkAccessOptionsEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownPublicNetworkAccessOptions(input) - return &out, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint.go deleted file mode 100644 index 613a79533aa..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint.go +++ /dev/null @@ -1,130 +0,0 @@ -package datacollectionendpoints - -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(&DataCollectionEndpointId{}) -} - -var _ resourceids.ResourceId = &DataCollectionEndpointId{} - -// DataCollectionEndpointId is a struct representing the Resource ID for a Data Collection Endpoint -type DataCollectionEndpointId struct { - SubscriptionId string - ResourceGroupName string - DataCollectionEndpointName string -} - -// NewDataCollectionEndpointID returns a new DataCollectionEndpointId struct -func NewDataCollectionEndpointID(subscriptionId string, resourceGroupName string, dataCollectionEndpointName string) DataCollectionEndpointId { - return DataCollectionEndpointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DataCollectionEndpointName: dataCollectionEndpointName, - } -} - -// ParseDataCollectionEndpointID parses 'input' into a DataCollectionEndpointId -func ParseDataCollectionEndpointID(input string) (*DataCollectionEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataCollectionEndpointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataCollectionEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataCollectionEndpointIDInsensitively parses 'input' case-insensitively into a DataCollectionEndpointId -// note: this method should only be used for API response data and not user input -func ParseDataCollectionEndpointIDInsensitively(input string) (*DataCollectionEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataCollectionEndpointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataCollectionEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataCollectionEndpointId) 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.DataCollectionEndpointName, ok = input.Parsed["dataCollectionEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataCollectionEndpointName", input) - } - - return nil -} - -// ValidateDataCollectionEndpointID checks that 'input' can be parsed as a Data Collection Endpoint ID -func ValidateDataCollectionEndpointID(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 := ParseDataCollectionEndpointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Collection Endpoint ID -func (id DataCollectionEndpointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/dataCollectionEndpoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DataCollectionEndpointName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Collection Endpoint ID -func (id DataCollectionEndpointId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticDataCollectionEndpoints", "dataCollectionEndpoints", "dataCollectionEndpoints"), - resourceids.UserSpecifiedSegment("dataCollectionEndpointName", "dataCollectionEndpointValue"), - } -} - -// String returns a human-readable description of this Data Collection Endpoint ID -func (id DataCollectionEndpointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Data Collection Endpoint Name: %q", id.DataCollectionEndpointName), - } - return fmt.Sprintf("Data Collection Endpoint (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint_test.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint_test.go deleted file mode 100644 index 21f435b8701..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/id_datacollectionendpoint_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package datacollectionendpoints - -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 = &DataCollectionEndpointId{} - -func TestNewDataCollectionEndpointID(t *testing.T) { - id := NewDataCollectionEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionEndpointValue") - - 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.DataCollectionEndpointName != "dataCollectionEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataCollectionEndpointName'", id.DataCollectionEndpointName, "dataCollectionEndpointValue") - } -} - -func TestFormatDataCollectionEndpointID(t *testing.T) { - actual := NewDataCollectionEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionEndpointValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints/dataCollectionEndpointValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataCollectionEndpointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataCollectionEndpointId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints/dataCollectionEndpointValue", - Expected: &DataCollectionEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DataCollectionEndpointName: "dataCollectionEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints/dataCollectionEndpointValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataCollectionEndpointID(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.DataCollectionEndpointName != v.Expected.DataCollectionEndpointName { - t.Fatalf("Expected %q but got %q for DataCollectionEndpointName", v.Expected.DataCollectionEndpointName, actual.DataCollectionEndpointName) - } - - } -} - -func TestParseDataCollectionEndpointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataCollectionEndpointId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNeNdPoInTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints/dataCollectionEndpointValue", - Expected: &DataCollectionEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DataCollectionEndpointName: "dataCollectionEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionEndpoints/dataCollectionEndpointValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNeNdPoInTs/dAtAcOlLeCtIoNeNdPoInTvAlUe", - Expected: &DataCollectionEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataCollectionEndpointName: "dAtAcOlLeCtIoNeNdPoInTvAlUe", - }, - }, - { - // 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.iNsIgHtS/dAtAcOlLeCtIoNeNdPoInTs/dAtAcOlLeCtIoNeNdPoInTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataCollectionEndpointIDInsensitively(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.DataCollectionEndpointName != v.Expected.DataCollectionEndpointName { - t.Fatalf("Expected %q but got %q for DataCollectionEndpointName", v.Expected.DataCollectionEndpointName, actual.DataCollectionEndpointName) - } - - } -} - -func TestSegmentsForDataCollectionEndpointId(t *testing.T) { - segments := DataCollectionEndpointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataCollectionEndpointId 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/insights/2021-04-01/datacollectionendpoints/method_create.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/method_create.go deleted file mode 100644 index a030026f8b8..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package datacollectionendpoints - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataCollectionEndpointResource -} - -// Create ... -func (c DataCollectionEndpointsClient) Create(ctx context.Context, id DataCollectionEndpointId, input DataCollectionEndpointResource) (result CreateOperationResponse, 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 DataCollectionEndpointResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_delete.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/method_delete.go deleted file mode 100644 index 1f4b196464e..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package datacollectionendpoints - -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 DataCollectionEndpointsClient) Delete(ctx context.Context, id DataCollectionEndpointId) (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/insights/2021-04-01/datacollectionendpoints/method_get.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/method_get.go deleted file mode 100644 index c76d55a8bf1..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package datacollectionendpoints - -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 *DataCollectionEndpointResource -} - -// Get ... -func (c DataCollectionEndpointsClient) Get(ctx context.Context, id DataCollectionEndpointId) (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 DataCollectionEndpointResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbyresourcegroup.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbyresourcegroup.go deleted file mode 100644 index 010ad394ee3..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package datacollectionendpoints - -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 *[]DataCollectionEndpointResource -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataCollectionEndpointResource -} - -// ListByResourceGroup ... -func (c DataCollectionEndpointsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/dataCollectionEndpoints", 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 *[]DataCollectionEndpointResource `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 DataCollectionEndpointsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DataCollectionEndpointResourceOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataCollectionEndpointsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DataCollectionEndpointResourceOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]DataCollectionEndpointResource, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/insights/2021-04-01/datacollectionendpoints/method_listbysubscription.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbysubscription.go deleted file mode 100644 index 60c753e8cdf..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package datacollectionendpoints - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DataCollectionEndpointResource -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataCollectionEndpointResource -} - -// ListBySubscription ... -func (c DataCollectionEndpointsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/dataCollectionEndpoints", 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 *[]DataCollectionEndpointResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c DataCollectionEndpointsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, DataCollectionEndpointResourceOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataCollectionEndpointsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DataCollectionEndpointResourceOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]DataCollectionEndpointResource, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_update.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/method_update.go deleted file mode 100644 index 27ba0a5ec60..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package datacollectionendpoints - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataCollectionEndpointResource -} - -// Update ... -func (c DataCollectionEndpointsClient) Update(ctx context.Context, id DataCollectionEndpointId, input ResourceForUpdate) (result UpdateOperationResponse, 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 DataCollectionEndpointResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_configurationaccessendpointspec.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/model_configurationaccessendpointspec.go deleted file mode 100644 index e35b5822dac..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_configurationaccessendpointspec.go +++ /dev/null @@ -1,8 +0,0 @@ -package datacollectionendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationAccessEndpointSpec struct { - Endpoint *string `json:"endpoint,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpoint.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpoint.go deleted file mode 100644 index 8b85bdd7b56..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpoint.go +++ /dev/null @@ -1,13 +0,0 @@ -package datacollectionendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataCollectionEndpoint struct { - ConfigurationAccess *ConfigurationAccessEndpointSpec `json:"configurationAccess,omitempty"` - Description *string `json:"description,omitempty"` - ImmutableId *string `json:"immutableId,omitempty"` - LogsIngestion *LogsIngestionEndpointSpec `json:"logsIngestion,omitempty"` - NetworkAcls *NetworkRuleSet `json:"networkAcls,omitempty"` - ProvisioningState *KnownDataCollectionEndpointProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpointresource.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpointresource.go deleted file mode 100644 index e9b56ee8cd1..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_datacollectionendpointresource.go +++ /dev/null @@ -1,20 +0,0 @@ -package datacollectionendpoints - -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 DataCollectionEndpointResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *KnownDataCollectionEndpointResourceKind `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *DataCollectionEndpoint `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/insights/2021-04-01/datacollectionendpoints/model_logsingestionendpointspec.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/model_logsingestionendpointspec.go deleted file mode 100644 index 398fc326eea..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_logsingestionendpointspec.go +++ /dev/null @@ -1,8 +0,0 @@ -package datacollectionendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogsIngestionEndpointSpec struct { - Endpoint *string `json:"endpoint,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_networkruleset.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/model_networkruleset.go deleted file mode 100644 index 86bef2b8810..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_networkruleset.go +++ /dev/null @@ -1,8 +0,0 @@ -package datacollectionendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkRuleSet struct { - PublicNetworkAccess *KnownPublicNetworkAccessOptions `json:"publicNetworkAccess,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_resourceforupdate.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/model_resourceforupdate.go deleted file mode 100644 index ef06bf24059..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/model_resourceforupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package datacollectionendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceForUpdate struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/predicates.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/predicates.go deleted file mode 100644 index 147344fb010..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package datacollectionendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataCollectionEndpointResourceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p DataCollectionEndpointResourceOperationPredicate) Matches(input DataCollectionEndpointResource) 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 -} diff --git a/resource-manager/insights/2021-04-01/datacollectionendpoints/version.go b/resource-manager/insights/2021-04-01/datacollectionendpoints/version.go deleted file mode 100644 index 883bbd46c61..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionendpoints/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package datacollectionendpoints - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/datacollectionendpoints/%s", defaultApiVersion) -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/README.md b/resource-manager/insights/2021-04-01/datacollectionruleassociations/README.md deleted file mode 100644 index 6e3e725360f..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/README.md +++ /dev/null @@ -1,108 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionruleassociations` Documentation - -The `datacollectionruleassociations` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-04-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/insights/2021-04-01/datacollectionruleassociations" -``` - - -### Client Initialization - -```go -client := datacollectionruleassociations.NewDataCollectionRuleAssociationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataCollectionRuleAssociationsClient.Create` - -```go -ctx := context.TODO() -id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationValue") - -payload := datacollectionruleassociations.DataCollectionRuleAssociationProxyOnlyResource{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DataCollectionRuleAssociationsClient.Delete` - -```go -ctx := context.TODO() -id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationValue") - -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: `DataCollectionRuleAssociationsClient.Get` - -```go -ctx := context.TODO() -id := datacollectionruleassociations.NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationValue") - -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: `DataCollectionRuleAssociationsClient.ListByResource` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// alternatively `client.ListByResource(ctx, id)` can be used to do batched pagination -items, err := client.ListByResourceComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DataCollectionRuleAssociationsClient.ListByRule` - -```go -ctx := context.TODO() -id := datacollectionruleassociations.NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - -// alternatively `client.ListByRule(ctx, id)` can be used to do batched pagination -items, err := client.ListByRuleComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/client.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/client.go deleted file mode 100644 index 1ac66a65960..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package datacollectionruleassociations - -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 DataCollectionRuleAssociationsClient struct { - Client *resourcemanager.Client -} - -func NewDataCollectionRuleAssociationsClientWithBaseURI(sdkApi sdkEnv.Api) (*DataCollectionRuleAssociationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "datacollectionruleassociations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataCollectionRuleAssociationsClient: %+v", err) - } - - return &DataCollectionRuleAssociationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/constants.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/constants.go deleted file mode 100644 index 26afa0763d7..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package datacollectionruleassociations - -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 KnownDataCollectionRuleAssociationProvisioningState string - -const ( - KnownDataCollectionRuleAssociationProvisioningStateCreating KnownDataCollectionRuleAssociationProvisioningState = "Creating" - KnownDataCollectionRuleAssociationProvisioningStateDeleting KnownDataCollectionRuleAssociationProvisioningState = "Deleting" - KnownDataCollectionRuleAssociationProvisioningStateFailed KnownDataCollectionRuleAssociationProvisioningState = "Failed" - KnownDataCollectionRuleAssociationProvisioningStateSucceeded KnownDataCollectionRuleAssociationProvisioningState = "Succeeded" - KnownDataCollectionRuleAssociationProvisioningStateUpdating KnownDataCollectionRuleAssociationProvisioningState = "Updating" -) - -func PossibleValuesForKnownDataCollectionRuleAssociationProvisioningState() []string { - return []string{ - string(KnownDataCollectionRuleAssociationProvisioningStateCreating), - string(KnownDataCollectionRuleAssociationProvisioningStateDeleting), - string(KnownDataCollectionRuleAssociationProvisioningStateFailed), - string(KnownDataCollectionRuleAssociationProvisioningStateSucceeded), - string(KnownDataCollectionRuleAssociationProvisioningStateUpdating), - } -} - -func (s *KnownDataCollectionRuleAssociationProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownDataCollectionRuleAssociationProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownDataCollectionRuleAssociationProvisioningState(input string) (*KnownDataCollectionRuleAssociationProvisioningState, error) { - vals := map[string]KnownDataCollectionRuleAssociationProvisioningState{ - "creating": KnownDataCollectionRuleAssociationProvisioningStateCreating, - "deleting": KnownDataCollectionRuleAssociationProvisioningStateDeleting, - "failed": KnownDataCollectionRuleAssociationProvisioningStateFailed, - "succeeded": KnownDataCollectionRuleAssociationProvisioningStateSucceeded, - "updating": KnownDataCollectionRuleAssociationProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownDataCollectionRuleAssociationProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule.go deleted file mode 100644 index 9bd3f447ab0..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule.go +++ /dev/null @@ -1,130 +0,0 @@ -package datacollectionruleassociations - -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(&DataCollectionRuleId{}) -} - -var _ resourceids.ResourceId = &DataCollectionRuleId{} - -// DataCollectionRuleId is a struct representing the Resource ID for a Data Collection Rule -type DataCollectionRuleId struct { - SubscriptionId string - ResourceGroupName string - DataCollectionRuleName string -} - -// NewDataCollectionRuleID returns a new DataCollectionRuleId struct -func NewDataCollectionRuleID(subscriptionId string, resourceGroupName string, dataCollectionRuleName string) DataCollectionRuleId { - return DataCollectionRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DataCollectionRuleName: dataCollectionRuleName, - } -} - -// ParseDataCollectionRuleID parses 'input' into a DataCollectionRuleId -func ParseDataCollectionRuleID(input string) (*DataCollectionRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataCollectionRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataCollectionRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataCollectionRuleIDInsensitively parses 'input' case-insensitively into a DataCollectionRuleId -// note: this method should only be used for API response data and not user input -func ParseDataCollectionRuleIDInsensitively(input string) (*DataCollectionRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataCollectionRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataCollectionRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataCollectionRuleId) 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.DataCollectionRuleName, ok = input.Parsed["dataCollectionRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataCollectionRuleName", input) - } - - return nil -} - -// ValidateDataCollectionRuleID checks that 'input' can be parsed as a Data Collection Rule ID -func ValidateDataCollectionRuleID(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 := ParseDataCollectionRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Collection Rule ID -func (id DataCollectionRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/dataCollectionRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DataCollectionRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Collection Rule ID -func (id DataCollectionRuleId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticDataCollectionRules", "dataCollectionRules", "dataCollectionRules"), - resourceids.UserSpecifiedSegment("dataCollectionRuleName", "dataCollectionRuleValue"), - } -} - -// String returns a human-readable description of this Data Collection Rule ID -func (id DataCollectionRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Data Collection Rule Name: %q", id.DataCollectionRuleName), - } - return fmt.Sprintf("Data Collection Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule_test.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule_test.go deleted file mode 100644 index 58f1455d4ce..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_datacollectionrule_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package datacollectionruleassociations - -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 = &DataCollectionRuleId{} - -func TestNewDataCollectionRuleID(t *testing.T) { - id := NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - - 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.DataCollectionRuleName != "dataCollectionRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataCollectionRuleName'", id.DataCollectionRuleName, "dataCollectionRuleValue") - } -} - -func TestFormatDataCollectionRuleID(t *testing.T) { - actual := NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataCollectionRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataCollectionRuleId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue", - Expected: &DataCollectionRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DataCollectionRuleName: "dataCollectionRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataCollectionRuleID(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.DataCollectionRuleName != v.Expected.DataCollectionRuleName { - t.Fatalf("Expected %q but got %q for DataCollectionRuleName", v.Expected.DataCollectionRuleName, actual.DataCollectionRuleName) - } - - } -} - -func TestParseDataCollectionRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataCollectionRuleId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue", - Expected: &DataCollectionRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DataCollectionRuleName: "dataCollectionRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEs/dAtAcOlLeCtIoNrUlEvAlUe", - Expected: &DataCollectionRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataCollectionRuleName: "dAtAcOlLeCtIoNrUlEvAlUe", - }, - }, - { - // 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.iNsIgHtS/dAtAcOlLeCtIoNrUlEs/dAtAcOlLeCtIoNrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataCollectionRuleIDInsensitively(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.DataCollectionRuleName != v.Expected.DataCollectionRuleName { - t.Fatalf("Expected %q but got %q for DataCollectionRuleName", v.Expected.DataCollectionRuleName, actual.DataCollectionRuleName) - } - - } -} - -func TestSegmentsForDataCollectionRuleId(t *testing.T) { - segments := DataCollectionRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataCollectionRuleId 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/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go deleted file mode 100644 index a41aa6370ca..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation.go +++ /dev/null @@ -1,120 +0,0 @@ -package datacollectionruleassociations - -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(&ScopedDataCollectionRuleAssociationId{}) -} - -var _ resourceids.ResourceId = &ScopedDataCollectionRuleAssociationId{} - -// ScopedDataCollectionRuleAssociationId is a struct representing the Resource ID for a Scoped Data Collection Rule Association -type ScopedDataCollectionRuleAssociationId struct { - ResourceUri string - DataCollectionRuleAssociationName string -} - -// NewScopedDataCollectionRuleAssociationID returns a new ScopedDataCollectionRuleAssociationId struct -func NewScopedDataCollectionRuleAssociationID(resourceUri string, dataCollectionRuleAssociationName string) ScopedDataCollectionRuleAssociationId { - return ScopedDataCollectionRuleAssociationId{ - ResourceUri: resourceUri, - DataCollectionRuleAssociationName: dataCollectionRuleAssociationName, - } -} - -// ParseScopedDataCollectionRuleAssociationID parses 'input' into a ScopedDataCollectionRuleAssociationId -func ParseScopedDataCollectionRuleAssociationID(input string) (*ScopedDataCollectionRuleAssociationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedDataCollectionRuleAssociationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedDataCollectionRuleAssociationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedDataCollectionRuleAssociationIDInsensitively parses 'input' case-insensitively into a ScopedDataCollectionRuleAssociationId -// note: this method should only be used for API response data and not user input -func ParseScopedDataCollectionRuleAssociationIDInsensitively(input string) (*ScopedDataCollectionRuleAssociationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedDataCollectionRuleAssociationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedDataCollectionRuleAssociationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedDataCollectionRuleAssociationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.ResourceUri, ok = input.Parsed["resourceUri"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceUri", input) - } - - if id.DataCollectionRuleAssociationName, ok = input.Parsed["dataCollectionRuleAssociationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataCollectionRuleAssociationName", input) - } - - return nil -} - -// ValidateScopedDataCollectionRuleAssociationID checks that 'input' can be parsed as a Scoped Data Collection Rule Association ID -func ValidateScopedDataCollectionRuleAssociationID(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 := ParseScopedDataCollectionRuleAssociationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Data Collection Rule Association ID -func (id ScopedDataCollectionRuleAssociationId) ID() string { - fmtString := "/%s/providers/Microsoft.Insights/dataCollectionRuleAssociations/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.ResourceUri, "/"), id.DataCollectionRuleAssociationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Data Collection Rule Association ID -func (id ScopedDataCollectionRuleAssociationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("resourceUri", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticDataCollectionRuleAssociations", "dataCollectionRuleAssociations", "dataCollectionRuleAssociations"), - resourceids.UserSpecifiedSegment("dataCollectionRuleAssociationName", "dataCollectionRuleAssociationValue"), - } -} - -// String returns a human-readable description of this Scoped Data Collection Rule Association ID -func (id ScopedDataCollectionRuleAssociationId) String() string { - components := []string{ - fmt.Sprintf("Resource Uri: %q", id.ResourceUri), - fmt.Sprintf("Data Collection Rule Association Name: %q", id.DataCollectionRuleAssociationName), - } - return fmt.Sprintf("Scoped Data Collection Rule Association (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go deleted file mode 100644 index 0818a789bb3..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/id_scopeddatacollectionruleassociation_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package datacollectionruleassociations - -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 = &ScopedDataCollectionRuleAssociationId{} - -func TestNewScopedDataCollectionRuleAssociationID(t *testing.T) { - id := NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationValue") - - if id.ResourceUri != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceUri'", id.ResourceUri, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.DataCollectionRuleAssociationName != "dataCollectionRuleAssociationValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataCollectionRuleAssociationName'", id.DataCollectionRuleAssociationName, "dataCollectionRuleAssociationValue") - } -} - -func TestFormatScopedDataCollectionRuleAssociationID(t *testing.T) { - actual := NewScopedDataCollectionRuleAssociationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "dataCollectionRuleAssociationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedDataCollectionRuleAssociationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedDataCollectionRuleAssociationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationValue", - Expected: &ScopedDataCollectionRuleAssociationId{ - ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DataCollectionRuleAssociationName: "dataCollectionRuleAssociationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedDataCollectionRuleAssociationID(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.ResourceUri != v.Expected.ResourceUri { - t.Fatalf("Expected %q but got %q for ResourceUri", v.Expected.ResourceUri, actual.ResourceUri) - } - - if actual.DataCollectionRuleAssociationName != v.Expected.DataCollectionRuleAssociationName { - t.Fatalf("Expected %q but got %q for DataCollectionRuleAssociationName", v.Expected.DataCollectionRuleAssociationName, actual.DataCollectionRuleAssociationName) - } - - } -} - -func TestParseScopedDataCollectionRuleAssociationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedDataCollectionRuleAssociationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationValue", - Expected: &ScopedDataCollectionRuleAssociationId{ - ResourceUri: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DataCollectionRuleAssociationName: "dataCollectionRuleAssociationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Insights/dataCollectionRuleAssociations/dataCollectionRuleAssociationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnVaLuE", - Expected: &ScopedDataCollectionRuleAssociationId{ - ResourceUri: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - DataCollectionRuleAssociationName: "dAtAcOlLeCtIoNrUlEaSsOcIaTiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnS/dAtAcOlLeCtIoNrUlEaSsOcIaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedDataCollectionRuleAssociationIDInsensitively(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.ResourceUri != v.Expected.ResourceUri { - t.Fatalf("Expected %q but got %q for ResourceUri", v.Expected.ResourceUri, actual.ResourceUri) - } - - if actual.DataCollectionRuleAssociationName != v.Expected.DataCollectionRuleAssociationName { - t.Fatalf("Expected %q but got %q for DataCollectionRuleAssociationName", v.Expected.DataCollectionRuleAssociationName, actual.DataCollectionRuleAssociationName) - } - - } -} - -func TestSegmentsForScopedDataCollectionRuleAssociationId(t *testing.T) { - segments := ScopedDataCollectionRuleAssociationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedDataCollectionRuleAssociationId 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/insights/2021-04-01/datacollectionruleassociations/method_create.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_create.go deleted file mode 100644 index 296ae570265..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package datacollectionruleassociations - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataCollectionRuleAssociationProxyOnlyResource -} - -// Create ... -func (c DataCollectionRuleAssociationsClient) Create(ctx context.Context, id ScopedDataCollectionRuleAssociationId, input DataCollectionRuleAssociationProxyOnlyResource) (result CreateOperationResponse, 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 DataCollectionRuleAssociationProxyOnlyResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_delete.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_delete.go deleted file mode 100644 index e6509236a67..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package datacollectionruleassociations - -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 DataCollectionRuleAssociationsClient) Delete(ctx context.Context, id ScopedDataCollectionRuleAssociationId) (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/insights/2021-04-01/datacollectionruleassociations/method_get.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_get.go deleted file mode 100644 index c8dd489bea1..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package datacollectionruleassociations - -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 *DataCollectionRuleAssociationProxyOnlyResource -} - -// Get ... -func (c DataCollectionRuleAssociationsClient) Get(ctx context.Context, id ScopedDataCollectionRuleAssociationId) (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 DataCollectionRuleAssociationProxyOnlyResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyresource.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyresource.go deleted file mode 100644 index bd56b99cf17..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyresource.go +++ /dev/null @@ -1,92 +0,0 @@ -package datacollectionruleassociations - -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 ListByResourceOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DataCollectionRuleAssociationProxyOnlyResource -} - -type ListByResourceCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataCollectionRuleAssociationProxyOnlyResource -} - -// ListByResource ... -func (c DataCollectionRuleAssociationsClient) ListByResource(ctx context.Context, id commonids.ScopeId) (result ListByResourceOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/dataCollectionRuleAssociations", 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 *[]DataCollectionRuleAssociationProxyOnlyResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByResourceComplete retrieves all the results into a single object -func (c DataCollectionRuleAssociationsClient) ListByResourceComplete(ctx context.Context, id commonids.ScopeId) (ListByResourceCompleteResult, error) { - return c.ListByResourceCompleteMatchingPredicate(ctx, id, DataCollectionRuleAssociationProxyOnlyResourceOperationPredicate{}) -} - -// ListByResourceCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataCollectionRuleAssociationsClient) ListByResourceCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate DataCollectionRuleAssociationProxyOnlyResourceOperationPredicate) (result ListByResourceCompleteResult, err error) { - items := make([]DataCollectionRuleAssociationProxyOnlyResource, 0) - - resp, err := c.ListByResource(ctx, id) - if err != nil { - 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 = ListByResourceCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyrule.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyrule.go deleted file mode 100644 index 494b34527e8..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/method_listbyrule.go +++ /dev/null @@ -1,91 +0,0 @@ -package datacollectionruleassociations - -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 ListByRuleOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DataCollectionRuleAssociationProxyOnlyResource -} - -type ListByRuleCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataCollectionRuleAssociationProxyOnlyResource -} - -// ListByRule ... -func (c DataCollectionRuleAssociationsClient) ListByRule(ctx context.Context, id DataCollectionRuleId) (result ListByRuleOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/associations", 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 *[]DataCollectionRuleAssociationProxyOnlyResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByRuleComplete retrieves all the results into a single object -func (c DataCollectionRuleAssociationsClient) ListByRuleComplete(ctx context.Context, id DataCollectionRuleId) (ListByRuleCompleteResult, error) { - return c.ListByRuleCompleteMatchingPredicate(ctx, id, DataCollectionRuleAssociationProxyOnlyResourceOperationPredicate{}) -} - -// ListByRuleCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataCollectionRuleAssociationsClient) ListByRuleCompleteMatchingPredicate(ctx context.Context, id DataCollectionRuleId, predicate DataCollectionRuleAssociationProxyOnlyResourceOperationPredicate) (result ListByRuleCompleteResult, err error) { - items := make([]DataCollectionRuleAssociationProxyOnlyResource, 0) - - resp, err := c.ListByRule(ctx, id) - if err != nil { - 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 = ListByRuleCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociation.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociation.go deleted file mode 100644 index 71b2d598bb9..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociation.go +++ /dev/null @@ -1,11 +0,0 @@ -package datacollectionruleassociations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataCollectionRuleAssociation struct { - DataCollectionEndpointId *string `json:"dataCollectionEndpointId,omitempty"` - DataCollectionRuleId *string `json:"dataCollectionRuleId,omitempty"` - Description *string `json:"description,omitempty"` - ProvisioningState *KnownDataCollectionRuleAssociationProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociationproxyonlyresource.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociationproxyonlyresource.go deleted file mode 100644 index 4cd986116fe..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/model_datacollectionruleassociationproxyonlyresource.go +++ /dev/null @@ -1,17 +0,0 @@ -package datacollectionruleassociations - -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 DataCollectionRuleAssociationProxyOnlyResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DataCollectionRuleAssociation `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionruleassociations/predicates.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/predicates.go deleted file mode 100644 index 4eda98a86ab..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package datacollectionruleassociations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataCollectionRuleAssociationProxyOnlyResourceOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p DataCollectionRuleAssociationProxyOnlyResourceOperationPredicate) Matches(input DataCollectionRuleAssociationProxyOnlyResource) 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.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/insights/2021-04-01/datacollectionruleassociations/version.go b/resource-manager/insights/2021-04-01/datacollectionruleassociations/version.go deleted file mode 100644 index 9e1aaf6b62a..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionruleassociations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package datacollectionruleassociations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/datacollectionruleassociations/%s", defaultApiVersion) -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/README.md b/resource-manager/insights/2021-04-01/datacollectionrules/README.md deleted file mode 100644 index f4335ff8201..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-04-01/datacollectionrules` Documentation - -The `datacollectionrules` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-04-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/insights/2021-04-01/datacollectionrules" -``` - - -### Client Initialization - -```go -client := datacollectionrules.NewDataCollectionRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataCollectionRulesClient.Create` - -```go -ctx := context.TODO() -id := datacollectionrules.NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - -payload := datacollectionrules.DataCollectionRuleResource{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `DataCollectionRulesClient.Delete` - -```go -ctx := context.TODO() -id := datacollectionrules.NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - -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: `DataCollectionRulesClient.Get` - -```go -ctx := context.TODO() -id := datacollectionrules.NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - -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: `DataCollectionRulesClient.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: `DataCollectionRulesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DataCollectionRulesClient.Update` - -```go -ctx := context.TODO() -id := datacollectionrules.NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - -payload := datacollectionrules.ResourceForUpdate{ - // ... -} - - -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/insights/2021-04-01/datacollectionrules/client.go b/resource-manager/insights/2021-04-01/datacollectionrules/client.go deleted file mode 100644 index 715b10fd358..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package datacollectionrules - -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 DataCollectionRulesClient struct { - Client *resourcemanager.Client -} - -func NewDataCollectionRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*DataCollectionRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "datacollectionrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataCollectionRulesClient: %+v", err) - } - - return &DataCollectionRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/constants.go b/resource-manager/insights/2021-04-01/datacollectionrules/constants.go deleted file mode 100644 index 637f6b3d65e..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/constants.go +++ /dev/null @@ -1,499 +0,0 @@ -package datacollectionrules - -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 KnownDataCollectionRuleProvisioningState string - -const ( - KnownDataCollectionRuleProvisioningStateCreating KnownDataCollectionRuleProvisioningState = "Creating" - KnownDataCollectionRuleProvisioningStateDeleting KnownDataCollectionRuleProvisioningState = "Deleting" - KnownDataCollectionRuleProvisioningStateFailed KnownDataCollectionRuleProvisioningState = "Failed" - KnownDataCollectionRuleProvisioningStateSucceeded KnownDataCollectionRuleProvisioningState = "Succeeded" - KnownDataCollectionRuleProvisioningStateUpdating KnownDataCollectionRuleProvisioningState = "Updating" -) - -func PossibleValuesForKnownDataCollectionRuleProvisioningState() []string { - return []string{ - string(KnownDataCollectionRuleProvisioningStateCreating), - string(KnownDataCollectionRuleProvisioningStateDeleting), - string(KnownDataCollectionRuleProvisioningStateFailed), - string(KnownDataCollectionRuleProvisioningStateSucceeded), - string(KnownDataCollectionRuleProvisioningStateUpdating), - } -} - -func (s *KnownDataCollectionRuleProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownDataCollectionRuleProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownDataCollectionRuleProvisioningState(input string) (*KnownDataCollectionRuleProvisioningState, error) { - vals := map[string]KnownDataCollectionRuleProvisioningState{ - "creating": KnownDataCollectionRuleProvisioningStateCreating, - "deleting": KnownDataCollectionRuleProvisioningStateDeleting, - "failed": KnownDataCollectionRuleProvisioningStateFailed, - "succeeded": KnownDataCollectionRuleProvisioningStateSucceeded, - "updating": KnownDataCollectionRuleProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownDataCollectionRuleProvisioningState(input) - return &out, nil -} - -type KnownDataCollectionRuleResourceKind string - -const ( - KnownDataCollectionRuleResourceKindLinux KnownDataCollectionRuleResourceKind = "Linux" - KnownDataCollectionRuleResourceKindWindows KnownDataCollectionRuleResourceKind = "Windows" -) - -func PossibleValuesForKnownDataCollectionRuleResourceKind() []string { - return []string{ - string(KnownDataCollectionRuleResourceKindLinux), - string(KnownDataCollectionRuleResourceKindWindows), - } -} - -func (s *KnownDataCollectionRuleResourceKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownDataCollectionRuleResourceKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownDataCollectionRuleResourceKind(input string) (*KnownDataCollectionRuleResourceKind, error) { - vals := map[string]KnownDataCollectionRuleResourceKind{ - "linux": KnownDataCollectionRuleResourceKindLinux, - "windows": KnownDataCollectionRuleResourceKindWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownDataCollectionRuleResourceKind(input) - return &out, nil -} - -type KnownDataFlowStreams string - -const ( - KnownDataFlowStreamsMicrosoftNegativeEvent KnownDataFlowStreams = "Microsoft-Event" - KnownDataFlowStreamsMicrosoftNegativeInsightsMetrics KnownDataFlowStreams = "Microsoft-InsightsMetrics" - KnownDataFlowStreamsMicrosoftNegativePerf KnownDataFlowStreams = "Microsoft-Perf" - KnownDataFlowStreamsMicrosoftNegativeSyslog KnownDataFlowStreams = "Microsoft-Syslog" - KnownDataFlowStreamsMicrosoftNegativeWindowsEvent KnownDataFlowStreams = "Microsoft-WindowsEvent" -) - -func PossibleValuesForKnownDataFlowStreams() []string { - return []string{ - string(KnownDataFlowStreamsMicrosoftNegativeEvent), - string(KnownDataFlowStreamsMicrosoftNegativeInsightsMetrics), - string(KnownDataFlowStreamsMicrosoftNegativePerf), - string(KnownDataFlowStreamsMicrosoftNegativeSyslog), - string(KnownDataFlowStreamsMicrosoftNegativeWindowsEvent), - } -} - -func (s *KnownDataFlowStreams) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownDataFlowStreams(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownDataFlowStreams(input string) (*KnownDataFlowStreams, error) { - vals := map[string]KnownDataFlowStreams{ - "microsoft-event": KnownDataFlowStreamsMicrosoftNegativeEvent, - "microsoft-insightsmetrics": KnownDataFlowStreamsMicrosoftNegativeInsightsMetrics, - "microsoft-perf": KnownDataFlowStreamsMicrosoftNegativePerf, - "microsoft-syslog": KnownDataFlowStreamsMicrosoftNegativeSyslog, - "microsoft-windowsevent": KnownDataFlowStreamsMicrosoftNegativeWindowsEvent, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownDataFlowStreams(input) - return &out, nil -} - -type KnownExtensionDataSourceStreams string - -const ( - KnownExtensionDataSourceStreamsMicrosoftNegativeEvent KnownExtensionDataSourceStreams = "Microsoft-Event" - KnownExtensionDataSourceStreamsMicrosoftNegativeInsightsMetrics KnownExtensionDataSourceStreams = "Microsoft-InsightsMetrics" - KnownExtensionDataSourceStreamsMicrosoftNegativePerf KnownExtensionDataSourceStreams = "Microsoft-Perf" - KnownExtensionDataSourceStreamsMicrosoftNegativeSyslog KnownExtensionDataSourceStreams = "Microsoft-Syslog" - KnownExtensionDataSourceStreamsMicrosoftNegativeWindowsEvent KnownExtensionDataSourceStreams = "Microsoft-WindowsEvent" -) - -func PossibleValuesForKnownExtensionDataSourceStreams() []string { - return []string{ - string(KnownExtensionDataSourceStreamsMicrosoftNegativeEvent), - string(KnownExtensionDataSourceStreamsMicrosoftNegativeInsightsMetrics), - string(KnownExtensionDataSourceStreamsMicrosoftNegativePerf), - string(KnownExtensionDataSourceStreamsMicrosoftNegativeSyslog), - string(KnownExtensionDataSourceStreamsMicrosoftNegativeWindowsEvent), - } -} - -func (s *KnownExtensionDataSourceStreams) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownExtensionDataSourceStreams(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownExtensionDataSourceStreams(input string) (*KnownExtensionDataSourceStreams, error) { - vals := map[string]KnownExtensionDataSourceStreams{ - "microsoft-event": KnownExtensionDataSourceStreamsMicrosoftNegativeEvent, - "microsoft-insightsmetrics": KnownExtensionDataSourceStreamsMicrosoftNegativeInsightsMetrics, - "microsoft-perf": KnownExtensionDataSourceStreamsMicrosoftNegativePerf, - "microsoft-syslog": KnownExtensionDataSourceStreamsMicrosoftNegativeSyslog, - "microsoft-windowsevent": KnownExtensionDataSourceStreamsMicrosoftNegativeWindowsEvent, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownExtensionDataSourceStreams(input) - return &out, nil -} - -type KnownPerfCounterDataSourceStreams string - -const ( - KnownPerfCounterDataSourceStreamsMicrosoftNegativeInsightsMetrics KnownPerfCounterDataSourceStreams = "Microsoft-InsightsMetrics" - KnownPerfCounterDataSourceStreamsMicrosoftNegativePerf KnownPerfCounterDataSourceStreams = "Microsoft-Perf" -) - -func PossibleValuesForKnownPerfCounterDataSourceStreams() []string { - return []string{ - string(KnownPerfCounterDataSourceStreamsMicrosoftNegativeInsightsMetrics), - string(KnownPerfCounterDataSourceStreamsMicrosoftNegativePerf), - } -} - -func (s *KnownPerfCounterDataSourceStreams) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownPerfCounterDataSourceStreams(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownPerfCounterDataSourceStreams(input string) (*KnownPerfCounterDataSourceStreams, error) { - vals := map[string]KnownPerfCounterDataSourceStreams{ - "microsoft-insightsmetrics": KnownPerfCounterDataSourceStreamsMicrosoftNegativeInsightsMetrics, - "microsoft-perf": KnownPerfCounterDataSourceStreamsMicrosoftNegativePerf, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownPerfCounterDataSourceStreams(input) - return &out, nil -} - -type KnownSyslogDataSourceFacilityNames string - -const ( - KnownSyslogDataSourceFacilityNamesAlert KnownSyslogDataSourceFacilityNames = "alert" - KnownSyslogDataSourceFacilityNamesAny KnownSyslogDataSourceFacilityNames = "*" - KnownSyslogDataSourceFacilityNamesAudit KnownSyslogDataSourceFacilityNames = "audit" - KnownSyslogDataSourceFacilityNamesAuth KnownSyslogDataSourceFacilityNames = "auth" - KnownSyslogDataSourceFacilityNamesAuthpriv KnownSyslogDataSourceFacilityNames = "authpriv" - KnownSyslogDataSourceFacilityNamesClock KnownSyslogDataSourceFacilityNames = "clock" - KnownSyslogDataSourceFacilityNamesCron KnownSyslogDataSourceFacilityNames = "cron" - KnownSyslogDataSourceFacilityNamesDaemon KnownSyslogDataSourceFacilityNames = "daemon" - KnownSyslogDataSourceFacilityNamesFtp KnownSyslogDataSourceFacilityNames = "ftp" - KnownSyslogDataSourceFacilityNamesKern KnownSyslogDataSourceFacilityNames = "kern" - KnownSyslogDataSourceFacilityNamesLocalFive KnownSyslogDataSourceFacilityNames = "local5" - KnownSyslogDataSourceFacilityNamesLocalFour KnownSyslogDataSourceFacilityNames = "local4" - KnownSyslogDataSourceFacilityNamesLocalOne KnownSyslogDataSourceFacilityNames = "local1" - KnownSyslogDataSourceFacilityNamesLocalSeven KnownSyslogDataSourceFacilityNames = "local7" - KnownSyslogDataSourceFacilityNamesLocalSix KnownSyslogDataSourceFacilityNames = "local6" - KnownSyslogDataSourceFacilityNamesLocalThree KnownSyslogDataSourceFacilityNames = "local3" - KnownSyslogDataSourceFacilityNamesLocalTwo KnownSyslogDataSourceFacilityNames = "local2" - KnownSyslogDataSourceFacilityNamesLocalZero KnownSyslogDataSourceFacilityNames = "local0" - KnownSyslogDataSourceFacilityNamesLpr KnownSyslogDataSourceFacilityNames = "lpr" - KnownSyslogDataSourceFacilityNamesMail KnownSyslogDataSourceFacilityNames = "mail" - KnownSyslogDataSourceFacilityNamesMark KnownSyslogDataSourceFacilityNames = "mark" - KnownSyslogDataSourceFacilityNamesNews KnownSyslogDataSourceFacilityNames = "news" - KnownSyslogDataSourceFacilityNamesNopri KnownSyslogDataSourceFacilityNames = "nopri" - KnownSyslogDataSourceFacilityNamesNtp KnownSyslogDataSourceFacilityNames = "ntp" - KnownSyslogDataSourceFacilityNamesSyslog KnownSyslogDataSourceFacilityNames = "syslog" - KnownSyslogDataSourceFacilityNamesUser KnownSyslogDataSourceFacilityNames = "user" - KnownSyslogDataSourceFacilityNamesUucp KnownSyslogDataSourceFacilityNames = "uucp" -) - -func PossibleValuesForKnownSyslogDataSourceFacilityNames() []string { - return []string{ - string(KnownSyslogDataSourceFacilityNamesAlert), - string(KnownSyslogDataSourceFacilityNamesAny), - string(KnownSyslogDataSourceFacilityNamesAudit), - string(KnownSyslogDataSourceFacilityNamesAuth), - string(KnownSyslogDataSourceFacilityNamesAuthpriv), - string(KnownSyslogDataSourceFacilityNamesClock), - string(KnownSyslogDataSourceFacilityNamesCron), - string(KnownSyslogDataSourceFacilityNamesDaemon), - string(KnownSyslogDataSourceFacilityNamesFtp), - string(KnownSyslogDataSourceFacilityNamesKern), - string(KnownSyslogDataSourceFacilityNamesLocalFive), - string(KnownSyslogDataSourceFacilityNamesLocalFour), - string(KnownSyslogDataSourceFacilityNamesLocalOne), - string(KnownSyslogDataSourceFacilityNamesLocalSeven), - string(KnownSyslogDataSourceFacilityNamesLocalSix), - string(KnownSyslogDataSourceFacilityNamesLocalThree), - string(KnownSyslogDataSourceFacilityNamesLocalTwo), - string(KnownSyslogDataSourceFacilityNamesLocalZero), - string(KnownSyslogDataSourceFacilityNamesLpr), - string(KnownSyslogDataSourceFacilityNamesMail), - string(KnownSyslogDataSourceFacilityNamesMark), - string(KnownSyslogDataSourceFacilityNamesNews), - string(KnownSyslogDataSourceFacilityNamesNopri), - string(KnownSyslogDataSourceFacilityNamesNtp), - string(KnownSyslogDataSourceFacilityNamesSyslog), - string(KnownSyslogDataSourceFacilityNamesUser), - string(KnownSyslogDataSourceFacilityNamesUucp), - } -} - -func (s *KnownSyslogDataSourceFacilityNames) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownSyslogDataSourceFacilityNames(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownSyslogDataSourceFacilityNames(input string) (*KnownSyslogDataSourceFacilityNames, error) { - vals := map[string]KnownSyslogDataSourceFacilityNames{ - "alert": KnownSyslogDataSourceFacilityNamesAlert, - "*": KnownSyslogDataSourceFacilityNamesAny, - "audit": KnownSyslogDataSourceFacilityNamesAudit, - "auth": KnownSyslogDataSourceFacilityNamesAuth, - "authpriv": KnownSyslogDataSourceFacilityNamesAuthpriv, - "clock": KnownSyslogDataSourceFacilityNamesClock, - "cron": KnownSyslogDataSourceFacilityNamesCron, - "daemon": KnownSyslogDataSourceFacilityNamesDaemon, - "ftp": KnownSyslogDataSourceFacilityNamesFtp, - "kern": KnownSyslogDataSourceFacilityNamesKern, - "local5": KnownSyslogDataSourceFacilityNamesLocalFive, - "local4": KnownSyslogDataSourceFacilityNamesLocalFour, - "local1": KnownSyslogDataSourceFacilityNamesLocalOne, - "local7": KnownSyslogDataSourceFacilityNamesLocalSeven, - "local6": KnownSyslogDataSourceFacilityNamesLocalSix, - "local3": KnownSyslogDataSourceFacilityNamesLocalThree, - "local2": KnownSyslogDataSourceFacilityNamesLocalTwo, - "local0": KnownSyslogDataSourceFacilityNamesLocalZero, - "lpr": KnownSyslogDataSourceFacilityNamesLpr, - "mail": KnownSyslogDataSourceFacilityNamesMail, - "mark": KnownSyslogDataSourceFacilityNamesMark, - "news": KnownSyslogDataSourceFacilityNamesNews, - "nopri": KnownSyslogDataSourceFacilityNamesNopri, - "ntp": KnownSyslogDataSourceFacilityNamesNtp, - "syslog": KnownSyslogDataSourceFacilityNamesSyslog, - "user": KnownSyslogDataSourceFacilityNamesUser, - "uucp": KnownSyslogDataSourceFacilityNamesUucp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownSyslogDataSourceFacilityNames(input) - return &out, nil -} - -type KnownSyslogDataSourceLogLevels string - -const ( - KnownSyslogDataSourceLogLevelsAlert KnownSyslogDataSourceLogLevels = "Alert" - KnownSyslogDataSourceLogLevelsAny KnownSyslogDataSourceLogLevels = "*" - KnownSyslogDataSourceLogLevelsCritical KnownSyslogDataSourceLogLevels = "Critical" - KnownSyslogDataSourceLogLevelsDebug KnownSyslogDataSourceLogLevels = "Debug" - KnownSyslogDataSourceLogLevelsEmergency KnownSyslogDataSourceLogLevels = "Emergency" - KnownSyslogDataSourceLogLevelsError KnownSyslogDataSourceLogLevels = "Error" - KnownSyslogDataSourceLogLevelsInfo KnownSyslogDataSourceLogLevels = "Info" - KnownSyslogDataSourceLogLevelsNotice KnownSyslogDataSourceLogLevels = "Notice" - KnownSyslogDataSourceLogLevelsWarning KnownSyslogDataSourceLogLevels = "Warning" -) - -func PossibleValuesForKnownSyslogDataSourceLogLevels() []string { - return []string{ - string(KnownSyslogDataSourceLogLevelsAlert), - string(KnownSyslogDataSourceLogLevelsAny), - string(KnownSyslogDataSourceLogLevelsCritical), - string(KnownSyslogDataSourceLogLevelsDebug), - string(KnownSyslogDataSourceLogLevelsEmergency), - string(KnownSyslogDataSourceLogLevelsError), - string(KnownSyslogDataSourceLogLevelsInfo), - string(KnownSyslogDataSourceLogLevelsNotice), - string(KnownSyslogDataSourceLogLevelsWarning), - } -} - -func (s *KnownSyslogDataSourceLogLevels) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownSyslogDataSourceLogLevels(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownSyslogDataSourceLogLevels(input string) (*KnownSyslogDataSourceLogLevels, error) { - vals := map[string]KnownSyslogDataSourceLogLevels{ - "alert": KnownSyslogDataSourceLogLevelsAlert, - "*": KnownSyslogDataSourceLogLevelsAny, - "critical": KnownSyslogDataSourceLogLevelsCritical, - "debug": KnownSyslogDataSourceLogLevelsDebug, - "emergency": KnownSyslogDataSourceLogLevelsEmergency, - "error": KnownSyslogDataSourceLogLevelsError, - "info": KnownSyslogDataSourceLogLevelsInfo, - "notice": KnownSyslogDataSourceLogLevelsNotice, - "warning": KnownSyslogDataSourceLogLevelsWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownSyslogDataSourceLogLevels(input) - return &out, nil -} - -type KnownSyslogDataSourceStreams string - -const ( - KnownSyslogDataSourceStreamsMicrosoftNegativeSyslog KnownSyslogDataSourceStreams = "Microsoft-Syslog" -) - -func PossibleValuesForKnownSyslogDataSourceStreams() []string { - return []string{ - string(KnownSyslogDataSourceStreamsMicrosoftNegativeSyslog), - } -} - -func (s *KnownSyslogDataSourceStreams) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownSyslogDataSourceStreams(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownSyslogDataSourceStreams(input string) (*KnownSyslogDataSourceStreams, error) { - vals := map[string]KnownSyslogDataSourceStreams{ - "microsoft-syslog": KnownSyslogDataSourceStreamsMicrosoftNegativeSyslog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownSyslogDataSourceStreams(input) - return &out, nil -} - -type KnownWindowsEventLogDataSourceStreams string - -const ( - KnownWindowsEventLogDataSourceStreamsMicrosoftNegativeEvent KnownWindowsEventLogDataSourceStreams = "Microsoft-Event" - KnownWindowsEventLogDataSourceStreamsMicrosoftNegativeWindowsEvent KnownWindowsEventLogDataSourceStreams = "Microsoft-WindowsEvent" -) - -func PossibleValuesForKnownWindowsEventLogDataSourceStreams() []string { - return []string{ - string(KnownWindowsEventLogDataSourceStreamsMicrosoftNegativeEvent), - string(KnownWindowsEventLogDataSourceStreamsMicrosoftNegativeWindowsEvent), - } -} - -func (s *KnownWindowsEventLogDataSourceStreams) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKnownWindowsEventLogDataSourceStreams(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKnownWindowsEventLogDataSourceStreams(input string) (*KnownWindowsEventLogDataSourceStreams, error) { - vals := map[string]KnownWindowsEventLogDataSourceStreams{ - "microsoft-event": KnownWindowsEventLogDataSourceStreamsMicrosoftNegativeEvent, - "microsoft-windowsevent": KnownWindowsEventLogDataSourceStreamsMicrosoftNegativeWindowsEvent, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KnownWindowsEventLogDataSourceStreams(input) - return &out, nil -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule.go b/resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule.go deleted file mode 100644 index 1e79f6efe93..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule.go +++ /dev/null @@ -1,130 +0,0 @@ -package datacollectionrules - -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(&DataCollectionRuleId{}) -} - -var _ resourceids.ResourceId = &DataCollectionRuleId{} - -// DataCollectionRuleId is a struct representing the Resource ID for a Data Collection Rule -type DataCollectionRuleId struct { - SubscriptionId string - ResourceGroupName string - DataCollectionRuleName string -} - -// NewDataCollectionRuleID returns a new DataCollectionRuleId struct -func NewDataCollectionRuleID(subscriptionId string, resourceGroupName string, dataCollectionRuleName string) DataCollectionRuleId { - return DataCollectionRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DataCollectionRuleName: dataCollectionRuleName, - } -} - -// ParseDataCollectionRuleID parses 'input' into a DataCollectionRuleId -func ParseDataCollectionRuleID(input string) (*DataCollectionRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataCollectionRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataCollectionRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataCollectionRuleIDInsensitively parses 'input' case-insensitively into a DataCollectionRuleId -// note: this method should only be used for API response data and not user input -func ParseDataCollectionRuleIDInsensitively(input string) (*DataCollectionRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataCollectionRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataCollectionRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataCollectionRuleId) 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.DataCollectionRuleName, ok = input.Parsed["dataCollectionRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataCollectionRuleName", input) - } - - return nil -} - -// ValidateDataCollectionRuleID checks that 'input' can be parsed as a Data Collection Rule ID -func ValidateDataCollectionRuleID(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 := ParseDataCollectionRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Collection Rule ID -func (id DataCollectionRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/dataCollectionRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DataCollectionRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Collection Rule ID -func (id DataCollectionRuleId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticDataCollectionRules", "dataCollectionRules", "dataCollectionRules"), - resourceids.UserSpecifiedSegment("dataCollectionRuleName", "dataCollectionRuleValue"), - } -} - -// String returns a human-readable description of this Data Collection Rule ID -func (id DataCollectionRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Data Collection Rule Name: %q", id.DataCollectionRuleName), - } - return fmt.Sprintf("Data Collection Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule_test.go b/resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule_test.go deleted file mode 100644 index 3783e4f9bb5..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/id_datacollectionrule_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package datacollectionrules - -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 = &DataCollectionRuleId{} - -func TestNewDataCollectionRuleID(t *testing.T) { - id := NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue") - - 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.DataCollectionRuleName != "dataCollectionRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataCollectionRuleName'", id.DataCollectionRuleName, "dataCollectionRuleValue") - } -} - -func TestFormatDataCollectionRuleID(t *testing.T) { - actual := NewDataCollectionRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dataCollectionRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataCollectionRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataCollectionRuleId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue", - Expected: &DataCollectionRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DataCollectionRuleName: "dataCollectionRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataCollectionRuleID(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.DataCollectionRuleName != v.Expected.DataCollectionRuleName { - t.Fatalf("Expected %q but got %q for DataCollectionRuleName", v.Expected.DataCollectionRuleName, actual.DataCollectionRuleName) - } - - } -} - -func TestParseDataCollectionRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataCollectionRuleId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue", - Expected: &DataCollectionRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DataCollectionRuleName: "dataCollectionRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/dataCollectionRules/dataCollectionRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/dAtAcOlLeCtIoNrUlEs/dAtAcOlLeCtIoNrUlEvAlUe", - Expected: &DataCollectionRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DataCollectionRuleName: "dAtAcOlLeCtIoNrUlEvAlUe", - }, - }, - { - // 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.iNsIgHtS/dAtAcOlLeCtIoNrUlEs/dAtAcOlLeCtIoNrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataCollectionRuleIDInsensitively(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.DataCollectionRuleName != v.Expected.DataCollectionRuleName { - t.Fatalf("Expected %q but got %q for DataCollectionRuleName", v.Expected.DataCollectionRuleName, actual.DataCollectionRuleName) - } - - } -} - -func TestSegmentsForDataCollectionRuleId(t *testing.T) { - segments := DataCollectionRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataCollectionRuleId 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/insights/2021-04-01/datacollectionrules/method_create.go b/resource-manager/insights/2021-04-01/datacollectionrules/method_create.go deleted file mode 100644 index 1aee4a277b0..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package datacollectionrules - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataCollectionRuleResource -} - -// Create ... -func (c DataCollectionRulesClient) Create(ctx context.Context, id DataCollectionRuleId, input DataCollectionRuleResource) (result CreateOperationResponse, 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 DataCollectionRuleResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/method_delete.go b/resource-manager/insights/2021-04-01/datacollectionrules/method_delete.go deleted file mode 100644 index 884b9155efc..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package datacollectionrules - -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 DataCollectionRulesClient) Delete(ctx context.Context, id DataCollectionRuleId) (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/insights/2021-04-01/datacollectionrules/method_get.go b/resource-manager/insights/2021-04-01/datacollectionrules/method_get.go deleted file mode 100644 index 850aa256d74..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package datacollectionrules - -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 *DataCollectionRuleResource -} - -// Get ... -func (c DataCollectionRulesClient) Get(ctx context.Context, id DataCollectionRuleId) (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 DataCollectionRuleResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/method_listbyresourcegroup.go b/resource-manager/insights/2021-04-01/datacollectionrules/method_listbyresourcegroup.go deleted file mode 100644 index df9dee95ac8..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package datacollectionrules - -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 *[]DataCollectionRuleResource -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataCollectionRuleResource -} - -// ListByResourceGroup ... -func (c DataCollectionRulesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/dataCollectionRules", 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 *[]DataCollectionRuleResource `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 DataCollectionRulesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DataCollectionRuleResourceOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataCollectionRulesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DataCollectionRuleResourceOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]DataCollectionRuleResource, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/insights/2021-04-01/datacollectionrules/method_listbysubscription.go b/resource-manager/insights/2021-04-01/datacollectionrules/method_listbysubscription.go deleted file mode 100644 index 62eaed8503f..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package datacollectionrules - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DataCollectionRuleResource -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataCollectionRuleResource -} - -// ListBySubscription ... -func (c DataCollectionRulesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/dataCollectionRules", 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 *[]DataCollectionRuleResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c DataCollectionRulesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, DataCollectionRuleResourceOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataCollectionRulesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DataCollectionRuleResourceOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]DataCollectionRuleResource, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/method_update.go b/resource-manager/insights/2021-04-01/datacollectionrules/method_update.go deleted file mode 100644 index 9d0d9273215..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package datacollectionrules - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataCollectionRuleResource -} - -// Update ... -func (c DataCollectionRulesClient) Update(ctx context.Context, id DataCollectionRuleId, input ResourceForUpdate) (result UpdateOperationResponse, 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 DataCollectionRuleResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_azuremonitormetricsdestination.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_azuremonitormetricsdestination.go deleted file mode 100644 index 52fefb9fdd9..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_azuremonitormetricsdestination.go +++ /dev/null @@ -1,8 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorMetricsDestination struct { - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionrule.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionrule.go deleted file mode 100644 index d0bd1cd25cf..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionrule.go +++ /dev/null @@ -1,13 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataCollectionRule struct { - DataFlows *[]DataFlow `json:"dataFlows,omitempty"` - DataSources *DataSourcesSpec `json:"dataSources,omitempty"` - Description *string `json:"description,omitempty"` - Destinations *DestinationsSpec `json:"destinations,omitempty"` - ImmutableId *string `json:"immutableId,omitempty"` - ProvisioningState *KnownDataCollectionRuleProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionruleresource.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionruleresource.go deleted file mode 100644 index 47a54626fe8..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_datacollectionruleresource.go +++ /dev/null @@ -1,20 +0,0 @@ -package datacollectionrules - -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 DataCollectionRuleResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *KnownDataCollectionRuleResourceKind `json:"kind,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *DataCollectionRule `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/insights/2021-04-01/datacollectionrules/model_dataflow.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_dataflow.go deleted file mode 100644 index 8a8e80603e2..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_dataflow.go +++ /dev/null @@ -1,9 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataFlow struct { - Destinations *[]string `json:"destinations,omitempty"` - Streams *[]KnownDataFlowStreams `json:"streams,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_datasourcesspec.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_datasourcesspec.go deleted file mode 100644 index 132e331406e..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_datasourcesspec.go +++ /dev/null @@ -1,11 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataSourcesSpec struct { - Extensions *[]ExtensionDataSource `json:"extensions,omitempty"` - PerformanceCounters *[]PerfCounterDataSource `json:"performanceCounters,omitempty"` - Syslog *[]SyslogDataSource `json:"syslog,omitempty"` - WindowsEventLogs *[]WindowsEventLogDataSource `json:"windowsEventLogs,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_destinationsspec.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_destinationsspec.go deleted file mode 100644 index 432e41c07c4..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_destinationsspec.go +++ /dev/null @@ -1,9 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DestinationsSpec struct { - AzureMonitorMetrics *AzureMonitorMetricsDestination `json:"azureMonitorMetrics,omitempty"` - LogAnalytics *[]LogAnalyticsDestination `json:"logAnalytics,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_extensiondatasource.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_extensiondatasource.go deleted file mode 100644 index 8f8599c7fef..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_extensiondatasource.go +++ /dev/null @@ -1,12 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionDataSource struct { - ExtensionName string `json:"extensionName"` - ExtensionSettings *interface{} `json:"extensionSettings,omitempty"` - InputDataSources *[]string `json:"inputDataSources,omitempty"` - Name *string `json:"name,omitempty"` - Streams *[]KnownExtensionDataSourceStreams `json:"streams,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_loganalyticsdestination.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_loganalyticsdestination.go deleted file mode 100644 index ecc04a3c5f0..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_loganalyticsdestination.go +++ /dev/null @@ -1,10 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LogAnalyticsDestination struct { - Name *string `json:"name,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_perfcounterdatasource.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_perfcounterdatasource.go deleted file mode 100644 index f43d0f81518..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_perfcounterdatasource.go +++ /dev/null @@ -1,11 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PerfCounterDataSource struct { - CounterSpecifiers *[]string `json:"counterSpecifiers,omitempty"` - Name *string `json:"name,omitempty"` - SamplingFrequencyInSeconds *int64 `json:"samplingFrequencyInSeconds,omitempty"` - Streams *[]KnownPerfCounterDataSourceStreams `json:"streams,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_resourceforupdate.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_resourceforupdate.go deleted file mode 100644 index 5e93df279da..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_resourceforupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceForUpdate struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_syslogdatasource.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_syslogdatasource.go deleted file mode 100644 index 543153d8999..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_syslogdatasource.go +++ /dev/null @@ -1,11 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SyslogDataSource struct { - FacilityNames *[]KnownSyslogDataSourceFacilityNames `json:"facilityNames,omitempty"` - LogLevels *[]KnownSyslogDataSourceLogLevels `json:"logLevels,omitempty"` - Name *string `json:"name,omitempty"` - Streams *[]KnownSyslogDataSourceStreams `json:"streams,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/model_windowseventlogdatasource.go b/resource-manager/insights/2021-04-01/datacollectionrules/model_windowseventlogdatasource.go deleted file mode 100644 index 2b0e211004f..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/model_windowseventlogdatasource.go +++ /dev/null @@ -1,10 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WindowsEventLogDataSource struct { - Name *string `json:"name,omitempty"` - Streams *[]KnownWindowsEventLogDataSourceStreams `json:"streams,omitempty"` - XPathQueries *[]string `json:"xPathQueries,omitempty"` -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/predicates.go b/resource-manager/insights/2021-04-01/datacollectionrules/predicates.go deleted file mode 100644 index 71960b7ef29..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package datacollectionrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataCollectionRuleResourceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p DataCollectionRuleResourceOperationPredicate) Matches(input DataCollectionRuleResource) 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 -} diff --git a/resource-manager/insights/2021-04-01/datacollectionrules/version.go b/resource-manager/insights/2021-04-01/datacollectionrules/version.go deleted file mode 100644 index 9c4156750c3..00000000000 --- a/resource-manager/insights/2021-04-01/datacollectionrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package datacollectionrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/datacollectionrules/%s", defaultApiVersion) -} diff --git a/resource-manager/insights/2021-07-01-preview/client.go b/resource-manager/insights/2021-07-01-preview/client.go deleted file mode 100644 index daea474d9d8..00000000000 --- a/resource-manager/insights/2021-07-01-preview/client.go +++ /dev/null @@ -1,55 +0,0 @@ -package v2021_07_01_preview - -// 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/insights/2021-07-01-preview/privateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - PrivateEndpointConnections *privateendpointconnections.PrivateEndpointConnectionsClient - PrivateLinkResources *privatelinkresources.PrivateLinkResourcesClient - PrivateLinkScopedResources *privatelinkscopedresources.PrivateLinkScopedResourcesClient - PrivateLinkScopesAPIs *privatelinkscopesapis.PrivateLinkScopesAPIsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - 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) - - privateLinkScopedResourcesClient, err := privatelinkscopedresources.NewPrivateLinkScopedResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkScopedResources client: %+v", err) - } - configureFunc(privateLinkScopedResourcesClient.Client) - - privateLinkScopesAPIsClient, err := privatelinkscopesapis.NewPrivateLinkScopesAPIsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkScopesAPIs client: %+v", err) - } - configureFunc(privateLinkScopesAPIsClient.Client) - - return &Client{ - PrivateEndpointConnections: privateEndpointConnectionsClient, - PrivateLinkResources: privateLinkResourcesClient, - PrivateLinkScopedResources: privateLinkScopedResourcesClient, - PrivateLinkScopesAPIs: privateLinkScopesAPIsClient, - }, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md deleted file mode 100644 index 354fd78a23e..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privateendpointconnections` Documentation - -The `privateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-07-01-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/insights/2021-07-01-preview/privateendpointconnections" -``` - - -### Client Initialization - -```go -client := privateendpointconnections.NewPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateEndpointConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateEndpointConnectionValue") - -payload := privateendpointconnections.PrivateEndpointConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateEndpointConnectionValue") - -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", "privateLinkScopeValue", "privateEndpointConnectionValue") - -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.ListByPrivateLinkScope` - -```go -ctx := context.TODO() -id := privateendpointconnections.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -read, err := client.ListByPrivateLinkScope(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/insights/2021-07-01-preview/privateendpointconnections/client.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/client.go deleted file mode 100644 index 3bf7a6afe1f..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(sdkApi, "privateendpointconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateEndpointConnectionsClient: %+v", err) - } - - return &PrivateEndpointConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/constants.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/constants.go deleted file mode 100644 index c5850609650..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -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 PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { - return []string{ - 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{ - "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 -} - -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -func PossibleValuesForPrivateEndpointServiceConnectionStatus() []string { - return []string{ - string(PrivateEndpointServiceConnectionStatusApproved), - string(PrivateEndpointServiceConnectionStatusPending), - string(PrivateEndpointServiceConnectionStatusRejected), - } -} - -func (s *PrivateEndpointServiceConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateEndpointServiceConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpointServiceConnectionStatus, error) { - vals := map[string]PrivateEndpointServiceConnectionStatus{ - "approved": PrivateEndpointServiceConnectionStatusApproved, - "pending": PrivateEndpointServiceConnectionStatusPending, - "rejected": PrivateEndpointServiceConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateEndpointServiceConnectionStatus(input) - return &out, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go deleted file mode 100644 index d1743b78c65..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -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 - PrivateLinkScopeName string - PrivateEndpointConnectionName string -} - -// NewPrivateEndpointConnectionID returns a new PrivateEndpointConnectionId struct -func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, privateLinkScopeName string, privateEndpointConnectionName string) PrivateEndpointConnectionId { - return PrivateEndpointConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", 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.Insights/privateLinkScopes/%s/privateEndpointConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName, 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// 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("Private Link Scope Name: %q", id.PrivateLinkScopeName), - 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/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go deleted file mode 100644 index be334eb575c..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -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", "privateLinkScopeValue", "privateEndpointConnectionValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections/privateEndpointConnectionValue" - 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections/privateEndpointConnectionValue/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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - 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/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go deleted file mode 100644 index 94e008cc775..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope.go +++ /dev/null @@ -1,130 +0,0 @@ -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(&PrivateLinkScopeId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkScopeId{} - -// PrivateLinkScopeId is a struct representing the Resource ID for a Private Link Scope -type PrivateLinkScopeId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkScopeName string -} - -// NewPrivateLinkScopeID returns a new PrivateLinkScopeId struct -func NewPrivateLinkScopeID(subscriptionId string, resourceGroupName string, privateLinkScopeName string) PrivateLinkScopeId { - return PrivateLinkScopeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - } -} - -// ParsePrivateLinkScopeID parses 'input' into a PrivateLinkScopeId -func ParsePrivateLinkScopeID(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkScopeIDInsensitively parses 'input' case-insensitively into a PrivateLinkScopeId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkScopeIDInsensitively(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkScopeId) 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", input) - } - - return nil -} - -// ValidatePrivateLinkScopeID checks that 'input' can be parsed as a Private Link Scope ID -func ValidatePrivateLinkScopeID(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 := ParsePrivateLinkScopeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Scope ID -func (id PrivateLinkScopeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/privateLinkScopes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Scope ID -func (id PrivateLinkScopeId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - } -} - -// String returns a human-readable description of this Private Link Scope ID -func (id PrivateLinkScopeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Scope Name: %q", id.PrivateLinkScopeName), - } - return fmt.Sprintf("Private Link Scope (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go deleted file mode 100644 index 2cceed670d7..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/id_privatelinkscope_test.go +++ /dev/null @@ -1,282 +0,0 @@ -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 = &PrivateLinkScopeId{} - -func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } -} - -func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkScopeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeID(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeIDInsensitively(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestSegmentsForPrivateLinkScopeId(t *testing.T) { - segments := PrivateLinkScopeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkScopeId 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/insights/2021-07-01-preview/privateendpointconnections/method_createorupdate.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_createorupdate.go deleted file mode 100644 index 943007e4641..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -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 CreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// CreateOrUpdate ... -func (c PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateEndpointConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/insights/2021-07-01-preview/privateendpointconnections/method_delete.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_delete.go deleted file mode 100644 index 63c26e8f27f..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -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.StatusAccepted, - 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/insights/2021-07-01-preview/privateendpointconnections/method_get.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_get.go deleted file mode 100644 index 8dc28d7ff7a..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -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/insights/2021-07-01-preview/privateendpointconnections/method_listbyprivatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_listbyprivatelinkscope.go deleted file mode 100644 index 565265facee..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/method_listbyprivatelinkscope.go +++ /dev/null @@ -1,55 +0,0 @@ -package privateendpointconnections - -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 ListByPrivateLinkScopeOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnectionListResult -} - -// ListByPrivateLinkScope ... -func (c PrivateEndpointConnectionsClient) ListByPrivateLinkScope(ctx context.Context, id PrivateLinkScopeId) (result ListByPrivateLinkScopeOperationResponse, 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/insights/2021-07-01-preview/privateendpointconnections/model_privateendpoint.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpoint.go deleted file mode 100644 index 1bc8cf2a97c..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -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/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnection.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnection.go deleted file mode 100644 index fde7f4db0fc..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -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/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go deleted file mode 100644 index 92a9ecb105a..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index 549d255f069..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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/insights/2021-07-01-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index ec3f7a9f24c..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/version.go b/resource-manager/insights/2021-07-01-preview/privateendpointconnections/version.go deleted file mode 100644 index b6b27c85f86..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpointconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpointconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md b/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md deleted file mode 100644 index 6203ce4941d..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/README.md +++ /dev/null @@ -1,52 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkresources` Documentation - -The `privatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-07-01-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/insights/2021-07-01-preview/privatelinkresources" -``` - - -### Client Initialization - -```go -client := privatelinkresources.NewPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkResourcesClient.Get` - -```go -ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateLinkResourceValue") - -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: `PrivateLinkResourcesClient.ListByPrivateLinkScope` - -```go -ctx := context.TODO() -id := privatelinkresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -read, err := client.ListByPrivateLinkScope(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/insights/2021-07-01-preview/privatelinkresources/client.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/client.go deleted file mode 100644 index e6e22caa746..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(sdkApi, "privatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkResourcesClient: %+v", err) - } - - return &PrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go deleted file mode 100644 index 5ed81e4e465..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package privatelinkresources - -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(&PrivateLinkResourceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkResourceId{} - -// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource -type PrivateLinkResourceId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkScopeName string - PrivateLinkResourceName string -} - -// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct -func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, privateLinkScopeName string, privateLinkResourceName string) PrivateLinkResourceId { - return PrivateLinkResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - PrivateLinkResourceName: privateLinkResourceName, - } -} - -// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId -func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkResourceId) 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", input) - } - - if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) - } - - return nil -} - -// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID -func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Resource ID -func (id PrivateLinkResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/privateLinkScopes/%s/privateLinkResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName, id.PrivateLinkResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID -func (id PrivateLinkResourceId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), - } -} - -// String returns a human-readable description of this Private Link Resource ID -func (id PrivateLinkResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Scope Name: %q", id.PrivateLinkScopeName), - fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), - } - return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go deleted file mode 100644 index c117e7991a6..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkresource_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package privatelinkresources - -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 = &PrivateLinkResourceId{} - -func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateLinkResourceValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } - - if id.PrivateLinkResourceName != "privateLinkResourceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceValue") - } -} - -func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "privateLinkResourceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources/privateLinkResourceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkResourceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceID(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/pRiVaTeLiNkReSoUrCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeVaLuE", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceIDInsensitively(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestSegmentsForPrivateLinkResourceId(t *testing.T) { - segments := PrivateLinkResourceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkResourceId 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/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go deleted file mode 100644 index 262cf3fdba8..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkresources - -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(&PrivateLinkScopeId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkScopeId{} - -// PrivateLinkScopeId is a struct representing the Resource ID for a Private Link Scope -type PrivateLinkScopeId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkScopeName string -} - -// NewPrivateLinkScopeID returns a new PrivateLinkScopeId struct -func NewPrivateLinkScopeID(subscriptionId string, resourceGroupName string, privateLinkScopeName string) PrivateLinkScopeId { - return PrivateLinkScopeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - } -} - -// ParsePrivateLinkScopeID parses 'input' into a PrivateLinkScopeId -func ParsePrivateLinkScopeID(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkScopeIDInsensitively parses 'input' case-insensitively into a PrivateLinkScopeId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkScopeIDInsensitively(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkScopeId) 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", input) - } - - return nil -} - -// ValidatePrivateLinkScopeID checks that 'input' can be parsed as a Private Link Scope ID -func ValidatePrivateLinkScopeID(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 := ParsePrivateLinkScopeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Scope ID -func (id PrivateLinkScopeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/privateLinkScopes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Scope ID -func (id PrivateLinkScopeId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - } -} - -// String returns a human-readable description of this Private Link Scope ID -func (id PrivateLinkScopeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Scope Name: %q", id.PrivateLinkScopeName), - } - return fmt.Sprintf("Private Link Scope (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go deleted file mode 100644 index 3e3bb2406a8..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/id_privatelinkscope_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkresources - -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 = &PrivateLinkScopeId{} - -func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } -} - -func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkScopeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeID(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeIDInsensitively(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestSegmentsForPrivateLinkScopeId(t *testing.T) { - segments := PrivateLinkScopeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkScopeId 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/insights/2021-07-01-preview/privatelinkresources/method_get.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/method_get.go deleted file mode 100644 index f265d7c640a..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package privatelinkresources - -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 *PrivateLinkResource -} - -// Get ... -func (c PrivateLinkResourcesClient) Get(ctx context.Context, id PrivateLinkResourceId) (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 PrivateLinkResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/method_listbyprivatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/method_listbyprivatelinkscope.go deleted file mode 100644 index 0b8eaa9c00c..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/method_listbyprivatelinkscope.go +++ /dev/null @@ -1,55 +0,0 @@ -package privatelinkresources - -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 ListByPrivateLinkScopeOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkResourceListResult -} - -// ListByPrivateLinkScope ... -func (c PrivateLinkResourcesClient) ListByPrivateLinkScope(ctx context.Context, id PrivateLinkScopeId) (result ListByPrivateLinkScopeOperationResponse, 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 PrivateLinkResourceListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 69e8ae0e57a..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourcelistresult.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourcelistresult.go deleted file mode 100644 index fa950217c47..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourcelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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 PrivateLinkResourceListResult struct { - Value *[]PrivateLinkResource `json:"value,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index 3c98012cdd1..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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 PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkresources/version.go b/resource-manager/insights/2021-07-01-preview/privatelinkresources/version.go deleted file mode 100644 index 5e6ee35f9a0..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md deleted file mode 100644 index e89f4872815..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources` Documentation - -The `privatelinkscopedresources` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-07-01-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/insights/2021-07-01-preview/privatelinkscopedresources" -``` - - -### Client Initialization - -```go -client := privatelinkscopedresources.NewPrivateLinkScopedResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkScopedResourcesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "scopedResourceValue") - -payload := privatelinkscopedresources.ScopedResource{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkScopedResourcesClient.Delete` - -```go -ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "scopedResourceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkScopedResourcesClient.Get` - -```go -ctx := context.TODO() -id := privatelinkscopedresources.NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "scopedResourceValue") - -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: `PrivateLinkScopedResourcesClient.ListByPrivateLinkScope` - -```go -ctx := context.TODO() -id := privatelinkscopedresources.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -// alternatively `client.ListByPrivateLinkScope(ctx, id)` can be used to do batched pagination -items, err := client.ListByPrivateLinkScopeComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/client.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/client.go deleted file mode 100644 index d57bf6a3767..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkscopedresources - -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 PrivateLinkScopedResourcesClient struct { - Client *resourcemanager.Client -} - -func NewPrivateLinkScopedResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkScopedResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatelinkscopedresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkScopedResourcesClient: %+v", err) - } - - return &PrivateLinkScopedResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go deleted file mode 100644 index 8aa1d039fc0..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkscopedresources - -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(&PrivateLinkScopeId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkScopeId{} - -// PrivateLinkScopeId is a struct representing the Resource ID for a Private Link Scope -type PrivateLinkScopeId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkScopeName string -} - -// NewPrivateLinkScopeID returns a new PrivateLinkScopeId struct -func NewPrivateLinkScopeID(subscriptionId string, resourceGroupName string, privateLinkScopeName string) PrivateLinkScopeId { - return PrivateLinkScopeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - } -} - -// ParsePrivateLinkScopeID parses 'input' into a PrivateLinkScopeId -func ParsePrivateLinkScopeID(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkScopeIDInsensitively parses 'input' case-insensitively into a PrivateLinkScopeId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkScopeIDInsensitively(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkScopeId) 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", input) - } - - return nil -} - -// ValidatePrivateLinkScopeID checks that 'input' can be parsed as a Private Link Scope ID -func ValidatePrivateLinkScopeID(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 := ParsePrivateLinkScopeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Scope ID -func (id PrivateLinkScopeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/privateLinkScopes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Scope ID -func (id PrivateLinkScopeId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - } -} - -// String returns a human-readable description of this Private Link Scope ID -func (id PrivateLinkScopeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Scope Name: %q", id.PrivateLinkScopeName), - } - return fmt.Sprintf("Private Link Scope (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go deleted file mode 100644 index 878c4612cb2..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_privatelinkscope_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkscopedresources - -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 = &PrivateLinkScopeId{} - -func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } -} - -func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkScopeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeID(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeIDInsensitively(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestSegmentsForPrivateLinkScopeId(t *testing.T) { - segments := PrivateLinkScopeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkScopeId 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/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go deleted file mode 100644 index 38f42803e81..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package privatelinkscopedresources - -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(&ScopedResourceId{}) -} - -var _ resourceids.ResourceId = &ScopedResourceId{} - -// ScopedResourceId is a struct representing the Resource ID for a Scoped Resource -type ScopedResourceId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkScopeName string - ScopedResourceName string -} - -// NewScopedResourceID returns a new ScopedResourceId struct -func NewScopedResourceID(subscriptionId string, resourceGroupName string, privateLinkScopeName string, scopedResourceName string) ScopedResourceId { - return ScopedResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - ScopedResourceName: scopedResourceName, - } -} - -// ParseScopedResourceID parses 'input' into a ScopedResourceId -func ParseScopedResourceID(input string) (*ScopedResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedResourceIDInsensitively parses 'input' case-insensitively into a ScopedResourceId -// note: this method should only be used for API response data and not user input -func ParseScopedResourceIDInsensitively(input string) (*ScopedResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedResourceId) 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", input) - } - - if id.ScopedResourceName, ok = input.Parsed["scopedResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scopedResourceName", input) - } - - return nil -} - -// ValidateScopedResourceID checks that 'input' can be parsed as a Scoped Resource ID -func ValidateScopedResourceID(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 := ParseScopedResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Resource ID -func (id ScopedResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/privateLinkScopes/%s/scopedResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName, id.ScopedResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Resource ID -func (id ScopedResourceId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - resourceids.StaticSegment("staticScopedResources", "scopedResources", "scopedResources"), - resourceids.UserSpecifiedSegment("scopedResourceName", "scopedResourceValue"), - } -} - -// String returns a human-readable description of this Scoped Resource ID -func (id ScopedResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Scope Name: %q", id.PrivateLinkScopeName), - fmt.Sprintf("Scoped Resource Name: %q", id.ScopedResourceName), - } - return fmt.Sprintf("Scoped Resource (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go deleted file mode 100644 index 09bf6ab00fb..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/id_scopedresource_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package privatelinkscopedresources - -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 = &ScopedResourceId{} - -func TestNewScopedResourceID(t *testing.T) { - id := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "scopedResourceValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } - - if id.ScopedResourceName != "scopedResourceValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScopedResourceName'", id.ScopedResourceName, "scopedResourceValue") - } -} - -func TestFormatScopedResourceID(t *testing.T) { - actual := NewScopedResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue", "scopedResourceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources/scopedResourceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedResourceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedResourceId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources/scopedResourceValue", - Expected: &ScopedResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - ScopedResourceName: "scopedResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources/scopedResourceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedResourceID(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - if actual.ScopedResourceName != v.Expected.ScopedResourceName { - t.Fatalf("Expected %q but got %q for ScopedResourceName", v.Expected.ScopedResourceName, actual.ScopedResourceName) - } - - } -} - -func TestParseScopedResourceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedResourceId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/sCoPeDrEsOuRcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources/scopedResourceValue", - Expected: &ScopedResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - ScopedResourceName: "scopedResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/scopedResources/scopedResourceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/sCoPeDrEsOuRcEs/sCoPeDrEsOuRcEvAlUe", - Expected: &ScopedResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - ScopedResourceName: "sCoPeDrEsOuRcEvAlUe", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/sCoPeDrEsOuRcEs/sCoPeDrEsOuRcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedResourceIDInsensitively(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - if actual.ScopedResourceName != v.Expected.ScopedResourceName { - t.Fatalf("Expected %q but got %q for ScopedResourceName", v.Expected.ScopedResourceName, actual.ScopedResourceName) - } - - } -} - -func TestSegmentsForScopedResourceId(t *testing.T) { - segments := ScopedResourceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedResourceId 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/insights/2021-07-01-preview/privatelinkscopedresources/method_createorupdate.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_createorupdate.go deleted file mode 100644 index adb33650098..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package privatelinkscopedresources - -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 *ScopedResource -} - -// CreateOrUpdate ... -func (c PrivateLinkScopedResourcesClient) CreateOrUpdate(ctx context.Context, id ScopedResourceId, input ScopedResource) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateLinkScopedResourcesClient) CreateOrUpdateThenPoll(ctx context.Context, id ScopedResourceId, input ScopedResource) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/insights/2021-07-01-preview/privatelinkscopedresources/method_delete.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_delete.go deleted file mode 100644 index b35550f204f..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatelinkscopedresources - -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 PrivateLinkScopedResourcesClient) Delete(ctx context.Context, id ScopedResourceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateLinkScopedResourcesClient) DeleteThenPoll(ctx context.Context, id ScopedResourceId) 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/insights/2021-07-01-preview/privatelinkscopedresources/method_get.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_get.go deleted file mode 100644 index b4973bf6c16..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package privatelinkscopedresources - -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 *ScopedResource -} - -// Get ... -func (c PrivateLinkScopedResourcesClient) Get(ctx context.Context, id ScopedResourceId) (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 ScopedResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_listbyprivatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_listbyprivatelinkscope.go deleted file mode 100644 index a5aa04fb72a..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/method_listbyprivatelinkscope.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkscopedresources - -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 ListByPrivateLinkScopeOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ScopedResource -} - -type ListByPrivateLinkScopeCompleteResult struct { - LatestHttpResponse *http.Response - Items []ScopedResource -} - -// ListByPrivateLinkScope ... -func (c PrivateLinkScopedResourcesClient) ListByPrivateLinkScope(ctx context.Context, id PrivateLinkScopeId) (result ListByPrivateLinkScopeOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/scopedResources", 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 *[]ScopedResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByPrivateLinkScopeComplete retrieves all the results into a single object -func (c PrivateLinkScopedResourcesClient) ListByPrivateLinkScopeComplete(ctx context.Context, id PrivateLinkScopeId) (ListByPrivateLinkScopeCompleteResult, error) { - return c.ListByPrivateLinkScopeCompleteMatchingPredicate(ctx, id, ScopedResourceOperationPredicate{}) -} - -// ListByPrivateLinkScopeCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkScopedResourcesClient) ListByPrivateLinkScopeCompleteMatchingPredicate(ctx context.Context, id PrivateLinkScopeId, predicate ScopedResourceOperationPredicate) (result ListByPrivateLinkScopeCompleteResult, err error) { - items := make([]ScopedResource, 0) - - resp, err := c.ListByPrivateLinkScope(ctx, id) - if err != nil { - 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 = ListByPrivateLinkScopeCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresource.go deleted file mode 100644 index 9edee09df3e..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresource.go +++ /dev/null @@ -1,16 +0,0 @@ -package privatelinkscopedresources - -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 ScopedResource struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ScopedResourceProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresourceproperties.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresourceproperties.go deleted file mode 100644 index d70e3d320e6..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/model_scopedresourceproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkscopedresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopedResourceProperties struct { - LinkedResourceId *string `json:"linkedResourceId,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/predicates.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/predicates.go deleted file mode 100644 index c601ae0c434..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatelinkscopedresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopedResourceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ScopedResourceOperationPredicate) Matches(input ScopedResource) 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/insights/2021-07-01-preview/privatelinkscopedresources/version.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/version.go deleted file mode 100644 index 04f0456566c..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopedresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkscopedresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkscopedresources/%s", defaultApiVersion) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md deleted file mode 100644 index f6e04d93b74..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis` Documentation - -The `privatelinkscopesapis` SDK allows for interaction with the Azure Resource Manager Service `insights` (API Version `2021-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis" -``` - - -### Client Initialization - -```go -client := privatelinkscopesapis.NewPrivateLinkScopesAPIsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkScopesAPIsClient.PrivateLinkScopesCreateOrUpdate` - -```go -ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -payload := privatelinkscopesapis.AzureMonitorPrivateLinkScope{ - // ... -} - - -read, err := client.PrivateLinkScopesCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkScopesAPIsClient.PrivateLinkScopesDelete` - -```go -ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -if err := client.PrivateLinkScopesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkScopesAPIsClient.PrivateLinkScopesGet` - -```go -ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -read, err := client.PrivateLinkScopesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkScopesAPIsClient.PrivateLinkScopesList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.PrivateLinkScopesList(ctx, id)` can be used to do batched pagination -items, err := client.PrivateLinkScopesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkScopesAPIsClient.PrivateLinkScopesListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.PrivateLinkScopesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.PrivateLinkScopesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkScopesAPIsClient.PrivateLinkScopesUpdateTags` - -```go -ctx := context.TODO() -id := privatelinkscopesapis.NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - -payload := privatelinkscopesapis.TagsResource{ - // ... -} - - -read, err := client.PrivateLinkScopesUpdateTags(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/insights/2021-07-01-preview/privatelinkscopesapis/client.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/client.go deleted file mode 100644 index 7db4b8bf924..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesAPIsClient struct { - Client *resourcemanager.Client -} - -func NewPrivateLinkScopesAPIsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkScopesAPIsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatelinkscopesapis", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkScopesAPIsClient: %+v", err) - } - - return &PrivateLinkScopesAPIsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go deleted file mode 100644 index 1ab8e4fd307..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/constants.go +++ /dev/null @@ -1,142 +0,0 @@ -package privatelinkscopesapis - -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 AccessMode string - -const ( - AccessModeOpen AccessMode = "Open" - AccessModePrivateOnly AccessMode = "PrivateOnly" -) - -func PossibleValuesForAccessMode() []string { - return []string{ - string(AccessModeOpen), - string(AccessModePrivateOnly), - } -} - -func (s *AccessMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccessMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccessMode(input string) (*AccessMode, error) { - vals := map[string]AccessMode{ - "open": AccessModeOpen, - "privateonly": AccessModePrivateOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AccessMode(input) - return &out, nil -} - -type PrivateEndpointConnectionProvisioningState string - -const ( - PrivateEndpointConnectionProvisioningStateCreating PrivateEndpointConnectionProvisioningState = "Creating" - PrivateEndpointConnectionProvisioningStateDeleting PrivateEndpointConnectionProvisioningState = "Deleting" - PrivateEndpointConnectionProvisioningStateFailed PrivateEndpointConnectionProvisioningState = "Failed" - PrivateEndpointConnectionProvisioningStateSucceeded PrivateEndpointConnectionProvisioningState = "Succeeded" -) - -func PossibleValuesForPrivateEndpointConnectionProvisioningState() []string { - return []string{ - 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{ - "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 -} - -type PrivateEndpointServiceConnectionStatus string - -const ( - PrivateEndpointServiceConnectionStatusApproved PrivateEndpointServiceConnectionStatus = "Approved" - PrivateEndpointServiceConnectionStatusPending PrivateEndpointServiceConnectionStatus = "Pending" - PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = "Rejected" -) - -func PossibleValuesForPrivateEndpointServiceConnectionStatus() []string { - return []string{ - string(PrivateEndpointServiceConnectionStatusApproved), - string(PrivateEndpointServiceConnectionStatusPending), - string(PrivateEndpointServiceConnectionStatusRejected), - } -} - -func (s *PrivateEndpointServiceConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateEndpointServiceConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateEndpointServiceConnectionStatus(input string) (*PrivateEndpointServiceConnectionStatus, error) { - vals := map[string]PrivateEndpointServiceConnectionStatus{ - "approved": PrivateEndpointServiceConnectionStatusApproved, - "pending": PrivateEndpointServiceConnectionStatusPending, - "rejected": PrivateEndpointServiceConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateEndpointServiceConnectionStatus(input) - return &out, nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go deleted file mode 100644 index d495f485120..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkscopesapis - -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(&PrivateLinkScopeId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkScopeId{} - -// PrivateLinkScopeId is a struct representing the Resource ID for a Private Link Scope -type PrivateLinkScopeId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkScopeName string -} - -// NewPrivateLinkScopeID returns a new PrivateLinkScopeId struct -func NewPrivateLinkScopeID(subscriptionId string, resourceGroupName string, privateLinkScopeName string) PrivateLinkScopeId { - return PrivateLinkScopeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkScopeName: privateLinkScopeName, - } -} - -// ParsePrivateLinkScopeID parses 'input' into a PrivateLinkScopeId -func ParsePrivateLinkScopeID(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkScopeIDInsensitively parses 'input' case-insensitively into a PrivateLinkScopeId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkScopeIDInsensitively(input string) (*PrivateLinkScopeId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkScopeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkScopeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkScopeId) 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.PrivateLinkScopeName, ok = input.Parsed["privateLinkScopeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkScopeName", input) - } - - return nil -} - -// ValidatePrivateLinkScopeID checks that 'input' can be parsed as a Private Link Scope ID -func ValidatePrivateLinkScopeID(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 := ParsePrivateLinkScopeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Scope ID -func (id PrivateLinkScopeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Insights/privateLinkScopes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkScopeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Scope ID -func (id PrivateLinkScopeId) 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("staticMicrosoftInsights", "Microsoft.Insights", "Microsoft.Insights"), - resourceids.StaticSegment("staticPrivateLinkScopes", "privateLinkScopes", "privateLinkScopes"), - resourceids.UserSpecifiedSegment("privateLinkScopeName", "privateLinkScopeValue"), - } -} - -// String returns a human-readable description of this Private Link Scope ID -func (id PrivateLinkScopeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Scope Name: %q", id.PrivateLinkScopeName), - } - return fmt.Sprintf("Private Link Scope (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go deleted file mode 100644 index 153f6c8662e..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/id_privatelinkscope_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkscopesapis - -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 = &PrivateLinkScopeId{} - -func TestNewPrivateLinkScopeID(t *testing.T) { - id := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue") - - 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.PrivateLinkScopeName != "privateLinkScopeValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkScopeName'", id.PrivateLinkScopeName, "privateLinkScopeValue") - } -} - -func TestFormatPrivateLinkScopeID(t *testing.T) { - actual := NewPrivateLinkScopeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkScopeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkScopeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeID(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestParsePrivateLinkScopeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkScopeId - }{ - { - // 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.Insights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkScopeName: "privateLinkScopeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Insights/privateLinkScopes/privateLinkScopeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe", - Expected: &PrivateLinkScopeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkScopeName: "pRiVaTeLiNkScOpEvAlUe", - }, - }, - { - // 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.iNsIgHtS/pRiVaTeLiNkScOpEs/pRiVaTeLiNkScOpEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkScopeIDInsensitively(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.PrivateLinkScopeName != v.Expected.PrivateLinkScopeName { - t.Fatalf("Expected %q but got %q for PrivateLinkScopeName", v.Expected.PrivateLinkScopeName, actual.PrivateLinkScopeName) - } - - } -} - -func TestSegmentsForPrivateLinkScopeId(t *testing.T) { - segments := PrivateLinkScopeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkScopeId 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/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go deleted file mode 100644 index 21bf558bfb3..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopescreateorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AzureMonitorPrivateLinkScope -} - -// PrivateLinkScopesCreateOrUpdate ... -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesCreateOrUpdate(ctx context.Context, id PrivateLinkScopeId, input AzureMonitorPrivateLinkScope) (result PrivateLinkScopesCreateOrUpdateOperationResponse, 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 AzureMonitorPrivateLinkScope - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go deleted file mode 100644 index 4f423b9a6a7..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// PrivateLinkScopesDelete ... -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesDelete(ctx context.Context, id PrivateLinkScopeId) (result PrivateLinkScopesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// PrivateLinkScopesDeleteThenPoll performs PrivateLinkScopesDelete then polls until it's completed -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesDeleteThenPoll(ctx context.Context, id PrivateLinkScopeId) error { - result, err := c.PrivateLinkScopesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing PrivateLinkScopesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PrivateLinkScopesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesget.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesget.go deleted file mode 100644 index 58cb807f450..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AzureMonitorPrivateLinkScope -} - -// PrivateLinkScopesGet ... -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesGet(ctx context.Context, id PrivateLinkScopeId) (result PrivateLinkScopesGetOperationResponse, 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 AzureMonitorPrivateLinkScope - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslist.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslist.go deleted file mode 100644 index cfa76432214..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AzureMonitorPrivateLinkScope -} - -type PrivateLinkScopesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureMonitorPrivateLinkScope -} - -// PrivateLinkScopesList ... -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesList(ctx context.Context, id commonids.SubscriptionId) (result PrivateLinkScopesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/privateLinkScopes", 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 *[]AzureMonitorPrivateLinkScope `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PrivateLinkScopesListComplete retrieves all the results into a single object -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesListComplete(ctx context.Context, id commonids.SubscriptionId) (PrivateLinkScopesListCompleteResult, error) { - return c.PrivateLinkScopesListCompleteMatchingPredicate(ctx, id, AzureMonitorPrivateLinkScopeOperationPredicate{}) -} - -// PrivateLinkScopesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AzureMonitorPrivateLinkScopeOperationPredicate) (result PrivateLinkScopesListCompleteResult, err error) { - items := make([]AzureMonitorPrivateLinkScope, 0) - - resp, err := c.PrivateLinkScopesList(ctx, id) - if err != nil { - 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 = PrivateLinkScopesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go deleted file mode 100644 index 64bdff27a63..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopeslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AzureMonitorPrivateLinkScope -} - -type PrivateLinkScopesListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureMonitorPrivateLinkScope -} - -// PrivateLinkScopesListByResourceGroup ... -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result PrivateLinkScopesListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Insights/privateLinkScopes", 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 *[]AzureMonitorPrivateLinkScope `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PrivateLinkScopesListByResourceGroupComplete retrieves all the results into a single object -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (PrivateLinkScopesListByResourceGroupCompleteResult, error) { - return c.PrivateLinkScopesListByResourceGroupCompleteMatchingPredicate(ctx, id, AzureMonitorPrivateLinkScopeOperationPredicate{}) -} - -// PrivateLinkScopesListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AzureMonitorPrivateLinkScopeOperationPredicate) (result PrivateLinkScopesListByResourceGroupCompleteResult, err error) { - items := make([]AzureMonitorPrivateLinkScope, 0) - - resp, err := c.PrivateLinkScopesListByResourceGroup(ctx, id) - if err != nil { - 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 = PrivateLinkScopesListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go deleted file mode 100644 index 008f03d8572..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/method_privatelinkscopesupdatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package privatelinkscopesapis - -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 PrivateLinkScopesUpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AzureMonitorPrivateLinkScope -} - -// PrivateLinkScopesUpdateTags ... -func (c PrivateLinkScopesAPIsClient) PrivateLinkScopesUpdateTags(ctx context.Context, id PrivateLinkScopeId, input TagsResource) (result PrivateLinkScopesUpdateTagsOperationResponse, 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 AzureMonitorPrivateLinkScope - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go deleted file mode 100644 index 07ba24268a1..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessModeSettings struct { - Exclusions *[]AccessModeSettingsExclusion `json:"exclusions,omitempty"` - IngestionAccessMode AccessMode `json:"ingestionAccessMode"` - QueryAccessMode AccessMode `json:"queryAccessMode"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go deleted file mode 100644 index 88d4c310514..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_accessmodesettingsexclusion.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccessModeSettingsExclusion struct { - IngestionAccessMode *AccessMode `json:"ingestionAccessMode,omitempty"` - PrivateEndpointConnectionName *string `json:"privateEndpointConnectionName,omitempty"` - QueryAccessMode *AccessMode `json:"queryAccessMode,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go deleted file mode 100644 index 7cba58daad2..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscope.go +++ /dev/null @@ -1,18 +0,0 @@ -package privatelinkscopesapis - -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 AzureMonitorPrivateLinkScope struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties AzureMonitorPrivateLinkScopeProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go deleted file mode 100644 index dfe3d8176db..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_azuremonitorprivatelinkscopeproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorPrivateLinkScopeProperties struct { - AccessModeSettings AccessModeSettings `json:"accessModeSettings"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go deleted file mode 100644 index dfd52c0bcc6..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkscopesapis - -// 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/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnection.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnection.go deleted file mode 100644 index a8f30352f0a..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkscopesapis - -// 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/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go deleted file mode 100644 index e02ccfddf47..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// 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/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index f292a48bd57..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkscopesapis - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_tagsresource.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_tagsresource.go deleted file mode 100644 index 22f50e38146..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/model_tagsresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TagsResource struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/predicates.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/predicates.go deleted file mode 100644 index 627be525eca..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package privatelinkscopesapis - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorPrivateLinkScopeOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p AzureMonitorPrivateLinkScopeOperationPredicate) Matches(input AzureMonitorPrivateLinkScope) 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/insights/2021-07-01-preview/privatelinkscopesapis/version.go b/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/version.go deleted file mode 100644 index e6c1b6f869f..00000000000 --- a/resource-manager/insights/2021-07-01-preview/privatelinkscopesapis/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkscopesapis - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkscopesapis/%s", defaultApiVersion) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/client.go deleted file mode 100644 index 7370983bf22..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/client.go +++ /dev/null @@ -1,73 +0,0 @@ -package v2022_03_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/kubernetesconfiguration/2022-03-01/clusterextensions" - "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/extensions" - "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/flux" - "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster" - "github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - ClusterExtensions *clusterextensions.ClusterExtensionsClient - Extensions *extensions.ExtensionsClient - Flux *flux.FluxClient - FluxConfiguration *fluxconfiguration.FluxConfigurationClient - OperationsInACluster *operationsinacluster.OperationsInAClusterClient - SourceControlConfiguration *sourcecontrolconfiguration.SourceControlConfigurationClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - clusterExtensionsClient, err := clusterextensions.NewClusterExtensionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ClusterExtensions client: %+v", err) - } - configureFunc(clusterExtensionsClient.Client) - - extensionsClient, err := extensions.NewExtensionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Extensions client: %+v", err) - } - configureFunc(extensionsClient.Client) - - fluxClient, err := flux.NewFluxClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Flux client: %+v", err) - } - configureFunc(fluxClient.Client) - - fluxConfigurationClient, err := fluxconfiguration.NewFluxConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FluxConfiguration client: %+v", err) - } - configureFunc(fluxConfigurationClient.Client) - - operationsInAClusterClient, err := operationsinacluster.NewOperationsInAClusterClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building OperationsInACluster client: %+v", err) - } - configureFunc(operationsInAClusterClient.Client) - - sourceControlConfigurationClient, err := sourcecontrolconfiguration.NewSourceControlConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SourceControlConfiguration client: %+v", err) - } - configureFunc(sourceControlConfigurationClient.Client) - - return &Client{ - ClusterExtensions: clusterExtensionsClient, - Extensions: extensionsClient, - Flux: fluxClient, - FluxConfiguration: fluxConfigurationClient, - OperationsInACluster: operationsInAClusterClient, - SourceControlConfiguration: sourceControlConfigurationClient, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/README.md b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/README.md deleted file mode 100644 index b2184b49948..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions` Documentation - -The `clusterextensions` SDK allows for interaction with the Azure Resource Manager Service `kubernetesconfiguration` (API Version `2022-03-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/kubernetesconfiguration/2022-03-01/clusterextensions" -``` - - -### Client Initialization - -```go -client := clusterextensions.NewClusterExtensionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ClusterExtensionsClient.ExtensionsCreate` - -```go -ctx := context.TODO() -id := clusterextensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -payload := clusterextensions.Extension{ - // ... -} - - -if err := client.ExtensionsCreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClusterExtensionsClient.ExtensionsDelete` - -```go -ctx := context.TODO() -id := clusterextensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -if err := client.ExtensionsDeleteThenPoll(ctx, id, clusterextensions.DefaultExtensionsDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ClusterExtensionsClient.ExtensionsGet` - -```go -ctx := context.TODO() -id := clusterextensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -read, err := client.ExtensionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ClusterExtensionsClient.ExtensionsList` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// alternatively `client.ExtensionsList(ctx, id)` can be used to do batched pagination -items, err := client.ExtensionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ClusterExtensionsClient.ExtensionsUpdate` - -```go -ctx := context.TODO() -id := clusterextensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -payload := clusterextensions.PatchExtension{ - // ... -} - - -if err := client.ExtensionsUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/client.go deleted file mode 100644 index 2170a0725b4..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package clusterextensions - -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 ClusterExtensionsClient struct { - Client *resourcemanager.Client -} - -func NewClusterExtensionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ClusterExtensionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "clusterextensions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ClusterExtensionsClient: %+v", err) - } - - return &ClusterExtensionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/constants.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/constants.go deleted file mode 100644 index 130bfd8ca35..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/constants.go +++ /dev/null @@ -1,148 +0,0 @@ -package clusterextensions - -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 AKSIdentityType string - -const ( - AKSIdentityTypeSystemAssigned AKSIdentityType = "SystemAssigned" - AKSIdentityTypeUserAssigned AKSIdentityType = "UserAssigned" -) - -func PossibleValuesForAKSIdentityType() []string { - return []string{ - string(AKSIdentityTypeSystemAssigned), - string(AKSIdentityTypeUserAssigned), - } -} - -func (s *AKSIdentityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAKSIdentityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAKSIdentityType(input string) (*AKSIdentityType, error) { - vals := map[string]AKSIdentityType{ - "systemassigned": AKSIdentityTypeSystemAssigned, - "userassigned": AKSIdentityTypeUserAssigned, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AKSIdentityType(input) - return &out, nil -} - -type LevelType string - -const ( - LevelTypeError LevelType = "Error" - LevelTypeInformation LevelType = "Information" - LevelTypeWarning LevelType = "Warning" -) - -func PossibleValuesForLevelType() []string { - return []string{ - string(LevelTypeError), - string(LevelTypeInformation), - string(LevelTypeWarning), - } -} - -func (s *LevelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLevelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLevelType(input string) (*LevelType, error) { - vals := map[string]LevelType{ - "error": LevelTypeError, - "information": LevelTypeInformation, - "warning": LevelTypeWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LevelType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension.go deleted file mode 100644 index 1ff1a718ace..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension.go +++ /dev/null @@ -1,120 +0,0 @@ -package clusterextensions - -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(&ScopedExtensionId{}) -} - -var _ resourceids.ResourceId = &ScopedExtensionId{} - -// ScopedExtensionId is a struct representing the Resource ID for a Scoped Extension -type ScopedExtensionId struct { - Scope string - ExtensionName string -} - -// NewScopedExtensionID returns a new ScopedExtensionId struct -func NewScopedExtensionID(scope string, extensionName string) ScopedExtensionId { - return ScopedExtensionId{ - Scope: scope, - ExtensionName: extensionName, - } -} - -// ParseScopedExtensionID parses 'input' into a ScopedExtensionId -func ParseScopedExtensionID(input string) (*ScopedExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedExtensionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedExtensionIDInsensitively parses 'input' case-insensitively into a ScopedExtensionId -// note: this method should only be used for API response data and not user input -func ParseScopedExtensionIDInsensitively(input string) (*ScopedExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedExtensionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedExtensionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.ExtensionName, ok = input.Parsed["extensionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "extensionName", input) - } - - return nil -} - -// ValidateScopedExtensionID checks that 'input' can be parsed as a Scoped Extension ID -func ValidateScopedExtensionID(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 := ParseScopedExtensionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Extension ID -func (id ScopedExtensionId) ID() string { - fmtString := "/%s/providers/Microsoft.KubernetesConfiguration/extensions/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.ExtensionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Extension ID -func (id ScopedExtensionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftKubernetesConfiguration", "Microsoft.KubernetesConfiguration", "Microsoft.KubernetesConfiguration"), - resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "extensionValue"), - } -} - -// String returns a human-readable description of this Scoped Extension ID -func (id ScopedExtensionId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Extension Name: %q", id.ExtensionName), - } - return fmt.Sprintf("Scoped Extension (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension_test.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension_test.go deleted file mode 100644 index 8381d6b4e51..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/id_scopedextension_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package clusterextensions - -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 = &ScopedExtensionId{} - -func TestNewScopedExtensionID(t *testing.T) { - id := NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.ExtensionName != "extensionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionValue") - } -} - -func TestFormatScopedExtensionID(t *testing.T) { - actual := NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedExtensionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedExtensionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue", - Expected: &ScopedExtensionId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedExtensionID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestParseScopedExtensionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedExtensionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/eXtEnSiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue", - Expected: &ScopedExtensionId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/eXtEnSiOnS/eXtEnSiOnVaLuE", - Expected: &ScopedExtensionId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ExtensionName: "eXtEnSiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/eXtEnSiOnS/eXtEnSiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedExtensionIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestSegmentsForScopedExtensionId(t *testing.T) { - segments := ScopedExtensionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedExtensionId 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/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionscreate.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionscreate.go deleted file mode 100644 index 8c721a1c117..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionscreate.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusterextensions - -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 ExtensionsCreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// ExtensionsCreate ... -func (c ClusterExtensionsClient) ExtensionsCreate(ctx context.Context, id ScopedExtensionId, input Extension) (result ExtensionsCreateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ExtensionsCreateThenPoll performs ExtensionsCreate then polls until it's completed -func (c ClusterExtensionsClient) ExtensionsCreateThenPoll(ctx context.Context, id ScopedExtensionId, input Extension) error { - result, err := c.ExtensionsCreate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ExtensionsCreate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExtensionsCreate: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsdelete.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsdelete.go deleted file mode 100644 index cc7f4a9467f..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsdelete.go +++ /dev/null @@ -1,99 +0,0 @@ -package clusterextensions - -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 ExtensionsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -type ExtensionsDeleteOperationOptions struct { - ForceDelete *bool -} - -func DefaultExtensionsDeleteOperationOptions() ExtensionsDeleteOperationOptions { - return ExtensionsDeleteOperationOptions{} -} - -func (o ExtensionsDeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ExtensionsDeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ExtensionsDeleteOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ForceDelete != nil { - out.Append("forceDelete", fmt.Sprintf("%v", *o.ForceDelete)) - } - return &out -} - -// ExtensionsDelete ... -func (c ClusterExtensionsClient) ExtensionsDelete(ctx context.Context, id ScopedExtensionId, options ExtensionsDeleteOperationOptions) (result ExtensionsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - OptionsObject: options, - } - - 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 -} - -// ExtensionsDeleteThenPoll performs ExtensionsDelete then polls until it's completed -func (c ClusterExtensionsClient) ExtensionsDeleteThenPoll(ctx context.Context, id ScopedExtensionId, options ExtensionsDeleteOperationOptions) error { - result, err := c.ExtensionsDelete(ctx, id, options) - if err != nil { - return fmt.Errorf("performing ExtensionsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExtensionsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsget.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsget.go deleted file mode 100644 index 2381c7832f9..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package clusterextensions - -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 ExtensionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// ExtensionsGet ... -func (c ClusterExtensionsClient) ExtensionsGet(ctx context.Context, id ScopedExtensionId) (result ExtensionsGetOperationResponse, 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 Extension - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionslist.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionslist.go deleted file mode 100644 index 6ccc2120b53..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package clusterextensions - -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 ExtensionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Extension -} - -type ExtensionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Extension -} - -// ExtensionsList ... -func (c ClusterExtensionsClient) ExtensionsList(ctx context.Context, id commonids.ScopeId) (result ExtensionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.KubernetesConfiguration/extensions", 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 *[]Extension `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ExtensionsListComplete retrieves all the results into a single object -func (c ClusterExtensionsClient) ExtensionsListComplete(ctx context.Context, id commonids.ScopeId) (ExtensionsListCompleteResult, error) { - return c.ExtensionsListCompleteMatchingPredicate(ctx, id, ExtensionOperationPredicate{}) -} - -// ExtensionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ClusterExtensionsClient) ExtensionsListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate ExtensionOperationPredicate) (result ExtensionsListCompleteResult, err error) { - items := make([]Extension, 0) - - resp, err := c.ExtensionsList(ctx, id) - if err != nil { - 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 = ExtensionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsupdate.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsupdate.go deleted file mode 100644 index b2357929118..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/method_extensionsupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package clusterextensions - -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 ExtensionsUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// ExtensionsUpdate ... -func (c ClusterExtensionsClient) ExtensionsUpdate(ctx context.Context, id ScopedExtensionId, input PatchExtension) (result ExtensionsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ExtensionsUpdateThenPoll performs ExtensionsUpdate then polls until it's completed -func (c ClusterExtensionsClient) ExtensionsUpdateThenPoll(ctx context.Context, id ScopedExtensionId, input PatchExtension) error { - result, err := c.ExtensionsUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ExtensionsUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExtensionsUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_erroradditionalinfo.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_erroradditionalinfo.go deleted file mode 100644 index 804699330a8..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusterextensions - -// 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/kubernetesconfiguration/2022-03-01/clusterextensions/model_errordetail.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_errordetail.go deleted file mode 100644 index 759e94926df..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_errordetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusterextensions - -// 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/kubernetesconfiguration/2022-03-01/clusterextensions/model_extension.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extension.go deleted file mode 100644 index d64139cb740..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extension.go +++ /dev/null @@ -1,18 +0,0 @@ -package clusterextensions - -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 Extension struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExtensionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionproperties.go deleted file mode 100644 index ed5b50aa876..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionProperties struct { - AksAssignedIdentity *ExtensionPropertiesAksAssignedIdentity `json:"aksAssignedIdentity,omitempty"` - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - ConfigurationSettings *map[string]string `json:"configurationSettings,omitempty"` - CustomLocationSettings *map[string]string `json:"customLocationSettings,omitempty"` - ErrorInfo *ErrorDetail `json:"errorInfo,omitempty"` - ExtensionType *string `json:"extensionType,omitempty"` - InstalledVersion *string `json:"installedVersion,omitempty"` - PackageUri *string `json:"packageUri,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ReleaseTrain *string `json:"releaseTrain,omitempty"` - Scope *Scope `json:"scope,omitempty"` - Statuses *[]ExtensionStatus `json:"statuses,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionpropertiesaksassignedidentity.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionpropertiesaksassignedidentity.go deleted file mode 100644 index 3c1774b93bd..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionpropertiesaksassignedidentity.go +++ /dev/null @@ -1,10 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPropertiesAksAssignedIdentity struct { - PrincipalId *string `json:"principalId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` - Type *AKSIdentityType `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionstatus.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionstatus.go deleted file mode 100644 index eb63e7e17d5..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_extensionstatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionStatus struct { - Code *string `json:"code,omitempty"` - DisplayStatus *string `json:"displayStatus,omitempty"` - Level *LevelType `json:"level,omitempty"` - Message *string `json:"message,omitempty"` - Time *string `json:"time,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextension.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextension.go deleted file mode 100644 index 8664a2b87ce..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextension.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchExtension struct { - Properties *PatchExtensionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextensionproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextensionproperties.go deleted file mode 100644 index 5758c6bb6b4..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_patchextensionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchExtensionProperties struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - ConfigurationSettings *map[string]string `json:"configurationSettings,omitempty"` - ReleaseTrain *string `json:"releaseTrain,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scope.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scope.go deleted file mode 100644 index 41faece2a7d..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scope.go +++ /dev/null @@ -1,9 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Scope struct { - Cluster *ScopeCluster `json:"cluster,omitempty"` - Namespace *ScopeNamespace `json:"namespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopecluster.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopecluster.go deleted file mode 100644 index 0c41f8d2208..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopecluster.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeCluster struct { - ReleaseNamespace *string `json:"releaseNamespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopenamespace.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopenamespace.go deleted file mode 100644 index e2313e78801..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/model_scopenamespace.go +++ /dev/null @@ -1,8 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeNamespace struct { - TargetNamespace *string `json:"targetNamespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/predicates.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/predicates.go deleted file mode 100644 index 1ddaf4e58fe..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package clusterextensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ExtensionOperationPredicate) Matches(input Extension) 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/kubernetesconfiguration/2022-03-01/clusterextensions/version.go b/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/version.go deleted file mode 100644 index 4f1f90eed29..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/clusterextensions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package clusterextensions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/clusterextensions/%s", defaultApiVersion) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/README.md b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/README.md deleted file mode 100644 index 85bd4e177aa..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/extensions` Documentation - -The `extensions` SDK allows for interaction with the Azure Resource Manager Service `kubernetesconfiguration` (API Version `2022-03-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/kubernetesconfiguration/2022-03-01/extensions" -``` - - -### Client Initialization - -```go -client := extensions.NewExtensionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExtensionsClient.Create` - -```go -ctx := context.TODO() -id := extensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -payload := extensions.Extension{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Delete` - -```go -ctx := context.TODO() -id := extensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -if err := client.DeleteThenPoll(ctx, id, extensions.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExtensionsClient.Get` - -```go -ctx := context.TODO() -id := extensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -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: `ExtensionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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: `ExtensionsClient.Update` - -```go -ctx := context.TODO() -id := extensions.NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - -payload := extensions.PatchExtension{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/client.go deleted file mode 100644 index 44725ac0e84..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package extensions - -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 ExtensionsClient struct { - Client *resourcemanager.Client -} - -func NewExtensionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExtensionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "extensions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExtensionsClient: %+v", err) - } - - return &ExtensionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/constants.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/constants.go deleted file mode 100644 index e0a6de4dc0c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/constants.go +++ /dev/null @@ -1,148 +0,0 @@ -package extensions - -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 AKSIdentityType string - -const ( - AKSIdentityTypeSystemAssigned AKSIdentityType = "SystemAssigned" - AKSIdentityTypeUserAssigned AKSIdentityType = "UserAssigned" -) - -func PossibleValuesForAKSIdentityType() []string { - return []string{ - string(AKSIdentityTypeSystemAssigned), - string(AKSIdentityTypeUserAssigned), - } -} - -func (s *AKSIdentityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAKSIdentityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAKSIdentityType(input string) (*AKSIdentityType, error) { - vals := map[string]AKSIdentityType{ - "systemassigned": AKSIdentityTypeSystemAssigned, - "userassigned": AKSIdentityTypeUserAssigned, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AKSIdentityType(input) - return &out, nil -} - -type LevelType string - -const ( - LevelTypeError LevelType = "Error" - LevelTypeInformation LevelType = "Information" - LevelTypeWarning LevelType = "Warning" -) - -func PossibleValuesForLevelType() []string { - return []string{ - string(LevelTypeError), - string(LevelTypeInformation), - string(LevelTypeWarning), - } -} - -func (s *LevelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLevelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLevelType(input string) (*LevelType, error) { - vals := map[string]LevelType{ - "error": LevelTypeError, - "information": LevelTypeInformation, - "warning": LevelTypeWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LevelType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension.go deleted file mode 100644 index 57c085319c9..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension.go +++ /dev/null @@ -1,120 +0,0 @@ -package extensions - -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(&ScopedExtensionId{}) -} - -var _ resourceids.ResourceId = &ScopedExtensionId{} - -// ScopedExtensionId is a struct representing the Resource ID for a Scoped Extension -type ScopedExtensionId struct { - Scope string - ExtensionName string -} - -// NewScopedExtensionID returns a new ScopedExtensionId struct -func NewScopedExtensionID(scope string, extensionName string) ScopedExtensionId { - return ScopedExtensionId{ - Scope: scope, - ExtensionName: extensionName, - } -} - -// ParseScopedExtensionID parses 'input' into a ScopedExtensionId -func ParseScopedExtensionID(input string) (*ScopedExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedExtensionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedExtensionIDInsensitively parses 'input' case-insensitively into a ScopedExtensionId -// note: this method should only be used for API response data and not user input -func ParseScopedExtensionIDInsensitively(input string) (*ScopedExtensionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedExtensionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedExtensionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedExtensionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.ExtensionName, ok = input.Parsed["extensionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "extensionName", input) - } - - return nil -} - -// ValidateScopedExtensionID checks that 'input' can be parsed as a Scoped Extension ID -func ValidateScopedExtensionID(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 := ParseScopedExtensionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Extension ID -func (id ScopedExtensionId) ID() string { - fmtString := "/%s/providers/Microsoft.KubernetesConfiguration/extensions/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.ExtensionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Extension ID -func (id ScopedExtensionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftKubernetesConfiguration", "Microsoft.KubernetesConfiguration", "Microsoft.KubernetesConfiguration"), - resourceids.StaticSegment("staticExtensions", "extensions", "extensions"), - resourceids.UserSpecifiedSegment("extensionName", "extensionValue"), - } -} - -// String returns a human-readable description of this Scoped Extension ID -func (id ScopedExtensionId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Extension Name: %q", id.ExtensionName), - } - return fmt.Sprintf("Scoped Extension (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension_test.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension_test.go deleted file mode 100644 index d2a7ca0210b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/id_scopedextension_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package extensions - -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 = &ScopedExtensionId{} - -func TestNewScopedExtensionID(t *testing.T) { - id := NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.ExtensionName != "extensionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExtensionName'", id.ExtensionName, "extensionValue") - } -} - -func TestFormatScopedExtensionID(t *testing.T) { - actual := NewScopedExtensionID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "extensionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedExtensionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedExtensionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue", - Expected: &ScopedExtensionId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedExtensionID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestParseScopedExtensionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedExtensionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/eXtEnSiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue", - Expected: &ScopedExtensionId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ExtensionName: "extensionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/extensions/extensionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/eXtEnSiOnS/eXtEnSiOnVaLuE", - Expected: &ScopedExtensionId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ExtensionName: "eXtEnSiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/eXtEnSiOnS/eXtEnSiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedExtensionIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ExtensionName != v.Expected.ExtensionName { - t.Fatalf("Expected %q but got %q for ExtensionName", v.Expected.ExtensionName, actual.ExtensionName) - } - - } -} - -func TestSegmentsForScopedExtensionId(t *testing.T) { - segments := ScopedExtensionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedExtensionId 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/kubernetesconfiguration/2022-03-01/extensions/method_create.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_create.go deleted file mode 100644 index aba668ff7a4..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_create.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// Create ... -func (c ExtensionsClient) Create(ctx context.Context, id ScopedExtensionId, input Extension) (result CreateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c ExtensionsClient) CreateThenPoll(ctx context.Context, id ScopedExtensionId, input Extension) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_delete.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_delete.go deleted file mode 100644 index b80bc526395..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package extensions - -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 { - ForceDelete *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o DeleteOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ForceDelete != nil { - out.Append("forceDelete", fmt.Sprintf("%v", *o.ForceDelete)) - } - return &out -} - -// Delete ... -func (c ExtensionsClient) Delete(ctx context.Context, id ScopedExtensionId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 ExtensionsClient) DeleteThenPoll(ctx context.Context, id ScopedExtensionId, 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/kubernetesconfiguration/2022-03-01/extensions/method_get.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_get.go deleted file mode 100644 index cd41d7bbb2c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package extensions - -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 *Extension -} - -// Get ... -func (c ExtensionsClient) Get(ctx context.Context, id ScopedExtensionId) (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 Extension - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_list.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_list.go deleted file mode 100644 index ee8a4f6296b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package extensions - -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 *[]Extension -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Extension -} - -// List ... -func (c ExtensionsClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.KubernetesConfiguration/extensions", 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 *[]Extension `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 ExtensionsClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExtensionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExtensionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate ExtensionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Extension, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/kubernetesconfiguration/2022-03-01/extensions/method_update.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_update.go deleted file mode 100644 index a16eb53ced9..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package extensions - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Extension -} - -// Update ... -func (c ExtensionsClient) Update(ctx context.Context, id ScopedExtensionId, input PatchExtension) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ExtensionsClient) UpdateThenPoll(ctx context.Context, id ScopedExtensionId, input PatchExtension) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_erroradditionalinfo.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_erroradditionalinfo.go deleted file mode 100644 index 2967bfa2cc9..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package extensions - -// 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/kubernetesconfiguration/2022-03-01/extensions/model_errordetail.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_errordetail.go deleted file mode 100644 index 1252819f522..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_errordetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// 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/kubernetesconfiguration/2022-03-01/extensions/model_extension.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extension.go deleted file mode 100644 index cc43bb7aba1..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extension.go +++ /dev/null @@ -1,18 +0,0 @@ -package extensions - -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 Extension struct { - Id *string `json:"id,omitempty"` - Identity *identity.SystemAssigned `json:"identity,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExtensionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionproperties.go deleted file mode 100644 index bc0aade45e1..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionProperties struct { - AksAssignedIdentity *ExtensionPropertiesAksAssignedIdentity `json:"aksAssignedIdentity,omitempty"` - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - ConfigurationSettings *map[string]string `json:"configurationSettings,omitempty"` - CustomLocationSettings *map[string]string `json:"customLocationSettings,omitempty"` - ErrorInfo *ErrorDetail `json:"errorInfo,omitempty"` - ExtensionType *string `json:"extensionType,omitempty"` - InstalledVersion *string `json:"installedVersion,omitempty"` - PackageUri *string `json:"packageUri,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ReleaseTrain *string `json:"releaseTrain,omitempty"` - Scope *Scope `json:"scope,omitempty"` - Statuses *[]ExtensionStatus `json:"statuses,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionpropertiesaksassignedidentity.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionpropertiesaksassignedidentity.go deleted file mode 100644 index f816f9300e4..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionpropertiesaksassignedidentity.go +++ /dev/null @@ -1,10 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionPropertiesAksAssignedIdentity struct { - PrincipalId *string `json:"principalId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` - Type *AKSIdentityType `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionstatus.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionstatus.go deleted file mode 100644 index 3e0d6ac3a57..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_extensionstatus.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionStatus struct { - Code *string `json:"code,omitempty"` - DisplayStatus *string `json:"displayStatus,omitempty"` - Level *LevelType `json:"level,omitempty"` - Message *string `json:"message,omitempty"` - Time *string `json:"time,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextension.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextension.go deleted file mode 100644 index 009bafcf1fb..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextension.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchExtension struct { - Properties *PatchExtensionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextensionproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextensionproperties.go deleted file mode 100644 index 40aa2a9830b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_patchextensionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchExtensionProperties struct { - AutoUpgradeMinorVersion *bool `json:"autoUpgradeMinorVersion,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - ConfigurationSettings *map[string]string `json:"configurationSettings,omitempty"` - ReleaseTrain *string `json:"releaseTrain,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scope.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scope.go deleted file mode 100644 index af7de8c1340..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scope.go +++ /dev/null @@ -1,9 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Scope struct { - Cluster *ScopeCluster `json:"cluster,omitempty"` - Namespace *ScopeNamespace `json:"namespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopecluster.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopecluster.go deleted file mode 100644 index 957e4e0eb10..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopecluster.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeCluster struct { - ReleaseNamespace *string `json:"releaseNamespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopenamespace.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopenamespace.go deleted file mode 100644 index c9abf157df5..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/model_scopenamespace.go +++ /dev/null @@ -1,8 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeNamespace struct { - TargetNamespace *string `json:"targetNamespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/predicates.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/predicates.go deleted file mode 100644 index 41d2fee4d9b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package extensions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtensionOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ExtensionOperationPredicate) Matches(input Extension) 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/kubernetesconfiguration/2022-03-01/extensions/version.go b/resource-manager/kubernetesconfiguration/2022-03-01/extensions/version.go deleted file mode 100644 index 5bcb6ca21d8..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/extensions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package extensions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/extensions/%s", defaultApiVersion) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/README.md b/resource-manager/kubernetesconfiguration/2022-03-01/flux/README.md deleted file mode 100644 index a5a4ee66d99..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/flux` Documentation - -The `flux` SDK allows for interaction with the Azure Resource Manager Service `kubernetesconfiguration` (API Version `2022-03-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/kubernetesconfiguration/2022-03-01/flux" -``` - - -### Client Initialization - -```go -client := flux.NewFluxClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FluxClient.ConfigurationsCreateOrUpdate` - -```go -ctx := context.TODO() -id := flux.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -payload := flux.FluxConfiguration{ - // ... -} - - -if err := client.ConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FluxClient.ConfigurationsDelete` - -```go -ctx := context.TODO() -id := flux.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -if err := client.ConfigurationsDeleteThenPoll(ctx, id, flux.DefaultConfigurationsDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `FluxClient.ConfigurationsGet` - -```go -ctx := context.TODO() -id := flux.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -read, err := client.ConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FluxClient.ConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// alternatively `client.ConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.ConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `FluxClient.ConfigurationsUpdate` - -```go -ctx := context.TODO() -id := flux.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -payload := flux.FluxConfigurationPatch{ - // ... -} - - -if err := client.ConfigurationsUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/client.go deleted file mode 100644 index ea34cc2b6c2..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package flux - -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 FluxClient struct { - Client *resourcemanager.Client -} - -func NewFluxClientWithBaseURI(sdkApi sdkEnv.Api) (*FluxClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "flux", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FluxClient: %+v", err) - } - - return &FluxClient{ - Client: client, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/constants.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/constants.go deleted file mode 100644 index c5c4991945b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/constants.go +++ /dev/null @@ -1,195 +0,0 @@ -package flux - -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 FluxComplianceState string - -const ( - FluxComplianceStateCompliant FluxComplianceState = "Compliant" - FluxComplianceStateNonNegativeCompliant FluxComplianceState = "Non-Compliant" - FluxComplianceStatePending FluxComplianceState = "Pending" - FluxComplianceStateSuspended FluxComplianceState = "Suspended" - FluxComplianceStateUnknown FluxComplianceState = "Unknown" -) - -func PossibleValuesForFluxComplianceState() []string { - return []string{ - string(FluxComplianceStateCompliant), - string(FluxComplianceStateNonNegativeCompliant), - string(FluxComplianceStatePending), - string(FluxComplianceStateSuspended), - string(FluxComplianceStateUnknown), - } -} - -func (s *FluxComplianceState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFluxComplianceState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFluxComplianceState(input string) (*FluxComplianceState, error) { - vals := map[string]FluxComplianceState{ - "compliant": FluxComplianceStateCompliant, - "non-compliant": FluxComplianceStateNonNegativeCompliant, - "pending": FluxComplianceStatePending, - "suspended": FluxComplianceStateSuspended, - "unknown": FluxComplianceStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FluxComplianceState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ScopeType string - -const ( - ScopeTypeCluster ScopeType = "cluster" - ScopeTypeNamespace ScopeType = "namespace" -) - -func PossibleValuesForScopeType() []string { - return []string{ - string(ScopeTypeCluster), - string(ScopeTypeNamespace), - } -} - -func (s *ScopeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScopeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScopeType(input string) (*ScopeType, error) { - vals := map[string]ScopeType{ - "cluster": ScopeTypeCluster, - "namespace": ScopeTypeNamespace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScopeType(input) - return &out, nil -} - -type SourceKindType string - -const ( - SourceKindTypeBucket SourceKindType = "Bucket" - SourceKindTypeGitRepository SourceKindType = "GitRepository" -) - -func PossibleValuesForSourceKindType() []string { - return []string{ - string(SourceKindTypeBucket), - string(SourceKindTypeGitRepository), - } -} - -func (s *SourceKindType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSourceKindType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSourceKindType(input string) (*SourceKindType, error) { - vals := map[string]SourceKindType{ - "bucket": SourceKindTypeBucket, - "gitrepository": SourceKindTypeGitRepository, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SourceKindType(input) - return &out, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration.go deleted file mode 100644 index 016579aff1b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration.go +++ /dev/null @@ -1,120 +0,0 @@ -package flux - -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(&ScopedFluxConfigurationId{}) -} - -var _ resourceids.ResourceId = &ScopedFluxConfigurationId{} - -// ScopedFluxConfigurationId is a struct representing the Resource ID for a Scoped Flux Configuration -type ScopedFluxConfigurationId struct { - Scope string - FluxConfigurationName string -} - -// NewScopedFluxConfigurationID returns a new ScopedFluxConfigurationId struct -func NewScopedFluxConfigurationID(scope string, fluxConfigurationName string) ScopedFluxConfigurationId { - return ScopedFluxConfigurationId{ - Scope: scope, - FluxConfigurationName: fluxConfigurationName, - } -} - -// ParseScopedFluxConfigurationID parses 'input' into a ScopedFluxConfigurationId -func ParseScopedFluxConfigurationID(input string) (*ScopedFluxConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedFluxConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedFluxConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedFluxConfigurationIDInsensitively parses 'input' case-insensitively into a ScopedFluxConfigurationId -// note: this method should only be used for API response data and not user input -func ParseScopedFluxConfigurationIDInsensitively(input string) (*ScopedFluxConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedFluxConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedFluxConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedFluxConfigurationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.FluxConfigurationName, ok = input.Parsed["fluxConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "fluxConfigurationName", input) - } - - return nil -} - -// ValidateScopedFluxConfigurationID checks that 'input' can be parsed as a Scoped Flux Configuration ID -func ValidateScopedFluxConfigurationID(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 := ParseScopedFluxConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Flux Configuration ID -func (id ScopedFluxConfigurationId) ID() string { - fmtString := "/%s/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.FluxConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Flux Configuration ID -func (id ScopedFluxConfigurationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftKubernetesConfiguration", "Microsoft.KubernetesConfiguration", "Microsoft.KubernetesConfiguration"), - resourceids.StaticSegment("staticFluxConfigurations", "fluxConfigurations", "fluxConfigurations"), - resourceids.UserSpecifiedSegment("fluxConfigurationName", "fluxConfigurationValue"), - } -} - -// String returns a human-readable description of this Scoped Flux Configuration ID -func (id ScopedFluxConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Flux Configuration Name: %q", id.FluxConfigurationName), - } - return fmt.Sprintf("Scoped Flux Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration_test.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration_test.go deleted file mode 100644 index 742dacff266..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/id_scopedfluxconfiguration_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package flux - -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 = &ScopedFluxConfigurationId{} - -func TestNewScopedFluxConfigurationID(t *testing.T) { - id := NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.FluxConfigurationName != "fluxConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'FluxConfigurationName'", id.FluxConfigurationName, "fluxConfigurationValue") - } -} - -func TestFormatScopedFluxConfigurationID(t *testing.T) { - actual := NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedFluxConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedFluxConfigurationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue", - Expected: &ScopedFluxConfigurationId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - FluxConfigurationName: "fluxConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedFluxConfigurationID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.FluxConfigurationName != v.Expected.FluxConfigurationName { - t.Fatalf("Expected %q but got %q for FluxConfigurationName", v.Expected.FluxConfigurationName, actual.FluxConfigurationName) - } - - } -} - -func TestParseScopedFluxConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedFluxConfigurationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/fLuXcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue", - Expected: &ScopedFluxConfigurationId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - FluxConfigurationName: "fluxConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/fLuXcOnFiGuRaTiOnS/fLuXcOnFiGuRaTiOnVaLuE", - Expected: &ScopedFluxConfigurationId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - FluxConfigurationName: "fLuXcOnFiGuRaTiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/fLuXcOnFiGuRaTiOnS/fLuXcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedFluxConfigurationIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.FluxConfigurationName != v.Expected.FluxConfigurationName { - t.Fatalf("Expected %q but got %q for FluxConfigurationName", v.Expected.FluxConfigurationName, actual.FluxConfigurationName) - } - - } -} - -func TestSegmentsForScopedFluxConfigurationId(t *testing.T) { - segments := ScopedFluxConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedFluxConfigurationId 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/kubernetesconfiguration/2022-03-01/flux/method_configurationscreateorupdate.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationscreateorupdate.go deleted file mode 100644 index ad1d4d585c2..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package flux - -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 ConfigurationsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FluxConfiguration -} - -// ConfigurationsCreateOrUpdate ... -func (c FluxClient) ConfigurationsCreateOrUpdate(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfiguration) (result ConfigurationsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ConfigurationsCreateOrUpdateThenPoll performs ConfigurationsCreateOrUpdate then polls until it's completed -func (c FluxClient) ConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfiguration) error { - result, err := c.ConfigurationsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ConfigurationsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsdelete.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsdelete.go deleted file mode 100644 index 5ae8ceb6b4e..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsdelete.go +++ /dev/null @@ -1,99 +0,0 @@ -package flux - -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 ConfigurationsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -type ConfigurationsDeleteOperationOptions struct { - ForceDelete *bool -} - -func DefaultConfigurationsDeleteOperationOptions() ConfigurationsDeleteOperationOptions { - return ConfigurationsDeleteOperationOptions{} -} - -func (o ConfigurationsDeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ConfigurationsDeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ConfigurationsDeleteOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ForceDelete != nil { - out.Append("forceDelete", fmt.Sprintf("%v", *o.ForceDelete)) - } - return &out -} - -// ConfigurationsDelete ... -func (c FluxClient) ConfigurationsDelete(ctx context.Context, id ScopedFluxConfigurationId, options ConfigurationsDeleteOperationOptions) (result ConfigurationsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusNoContent, - http.StatusOK, - }, - HttpMethod: http.MethodDelete, - Path: id.ID(), - OptionsObject: options, - } - - 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 -} - -// ConfigurationsDeleteThenPoll performs ConfigurationsDelete then polls until it's completed -func (c FluxClient) ConfigurationsDeleteThenPoll(ctx context.Context, id ScopedFluxConfigurationId, options ConfigurationsDeleteOperationOptions) error { - result, err := c.ConfigurationsDelete(ctx, id, options) - if err != nil { - return fmt.Errorf("performing ConfigurationsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsget.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsget.go deleted file mode 100644 index e2da945854a..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package flux - -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 ConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FluxConfiguration -} - -// ConfigurationsGet ... -func (c FluxClient) ConfigurationsGet(ctx context.Context, id ScopedFluxConfigurationId) (result ConfigurationsGetOperationResponse, 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 FluxConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationslist.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationslist.go deleted file mode 100644 index 1b328970be2..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package flux - -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 ConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FluxConfiguration -} - -type ConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FluxConfiguration -} - -// ConfigurationsList ... -func (c FluxClient) ConfigurationsList(ctx context.Context, id commonids.ScopeId) (result ConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", 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 *[]FluxConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ConfigurationsListComplete retrieves all the results into a single object -func (c FluxClient) ConfigurationsListComplete(ctx context.Context, id commonids.ScopeId) (ConfigurationsListCompleteResult, error) { - return c.ConfigurationsListCompleteMatchingPredicate(ctx, id, FluxConfigurationOperationPredicate{}) -} - -// ConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FluxClient) ConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate FluxConfigurationOperationPredicate) (result ConfigurationsListCompleteResult, err error) { - items := make([]FluxConfiguration, 0) - - resp, err := c.ConfigurationsList(ctx, id) - if err != nil { - 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 = ConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsupdate.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsupdate.go deleted file mode 100644 index e132ebf8779..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/method_configurationsupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package flux - -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 ConfigurationsUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FluxConfiguration -} - -// ConfigurationsUpdate ... -func (c FluxClient) ConfigurationsUpdate(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfigurationPatch) (result ConfigurationsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ConfigurationsUpdateThenPoll performs ConfigurationsUpdate then polls until it's completed -func (c FluxClient) ConfigurationsUpdateThenPoll(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfigurationPatch) error { - result, err := c.ConfigurationsUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ConfigurationsUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationsUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketdefinition.go deleted file mode 100644 index 9d8742fe1f0..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BucketDefinition struct { - AccessKey *string `json:"accessKey,omitempty"` - BucketName *string `json:"bucketName,omitempty"` - Insecure *bool `json:"insecure,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketpatchdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketpatchdefinition.go deleted file mode 100644 index 9daaf1b3030..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_bucketpatchdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BucketPatchDefinition struct { - AccessKey *string `json:"accessKey,omitempty"` - BucketName *string `json:"bucketName,omitempty"` - Insecure *bool `json:"insecure,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfiguration.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfiguration.go deleted file mode 100644 index ac6600a0031..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -package flux - -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 FluxConfiguration struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FluxConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatch.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatch.go deleted file mode 100644 index d96b2e84cf9..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FluxConfigurationPatch struct { - Properties *FluxConfigurationPatchProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatchproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatchproperties.go deleted file mode 100644 index 4e71ac02465..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationpatchproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FluxConfigurationPatchProperties struct { - Bucket *BucketPatchDefinition `json:"bucket,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - GitRepository *GitRepositoryPatchDefinition `json:"gitRepository,omitempty"` - Kustomizations *map[string]KustomizationPatchDefinition `json:"kustomizations,omitempty"` - SourceKind *SourceKindType `json:"sourceKind,omitempty"` - Suspend *bool `json:"suspend,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationproperties.go deleted file mode 100644 index 8e62c37d0dd..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_fluxconfigurationproperties.go +++ /dev/null @@ -1,53 +0,0 @@ -package flux - -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 FluxConfigurationProperties struct { - Bucket *BucketDefinition `json:"bucket,omitempty"` - ComplianceState *FluxComplianceState `json:"complianceState,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - GitRepository *GitRepositoryDefinition `json:"gitRepository,omitempty"` - Kustomizations *map[string]KustomizationDefinition `json:"kustomizations,omitempty"` - Namespace *string `json:"namespace,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` - Scope *ScopeType `json:"scope,omitempty"` - SourceKind *SourceKindType `json:"sourceKind,omitempty"` - SourceSyncedCommitId *string `json:"sourceSyncedCommitId,omitempty"` - SourceUpdatedAt *string `json:"sourceUpdatedAt,omitempty"` - StatusUpdatedAt *string `json:"statusUpdatedAt,omitempty"` - Statuses *[]ObjectStatusDefinition `json:"statuses,omitempty"` - Suspend *bool `json:"suspend,omitempty"` -} - -func (o *FluxConfigurationProperties) GetSourceUpdatedAtAsTime() (*time.Time, error) { - if o.SourceUpdatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.SourceUpdatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *FluxConfigurationProperties) SetSourceUpdatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.SourceUpdatedAt = &formatted -} - -func (o *FluxConfigurationProperties) GetStatusUpdatedAtAsTime() (*time.Time, error) { - if o.StatusUpdatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StatusUpdatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *FluxConfigurationProperties) SetStatusUpdatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StatusUpdatedAt = &formatted -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorydefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorydefinition.go deleted file mode 100644 index 0be2d48e28c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorydefinition.go +++ /dev/null @@ -1,15 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GitRepositoryDefinition struct { - HTTPSCACert *string `json:"httpsCACert,omitempty"` - HTTPSUser *string `json:"httpsUser,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"` - SshKnownHosts *string `json:"sshKnownHosts,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorypatchdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorypatchdefinition.go deleted file mode 100644 index aaed329834f..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_gitrepositorypatchdefinition.go +++ /dev/null @@ -1,15 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GitRepositoryPatchDefinition struct { - HTTPSCACert *string `json:"httpsCACert,omitempty"` - HTTPSUser *string `json:"httpsUser,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"` - SshKnownHosts *string `json:"sshKnownHosts,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_helmreleasepropertiesdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_helmreleasepropertiesdefinition.go deleted file mode 100644 index a99ef57fc11..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_helmreleasepropertiesdefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HelmReleasePropertiesDefinition struct { - FailureCount *int64 `json:"failureCount,omitempty"` - HelmChartRef *ObjectReferenceDefinition `json:"helmChartRef,omitempty"` - InstallFailureCount *int64 `json:"installFailureCount,omitempty"` - LastRevisionApplied *int64 `json:"lastRevisionApplied,omitempty"` - UpgradeFailureCount *int64 `json:"upgradeFailureCount,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationdefinition.go deleted file mode 100644 index 9755ed770f2..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationdefinition.go +++ /dev/null @@ -1,15 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KustomizationDefinition struct { - DependsOn *[]string `json:"dependsOn,omitempty"` - Force *bool `json:"force,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Prune *bool `json:"prune,omitempty"` - RetryIntervalInSeconds *int64 `json:"retryIntervalInSeconds,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationpatchdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationpatchdefinition.go deleted file mode 100644 index bbfa9eff798..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_kustomizationpatchdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KustomizationPatchDefinition struct { - DependsOn *[]string `json:"dependsOn,omitempty"` - Force *bool `json:"force,omitempty"` - Path *string `json:"path,omitempty"` - Prune *bool `json:"prune,omitempty"` - RetryIntervalInSeconds *int64 `json:"retryIntervalInSeconds,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectreferencedefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectreferencedefinition.go deleted file mode 100644 index 6efdf81c0ef..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectreferencedefinition.go +++ /dev/null @@ -1,9 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ObjectReferenceDefinition struct { - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusconditiondefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusconditiondefinition.go deleted file mode 100644 index d516681b0b4..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusconditiondefinition.go +++ /dev/null @@ -1,30 +0,0 @@ -package flux - -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 ObjectStatusConditionDefinition struct { - LastTransitionTime *string `json:"lastTransitionTime,omitempty"` - Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` -} - -func (o *ObjectStatusConditionDefinition) GetLastTransitionTimeAsTime() (*time.Time, error) { - if o.LastTransitionTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastTransitionTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ObjectStatusConditionDefinition) SetLastTransitionTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastTransitionTime = &formatted -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusdefinition.go deleted file mode 100644 index c6b53f2ca35..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_objectstatusdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ObjectStatusDefinition struct { - AppliedBy *ObjectReferenceDefinition `json:"appliedBy,omitempty"` - ComplianceState *FluxComplianceState `json:"complianceState,omitempty"` - HelmReleaseProperties *HelmReleasePropertiesDefinition `json:"helmReleaseProperties,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` - StatusConditions *[]ObjectStatusConditionDefinition `json:"statusConditions,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_repositoryrefdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_repositoryrefdefinition.go deleted file mode 100644 index d19277db138..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/model_repositoryrefdefinition.go +++ /dev/null @@ -1,11 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RepositoryRefDefinition struct { - Branch *string `json:"branch,omitempty"` - Commit *string `json:"commit,omitempty"` - Semver *string `json:"semver,omitempty"` - Tag *string `json:"tag,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/flux/predicates.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/predicates.go deleted file mode 100644 index 54dfb4c2d8c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package flux - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FluxConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p FluxConfigurationOperationPredicate) Matches(input FluxConfiguration) 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/kubernetesconfiguration/2022-03-01/flux/version.go b/resource-manager/kubernetesconfiguration/2022-03-01/flux/version.go deleted file mode 100644 index b937061da2c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/flux/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package flux - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/flux/%s", defaultApiVersion) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/README.md b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/README.md deleted file mode 100644 index 2bb3f541b25..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration` Documentation - -The `fluxconfiguration` SDK allows for interaction with the Azure Resource Manager Service `kubernetesconfiguration` (API Version `2022-03-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/kubernetesconfiguration/2022-03-01/fluxconfiguration" -``` - - -### Client Initialization - -```go -client := fluxconfiguration.NewFluxConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FluxConfigurationClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := fluxconfiguration.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -payload := fluxconfiguration.FluxConfiguration{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FluxConfigurationClient.Delete` - -```go -ctx := context.TODO() -id := fluxconfiguration.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, fluxconfiguration.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `FluxConfigurationClient.Get` - -```go -ctx := context.TODO() -id := fluxconfiguration.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -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: `FluxConfigurationClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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: `FluxConfigurationClient.Update` - -```go -ctx := context.TODO() -id := fluxconfiguration.NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - -payload := fluxconfiguration.FluxConfigurationPatch{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/client.go deleted file mode 100644 index 742e70f8a2b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package fluxconfiguration - -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 FluxConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewFluxConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*FluxConfigurationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "fluxconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FluxConfigurationClient: %+v", err) - } - - return &FluxConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/constants.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/constants.go deleted file mode 100644 index 672d86aad62..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/constants.go +++ /dev/null @@ -1,195 +0,0 @@ -package fluxconfiguration - -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 FluxComplianceState string - -const ( - FluxComplianceStateCompliant FluxComplianceState = "Compliant" - FluxComplianceStateNonNegativeCompliant FluxComplianceState = "Non-Compliant" - FluxComplianceStatePending FluxComplianceState = "Pending" - FluxComplianceStateSuspended FluxComplianceState = "Suspended" - FluxComplianceStateUnknown FluxComplianceState = "Unknown" -) - -func PossibleValuesForFluxComplianceState() []string { - return []string{ - string(FluxComplianceStateCompliant), - string(FluxComplianceStateNonNegativeCompliant), - string(FluxComplianceStatePending), - string(FluxComplianceStateSuspended), - string(FluxComplianceStateUnknown), - } -} - -func (s *FluxComplianceState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFluxComplianceState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFluxComplianceState(input string) (*FluxComplianceState, error) { - vals := map[string]FluxComplianceState{ - "compliant": FluxComplianceStateCompliant, - "non-compliant": FluxComplianceStateNonNegativeCompliant, - "pending": FluxComplianceStatePending, - "suspended": FluxComplianceStateSuspended, - "unknown": FluxComplianceStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FluxComplianceState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCanceled ProvisioningState = "Canceled" - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCanceled), - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "canceled": ProvisioningStateCanceled, - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ScopeType string - -const ( - ScopeTypeCluster ScopeType = "cluster" - ScopeTypeNamespace ScopeType = "namespace" -) - -func PossibleValuesForScopeType() []string { - return []string{ - string(ScopeTypeCluster), - string(ScopeTypeNamespace), - } -} - -func (s *ScopeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScopeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScopeType(input string) (*ScopeType, error) { - vals := map[string]ScopeType{ - "cluster": ScopeTypeCluster, - "namespace": ScopeTypeNamespace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScopeType(input) - return &out, nil -} - -type SourceKindType string - -const ( - SourceKindTypeBucket SourceKindType = "Bucket" - SourceKindTypeGitRepository SourceKindType = "GitRepository" -) - -func PossibleValuesForSourceKindType() []string { - return []string{ - string(SourceKindTypeBucket), - string(SourceKindTypeGitRepository), - } -} - -func (s *SourceKindType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSourceKindType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSourceKindType(input string) (*SourceKindType, error) { - vals := map[string]SourceKindType{ - "bucket": SourceKindTypeBucket, - "gitrepository": SourceKindTypeGitRepository, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SourceKindType(input) - return &out, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration.go deleted file mode 100644 index 41d3cd66d47..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration.go +++ /dev/null @@ -1,120 +0,0 @@ -package fluxconfiguration - -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(&ScopedFluxConfigurationId{}) -} - -var _ resourceids.ResourceId = &ScopedFluxConfigurationId{} - -// ScopedFluxConfigurationId is a struct representing the Resource ID for a Scoped Flux Configuration -type ScopedFluxConfigurationId struct { - Scope string - FluxConfigurationName string -} - -// NewScopedFluxConfigurationID returns a new ScopedFluxConfigurationId struct -func NewScopedFluxConfigurationID(scope string, fluxConfigurationName string) ScopedFluxConfigurationId { - return ScopedFluxConfigurationId{ - Scope: scope, - FluxConfigurationName: fluxConfigurationName, - } -} - -// ParseScopedFluxConfigurationID parses 'input' into a ScopedFluxConfigurationId -func ParseScopedFluxConfigurationID(input string) (*ScopedFluxConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedFluxConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedFluxConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedFluxConfigurationIDInsensitively parses 'input' case-insensitively into a ScopedFluxConfigurationId -// note: this method should only be used for API response data and not user input -func ParseScopedFluxConfigurationIDInsensitively(input string) (*ScopedFluxConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedFluxConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedFluxConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedFluxConfigurationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.FluxConfigurationName, ok = input.Parsed["fluxConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "fluxConfigurationName", input) - } - - return nil -} - -// ValidateScopedFluxConfigurationID checks that 'input' can be parsed as a Scoped Flux Configuration ID -func ValidateScopedFluxConfigurationID(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 := ParseScopedFluxConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Flux Configuration ID -func (id ScopedFluxConfigurationId) ID() string { - fmtString := "/%s/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.FluxConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Flux Configuration ID -func (id ScopedFluxConfigurationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftKubernetesConfiguration", "Microsoft.KubernetesConfiguration", "Microsoft.KubernetesConfiguration"), - resourceids.StaticSegment("staticFluxConfigurations", "fluxConfigurations", "fluxConfigurations"), - resourceids.UserSpecifiedSegment("fluxConfigurationName", "fluxConfigurationValue"), - } -} - -// String returns a human-readable description of this Scoped Flux Configuration ID -func (id ScopedFluxConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Flux Configuration Name: %q", id.FluxConfigurationName), - } - return fmt.Sprintf("Scoped Flux Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration_test.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration_test.go deleted file mode 100644 index 3e7d649562e..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/id_scopedfluxconfiguration_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package fluxconfiguration - -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 = &ScopedFluxConfigurationId{} - -func TestNewScopedFluxConfigurationID(t *testing.T) { - id := NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.FluxConfigurationName != "fluxConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'FluxConfigurationName'", id.FluxConfigurationName, "fluxConfigurationValue") - } -} - -func TestFormatScopedFluxConfigurationID(t *testing.T) { - actual := NewScopedFluxConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "fluxConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedFluxConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedFluxConfigurationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue", - Expected: &ScopedFluxConfigurationId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - FluxConfigurationName: "fluxConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedFluxConfigurationID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.FluxConfigurationName != v.Expected.FluxConfigurationName { - t.Fatalf("Expected %q but got %q for FluxConfigurationName", v.Expected.FluxConfigurationName, actual.FluxConfigurationName) - } - - } -} - -func TestParseScopedFluxConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedFluxConfigurationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/fLuXcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue", - Expected: &ScopedFluxConfigurationId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - FluxConfigurationName: "fluxConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/fluxConfigurations/fluxConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/fLuXcOnFiGuRaTiOnS/fLuXcOnFiGuRaTiOnVaLuE", - Expected: &ScopedFluxConfigurationId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - FluxConfigurationName: "fLuXcOnFiGuRaTiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/fLuXcOnFiGuRaTiOnS/fLuXcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedFluxConfigurationIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.FluxConfigurationName != v.Expected.FluxConfigurationName { - t.Fatalf("Expected %q but got %q for FluxConfigurationName", v.Expected.FluxConfigurationName, actual.FluxConfigurationName) - } - - } -} - -func TestSegmentsForScopedFluxConfigurationId(t *testing.T) { - segments := ScopedFluxConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedFluxConfigurationId 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/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_createorupdate.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_createorupdate.go deleted file mode 100644 index 2be95e3dc4b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package fluxconfiguration - -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 *FluxConfiguration -} - -// CreateOrUpdate ... -func (c FluxConfigurationClient) CreateOrUpdate(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfiguration) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FluxConfigurationClient) CreateOrUpdateThenPoll(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfiguration) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_delete.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_delete.go deleted file mode 100644 index 2ad43c6f9e6..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package fluxconfiguration - -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 { - ForceDelete *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o DeleteOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.ForceDelete != nil { - out.Append("forceDelete", fmt.Sprintf("%v", *o.ForceDelete)) - } - return &out -} - -// Delete ... -func (c FluxConfigurationClient) Delete(ctx context.Context, id ScopedFluxConfigurationId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 FluxConfigurationClient) DeleteThenPoll(ctx context.Context, id ScopedFluxConfigurationId, 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/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_get.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_get.go deleted file mode 100644 index ecd54c34d07..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package fluxconfiguration - -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 *FluxConfiguration -} - -// Get ... -func (c FluxConfigurationClient) Get(ctx context.Context, id ScopedFluxConfigurationId) (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 FluxConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_list.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_list.go deleted file mode 100644 index dbc486a0248..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package fluxconfiguration - -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 *[]FluxConfiguration -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FluxConfiguration -} - -// List ... -func (c FluxConfigurationClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.KubernetesConfiguration/fluxConfigurations", 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 *[]FluxConfiguration `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 FluxConfigurationClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FluxConfigurationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FluxConfigurationClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate FluxConfigurationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FluxConfiguration, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_update.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_update.go deleted file mode 100644 index ba4eea0a187..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package fluxconfiguration - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FluxConfiguration -} - -// Update ... -func (c FluxConfigurationClient) Update(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfigurationPatch) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c FluxConfigurationClient) UpdateThenPoll(ctx context.Context, id ScopedFluxConfigurationId, input FluxConfigurationPatch) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketdefinition.go deleted file mode 100644 index 32aeb567611..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BucketDefinition struct { - AccessKey *string `json:"accessKey,omitempty"` - BucketName *string `json:"bucketName,omitempty"` - Insecure *bool `json:"insecure,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketpatchdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketpatchdefinition.go deleted file mode 100644 index c75c9e07b2a..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_bucketpatchdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BucketPatchDefinition struct { - AccessKey *string `json:"accessKey,omitempty"` - BucketName *string `json:"bucketName,omitempty"` - Insecure *bool `json:"insecure,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfiguration.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfiguration.go deleted file mode 100644 index d57208cf50a..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -package fluxconfiguration - -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 FluxConfiguration struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FluxConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatch.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatch.go deleted file mode 100644 index 0846300c98c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatch.go +++ /dev/null @@ -1,8 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FluxConfigurationPatch struct { - Properties *FluxConfigurationPatchProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatchproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatchproperties.go deleted file mode 100644 index f8ce62a4dd2..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationpatchproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FluxConfigurationPatchProperties struct { - Bucket *BucketPatchDefinition `json:"bucket,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - GitRepository *GitRepositoryPatchDefinition `json:"gitRepository,omitempty"` - Kustomizations *map[string]KustomizationPatchDefinition `json:"kustomizations,omitempty"` - SourceKind *SourceKindType `json:"sourceKind,omitempty"` - Suspend *bool `json:"suspend,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationproperties.go deleted file mode 100644 index 2eb564692f2..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_fluxconfigurationproperties.go +++ /dev/null @@ -1,53 +0,0 @@ -package fluxconfiguration - -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 FluxConfigurationProperties struct { - Bucket *BucketDefinition `json:"bucket,omitempty"` - ComplianceState *FluxComplianceState `json:"complianceState,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - GitRepository *GitRepositoryDefinition `json:"gitRepository,omitempty"` - Kustomizations *map[string]KustomizationDefinition `json:"kustomizations,omitempty"` - Namespace *string `json:"namespace,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` - Scope *ScopeType `json:"scope,omitempty"` - SourceKind *SourceKindType `json:"sourceKind,omitempty"` - SourceSyncedCommitId *string `json:"sourceSyncedCommitId,omitempty"` - SourceUpdatedAt *string `json:"sourceUpdatedAt,omitempty"` - StatusUpdatedAt *string `json:"statusUpdatedAt,omitempty"` - Statuses *[]ObjectStatusDefinition `json:"statuses,omitempty"` - Suspend *bool `json:"suspend,omitempty"` -} - -func (o *FluxConfigurationProperties) GetSourceUpdatedAtAsTime() (*time.Time, error) { - if o.SourceUpdatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.SourceUpdatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *FluxConfigurationProperties) SetSourceUpdatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.SourceUpdatedAt = &formatted -} - -func (o *FluxConfigurationProperties) GetStatusUpdatedAtAsTime() (*time.Time, error) { - if o.StatusUpdatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StatusUpdatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *FluxConfigurationProperties) SetStatusUpdatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StatusUpdatedAt = &formatted -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorydefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorydefinition.go deleted file mode 100644 index 20a1c6cd45e..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorydefinition.go +++ /dev/null @@ -1,15 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GitRepositoryDefinition struct { - HTTPSCACert *string `json:"httpsCACert,omitempty"` - HTTPSUser *string `json:"httpsUser,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"` - SshKnownHosts *string `json:"sshKnownHosts,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorypatchdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorypatchdefinition.go deleted file mode 100644 index 30e192680a5..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_gitrepositorypatchdefinition.go +++ /dev/null @@ -1,15 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GitRepositoryPatchDefinition struct { - HTTPSCACert *string `json:"httpsCACert,omitempty"` - HTTPSUser *string `json:"httpsUser,omitempty"` - LocalAuthRef *string `json:"localAuthRef,omitempty"` - RepositoryRef *RepositoryRefDefinition `json:"repositoryRef,omitempty"` - SshKnownHosts *string `json:"sshKnownHosts,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_helmreleasepropertiesdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_helmreleasepropertiesdefinition.go deleted file mode 100644 index a5154ff7204..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_helmreleasepropertiesdefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HelmReleasePropertiesDefinition struct { - FailureCount *int64 `json:"failureCount,omitempty"` - HelmChartRef *ObjectReferenceDefinition `json:"helmChartRef,omitempty"` - InstallFailureCount *int64 `json:"installFailureCount,omitempty"` - LastRevisionApplied *int64 `json:"lastRevisionApplied,omitempty"` - UpgradeFailureCount *int64 `json:"upgradeFailureCount,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationdefinition.go deleted file mode 100644 index f290effccf3..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationdefinition.go +++ /dev/null @@ -1,15 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KustomizationDefinition struct { - DependsOn *[]string `json:"dependsOn,omitempty"` - Force *bool `json:"force,omitempty"` - Name *string `json:"name,omitempty"` - Path *string `json:"path,omitempty"` - Prune *bool `json:"prune,omitempty"` - RetryIntervalInSeconds *int64 `json:"retryIntervalInSeconds,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationpatchdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationpatchdefinition.go deleted file mode 100644 index 988a0b73b93..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_kustomizationpatchdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KustomizationPatchDefinition struct { - DependsOn *[]string `json:"dependsOn,omitempty"` - Force *bool `json:"force,omitempty"` - Path *string `json:"path,omitempty"` - Prune *bool `json:"prune,omitempty"` - RetryIntervalInSeconds *int64 `json:"retryIntervalInSeconds,omitempty"` - SyncIntervalInSeconds *int64 `json:"syncIntervalInSeconds,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectreferencedefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectreferencedefinition.go deleted file mode 100644 index 50c2cf759b8..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectreferencedefinition.go +++ /dev/null @@ -1,9 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ObjectReferenceDefinition struct { - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusconditiondefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusconditiondefinition.go deleted file mode 100644 index 44bf564fb39..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusconditiondefinition.go +++ /dev/null @@ -1,30 +0,0 @@ -package fluxconfiguration - -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 ObjectStatusConditionDefinition struct { - LastTransitionTime *string `json:"lastTransitionTime,omitempty"` - Message *string `json:"message,omitempty"` - Reason *string `json:"reason,omitempty"` - Status *string `json:"status,omitempty"` - Type *string `json:"type,omitempty"` -} - -func (o *ObjectStatusConditionDefinition) GetLastTransitionTimeAsTime() (*time.Time, error) { - if o.LastTransitionTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastTransitionTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ObjectStatusConditionDefinition) SetLastTransitionTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastTransitionTime = &formatted -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusdefinition.go deleted file mode 100644 index c3e90eccbea..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_objectstatusdefinition.go +++ /dev/null @@ -1,14 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ObjectStatusDefinition struct { - AppliedBy *ObjectReferenceDefinition `json:"appliedBy,omitempty"` - ComplianceState *FluxComplianceState `json:"complianceState,omitempty"` - HelmReleaseProperties *HelmReleasePropertiesDefinition `json:"helmReleaseProperties,omitempty"` - Kind *string `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Namespace *string `json:"namespace,omitempty"` - StatusConditions *[]ObjectStatusConditionDefinition `json:"statusConditions,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_repositoryrefdefinition.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_repositoryrefdefinition.go deleted file mode 100644 index 4ce9209ae2b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/model_repositoryrefdefinition.go +++ /dev/null @@ -1,11 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RepositoryRefDefinition struct { - Branch *string `json:"branch,omitempty"` - Commit *string `json:"commit,omitempty"` - Semver *string `json:"semver,omitempty"` - Tag *string `json:"tag,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/predicates.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/predicates.go deleted file mode 100644 index 726a4ce8788..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package fluxconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FluxConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p FluxConfigurationOperationPredicate) Matches(input FluxConfiguration) 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/kubernetesconfiguration/2022-03-01/fluxconfiguration/version.go b/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/version.go deleted file mode 100644 index 1e8b4426ca5..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/fluxconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package fluxconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/fluxconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/README.md b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/README.md deleted file mode 100644 index 3a70010c0b6..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster` Documentation - -The `operationsinacluster` SDK allows for interaction with the Azure Resource Manager Service `kubernetesconfiguration` (API Version `2022-03-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/kubernetesconfiguration/2022-03-01/operationsinacluster" -``` - - -### Client Initialization - -```go -client := operationsinacluster.NewOperationsInAClusterClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OperationsInAClusterClient.OperationStatusList` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// alternatively `client.OperationStatusList(ctx, id)` can be used to do batched pagination -items, err := client.OperationStatusListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/client.go deleted file mode 100644 index f364711cd9b..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package operationsinacluster - -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 OperationsInAClusterClient struct { - Client *resourcemanager.Client -} - -func NewOperationsInAClusterClientWithBaseURI(sdkApi sdkEnv.Api) (*OperationsInAClusterClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "operationsinacluster", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating OperationsInAClusterClient: %+v", err) - } - - return &OperationsInAClusterClient{ - Client: client, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/method_operationstatuslist.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/method_operationstatuslist.go deleted file mode 100644 index 7d9daf1c9b9..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/method_operationstatuslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package operationsinacluster - -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 OperationStatusListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]OperationStatusResult -} - -type OperationStatusListCompleteResult struct { - LatestHttpResponse *http.Response - Items []OperationStatusResult -} - -// OperationStatusList ... -func (c OperationsInAClusterClient) OperationStatusList(ctx context.Context, id commonids.ScopeId) (result OperationStatusListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.KubernetesConfiguration/operations", 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 *[]OperationStatusResult `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// OperationStatusListComplete retrieves all the results into a single object -func (c OperationsInAClusterClient) OperationStatusListComplete(ctx context.Context, id commonids.ScopeId) (OperationStatusListCompleteResult, error) { - return c.OperationStatusListCompleteMatchingPredicate(ctx, id, OperationStatusResultOperationPredicate{}) -} - -// OperationStatusListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OperationsInAClusterClient) OperationStatusListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate OperationStatusResultOperationPredicate) (result OperationStatusListCompleteResult, err error) { - items := make([]OperationStatusResult, 0) - - resp, err := c.OperationStatusList(ctx, id) - if err != nil { - 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 = OperationStatusListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_erroradditionalinfo.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_erroradditionalinfo.go deleted file mode 100644 index 0a4beb6a226..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_erroradditionalinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package operationsinacluster - -// 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/kubernetesconfiguration/2022-03-01/operationsinacluster/model_errordetail.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_errordetail.go deleted file mode 100644 index 4f9db697a30..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_errordetail.go +++ /dev/null @@ -1,12 +0,0 @@ -package operationsinacluster - -// 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/kubernetesconfiguration/2022-03-01/operationsinacluster/model_operationstatusresult.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_operationstatusresult.go deleted file mode 100644 index c898afed3e1..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/model_operationstatusresult.go +++ /dev/null @@ -1,12 +0,0 @@ -package operationsinacluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OperationStatusResult struct { - Error *ErrorDetail `json:"error,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *map[string]string `json:"properties,omitempty"` - Status string `json:"status"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/predicates.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/predicates.go deleted file mode 100644 index 2b12fb09288..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package operationsinacluster - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OperationStatusResultOperationPredicate struct { - Id *string - Name *string - Status *string -} - -func (p OperationStatusResultOperationPredicate) Matches(input OperationStatusResult) 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.Status != nil && *p.Status != input.Status { - return false - } - - return true -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/version.go b/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/version.go deleted file mode 100644 index 1df22af474a..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/operationsinacluster/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package operationsinacluster - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/operationsinacluster/%s", defaultApiVersion) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/README.md b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/README.md deleted file mode 100644 index 5d2ae784ccb..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/README.md +++ /dev/null @@ -1,87 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration` Documentation - -The `sourcecontrolconfiguration` SDK allows for interaction with the Azure Resource Manager Service `kubernetesconfiguration` (API Version `2022-03-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/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration" -``` - - -### Client Initialization - -```go -client := sourcecontrolconfiguration.NewSourceControlConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SourceControlConfigurationClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := sourcecontrolconfiguration.NewScopedSourceControlConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "sourceControlConfigurationValue") - -payload := sourcecontrolconfiguration.SourceControlConfiguration{ - // ... -} - - -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: `SourceControlConfigurationClient.Delete` - -```go -ctx := context.TODO() -id := sourcecontrolconfiguration.NewScopedSourceControlConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "sourceControlConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SourceControlConfigurationClient.Get` - -```go -ctx := context.TODO() -id := sourcecontrolconfiguration.NewScopedSourceControlConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "sourceControlConfigurationValue") - -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: `SourceControlConfigurationClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/client.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/client.go deleted file mode 100644 index c97f0d63f9c..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sourcecontrolconfiguration - -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 SourceControlConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewSourceControlConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*SourceControlConfigurationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sourcecontrolconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SourceControlConfigurationClient: %+v", err) - } - - return &SourceControlConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/constants.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/constants.go deleted file mode 100644 index 6cd6708fbf3..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/constants.go +++ /dev/null @@ -1,233 +0,0 @@ -package sourcecontrolconfiguration - -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 ComplianceStateType string - -const ( - ComplianceStateTypeCompliant ComplianceStateType = "Compliant" - ComplianceStateTypeFailed ComplianceStateType = "Failed" - ComplianceStateTypeInstalled ComplianceStateType = "Installed" - ComplianceStateTypeNoncompliant ComplianceStateType = "Noncompliant" - ComplianceStateTypePending ComplianceStateType = "Pending" -) - -func PossibleValuesForComplianceStateType() []string { - return []string{ - string(ComplianceStateTypeCompliant), - string(ComplianceStateTypeFailed), - string(ComplianceStateTypeInstalled), - string(ComplianceStateTypeNoncompliant), - string(ComplianceStateTypePending), - } -} - -func (s *ComplianceStateType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseComplianceStateType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseComplianceStateType(input string) (*ComplianceStateType, error) { - vals := map[string]ComplianceStateType{ - "compliant": ComplianceStateTypeCompliant, - "failed": ComplianceStateTypeFailed, - "installed": ComplianceStateTypeInstalled, - "noncompliant": ComplianceStateTypeNoncompliant, - "pending": ComplianceStateTypePending, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ComplianceStateType(input) - return &out, nil -} - -type MessageLevelType string - -const ( - MessageLevelTypeError MessageLevelType = "Error" - MessageLevelTypeInformation MessageLevelType = "Information" - MessageLevelTypeWarning MessageLevelType = "Warning" -) - -func PossibleValuesForMessageLevelType() []string { - return []string{ - string(MessageLevelTypeError), - string(MessageLevelTypeInformation), - string(MessageLevelTypeWarning), - } -} - -func (s *MessageLevelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMessageLevelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMessageLevelType(input string) (*MessageLevelType, error) { - vals := map[string]MessageLevelType{ - "error": MessageLevelTypeError, - "information": MessageLevelTypeInformation, - "warning": MessageLevelTypeWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MessageLevelType(input) - return &out, nil -} - -type OperatorScopeType string - -const ( - OperatorScopeTypeCluster OperatorScopeType = "cluster" - OperatorScopeTypeNamespace OperatorScopeType = "namespace" -) - -func PossibleValuesForOperatorScopeType() []string { - return []string{ - string(OperatorScopeTypeCluster), - string(OperatorScopeTypeNamespace), - } -} - -func (s *OperatorScopeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperatorScopeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperatorScopeType(input string) (*OperatorScopeType, error) { - vals := map[string]OperatorScopeType{ - "cluster": OperatorScopeTypeCluster, - "namespace": OperatorScopeTypeNamespace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OperatorScopeType(input) - return &out, nil -} - -type OperatorType string - -const ( - OperatorTypeFlux OperatorType = "Flux" -) - -func PossibleValuesForOperatorType() []string { - return []string{ - string(OperatorTypeFlux), - } -} - -func (s *OperatorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperatorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperatorType(input string) (*OperatorType, error) { - vals := map[string]OperatorType{ - "flux": OperatorTypeFlux, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OperatorType(input) - return &out, nil -} - -type ProvisioningStateType string - -const ( - ProvisioningStateTypeAccepted ProvisioningStateType = "Accepted" - ProvisioningStateTypeDeleting ProvisioningStateType = "Deleting" - ProvisioningStateTypeFailed ProvisioningStateType = "Failed" - ProvisioningStateTypeRunning ProvisioningStateType = "Running" - ProvisioningStateTypeSucceeded ProvisioningStateType = "Succeeded" -) - -func PossibleValuesForProvisioningStateType() []string { - return []string{ - string(ProvisioningStateTypeAccepted), - string(ProvisioningStateTypeDeleting), - string(ProvisioningStateTypeFailed), - string(ProvisioningStateTypeRunning), - string(ProvisioningStateTypeSucceeded), - } -} - -func (s *ProvisioningStateType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningStateType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningStateType(input string) (*ProvisioningStateType, error) { - vals := map[string]ProvisioningStateType{ - "accepted": ProvisioningStateTypeAccepted, - "deleting": ProvisioningStateTypeDeleting, - "failed": ProvisioningStateTypeFailed, - "running": ProvisioningStateTypeRunning, - "succeeded": ProvisioningStateTypeSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningStateType(input) - return &out, nil -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration.go deleted file mode 100644 index 26f9cc1092a..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration.go +++ /dev/null @@ -1,120 +0,0 @@ -package sourcecontrolconfiguration - -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(&ScopedSourceControlConfigurationId{}) -} - -var _ resourceids.ResourceId = &ScopedSourceControlConfigurationId{} - -// ScopedSourceControlConfigurationId is a struct representing the Resource ID for a Scoped Source Control Configuration -type ScopedSourceControlConfigurationId struct { - Scope string - SourceControlConfigurationName string -} - -// NewScopedSourceControlConfigurationID returns a new ScopedSourceControlConfigurationId struct -func NewScopedSourceControlConfigurationID(scope string, sourceControlConfigurationName string) ScopedSourceControlConfigurationId { - return ScopedSourceControlConfigurationId{ - Scope: scope, - SourceControlConfigurationName: sourceControlConfigurationName, - } -} - -// ParseScopedSourceControlConfigurationID parses 'input' into a ScopedSourceControlConfigurationId -func ParseScopedSourceControlConfigurationID(input string) (*ScopedSourceControlConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedSourceControlConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedSourceControlConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedSourceControlConfigurationIDInsensitively parses 'input' case-insensitively into a ScopedSourceControlConfigurationId -// note: this method should only be used for API response data and not user input -func ParseScopedSourceControlConfigurationIDInsensitively(input string) (*ScopedSourceControlConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedSourceControlConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedSourceControlConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedSourceControlConfigurationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.SourceControlConfigurationName, ok = input.Parsed["sourceControlConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "sourceControlConfigurationName", input) - } - - return nil -} - -// ValidateScopedSourceControlConfigurationID checks that 'input' can be parsed as a Scoped Source Control Configuration ID -func ValidateScopedSourceControlConfigurationID(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 := ParseScopedSourceControlConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Source Control Configuration ID -func (id ScopedSourceControlConfigurationId) ID() string { - fmtString := "/%s/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.SourceControlConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Source Control Configuration ID -func (id ScopedSourceControlConfigurationId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftKubernetesConfiguration", "Microsoft.KubernetesConfiguration", "Microsoft.KubernetesConfiguration"), - resourceids.StaticSegment("staticSourceControlConfigurations", "sourceControlConfigurations", "sourceControlConfigurations"), - resourceids.UserSpecifiedSegment("sourceControlConfigurationName", "sourceControlConfigurationValue"), - } -} - -// String returns a human-readable description of this Scoped Source Control Configuration ID -func (id ScopedSourceControlConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Source Control Configuration Name: %q", id.SourceControlConfigurationName), - } - return fmt.Sprintf("Scoped Source Control Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration_test.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration_test.go deleted file mode 100644 index 714b797570a..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/id_scopedsourcecontrolconfiguration_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package sourcecontrolconfiguration - -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 = &ScopedSourceControlConfigurationId{} - -func TestNewScopedSourceControlConfigurationID(t *testing.T) { - id := NewScopedSourceControlConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "sourceControlConfigurationValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.SourceControlConfigurationName != "sourceControlConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SourceControlConfigurationName'", id.SourceControlConfigurationName, "sourceControlConfigurationValue") - } -} - -func TestFormatScopedSourceControlConfigurationID(t *testing.T) { - actual := NewScopedSourceControlConfigurationID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "sourceControlConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/sourceControlConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedSourceControlConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedSourceControlConfigurationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/sourceControlConfigurationValue", - Expected: &ScopedSourceControlConfigurationId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - SourceControlConfigurationName: "sourceControlConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/sourceControlConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedSourceControlConfigurationID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.SourceControlConfigurationName != v.Expected.SourceControlConfigurationName { - t.Fatalf("Expected %q but got %q for SourceControlConfigurationName", v.Expected.SourceControlConfigurationName, actual.SourceControlConfigurationName) - } - - } -} - -func TestParseScopedSourceControlConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedSourceControlConfigurationId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/sOuRcEcOnTrOlCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/sourceControlConfigurationValue", - Expected: &ScopedSourceControlConfigurationId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - SourceControlConfigurationName: "sourceControlConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations/sourceControlConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/sOuRcEcOnTrOlCoNfIgUrAtIoNs/sOuRcEcOnTrOlCoNfIgUrAtIoNvAlUe", - Expected: &ScopedSourceControlConfigurationId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - SourceControlConfigurationName: "sOuRcEcOnTrOlCoNfIgUrAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.kUbErNeTeScOnFiGuRaTiOn/sOuRcEcOnTrOlCoNfIgUrAtIoNs/sOuRcEcOnTrOlCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedSourceControlConfigurationIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.SourceControlConfigurationName != v.Expected.SourceControlConfigurationName { - t.Fatalf("Expected %q but got %q for SourceControlConfigurationName", v.Expected.SourceControlConfigurationName, actual.SourceControlConfigurationName) - } - - } -} - -func TestSegmentsForScopedSourceControlConfigurationId(t *testing.T) { - segments := ScopedSourceControlConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedSourceControlConfigurationId 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/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_createorupdate.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_createorupdate.go deleted file mode 100644 index b07014d22d1..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package sourcecontrolconfiguration - -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 *SourceControlConfiguration -} - -// CreateOrUpdate ... -func (c SourceControlConfigurationClient) CreateOrUpdate(ctx context.Context, id ScopedSourceControlConfigurationId, input SourceControlConfiguration) (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 SourceControlConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_delete.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_delete.go deleted file mode 100644 index b406a12d32f..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package sourcecontrolconfiguration - -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 SourceControlConfigurationClient) Delete(ctx context.Context, id ScopedSourceControlConfigurationId) (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 SourceControlConfigurationClient) DeleteThenPoll(ctx context.Context, id ScopedSourceControlConfigurationId) 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/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_get.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_get.go deleted file mode 100644 index 11cf0be3aaf..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package sourcecontrolconfiguration - -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 *SourceControlConfiguration -} - -// Get ... -func (c SourceControlConfigurationClient) Get(ctx context.Context, id ScopedSourceControlConfigurationId) (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 SourceControlConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_list.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_list.go deleted file mode 100644 index 38544636910..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package sourcecontrolconfiguration - -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 *[]SourceControlConfiguration -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SourceControlConfiguration -} - -// List ... -func (c SourceControlConfigurationClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.KubernetesConfiguration/sourceControlConfigurations", 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 *[]SourceControlConfiguration `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 SourceControlConfigurationClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SourceControlConfigurationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SourceControlConfigurationClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate SourceControlConfigurationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SourceControlConfiguration, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_compliancestatus.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_compliancestatus.go deleted file mode 100644 index f7bd89eacab..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_compliancestatus.go +++ /dev/null @@ -1,29 +0,0 @@ -package sourcecontrolconfiguration - -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 ComplianceStatus struct { - ComplianceState *ComplianceStateType `json:"complianceState,omitempty"` - LastConfigApplied *string `json:"lastConfigApplied,omitempty"` - Message *string `json:"message,omitempty"` - MessageLevel *MessageLevelType `json:"messageLevel,omitempty"` -} - -func (o *ComplianceStatus) GetLastConfigAppliedAsTime() (*time.Time, error) { - if o.LastConfigApplied == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastConfigApplied, "2006-01-02T15:04:05Z07:00") -} - -func (o *ComplianceStatus) SetLastConfigAppliedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastConfigApplied = &formatted -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_helmoperatorproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_helmoperatorproperties.go deleted file mode 100644 index 4a69ea375c6..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_helmoperatorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package sourcecontrolconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HelmOperatorProperties struct { - ChartValues *string `json:"chartValues,omitempty"` - ChartVersion *string `json:"chartVersion,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfiguration.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfiguration.go deleted file mode 100644 index 5b8d63b0c49..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -package sourcecontrolconfiguration - -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 SourceControlConfiguration struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SourceControlConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go deleted file mode 100644 index dd979aadd87..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/model_sourcecontrolconfigurationproperties.go +++ /dev/null @@ -1,20 +0,0 @@ -package sourcecontrolconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceControlConfigurationProperties struct { - ComplianceStatus *ComplianceStatus `json:"complianceStatus,omitempty"` - ConfigurationProtectedSettings *map[string]string `json:"configurationProtectedSettings,omitempty"` - EnableHelmOperator *bool `json:"enableHelmOperator,omitempty"` - HelmOperatorProperties *HelmOperatorProperties `json:"helmOperatorProperties,omitempty"` - OperatorInstanceName *string `json:"operatorInstanceName,omitempty"` - OperatorNamespace *string `json:"operatorNamespace,omitempty"` - OperatorParams *string `json:"operatorParams,omitempty"` - OperatorScope *OperatorScopeType `json:"operatorScope,omitempty"` - OperatorType *OperatorType `json:"operatorType,omitempty"` - ProvisioningState *ProvisioningStateType `json:"provisioningState,omitempty"` - RepositoryPublicKey *string `json:"repositoryPublicKey,omitempty"` - RepositoryUrl *string `json:"repositoryUrl,omitempty"` - SshKnownHostsContents *string `json:"sshKnownHostsContents,omitempty"` -} diff --git a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/predicates.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/predicates.go deleted file mode 100644 index 8d35e4a34d4..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package sourcecontrolconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceControlConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p SourceControlConfigurationOperationPredicate) Matches(input SourceControlConfiguration) 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/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/version.go b/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/version.go deleted file mode 100644 index b933b056168..00000000000 --- a/resource-manager/kubernetesconfiguration/2022-03-01/sourcecontrolconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package sourcecontrolconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-03-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/sourcecontrolconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/labservices/2021-10-01-preview/client.go b/resource-manager/labservices/2021-10-01-preview/client.go deleted file mode 100644 index e81eebad438..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/client.go +++ /dev/null @@ -1,73 +0,0 @@ -package v2021_10_01_preview - -// 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/labservices/2021-10-01-preview/image" - "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/lab" - "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/labplan" - "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/schedule" - "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/user" - "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/virtualmachine" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Image *image.ImageClient - Lab *lab.LabClient - LabPlan *labplan.LabPlanClient - Schedule *schedule.ScheduleClient - User *user.UserClient - VirtualMachine *virtualmachine.VirtualMachineClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - imageClient, err := image.NewImageClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Image client: %+v", err) - } - configureFunc(imageClient.Client) - - labClient, err := lab.NewLabClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Lab client: %+v", err) - } - configureFunc(labClient.Client) - - labPlanClient, err := labplan.NewLabPlanClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LabPlan client: %+v", err) - } - configureFunc(labPlanClient.Client) - - scheduleClient, err := schedule.NewScheduleClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Schedule client: %+v", err) - } - configureFunc(scheduleClient.Client) - - userClient, err := user.NewUserClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building User client: %+v", err) - } - configureFunc(userClient.Client) - - virtualMachineClient, err := virtualmachine.NewVirtualMachineClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualMachine client: %+v", err) - } - configureFunc(virtualMachineClient.Client) - - return &Client{ - Image: imageClient, - Lab: labClient, - LabPlan: labPlanClient, - Schedule: scheduleClient, - User: userClient, - VirtualMachine: virtualMachineClient, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/README.md b/resource-manager/labservices/2021-10-01-preview/image/README.md deleted file mode 100644 index 868beba5af7..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/README.md +++ /dev/null @@ -1,95 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/image` Documentation - -The `image` SDK allows for interaction with the Azure Resource Manager Service `labservices` (API Version `2021-10-01-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/labservices/2021-10-01-preview/image" -``` - - -### Client Initialization - -```go -client := image.NewImageClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ImageClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := image.NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue", "imageValue") - -payload := image.Image{ - // ... -} - - -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: `ImageClient.Get` - -```go -ctx := context.TODO() -id := image.NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue", "imageValue") - -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: `ImageClient.ListByLabPlan` - -```go -ctx := context.TODO() -id := image.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - -// alternatively `client.ListByLabPlan(ctx, id)` can be used to do batched pagination -items, err := client.ListByLabPlanComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ImageClient.Update` - -```go -ctx := context.TODO() -id := image.NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue", "imageValue") - -payload := image.ImageUpdate{ - // ... -} - - -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/labservices/2021-10-01-preview/image/client.go b/resource-manager/labservices/2021-10-01-preview/image/client.go deleted file mode 100644 index 7b3305e5bb3..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package image - -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 ImageClient struct { - Client *resourcemanager.Client -} - -func NewImageClientWithBaseURI(sdkApi sdkEnv.Api) (*ImageClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "image", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ImageClient: %+v", err) - } - - return &ImageClient{ - Client: client, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/constants.go b/resource-manager/labservices/2021-10-01-preview/image/constants.go deleted file mode 100644 index 44ec9fceae0..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/constants.go +++ /dev/null @@ -1,186 +0,0 @@ -package image - -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 EnableState string - -const ( - EnableStateDisabled EnableState = "Disabled" - EnableStateEnabled EnableState = "Enabled" -) - -func PossibleValuesForEnableState() []string { - return []string{ - string(EnableStateDisabled), - string(EnableStateEnabled), - } -} - -func (s *EnableState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEnableState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEnableState(input string) (*EnableState, error) { - vals := map[string]EnableState{ - "disabled": EnableStateDisabled, - "enabled": EnableStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableState(input) - return &out, nil -} - -type OsState string - -const ( - OsStateGeneralized OsState = "Generalized" - OsStateSpecialized OsState = "Specialized" -) - -func PossibleValuesForOsState() []string { - return []string{ - string(OsStateGeneralized), - string(OsStateSpecialized), - } -} - -func (s *OsState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOsState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOsState(input string) (*OsState, error) { - vals := map[string]OsState{ - "generalized": OsStateGeneralized, - "specialized": OsStateSpecialized, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OsState(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 ProvisioningState string - -const ( - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateLocked ProvisioningState = "Locked" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateLocked), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "locked": ProvisioningStateLocked, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/id_image.go b/resource-manager/labservices/2021-10-01-preview/image/id_image.go deleted file mode 100644 index bbef75cc687..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/id_image.go +++ /dev/null @@ -1,139 +0,0 @@ -package image - -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(&ImageId{}) -} - -var _ resourceids.ResourceId = &ImageId{} - -// ImageId is a struct representing the Resource ID for a Image -type ImageId struct { - SubscriptionId string - ResourceGroupName string - LabPlanName string - ImageName string -} - -// NewImageID returns a new ImageId struct -func NewImageID(subscriptionId string, resourceGroupName string, labPlanName string, imageName string) ImageId { - return ImageId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabPlanName: labPlanName, - ImageName: imageName, - } -} - -// ParseImageID parses 'input' into a ImageId -func ParseImageID(input string) (*ImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&ImageId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ImageId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseImageIDInsensitively parses 'input' case-insensitively into a ImageId -// note: this method should only be used for API response data and not user input -func ParseImageIDInsensitively(input string) (*ImageId, error) { - parser := resourceids.NewParserFromResourceIdType(&ImageId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ImageId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ImageId) 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.LabPlanName, ok = input.Parsed["labPlanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labPlanName", input) - } - - if id.ImageName, ok = input.Parsed["imageName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "imageName", input) - } - - return nil -} - -// ValidateImageID checks that 'input' can be parsed as a Image ID -func ValidateImageID(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 := ParseImageID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Image ID -func (id ImageId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labPlans/%s/images/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabPlanName, id.ImageName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Image ID -func (id ImageId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabPlans", "labPlans", "labPlans"), - resourceids.UserSpecifiedSegment("labPlanName", "labPlanValue"), - resourceids.StaticSegment("staticImages", "images", "images"), - resourceids.UserSpecifiedSegment("imageName", "imageValue"), - } -} - -// String returns a human-readable description of this Image ID -func (id ImageId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Plan Name: %q", id.LabPlanName), - fmt.Sprintf("Image Name: %q", id.ImageName), - } - return fmt.Sprintf("Image (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/id_image_test.go b/resource-manager/labservices/2021-10-01-preview/image/id_image_test.go deleted file mode 100644 index 4c4bdf2dbd4..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/id_image_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package image - -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 = &ImageId{} - -func TestNewImageID(t *testing.T) { - id := NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue", "imageValue") - - 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.LabPlanName != "labPlanValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabPlanName'", id.LabPlanName, "labPlanValue") - } - - if id.ImageName != "imageValue" { - t.Fatalf("Expected %q but got %q for Segment 'ImageName'", id.ImageName, "imageValue") - } -} - -func TestFormatImageID(t *testing.T) { - actual := NewImageID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue", "imageValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images/imageValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseImageID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ImageId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images/imageValue", - Expected: &ImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - ImageName: "imageValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images/imageValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseImageID(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - if actual.ImageName != v.Expected.ImageName { - t.Fatalf("Expected %q but got %q for ImageName", v.Expected.ImageName, actual.ImageName) - } - - } -} - -func TestParseImageIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ImageId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE/iMaGeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images/imageValue", - Expected: &ImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - ImageName: "imageValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/images/imageValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE/iMaGeS/iMaGeVaLuE", - Expected: &ImageId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabPlanName: "lAbPlAnVaLuE", - ImageName: "iMaGeVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE/iMaGeS/iMaGeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseImageIDInsensitively(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - if actual.ImageName != v.Expected.ImageName { - t.Fatalf("Expected %q but got %q for ImageName", v.Expected.ImageName, actual.ImageName) - } - - } -} - -func TestSegmentsForImageId(t *testing.T) { - segments := ImageId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ImageId 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/labservices/2021-10-01-preview/image/id_labplan.go b/resource-manager/labservices/2021-10-01-preview/image/id_labplan.go deleted file mode 100644 index 84f52488353..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/id_labplan.go +++ /dev/null @@ -1,130 +0,0 @@ -package image - -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(&LabPlanId{}) -} - -var _ resourceids.ResourceId = &LabPlanId{} - -// LabPlanId is a struct representing the Resource ID for a Lab Plan -type LabPlanId struct { - SubscriptionId string - ResourceGroupName string - LabPlanName string -} - -// NewLabPlanID returns a new LabPlanId struct -func NewLabPlanID(subscriptionId string, resourceGroupName string, labPlanName string) LabPlanId { - return LabPlanId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabPlanName: labPlanName, - } -} - -// ParseLabPlanID parses 'input' into a LabPlanId -func ParseLabPlanID(input string) (*LabPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabPlanId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabPlanIDInsensitively parses 'input' case-insensitively into a LabPlanId -// note: this method should only be used for API response data and not user input -func ParseLabPlanIDInsensitively(input string) (*LabPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabPlanId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabPlanId) 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.LabPlanName, ok = input.Parsed["labPlanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labPlanName", input) - } - - return nil -} - -// ValidateLabPlanID checks that 'input' can be parsed as a Lab Plan ID -func ValidateLabPlanID(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 := ParseLabPlanID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab Plan ID -func (id LabPlanId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labPlans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabPlanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab Plan ID -func (id LabPlanId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabPlans", "labPlans", "labPlans"), - resourceids.UserSpecifiedSegment("labPlanName", "labPlanValue"), - } -} - -// String returns a human-readable description of this Lab Plan ID -func (id LabPlanId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Plan Name: %q", id.LabPlanName), - } - return fmt.Sprintf("Lab Plan (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/id_labplan_test.go b/resource-manager/labservices/2021-10-01-preview/image/id_labplan_test.go deleted file mode 100644 index 1a7515f684e..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/id_labplan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package image - -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 = &LabPlanId{} - -func TestNewLabPlanID(t *testing.T) { - id := NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - - 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.LabPlanName != "labPlanValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabPlanName'", id.LabPlanName, "labPlanValue") - } -} - -func TestFormatLabPlanID(t *testing.T) { - actual := NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabPlanID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabPlanId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabPlanID(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - } -} - -func TestParseLabPlanIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabPlanId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabPlanName: "lAbPlAnVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabPlanIDInsensitively(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - } -} - -func TestSegmentsForLabPlanId(t *testing.T) { - segments := LabPlanId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabPlanId 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/labservices/2021-10-01-preview/image/method_createorupdate.go b/resource-manager/labservices/2021-10-01-preview/image/method_createorupdate.go deleted file mode 100644 index ae107d33bf0..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/method_createorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package image - -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 *Image -} - -// CreateOrUpdate ... -func (c ImageClient) CreateOrUpdate(ctx context.Context, id ImageId, input Image) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Image - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/method_get.go b/resource-manager/labservices/2021-10-01-preview/image/method_get.go deleted file mode 100644 index 5eeea163f5b..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package image - -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 *Image -} - -// Get ... -func (c ImageClient) Get(ctx context.Context, id ImageId) (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 Image - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/method_listbylabplan.go b/resource-manager/labservices/2021-10-01-preview/image/method_listbylabplan.go deleted file mode 100644 index 0236916ec3c..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/method_listbylabplan.go +++ /dev/null @@ -1,91 +0,0 @@ -package image - -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 ListByLabPlanOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Image -} - -type ListByLabPlanCompleteResult struct { - LatestHttpResponse *http.Response - Items []Image -} - -// ListByLabPlan ... -func (c ImageClient) ListByLabPlan(ctx context.Context, id LabPlanId) (result ListByLabPlanOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/images", 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 *[]Image `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByLabPlanComplete retrieves all the results into a single object -func (c ImageClient) ListByLabPlanComplete(ctx context.Context, id LabPlanId) (ListByLabPlanCompleteResult, error) { - return c.ListByLabPlanCompleteMatchingPredicate(ctx, id, ImageOperationPredicate{}) -} - -// ListByLabPlanCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ImageClient) ListByLabPlanCompleteMatchingPredicate(ctx context.Context, id LabPlanId, predicate ImageOperationPredicate) (result ListByLabPlanCompleteResult, err error) { - items := make([]Image, 0) - - resp, err := c.ListByLabPlan(ctx, id) - if err != nil { - 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 = ListByLabPlanCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/method_update.go b/resource-manager/labservices/2021-10-01-preview/image/method_update.go deleted file mode 100644 index 5dcdad72c91..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package image - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Image -} - -// Update ... -func (c ImageClient) Update(ctx context.Context, id ImageId, input ImageUpdate) (result UpdateOperationResponse, 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 Image - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/model_image.go b/resource-manager/labservices/2021-10-01-preview/image/model_image.go deleted file mode 100644 index b4ee240b643..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/model_image.go +++ /dev/null @@ -1,16 +0,0 @@ -package image - -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 Image struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ImageProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/model_imageproperties.go b/resource-manager/labservices/2021-10-01-preview/image/model_imageproperties.go deleted file mode 100644 index 2a17e6bfd69..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/model_imageproperties.go +++ /dev/null @@ -1,23 +0,0 @@ -package image - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageProperties struct { - Author *string `json:"author,omitempty"` - AvailableRegions *[]string `json:"availableRegions,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EnabledState *EnableState `json:"enabledState,omitempty"` - IconUrl *string `json:"iconUrl,omitempty"` - Offer *string `json:"offer,omitempty"` - OsState *OsState `json:"osState,omitempty"` - OsType *OsType `json:"osType,omitempty"` - Plan *string `json:"plan,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Publisher *string `json:"publisher,omitempty"` - SharedGalleryId *string `json:"sharedGalleryId,omitempty"` - Sku *string `json:"sku,omitempty"` - TermsStatus *EnableState `json:"termsStatus,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/model_imageupdate.go b/resource-manager/labservices/2021-10-01-preview/image/model_imageupdate.go deleted file mode 100644 index 220c67fb3e2..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/model_imageupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package image - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageUpdate struct { - Properties *ImageUpdateProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/model_imageupdateproperties.go b/resource-manager/labservices/2021-10-01-preview/image/model_imageupdateproperties.go deleted file mode 100644 index da1b639fc29..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/model_imageupdateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package image - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageUpdateProperties struct { - EnabledState *EnableState `json:"enabledState,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/image/predicates.go b/resource-manager/labservices/2021-10-01-preview/image/predicates.go deleted file mode 100644 index 9b67b8bdf94..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package image - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ImageOperationPredicate) Matches(input Image) 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/labservices/2021-10-01-preview/image/version.go b/resource-manager/labservices/2021-10-01-preview/image/version.go deleted file mode 100644 index d5bf4cc199e..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/image/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package image - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/image/%s", defaultApiVersion) -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/README.md b/resource-manager/labservices/2021-10-01-preview/lab/README.md deleted file mode 100644 index b69a97e6066..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/README.md +++ /dev/null @@ -1,141 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/lab` Documentation - -The `lab` SDK allows for interaction with the Azure Resource Manager Service `labservices` (API Version `2021-10-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/lab" -``` - - -### Client Initialization - -```go -client := lab.NewLabClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LabClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := lab.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -payload := lab.Lab{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LabClient.Delete` - -```go -ctx := context.TODO() -id := lab.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LabClient.Get` - -```go -ctx := context.TODO() -id := lab.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -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: `LabClient.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: `LabClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LabClient.Publish` - -```go -ctx := context.TODO() -id := lab.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -if err := client.PublishThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LabClient.SyncGroup` - -```go -ctx := context.TODO() -id := lab.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -if err := client.SyncGroupThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LabClient.Update` - -```go -ctx := context.TODO() -id := lab.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -payload := lab.LabUpdate{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/labservices/2021-10-01-preview/lab/client.go b/resource-manager/labservices/2021-10-01-preview/lab/client.go deleted file mode 100644 index 0240d2f3918..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package lab - -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 LabClient struct { - Client *resourcemanager.Client -} - -func NewLabClientWithBaseURI(sdkApi sdkEnv.Api) (*LabClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "lab", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LabClient: %+v", err) - } - - return &LabClient{ - Client: client, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/constants.go b/resource-manager/labservices/2021-10-01-preview/lab/constants.go deleted file mode 100644 index f873909e6c2..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/constants.go +++ /dev/null @@ -1,371 +0,0 @@ -package lab - -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 ConnectionType string - -const ( - ConnectionTypeNone ConnectionType = "None" - ConnectionTypePrivate ConnectionType = "Private" - ConnectionTypePublic ConnectionType = "Public" -) - -func PossibleValuesForConnectionType() []string { - return []string{ - string(ConnectionTypeNone), - string(ConnectionTypePrivate), - string(ConnectionTypePublic), - } -} - -func (s *ConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionType(input string) (*ConnectionType, error) { - vals := map[string]ConnectionType{ - "none": ConnectionTypeNone, - "private": ConnectionTypePrivate, - "public": ConnectionTypePublic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionType(input) - return &out, nil -} - -type CreateOption string - -const ( - CreateOptionImage CreateOption = "Image" - CreateOptionTemplateVM CreateOption = "TemplateVM" -) - -func PossibleValuesForCreateOption() []string { - return []string{ - string(CreateOptionImage), - string(CreateOptionTemplateVM), - } -} - -func (s *CreateOption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCreateOption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCreateOption(input string) (*CreateOption, error) { - vals := map[string]CreateOption{ - "image": CreateOptionImage, - "templatevm": CreateOptionTemplateVM, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreateOption(input) - return &out, nil -} - -type EnableState string - -const ( - EnableStateDisabled EnableState = "Disabled" - EnableStateEnabled EnableState = "Enabled" -) - -func PossibleValuesForEnableState() []string { - return []string{ - string(EnableStateDisabled), - string(EnableStateEnabled), - } -} - -func (s *EnableState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEnableState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEnableState(input string) (*EnableState, error) { - vals := map[string]EnableState{ - "disabled": EnableStateDisabled, - "enabled": EnableStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableState(input) - return &out, nil -} - -type LabState string - -const ( - LabStateDraft LabState = "Draft" - LabStatePublished LabState = "Published" - LabStatePublishing LabState = "Publishing" - LabStateScaling LabState = "Scaling" - LabStateSyncing LabState = "Syncing" -) - -func PossibleValuesForLabState() []string { - return []string{ - string(LabStateDraft), - string(LabStatePublished), - string(LabStatePublishing), - string(LabStateScaling), - string(LabStateSyncing), - } -} - -func (s *LabState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLabState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLabState(input string) (*LabState, error) { - vals := map[string]LabState{ - "draft": LabStateDraft, - "published": LabStatePublished, - "publishing": LabStatePublishing, - "scaling": LabStateScaling, - "syncing": LabStateSyncing, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LabState(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 ProvisioningState string - -const ( - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateLocked ProvisioningState = "Locked" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateLocked), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "locked": ProvisioningStateLocked, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ShutdownOnIdleMode string - -const ( - ShutdownOnIdleModeLowUsage ShutdownOnIdleMode = "LowUsage" - ShutdownOnIdleModeNone ShutdownOnIdleMode = "None" - ShutdownOnIdleModeUserAbsence ShutdownOnIdleMode = "UserAbsence" -) - -func PossibleValuesForShutdownOnIdleMode() []string { - return []string{ - string(ShutdownOnIdleModeLowUsage), - string(ShutdownOnIdleModeNone), - string(ShutdownOnIdleModeUserAbsence), - } -} - -func (s *ShutdownOnIdleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseShutdownOnIdleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseShutdownOnIdleMode(input string) (*ShutdownOnIdleMode, error) { - vals := map[string]ShutdownOnIdleMode{ - "lowusage": ShutdownOnIdleModeLowUsage, - "none": ShutdownOnIdleModeNone, - "userabsence": ShutdownOnIdleModeUserAbsence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ShutdownOnIdleMode(input) - return &out, nil -} - -type SkuTier string - -const ( - SkuTierBasic SkuTier = "Basic" - SkuTierFree SkuTier = "Free" - SkuTierPremium SkuTier = "Premium" - SkuTierStandard SkuTier = "Standard" -) - -func PossibleValuesForSkuTier() []string { - return []string{ - string(SkuTierBasic), - string(SkuTierFree), - string(SkuTierPremium), - string(SkuTierStandard), - } -} - -func (s *SkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuTier(input string) (*SkuTier, error) { - vals := map[string]SkuTier{ - "basic": SkuTierBasic, - "free": SkuTierFree, - "premium": SkuTierPremium, - "standard": SkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuTier(input) - return &out, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/id_lab.go b/resource-manager/labservices/2021-10-01-preview/lab/id_lab.go deleted file mode 100644 index eb77d34b54d..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/id_lab.go +++ /dev/null @@ -1,130 +0,0 @@ -package lab - -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(&LabId{}) -} - -var _ resourceids.ResourceId = &LabId{} - -// LabId is a struct representing the Resource ID for a Lab -type LabId struct { - SubscriptionId string - ResourceGroupName string - LabName string -} - -// NewLabID returns a new LabId struct -func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId { - return LabId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - } -} - -// ParseLabID parses 'input' into a LabId -func ParseLabID(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabIDInsensitively parses 'input' case-insensitively into a LabId -// note: this method should only be used for API response data and not user input -func ParseLabIDInsensitively(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - return nil -} - -// ValidateLabID checks that 'input' can be parsed as a Lab ID -func ValidateLabID(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 := ParseLabID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab ID -func (id LabId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab ID -func (id LabId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - } -} - -// String returns a human-readable description of this Lab ID -func (id LabId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - } - return fmt.Sprintf("Lab (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/id_lab_test.go b/resource-manager/labservices/2021-10-01-preview/lab/id_lab_test.go deleted file mode 100644 index 108572189f9..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/id_lab_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package lab - -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 = &LabId{} - -func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } -} - -func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestParseLabIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestSegmentsForLabId(t *testing.T) { - segments := LabId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabId 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/labservices/2021-10-01-preview/lab/method_createorupdate.go b/resource-manager/labservices/2021-10-01-preview/lab/method_createorupdate.go deleted file mode 100644 index 9eb3bb00b80..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package lab - -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 *Lab -} - -// CreateOrUpdate ... -func (c LabClient) CreateOrUpdate(ctx context.Context, id LabId, input Lab) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LabClient) CreateOrUpdateThenPoll(ctx context.Context, id LabId, input Lab) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/labservices/2021-10-01-preview/lab/method_delete.go b/resource-manager/labservices/2021-10-01-preview/lab/method_delete.go deleted file mode 100644 index 61d797ee9c9..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package lab - -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 LabClient) Delete(ctx context.Context, id LabId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LabClient) DeleteThenPoll(ctx context.Context, id LabId) 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/labservices/2021-10-01-preview/lab/method_get.go b/resource-manager/labservices/2021-10-01-preview/lab/method_get.go deleted file mode 100644 index 744e5ffbaf7..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package lab - -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 *Lab -} - -// Get ... -func (c LabClient) Get(ctx context.Context, id LabId) (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 Lab - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/method_listbyresourcegroup.go b/resource-manager/labservices/2021-10-01-preview/lab/method_listbyresourcegroup.go deleted file mode 100644 index aa38a443b18..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package lab - -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 *[]Lab -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Lab -} - -// ListByResourceGroup ... -func (c LabClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.LabServices/labs", 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 *[]Lab `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 LabClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, LabOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LabClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LabOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Lab, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/labservices/2021-10-01-preview/lab/method_listbysubscription.go b/resource-manager/labservices/2021-10-01-preview/lab/method_listbysubscription.go deleted file mode 100644 index 3b91828d5b3..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package lab - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Lab -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []Lab -} - -// ListBySubscription ... -func (c LabClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.LabServices/labs", 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 *[]Lab `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c LabClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, LabOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LabClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LabOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]Lab, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/method_publish.go b/resource-manager/labservices/2021-10-01-preview/lab/method_publish.go deleted file mode 100644 index 0f1bdd45364..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_publish.go +++ /dev/null @@ -1,70 +0,0 @@ -package lab - -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 PublishOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Publish ... -func (c LabClient) Publish(ctx context.Context, id LabId) (result PublishOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/publish", 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 -} - -// PublishThenPoll performs Publish then polls until it's completed -func (c LabClient) PublishThenPoll(ctx context.Context, id LabId) error { - result, err := c.Publish(ctx, id) - if err != nil { - return fmt.Errorf("performing Publish: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Publish: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/method_syncgroup.go b/resource-manager/labservices/2021-10-01-preview/lab/method_syncgroup.go deleted file mode 100644 index 0c886d63fd4..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_syncgroup.go +++ /dev/null @@ -1,70 +0,0 @@ -package lab - -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 SyncGroupOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SyncGroup ... -func (c LabClient) SyncGroup(ctx context.Context, id LabId) (result SyncGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/syncGroup", 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 -} - -// SyncGroupThenPoll performs SyncGroup then polls until it's completed -func (c LabClient) SyncGroupThenPoll(ctx context.Context, id LabId) error { - result, err := c.SyncGroup(ctx, id) - if err != nil { - return fmt.Errorf("performing SyncGroup: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SyncGroup: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/method_update.go b/resource-manager/labservices/2021-10-01-preview/lab/method_update.go deleted file mode 100644 index b4ae22ae6d1..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package lab - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Lab -} - -// Update ... -func (c LabClient) Update(ctx context.Context, id LabId, input LabUpdate) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c LabClient) UpdateThenPoll(ctx context.Context, id LabId, input LabUpdate) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_autoshutdownprofile.go b/resource-manager/labservices/2021-10-01-preview/lab/model_autoshutdownprofile.go deleted file mode 100644 index 06638510756..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_autoshutdownprofile.go +++ /dev/null @@ -1,13 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoShutdownProfile struct { - DisconnectDelay *string `json:"disconnectDelay,omitempty"` - IdleDelay *string `json:"idleDelay,omitempty"` - NoConnectDelay *string `json:"noConnectDelay,omitempty"` - ShutdownOnDisconnect *EnableState `json:"shutdownOnDisconnect,omitempty"` - ShutdownOnIdle *ShutdownOnIdleMode `json:"shutdownOnIdle,omitempty"` - ShutdownWhenNotConnected *EnableState `json:"shutdownWhenNotConnected,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_connectionprofile.go b/resource-manager/labservices/2021-10-01-preview/lab/model_connectionprofile.go deleted file mode 100644 index 68a127f8e34..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_connectionprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionProfile struct { - ClientRdpAccess *ConnectionType `json:"clientRdpAccess,omitempty"` - ClientSshAccess *ConnectionType `json:"clientSshAccess,omitempty"` - WebRdpAccess *ConnectionType `json:"webRdpAccess,omitempty"` - WebSshAccess *ConnectionType `json:"webSshAccess,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_credentials.go b/resource-manager/labservices/2021-10-01-preview/lab/model_credentials.go deleted file mode 100644 index 6d23f8a3fba..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_credentials.go +++ /dev/null @@ -1,9 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Credentials struct { - Password *string `json:"password,omitempty"` - Username string `json:"username"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_imagereference.go b/resource-manager/labservices/2021-10-01-preview/lab/model_imagereference.go deleted file mode 100644 index b58e73a3347..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_imagereference.go +++ /dev/null @@ -1,13 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImageReference struct { - ExactVersion *string `json:"exactVersion,omitempty"` - Id *string `json:"id,omitempty"` - Offer *string `json:"offer,omitempty"` - Publisher *string `json:"publisher,omitempty"` - Sku *string `json:"sku,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_lab.go b/resource-manager/labservices/2021-10-01-preview/lab/model_lab.go deleted file mode 100644 index 47453834f0e..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_lab.go +++ /dev/null @@ -1,18 +0,0 @@ -package lab - -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 Lab struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties LabProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_labnetworkprofile.go b/resource-manager/labservices/2021-10-01-preview/lab/model_labnetworkprofile.go deleted file mode 100644 index 48ff54d74bf..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_labnetworkprofile.go +++ /dev/null @@ -1,10 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabNetworkProfile struct { - LoadBalancerId *string `json:"loadBalancerId,omitempty"` - PublicIPId *string `json:"publicIpId,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_labproperties.go b/resource-manager/labservices/2021-10-01-preview/lab/model_labproperties.go deleted file mode 100644 index ea789c61b7a..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_labproperties.go +++ /dev/null @@ -1,18 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabProperties struct { - AutoShutdownProfile *AutoShutdownProfile `json:"autoShutdownProfile,omitempty"` - ConnectionProfile *ConnectionProfile `json:"connectionProfile,omitempty"` - Description *string `json:"description,omitempty"` - LabPlanId *string `json:"labPlanId,omitempty"` - NetworkProfile *LabNetworkProfile `json:"networkProfile,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RosterProfile *RosterProfile `json:"rosterProfile,omitempty"` - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - State *LabState `json:"state,omitempty"` - Title *string `json:"title,omitempty"` - VirtualMachineProfile *VirtualMachineProfile `json:"virtualMachineProfile,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_labupdate.go b/resource-manager/labservices/2021-10-01-preview/lab/model_labupdate.go deleted file mode 100644 index dfa99f31c3c..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_labupdate.go +++ /dev/null @@ -1,9 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabUpdate struct { - Properties *LabUpdateProperties `json:"properties,omitempty"` - Tags *[]string `json:"tags,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_labupdateproperties.go b/resource-manager/labservices/2021-10-01-preview/lab/model_labupdateproperties.go deleted file mode 100644 index eb79b4be84b..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_labupdateproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabUpdateProperties struct { - AutoShutdownProfile *AutoShutdownProfile `json:"autoShutdownProfile,omitempty"` - ConnectionProfile *ConnectionProfile `json:"connectionProfile,omitempty"` - Description *string `json:"description,omitempty"` - LabPlanId *string `json:"labPlanId,omitempty"` - RosterProfile *RosterProfile `json:"rosterProfile,omitempty"` - SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` - Title *string `json:"title,omitempty"` - VirtualMachineProfile *VirtualMachineProfile `json:"virtualMachineProfile,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_rosterprofile.go b/resource-manager/labservices/2021-10-01-preview/lab/model_rosterprofile.go deleted file mode 100644 index b95ceca34af..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_rosterprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RosterProfile struct { - ActiveDirectoryGroupId *string `json:"activeDirectoryGroupId,omitempty"` - LmsInstance *string `json:"lmsInstance,omitempty"` - LtiClientId *string `json:"ltiClientId,omitempty"` - LtiContextId *string `json:"ltiContextId,omitempty"` - LtiRosterEndpoint *string `json:"ltiRosterEndpoint,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_securityprofile.go b/resource-manager/labservices/2021-10-01-preview/lab/model_securityprofile.go deleted file mode 100644 index 9e018475574..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_securityprofile.go +++ /dev/null @@ -1,9 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityProfile struct { - OpenAccess *EnableState `json:"openAccess,omitempty"` - RegistrationCode *string `json:"registrationCode,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_sku.go b/resource-manager/labservices/2021-10-01-preview/lab/model_sku.go deleted file mode 100644 index abacbe098b4..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *int64 `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name string `json:"name"` - Size *string `json:"size,omitempty"` - Tier *SkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineadditionalcapabilities.go b/resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineadditionalcapabilities.go deleted file mode 100644 index f0aff54d431..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineadditionalcapabilities.go +++ /dev/null @@ -1,8 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineAdditionalCapabilities struct { - InstallGpuDrivers *EnableState `json:"installGpuDrivers,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineprofile.go b/resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineprofile.go deleted file mode 100644 index 840aece6465..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/model_virtualmachineprofile.go +++ /dev/null @@ -1,16 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineProfile struct { - AdditionalCapabilities *VirtualMachineAdditionalCapabilities `json:"additionalCapabilities,omitempty"` - AdminUser Credentials `json:"adminUser"` - CreateOption CreateOption `json:"createOption"` - ImageReference ImageReference `json:"imageReference"` - NonAdminUser *Credentials `json:"nonAdminUser,omitempty"` - OsType *OsType `json:"osType,omitempty"` - Sku Sku `json:"sku"` - UsageQuota string `json:"usageQuota"` - UseSharedPassword *EnableState `json:"useSharedPassword,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/lab/predicates.go b/resource-manager/labservices/2021-10-01-preview/lab/predicates.go deleted file mode 100644 index ddf1b2a81d8..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package lab - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p LabOperationPredicate) Matches(input Lab) 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/labservices/2021-10-01-preview/lab/version.go b/resource-manager/labservices/2021-10-01-preview/lab/version.go deleted file mode 100644 index cdc92a631f5..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/lab/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package lab - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/lab/%s", defaultApiVersion) -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/README.md b/resource-manager/labservices/2021-10-01-preview/labplan/README.md deleted file mode 100644 index 4be366605ec..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/README.md +++ /dev/null @@ -1,117 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/labplan` Documentation - -The `labplan` SDK allows for interaction with the Azure Resource Manager Service `labservices` (API Version `2021-10-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/labplan" -``` - - -### Client Initialization - -```go -client := labplan.NewLabPlanClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LabPlanClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := labplan.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - -payload := labplan.LabPlan{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LabPlanClient.Delete` - -```go -ctx := context.TODO() -id := labplan.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LabPlanClient.Get` - -```go -ctx := context.TODO() -id := labplan.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - -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: `LabPlanClient.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: `LabPlanClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LabPlanClient.Update` - -```go -ctx := context.TODO() -id := labplan.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - -payload := labplan.LabPlanUpdate{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/client.go b/resource-manager/labservices/2021-10-01-preview/labplan/client.go deleted file mode 100644 index c00d6ef4fdd..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package labplan - -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 LabPlanClient struct { - Client *resourcemanager.Client -} - -func NewLabPlanClientWithBaseURI(sdkApi sdkEnv.Api) (*LabPlanClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "labplan", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LabPlanClient: %+v", err) - } - - return &LabPlanClient{ - Client: client, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/constants.go b/resource-manager/labservices/2021-10-01-preview/labplan/constants.go deleted file mode 100644 index e2f171bcf6d..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/constants.go +++ /dev/null @@ -1,192 +0,0 @@ -package labplan - -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 ConnectionType string - -const ( - ConnectionTypeNone ConnectionType = "None" - ConnectionTypePrivate ConnectionType = "Private" - ConnectionTypePublic ConnectionType = "Public" -) - -func PossibleValuesForConnectionType() []string { - return []string{ - string(ConnectionTypeNone), - string(ConnectionTypePrivate), - string(ConnectionTypePublic), - } -} - -func (s *ConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionType(input string) (*ConnectionType, error) { - vals := map[string]ConnectionType{ - "none": ConnectionTypeNone, - "private": ConnectionTypePrivate, - "public": ConnectionTypePublic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionType(input) - return &out, nil -} - -type EnableState string - -const ( - EnableStateDisabled EnableState = "Disabled" - EnableStateEnabled EnableState = "Enabled" -) - -func PossibleValuesForEnableState() []string { - return []string{ - string(EnableStateDisabled), - string(EnableStateEnabled), - } -} - -func (s *EnableState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEnableState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEnableState(input string) (*EnableState, error) { - vals := map[string]EnableState{ - "disabled": EnableStateDisabled, - "enabled": EnableStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnableState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateLocked ProvisioningState = "Locked" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateLocked), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "locked": ProvisioningStateLocked, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ShutdownOnIdleMode string - -const ( - ShutdownOnIdleModeLowUsage ShutdownOnIdleMode = "LowUsage" - ShutdownOnIdleModeNone ShutdownOnIdleMode = "None" - ShutdownOnIdleModeUserAbsence ShutdownOnIdleMode = "UserAbsence" -) - -func PossibleValuesForShutdownOnIdleMode() []string { - return []string{ - string(ShutdownOnIdleModeLowUsage), - string(ShutdownOnIdleModeNone), - string(ShutdownOnIdleModeUserAbsence), - } -} - -func (s *ShutdownOnIdleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseShutdownOnIdleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseShutdownOnIdleMode(input string) (*ShutdownOnIdleMode, error) { - vals := map[string]ShutdownOnIdleMode{ - "lowusage": ShutdownOnIdleModeLowUsage, - "none": ShutdownOnIdleModeNone, - "userabsence": ShutdownOnIdleModeUserAbsence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ShutdownOnIdleMode(input) - return &out, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/id_labplan.go b/resource-manager/labservices/2021-10-01-preview/labplan/id_labplan.go deleted file mode 100644 index f0ad633137e..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/id_labplan.go +++ /dev/null @@ -1,130 +0,0 @@ -package labplan - -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(&LabPlanId{}) -} - -var _ resourceids.ResourceId = &LabPlanId{} - -// LabPlanId is a struct representing the Resource ID for a Lab Plan -type LabPlanId struct { - SubscriptionId string - ResourceGroupName string - LabPlanName string -} - -// NewLabPlanID returns a new LabPlanId struct -func NewLabPlanID(subscriptionId string, resourceGroupName string, labPlanName string) LabPlanId { - return LabPlanId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabPlanName: labPlanName, - } -} - -// ParseLabPlanID parses 'input' into a LabPlanId -func ParseLabPlanID(input string) (*LabPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabPlanId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabPlanIDInsensitively parses 'input' case-insensitively into a LabPlanId -// note: this method should only be used for API response data and not user input -func ParseLabPlanIDInsensitively(input string) (*LabPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabPlanId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabPlanId) 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.LabPlanName, ok = input.Parsed["labPlanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labPlanName", input) - } - - return nil -} - -// ValidateLabPlanID checks that 'input' can be parsed as a Lab Plan ID -func ValidateLabPlanID(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 := ParseLabPlanID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab Plan ID -func (id LabPlanId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labPlans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabPlanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab Plan ID -func (id LabPlanId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabPlans", "labPlans", "labPlans"), - resourceids.UserSpecifiedSegment("labPlanName", "labPlanValue"), - } -} - -// String returns a human-readable description of this Lab Plan ID -func (id LabPlanId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Plan Name: %q", id.LabPlanName), - } - return fmt.Sprintf("Lab Plan (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/id_labplan_test.go b/resource-manager/labservices/2021-10-01-preview/labplan/id_labplan_test.go deleted file mode 100644 index 1f2d6c103e4..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/id_labplan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package labplan - -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 = &LabPlanId{} - -func TestNewLabPlanID(t *testing.T) { - id := NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - - 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.LabPlanName != "labPlanValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabPlanName'", id.LabPlanName, "labPlanValue") - } -} - -func TestFormatLabPlanID(t *testing.T) { - actual := NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabPlanID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabPlanId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabPlanID(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - } -} - -func TestParseLabPlanIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabPlanId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabPlanName: "lAbPlAnVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabPlanIDInsensitively(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - } -} - -func TestSegmentsForLabPlanId(t *testing.T) { - segments := LabPlanId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabPlanId 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/labservices/2021-10-01-preview/labplan/method_createorupdate.go b/resource-manager/labservices/2021-10-01-preview/labplan/method_createorupdate.go deleted file mode 100644 index 921eaacfd11..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package labplan - -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 *LabPlan -} - -// CreateOrUpdate ... -func (c LabPlanClient) CreateOrUpdate(ctx context.Context, id LabPlanId, input LabPlan) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LabPlanClient) CreateOrUpdateThenPoll(ctx context.Context, id LabPlanId, input LabPlan) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/labservices/2021-10-01-preview/labplan/method_delete.go b/resource-manager/labservices/2021-10-01-preview/labplan/method_delete.go deleted file mode 100644 index f48cc96554a..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package labplan - -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 LabPlanClient) Delete(ctx context.Context, id LabPlanId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LabPlanClient) DeleteThenPoll(ctx context.Context, id LabPlanId) 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/labservices/2021-10-01-preview/labplan/method_get.go b/resource-manager/labservices/2021-10-01-preview/labplan/method_get.go deleted file mode 100644 index 19314604754..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package labplan - -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 *LabPlan -} - -// Get ... -func (c LabPlanClient) Get(ctx context.Context, id LabPlanId) (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 LabPlan - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/method_listbyresourcegroup.go b/resource-manager/labservices/2021-10-01-preview/labplan/method_listbyresourcegroup.go deleted file mode 100644 index 079730224e1..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package labplan - -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 *[]LabPlan -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []LabPlan -} - -// ListByResourceGroup ... -func (c LabPlanClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.LabServices/labPlans", 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 *[]LabPlan `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 LabPlanClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, LabPlanOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LabPlanClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LabPlanOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]LabPlan, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/labservices/2021-10-01-preview/labplan/method_listbysubscription.go b/resource-manager/labservices/2021-10-01-preview/labplan/method_listbysubscription.go deleted file mode 100644 index 70536f89fa2..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package labplan - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LabPlan -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []LabPlan -} - -// ListBySubscription ... -func (c LabPlanClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.LabServices/labPlans", 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 *[]LabPlan `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c LabPlanClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, LabPlanOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LabPlanClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LabPlanOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]LabPlan, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/method_update.go b/resource-manager/labservices/2021-10-01-preview/labplan/method_update.go deleted file mode 100644 index c896046fcf1..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package labplan - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *LabPlan -} - -// Update ... -func (c LabPlanClient) Update(ctx context.Context, id LabPlanId, input LabPlanUpdate) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c LabPlanClient) UpdateThenPoll(ctx context.Context, id LabPlanId, input LabPlanUpdate) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_autoshutdownprofile.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_autoshutdownprofile.go deleted file mode 100644 index 2f682940355..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_autoshutdownprofile.go +++ /dev/null @@ -1,13 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoShutdownProfile struct { - DisconnectDelay *string `json:"disconnectDelay,omitempty"` - IdleDelay *string `json:"idleDelay,omitempty"` - NoConnectDelay *string `json:"noConnectDelay,omitempty"` - ShutdownOnDisconnect *EnableState `json:"shutdownOnDisconnect,omitempty"` - ShutdownOnIdle *ShutdownOnIdleMode `json:"shutdownOnIdle,omitempty"` - ShutdownWhenNotConnected *EnableState `json:"shutdownWhenNotConnected,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_connectionprofile.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_connectionprofile.go deleted file mode 100644 index f54cc4fc0e0..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_connectionprofile.go +++ /dev/null @@ -1,11 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionProfile struct { - ClientRdpAccess *ConnectionType `json:"clientRdpAccess,omitempty"` - ClientSshAccess *ConnectionType `json:"clientSshAccess,omitempty"` - WebRdpAccess *ConnectionType `json:"webRdpAccess,omitempty"` - WebSshAccess *ConnectionType `json:"webSshAccess,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplan.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_labplan.go deleted file mode 100644 index 0be83091296..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplan.go +++ /dev/null @@ -1,18 +0,0 @@ -package labplan - -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 LabPlan struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties LabPlanProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplannetworkprofile.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_labplannetworkprofile.go deleted file mode 100644 index 7c4a0861b15..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplannetworkprofile.go +++ /dev/null @@ -1,8 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabPlanNetworkProfile struct { - SubnetId *string `json:"subnetId,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanproperties.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanproperties.go deleted file mode 100644 index 1904d39790d..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabPlanProperties struct { - AllowedRegions *[]string `json:"allowedRegions,omitempty"` - DefaultAutoShutdownProfile *AutoShutdownProfile `json:"defaultAutoShutdownProfile,omitempty"` - DefaultConnectionProfile *ConnectionProfile `json:"defaultConnectionProfile,omitempty"` - DefaultNetworkProfile *LabPlanNetworkProfile `json:"defaultNetworkProfile,omitempty"` - LinkedLmsInstance *string `json:"linkedLmsInstance,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SharedGalleryId *string `json:"sharedGalleryId,omitempty"` - SupportInfo *SupportInfo `json:"supportInfo,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdate.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdate.go deleted file mode 100644 index d3dff4d2899..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdate.go +++ /dev/null @@ -1,9 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabPlanUpdate struct { - Properties *LabPlanUpdateProperties `json:"properties,omitempty"` - Tags *[]string `json:"tags,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdateproperties.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdateproperties.go deleted file mode 100644 index bcf2660820f..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_labplanupdateproperties.go +++ /dev/null @@ -1,14 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabPlanUpdateProperties struct { - AllowedRegions *[]string `json:"allowedRegions,omitempty"` - DefaultAutoShutdownProfile *AutoShutdownProfile `json:"defaultAutoShutdownProfile,omitempty"` - DefaultConnectionProfile *ConnectionProfile `json:"defaultConnectionProfile,omitempty"` - DefaultNetworkProfile *LabPlanNetworkProfile `json:"defaultNetworkProfile,omitempty"` - LinkedLmsInstance *string `json:"linkedLmsInstance,omitempty"` - SharedGalleryId *string `json:"sharedGalleryId,omitempty"` - SupportInfo *SupportInfo `json:"supportInfo,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/model_supportinfo.go b/resource-manager/labservices/2021-10-01-preview/labplan/model_supportinfo.go deleted file mode 100644 index 45b8d18165b..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/model_supportinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SupportInfo struct { - Email *string `json:"email,omitempty"` - Instructions *string `json:"instructions,omitempty"` - Phone *string `json:"phone,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/labplan/predicates.go b/resource-manager/labservices/2021-10-01-preview/labplan/predicates.go deleted file mode 100644 index 74f89d0968a..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package labplan - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LabPlanOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p LabPlanOperationPredicate) Matches(input LabPlan) 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/labservices/2021-10-01-preview/labplan/version.go b/resource-manager/labservices/2021-10-01-preview/labplan/version.go deleted file mode 100644 index c64fbafc7b5..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/labplan/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package labplan - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/labplan/%s", defaultApiVersion) -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/README.md b/resource-manager/labservices/2021-10-01-preview/schedule/README.md deleted file mode 100644 index ba96c63eaab..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/README.md +++ /dev/null @@ -1,107 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/schedule` Documentation - -The `schedule` SDK allows for interaction with the Azure Resource Manager Service `labservices` (API Version `2021-10-01-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/labservices/2021-10-01-preview/schedule" -``` - - -### Client Initialization - -```go -client := schedule.NewScheduleClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScheduleClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue") - -payload := schedule.Schedule{ - // ... -} - - -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: `ScheduleClient.Delete` - -```go -ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ScheduleClient.Get` - -```go -ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue") - -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: `ScheduleClient.ListByLab` - -```go -ctx := context.TODO() -id := schedule.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -// alternatively `client.ListByLab(ctx, id)` can be used to do batched pagination -items, err := client.ListByLabComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ScheduleClient.Update` - -```go -ctx := context.TODO() -id := schedule.NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue") - -payload := schedule.ScheduleUpdate{ - // ... -} - - -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/labservices/2021-10-01-preview/schedule/client.go b/resource-manager/labservices/2021-10-01-preview/schedule/client.go deleted file mode 100644 index 14f19f2e2d6..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package schedule - -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 ScheduleClient struct { - Client *resourcemanager.Client -} - -func NewScheduleClientWithBaseURI(sdkApi sdkEnv.Api) (*ScheduleClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "schedule", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ScheduleClient: %+v", err) - } - - return &ScheduleClient{ - Client: client, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/constants.go b/resource-manager/labservices/2021-10-01-preview/schedule/constants.go deleted file mode 100644 index 0ef4dd02a21..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/constants.go +++ /dev/null @@ -1,160 +0,0 @@ -package schedule - -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 ProvisioningState string - -const ( - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateLocked ProvisioningState = "Locked" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateLocked), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "locked": ProvisioningStateLocked, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RecurrenceFrequency string - -const ( - RecurrenceFrequencyDaily RecurrenceFrequency = "Daily" - RecurrenceFrequencyWeekly RecurrenceFrequency = "Weekly" -) - -func PossibleValuesForRecurrenceFrequency() []string { - return []string{ - string(RecurrenceFrequencyDaily), - string(RecurrenceFrequencyWeekly), - } -} - -func (s *RecurrenceFrequency) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRecurrenceFrequency(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRecurrenceFrequency(input string) (*RecurrenceFrequency, error) { - vals := map[string]RecurrenceFrequency{ - "daily": RecurrenceFrequencyDaily, - "weekly": RecurrenceFrequencyWeekly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecurrenceFrequency(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/labservices/2021-10-01-preview/schedule/id_lab.go b/resource-manager/labservices/2021-10-01-preview/schedule/id_lab.go deleted file mode 100644 index a8736ed3364..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/id_lab.go +++ /dev/null @@ -1,130 +0,0 @@ -package schedule - -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(&LabId{}) -} - -var _ resourceids.ResourceId = &LabId{} - -// LabId is a struct representing the Resource ID for a Lab -type LabId struct { - SubscriptionId string - ResourceGroupName string - LabName string -} - -// NewLabID returns a new LabId struct -func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId { - return LabId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - } -} - -// ParseLabID parses 'input' into a LabId -func ParseLabID(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabIDInsensitively parses 'input' case-insensitively into a LabId -// note: this method should only be used for API response data and not user input -func ParseLabIDInsensitively(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - return nil -} - -// ValidateLabID checks that 'input' can be parsed as a Lab ID -func ValidateLabID(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 := ParseLabID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab ID -func (id LabId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab ID -func (id LabId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - } -} - -// String returns a human-readable description of this Lab ID -func (id LabId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - } - return fmt.Sprintf("Lab (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/id_lab_test.go b/resource-manager/labservices/2021-10-01-preview/schedule/id_lab_test.go deleted file mode 100644 index 614f8b49e97..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/id_lab_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package schedule - -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 = &LabId{} - -func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } -} - -func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestParseLabIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestSegmentsForLabId(t *testing.T) { - segments := LabId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabId 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/labservices/2021-10-01-preview/schedule/id_schedule.go b/resource-manager/labservices/2021-10-01-preview/schedule/id_schedule.go deleted file mode 100644 index fce50774e00..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/id_schedule.go +++ /dev/null @@ -1,139 +0,0 @@ -package schedule - -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(&ScheduleId{}) -} - -var _ resourceids.ResourceId = &ScheduleId{} - -// ScheduleId is a struct representing the Resource ID for a Schedule -type ScheduleId struct { - SubscriptionId string - ResourceGroupName string - LabName string - ScheduleName string -} - -// NewScheduleID returns a new ScheduleId struct -func NewScheduleID(subscriptionId string, resourceGroupName string, labName string, scheduleName string) ScheduleId { - return ScheduleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - ScheduleName: scheduleName, - } -} - -// ParseScheduleID parses 'input' into a ScheduleId -func ParseScheduleID(input string) (*ScheduleId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScheduleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScheduleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScheduleIDInsensitively parses 'input' case-insensitively into a ScheduleId -// note: this method should only be used for API response data and not user input -func ParseScheduleIDInsensitively(input string) (*ScheduleId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScheduleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScheduleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScheduleId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - if id.ScheduleName, ok = input.Parsed["scheduleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scheduleName", input) - } - - return nil -} - -// ValidateScheduleID checks that 'input' can be parsed as a Schedule ID -func ValidateScheduleID(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 := ParseScheduleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Schedule ID -func (id ScheduleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s/schedules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName, id.ScheduleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Schedule ID -func (id ScheduleId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - resourceids.StaticSegment("staticSchedules", "schedules", "schedules"), - resourceids.UserSpecifiedSegment("scheduleName", "scheduleValue"), - } -} - -// String returns a human-readable description of this Schedule ID -func (id ScheduleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - fmt.Sprintf("Schedule Name: %q", id.ScheduleName), - } - return fmt.Sprintf("Schedule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/id_schedule_test.go b/resource-manager/labservices/2021-10-01-preview/schedule/id_schedule_test.go deleted file mode 100644 index ed692dc4dee..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/id_schedule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package schedule - -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 = &ScheduleId{} - -func TestNewScheduleID(t *testing.T) { - id := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } - - if id.ScheduleName != "scheduleValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScheduleName'", id.ScheduleName, "scheduleValue") - } -} - -func TestFormatScheduleID(t *testing.T) { - actual := NewScheduleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "scheduleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules/scheduleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScheduleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScheduleId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules/scheduleValue", - Expected: &ScheduleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - ScheduleName: "scheduleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules/scheduleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScheduleID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - if actual.ScheduleName != v.Expected.ScheduleName { - t.Fatalf("Expected %q but got %q for ScheduleName", v.Expected.ScheduleName, actual.ScheduleName) - } - - } -} - -func TestParseScheduleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScheduleId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE/sChEdUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules/scheduleValue", - Expected: &ScheduleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - ScheduleName: "scheduleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/schedules/scheduleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE/sChEdUlEs/sChEdUlEvAlUe", - Expected: &ScheduleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - ScheduleName: "sChEdUlEvAlUe", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/sChEdUlEs/sChEdUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScheduleIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - if actual.ScheduleName != v.Expected.ScheduleName { - t.Fatalf("Expected %q but got %q for ScheduleName", v.Expected.ScheduleName, actual.ScheduleName) - } - - } -} - -func TestSegmentsForScheduleId(t *testing.T) { - segments := ScheduleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScheduleId 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/labservices/2021-10-01-preview/schedule/method_createorupdate.go b/resource-manager/labservices/2021-10-01-preview/schedule/method_createorupdate.go deleted file mode 100644 index 06f15c27d8e..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package schedule - -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 *Schedule -} - -// CreateOrUpdate ... -func (c ScheduleClient) CreateOrUpdate(ctx context.Context, id ScheduleId, input Schedule) (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 Schedule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/method_delete.go b/resource-manager/labservices/2021-10-01-preview/schedule/method_delete.go deleted file mode 100644 index dd45b55709c..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package schedule - -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 ScheduleClient) Delete(ctx context.Context, id ScheduleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ScheduleClient) DeleteThenPoll(ctx context.Context, id ScheduleId) 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/labservices/2021-10-01-preview/schedule/method_get.go b/resource-manager/labservices/2021-10-01-preview/schedule/method_get.go deleted file mode 100644 index 1e138129113..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package schedule - -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 *Schedule -} - -// Get ... -func (c ScheduleClient) Get(ctx context.Context, id ScheduleId) (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 Schedule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/method_listbylab.go b/resource-manager/labservices/2021-10-01-preview/schedule/method_listbylab.go deleted file mode 100644 index 799c7f127b4..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/method_listbylab.go +++ /dev/null @@ -1,91 +0,0 @@ -package schedule - -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 ListByLabOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Schedule -} - -type ListByLabCompleteResult struct { - LatestHttpResponse *http.Response - Items []Schedule -} - -// ListByLab ... -func (c ScheduleClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/schedules", 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 *[]Schedule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByLabComplete retrieves all the results into a single object -func (c ScheduleClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error) { - return c.ListByLabCompleteMatchingPredicate(ctx, id, ScheduleOperationPredicate{}) -} - -// ListByLabCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ScheduleClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate ScheduleOperationPredicate) (result ListByLabCompleteResult, err error) { - items := make([]Schedule, 0) - - resp, err := c.ListByLab(ctx, id) - if err != nil { - 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 = ListByLabCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/method_update.go b/resource-manager/labservices/2021-10-01-preview/schedule/method_update.go deleted file mode 100644 index 66c00e47ea5..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package schedule - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Schedule -} - -// Update ... -func (c ScheduleClient) Update(ctx context.Context, id ScheduleId, input ScheduleUpdate) (result UpdateOperationResponse, 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 Schedule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/model_recurrencepattern.go b/resource-manager/labservices/2021-10-01-preview/schedule/model_recurrencepattern.go deleted file mode 100644 index 2f37e55d94a..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/model_recurrencepattern.go +++ /dev/null @@ -1,11 +0,0 @@ -package schedule - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecurrencePattern struct { - ExpirationDate string `json:"expirationDate"` - Frequency RecurrenceFrequency `json:"frequency"` - Interval *int64 `json:"interval,omitempty"` - WeekDays *[]WeekDay `json:"weekDays,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/model_schedule.go b/resource-manager/labservices/2021-10-01-preview/schedule/model_schedule.go deleted file mode 100644 index 810453634f1..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/model_schedule.go +++ /dev/null @@ -1,16 +0,0 @@ -package schedule - -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 Schedule struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ScheduleProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleproperties.go b/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleproperties.go deleted file mode 100644 index 70d5ac850ed..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleproperties.go +++ /dev/null @@ -1,43 +0,0 @@ -package schedule - -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 ScheduleProperties struct { - Notes *string `json:"notes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RecurrencePattern *RecurrencePattern `json:"recurrencePattern,omitempty"` - StartAt *string `json:"startAt,omitempty"` - StopAt *string `json:"stopAt,omitempty"` - TimeZoneId *string `json:"timeZoneId,omitempty"` -} - -func (o *ScheduleProperties) GetStartAtAsTime() (*time.Time, error) { - if o.StartAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduleProperties) SetStartAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartAt = &formatted -} - -func (o *ScheduleProperties) GetStopAtAsTime() (*time.Time, error) { - if o.StopAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StopAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduleProperties) SetStopAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StopAt = &formatted -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdate.go b/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdate.go deleted file mode 100644 index 57030b33d88..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package schedule - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScheduleUpdate struct { - Properties *ScheduleUpdateProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdateproperties.go b/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdateproperties.go deleted file mode 100644 index 3878a8e4f38..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/model_scheduleupdateproperties.go +++ /dev/null @@ -1,42 +0,0 @@ -package schedule - -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 ScheduleUpdateProperties struct { - Notes *string `json:"notes,omitempty"` - RecurrencePattern *RecurrencePattern `json:"recurrencePattern,omitempty"` - StartAt *string `json:"startAt,omitempty"` - StopAt *string `json:"stopAt,omitempty"` - TimeZoneId *string `json:"timeZoneId,omitempty"` -} - -func (o *ScheduleUpdateProperties) GetStartAtAsTime() (*time.Time, error) { - if o.StartAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduleUpdateProperties) SetStartAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartAt = &formatted -} - -func (o *ScheduleUpdateProperties) GetStopAtAsTime() (*time.Time, error) { - if o.StopAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StopAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduleUpdateProperties) SetStopAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StopAt = &formatted -} diff --git a/resource-manager/labservices/2021-10-01-preview/schedule/predicates.go b/resource-manager/labservices/2021-10-01-preview/schedule/predicates.go deleted file mode 100644 index 77fa3780f49..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package schedule - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScheduleOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ScheduleOperationPredicate) Matches(input Schedule) 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/labservices/2021-10-01-preview/schedule/version.go b/resource-manager/labservices/2021-10-01-preview/schedule/version.go deleted file mode 100644 index 3c050da1191..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/schedule/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package schedule - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/schedule/%s", defaultApiVersion) -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/README.md b/resource-manager/labservices/2021-10-01-preview/user/README.md deleted file mode 100644 index a61e55c2123..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/README.md +++ /dev/null @@ -1,116 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/user` Documentation - -The `user` SDK allows for interaction with the Azure Resource Manager Service `labservices` (API Version `2021-10-01-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/labservices/2021-10-01-preview/user" -``` - - -### Client Initialization - -```go -client := user.NewUserClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UserClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := user.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue") - -payload := user.User{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `UserClient.Delete` - -```go -ctx := context.TODO() -id := user.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `UserClient.Get` - -```go -ctx := context.TODO() -id := user.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue") - -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: `UserClient.Invite` - -```go -ctx := context.TODO() -id := user.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue") - -payload := user.InviteBody{ - // ... -} - - -if err := client.InviteThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `UserClient.ListByLab` - -```go -ctx := context.TODO() -id := user.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -// alternatively `client.ListByLab(ctx, id)` can be used to do batched pagination -items, err := client.ListByLabComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `UserClient.Update` - -```go -ctx := context.TODO() -id := user.NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue") - -payload := user.UserUpdate{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/labservices/2021-10-01-preview/user/client.go b/resource-manager/labservices/2021-10-01-preview/user/client.go deleted file mode 100644 index 3d1a0eb8bf3..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package user - -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 UserClient struct { - Client *resourcemanager.Client -} - -func NewUserClientWithBaseURI(sdkApi sdkEnv.Api) (*UserClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "user", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UserClient: %+v", err) - } - - return &UserClient{ - Client: client, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/constants.go b/resource-manager/labservices/2021-10-01-preview/user/constants.go deleted file mode 100644 index e73edfaec7c..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/constants.go +++ /dev/null @@ -1,151 +0,0 @@ -package user - -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 InvitationState string - -const ( - InvitationStateFailed InvitationState = "Failed" - InvitationStateNotSent InvitationState = "NotSent" - InvitationStateSending InvitationState = "Sending" - InvitationStateSent InvitationState = "Sent" -) - -func PossibleValuesForInvitationState() []string { - return []string{ - string(InvitationStateFailed), - string(InvitationStateNotSent), - string(InvitationStateSending), - string(InvitationStateSent), - } -} - -func (s *InvitationState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInvitationState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInvitationState(input string) (*InvitationState, error) { - vals := map[string]InvitationState{ - "failed": InvitationStateFailed, - "notsent": InvitationStateNotSent, - "sending": InvitationStateSending, - "sent": InvitationStateSent, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InvitationState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateLocked ProvisioningState = "Locked" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateLocked), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "locked": ProvisioningStateLocked, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RegistrationState string - -const ( - RegistrationStateNotRegistered RegistrationState = "NotRegistered" - RegistrationStateRegistered RegistrationState = "Registered" -) - -func PossibleValuesForRegistrationState() []string { - return []string{ - string(RegistrationStateNotRegistered), - string(RegistrationStateRegistered), - } -} - -func (s *RegistrationState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistrationState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistrationState(input string) (*RegistrationState, error) { - vals := map[string]RegistrationState{ - "notregistered": RegistrationStateNotRegistered, - "registered": RegistrationStateRegistered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistrationState(input) - return &out, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/id_lab.go b/resource-manager/labservices/2021-10-01-preview/user/id_lab.go deleted file mode 100644 index f2191ccecc9..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/id_lab.go +++ /dev/null @@ -1,130 +0,0 @@ -package user - -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(&LabId{}) -} - -var _ resourceids.ResourceId = &LabId{} - -// LabId is a struct representing the Resource ID for a Lab -type LabId struct { - SubscriptionId string - ResourceGroupName string - LabName string -} - -// NewLabID returns a new LabId struct -func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId { - return LabId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - } -} - -// ParseLabID parses 'input' into a LabId -func ParseLabID(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabIDInsensitively parses 'input' case-insensitively into a LabId -// note: this method should only be used for API response data and not user input -func ParseLabIDInsensitively(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - return nil -} - -// ValidateLabID checks that 'input' can be parsed as a Lab ID -func ValidateLabID(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 := ParseLabID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab ID -func (id LabId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab ID -func (id LabId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - } -} - -// String returns a human-readable description of this Lab ID -func (id LabId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - } - return fmt.Sprintf("Lab (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/id_lab_test.go b/resource-manager/labservices/2021-10-01-preview/user/id_lab_test.go deleted file mode 100644 index 863de0cc9ec..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/id_lab_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package user - -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 = &LabId{} - -func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } -} - -func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestParseLabIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestSegmentsForLabId(t *testing.T) { - segments := LabId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabId 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/labservices/2021-10-01-preview/user/id_user.go b/resource-manager/labservices/2021-10-01-preview/user/id_user.go deleted file mode 100644 index b6e22f8bc58..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/id_user.go +++ /dev/null @@ -1,139 +0,0 @@ -package user - -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(&UserId{}) -} - -var _ resourceids.ResourceId = &UserId{} - -// UserId is a struct representing the Resource ID for a User -type UserId struct { - SubscriptionId string - ResourceGroupName string - LabName string - UserName string -} - -// NewUserID returns a new UserId struct -func NewUserID(subscriptionId string, resourceGroupName string, labName string, userName string) UserId { - return UserId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - UserName: userName, - } -} - -// ParseUserID parses 'input' into a UserId -func ParseUserID(input string) (*UserId, error) { - parser := resourceids.NewParserFromResourceIdType(&UserId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UserId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseUserIDInsensitively parses 'input' case-insensitively into a UserId -// note: this method should only be used for API response data and not user input -func ParseUserIDInsensitively(input string) (*UserId, error) { - parser := resourceids.NewParserFromResourceIdType(&UserId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := UserId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *UserId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - if id.UserName, ok = input.Parsed["userName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "userName", input) - } - - return nil -} - -// ValidateUserID checks that 'input' can be parsed as a User ID -func ValidateUserID(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 := ParseUserID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted User ID -func (id UserId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s/users/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName, id.UserName) -} - -// Segments returns a slice of Resource ID Segments which comprise this User ID -func (id UserId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - resourceids.StaticSegment("staticUsers", "users", "users"), - resourceids.UserSpecifiedSegment("userName", "userValue"), - } -} - -// String returns a human-readable description of this User ID -func (id UserId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - fmt.Sprintf("User Name: %q", id.UserName), - } - return fmt.Sprintf("User (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/id_user_test.go b/resource-manager/labservices/2021-10-01-preview/user/id_user_test.go deleted file mode 100644 index 1386d1fe261..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/id_user_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package user - -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 = &UserId{} - -func TestNewUserID(t *testing.T) { - id := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } - - if id.UserName != "userValue" { - t.Fatalf("Expected %q but got %q for Segment 'UserName'", id.UserName, "userValue") - } -} - -func TestFormatUserID(t *testing.T) { - actual := NewUserID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "userValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users/userValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseUserID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UserId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users/userValue", - Expected: &UserId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - UserName: "userValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users/userValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUserID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - if actual.UserName != v.Expected.UserName { - t.Fatalf("Expected %q but got %q for UserName", v.Expected.UserName, actual.UserName) - } - - } -} - -func TestParseUserIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *UserId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE/uSeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users/userValue", - Expected: &UserId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - UserName: "userValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/users/userValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE/uSeRs/uSeRvAlUe", - Expected: &UserId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - UserName: "uSeRvAlUe", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/uSeRs/uSeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseUserIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - if actual.UserName != v.Expected.UserName { - t.Fatalf("Expected %q but got %q for UserName", v.Expected.UserName, actual.UserName) - } - - } -} - -func TestSegmentsForUserId(t *testing.T) { - segments := UserId{}.Segments() - if len(segments) == 0 { - t.Fatalf("UserId 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/labservices/2021-10-01-preview/user/method_createorupdate.go b/resource-manager/labservices/2021-10-01-preview/user/method_createorupdate.go deleted file mode 100644 index c5a0e023dbd..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package user - -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 *User -} - -// CreateOrUpdate ... -func (c UserClient) CreateOrUpdate(ctx context.Context, id UserId, input User) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c UserClient) CreateOrUpdateThenPoll(ctx context.Context, id UserId, input User) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/labservices/2021-10-01-preview/user/method_delete.go b/resource-manager/labservices/2021-10-01-preview/user/method_delete.go deleted file mode 100644 index 879b3a49beb..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package user - -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 UserClient) Delete(ctx context.Context, id UserId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 UserClient) DeleteThenPoll(ctx context.Context, id UserId) 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/labservices/2021-10-01-preview/user/method_get.go b/resource-manager/labservices/2021-10-01-preview/user/method_get.go deleted file mode 100644 index e8a1c1d557f..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package user - -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 *User -} - -// Get ... -func (c UserClient) Get(ctx context.Context, id UserId) (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 User - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/method_invite.go b/resource-manager/labservices/2021-10-01-preview/user/method_invite.go deleted file mode 100644 index f9f201663b1..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/method_invite.go +++ /dev/null @@ -1,74 +0,0 @@ -package user - -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 InviteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Invite ... -func (c UserClient) Invite(ctx context.Context, id UserId, input InviteBody) (result InviteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/invite", 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 -} - -// InviteThenPoll performs Invite then polls until it's completed -func (c UserClient) InviteThenPoll(ctx context.Context, id UserId, input InviteBody) error { - result, err := c.Invite(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Invite: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Invite: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/method_listbylab.go b/resource-manager/labservices/2021-10-01-preview/user/method_listbylab.go deleted file mode 100644 index ad208bcdbf7..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/method_listbylab.go +++ /dev/null @@ -1,91 +0,0 @@ -package user - -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 ListByLabOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]User -} - -type ListByLabCompleteResult struct { - LatestHttpResponse *http.Response - Items []User -} - -// ListByLab ... -func (c UserClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/users", 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 *[]User `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByLabComplete retrieves all the results into a single object -func (c UserClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error) { - return c.ListByLabCompleteMatchingPredicate(ctx, id, UserOperationPredicate{}) -} - -// ListByLabCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UserClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate UserOperationPredicate) (result ListByLabCompleteResult, err error) { - items := make([]User, 0) - - resp, err := c.ListByLab(ctx, id) - if err != nil { - 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 = ListByLabCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/method_update.go b/resource-manager/labservices/2021-10-01-preview/user/method_update.go deleted file mode 100644 index 43712e07b09..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package user - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *User -} - -// Update ... -func (c UserClient) Update(ctx context.Context, id UserId, input UserUpdate) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c UserClient) UpdateThenPoll(ctx context.Context, id UserId, input UserUpdate) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/model_invitebody.go b/resource-manager/labservices/2021-10-01-preview/user/model_invitebody.go deleted file mode 100644 index ee4e0b5e9d5..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/model_invitebody.go +++ /dev/null @@ -1,8 +0,0 @@ -package user - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InviteBody struct { - Text *string `json:"text,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/model_user.go b/resource-manager/labservices/2021-10-01-preview/user/model_user.go deleted file mode 100644 index 4f9ffc6ed7e..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/model_user.go +++ /dev/null @@ -1,16 +0,0 @@ -package user - -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 User struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties UserProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/model_userproperties.go b/resource-manager/labservices/2021-10-01-preview/user/model_userproperties.go deleted file mode 100644 index 317861cc9d7..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/model_userproperties.go +++ /dev/null @@ -1,33 +0,0 @@ -package user - -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 UserProperties struct { - AdditionalUsageQuota *string `json:"additionalUsageQuota,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Email string `json:"email"` - InvitationSent *string `json:"invitationSent,omitempty"` - InvitationState *InvitationState `json:"invitationState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RegistrationState *RegistrationState `json:"registrationState,omitempty"` - TotalUsage *string `json:"totalUsage,omitempty"` -} - -func (o *UserProperties) GetInvitationSentAsTime() (*time.Time, error) { - if o.InvitationSent == nil { - return nil, nil - } - return dates.ParseAsFormat(o.InvitationSent, "2006-01-02T15:04:05Z07:00") -} - -func (o *UserProperties) SetInvitationSentAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.InvitationSent = &formatted -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/model_userupdate.go b/resource-manager/labservices/2021-10-01-preview/user/model_userupdate.go deleted file mode 100644 index fdf61da8e3d..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/model_userupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package user - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserUpdate struct { - Properties *UserUpdateProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/model_userupdateproperties.go b/resource-manager/labservices/2021-10-01-preview/user/model_userupdateproperties.go deleted file mode 100644 index e1853265a7f..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/model_userupdateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package user - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserUpdateProperties struct { - AdditionalUsageQuota *string `json:"additionalUsageQuota,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/user/predicates.go b/resource-manager/labservices/2021-10-01-preview/user/predicates.go deleted file mode 100644 index 6af39b3985a..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package user - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p UserOperationPredicate) Matches(input User) 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/labservices/2021-10-01-preview/user/version.go b/resource-manager/labservices/2021-10-01-preview/user/version.go deleted file mode 100644 index 67a82926036..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/user/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package user - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/user/%s", defaultApiVersion) -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/README.md b/resource-manager/labservices/2021-10-01-preview/virtualmachine/README.md deleted file mode 100644 index 03b318fd211..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/README.md +++ /dev/null @@ -1,135 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/labservices/2021-10-01-preview/virtualmachine` Documentation - -The `virtualmachine` SDK allows for interaction with the Azure Resource Manager Service `labservices` (API Version `2021-10-01-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/labservices/2021-10-01-preview/virtualmachine" -``` - - -### Client Initialization - -```go -client := virtualmachine.NewVirtualMachineClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualMachineClient.Get` - -```go -ctx := context.TODO() -id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - -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: `VirtualMachineClient.LabPlansSaveImage` - -```go -ctx := context.TODO() -id := virtualmachine.NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - -payload := virtualmachine.SaveImageBody{ - // ... -} - - -if err := client.LabPlansSaveImageThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineClient.ListByLab` - -```go -ctx := context.TODO() -id := virtualmachine.NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - -// alternatively `client.ListByLab(ctx, id)` can be used to do batched pagination -items, err := client.ListByLabComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualMachineClient.Redeploy` - -```go -ctx := context.TODO() -id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - -if err := client.RedeployThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineClient.Reimage` - -```go -ctx := context.TODO() -id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - -if err := client.ReimageThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineClient.ResetPassword` - -```go -ctx := context.TODO() -id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - -payload := virtualmachine.ResetPasswordBody{ - // ... -} - - -if err := client.ResetPasswordThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineClient.Start` - -```go -ctx := context.TODO() -id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualMachineClient.Stop` - -```go -ctx := context.TODO() -id := virtualmachine.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/client.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/client.go deleted file mode 100644 index 8a2dacec8cb..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualmachine - -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 VirtualMachineClient struct { - Client *resourcemanager.Client -} - -func NewVirtualMachineClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualMachineClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualmachine", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualMachineClient: %+v", err) - } - - return &VirtualMachineClient{ - Client: client, - }, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/constants.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/constants.go deleted file mode 100644 index c7f0aee5c8f..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/constants.go +++ /dev/null @@ -1,160 +0,0 @@ -package virtualmachine - -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 ProvisioningState string - -const ( - ProvisioningStateCreating ProvisioningState = "Creating" - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateLocked ProvisioningState = "Locked" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateCreating), - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateLocked), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "creating": ProvisioningStateCreating, - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "locked": ProvisioningStateLocked, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualMachineState string - -const ( - VirtualMachineStateRedeploying VirtualMachineState = "Redeploying" - VirtualMachineStateReimaging VirtualMachineState = "Reimaging" - VirtualMachineStateResettingPassword VirtualMachineState = "ResettingPassword" - VirtualMachineStateRunning VirtualMachineState = "Running" - VirtualMachineStateStarting VirtualMachineState = "Starting" - VirtualMachineStateStopped VirtualMachineState = "Stopped" - VirtualMachineStateStopping VirtualMachineState = "Stopping" -) - -func PossibleValuesForVirtualMachineState() []string { - return []string{ - string(VirtualMachineStateRedeploying), - string(VirtualMachineStateReimaging), - string(VirtualMachineStateResettingPassword), - string(VirtualMachineStateRunning), - string(VirtualMachineStateStarting), - string(VirtualMachineStateStopped), - string(VirtualMachineStateStopping), - } -} - -func (s *VirtualMachineState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualMachineState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualMachineState(input string) (*VirtualMachineState, error) { - vals := map[string]VirtualMachineState{ - "redeploying": VirtualMachineStateRedeploying, - "reimaging": VirtualMachineStateReimaging, - "resettingpassword": VirtualMachineStateResettingPassword, - "running": VirtualMachineStateRunning, - "starting": VirtualMachineStateStarting, - "stopped": VirtualMachineStateStopped, - "stopping": VirtualMachineStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualMachineState(input) - return &out, nil -} - -type VirtualMachineType string - -const ( - VirtualMachineTypeTemplate VirtualMachineType = "Template" - VirtualMachineTypeUser VirtualMachineType = "User" -) - -func PossibleValuesForVirtualMachineType() []string { - return []string{ - string(VirtualMachineTypeTemplate), - string(VirtualMachineTypeUser), - } -} - -func (s *VirtualMachineType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualMachineType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualMachineType(input string) (*VirtualMachineType, error) { - vals := map[string]VirtualMachineType{ - "template": VirtualMachineTypeTemplate, - "user": VirtualMachineTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualMachineType(input) - return &out, nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab.go deleted file mode 100644 index 086d1b5029d..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualmachine - -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(&LabId{}) -} - -var _ resourceids.ResourceId = &LabId{} - -// LabId is a struct representing the Resource ID for a Lab -type LabId struct { - SubscriptionId string - ResourceGroupName string - LabName string -} - -// NewLabID returns a new LabId struct -func NewLabID(subscriptionId string, resourceGroupName string, labName string) LabId { - return LabId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - } -} - -// ParseLabID parses 'input' into a LabId -func ParseLabID(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabIDInsensitively parses 'input' case-insensitively into a LabId -// note: this method should only be used for API response data and not user input -func ParseLabIDInsensitively(input string) (*LabId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - return nil -} - -// ValidateLabID checks that 'input' can be parsed as a Lab ID -func ValidateLabID(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 := ParseLabID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab ID -func (id LabId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab ID -func (id LabId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - } -} - -// String returns a human-readable description of this Lab ID -func (id LabId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - } - return fmt.Sprintf("Lab (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab_test.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab_test.go deleted file mode 100644 index 9ee750a7727..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_lab_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualmachine - -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 = &LabId{} - -func TestNewLabID(t *testing.T) { - id := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } -} - -func TestFormatLabID(t *testing.T) { - actual := NewLabID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestParseLabIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Expected: &LabId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - } -} - -func TestSegmentsForLabId(t *testing.T) { - segments := LabId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabId 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/labservices/2021-10-01-preview/virtualmachine/id_labplan.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan.go deleted file mode 100644 index cc0ea7e3c68..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualmachine - -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(&LabPlanId{}) -} - -var _ resourceids.ResourceId = &LabPlanId{} - -// LabPlanId is a struct representing the Resource ID for a Lab Plan -type LabPlanId struct { - SubscriptionId string - ResourceGroupName string - LabPlanName string -} - -// NewLabPlanID returns a new LabPlanId struct -func NewLabPlanID(subscriptionId string, resourceGroupName string, labPlanName string) LabPlanId { - return LabPlanId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabPlanName: labPlanName, - } -} - -// ParseLabPlanID parses 'input' into a LabPlanId -func ParseLabPlanID(input string) (*LabPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabPlanId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLabPlanIDInsensitively parses 'input' case-insensitively into a LabPlanId -// note: this method should only be used for API response data and not user input -func ParseLabPlanIDInsensitively(input string) (*LabPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&LabPlanId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LabPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LabPlanId) 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.LabPlanName, ok = input.Parsed["labPlanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labPlanName", input) - } - - return nil -} - -// ValidateLabPlanID checks that 'input' can be parsed as a Lab Plan ID -func ValidateLabPlanID(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 := ParseLabPlanID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Lab Plan ID -func (id LabPlanId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labPlans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabPlanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Lab Plan ID -func (id LabPlanId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabPlans", "labPlans", "labPlans"), - resourceids.UserSpecifiedSegment("labPlanName", "labPlanValue"), - } -} - -// String returns a human-readable description of this Lab Plan ID -func (id LabPlanId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Plan Name: %q", id.LabPlanName), - } - return fmt.Sprintf("Lab Plan (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan_test.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan_test.go deleted file mode 100644 index 4d76d59e0a7..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_labplan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualmachine - -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 = &LabPlanId{} - -func TestNewLabPlanID(t *testing.T) { - id := NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue") - - 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.LabPlanName != "labPlanValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabPlanName'", id.LabPlanName, "labPlanValue") - } -} - -func TestFormatLabPlanID(t *testing.T) { - actual := NewLabPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labPlanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLabPlanID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabPlanId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabPlanID(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - } -} - -func TestParseLabPlanIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LabPlanId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabPlanName: "labPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labPlans/labPlanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE", - Expected: &LabPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabPlanName: "lAbPlAnVaLuE", - }, - }, - { - // 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.lAbSeRvIcEs/lAbPlAnS/lAbPlAnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLabPlanIDInsensitively(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.LabPlanName != v.Expected.LabPlanName { - t.Fatalf("Expected %q but got %q for LabPlanName", v.Expected.LabPlanName, actual.LabPlanName) - } - - } -} - -func TestSegmentsForLabPlanId(t *testing.T) { - segments := LabPlanId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LabPlanId 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/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine.go deleted file mode 100644 index 345e5908945..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualmachine - -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(&VirtualMachineId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineId{} - -// VirtualMachineId is a struct representing the Resource ID for a Virtual Machine -type VirtualMachineId struct { - SubscriptionId string - ResourceGroupName string - LabName string - VirtualMachineName string -} - -// NewVirtualMachineID returns a new VirtualMachineId struct -func NewVirtualMachineID(subscriptionId string, resourceGroupName string, labName string, virtualMachineName string) VirtualMachineId { - return VirtualMachineId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LabName: labName, - VirtualMachineName: virtualMachineName, - } -} - -// ParseVirtualMachineID parses 'input' into a VirtualMachineId -func ParseVirtualMachineID(input string) (*VirtualMachineId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineIDInsensitively(input string) (*VirtualMachineId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineId) 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.LabName, ok = input.Parsed["labName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "labName", input) - } - - if id.VirtualMachineName, ok = input.Parsed["virtualMachineName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineName", input) - } - - return nil -} - -// ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID -func ValidateVirtualMachineID(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 := ParseVirtualMachineID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine ID -func (id VirtualMachineId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.LabServices/labs/%s/virtualMachines/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LabName, id.VirtualMachineName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine ID -func (id VirtualMachineId) 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("staticMicrosoftLabServices", "Microsoft.LabServices", "Microsoft.LabServices"), - resourceids.StaticSegment("staticLabs", "labs", "labs"), - resourceids.UserSpecifiedSegment("labName", "labValue"), - resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineValue"), - } -} - -// String returns a human-readable description of this Virtual Machine ID -func (id VirtualMachineId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Lab Name: %q", id.LabName), - fmt.Sprintf("Virtual Machine Name: %q", id.VirtualMachineName), - } - return fmt.Sprintf("Virtual Machine (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine_test.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine_test.go deleted file mode 100644 index 4b118b1c5ba..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/id_virtualmachine_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualmachine - -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 = &VirtualMachineId{} - -func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue") - - 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.LabName != "labValue" { - t.Fatalf("Expected %q but got %q for Segment 'LabName'", id.LabName, "labValue") - } - - if id.VirtualMachineName != "virtualMachineValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineValue") - } -} - -func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "labValue", "virtualMachineValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines/virtualMachineValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines/virtualMachineValue", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - VirtualMachineName: "virtualMachineValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines/virtualMachineValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineID(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - if actual.VirtualMachineName != v.Expected.VirtualMachineName { - t.Fatalf("Expected %q but got %q for VirtualMachineName", v.Expected.VirtualMachineName, actual.VirtualMachineName) - } - - } -} - -func TestParseVirtualMachineIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineId - }{ - { - // 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.LabServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE/vIrTuAlMaChInEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines/virtualMachineValue", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LabName: "labValue", - VirtualMachineName: "virtualMachineValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.LabServices/labs/labValue/virtualMachines/virtualMachineValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.lAbSeRvIcEs/lAbS/lAbVaLuE/vIrTuAlMaChInEs/vIrTuAlMaChInEvAlUe", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LabName: "lAbVaLuE", - VirtualMachineName: "vIrTuAlMaChInEvAlUe", - }, - }, - { - // 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.lAbSeRvIcEs/lAbS/lAbVaLuE/vIrTuAlMaChInEs/vIrTuAlMaChInEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineIDInsensitively(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.LabName != v.Expected.LabName { - t.Fatalf("Expected %q but got %q for LabName", v.Expected.LabName, actual.LabName) - } - - if actual.VirtualMachineName != v.Expected.VirtualMachineName { - t.Fatalf("Expected %q but got %q for VirtualMachineName", v.Expected.VirtualMachineName, actual.VirtualMachineName) - } - - } -} - -func TestSegmentsForVirtualMachineId(t *testing.T) { - segments := VirtualMachineId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineId 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/labservices/2021-10-01-preview/virtualmachine/method_get.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_get.go deleted file mode 100644 index 34d61e1b691..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualmachine - -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 *VirtualMachine -} - -// Get ... -func (c VirtualMachineClient) Get(ctx context.Context, id VirtualMachineId) (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 VirtualMachine - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_labplanssaveimage.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_labplanssaveimage.go deleted file mode 100644 index 5b70b60915b..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_labplanssaveimage.go +++ /dev/null @@ -1,74 +0,0 @@ -package virtualmachine - -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 LabPlansSaveImageOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// LabPlansSaveImage ... -func (c VirtualMachineClient) LabPlansSaveImage(ctx context.Context, id LabPlanId, input SaveImageBody) (result LabPlansSaveImageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/saveImage", 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 -} - -// LabPlansSaveImageThenPoll performs LabPlansSaveImage then polls until it's completed -func (c VirtualMachineClient) LabPlansSaveImageThenPoll(ctx context.Context, id LabPlanId, input SaveImageBody) error { - result, err := c.LabPlansSaveImage(ctx, id, input) - if err != nil { - return fmt.Errorf("performing LabPlansSaveImage: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after LabPlansSaveImage: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_listbylab.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_listbylab.go deleted file mode 100644 index 29ea97c90c5..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_listbylab.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualmachine - -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 ListByLabOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualMachine -} - -type ListByLabCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualMachine -} - -// ListByLab ... -func (c VirtualMachineClient) ListByLab(ctx context.Context, id LabId) (result ListByLabOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualMachines", 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 *[]VirtualMachine `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByLabComplete retrieves all the results into a single object -func (c VirtualMachineClient) ListByLabComplete(ctx context.Context, id LabId) (ListByLabCompleteResult, error) { - return c.ListByLabCompleteMatchingPredicate(ctx, id, VirtualMachineOperationPredicate{}) -} - -// ListByLabCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualMachineClient) ListByLabCompleteMatchingPredicate(ctx context.Context, id LabId, predicate VirtualMachineOperationPredicate) (result ListByLabCompleteResult, err error) { - items := make([]VirtualMachine, 0) - - resp, err := c.ListByLab(ctx, id) - if err != nil { - 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 = ListByLabCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_redeploy.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_redeploy.go deleted file mode 100644 index 4dd7f7d2b98..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_redeploy.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualmachine - -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 RedeployOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Redeploy ... -func (c VirtualMachineClient) Redeploy(ctx context.Context, id VirtualMachineId) (result RedeployOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/redeploy", 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 -} - -// RedeployThenPoll performs Redeploy then polls until it's completed -func (c VirtualMachineClient) RedeployThenPoll(ctx context.Context, id VirtualMachineId) error { - result, err := c.Redeploy(ctx, id) - if err != nil { - return fmt.Errorf("performing Redeploy: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Redeploy: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_reimage.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_reimage.go deleted file mode 100644 index 65e8c996687..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_reimage.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualmachine - -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 ReimageOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Reimage ... -func (c VirtualMachineClient) Reimage(ctx context.Context, id VirtualMachineId) (result ReimageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reimage", 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 -} - -// ReimageThenPoll performs Reimage then polls until it's completed -func (c VirtualMachineClient) ReimageThenPoll(ctx context.Context, id VirtualMachineId) error { - result, err := c.Reimage(ctx, id) - if err != nil { - return fmt.Errorf("performing Reimage: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reimage: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_resetpassword.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_resetpassword.go deleted file mode 100644 index f09ee361234..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_resetpassword.go +++ /dev/null @@ -1,74 +0,0 @@ -package virtualmachine - -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 ResetPasswordOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetPassword ... -func (c VirtualMachineClient) ResetPassword(ctx context.Context, id VirtualMachineId, input ResetPasswordBody) (result ResetPasswordOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetPassword", 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 -} - -// ResetPasswordThenPoll performs ResetPassword then polls until it's completed -func (c VirtualMachineClient) ResetPasswordThenPoll(ctx context.Context, id VirtualMachineId, input ResetPasswordBody) error { - result, err := c.ResetPassword(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ResetPassword: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetPassword: %+v", err) - } - - return nil -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_start.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_start.go deleted file mode 100644 index eed369ce721..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_start.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualmachine - -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 StartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Start ... -func (c VirtualMachineClient) Start(ctx context.Context, id VirtualMachineId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 VirtualMachineClient) StartThenPoll(ctx context.Context, id VirtualMachineId) 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/labservices/2021-10-01-preview/virtualmachine/method_stop.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_stop.go deleted file mode 100644 index c98a618160a..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualmachine - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c VirtualMachineClient) Stop(ctx context.Context, id VirtualMachineId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 VirtualMachineClient) StopThenPoll(ctx context.Context, id VirtualMachineId) 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/labservices/2021-10-01-preview/virtualmachine/model_resetpasswordbody.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_resetpasswordbody.go deleted file mode 100644 index 7336efbc7b9..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_resetpasswordbody.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachine - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResetPasswordBody struct { - Password string `json:"password"` - Username string `json:"username"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_saveimagebody.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_saveimagebody.go deleted file mode 100644 index bce504dba29..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_saveimagebody.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualmachine - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SaveImageBody struct { - LabVirtualMachineId *string `json:"labVirtualMachineId,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachine.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachine.go deleted file mode 100644 index 8841abe08c3..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachine.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualmachine - -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 VirtualMachine struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualMachineProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineconnectionprofile.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineconnectionprofile.go deleted file mode 100644 index f6196aaa3c4..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineconnectionprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualmachine - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineConnectionProfile struct { - AdminUsername *string `json:"adminUsername,omitempty"` - NonAdminUsername *string `json:"nonAdminUsername,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - RdpAuthority *string `json:"rdpAuthority,omitempty"` - RdpInBrowserUrl *string `json:"rdpInBrowserUrl,omitempty"` - SshAuthority *string `json:"sshAuthority,omitempty"` - SshInBrowserUrl *string `json:"sshInBrowserUrl,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineproperties.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineproperties.go deleted file mode 100644 index e1a5e022b22..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/model_virtualmachineproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachine - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineProperties struct { - ClaimedByUserId *string `json:"claimedByUserId,omitempty"` - ConnectionProfile *VirtualMachineConnectionProfile `json:"connectionProfile,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - State *VirtualMachineState `json:"state,omitempty"` - VMType *VirtualMachineType `json:"vmType,omitempty"` -} diff --git a/resource-manager/labservices/2021-10-01-preview/virtualmachine/predicates.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/predicates.go deleted file mode 100644 index ebb8cbbc98d..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualmachine - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualMachineOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p VirtualMachineOperationPredicate) Matches(input VirtualMachine) 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/labservices/2021-10-01-preview/virtualmachine/version.go b/resource-manager/labservices/2021-10-01-preview/virtualmachine/version.go deleted file mode 100644 index 44da2ea6fbf..00000000000 --- a/resource-manager/labservices/2021-10-01-preview/virtualmachine/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualmachine - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-10-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualmachine/%s", defaultApiVersion) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/README.md b/resource-manager/maintenance/2022-07-01-preview/applyupdate/README.md deleted file mode 100644 index f3ce81f4391..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/applyupdate` Documentation - -The `applyupdate` SDK allows for interaction with the Azure Resource Manager Service `maintenance` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/applyupdate" -``` - - -### Client Initialization - -```go -client := applyupdate.NewApplyUpdateClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplyUpdateClient.ForResourceGroupList` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.ForResourceGroupList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplyUpdateClient.List` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -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/maintenance/2022-07-01-preview/applyupdate/client.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/client.go deleted file mode 100644 index 8ace6eb5243..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applyupdate - -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 ApplyUpdateClient struct { - Client *resourcemanager.Client -} - -func NewApplyUpdateClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplyUpdateClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applyupdate", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplyUpdateClient: %+v", err) - } - - return &ApplyUpdateClient{ - Client: client, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/constants.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/constants.go deleted file mode 100644 index 0f1d1595016..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package applyupdate - -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 UpdateStatus string - -const ( - UpdateStatusCompleted UpdateStatus = "Completed" - UpdateStatusInProgress UpdateStatus = "InProgress" - UpdateStatusPending UpdateStatus = "Pending" - UpdateStatusRetryLater UpdateStatus = "RetryLater" - UpdateStatusRetryNow UpdateStatus = "RetryNow" -) - -func PossibleValuesForUpdateStatus() []string { - return []string{ - string(UpdateStatusCompleted), - string(UpdateStatusInProgress), - string(UpdateStatusPending), - string(UpdateStatusRetryLater), - string(UpdateStatusRetryNow), - } -} - -func (s *UpdateStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateStatus(input string) (*UpdateStatus, error) { - vals := map[string]UpdateStatus{ - "completed": UpdateStatusCompleted, - "inprogress": UpdateStatusInProgress, - "pending": UpdateStatusPending, - "retrylater": UpdateStatusRetryLater, - "retrynow": UpdateStatusRetryNow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateStatus(input) - return &out, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/method_forresourcegrouplist.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/method_forresourcegrouplist.go deleted file mode 100644 index 80c204902ae..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/method_forresourcegrouplist.go +++ /dev/null @@ -1,56 +0,0 @@ -package applyupdate - -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 ForResourceGroupListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ListApplyUpdate -} - -// ForResourceGroupList ... -func (c ApplyUpdateClient) ForResourceGroupList(ctx context.Context, id commonids.ResourceGroupId) (result ForResourceGroupListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/applyUpdates", 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 ListApplyUpdate - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/method_list.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/method_list.go deleted file mode 100644 index 3c3c6a89687..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package applyupdate - -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 *ListApplyUpdate -} - -// List ... -func (c ApplyUpdateClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/applyUpdates", 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 ListApplyUpdate - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdate.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdate.go deleted file mode 100644 index 1f8ea2a9c02..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdate.go +++ /dev/null @@ -1,16 +0,0 @@ -package applyupdate - -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 ApplyUpdate struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplyUpdateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdateproperties.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdateproperties.go deleted file mode 100644 index 56a95dd2f31..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_applyupdateproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package applyupdate - -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 ApplyUpdateProperties struct { - LastUpdateTime *string `json:"lastUpdateTime,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Status *UpdateStatus `json:"status,omitempty"` -} - -func (o *ApplyUpdateProperties) GetLastUpdateTimeAsTime() (*time.Time, error) { - if o.LastUpdateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ApplyUpdateProperties) SetLastUpdateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdateTime = &formatted -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_listapplyupdate.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_listapplyupdate.go deleted file mode 100644 index dbd402cf3b4..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/model_listapplyupdate.go +++ /dev/null @@ -1,8 +0,0 @@ -package applyupdate - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListApplyUpdate struct { - Value *[]ApplyUpdate `json:"value,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdate/version.go b/resource-manager/maintenance/2022-07-01-preview/applyupdate/version.go deleted file mode 100644 index 6c6a5cbcaa4..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdate/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applyupdate - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applyupdate/%s", defaultApiVersion) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/README.md b/resource-manager/maintenance/2022-07-01-preview/applyupdates/README.md deleted file mode 100644 index 754dbd8617f..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/README.md +++ /dev/null @@ -1,85 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/applyupdates` Documentation - -The `applyupdates` SDK allows for interaction with the Azure Resource Manager Service `maintenance` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/applyupdates" -``` - - -### Client Initialization - -```go -client := applyupdates.NewApplyUpdatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplyUpdatesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -read, err := client.CreateOrUpdate(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplyUpdatesClient.CreateOrUpdateParent` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -read, err := client.CreateOrUpdateParent(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplyUpdatesClient.Get` - -```go -ctx := context.TODO() -id := applyupdates.NewScopedApplyUpdateID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "applyUpdateValue") - -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: `ApplyUpdatesClient.GetParent` - -```go -ctx := context.TODO() -id := applyupdates.NewScopedApplyUpdateID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "applyUpdateValue") - -read, err := client.GetParent(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/maintenance/2022-07-01-preview/applyupdates/client.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/client.go deleted file mode 100644 index d1ba86cc002..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applyupdates - -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 ApplyUpdatesClient struct { - Client *resourcemanager.Client -} - -func NewApplyUpdatesClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplyUpdatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applyupdates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplyUpdatesClient: %+v", err) - } - - return &ApplyUpdatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/constants.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/constants.go deleted file mode 100644 index 3f7e14f91fd..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package applyupdates - -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 UpdateStatus string - -const ( - UpdateStatusCompleted UpdateStatus = "Completed" - UpdateStatusInProgress UpdateStatus = "InProgress" - UpdateStatusPending UpdateStatus = "Pending" - UpdateStatusRetryLater UpdateStatus = "RetryLater" - UpdateStatusRetryNow UpdateStatus = "RetryNow" -) - -func PossibleValuesForUpdateStatus() []string { - return []string{ - string(UpdateStatusCompleted), - string(UpdateStatusInProgress), - string(UpdateStatusPending), - string(UpdateStatusRetryLater), - string(UpdateStatusRetryNow), - } -} - -func (s *UpdateStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateStatus(input string) (*UpdateStatus, error) { - vals := map[string]UpdateStatus{ - "completed": UpdateStatusCompleted, - "inprogress": UpdateStatusInProgress, - "pending": UpdateStatusPending, - "retrylater": UpdateStatusRetryLater, - "retrynow": UpdateStatusRetryNow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateStatus(input) - return &out, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate.go deleted file mode 100644 index ef2f182daad..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate.go +++ /dev/null @@ -1,120 +0,0 @@ -package applyupdates - -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(&ScopedApplyUpdateId{}) -} - -var _ resourceids.ResourceId = &ScopedApplyUpdateId{} - -// ScopedApplyUpdateId is a struct representing the Resource ID for a Scoped Apply Update -type ScopedApplyUpdateId struct { - Scope string - ApplyUpdateName string -} - -// NewScopedApplyUpdateID returns a new ScopedApplyUpdateId struct -func NewScopedApplyUpdateID(scope string, applyUpdateName string) ScopedApplyUpdateId { - return ScopedApplyUpdateId{ - Scope: scope, - ApplyUpdateName: applyUpdateName, - } -} - -// ParseScopedApplyUpdateID parses 'input' into a ScopedApplyUpdateId -func ParseScopedApplyUpdateID(input string) (*ScopedApplyUpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedApplyUpdateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedApplyUpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedApplyUpdateIDInsensitively parses 'input' case-insensitively into a ScopedApplyUpdateId -// note: this method should only be used for API response data and not user input -func ParseScopedApplyUpdateIDInsensitively(input string) (*ScopedApplyUpdateId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedApplyUpdateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedApplyUpdateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedApplyUpdateId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.ApplyUpdateName, ok = input.Parsed["applyUpdateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applyUpdateName", input) - } - - return nil -} - -// ValidateScopedApplyUpdateID checks that 'input' can be parsed as a Scoped Apply Update ID -func ValidateScopedApplyUpdateID(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 := ParseScopedApplyUpdateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Apply Update ID -func (id ScopedApplyUpdateId) ID() string { - fmtString := "/%s/providers/Microsoft.Maintenance/applyUpdates/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.ApplyUpdateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Apply Update ID -func (id ScopedApplyUpdateId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftMaintenance", "Microsoft.Maintenance", "Microsoft.Maintenance"), - resourceids.StaticSegment("staticApplyUpdates", "applyUpdates", "applyUpdates"), - resourceids.UserSpecifiedSegment("applyUpdateName", "applyUpdateValue"), - } -} - -// String returns a human-readable description of this Scoped Apply Update ID -func (id ScopedApplyUpdateId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Apply Update Name: %q", id.ApplyUpdateName), - } - return fmt.Sprintf("Scoped Apply Update (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate_test.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate_test.go deleted file mode 100644 index 16587f4c421..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/id_scopedapplyupdate_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package applyupdates - -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 = &ScopedApplyUpdateId{} - -func TestNewScopedApplyUpdateID(t *testing.T) { - id := NewScopedApplyUpdateID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "applyUpdateValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.ApplyUpdateName != "applyUpdateValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplyUpdateName'", id.ApplyUpdateName, "applyUpdateValue") - } -} - -func TestFormatScopedApplyUpdateID(t *testing.T) { - actual := NewScopedApplyUpdateID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "applyUpdateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates/applyUpdateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedApplyUpdateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedApplyUpdateId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates/applyUpdateValue", - Expected: &ScopedApplyUpdateId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ApplyUpdateName: "applyUpdateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates/applyUpdateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedApplyUpdateID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ApplyUpdateName != v.Expected.ApplyUpdateName { - t.Fatalf("Expected %q but got %q for ApplyUpdateName", v.Expected.ApplyUpdateName, actual.ApplyUpdateName) - } - - } -} - -func TestParseScopedApplyUpdateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedApplyUpdateId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/aPpLyUpDaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates/applyUpdateValue", - Expected: &ScopedApplyUpdateId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ApplyUpdateName: "applyUpdateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/applyUpdates/applyUpdateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/aPpLyUpDaTeS/aPpLyUpDaTeVaLuE", - Expected: &ScopedApplyUpdateId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ApplyUpdateName: "aPpLyUpDaTeVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/aPpLyUpDaTeS/aPpLyUpDaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedApplyUpdateIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ApplyUpdateName != v.Expected.ApplyUpdateName { - t.Fatalf("Expected %q but got %q for ApplyUpdateName", v.Expected.ApplyUpdateName, actual.ApplyUpdateName) - } - - } -} - -func TestSegmentsForScopedApplyUpdateId(t *testing.T) { - segments := ScopedApplyUpdateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedApplyUpdateId 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/maintenance/2022-07-01-preview/applyupdates/method_createorupdate.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdate.go deleted file mode 100644 index 370302b5ad5..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdate.go +++ /dev/null @@ -1,56 +0,0 @@ -package applyupdates - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplyUpdate -} - -// CreateOrUpdate ... -func (c ApplyUpdatesClient) CreateOrUpdate(ctx context.Context, id commonids.ScopeId) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/applyUpdates/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 ApplyUpdate - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdateparent.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdateparent.go deleted file mode 100644 index e61c2bbd85d..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_createorupdateparent.go +++ /dev/null @@ -1,56 +0,0 @@ -package applyupdates - -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 CreateOrUpdateParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplyUpdate -} - -// CreateOrUpdateParent ... -func (c ApplyUpdatesClient) CreateOrUpdateParent(ctx context.Context, id commonids.ScopeId) (result CreateOrUpdateParentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/applyUpdates/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 ApplyUpdate - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_get.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_get.go deleted file mode 100644 index 5a233aec216..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applyupdates - -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 *ApplyUpdate -} - -// Get ... -func (c ApplyUpdatesClient) Get(ctx context.Context, id ScopedApplyUpdateId) (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 ApplyUpdate - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_getparent.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_getparent.go deleted file mode 100644 index cd012cf3c62..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/method_getparent.go +++ /dev/null @@ -1,54 +0,0 @@ -package applyupdates - -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 GetParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplyUpdate -} - -// GetParent ... -func (c ApplyUpdatesClient) GetParent(ctx context.Context, id ScopedApplyUpdateId) (result GetParentOperationResponse, 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 ApplyUpdate - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdate.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdate.go deleted file mode 100644 index 7a30c50526a..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdate.go +++ /dev/null @@ -1,16 +0,0 @@ -package applyupdates - -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 ApplyUpdate struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplyUpdateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdateproperties.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdateproperties.go deleted file mode 100644 index 5cd3a757a92..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/model_applyupdateproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package applyupdates - -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 ApplyUpdateProperties struct { - LastUpdateTime *string `json:"lastUpdateTime,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Status *UpdateStatus `json:"status,omitempty"` -} - -func (o *ApplyUpdateProperties) GetLastUpdateTimeAsTime() (*time.Time, error) { - if o.LastUpdateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ApplyUpdateProperties) SetLastUpdateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdateTime = &formatted -} diff --git a/resource-manager/maintenance/2022-07-01-preview/applyupdates/version.go b/resource-manager/maintenance/2022-07-01-preview/applyupdates/version.go deleted file mode 100644 index 79c624bebce..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/applyupdates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applyupdates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applyupdates/%s", defaultApiVersion) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/client.go b/resource-manager/maintenance/2022-07-01-preview/client.go deleted file mode 100644 index 2ee74e77067..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/client.go +++ /dev/null @@ -1,73 +0,0 @@ -package v2022_07_01_preview - -// 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/maintenance/2022-07-01-preview/applyupdate" - "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/applyupdates" - "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/configurationassignments" - "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/updates" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - ApplyUpdate *applyupdate.ApplyUpdateClient - ApplyUpdates *applyupdates.ApplyUpdatesClient - ConfigurationAssignments *configurationassignments.ConfigurationAssignmentsClient - MaintenanceConfigurations *maintenanceconfigurations.MaintenanceConfigurationsClient - PublicMaintenanceConfigurations *publicmaintenanceconfigurations.PublicMaintenanceConfigurationsClient - Updates *updates.UpdatesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - applyUpdateClient, err := applyupdate.NewApplyUpdateClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplyUpdate client: %+v", err) - } - configureFunc(applyUpdateClient.Client) - - applyUpdatesClient, err := applyupdates.NewApplyUpdatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplyUpdates client: %+v", err) - } - configureFunc(applyUpdatesClient.Client) - - configurationAssignmentsClient, err := configurationassignments.NewConfigurationAssignmentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConfigurationAssignments client: %+v", err) - } - configureFunc(configurationAssignmentsClient.Client) - - maintenanceConfigurationsClient, err := maintenanceconfigurations.NewMaintenanceConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building MaintenanceConfigurations client: %+v", err) - } - configureFunc(maintenanceConfigurationsClient.Client) - - publicMaintenanceConfigurationsClient, err := publicmaintenanceconfigurations.NewPublicMaintenanceConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicMaintenanceConfigurations client: %+v", err) - } - configureFunc(publicMaintenanceConfigurationsClient.Client) - - updatesClient, err := updates.NewUpdatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Updates client: %+v", err) - } - configureFunc(updatesClient.Client) - - return &Client{ - ApplyUpdate: applyUpdateClient, - ApplyUpdates: applyUpdatesClient, - ConfigurationAssignments: configurationAssignmentsClient, - MaintenanceConfigurations: maintenanceConfigurationsClient, - PublicMaintenanceConfigurations: publicMaintenanceConfigurationsClient, - Updates: updatesClient, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/README.md b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/README.md deleted file mode 100644 index e92b4772872..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/README.md +++ /dev/null @@ -1,175 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/configurationassignments` Documentation - -The `configurationassignments` SDK allows for interaction with the Azure Resource Manager Service `maintenance` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/configurationassignments" -``` - - -### Client Initialization - -```go -client := configurationassignments.NewConfigurationAssignmentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConfigurationAssignmentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := configurationassignments.NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - -payload := configurationassignments.ConfigurationAssignment{ - // ... -} - - -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: `ConfigurationAssignmentsClient.CreateOrUpdateParent` - -```go -ctx := context.TODO() -id := configurationassignments.NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - -payload := configurationassignments.ConfigurationAssignment{ - // ... -} - - -read, err := client.CreateOrUpdateParent(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ConfigurationAssignmentsClient.Delete` - -```go -ctx := context.TODO() -id := configurationassignments.NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - -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: `ConfigurationAssignmentsClient.DeleteParent` - -```go -ctx := context.TODO() -id := configurationassignments.NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - -read, err := client.DeleteParent(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ConfigurationAssignmentsClient.Get` - -```go -ctx := context.TODO() -id := configurationassignments.NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - -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: `ConfigurationAssignmentsClient.GetParent` - -```go -ctx := context.TODO() -id := configurationassignments.NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - -read, err := client.GetParent(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ConfigurationAssignmentsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -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: `ConfigurationAssignmentsClient.ListParent` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -read, err := client.ListParent(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ConfigurationAssignmentsClient.WithinSubscriptionList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.WithinSubscriptionList(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/maintenance/2022-07-01-preview/configurationassignments/client.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/client.go deleted file mode 100644 index dbc7cab57fc..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package configurationassignments - -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 ConfigurationAssignmentsClient struct { - Client *resourcemanager.Client -} - -func NewConfigurationAssignmentsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConfigurationAssignmentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "configurationassignments", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConfigurationAssignmentsClient: %+v", err) - } - - return &ConfigurationAssignmentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment.go deleted file mode 100644 index 5116ef22e5c..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment.go +++ /dev/null @@ -1,120 +0,0 @@ -package configurationassignments - -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(&ScopedConfigurationAssignmentId{}) -} - -var _ resourceids.ResourceId = &ScopedConfigurationAssignmentId{} - -// ScopedConfigurationAssignmentId is a struct representing the Resource ID for a Scoped Configuration Assignment -type ScopedConfigurationAssignmentId struct { - Scope string - ConfigurationAssignmentName string -} - -// NewScopedConfigurationAssignmentID returns a new ScopedConfigurationAssignmentId struct -func NewScopedConfigurationAssignmentID(scope string, configurationAssignmentName string) ScopedConfigurationAssignmentId { - return ScopedConfigurationAssignmentId{ - Scope: scope, - ConfigurationAssignmentName: configurationAssignmentName, - } -} - -// ParseScopedConfigurationAssignmentID parses 'input' into a ScopedConfigurationAssignmentId -func ParseScopedConfigurationAssignmentID(input string) (*ScopedConfigurationAssignmentId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedConfigurationAssignmentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedConfigurationAssignmentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedConfigurationAssignmentIDInsensitively parses 'input' case-insensitively into a ScopedConfigurationAssignmentId -// note: this method should only be used for API response data and not user input -func ParseScopedConfigurationAssignmentIDInsensitively(input string) (*ScopedConfigurationAssignmentId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedConfigurationAssignmentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedConfigurationAssignmentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedConfigurationAssignmentId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.ConfigurationAssignmentName, ok = input.Parsed["configurationAssignmentName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "configurationAssignmentName", input) - } - - return nil -} - -// ValidateScopedConfigurationAssignmentID checks that 'input' can be parsed as a Scoped Configuration Assignment ID -func ValidateScopedConfigurationAssignmentID(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 := ParseScopedConfigurationAssignmentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Configuration Assignment ID -func (id ScopedConfigurationAssignmentId) ID() string { - fmtString := "/%s/providers/Microsoft.Maintenance/configurationAssignments/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.ConfigurationAssignmentName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Configuration Assignment ID -func (id ScopedConfigurationAssignmentId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftMaintenance", "Microsoft.Maintenance", "Microsoft.Maintenance"), - resourceids.StaticSegment("staticConfigurationAssignments", "configurationAssignments", "configurationAssignments"), - resourceids.UserSpecifiedSegment("configurationAssignmentName", "configurationAssignmentValue"), - } -} - -// String returns a human-readable description of this Scoped Configuration Assignment ID -func (id ScopedConfigurationAssignmentId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Configuration Assignment Name: %q", id.ConfigurationAssignmentName), - } - return fmt.Sprintf("Scoped Configuration Assignment (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment_test.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment_test.go deleted file mode 100644 index 80cd01558ca..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/id_scopedconfigurationassignment_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package configurationassignments - -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 = &ScopedConfigurationAssignmentId{} - -func TestNewScopedConfigurationAssignmentID(t *testing.T) { - id := NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.ConfigurationAssignmentName != "configurationAssignmentValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationAssignmentName'", id.ConfigurationAssignmentName, "configurationAssignmentValue") - } -} - -func TestFormatScopedConfigurationAssignmentID(t *testing.T) { - actual := NewScopedConfigurationAssignmentID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "configurationAssignmentValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments/configurationAssignmentValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedConfigurationAssignmentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedConfigurationAssignmentId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments/configurationAssignmentValue", - Expected: &ScopedConfigurationAssignmentId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ConfigurationAssignmentName: "configurationAssignmentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments/configurationAssignmentValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedConfigurationAssignmentID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ConfigurationAssignmentName != v.Expected.ConfigurationAssignmentName { - t.Fatalf("Expected %q but got %q for ConfigurationAssignmentName", v.Expected.ConfigurationAssignmentName, actual.ConfigurationAssignmentName) - } - - } -} - -func TestParseScopedConfigurationAssignmentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedConfigurationAssignmentId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/cOnFiGuRaTiOnAsSiGnMeNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments/configurationAssignmentValue", - Expected: &ScopedConfigurationAssignmentId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ConfigurationAssignmentName: "configurationAssignmentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Maintenance/configurationAssignments/configurationAssignmentValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/cOnFiGuRaTiOnAsSiGnMeNtS/cOnFiGuRaTiOnAsSiGnMeNtVaLuE", - Expected: &ScopedConfigurationAssignmentId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ConfigurationAssignmentName: "cOnFiGuRaTiOnAsSiGnMeNtVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/cOnFiGuRaTiOnAsSiGnMeNtS/cOnFiGuRaTiOnAsSiGnMeNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedConfigurationAssignmentIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ConfigurationAssignmentName != v.Expected.ConfigurationAssignmentName { - t.Fatalf("Expected %q but got %q for ConfigurationAssignmentName", v.Expected.ConfigurationAssignmentName, actual.ConfigurationAssignmentName) - } - - } -} - -func TestSegmentsForScopedConfigurationAssignmentId(t *testing.T) { - segments := ScopedConfigurationAssignmentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedConfigurationAssignmentId 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/maintenance/2022-07-01-preview/configurationassignments/method_createorupdate.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdate.go deleted file mode 100644 index 03c1cbce57e..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package configurationassignments - -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 *ConfigurationAssignment -} - -// CreateOrUpdate ... -func (c ConfigurationAssignmentsClient) CreateOrUpdate(ctx context.Context, id ScopedConfigurationAssignmentId, input ConfigurationAssignment) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 ConfigurationAssignment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdateparent.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdateparent.go deleted file mode 100644 index a33dc94f21d..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_createorupdateparent.go +++ /dev/null @@ -1,58 +0,0 @@ -package configurationassignments - -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 CreateOrUpdateParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ConfigurationAssignment -} - -// CreateOrUpdateParent ... -func (c ConfigurationAssignmentsClient) CreateOrUpdateParent(ctx context.Context, id ScopedConfigurationAssignmentId, input ConfigurationAssignment) (result CreateOrUpdateParentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 ConfigurationAssignment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_delete.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_delete.go deleted file mode 100644 index 4158a6dc0df..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_delete.go +++ /dev/null @@ -1,55 +0,0 @@ -package configurationassignments - -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 - Model *ConfigurationAssignment -} - -// Delete ... -func (c ConfigurationAssignmentsClient) Delete(ctx context.Context, id ScopedConfigurationAssignmentId) (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 - } - - var model ConfigurationAssignment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_deleteparent.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_deleteparent.go deleted file mode 100644 index 0d55ebaa028..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_deleteparent.go +++ /dev/null @@ -1,55 +0,0 @@ -package configurationassignments - -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 DeleteParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ConfigurationAssignment -} - -// DeleteParent ... -func (c ConfigurationAssignmentsClient) DeleteParent(ctx context.Context, id ScopedConfigurationAssignmentId) (result DeleteParentOperationResponse, 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 - } - - var model ConfigurationAssignment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_get.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_get.go deleted file mode 100644 index cb060af0383..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package configurationassignments - -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 *ConfigurationAssignment -} - -// Get ... -func (c ConfigurationAssignmentsClient) Get(ctx context.Context, id ScopedConfigurationAssignmentId) (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 ConfigurationAssignment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_getparent.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_getparent.go deleted file mode 100644 index 961071ecc98..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_getparent.go +++ /dev/null @@ -1,54 +0,0 @@ -package configurationassignments - -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 GetParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ConfigurationAssignment -} - -// GetParent ... -func (c ConfigurationAssignmentsClient) GetParent(ctx context.Context, id ScopedConfigurationAssignmentId) (result GetParentOperationResponse, 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 ConfigurationAssignment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_list.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_list.go deleted file mode 100644 index 894ad2592c8..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package configurationassignments - -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 *ListConfigurationAssignmentsResult -} - -// List ... -func (c ConfigurationAssignmentsClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/configurationAssignments", 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 ListConfigurationAssignmentsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_listparent.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_listparent.go deleted file mode 100644 index 0a06ca63c37..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_listparent.go +++ /dev/null @@ -1,56 +0,0 @@ -package configurationassignments - -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 ListParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ListConfigurationAssignmentsResult -} - -// ListParent ... -func (c ConfigurationAssignmentsClient) ListParent(ctx context.Context, id commonids.ScopeId) (result ListParentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/configurationAssignments", 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 ListConfigurationAssignmentsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_withinsubscriptionlist.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_withinsubscriptionlist.go deleted file mode 100644 index ef7117fe32f..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/method_withinsubscriptionlist.go +++ /dev/null @@ -1,56 +0,0 @@ -package configurationassignments - -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 WithinSubscriptionListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ListConfigurationAssignmentsResult -} - -// WithinSubscriptionList ... -func (c ConfigurationAssignmentsClient) WithinSubscriptionList(ctx context.Context, id commonids.SubscriptionId) (result WithinSubscriptionListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/configurationAssignments", 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 ListConfigurationAssignmentsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignment.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignment.go deleted file mode 100644 index 99db0c67db7..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignment.go +++ /dev/null @@ -1,17 +0,0 @@ -package configurationassignments - -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 ConfigurationAssignment struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ConfigurationAssignmentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignmentproperties.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignmentproperties.go deleted file mode 100644 index 6f3b76b88e9..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_configurationassignmentproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package configurationassignments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationAssignmentProperties struct { - MaintenanceConfigurationId *string `json:"maintenanceConfigurationId,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_listconfigurationassignmentsresult.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_listconfigurationassignmentsresult.go deleted file mode 100644 index 3a98d44c95c..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/model_listconfigurationassignmentsresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package configurationassignments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListConfigurationAssignmentsResult struct { - Value *[]ConfigurationAssignment `json:"value,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/version.go b/resource-manager/maintenance/2022-07-01-preview/configurationassignments/version.go deleted file mode 100644 index b152d509fa2..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/configurationassignments/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package configurationassignments - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/configurationassignments/%s", defaultApiVersion) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/README.md b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/README.md deleted file mode 100644 index 3647244df13..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/README.md +++ /dev/null @@ -1,127 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations` Documentation - -The `maintenanceconfigurations` SDK allows for interaction with the Azure Resource Manager Service `maintenance` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/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", "maintenanceConfigurationValue") - -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", "maintenanceConfigurationValue") - -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.ForResourceGroupList` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.ForResourceGroupList(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", "maintenanceConfigurationValue") - -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.List` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -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: `MaintenanceConfigurationsClient.Update` - -```go -ctx := context.TODO() -id := maintenanceconfigurations.NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationValue") - -payload := maintenanceconfigurations.MaintenanceConfiguration{ - // ... -} - - -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/maintenance/2022-07-01-preview/maintenanceconfigurations/client.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/client.go deleted file mode 100644 index 4d799de617c..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -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.NewResourceManagerClient(sdkApi, "maintenanceconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating MaintenanceConfigurationsClient: %+v", err) - } - - return &MaintenanceConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/constants.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/constants.go deleted file mode 100644 index fa773a76e0d..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/constants.go +++ /dev/null @@ -1,192 +0,0 @@ -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 MaintenanceScope string - -const ( - MaintenanceScopeExtension MaintenanceScope = "Extension" - MaintenanceScopeHost MaintenanceScope = "Host" - MaintenanceScopeInGuestPatch MaintenanceScope = "InGuestPatch" - MaintenanceScopeOSImage MaintenanceScope = "OSImage" - MaintenanceScopeResource MaintenanceScope = "Resource" - MaintenanceScopeSQLDB MaintenanceScope = "SQLDB" - MaintenanceScopeSQLManagedInstance MaintenanceScope = "SQLManagedInstance" -) - -func PossibleValuesForMaintenanceScope() []string { - return []string{ - string(MaintenanceScopeExtension), - string(MaintenanceScopeHost), - string(MaintenanceScopeInGuestPatch), - string(MaintenanceScopeOSImage), - string(MaintenanceScopeResource), - string(MaintenanceScopeSQLDB), - string(MaintenanceScopeSQLManagedInstance), - } -} - -func (s *MaintenanceScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMaintenanceScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMaintenanceScope(input string) (*MaintenanceScope, error) { - vals := map[string]MaintenanceScope{ - "extension": MaintenanceScopeExtension, - "host": MaintenanceScopeHost, - "inguestpatch": MaintenanceScopeInGuestPatch, - "osimage": MaintenanceScopeOSImage, - "resource": MaintenanceScopeResource, - "sqldb": MaintenanceScopeSQLDB, - "sqlmanagedinstance": MaintenanceScopeSQLManagedInstance, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MaintenanceScope(input) - return &out, nil -} - -type RebootOptions string - -const ( - RebootOptionsAlways RebootOptions = "Always" - RebootOptionsIfRequired RebootOptions = "IfRequired" - RebootOptionsNever RebootOptions = "Never" -) - -func PossibleValuesForRebootOptions() []string { - return []string{ - string(RebootOptionsAlways), - string(RebootOptionsIfRequired), - string(RebootOptionsNever), - } -} - -func (s *RebootOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRebootOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRebootOptions(input string) (*RebootOptions, error) { - vals := map[string]RebootOptions{ - "always": RebootOptionsAlways, - "ifrequired": RebootOptionsIfRequired, - "never": RebootOptionsNever, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RebootOptions(input) - return &out, nil -} - -type TaskScope string - -const ( - TaskScopeGlobal TaskScope = "Global" - TaskScopeResource TaskScope = "Resource" -) - -func PossibleValuesForTaskScope() []string { - return []string{ - string(TaskScopeGlobal), - string(TaskScopeResource), - } -} - -func (s *TaskScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTaskScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTaskScope(input string) (*TaskScope, error) { - vals := map[string]TaskScope{ - "global": TaskScopeGlobal, - "resource": TaskScopeResource, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TaskScope(input) - return &out, nil -} - -type Visibility string - -const ( - VisibilityCustom Visibility = "Custom" - VisibilityPublic Visibility = "Public" -) - -func PossibleValuesForVisibility() []string { - return []string{ - string(VisibilityCustom), - string(VisibilityPublic), - } -} - -func (s *Visibility) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVisibility(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVisibility(input string) (*Visibility, error) { - vals := map[string]Visibility{ - "custom": VisibilityCustom, - "public": VisibilityPublic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Visibility(input) - return &out, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration.go deleted file mode 100644 index ce2ff107815..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -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 - MaintenanceConfigurationName string -} - -// NewMaintenanceConfigurationID returns a new MaintenanceConfigurationId struct -func NewMaintenanceConfigurationID(subscriptionId string, resourceGroupName string, maintenanceConfigurationName string) MaintenanceConfigurationId { - return MaintenanceConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - 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.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.Maintenance/maintenanceConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, 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("staticMicrosoftMaintenance", "Microsoft.Maintenance", "Microsoft.Maintenance"), - resourceids.StaticSegment("staticMaintenanceConfigurations", "maintenanceConfigurations", "maintenanceConfigurations"), - resourceids.UserSpecifiedSegment("maintenanceConfigurationName", "maintenanceConfigurationValue"), - } -} - -// 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("Maintenance Configuration Name: %q", id.MaintenanceConfigurationName), - } - return fmt.Sprintf("Maintenance Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go deleted file mode 100644 index e069472cd3b..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/id_maintenanceconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -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", "maintenanceConfigurationValue") - - 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.MaintenanceConfigurationName != "maintenanceConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'MaintenanceConfigurationName'", id.MaintenanceConfigurationName, "maintenanceConfigurationValue") - } -} - -func TestFormatMaintenanceConfigurationID(t *testing.T) { - actual := NewMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "maintenanceConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationValue" - 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.Maintenance", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationValue", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - MaintenanceConfigurationName: "maintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationValue/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.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.Maintenance", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationValue", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - MaintenanceConfigurationName: "maintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Maintenance/maintenanceConfigurations/maintenanceConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - Expected: &MaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - MaintenanceConfigurationName: "mAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.mAiNtEnAnCe/mAiNtEnAnCeCoNfIgUrAtIoNs/mAiNtEnAnCeCoNfIgUrAtIoNvAlUe/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.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/maintenance/2022-07-01-preview/maintenanceconfigurations/method_createorupdate.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_createorupdate.go deleted file mode 100644 index 726183cac89..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_createorupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package maintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// CreateOrUpdate ... -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{ - 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_delete.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_delete.go deleted file mode 100644 index a00ea8abc55..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_delete.go +++ /dev/null @@ -1,55 +0,0 @@ -package maintenanceconfigurations - -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 - Model *MaintenanceConfiguration -} - -// 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.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 - } - - var model MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_forresourcegrouplist.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_forresourcegrouplist.go deleted file mode 100644 index e2a9aedb64c..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_forresourcegrouplist.go +++ /dev/null @@ -1,56 +0,0 @@ -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 ForResourceGroupListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ListMaintenanceConfigurationsResult -} - -// ForResourceGroupList ... -func (c MaintenanceConfigurationsClient) ForResourceGroupList(ctx context.Context, id commonids.ResourceGroupId) (result ForResourceGroupListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/maintenanceConfigurations", 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 ListMaintenanceConfigurationsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_get.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_get.go deleted file mode 100644 index 6ea658ab6d5..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package maintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// Get ... -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: 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_list.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_list.go deleted file mode 100644 index a742d808133..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -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 ListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ListMaintenanceConfigurationsResult -} - -// List ... -func (c MaintenanceConfigurationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/maintenanceConfigurations", 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 ListMaintenanceConfigurationsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_update.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_update.go deleted file mode 100644 index 61b09309274..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package maintenanceconfigurations - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MaintenanceConfiguration -} - -// Update ... -func (c MaintenanceConfigurationsClient) Update(ctx context.Context, id MaintenanceConfigurationId, input MaintenanceConfiguration) (result UpdateOperationResponse, 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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputlinuxparameters.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputlinuxparameters.go deleted file mode 100644 index 4612a10f834..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputlinuxparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -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 InputLinuxParameters struct { - ClassificationsToInclude *[]string `json:"classificationsToInclude,omitempty"` - PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` - PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputpatchconfiguration.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputpatchconfiguration.go deleted file mode 100644 index 9ba001e642d..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputpatchconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -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 InputPatchConfiguration struct { - LinuxParameters *InputLinuxParameters `json:"linuxParameters,omitempty"` - RebootSetting *RebootOptions `json:"rebootSetting,omitempty"` - Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` - WindowsParameters *InputWindowsParameters `json:"windowsParameters,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputwindowsparameters.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputwindowsparameters.go deleted file mode 100644 index 427d3a70432..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_inputwindowsparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -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 InputWindowsParameters struct { - ClassificationsToInclude *[]string `json:"classificationsToInclude,omitempty"` - ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` - KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` - KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_listmaintenanceconfigurationsresult.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_listmaintenanceconfigurationsresult.go deleted file mode 100644 index d43447c158e..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_listmaintenanceconfigurationsresult.go +++ /dev/null @@ -1,8 +0,0 @@ -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 ListMaintenanceConfigurationsResult struct { - Value *[]MaintenanceConfiguration `json:"value,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfiguration.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfiguration.go deleted file mode 100644 index dc98b878e51..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfiguration.go +++ /dev/null @@ -1,18 +0,0 @@ -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"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *MaintenanceConfigurationProperties `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/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go deleted file mode 100644 index fa7143da8d3..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenanceconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -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 { - ExtensionProperties *map[string]string `json:"extensionProperties,omitempty"` - InstallPatches *InputPatchConfiguration `json:"installPatches,omitempty"` - MaintenanceScope *MaintenanceScope `json:"maintenanceScope,omitempty"` - MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Visibility *Visibility `json:"visibility,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenancewindow.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenancewindow.go deleted file mode 100644 index 6029080ddaa..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_maintenancewindow.go +++ /dev/null @@ -1,12 +0,0 @@ -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 { - Duration *string `json:"duration,omitempty"` - ExpirationDateTime *string `json:"expirationDateTime,omitempty"` - RecurEvery *string `json:"recurEvery,omitempty"` - StartDateTime *string `json:"startDateTime,omitempty"` - TimeZone *string `json:"timeZone,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_softwareupdateconfigurationtasks.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_softwareupdateconfigurationtasks.go deleted file mode 100644 index 5585e4a2113..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_softwareupdateconfigurationtasks.go +++ /dev/null @@ -1,9 +0,0 @@ -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 SoftwareUpdateConfigurationTasks struct { - PostTasks *[]TaskProperties `json:"postTasks,omitempty"` - PreTasks *[]TaskProperties `json:"preTasks,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_taskproperties.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_taskproperties.go deleted file mode 100644 index 709f6502c39..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/model_taskproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -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 TaskProperties struct { - Parameters *map[string]string `json:"parameters,omitempty"` - Source *string `json:"source,omitempty"` - TaskScope *TaskScope `json:"taskScope,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/version.go b/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/version.go deleted file mode 100644 index 5039de6e0e2..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/maintenanceconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package maintenanceconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/maintenanceconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/README.md b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/README.md deleted file mode 100644 index 323169c8d42..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations` Documentation - -The `publicmaintenanceconfigurations` SDK allows for interaction with the Azure Resource Manager Service `maintenance` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations" -``` - - -### Client Initialization - -```go -client := publicmaintenanceconfigurations.NewPublicMaintenanceConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicMaintenanceConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := publicmaintenanceconfigurations.NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "publicMaintenanceConfigurationValue") - -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: `PublicMaintenanceConfigurationsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -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/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/client.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/client.go deleted file mode 100644 index 79ca5fc9e3c..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicmaintenanceconfigurations - -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 PublicMaintenanceConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewPublicMaintenanceConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*PublicMaintenanceConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publicmaintenanceconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublicMaintenanceConfigurationsClient: %+v", err) - } - - return &PublicMaintenanceConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/constants.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/constants.go deleted file mode 100644 index fac0aaca237..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/constants.go +++ /dev/null @@ -1,192 +0,0 @@ -package publicmaintenanceconfigurations - -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 MaintenanceScope string - -const ( - MaintenanceScopeExtension MaintenanceScope = "Extension" - MaintenanceScopeHost MaintenanceScope = "Host" - MaintenanceScopeInGuestPatch MaintenanceScope = "InGuestPatch" - MaintenanceScopeOSImage MaintenanceScope = "OSImage" - MaintenanceScopeResource MaintenanceScope = "Resource" - MaintenanceScopeSQLDB MaintenanceScope = "SQLDB" - MaintenanceScopeSQLManagedInstance MaintenanceScope = "SQLManagedInstance" -) - -func PossibleValuesForMaintenanceScope() []string { - return []string{ - string(MaintenanceScopeExtension), - string(MaintenanceScopeHost), - string(MaintenanceScopeInGuestPatch), - string(MaintenanceScopeOSImage), - string(MaintenanceScopeResource), - string(MaintenanceScopeSQLDB), - string(MaintenanceScopeSQLManagedInstance), - } -} - -func (s *MaintenanceScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMaintenanceScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMaintenanceScope(input string) (*MaintenanceScope, error) { - vals := map[string]MaintenanceScope{ - "extension": MaintenanceScopeExtension, - "host": MaintenanceScopeHost, - "inguestpatch": MaintenanceScopeInGuestPatch, - "osimage": MaintenanceScopeOSImage, - "resource": MaintenanceScopeResource, - "sqldb": MaintenanceScopeSQLDB, - "sqlmanagedinstance": MaintenanceScopeSQLManagedInstance, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MaintenanceScope(input) - return &out, nil -} - -type RebootOptions string - -const ( - RebootOptionsAlways RebootOptions = "Always" - RebootOptionsIfRequired RebootOptions = "IfRequired" - RebootOptionsNever RebootOptions = "Never" -) - -func PossibleValuesForRebootOptions() []string { - return []string{ - string(RebootOptionsAlways), - string(RebootOptionsIfRequired), - string(RebootOptionsNever), - } -} - -func (s *RebootOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRebootOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRebootOptions(input string) (*RebootOptions, error) { - vals := map[string]RebootOptions{ - "always": RebootOptionsAlways, - "ifrequired": RebootOptionsIfRequired, - "never": RebootOptionsNever, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RebootOptions(input) - return &out, nil -} - -type TaskScope string - -const ( - TaskScopeGlobal TaskScope = "Global" - TaskScopeResource TaskScope = "Resource" -) - -func PossibleValuesForTaskScope() []string { - return []string{ - string(TaskScopeGlobal), - string(TaskScopeResource), - } -} - -func (s *TaskScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTaskScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTaskScope(input string) (*TaskScope, error) { - vals := map[string]TaskScope{ - "global": TaskScopeGlobal, - "resource": TaskScopeResource, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TaskScope(input) - return &out, nil -} - -type Visibility string - -const ( - VisibilityCustom Visibility = "Custom" - VisibilityPublic Visibility = "Public" -) - -func PossibleValuesForVisibility() []string { - return []string{ - string(VisibilityCustom), - string(VisibilityPublic), - } -} - -func (s *Visibility) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVisibility(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVisibility(input string) (*Visibility, error) { - vals := map[string]Visibility{ - "custom": VisibilityCustom, - "public": VisibilityPublic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Visibility(input) - return &out, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go deleted file mode 100644 index 0b827fb04c3..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration.go +++ /dev/null @@ -1,121 +0,0 @@ -package publicmaintenanceconfigurations - -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(&PublicMaintenanceConfigurationId{}) -} - -var _ resourceids.ResourceId = &PublicMaintenanceConfigurationId{} - -// PublicMaintenanceConfigurationId is a struct representing the Resource ID for a Public Maintenance Configuration -type PublicMaintenanceConfigurationId struct { - SubscriptionId string - PublicMaintenanceConfigurationName string -} - -// NewPublicMaintenanceConfigurationID returns a new PublicMaintenanceConfigurationId struct -func NewPublicMaintenanceConfigurationID(subscriptionId string, publicMaintenanceConfigurationName string) PublicMaintenanceConfigurationId { - return PublicMaintenanceConfigurationId{ - SubscriptionId: subscriptionId, - PublicMaintenanceConfigurationName: publicMaintenanceConfigurationName, - } -} - -// ParsePublicMaintenanceConfigurationID parses 'input' into a PublicMaintenanceConfigurationId -func ParsePublicMaintenanceConfigurationID(input string) (*PublicMaintenanceConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicMaintenanceConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicMaintenanceConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublicMaintenanceConfigurationIDInsensitively parses 'input' case-insensitively into a PublicMaintenanceConfigurationId -// note: this method should only be used for API response data and not user input -func ParsePublicMaintenanceConfigurationIDInsensitively(input string) (*PublicMaintenanceConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicMaintenanceConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicMaintenanceConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublicMaintenanceConfigurationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.PublicMaintenanceConfigurationName, ok = input.Parsed["publicMaintenanceConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publicMaintenanceConfigurationName", input) - } - - return nil -} - -// ValidatePublicMaintenanceConfigurationID checks that 'input' can be parsed as a Public Maintenance Configuration ID -func ValidatePublicMaintenanceConfigurationID(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 := ParsePublicMaintenanceConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Public Maintenance Configuration ID -func (id PublicMaintenanceConfigurationId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.PublicMaintenanceConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Public Maintenance Configuration ID -func (id PublicMaintenanceConfigurationId) 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("staticMicrosoftMaintenance", "Microsoft.Maintenance", "Microsoft.Maintenance"), - resourceids.StaticSegment("staticPublicMaintenanceConfigurations", "publicMaintenanceConfigurations", "publicMaintenanceConfigurations"), - resourceids.UserSpecifiedSegment("publicMaintenanceConfigurationName", "publicMaintenanceConfigurationValue"), - } -} - -// String returns a human-readable description of this Public Maintenance Configuration ID -func (id PublicMaintenanceConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Public Maintenance Configuration Name: %q", id.PublicMaintenanceConfigurationName), - } - return fmt.Sprintf("Public Maintenance Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go deleted file mode 100644 index 24114619f2e..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/id_publicmaintenanceconfiguration_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package publicmaintenanceconfigurations - -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 = &PublicMaintenanceConfigurationId{} - -func TestNewPublicMaintenanceConfigurationID(t *testing.T) { - id := NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "publicMaintenanceConfigurationValue") - - 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.PublicMaintenanceConfigurationName != "publicMaintenanceConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublicMaintenanceConfigurationName'", id.PublicMaintenanceConfigurationName, "publicMaintenanceConfigurationValue") - } -} - -func TestFormatPublicMaintenanceConfigurationID(t *testing.T) { - actual := NewPublicMaintenanceConfigurationID("12345678-1234-9876-4563-123456789012", "publicMaintenanceConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublicMaintenanceConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublicMaintenanceConfigurationId - }{ - { - // 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.Maintenance", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationValue", - Expected: &PublicMaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PublicMaintenanceConfigurationName: "publicMaintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublicMaintenanceConfigurationID(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.PublicMaintenanceConfigurationName != v.Expected.PublicMaintenanceConfigurationName { - t.Fatalf("Expected %q but got %q for PublicMaintenanceConfigurationName", v.Expected.PublicMaintenanceConfigurationName, actual.PublicMaintenanceConfigurationName) - } - - } -} - -func TestParsePublicMaintenanceConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublicMaintenanceConfigurationId - }{ - { - // 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.Maintenance", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationValue", - Expected: &PublicMaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PublicMaintenanceConfigurationName: "publicMaintenanceConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Maintenance/publicMaintenanceConfigurations/publicMaintenanceConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - Expected: &PublicMaintenanceConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PublicMaintenanceConfigurationName: "pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.mAiNtEnAnCe/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNs/pUbLiCmAiNtEnAnCeCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublicMaintenanceConfigurationIDInsensitively(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.PublicMaintenanceConfigurationName != v.Expected.PublicMaintenanceConfigurationName { - t.Fatalf("Expected %q but got %q for PublicMaintenanceConfigurationName", v.Expected.PublicMaintenanceConfigurationName, actual.PublicMaintenanceConfigurationName) - } - - } -} - -func TestSegmentsForPublicMaintenanceConfigurationId(t *testing.T) { - segments := PublicMaintenanceConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublicMaintenanceConfigurationId 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/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_get.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_get.go deleted file mode 100644 index b7c2d7cd15b..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package publicmaintenanceconfigurations - -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 *MaintenanceConfiguration -} - -// Get ... -func (c PublicMaintenanceConfigurationsClient) Get(ctx context.Context, id PublicMaintenanceConfigurationId) (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 MaintenanceConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_list.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_list.go deleted file mode 100644 index 31af41f7b10..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package publicmaintenanceconfigurations - -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 *ListMaintenanceConfigurationsResult -} - -// List ... -func (c PublicMaintenanceConfigurationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/publicMaintenanceConfigurations", 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 ListMaintenanceConfigurationsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputlinuxparameters.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputlinuxparameters.go deleted file mode 100644 index c03821dcd71..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputlinuxparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicmaintenanceconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InputLinuxParameters struct { - ClassificationsToInclude *[]string `json:"classificationsToInclude,omitempty"` - PackageNameMasksToExclude *[]string `json:"packageNameMasksToExclude,omitempty"` - PackageNameMasksToInclude *[]string `json:"packageNameMasksToInclude,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputpatchconfiguration.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputpatchconfiguration.go deleted file mode 100644 index 72c7618be52..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputpatchconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicmaintenanceconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InputPatchConfiguration struct { - LinuxParameters *InputLinuxParameters `json:"linuxParameters,omitempty"` - RebootSetting *RebootOptions `json:"rebootSetting,omitempty"` - Tasks *SoftwareUpdateConfigurationTasks `json:"tasks,omitempty"` - WindowsParameters *InputWindowsParameters `json:"windowsParameters,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputwindowsparameters.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputwindowsparameters.go deleted file mode 100644 index 94c6285a9d4..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_inputwindowsparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicmaintenanceconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InputWindowsParameters struct { - ClassificationsToInclude *[]string `json:"classificationsToInclude,omitempty"` - ExcludeKbsRequiringReboot *bool `json:"excludeKbsRequiringReboot,omitempty"` - KbNumbersToExclude *[]string `json:"kbNumbersToExclude,omitempty"` - KbNumbersToInclude *[]string `json:"kbNumbersToInclude,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_listmaintenanceconfigurationsresult.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_listmaintenanceconfigurationsresult.go deleted file mode 100644 index 3b46e41b8ea..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_listmaintenanceconfigurationsresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicmaintenanceconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListMaintenanceConfigurationsResult struct { - Value *[]MaintenanceConfiguration `json:"value,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfiguration.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfiguration.go deleted file mode 100644 index 2d039cc921f..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfiguration.go +++ /dev/null @@ -1,18 +0,0 @@ -package publicmaintenanceconfigurations - -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"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *MaintenanceConfigurationProperties `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/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfigurationproperties.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfigurationproperties.go deleted file mode 100644 index 4cb7f757f4e..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenanceconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicmaintenanceconfigurations - -// 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 { - ExtensionProperties *map[string]string `json:"extensionProperties,omitempty"` - InstallPatches *InputPatchConfiguration `json:"installPatches,omitempty"` - MaintenanceScope *MaintenanceScope `json:"maintenanceScope,omitempty"` - MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` - Namespace *string `json:"namespace,omitempty"` - Visibility *Visibility `json:"visibility,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenancewindow.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenancewindow.go deleted file mode 100644 index 720a9f37998..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_maintenancewindow.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicmaintenanceconfigurations - -// 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 { - Duration *string `json:"duration,omitempty"` - ExpirationDateTime *string `json:"expirationDateTime,omitempty"` - RecurEvery *string `json:"recurEvery,omitempty"` - StartDateTime *string `json:"startDateTime,omitempty"` - TimeZone *string `json:"timeZone,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_softwareupdateconfigurationtasks.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_softwareupdateconfigurationtasks.go deleted file mode 100644 index 35afb84a044..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_softwareupdateconfigurationtasks.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicmaintenanceconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftwareUpdateConfigurationTasks struct { - PostTasks *[]TaskProperties `json:"postTasks,omitempty"` - PreTasks *[]TaskProperties `json:"preTasks,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_taskproperties.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_taskproperties.go deleted file mode 100644 index 297e42b866f..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/model_taskproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicmaintenanceconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TaskProperties struct { - Parameters *map[string]string `json:"parameters,omitempty"` - Source *string `json:"source,omitempty"` - TaskScope *TaskScope `json:"taskScope,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/version.go b/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/version.go deleted file mode 100644 index 236cb0e42f9..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/publicmaintenanceconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicmaintenanceconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicmaintenanceconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/README.md b/resource-manager/maintenance/2022-07-01-preview/updates/README.md deleted file mode 100644 index 44e78852f8b..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/updates` Documentation - -The `updates` SDK allows for interaction with the Azure Resource Manager Service `maintenance` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/maintenance/2022-07-01-preview/updates" -``` - - -### Client Initialization - -```go -client := updates.NewUpdatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UpdatesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -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: `UpdatesClient.ListParent` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -read, err := client.ListParent(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/maintenance/2022-07-01-preview/updates/client.go b/resource-manager/maintenance/2022-07-01-preview/updates/client.go deleted file mode 100644 index f8438b80656..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package updates - -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 UpdatesClient struct { - Client *resourcemanager.Client -} - -func NewUpdatesClientWithBaseURI(sdkApi sdkEnv.Api) (*UpdatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "updates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UpdatesClient: %+v", err) - } - - return &UpdatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/constants.go b/resource-manager/maintenance/2022-07-01-preview/updates/constants.go deleted file mode 100644 index b73030e0dde..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/constants.go +++ /dev/null @@ -1,163 +0,0 @@ -package updates - -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 ImpactType string - -const ( - ImpactTypeFreeze ImpactType = "Freeze" - ImpactTypeNone ImpactType = "None" - ImpactTypeRedeploy ImpactType = "Redeploy" - ImpactTypeRestart ImpactType = "Restart" -) - -func PossibleValuesForImpactType() []string { - return []string{ - string(ImpactTypeFreeze), - string(ImpactTypeNone), - string(ImpactTypeRedeploy), - string(ImpactTypeRestart), - } -} - -func (s *ImpactType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImpactType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImpactType(input string) (*ImpactType, error) { - vals := map[string]ImpactType{ - "freeze": ImpactTypeFreeze, - "none": ImpactTypeNone, - "redeploy": ImpactTypeRedeploy, - "restart": ImpactTypeRestart, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImpactType(input) - return &out, nil -} - -type MaintenanceScope string - -const ( - MaintenanceScopeExtension MaintenanceScope = "Extension" - MaintenanceScopeHost MaintenanceScope = "Host" - MaintenanceScopeInGuestPatch MaintenanceScope = "InGuestPatch" - MaintenanceScopeOSImage MaintenanceScope = "OSImage" - MaintenanceScopeResource MaintenanceScope = "Resource" - MaintenanceScopeSQLDB MaintenanceScope = "SQLDB" - MaintenanceScopeSQLManagedInstance MaintenanceScope = "SQLManagedInstance" -) - -func PossibleValuesForMaintenanceScope() []string { - return []string{ - string(MaintenanceScopeExtension), - string(MaintenanceScopeHost), - string(MaintenanceScopeInGuestPatch), - string(MaintenanceScopeOSImage), - string(MaintenanceScopeResource), - string(MaintenanceScopeSQLDB), - string(MaintenanceScopeSQLManagedInstance), - } -} - -func (s *MaintenanceScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMaintenanceScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMaintenanceScope(input string) (*MaintenanceScope, error) { - vals := map[string]MaintenanceScope{ - "extension": MaintenanceScopeExtension, - "host": MaintenanceScopeHost, - "inguestpatch": MaintenanceScopeInGuestPatch, - "osimage": MaintenanceScopeOSImage, - "resource": MaintenanceScopeResource, - "sqldb": MaintenanceScopeSQLDB, - "sqlmanagedinstance": MaintenanceScopeSQLManagedInstance, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MaintenanceScope(input) - return &out, nil -} - -type UpdateStatus string - -const ( - UpdateStatusCompleted UpdateStatus = "Completed" - UpdateStatusInProgress UpdateStatus = "InProgress" - UpdateStatusPending UpdateStatus = "Pending" - UpdateStatusRetryLater UpdateStatus = "RetryLater" - UpdateStatusRetryNow UpdateStatus = "RetryNow" -) - -func PossibleValuesForUpdateStatus() []string { - return []string{ - string(UpdateStatusCompleted), - string(UpdateStatusInProgress), - string(UpdateStatusPending), - string(UpdateStatusRetryLater), - string(UpdateStatusRetryNow), - } -} - -func (s *UpdateStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUpdateStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUpdateStatus(input string) (*UpdateStatus, error) { - vals := map[string]UpdateStatus{ - "completed": UpdateStatusCompleted, - "inprogress": UpdateStatusInProgress, - "pending": UpdateStatusPending, - "retrylater": UpdateStatusRetryLater, - "retrynow": UpdateStatusRetryNow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UpdateStatus(input) - return &out, nil -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/method_list.go b/resource-manager/maintenance/2022-07-01-preview/updates/method_list.go deleted file mode 100644 index 697d64e4b81..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package updates - -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 *ListUpdatesResult -} - -// List ... -func (c UpdatesClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/updates", 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 ListUpdatesResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/method_listparent.go b/resource-manager/maintenance/2022-07-01-preview/updates/method_listparent.go deleted file mode 100644 index e56f83158de..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/method_listparent.go +++ /dev/null @@ -1,56 +0,0 @@ -package updates - -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 ListParentOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ListUpdatesResult -} - -// ListParent ... -func (c UpdatesClient) ListParent(ctx context.Context, id commonids.ScopeId) (result ListParentOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Maintenance/updates", 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 ListUpdatesResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/model_listupdatesresult.go b/resource-manager/maintenance/2022-07-01-preview/updates/model_listupdatesresult.go deleted file mode 100644 index 536184d7e41..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/model_listupdatesresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ListUpdatesResult struct { - Value *[]Update `json:"value,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/model_update.go b/resource-manager/maintenance/2022-07-01-preview/updates/model_update.go deleted file mode 100644 index fec985065ca..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/model_update.go +++ /dev/null @@ -1,31 +0,0 @@ -package updates - -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 Update struct { - ImpactDurationInSec *int64 `json:"impactDurationInSec,omitempty"` - ImpactType *ImpactType `json:"impactType,omitempty"` - MaintenanceScope *MaintenanceScope `json:"maintenanceScope,omitempty"` - NotBefore *string `json:"notBefore,omitempty"` - Properties *UpdateProperties `json:"properties,omitempty"` - Status *UpdateStatus `json:"status,omitempty"` -} - -func (o *Update) GetNotBeforeAsTime() (*time.Time, error) { - if o.NotBefore == nil { - return nil, nil - } - return dates.ParseAsFormat(o.NotBefore, "2006-01-02T15:04:05Z07:00") -} - -func (o *Update) SetNotBeforeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.NotBefore = &formatted -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/model_updateproperties.go b/resource-manager/maintenance/2022-07-01-preview/updates/model_updateproperties.go deleted file mode 100644 index 76108752ee7..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/model_updateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package updates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateProperties struct { - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/maintenance/2022-07-01-preview/updates/version.go b/resource-manager/maintenance/2022-07-01-preview/updates/version.go deleted file mode 100644 index bb4b47ce49c..00000000000 --- a/resource-manager/maintenance/2022-07-01-preview/updates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package updates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/updates/%s", defaultApiVersion) -} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/README.md b/resource-manager/netapp/2023-11-01/backuppolicy/README.md new file mode 100644 index 00000000000..dbd31fce3f9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/README.md @@ -0,0 +1,98 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/backuppolicy` Documentation + +The `backuppolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/backuppolicy" +``` + + +### Client Initialization + +```go +client := backuppolicy.NewBackupPolicyClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BackupPolicyClient.BackupPoliciesCreate` + +```go +ctx := context.TODO() +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupPolicyValue") + +payload := backuppolicy.BackupPolicy{ + // ... +} + + +if err := client.BackupPoliciesCreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupPolicyClient.BackupPoliciesDelete` + +```go +ctx := context.TODO() +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupPolicyValue") + +if err := client.BackupPoliciesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupPolicyClient.BackupPoliciesGet` + +```go +ctx := context.TODO() +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupPolicyValue") + +read, err := client.BackupPoliciesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `BackupPolicyClient.BackupPoliciesList` + +```go +ctx := context.TODO() +id := backuppolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +read, err := client.BackupPoliciesList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `BackupPolicyClient.BackupPoliciesUpdate` + +```go +ctx := context.TODO() +id := backuppolicy.NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupPolicyValue") + +payload := backuppolicy.BackupPolicyPatch{ + // ... +} + + +if err := client.BackupPoliciesUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/client.go b/resource-manager/netapp/2023-11-01/backuppolicy/client.go new file mode 100644 index 00000000000..1db45e634e5 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/client.go @@ -0,0 +1,26 @@ +package backuppolicy + +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 BackupPolicyClient struct { + Client *resourcemanager.Client +} + +func NewBackupPolicyClientWithBaseURI(sdkApi sdkEnv.Api) (*BackupPolicyClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "backuppolicy", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating BackupPolicyClient: %+v", err) + } + + return &BackupPolicyClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go new file mode 100644 index 00000000000..9f45aceef30 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy.go @@ -0,0 +1,139 @@ +package backuppolicy + +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(&BackupPolicyId{}) +} + +var _ resourceids.ResourceId = &BackupPolicyId{} + +// BackupPolicyId is a struct representing the Resource ID for a Backup Policy +type BackupPolicyId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + BackupPolicyName string +} + +// NewBackupPolicyID returns a new BackupPolicyId struct +func NewBackupPolicyID(subscriptionId string, resourceGroupName string, netAppAccountName string, backupPolicyName string) BackupPolicyId { + return BackupPolicyId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + BackupPolicyName: backupPolicyName, + } +} + +// ParseBackupPolicyID parses 'input' into a BackupPolicyId +func ParseBackupPolicyID(input string) (*BackupPolicyId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupPolicyId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupPolicyId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBackupPolicyIDInsensitively parses 'input' case-insensitively into a BackupPolicyId +// note: this method should only be used for API response data and not user input +func ParseBackupPolicyIDInsensitively(input string) (*BackupPolicyId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupPolicyId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupPolicyId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BackupPolicyId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.BackupPolicyName, ok = input.Parsed["backupPolicyName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "backupPolicyName", input) + } + + return nil +} + +// ValidateBackupPolicyID checks that 'input' can be parsed as a Backup Policy ID +func ValidateBackupPolicyID(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 := ParseBackupPolicyID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Backup Policy ID +func (id BackupPolicyId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/backupPolicies/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.BackupPolicyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Backup Policy ID +func (id BackupPolicyId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticBackupPolicies", "backupPolicies", "backupPolicies"), + resourceids.UserSpecifiedSegment("backupPolicyName", "backupPolicyValue"), + } +} + +// String returns a human-readable description of this Backup Policy ID +func (id BackupPolicyId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Backup Policy Name: %q", id.BackupPolicyName), + } + return fmt.Sprintf("Backup Policy (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go new file mode 100644 index 00000000000..7b64437eed6 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_backuppolicy_test.go @@ -0,0 +1,327 @@ +package backuppolicy + +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 = &BackupPolicyId{} + +func TestNewBackupPolicyID(t *testing.T) { + id := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupPolicyValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.BackupPolicyName != "backupPolicyValue" { + t.Fatalf("Expected %q but got %q for Segment 'BackupPolicyName'", id.BackupPolicyName, "backupPolicyValue") + } +} + +func TestFormatBackupPolicyID(t *testing.T) { + actual := NewBackupPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupPolicyValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies/backupPolicyValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseBackupPolicyID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupPolicyId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies/backupPolicyValue", + Expected: &BackupPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupPolicyName: "backupPolicyValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies/backupPolicyValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupPolicyID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupPolicyName != v.Expected.BackupPolicyName { + t.Fatalf("Expected %q but got %q for BackupPolicyName", v.Expected.BackupPolicyName, actual.BackupPolicyName) + } + + } +} + +func TestParseBackupPolicyIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupPolicyId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPpOlIcIeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies/backupPolicyValue", + Expected: &BackupPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupPolicyName: "backupPolicyValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupPolicies/backupPolicyValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPpOlIcIeS/bAcKuPpOlIcYvAlUe", + Expected: &BackupPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + BackupPolicyName: "bAcKuPpOlIcYvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPpOlIcIeS/bAcKuPpOlIcYvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupPolicyIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupPolicyName != v.Expected.BackupPolicyName { + t.Fatalf("Expected %q but got %q for BackupPolicyName", v.Expected.BackupPolicyName, actual.BackupPolicyName) + } + + } +} + +func TestSegmentsForBackupPolicyId(t *testing.T) { + segments := BackupPolicyId{}.Segments() + if len(segments) == 0 { + t.Fatalf("BackupPolicyId 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/netapp/2023-11-01/backuppolicy/id_netappaccount.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go new file mode 100644 index 00000000000..d722f9a676d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount.go @@ -0,0 +1,130 @@ +package backuppolicy + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go new file mode 100644 index 00000000000..262e6f6b916 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package backuppolicy + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/backuppolicy/method_backuppoliciescreate.go b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciescreate.go new file mode 100644 index 00000000000..bb886f44754 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciescreate.go @@ -0,0 +1,76 @@ +package backuppolicy + +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 BackupPoliciesCreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *BackupPolicy +} + +// BackupPoliciesCreate ... +func (c BackupPolicyClient) BackupPoliciesCreate(ctx context.Context, id BackupPolicyId, input BackupPolicy) (result BackupPoliciesCreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// BackupPoliciesCreateThenPoll performs BackupPoliciesCreate then polls until it's completed +func (c BackupPolicyClient) BackupPoliciesCreateThenPoll(ctx context.Context, id BackupPolicyId, input BackupPolicy) error { + result, err := c.BackupPoliciesCreate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing BackupPoliciesCreate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after BackupPoliciesCreate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesdelete.go b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesdelete.go new file mode 100644 index 00000000000..482cdc1780e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesdelete.go @@ -0,0 +1,71 @@ +package backuppolicy + +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 BackupPoliciesDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// BackupPoliciesDelete ... +func (c BackupPolicyClient) BackupPoliciesDelete(ctx context.Context, id BackupPolicyId) (result BackupPoliciesDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 +} + +// BackupPoliciesDeleteThenPoll performs BackupPoliciesDelete then polls until it's completed +func (c BackupPolicyClient) BackupPoliciesDeleteThenPoll(ctx context.Context, id BackupPolicyId) error { + result, err := c.BackupPoliciesDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing BackupPoliciesDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after BackupPoliciesDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesget.go b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesget.go new file mode 100644 index 00000000000..73667d207d3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesget.go @@ -0,0 +1,54 @@ +package backuppolicy + +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 BackupPoliciesGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *BackupPolicy +} + +// BackupPoliciesGet ... +func (c BackupPolicyClient) BackupPoliciesGet(ctx context.Context, id BackupPolicyId) (result BackupPoliciesGetOperationResponse, 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 BackupPolicy + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppolicieslist.go b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppolicieslist.go new file mode 100644 index 00000000000..7a939318453 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppolicieslist.go @@ -0,0 +1,55 @@ +package backuppolicy + +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 BackupPoliciesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *BackupPoliciesList +} + +// BackupPoliciesList ... +func (c BackupPolicyClient) BackupPoliciesList(ctx context.Context, id NetAppAccountId) (result BackupPoliciesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/backupPolicies", 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 BackupPoliciesList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesupdate.go b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesupdate.go new file mode 100644 index 00000000000..b24e23a21cf --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/method_backuppoliciesupdate.go @@ -0,0 +1,75 @@ +package backuppolicy + +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 BackupPoliciesUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *BackupPolicy +} + +// BackupPoliciesUpdate ... +func (c BackupPolicyClient) BackupPoliciesUpdate(ctx context.Context, id BackupPolicyId, input BackupPolicyPatch) (result BackupPoliciesUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// BackupPoliciesUpdateThenPoll performs BackupPoliciesUpdate then polls until it's completed +func (c BackupPolicyClient) BackupPoliciesUpdateThenPoll(ctx context.Context, id BackupPolicyId, input BackupPolicyPatch) error { + result, err := c.BackupPoliciesUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing BackupPoliciesUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after BackupPoliciesUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicieslist.go b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicieslist.go new file mode 100644 index 00000000000..3db3d131a60 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicieslist.go @@ -0,0 +1,8 @@ +package backuppolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPoliciesList struct { + Value *[]BackupPolicy `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicy.go b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicy.go new file mode 100644 index 00000000000..747ab65be24 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicy.go @@ -0,0 +1,19 @@ +package backuppolicy + +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 BackupPolicy struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties BackupPolicyProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicypatch.go b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicypatch.go new file mode 100644 index 00000000000..bf7eecb1358 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicypatch.go @@ -0,0 +1,13 @@ +package backuppolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPolicyPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *BackupPolicyProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicyproperties.go b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicyproperties.go new file mode 100644 index 00000000000..d5694f4797d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/model_backuppolicyproperties.go @@ -0,0 +1,15 @@ +package backuppolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPolicyProperties struct { + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + DailyBackupsToKeep *int64 `json:"dailyBackupsToKeep,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + MonthlyBackupsToKeep *int64 `json:"monthlyBackupsToKeep,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + VolumeBackups *[]VolumeBackups `json:"volumeBackups,omitempty"` + VolumesAssigned *int64 `json:"volumesAssigned,omitempty"` + WeeklyBackupsToKeep *int64 `json:"weeklyBackupsToKeep,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/model_volumebackups.go b/resource-manager/netapp/2023-11-01/backuppolicy/model_volumebackups.go new file mode 100644 index 00000000000..b53afb9ae14 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/model_volumebackups.go @@ -0,0 +1,11 @@ +package backuppolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackups struct { + BackupsCount *int64 `json:"backupsCount,omitempty"` + PolicyEnabled *bool `json:"policyEnabled,omitempty"` + VolumeName *string `json:"volumeName,omitempty"` + VolumeResourceId *string `json:"volumeResourceId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backuppolicy/version.go b/resource-manager/netapp/2023-11-01/backuppolicy/version.go new file mode 100644 index 00000000000..241d6314ffc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backuppolicy/version.go @@ -0,0 +1,12 @@ +package backuppolicy + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/backuppolicy/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/backups/README.md b/resource-manager/netapp/2023-11-01/backups/README.md new file mode 100644 index 00000000000..60098de1abb --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/README.md @@ -0,0 +1,166 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/backups` Documentation + +The `backups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/backups" +``` + + +### Client Initialization + +```go +client := backups.NewBackupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BackupsClient.Create` + +```go +ctx := context.TODO() +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue") + +payload := backups.Backup{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupsClient.Delete` + +```go +ctx := context.TODO() +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupsClient.Get` + +```go +ctx := context.TODO() +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue") + +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: `BackupsClient.GetLatestStatus` + +```go +ctx := context.TODO() +id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +read, err := client.GetLatestStatus(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `BackupsClient.ListByVault` + +```go +ctx := context.TODO() +id := backups.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + +// alternatively `client.ListByVault(ctx, id, backups.DefaultListByVaultOperationOptions())` can be used to do batched pagination +items, err := client.ListByVaultComplete(ctx, id, backups.DefaultListByVaultOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BackupsClient.UnderAccountMigrateBackups` + +```go +ctx := context.TODO() +id := backups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +payload := backups.BackupsMigrationRequest{ + // ... +} + + +if err := client.UnderAccountMigrateBackupsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupsClient.UnderBackupVaultRestoreFiles` + +```go +ctx := context.TODO() +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue") + +payload := backups.BackupRestoreFiles{ + // ... +} + + +if err := client.UnderBackupVaultRestoreFilesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupsClient.UnderVolumeMigrateBackups` + +```go +ctx := context.TODO() +id := backups.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := backups.BackupsMigrationRequest{ + // ... +} + + +if err := client.UnderVolumeMigrateBackupsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupsClient.Update` + +```go +ctx := context.TODO() +id := backups.NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue") + +payload := backups.BackupPatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/backups/client.go b/resource-manager/netapp/2023-11-01/backups/client.go new file mode 100644 index 00000000000..a0f81d2a6ab --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/client.go @@ -0,0 +1,26 @@ +package backups + +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 BackupsClient struct { + Client *resourcemanager.Client +} + +func NewBackupsClientWithBaseURI(sdkApi sdkEnv.Api) (*BackupsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "backups", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating BackupsClient: %+v", err) + } + + return &BackupsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/constants.go b/resource-manager/netapp/2023-11-01/backups/constants.go new file mode 100644 index 00000000000..d3c86cd75c0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/constants.go @@ -0,0 +1,142 @@ +package backups + +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 BackupType string + +const ( + BackupTypeManual BackupType = "Manual" + BackupTypeScheduled BackupType = "Scheduled" +) + +func PossibleValuesForBackupType() []string { + return []string{ + string(BackupTypeManual), + string(BackupTypeScheduled), + } +} + +func (s *BackupType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBackupType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBackupType(input string) (*BackupType, error) { + vals := map[string]BackupType{ + "manual": BackupTypeManual, + "scheduled": BackupTypeScheduled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BackupType(input) + return &out, nil +} + +type MirrorState string + +const ( + MirrorStateBroken MirrorState = "Broken" + MirrorStateMirrored MirrorState = "Mirrored" + MirrorStateUninitialized MirrorState = "Uninitialized" +) + +func PossibleValuesForMirrorState() []string { + return []string{ + string(MirrorStateBroken), + string(MirrorStateMirrored), + string(MirrorStateUninitialized), + } +} + +func (s *MirrorState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMirrorState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMirrorState(input string) (*MirrorState, error) { + vals := map[string]MirrorState{ + "broken": MirrorStateBroken, + "mirrored": MirrorStateMirrored, + "uninitialized": MirrorStateUninitialized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MirrorState(input) + return &out, nil +} + +type RelationshipStatus string + +const ( + RelationshipStatusFailed RelationshipStatus = "Failed" + RelationshipStatusIdle RelationshipStatus = "Idle" + RelationshipStatusTransferring RelationshipStatus = "Transferring" + RelationshipStatusUnknown RelationshipStatus = "Unknown" +) + +func PossibleValuesForRelationshipStatus() []string { + return []string{ + string(RelationshipStatusFailed), + string(RelationshipStatusIdle), + string(RelationshipStatusTransferring), + string(RelationshipStatusUnknown), + } +} + +func (s *RelationshipStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRelationshipStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRelationshipStatus(input string) (*RelationshipStatus, error) { + vals := map[string]RelationshipStatus{ + "failed": RelationshipStatusFailed, + "idle": RelationshipStatusIdle, + "transferring": RelationshipStatusTransferring, + "unknown": RelationshipStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RelationshipStatus(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/id_backup.go b/resource-manager/netapp/2023-11-01/backups/id_backup.go new file mode 100644 index 00000000000..4af4424ea14 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_backup.go @@ -0,0 +1,148 @@ +package backups + +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(&BackupId{}) +} + +var _ resourceids.ResourceId = &BackupId{} + +// BackupId is a struct representing the Resource ID for a Backup +type BackupId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + BackupVaultName string + BackupName string +} + +// NewBackupID returns a new BackupId struct +func NewBackupID(subscriptionId string, resourceGroupName string, netAppAccountName string, backupVaultName string, backupName string) BackupId { + return BackupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + BackupVaultName: backupVaultName, + BackupName: backupName, + } +} + +// ParseBackupID parses 'input' into a BackupId +func ParseBackupID(input string) (*BackupId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBackupIDInsensitively parses 'input' case-insensitively into a BackupId +// note: this method should only be used for API response data and not user input +func ParseBackupIDInsensitively(input string) (*BackupId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BackupId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.BackupVaultName, ok = input.Parsed["backupVaultName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "backupVaultName", input) + } + + if id.BackupName, ok = input.Parsed["backupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "backupName", input) + } + + return nil +} + +// ValidateBackupID checks that 'input' can be parsed as a Backup ID +func ValidateBackupID(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 := ParseBackupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Backup ID +func (id BackupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/backupVaults/%s/backups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.BackupVaultName, id.BackupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Backup ID +func (id BackupId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultValue"), + resourceids.StaticSegment("staticBackups", "backups", "backups"), + resourceids.UserSpecifiedSegment("backupName", "backupValue"), + } +} + +// String returns a human-readable description of this Backup ID +func (id BackupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Backup Vault Name: %q", id.BackupVaultName), + fmt.Sprintf("Backup Name: %q", id.BackupName), + } + return fmt.Sprintf("Backup (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backups/id_backup_test.go b/resource-manager/netapp/2023-11-01/backups/id_backup_test.go new file mode 100644 index 00000000000..17730596540 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_backup_test.go @@ -0,0 +1,372 @@ +package backups + +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 = &BackupId{} + +func TestNewBackupID(t *testing.T) { + id := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.BackupVaultName != "backupVaultValue" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultValue") + } + + if id.BackupName != "backupValue" { + t.Fatalf("Expected %q but got %q for Segment 'BackupName'", id.BackupName, "backupValue") + } +} + +func TestFormatBackupID(t *testing.T) { + actual := NewBackupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue", "backupValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups/backupValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseBackupID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups/backupValue", + Expected: &BackupId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupVaultName: "backupVaultValue", + BackupName: "backupValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups/backupValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupVaultName != v.Expected.BackupVaultName { + t.Fatalf("Expected %q but got %q for BackupVaultName", v.Expected.BackupVaultName, actual.BackupVaultName) + } + + if actual.BackupName != v.Expected.BackupName { + t.Fatalf("Expected %q but got %q for BackupName", v.Expected.BackupName, actual.BackupName) + } + + } +} + +func TestParseBackupIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE/bAcKuPs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups/backupValue", + Expected: &BackupId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupVaultName: "backupVaultValue", + BackupName: "backupValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/backups/backupValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE/bAcKuPs/bAcKuPvAlUe", + Expected: &BackupId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + BackupVaultName: "bAcKuPvAuLtVaLuE", + BackupName: "bAcKuPvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE/bAcKuPs/bAcKuPvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupVaultName != v.Expected.BackupVaultName { + t.Fatalf("Expected %q but got %q for BackupVaultName", v.Expected.BackupVaultName, actual.BackupVaultName) + } + + if actual.BackupName != v.Expected.BackupName { + t.Fatalf("Expected %q but got %q for BackupName", v.Expected.BackupName, actual.BackupName) + } + + } +} + +func TestSegmentsForBackupId(t *testing.T) { + segments := BackupId{}.Segments() + if len(segments) == 0 { + t.Fatalf("BackupId 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/netapp/2023-11-01/backups/id_backupvault.go b/resource-manager/netapp/2023-11-01/backups/id_backupvault.go new file mode 100644 index 00000000000..93042918533 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_backupvault.go @@ -0,0 +1,139 @@ +package backups + +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(&BackupVaultId{}) +} + +var _ resourceids.ResourceId = &BackupVaultId{} + +// BackupVaultId is a struct representing the Resource ID for a Backup Vault +type BackupVaultId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + BackupVaultName string +} + +// NewBackupVaultID returns a new BackupVaultId struct +func NewBackupVaultID(subscriptionId string, resourceGroupName string, netAppAccountName string, backupVaultName string) BackupVaultId { + return BackupVaultId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + BackupVaultName: backupVaultName, + } +} + +// ParseBackupVaultID parses 'input' into a BackupVaultId +func ParseBackupVaultID(input string) (*BackupVaultId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupVaultId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupVaultId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBackupVaultIDInsensitively parses 'input' case-insensitively into a BackupVaultId +// note: this method should only be used for API response data and not user input +func ParseBackupVaultIDInsensitively(input string) (*BackupVaultId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupVaultId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupVaultId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BackupVaultId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.BackupVaultName, ok = input.Parsed["backupVaultName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "backupVaultName", input) + } + + return nil +} + +// ValidateBackupVaultID checks that 'input' can be parsed as a Backup Vault ID +func ValidateBackupVaultID(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 := ParseBackupVaultID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Backup Vault ID +func (id BackupVaultId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/backupVaults/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.BackupVaultName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Backup Vault ID +func (id BackupVaultId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultValue"), + } +} + +// String returns a human-readable description of this Backup Vault ID +func (id BackupVaultId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Backup Vault Name: %q", id.BackupVaultName), + } + return fmt.Sprintf("Backup Vault (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go b/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go new file mode 100644 index 00000000000..3bec6466924 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_backupvault_test.go @@ -0,0 +1,327 @@ +package backups + +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 = &BackupVaultId{} + +func TestNewBackupVaultID(t *testing.T) { + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.BackupVaultName != "backupVaultValue" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultValue") + } +} + +func TestFormatBackupVaultID(t *testing.T) { + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseBackupVaultID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupVaultId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue", + Expected: &BackupVaultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupVaultName: "backupVaultValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupVaultID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupVaultName != v.Expected.BackupVaultName { + t.Fatalf("Expected %q but got %q for BackupVaultName", v.Expected.BackupVaultName, actual.BackupVaultName) + } + + } +} + +func TestParseBackupVaultIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupVaultId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue", + Expected: &BackupVaultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupVaultName: "backupVaultValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE", + Expected: &BackupVaultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + BackupVaultName: "bAcKuPvAuLtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupVaultIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupVaultName != v.Expected.BackupVaultName { + t.Fatalf("Expected %q but got %q for BackupVaultName", v.Expected.BackupVaultName, actual.BackupVaultName) + } + + } +} + +func TestSegmentsForBackupVaultId(t *testing.T) { + segments := BackupVaultId{}.Segments() + if len(segments) == 0 { + t.Fatalf("BackupVaultId 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/netapp/2023-11-01/backups/id_netappaccount.go b/resource-manager/netapp/2023-11-01/backups/id_netappaccount.go new file mode 100644 index 00000000000..26feaa5e8b2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_netappaccount.go @@ -0,0 +1,130 @@ +package backups + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go new file mode 100644 index 00000000000..9d83ab4e6a3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package backups + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/backups/id_volume.go b/resource-manager/netapp/2023-11-01/backups/id_volume.go new file mode 100644 index 00000000000..839d08e459e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_volume.go @@ -0,0 +1,148 @@ +package backups + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backups/id_volume_test.go b/resource-manager/netapp/2023-11-01/backups/id_volume_test.go new file mode 100644 index 00000000000..8b3a99a0f10 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/id_volume_test.go @@ -0,0 +1,372 @@ +package backups + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/backups/method_create.go b/resource-manager/netapp/2023-11-01/backups/method_create.go new file mode 100644 index 00000000000..547e1883e1f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_create.go @@ -0,0 +1,75 @@ +package backups + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Backup +} + +// Create ... +func (c BackupsClient) Create(ctx context.Context, id BackupId, input Backup) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c BackupsClient) CreateThenPoll(ctx context.Context, id BackupId, input Backup) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_delete.go b/resource-manager/netapp/2023-11-01/backups/method_delete.go new file mode 100644 index 00000000000..15a40b88c3c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_delete.go @@ -0,0 +1,70 @@ +package backups + +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 BackupsClient) Delete(ctx context.Context, id BackupId) (result DeleteOperationResponse, 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c BackupsClient) DeleteThenPoll(ctx context.Context, id BackupId) 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/netapp/2023-11-01/backups/method_get.go b/resource-manager/netapp/2023-11-01/backups/method_get.go new file mode 100644 index 00000000000..65321ba9ef6 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_get.go @@ -0,0 +1,54 @@ +package backups + +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 *Backup +} + +// Get ... +func (c BackupsClient) Get(ctx context.Context, id BackupId) (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 Backup + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_getlateststatus.go b/resource-manager/netapp/2023-11-01/backups/method_getlateststatus.go new file mode 100644 index 00000000000..dcd2709c74f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_getlateststatus.go @@ -0,0 +1,55 @@ +package backups + +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 GetLatestStatusOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *BackupStatus +} + +// GetLatestStatus ... +func (c BackupsClient) GetLatestStatus(ctx context.Context, id VolumeId) (result GetLatestStatusOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/latestBackupStatus/current", 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 BackupStatus + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_listbyvault.go b/resource-manager/netapp/2023-11-01/backups/method_listbyvault.go new file mode 100644 index 00000000000..002a9c92cf4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_listbyvault.go @@ -0,0 +1,119 @@ +package backups + +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 ListByVaultOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Backup +} + +type ListByVaultCompleteResult struct { + LatestHttpResponse *http.Response + Items []Backup +} + +type ListByVaultOperationOptions struct { + Filter *string +} + +func DefaultListByVaultOperationOptions() ListByVaultOperationOptions { + return ListByVaultOperationOptions{} +} + +func (o ListByVaultOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o ListByVaultOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o ListByVaultOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Filter != nil { + out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) + } + return &out +} + +// ListByVault ... +func (c BackupsClient) ListByVault(ctx context.Context, id BackupVaultId, options ListByVaultOperationOptions) (result ListByVaultOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/backups", id.ID()), + OptionsObject: options, + } + + 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 *[]Backup `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByVaultComplete retrieves all the results into a single object +func (c BackupsClient) ListByVaultComplete(ctx context.Context, id BackupVaultId, options ListByVaultOperationOptions) (ListByVaultCompleteResult, error) { + return c.ListByVaultCompleteMatchingPredicate(ctx, id, options, BackupOperationPredicate{}) +} + +// ListByVaultCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c BackupsClient) ListByVaultCompleteMatchingPredicate(ctx context.Context, id BackupVaultId, options ListByVaultOperationOptions, predicate BackupOperationPredicate) (result ListByVaultCompleteResult, err error) { + items := make([]Backup, 0) + + resp, err := c.ListByVault(ctx, id, options) + if err != nil { + 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 = ListByVaultCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_underaccountmigratebackups.go b/resource-manager/netapp/2023-11-01/backups/method_underaccountmigratebackups.go new file mode 100644 index 00000000000..d8792fed2b6 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_underaccountmigratebackups.go @@ -0,0 +1,73 @@ +package backups + +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 UnderAccountMigrateBackupsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// UnderAccountMigrateBackups ... +func (c BackupsClient) UnderAccountMigrateBackups(ctx context.Context, id NetAppAccountId, input BackupsMigrationRequest) (result UnderAccountMigrateBackupsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/migrateBackups", 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 +} + +// UnderAccountMigrateBackupsThenPoll performs UnderAccountMigrateBackups then polls until it's completed +func (c BackupsClient) UnderAccountMigrateBackupsThenPoll(ctx context.Context, id NetAppAccountId, input BackupsMigrationRequest) error { + result, err := c.UnderAccountMigrateBackups(ctx, id, input) + if err != nil { + return fmt.Errorf("performing UnderAccountMigrateBackups: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UnderAccountMigrateBackups: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_underbackupvaultrestorefiles.go b/resource-manager/netapp/2023-11-01/backups/method_underbackupvaultrestorefiles.go new file mode 100644 index 00000000000..fae1ff9c3ac --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_underbackupvaultrestorefiles.go @@ -0,0 +1,73 @@ +package backups + +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 UnderBackupVaultRestoreFilesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// UnderBackupVaultRestoreFiles ... +func (c BackupsClient) UnderBackupVaultRestoreFiles(ctx context.Context, id BackupId, input BackupRestoreFiles) (result UnderBackupVaultRestoreFilesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/restoreFiles", 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 +} + +// UnderBackupVaultRestoreFilesThenPoll performs UnderBackupVaultRestoreFiles then polls until it's completed +func (c BackupsClient) UnderBackupVaultRestoreFilesThenPoll(ctx context.Context, id BackupId, input BackupRestoreFiles) error { + result, err := c.UnderBackupVaultRestoreFiles(ctx, id, input) + if err != nil { + return fmt.Errorf("performing UnderBackupVaultRestoreFiles: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UnderBackupVaultRestoreFiles: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_undervolumemigratebackups.go b/resource-manager/netapp/2023-11-01/backups/method_undervolumemigratebackups.go new file mode 100644 index 00000000000..1bbdca6b084 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_undervolumemigratebackups.go @@ -0,0 +1,73 @@ +package backups + +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 UnderVolumeMigrateBackupsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// UnderVolumeMigrateBackups ... +func (c BackupsClient) UnderVolumeMigrateBackups(ctx context.Context, id VolumeId, input BackupsMigrationRequest) (result UnderVolumeMigrateBackupsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/migrateBackups", 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 +} + +// UnderVolumeMigrateBackupsThenPoll performs UnderVolumeMigrateBackups then polls until it's completed +func (c BackupsClient) UnderVolumeMigrateBackupsThenPoll(ctx context.Context, id VolumeId, input BackupsMigrationRequest) error { + result, err := c.UnderVolumeMigrateBackups(ctx, id, input) + if err != nil { + return fmt.Errorf("performing UnderVolumeMigrateBackups: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UnderVolumeMigrateBackups: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/method_update.go b/resource-manager/netapp/2023-11-01/backups/method_update.go new file mode 100644 index 00000000000..0a8669d7caa --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/method_update.go @@ -0,0 +1,75 @@ +package backups + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Backup +} + +// Update ... +func (c BackupsClient) Update(ctx context.Context, id BackupId, input BackupPatch) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c BackupsClient) UpdateThenPoll(ctx context.Context, id BackupId, input BackupPatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backup.go b/resource-manager/netapp/2023-11-01/backups/model_backup.go new file mode 100644 index 00000000000..ef5ef0a7bc6 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backup.go @@ -0,0 +1,16 @@ +package backups + +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 Backup struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties BackupProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backuppatch.go b/resource-manager/netapp/2023-11-01/backups/model_backuppatch.go new file mode 100644 index 00000000000..a87251f4b0c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backuppatch.go @@ -0,0 +1,8 @@ +package backups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPatch struct { + Properties *BackupPatchProperties `json:"properties,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backuppatchproperties.go b/resource-manager/netapp/2023-11-01/backups/model_backuppatchproperties.go new file mode 100644 index 00000000000..b374bda3143 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backuppatchproperties.go @@ -0,0 +1,8 @@ +package backups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupPatchProperties struct { + Label *string `json:"label,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backupproperties.go b/resource-manager/netapp/2023-11-01/backups/model_backupproperties.go new file mode 100644 index 00000000000..168aa8182a9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backupproperties.go @@ -0,0 +1,36 @@ +package backups + +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 BackupProperties struct { + BackupId *string `json:"backupId,omitempty"` + BackupPolicyResourceId *string `json:"backupPolicyResourceId,omitempty"` + BackupType *BackupType `json:"backupType,omitempty"` + CreationDate *string `json:"creationDate,omitempty"` + FailureReason *string `json:"failureReason,omitempty"` + Label *string `json:"label,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Size *int64 `json:"size,omitempty"` + SnapshotName *string `json:"snapshotName,omitempty"` + UseExistingSnapshot *bool `json:"useExistingSnapshot,omitempty"` + VolumeResourceId string `json:"volumeResourceId"` +} + +func (o *BackupProperties) GetCreationDateAsTime() (*time.Time, error) { + if o.CreationDate == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationDate, "2006-01-02T15:04:05Z07:00") +} + +func (o *BackupProperties) SetCreationDateAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationDate = &formatted +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backuprestorefiles.go b/resource-manager/netapp/2023-11-01/backups/model_backuprestorefiles.go new file mode 100644 index 00000000000..e26ce886407 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backuprestorefiles.go @@ -0,0 +1,10 @@ +package backups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupRestoreFiles struct { + DestinationVolumeId string `json:"destinationVolumeId"` + FileList []string `json:"fileList"` + RestoreFilePath *string `json:"restoreFilePath,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backupsmigrationrequest.go b/resource-manager/netapp/2023-11-01/backups/model_backupsmigrationrequest.go new file mode 100644 index 00000000000..f0fb612b507 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backupsmigrationrequest.go @@ -0,0 +1,8 @@ +package backups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupsMigrationRequest struct { + BackupVaultId string `json:"backupVaultId"` +} diff --git a/resource-manager/netapp/2023-11-01/backups/model_backupstatus.go b/resource-manager/netapp/2023-11-01/backups/model_backupstatus.go new file mode 100644 index 00000000000..e873cd9463d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/model_backupstatus.go @@ -0,0 +1,16 @@ +package backups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupStatus struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Healthy *bool `json:"healthy,omitempty"` + LastTransferSize *int64 `json:"lastTransferSize,omitempty"` + LastTransferType *string `json:"lastTransferType,omitempty"` + MirrorState *MirrorState `json:"mirrorState,omitempty"` + RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` + TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"` + TransferProgressBytes *int64 `json:"transferProgressBytes,omitempty"` + UnhealthyReason *string `json:"unhealthyReason,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backups/predicates.go b/resource-manager/netapp/2023-11-01/backups/predicates.go new file mode 100644 index 00000000000..f5033a2bb91 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/predicates.go @@ -0,0 +1,27 @@ +package backups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p BackupOperationPredicate) Matches(input Backup) 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/netapp/2023-11-01/backups/version.go b/resource-manager/netapp/2023-11-01/backups/version.go new file mode 100644 index 00000000000..0c6f81b0247 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backups/version.go @@ -0,0 +1,12 @@ +package backups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/backups/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/README.md b/resource-manager/netapp/2023-11-01/backupvaults/README.md new file mode 100644 index 00000000000..e06b4ae1999 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/backupvaults` Documentation + +The `backupvaults` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/backupvaults" +``` + + +### Client Initialization + +```go +client := backupvaults.NewBackupVaultsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BackupVaultsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + +payload := backupvaults.BackupVault{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupVaultsClient.Delete` + +```go +ctx := context.TODO() +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `BackupVaultsClient.Get` + +```go +ctx := context.TODO() +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + +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: `BackupVaultsClient.ListByNetAppAccount` + +```go +ctx := context.TODO() +id := backupvaults.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +// alternatively `client.ListByNetAppAccount(ctx, id)` can be used to do batched pagination +items, err := client.ListByNetAppAccountComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BackupVaultsClient.Update` + +```go +ctx := context.TODO() +id := backupvaults.NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + +payload := backupvaults.BackupVaultPatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/backupvaults/client.go b/resource-manager/netapp/2023-11-01/backupvaults/client.go new file mode 100644 index 00000000000..7a4dd932170 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/client.go @@ -0,0 +1,26 @@ +package backupvaults + +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 BackupVaultsClient struct { + Client *resourcemanager.Client +} + +func NewBackupVaultsClientWithBaseURI(sdkApi sdkEnv.Api) (*BackupVaultsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "backupvaults", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating BackupVaultsClient: %+v", err) + } + + return &BackupVaultsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go new file mode 100644 index 00000000000..de1952d7834 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault.go @@ -0,0 +1,139 @@ +package backupvaults + +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(&BackupVaultId{}) +} + +var _ resourceids.ResourceId = &BackupVaultId{} + +// BackupVaultId is a struct representing the Resource ID for a Backup Vault +type BackupVaultId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + BackupVaultName string +} + +// NewBackupVaultID returns a new BackupVaultId struct +func NewBackupVaultID(subscriptionId string, resourceGroupName string, netAppAccountName string, backupVaultName string) BackupVaultId { + return BackupVaultId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + BackupVaultName: backupVaultName, + } +} + +// ParseBackupVaultID parses 'input' into a BackupVaultId +func ParseBackupVaultID(input string) (*BackupVaultId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupVaultId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupVaultId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseBackupVaultIDInsensitively parses 'input' case-insensitively into a BackupVaultId +// note: this method should only be used for API response data and not user input +func ParseBackupVaultIDInsensitively(input string) (*BackupVaultId, error) { + parser := resourceids.NewParserFromResourceIdType(&BackupVaultId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := BackupVaultId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *BackupVaultId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.BackupVaultName, ok = input.Parsed["backupVaultName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "backupVaultName", input) + } + + return nil +} + +// ValidateBackupVaultID checks that 'input' can be parsed as a Backup Vault ID +func ValidateBackupVaultID(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 := ParseBackupVaultID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Backup Vault ID +func (id BackupVaultId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/backupVaults/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.BackupVaultName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Backup Vault ID +func (id BackupVaultId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticBackupVaults", "backupVaults", "backupVaults"), + resourceids.UserSpecifiedSegment("backupVaultName", "backupVaultValue"), + } +} + +// String returns a human-readable description of this Backup Vault ID +func (id BackupVaultId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Backup Vault Name: %q", id.BackupVaultName), + } + return fmt.Sprintf("Backup Vault (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go new file mode 100644 index 00000000000..cf77b15613f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_backupvault_test.go @@ -0,0 +1,327 @@ +package backupvaults + +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 = &BackupVaultId{} + +func TestNewBackupVaultID(t *testing.T) { + id := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.BackupVaultName != "backupVaultValue" { + t.Fatalf("Expected %q but got %q for Segment 'BackupVaultName'", id.BackupVaultName, "backupVaultValue") + } +} + +func TestFormatBackupVaultID(t *testing.T) { + actual := NewBackupVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "backupVaultValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseBackupVaultID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupVaultId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue", + Expected: &BackupVaultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupVaultName: "backupVaultValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupVaultID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupVaultName != v.Expected.BackupVaultName { + t.Fatalf("Expected %q but got %q for BackupVaultName", v.Expected.BackupVaultName, actual.BackupVaultName) + } + + } +} + +func TestParseBackupVaultIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *BackupVaultId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue", + Expected: &BackupVaultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + BackupVaultName: "backupVaultValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/backupVaults/backupVaultValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE", + Expected: &BackupVaultId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + BackupVaultName: "bAcKuPvAuLtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/bAcKuPvAuLtS/bAcKuPvAuLtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseBackupVaultIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.BackupVaultName != v.Expected.BackupVaultName { + t.Fatalf("Expected %q but got %q for BackupVaultName", v.Expected.BackupVaultName, actual.BackupVaultName) + } + + } +} + +func TestSegmentsForBackupVaultId(t *testing.T) { + segments := BackupVaultId{}.Segments() + if len(segments) == 0 { + t.Fatalf("BackupVaultId 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/netapp/2023-11-01/backupvaults/id_netappaccount.go b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go new file mode 100644 index 00000000000..2096ade91b3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount.go @@ -0,0 +1,130 @@ +package backupvaults + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go new file mode 100644 index 00000000000..0f7d5ecb8d9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package backupvaults + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/backupvaults/method_createorupdate.go b/resource-manager/netapp/2023-11-01/backupvaults/method_createorupdate.go new file mode 100644 index 00000000000..0f75206e2d7 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/method_createorupdate.go @@ -0,0 +1,75 @@ +package backupvaults + +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 *BackupVault +} + +// CreateOrUpdate ... +func (c BackupVaultsClient) CreateOrUpdate(ctx context.Context, id BackupVaultId, input BackupVault) (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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c BackupVaultsClient) CreateOrUpdateThenPoll(ctx context.Context, id BackupVaultId, input BackupVault) error { + result, err := c.CreateOrUpdate(ctx, id, input) + 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/netapp/2023-11-01/backupvaults/method_delete.go b/resource-manager/netapp/2023-11-01/backupvaults/method_delete.go new file mode 100644 index 00000000000..32a1387f1ba --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/method_delete.go @@ -0,0 +1,70 @@ +package backupvaults + +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 BackupVaultsClient) Delete(ctx context.Context, id BackupVaultId) (result DeleteOperationResponse, 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 +} + +// DeleteThenPoll performs Delete then polls until it's completed +func (c BackupVaultsClient) DeleteThenPoll(ctx context.Context, id BackupVaultId) 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/netapp/2023-11-01/backupvaults/method_get.go b/resource-manager/netapp/2023-11-01/backupvaults/method_get.go new file mode 100644 index 00000000000..e3c1b3c6952 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/method_get.go @@ -0,0 +1,54 @@ +package backupvaults + +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 *BackupVault +} + +// Get ... +func (c BackupVaultsClient) Get(ctx context.Context, id BackupVaultId) (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 BackupVault + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/method_listbynetappaccount.go b/resource-manager/netapp/2023-11-01/backupvaults/method_listbynetappaccount.go new file mode 100644 index 00000000000..47b4c848ae4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/method_listbynetappaccount.go @@ -0,0 +1,91 @@ +package backupvaults + +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 ListByNetAppAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]BackupVault +} + +type ListByNetAppAccountCompleteResult struct { + LatestHttpResponse *http.Response + Items []BackupVault +} + +// ListByNetAppAccount ... +func (c BackupVaultsClient) ListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result ListByNetAppAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/backupVaults", 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 *[]BackupVault `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByNetAppAccountComplete retrieves all the results into a single object +func (c BackupVaultsClient) ListByNetAppAccountComplete(ctx context.Context, id NetAppAccountId) (ListByNetAppAccountCompleteResult, error) { + return c.ListByNetAppAccountCompleteMatchingPredicate(ctx, id, BackupVaultOperationPredicate{}) +} + +// ListByNetAppAccountCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c BackupVaultsClient) ListByNetAppAccountCompleteMatchingPredicate(ctx context.Context, id NetAppAccountId, predicate BackupVaultOperationPredicate) (result ListByNetAppAccountCompleteResult, err error) { + items := make([]BackupVault, 0) + + resp, err := c.ListByNetAppAccount(ctx, id) + if err != nil { + 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 = ListByNetAppAccountCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/method_update.go b/resource-manager/netapp/2023-11-01/backupvaults/method_update.go new file mode 100644 index 00000000000..8ea7dce3123 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/method_update.go @@ -0,0 +1,75 @@ +package backupvaults + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *BackupVault +} + +// Update ... +func (c BackupVaultsClient) Update(ctx context.Context, id BackupVaultId, input BackupVaultPatch) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c BackupVaultsClient) UpdateThenPoll(ctx context.Context, id BackupVaultId, input BackupVaultPatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/model_backupvault.go b/resource-manager/netapp/2023-11-01/backupvaults/model_backupvault.go new file mode 100644 index 00000000000..0e8761f2293 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/model_backupvault.go @@ -0,0 +1,18 @@ +package backupvaults + +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 BackupVault struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *BackupVaultProperties `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/netapp/2023-11-01/backupvaults/model_backupvaultpatch.go b/resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultpatch.go new file mode 100644 index 00000000000..899e2ecf858 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultpatch.go @@ -0,0 +1,8 @@ +package backupvaults + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupVaultPatch struct { + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultproperties.go b/resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultproperties.go new file mode 100644 index 00000000000..7327d4d2119 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/model_backupvaultproperties.go @@ -0,0 +1,8 @@ +package backupvaults + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupVaultProperties struct { + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/backupvaults/predicates.go b/resource-manager/netapp/2023-11-01/backupvaults/predicates.go new file mode 100644 index 00000000000..53d942f568c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/predicates.go @@ -0,0 +1,32 @@ +package backupvaults + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackupVaultOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p BackupVaultOperationPredicate) Matches(input BackupVault) 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/netapp/2023-11-01/backupvaults/version.go b/resource-manager/netapp/2023-11-01/backupvaults/version.go new file mode 100644 index 00000000000..742a32aa461 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/backupvaults/version.go @@ -0,0 +1,12 @@ +package backupvaults + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/backupvaults/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/README.md b/resource-manager/netapp/2023-11-01/capacitypools/README.md new file mode 100644 index 00000000000..6db036a4785 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/README.md @@ -0,0 +1,99 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/capacitypools` Documentation + +The `capacitypools` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/capacitypools" +``` + + +### Client Initialization + +```go +client := capacitypools.NewCapacityPoolsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CapacityPoolsClient.PoolsCreateOrUpdate` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + +payload := capacitypools.CapacityPool{ + // ... +} + + +if err := client.PoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsDelete` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + +if err := client.PoolsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsGet` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + +read, err := client.PoolsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsList` + +```go +ctx := context.TODO() +id := capacitypools.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +// alternatively `client.PoolsList(ctx, id)` can be used to do batched pagination +items, err := client.PoolsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CapacityPoolsClient.PoolsUpdate` + +```go +ctx := context.TODO() +id := capacitypools.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + +payload := capacitypools.CapacityPoolPatch{ + // ... +} + + +if err := client.PoolsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/capacitypools/client.go b/resource-manager/netapp/2023-11-01/capacitypools/client.go new file mode 100644 index 00000000000..3de33a3dc5b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/client.go @@ -0,0 +1,26 @@ +package capacitypools + +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 CapacityPoolsClient struct { + Client *resourcemanager.Client +} + +func NewCapacityPoolsClientWithBaseURI(sdkApi sdkEnv.Api) (*CapacityPoolsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "capacitypools", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating CapacityPoolsClient: %+v", err) + } + + return &CapacityPoolsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/constants.go b/resource-manager/netapp/2023-11-01/capacitypools/constants.go new file mode 100644 index 00000000000..802074e5dc1 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/constants.go @@ -0,0 +1,139 @@ +package capacitypools + +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 EncryptionType string + +const ( + EncryptionTypeDouble EncryptionType = "Double" + EncryptionTypeSingle EncryptionType = "Single" +) + +func PossibleValuesForEncryptionType() []string { + return []string{ + string(EncryptionTypeDouble), + string(EncryptionTypeSingle), + } +} + +func (s *EncryptionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEncryptionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEncryptionType(input string) (*EncryptionType, error) { + vals := map[string]EncryptionType{ + "double": EncryptionTypeDouble, + "single": EncryptionTypeSingle, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionType(input) + return &out, nil +} + +type QosType string + +const ( + QosTypeAuto QosType = "Auto" + QosTypeManual QosType = "Manual" +) + +func PossibleValuesForQosType() []string { + return []string{ + string(QosTypeAuto), + string(QosTypeManual), + } +} + +func (s *QosType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseQosType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseQosType(input string) (*QosType, error) { + vals := map[string]QosType{ + "auto": QosTypeAuto, + "manual": QosTypeManual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := QosType(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func (s *ServiceLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go new file mode 100644 index 00000000000..30b27305799 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool.go @@ -0,0 +1,139 @@ +package capacitypools + +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(&CapacityPoolId{}) +} + +var _ resourceids.ResourceId = &CapacityPoolId{} + +// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool +type CapacityPoolId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string +} + +// NewCapacityPoolID returns a new CapacityPoolId struct +func NewCapacityPoolID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string) CapacityPoolId { + return CapacityPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + } +} + +// ParseCapacityPoolID parses 'input' into a CapacityPoolId +func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&CapacityPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CapacityPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId +// note: this method should only be used for API response data and not user input +func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&CapacityPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CapacityPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CapacityPoolId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + return nil +} + +// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID +func ValidateCapacityPoolID(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 := ParseCapacityPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Capacity Pool ID +func (id CapacityPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID +func (id CapacityPoolId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + } +} + +// String returns a human-readable description of this Capacity Pool ID +func (id CapacityPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + } + return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go new file mode 100644 index 00000000000..6ce8a8c182c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_capacitypool_test.go @@ -0,0 +1,327 @@ +package capacitypools + +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 = &CapacityPoolId{} + +func TestNewCapacityPoolID(t *testing.T) { + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } +} + +func TestFormatCapacityPoolID(t *testing.T) { + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseCapacityPoolID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *CapacityPoolId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Expected: &CapacityPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseCapacityPoolID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + } +} + +func TestParseCapacityPoolIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *CapacityPoolId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Expected: &CapacityPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Expected: &CapacityPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseCapacityPoolIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + } +} + +func TestSegmentsForCapacityPoolId(t *testing.T) { + segments := CapacityPoolId{}.Segments() + if len(segments) == 0 { + t.Fatalf("CapacityPoolId 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/netapp/2023-11-01/capacitypools/id_netappaccount.go b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go new file mode 100644 index 00000000000..a77679932dd --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount.go @@ -0,0 +1,130 @@ +package capacitypools + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go new file mode 100644 index 00000000000..6f7d9e44a52 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package capacitypools + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/capacitypools/method_poolscreateorupdate.go b/resource-manager/netapp/2023-11-01/capacitypools/method_poolscreateorupdate.go new file mode 100644 index 00000000000..2083a6d9987 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/method_poolscreateorupdate.go @@ -0,0 +1,75 @@ +package capacitypools + +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 PoolsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CapacityPool +} + +// PoolsCreateOrUpdate ... +func (c CapacityPoolsClient) PoolsCreateOrUpdate(ctx context.Context, id CapacityPoolId, input CapacityPool) (result PoolsCreateOrUpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// PoolsCreateOrUpdateThenPoll performs PoolsCreateOrUpdate then polls until it's completed +func (c CapacityPoolsClient) PoolsCreateOrUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPool) error { + result, err := c.PoolsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PoolsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PoolsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/method_poolsdelete.go b/resource-manager/netapp/2023-11-01/capacitypools/method_poolsdelete.go new file mode 100644 index 00000000000..36c9e0e6bcf --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/method_poolsdelete.go @@ -0,0 +1,70 @@ +package capacitypools + +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 PoolsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// PoolsDelete ... +func (c CapacityPoolsClient) PoolsDelete(ctx context.Context, id CapacityPoolId) (result PoolsDeleteOperationResponse, 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 +} + +// PoolsDeleteThenPoll performs PoolsDelete then polls until it's completed +func (c CapacityPoolsClient) PoolsDeleteThenPoll(ctx context.Context, id CapacityPoolId) error { + result, err := c.PoolsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing PoolsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PoolsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/method_poolsget.go b/resource-manager/netapp/2023-11-01/capacitypools/method_poolsget.go new file mode 100644 index 00000000000..d2f91e09044 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/method_poolsget.go @@ -0,0 +1,54 @@ +package capacitypools + +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 PoolsGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CapacityPool +} + +// PoolsGet ... +func (c CapacityPoolsClient) PoolsGet(ctx context.Context, id CapacityPoolId) (result PoolsGetOperationResponse, 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 CapacityPool + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/method_poolslist.go b/resource-manager/netapp/2023-11-01/capacitypools/method_poolslist.go new file mode 100644 index 00000000000..a62454db5c3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/method_poolslist.go @@ -0,0 +1,91 @@ +package capacitypools + +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 PoolsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]CapacityPool +} + +type PoolsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []CapacityPool +} + +// PoolsList ... +func (c CapacityPoolsClient) PoolsList(ctx context.Context, id NetAppAccountId) (result PoolsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/capacityPools", 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 *[]CapacityPool `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// PoolsListComplete retrieves all the results into a single object +func (c CapacityPoolsClient) PoolsListComplete(ctx context.Context, id NetAppAccountId) (PoolsListCompleteResult, error) { + return c.PoolsListCompleteMatchingPredicate(ctx, id, CapacityPoolOperationPredicate{}) +} + +// PoolsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c CapacityPoolsClient) PoolsListCompleteMatchingPredicate(ctx context.Context, id NetAppAccountId, predicate CapacityPoolOperationPredicate) (result PoolsListCompleteResult, err error) { + items := make([]CapacityPool, 0) + + resp, err := c.PoolsList(ctx, id) + if err != nil { + 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 = PoolsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/method_poolsupdate.go b/resource-manager/netapp/2023-11-01/capacitypools/method_poolsupdate.go new file mode 100644 index 00000000000..df2c44337fd --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/method_poolsupdate.go @@ -0,0 +1,75 @@ +package capacitypools + +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 PoolsUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *CapacityPool +} + +// PoolsUpdate ... +func (c CapacityPoolsClient) PoolsUpdate(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) (result PoolsUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// PoolsUpdateThenPoll performs PoolsUpdate then polls until it's completed +func (c CapacityPoolsClient) PoolsUpdateThenPoll(ctx context.Context, id CapacityPoolId, input CapacityPoolPatch) error { + result, err := c.PoolsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing PoolsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PoolsUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/model_capacitypool.go b/resource-manager/netapp/2023-11-01/capacitypools/model_capacitypool.go new file mode 100644 index 00000000000..f5d6f1ea86d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/model_capacitypool.go @@ -0,0 +1,19 @@ +package capacitypools + +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 CapacityPool struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties PoolProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/model_capacitypoolpatch.go b/resource-manager/netapp/2023-11-01/capacitypools/model_capacitypoolpatch.go new file mode 100644 index 00000000000..46abcde6b33 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/model_capacitypoolpatch.go @@ -0,0 +1,13 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPoolPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *PoolPatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/model_poolpatchproperties.go b/resource-manager/netapp/2023-11-01/capacitypools/model_poolpatchproperties.go new file mode 100644 index 00000000000..c971dd8637c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/model_poolpatchproperties.go @@ -0,0 +1,10 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolPatchProperties struct { + CoolAccess *bool `json:"coolAccess,omitempty"` + QosType *QosType `json:"qosType,omitempty"` + Size *int64 `json:"size,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/model_poolproperties.go b/resource-manager/netapp/2023-11-01/capacitypools/model_poolproperties.go new file mode 100644 index 00000000000..a1fee733fb4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/model_poolproperties.go @@ -0,0 +1,16 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolProperties struct { + CoolAccess *bool `json:"coolAccess,omitempty"` + EncryptionType *EncryptionType `json:"encryptionType,omitempty"` + PoolId *string `json:"poolId,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + QosType *QosType `json:"qosType,omitempty"` + ServiceLevel ServiceLevel `json:"serviceLevel"` + Size int64 `json:"size"` + TotalThroughputMibps *float64 `json:"totalThroughputMibps,omitempty"` + UtilizedThroughputMibps *float64 `json:"utilizedThroughputMibps,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/predicates.go b/resource-manager/netapp/2023-11-01/capacitypools/predicates.go new file mode 100644 index 00000000000..386a7986d42 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/predicates.go @@ -0,0 +1,37 @@ +package capacitypools + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CapacityPoolOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p CapacityPoolOperationPredicate) Matches(input CapacityPool) 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 +} diff --git a/resource-manager/netapp/2023-11-01/capacitypools/version.go b/resource-manager/netapp/2023-11-01/capacitypools/version.go new file mode 100644 index 00000000000..54c4a477f54 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/capacitypools/version.go @@ -0,0 +1,12 @@ +package capacitypools + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/capacitypools/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/client.go b/resource-manager/netapp/2023-11-01/client.go new file mode 100644 index 00000000000..94a58af32a8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/client.go @@ -0,0 +1,208 @@ +package v2023_11_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/netapp/2023-11-01/backuppolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/backups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/backupvaults" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/capacitypools" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/filelocks" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/groupidlistforldapuser" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/netappaccounts" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/netappresource" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/poolchange" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/resetcifspassword" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/restore" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/snapshotpolicy" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/snapshots" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/subvolumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumequotarules" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumes" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumesrelocation" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumesreplication" + "github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumesrevert" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + BackupPolicy *backuppolicy.BackupPolicyClient + BackupVaults *backupvaults.BackupVaultsClient + Backups *backups.BackupsClient + CapacityPools *capacitypools.CapacityPoolsClient + FileLocks *filelocks.FileLocksClient + GroupIdListForLDAPUser *groupidlistforldapuser.GroupIdListForLDAPUserClient + NetAppAccounts *netappaccounts.NetAppAccountsClient + NetAppResource *netappresource.NetAppResourceClient + PoolChange *poolchange.PoolChangeClient + ResetCifsPassword *resetcifspassword.ResetCifsPasswordClient + Restore *restore.RestoreClient + SnapshotPolicy *snapshotpolicy.SnapshotPolicyClient + SnapshotPolicyListVolumes *snapshotpolicylistvolumes.SnapshotPolicyListVolumesClient + Snapshots *snapshots.SnapshotsClient + SubVolumes *subvolumes.SubVolumesClient + VolumeGroups *volumegroups.VolumeGroupsClient + VolumeQuotaRules *volumequotarules.VolumeQuotaRulesClient + Volumes *volumes.VolumesClient + VolumesRelocation *volumesrelocation.VolumesRelocationClient + VolumesReplication *volumesreplication.VolumesReplicationClient + VolumesRevert *volumesrevert.VolumesRevertClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + backupPolicyClient, err := backuppolicy.NewBackupPolicyClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building BackupPolicy client: %+v", err) + } + configureFunc(backupPolicyClient.Client) + + backupVaultsClient, err := backupvaults.NewBackupVaultsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building BackupVaults client: %+v", err) + } + configureFunc(backupVaultsClient.Client) + + backupsClient, err := backups.NewBackupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Backups client: %+v", err) + } + configureFunc(backupsClient.Client) + + capacityPoolsClient, err := capacitypools.NewCapacityPoolsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CapacityPools client: %+v", err) + } + configureFunc(capacityPoolsClient.Client) + + fileLocksClient, err := filelocks.NewFileLocksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building FileLocks client: %+v", err) + } + configureFunc(fileLocksClient.Client) + + groupIdListForLDAPUserClient, err := groupidlistforldapuser.NewGroupIdListForLDAPUserClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building GroupIdListForLDAPUser client: %+v", err) + } + configureFunc(groupIdListForLDAPUserClient.Client) + + netAppAccountsClient, err := netappaccounts.NewNetAppAccountsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetAppAccounts client: %+v", err) + } + configureFunc(netAppAccountsClient.Client) + + netAppResourceClient, err := netappresource.NewNetAppResourceClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetAppResource client: %+v", err) + } + configureFunc(netAppResourceClient.Client) + + poolChangeClient, err := poolchange.NewPoolChangeClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PoolChange client: %+v", err) + } + configureFunc(poolChangeClient.Client) + + resetCifsPasswordClient, err := resetcifspassword.NewResetCifsPasswordClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ResetCifsPassword client: %+v", err) + } + configureFunc(resetCifsPasswordClient.Client) + + restoreClient, err := restore.NewRestoreClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Restore client: %+v", err) + } + configureFunc(restoreClient.Client) + + snapshotPolicyClient, err := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SnapshotPolicy client: %+v", err) + } + configureFunc(snapshotPolicyClient.Client) + + snapshotPolicyListVolumesClient, err := snapshotpolicylistvolumes.NewSnapshotPolicyListVolumesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SnapshotPolicyListVolumes client: %+v", err) + } + configureFunc(snapshotPolicyListVolumesClient.Client) + + snapshotsClient, err := snapshots.NewSnapshotsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Snapshots client: %+v", err) + } + configureFunc(snapshotsClient.Client) + + subVolumesClient, err := subvolumes.NewSubVolumesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SubVolumes client: %+v", err) + } + configureFunc(subVolumesClient.Client) + + volumeGroupsClient, err := volumegroups.NewVolumeGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VolumeGroups client: %+v", err) + } + configureFunc(volumeGroupsClient.Client) + + volumeQuotaRulesClient, err := volumequotarules.NewVolumeQuotaRulesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VolumeQuotaRules client: %+v", err) + } + configureFunc(volumeQuotaRulesClient.Client) + + volumesClient, err := volumes.NewVolumesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Volumes client: %+v", err) + } + configureFunc(volumesClient.Client) + + volumesRelocationClient, err := volumesrelocation.NewVolumesRelocationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VolumesRelocation client: %+v", err) + } + configureFunc(volumesRelocationClient.Client) + + volumesReplicationClient, err := volumesreplication.NewVolumesReplicationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VolumesReplication client: %+v", err) + } + configureFunc(volumesReplicationClient.Client) + + volumesRevertClient, err := volumesrevert.NewVolumesRevertClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VolumesRevert client: %+v", err) + } + configureFunc(volumesRevertClient.Client) + + return &Client{ + BackupPolicy: backupPolicyClient, + BackupVaults: backupVaultsClient, + Backups: backupsClient, + CapacityPools: capacityPoolsClient, + FileLocks: fileLocksClient, + GroupIdListForLDAPUser: groupIdListForLDAPUserClient, + NetAppAccounts: netAppAccountsClient, + NetAppResource: netAppResourceClient, + PoolChange: poolChangeClient, + ResetCifsPassword: resetCifsPasswordClient, + Restore: restoreClient, + SnapshotPolicy: snapshotPolicyClient, + SnapshotPolicyListVolumes: snapshotPolicyListVolumesClient, + Snapshots: snapshotsClient, + SubVolumes: subVolumesClient, + VolumeGroups: volumeGroupsClient, + VolumeQuotaRules: volumeQuotaRulesClient, + Volumes: volumesClient, + VolumesRelocation: volumesRelocationClient, + VolumesReplication: volumesReplicationClient, + VolumesRevert: volumesRevertClient, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/filelocks/README.md b/resource-manager/netapp/2023-11-01/filelocks/README.md new file mode 100644 index 00000000000..e41d3643b0f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/filelocks` Documentation + +The `filelocks` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/filelocks" +``` + + +### Client Initialization + +```go +client := filelocks.NewFileLocksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `FileLocksClient.VolumesBreakFileLocks` + +```go +ctx := context.TODO() +id := filelocks.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := filelocks.BreakFileLocksRequest{ + // ... +} + + +if err := client.VolumesBreakFileLocksThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/filelocks/client.go b/resource-manager/netapp/2023-11-01/filelocks/client.go new file mode 100644 index 00000000000..7f39f5ef46b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/client.go @@ -0,0 +1,26 @@ +package filelocks + +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 FileLocksClient struct { + Client *resourcemanager.Client +} + +func NewFileLocksClientWithBaseURI(sdkApi sdkEnv.Api) (*FileLocksClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "filelocks", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating FileLocksClient: %+v", err) + } + + return &FileLocksClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/filelocks/id_volume.go b/resource-manager/netapp/2023-11-01/filelocks/id_volume.go new file mode 100644 index 00000000000..8f6a5960750 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/id_volume.go @@ -0,0 +1,148 @@ +package filelocks + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go b/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go new file mode 100644 index 00000000000..fae019ae972 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/id_volume_test.go @@ -0,0 +1,372 @@ +package filelocks + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/filelocks/method_volumesbreakfilelocks.go b/resource-manager/netapp/2023-11-01/filelocks/method_volumesbreakfilelocks.go new file mode 100644 index 00000000000..c1ff2b4b86f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/method_volumesbreakfilelocks.go @@ -0,0 +1,74 @@ +package filelocks + +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 VolumesBreakFileLocksOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesBreakFileLocks ... +func (c FileLocksClient) VolumesBreakFileLocks(ctx context.Context, id VolumeId, input BreakFileLocksRequest) (result VolumesBreakFileLocksOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/breakFileLocks", 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 +} + +// VolumesBreakFileLocksThenPoll performs VolumesBreakFileLocks then polls until it's completed +func (c FileLocksClient) VolumesBreakFileLocksThenPoll(ctx context.Context, id VolumeId, input BreakFileLocksRequest) error { + result, err := c.VolumesBreakFileLocks(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesBreakFileLocks: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesBreakFileLocks: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/filelocks/model_breakfilelocksrequest.go b/resource-manager/netapp/2023-11-01/filelocks/model_breakfilelocksrequest.go new file mode 100644 index 00000000000..62fa9fc9808 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/model_breakfilelocksrequest.go @@ -0,0 +1,9 @@ +package filelocks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BreakFileLocksRequest struct { + ClientIP *string `json:"clientIp,omitempty"` + ConfirmRunningDisruptiveOperation *bool `json:"confirmRunningDisruptiveOperation,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/filelocks/version.go b/resource-manager/netapp/2023-11-01/filelocks/version.go new file mode 100644 index 00000000000..35d59c87af2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/filelocks/version.go @@ -0,0 +1,12 @@ +package filelocks + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/filelocks/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md new file mode 100644 index 00000000000..6d06dcb8646 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/groupidlistforldapuser` Documentation + +The `groupidlistforldapuser` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/groupidlistforldapuser" +``` + + +### Client Initialization + +```go +client := groupidlistforldapuser.NewGroupIdListForLDAPUserClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `GroupIdListForLDAPUserClient.VolumesListGetGroupIdListForLdapUser` + +```go +ctx := context.TODO() +id := groupidlistforldapuser.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := groupidlistforldapuser.GetGroupIdListForLDAPUserRequest{ + // ... +} + + +if err := client.VolumesListGetGroupIdListForLdapUserThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/client.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/client.go new file mode 100644 index 00000000000..b954d6fe7dc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/client.go @@ -0,0 +1,26 @@ +package groupidlistforldapuser + +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 GroupIdListForLDAPUserClient struct { + Client *resourcemanager.Client +} + +func NewGroupIdListForLDAPUserClientWithBaseURI(sdkApi sdkEnv.Api) (*GroupIdListForLDAPUserClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "groupidlistforldapuser", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating GroupIdListForLDAPUserClient: %+v", err) + } + + return &GroupIdListForLDAPUserClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go new file mode 100644 index 00000000000..74868cea51a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume.go @@ -0,0 +1,148 @@ +package groupidlistforldapuser + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go new file mode 100644 index 00000000000..1f49930d14a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/id_volume_test.go @@ -0,0 +1,372 @@ +package groupidlistforldapuser + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/groupidlistforldapuser/method_volumeslistgetgroupidlistforldapuser.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/method_volumeslistgetgroupidlistforldapuser.go new file mode 100644 index 00000000000..9c2248727d2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/method_volumeslistgetgroupidlistforldapuser.go @@ -0,0 +1,75 @@ +package groupidlistforldapuser + +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 VolumesListGetGroupIdListForLdapUserOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *GetGroupIdListForLDAPUserResponse +} + +// VolumesListGetGroupIdListForLdapUser ... +func (c GroupIdListForLDAPUserClient) VolumesListGetGroupIdListForLdapUser(ctx context.Context, id VolumeId, input GetGroupIdListForLDAPUserRequest) (result VolumesListGetGroupIdListForLdapUserOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/getGroupIdListForLdapUser", 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 +} + +// VolumesListGetGroupIdListForLdapUserThenPoll performs VolumesListGetGroupIdListForLdapUser then polls until it's completed +func (c GroupIdListForLDAPUserClient) VolumesListGetGroupIdListForLdapUserThenPoll(ctx context.Context, id VolumeId, input GetGroupIdListForLDAPUserRequest) error { + result, err := c.VolumesListGetGroupIdListForLdapUser(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesListGetGroupIdListForLdapUser: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesListGetGroupIdListForLdapUser: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserrequest.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserrequest.go new file mode 100644 index 00000000000..797ecd9aa2a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserrequest.go @@ -0,0 +1,8 @@ +package groupidlistforldapuser + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetGroupIdListForLDAPUserRequest struct { + Username string `json:"username"` +} diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserresponse.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserresponse.go new file mode 100644 index 00000000000..42c528df2f2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/model_getgroupidlistforldapuserresponse.go @@ -0,0 +1,8 @@ +package groupidlistforldapuser + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type GetGroupIdListForLDAPUserResponse struct { + GroupIdsForLdapUser *[]string `json:"groupIdsForLdapUser,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/groupidlistforldapuser/version.go b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/version.go new file mode 100644 index 00000000000..842d4227ab9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/groupidlistforldapuser/version.go @@ -0,0 +1,12 @@ +package groupidlistforldapuser + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/groupidlistforldapuser/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/README.md b/resource-manager/netapp/2023-11-01/netappaccounts/README.md new file mode 100644 index 00000000000..9d541bb9ec4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/README.md @@ -0,0 +1,129 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/netappaccounts` Documentation + +The `netappaccounts` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/netappaccounts" +``` + + +### Client Initialization + +```go +client := netappaccounts.NewNetAppAccountsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetAppAccountsClient.AccountsCreateOrUpdate` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +payload := netappaccounts.NetAppAccount{ + // ... +} + + +if err := client.AccountsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsDelete` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +if err := client.AccountsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsGet` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +read, err := client.AccountsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsList` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.AccountsList(ctx, id)` can be used to do batched pagination +items, err := client.AccountsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.AccountsListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.AccountsListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsRenewCredentials` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +if err := client.AccountsRenewCredentialsThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetAppAccountsClient.AccountsUpdate` + +```go +ctx := context.TODO() +id := netappaccounts.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +payload := netappaccounts.NetAppAccountPatch{ + // ... +} + + +if err := client.AccountsUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/client.go b/resource-manager/netapp/2023-11-01/netappaccounts/client.go new file mode 100644 index 00000000000..172f1218e2c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/client.go @@ -0,0 +1,26 @@ +package netappaccounts + +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 NetAppAccountsClient struct { + Client *resourcemanager.Client +} + +func NewNetAppAccountsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetAppAccountsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "netappaccounts", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating NetAppAccountsClient: %+v", err) + } + + return &NetAppAccountsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/constants.go b/resource-manager/netapp/2023-11-01/netappaccounts/constants.go new file mode 100644 index 00000000000..f8d0489c2a0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/constants.go @@ -0,0 +1,151 @@ +package netappaccounts + +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 ActiveDirectoryStatus string + +const ( + ActiveDirectoryStatusCreated ActiveDirectoryStatus = "Created" + ActiveDirectoryStatusDeleted ActiveDirectoryStatus = "Deleted" + ActiveDirectoryStatusError ActiveDirectoryStatus = "Error" + ActiveDirectoryStatusInUse ActiveDirectoryStatus = "InUse" + ActiveDirectoryStatusUpdating ActiveDirectoryStatus = "Updating" +) + +func PossibleValuesForActiveDirectoryStatus() []string { + return []string{ + string(ActiveDirectoryStatusCreated), + string(ActiveDirectoryStatusDeleted), + string(ActiveDirectoryStatusError), + string(ActiveDirectoryStatusInUse), + string(ActiveDirectoryStatusUpdating), + } +} + +func (s *ActiveDirectoryStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseActiveDirectoryStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseActiveDirectoryStatus(input string) (*ActiveDirectoryStatus, error) { + vals := map[string]ActiveDirectoryStatus{ + "created": ActiveDirectoryStatusCreated, + "deleted": ActiveDirectoryStatusDeleted, + "error": ActiveDirectoryStatusError, + "inuse": ActiveDirectoryStatusInUse, + "updating": ActiveDirectoryStatusUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActiveDirectoryStatus(input) + return &out, nil +} + +type KeySource string + +const ( + KeySourceMicrosoftPointKeyVault KeySource = "Microsoft.KeyVault" + KeySourceMicrosoftPointNetApp KeySource = "Microsoft.NetApp" +) + +func PossibleValuesForKeySource() []string { + return []string{ + string(KeySourceMicrosoftPointKeyVault), + string(KeySourceMicrosoftPointNetApp), + } +} + +func (s *KeySource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKeySource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKeySource(input string) (*KeySource, error) { + vals := map[string]KeySource{ + "microsoft.keyvault": KeySourceMicrosoftPointKeyVault, + "microsoft.netapp": KeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeySource(input) + return &out, nil +} + +type KeyVaultStatus string + +const ( + KeyVaultStatusCreated KeyVaultStatus = "Created" + KeyVaultStatusDeleted KeyVaultStatus = "Deleted" + KeyVaultStatusError KeyVaultStatus = "Error" + KeyVaultStatusInUse KeyVaultStatus = "InUse" + KeyVaultStatusUpdating KeyVaultStatus = "Updating" +) + +func PossibleValuesForKeyVaultStatus() []string { + return []string{ + string(KeyVaultStatusCreated), + string(KeyVaultStatusDeleted), + string(KeyVaultStatusError), + string(KeyVaultStatusInUse), + string(KeyVaultStatusUpdating), + } +} + +func (s *KeyVaultStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseKeyVaultStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseKeyVaultStatus(input string) (*KeyVaultStatus, error) { + vals := map[string]KeyVaultStatus{ + "created": KeyVaultStatusCreated, + "deleted": KeyVaultStatusDeleted, + "error": KeyVaultStatusError, + "inuse": KeyVaultStatusInUse, + "updating": KeyVaultStatusUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := KeyVaultStatus(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go new file mode 100644 index 00000000000..a93e2cd2ea8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount.go @@ -0,0 +1,130 @@ +package netappaccounts + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go new file mode 100644 index 00000000000..d457f762e3d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package netappaccounts + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/netappaccounts/method_accountscreateorupdate.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountscreateorupdate.go new file mode 100644 index 00000000000..42add8d5ac1 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountscreateorupdate.go @@ -0,0 +1,75 @@ +package netappaccounts + +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 AccountsCreateOrUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetAppAccount +} + +// AccountsCreateOrUpdate ... +func (c NetAppAccountsClient) AccountsCreateOrUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccount) (result AccountsCreateOrUpdateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AccountsCreateOrUpdateThenPoll performs AccountsCreateOrUpdate then polls until it's completed +func (c NetAppAccountsClient) AccountsCreateOrUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccount) error { + result, err := c.AccountsCreateOrUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AccountsCreateOrUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AccountsCreateOrUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsdelete.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsdelete.go new file mode 100644 index 00000000000..ae46b7b061d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsdelete.go @@ -0,0 +1,70 @@ +package netappaccounts + +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 AccountsDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AccountsDelete ... +func (c NetAppAccountsClient) AccountsDelete(ctx context.Context, id NetAppAccountId) (result AccountsDeleteOperationResponse, 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 +} + +// AccountsDeleteThenPoll performs AccountsDelete then polls until it's completed +func (c NetAppAccountsClient) AccountsDeleteThenPoll(ctx context.Context, id NetAppAccountId) error { + result, err := c.AccountsDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing AccountsDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AccountsDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsget.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsget.go new file mode 100644 index 00000000000..dc67125153f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsget.go @@ -0,0 +1,54 @@ +package netappaccounts + +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 AccountsGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *NetAppAccount +} + +// AccountsGet ... +func (c NetAppAccountsClient) AccountsGet(ctx context.Context, id NetAppAccountId) (result AccountsGetOperationResponse, 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 NetAppAccount + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/method_accountslist.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountslist.go new file mode 100644 index 00000000000..1ccc225b892 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountslist.go @@ -0,0 +1,92 @@ +package netappaccounts + +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 AccountsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]NetAppAccount +} + +type AccountsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []NetAppAccount +} + +// AccountsList ... +func (c NetAppAccountsClient) AccountsList(ctx context.Context, id commonids.ResourceGroupId) (result AccountsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", 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 *[]NetAppAccount `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// AccountsListComplete retrieves all the results into a single object +func (c NetAppAccountsClient) AccountsListComplete(ctx context.Context, id commonids.ResourceGroupId) (AccountsListCompleteResult, error) { + return c.AccountsListCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) +} + +// AccountsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c NetAppAccountsClient) AccountsListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetAppAccountOperationPredicate) (result AccountsListCompleteResult, err error) { + items := make([]NetAppAccount, 0) + + resp, err := c.AccountsList(ctx, id) + if err != nil { + 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 = AccountsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/method_accountslistbysubscription.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountslistbysubscription.go new file mode 100644 index 00000000000..2445d4d4e48 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountslistbysubscription.go @@ -0,0 +1,92 @@ +package netappaccounts + +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 AccountsListBySubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]NetAppAccount +} + +type AccountsListBySubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []NetAppAccount +} + +// AccountsListBySubscription ... +func (c NetAppAccountsClient) AccountsListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result AccountsListBySubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.NetApp/netAppAccounts", 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 *[]NetAppAccount `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// AccountsListBySubscriptionComplete retrieves all the results into a single object +func (c NetAppAccountsClient) AccountsListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (AccountsListBySubscriptionCompleteResult, error) { + return c.AccountsListBySubscriptionCompleteMatchingPredicate(ctx, id, NetAppAccountOperationPredicate{}) +} + +// AccountsListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c NetAppAccountsClient) AccountsListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetAppAccountOperationPredicate) (result AccountsListBySubscriptionCompleteResult, err error) { + items := make([]NetAppAccount, 0) + + resp, err := c.AccountsListBySubscription(ctx, id) + if err != nil { + 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 = AccountsListBySubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsrenewcredentials.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsrenewcredentials.go new file mode 100644 index 00000000000..4d7aca0b151 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsrenewcredentials.go @@ -0,0 +1,70 @@ +package netappaccounts + +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 AccountsRenewCredentialsOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// AccountsRenewCredentials ... +func (c NetAppAccountsClient) AccountsRenewCredentials(ctx context.Context, id NetAppAccountId) (result AccountsRenewCredentialsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/renewCredentials", 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 +} + +// AccountsRenewCredentialsThenPoll performs AccountsRenewCredentials then polls until it's completed +func (c NetAppAccountsClient) AccountsRenewCredentialsThenPoll(ctx context.Context, id NetAppAccountId) error { + result, err := c.AccountsRenewCredentials(ctx, id) + if err != nil { + return fmt.Errorf("performing AccountsRenewCredentials: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AccountsRenewCredentials: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsupdate.go b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsupdate.go new file mode 100644 index 00000000000..8957725808a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/method_accountsupdate.go @@ -0,0 +1,75 @@ +package netappaccounts + +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 AccountsUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetAppAccount +} + +// AccountsUpdate ... +func (c NetAppAccountsClient) AccountsUpdate(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) (result AccountsUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// AccountsUpdateThenPoll performs AccountsUpdate then polls until it's completed +func (c NetAppAccountsClient) AccountsUpdateThenPoll(ctx context.Context, id NetAppAccountId, input NetAppAccountPatch) error { + result, err := c.AccountsUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing AccountsUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after AccountsUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_accountencryption.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_accountencryption.go new file mode 100644 index 00000000000..93f1a662f77 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_accountencryption.go @@ -0,0 +1,10 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountEncryption struct { + Identity *EncryptionIdentity `json:"identity,omitempty"` + KeySource *KeySource `json:"keySource,omitempty"` + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_accountproperties.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_accountproperties.go new file mode 100644 index 00000000000..18428908f56 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_accountproperties.go @@ -0,0 +1,11 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AccountProperties struct { + ActiveDirectories *[]ActiveDirectory `json:"activeDirectories,omitempty"` + DisableShowmount *bool `json:"disableShowmount,omitempty"` + Encryption *AccountEncryption `json:"encryption,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_activedirectory.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_activedirectory.go new file mode 100644 index 00000000000..81bbf0d2927 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_activedirectory.go @@ -0,0 +1,30 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActiveDirectory struct { + ActiveDirectoryId *string `json:"activeDirectoryId,omitempty"` + AdName *string `json:"adName,omitempty"` + Administrators *[]string `json:"administrators,omitempty"` + AesEncryption *bool `json:"aesEncryption,omitempty"` + AllowLocalNfsUsersWithLdap *bool `json:"allowLocalNfsUsersWithLdap,omitempty"` + BackupOperators *[]string `json:"backupOperators,omitempty"` + Dns *string `json:"dns,omitempty"` + Domain *string `json:"domain,omitempty"` + EncryptDCConnections *bool `json:"encryptDCConnections,omitempty"` + KdcIP *string `json:"kdcIP,omitempty"` + LdapOverTLS *bool `json:"ldapOverTLS,omitempty"` + LdapSearchScope *LdapSearchScopeOpt `json:"ldapSearchScope,omitempty"` + LdapSigning *bool `json:"ldapSigning,omitempty"` + OrganizationalUnit *string `json:"organizationalUnit,omitempty"` + Password *string `json:"password,omitempty"` + PreferredServersForLdapClient *string `json:"preferredServersForLdapClient,omitempty"` + SecurityOperators *[]string `json:"securityOperators,omitempty"` + ServerRootCACertificate *string `json:"serverRootCACertificate,omitempty"` + Site *string `json:"site,omitempty"` + SmbServerName *string `json:"smbServerName,omitempty"` + Status *ActiveDirectoryStatus `json:"status,omitempty"` + StatusDetails *string `json:"statusDetails,omitempty"` + Username *string `json:"username,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_encryptionidentity.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_encryptionidentity.go new file mode 100644 index 00000000000..50cf4dbf679 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_encryptionidentity.go @@ -0,0 +1,9 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type EncryptionIdentity struct { + PrincipalId *string `json:"principalId,omitempty"` + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_keyvaultproperties.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_keyvaultproperties.go new file mode 100644 index 00000000000..ac5d8c6afa4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_keyvaultproperties.go @@ -0,0 +1,12 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultProperties struct { + KeyName string `json:"keyName"` + KeyVaultId *string `json:"keyVaultId,omitempty"` + KeyVaultResourceId string `json:"keyVaultResourceId"` + KeyVaultUri string `json:"keyVaultUri"` + Status *KeyVaultStatus `json:"status,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_ldapsearchscopeopt.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_ldapsearchscopeopt.go new file mode 100644 index 00000000000..c476b0f0875 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_ldapsearchscopeopt.go @@ -0,0 +1,10 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type LdapSearchScopeOpt struct { + GroupDN *string `json:"groupDN,omitempty"` + GroupMembershipFilter *string `json:"groupMembershipFilter,omitempty"` + UserDN *string `json:"userDN,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccount.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccount.go new file mode 100644 index 00000000000..ae38663e126 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccount.go @@ -0,0 +1,21 @@ +package netappaccounts + +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 NetAppAccount struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `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/netapp/2023-11-01/netappaccounts/model_netappaccountpatch.go b/resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccountpatch.go new file mode 100644 index 00000000000..9f24bca3d5a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/model_netappaccountpatch.go @@ -0,0 +1,18 @@ +package netappaccounts + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccountPatch struct { + Id *string `json:"id,omitempty"` + Identity *identity.LegacySystemAndUserAssignedMap `json:"identity,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *AccountProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/predicates.go b/resource-manager/netapp/2023-11-01/netappaccounts/predicates.go new file mode 100644 index 00000000000..ad2c0a55483 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/predicates.go @@ -0,0 +1,37 @@ +package netappaccounts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetAppAccountOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p NetAppAccountOperationPredicate) Matches(input NetAppAccount) 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 +} diff --git a/resource-manager/netapp/2023-11-01/netappaccounts/version.go b/resource-manager/netapp/2023-11-01/netappaccounts/version.go new file mode 100644 index 00000000000..2fb0e0d3b5b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappaccounts/version.go @@ -0,0 +1,12 @@ +package netappaccounts + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/netappaccounts/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/README.md b/resource-manager/netapp/2023-11-01/netappresource/README.md new file mode 100644 index 00000000000..3c06a7e8175 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/README.md @@ -0,0 +1,202 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/netappresource` Documentation + +The `netappresource` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/netappresource" +``` + + +### Client Initialization + +```go +client := netappresource.NewNetAppResourceClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetAppResourceClient.CheckFilePathAvailability` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := netappresource.FilePathAvailabilityRequest{ + // ... +} + + +read, err := client.CheckFilePathAvailability(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.CheckNameAvailability` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := netappresource.ResourceNameAvailabilityRequest{ + // ... +} + + +read, err := client.CheckNameAvailability(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.CheckQuotaAvailability` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := netappresource.QuotaAvailabilityRequest{ + // ... +} + + +read, err := client.CheckQuotaAvailability(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.QueryNetworkSiblingSet` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := netappresource.QueryNetworkSiblingSetRequest{ + // ... +} + + +read, err := client.QueryNetworkSiblingSet(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.QueryRegionInfo` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.QueryRegionInfo(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.QuotaLimitsGet` + +```go +ctx := context.TODO() +id := netappresource.NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationValue", "quotaLimitValue") + +read, err := client.QuotaLimitsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.QuotaLimitsList` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.QuotaLimitsList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.RegionInfosGet` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.RegionInfosGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetAppResourceClient.RegionInfosList` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.RegionInfosList(ctx, id)` can be used to do batched pagination +items, err := client.RegionInfosListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetAppResourceClient.UpdateNetworkSiblingSet` + +```go +ctx := context.TODO() +id := netappresource.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := netappresource.UpdateNetworkSiblingSetRequest{ + // ... +} + + +if err := client.UpdateNetworkSiblingSetThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/netappresource/client.go b/resource-manager/netapp/2023-11-01/netappresource/client.go new file mode 100644 index 00000000000..e02988617d8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/client.go @@ -0,0 +1,26 @@ +package netappresource + +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 NetAppResourceClient struct { + Client *resourcemanager.Client +} + +func NewNetAppResourceClientWithBaseURI(sdkApi sdkEnv.Api) (*NetAppResourceClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "netappresource", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating NetAppResourceClient: %+v", err) + } + + return &NetAppResourceClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/constants.go b/resource-manager/netapp/2023-11-01/netappresource/constants.go new file mode 100644 index 00000000000..5f4e36630e6 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/constants.go @@ -0,0 +1,298 @@ +package netappresource + +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 CheckNameResourceTypes string + +const ( + CheckNameResourceTypesMicrosoftPointNetAppNetAppAccounts CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts" + CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPools CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" + CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumes CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumesSnapshots CheckNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" +) + +func PossibleValuesForCheckNameResourceTypes() []string { + return []string{ + string(CheckNameResourceTypesMicrosoftPointNetAppNetAppAccounts), + string(CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPools), + string(CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumes), + string(CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumesSnapshots), + } +} + +func (s *CheckNameResourceTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCheckNameResourceTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCheckNameResourceTypes(input string) (*CheckNameResourceTypes, error) { + vals := map[string]CheckNameResourceTypes{ + "microsoft.netapp/netappaccounts": CheckNameResourceTypesMicrosoftPointNetAppNetAppAccounts, + "microsoft.netapp/netappaccounts/capacitypools": CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPools, + "microsoft.netapp/netappaccounts/capacitypools/volumes": CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumes, + "microsoft.netapp/netappaccounts/capacitypools/volumes/snapshots": CheckNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumesSnapshots, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CheckNameResourceTypes(input) + return &out, nil +} + +type CheckQuotaNameResourceTypes string + +const ( + CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccounts CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts" + CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPools CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools" + CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumes CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes" + CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumesSnapshots CheckQuotaNameResourceTypes = "Microsoft.NetApp/netAppAccounts/capacityPools/volumes/snapshots" +) + +func PossibleValuesForCheckQuotaNameResourceTypes() []string { + return []string{ + string(CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccounts), + string(CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPools), + string(CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumes), + string(CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumesSnapshots), + } +} + +func (s *CheckQuotaNameResourceTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCheckQuotaNameResourceTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCheckQuotaNameResourceTypes(input string) (*CheckQuotaNameResourceTypes, error) { + vals := map[string]CheckQuotaNameResourceTypes{ + "microsoft.netapp/netappaccounts": CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccounts, + "microsoft.netapp/netappaccounts/capacitypools": CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPools, + "microsoft.netapp/netappaccounts/capacitypools/volumes": CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumes, + "microsoft.netapp/netappaccounts/capacitypools/volumes/snapshots": CheckQuotaNameResourceTypesMicrosoftPointNetAppNetAppAccountsCapacityPoolsVolumesSnapshots, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CheckQuotaNameResourceTypes(input) + return &out, nil +} + +type InAvailabilityReasonType string + +const ( + InAvailabilityReasonTypeAlreadyExists InAvailabilityReasonType = "AlreadyExists" + InAvailabilityReasonTypeInvalid InAvailabilityReasonType = "Invalid" +) + +func PossibleValuesForInAvailabilityReasonType() []string { + return []string{ + string(InAvailabilityReasonTypeAlreadyExists), + string(InAvailabilityReasonTypeInvalid), + } +} + +func (s *InAvailabilityReasonType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseInAvailabilityReasonType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseInAvailabilityReasonType(input string) (*InAvailabilityReasonType, error) { + vals := map[string]InAvailabilityReasonType{ + "alreadyexists": InAvailabilityReasonTypeAlreadyExists, + "invalid": InAvailabilityReasonTypeInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := InAvailabilityReasonType(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesBasicStandard NetworkFeatures = "Basic_Standard" + NetworkFeaturesStandard NetworkFeatures = "Standard" + NetworkFeaturesStandardBasic NetworkFeatures = "Standard_Basic" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesBasicStandard), + string(NetworkFeaturesStandard), + string(NetworkFeaturesStandardBasic), + } +} + +func (s *NetworkFeatures) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkFeatures(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "basic_standard": NetworkFeaturesBasicStandard, + "standard": NetworkFeaturesStandard, + "standard_basic": NetworkFeaturesStandardBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type NetworkSiblingSetProvisioningState string + +const ( + NetworkSiblingSetProvisioningStateCanceled NetworkSiblingSetProvisioningState = "Canceled" + NetworkSiblingSetProvisioningStateFailed NetworkSiblingSetProvisioningState = "Failed" + NetworkSiblingSetProvisioningStateSucceeded NetworkSiblingSetProvisioningState = "Succeeded" + NetworkSiblingSetProvisioningStateUpdating NetworkSiblingSetProvisioningState = "Updating" +) + +func PossibleValuesForNetworkSiblingSetProvisioningState() []string { + return []string{ + string(NetworkSiblingSetProvisioningStateCanceled), + string(NetworkSiblingSetProvisioningStateFailed), + string(NetworkSiblingSetProvisioningStateSucceeded), + string(NetworkSiblingSetProvisioningStateUpdating), + } +} + +func (s *NetworkSiblingSetProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkSiblingSetProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkSiblingSetProvisioningState(input string) (*NetworkSiblingSetProvisioningState, error) { + vals := map[string]NetworkSiblingSetProvisioningState{ + "canceled": NetworkSiblingSetProvisioningStateCanceled, + "failed": NetworkSiblingSetProvisioningStateFailed, + "succeeded": NetworkSiblingSetProvisioningStateSucceeded, + "updating": NetworkSiblingSetProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkSiblingSetProvisioningState(input) + return &out, nil +} + +type RegionStorageToNetworkProximity string + +const ( + RegionStorageToNetworkProximityAcrossTTwo RegionStorageToNetworkProximity = "AcrossT2" + RegionStorageToNetworkProximityDefault RegionStorageToNetworkProximity = "Default" + RegionStorageToNetworkProximityTOne RegionStorageToNetworkProximity = "T1" + RegionStorageToNetworkProximityTOneAndAcrossTTwo RegionStorageToNetworkProximity = "T1AndAcrossT2" + RegionStorageToNetworkProximityTOneAndTTwo RegionStorageToNetworkProximity = "T1AndT2" + RegionStorageToNetworkProximityTOneAndTTwoAndAcrossTTwo RegionStorageToNetworkProximity = "T1AndT2AndAcrossT2" + RegionStorageToNetworkProximityTTwo RegionStorageToNetworkProximity = "T2" + RegionStorageToNetworkProximityTTwoAndAcrossTTwo RegionStorageToNetworkProximity = "T2AndAcrossT2" +) + +func PossibleValuesForRegionStorageToNetworkProximity() []string { + return []string{ + string(RegionStorageToNetworkProximityAcrossTTwo), + string(RegionStorageToNetworkProximityDefault), + string(RegionStorageToNetworkProximityTOne), + string(RegionStorageToNetworkProximityTOneAndAcrossTTwo), + string(RegionStorageToNetworkProximityTOneAndTTwo), + string(RegionStorageToNetworkProximityTOneAndTTwoAndAcrossTTwo), + string(RegionStorageToNetworkProximityTTwo), + string(RegionStorageToNetworkProximityTTwoAndAcrossTTwo), + } +} + +func (s *RegionStorageToNetworkProximity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRegionStorageToNetworkProximity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRegionStorageToNetworkProximity(input string) (*RegionStorageToNetworkProximity, error) { + vals := map[string]RegionStorageToNetworkProximity{ + "acrosst2": RegionStorageToNetworkProximityAcrossTTwo, + "default": RegionStorageToNetworkProximityDefault, + "t1": RegionStorageToNetworkProximityTOne, + "t1andacrosst2": RegionStorageToNetworkProximityTOneAndAcrossTTwo, + "t1andt2": RegionStorageToNetworkProximityTOneAndTTwo, + "t1andt2andacrosst2": RegionStorageToNetworkProximityTOneAndTTwoAndAcrossTTwo, + "t2": RegionStorageToNetworkProximityTTwo, + "t2andacrosst2": RegionStorageToNetworkProximityTTwoAndAcrossTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RegionStorageToNetworkProximity(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/id_location.go b/resource-manager/netapp/2023-11-01/netappresource/id_location.go new file mode 100644 index 00000000000..b6b91bc802d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/id_location.go @@ -0,0 +1,121 @@ +package netappresource + +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.NetApp/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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationValue"), + } +} + +// 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/netapp/2023-11-01/netappresource/id_location_test.go b/resource-manager/netapp/2023-11-01/netappresource/id_location_test.go new file mode 100644 index 00000000000..39f050b2bde --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/id_location_test.go @@ -0,0 +1,237 @@ +package netappresource + +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", "locationValue") + + 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 != "locationValue" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") + } +} + +func TestFormatLocationID(t *testing.T) { + actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue" + 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNvAlUe", + Expected: &LocationId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "lOcAtIoNvAlUe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNvAlUe/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/netapp/2023-11-01/netappresource/id_quotalimit.go b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go new file mode 100644 index 00000000000..0088f16b365 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit.go @@ -0,0 +1,130 @@ +package netappresource + +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(&QuotaLimitId{}) +} + +var _ resourceids.ResourceId = &QuotaLimitId{} + +// QuotaLimitId is a struct representing the Resource ID for a Quota Limit +type QuotaLimitId struct { + SubscriptionId string + LocationName string + QuotaLimitName string +} + +// NewQuotaLimitID returns a new QuotaLimitId struct +func NewQuotaLimitID(subscriptionId string, locationName string, quotaLimitName string) QuotaLimitId { + return QuotaLimitId{ + SubscriptionId: subscriptionId, + LocationName: locationName, + QuotaLimitName: quotaLimitName, + } +} + +// ParseQuotaLimitID parses 'input' into a QuotaLimitId +func ParseQuotaLimitID(input string) (*QuotaLimitId, error) { + parser := resourceids.NewParserFromResourceIdType(&QuotaLimitId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := QuotaLimitId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseQuotaLimitIDInsensitively parses 'input' case-insensitively into a QuotaLimitId +// note: this method should only be used for API response data and not user input +func ParseQuotaLimitIDInsensitively(input string) (*QuotaLimitId, error) { + parser := resourceids.NewParserFromResourceIdType(&QuotaLimitId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := QuotaLimitId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *QuotaLimitId) 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.QuotaLimitName, ok = input.Parsed["quotaLimitName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "quotaLimitName", input) + } + + return nil +} + +// ValidateQuotaLimitID checks that 'input' can be parsed as a Quota Limit ID +func ValidateQuotaLimitID(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 := ParseQuotaLimitID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Quota Limit ID +func (id QuotaLimitId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.NetApp/locations/%s/quotaLimits/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.QuotaLimitName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Quota Limit ID +func (id QuotaLimitId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticLocations", "locations", "locations"), + resourceids.UserSpecifiedSegment("locationName", "locationValue"), + resourceids.StaticSegment("staticQuotaLimits", "quotaLimits", "quotaLimits"), + resourceids.UserSpecifiedSegment("quotaLimitName", "quotaLimitValue"), + } +} + +// String returns a human-readable description of this Quota Limit ID +func (id QuotaLimitId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Location Name: %q", id.LocationName), + fmt.Sprintf("Quota Limit Name: %q", id.QuotaLimitName), + } + return fmt.Sprintf("Quota Limit (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go new file mode 100644 index 00000000000..f2a725b4e96 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/id_quotalimit_test.go @@ -0,0 +1,282 @@ +package netappresource + +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 = &QuotaLimitId{} + +func TestNewQuotaLimitID(t *testing.T) { + id := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationValue", "quotaLimitValue") + + 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 != "locationValue" { + t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") + } + + if id.QuotaLimitName != "quotaLimitValue" { + t.Fatalf("Expected %q but got %q for Segment 'QuotaLimitName'", id.QuotaLimitName, "quotaLimitValue") + } +} + +func TestFormatQuotaLimitID(t *testing.T) { + actual := NewQuotaLimitID("12345678-1234-9876-4563-123456789012", "locationValue", "quotaLimitValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits/quotaLimitValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseQuotaLimitID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *QuotaLimitId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits/quotaLimitValue", + Expected: &QuotaLimitId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationValue", + QuotaLimitName: "quotaLimitValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits/quotaLimitValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseQuotaLimitID(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.QuotaLimitName != v.Expected.QuotaLimitName { + t.Fatalf("Expected %q but got %q for QuotaLimitName", v.Expected.QuotaLimitName, actual.QuotaLimitName) + } + + } +} + +func TestParseQuotaLimitIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *QuotaLimitId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNvAlUe/qUoTaLiMiTs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits/quotaLimitValue", + Expected: &QuotaLimitId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "locationValue", + QuotaLimitName: "quotaLimitValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.NetApp/locations/locationValue/quotaLimits/quotaLimitValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNvAlUe/qUoTaLiMiTs/qUoTaLiMiTvAlUe", + Expected: &QuotaLimitId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + LocationName: "lOcAtIoNvAlUe", + QuotaLimitName: "qUoTaLiMiTvAlUe", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtApP/lOcAtIoNs/lOcAtIoNvAlUe/qUoTaLiMiTs/qUoTaLiMiTvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseQuotaLimitIDInsensitively(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.QuotaLimitName != v.Expected.QuotaLimitName { + t.Fatalf("Expected %q but got %q for QuotaLimitName", v.Expected.QuotaLimitName, actual.QuotaLimitName) + } + + } +} + +func TestSegmentsForQuotaLimitId(t *testing.T) { + segments := QuotaLimitId{}.Segments() + if len(segments) == 0 { + t.Fatalf("QuotaLimitId 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/netapp/2023-11-01/netappresource/method_checkfilepathavailability.go b/resource-manager/netapp/2023-11-01/netappresource/method_checkfilepathavailability.go new file mode 100644 index 00000000000..2710dd52807 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_checkfilepathavailability.go @@ -0,0 +1,59 @@ +package netappresource + +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 CheckFilePathAvailabilityOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CheckAvailabilityResponse +} + +// CheckFilePathAvailability ... +func (c NetAppResourceClient) CheckFilePathAvailability(ctx context.Context, id LocationId, input FilePathAvailabilityRequest) (result CheckFilePathAvailabilityOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/checkFilePathAvailability", 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 CheckAvailabilityResponse + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_checknameavailability.go b/resource-manager/netapp/2023-11-01/netappresource/method_checknameavailability.go new file mode 100644 index 00000000000..3c7ac9c5704 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_checknameavailability.go @@ -0,0 +1,59 @@ +package netappresource + +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 CheckNameAvailabilityOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CheckAvailabilityResponse +} + +// CheckNameAvailability ... +func (c NetAppResourceClient) CheckNameAvailability(ctx context.Context, id LocationId, input ResourceNameAvailabilityRequest) (result CheckNameAvailabilityOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/checkNameAvailability", 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 CheckAvailabilityResponse + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_checkquotaavailability.go b/resource-manager/netapp/2023-11-01/netappresource/method_checkquotaavailability.go new file mode 100644 index 00000000000..68f31ded84e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_checkquotaavailability.go @@ -0,0 +1,59 @@ +package netappresource + +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 CheckQuotaAvailabilityOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *CheckAvailabilityResponse +} + +// CheckQuotaAvailability ... +func (c NetAppResourceClient) CheckQuotaAvailability(ctx context.Context, id LocationId, input QuotaAvailabilityRequest) (result CheckQuotaAvailabilityOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/checkQuotaAvailability", 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 CheckAvailabilityResponse + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_querynetworksiblingset.go b/resource-manager/netapp/2023-11-01/netappresource/method_querynetworksiblingset.go new file mode 100644 index 00000000000..9707443382a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_querynetworksiblingset.go @@ -0,0 +1,59 @@ +package netappresource + +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 QueryNetworkSiblingSetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *NetworkSiblingSet +} + +// QueryNetworkSiblingSet ... +func (c NetAppResourceClient) QueryNetworkSiblingSet(ctx context.Context, id LocationId, input QueryNetworkSiblingSetRequest) (result QueryNetworkSiblingSetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/queryNetworkSiblingSet", 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 NetworkSiblingSet + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_queryregioninfo.go b/resource-manager/netapp/2023-11-01/netappresource/method_queryregioninfo.go new file mode 100644 index 00000000000..ef1715019e4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_queryregioninfo.go @@ -0,0 +1,55 @@ +package netappresource + +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 QueryRegionInfoOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RegionInfo +} + +// QueryRegionInfo ... +func (c NetAppResourceClient) QueryRegionInfo(ctx context.Context, id LocationId) (result QueryRegionInfoOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/regionInfo", 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 RegionInfo + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_quotalimitsget.go b/resource-manager/netapp/2023-11-01/netappresource/method_quotalimitsget.go new file mode 100644 index 00000000000..721f649f0b2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_quotalimitsget.go @@ -0,0 +1,54 @@ +package netappresource + +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 QuotaLimitsGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SubscriptionQuotaItem +} + +// QuotaLimitsGet ... +func (c NetAppResourceClient) QuotaLimitsGet(ctx context.Context, id QuotaLimitId) (result QuotaLimitsGetOperationResponse, 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 SubscriptionQuotaItem + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_quotalimitslist.go b/resource-manager/netapp/2023-11-01/netappresource/method_quotalimitslist.go new file mode 100644 index 00000000000..eba38d4fa9e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_quotalimitslist.go @@ -0,0 +1,55 @@ +package netappresource + +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 QuotaLimitsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SubscriptionQuotaItemList +} + +// QuotaLimitsList ... +func (c NetAppResourceClient) QuotaLimitsList(ctx context.Context, id LocationId) (result QuotaLimitsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/quotaLimits", 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 SubscriptionQuotaItemList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_regioninfosget.go b/resource-manager/netapp/2023-11-01/netappresource/method_regioninfosget.go new file mode 100644 index 00000000000..61840d90ef2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_regioninfosget.go @@ -0,0 +1,55 @@ +package netappresource + +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 RegionInfosGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RegionInfoResource +} + +// RegionInfosGet ... +func (c NetAppResourceClient) RegionInfosGet(ctx context.Context, id LocationId) (result RegionInfosGetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/regionInfos/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 RegionInfoResource + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_regioninfoslist.go b/resource-manager/netapp/2023-11-01/netappresource/method_regioninfoslist.go new file mode 100644 index 00000000000..1c0de735e75 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_regioninfoslist.go @@ -0,0 +1,91 @@ +package netappresource + +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 RegionInfosListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]RegionInfoResource +} + +type RegionInfosListCompleteResult struct { + LatestHttpResponse *http.Response + Items []RegionInfoResource +} + +// RegionInfosList ... +func (c NetAppResourceClient) RegionInfosList(ctx context.Context, id LocationId) (result RegionInfosListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/regionInfos", 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 *[]RegionInfoResource `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// RegionInfosListComplete retrieves all the results into a single object +func (c NetAppResourceClient) RegionInfosListComplete(ctx context.Context, id LocationId) (RegionInfosListCompleteResult, error) { + return c.RegionInfosListCompleteMatchingPredicate(ctx, id, RegionInfoResourceOperationPredicate{}) +} + +// RegionInfosListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c NetAppResourceClient) RegionInfosListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate RegionInfoResourceOperationPredicate) (result RegionInfosListCompleteResult, err error) { + items := make([]RegionInfoResource, 0) + + resp, err := c.RegionInfosList(ctx, id) + if err != nil { + 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 = RegionInfosListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/method_updatenetworksiblingset.go b/resource-manager/netapp/2023-11-01/netappresource/method_updatenetworksiblingset.go new file mode 100644 index 00000000000..47e6dd6cba8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/method_updatenetworksiblingset.go @@ -0,0 +1,75 @@ +package netappresource + +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 UpdateNetworkSiblingSetOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *NetworkSiblingSet +} + +// UpdateNetworkSiblingSet ... +func (c NetAppResourceClient) UpdateNetworkSiblingSet(ctx context.Context, id LocationId, input UpdateNetworkSiblingSetRequest) (result UpdateNetworkSiblingSetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/updateNetworkSiblingSet", 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 +} + +// UpdateNetworkSiblingSetThenPoll performs UpdateNetworkSiblingSet then polls until it's completed +func (c NetAppResourceClient) UpdateNetworkSiblingSetThenPoll(ctx context.Context, id LocationId, input UpdateNetworkSiblingSetRequest) error { + result, err := c.UpdateNetworkSiblingSet(ctx, id, input) + if err != nil { + return fmt.Errorf("performing UpdateNetworkSiblingSet: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after UpdateNetworkSiblingSet: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_checkavailabilityresponse.go b/resource-manager/netapp/2023-11-01/netappresource/model_checkavailabilityresponse.go new file mode 100644 index 00000000000..6423d9de076 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_checkavailabilityresponse.go @@ -0,0 +1,10 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type CheckAvailabilityResponse struct { + IsAvailable *bool `json:"isAvailable,omitempty"` + Message *string `json:"message,omitempty"` + Reason *InAvailabilityReasonType `json:"reason,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_filepathavailabilityrequest.go b/resource-manager/netapp/2023-11-01/netappresource/model_filepathavailabilityrequest.go new file mode 100644 index 00000000000..6407d29060b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_filepathavailabilityrequest.go @@ -0,0 +1,9 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type FilePathAvailabilityRequest struct { + Name string `json:"name"` + SubnetId string `json:"subnetId"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_networksiblingset.go b/resource-manager/netapp/2023-11-01/netappresource/model_networksiblingset.go new file mode 100644 index 00000000000..6873f71c613 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_networksiblingset.go @@ -0,0 +1,13 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkSiblingSet struct { + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + NetworkSiblingSetStateId *string `json:"networkSiblingSetStateId,omitempty"` + NicInfoList *[]NicInfo `json:"nicInfoList,omitempty"` + ProvisioningState *NetworkSiblingSetProvisioningState `json:"provisioningState,omitempty"` + SubnetId *string `json:"subnetId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_nicinfo.go b/resource-manager/netapp/2023-11-01/netappresource/model_nicinfo.go new file mode 100644 index 00000000000..5ee50025a75 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_nicinfo.go @@ -0,0 +1,9 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NicInfo struct { + IPAddress *string `json:"ipAddress,omitempty"` + VolumeResourceIds *[]string `json:"volumeResourceIds,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_querynetworksiblingsetrequest.go b/resource-manager/netapp/2023-11-01/netappresource/model_querynetworksiblingsetrequest.go new file mode 100644 index 00000000000..35c102048c3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_querynetworksiblingsetrequest.go @@ -0,0 +1,9 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QueryNetworkSiblingSetRequest struct { + NetworkSiblingSetId string `json:"networkSiblingSetId"` + SubnetId string `json:"subnetId"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_quotaavailabilityrequest.go b/resource-manager/netapp/2023-11-01/netappresource/model_quotaavailabilityrequest.go new file mode 100644 index 00000000000..d8df9ac4cef --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_quotaavailabilityrequest.go @@ -0,0 +1,10 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type QuotaAvailabilityRequest struct { + Name string `json:"name"` + ResourceGroup string `json:"resourceGroup"` + Type CheckQuotaNameResourceTypes `json:"type"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_regioninfo.go b/resource-manager/netapp/2023-11-01/netappresource/model_regioninfo.go new file mode 100644 index 00000000000..63c92a72c98 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_regioninfo.go @@ -0,0 +1,9 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegionInfo struct { + AvailabilityZoneMappings *[]RegionInfoAvailabilityZoneMappingsInlined `json:"availabilityZoneMappings,omitempty"` + StorageToNetworkProximity *RegionStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_regioninfoavailabilityzonemappingsinlined.go b/resource-manager/netapp/2023-11-01/netappresource/model_regioninfoavailabilityzonemappingsinlined.go new file mode 100644 index 00000000000..36fce7489dc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_regioninfoavailabilityzonemappingsinlined.go @@ -0,0 +1,9 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegionInfoAvailabilityZoneMappingsInlined struct { + AvailabilityZone *string `json:"availabilityZone,omitempty"` + IsAvailable *bool `json:"isAvailable,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_regioninforesource.go b/resource-manager/netapp/2023-11-01/netappresource/model_regioninforesource.go new file mode 100644 index 00000000000..9e9a94461d9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_regioninforesource.go @@ -0,0 +1,16 @@ +package netappresource + +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 RegionInfoResource struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *RegionInfo `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_resourcenameavailabilityrequest.go b/resource-manager/netapp/2023-11-01/netappresource/model_resourcenameavailabilityrequest.go new file mode 100644 index 00000000000..0bfbaf4c0e9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_resourcenameavailabilityrequest.go @@ -0,0 +1,10 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceNameAvailabilityRequest struct { + Name string `json:"name"` + ResourceGroup string `json:"resourceGroup"` + Type CheckNameResourceTypes `json:"type"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitem.go b/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitem.go new file mode 100644 index 00000000000..88a5cbd39c1 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitem.go @@ -0,0 +1,16 @@ +package netappresource + +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 SubscriptionQuotaItem struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SubscriptionQuotaItemProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemlist.go b/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemlist.go new file mode 100644 index 00000000000..800319869a1 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemlist.go @@ -0,0 +1,8 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubscriptionQuotaItemList struct { + Value *[]SubscriptionQuotaItem `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemproperties.go b/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemproperties.go new file mode 100644 index 00000000000..01cdd538c05 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_subscriptionquotaitemproperties.go @@ -0,0 +1,9 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubscriptionQuotaItemProperties struct { + Current *int64 `json:"current,omitempty"` + Default *int64 `json:"default,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/model_updatenetworksiblingsetrequest.go b/resource-manager/netapp/2023-11-01/netappresource/model_updatenetworksiblingsetrequest.go new file mode 100644 index 00000000000..ea780814344 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/model_updatenetworksiblingsetrequest.go @@ -0,0 +1,11 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type UpdateNetworkSiblingSetRequest struct { + NetworkFeatures NetworkFeatures `json:"networkFeatures"` + NetworkSiblingSetId string `json:"networkSiblingSetId"` + NetworkSiblingSetStateId string `json:"networkSiblingSetStateId"` + SubnetId string `json:"subnetId"` +} diff --git a/resource-manager/netapp/2023-11-01/netappresource/predicates.go b/resource-manager/netapp/2023-11-01/netappresource/predicates.go new file mode 100644 index 00000000000..cbc494a4360 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/predicates.go @@ -0,0 +1,27 @@ +package netappresource + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RegionInfoResourceOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p RegionInfoResourceOperationPredicate) Matches(input RegionInfoResource) 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/netapp/2023-11-01/netappresource/version.go b/resource-manager/netapp/2023-11-01/netappresource/version.go new file mode 100644 index 00000000000..ea201ece959 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/netappresource/version.go @@ -0,0 +1,12 @@ +package netappresource + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/netappresource/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/poolchange/README.md b/resource-manager/netapp/2023-11-01/poolchange/README.md new file mode 100644 index 00000000000..8986eb96f00 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/poolchange` Documentation + +The `poolchange` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/poolchange" +``` + + +### Client Initialization + +```go +client := poolchange.NewPoolChangeClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PoolChangeClient.VolumesPoolChange` + +```go +ctx := context.TODO() +id := poolchange.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := poolchange.PoolChangeRequest{ + // ... +} + + +if err := client.VolumesPoolChangeThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/poolchange/client.go b/resource-manager/netapp/2023-11-01/poolchange/client.go new file mode 100644 index 00000000000..270c25028c2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/client.go @@ -0,0 +1,26 @@ +package poolchange + +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 PoolChangeClient struct { + Client *resourcemanager.Client +} + +func NewPoolChangeClientWithBaseURI(sdkApi sdkEnv.Api) (*PoolChangeClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "poolchange", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating PoolChangeClient: %+v", err) + } + + return &PoolChangeClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/poolchange/id_volume.go b/resource-manager/netapp/2023-11-01/poolchange/id_volume.go new file mode 100644 index 00000000000..0e74fdf5585 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/id_volume.go @@ -0,0 +1,148 @@ +package poolchange + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go b/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go new file mode 100644 index 00000000000..943fab54d32 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/id_volume_test.go @@ -0,0 +1,372 @@ +package poolchange + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/poolchange/method_volumespoolchange.go b/resource-manager/netapp/2023-11-01/poolchange/method_volumespoolchange.go new file mode 100644 index 00000000000..7a0ca0e6450 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/method_volumespoolchange.go @@ -0,0 +1,74 @@ +package poolchange + +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 VolumesPoolChangeOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesPoolChange ... +func (c PoolChangeClient) VolumesPoolChange(ctx context.Context, id VolumeId, input PoolChangeRequest) (result VolumesPoolChangeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/poolChange", 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 +} + +// VolumesPoolChangeThenPoll performs VolumesPoolChange then polls until it's completed +func (c PoolChangeClient) VolumesPoolChangeThenPoll(ctx context.Context, id VolumeId, input PoolChangeRequest) error { + result, err := c.VolumesPoolChange(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesPoolChange: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesPoolChange: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/poolchange/model_poolchangerequest.go b/resource-manager/netapp/2023-11-01/poolchange/model_poolchangerequest.go new file mode 100644 index 00000000000..19402a5b699 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/model_poolchangerequest.go @@ -0,0 +1,8 @@ +package poolchange + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PoolChangeRequest struct { + NewPoolResourceId string `json:"newPoolResourceId"` +} diff --git a/resource-manager/netapp/2023-11-01/poolchange/version.go b/resource-manager/netapp/2023-11-01/poolchange/version.go new file mode 100644 index 00000000000..36d5f212b14 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/poolchange/version.go @@ -0,0 +1,12 @@ +package poolchange + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/poolchange/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/resetcifspassword/client.go b/resource-manager/netapp/2023-11-01/resetcifspassword/client.go new file mode 100644 index 00000000000..2d17ccc3976 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/client.go @@ -0,0 +1,26 @@ +package resetcifspassword + +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 ResetCifsPasswordClient struct { + Client *resourcemanager.Client +} + +func NewResetCifsPasswordClientWithBaseURI(sdkApi sdkEnv.Api) (*ResetCifsPasswordClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "resetcifspassword", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating ResetCifsPasswordClient: %+v", err) + } + + return &ResetCifsPasswordClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go new file mode 100644 index 00000000000..b2cdcb5d95a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume.go @@ -0,0 +1,148 @@ +package resetcifspassword + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go new file mode 100644 index 00000000000..4d55720edb1 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/id_volume_test.go @@ -0,0 +1,372 @@ +package resetcifspassword + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/resetcifspassword/method_volumesresetcifspassword.go b/resource-manager/netapp/2023-11-01/resetcifspassword/method_volumesresetcifspassword.go new file mode 100644 index 00000000000..d8bdd81cd6f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/method_volumesresetcifspassword.go @@ -0,0 +1,69 @@ +package resetcifspassword + +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 VolumesResetCifsPasswordOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesResetCifsPassword ... +func (c ResetCifsPasswordClient) VolumesResetCifsPassword(ctx context.Context, id VolumeId) (result VolumesResetCifsPasswordOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resetCifsPassword", 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 +} + +// VolumesResetCifsPasswordThenPoll performs VolumesResetCifsPassword then polls until it's completed +func (c ResetCifsPasswordClient) VolumesResetCifsPasswordThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesResetCifsPassword(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesResetCifsPassword: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesResetCifsPassword: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/resetcifspassword/version.go b/resource-manager/netapp/2023-11-01/resetcifspassword/version.go new file mode 100644 index 00000000000..0d89a535915 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/resetcifspassword/version.go @@ -0,0 +1,12 @@ +package resetcifspassword + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/resetcifspassword/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/restore/README.md b/resource-manager/netapp/2023-11-01/restore/README.md new file mode 100644 index 00000000000..5ff5ed00bdf --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/restore` Documentation + +The `restore` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/restore" +``` + + +### Client Initialization + +```go +client := restore.NewRestoreClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RestoreClient.BackupsGetVolumeLatestRestoreStatus` + +```go +ctx := context.TODO() +id := restore.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +read, err := client.BackupsGetVolumeLatestRestoreStatus(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/netapp/2023-11-01/restore/client.go b/resource-manager/netapp/2023-11-01/restore/client.go new file mode 100644 index 00000000000..97fa355d7db --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/client.go @@ -0,0 +1,26 @@ +package restore + +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 RestoreClient struct { + Client *resourcemanager.Client +} + +func NewRestoreClientWithBaseURI(sdkApi sdkEnv.Api) (*RestoreClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "restore", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating RestoreClient: %+v", err) + } + + return &RestoreClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/restore/constants.go b/resource-manager/netapp/2023-11-01/restore/constants.go new file mode 100644 index 00000000000..c734520711f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/constants.go @@ -0,0 +1,101 @@ +package restore + +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 MirrorState string + +const ( + MirrorStateBroken MirrorState = "Broken" + MirrorStateMirrored MirrorState = "Mirrored" + MirrorStateUninitialized MirrorState = "Uninitialized" +) + +func PossibleValuesForMirrorState() []string { + return []string{ + string(MirrorStateBroken), + string(MirrorStateMirrored), + string(MirrorStateUninitialized), + } +} + +func (s *MirrorState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMirrorState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMirrorState(input string) (*MirrorState, error) { + vals := map[string]MirrorState{ + "broken": MirrorStateBroken, + "mirrored": MirrorStateMirrored, + "uninitialized": MirrorStateUninitialized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MirrorState(input) + return &out, nil +} + +type RelationshipStatus string + +const ( + RelationshipStatusFailed RelationshipStatus = "Failed" + RelationshipStatusIdle RelationshipStatus = "Idle" + RelationshipStatusTransferring RelationshipStatus = "Transferring" + RelationshipStatusUnknown RelationshipStatus = "Unknown" +) + +func PossibleValuesForRelationshipStatus() []string { + return []string{ + string(RelationshipStatusFailed), + string(RelationshipStatusIdle), + string(RelationshipStatusTransferring), + string(RelationshipStatusUnknown), + } +} + +func (s *RelationshipStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRelationshipStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRelationshipStatus(input string) (*RelationshipStatus, error) { + vals := map[string]RelationshipStatus{ + "failed": RelationshipStatusFailed, + "idle": RelationshipStatusIdle, + "transferring": RelationshipStatusTransferring, + "unknown": RelationshipStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RelationshipStatus(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/restore/id_volume.go b/resource-manager/netapp/2023-11-01/restore/id_volume.go new file mode 100644 index 00000000000..64d9eacc3ac --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/id_volume.go @@ -0,0 +1,148 @@ +package restore + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/restore/id_volume_test.go b/resource-manager/netapp/2023-11-01/restore/id_volume_test.go new file mode 100644 index 00000000000..7215e839ec9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/id_volume_test.go @@ -0,0 +1,372 @@ +package restore + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/restore/method_backupsgetvolumelatestrestorestatus.go b/resource-manager/netapp/2023-11-01/restore/method_backupsgetvolumelatestrestorestatus.go new file mode 100644 index 00000000000..f8d846b552b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/method_backupsgetvolumelatestrestorestatus.go @@ -0,0 +1,55 @@ +package restore + +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 BackupsGetVolumeLatestRestoreStatusOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *RestoreStatus +} + +// BackupsGetVolumeLatestRestoreStatus ... +func (c RestoreClient) BackupsGetVolumeLatestRestoreStatus(ctx context.Context, id VolumeId) (result BackupsGetVolumeLatestRestoreStatusOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/latestRestoreStatus/current", 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 RestoreStatus + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/restore/model_restorestatus.go b/resource-manager/netapp/2023-11-01/restore/model_restorestatus.go new file mode 100644 index 00000000000..546d31e9ce7 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/model_restorestatus.go @@ -0,0 +1,13 @@ +package restore + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RestoreStatus struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Healthy *bool `json:"healthy,omitempty"` + MirrorState *MirrorState `json:"mirrorState,omitempty"` + RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` + TotalTransferBytes *int64 `json:"totalTransferBytes,omitempty"` + UnhealthyReason *string `json:"unhealthyReason,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/restore/version.go b/resource-manager/netapp/2023-11-01/restore/version.go new file mode 100644 index 00000000000..1fec4b0bd31 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/restore/version.go @@ -0,0 +1,12 @@ +package restore + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/restore/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md b/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md new file mode 100644 index 00000000000..e5c48c02b7e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/README.md @@ -0,0 +1,102 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/snapshotpolicy` Documentation + +The `snapshotpolicy` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/snapshotpolicy" +``` + + +### Client Initialization + +```go +client := snapshotpolicy.NewSnapshotPolicyClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesCreate` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + +payload := snapshotpolicy.SnapshotPolicy{ + // ... +} + + +read, err := client.SnapshotPoliciesCreate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesDelete` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + +if err := client.SnapshotPoliciesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesGet` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + +read, err := client.SnapshotPoliciesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesList` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +read, err := client.SnapshotPoliciesList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SnapshotPolicyClient.SnapshotPoliciesUpdate` + +```go +ctx := context.TODO() +id := snapshotpolicy.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + +payload := snapshotpolicy.SnapshotPolicyPatch{ + // ... +} + + +if err := client.SnapshotPoliciesUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/client.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/client.go new file mode 100644 index 00000000000..eebb8c7b8da --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/client.go @@ -0,0 +1,26 @@ +package snapshotpolicy + +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 SnapshotPolicyClient struct { + Client *resourcemanager.Client +} + +func NewSnapshotPolicyClientWithBaseURI(sdkApi sdkEnv.Api) (*SnapshotPolicyClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "snapshotpolicy", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SnapshotPolicyClient: %+v", err) + } + + return &SnapshotPolicyClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go new file mode 100644 index 00000000000..51822e9aaf3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount.go @@ -0,0 +1,130 @@ +package snapshotpolicy + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go new file mode 100644 index 00000000000..bd28761531c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package snapshotpolicy + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go new file mode 100644 index 00000000000..c007ae89039 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy.go @@ -0,0 +1,139 @@ +package snapshotpolicy + +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(&SnapshotPolicyId{}) +} + +var _ resourceids.ResourceId = &SnapshotPolicyId{} + +// SnapshotPolicyId is a struct representing the Resource ID for a Snapshot Policy +type SnapshotPolicyId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + SnapshotPolicyName string +} + +// NewSnapshotPolicyID returns a new SnapshotPolicyId struct +func NewSnapshotPolicyID(subscriptionId string, resourceGroupName string, netAppAccountName string, snapshotPolicyName string) SnapshotPolicyId { + return SnapshotPolicyId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + SnapshotPolicyName: snapshotPolicyName, + } +} + +// ParseSnapshotPolicyID parses 'input' into a SnapshotPolicyId +func ParseSnapshotPolicyID(input string) (*SnapshotPolicyId, error) { + parser := resourceids.NewParserFromResourceIdType(&SnapshotPolicyId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SnapshotPolicyId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseSnapshotPolicyIDInsensitively parses 'input' case-insensitively into a SnapshotPolicyId +// note: this method should only be used for API response data and not user input +func ParseSnapshotPolicyIDInsensitively(input string) (*SnapshotPolicyId, error) { + parser := resourceids.NewParserFromResourceIdType(&SnapshotPolicyId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SnapshotPolicyId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *SnapshotPolicyId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.SnapshotPolicyName, ok = input.Parsed["snapshotPolicyName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "snapshotPolicyName", input) + } + + return nil +} + +// ValidateSnapshotPolicyID checks that 'input' can be parsed as a Snapshot Policy ID +func ValidateSnapshotPolicyID(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 := ParseSnapshotPolicyID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot Policy ID +func (id SnapshotPolicyId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/snapshotPolicies/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.SnapshotPolicyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Snapshot Policy ID +func (id SnapshotPolicyId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), + resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyValue"), + } +} + +// String returns a human-readable description of this Snapshot Policy ID +func (id SnapshotPolicyId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Snapshot Policy Name: %q", id.SnapshotPolicyName), + } + return fmt.Sprintf("Snapshot Policy (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go new file mode 100644 index 00000000000..7c6857f3745 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/id_snapshotpolicy_test.go @@ -0,0 +1,327 @@ +package snapshotpolicy + +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 = &SnapshotPolicyId{} + +func TestNewSnapshotPolicyID(t *testing.T) { + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.SnapshotPolicyName != "snapshotPolicyValue" { + t.Fatalf("Expected %q but got %q for Segment 'SnapshotPolicyName'", id.SnapshotPolicyName, "snapshotPolicyValue") + } +} + +func TestFormatSnapshotPolicyID(t *testing.T) { + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseSnapshotPolicyID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SnapshotPolicyId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue", + Expected: &SnapshotPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + SnapshotPolicyName: "snapshotPolicyValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSnapshotPolicyID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.SnapshotPolicyName != v.Expected.SnapshotPolicyName { + t.Fatalf("Expected %q but got %q for SnapshotPolicyName", v.Expected.SnapshotPolicyName, actual.SnapshotPolicyName) + } + + } +} + +func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SnapshotPolicyId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/sNaPsHoTpOlIcIeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue", + Expected: &SnapshotPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + SnapshotPolicyName: "snapshotPolicyValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYvAlUe", + Expected: &SnapshotPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + SnapshotPolicyName: "sNaPsHoTpOlIcYvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSnapshotPolicyIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.SnapshotPolicyName != v.Expected.SnapshotPolicyName { + t.Fatalf("Expected %q but got %q for SnapshotPolicyName", v.Expected.SnapshotPolicyName, actual.SnapshotPolicyName) + } + + } +} + +func TestSegmentsForSnapshotPolicyId(t *testing.T) { + segments := SnapshotPolicyId{}.Segments() + if len(segments) == 0 { + t.Fatalf("SnapshotPolicyId 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/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciescreate.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciescreate.go new file mode 100644 index 00000000000..f0aaa54617e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciescreate.go @@ -0,0 +1,59 @@ +package snapshotpolicy + +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 SnapshotPoliciesCreateOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SnapshotPolicy +} + +// SnapshotPoliciesCreate ... +func (c SnapshotPolicyClient) SnapshotPoliciesCreate(ctx context.Context, id SnapshotPolicyId, input SnapshotPolicy) (result SnapshotPoliciesCreateOperationResponse, 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 SnapshotPolicy + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesdelete.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesdelete.go new file mode 100644 index 00000000000..88822a15bf8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesdelete.go @@ -0,0 +1,71 @@ +package snapshotpolicy + +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 SnapshotPoliciesDeleteOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// SnapshotPoliciesDelete ... +func (c SnapshotPolicyClient) SnapshotPoliciesDelete(ctx context.Context, id SnapshotPolicyId) (result SnapshotPoliciesDeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 +} + +// SnapshotPoliciesDeleteThenPoll performs SnapshotPoliciesDelete then polls until it's completed +func (c SnapshotPolicyClient) SnapshotPoliciesDeleteThenPoll(ctx context.Context, id SnapshotPolicyId) error { + result, err := c.SnapshotPoliciesDelete(ctx, id) + if err != nil { + return fmt.Errorf("performing SnapshotPoliciesDelete: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after SnapshotPoliciesDelete: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesget.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesget.go new file mode 100644 index 00000000000..53aa8b06361 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesget.go @@ -0,0 +1,54 @@ +package snapshotpolicy + +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 SnapshotPoliciesGetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SnapshotPolicy +} + +// SnapshotPoliciesGet ... +func (c SnapshotPolicyClient) SnapshotPoliciesGet(ctx context.Context, id SnapshotPolicyId) (result SnapshotPoliciesGetOperationResponse, 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 SnapshotPolicy + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpolicieslist.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpolicieslist.go new file mode 100644 index 00000000000..50c611c5cb0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpolicieslist.go @@ -0,0 +1,55 @@ +package snapshotpolicy + +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 SnapshotPoliciesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SnapshotPoliciesList +} + +// SnapshotPoliciesList ... +func (c SnapshotPolicyClient) SnapshotPoliciesList(ctx context.Context, id NetAppAccountId) (result SnapshotPoliciesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/snapshotPolicies", 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 SnapshotPoliciesList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesupdate.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesupdate.go new file mode 100644 index 00000000000..c0cf93edf94 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/method_snapshotpoliciesupdate.go @@ -0,0 +1,75 @@ +package snapshotpolicy + +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 SnapshotPoliciesUpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *SnapshotPolicy +} + +// SnapshotPoliciesUpdate ... +func (c SnapshotPolicyClient) SnapshotPoliciesUpdate(ctx context.Context, id SnapshotPolicyId, input SnapshotPolicyPatch) (result SnapshotPoliciesUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// SnapshotPoliciesUpdateThenPoll performs SnapshotPoliciesUpdate then polls until it's completed +func (c SnapshotPolicyClient) SnapshotPoliciesUpdateThenPoll(ctx context.Context, id SnapshotPolicyId, input SnapshotPolicyPatch) error { + result, err := c.SnapshotPoliciesUpdate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing SnapshotPoliciesUpdate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after SnapshotPoliciesUpdate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_dailyschedule.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_dailyschedule.go new file mode 100644 index 00000000000..bdafb72e6e0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_dailyschedule.go @@ -0,0 +1,11 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DailySchedule struct { + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_hourlyschedule.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_hourlyschedule.go new file mode 100644 index 00000000000..a1e5d0fa028 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_hourlyschedule.go @@ -0,0 +1,10 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type HourlySchedule struct { + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_monthlyschedule.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_monthlyschedule.go new file mode 100644 index 00000000000..02cbcad6a59 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_monthlyschedule.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MonthlySchedule struct { + DaysOfMonth *string `json:"daysOfMonth,omitempty"` + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicieslist.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicieslist.go new file mode 100644 index 00000000000..910e2519adb --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicieslist.go @@ -0,0 +1,8 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPoliciesList struct { + Value *[]SnapshotPolicy `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicy.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicy.go new file mode 100644 index 00000000000..310cfaaf1bb --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicy.go @@ -0,0 +1,19 @@ +package snapshotpolicy + +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 SnapshotPolicy struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties SnapshotPolicyProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicypatch.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicypatch.go new file mode 100644 index 00000000000..76df9be172b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicypatch.go @@ -0,0 +1,13 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyPatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SnapshotPolicyProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicyproperties.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicyproperties.go new file mode 100644 index 00000000000..fb4fb0fcb05 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_snapshotpolicyproperties.go @@ -0,0 +1,13 @@ +package snapshotpolicy + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyProperties struct { + DailySchedule *DailySchedule `json:"dailySchedule,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + HourlySchedule *HourlySchedule `json:"hourlySchedule,omitempty"` + MonthlySchedule *MonthlySchedule `json:"monthlySchedule,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + WeeklySchedule *WeeklySchedule `json:"weeklySchedule,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/model_weeklyschedule.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_weeklyschedule.go new file mode 100644 index 00000000000..128ece7ef5e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/model_weeklyschedule.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +// 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 { + Day *string `json:"day,omitempty"` + Hour *int64 `json:"hour,omitempty"` + Minute *int64 `json:"minute,omitempty"` + SnapshotsToKeep *int64 `json:"snapshotsToKeep,omitempty"` + UsedBytes *int64 `json:"usedBytes,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicy/version.go b/resource-manager/netapp/2023-11-01/snapshotpolicy/version.go new file mode 100644 index 00000000000..4b716695a28 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicy/version.go @@ -0,0 +1,12 @@ +package snapshotpolicy + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicy/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md new file mode 100644 index 00000000000..d1f602c1bc3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes` Documentation + +The `snapshotpolicylistvolumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/snapshotpolicylistvolumes" +``` + + +### Client Initialization + +```go +client := snapshotpolicylistvolumes.NewSnapshotPolicyListVolumesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotPolicyListVolumesClient.SnapshotPoliciesListVolumes` + +```go +ctx := context.TODO() +id := snapshotpolicylistvolumes.NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + +read, err := client.SnapshotPoliciesListVolumes(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/netapp/2023-11-01/snapshotpolicylistvolumes/client.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/client.go new file mode 100644 index 00000000000..047d79a12c3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/client.go @@ -0,0 +1,26 @@ +package snapshotpolicylistvolumes + +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 SnapshotPolicyListVolumesClient struct { + Client *resourcemanager.Client +} + +func NewSnapshotPolicyListVolumesClientWithBaseURI(sdkApi sdkEnv.Api) (*SnapshotPolicyListVolumesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "snapshotpolicylistvolumes", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SnapshotPolicyListVolumesClient: %+v", err) + } + + return &SnapshotPolicyListVolumesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/constants.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/constants.go new file mode 100644 index 00000000000..c3a395d5f82 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/constants.go @@ -0,0 +1,608 @@ +package snapshotpolicylistvolumes + +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 AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func (s *AvsDataStore) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAvsDataStore(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func (s *ChownMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseChownMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type CoolAccessRetrievalPolicy string + +const ( + CoolAccessRetrievalPolicyDefault CoolAccessRetrievalPolicy = "Default" + CoolAccessRetrievalPolicyNever CoolAccessRetrievalPolicy = "Never" + CoolAccessRetrievalPolicyOnRead CoolAccessRetrievalPolicy = "OnRead" +) + +func PossibleValuesForCoolAccessRetrievalPolicy() []string { + return []string{ + string(CoolAccessRetrievalPolicyDefault), + string(CoolAccessRetrievalPolicyNever), + string(CoolAccessRetrievalPolicyOnRead), + } +} + +func (s *CoolAccessRetrievalPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCoolAccessRetrievalPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCoolAccessRetrievalPolicy(input string) (*CoolAccessRetrievalPolicy, error) { + vals := map[string]CoolAccessRetrievalPolicy{ + "default": CoolAccessRetrievalPolicyDefault, + "never": CoolAccessRetrievalPolicyNever, + "onread": CoolAccessRetrievalPolicyOnRead, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CoolAccessRetrievalPolicy(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func (s *EnableSubvolumes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnableSubvolumes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointKeyVault EncryptionKeySource = "Microsoft.KeyVault" + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointKeyVault), + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func (s *EncryptionKeySource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEncryptionKeySource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.keyvault": EncryptionKeySourceMicrosoftPointKeyVault, + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func (s *EndpointType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEndpointType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type FileAccessLogs string + +const ( + FileAccessLogsDisabled FileAccessLogs = "Disabled" + FileAccessLogsEnabled FileAccessLogs = "Enabled" +) + +func PossibleValuesForFileAccessLogs() []string { + return []string{ + string(FileAccessLogsDisabled), + string(FileAccessLogsEnabled), + } +} + +func (s *FileAccessLogs) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileAccessLogs(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileAccessLogs(input string) (*FileAccessLogs, error) { + vals := map[string]FileAccessLogs{ + "disabled": FileAccessLogsDisabled, + "enabled": FileAccessLogsEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileAccessLogs(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesBasicStandard NetworkFeatures = "Basic_Standard" + NetworkFeaturesStandard NetworkFeatures = "Standard" + NetworkFeaturesStandardBasic NetworkFeatures = "Standard_Basic" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesBasicStandard), + string(NetworkFeaturesStandard), + string(NetworkFeaturesStandardBasic), + } +} + +func (s *NetworkFeatures) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkFeatures(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "basic_standard": NetworkFeaturesBasicStandard, + "standard": NetworkFeaturesStandard, + "standard_basic": NetworkFeaturesStandardBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func (s *ReplicationSchedule) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicationSchedule(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func (s *SecurityStyle) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityStyle(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func (s *ServiceLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type SmbAccessBasedEnumeration string + +const ( + SmbAccessBasedEnumerationDisabled SmbAccessBasedEnumeration = "Disabled" + SmbAccessBasedEnumerationEnabled SmbAccessBasedEnumeration = "Enabled" +) + +func PossibleValuesForSmbAccessBasedEnumeration() []string { + return []string{ + string(SmbAccessBasedEnumerationDisabled), + string(SmbAccessBasedEnumerationEnabled), + } +} + +func (s *SmbAccessBasedEnumeration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSmbAccessBasedEnumeration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSmbAccessBasedEnumeration(input string) (*SmbAccessBasedEnumeration, error) { + vals := map[string]SmbAccessBasedEnumeration{ + "disabled": SmbAccessBasedEnumerationDisabled, + "enabled": SmbAccessBasedEnumerationEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbAccessBasedEnumeration(input) + return &out, nil +} + +type SmbNonBrowsable string + +const ( + SmbNonBrowsableDisabled SmbNonBrowsable = "Disabled" + SmbNonBrowsableEnabled SmbNonBrowsable = "Enabled" +) + +func PossibleValuesForSmbNonBrowsable() []string { + return []string{ + string(SmbNonBrowsableDisabled), + string(SmbNonBrowsableEnabled), + } +} + +func (s *SmbNonBrowsable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSmbNonBrowsable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSmbNonBrowsable(input string) (*SmbNonBrowsable, error) { + vals := map[string]SmbNonBrowsable{ + "disabled": SmbNonBrowsableDisabled, + "enabled": SmbNonBrowsableEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbNonBrowsable(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityAcrossTTwo VolumeStorageToNetworkProximity = "AcrossT2" + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityAcrossTTwo), + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func (s *VolumeStorageToNetworkProximity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVolumeStorageToNetworkProximity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "acrosst2": VolumeStorageToNetworkProximityAcrossTTwo, + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go new file mode 100644 index 00000000000..1b30e761faf --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy.go @@ -0,0 +1,139 @@ +package snapshotpolicylistvolumes + +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(&SnapshotPolicyId{}) +} + +var _ resourceids.ResourceId = &SnapshotPolicyId{} + +// SnapshotPolicyId is a struct representing the Resource ID for a Snapshot Policy +type SnapshotPolicyId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + SnapshotPolicyName string +} + +// NewSnapshotPolicyID returns a new SnapshotPolicyId struct +func NewSnapshotPolicyID(subscriptionId string, resourceGroupName string, netAppAccountName string, snapshotPolicyName string) SnapshotPolicyId { + return SnapshotPolicyId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + SnapshotPolicyName: snapshotPolicyName, + } +} + +// ParseSnapshotPolicyID parses 'input' into a SnapshotPolicyId +func ParseSnapshotPolicyID(input string) (*SnapshotPolicyId, error) { + parser := resourceids.NewParserFromResourceIdType(&SnapshotPolicyId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SnapshotPolicyId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseSnapshotPolicyIDInsensitively parses 'input' case-insensitively into a SnapshotPolicyId +// note: this method should only be used for API response data and not user input +func ParseSnapshotPolicyIDInsensitively(input string) (*SnapshotPolicyId, error) { + parser := resourceids.NewParserFromResourceIdType(&SnapshotPolicyId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SnapshotPolicyId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *SnapshotPolicyId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.SnapshotPolicyName, ok = input.Parsed["snapshotPolicyName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "snapshotPolicyName", input) + } + + return nil +} + +// ValidateSnapshotPolicyID checks that 'input' can be parsed as a Snapshot Policy ID +func ValidateSnapshotPolicyID(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 := ParseSnapshotPolicyID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot Policy ID +func (id SnapshotPolicyId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/snapshotPolicies/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.SnapshotPolicyName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Snapshot Policy ID +func (id SnapshotPolicyId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticSnapshotPolicies", "snapshotPolicies", "snapshotPolicies"), + resourceids.UserSpecifiedSegment("snapshotPolicyName", "snapshotPolicyValue"), + } +} + +// String returns a human-readable description of this Snapshot Policy ID +func (id SnapshotPolicyId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Snapshot Policy Name: %q", id.SnapshotPolicyName), + } + return fmt.Sprintf("Snapshot Policy (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go new file mode 100644 index 00000000000..fc38eab1d7e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/id_snapshotpolicy_test.go @@ -0,0 +1,327 @@ +package snapshotpolicylistvolumes + +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 = &SnapshotPolicyId{} + +func TestNewSnapshotPolicyID(t *testing.T) { + id := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.SnapshotPolicyName != "snapshotPolicyValue" { + t.Fatalf("Expected %q but got %q for Segment 'SnapshotPolicyName'", id.SnapshotPolicyName, "snapshotPolicyValue") + } +} + +func TestFormatSnapshotPolicyID(t *testing.T) { + actual := NewSnapshotPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "snapshotPolicyValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseSnapshotPolicyID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SnapshotPolicyId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue", + Expected: &SnapshotPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + SnapshotPolicyName: "snapshotPolicyValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSnapshotPolicyID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.SnapshotPolicyName != v.Expected.SnapshotPolicyName { + t.Fatalf("Expected %q but got %q for SnapshotPolicyName", v.Expected.SnapshotPolicyName, actual.SnapshotPolicyName) + } + + } +} + +func TestParseSnapshotPolicyIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SnapshotPolicyId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/sNaPsHoTpOlIcIeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue", + Expected: &SnapshotPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + SnapshotPolicyName: "snapshotPolicyValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/snapshotPolicies/snapshotPolicyValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYvAlUe", + Expected: &SnapshotPolicyId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + SnapshotPolicyName: "sNaPsHoTpOlIcYvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/sNaPsHoTpOlIcIeS/sNaPsHoTpOlIcYvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSnapshotPolicyIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.SnapshotPolicyName != v.Expected.SnapshotPolicyName { + t.Fatalf("Expected %q but got %q for SnapshotPolicyName", v.Expected.SnapshotPolicyName, actual.SnapshotPolicyName) + } + + } +} + +func TestSegmentsForSnapshotPolicyId(t *testing.T) { + segments := SnapshotPolicyId{}.Segments() + if len(segments) == 0 { + t.Fatalf("SnapshotPolicyId 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/netapp/2023-11-01/snapshotpolicylistvolumes/method_snapshotpolicieslistvolumes.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/method_snapshotpolicieslistvolumes.go new file mode 100644 index 00000000000..59512dd2794 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/method_snapshotpolicieslistvolumes.go @@ -0,0 +1,55 @@ +package snapshotpolicylistvolumes + +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 SnapshotPoliciesListVolumesOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *SnapshotPolicyVolumeList +} + +// SnapshotPoliciesListVolumes ... +func (c SnapshotPolicyListVolumesClient) SnapshotPoliciesListVolumes(ctx context.Context, id SnapshotPolicyId) (result SnapshotPoliciesListVolumesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/volumes", 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 SnapshotPolicyVolumeList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_exportpolicyrule.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_exportpolicyrule.go new file mode 100644 index 00000000000..dd6bb7a20fc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_mounttargetproperties.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_mounttargetproperties.go new file mode 100644 index 00000000000..49f9f6f131a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IPAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_placementkeyvaluepairs.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_placementkeyvaluepairs.go new file mode 100644 index 00000000000..0d5756a7089 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_replicationobject.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_replicationobject.go new file mode 100644 index 00000000000..97bf50ea504 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_replicationobject.go @@ -0,0 +1,12 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_snapshotpolicyvolumelist.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_snapshotpolicyvolumelist.go new file mode 100644 index 00000000000..2d14e9596fe --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_snapshotpolicyvolumelist.go @@ -0,0 +1,8 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SnapshotPolicyVolumeList struct { + Value *[]Volume `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volume.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volume.go new file mode 100644 index 00000000000..36417f52891 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volume.go @@ -0,0 +1,21 @@ +package snapshotpolicylistvolumes + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" + "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 Volume struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumebackupproperties.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumebackupproperties.go new file mode 100644 index 00000000000..be2a40ea08d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumebackupproperties.go @@ -0,0 +1,10 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + BackupVaultId *string `json:"backupVaultId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumeproperties.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumeproperties.go new file mode 100644 index 00000000000..2adf28772bf --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumeproperties.go @@ -0,0 +1,61 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + ActualThroughputMibps *float64 `json:"actualThroughputMibps,omitempty"` + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolAccessRetrievalPolicy *CoolAccessRetrievalPolicy `json:"coolAccessRetrievalPolicy,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DataStoreResourceId *[]string `json:"dataStoreResourceId,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + DeleteBaseSnapshot *bool `json:"deleteBaseSnapshot,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileAccessLogs *FileAccessLogs `json:"fileAccessLogs,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsLargeVolume *bool `json:"isLargeVolume,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + KeyVaultPrivateEndpointResourceId *string `json:"keyVaultPrivateEndpointResourceId,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + OriginatingResourceId *string `json:"originatingResourceId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisionedAvailabilityZone *string `json:"provisionedAvailabilityZone,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbAccessBasedEnumeration *SmbAccessBasedEnumeration `json:"smbAccessBasedEnumeration,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SmbNonBrowsable *SmbNonBrowsable `json:"smbNonBrowsable,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesdataprotection.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesdataprotection.go new file mode 100644 index 00000000000..bf5ff10761d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesdataprotection.go @@ -0,0 +1,11 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` + VolumeRelocation *VolumeRelocationProperties `json:"volumeRelocation,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesexportpolicy.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesexportpolicy.go new file mode 100644 index 00000000000..1ad178d6e25 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumerelocationproperties.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumerelocationproperties.go new file mode 100644 index 00000000000..26ffc8f0697 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumerelocationproperties.go @@ -0,0 +1,9 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeRelocationProperties struct { + ReadyToBeFinalized *bool `json:"readyToBeFinalized,omitempty"` + RelocationRequested *bool `json:"relocationRequested,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumesnapshotproperties.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumesnapshotproperties.go new file mode 100644 index 00000000000..e4915375144 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package snapshotpolicylistvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/version.go b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/version.go new file mode 100644 index 00000000000..decd9b4dc87 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshotpolicylistvolumes/version.go @@ -0,0 +1,12 @@ +package snapshotpolicylistvolumes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshotpolicylistvolumes/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/README.md b/resource-manager/netapp/2023-11-01/snapshots/README.md new file mode 100644 index 00000000000..4a8604cc08c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/snapshots` Documentation + +The `snapshots` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/snapshots" +``` + + +### Client Initialization + +```go +client := snapshots.NewSnapshotsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SnapshotsClient.Create` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue") + +payload := snapshots.Snapshot{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Delete` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Get` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue") + +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 := snapshots.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +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: `SnapshotsClient.RestoreFiles` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue") + +payload := snapshots.SnapshotRestoreFiles{ + // ... +} + + +if err := client.RestoreFilesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SnapshotsClient.Update` + +```go +ctx := context.TODO() +id := snapshots.NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue") +var payload interface{} + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/containerservice/2022-09-02-preview/snapshots/client.go b/resource-manager/netapp/2023-11-01/snapshots/client.go similarity index 100% rename from resource-manager/containerservice/2022-09-02-preview/snapshots/client.go rename to resource-manager/netapp/2023-11-01/snapshots/client.go diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go new file mode 100644 index 00000000000..1712cf99186 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot.go @@ -0,0 +1,157 @@ +package snapshots + +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(&SnapshotId{}) +} + +var _ resourceids.ResourceId = &SnapshotId{} + +// SnapshotId is a struct representing the Resource ID for a Snapshot +type SnapshotId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string + SnapshotName string +} + +// NewSnapshotID returns a new SnapshotId struct +func NewSnapshotID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string, snapshotName string) SnapshotId { + return SnapshotId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + SnapshotName: snapshotName, + } +} + +// 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 := SnapshotId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseSnapshotIDInsensitively parses 'input' case-insensitively into a SnapshotId +// note: this method should only be used for API response data and not user input +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 := SnapshotId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *SnapshotId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + if id.SnapshotName, ok = input.Parsed["snapshotName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "snapshotName", input) + } + + return nil +} + +// 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 := ParseSnapshotID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Snapshot ID +func (id SnapshotId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/snapshots/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName, id.SnapshotName) +} + +// 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + resourceids.StaticSegment("staticSnapshots", "snapshots", "snapshots"), + resourceids.UserSpecifiedSegment("snapshotName", "snapshotValue"), + } +} + +// 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("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + fmt.Sprintf("Snapshot Name: %q", id.SnapshotName), + } + return fmt.Sprintf("Snapshot (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go new file mode 100644 index 00000000000..a5a11684e77 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/id_snapshot_test.go @@ -0,0 +1,417 @@ +package snapshots + +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 = &SnapshotId{} + +func TestNewSnapshotID(t *testing.T) { + id := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } + + if id.SnapshotName != "snapshotValue" { + t.Fatalf("Expected %q but got %q for Segment 'SnapshotName'", id.SnapshotName, "snapshotValue") + } +} + +func TestFormatSnapshotID(t *testing.T) { + actual := NewSnapshotID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "snapshotValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots/snapshotValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseSnapshotID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SnapshotId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots/snapshotValue", + Expected: &SnapshotId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + SnapshotName: "snapshotValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots/snapshotValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSnapshotID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + if actual.SnapshotName != v.Expected.SnapshotName { + t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) + } + + } +} + +func TestParseSnapshotIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SnapshotId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/sNaPsHoTs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots/snapshotValue", + Expected: &SnapshotId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + SnapshotName: "snapshotValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/snapshots/snapshotValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/sNaPsHoTs/sNaPsHoTvAlUe", + Expected: &SnapshotId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + SnapshotName: "sNaPsHoTvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/sNaPsHoTs/sNaPsHoTvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSnapshotIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + if actual.SnapshotName != v.Expected.SnapshotName { + t.Fatalf("Expected %q but got %q for SnapshotName", v.Expected.SnapshotName, actual.SnapshotName) + } + + } +} + +func TestSegmentsForSnapshotId(t *testing.T) { + segments := SnapshotId{}.Segments() + if len(segments) == 0 { + t.Fatalf("SnapshotId 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/netapp/2023-11-01/snapshots/id_volume.go b/resource-manager/netapp/2023-11-01/snapshots/id_volume.go new file mode 100644 index 00000000000..1d8f9e61805 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/id_volume.go @@ -0,0 +1,148 @@ +package snapshots + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go b/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go new file mode 100644 index 00000000000..a1879c11310 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/id_volume_test.go @@ -0,0 +1,372 @@ +package snapshots + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/snapshots/method_create.go b/resource-manager/netapp/2023-11-01/snapshots/method_create.go new file mode 100644 index 00000000000..6d6b9a4fbe2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/method_create.go @@ -0,0 +1,75 @@ +package snapshots + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Snapshot +} + +// Create ... +func (c SnapshotsClient) Create(ctx context.Context, id SnapshotId, input Snapshot) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusCreated, + }, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c SnapshotsClient) CreateThenPoll(ctx context.Context, id SnapshotId, input Snapshot) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/method_delete.go b/resource-manager/netapp/2023-11-01/snapshots/method_delete.go new file mode 100644 index 00000000000..ef16480f860 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/method_delete.go @@ -0,0 +1,71 @@ +package snapshots + +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 SnapshotsClient) Delete(ctx context.Context, id SnapshotId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 SnapshotsClient) DeleteThenPoll(ctx context.Context, id SnapshotId) 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/2022-09-02-preview/snapshots/method_get.go b/resource-manager/netapp/2023-11-01/snapshots/method_get.go similarity index 100% rename from resource-manager/containerservice/2022-09-02-preview/snapshots/method_get.go rename to resource-manager/netapp/2023-11-01/snapshots/method_get.go diff --git a/resource-manager/netapp/2023-11-01/snapshots/method_list.go b/resource-manager/netapp/2023-11-01/snapshots/method_list.go new file mode 100644 index 00000000000..d60b22e27a9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/method_list.go @@ -0,0 +1,55 @@ +package snapshots + +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 *SnapshotsList +} + +// List ... +func (c SnapshotsClient) List(ctx context.Context, id VolumeId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/snapshots", 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 SnapshotsList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/method_restorefiles.go b/resource-manager/netapp/2023-11-01/snapshots/method_restorefiles.go new file mode 100644 index 00000000000..685be44a5ff --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/method_restorefiles.go @@ -0,0 +1,74 @@ +package snapshots + +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 RestoreFilesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// RestoreFiles ... +func (c SnapshotsClient) RestoreFiles(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) (result RestoreFilesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/restoreFiles", 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 +} + +// RestoreFilesThenPoll performs RestoreFiles then polls until it's completed +func (c SnapshotsClient) RestoreFilesThenPoll(ctx context.Context, id SnapshotId, input SnapshotRestoreFiles) error { + result, err := c.RestoreFiles(ctx, id, input) + if err != nil { + return fmt.Errorf("performing RestoreFiles: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after RestoreFiles: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/method_update.go b/resource-manager/netapp/2023-11-01/snapshots/method_update.go new file mode 100644 index 00000000000..1e85e294ee5 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/method_update.go @@ -0,0 +1,75 @@ +package snapshots + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Snapshot +} + +// Update ... +func (c SnapshotsClient) Update(ctx context.Context, id SnapshotId, input interface{}) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c SnapshotsClient) UpdateThenPoll(ctx context.Context, id SnapshotId, input interface{}) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/model_snapshot.go b/resource-manager/netapp/2023-11-01/snapshots/model_snapshot.go new file mode 100644 index 00000000000..fe53e779a4c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/model_snapshot.go @@ -0,0 +1,17 @@ +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"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/model_snapshotproperties.go b/resource-manager/netapp/2023-11-01/snapshots/model_snapshotproperties.go new file mode 100644 index 00000000000..fe60537eaaa --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/model_snapshotproperties.go @@ -0,0 +1,28 @@ +package snapshots + +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 SnapshotProperties struct { + Created *string `json:"created,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` +} + +func (o *SnapshotProperties) GetCreatedAsTime() (*time.Time, error) { + if o.Created == nil { + return nil, nil + } + return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") +} + +func (o *SnapshotProperties) SetCreatedAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.Created = &formatted +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/model_snapshotrestorefiles.go b/resource-manager/netapp/2023-11-01/snapshots/model_snapshotrestorefiles.go new file mode 100644 index 00000000000..de80d971dcf --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/model_snapshotrestorefiles.go @@ -0,0 +1,9 @@ +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 SnapshotRestoreFiles struct { + DestinationPath *string `json:"destinationPath,omitempty"` + FilePaths []string `json:"filePaths"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/model_snapshotslist.go b/resource-manager/netapp/2023-11-01/snapshots/model_snapshotslist.go new file mode 100644 index 00000000000..bf283b0d2ac --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/model_snapshotslist.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 SnapshotsList struct { + Value *[]Snapshot `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/snapshots/version.go b/resource-manager/netapp/2023-11-01/snapshots/version.go new file mode 100644 index 00000000000..dba1cc34236 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/snapshots/version.go @@ -0,0 +1,12 @@ +package snapshots + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/snapshots/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/README.md b/resource-manager/netapp/2023-11-01/subvolumes/README.md new file mode 100644 index 00000000000..b2a47aa2cde --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/subvolumes` Documentation + +The `subvolumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/subvolumes" +``` + + +### Client Initialization + +```go +client := subvolumes.NewSubVolumesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SubVolumesClient.Create` + +```go +ctx := context.TODO() +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue") + +payload := subvolumes.SubvolumeInfo{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SubVolumesClient.Delete` + +```go +ctx := context.TODO() +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SubVolumesClient.Get` + +```go +ctx := context.TODO() +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue") + +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: `SubVolumesClient.GetMetadata` + +```go +ctx := context.TODO() +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue") + +if err := client.GetMetadataThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SubVolumesClient.ListByVolume` + +```go +ctx := context.TODO() +id := subvolumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +// alternatively `client.ListByVolume(ctx, id)` can be used to do batched pagination +items, err := client.ListByVolumeComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `SubVolumesClient.Update` + +```go +ctx := context.TODO() +id := subvolumes.NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue") + +payload := subvolumes.SubvolumePatchRequest{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/subvolumes/client.go b/resource-manager/netapp/2023-11-01/subvolumes/client.go new file mode 100644 index 00000000000..b675258d906 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/client.go @@ -0,0 +1,26 @@ +package subvolumes + +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 SubVolumesClient struct { + Client *resourcemanager.Client +} + +func NewSubVolumesClientWithBaseURI(sdkApi sdkEnv.Api) (*SubVolumesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "subvolumes", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating SubVolumesClient: %+v", err) + } + + return &SubVolumesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go new file mode 100644 index 00000000000..5c35777037a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume.go @@ -0,0 +1,157 @@ +package subvolumes + +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(&SubVolumeId{}) +} + +var _ resourceids.ResourceId = &SubVolumeId{} + +// SubVolumeId is a struct representing the Resource ID for a Sub Volume +type SubVolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string + SubVolumeName string +} + +// NewSubVolumeID returns a new SubVolumeId struct +func NewSubVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string, subVolumeName string) SubVolumeId { + return SubVolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + SubVolumeName: subVolumeName, + } +} + +// ParseSubVolumeID parses 'input' into a SubVolumeId +func ParseSubVolumeID(input string) (*SubVolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&SubVolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SubVolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseSubVolumeIDInsensitively parses 'input' case-insensitively into a SubVolumeId +// note: this method should only be used for API response data and not user input +func ParseSubVolumeIDInsensitively(input string) (*SubVolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&SubVolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := SubVolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *SubVolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + if id.SubVolumeName, ok = input.Parsed["subVolumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subVolumeName", input) + } + + return nil +} + +// ValidateSubVolumeID checks that 'input' can be parsed as a Sub Volume ID +func ValidateSubVolumeID(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 := ParseSubVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Sub Volume ID +func (id SubVolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/subVolumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName, id.SubVolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Sub Volume ID +func (id SubVolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + resourceids.StaticSegment("staticSubVolumes", "subVolumes", "subVolumes"), + resourceids.UserSpecifiedSegment("subVolumeName", "subVolumeValue"), + } +} + +// String returns a human-readable description of this Sub Volume ID +func (id SubVolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + fmt.Sprintf("Sub Volume Name: %q", id.SubVolumeName), + } + return fmt.Sprintf("Sub Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go new file mode 100644 index 00000000000..202be728575 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_subvolume_test.go @@ -0,0 +1,417 @@ +package subvolumes + +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 = &SubVolumeId{} + +func TestNewSubVolumeID(t *testing.T) { + id := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } + + if id.SubVolumeName != "subVolumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'SubVolumeName'", id.SubVolumeName, "subVolumeValue") + } +} + +func TestFormatSubVolumeID(t *testing.T) { + actual := NewSubVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "subVolumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes/subVolumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseSubVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SubVolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes/subVolumeValue", + Expected: &SubVolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + SubVolumeName: "subVolumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes/subVolumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSubVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + if actual.SubVolumeName != v.Expected.SubVolumeName { + t.Fatalf("Expected %q but got %q for SubVolumeName", v.Expected.SubVolumeName, actual.SubVolumeName) + } + + } +} + +func TestParseSubVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *SubVolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/sUbVoLuMeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes/subVolumeValue", + Expected: &SubVolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + SubVolumeName: "subVolumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/subVolumes/subVolumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/sUbVoLuMeS/sUbVoLuMeVaLuE", + Expected: &SubVolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + SubVolumeName: "sUbVoLuMeVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/sUbVoLuMeS/sUbVoLuMeVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseSubVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + if actual.SubVolumeName != v.Expected.SubVolumeName { + t.Fatalf("Expected %q but got %q for SubVolumeName", v.Expected.SubVolumeName, actual.SubVolumeName) + } + + } +} + +func TestSegmentsForSubVolumeId(t *testing.T) { + segments := SubVolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("SubVolumeId 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/netapp/2023-11-01/subvolumes/id_volume.go b/resource-manager/netapp/2023-11-01/subvolumes/id_volume.go new file mode 100644 index 00000000000..2b24cb1a31f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_volume.go @@ -0,0 +1,148 @@ +package subvolumes + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go b/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go new file mode 100644 index 00000000000..54203934497 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/id_volume_test.go @@ -0,0 +1,372 @@ +package subvolumes + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/subvolumes/method_create.go b/resource-manager/netapp/2023-11-01/subvolumes/method_create.go new file mode 100644 index 00000000000..bbfe4a236ba --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/method_create.go @@ -0,0 +1,76 @@ +package subvolumes + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *SubvolumeInfo +} + +// Create ... +func (c SubVolumesClient) Create(ctx context.Context, id SubVolumeId, input SubvolumeInfo) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c SubVolumesClient) CreateThenPoll(ctx context.Context, id SubVolumeId, input SubvolumeInfo) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/method_delete.go b/resource-manager/netapp/2023-11-01/subvolumes/method_delete.go new file mode 100644 index 00000000000..2f19ed22f0c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/method_delete.go @@ -0,0 +1,71 @@ +package subvolumes + +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 SubVolumesClient) Delete(ctx context.Context, id SubVolumeId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 SubVolumesClient) DeleteThenPoll(ctx context.Context, id SubVolumeId) 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/netapp/2023-11-01/subvolumes/method_get.go b/resource-manager/netapp/2023-11-01/subvolumes/method_get.go new file mode 100644 index 00000000000..455566fe22c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/method_get.go @@ -0,0 +1,54 @@ +package subvolumes + +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 *SubvolumeInfo +} + +// Get ... +func (c SubVolumesClient) Get(ctx context.Context, id SubVolumeId) (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 SubvolumeInfo + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/method_getmetadata.go b/resource-manager/netapp/2023-11-01/subvolumes/method_getmetadata.go new file mode 100644 index 00000000000..08001acad27 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/method_getmetadata.go @@ -0,0 +1,71 @@ +package subvolumes + +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 GetMetadataOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *SubvolumeModel +} + +// GetMetadata ... +func (c SubVolumesClient) GetMetadata(ctx context.Context, id SubVolumeId) (result GetMetadataOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/getMetadata", 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 +} + +// GetMetadataThenPoll performs GetMetadata then polls until it's completed +func (c SubVolumesClient) GetMetadataThenPoll(ctx context.Context, id SubVolumeId) error { + result, err := c.GetMetadata(ctx, id) + if err != nil { + return fmt.Errorf("performing GetMetadata: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after GetMetadata: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/method_listbyvolume.go b/resource-manager/netapp/2023-11-01/subvolumes/method_listbyvolume.go new file mode 100644 index 00000000000..78a3950e631 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/method_listbyvolume.go @@ -0,0 +1,91 @@ +package subvolumes + +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 ListByVolumeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]SubvolumeInfo +} + +type ListByVolumeCompleteResult struct { + LatestHttpResponse *http.Response + Items []SubvolumeInfo +} + +// ListByVolume ... +func (c SubVolumesClient) ListByVolume(ctx context.Context, id VolumeId) (result ListByVolumeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/subVolumes", 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 *[]SubvolumeInfo `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListByVolumeComplete retrieves all the results into a single object +func (c SubVolumesClient) ListByVolumeComplete(ctx context.Context, id VolumeId) (ListByVolumeCompleteResult, error) { + return c.ListByVolumeCompleteMatchingPredicate(ctx, id, SubvolumeInfoOperationPredicate{}) +} + +// ListByVolumeCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c SubVolumesClient) ListByVolumeCompleteMatchingPredicate(ctx context.Context, id VolumeId, predicate SubvolumeInfoOperationPredicate) (result ListByVolumeCompleteResult, err error) { + items := make([]SubvolumeInfo, 0) + + resp, err := c.ListByVolume(ctx, id) + if err != nil { + 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 = ListByVolumeCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/method_update.go b/resource-manager/netapp/2023-11-01/subvolumes/method_update.go new file mode 100644 index 00000000000..294ead80256 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/method_update.go @@ -0,0 +1,75 @@ +package subvolumes + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *SubvolumeInfo +} + +// Update ... +func (c SubVolumesClient) Update(ctx context.Context, id SubVolumeId, input SubvolumePatchRequest) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c SubVolumesClient) UpdateThenPoll(ctx context.Context, id SubVolumeId, input SubvolumePatchRequest) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeinfo.go b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeinfo.go new file mode 100644 index 00000000000..3adbcfc6002 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeinfo.go @@ -0,0 +1,16 @@ +package subvolumes + +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 SubvolumeInfo struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SubvolumeProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodel.go b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodel.go new file mode 100644 index 00000000000..d15828e2987 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodel.go @@ -0,0 +1,11 @@ +package subvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubvolumeModel struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *SubvolumeModelProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodelproperties.go b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodelproperties.go new file mode 100644 index 00000000000..26911c386fc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumemodelproperties.go @@ -0,0 +1,71 @@ +package subvolumes + +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 SubvolumeModelProperties struct { + AccessedTimeStamp *string `json:"accessedTimeStamp,omitempty"` + BytesUsed *int64 `json:"bytesUsed,omitempty"` + ChangedTimeStamp *string `json:"changedTimeStamp,omitempty"` + CreationTimeStamp *string `json:"creationTimeStamp,omitempty"` + ModifiedTimeStamp *string `json:"modifiedTimeStamp,omitempty"` + ParentPath *string `json:"parentPath,omitempty"` + Path *string `json:"path,omitempty"` + Permissions *string `json:"permissions,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Size *int64 `json:"size,omitempty"` +} + +func (o *SubvolumeModelProperties) GetAccessedTimeStampAsTime() (*time.Time, error) { + if o.AccessedTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.AccessedTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubvolumeModelProperties) SetAccessedTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.AccessedTimeStamp = &formatted +} + +func (o *SubvolumeModelProperties) GetChangedTimeStampAsTime() (*time.Time, error) { + if o.ChangedTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ChangedTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubvolumeModelProperties) SetChangedTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ChangedTimeStamp = &formatted +} + +func (o *SubvolumeModelProperties) GetCreationTimeStampAsTime() (*time.Time, error) { + if o.CreationTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.CreationTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubvolumeModelProperties) SetCreationTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.CreationTimeStamp = &formatted +} + +func (o *SubvolumeModelProperties) GetModifiedTimeStampAsTime() (*time.Time, error) { + if o.ModifiedTimeStamp == nil { + return nil, nil + } + return dates.ParseAsFormat(o.ModifiedTimeStamp, "2006-01-02T15:04:05Z07:00") +} + +func (o *SubvolumeModelProperties) SetModifiedTimeStampAsTime(input time.Time) { + formatted := input.Format("2006-01-02T15:04:05Z07:00") + o.ModifiedTimeStamp = &formatted +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchparams.go b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchparams.go new file mode 100644 index 00000000000..02ea94ff0ac --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchparams.go @@ -0,0 +1,9 @@ +package subvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubvolumePatchParams struct { + Path *string `json:"path,omitempty"` + Size *int64 `json:"size,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchrequest.go b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchrequest.go new file mode 100644 index 00000000000..0394a55073a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumepatchrequest.go @@ -0,0 +1,8 @@ +package subvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubvolumePatchRequest struct { + Properties *SubvolumePatchParams `json:"properties,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeproperties.go b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeproperties.go new file mode 100644 index 00000000000..899e995183a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/model_subvolumeproperties.go @@ -0,0 +1,11 @@ +package subvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubvolumeProperties struct { + ParentPath *string `json:"parentPath,omitempty"` + Path *string `json:"path,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Size *int64 `json:"size,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/subvolumes/predicates.go b/resource-manager/netapp/2023-11-01/subvolumes/predicates.go new file mode 100644 index 00000000000..af649a6bd08 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/predicates.go @@ -0,0 +1,27 @@ +package subvolumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubvolumeInfoOperationPredicate struct { + Id *string + Name *string + Type *string +} + +func (p SubvolumeInfoOperationPredicate) Matches(input SubvolumeInfo) 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/netapp/2023-11-01/subvolumes/version.go b/resource-manager/netapp/2023-11-01/subvolumes/version.go new file mode 100644 index 00000000000..888c5854d33 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/subvolumes/version.go @@ -0,0 +1,12 @@ +package subvolumes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/subvolumes/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/README.md b/resource-manager/netapp/2023-11-01/volumegroups/README.md new file mode 100644 index 00000000000..1424cd706bc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumegroups` Documentation + +The `volumegroups` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/volumegroups" +``` + + +### Client Initialization + +```go +client := volumegroups.NewVolumeGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumeGroupsClient.Create` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") + +payload := volumegroups.VolumeGroupDetails{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.Delete` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeGroupsClient.Get` + +```go +ctx := context.TODO() +id := volumegroups.NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") + +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: `VolumeGroupsClient.ListByNetAppAccount` + +```go +ctx := context.TODO() +id := volumegroups.NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + +read, err := client.ListByNetAppAccount(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/netapp/2023-11-01/volumegroups/client.go b/resource-manager/netapp/2023-11-01/volumegroups/client.go new file mode 100644 index 00000000000..a117e697f04 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/client.go @@ -0,0 +1,26 @@ +package volumegroups + +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 VolumeGroupsClient struct { + Client *resourcemanager.Client +} + +func NewVolumeGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumeGroupsClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "volumegroups", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VolumeGroupsClient: %+v", err) + } + + return &VolumeGroupsClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/constants.go b/resource-manager/netapp/2023-11-01/volumegroups/constants.go new file mode 100644 index 00000000000..5a28a92bfa4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/constants.go @@ -0,0 +1,649 @@ +package volumegroups + +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 ApplicationType string + +const ( + ApplicationTypeORACLE ApplicationType = "ORACLE" + ApplicationTypeSAPNegativeHANA ApplicationType = "SAP-HANA" +) + +func PossibleValuesForApplicationType() []string { + return []string{ + string(ApplicationTypeORACLE), + string(ApplicationTypeSAPNegativeHANA), + } +} + +func (s *ApplicationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationType(input string) (*ApplicationType, error) { + vals := map[string]ApplicationType{ + "oracle": ApplicationTypeORACLE, + "sap-hana": ApplicationTypeSAPNegativeHANA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationType(input) + return &out, nil +} + +type AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func (s *AvsDataStore) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAvsDataStore(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func (s *ChownMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseChownMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type CoolAccessRetrievalPolicy string + +const ( + CoolAccessRetrievalPolicyDefault CoolAccessRetrievalPolicy = "Default" + CoolAccessRetrievalPolicyNever CoolAccessRetrievalPolicy = "Never" + CoolAccessRetrievalPolicyOnRead CoolAccessRetrievalPolicy = "OnRead" +) + +func PossibleValuesForCoolAccessRetrievalPolicy() []string { + return []string{ + string(CoolAccessRetrievalPolicyDefault), + string(CoolAccessRetrievalPolicyNever), + string(CoolAccessRetrievalPolicyOnRead), + } +} + +func (s *CoolAccessRetrievalPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCoolAccessRetrievalPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCoolAccessRetrievalPolicy(input string) (*CoolAccessRetrievalPolicy, error) { + vals := map[string]CoolAccessRetrievalPolicy{ + "default": CoolAccessRetrievalPolicyDefault, + "never": CoolAccessRetrievalPolicyNever, + "onread": CoolAccessRetrievalPolicyOnRead, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CoolAccessRetrievalPolicy(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func (s *EnableSubvolumes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnableSubvolumes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointKeyVault EncryptionKeySource = "Microsoft.KeyVault" + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointKeyVault), + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func (s *EncryptionKeySource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEncryptionKeySource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.keyvault": EncryptionKeySourceMicrosoftPointKeyVault, + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func (s *EndpointType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEndpointType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type FileAccessLogs string + +const ( + FileAccessLogsDisabled FileAccessLogs = "Disabled" + FileAccessLogsEnabled FileAccessLogs = "Enabled" +) + +func PossibleValuesForFileAccessLogs() []string { + return []string{ + string(FileAccessLogsDisabled), + string(FileAccessLogsEnabled), + } +} + +func (s *FileAccessLogs) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileAccessLogs(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileAccessLogs(input string) (*FileAccessLogs, error) { + vals := map[string]FileAccessLogs{ + "disabled": FileAccessLogsDisabled, + "enabled": FileAccessLogsEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileAccessLogs(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesBasicStandard NetworkFeatures = "Basic_Standard" + NetworkFeaturesStandard NetworkFeatures = "Standard" + NetworkFeaturesStandardBasic NetworkFeatures = "Standard_Basic" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesBasicStandard), + string(NetworkFeaturesStandard), + string(NetworkFeaturesStandardBasic), + } +} + +func (s *NetworkFeatures) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkFeatures(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "basic_standard": NetworkFeaturesBasicStandard, + "standard": NetworkFeaturesStandard, + "standard_basic": NetworkFeaturesStandardBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func (s *ReplicationSchedule) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicationSchedule(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func (s *SecurityStyle) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityStyle(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func (s *ServiceLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type SmbAccessBasedEnumeration string + +const ( + SmbAccessBasedEnumerationDisabled SmbAccessBasedEnumeration = "Disabled" + SmbAccessBasedEnumerationEnabled SmbAccessBasedEnumeration = "Enabled" +) + +func PossibleValuesForSmbAccessBasedEnumeration() []string { + return []string{ + string(SmbAccessBasedEnumerationDisabled), + string(SmbAccessBasedEnumerationEnabled), + } +} + +func (s *SmbAccessBasedEnumeration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSmbAccessBasedEnumeration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSmbAccessBasedEnumeration(input string) (*SmbAccessBasedEnumeration, error) { + vals := map[string]SmbAccessBasedEnumeration{ + "disabled": SmbAccessBasedEnumerationDisabled, + "enabled": SmbAccessBasedEnumerationEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbAccessBasedEnumeration(input) + return &out, nil +} + +type SmbNonBrowsable string + +const ( + SmbNonBrowsableDisabled SmbNonBrowsable = "Disabled" + SmbNonBrowsableEnabled SmbNonBrowsable = "Enabled" +) + +func PossibleValuesForSmbNonBrowsable() []string { + return []string{ + string(SmbNonBrowsableDisabled), + string(SmbNonBrowsableEnabled), + } +} + +func (s *SmbNonBrowsable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSmbNonBrowsable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSmbNonBrowsable(input string) (*SmbNonBrowsable, error) { + vals := map[string]SmbNonBrowsable{ + "disabled": SmbNonBrowsableDisabled, + "enabled": SmbNonBrowsableEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbNonBrowsable(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityAcrossTTwo VolumeStorageToNetworkProximity = "AcrossT2" + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityAcrossTTwo), + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func (s *VolumeStorageToNetworkProximity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVolumeStorageToNetworkProximity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "acrosst2": VolumeStorageToNetworkProximityAcrossTTwo, + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go new file mode 100644 index 00000000000..e41dc1600a0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount.go @@ -0,0 +1,130 @@ +package volumegroups + +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(&NetAppAccountId{}) +} + +var _ resourceids.ResourceId = &NetAppAccountId{} + +// NetAppAccountId is a struct representing the Resource ID for a Net App Account +type NetAppAccountId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string +} + +// NewNetAppAccountID returns a new NetAppAccountId struct +func NewNetAppAccountID(subscriptionId string, resourceGroupName string, netAppAccountName string) NetAppAccountId { + return NetAppAccountId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + } +} + +// ParseNetAppAccountID parses 'input' into a NetAppAccountId +func ParseNetAppAccountID(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseNetAppAccountIDInsensitively parses 'input' case-insensitively into a NetAppAccountId +// note: this method should only be used for API response data and not user input +func ParseNetAppAccountIDInsensitively(input string) (*NetAppAccountId, error) { + parser := resourceids.NewParserFromResourceIdType(&NetAppAccountId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := NetAppAccountId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *NetAppAccountId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + return nil +} + +// ValidateNetAppAccountID checks that 'input' can be parsed as a Net App Account ID +func ValidateNetAppAccountID(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 := ParseNetAppAccountID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Net App Account ID +func (id NetAppAccountId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Net App Account ID +func (id NetAppAccountId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + } +} + +// String returns a human-readable description of this Net App Account ID +func (id NetAppAccountId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + } + return fmt.Sprintf("Net App Account (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go new file mode 100644 index 00000000000..36fb9212c90 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_netappaccount_test.go @@ -0,0 +1,282 @@ +package volumegroups + +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 = &NetAppAccountId{} + +func TestNewNetAppAccountID(t *testing.T) { + id := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } +} + +func TestFormatNetAppAccountID(t *testing.T) { + actual := NewNetAppAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseNetAppAccountID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestParseNetAppAccountIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *NetAppAccountId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Expected: &NetAppAccountId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseNetAppAccountIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + } +} + +func TestSegmentsForNetAppAccountId(t *testing.T) { + segments := NetAppAccountId{}.Segments() + if len(segments) == 0 { + t.Fatalf("NetAppAccountId 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/netapp/2023-11-01/volumegroups/id_volumegroup.go b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go new file mode 100644 index 00000000000..f42fe51614d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup.go @@ -0,0 +1,139 @@ +package volumegroups + +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(&VolumeGroupId{}) +} + +var _ resourceids.ResourceId = &VolumeGroupId{} + +// VolumeGroupId is a struct representing the Resource ID for a Volume Group +type VolumeGroupId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + VolumeGroupName string +} + +// NewVolumeGroupID returns a new VolumeGroupId struct +func NewVolumeGroupID(subscriptionId string, resourceGroupName string, netAppAccountName string, volumeGroupName string) VolumeGroupId { + return VolumeGroupId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + VolumeGroupName: volumeGroupName, + } +} + +// ParseVolumeGroupID parses 'input' into a VolumeGroupId +func ParseVolumeGroupID(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeGroupId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeGroupId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeGroupIDInsensitively parses 'input' case-insensitively into a VolumeGroupId +// note: this method should only be used for API response data and not user input +func ParseVolumeGroupIDInsensitively(input string) (*VolumeGroupId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeGroupId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeGroupId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeGroupId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.VolumeGroupName, ok = input.Parsed["volumeGroupName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeGroupName", input) + } + + return nil +} + +// ValidateVolumeGroupID checks that 'input' can be parsed as a Volume Group ID +func ValidateVolumeGroupID(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 := ParseVolumeGroupID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume Group ID +func (id VolumeGroupId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/volumeGroups/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.VolumeGroupName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume Group ID +func (id VolumeGroupId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticVolumeGroups", "volumeGroups", "volumeGroups"), + resourceids.UserSpecifiedSegment("volumeGroupName", "volumeGroupValue"), + } +} + +// String returns a human-readable description of this Volume Group ID +func (id VolumeGroupId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Volume Group Name: %q", id.VolumeGroupName), + } + return fmt.Sprintf("Volume Group (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go new file mode 100644 index 00000000000..b320b29e27d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/id_volumegroup_test.go @@ -0,0 +1,327 @@ +package volumegroups + +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 = &VolumeGroupId{} + +func TestNewVolumeGroupID(t *testing.T) { + id := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.VolumeGroupName != "volumeGroupValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeGroupName'", id.VolumeGroupName, "volumeGroupValue") + } +} + +func TestFormatVolumeGroupID(t *testing.T) { + actual := NewVolumeGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "volumeGroupValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups/volumeGroupValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeGroupID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeGroupId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups/volumeGroupValue", + Expected: &VolumeGroupId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + VolumeGroupName: "volumeGroupValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups/volumeGroupValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeGroupID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.VolumeGroupName != v.Expected.VolumeGroupName { + t.Fatalf("Expected %q but got %q for VolumeGroupName", v.Expected.VolumeGroupName, actual.VolumeGroupName) + } + + } +} + +func TestParseVolumeGroupIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeGroupId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/vOlUmEgRoUpS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups/volumeGroupValue", + Expected: &VolumeGroupId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + VolumeGroupName: "volumeGroupValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/volumeGroups/volumeGroupValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/vOlUmEgRoUpS/vOlUmEgRoUpVaLuE", + Expected: &VolumeGroupId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + VolumeGroupName: "vOlUmEgRoUpVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/vOlUmEgRoUpS/vOlUmEgRoUpVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeGroupIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.VolumeGroupName != v.Expected.VolumeGroupName { + t.Fatalf("Expected %q but got %q for VolumeGroupName", v.Expected.VolumeGroupName, actual.VolumeGroupName) + } + + } +} + +func TestSegmentsForVolumeGroupId(t *testing.T) { + segments := VolumeGroupId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeGroupId 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/netapp/2023-11-01/volumegroups/method_create.go b/resource-manager/netapp/2023-11-01/volumegroups/method_create.go new file mode 100644 index 00000000000..20ea352a9b8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/method_create.go @@ -0,0 +1,74 @@ +package volumegroups + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VolumeGroupDetails +} + +// Create ... +func (c VolumeGroupsClient) Create(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) (result CreateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusCreated, + }, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VolumeGroupsClient) CreateThenPoll(ctx context.Context, id VolumeGroupId, input VolumeGroupDetails) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/method_delete.go b/resource-manager/netapp/2023-11-01/volumegroups/method_delete.go new file mode 100644 index 00000000000..32e6c75b150 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/method_delete.go @@ -0,0 +1,71 @@ +package volumegroups + +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 VolumeGroupsClient) Delete(ctx context.Context, id VolumeGroupId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 VolumeGroupsClient) DeleteThenPoll(ctx context.Context, id VolumeGroupId) 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/netapp/2023-11-01/volumegroups/method_get.go b/resource-manager/netapp/2023-11-01/volumegroups/method_get.go new file mode 100644 index 00000000000..981869d83d5 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/method_get.go @@ -0,0 +1,54 @@ +package volumegroups + +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 *VolumeGroupDetails +} + +// Get ... +func (c VolumeGroupsClient) Get(ctx context.Context, id VolumeGroupId) (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 VolumeGroupDetails + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/method_listbynetappaccount.go b/resource-manager/netapp/2023-11-01/volumegroups/method_listbynetappaccount.go new file mode 100644 index 00000000000..a97d0887201 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/method_listbynetappaccount.go @@ -0,0 +1,55 @@ +package volumegroups + +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 ListByNetAppAccountOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VolumeGroupList +} + +// ListByNetAppAccount ... +func (c VolumeGroupsClient) ListByNetAppAccount(ctx context.Context, id NetAppAccountId) (result ListByNetAppAccountOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/volumeGroups", 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 VolumeGroupList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_exportpolicyrule.go b/resource-manager/netapp/2023-11-01/volumegroups/model_exportpolicyrule.go new file mode 100644 index 00000000000..e17395ba1a7 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_mounttargetproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_mounttargetproperties.go new file mode 100644 index 00000000000..5844b80ce9d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IPAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_placementkeyvaluepairs.go b/resource-manager/netapp/2023-11-01/volumegroups/model_placementkeyvaluepairs.go new file mode 100644 index 00000000000..1714b1662a1 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_replicationobject.go b/resource-manager/netapp/2023-11-01/volumegroups/model_replicationobject.go new file mode 100644 index 00000000000..6d145aa0079 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumebackupproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumebackupproperties.go new file mode 100644 index 00000000000..39ce5a2b79b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumebackupproperties.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + BackupVaultId *string `json:"backupVaultId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroup.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroup.go new file mode 100644 index 00000000000..5e4df7bb9c0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroup.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroup struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupListProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupdetails.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupdetails.go new file mode 100644 index 00000000000..5f01af82c0f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupdetails.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupDetails struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumeGroupProperties `json:"properties,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplist.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplist.go new file mode 100644 index 00000000000..447c6e6e858 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplist.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupList struct { + Value *[]VolumeGroup `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplistproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplistproperties.go new file mode 100644 index 00000000000..5788ee516fc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegrouplistproperties.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupListProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupmetadata.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupmetadata.go new file mode 100644 index 00000000000..b9fa343690c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupmetadata.go @@ -0,0 +1,12 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupMetaData struct { + ApplicationIdentifier *string `json:"applicationIdentifier,omitempty"` + ApplicationType *ApplicationType `json:"applicationType,omitempty"` + GlobalPlacementRules *[]PlacementKeyValuePairs `json:"globalPlacementRules,omitempty"` + GroupDescription *string `json:"groupDescription,omitempty"` + VolumesCount *int64 `json:"volumesCount,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupproperties.go new file mode 100644 index 00000000000..0bab153b397 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupproperties.go @@ -0,0 +1,10 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeGroupProperties struct { + GroupMetaData *VolumeGroupMetaData `json:"groupMetaData,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + Volumes *[]VolumeGroupVolumeProperties `json:"volumes,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupvolumeproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupvolumeproperties.go new file mode 100644 index 00000000000..935a8a5f480 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumegroupvolumeproperties.go @@ -0,0 +1,17 @@ +package volumegroups + +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 VolumeGroupVolumeProperties struct { + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumeproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumeproperties.go new file mode 100644 index 00000000000..d6aa4935855 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumeproperties.go @@ -0,0 +1,61 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + ActualThroughputMibps *float64 `json:"actualThroughputMibps,omitempty"` + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolAccessRetrievalPolicy *CoolAccessRetrievalPolicy `json:"coolAccessRetrievalPolicy,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DataStoreResourceId *[]string `json:"dataStoreResourceId,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + DeleteBaseSnapshot *bool `json:"deleteBaseSnapshot,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileAccessLogs *FileAccessLogs `json:"fileAccessLogs,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsLargeVolume *bool `json:"isLargeVolume,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + KeyVaultPrivateEndpointResourceId *string `json:"keyVaultPrivateEndpointResourceId,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + OriginatingResourceId *string `json:"originatingResourceId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisionedAvailabilityZone *string `json:"provisionedAvailabilityZone,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbAccessBasedEnumeration *SmbAccessBasedEnumeration `json:"smbAccessBasedEnumeration,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SmbNonBrowsable *SmbNonBrowsable `json:"smbNonBrowsable,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesdataprotection.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesdataprotection.go new file mode 100644 index 00000000000..632e45e64b0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesdataprotection.go @@ -0,0 +1,11 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` + VolumeRelocation *VolumeRelocationProperties `json:"volumeRelocation,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesexportpolicy.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesexportpolicy.go new file mode 100644 index 00000000000..227c8586d6f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumerelocationproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumerelocationproperties.go new file mode 100644 index 00000000000..4fea57c7396 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumerelocationproperties.go @@ -0,0 +1,9 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeRelocationProperties struct { + ReadyToBeFinalized *bool `json:"readyToBeFinalized,omitempty"` + RelocationRequested *bool `json:"relocationRequested,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/model_volumesnapshotproperties.go b/resource-manager/netapp/2023-11-01/volumegroups/model_volumesnapshotproperties.go new file mode 100644 index 00000000000..a3f5011da3b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumegroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumegroups/version.go b/resource-manager/netapp/2023-11-01/volumegroups/version.go new file mode 100644 index 00000000000..e9eb0225bac --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumegroups/version.go @@ -0,0 +1,12 @@ +package volumegroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumegroups/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/README.md b/resource-manager/netapp/2023-11-01/volumequotarules/README.md new file mode 100644 index 00000000000..9deddc0c0e0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/README.md @@ -0,0 +1,98 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumequotarules` Documentation + +The `volumequotarules` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/volumequotarules" +``` + + +### Client Initialization + +```go +client := volumequotarules.NewVolumeQuotaRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumeQuotaRulesClient.Create` + +```go +ctx := context.TODO() +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "volumeQuotaRuleValue") + +payload := volumequotarules.VolumeQuotaRule{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeQuotaRulesClient.Delete` + +```go +ctx := context.TODO() +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "volumeQuotaRuleValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumeQuotaRulesClient.Get` + +```go +ctx := context.TODO() +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "volumeQuotaRuleValue") + +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: `VolumeQuotaRulesClient.ListByVolume` + +```go +ctx := context.TODO() +id := volumequotarules.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +read, err := client.ListByVolume(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumeQuotaRulesClient.Update` + +```go +ctx := context.TODO() +id := volumequotarules.NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "volumeQuotaRuleValue") + +payload := volumequotarules.VolumeQuotaRulePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/client.go b/resource-manager/netapp/2023-11-01/volumequotarules/client.go new file mode 100644 index 00000000000..c6c70e112e0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/client.go @@ -0,0 +1,26 @@ +package volumequotarules + +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 VolumeQuotaRulesClient struct { + Client *resourcemanager.Client +} + +func NewVolumeQuotaRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumeQuotaRulesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "volumequotarules", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VolumeQuotaRulesClient: %+v", err) + } + + return &VolumeQuotaRulesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/constants.go b/resource-manager/netapp/2023-11-01/volumequotarules/constants.go new file mode 100644 index 00000000000..fb0e41e1afb --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/constants.go @@ -0,0 +1,113 @@ +package volumequotarules + +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 ProvisioningState string + +const ( + ProvisioningStateAccepted ProvisioningState = "Accepted" + ProvisioningStateCreating ProvisioningState = "Creating" + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateMoving ProvisioningState = "Moving" + ProvisioningStatePatching ProvisioningState = "Patching" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateAccepted), + string(ProvisioningStateCreating), + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateMoving), + string(ProvisioningStatePatching), + string(ProvisioningStateSucceeded), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "accepted": ProvisioningStateAccepted, + "creating": ProvisioningStateCreating, + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "moving": ProvisioningStateMoving, + "patching": ProvisioningStatePatching, + "succeeded": ProvisioningStateSucceeded, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type Type string + +const ( + TypeDefaultGroupQuota Type = "DefaultGroupQuota" + TypeDefaultUserQuota Type = "DefaultUserQuota" + TypeIndividualGroupQuota Type = "IndividualGroupQuota" + TypeIndividualUserQuota Type = "IndividualUserQuota" +) + +func PossibleValuesForType() []string { + return []string{ + string(TypeDefaultGroupQuota), + string(TypeDefaultUserQuota), + string(TypeIndividualGroupQuota), + string(TypeIndividualUserQuota), + } +} + +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{ + "defaultgroupquota": TypeDefaultGroupQuota, + "defaultuserquota": TypeDefaultUserQuota, + "individualgroupquota": TypeIndividualGroupQuota, + "individualuserquota": TypeIndividualUserQuota, + } + 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 +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go new file mode 100644 index 00000000000..6dad4e030b2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume.go @@ -0,0 +1,148 @@ +package volumequotarules + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go new file mode 100644 index 00000000000..146a488d279 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volume_test.go @@ -0,0 +1,372 @@ +package volumequotarules + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/volumequotarules/id_volumequotarule.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go new file mode 100644 index 00000000000..e61ab571acc --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule.go @@ -0,0 +1,157 @@ +package volumequotarules + +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(&VolumeQuotaRuleId{}) +} + +var _ resourceids.ResourceId = &VolumeQuotaRuleId{} + +// VolumeQuotaRuleId is a struct representing the Resource ID for a Volume Quota Rule +type VolumeQuotaRuleId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string + VolumeQuotaRuleName string +} + +// NewVolumeQuotaRuleID returns a new VolumeQuotaRuleId struct +func NewVolumeQuotaRuleID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string, volumeQuotaRuleName string) VolumeQuotaRuleId { + return VolumeQuotaRuleId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + VolumeQuotaRuleName: volumeQuotaRuleName, + } +} + +// ParseVolumeQuotaRuleID parses 'input' into a VolumeQuotaRuleId +func ParseVolumeQuotaRuleID(input string) (*VolumeQuotaRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeQuotaRuleId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeQuotaRuleId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeQuotaRuleIDInsensitively parses 'input' case-insensitively into a VolumeQuotaRuleId +// note: this method should only be used for API response data and not user input +func ParseVolumeQuotaRuleIDInsensitively(input string) (*VolumeQuotaRuleId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeQuotaRuleId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeQuotaRuleId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeQuotaRuleId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + if id.VolumeQuotaRuleName, ok = input.Parsed["volumeQuotaRuleName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeQuotaRuleName", input) + } + + return nil +} + +// ValidateVolumeQuotaRuleID checks that 'input' can be parsed as a Volume Quota Rule ID +func ValidateVolumeQuotaRuleID(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 := ParseVolumeQuotaRuleID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume Quota Rule ID +func (id VolumeQuotaRuleId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s/volumeQuotaRules/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName, id.VolumeQuotaRuleName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume Quota Rule ID +func (id VolumeQuotaRuleId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + resourceids.StaticSegment("staticVolumeQuotaRules", "volumeQuotaRules", "volumeQuotaRules"), + resourceids.UserSpecifiedSegment("volumeQuotaRuleName", "volumeQuotaRuleValue"), + } +} + +// String returns a human-readable description of this Volume Quota Rule ID +func (id VolumeQuotaRuleId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + fmt.Sprintf("Volume Quota Rule Name: %q", id.VolumeQuotaRuleName), + } + return fmt.Sprintf("Volume Quota Rule (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go new file mode 100644 index 00000000000..92ceb47b830 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/id_volumequotarule_test.go @@ -0,0 +1,417 @@ +package volumequotarules + +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 = &VolumeQuotaRuleId{} + +func TestNewVolumeQuotaRuleID(t *testing.T) { + id := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "volumeQuotaRuleValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } + + if id.VolumeQuotaRuleName != "volumeQuotaRuleValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeQuotaRuleName'", id.VolumeQuotaRuleName, "volumeQuotaRuleValue") + } +} + +func TestFormatVolumeQuotaRuleID(t *testing.T) { + actual := NewVolumeQuotaRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue", "volumeQuotaRuleValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules/volumeQuotaRuleValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeQuotaRuleID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeQuotaRuleId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules/volumeQuotaRuleValue", + Expected: &VolumeQuotaRuleId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + VolumeQuotaRuleName: "volumeQuotaRuleValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules/volumeQuotaRuleValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeQuotaRuleID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + if actual.VolumeQuotaRuleName != v.Expected.VolumeQuotaRuleName { + t.Fatalf("Expected %q but got %q for VolumeQuotaRuleName", v.Expected.VolumeQuotaRuleName, actual.VolumeQuotaRuleName) + } + + } +} + +func TestParseVolumeQuotaRuleIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeQuotaRuleId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/vOlUmEqUoTaRuLeS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules/volumeQuotaRuleValue", + Expected: &VolumeQuotaRuleId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + VolumeQuotaRuleName: "volumeQuotaRuleValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/volumeQuotaRules/volumeQuotaRuleValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeVaLuE", + Expected: &VolumeQuotaRuleId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + VolumeQuotaRuleName: "vOlUmEqUoTaRuLeVaLuE", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/vOlUmEqUoTaRuLeS/vOlUmEqUoTaRuLeVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeQuotaRuleIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + if actual.VolumeQuotaRuleName != v.Expected.VolumeQuotaRuleName { + t.Fatalf("Expected %q but got %q for VolumeQuotaRuleName", v.Expected.VolumeQuotaRuleName, actual.VolumeQuotaRuleName) + } + + } +} + +func TestSegmentsForVolumeQuotaRuleId(t *testing.T) { + segments := VolumeQuotaRuleId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeQuotaRuleId 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/netapp/2023-11-01/volumequotarules/method_create.go b/resource-manager/netapp/2023-11-01/volumequotarules/method_create.go new file mode 100644 index 00000000000..4904525f7a0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/method_create.go @@ -0,0 +1,75 @@ +package volumequotarules + +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 CreateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VolumeQuotaRule +} + +// Create ... +func (c VolumeQuotaRulesClient) Create(ctx context.Context, id VolumeQuotaRuleId, input VolumeQuotaRule) (result CreateOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateThenPoll performs Create then polls until it's completed +func (c VolumeQuotaRulesClient) CreateThenPoll(ctx context.Context, id VolumeQuotaRuleId, input VolumeQuotaRule) error { + result, err := c.Create(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Create: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Create: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/method_delete.go b/resource-manager/netapp/2023-11-01/volumequotarules/method_delete.go new file mode 100644 index 00000000000..59d6fbecf0a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/method_delete.go @@ -0,0 +1,71 @@ +package volumequotarules + +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 VolumeQuotaRulesClient) Delete(ctx context.Context, id VolumeQuotaRuleId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 VolumeQuotaRulesClient) DeleteThenPoll(ctx context.Context, id VolumeQuotaRuleId) 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/netapp/2023-11-01/volumequotarules/method_get.go b/resource-manager/netapp/2023-11-01/volumequotarules/method_get.go new file mode 100644 index 00000000000..88aa05a3709 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/method_get.go @@ -0,0 +1,54 @@ +package volumequotarules + +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 *VolumeQuotaRule +} + +// Get ... +func (c VolumeQuotaRulesClient) Get(ctx context.Context, id VolumeQuotaRuleId) (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 VolumeQuotaRule + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/method_listbyvolume.go b/resource-manager/netapp/2023-11-01/volumequotarules/method_listbyvolume.go new file mode 100644 index 00000000000..ed643e0c5b0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/method_listbyvolume.go @@ -0,0 +1,55 @@ +package volumequotarules + +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 ListByVolumeOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *VolumeQuotaRulesList +} + +// ListByVolume ... +func (c VolumeQuotaRulesClient) ListByVolume(ctx context.Context, id VolumeId) (result ListByVolumeOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/volumeQuotaRules", 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 VolumeQuotaRulesList + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/method_update.go b/resource-manager/netapp/2023-11-01/volumequotarules/method_update.go new file mode 100644 index 00000000000..39d68a726c3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/method_update.go @@ -0,0 +1,75 @@ +package volumequotarules + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VolumeQuotaRule +} + +// Update ... +func (c VolumeQuotaRulesClient) Update(ctx context.Context, id VolumeQuotaRuleId, input VolumeQuotaRulePatch) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VolumeQuotaRulesClient) UpdateThenPoll(ctx context.Context, id VolumeQuotaRuleId, input VolumeQuotaRulePatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarule.go b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarule.go new file mode 100644 index 00000000000..9436f5c0008 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarule.go @@ -0,0 +1,18 @@ +package volumequotarules + +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 VolumeQuotaRule struct { + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties *VolumeQuotaRulesProperties `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/netapp/2023-11-01/volumequotarules/model_volumequotarulepatch.go b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulepatch.go new file mode 100644 index 00000000000..fbf72546c43 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulepatch.go @@ -0,0 +1,9 @@ +package volumequotarules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeQuotaRulePatch struct { + Properties *VolumeQuotaRulesProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotaruleslist.go b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotaruleslist.go new file mode 100644 index 00000000000..d9e15cf8035 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotaruleslist.go @@ -0,0 +1,8 @@ +package volumequotarules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeQuotaRulesList struct { + Value *[]VolumeQuotaRule `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulesproperties.go b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulesproperties.go new file mode 100644 index 00000000000..5ae037e0a23 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/model_volumequotarulesproperties.go @@ -0,0 +1,11 @@ +package volumequotarules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeQuotaRulesProperties struct { + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + QuotaSizeInKiBs *int64 `json:"quotaSizeInKiBs,omitempty"` + QuotaTarget *string `json:"quotaTarget,omitempty"` + QuotaType *Type `json:"quotaType,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumequotarules/version.go b/resource-manager/netapp/2023-11-01/volumequotarules/version.go new file mode 100644 index 00000000000..ee9371b563c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumequotarules/version.go @@ -0,0 +1,12 @@ +package volumequotarules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumequotarules/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/volumes/README.md b/resource-manager/netapp/2023-11-01/volumes/README.md new file mode 100644 index 00000000000..8172e40f4fe --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/README.md @@ -0,0 +1,111 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumes` Documentation + +The `volumes` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/volumes" +``` + + +### Client Initialization + +```go +client := volumes.NewVolumesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumes.Volume{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Delete` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.DeleteThenPoll(ctx, id, volumes.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Get` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +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: `VolumesClient.List` + +```go +ctx := context.TODO() +id := volumes.NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + +// 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: `VolumesClient.PopulateAvailabilityZone` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.PopulateAvailabilityZoneThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesClient.Update` + +```go +ctx := context.TODO() +id := volumes.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumes.VolumePatch{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/volumes/client.go b/resource-manager/netapp/2023-11-01/volumes/client.go new file mode 100644 index 00000000000..9f34fb4a6eb --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/client.go @@ -0,0 +1,26 @@ +package volumes + +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 VolumesClient struct { + Client *resourcemanager.Client +} + +func NewVolumesClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumesClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "volumes", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VolumesClient: %+v", err) + } + + return &VolumesClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumes/constants.go b/resource-manager/netapp/2023-11-01/volumes/constants.go new file mode 100644 index 00000000000..f3648628f02 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/constants.go @@ -0,0 +1,608 @@ +package volumes + +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 AvsDataStore string + +const ( + AvsDataStoreDisabled AvsDataStore = "Disabled" + AvsDataStoreEnabled AvsDataStore = "Enabled" +) + +func PossibleValuesForAvsDataStore() []string { + return []string{ + string(AvsDataStoreDisabled), + string(AvsDataStoreEnabled), + } +} + +func (s *AvsDataStore) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAvsDataStore(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAvsDataStore(input string) (*AvsDataStore, error) { + vals := map[string]AvsDataStore{ + "disabled": AvsDataStoreDisabled, + "enabled": AvsDataStoreEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AvsDataStore(input) + return &out, nil +} + +type ChownMode string + +const ( + ChownModeRestricted ChownMode = "Restricted" + ChownModeUnrestricted ChownMode = "Unrestricted" +) + +func PossibleValuesForChownMode() []string { + return []string{ + string(ChownModeRestricted), + string(ChownModeUnrestricted), + } +} + +func (s *ChownMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseChownMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseChownMode(input string) (*ChownMode, error) { + vals := map[string]ChownMode{ + "restricted": ChownModeRestricted, + "unrestricted": ChownModeUnrestricted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ChownMode(input) + return &out, nil +} + +type CoolAccessRetrievalPolicy string + +const ( + CoolAccessRetrievalPolicyDefault CoolAccessRetrievalPolicy = "Default" + CoolAccessRetrievalPolicyNever CoolAccessRetrievalPolicy = "Never" + CoolAccessRetrievalPolicyOnRead CoolAccessRetrievalPolicy = "OnRead" +) + +func PossibleValuesForCoolAccessRetrievalPolicy() []string { + return []string{ + string(CoolAccessRetrievalPolicyDefault), + string(CoolAccessRetrievalPolicyNever), + string(CoolAccessRetrievalPolicyOnRead), + } +} + +func (s *CoolAccessRetrievalPolicy) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseCoolAccessRetrievalPolicy(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseCoolAccessRetrievalPolicy(input string) (*CoolAccessRetrievalPolicy, error) { + vals := map[string]CoolAccessRetrievalPolicy{ + "default": CoolAccessRetrievalPolicyDefault, + "never": CoolAccessRetrievalPolicyNever, + "onread": CoolAccessRetrievalPolicyOnRead, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := CoolAccessRetrievalPolicy(input) + return &out, nil +} + +type EnableSubvolumes string + +const ( + EnableSubvolumesDisabled EnableSubvolumes = "Disabled" + EnableSubvolumesEnabled EnableSubvolumes = "Enabled" +) + +func PossibleValuesForEnableSubvolumes() []string { + return []string{ + string(EnableSubvolumesDisabled), + string(EnableSubvolumesEnabled), + } +} + +func (s *EnableSubvolumes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEnableSubvolumes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEnableSubvolumes(input string) (*EnableSubvolumes, error) { + vals := map[string]EnableSubvolumes{ + "disabled": EnableSubvolumesDisabled, + "enabled": EnableSubvolumesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EnableSubvolumes(input) + return &out, nil +} + +type EncryptionKeySource string + +const ( + EncryptionKeySourceMicrosoftPointKeyVault EncryptionKeySource = "Microsoft.KeyVault" + EncryptionKeySourceMicrosoftPointNetApp EncryptionKeySource = "Microsoft.NetApp" +) + +func PossibleValuesForEncryptionKeySource() []string { + return []string{ + string(EncryptionKeySourceMicrosoftPointKeyVault), + string(EncryptionKeySourceMicrosoftPointNetApp), + } +} + +func (s *EncryptionKeySource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEncryptionKeySource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEncryptionKeySource(input string) (*EncryptionKeySource, error) { + vals := map[string]EncryptionKeySource{ + "microsoft.keyvault": EncryptionKeySourceMicrosoftPointKeyVault, + "microsoft.netapp": EncryptionKeySourceMicrosoftPointNetApp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EncryptionKeySource(input) + return &out, nil +} + +type EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func (s *EndpointType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEndpointType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type FileAccessLogs string + +const ( + FileAccessLogsDisabled FileAccessLogs = "Disabled" + FileAccessLogsEnabled FileAccessLogs = "Enabled" +) + +func PossibleValuesForFileAccessLogs() []string { + return []string{ + string(FileAccessLogsDisabled), + string(FileAccessLogsEnabled), + } +} + +func (s *FileAccessLogs) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFileAccessLogs(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFileAccessLogs(input string) (*FileAccessLogs, error) { + vals := map[string]FileAccessLogs{ + "disabled": FileAccessLogsDisabled, + "enabled": FileAccessLogsEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FileAccessLogs(input) + return &out, nil +} + +type NetworkFeatures string + +const ( + NetworkFeaturesBasic NetworkFeatures = "Basic" + NetworkFeaturesBasicStandard NetworkFeatures = "Basic_Standard" + NetworkFeaturesStandard NetworkFeatures = "Standard" + NetworkFeaturesStandardBasic NetworkFeatures = "Standard_Basic" +) + +func PossibleValuesForNetworkFeatures() []string { + return []string{ + string(NetworkFeaturesBasic), + string(NetworkFeaturesBasicStandard), + string(NetworkFeaturesStandard), + string(NetworkFeaturesStandardBasic), + } +} + +func (s *NetworkFeatures) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkFeatures(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkFeatures(input string) (*NetworkFeatures, error) { + vals := map[string]NetworkFeatures{ + "basic": NetworkFeaturesBasic, + "basic_standard": NetworkFeaturesBasicStandard, + "standard": NetworkFeaturesStandard, + "standard_basic": NetworkFeaturesStandardBasic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkFeatures(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func (s *ReplicationSchedule) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicationSchedule(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} + +type SecurityStyle string + +const ( + SecurityStyleNtfs SecurityStyle = "ntfs" + SecurityStyleUnix SecurityStyle = "unix" +) + +func PossibleValuesForSecurityStyle() []string { + return []string{ + string(SecurityStyleNtfs), + string(SecurityStyleUnix), + } +} + +func (s *SecurityStyle) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityStyle(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityStyle(input string) (*SecurityStyle, error) { + vals := map[string]SecurityStyle{ + "ntfs": SecurityStyleNtfs, + "unix": SecurityStyleUnix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityStyle(input) + return &out, nil +} + +type ServiceLevel string + +const ( + ServiceLevelPremium ServiceLevel = "Premium" + ServiceLevelStandard ServiceLevel = "Standard" + ServiceLevelStandardZRS ServiceLevel = "StandardZRS" + ServiceLevelUltra ServiceLevel = "Ultra" +) + +func PossibleValuesForServiceLevel() []string { + return []string{ + string(ServiceLevelPremium), + string(ServiceLevelStandard), + string(ServiceLevelStandardZRS), + string(ServiceLevelUltra), + } +} + +func (s *ServiceLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseServiceLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseServiceLevel(input string) (*ServiceLevel, error) { + vals := map[string]ServiceLevel{ + "premium": ServiceLevelPremium, + "standard": ServiceLevelStandard, + "standardzrs": ServiceLevelStandardZRS, + "ultra": ServiceLevelUltra, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ServiceLevel(input) + return &out, nil +} + +type SmbAccessBasedEnumeration string + +const ( + SmbAccessBasedEnumerationDisabled SmbAccessBasedEnumeration = "Disabled" + SmbAccessBasedEnumerationEnabled SmbAccessBasedEnumeration = "Enabled" +) + +func PossibleValuesForSmbAccessBasedEnumeration() []string { + return []string{ + string(SmbAccessBasedEnumerationDisabled), + string(SmbAccessBasedEnumerationEnabled), + } +} + +func (s *SmbAccessBasedEnumeration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSmbAccessBasedEnumeration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSmbAccessBasedEnumeration(input string) (*SmbAccessBasedEnumeration, error) { + vals := map[string]SmbAccessBasedEnumeration{ + "disabled": SmbAccessBasedEnumerationDisabled, + "enabled": SmbAccessBasedEnumerationEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbAccessBasedEnumeration(input) + return &out, nil +} + +type SmbNonBrowsable string + +const ( + SmbNonBrowsableDisabled SmbNonBrowsable = "Disabled" + SmbNonBrowsableEnabled SmbNonBrowsable = "Enabled" +) + +func PossibleValuesForSmbNonBrowsable() []string { + return []string{ + string(SmbNonBrowsableDisabled), + string(SmbNonBrowsableEnabled), + } +} + +func (s *SmbNonBrowsable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSmbNonBrowsable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSmbNonBrowsable(input string) (*SmbNonBrowsable, error) { + vals := map[string]SmbNonBrowsable{ + "disabled": SmbNonBrowsableDisabled, + "enabled": SmbNonBrowsableEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SmbNonBrowsable(input) + return &out, nil +} + +type VolumeStorageToNetworkProximity string + +const ( + VolumeStorageToNetworkProximityAcrossTTwo VolumeStorageToNetworkProximity = "AcrossT2" + VolumeStorageToNetworkProximityDefault VolumeStorageToNetworkProximity = "Default" + VolumeStorageToNetworkProximityTOne VolumeStorageToNetworkProximity = "T1" + VolumeStorageToNetworkProximityTTwo VolumeStorageToNetworkProximity = "T2" +) + +func PossibleValuesForVolumeStorageToNetworkProximity() []string { + return []string{ + string(VolumeStorageToNetworkProximityAcrossTTwo), + string(VolumeStorageToNetworkProximityDefault), + string(VolumeStorageToNetworkProximityTOne), + string(VolumeStorageToNetworkProximityTTwo), + } +} + +func (s *VolumeStorageToNetworkProximity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVolumeStorageToNetworkProximity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVolumeStorageToNetworkProximity(input string) (*VolumeStorageToNetworkProximity, error) { + vals := map[string]VolumeStorageToNetworkProximity{ + "acrosst2": VolumeStorageToNetworkProximityAcrossTTwo, + "default": VolumeStorageToNetworkProximityDefault, + "t1": VolumeStorageToNetworkProximityTOne, + "t2": VolumeStorageToNetworkProximityTTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VolumeStorageToNetworkProximity(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go new file mode 100644 index 00000000000..baea2acd856 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool.go @@ -0,0 +1,139 @@ +package volumes + +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(&CapacityPoolId{}) +} + +var _ resourceids.ResourceId = &CapacityPoolId{} + +// CapacityPoolId is a struct representing the Resource ID for a Capacity Pool +type CapacityPoolId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string +} + +// NewCapacityPoolID returns a new CapacityPoolId struct +func NewCapacityPoolID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string) CapacityPoolId { + return CapacityPoolId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + } +} + +// ParseCapacityPoolID parses 'input' into a CapacityPoolId +func ParseCapacityPoolID(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&CapacityPoolId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CapacityPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseCapacityPoolIDInsensitively parses 'input' case-insensitively into a CapacityPoolId +// note: this method should only be used for API response data and not user input +func ParseCapacityPoolIDInsensitively(input string) (*CapacityPoolId, error) { + parser := resourceids.NewParserFromResourceIdType(&CapacityPoolId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := CapacityPoolId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *CapacityPoolId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + return nil +} + +// ValidateCapacityPoolID checks that 'input' can be parsed as a Capacity Pool ID +func ValidateCapacityPoolID(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 := ParseCapacityPoolID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Capacity Pool ID +func (id CapacityPoolId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Capacity Pool ID +func (id CapacityPoolId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + } +} + +// String returns a human-readable description of this Capacity Pool ID +func (id CapacityPoolId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + } + return fmt.Sprintf("Capacity Pool (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go new file mode 100644 index 00000000000..3b60398c58a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/id_capacitypool_test.go @@ -0,0 +1,327 @@ +package volumes + +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 = &CapacityPoolId{} + +func TestNewCapacityPoolID(t *testing.T) { + id := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } +} + +func TestFormatCapacityPoolID(t *testing.T) { + actual := NewCapacityPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseCapacityPoolID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *CapacityPoolId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Expected: &CapacityPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseCapacityPoolID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + } +} + +func TestParseCapacityPoolIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *CapacityPoolId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Expected: &CapacityPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Expected: &CapacityPoolId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseCapacityPoolIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + } +} + +func TestSegmentsForCapacityPoolId(t *testing.T) { + segments := CapacityPoolId{}.Segments() + if len(segments) == 0 { + t.Fatalf("CapacityPoolId 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/netapp/2023-11-01/volumes/id_volume.go b/resource-manager/netapp/2023-11-01/volumes/id_volume.go new file mode 100644 index 00000000000..2144d7750a2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/id_volume.go @@ -0,0 +1,148 @@ +package volumes + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go new file mode 100644 index 00000000000..8d2b5861a62 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/id_volume_test.go @@ -0,0 +1,372 @@ +package volumes + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/volumes/method_createorupdate.go b/resource-manager/netapp/2023-11-01/volumes/method_createorupdate.go new file mode 100644 index 00000000000..fe291f378c8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/method_createorupdate.go @@ -0,0 +1,76 @@ +package volumes + +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 *Volume +} + +// CreateOrUpdate ... +func (c VolumesClient) CreateOrUpdate(ctx context.Context, id VolumeId, input Volume) (result CreateOrUpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c VolumesClient) CreateOrUpdateThenPoll(ctx context.Context, id VolumeId, input Volume) error { + result, err := c.CreateOrUpdate(ctx, id, input) + 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/netapp/2023-11-01/volumes/method_delete.go b/resource-manager/netapp/2023-11-01/volumes/method_delete.go new file mode 100644 index 00000000000..23734d43ae5 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/method_delete.go @@ -0,0 +1,98 @@ +package volumes + +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 { + ForceDelete *bool +} + +func DefaultDeleteOperationOptions() DeleteOperationOptions { + return DeleteOperationOptions{} +} + +func (o DeleteOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.ForceDelete != nil { + out.Append("forceDelete", fmt.Sprintf("%v", *o.ForceDelete)) + } + return &out +} + +// Delete ... +func (c VolumesClient) Delete(ctx context.Context, id VolumeId, options DeleteOperationOptions) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 VolumesClient) DeleteThenPoll(ctx context.Context, id VolumeId, 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/netapp/2023-11-01/volumes/method_get.go b/resource-manager/netapp/2023-11-01/volumes/method_get.go new file mode 100644 index 00000000000..a62cc7f84a3 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/method_get.go @@ -0,0 +1,54 @@ +package volumes + +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 *Volume +} + +// Get ... +func (c VolumesClient) Get(ctx context.Context, id VolumeId) (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 Volume + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumes/method_list.go b/resource-manager/netapp/2023-11-01/volumes/method_list.go new file mode 100644 index 00000000000..b5bb5692142 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/method_list.go @@ -0,0 +1,91 @@ +package volumes + +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 *[]Volume +} + +type ListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Volume +} + +// List ... +func (c VolumesClient) List(ctx context.Context, id CapacityPoolId) (result ListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/volumes", 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 *[]Volume `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 VolumesClient) ListComplete(ctx context.Context, id CapacityPoolId) (ListCompleteResult, error) { + return c.ListCompleteMatchingPredicate(ctx, id, VolumeOperationPredicate{}) +} + +// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c VolumesClient) ListCompleteMatchingPredicate(ctx context.Context, id CapacityPoolId, predicate VolumeOperationPredicate) (result ListCompleteResult, err error) { + items := make([]Volume, 0) + + resp, err := c.List(ctx, id) + if err != nil { + 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/netapp/2023-11-01/volumes/method_populateavailabilityzone.go b/resource-manager/netapp/2023-11-01/volumes/method_populateavailabilityzone.go new file mode 100644 index 00000000000..052b13f3fd6 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/method_populateavailabilityzone.go @@ -0,0 +1,71 @@ +package volumes + +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 PopulateAvailabilityZoneOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Volume +} + +// PopulateAvailabilityZone ... +func (c VolumesClient) PopulateAvailabilityZone(ctx context.Context, id VolumeId) (result PopulateAvailabilityZoneOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/populateAvailabilityZone", 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 +} + +// PopulateAvailabilityZoneThenPoll performs PopulateAvailabilityZone then polls until it's completed +func (c VolumesClient) PopulateAvailabilityZoneThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.PopulateAvailabilityZone(ctx, id) + if err != nil { + return fmt.Errorf("performing PopulateAvailabilityZone: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after PopulateAvailabilityZone: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumes/method_update.go b/resource-manager/netapp/2023-11-01/volumes/method_update.go new file mode 100644 index 00000000000..8a9aedb619c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/method_update.go @@ -0,0 +1,75 @@ +package volumes + +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 UpdateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *Volume +} + +// Update ... +func (c VolumesClient) Update(ctx context.Context, id VolumeId, input VolumePatch) (result UpdateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// UpdateThenPoll performs Update then polls until it's completed +func (c VolumesClient) UpdateThenPoll(ctx context.Context, id VolumeId, input VolumePatch) error { + result, err := c.Update(ctx, id, input) + if err != nil { + return fmt.Errorf("performing Update: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Update: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_exportpolicyrule.go b/resource-manager/netapp/2023-11-01/volumes/model_exportpolicyrule.go new file mode 100644 index 00000000000..9b059c74757 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_exportpolicyrule.go @@ -0,0 +1,22 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExportPolicyRule struct { + AllowedClients *string `json:"allowedClients,omitempty"` + ChownMode *ChownMode `json:"chownMode,omitempty"` + Cifs *bool `json:"cifs,omitempty"` + HasRootAccess *bool `json:"hasRootAccess,omitempty"` + Kerberos5ReadOnly *bool `json:"kerberos5ReadOnly,omitempty"` + Kerberos5ReadWrite *bool `json:"kerberos5ReadWrite,omitempty"` + Kerberos5iReadOnly *bool `json:"kerberos5iReadOnly,omitempty"` + Kerberos5iReadWrite *bool `json:"kerberos5iReadWrite,omitempty"` + Kerberos5pReadOnly *bool `json:"kerberos5pReadOnly,omitempty"` + Kerberos5pReadWrite *bool `json:"kerberos5pReadWrite,omitempty"` + Nfsv3 *bool `json:"nfsv3,omitempty"` + Nfsv41 *bool `json:"nfsv41,omitempty"` + RuleIndex *int64 `json:"ruleIndex,omitempty"` + UnixReadOnly *bool `json:"unixReadOnly,omitempty"` + UnixReadWrite *bool `json:"unixReadWrite,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_mounttargetproperties.go b/resource-manager/netapp/2023-11-01/volumes/model_mounttargetproperties.go new file mode 100644 index 00000000000..7f5c238183c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_mounttargetproperties.go @@ -0,0 +1,11 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type MountTargetProperties struct { + FileSystemId string `json:"fileSystemId"` + IPAddress *string `json:"ipAddress,omitempty"` + MountTargetId *string `json:"mountTargetId,omitempty"` + SmbServerFqdn *string `json:"smbServerFqdn,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_placementkeyvaluepairs.go b/resource-manager/netapp/2023-11-01/volumes/model_placementkeyvaluepairs.go new file mode 100644 index 00000000000..588e9729c1e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_placementkeyvaluepairs.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PlacementKeyValuePairs struct { + Key string `json:"key"` + Value string `json:"value"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_replicationobject.go b/resource-manager/netapp/2023-11-01/volumes/model_replicationobject.go new file mode 100644 index 00000000000..b7d6873811e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_replicationobject.go @@ -0,0 +1,12 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationObject struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationId *string `json:"replicationId,omitempty"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volume.go b/resource-manager/netapp/2023-11-01/volumes/model_volume.go new file mode 100644 index 00000000000..1679818444b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volume.go @@ -0,0 +1,21 @@ +package volumes + +import ( + "github.com/hashicorp/go-azure-helpers/resourcemanager/systemdata" + "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 Volume struct { + Etag *string `json:"etag,omitempty"` + Id *string `json:"id,omitempty"` + Location string `json:"location"` + Name *string `json:"name,omitempty"` + Properties VolumeProperties `json:"properties"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` + Zones *zones.Schema `json:"zones,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumebackupproperties.go b/resource-manager/netapp/2023-11-01/volumes/model_volumebackupproperties.go new file mode 100644 index 00000000000..a74e6fd4d16 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumebackupproperties.go @@ -0,0 +1,10 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeBackupProperties struct { + BackupPolicyId *string `json:"backupPolicyId,omitempty"` + BackupVaultId *string `json:"backupVaultId,omitempty"` + PolicyEnforced *bool `json:"policyEnforced,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumepatch.go b/resource-manager/netapp/2023-11-01/volumes/model_volumepatch.go new file mode 100644 index 00000000000..b39ea01aee8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumepatch.go @@ -0,0 +1,13 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatch struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *VolumePatchProperties `json:"properties,omitempty"` + Tags *map[string]string `json:"tags,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumepatchproperties.go b/resource-manager/netapp/2023-11-01/volumes/model_volumepatchproperties.go new file mode 100644 index 00000000000..f2257b56671 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumepatchproperties.go @@ -0,0 +1,22 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchProperties struct { + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolAccessRetrievalPolicy *CoolAccessRetrievalPolicy `json:"coolAccessRetrievalPolicy,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + DataProtection *VolumePatchPropertiesDataProtection `json:"dataProtection,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + ExportPolicy *VolumePatchPropertiesExportPolicy `json:"exportPolicy,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbAccessBasedEnumeration *SmbAccessBasedEnumeration `json:"smbAccessBasedEnumeration,omitempty"` + SmbNonBrowsable *SmbNonBrowsable `json:"smbNonBrowsable,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold *int64 `json:"usageThreshold,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesdataprotection.go b/resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesdataprotection.go new file mode 100644 index 00000000000..8c9edc10ff7 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesdataprotection.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchPropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesexportpolicy.go b/resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesexportpolicy.go new file mode 100644 index 00000000000..ae83a5fc1b4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumepatchpropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePatchPropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumeproperties.go b/resource-manager/netapp/2023-11-01/volumes/model_volumeproperties.go new file mode 100644 index 00000000000..758b5a9160f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumeproperties.go @@ -0,0 +1,61 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeProperties struct { + ActualThroughputMibps *float64 `json:"actualThroughputMibps,omitempty"` + AvsDataStore *AvsDataStore `json:"avsDataStore,omitempty"` + BackupId *string `json:"backupId,omitempty"` + BaremetalTenantId *string `json:"baremetalTenantId,omitempty"` + CapacityPoolResourceId *string `json:"capacityPoolResourceId,omitempty"` + CloneProgress *int64 `json:"cloneProgress,omitempty"` + CoolAccess *bool `json:"coolAccess,omitempty"` + CoolAccessRetrievalPolicy *CoolAccessRetrievalPolicy `json:"coolAccessRetrievalPolicy,omitempty"` + CoolnessPeriod *int64 `json:"coolnessPeriod,omitempty"` + CreationToken string `json:"creationToken"` + DataProtection *VolumePropertiesDataProtection `json:"dataProtection,omitempty"` + DataStoreResourceId *[]string `json:"dataStoreResourceId,omitempty"` + DefaultGroupQuotaInKiBs *int64 `json:"defaultGroupQuotaInKiBs,omitempty"` + DefaultUserQuotaInKiBs *int64 `json:"defaultUserQuotaInKiBs,omitempty"` + DeleteBaseSnapshot *bool `json:"deleteBaseSnapshot,omitempty"` + EnableSubvolumes *EnableSubvolumes `json:"enableSubvolumes,omitempty"` + Encrypted *bool `json:"encrypted,omitempty"` + EncryptionKeySource *EncryptionKeySource `json:"encryptionKeySource,omitempty"` + ExportPolicy *VolumePropertiesExportPolicy `json:"exportPolicy,omitempty"` + FileAccessLogs *FileAccessLogs `json:"fileAccessLogs,omitempty"` + FileSystemId *string `json:"fileSystemId,omitempty"` + IsDefaultQuotaEnabled *bool `json:"isDefaultQuotaEnabled,omitempty"` + IsLargeVolume *bool `json:"isLargeVolume,omitempty"` + IsRestoring *bool `json:"isRestoring,omitempty"` + KerberosEnabled *bool `json:"kerberosEnabled,omitempty"` + KeyVaultPrivateEndpointResourceId *string `json:"keyVaultPrivateEndpointResourceId,omitempty"` + LdapEnabled *bool `json:"ldapEnabled,omitempty"` + MaximumNumberOfFiles *int64 `json:"maximumNumberOfFiles,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` + NetworkFeatures *NetworkFeatures `json:"networkFeatures,omitempty"` + NetworkSiblingSetId *string `json:"networkSiblingSetId,omitempty"` + OriginatingResourceId *string `json:"originatingResourceId,omitempty"` + PlacementRules *[]PlacementKeyValuePairs `json:"placementRules,omitempty"` + ProtocolTypes *[]string `json:"protocolTypes,omitempty"` + ProvisionedAvailabilityZone *string `json:"provisionedAvailabilityZone,omitempty"` + ProvisioningState *string `json:"provisioningState,omitempty"` + ProximityPlacementGroup *string `json:"proximityPlacementGroup,omitempty"` + SecurityStyle *SecurityStyle `json:"securityStyle,omitempty"` + ServiceLevel *ServiceLevel `json:"serviceLevel,omitempty"` + SmbAccessBasedEnumeration *SmbAccessBasedEnumeration `json:"smbAccessBasedEnumeration,omitempty"` + SmbContinuouslyAvailable *bool `json:"smbContinuouslyAvailable,omitempty"` + SmbEncryption *bool `json:"smbEncryption,omitempty"` + SmbNonBrowsable *SmbNonBrowsable `json:"smbNonBrowsable,omitempty"` + SnapshotDirectoryVisible *bool `json:"snapshotDirectoryVisible,omitempty"` + SnapshotId *string `json:"snapshotId,omitempty"` + StorageToNetworkProximity *VolumeStorageToNetworkProximity `json:"storageToNetworkProximity,omitempty"` + SubnetId string `json:"subnetId"` + T2Network *string `json:"t2Network,omitempty"` + ThroughputMibps *float64 `json:"throughputMibps,omitempty"` + UnixPermissions *string `json:"unixPermissions,omitempty"` + UsageThreshold int64 `json:"usageThreshold"` + VolumeGroupName *string `json:"volumeGroupName,omitempty"` + VolumeSpecName *string `json:"volumeSpecName,omitempty"` + VolumeType *string `json:"volumeType,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesdataprotection.go b/resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesdataprotection.go new file mode 100644 index 00000000000..fcf952952d2 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesdataprotection.go @@ -0,0 +1,11 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesDataProtection struct { + Backup *VolumeBackupProperties `json:"backup,omitempty"` + Replication *ReplicationObject `json:"replication,omitempty"` + Snapshot *VolumeSnapshotProperties `json:"snapshot,omitempty"` + VolumeRelocation *VolumeRelocationProperties `json:"volumeRelocation,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesexportpolicy.go b/resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesexportpolicy.go new file mode 100644 index 00000000000..fda5f4739de --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumepropertiesexportpolicy.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumePropertiesExportPolicy struct { + Rules *[]ExportPolicyRule `json:"rules,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumerelocationproperties.go b/resource-manager/netapp/2023-11-01/volumes/model_volumerelocationproperties.go new file mode 100644 index 00000000000..23274832779 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumerelocationproperties.go @@ -0,0 +1,9 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeRelocationProperties struct { + ReadyToBeFinalized *bool `json:"readyToBeFinalized,omitempty"` + RelocationRequested *bool `json:"relocationRequested,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/model_volumesnapshotproperties.go b/resource-manager/netapp/2023-11-01/volumes/model_volumesnapshotproperties.go new file mode 100644 index 00000000000..48aba2acce0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/model_volumesnapshotproperties.go @@ -0,0 +1,8 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeSnapshotProperties struct { + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumes/predicates.go b/resource-manager/netapp/2023-11-01/volumes/predicates.go new file mode 100644 index 00000000000..fcc54ae5e26 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/predicates.go @@ -0,0 +1,37 @@ +package volumes + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeOperationPredicate struct { + Etag *string + Id *string + Location *string + Name *string + Type *string +} + +func (p VolumeOperationPredicate) Matches(input Volume) 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 +} diff --git a/resource-manager/netapp/2023-11-01/volumes/version.go b/resource-manager/netapp/2023-11-01/volumes/version.go new file mode 100644 index 00000000000..3583fe71b16 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumes/version.go @@ -0,0 +1,12 @@ +package volumes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumes/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/README.md b/resource-manager/netapp/2023-11-01/volumesrelocation/README.md new file mode 100644 index 00000000000..273bc512b69 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/README.md @@ -0,0 +1,61 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumesrelocation` Documentation + +The `volumesrelocation` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/volumesrelocation" +``` + + +### Client Initialization + +```go +client := volumesrelocation.NewVolumesRelocationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesRelocationClient.VolumesFinalizeRelocation` + +```go +ctx := context.TODO() +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.VolumesFinalizeRelocationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesRelocationClient.VolumesRelocate` + +```go +ctx := context.TODO() +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumesrelocation.RelocateVolumeRequest{ + // ... +} + + +if err := client.VolumesRelocateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesRelocationClient.VolumesRevertRelocation` + +```go +ctx := context.TODO() +id := volumesrelocation.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.VolumesRevertRelocationThenPoll(ctx, id); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/client.go b/resource-manager/netapp/2023-11-01/volumesrelocation/client.go new file mode 100644 index 00000000000..9170c859f6f --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/client.go @@ -0,0 +1,26 @@ +package volumesrelocation + +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 VolumesRelocationClient struct { + Client *resourcemanager.Client +} + +func NewVolumesRelocationClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumesRelocationClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "volumesrelocation", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VolumesRelocationClient: %+v", err) + } + + return &VolumesRelocationClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go new file mode 100644 index 00000000000..b304817c7c8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume.go @@ -0,0 +1,148 @@ +package volumesrelocation + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go new file mode 100644 index 00000000000..6a196ac2224 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/id_volume_test.go @@ -0,0 +1,372 @@ +package volumesrelocation + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/volumesrelocation/method_volumesfinalizerelocation.go b/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesfinalizerelocation.go new file mode 100644 index 00000000000..8bc1cc1b39a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesfinalizerelocation.go @@ -0,0 +1,70 @@ +package volumesrelocation + +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 VolumesFinalizeRelocationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesFinalizeRelocation ... +func (c VolumesRelocationClient) VolumesFinalizeRelocation(ctx context.Context, id VolumeId) (result VolumesFinalizeRelocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/finalizeRelocation", 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 +} + +// VolumesFinalizeRelocationThenPoll performs VolumesFinalizeRelocation then polls until it's completed +func (c VolumesRelocationClient) VolumesFinalizeRelocationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesFinalizeRelocation(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesFinalizeRelocation: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesFinalizeRelocation: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrelocate.go b/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrelocate.go new file mode 100644 index 00000000000..1207d489ed4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrelocate.go @@ -0,0 +1,74 @@ +package volumesrelocation + +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 VolumesRelocateOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesRelocate ... +func (c VolumesRelocationClient) VolumesRelocate(ctx context.Context, id VolumeId, input RelocateVolumeRequest) (result VolumesRelocateOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/relocate", 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 +} + +// VolumesRelocateThenPoll performs VolumesRelocate then polls until it's completed +func (c VolumesRelocationClient) VolumesRelocateThenPoll(ctx context.Context, id VolumeId, input RelocateVolumeRequest) error { + result, err := c.VolumesRelocate(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesRelocate: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesRelocate: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrevertrelocation.go b/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrevertrelocation.go new file mode 100644 index 00000000000..0091b1304fd --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/method_volumesrevertrelocation.go @@ -0,0 +1,70 @@ +package volumesrelocation + +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 VolumesRevertRelocationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesRevertRelocation ... +func (c VolumesRelocationClient) VolumesRevertRelocation(ctx context.Context, id VolumeId) (result VolumesRevertRelocationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/revertRelocation", 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 +} + +// VolumesRevertRelocationThenPoll performs VolumesRevertRelocation then polls until it's completed +func (c VolumesRelocationClient) VolumesRevertRelocationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesRevertRelocation(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesRevertRelocation: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesRevertRelocation: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/model_relocatevolumerequest.go b/resource-manager/netapp/2023-11-01/volumesrelocation/model_relocatevolumerequest.go new file mode 100644 index 00000000000..25cb3a56801 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/model_relocatevolumerequest.go @@ -0,0 +1,8 @@ +package volumesrelocation + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type RelocateVolumeRequest struct { + CreationToken *string `json:"creationToken,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesrelocation/version.go b/resource-manager/netapp/2023-11-01/volumesrelocation/version.go new file mode 100644 index 00000000000..e84ee4ecbb9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrelocation/version.go @@ -0,0 +1,12 @@ +package volumesrelocation + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumesrelocation/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/README.md b/resource-manager/netapp/2023-11-01/volumesreplication/README.md new file mode 100644 index 00000000000..a2e754a7aca --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/README.md @@ -0,0 +1,139 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumesreplication` Documentation + +The `volumesreplication` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/volumesreplication" +``` + + +### Client Initialization + +```go +client := volumesreplication.NewVolumesReplicationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesReplicationClient.VolumesAuthorizeReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumesreplication.AuthorizeRequest{ + // ... +} + + +if err := client.VolumesAuthorizeReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesBreakReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumesreplication.BreakReplicationRequest{ + // ... +} + + +if err := client.VolumesBreakReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesDeleteReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.VolumesDeleteReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesListReplications` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +read, err := client.VolumesListReplications(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReInitializeReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.VolumesReInitializeReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReestablishReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumesreplication.ReestablishReplicationRequest{ + // ... +} + + +if err := client.VolumesReestablishReplicationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesReplicationStatus` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +read, err := client.VolumesReplicationStatus(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VolumesReplicationClient.VolumesResyncReplication` + +```go +ctx := context.TODO() +id := volumesreplication.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +if err := client.VolumesResyncReplicationThenPoll(ctx, id); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/client.go b/resource-manager/netapp/2023-11-01/volumesreplication/client.go new file mode 100644 index 00000000000..278506e484e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/client.go @@ -0,0 +1,26 @@ +package volumesreplication + +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 VolumesReplicationClient struct { + Client *resourcemanager.Client +} + +func NewVolumesReplicationClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumesReplicationClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "volumesreplication", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VolumesReplicationClient: %+v", err) + } + + return &VolumesReplicationClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/constants.go b/resource-manager/netapp/2023-11-01/volumesreplication/constants.go new file mode 100644 index 00000000000..2e5196391b7 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/constants.go @@ -0,0 +1,180 @@ +package volumesreplication + +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 EndpointType string + +const ( + EndpointTypeDst EndpointType = "dst" + EndpointTypeSrc EndpointType = "src" +) + +func PossibleValuesForEndpointType() []string { + return []string{ + string(EndpointTypeDst), + string(EndpointTypeSrc), + } +} + +func (s *EndpointType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEndpointType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEndpointType(input string) (*EndpointType, error) { + vals := map[string]EndpointType{ + "dst": EndpointTypeDst, + "src": EndpointTypeSrc, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EndpointType(input) + return &out, nil +} + +type MirrorState string + +const ( + MirrorStateBroken MirrorState = "Broken" + MirrorStateMirrored MirrorState = "Mirrored" + MirrorStateUninitialized MirrorState = "Uninitialized" +) + +func PossibleValuesForMirrorState() []string { + return []string{ + string(MirrorStateBroken), + string(MirrorStateMirrored), + string(MirrorStateUninitialized), + } +} + +func (s *MirrorState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseMirrorState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseMirrorState(input string) (*MirrorState, error) { + vals := map[string]MirrorState{ + "broken": MirrorStateBroken, + "mirrored": MirrorStateMirrored, + "uninitialized": MirrorStateUninitialized, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := MirrorState(input) + return &out, nil +} + +type RelationshipStatus string + +const ( + RelationshipStatusIdle RelationshipStatus = "Idle" + RelationshipStatusTransferring RelationshipStatus = "Transferring" +) + +func PossibleValuesForRelationshipStatus() []string { + return []string{ + string(RelationshipStatusIdle), + string(RelationshipStatusTransferring), + } +} + +func (s *RelationshipStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRelationshipStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRelationshipStatus(input string) (*RelationshipStatus, error) { + vals := map[string]RelationshipStatus{ + "idle": RelationshipStatusIdle, + "transferring": RelationshipStatusTransferring, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RelationshipStatus(input) + return &out, nil +} + +type ReplicationSchedule string + +const ( + ReplicationScheduleDaily ReplicationSchedule = "daily" + ReplicationScheduleHourly ReplicationSchedule = "hourly" + ReplicationScheduleOneZerominutely ReplicationSchedule = "_10minutely" +) + +func PossibleValuesForReplicationSchedule() []string { + return []string{ + string(ReplicationScheduleDaily), + string(ReplicationScheduleHourly), + string(ReplicationScheduleOneZerominutely), + } +} + +func (s *ReplicationSchedule) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseReplicationSchedule(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseReplicationSchedule(input string) (*ReplicationSchedule, error) { + vals := map[string]ReplicationSchedule{ + "daily": ReplicationScheduleDaily, + "hourly": ReplicationScheduleHourly, + "_10minutely": ReplicationScheduleOneZerominutely, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ReplicationSchedule(input) + return &out, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go new file mode 100644 index 00000000000..0a7eb12df02 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume.go @@ -0,0 +1,148 @@ +package volumesreplication + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go new file mode 100644 index 00000000000..8df5b274723 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/id_volume_test.go @@ -0,0 +1,372 @@ +package volumesreplication + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/volumesreplication/method_volumesauthorizereplication.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesauthorizereplication.go new file mode 100644 index 00000000000..591d7c626ab --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesauthorizereplication.go @@ -0,0 +1,74 @@ +package volumesreplication + +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 VolumesAuthorizeReplicationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesAuthorizeReplication ... +func (c VolumesReplicationClient) VolumesAuthorizeReplication(ctx context.Context, id VolumeId, input AuthorizeRequest) (result VolumesAuthorizeReplicationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/authorizeReplication", 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 +} + +// VolumesAuthorizeReplicationThenPoll performs VolumesAuthorizeReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesAuthorizeReplicationThenPoll(ctx context.Context, id VolumeId, input AuthorizeRequest) error { + result, err := c.VolumesAuthorizeReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesAuthorizeReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesAuthorizeReplication: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesbreakreplication.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesbreakreplication.go new file mode 100644 index 00000000000..280008e8175 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesbreakreplication.go @@ -0,0 +1,74 @@ +package volumesreplication + +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 VolumesBreakReplicationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesBreakReplication ... +func (c VolumesReplicationClient) VolumesBreakReplication(ctx context.Context, id VolumeId, input BreakReplicationRequest) (result VolumesBreakReplicationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/breakReplication", 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 +} + +// VolumesBreakReplicationThenPoll performs VolumesBreakReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesBreakReplicationThenPoll(ctx context.Context, id VolumeId, input BreakReplicationRequest) error { + result, err := c.VolumesBreakReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesBreakReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesBreakReplication: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesdeletereplication.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesdeletereplication.go new file mode 100644 index 00000000000..cda9737c512 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesdeletereplication.go @@ -0,0 +1,70 @@ +package volumesreplication + +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 VolumesDeleteReplicationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesDeleteReplication ... +func (c VolumesReplicationClient) VolumesDeleteReplication(ctx context.Context, id VolumeId) (result VolumesDeleteReplicationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/deleteReplication", 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 +} + +// VolumesDeleteReplicationThenPoll performs VolumesDeleteReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesDeleteReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesDeleteReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesDeleteReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesDeleteReplication: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumeslistreplications.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumeslistreplications.go new file mode 100644 index 00000000000..5a7f27f7407 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumeslistreplications.go @@ -0,0 +1,55 @@ +package volumesreplication + +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 VolumesListReplicationsOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ListReplications +} + +// VolumesListReplications ... +func (c VolumesReplicationClient) VolumesListReplications(ctx context.Context, id VolumeId) (result VolumesListReplicationsOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/listReplications", 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 ListReplications + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreestablishreplication.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreestablishreplication.go new file mode 100644 index 00000000000..047fc04a7f9 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreestablishreplication.go @@ -0,0 +1,73 @@ +package volumesreplication + +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 VolumesReestablishReplicationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesReestablishReplication ... +func (c VolumesReplicationClient) VolumesReestablishReplication(ctx context.Context, id VolumeId, input ReestablishReplicationRequest) (result VolumesReestablishReplicationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/reestablishReplication", 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 +} + +// VolumesReestablishReplicationThenPoll performs VolumesReestablishReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesReestablishReplicationThenPoll(ctx context.Context, id VolumeId, input ReestablishReplicationRequest) error { + result, err := c.VolumesReestablishReplication(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesReestablishReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesReestablishReplication: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreinitializereplication.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreinitializereplication.go new file mode 100644 index 00000000000..3f479bf637a --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreinitializereplication.go @@ -0,0 +1,70 @@ +package volumesreplication + +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 VolumesReInitializeReplicationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesReInitializeReplication ... +func (c VolumesReplicationClient) VolumesReInitializeReplication(ctx context.Context, id VolumeId) (result VolumesReInitializeReplicationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/reinitializeReplication", 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 +} + +// VolumesReInitializeReplicationThenPoll performs VolumesReInitializeReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesReInitializeReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesReInitializeReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesReInitializeReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesReInitializeReplication: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreplicationstatus.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreplicationstatus.go new file mode 100644 index 00000000000..6e7f09b9dbe --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesreplicationstatus.go @@ -0,0 +1,55 @@ +package volumesreplication + +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 VolumesReplicationStatusOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *ReplicationStatus +} + +// VolumesReplicationStatus ... +func (c VolumesReplicationClient) VolumesReplicationStatus(ctx context.Context, id VolumeId) (result VolumesReplicationStatusOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/replicationStatus", 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 ReplicationStatus + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesresyncreplication.go b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesresyncreplication.go new file mode 100644 index 00000000000..23e1a66f518 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/method_volumesresyncreplication.go @@ -0,0 +1,70 @@ +package volumesreplication + +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 VolumesResyncReplicationOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesResyncReplication ... +func (c VolumesReplicationClient) VolumesResyncReplication(ctx context.Context, id VolumeId) (result VolumesResyncReplicationOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/resyncReplication", 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 +} + +// VolumesResyncReplicationThenPoll performs VolumesResyncReplication then polls until it's completed +func (c VolumesReplicationClient) VolumesResyncReplicationThenPoll(ctx context.Context, id VolumeId) error { + result, err := c.VolumesResyncReplication(ctx, id) + if err != nil { + return fmt.Errorf("performing VolumesResyncReplication: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesResyncReplication: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/model_authorizerequest.go b/resource-manager/netapp/2023-11-01/volumesreplication/model_authorizerequest.go new file mode 100644 index 00000000000..ff1cefa31ef --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/model_authorizerequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AuthorizeRequest struct { + RemoteVolumeResourceId *string `json:"remoteVolumeResourceId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/model_breakreplicationrequest.go b/resource-manager/netapp/2023-11-01/volumesreplication/model_breakreplicationrequest.go new file mode 100644 index 00000000000..b6a0a179a9c --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/model_breakreplicationrequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BreakReplicationRequest struct { + ForceBreakReplication *bool `json:"forceBreakReplication,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/model_listreplications.go b/resource-manager/netapp/2023-11-01/volumesreplication/model_listreplications.go new file mode 100644 index 00000000000..7929ea4ace4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/model_listreplications.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ListReplications struct { + Value *[]Replication `json:"value,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/model_reestablishreplicationrequest.go b/resource-manager/netapp/2023-11-01/volumesreplication/model_reestablishreplicationrequest.go new file mode 100644 index 00000000000..193b71f1490 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/model_reestablishreplicationrequest.go @@ -0,0 +1,8 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReestablishReplicationRequest struct { + SourceVolumeId *string `json:"sourceVolumeId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/model_replication.go b/resource-manager/netapp/2023-11-01/volumesreplication/model_replication.go new file mode 100644 index 00000000000..06e345fdb5e --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/model_replication.go @@ -0,0 +1,11 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type Replication struct { + EndpointType *EndpointType `json:"endpointType,omitempty"` + RemoteVolumeRegion *string `json:"remoteVolumeRegion,omitempty"` + RemoteVolumeResourceId string `json:"remoteVolumeResourceId"` + ReplicationSchedule *ReplicationSchedule `json:"replicationSchedule,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/model_replicationstatus.go b/resource-manager/netapp/2023-11-01/volumesreplication/model_replicationstatus.go new file mode 100644 index 00000000000..2a79dddf7a4 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/model_replicationstatus.go @@ -0,0 +1,12 @@ +package volumesreplication + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ReplicationStatus struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + Healthy *bool `json:"healthy,omitempty"` + MirrorState *MirrorState `json:"mirrorState,omitempty"` + RelationshipStatus *RelationshipStatus `json:"relationshipStatus,omitempty"` + TotalProgress *string `json:"totalProgress,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesreplication/version.go b/resource-manager/netapp/2023-11-01/volumesreplication/version.go new file mode 100644 index 00000000000..a9e89056628 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesreplication/version.go @@ -0,0 +1,12 @@ +package volumesreplication + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumesreplication/%s", defaultApiVersion) +} diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/README.md b/resource-manager/netapp/2023-11-01/volumesrevert/README.md new file mode 100644 index 00000000000..4b6d436978d --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/netapp/2023-11-01/volumesrevert` Documentation + +The `volumesrevert` SDK allows for interaction with the Azure Resource Manager Service `netapp` (API Version `2023-11-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/netapp/2023-11-01/volumesrevert" +``` + + +### Client Initialization + +```go +client := volumesrevert.NewVolumesRevertClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VolumesRevertClient.VolumesRevert` + +```go +ctx := context.TODO() +id := volumesrevert.NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + +payload := volumesrevert.VolumeRevert{ + // ... +} + + +if err := client.VolumesRevertThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/client.go b/resource-manager/netapp/2023-11-01/volumesrevert/client.go new file mode 100644 index 00000000000..fa2bad78d7b --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/client.go @@ -0,0 +1,26 @@ +package volumesrevert + +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 VolumesRevertClient struct { + Client *resourcemanager.Client +} + +func NewVolumesRevertClientWithBaseURI(sdkApi sdkEnv.Api) (*VolumesRevertClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "volumesrevert", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating VolumesRevertClient: %+v", err) + } + + return &VolumesRevertClient{ + Client: client, + }, nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go new file mode 100644 index 00000000000..3b9e67d66c0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume.go @@ -0,0 +1,148 @@ +package volumesrevert + +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(&VolumeId{}) +} + +var _ resourceids.ResourceId = &VolumeId{} + +// VolumeId is a struct representing the Resource ID for a Volume +type VolumeId struct { + SubscriptionId string + ResourceGroupName string + NetAppAccountName string + CapacityPoolName string + VolumeName string +} + +// NewVolumeID returns a new VolumeId struct +func NewVolumeID(subscriptionId string, resourceGroupName string, netAppAccountName string, capacityPoolName string, volumeName string) VolumeId { + return VolumeId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + NetAppAccountName: netAppAccountName, + CapacityPoolName: capacityPoolName, + VolumeName: volumeName, + } +} + +// ParseVolumeID parses 'input' into a VolumeId +func ParseVolumeID(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseVolumeIDInsensitively parses 'input' case-insensitively into a VolumeId +// note: this method should only be used for API response data and not user input +func ParseVolumeIDInsensitively(input string) (*VolumeId, error) { + parser := resourceids.NewParserFromResourceIdType(&VolumeId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := VolumeId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *VolumeId) 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.NetAppAccountName, ok = input.Parsed["netAppAccountName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "netAppAccountName", input) + } + + if id.CapacityPoolName, ok = input.Parsed["capacityPoolName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "capacityPoolName", input) + } + + if id.VolumeName, ok = input.Parsed["volumeName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "volumeName", input) + } + + return nil +} + +// ValidateVolumeID checks that 'input' can be parsed as a Volume ID +func ValidateVolumeID(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 := ParseVolumeID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Volume ID +func (id VolumeId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.NetApp/netAppAccounts/%s/capacityPools/%s/volumes/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetAppAccountName, id.CapacityPoolName, id.VolumeName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Volume ID +func (id VolumeId) 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("staticMicrosoftNetApp", "Microsoft.NetApp", "Microsoft.NetApp"), + resourceids.StaticSegment("staticNetAppAccounts", "netAppAccounts", "netAppAccounts"), + resourceids.UserSpecifiedSegment("netAppAccountName", "netAppAccountValue"), + resourceids.StaticSegment("staticCapacityPools", "capacityPools", "capacityPools"), + resourceids.UserSpecifiedSegment("capacityPoolName", "capacityPoolValue"), + resourceids.StaticSegment("staticVolumes", "volumes", "volumes"), + resourceids.UserSpecifiedSegment("volumeName", "volumeValue"), + } +} + +// String returns a human-readable description of this Volume ID +func (id VolumeId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Net App Account Name: %q", id.NetAppAccountName), + fmt.Sprintf("Capacity Pool Name: %q", id.CapacityPoolName), + fmt.Sprintf("Volume Name: %q", id.VolumeName), + } + return fmt.Sprintf("Volume (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go new file mode 100644 index 00000000000..14c1c8d12f0 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/id_volume_test.go @@ -0,0 +1,372 @@ +package volumesrevert + +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 = &VolumeId{} + +func TestNewVolumeID(t *testing.T) { + id := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue") + + 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.NetAppAccountName != "netAppAccountValue" { + t.Fatalf("Expected %q but got %q for Segment 'NetAppAccountName'", id.NetAppAccountName, "netAppAccountValue") + } + + if id.CapacityPoolName != "capacityPoolValue" { + t.Fatalf("Expected %q but got %q for Segment 'CapacityPoolName'", id.CapacityPoolName, "capacityPoolValue") + } + + if id.VolumeName != "volumeValue" { + t.Fatalf("Expected %q but got %q for Segment 'VolumeName'", id.VolumeName, "volumeValue") + } +} + +func TestFormatVolumeID(t *testing.T) { + actual := NewVolumeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "netAppAccountValue", "capacityPoolValue", "volumeValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseVolumeID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeID(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestParseVolumeIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *VolumeId + }{ + { + // 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.NetApp", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + NetAppAccountName: "netAppAccountValue", + CapacityPoolName: "capacityPoolValue", + VolumeName: "volumeValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.NetApp/netAppAccounts/netAppAccountValue/capacityPools/capacityPoolValue/volumes/volumeValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe", + Expected: &VolumeId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + NetAppAccountName: "nEtApPaCcOuNtVaLuE", + CapacityPoolName: "cApAcItYpOoLvAlUe", + VolumeName: "vOlUmEvAlUe", + }, + }, + { + // 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.nEtApP/nEtApPaCcOuNtS/nEtApPaCcOuNtVaLuE/cApAcItYpOoLs/cApAcItYpOoLvAlUe/vOlUmEs/vOlUmEvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseVolumeIDInsensitively(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.NetAppAccountName != v.Expected.NetAppAccountName { + t.Fatalf("Expected %q but got %q for NetAppAccountName", v.Expected.NetAppAccountName, actual.NetAppAccountName) + } + + if actual.CapacityPoolName != v.Expected.CapacityPoolName { + t.Fatalf("Expected %q but got %q for CapacityPoolName", v.Expected.CapacityPoolName, actual.CapacityPoolName) + } + + if actual.VolumeName != v.Expected.VolumeName { + t.Fatalf("Expected %q but got %q for VolumeName", v.Expected.VolumeName, actual.VolumeName) + } + + } +} + +func TestSegmentsForVolumeId(t *testing.T) { + segments := VolumeId{}.Segments() + if len(segments) == 0 { + t.Fatalf("VolumeId 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/netapp/2023-11-01/volumesrevert/method_volumesrevert.go b/resource-manager/netapp/2023-11-01/volumesrevert/method_volumesrevert.go new file mode 100644 index 00000000000..0be129fdd47 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/method_volumesrevert.go @@ -0,0 +1,74 @@ +package volumesrevert + +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 VolumesRevertOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VolumesRevert ... +func (c VolumesRevertClient) VolumesRevert(ctx context.Context, id VolumeId, input VolumeRevert) (result VolumesRevertOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/revert", 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 +} + +// VolumesRevertThenPoll performs VolumesRevert then polls until it's completed +func (c VolumesRevertClient) VolumesRevertThenPoll(ctx context.Context, id VolumeId, input VolumeRevert) error { + result, err := c.VolumesRevert(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VolumesRevert: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VolumesRevert: %+v", err) + } + + return nil +} diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/model_volumerevert.go b/resource-manager/netapp/2023-11-01/volumesrevert/model_volumerevert.go new file mode 100644 index 00000000000..c5adf461cf8 --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/model_volumerevert.go @@ -0,0 +1,8 @@ +package volumesrevert + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VolumeRevert struct { + SnapshotId *string `json:"snapshotId,omitempty"` +} diff --git a/resource-manager/netapp/2023-11-01/volumesrevert/version.go b/resource-manager/netapp/2023-11-01/volumesrevert/version.go new file mode 100644 index 00000000000..d385e77c1ab --- /dev/null +++ b/resource-manager/netapp/2023-11-01/volumesrevert/version.go @@ -0,0 +1,12 @@ +package volumesrevert + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2023-11-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/volumesrevert/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/adminrulecollections/README.md b/resource-manager/network/2022-07-01/adminrulecollections/README.md new file mode 100644 index 00000000000..6dde6288cea --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrulecollections/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/adminrulecollections` Documentation + +The `adminrulecollections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/adminrulecollections" +``` + + +### Client Initialization + +```go +client := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AdminRuleCollectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") + +payload := adminrulecollections.AdminRuleCollection{ + // ... +} + + +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: `AdminRuleCollectionsClient.Delete` + +```go +ctx := context.TODO() +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") + +if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `AdminRuleCollectionsClient.Get` + +```go +ctx := context.TODO() +id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") + +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: `AdminRuleCollectionsClient.List` + +```go +ctx := context.TODO() +id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") + +// alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/adminrulecollections/client.go b/resource-manager/network/2022-07-01/adminrulecollections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/client.go rename to resource-manager/network/2022-07-01/adminrulecollections/client.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/constants.go b/resource-manager/network/2022-07-01/adminrulecollections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/constants.go rename to resource-manager/network/2022-07-01/adminrulecollections/constants.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/id_rulecollection.go b/resource-manager/network/2022-07-01/adminrulecollections/id_rulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/id_rulecollection.go rename to resource-manager/network/2022-07-01/adminrulecollections/id_rulecollection.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/id_rulecollection_test.go b/resource-manager/network/2022-07-01/adminrulecollections/id_rulecollection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/id_rulecollection_test.go rename to resource-manager/network/2022-07-01/adminrulecollections/id_rulecollection_test.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2022-07-01/adminrulecollections/id_securityadminconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/id_securityadminconfiguration.go rename to resource-manager/network/2022-07-01/adminrulecollections/id_securityadminconfiguration.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2022-07-01/adminrulecollections/id_securityadminconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/id_securityadminconfiguration_test.go rename to resource-manager/network/2022-07-01/adminrulecollections/id_securityadminconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/method_createorupdate.go b/resource-manager/network/2022-07-01/adminrulecollections/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/method_createorupdate.go rename to resource-manager/network/2022-07-01/adminrulecollections/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/method_delete.go b/resource-manager/network/2022-07-01/adminrulecollections/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/method_delete.go rename to resource-manager/network/2022-07-01/adminrulecollections/method_delete.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/method_get.go b/resource-manager/network/2022-07-01/adminrulecollections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/method_get.go rename to resource-manager/network/2022-07-01/adminrulecollections/method_get.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/method_list.go b/resource-manager/network/2022-07-01/adminrulecollections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/method_list.go rename to resource-manager/network/2022-07-01/adminrulecollections/method_list.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/model_adminrulecollection.go b/resource-manager/network/2022-07-01/adminrulecollections/model_adminrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/model_adminrulecollection.go rename to resource-manager/network/2022-07-01/adminrulecollections/model_adminrulecollection.go diff --git a/resource-manager/network/2022-07-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go b/resource-manager/network/2022-07-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go new file mode 100644 index 00000000000..864de2165bf --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go @@ -0,0 +1,10 @@ +package adminrulecollections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdminRuleCollectionPropertiesFormat struct { + AppliesToGroups []NetworkManagerSecurityGroupItem `json:"appliesToGroups"` + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/adminrulecollections/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2022-07-01/adminrulecollections/model_networkmanagersecuritygroupitem.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/model_networkmanagersecuritygroupitem.go rename to resource-manager/network/2022-07-01/adminrulecollections/model_networkmanagersecuritygroupitem.go diff --git a/resource-manager/network/2023-04-01/adminrulecollections/predicates.go b/resource-manager/network/2022-07-01/adminrulecollections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrulecollections/predicates.go rename to resource-manager/network/2022-07-01/adminrulecollections/predicates.go diff --git a/resource-manager/network/2022-07-01/adminrulecollections/version.go b/resource-manager/network/2022-07-01/adminrulecollections/version.go new file mode 100644 index 00000000000..0f0b6531920 --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrulecollections/version.go @@ -0,0 +1,12 @@ +package adminrulecollections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/adminrulecollections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/adminrules/README.md b/resource-manager/network/2022-07-01/adminrules/README.md new file mode 100644 index 00000000000..94ca871cecb --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrules/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/adminrules` Documentation + +The `adminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/adminrules" +``` + + +### Client Initialization + +```go +client := adminrules.NewAdminRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AdminRulesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") + +payload := adminrules.BaseAdminRule{ + // ... +} + + +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: `AdminRulesClient.Delete` + +```go +ctx := context.TODO() +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") + +if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `AdminRulesClient.Get` + +```go +ctx := context.TODO() +id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") + +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: `AdminRulesClient.List` + +```go +ctx := context.TODO() +id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") + +// 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/network/2023-04-01/adminrules/client.go b/resource-manager/network/2022-07-01/adminrules/client.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/client.go rename to resource-manager/network/2022-07-01/adminrules/client.go diff --git a/resource-manager/network/2023-04-01/adminrules/constants.go b/resource-manager/network/2022-07-01/adminrules/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/constants.go rename to resource-manager/network/2022-07-01/adminrules/constants.go diff --git a/resource-manager/network/2023-04-01/adminrules/id_rule.go b/resource-manager/network/2022-07-01/adminrules/id_rule.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/id_rule.go rename to resource-manager/network/2022-07-01/adminrules/id_rule.go diff --git a/resource-manager/network/2023-04-01/adminrules/id_rule_test.go b/resource-manager/network/2022-07-01/adminrules/id_rule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/id_rule_test.go rename to resource-manager/network/2022-07-01/adminrules/id_rule_test.go diff --git a/resource-manager/network/2023-04-01/adminrules/id_rulecollection.go b/resource-manager/network/2022-07-01/adminrules/id_rulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/id_rulecollection.go rename to resource-manager/network/2022-07-01/adminrules/id_rulecollection.go diff --git a/resource-manager/network/2023-04-01/adminrules/id_rulecollection_test.go b/resource-manager/network/2022-07-01/adminrules/id_rulecollection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/id_rulecollection_test.go rename to resource-manager/network/2022-07-01/adminrules/id_rulecollection_test.go diff --git a/resource-manager/network/2023-04-01/adminrules/method_createorupdate.go b/resource-manager/network/2022-07-01/adminrules/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/method_createorupdate.go rename to resource-manager/network/2022-07-01/adminrules/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/adminrules/method_delete.go b/resource-manager/network/2022-07-01/adminrules/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/method_delete.go rename to resource-manager/network/2022-07-01/adminrules/method_delete.go diff --git a/resource-manager/network/2023-04-01/adminrules/method_get.go b/resource-manager/network/2022-07-01/adminrules/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/method_get.go rename to resource-manager/network/2022-07-01/adminrules/method_get.go diff --git a/resource-manager/network/2023-04-01/adminrules/method_list.go b/resource-manager/network/2022-07-01/adminrules/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/method_list.go rename to resource-manager/network/2022-07-01/adminrules/method_list.go diff --git a/resource-manager/network/2023-04-01/adminrules/model_addressprefixitem.go b/resource-manager/network/2022-07-01/adminrules/model_addressprefixitem.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/model_addressprefixitem.go rename to resource-manager/network/2022-07-01/adminrules/model_addressprefixitem.go diff --git a/resource-manager/network/2022-07-01/adminrules/model_adminpropertiesformat.go b/resource-manager/network/2022-07-01/adminrules/model_adminpropertiesformat.go new file mode 100644 index 00000000000..94884de7b5a --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrules/model_adminpropertiesformat.go @@ -0,0 +1,17 @@ +package adminrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdminPropertiesFormat struct { + Access SecurityConfigurationRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + Direction SecurityConfigurationRuleDirection `json:"direction"` + Priority int64 `json:"priority"` + Protocol SecurityConfigurationRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + Sources *[]AddressPrefixItem `json:"sources,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/adminrules/model_adminrule.go b/resource-manager/network/2022-07-01/adminrules/model_adminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/model_adminrule.go rename to resource-manager/network/2022-07-01/adminrules/model_adminrule.go diff --git a/resource-manager/network/2023-04-01/adminrules/model_baseadminrule.go b/resource-manager/network/2022-07-01/adminrules/model_baseadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/model_baseadminrule.go rename to resource-manager/network/2022-07-01/adminrules/model_baseadminrule.go diff --git a/resource-manager/network/2022-07-01/adminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2022-07-01/adminrules/model_defaultadminpropertiesformat.go new file mode 100644 index 00000000000..e2236833f23 --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrules/model_defaultadminpropertiesformat.go @@ -0,0 +1,18 @@ +package adminrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DefaultAdminPropertiesFormat struct { + Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` + Description *string `json:"description,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` + Flag *string `json:"flag,omitempty"` + Priority *int64 `json:"priority,omitempty"` + Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + Sources *[]AddressPrefixItem `json:"sources,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/adminrules/model_defaultadminrule.go b/resource-manager/network/2022-07-01/adminrules/model_defaultadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/model_defaultadminrule.go rename to resource-manager/network/2022-07-01/adminrules/model_defaultadminrule.go diff --git a/resource-manager/network/2023-04-01/adminrules/predicates.go b/resource-manager/network/2022-07-01/adminrules/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/adminrules/predicates.go rename to resource-manager/network/2022-07-01/adminrules/predicates.go diff --git a/resource-manager/network/2022-07-01/adminrules/version.go b/resource-manager/network/2022-07-01/adminrules/version.go new file mode 100644 index 00000000000..359b0b4bbac --- /dev/null +++ b/resource-manager/network/2022-07-01/adminrules/version.go @@ -0,0 +1,12 @@ +package adminrules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/adminrules/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/README.md new file mode 100644 index 00000000000..02aa2db8215 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections` Documentation + +The `applicationgatewayprivateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/applicationgatewayprivateendpointconnections" +``` + + +### Client Initialization + +```go +client := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Get` + +```go +ctx := context.TODO() +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") + +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: `ApplicationGatewayPrivateEndpointConnectionsClient.List` + +```go +ctx := context.TODO() +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +// 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: `ApplicationGatewayPrivateEndpointConnectionsClient.Update` + +```go +ctx := context.TODO() +id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") + +payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ + // ... +} + + +if err := client.UpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/client.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/client.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/client.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/constants.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/constants.go new file mode 100644 index 00000000000..962f6cce88e --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/constants.go @@ -0,0 +1,1013 @@ +package applicationgatewayprivateendpointconnections + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_delete.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_delete.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_delete.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_get.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_get.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_list.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_list.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_update.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_update.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/method_update.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/method_update.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..3877d225eb8 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package applicationgatewayprivateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ddossettings.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ddossettings.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_delegation.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_delegation.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_delegation.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_flowlog.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_flowlog.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_iptag.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_iptag.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_iptag.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natgateway.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natgateway.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterface.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterface.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..e3f6c6dfd56 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package applicationgatewayprivateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..5c399fe2ef5 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package applicationgatewayprivateendpointconnections + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..fc9ec96f106 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package applicationgatewayprivateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_resourceset.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_resourceset.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_route.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_route.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_route.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_routetable.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_routetable.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_routetable.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_securityrule.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_securityrule.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..3ea546f130b --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package applicationgatewayprivateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subnet.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subnet.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subnet.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..37f741c39d1 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package applicationgatewayprivateendpointconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subresource.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subresource.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_subresource.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/predicates.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/predicates.go rename to resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/version.go b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/version.go new file mode 100644 index 00000000000..eac1468c326 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections/version.go @@ -0,0 +1,12 @@ +package applicationgatewayprivateendpointconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivateendpointconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/README.md b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/README.md new file mode 100644 index 00000000000..8ccce3fe97d --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources` Documentation + +The `applicationgatewayprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/applicationgatewayprivatelinkresources" +``` + + +### Client Initialization + +```go +client := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ApplicationGatewayPrivateLinkResourcesClient.List` + +```go +ctx := context.TODO() +id := applicationgatewayprivatelinkresources.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +// 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/network/2023-04-01/applicationgatewayprivatelinkresources/client.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/client.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/client.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/client.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/id_applicationgateway.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/id_applicationgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/id_applicationgateway.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/id_applicationgateway.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/method_list.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/method_list.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/method_list.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/predicates.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/predicates.go rename to resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/predicates.go diff --git a/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/version.go b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/version.go new file mode 100644 index 00000000000..29793a4e52f --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources/version.go @@ -0,0 +1,12 @@ +package applicationgatewayprivatelinkresources + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivatelinkresources/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/applicationgateways/README.md b/resource-manager/network/2022-07-01/applicationgateways/README.md new file mode 100644 index 00000000000..99f2f698292 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/README.md @@ -0,0 +1,287 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgateways` Documentation + +The `applicationgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/applicationgateways" +``` + + +### Client Initialization + +```go +client := applicationgateways.NewApplicationGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ApplicationGatewaysClient.BackendHealth` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +if err := client.BackendHealthThenPoll(ctx, id, applicationgateways.DefaultBackendHealthOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewaysClient.BackendHealthOnDemand` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +payload := applicationgateways.ApplicationGatewayOnDemandProbe{ + // ... +} + + +if err := client.BackendHealthOnDemandThenPoll(ctx, id, payload, applicationgateways.DefaultBackendHealthOnDemandOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewaysClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +payload := applicationgateways.ApplicationGateway{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewaysClient.Delete` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewaysClient.Get` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +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: `ApplicationGatewaysClient.GetSslPredefinedPolicy` + +```go +ctx := context.TODO() +id := applicationgateways.NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue") + +read, err := client.GetSslPredefinedPolicy(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewaysClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `ApplicationGatewaysClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ApplicationGatewaysClient.ListAvailableRequestHeaders` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListAvailableRequestHeaders(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewaysClient.ListAvailableResponseHeaders` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListAvailableResponseHeaders(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewaysClient.ListAvailableServerVariables` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListAvailableServerVariables(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewaysClient.ListAvailableSslOptions` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListAvailableSslOptions(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAvailableSslPredefinedPolicies(ctx, id)` can be used to do batched pagination +items, err := client.ListAvailableSslPredefinedPoliciesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ApplicationGatewaysClient.ListAvailableWafRuleSets` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListAvailableWafRuleSets(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewaysClient.Start` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +if err := client.StartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewaysClient.Stop` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +if err := client.StopThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") + +payload := applicationgateways.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/network/2023-04-01/applicationgateways/client.go b/resource-manager/network/2022-07-01/applicationgateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/client.go rename to resource-manager/network/2022-07-01/applicationgateways/client.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/constants.go b/resource-manager/network/2022-07-01/applicationgateways/constants.go new file mode 100644 index 00000000000..e6cef95825f --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/constants.go @@ -0,0 +1,1954 @@ +package applicationgateways + +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 ApplicationGatewayBackendHealthServerHealth string + +const ( + ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" + ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" + ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" + ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" + ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" +) + +func PossibleValuesForApplicationGatewayBackendHealthServerHealth() []string { + return []string{ + string(ApplicationGatewayBackendHealthServerHealthDown), + string(ApplicationGatewayBackendHealthServerHealthDraining), + string(ApplicationGatewayBackendHealthServerHealthPartial), + string(ApplicationGatewayBackendHealthServerHealthUnknown), + string(ApplicationGatewayBackendHealthServerHealthUp), + } +} + +func (s *ApplicationGatewayBackendHealthServerHealth) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayBackendHealthServerHealth(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayBackendHealthServerHealth(input string) (*ApplicationGatewayBackendHealthServerHealth, error) { + vals := map[string]ApplicationGatewayBackendHealthServerHealth{ + "down": ApplicationGatewayBackendHealthServerHealthDown, + "draining": ApplicationGatewayBackendHealthServerHealthDraining, + "partial": ApplicationGatewayBackendHealthServerHealthPartial, + "unknown": ApplicationGatewayBackendHealthServerHealthUnknown, + "up": ApplicationGatewayBackendHealthServerHealthUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayBackendHealthServerHealth(input) + return &out, nil +} + +type ApplicationGatewayClientRevocationOptions string + +const ( + ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" + ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" +) + +func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { + return []string{ + string(ApplicationGatewayClientRevocationOptionsNone), + string(ApplicationGatewayClientRevocationOptionsOCSP), + } +} + +func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayClientRevocationOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { + vals := map[string]ApplicationGatewayClientRevocationOptions{ + "none": ApplicationGatewayClientRevocationOptionsNone, + "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayClientRevocationOptions(input) + return &out, nil +} + +type ApplicationGatewayCookieBasedAffinity string + +const ( + ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" + ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" +) + +func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { + return []string{ + string(ApplicationGatewayCookieBasedAffinityDisabled), + string(ApplicationGatewayCookieBasedAffinityEnabled), + } +} + +func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayCookieBasedAffinity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { + vals := map[string]ApplicationGatewayCookieBasedAffinity{ + "disabled": ApplicationGatewayCookieBasedAffinityDisabled, + "enabled": ApplicationGatewayCookieBasedAffinityEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayCookieBasedAffinity(input) + return &out, nil +} + +type ApplicationGatewayCustomErrorStatusCode string + +const ( + ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" + ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" +) + +func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { + return []string{ + string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), + string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), + } +} + +func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { + vals := map[string]ApplicationGatewayCustomErrorStatusCode{ + "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, + "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayCustomErrorStatusCode(input) + return &out, nil +} + +type ApplicationGatewayFirewallMode string + +const ( + ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" + ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" +) + +func PossibleValuesForApplicationGatewayFirewallMode() []string { + return []string{ + string(ApplicationGatewayFirewallModeDetection), + string(ApplicationGatewayFirewallModePrevention), + } +} + +func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayFirewallMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { + vals := map[string]ApplicationGatewayFirewallMode{ + "detection": ApplicationGatewayFirewallModeDetection, + "prevention": ApplicationGatewayFirewallModePrevention, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayFirewallMode(input) + return &out, nil +} + +type ApplicationGatewayLoadDistributionAlgorithm string + +const ( + ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" + ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" +) + +func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { + return []string{ + string(ApplicationGatewayLoadDistributionAlgorithmIPHash), + string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), + string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), + } +} + +func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { + vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ + "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, + "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, + "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayLoadDistributionAlgorithm(input) + return &out, nil +} + +type ApplicationGatewayOperationalState string + +const ( + ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" + ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" + ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" + ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" +) + +func PossibleValuesForApplicationGatewayOperationalState() []string { + return []string{ + string(ApplicationGatewayOperationalStateRunning), + string(ApplicationGatewayOperationalStateStarting), + string(ApplicationGatewayOperationalStateStopped), + string(ApplicationGatewayOperationalStateStopping), + } +} + +func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayOperationalState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { + vals := map[string]ApplicationGatewayOperationalState{ + "running": ApplicationGatewayOperationalStateRunning, + "starting": ApplicationGatewayOperationalStateStarting, + "stopped": ApplicationGatewayOperationalStateStopped, + "stopping": ApplicationGatewayOperationalStateStopping, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayOperationalState(input) + return &out, nil +} + +type ApplicationGatewayProtocol string + +const ( + ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" + ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" + ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" + ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" +) + +func PossibleValuesForApplicationGatewayProtocol() []string { + return []string{ + string(ApplicationGatewayProtocolHTTP), + string(ApplicationGatewayProtocolHTTPS), + string(ApplicationGatewayProtocolTcp), + string(ApplicationGatewayProtocolTls), + } +} + +func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { + vals := map[string]ApplicationGatewayProtocol{ + "http": ApplicationGatewayProtocolHTTP, + "https": ApplicationGatewayProtocolHTTPS, + "tcp": ApplicationGatewayProtocolTcp, + "tls": ApplicationGatewayProtocolTls, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayProtocol(input) + return &out, nil +} + +type ApplicationGatewayRedirectType string + +const ( + ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" + ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" + ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" + ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" +) + +func PossibleValuesForApplicationGatewayRedirectType() []string { + return []string{ + string(ApplicationGatewayRedirectTypeFound), + string(ApplicationGatewayRedirectTypePermanent), + string(ApplicationGatewayRedirectTypeSeeOther), + string(ApplicationGatewayRedirectTypeTemporary), + } +} + +func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayRedirectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { + vals := map[string]ApplicationGatewayRedirectType{ + "found": ApplicationGatewayRedirectTypeFound, + "permanent": ApplicationGatewayRedirectTypePermanent, + "seeother": ApplicationGatewayRedirectTypeSeeOther, + "temporary": ApplicationGatewayRedirectTypeTemporary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayRedirectType(input) + return &out, nil +} + +type ApplicationGatewayRequestRoutingRuleType string + +const ( + ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" + ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" +) + +func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { + return []string{ + string(ApplicationGatewayRequestRoutingRuleTypeBasic), + string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), + } +} + +func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { + vals := map[string]ApplicationGatewayRequestRoutingRuleType{ + "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, + "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayRequestRoutingRuleType(input) + return &out, nil +} + +type ApplicationGatewaySkuName string + +const ( + ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" + ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" + ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" + ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" + ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" + ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" + ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" +) + +func PossibleValuesForApplicationGatewaySkuName() []string { + return []string{ + string(ApplicationGatewaySkuNameStandardLarge), + string(ApplicationGatewaySkuNameStandardMedium), + string(ApplicationGatewaySkuNameStandardSmall), + string(ApplicationGatewaySkuNameStandardVTwo), + string(ApplicationGatewaySkuNameWAFLarge), + string(ApplicationGatewaySkuNameWAFMedium), + string(ApplicationGatewaySkuNameWAFVTwo), + } +} + +func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { + vals := map[string]ApplicationGatewaySkuName{ + "standard_large": ApplicationGatewaySkuNameStandardLarge, + "standard_medium": ApplicationGatewaySkuNameStandardMedium, + "standard_small": ApplicationGatewaySkuNameStandardSmall, + "standard_v2": ApplicationGatewaySkuNameStandardVTwo, + "waf_large": ApplicationGatewaySkuNameWAFLarge, + "waf_medium": ApplicationGatewaySkuNameWAFMedium, + "waf_v2": ApplicationGatewaySkuNameWAFVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySkuName(input) + return &out, nil +} + +type ApplicationGatewaySslCipherSuite string + +const ( + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +) + +func PossibleValuesForApplicationGatewaySslCipherSuite() []string { + return []string{ + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), + } +} + +func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslCipherSuite(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { + vals := map[string]ApplicationGatewaySslCipherSuite{ + "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, + "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, + "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, + "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, + "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, + "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, + "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, + "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, + "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, + "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, + "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, + "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, + "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, + "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, + "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, + "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslCipherSuite(input) + return &out, nil +} + +type ApplicationGatewaySslPolicyName string + +const ( + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" +) + +func PossibleValuesForApplicationGatewaySslPolicyName() []string { + return []string{ + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), + } +} + +func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslPolicyName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { + vals := map[string]ApplicationGatewaySslPolicyName{ + "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, + "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, + "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, + "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, + "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslPolicyName(input) + return &out, nil +} + +type ApplicationGatewaySslPolicyType string + +const ( + ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" + ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" + ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" +) + +func PossibleValuesForApplicationGatewaySslPolicyType() []string { + return []string{ + string(ApplicationGatewaySslPolicyTypeCustom), + string(ApplicationGatewaySslPolicyTypeCustomVTwo), + string(ApplicationGatewaySslPolicyTypePredefined), + } +} + +func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslPolicyType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { + vals := map[string]ApplicationGatewaySslPolicyType{ + "custom": ApplicationGatewaySslPolicyTypeCustom, + "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, + "predefined": ApplicationGatewaySslPolicyTypePredefined, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslPolicyType(input) + return &out, nil +} + +type ApplicationGatewaySslProtocol string + +const ( + ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" + ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" + ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" + ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" +) + +func PossibleValuesForApplicationGatewaySslProtocol() []string { + return []string{ + string(ApplicationGatewaySslProtocolTLSvOneOne), + string(ApplicationGatewaySslProtocolTLSvOneThree), + string(ApplicationGatewaySslProtocolTLSvOneTwo), + string(ApplicationGatewaySslProtocolTLSvOneZero), + } +} + +func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { + vals := map[string]ApplicationGatewaySslProtocol{ + "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, + "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, + "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, + "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslProtocol(input) + return &out, nil +} + +type ApplicationGatewayTier string + +const ( + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" +) + +func PossibleValuesForApplicationGatewayTier() []string { + return []string{ + string(ApplicationGatewayTierStandard), + string(ApplicationGatewayTierStandardVTwo), + string(ApplicationGatewayTierWAF), + string(ApplicationGatewayTierWAFVTwo), + } +} + +func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { + vals := map[string]ApplicationGatewayTier{ + "standard": ApplicationGatewayTierStandard, + "standard_v2": ApplicationGatewayTierStandardVTwo, + "waf": ApplicationGatewayTierWAF, + "waf_v2": ApplicationGatewayTierWAFVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayTier(input) + return &out, nil +} + +type ApplicationGatewayTierTypes string + +const ( + ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" + ApplicationGatewayTierTypesStandardVTwo ApplicationGatewayTierTypes = "Standard_v2" + ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" + ApplicationGatewayTierTypesWAFVTwo ApplicationGatewayTierTypes = "WAF_v2" +) + +func PossibleValuesForApplicationGatewayTierTypes() []string { + return []string{ + string(ApplicationGatewayTierTypesStandard), + string(ApplicationGatewayTierTypesStandardVTwo), + string(ApplicationGatewayTierTypesWAF), + string(ApplicationGatewayTierTypesWAFVTwo), + } +} + +func (s *ApplicationGatewayTierTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayTierTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayTierTypes(input string) (*ApplicationGatewayTierTypes, error) { + vals := map[string]ApplicationGatewayTierTypes{ + "standard": ApplicationGatewayTierTypesStandard, + "standard_v2": ApplicationGatewayTierTypesStandardVTwo, + "waf": ApplicationGatewayTierTypesWAF, + "waf_v2": ApplicationGatewayTierTypesWAFVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayTierTypes(input) + return &out, nil +} + +type ApplicationGatewayWafRuleActionTypes string + +const ( + ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" + ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" + ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" + ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" + ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" +) + +func PossibleValuesForApplicationGatewayWafRuleActionTypes() []string { + return []string{ + string(ApplicationGatewayWafRuleActionTypesAllow), + string(ApplicationGatewayWafRuleActionTypesAnomalyScoring), + string(ApplicationGatewayWafRuleActionTypesBlock), + string(ApplicationGatewayWafRuleActionTypesLog), + string(ApplicationGatewayWafRuleActionTypesNone), + } +} + +func (s *ApplicationGatewayWafRuleActionTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayWafRuleActionTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayWafRuleActionTypes(input string) (*ApplicationGatewayWafRuleActionTypes, error) { + vals := map[string]ApplicationGatewayWafRuleActionTypes{ + "allow": ApplicationGatewayWafRuleActionTypesAllow, + "anomalyscoring": ApplicationGatewayWafRuleActionTypesAnomalyScoring, + "block": ApplicationGatewayWafRuleActionTypesBlock, + "log": ApplicationGatewayWafRuleActionTypesLog, + "none": ApplicationGatewayWafRuleActionTypesNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayWafRuleActionTypes(input) + return &out, nil +} + +type ApplicationGatewayWafRuleStateTypes string + +const ( + ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" + ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" +) + +func PossibleValuesForApplicationGatewayWafRuleStateTypes() []string { + return []string{ + string(ApplicationGatewayWafRuleStateTypesDisabled), + string(ApplicationGatewayWafRuleStateTypesEnabled), + } +} + +func (s *ApplicationGatewayWafRuleStateTypes) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayWafRuleStateTypes(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayWafRuleStateTypes(input string) (*ApplicationGatewayWafRuleStateTypes, error) { + vals := map[string]ApplicationGatewayWafRuleStateTypes{ + "disabled": ApplicationGatewayWafRuleStateTypesDisabled, + "enabled": ApplicationGatewayWafRuleStateTypesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayWafRuleStateTypes(input) + return &out, nil +} + +type DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/id_applicationgateway.go b/resource-manager/network/2022-07-01/applicationgateways/id_applicationgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/id_applicationgateway.go rename to resource-manager/network/2022-07-01/applicationgateways/id_applicationgateway.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/id_applicationgateway_test.go b/resource-manager/network/2022-07-01/applicationgateways/id_applicationgateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/id_applicationgateway_test.go rename to resource-manager/network/2022-07-01/applicationgateways/id_applicationgateway_test.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/id_predefinedpolicy.go b/resource-manager/network/2022-07-01/applicationgateways/id_predefinedpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/id_predefinedpolicy.go rename to resource-manager/network/2022-07-01/applicationgateways/id_predefinedpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/id_predefinedpolicy_test.go b/resource-manager/network/2022-07-01/applicationgateways/id_predefinedpolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/id_predefinedpolicy_test.go rename to resource-manager/network/2022-07-01/applicationgateways/id_predefinedpolicy_test.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_backendhealth.go b/resource-manager/network/2022-07-01/applicationgateways/method_backendhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_backendhealth.go rename to resource-manager/network/2022-07-01/applicationgateways/method_backendhealth.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_backendhealthondemand.go b/resource-manager/network/2022-07-01/applicationgateways/method_backendhealthondemand.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_backendhealthondemand.go rename to resource-manager/network/2022-07-01/applicationgateways/method_backendhealthondemand.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_createorupdate.go b/resource-manager/network/2022-07-01/applicationgateways/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_createorupdate.go rename to resource-manager/network/2022-07-01/applicationgateways/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_delete.go b/resource-manager/network/2022-07-01/applicationgateways/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_delete.go rename to resource-manager/network/2022-07-01/applicationgateways/method_delete.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_get.go b/resource-manager/network/2022-07-01/applicationgateways/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_get.go rename to resource-manager/network/2022-07-01/applicationgateways/method_get.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_getsslpredefinedpolicy.go b/resource-manager/network/2022-07-01/applicationgateways/method_getsslpredefinedpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_getsslpredefinedpolicy.go rename to resource-manager/network/2022-07-01/applicationgateways/method_getsslpredefinedpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_list.go b/resource-manager/network/2022-07-01/applicationgateways/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_list.go rename to resource-manager/network/2022-07-01/applicationgateways/method_list.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listall.go b/resource-manager/network/2022-07-01/applicationgateways/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listall.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listall.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listavailablerequestheaders.go b/resource-manager/network/2022-07-01/applicationgateways/method_listavailablerequestheaders.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listavailablerequestheaders.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listavailablerequestheaders.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listavailableresponseheaders.go b/resource-manager/network/2022-07-01/applicationgateways/method_listavailableresponseheaders.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listavailableresponseheaders.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listavailableresponseheaders.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listavailableservervariables.go b/resource-manager/network/2022-07-01/applicationgateways/method_listavailableservervariables.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listavailableservervariables.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listavailableservervariables.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listavailablessloptions.go b/resource-manager/network/2022-07-01/applicationgateways/method_listavailablessloptions.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listavailablessloptions.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listavailablessloptions.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listavailablesslpredefinedpolicies.go b/resource-manager/network/2022-07-01/applicationgateways/method_listavailablesslpredefinedpolicies.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listavailablesslpredefinedpolicies.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listavailablesslpredefinedpolicies.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_listavailablewafrulesets.go b/resource-manager/network/2022-07-01/applicationgateways/method_listavailablewafrulesets.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_listavailablewafrulesets.go rename to resource-manager/network/2022-07-01/applicationgateways/method_listavailablewafrulesets.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_start.go b/resource-manager/network/2022-07-01/applicationgateways/method_start.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_start.go rename to resource-manager/network/2022-07-01/applicationgateways/method_start.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_stop.go b/resource-manager/network/2022-07-01/applicationgateways/method_stop.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_stop.go rename to resource-manager/network/2022-07-01/applicationgateways/method_stop.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/method_updatetags.go b/resource-manager/network/2022-07-01/applicationgateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/method_updatetags.go rename to resource-manager/network/2022-07-01/applicationgateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgateway.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgateway.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgateway.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayavailablessloptions.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayavailablessloptions.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayavailablessloptions.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayavailablessloptions.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealth.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealth.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealth.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthpool.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthpool.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthpool.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthpool.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthserver.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthserver.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhealthserver.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhealthserver.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendsettings.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendsettings.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendsettings.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayconnectiondraining.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayconnectiondraining.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayconnectiondraining.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayconnectiondraining.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaycustomerror.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaycustomerror.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaycustomerror.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallexclusion.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallexclusion.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallexclusion.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallexclusion.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallrule.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallrule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallrule.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallruleset.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallruleset.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallruleset.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallruleset.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendport.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendport.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendport.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendport.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayglobalconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayglobalconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayglobalconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayglobalconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayheaderconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayheaderconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayheaderconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayheaderconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayhttplistener.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayhttplistener.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayhttplistener.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayhttplistener.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaylistener.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaylistener.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaylistener.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaylistener.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayondemandprobe.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayondemandprobe.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayondemandprobe.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayondemandprobe.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypathrule.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypathrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypathrule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypathrule.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprobe.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprobe.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprobe.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprobe.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypropertiesformat.go new file mode 100644 index 00000000000..8f57d0c043f --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaypropertiesformat.go @@ -0,0 +1,42 @@ +package applicationgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationGatewayPropertiesFormat struct { + AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` + AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` + BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` + BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` + BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` + CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` + EnableFips *bool `json:"enableFips,omitempty"` + EnableHTTP2 *bool `json:"enableHttp2,omitempty"` + FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` + ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` + FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` + FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` + GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` + GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` + HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` + Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` + LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` + OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` + PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` + Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` + RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` + RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` + Sku *ApplicationGatewaySku `json:"sku,omitempty"` + SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` + SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` + SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` + TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` + TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` + UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayredirectconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayredirectconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayredirectconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayredirectconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrequestroutingrule.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrequestroutingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrequestroutingrule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrequestroutingrule.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriterule.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriterule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriterule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriterule.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriterulecondition.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriterulecondition.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriterulecondition.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriterulecondition.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriteruleset.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriteruleset.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriteruleset.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriteruleset.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayroutingrule.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayroutingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayroutingrule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayroutingrule.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysku.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysku.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysku.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslcertificate.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslcertificate.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslcertificate.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslpolicy.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslpolicy.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslprofile.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslprofile.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslprofile.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayurlconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayurlconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayurlconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayurlpathmap.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayurlpathmap.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayurlpathmap.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_backendaddresspool.go b/resource-manager/network/2022-07-01/applicationgateways/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/applicationgateways/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..7dc8222f453 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package applicationgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_ddossettings.go b/resource-manager/network/2022-07-01/applicationgateways/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_ddossettings.go rename to resource-manager/network/2022-07-01/applicationgateways/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_delegation.go b/resource-manager/network/2022-07-01/applicationgateways/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_delegation.go rename to resource-manager/network/2022-07-01/applicationgateways/model_delegation.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_flowlog.go b/resource-manager/network/2022-07-01/applicationgateways/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_flowlog.go rename to resource-manager/network/2022-07-01/applicationgateways/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/applicationgateways/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/applicationgateways/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_inboundnatrule.go b/resource-manager/network/2022-07-01/applicationgateways/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_ipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/applicationgateways/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/applicationgateways/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_iptag.go b/resource-manager/network/2022-07-01/applicationgateways/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_iptag.go rename to resource-manager/network/2022-07-01/applicationgateways/model_iptag.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/applicationgateways/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/applicationgateways/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_natgateway.go b/resource-manager/network/2022-07-01/applicationgateways/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_natgateway.go rename to resource-manager/network/2022-07-01/applicationgateways/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_natgatewaysku.go b/resource-manager/network/2022-07-01/applicationgateways/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/applicationgateways/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_natruleportmapping.go b/resource-manager/network/2022-07-01/applicationgateways/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/applicationgateways/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterface.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterface.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..5b015dee73f --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package applicationgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/applicationgateways/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpoint.go b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privateendpoint.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..4413bd3db27 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package applicationgateways + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkservice.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_publicipaddress.go b/resource-manager/network/2022-07-01/applicationgateways/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_publicipaddress.go rename to resource-manager/network/2022-07-01/applicationgateways/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/applicationgateways/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..bb716274972 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package applicationgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/applicationgateways/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/applicationgateways/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/applicationgateways/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/applicationgateways/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_resourceset.go b/resource-manager/network/2022-07-01/applicationgateways/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_resourceset.go rename to resource-manager/network/2022-07-01/applicationgateways/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/applicationgateways/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/applicationgateways/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_route.go b/resource-manager/network/2022-07-01/applicationgateways/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_route.go rename to resource-manager/network/2022-07-01/applicationgateways/model_route.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_routetable.go b/resource-manager/network/2022-07-01/applicationgateways/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_routetable.go rename to resource-manager/network/2022-07-01/applicationgateways/model_routetable.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_securityrule.go b/resource-manager/network/2022-07-01/applicationgateways/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_securityrule.go rename to resource-manager/network/2022-07-01/applicationgateways/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..96f0eea52f0 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package applicationgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_subnet.go b/resource-manager/network/2022-07-01/applicationgateways/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_subnet.go rename to resource-manager/network/2022-07-01/applicationgateways/model_subnet.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..be8f3c6638a --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package applicationgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_subresource.go b/resource-manager/network/2022-07-01/applicationgateways/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_subresource.go rename to resource-manager/network/2022-07-01/applicationgateways/model_subresource.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_tagsobject.go b/resource-manager/network/2022-07-01/applicationgateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/applicationgateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/applicationgateways/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/applicationgateways/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/applicationgateways/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/applicationgateways/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/applicationgateways/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/applicationgateways/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationgateways/predicates.go b/resource-manager/network/2022-07-01/applicationgateways/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgateways/predicates.go rename to resource-manager/network/2022-07-01/applicationgateways/predicates.go diff --git a/resource-manager/network/2022-07-01/applicationgateways/version.go b/resource-manager/network/2022-07-01/applicationgateways/version.go new file mode 100644 index 00000000000..192eed3c6e9 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgateways/version.go @@ -0,0 +1,12 @@ +package applicationgateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/README.md new file mode 100644 index 00000000000..e87f13ec7c5 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests` Documentation + +The `applicationgatewaywafdynamicmanifests` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/applicationgatewaywafdynamicmanifests" +``` + + +### Client Initialization + +```go +client := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.DefaultGet` + +```go +ctx := context.TODO() +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.DefaultGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.Get` + +```go +ctx := context.TODO() +id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.Get(ctx, id)` can be used to do batched pagination +items, err := client.GetComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/client.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/client.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/client.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/client.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/constants.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/constants.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/constants.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/id_location.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/id_location.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/id_location_test.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/id_location_test.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/method_defaultget.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/method_defaultget.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/method_defaultget.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/method_defaultget.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/method_get.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/method_get.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/method_get.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/predicates.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/predicates.go rename to resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/predicates.go diff --git a/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/version.go b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/version.go new file mode 100644 index 00000000000..93bbbaf1409 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests/version.go @@ -0,0 +1,12 @@ +package applicationgatewaywafdynamicmanifests + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewaywafdynamicmanifests/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/applicationsecuritygroups/README.md b/resource-manager/network/2022-07-01/applicationsecuritygroups/README.md new file mode 100644 index 00000000000..5511509a5ab --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationsecuritygroups/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationsecuritygroups` Documentation + +The `applicationsecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/applicationsecuritygroups" +``` + + +### Client Initialization + +```go +client := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ApplicationSecurityGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") + +payload := applicationsecuritygroups.ApplicationSecurityGroup{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationSecurityGroupsClient.Delete` + +```go +ctx := context.TODO() +id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ApplicationSecurityGroupsClient.Get` + +```go +ctx := context.TODO() +id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") + +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: `ApplicationSecurityGroupsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `ApplicationSecurityGroupsClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ApplicationSecurityGroupsClient.UpdateTags` + +```go +ctx := context.TODO() +id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") + +payload := applicationsecuritygroups.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/network/2023-04-01/applicationsecuritygroups/client.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/client.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/client.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/client.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/constants.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/constants.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/constants.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/id_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/id_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/id_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/id_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/method_createorupdate.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/method_createorupdate.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/method_delete.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/method_delete.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/method_delete.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/method_get.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/method_get.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/method_get.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/method_list.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/method_list.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/method_list.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/method_listall.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/method_listall.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/method_listall.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/method_updatetags.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/method_updatetags.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/model_tagsobject.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/model_tagsobject.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/predicates.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/applicationsecuritygroups/predicates.go rename to resource-manager/network/2022-07-01/applicationsecuritygroups/predicates.go diff --git a/resource-manager/network/2022-07-01/applicationsecuritygroups/version.go b/resource-manager/network/2022-07-01/applicationsecuritygroups/version.go new file mode 100644 index 00000000000..71657c185b1 --- /dev/null +++ b/resource-manager/network/2022-07-01/applicationsecuritygroups/version.go @@ -0,0 +1,12 @@ +package applicationsecuritygroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/applicationsecuritygroups/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/availabledelegations/README.md b/resource-manager/network/2022-07-01/availabledelegations/README.md new file mode 100644 index 00000000000..28a1712b12d --- /dev/null +++ b/resource-manager/network/2022-07-01/availabledelegations/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/availabledelegations` Documentation + +The `availabledelegations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/availabledelegations" +``` + + +### Client Initialization + +```go +client := availabledelegations.NewAvailableDelegationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AvailableDelegationsClient.AvailableDelegationsList` + +```go +ctx := context.TODO() +id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination +items, err := client.AvailableDelegationsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AvailableDelegationsClient.AvailableResourceGroupDelegationsList` + +```go +ctx := context.TODO() +id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") + +// alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination +items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/availabledelegations/client.go b/resource-manager/network/2022-07-01/availabledelegations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/client.go rename to resource-manager/network/2022-07-01/availabledelegations/client.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/id_location.go b/resource-manager/network/2022-07-01/availabledelegations/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/id_location.go rename to resource-manager/network/2022-07-01/availabledelegations/id_location.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/id_location_test.go b/resource-manager/network/2022-07-01/availabledelegations/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/id_location_test.go rename to resource-manager/network/2022-07-01/availabledelegations/id_location_test.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2022-07-01/availabledelegations/id_providerlocation.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/id_providerlocation.go rename to resource-manager/network/2022-07-01/availabledelegations/id_providerlocation.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2022-07-01/availabledelegations/id_providerlocation_test.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/id_providerlocation_test.go rename to resource-manager/network/2022-07-01/availabledelegations/id_providerlocation_test.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/method_availabledelegationslist.go b/resource-manager/network/2022-07-01/availabledelegations/method_availabledelegationslist.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/method_availabledelegationslist.go rename to resource-manager/network/2022-07-01/availabledelegations/method_availabledelegationslist.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/method_availableresourcegroupdelegationslist.go b/resource-manager/network/2022-07-01/availabledelegations/method_availableresourcegroupdelegationslist.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/method_availableresourcegroupdelegationslist.go rename to resource-manager/network/2022-07-01/availabledelegations/method_availableresourcegroupdelegationslist.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/model_availabledelegation.go b/resource-manager/network/2022-07-01/availabledelegations/model_availabledelegation.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/model_availabledelegation.go rename to resource-manager/network/2022-07-01/availabledelegations/model_availabledelegation.go diff --git a/resource-manager/network/2023-04-01/availabledelegations/predicates.go b/resource-manager/network/2022-07-01/availabledelegations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/availabledelegations/predicates.go rename to resource-manager/network/2022-07-01/availabledelegations/predicates.go diff --git a/resource-manager/network/2022-07-01/availabledelegations/version.go b/resource-manager/network/2022-07-01/availabledelegations/version.go new file mode 100644 index 00000000000..e5127a97694 --- /dev/null +++ b/resource-manager/network/2022-07-01/availabledelegations/version.go @@ -0,0 +1,12 @@ +package availabledelegations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/availabledelegations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/availableservicealiases/README.md b/resource-manager/network/2022-07-01/availableservicealiases/README.md new file mode 100644 index 00000000000..a34b44027b8 --- /dev/null +++ b/resource-manager/network/2022-07-01/availableservicealiases/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/availableservicealiases` Documentation + +The `availableservicealiases` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/availableservicealiases" +``` + + +### Client Initialization + +```go +client := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AvailableServiceAliasesClient.List` + +```go +ctx := context.TODO() +id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// 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: `AvailableServiceAliasesClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") + +// 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 +} +``` diff --git a/resource-manager/network/2023-04-01/availableservicealiases/client.go b/resource-manager/network/2022-07-01/availableservicealiases/client.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/client.go rename to resource-manager/network/2022-07-01/availableservicealiases/client.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/id_location.go b/resource-manager/network/2022-07-01/availableservicealiases/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/id_location.go rename to resource-manager/network/2022-07-01/availableservicealiases/id_location.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/id_location_test.go b/resource-manager/network/2022-07-01/availableservicealiases/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/id_location_test.go rename to resource-manager/network/2022-07-01/availableservicealiases/id_location_test.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2022-07-01/availableservicealiases/id_providerlocation.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/id_providerlocation.go rename to resource-manager/network/2022-07-01/availableservicealiases/id_providerlocation.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2022-07-01/availableservicealiases/id_providerlocation_test.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/id_providerlocation_test.go rename to resource-manager/network/2022-07-01/availableservicealiases/id_providerlocation_test.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/method_list.go b/resource-manager/network/2022-07-01/availableservicealiases/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/method_list.go rename to resource-manager/network/2022-07-01/availableservicealiases/method_list.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/availableservicealiases/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/availableservicealiases/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/model_availableservicealias.go b/resource-manager/network/2022-07-01/availableservicealiases/model_availableservicealias.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/model_availableservicealias.go rename to resource-manager/network/2022-07-01/availableservicealiases/model_availableservicealias.go diff --git a/resource-manager/network/2023-04-01/availableservicealiases/predicates.go b/resource-manager/network/2022-07-01/availableservicealiases/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/availableservicealiases/predicates.go rename to resource-manager/network/2022-07-01/availableservicealiases/predicates.go diff --git a/resource-manager/network/2022-07-01/availableservicealiases/version.go b/resource-manager/network/2022-07-01/availableservicealiases/version.go new file mode 100644 index 00000000000..69387b26026 --- /dev/null +++ b/resource-manager/network/2022-07-01/availableservicealiases/version.go @@ -0,0 +1,12 @@ +package availableservicealiases + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/availableservicealiases/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/azurefirewalls/README.md b/resource-manager/network/2022-07-01/azurefirewalls/README.md new file mode 100644 index 00000000000..4e70e275c5c --- /dev/null +++ b/resource-manager/network/2022-07-01/azurefirewalls/README.md @@ -0,0 +1,129 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/azurefirewalls` Documentation + +The `azurefirewalls` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/azurefirewalls" +``` + + +### Client Initialization + +```go +client := azurefirewalls.NewAzureFirewallsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `AzureFirewallsClient.AzureFirewallsListLearnedPrefixes` + +```go +ctx := context.TODO() +id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") + +if err := client.AzureFirewallsListLearnedPrefixesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AzureFirewallsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") + +payload := azurefirewalls.AzureFirewall{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `AzureFirewallsClient.Delete` + +```go +ctx := context.TODO() +id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `AzureFirewallsClient.Get` + +```go +ctx := context.TODO() +id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") + +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: `AzureFirewallsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `AzureFirewallsClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `AzureFirewallsClient.UpdateTags` + +```go +ctx := context.TODO() +id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") + +payload := azurefirewalls.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/azurefirewalls/client.go b/resource-manager/network/2022-07-01/azurefirewalls/client.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/client.go rename to resource-manager/network/2022-07-01/azurefirewalls/client.go diff --git a/resource-manager/network/2022-07-01/azurefirewalls/constants.go b/resource-manager/network/2022-07-01/azurefirewalls/constants.go new file mode 100644 index 00000000000..b8e1a119bde --- /dev/null +++ b/resource-manager/network/2022-07-01/azurefirewalls/constants.go @@ -0,0 +1,359 @@ +package azurefirewalls + +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 AzureFirewallApplicationRuleProtocolType string + +const ( + AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" + AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" + AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" +) + +func PossibleValuesForAzureFirewallApplicationRuleProtocolType() []string { + return []string{ + string(AzureFirewallApplicationRuleProtocolTypeHTTP), + string(AzureFirewallApplicationRuleProtocolTypeHTTPS), + string(AzureFirewallApplicationRuleProtocolTypeMssql), + } +} + +func (s *AzureFirewallApplicationRuleProtocolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallApplicationRuleProtocolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallApplicationRuleProtocolType(input string) (*AzureFirewallApplicationRuleProtocolType, error) { + vals := map[string]AzureFirewallApplicationRuleProtocolType{ + "http": AzureFirewallApplicationRuleProtocolTypeHTTP, + "https": AzureFirewallApplicationRuleProtocolTypeHTTPS, + "mssql": AzureFirewallApplicationRuleProtocolTypeMssql, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallApplicationRuleProtocolType(input) + return &out, nil +} + +type AzureFirewallNatRCActionType string + +const ( + AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" + AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" +) + +func PossibleValuesForAzureFirewallNatRCActionType() []string { + return []string{ + string(AzureFirewallNatRCActionTypeDnat), + string(AzureFirewallNatRCActionTypeSnat), + } +} + +func (s *AzureFirewallNatRCActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallNatRCActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallNatRCActionType(input string) (*AzureFirewallNatRCActionType, error) { + vals := map[string]AzureFirewallNatRCActionType{ + "dnat": AzureFirewallNatRCActionTypeDnat, + "snat": AzureFirewallNatRCActionTypeSnat, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallNatRCActionType(input) + return &out, nil +} + +type AzureFirewallNetworkRuleProtocol string + +const ( + AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" + AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" + AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" + AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" +) + +func PossibleValuesForAzureFirewallNetworkRuleProtocol() []string { + return []string{ + string(AzureFirewallNetworkRuleProtocolAny), + string(AzureFirewallNetworkRuleProtocolICMP), + string(AzureFirewallNetworkRuleProtocolTCP), + string(AzureFirewallNetworkRuleProtocolUDP), + } +} + +func (s *AzureFirewallNetworkRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallNetworkRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallNetworkRuleProtocol(input string) (*AzureFirewallNetworkRuleProtocol, error) { + vals := map[string]AzureFirewallNetworkRuleProtocol{ + "any": AzureFirewallNetworkRuleProtocolAny, + "icmp": AzureFirewallNetworkRuleProtocolICMP, + "tcp": AzureFirewallNetworkRuleProtocolTCP, + "udp": AzureFirewallNetworkRuleProtocolUDP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallNetworkRuleProtocol(input) + return &out, nil +} + +type AzureFirewallRCActionType string + +const ( + AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" + AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" +) + +func PossibleValuesForAzureFirewallRCActionType() []string { + return []string{ + string(AzureFirewallRCActionTypeAllow), + string(AzureFirewallRCActionTypeDeny), + } +} + +func (s *AzureFirewallRCActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallRCActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallRCActionType(input string) (*AzureFirewallRCActionType, error) { + vals := map[string]AzureFirewallRCActionType{ + "allow": AzureFirewallRCActionTypeAllow, + "deny": AzureFirewallRCActionTypeDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallRCActionType(input) + return &out, nil +} + +type AzureFirewallSkuName string + +const ( + AzureFirewallSkuNameAZFWHub AzureFirewallSkuName = "AZFW_Hub" + AzureFirewallSkuNameAZFWVNet AzureFirewallSkuName = "AZFW_VNet" +) + +func PossibleValuesForAzureFirewallSkuName() []string { + return []string{ + string(AzureFirewallSkuNameAZFWHub), + string(AzureFirewallSkuNameAZFWVNet), + } +} + +func (s *AzureFirewallSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallSkuName(input string) (*AzureFirewallSkuName, error) { + vals := map[string]AzureFirewallSkuName{ + "azfw_hub": AzureFirewallSkuNameAZFWHub, + "azfw_vnet": AzureFirewallSkuNameAZFWVNet, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallSkuName(input) + return &out, nil +} + +type AzureFirewallSkuTier string + +const ( + AzureFirewallSkuTierBasic AzureFirewallSkuTier = "Basic" + AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" + AzureFirewallSkuTierStandard AzureFirewallSkuTier = "Standard" +) + +func PossibleValuesForAzureFirewallSkuTier() []string { + return []string{ + string(AzureFirewallSkuTierBasic), + string(AzureFirewallSkuTierPremium), + string(AzureFirewallSkuTierStandard), + } +} + +func (s *AzureFirewallSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallSkuTier(input string) (*AzureFirewallSkuTier, error) { + vals := map[string]AzureFirewallSkuTier{ + "basic": AzureFirewallSkuTierBasic, + "premium": AzureFirewallSkuTierPremium, + "standard": AzureFirewallSkuTierStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallSkuTier(input) + return &out, nil +} + +type AzureFirewallThreatIntelMode string + +const ( + AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" + AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" + AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" +) + +func PossibleValuesForAzureFirewallThreatIntelMode() []string { + return []string{ + string(AzureFirewallThreatIntelModeAlert), + string(AzureFirewallThreatIntelModeDeny), + string(AzureFirewallThreatIntelModeOff), + } +} + +func (s *AzureFirewallThreatIntelMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAzureFirewallThreatIntelMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAzureFirewallThreatIntelMode(input string) (*AzureFirewallThreatIntelMode, error) { + vals := map[string]AzureFirewallThreatIntelMode{ + "alert": AzureFirewallThreatIntelModeAlert, + "deny": AzureFirewallThreatIntelModeDeny, + "off": AzureFirewallThreatIntelModeOff, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AzureFirewallThreatIntelMode(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/id_azurefirewall.go b/resource-manager/network/2022-07-01/azurefirewalls/id_azurefirewall.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/id_azurefirewall.go rename to resource-manager/network/2022-07-01/azurefirewalls/id_azurefirewall.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/id_azurefirewall_test.go b/resource-manager/network/2022-07-01/azurefirewalls/id_azurefirewall_test.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/id_azurefirewall_test.go rename to resource-manager/network/2022-07-01/azurefirewalls/id_azurefirewall_test.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go b/resource-manager/network/2022-07-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_createorupdate.go b/resource-manager/network/2022-07-01/azurefirewalls/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_createorupdate.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_delete.go b/resource-manager/network/2022-07-01/azurefirewalls/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_delete.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_delete.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_get.go b/resource-manager/network/2022-07-01/azurefirewalls/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_get.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_get.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_list.go b/resource-manager/network/2022-07-01/azurefirewalls/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_list.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_list.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_listall.go b/resource-manager/network/2022-07-01/azurefirewalls/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_listall.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_listall.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_updatetags.go b/resource-manager/network/2022-07-01/azurefirewalls/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/method_updatetags.go rename to resource-manager/network/2022-07-01/azurefirewalls/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewall.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewall.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewall.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewall.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationrule.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationrule.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationrule.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationrule.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallipconfiguration.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallipconfiguration.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallipconfiguration.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallipgroups.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallipgroups.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallipgroups.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallipgroups.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrcaction.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrcaction.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrcaction.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrcaction.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrule.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrule.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrule.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrulecollection.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrulecollection.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrulecollection.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnetworkrule.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnetworkrule.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnetworkrule.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnetworkrule.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpropertiesformat.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpropertiesformat.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpublicipaddress.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallpublicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpublicipaddress.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallpublicipaddress.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallrcaction.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallrcaction.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallrcaction.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallrcaction.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallsku.go b/resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallsku.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallsku.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_azurefirewallsku.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_hubipaddresses.go b/resource-manager/network/2022-07-01/azurefirewalls/model_hubipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_hubipaddresses.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_hubipaddresses.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_hubpublicipaddresses.go b/resource-manager/network/2022-07-01/azurefirewalls/model_hubpublicipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_hubpublicipaddresses.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_hubpublicipaddresses.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_ipprefixeslist.go b/resource-manager/network/2022-07-01/azurefirewalls/model_ipprefixeslist.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_ipprefixeslist.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_ipprefixeslist.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_subresource.go b/resource-manager/network/2022-07-01/azurefirewalls/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_subresource.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_subresource.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_tagsobject.go b/resource-manager/network/2022-07-01/azurefirewalls/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/model_tagsobject.go rename to resource-manager/network/2022-07-01/azurefirewalls/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/azurefirewalls/predicates.go b/resource-manager/network/2022-07-01/azurefirewalls/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/azurefirewalls/predicates.go rename to resource-manager/network/2022-07-01/azurefirewalls/predicates.go diff --git a/resource-manager/network/2022-07-01/azurefirewalls/version.go b/resource-manager/network/2022-07-01/azurefirewalls/version.go new file mode 100644 index 00000000000..755d7329546 --- /dev/null +++ b/resource-manager/network/2022-07-01/azurefirewalls/version.go @@ -0,0 +1,12 @@ +package azurefirewalls + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/azurefirewalls/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/bastionhosts/README.md b/resource-manager/network/2022-07-01/bastionhosts/README.md new file mode 100644 index 00000000000..3195e8e5895 --- /dev/null +++ b/resource-manager/network/2022-07-01/bastionhosts/README.md @@ -0,0 +1,217 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/bastionhosts` Documentation + +The `bastionhosts` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/bastionhosts" +``` + + +### Client Initialization + +```go +client := bastionhosts.NewBastionHostsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BastionHostsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionHost{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.Delete` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.DeleteBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkListRequest{ + // ... +} + + +if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionHostsClient.DisconnectActiveSessions` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.SessionIds{ + // ... +} + + +// alternatively `client.DisconnectActiveSessions(ctx, id, payload)` can be used to do batched pagination +items, err := client.DisconnectActiveSessionsComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.Get` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +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: `BastionHostsClient.GetActiveSessions` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +// alternatively `client.GetActiveSessions(ctx, id)` can be used to do batched pagination +items, err := client.GetActiveSessionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.GetBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkListRequest{ + // ... +} + + +// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination +items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.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: `BastionHostsClient.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: `BastionHostsClient.PutBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.BastionShareableLinkListRequest{ + // ... +} + + +// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination +items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionHostsClient.UpdateTags` + +```go +ctx := context.TODO() +id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionhosts.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/bastionhosts/client.go b/resource-manager/network/2022-07-01/bastionhosts/client.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/client.go rename to resource-manager/network/2022-07-01/bastionhosts/client.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/constants.go b/resource-manager/network/2022-07-01/bastionhosts/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/constants.go rename to resource-manager/network/2022-07-01/bastionhosts/constants.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/id_bastionhost.go b/resource-manager/network/2022-07-01/bastionhosts/id_bastionhost.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/id_bastionhost.go rename to resource-manager/network/2022-07-01/bastionhosts/id_bastionhost.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/id_bastionhost_test.go b/resource-manager/network/2022-07-01/bastionhosts/id_bastionhost_test.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/id_bastionhost_test.go rename to resource-manager/network/2022-07-01/bastionhosts/id_bastionhost_test.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_createorupdate.go b/resource-manager/network/2022-07-01/bastionhosts/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_createorupdate.go rename to resource-manager/network/2022-07-01/bastionhosts/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_delete.go b/resource-manager/network/2022-07-01/bastionhosts/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_delete.go rename to resource-manager/network/2022-07-01/bastionhosts/method_delete.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_deletebastionshareablelink.go b/resource-manager/network/2022-07-01/bastionhosts/method_deletebastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_deletebastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionhosts/method_deletebastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_disconnectactivesessions.go b/resource-manager/network/2022-07-01/bastionhosts/method_disconnectactivesessions.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_disconnectactivesessions.go rename to resource-manager/network/2022-07-01/bastionhosts/method_disconnectactivesessions.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_get.go b/resource-manager/network/2022-07-01/bastionhosts/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_get.go rename to resource-manager/network/2022-07-01/bastionhosts/method_get.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_getactivesessions.go b/resource-manager/network/2022-07-01/bastionhosts/method_getactivesessions.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_getactivesessions.go rename to resource-manager/network/2022-07-01/bastionhosts/method_getactivesessions.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_getbastionshareablelink.go b/resource-manager/network/2022-07-01/bastionhosts/method_getbastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_getbastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionhosts/method_getbastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_list.go b/resource-manager/network/2022-07-01/bastionhosts/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_list.go rename to resource-manager/network/2022-07-01/bastionhosts/method_list.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/bastionhosts/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/bastionhosts/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_putbastionshareablelink.go b/resource-manager/network/2022-07-01/bastionhosts/method_putbastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_putbastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionhosts/method_putbastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/method_updatetags.go b/resource-manager/network/2022-07-01/bastionhosts/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/method_updatetags.go rename to resource-manager/network/2022-07-01/bastionhosts/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionactivesession.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionactivesession.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionactivesession.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionactivesession.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionhost.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionhost.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionhost.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionhost.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionhostipconfiguration.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionhostipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionhostipconfiguration.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionhostipconfiguration.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/bastionhosts/model_bastionhostpropertiesformat.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionhostpropertiesformat.go new file mode 100644 index 00000000000..4567093a391 --- /dev/null +++ b/resource-manager/network/2022-07-01/bastionhosts/model_bastionhostpropertiesformat.go @@ -0,0 +1,16 @@ +package bastionhosts + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BastionHostPropertiesFormat struct { + DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` + DnsName *string `json:"dnsName,omitempty"` + EnableFileCopy *bool `json:"enableFileCopy,omitempty"` + EnableIPConnect *bool `json:"enableIpConnect,omitempty"` + EnableShareableLink *bool `json:"enableShareableLink,omitempty"` + EnableTunneling *bool `json:"enableTunneling,omitempty"` + IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ScaleUnits *int64 `json:"scaleUnits,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionsessionstate.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionsessionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionsessionstate.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionsessionstate.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionshareablelink.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionshareablelinklistrequest.go b/resource-manager/network/2022-07-01/bastionhosts/model_bastionshareablelinklistrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_bastionshareablelinklistrequest.go rename to resource-manager/network/2022-07-01/bastionhosts/model_bastionshareablelinklistrequest.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_resource.go b/resource-manager/network/2022-07-01/bastionhosts/model_resource.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_resource.go rename to resource-manager/network/2022-07-01/bastionhosts/model_resource.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_sessionids.go b/resource-manager/network/2022-07-01/bastionhosts/model_sessionids.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_sessionids.go rename to resource-manager/network/2022-07-01/bastionhosts/model_sessionids.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_sku.go b/resource-manager/network/2022-07-01/bastionhosts/model_sku.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_sku.go rename to resource-manager/network/2022-07-01/bastionhosts/model_sku.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_subresource.go b/resource-manager/network/2022-07-01/bastionhosts/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_subresource.go rename to resource-manager/network/2022-07-01/bastionhosts/model_subresource.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_tagsobject.go b/resource-manager/network/2022-07-01/bastionhosts/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/model_tagsobject.go rename to resource-manager/network/2022-07-01/bastionhosts/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/bastionhosts/predicates.go b/resource-manager/network/2022-07-01/bastionhosts/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionhosts/predicates.go rename to resource-manager/network/2022-07-01/bastionhosts/predicates.go diff --git a/resource-manager/network/2022-07-01/bastionhosts/version.go b/resource-manager/network/2022-07-01/bastionhosts/version.go new file mode 100644 index 00000000000..7a2ce6ec368 --- /dev/null +++ b/resource-manager/network/2022-07-01/bastionhosts/version.go @@ -0,0 +1,12 @@ +package bastionhosts + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/bastionhosts/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/bastionshareablelink/README.md b/resource-manager/network/2022-07-01/bastionshareablelink/README.md new file mode 100644 index 00000000000..be27b25f14a --- /dev/null +++ b/resource-manager/network/2022-07-01/bastionshareablelink/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/bastionshareablelink` Documentation + +The `bastionshareablelink` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/bastionshareablelink" +``` + + +### Client Initialization + +```go +client := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BastionShareableLinkClient.DeleteBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionshareablelink.BastionShareableLinkListRequest{ + // ... +} + + +if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `BastionShareableLinkClient.GetBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionshareablelink.BastionShareableLinkListRequest{ + // ... +} + + +// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination +items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `BastionShareableLinkClient.PutBastionShareableLink` + +```go +ctx := context.TODO() +id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") + +payload := bastionshareablelink.BastionShareableLinkListRequest{ + // ... +} + + +// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination +items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/client.go b/resource-manager/network/2022-07-01/bastionshareablelink/client.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/client.go rename to resource-manager/network/2022-07-01/bastionshareablelink/client.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/id_bastionhost.go b/resource-manager/network/2022-07-01/bastionshareablelink/id_bastionhost.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/id_bastionhost.go rename to resource-manager/network/2022-07-01/bastionshareablelink/id_bastionhost.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/id_bastionhost_test.go b/resource-manager/network/2022-07-01/bastionshareablelink/id_bastionhost_test.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/id_bastionhost_test.go rename to resource-manager/network/2022-07-01/bastionshareablelink/id_bastionhost_test.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/method_deletebastionshareablelink.go b/resource-manager/network/2022-07-01/bastionshareablelink/method_deletebastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/method_deletebastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionshareablelink/method_deletebastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/method_getbastionshareablelink.go b/resource-manager/network/2022-07-01/bastionshareablelink/method_getbastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/method_getbastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionshareablelink/method_getbastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/method_putbastionshareablelink.go b/resource-manager/network/2022-07-01/bastionshareablelink/method_putbastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/method_putbastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionshareablelink/method_putbastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/model_bastionshareablelink.go b/resource-manager/network/2022-07-01/bastionshareablelink/model_bastionshareablelink.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/model_bastionshareablelink.go rename to resource-manager/network/2022-07-01/bastionshareablelink/model_bastionshareablelink.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/model_bastionshareablelinklistrequest.go b/resource-manager/network/2022-07-01/bastionshareablelink/model_bastionshareablelinklistrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/model_bastionshareablelinklistrequest.go rename to resource-manager/network/2022-07-01/bastionshareablelink/model_bastionshareablelinklistrequest.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/model_resource.go b/resource-manager/network/2022-07-01/bastionshareablelink/model_resource.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/model_resource.go rename to resource-manager/network/2022-07-01/bastionshareablelink/model_resource.go diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/predicates.go b/resource-manager/network/2022-07-01/bastionshareablelink/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/bastionshareablelink/predicates.go rename to resource-manager/network/2022-07-01/bastionshareablelink/predicates.go diff --git a/resource-manager/network/2022-07-01/bastionshareablelink/version.go b/resource-manager/network/2022-07-01/bastionshareablelink/version.go new file mode 100644 index 00000000000..04a77a7b715 --- /dev/null +++ b/resource-manager/network/2022-07-01/bastionshareablelink/version.go @@ -0,0 +1,12 @@ +package bastionshareablelink + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/bastionshareablelink/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/bgpservicecommunities/README.md b/resource-manager/network/2022-07-01/bgpservicecommunities/README.md new file mode 100644 index 00000000000..1e9112bd941 --- /dev/null +++ b/resource-manager/network/2022-07-01/bgpservicecommunities/README.md @@ -0,0 +1,38 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/bgpservicecommunities` Documentation + +The `bgpservicecommunities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/bgpservicecommunities" +``` + + +### Client Initialization + +```go +client := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `BgpServiceCommunitiesClient.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 +} +``` diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/client.go b/resource-manager/network/2022-07-01/bgpservicecommunities/client.go similarity index 100% rename from resource-manager/network/2023-04-01/bgpservicecommunities/client.go rename to resource-manager/network/2022-07-01/bgpservicecommunities/client.go diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/method_list.go b/resource-manager/network/2022-07-01/bgpservicecommunities/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/bgpservicecommunities/method_list.go rename to resource-manager/network/2022-07-01/bgpservicecommunities/method_list.go diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/model_bgpcommunity.go b/resource-manager/network/2022-07-01/bgpservicecommunities/model_bgpcommunity.go similarity index 100% rename from resource-manager/network/2023-04-01/bgpservicecommunities/model_bgpcommunity.go rename to resource-manager/network/2022-07-01/bgpservicecommunities/model_bgpcommunity.go diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/model_bgpservicecommunity.go b/resource-manager/network/2022-07-01/bgpservicecommunities/model_bgpservicecommunity.go similarity index 100% rename from resource-manager/network/2023-04-01/bgpservicecommunities/model_bgpservicecommunity.go rename to resource-manager/network/2022-07-01/bgpservicecommunities/model_bgpservicecommunity.go diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go b/resource-manager/network/2022-07-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go rename to resource-manager/network/2022-07-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/predicates.go b/resource-manager/network/2022-07-01/bgpservicecommunities/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/bgpservicecommunities/predicates.go rename to resource-manager/network/2022-07-01/bgpservicecommunities/predicates.go diff --git a/resource-manager/network/2022-07-01/bgpservicecommunities/version.go b/resource-manager/network/2022-07-01/bgpservicecommunities/version.go new file mode 100644 index 00000000000..0cef953d6c7 --- /dev/null +++ b/resource-manager/network/2022-07-01/bgpservicecommunities/version.go @@ -0,0 +1,12 @@ +package bgpservicecommunities + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/bgpservicecommunities/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/checkdnsavailabilities/README.md b/resource-manager/network/2022-07-01/checkdnsavailabilities/README.md new file mode 100644 index 00000000000..f2583ac3b08 --- /dev/null +++ b/resource-manager/network/2022-07-01/checkdnsavailabilities/README.md @@ -0,0 +1,36 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/checkdnsavailabilities` Documentation + +The `checkdnsavailabilities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/checkdnsavailabilities" +``` + + +### Client Initialization + +```go +client := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CheckDnsAvailabilitiesClient.CheckDnsNameAvailability` + +```go +ctx := context.TODO() +id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/client.go b/resource-manager/network/2022-07-01/checkdnsavailabilities/client.go similarity index 100% rename from resource-manager/network/2023-04-01/checkdnsavailabilities/client.go rename to resource-manager/network/2022-07-01/checkdnsavailabilities/client.go diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2022-07-01/checkdnsavailabilities/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/checkdnsavailabilities/id_location.go rename to resource-manager/network/2022-07-01/checkdnsavailabilities/id_location.go diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2022-07-01/checkdnsavailabilities/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/checkdnsavailabilities/id_location_test.go rename to resource-manager/network/2022-07-01/checkdnsavailabilities/id_location_test.go diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/method_checkdnsnameavailability.go b/resource-manager/network/2022-07-01/checkdnsavailabilities/method_checkdnsnameavailability.go similarity index 100% rename from resource-manager/network/2023-04-01/checkdnsavailabilities/method_checkdnsnameavailability.go rename to resource-manager/network/2022-07-01/checkdnsavailabilities/method_checkdnsnameavailability.go diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go b/resource-manager/network/2022-07-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go similarity index 100% rename from resource-manager/network/2023-04-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go rename to resource-manager/network/2022-07-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go diff --git a/resource-manager/network/2022-07-01/checkdnsavailabilities/version.go b/resource-manager/network/2022-07-01/checkdnsavailabilities/version.go new file mode 100644 index 00000000000..b52ed8a5e96 --- /dev/null +++ b/resource-manager/network/2022-07-01/checkdnsavailabilities/version.go @@ -0,0 +1,12 @@ +package checkdnsavailabilities + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/checkdnsavailabilities/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/client.go b/resource-manager/network/2022-07-01/client.go new file mode 100644 index 00000000000..d5444f1e12f --- /dev/null +++ b/resource-manager/network/2022-07-01/client.go @@ -0,0 +1,982 @@ +package v2022_07_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/network/2022-07-01/adminrulecollections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/adminrules" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgatewayprivateendpointconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgatewayprivatelinkresources" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationgatewaywafdynamicmanifests" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/applicationsecuritygroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/availabledelegations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/availableservicealiases" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/azurefirewalls" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/bastionhosts" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/bastionshareablelink" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/bgpservicecommunities" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/checkdnsavailabilities" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/cloudservicepublicipaddresses" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/connectionmonitors" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/connectivityconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/customipprefixes" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ddoscustompolicies" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ddosprotectionplans" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/dscpconfiguration" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/dscpconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/endpointservices" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitarptable" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitauthorizations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitpeerings" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitroutestable" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuits" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitstats" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutegateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutelinks" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteportauthorizations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteports" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteportslocations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteproviderports" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteserviceproviders" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/firewallpolicies" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/flowlogs" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ipallocations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ipgroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/loadbalancers" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/localnetworkgateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/natgateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkgroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkinterfaces" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanageractiveconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagerconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagers" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkprofiles" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networksecuritygroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkvirtualappliances" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkwatchers" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/p2svpngateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/packetcaptures" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privatednszonegroups" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privateendpoints" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privatelinkservice" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privatelinkservices" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/publicipaddresses" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/publicipprefixes" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routefilterrules" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routefilters" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routes" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routetables" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/scopeconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/securityadminconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/securitypartnerproviders" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/securityrules" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/serviceendpointpolicies" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/servicetags" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/staticmembers" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/subnets" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/trafficanalytics" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/usages" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vipswap" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualappliancesites" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualapplianceskus" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworkgateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworkpeerings" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworks" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworktap" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworktaps" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualrouterpeerings" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualrouters" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualwans" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vmsspublicipaddresses" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpngateways" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpnlinkconnections" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpnserverconfigurations" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpnsites" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/webapplicationfirewallpolicies" + "github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/webcategories" + "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" + sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" +) + +type Client struct { + AdminRuleCollections *adminrulecollections.AdminRuleCollectionsClient + AdminRules *adminrules.AdminRulesClient + ApplicationGatewayPrivateEndpointConnections *applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnectionsClient + ApplicationGatewayPrivateLinkResources *applicationgatewayprivatelinkresources.ApplicationGatewayPrivateLinkResourcesClient + ApplicationGatewayWafDynamicManifests *applicationgatewaywafdynamicmanifests.ApplicationGatewayWafDynamicManifestsClient + ApplicationGateways *applicationgateways.ApplicationGatewaysClient + ApplicationSecurityGroups *applicationsecuritygroups.ApplicationSecurityGroupsClient + AvailableDelegations *availabledelegations.AvailableDelegationsClient + AvailableServiceAliases *availableservicealiases.AvailableServiceAliasesClient + AzureFirewalls *azurefirewalls.AzureFirewallsClient + BastionHosts *bastionhosts.BastionHostsClient + BastionShareableLink *bastionshareablelink.BastionShareableLinkClient + BgpServiceCommunities *bgpservicecommunities.BgpServiceCommunitiesClient + CheckDnsAvailabilities *checkdnsavailabilities.CheckDnsAvailabilitiesClient + CloudServicePublicIPAddresses *cloudservicepublicipaddresses.CloudServicePublicIPAddressesClient + ConnectionMonitors *connectionmonitors.ConnectionMonitorsClient + ConnectivityConfigurations *connectivityconfigurations.ConnectivityConfigurationsClient + CustomIPPrefixes *customipprefixes.CustomIPPrefixesClient + DdosCustomPolicies *ddoscustompolicies.DdosCustomPoliciesClient + DdosProtectionPlans *ddosprotectionplans.DdosProtectionPlansClient + DscpConfiguration *dscpconfiguration.DscpConfigurationClient + DscpConfigurations *dscpconfigurations.DscpConfigurationsClient + EndpointServices *endpointservices.EndpointServicesClient + ExpressRouteCircuitArpTable *expressroutecircuitarptable.ExpressRouteCircuitArpTableClient + ExpressRouteCircuitAuthorizations *expressroutecircuitauthorizations.ExpressRouteCircuitAuthorizationsClient + ExpressRouteCircuitConnections *expressroutecircuitconnections.ExpressRouteCircuitConnectionsClient + ExpressRouteCircuitPeerings *expressroutecircuitpeerings.ExpressRouteCircuitPeeringsClient + ExpressRouteCircuitRoutesTable *expressroutecircuitroutestable.ExpressRouteCircuitRoutesTableClient + ExpressRouteCircuitRoutesTableSummary *expressroutecircuitroutestablesummary.ExpressRouteCircuitRoutesTableSummaryClient + ExpressRouteCircuitStats *expressroutecircuitstats.ExpressRouteCircuitStatsClient + ExpressRouteCircuits *expressroutecircuits.ExpressRouteCircuitsClient + ExpressRouteConnections *expressrouteconnections.ExpressRouteConnectionsClient + ExpressRouteCrossConnectionArpTable *expressroutecrossconnectionarptable.ExpressRouteCrossConnectionArpTableClient + ExpressRouteCrossConnectionPeerings *expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeeringsClient + ExpressRouteCrossConnectionRouteTable *expressroutecrossconnectionroutetable.ExpressRouteCrossConnectionRouteTableClient + ExpressRouteCrossConnectionRouteTableSummary *expressroutecrossconnectionroutetablesummary.ExpressRouteCrossConnectionRouteTableSummaryClient + ExpressRouteCrossConnections *expressroutecrossconnections.ExpressRouteCrossConnectionsClient + ExpressRouteGateways *expressroutegateways.ExpressRouteGatewaysClient + ExpressRouteLinks *expressroutelinks.ExpressRouteLinksClient + ExpressRoutePortAuthorizations *expressrouteportauthorizations.ExpressRoutePortAuthorizationsClient + ExpressRoutePorts *expressrouteports.ExpressRoutePortsClient + ExpressRoutePortsLocations *expressrouteportslocations.ExpressRoutePortsLocationsClient + ExpressRouteProviderPorts *expressrouteproviderports.ExpressRouteProviderPortsClient + ExpressRouteServiceProviders *expressrouteserviceproviders.ExpressRouteServiceProvidersClient + FirewallPolicies *firewallpolicies.FirewallPoliciesClient + FirewallPolicyRuleCollectionGroups *firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroupsClient + FlowLogs *flowlogs.FlowLogsClient + IPAllocations *ipallocations.IPAllocationsClient + IPGroups *ipgroups.IPGroupsClient + LoadBalancers *loadbalancers.LoadBalancersClient + LocalNetworkGateways *localnetworkgateways.LocalNetworkGatewaysClient + NatGateways *natgateways.NatGatewaysClient + NetworkGroups *networkgroups.NetworkGroupsClient + NetworkInterfaces *networkinterfaces.NetworkInterfacesClient + NetworkManagerActiveConfigurations *networkmanageractiveconfigurations.NetworkManagerActiveConfigurationsClient + NetworkManagerActiveConnectivityConfigurations *networkmanageractiveconnectivityconfigurations.NetworkManagerActiveConnectivityConfigurationsClient + NetworkManagerConnections *networkmanagerconnections.NetworkManagerConnectionsClient + NetworkManagerEffectiveConnectivityConfiguration *networkmanagereffectiveconnectivityconfiguration.NetworkManagerEffectiveConnectivityConfigurationClient + NetworkManagerEffectiveSecurityAdminRules *networkmanagereffectivesecurityadminrules.NetworkManagerEffectiveSecurityAdminRulesClient + NetworkManagers *networkmanagers.NetworkManagersClient + NetworkProfiles *networkprofiles.NetworkProfilesClient + NetworkSecurityGroups *networksecuritygroups.NetworkSecurityGroupsClient + NetworkVirtualAppliances *networkvirtualappliances.NetworkVirtualAppliancesClient + NetworkWatchers *networkwatchers.NetworkWatchersClient + P2sVpnGateways *p2svpngateways.P2sVpnGatewaysClient + PacketCaptures *packetcaptures.PacketCapturesClient + PeerExpressRouteCircuitConnections *peerexpressroutecircuitconnections.PeerExpressRouteCircuitConnectionsClient + PrivateDnsZoneGroups *privatednszonegroups.PrivateDnsZoneGroupsClient + PrivateEndpoints *privateendpoints.PrivateEndpointsClient + PrivateLinkService *privatelinkservice.PrivateLinkServiceClient + PrivateLinkServices *privatelinkservices.PrivateLinkServicesClient + PublicIPAddresses *publicipaddresses.PublicIPAddressesClient + PublicIPPrefixes *publicipprefixes.PublicIPPrefixesClient + RouteFilterRules *routefilterrules.RouteFilterRulesClient + RouteFilters *routefilters.RouteFiltersClient + RouteTables *routetables.RouteTablesClient + Routes *routes.RoutesClient + ScopeConnections *scopeconnections.ScopeConnectionsClient + SecurityAdminConfigurations *securityadminconfigurations.SecurityAdminConfigurationsClient + SecurityPartnerProviders *securitypartnerproviders.SecurityPartnerProvidersClient + SecurityRules *securityrules.SecurityRulesClient + ServiceEndpointPolicies *serviceendpointpolicies.ServiceEndpointPoliciesClient + ServiceEndpointPolicyDefinitions *serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinitionsClient + ServiceTags *servicetags.ServiceTagsClient + StaticMembers *staticmembers.StaticMembersClient + Subnets *subnets.SubnetsClient + TrafficAnalytics *trafficanalytics.TrafficAnalyticsClient + Usages *usages.UsagesClient + VMSSPublicIPAddresses *vmsspublicipaddresses.VMSSPublicIPAddressesClient + VipSwap *vipswap.VipSwapClient + VirtualApplianceSites *virtualappliancesites.VirtualApplianceSitesClient + VirtualApplianceSkus *virtualapplianceskus.VirtualApplianceSkusClient + VirtualNetworkGatewayConnections *virtualnetworkgatewayconnections.VirtualNetworkGatewayConnectionsClient + VirtualNetworkGateways *virtualnetworkgateways.VirtualNetworkGatewaysClient + VirtualNetworkPeerings *virtualnetworkpeerings.VirtualNetworkPeeringsClient + VirtualNetworkTap *virtualnetworktap.VirtualNetworkTapClient + VirtualNetworkTaps *virtualnetworktaps.VirtualNetworkTapsClient + VirtualNetworks *virtualnetworks.VirtualNetworksClient + VirtualRouterPeerings *virtualrouterpeerings.VirtualRouterPeeringsClient + VirtualRouters *virtualrouters.VirtualRoutersClient + VirtualWANs *virtualwans.VirtualWANsClient + VpnGateways *vpngateways.VpnGatewaysClient + VpnLinkConnections *vpnlinkconnections.VpnLinkConnectionsClient + VpnServerConfigurations *vpnserverconfigurations.VpnServerConfigurationsClient + VpnSites *vpnsites.VpnSitesClient + WebApplicationFirewallPolicies *webapplicationfirewallpolicies.WebApplicationFirewallPoliciesClient + WebCategories *webcategories.WebCategoriesClient +} + +func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { + adminRuleCollectionsClient, err := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AdminRuleCollections client: %+v", err) + } + configureFunc(adminRuleCollectionsClient.Client) + + adminRulesClient, err := adminrules.NewAdminRulesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AdminRules client: %+v", err) + } + configureFunc(adminRulesClient.Client) + + applicationGatewayPrivateEndpointConnectionsClient, err := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ApplicationGatewayPrivateEndpointConnections client: %+v", err) + } + configureFunc(applicationGatewayPrivateEndpointConnectionsClient.Client) + + applicationGatewayPrivateLinkResourcesClient, err := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ApplicationGatewayPrivateLinkResources client: %+v", err) + } + configureFunc(applicationGatewayPrivateLinkResourcesClient.Client) + + applicationGatewayWafDynamicManifestsClient, err := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ApplicationGatewayWafDynamicManifests client: %+v", err) + } + configureFunc(applicationGatewayWafDynamicManifestsClient.Client) + + applicationGatewaysClient, err := applicationgateways.NewApplicationGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ApplicationGateways client: %+v", err) + } + configureFunc(applicationGatewaysClient.Client) + + applicationSecurityGroupsClient, err := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ApplicationSecurityGroups client: %+v", err) + } + configureFunc(applicationSecurityGroupsClient.Client) + + availableDelegationsClient, err := availabledelegations.NewAvailableDelegationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AvailableDelegations client: %+v", err) + } + configureFunc(availableDelegationsClient.Client) + + availableServiceAliasesClient, err := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AvailableServiceAliases client: %+v", err) + } + configureFunc(availableServiceAliasesClient.Client) + + azureFirewallsClient, err := azurefirewalls.NewAzureFirewallsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building AzureFirewalls client: %+v", err) + } + configureFunc(azureFirewallsClient.Client) + + bastionHostsClient, err := bastionhosts.NewBastionHostsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building BastionHosts client: %+v", err) + } + configureFunc(bastionHostsClient.Client) + + bastionShareableLinkClient, err := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building BastionShareableLink client: %+v", err) + } + configureFunc(bastionShareableLinkClient.Client) + + bgpServiceCommunitiesClient, err := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building BgpServiceCommunities client: %+v", err) + } + configureFunc(bgpServiceCommunitiesClient.Client) + + checkDnsAvailabilitiesClient, err := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CheckDnsAvailabilities client: %+v", err) + } + configureFunc(checkDnsAvailabilitiesClient.Client) + + cloudServicePublicIPAddressesClient, err := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CloudServicePublicIPAddresses client: %+v", err) + } + configureFunc(cloudServicePublicIPAddressesClient.Client) + + connectionMonitorsClient, err := connectionmonitors.NewConnectionMonitorsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ConnectionMonitors client: %+v", err) + } + configureFunc(connectionMonitorsClient.Client) + + connectivityConfigurationsClient, err := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ConnectivityConfigurations client: %+v", err) + } + configureFunc(connectivityConfigurationsClient.Client) + + customIPPrefixesClient, err := customipprefixes.NewCustomIPPrefixesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building CustomIPPrefixes client: %+v", err) + } + configureFunc(customIPPrefixesClient.Client) + + ddosCustomPoliciesClient, err := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DdosCustomPolicies client: %+v", err) + } + configureFunc(ddosCustomPoliciesClient.Client) + + ddosProtectionPlansClient, err := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DdosProtectionPlans client: %+v", err) + } + configureFunc(ddosProtectionPlansClient.Client) + + dscpConfigurationClient, err := dscpconfiguration.NewDscpConfigurationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DscpConfiguration client: %+v", err) + } + configureFunc(dscpConfigurationClient.Client) + + dscpConfigurationsClient, err := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DscpConfigurations client: %+v", err) + } + configureFunc(dscpConfigurationsClient.Client) + + endpointServicesClient, err := endpointservices.NewEndpointServicesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building EndpointServices client: %+v", err) + } + configureFunc(endpointServicesClient.Client) + + expressRouteCircuitArpTableClient, err := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitArpTable client: %+v", err) + } + configureFunc(expressRouteCircuitArpTableClient.Client) + + expressRouteCircuitAuthorizationsClient, err := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitAuthorizations client: %+v", err) + } + configureFunc(expressRouteCircuitAuthorizationsClient.Client) + + expressRouteCircuitConnectionsClient, err := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitConnections client: %+v", err) + } + configureFunc(expressRouteCircuitConnectionsClient.Client) + + expressRouteCircuitPeeringsClient, err := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitPeerings client: %+v", err) + } + configureFunc(expressRouteCircuitPeeringsClient.Client) + + expressRouteCircuitRoutesTableClient, err := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTable client: %+v", err) + } + configureFunc(expressRouteCircuitRoutesTableClient.Client) + + expressRouteCircuitRoutesTableSummaryClient, err := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTableSummary client: %+v", err) + } + configureFunc(expressRouteCircuitRoutesTableSummaryClient.Client) + + expressRouteCircuitStatsClient, err := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuitStats client: %+v", err) + } + configureFunc(expressRouteCircuitStatsClient.Client) + + expressRouteCircuitsClient, err := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCircuits client: %+v", err) + } + configureFunc(expressRouteCircuitsClient.Client) + + expressRouteConnectionsClient, err := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteConnections client: %+v", err) + } + configureFunc(expressRouteConnectionsClient.Client) + + expressRouteCrossConnectionArpTableClient, err := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCrossConnectionArpTable client: %+v", err) + } + configureFunc(expressRouteCrossConnectionArpTableClient.Client) + + expressRouteCrossConnectionPeeringsClient, err := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCrossConnectionPeerings client: %+v", err) + } + configureFunc(expressRouteCrossConnectionPeeringsClient.Client) + + expressRouteCrossConnectionRouteTableClient, err := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTable client: %+v", err) + } + configureFunc(expressRouteCrossConnectionRouteTableClient.Client) + + expressRouteCrossConnectionRouteTableSummaryClient, err := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTableSummary client: %+v", err) + } + configureFunc(expressRouteCrossConnectionRouteTableSummaryClient.Client) + + expressRouteCrossConnectionsClient, err := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteCrossConnections client: %+v", err) + } + configureFunc(expressRouteCrossConnectionsClient.Client) + + expressRouteGatewaysClient, err := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteGateways client: %+v", err) + } + configureFunc(expressRouteGatewaysClient.Client) + + expressRouteLinksClient, err := expressroutelinks.NewExpressRouteLinksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteLinks client: %+v", err) + } + configureFunc(expressRouteLinksClient.Client) + + expressRoutePortAuthorizationsClient, err := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRoutePortAuthorizations client: %+v", err) + } + configureFunc(expressRoutePortAuthorizationsClient.Client) + + expressRoutePortsClient, err := expressrouteports.NewExpressRoutePortsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRoutePorts client: %+v", err) + } + configureFunc(expressRoutePortsClient.Client) + + expressRoutePortsLocationsClient, err := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRoutePortsLocations client: %+v", err) + } + configureFunc(expressRoutePortsLocationsClient.Client) + + expressRouteProviderPortsClient, err := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteProviderPorts client: %+v", err) + } + configureFunc(expressRouteProviderPortsClient.Client) + + expressRouteServiceProvidersClient, err := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ExpressRouteServiceProviders client: %+v", err) + } + configureFunc(expressRouteServiceProvidersClient.Client) + + firewallPoliciesClient, err := firewallpolicies.NewFirewallPoliciesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building FirewallPolicies client: %+v", err) + } + configureFunc(firewallPoliciesClient.Client) + + firewallPolicyRuleCollectionGroupsClient, err := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building FirewallPolicyRuleCollectionGroups client: %+v", err) + } + configureFunc(firewallPolicyRuleCollectionGroupsClient.Client) + + flowLogsClient, err := flowlogs.NewFlowLogsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building FlowLogs client: %+v", err) + } + configureFunc(flowLogsClient.Client) + + iPAllocationsClient, err := ipallocations.NewIPAllocationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building IPAllocations client: %+v", err) + } + configureFunc(iPAllocationsClient.Client) + + iPGroupsClient, err := ipgroups.NewIPGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building IPGroups client: %+v", err) + } + configureFunc(iPGroupsClient.Client) + + loadBalancersClient, err := loadbalancers.NewLoadBalancersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building LoadBalancers client: %+v", err) + } + configureFunc(loadBalancersClient.Client) + + localNetworkGatewaysClient, err := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building LocalNetworkGateways client: %+v", err) + } + configureFunc(localNetworkGatewaysClient.Client) + + natGatewaysClient, err := natgateways.NewNatGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NatGateways client: %+v", err) + } + configureFunc(natGatewaysClient.Client) + + networkGroupsClient, err := networkgroups.NewNetworkGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkGroups client: %+v", err) + } + configureFunc(networkGroupsClient.Client) + + networkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkInterfaces client: %+v", err) + } + configureFunc(networkInterfacesClient.Client) + + networkManagerActiveConfigurationsClient, err := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkManagerActiveConfigurations client: %+v", err) + } + configureFunc(networkManagerActiveConfigurationsClient.Client) + + networkManagerActiveConnectivityConfigurationsClient, err := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkManagerActiveConnectivityConfigurations client: %+v", err) + } + configureFunc(networkManagerActiveConnectivityConfigurationsClient.Client) + + networkManagerConnectionsClient, err := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkManagerConnections client: %+v", err) + } + configureFunc(networkManagerConnectionsClient.Client) + + networkManagerEffectiveConnectivityConfigurationClient, err := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkManagerEffectiveConnectivityConfiguration client: %+v", err) + } + configureFunc(networkManagerEffectiveConnectivityConfigurationClient.Client) + + networkManagerEffectiveSecurityAdminRulesClient, err := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkManagerEffectiveSecurityAdminRules client: %+v", err) + } + configureFunc(networkManagerEffectiveSecurityAdminRulesClient.Client) + + networkManagersClient, err := networkmanagers.NewNetworkManagersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkManagers client: %+v", err) + } + configureFunc(networkManagersClient.Client) + + networkProfilesClient, err := networkprofiles.NewNetworkProfilesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkProfiles client: %+v", err) + } + configureFunc(networkProfilesClient.Client) + + networkSecurityGroupsClient, err := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkSecurityGroups client: %+v", err) + } + configureFunc(networkSecurityGroupsClient.Client) + + networkVirtualAppliancesClient, err := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkVirtualAppliances client: %+v", err) + } + configureFunc(networkVirtualAppliancesClient.Client) + + networkWatchersClient, err := networkwatchers.NewNetworkWatchersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building NetworkWatchers client: %+v", err) + } + configureFunc(networkWatchersClient.Client) + + p2sVpnGatewaysClient, err := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building P2sVpnGateways client: %+v", err) + } + configureFunc(p2sVpnGatewaysClient.Client) + + packetCapturesClient, err := packetcaptures.NewPacketCapturesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PacketCaptures client: %+v", err) + } + configureFunc(packetCapturesClient.Client) + + peerExpressRouteCircuitConnectionsClient, err := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PeerExpressRouteCircuitConnections client: %+v", err) + } + configureFunc(peerExpressRouteCircuitConnectionsClient.Client) + + privateDnsZoneGroupsClient, err := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateDnsZoneGroups client: %+v", err) + } + configureFunc(privateDnsZoneGroupsClient.Client) + + privateEndpointsClient, err := privateendpoints.NewPrivateEndpointsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateEndpoints client: %+v", err) + } + configureFunc(privateEndpointsClient.Client) + + privateLinkServiceClient, err := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateLinkService client: %+v", err) + } + configureFunc(privateLinkServiceClient.Client) + + privateLinkServicesClient, err := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PrivateLinkServices client: %+v", err) + } + configureFunc(privateLinkServicesClient.Client) + + publicIPAddressesClient, err := publicipaddresses.NewPublicIPAddressesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PublicIPAddresses client: %+v", err) + } + configureFunc(publicIPAddressesClient.Client) + + publicIPPrefixesClient, err := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building PublicIPPrefixes client: %+v", err) + } + configureFunc(publicIPPrefixesClient.Client) + + routeFilterRulesClient, err := routefilterrules.NewRouteFilterRulesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building RouteFilterRules client: %+v", err) + } + configureFunc(routeFilterRulesClient.Client) + + routeFiltersClient, err := routefilters.NewRouteFiltersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building RouteFilters client: %+v", err) + } + configureFunc(routeFiltersClient.Client) + + routeTablesClient, err := routetables.NewRouteTablesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building RouteTables client: %+v", err) + } + configureFunc(routeTablesClient.Client) + + routesClient, err := routes.NewRoutesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Routes client: %+v", err) + } + configureFunc(routesClient.Client) + + scopeConnectionsClient, err := scopeconnections.NewScopeConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ScopeConnections client: %+v", err) + } + configureFunc(scopeConnectionsClient.Client) + + securityAdminConfigurationsClient, err := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SecurityAdminConfigurations client: %+v", err) + } + configureFunc(securityAdminConfigurationsClient.Client) + + securityPartnerProvidersClient, err := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SecurityPartnerProviders client: %+v", err) + } + configureFunc(securityPartnerProvidersClient.Client) + + securityRulesClient, err := securityrules.NewSecurityRulesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building SecurityRules client: %+v", err) + } + configureFunc(securityRulesClient.Client) + + serviceEndpointPoliciesClient, err := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ServiceEndpointPolicies client: %+v", err) + } + configureFunc(serviceEndpointPoliciesClient.Client) + + serviceEndpointPolicyDefinitionsClient, err := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ServiceEndpointPolicyDefinitions client: %+v", err) + } + configureFunc(serviceEndpointPolicyDefinitionsClient.Client) + + serviceTagsClient, err := servicetags.NewServiceTagsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building ServiceTags client: %+v", err) + } + configureFunc(serviceTagsClient.Client) + + staticMembersClient, err := staticmembers.NewStaticMembersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building StaticMembers client: %+v", err) + } + configureFunc(staticMembersClient.Client) + + subnetsClient, err := subnets.NewSubnetsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Subnets client: %+v", err) + } + configureFunc(subnetsClient.Client) + + trafficAnalyticsClient, err := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building TrafficAnalytics client: %+v", err) + } + configureFunc(trafficAnalyticsClient.Client) + + usagesClient, err := usages.NewUsagesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building Usages client: %+v", err) + } + configureFunc(usagesClient.Client) + + vMSSPublicIPAddressesClient, err := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VMSSPublicIPAddresses client: %+v", err) + } + configureFunc(vMSSPublicIPAddressesClient.Client) + + vipSwapClient, err := vipswap.NewVipSwapClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VipSwap client: %+v", err) + } + configureFunc(vipSwapClient.Client) + + virtualApplianceSitesClient, err := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualApplianceSites client: %+v", err) + } + configureFunc(virtualApplianceSitesClient.Client) + + virtualApplianceSkusClient, err := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualApplianceSkus client: %+v", err) + } + configureFunc(virtualApplianceSkusClient.Client) + + virtualNetworkGatewayConnectionsClient, err := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworkGatewayConnections client: %+v", err) + } + configureFunc(virtualNetworkGatewayConnectionsClient.Client) + + virtualNetworkGatewaysClient, err := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworkGateways client: %+v", err) + } + configureFunc(virtualNetworkGatewaysClient.Client) + + virtualNetworkPeeringsClient, err := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworkPeerings client: %+v", err) + } + configureFunc(virtualNetworkPeeringsClient.Client) + + virtualNetworkTapClient, err := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworkTap client: %+v", err) + } + configureFunc(virtualNetworkTapClient.Client) + + virtualNetworkTapsClient, err := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworkTaps client: %+v", err) + } + configureFunc(virtualNetworkTapsClient.Client) + + virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) + } + configureFunc(virtualNetworksClient.Client) + + virtualRouterPeeringsClient, err := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualRouterPeerings client: %+v", err) + } + configureFunc(virtualRouterPeeringsClient.Client) + + virtualRoutersClient, err := virtualrouters.NewVirtualRoutersClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualRouters client: %+v", err) + } + configureFunc(virtualRoutersClient.Client) + + virtualWANsClient, err := virtualwans.NewVirtualWANsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VirtualWANs client: %+v", err) + } + configureFunc(virtualWANsClient.Client) + + vpnGatewaysClient, err := vpngateways.NewVpnGatewaysClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VpnGateways client: %+v", err) + } + configureFunc(vpnGatewaysClient.Client) + + vpnLinkConnectionsClient, err := vpnlinkconnections.NewVpnLinkConnectionsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VpnLinkConnections client: %+v", err) + } + configureFunc(vpnLinkConnectionsClient.Client) + + vpnServerConfigurationsClient, err := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VpnServerConfigurations client: %+v", err) + } + configureFunc(vpnServerConfigurationsClient.Client) + + vpnSitesClient, err := vpnsites.NewVpnSitesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building VpnSites client: %+v", err) + } + configureFunc(vpnSitesClient.Client) + + webApplicationFirewallPoliciesClient, err := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building WebApplicationFirewallPolicies client: %+v", err) + } + configureFunc(webApplicationFirewallPoliciesClient.Client) + + webCategoriesClient, err := webcategories.NewWebCategoriesClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building WebCategories client: %+v", err) + } + configureFunc(webCategoriesClient.Client) + + return &Client{ + AdminRuleCollections: adminRuleCollectionsClient, + AdminRules: adminRulesClient, + ApplicationGatewayPrivateEndpointConnections: applicationGatewayPrivateEndpointConnectionsClient, + ApplicationGatewayPrivateLinkResources: applicationGatewayPrivateLinkResourcesClient, + ApplicationGatewayWafDynamicManifests: applicationGatewayWafDynamicManifestsClient, + ApplicationGateways: applicationGatewaysClient, + ApplicationSecurityGroups: applicationSecurityGroupsClient, + AvailableDelegations: availableDelegationsClient, + AvailableServiceAliases: availableServiceAliasesClient, + AzureFirewalls: azureFirewallsClient, + BastionHosts: bastionHostsClient, + BastionShareableLink: bastionShareableLinkClient, + BgpServiceCommunities: bgpServiceCommunitiesClient, + CheckDnsAvailabilities: checkDnsAvailabilitiesClient, + CloudServicePublicIPAddresses: cloudServicePublicIPAddressesClient, + ConnectionMonitors: connectionMonitorsClient, + ConnectivityConfigurations: connectivityConfigurationsClient, + CustomIPPrefixes: customIPPrefixesClient, + DdosCustomPolicies: ddosCustomPoliciesClient, + DdosProtectionPlans: ddosProtectionPlansClient, + DscpConfiguration: dscpConfigurationClient, + DscpConfigurations: dscpConfigurationsClient, + EndpointServices: endpointServicesClient, + ExpressRouteCircuitArpTable: expressRouteCircuitArpTableClient, + ExpressRouteCircuitAuthorizations: expressRouteCircuitAuthorizationsClient, + ExpressRouteCircuitConnections: expressRouteCircuitConnectionsClient, + ExpressRouteCircuitPeerings: expressRouteCircuitPeeringsClient, + ExpressRouteCircuitRoutesTable: expressRouteCircuitRoutesTableClient, + ExpressRouteCircuitRoutesTableSummary: expressRouteCircuitRoutesTableSummaryClient, + ExpressRouteCircuitStats: expressRouteCircuitStatsClient, + ExpressRouteCircuits: expressRouteCircuitsClient, + ExpressRouteConnections: expressRouteConnectionsClient, + ExpressRouteCrossConnectionArpTable: expressRouteCrossConnectionArpTableClient, + ExpressRouteCrossConnectionPeerings: expressRouteCrossConnectionPeeringsClient, + ExpressRouteCrossConnectionRouteTable: expressRouteCrossConnectionRouteTableClient, + ExpressRouteCrossConnectionRouteTableSummary: expressRouteCrossConnectionRouteTableSummaryClient, + ExpressRouteCrossConnections: expressRouteCrossConnectionsClient, + ExpressRouteGateways: expressRouteGatewaysClient, + ExpressRouteLinks: expressRouteLinksClient, + ExpressRoutePortAuthorizations: expressRoutePortAuthorizationsClient, + ExpressRoutePorts: expressRoutePortsClient, + ExpressRoutePortsLocations: expressRoutePortsLocationsClient, + ExpressRouteProviderPorts: expressRouteProviderPortsClient, + ExpressRouteServiceProviders: expressRouteServiceProvidersClient, + FirewallPolicies: firewallPoliciesClient, + FirewallPolicyRuleCollectionGroups: firewallPolicyRuleCollectionGroupsClient, + FlowLogs: flowLogsClient, + IPAllocations: iPAllocationsClient, + IPGroups: iPGroupsClient, + LoadBalancers: loadBalancersClient, + LocalNetworkGateways: localNetworkGatewaysClient, + NatGateways: natGatewaysClient, + NetworkGroups: networkGroupsClient, + NetworkInterfaces: networkInterfacesClient, + NetworkManagerActiveConfigurations: networkManagerActiveConfigurationsClient, + NetworkManagerActiveConnectivityConfigurations: networkManagerActiveConnectivityConfigurationsClient, + NetworkManagerConnections: networkManagerConnectionsClient, + NetworkManagerEffectiveConnectivityConfiguration: networkManagerEffectiveConnectivityConfigurationClient, + NetworkManagerEffectiveSecurityAdminRules: networkManagerEffectiveSecurityAdminRulesClient, + NetworkManagers: networkManagersClient, + NetworkProfiles: networkProfilesClient, + NetworkSecurityGroups: networkSecurityGroupsClient, + NetworkVirtualAppliances: networkVirtualAppliancesClient, + NetworkWatchers: networkWatchersClient, + P2sVpnGateways: p2sVpnGatewaysClient, + PacketCaptures: packetCapturesClient, + PeerExpressRouteCircuitConnections: peerExpressRouteCircuitConnectionsClient, + PrivateDnsZoneGroups: privateDnsZoneGroupsClient, + PrivateEndpoints: privateEndpointsClient, + PrivateLinkService: privateLinkServiceClient, + PrivateLinkServices: privateLinkServicesClient, + PublicIPAddresses: publicIPAddressesClient, + PublicIPPrefixes: publicIPPrefixesClient, + RouteFilterRules: routeFilterRulesClient, + RouteFilters: routeFiltersClient, + RouteTables: routeTablesClient, + Routes: routesClient, + ScopeConnections: scopeConnectionsClient, + SecurityAdminConfigurations: securityAdminConfigurationsClient, + SecurityPartnerProviders: securityPartnerProvidersClient, + SecurityRules: securityRulesClient, + ServiceEndpointPolicies: serviceEndpointPoliciesClient, + ServiceEndpointPolicyDefinitions: serviceEndpointPolicyDefinitionsClient, + ServiceTags: serviceTagsClient, + StaticMembers: staticMembersClient, + Subnets: subnetsClient, + TrafficAnalytics: trafficAnalyticsClient, + Usages: usagesClient, + VMSSPublicIPAddresses: vMSSPublicIPAddressesClient, + VipSwap: vipSwapClient, + VirtualApplianceSites: virtualApplianceSitesClient, + VirtualApplianceSkus: virtualApplianceSkusClient, + VirtualNetworkGatewayConnections: virtualNetworkGatewayConnectionsClient, + VirtualNetworkGateways: virtualNetworkGatewaysClient, + VirtualNetworkPeerings: virtualNetworkPeeringsClient, + VirtualNetworkTap: virtualNetworkTapClient, + VirtualNetworkTaps: virtualNetworkTapsClient, + VirtualNetworks: virtualNetworksClient, + VirtualRouterPeerings: virtualRouterPeeringsClient, + VirtualRouters: virtualRoutersClient, + VirtualWANs: virtualWANsClient, + VpnGateways: vpnGatewaysClient, + VpnLinkConnections: vpnLinkConnectionsClient, + VpnServerConfigurations: vpnServerConfigurationsClient, + VpnSites: vpnSitesClient, + WebApplicationFirewallPolicies: webApplicationFirewallPoliciesClient, + WebCategories: webCategoriesClient, + }, nil +} diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/README.md b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/README.md new file mode 100644 index 00000000000..93c1b955fdf --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/README.md @@ -0,0 +1,71 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/cloudservicepublicipaddresses` Documentation + +The `cloudservicepublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/cloudservicepublicipaddresses" +``` + + +### Client Initialization + +```go +client := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesGetCloudServicePublicIPAddress` + +```go +ctx := context.TODO() +id := commonids.NewCloudServicesPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") + +read, err := client.PublicIPAddressesGetCloudServicePublicIPAddress(ctx, id, cloudservicepublicipaddresses.DefaultPublicIPAddressesGetCloudServicePublicIPAddressOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServicePublicIPAddresses` + +```go +ctx := context.TODO() +id := cloudservicepublicipaddresses.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") + +// alternatively `client.PublicIPAddressesListCloudServicePublicIPAddresses(ctx, id)` can be used to do batched pagination +items, err := client.PublicIPAddressesListCloudServicePublicIPAddressesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses` + +```go +ctx := context.TODO() +id := commonids.NewCloudServicesIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue") + +// alternatively `client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx, id)` can be used to do batched pagination +items, err := client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/client.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/client.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/client.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/client.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/constants.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/constants.go new file mode 100644 index 00000000000..7d5aefa24ec --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/constants.go @@ -0,0 +1,1013 @@ +package cloudservicepublicipaddresses + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/id_providercloudservice.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/id_providercloudservice.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/id_providercloudservice.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/id_providercloudservice.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/id_providercloudservice_test.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/id_providercloudservice_test.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/id_providercloudservice_test.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/id_providercloudservice_test.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_backendaddresspool.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..b0cb1d74343 --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package cloudservicepublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ddossettings.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ddossettings.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_delegation.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_delegation.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_delegation.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_flowlog.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_flowlog.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_inboundnatrule.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_iptag.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_iptag.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_iptag.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natgateway.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natgateway.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natgatewaysku.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natruleportmapping.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterface.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterface.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..3d716d52cb5 --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package cloudservicepublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpoint.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpoint.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..bc8a1f66b67 --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package cloudservicepublicipaddresses + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkservice.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddress.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddress.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..c76bfdfbfaa --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package cloudservicepublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_resourceset.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_resourceset.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_route.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_route.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_route.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_routetable.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_routetable.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_routetable.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_securityrule.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_securityrule.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..e3d906f92be --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package cloudservicepublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subnet.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subnet.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subnet.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..750044c7125 --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package cloudservicepublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subresource.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subresource.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_subresource.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/predicates.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/cloudservicepublicipaddresses/predicates.go rename to resource-manager/network/2022-07-01/cloudservicepublicipaddresses/predicates.go diff --git a/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/version.go b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/version.go new file mode 100644 index 00000000000..ad6ed05b029 --- /dev/null +++ b/resource-manager/network/2022-07-01/cloudservicepublicipaddresses/version.go @@ -0,0 +1,12 @@ +package cloudservicepublicipaddresses + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/cloudservicepublicipaddresses/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/connectionmonitors/README.md b/resource-manager/network/2022-07-01/connectionmonitors/README.md new file mode 100644 index 00000000000..a0f346837d7 --- /dev/null +++ b/resource-manager/network/2022-07-01/connectionmonitors/README.md @@ -0,0 +1,138 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/connectionmonitors` Documentation + +The `connectionmonitors` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/connectionmonitors" +``` + + +### Client Initialization + +```go +client := connectionmonitors.NewConnectionMonitorsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ConnectionMonitorsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +payload := connectionmonitors.ConnectionMonitor{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload, connectionmonitors.DefaultCreateOrUpdateOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConnectionMonitorsClient.Delete` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConnectionMonitorsClient.Get` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +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: `ConnectionMonitorsClient.List` + +```go +ctx := context.TODO() +id := connectionmonitors.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +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: `ConnectionMonitorsClient.Query` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +if err := client.QueryThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConnectionMonitorsClient.Start` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +if err := client.StartThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConnectionMonitorsClient.Stop` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +if err := client.StopThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConnectionMonitorsClient.UpdateTags` + +```go +ctx := context.TODO() +id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") + +payload := connectionmonitors.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/network/2023-04-01/connectionmonitors/client.go b/resource-manager/network/2022-07-01/connectionmonitors/client.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/client.go rename to resource-manager/network/2022-07-01/connectionmonitors/client.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/constants.go b/resource-manager/network/2022-07-01/connectionmonitors/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/constants.go rename to resource-manager/network/2022-07-01/connectionmonitors/constants.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/id_connectionmonitor.go b/resource-manager/network/2022-07-01/connectionmonitors/id_connectionmonitor.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/id_connectionmonitor.go rename to resource-manager/network/2022-07-01/connectionmonitors/id_connectionmonitor.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/id_connectionmonitor_test.go b/resource-manager/network/2022-07-01/connectionmonitors/id_connectionmonitor_test.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/id_connectionmonitor_test.go rename to resource-manager/network/2022-07-01/connectionmonitors/id_connectionmonitor_test.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/id_networkwatcher.go b/resource-manager/network/2022-07-01/connectionmonitors/id_networkwatcher.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/id_networkwatcher.go rename to resource-manager/network/2022-07-01/connectionmonitors/id_networkwatcher.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/id_networkwatcher_test.go b/resource-manager/network/2022-07-01/connectionmonitors/id_networkwatcher_test.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/id_networkwatcher_test.go rename to resource-manager/network/2022-07-01/connectionmonitors/id_networkwatcher_test.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_createorupdate.go b/resource-manager/network/2022-07-01/connectionmonitors/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_createorupdate.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_delete.go b/resource-manager/network/2022-07-01/connectionmonitors/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_delete.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_delete.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_get.go b/resource-manager/network/2022-07-01/connectionmonitors/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_get.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_get.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_list.go b/resource-manager/network/2022-07-01/connectionmonitors/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_list.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_list.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_query.go b/resource-manager/network/2022-07-01/connectionmonitors/method_query.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_query.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_query.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_start.go b/resource-manager/network/2022-07-01/connectionmonitors/method_start.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_start.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_start.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_stop.go b/resource-manager/network/2022-07-01/connectionmonitors/method_stop.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_stop.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_stop.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/method_updatetags.go b/resource-manager/network/2022-07-01/connectionmonitors/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/method_updatetags.go rename to resource-manager/network/2022-07-01/connectionmonitors/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitor.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitor.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitor.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitor.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitordestination.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitordestination.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitordestination.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitordestination.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpoint.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpoint.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpoint.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointfilter.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointfilter.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointfilter.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointfilter.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointscope.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointscope.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointscope.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointscope.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorlistresult.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorlistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorlistresult.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorlistresult.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitoroutput.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitoroutput.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitoroutput.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitoroutput.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorparameters.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorparameters.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorparameters.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorqueryresult.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorqueryresult.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorqueryresult.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorqueryresult.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorresult.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorresult.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorresult.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorresult.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorresultproperties.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorresultproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorresultproperties.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorresultproperties.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorsource.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorsource.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorsource.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorsource.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitortcpconfiguration.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitortcpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitortcpconfiguration.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitortcpconfiguration.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitortestconfiguration.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitortestconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitortestconfiguration.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitortestconfiguration.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitortestgroup.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitortestgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitortestgroup.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitortestgroup.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorworkspacesettings.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorworkspacesettings.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionmonitorworkspacesettings.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionmonitorworkspacesettings.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectionstatesnapshot.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectionstatesnapshot.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectionstatesnapshot.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectionstatesnapshot.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectivityhop.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectivityhop.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectivityhop.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectivityhop.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_connectivityissue.go b/resource-manager/network/2022-07-01/connectionmonitors/model_connectivityissue.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_connectivityissue.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_connectivityissue.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_hoplink.go b/resource-manager/network/2022-07-01/connectionmonitors/model_hoplink.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_hoplink.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_hoplink.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_hoplinkproperties.go b/resource-manager/network/2022-07-01/connectionmonitors/model_hoplinkproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_hoplinkproperties.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_hoplinkproperties.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_httpheader.go b/resource-manager/network/2022-07-01/connectionmonitors/model_httpheader.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_httpheader.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_httpheader.go diff --git a/resource-manager/network/2023-04-01/connectionmonitors/model_tagsobject.go b/resource-manager/network/2022-07-01/connectionmonitors/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/connectionmonitors/model_tagsobject.go rename to resource-manager/network/2022-07-01/connectionmonitors/model_tagsobject.go diff --git a/resource-manager/network/2022-07-01/connectionmonitors/version.go b/resource-manager/network/2022-07-01/connectionmonitors/version.go new file mode 100644 index 00000000000..183c535f8d0 --- /dev/null +++ b/resource-manager/network/2022-07-01/connectionmonitors/version.go @@ -0,0 +1,12 @@ +package connectionmonitors + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/connectionmonitors/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/connectivityconfigurations/README.md b/resource-manager/network/2022-07-01/connectivityconfigurations/README.md new file mode 100644 index 00000000000..3c64ccef936 --- /dev/null +++ b/resource-manager/network/2022-07-01/connectivityconfigurations/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/connectivityconfigurations` Documentation + +The `connectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/connectivityconfigurations" +``` + + +### Client Initialization + +```go +client := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ConnectivityConfigurationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") + +payload := connectivityconfigurations.ConnectivityConfiguration{ + // ... +} + + +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: `ConnectivityConfigurationsClient.Delete` + +```go +ctx := context.TODO() +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") + +if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `ConnectivityConfigurationsClient.Get` + +```go +ctx := context.TODO() +id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") + +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: `ConnectivityConfigurationsClient.List` + +```go +ctx := context.TODO() +id := connectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +// alternatively `client.List(ctx, id, connectivityconfigurations.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, connectivityconfigurations.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/client.go b/resource-manager/network/2022-07-01/connectivityconfigurations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/client.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/client.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/constants.go b/resource-manager/network/2022-07-01/connectivityconfigurations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/constants.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/constants.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2022-07-01/connectivityconfigurations/id_connectivityconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/id_connectivityconfiguration.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/id_connectivityconfiguration.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2022-07-01/connectivityconfigurations/id_connectivityconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/id_connectivityconfiguration_test.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/id_connectivityconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/id_networkmanager.go b/resource-manager/network/2022-07-01/connectivityconfigurations/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/id_networkmanager.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/id_networkmanager_test.go b/resource-manager/network/2022-07-01/connectivityconfigurations/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/method_createorupdate.go b/resource-manager/network/2022-07-01/connectivityconfigurations/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/method_createorupdate.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/method_delete.go b/resource-manager/network/2022-07-01/connectivityconfigurations/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/method_delete.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/method_delete.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/method_get.go b/resource-manager/network/2022-07-01/connectivityconfigurations/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/method_get.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/method_get.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/method_list.go b/resource-manager/network/2022-07-01/connectivityconfigurations/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/method_list.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/method_list.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivityconfiguration.go b/resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivityconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivityconfiguration.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivityconfiguration.go diff --git a/resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivityconfigurationproperties.go new file mode 100644 index 00000000000..ccdec2929c7 --- /dev/null +++ b/resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivityconfigurationproperties.go @@ -0,0 +1,14 @@ +package connectivityconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectivityConfigurationProperties struct { + AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` + ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` + DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` + Description *string `json:"description,omitempty"` + Hubs *[]Hub `json:"hubs,omitempty"` + IsGlobal *IsGlobal `json:"isGlobal,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivitygroupitem.go b/resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivitygroupitem.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivitygroupitem.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/model_connectivitygroupitem.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/model_hub.go b/resource-manager/network/2022-07-01/connectivityconfigurations/model_hub.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/model_hub.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/model_hub.go diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/predicates.go b/resource-manager/network/2022-07-01/connectivityconfigurations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/connectivityconfigurations/predicates.go rename to resource-manager/network/2022-07-01/connectivityconfigurations/predicates.go diff --git a/resource-manager/network/2022-07-01/connectivityconfigurations/version.go b/resource-manager/network/2022-07-01/connectivityconfigurations/version.go new file mode 100644 index 00000000000..cc14e386a22 --- /dev/null +++ b/resource-manager/network/2022-07-01/connectivityconfigurations/version.go @@ -0,0 +1,12 @@ +package connectivityconfigurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/connectivityconfigurations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/customipprefixes/README.md b/resource-manager/network/2022-07-01/customipprefixes/README.md new file mode 100644 index 00000000000..baa2d7db847 --- /dev/null +++ b/resource-manager/network/2022-07-01/customipprefixes/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/customipprefixes` Documentation + +The `customipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/customipprefixes" +``` + + +### Client Initialization + +```go +client := customipprefixes.NewCustomIPPrefixesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `CustomIPPrefixesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") + +payload := customipprefixes.CustomIPPrefix{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `CustomIPPrefixesClient.Delete` + +```go +ctx := context.TODO() +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `CustomIPPrefixesClient.Get` + +```go +ctx := context.TODO() +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") + +read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `CustomIPPrefixesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `CustomIPPrefixesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `CustomIPPrefixesClient.UpdateTags` + +```go +ctx := context.TODO() +id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") + +payload := customipprefixes.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/network/2023-04-01/customipprefixes/client.go b/resource-manager/network/2022-07-01/customipprefixes/client.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/client.go rename to resource-manager/network/2022-07-01/customipprefixes/client.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/constants.go b/resource-manager/network/2022-07-01/customipprefixes/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/constants.go rename to resource-manager/network/2022-07-01/customipprefixes/constants.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2022-07-01/customipprefixes/id_customipprefix.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/id_customipprefix.go rename to resource-manager/network/2022-07-01/customipprefixes/id_customipprefix.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2022-07-01/customipprefixes/id_customipprefix_test.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/id_customipprefix_test.go rename to resource-manager/network/2022-07-01/customipprefixes/id_customipprefix_test.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/method_createorupdate.go b/resource-manager/network/2022-07-01/customipprefixes/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/method_createorupdate.go rename to resource-manager/network/2022-07-01/customipprefixes/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/method_delete.go b/resource-manager/network/2022-07-01/customipprefixes/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/method_delete.go rename to resource-manager/network/2022-07-01/customipprefixes/method_delete.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/method_get.go b/resource-manager/network/2022-07-01/customipprefixes/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/method_get.go rename to resource-manager/network/2022-07-01/customipprefixes/method_get.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/method_list.go b/resource-manager/network/2022-07-01/customipprefixes/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/method_list.go rename to resource-manager/network/2022-07-01/customipprefixes/method_list.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/method_listall.go b/resource-manager/network/2022-07-01/customipprefixes/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/method_listall.go rename to resource-manager/network/2022-07-01/customipprefixes/method_listall.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/method_updatetags.go b/resource-manager/network/2022-07-01/customipprefixes/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/method_updatetags.go rename to resource-manager/network/2022-07-01/customipprefixes/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/model_customipprefix.go b/resource-manager/network/2022-07-01/customipprefixes/model_customipprefix.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/model_customipprefix.go rename to resource-manager/network/2022-07-01/customipprefixes/model_customipprefix.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/model_customipprefixpropertiesformat.go b/resource-manager/network/2022-07-01/customipprefixes/model_customipprefixpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/model_customipprefixpropertiesformat.go rename to resource-manager/network/2022-07-01/customipprefixes/model_customipprefixpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/model_subresource.go b/resource-manager/network/2022-07-01/customipprefixes/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/model_subresource.go rename to resource-manager/network/2022-07-01/customipprefixes/model_subresource.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/model_tagsobject.go b/resource-manager/network/2022-07-01/customipprefixes/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/model_tagsobject.go rename to resource-manager/network/2022-07-01/customipprefixes/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/customipprefixes/predicates.go b/resource-manager/network/2022-07-01/customipprefixes/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/customipprefixes/predicates.go rename to resource-manager/network/2022-07-01/customipprefixes/predicates.go diff --git a/resource-manager/network/2022-07-01/customipprefixes/version.go b/resource-manager/network/2022-07-01/customipprefixes/version.go new file mode 100644 index 00000000000..6fee5d12371 --- /dev/null +++ b/resource-manager/network/2022-07-01/customipprefixes/version.go @@ -0,0 +1,12 @@ +package customipprefixes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/customipprefixes/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/ddoscustompolicies/README.md b/resource-manager/network/2022-07-01/ddoscustompolicies/README.md new file mode 100644 index 00000000000..c6ac5a2217b --- /dev/null +++ b/resource-manager/network/2022-07-01/ddoscustompolicies/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ddoscustompolicies` Documentation + +The `ddoscustompolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/ddoscustompolicies" +``` + + +### Client Initialization + +```go +client := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DdosCustomPoliciesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") + +payload := ddoscustompolicies.DdosCustomPolicy{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DdosCustomPoliciesClient.Delete` + +```go +ctx := context.TODO() +id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DdosCustomPoliciesClient.Get` + +```go +ctx := context.TODO() +id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") + +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: `DdosCustomPoliciesClient.UpdateTags` + +```go +ctx := context.TODO() +id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") + +payload := ddoscustompolicies.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/network/2023-04-01/ddoscustompolicies/client.go b/resource-manager/network/2022-07-01/ddoscustompolicies/client.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/client.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/client.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/constants.go b/resource-manager/network/2022-07-01/ddoscustompolicies/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/constants.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/constants.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/id_ddoscustompolicy.go b/resource-manager/network/2022-07-01/ddoscustompolicies/id_ddoscustompolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/id_ddoscustompolicy.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/id_ddoscustompolicy.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/id_ddoscustompolicy_test.go b/resource-manager/network/2022-07-01/ddoscustompolicies/id_ddoscustompolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/id_ddoscustompolicy_test.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/id_ddoscustompolicy_test.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/method_createorupdate.go b/resource-manager/network/2022-07-01/ddoscustompolicies/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/method_createorupdate.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/method_delete.go b/resource-manager/network/2022-07-01/ddoscustompolicies/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/method_delete.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/method_delete.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/method_get.go b/resource-manager/network/2022-07-01/ddoscustompolicies/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/method_get.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/method_get.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/method_updatetags.go b/resource-manager/network/2022-07-01/ddoscustompolicies/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/method_updatetags.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/model_ddoscustompolicy.go b/resource-manager/network/2022-07-01/ddoscustompolicies/model_ddoscustompolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/model_ddoscustompolicy.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/model_ddoscustompolicy.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go b/resource-manager/network/2022-07-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/model_tagsobject.go b/resource-manager/network/2022-07-01/ddoscustompolicies/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/ddoscustompolicies/model_tagsobject.go rename to resource-manager/network/2022-07-01/ddoscustompolicies/model_tagsobject.go diff --git a/resource-manager/network/2022-07-01/ddoscustompolicies/version.go b/resource-manager/network/2022-07-01/ddoscustompolicies/version.go new file mode 100644 index 00000000000..cbb0e680817 --- /dev/null +++ b/resource-manager/network/2022-07-01/ddoscustompolicies/version.go @@ -0,0 +1,12 @@ +package ddoscustompolicies + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/ddoscustompolicies/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/ddosprotectionplans/README.md b/resource-manager/network/2022-07-01/ddosprotectionplans/README.md new file mode 100644 index 00000000000..e191c9dd0ae --- /dev/null +++ b/resource-manager/network/2022-07-01/ddosprotectionplans/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ddosprotectionplans` Documentation + +The `ddosprotectionplans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/ddosprotectionplans" +``` + + +### Client Initialization + +```go +client := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DdosProtectionPlansClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") + +payload := ddosprotectionplans.DdosProtectionPlan{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DdosProtectionPlansClient.Delete` + +```go +ctx := context.TODO() +id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DdosProtectionPlansClient.Get` + +```go +ctx := context.TODO() +id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") + +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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.UpdateTags` + +```go +ctx := context.TODO() +id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") + +payload := ddosprotectionplans.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/network/2023-04-01/ddosprotectionplans/client.go b/resource-manager/network/2022-07-01/ddosprotectionplans/client.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/client.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/client.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/constants.go b/resource-manager/network/2022-07-01/ddosprotectionplans/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/constants.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/constants.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/id_ddosprotectionplan.go b/resource-manager/network/2022-07-01/ddosprotectionplans/id_ddosprotectionplan.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/id_ddosprotectionplan.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/id_ddosprotectionplan.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/id_ddosprotectionplan_test.go b/resource-manager/network/2022-07-01/ddosprotectionplans/id_ddosprotectionplan_test.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/id_ddosprotectionplan_test.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/id_ddosprotectionplan_test.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/method_createorupdate.go b/resource-manager/network/2022-07-01/ddosprotectionplans/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/method_createorupdate.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/method_delete.go b/resource-manager/network/2022-07-01/ddosprotectionplans/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/method_delete.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/method_delete.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/method_get.go b/resource-manager/network/2022-07-01/ddosprotectionplans/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/method_get.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/method_get.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/method_list.go b/resource-manager/network/2022-07-01/ddosprotectionplans/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/method_list.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/method_list.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/ddosprotectionplans/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/method_updatetags.go b/resource-manager/network/2022-07-01/ddosprotectionplans/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/method_updatetags.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/model_ddosprotectionplan.go b/resource-manager/network/2022-07-01/ddosprotectionplans/model_ddosprotectionplan.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/model_ddosprotectionplan.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/model_ddosprotectionplan.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go b/resource-manager/network/2022-07-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/model_subresource.go b/resource-manager/network/2022-07-01/ddosprotectionplans/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/model_subresource.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/model_subresource.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/model_tagsobject.go b/resource-manager/network/2022-07-01/ddosprotectionplans/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/model_tagsobject.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/predicates.go b/resource-manager/network/2022-07-01/ddosprotectionplans/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/ddosprotectionplans/predicates.go rename to resource-manager/network/2022-07-01/ddosprotectionplans/predicates.go diff --git a/resource-manager/network/2022-07-01/ddosprotectionplans/version.go b/resource-manager/network/2022-07-01/ddosprotectionplans/version.go new file mode 100644 index 00000000000..9d407555661 --- /dev/null +++ b/resource-manager/network/2022-07-01/ddosprotectionplans/version.go @@ -0,0 +1,12 @@ +package ddosprotectionplans + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/ddosprotectionplans/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/README.md b/resource-manager/network/2022-07-01/dscpconfiguration/README.md new file mode 100644 index 00000000000..9048ac9cce3 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/README.md @@ -0,0 +1,65 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/dscpconfiguration` Documentation + +The `dscpconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/dscpconfiguration" +``` + + +### Client Initialization + +```go +client := dscpconfiguration.NewDscpConfigurationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DscpConfigurationClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") + +payload := dscpconfiguration.DscpConfiguration{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DscpConfigurationClient.Delete` + +```go +ctx := context.TODO() +id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `DscpConfigurationClient.Get` + +```go +ctx := context.TODO() +id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") + +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 +} +``` diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/client.go b/resource-manager/network/2022-07-01/dscpconfiguration/client.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/client.go rename to resource-manager/network/2022-07-01/dscpconfiguration/client.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/constants.go b/resource-manager/network/2022-07-01/dscpconfiguration/constants.go new file mode 100644 index 00000000000..ef9b17da642 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/constants.go @@ -0,0 +1,1075 @@ +package dscpconfiguration + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProtocolType string + +const ( + ProtocolTypeAh ProtocolType = "Ah" + ProtocolTypeAll ProtocolType = "All" + ProtocolTypeDoNotUse ProtocolType = "DoNotUse" + ProtocolTypeEsp ProtocolType = "Esp" + ProtocolTypeGre ProtocolType = "Gre" + ProtocolTypeIcmp ProtocolType = "Icmp" + ProtocolTypeTcp ProtocolType = "Tcp" + ProtocolTypeUdp ProtocolType = "Udp" + ProtocolTypeVxlan ProtocolType = "Vxlan" +) + +func PossibleValuesForProtocolType() []string { + return []string{ + string(ProtocolTypeAh), + string(ProtocolTypeAll), + string(ProtocolTypeDoNotUse), + string(ProtocolTypeEsp), + string(ProtocolTypeGre), + string(ProtocolTypeIcmp), + string(ProtocolTypeTcp), + string(ProtocolTypeUdp), + string(ProtocolTypeVxlan), + } +} + +func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocolType(input string) (*ProtocolType, error) { + vals := map[string]ProtocolType{ + "ah": ProtocolTypeAh, + "all": ProtocolTypeAll, + "donotuse": ProtocolTypeDoNotUse, + "esp": ProtocolTypeEsp, + "gre": ProtocolTypeGre, + "icmp": ProtocolTypeIcmp, + "tcp": ProtocolTypeTcp, + "udp": ProtocolTypeUdp, + "vxlan": ProtocolTypeVxlan, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProtocolType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/id_dscpconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/id_dscpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/id_dscpconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/id_dscpconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/id_dscpconfiguration_test.go b/resource-manager/network/2022-07-01/dscpconfiguration/id_dscpconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/id_dscpconfiguration_test.go rename to resource-manager/network/2022-07-01/dscpconfiguration/id_dscpconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/method_createorupdate.go b/resource-manager/network/2022-07-01/dscpconfiguration/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/method_createorupdate.go rename to resource-manager/network/2022-07-01/dscpconfiguration/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/method_delete.go b/resource-manager/network/2022-07-01/dscpconfiguration/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/method_delete.go rename to resource-manager/network/2022-07-01/dscpconfiguration/method_delete.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/method_get.go b/resource-manager/network/2022-07-01/dscpconfiguration/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/method_get.go rename to resource-manager/network/2022-07-01/dscpconfiguration/method_get.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_backendaddresspool.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..3e973574814 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package dscpconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_ddossettings.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_ddossettings.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_delegation.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_delegation.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_delegation.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_dscpconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_dscpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_dscpconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_dscpconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_flowlog.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_flowlog.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_inboundnatrule.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_iptag.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_iptag.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_iptag.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_natgateway.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_natgateway.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_natgatewaysku.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_natruleportmapping.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterface.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterface.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..9cdc00b2066 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package dscpconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpoint.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpoint.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..ca624354be3 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package dscpconfiguration + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkservice.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddress.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddress.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..a36b23f31ae --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package dscpconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_qosdefinition.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_qosdefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_qosdefinition.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_qosdefinition.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_qosiprange.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_qosiprange.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_qosiprange.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_qosiprange.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_qosportrange.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_qosportrange.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_qosportrange.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_qosportrange.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_resourceset.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_resourceset.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_route.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_route.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_route.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_routetable.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_routetable.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_routetable.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_securityrule.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_securityrule.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..91248197612 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package dscpconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_subnet.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_subnet.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_subnet.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..9750fc81dd6 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package dscpconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_subresource.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_subresource.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_subresource.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2022-07-01/dscpconfiguration/version.go b/resource-manager/network/2022-07-01/dscpconfiguration/version.go new file mode 100644 index 00000000000..9db3e6bc973 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfiguration/version.go @@ -0,0 +1,12 @@ +package dscpconfiguration + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfiguration/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/README.md b/resource-manager/network/2022-07-01/dscpconfigurations/README.md new file mode 100644 index 00000000000..781a8d65a97 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/README.md @@ -0,0 +1,55 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/dscpconfigurations` Documentation + +The `dscpconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/dscpconfigurations" +``` + + +### Client Initialization + +```go +client := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DscpConfigurationsClient.DscpConfigurationList` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.DscpConfigurationList(ctx, id)` can be used to do batched pagination +items, err := client.DscpConfigurationListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DscpConfigurationsClient.DscpConfigurationListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.DscpConfigurationListAll(ctx, id)` can be used to do batched pagination +items, err := client.DscpConfigurationListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/client.go b/resource-manager/network/2022-07-01/dscpconfigurations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/client.go rename to resource-manager/network/2022-07-01/dscpconfigurations/client.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/constants.go b/resource-manager/network/2022-07-01/dscpconfigurations/constants.go new file mode 100644 index 00000000000..cf6addd5672 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/constants.go @@ -0,0 +1,1075 @@ +package dscpconfigurations + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProtocolType string + +const ( + ProtocolTypeAh ProtocolType = "Ah" + ProtocolTypeAll ProtocolType = "All" + ProtocolTypeDoNotUse ProtocolType = "DoNotUse" + ProtocolTypeEsp ProtocolType = "Esp" + ProtocolTypeGre ProtocolType = "Gre" + ProtocolTypeIcmp ProtocolType = "Icmp" + ProtocolTypeTcp ProtocolType = "Tcp" + ProtocolTypeUdp ProtocolType = "Udp" + ProtocolTypeVxlan ProtocolType = "Vxlan" +) + +func PossibleValuesForProtocolType() []string { + return []string{ + string(ProtocolTypeAh), + string(ProtocolTypeAll), + string(ProtocolTypeDoNotUse), + string(ProtocolTypeEsp), + string(ProtocolTypeGre), + string(ProtocolTypeIcmp), + string(ProtocolTypeTcp), + string(ProtocolTypeUdp), + string(ProtocolTypeVxlan), + } +} + +func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProtocolType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProtocolType(input string) (*ProtocolType, error) { + vals := map[string]ProtocolType{ + "ah": ProtocolTypeAh, + "all": ProtocolTypeAll, + "donotuse": ProtocolTypeDoNotUse, + "esp": ProtocolTypeEsp, + "gre": ProtocolTypeGre, + "icmp": ProtocolTypeIcmp, + "tcp": ProtocolTypeTcp, + "udp": ProtocolTypeUdp, + "vxlan": ProtocolTypeVxlan, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProtocolType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/method_dscpconfigurationlist.go b/resource-manager/network/2022-07-01/dscpconfigurations/method_dscpconfigurationlist.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/method_dscpconfigurationlist.go rename to resource-manager/network/2022-07-01/dscpconfigurations/method_dscpconfigurationlist.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/method_dscpconfigurationlistall.go b/resource-manager/network/2022-07-01/dscpconfigurations/method_dscpconfigurationlistall.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/method_dscpconfigurationlistall.go rename to resource-manager/network/2022-07-01/dscpconfigurations/method_dscpconfigurationlistall.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_backendaddresspool.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..b2db6065b70 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package dscpconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_ddossettings.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_ddossettings.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_delegation.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_delegation.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_delegation.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_dscpconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_dscpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_dscpconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_dscpconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_flowlog.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_flowlog.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_inboundnatrule.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_iptag.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_iptag.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_iptag.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_natgateway.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_natgateway.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_natgatewaysku.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_natruleportmapping.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterface.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterface.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..9e602b5b837 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package dscpconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpoint.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpoint.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..85fd55f5a6b --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package dscpconfigurations + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkservice.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddress.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddress.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..744f8e15385 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package dscpconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_qosdefinition.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_qosdefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_qosdefinition.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_qosdefinition.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_qosiprange.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_qosiprange.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_qosiprange.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_qosiprange.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_qosportrange.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_qosportrange.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_qosportrange.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_qosportrange.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_resourceset.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_resourceset.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_route.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_route.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_route.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_routetable.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_routetable.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_routetable.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_securityrule.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_securityrule.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..103e6146e17 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package dscpconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_subnet.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_subnet.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_subnet.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..263308f4a0f --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package dscpconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_subresource.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_subresource.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_subresource.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/predicates.go b/resource-manager/network/2022-07-01/dscpconfigurations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/dscpconfigurations/predicates.go rename to resource-manager/network/2022-07-01/dscpconfigurations/predicates.go diff --git a/resource-manager/network/2022-07-01/dscpconfigurations/version.go b/resource-manager/network/2022-07-01/dscpconfigurations/version.go new file mode 100644 index 00000000000..d82fc410603 --- /dev/null +++ b/resource-manager/network/2022-07-01/dscpconfigurations/version.go @@ -0,0 +1,12 @@ +package dscpconfigurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfigurations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/endpointservices/README.md b/resource-manager/network/2022-07-01/endpointservices/README.md new file mode 100644 index 00000000000..eebef2c0d31 --- /dev/null +++ b/resource-manager/network/2022-07-01/endpointservices/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/endpointservices` Documentation + +The `endpointservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/endpointservices" +``` + + +### Client Initialization + +```go +client := endpointservices.NewEndpointServicesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `EndpointServicesClient.AvailableEndpointServicesList` + +```go +ctx := context.TODO() +id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination +items, err := client.AvailableEndpointServicesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/endpointservices/client.go b/resource-manager/network/2022-07-01/endpointservices/client.go similarity index 100% rename from resource-manager/network/2023-04-01/endpointservices/client.go rename to resource-manager/network/2022-07-01/endpointservices/client.go diff --git a/resource-manager/network/2023-04-01/endpointservices/id_location.go b/resource-manager/network/2022-07-01/endpointservices/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/endpointservices/id_location.go rename to resource-manager/network/2022-07-01/endpointservices/id_location.go diff --git a/resource-manager/network/2023-04-01/endpointservices/id_location_test.go b/resource-manager/network/2022-07-01/endpointservices/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/endpointservices/id_location_test.go rename to resource-manager/network/2022-07-01/endpointservices/id_location_test.go diff --git a/resource-manager/network/2023-04-01/endpointservices/method_availableendpointserviceslist.go b/resource-manager/network/2022-07-01/endpointservices/method_availableendpointserviceslist.go similarity index 100% rename from resource-manager/network/2023-04-01/endpointservices/method_availableendpointserviceslist.go rename to resource-manager/network/2022-07-01/endpointservices/method_availableendpointserviceslist.go diff --git a/resource-manager/network/2023-04-01/endpointservices/model_endpointserviceresult.go b/resource-manager/network/2022-07-01/endpointservices/model_endpointserviceresult.go similarity index 100% rename from resource-manager/network/2023-04-01/endpointservices/model_endpointserviceresult.go rename to resource-manager/network/2022-07-01/endpointservices/model_endpointserviceresult.go diff --git a/resource-manager/network/2023-04-01/endpointservices/predicates.go b/resource-manager/network/2022-07-01/endpointservices/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/endpointservices/predicates.go rename to resource-manager/network/2022-07-01/endpointservices/predicates.go diff --git a/resource-manager/network/2022-07-01/endpointservices/version.go b/resource-manager/network/2022-07-01/endpointservices/version.go new file mode 100644 index 00000000000..67aa5f0eb0d --- /dev/null +++ b/resource-manager/network/2022-07-01/endpointservices/version.go @@ -0,0 +1,12 @@ +package endpointservices + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/endpointservices/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitarptable/README.md b/resource-manager/network/2022-07-01/expressroutecircuitarptable/README.md new file mode 100644 index 00000000000..b3e23d5a5e8 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitarptable/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitarptable` Documentation + +The `expressroutecircuitarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitarptable" +``` + + +### Client Initialization + +```go +client := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitArpTableClient.ExpressRouteCircuitsListArpTable` + +```go +ctx := context.TODO() +id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue") + +// alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination +items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/client.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitarptable/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitarptable/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/id_arptable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitarptable/id_arptable.go rename to resource-manager/network/2022-07-01/expressroutecircuitarptable/id_arptable.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/id_arptable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitarptable/id_arptable_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitarptable/id_arptable_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go rename to resource-manager/network/2022-07-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go rename to resource-manager/network/2022-07-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitarptable/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuitarptable/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitarptable/version.go b/resource-manager/network/2022-07-01/expressroutecircuitarptable/version.go new file mode 100644 index 00000000000..f4d8aef3a29 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitarptable/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitarptable + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitarptable/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/README.md new file mode 100644 index 00000000000..6e99f37aaf3 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitauthorizations` Documentation + +The `expressroutecircuitauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitauthorizations" +``` + + +### Client Initialization + +```go +client := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") + +payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") + +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: `ExpressRouteCircuitAuthorizationsClient.List` + +```go +ctx := context.TODO() +id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +// 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/network/2023-04-01/expressroutecircuitauthorizations/client.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/constants.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/constants.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_authorization.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_authorization.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_authorization.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_authorization_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_authorization_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_authorization_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_expressroutecircuit.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_expressroutecircuit.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_expressroutecircuit.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_delete.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_delete.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_get.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_get.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_list.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/method_list.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitauthorizations/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuitauthorizations/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/version.go b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/version.go new file mode 100644 index 00000000000..20c8f0aab45 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitauthorizations/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitauthorizations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitauthorizations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitconnections/README.md b/resource-manager/network/2022-07-01/expressroutecircuitconnections/README.md new file mode 100644 index 00000000000..f58e8dfa7cb --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitconnections/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitconnections` Documentation + +The `expressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitconnections" +``` + + +### Client Initialization + +```go +client := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") + +payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitConnectionsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") + +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: `ExpressRouteCircuitConnectionsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +// 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/network/2023-04-01/expressroutecircuitconnections/client.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/constants.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/constants.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/id_peeringconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/id_peeringconnection.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/id_peeringconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/id_peeringconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/id_peeringconnection_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/id_peeringconnection_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/method_delete.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/method_delete.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/method_get.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/method_get.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/method_list.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/method_list.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/model_subresource.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/model_subresource.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitconnections/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuitconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitconnections/version.go b/resource-manager/network/2022-07-01/expressroutecircuitconnections/version.go new file mode 100644 index 00000000000..55ae80da518 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitconnections/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/README.md new file mode 100644 index 00000000000..d58f971e4f6 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitpeerings` Documentation + +The `expressroutecircuitpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitpeerings" +``` + + +### Client Initialization + +```go +client := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitPeeringsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitPeeringsClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitPeeringsClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +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: `ExpressRouteCircuitPeeringsClient.List` + +```go +ctx := context.TODO() +id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +// 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/network/2023-04-01/expressroutecircuitpeerings/client.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/constants.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/constants.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/id_expressroutecircuit.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/id_expressroutecircuit.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/id_expressroutecircuit.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_delete.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_delete.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_get.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_get.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_list.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/method_list.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_subresource.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/model_subresource.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitpeerings/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuitpeerings/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitpeerings/version.go b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/version.go new file mode 100644 index 00000000000..a1fd1361bed --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitpeerings/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitpeerings + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitpeerings/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/README.md new file mode 100644 index 00000000000..396247ded30 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitroutestable` Documentation + +The `expressroutecircuitroutestable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitroutestable" +``` + + +### Client Initialization + +```go +client := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitRoutesTableClient.ExpressRouteCircuitsListRoutesTable` + +```go +ctx := context.TODO() +id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue") + +// alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination +items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/client.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestable/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestable/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/id_peeringroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestable/id_peeringroutetable.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestable/id_peeringroutetable.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/id_peeringroutetable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestable/id_peeringroutetable_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestable/id_peeringroutetable_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestable/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestable/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitroutestable/version.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/version.go new file mode 100644 index 00000000000..3e6fe28ff57 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitroutestable/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitroutestable + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestable/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/README.md new file mode 100644 index 00000000000..3456184252e --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary` Documentation + +The `expressroutecircuitroutestablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitroutestablesummary" +``` + + +### Client Initialization + +```go +client := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitRoutesTableSummaryClient.ExpressRouteCircuitsListRoutesTableSummary` + +```go +ctx := context.TODO() +id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue") + +// alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination +items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/client.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/id_routetablessummary.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/id_routetablessummary.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/id_routetablessummary.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/version.go b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/version.go new file mode 100644 index 00000000000..767b5098ae7 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitroutestablesummary/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitroutestablesummary + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestablesummary/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuits/README.md b/resource-manager/network/2022-07-01/expressroutecircuits/README.md new file mode 100644 index 00000000000..6b129d4ce0e --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuits/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuits` Documentation + +The `expressroutecircuits` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuits" +``` + + +### Client Initialization + +```go +client := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +payload := expressroutecircuits.ExpressRouteCircuit{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCircuitsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +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: `ExpressRouteCircuitsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `ExpressRouteCircuitsClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ExpressRouteCircuitsClient.UpdateTags` + +```go +ctx := context.TODO() +id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +payload := expressroutecircuits.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/network/2023-04-01/expressroutecircuits/client.go b/resource-manager/network/2022-07-01/expressroutecircuits/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/client.go rename to resource-manager/network/2022-07-01/expressroutecircuits/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/constants.go b/resource-manager/network/2022-07-01/expressroutecircuits/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/constants.go rename to resource-manager/network/2022-07-01/expressroutecircuits/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2022-07-01/expressroutecircuits/id_expressroutecircuit.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/id_expressroutecircuit.go rename to resource-manager/network/2022-07-01/expressroutecircuits/id_expressroutecircuit.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2022-07-01/expressroutecircuits/id_expressroutecircuit_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/id_expressroutecircuit_test.go rename to resource-manager/network/2022-07-01/expressroutecircuits/id_expressroutecircuit_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutecircuits/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutecircuits/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/method_delete.go b/resource-manager/network/2022-07-01/expressroutecircuits/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/method_delete.go rename to resource-manager/network/2022-07-01/expressroutecircuits/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/method_get.go b/resource-manager/network/2022-07-01/expressroutecircuits/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/method_get.go rename to resource-manager/network/2022-07-01/expressroutecircuits/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/method_list.go b/resource-manager/network/2022-07-01/expressroutecircuits/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/method_list.go rename to resource-manager/network/2022-07-01/expressroutecircuits/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/method_listall.go b/resource-manager/network/2022-07-01/expressroutecircuits/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/method_listall.go rename to resource-manager/network/2022-07-01/expressroutecircuits/method_listall.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/method_updatetags.go b/resource-manager/network/2022-07-01/expressroutecircuits/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/method_updatetags.go rename to resource-manager/network/2022-07-01/expressroutecircuits/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_authorizationpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_authorizationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_authorizationpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_authorizationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuit.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuit.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuit.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuit.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitauthorization.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitauthorization.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitauthorization.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitauthorization.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitconnection.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpeering.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpeering.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpeering.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go new file mode 100644 index 00000000000..7a9d58b92db --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go @@ -0,0 +1,22 @@ +package expressroutecircuits + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ExpressRouteCircuitPropertiesFormat struct { + AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` + AuthorizationKey *string `json:"authorizationKey,omitempty"` + Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` + BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` + CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` + ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` + GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` + GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` + Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ServiceKey *string `json:"serviceKey,omitempty"` + ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` + ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` + ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` + Stag *int64 `json:"stag,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitsku.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitsku.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitsku.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitsku.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitstats.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitstats.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitstats.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressroutecircuitstats.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressrouteconnectionid.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_expressrouteconnectionid.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_expressrouteconnectionid.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_expressrouteconnectionid.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_subresource.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_subresource.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/model_tagsobject.go b/resource-manager/network/2022-07-01/expressroutecircuits/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/model_tagsobject.go rename to resource-manager/network/2022-07-01/expressroutecircuits/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/predicates.go b/resource-manager/network/2022-07-01/expressroutecircuits/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuits/predicates.go rename to resource-manager/network/2022-07-01/expressroutecircuits/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuits/version.go b/resource-manager/network/2022-07-01/expressroutecircuits/version.go new file mode 100644 index 00000000000..9a462e93baa --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuits/version.go @@ -0,0 +1,12 @@ +package expressroutecircuits + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuits/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecircuitstats/README.md b/resource-manager/network/2022-07-01/expressroutecircuitstats/README.md new file mode 100644 index 00000000000..0621108a7ec --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitstats/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecircuitstats` Documentation + +The `expressroutecircuitstats` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecircuitstats" +``` + + +### Client Initialization + +```go +client := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetPeeringStats` + +```go +ctx := context.TODO() +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetStats` + +```go +ctx := context.TODO() +id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") + +read, err := client.ExpressRouteCircuitsGetStats(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/network/2023-04-01/expressroutecircuitstats/client.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitstats/client.go rename to resource-manager/network/2022-07-01/expressroutecircuitstats/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/id_expressroutecircuit.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitstats/id_expressroutecircuit.go rename to resource-manager/network/2022-07-01/expressroutecircuitstats/id_expressroutecircuit.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/id_expressroutecircuit_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitstats/id_expressroutecircuit_test.go rename to resource-manager/network/2022-07-01/expressroutecircuitstats/id_expressroutecircuit_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go rename to resource-manager/network/2022-07-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go rename to resource-manager/network/2022-07-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go diff --git a/resource-manager/network/2023-04-01/expressroutecircuitstats/model_expressroutecircuitstats.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/model_expressroutecircuitstats.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecircuitstats/model_expressroutecircuitstats.go rename to resource-manager/network/2022-07-01/expressroutecircuitstats/model_expressroutecircuitstats.go diff --git a/resource-manager/network/2022-07-01/expressroutecircuitstats/version.go b/resource-manager/network/2022-07-01/expressroutecircuitstats/version.go new file mode 100644 index 00000000000..dd19dbedf71 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecircuitstats/version.go @@ -0,0 +1,12 @@ +package expressroutecircuitstats + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitstats/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressrouteconnections/README.md b/resource-manager/network/2022-07-01/expressrouteconnections/README.md new file mode 100644 index 00000000000..9944c554478 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteconnections/README.md @@ -0,0 +1,81 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteconnections` Documentation + +The `expressrouteconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressrouteconnections" +``` + + +### Client Initialization + +```go +client := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") + +payload := expressrouteconnections.ExpressRouteConnection{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteConnectionsClient.Get` + +```go +ctx := context.TODO() +id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") + +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: `ExpressRouteConnectionsClient.List` + +```go +ctx := context.TODO() +id := expressrouteconnections.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") + +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/network/2023-04-01/expressrouteconnections/client.go b/resource-manager/network/2022-07-01/expressrouteconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/client.go rename to resource-manager/network/2022-07-01/expressrouteconnections/client.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/constants.go b/resource-manager/network/2022-07-01/expressrouteconnections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/constants.go rename to resource-manager/network/2022-07-01/expressrouteconnections/constants.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2022-07-01/expressrouteconnections/id_expressrouteconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/id_expressrouteconnection.go rename to resource-manager/network/2022-07-01/expressrouteconnections/id_expressrouteconnection.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2022-07-01/expressrouteconnections/id_expressrouteconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/id_expressrouteconnection_test.go rename to resource-manager/network/2022-07-01/expressrouteconnections/id_expressrouteconnection_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/id_expressroutegateway.go b/resource-manager/network/2022-07-01/expressrouteconnections/id_expressroutegateway.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/id_expressroutegateway.go rename to resource-manager/network/2022-07-01/expressrouteconnections/id_expressroutegateway.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/id_expressroutegateway_test.go b/resource-manager/network/2022-07-01/expressrouteconnections/id_expressroutegateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/id_expressroutegateway_test.go rename to resource-manager/network/2022-07-01/expressrouteconnections/id_expressroutegateway_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/method_createorupdate.go b/resource-manager/network/2022-07-01/expressrouteconnections/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressrouteconnections/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/method_delete.go b/resource-manager/network/2022-07-01/expressrouteconnections/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/method_delete.go rename to resource-manager/network/2022-07-01/expressrouteconnections/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/method_get.go b/resource-manager/network/2022-07-01/expressrouteconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/method_get.go rename to resource-manager/network/2022-07-01/expressrouteconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/method_list.go b/resource-manager/network/2022-07-01/expressrouteconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/method_list.go rename to resource-manager/network/2022-07-01/expressrouteconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_expressroutecircuitpeeringid.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_expressroutecircuitpeeringid.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_expressroutecircuitpeeringid.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_expressroutecircuitpeeringid.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_expressrouteconnection.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_expressrouteconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_expressrouteconnection.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_expressrouteconnection.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_expressrouteconnectionlist.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_expressrouteconnectionlist.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_expressrouteconnectionlist.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_expressrouteconnectionlist.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_expressrouteconnectionproperties.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_expressrouteconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_expressrouteconnectionproperties.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_expressrouteconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_propagatedroutetable.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_propagatedroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_propagatedroutetable.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_propagatedroutetable.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_routingconfiguration.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_routingconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_routingconfiguration.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_routingconfiguration.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_staticroute.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_staticroute.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_staticroute.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_staticroute.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_staticroutesconfig.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_staticroutesconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_staticroutesconfig.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_staticroutesconfig.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_subresource.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_subresource.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/model_vnetroute.go b/resource-manager/network/2022-07-01/expressrouteconnections/model_vnetroute.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteconnections/model_vnetroute.go rename to resource-manager/network/2022-07-01/expressrouteconnections/model_vnetroute.go diff --git a/resource-manager/network/2022-07-01/expressrouteconnections/version.go b/resource-manager/network/2022-07-01/expressrouteconnections/version.go new file mode 100644 index 00000000000..e74f407973f --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteconnections/version.go @@ -0,0 +1,12 @@ +package expressrouteconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/README.md new file mode 100644 index 00000000000..257ac2ba9f2 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable` Documentation + +The `expressroutecrossconnectionarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecrossconnectionarptable" +``` + + +### Client Initialization + +```go +client := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCrossConnectionArpTableClient.ExpressRouteCrossConnectionsListArpTable` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue") + +// alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination +items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/client.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/client.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/id_peeringarptable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/id_peeringarptable.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/id_peeringarptable.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/predicates.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/predicates.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/version.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/version.go new file mode 100644 index 00000000000..fffea55fda1 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionarptable/version.go @@ -0,0 +1,12 @@ +package expressroutecrossconnectionarptable + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionarptable/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/README.md new file mode 100644 index 00000000000..ae3704afd11 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings` Documentation + +The `expressroutecrossconnectionpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecrossconnectionpeerings" +``` + + +### Client Initialization + +```go +client := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") + +payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Delete` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") + +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: `ExpressRouteCrossConnectionPeeringsClient.List` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") + +// 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/network/2023-04-01/expressroutecrossconnectionpeerings/client.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/client.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/constants.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/constants.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_peering.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_peering.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_peering.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_peering_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/id_peering_test.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/id_peering_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_delete.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_delete.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_get.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_get.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_list.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/method_list.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_subresource.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/model_subresource.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/predicates.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/predicates.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/version.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/version.go new file mode 100644 index 00000000000..24db4f8cdb2 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionpeerings/version.go @@ -0,0 +1,12 @@ +package expressroutecrossconnectionpeerings + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionpeerings/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/README.md new file mode 100644 index 00000000000..d4148689ad5 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable` Documentation + +The `expressroutecrossconnectionroutetable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecrossconnectionroutetable" +``` + + +### Client Initialization + +```go +client := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCrossConnectionRouteTableClient.ExpressRouteCrossConnectionsListRoutesTable` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue") + +// alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination +items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/client.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/client.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/predicates.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/predicates.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/version.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/version.go new file mode 100644 index 00000000000..7fd9bd1ca23 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetable/version.go @@ -0,0 +1,12 @@ +package expressroutecrossconnectionroutetable + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetable/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/README.md new file mode 100644 index 00000000000..540c0f81a20 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary` Documentation + +The `expressroutecrossconnectionroutetablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecrossconnectionroutetablesummary" +``` + + +### Client Initialization + +```go +client := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCrossConnectionRouteTableSummaryClient.ExpressRouteCrossConnectionsListRoutesTableSummary` + +```go +ctx := context.TODO() +id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue") + +// alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination +items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/client.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/client.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/predicates.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/predicates.go rename to resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/version.go b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/version.go new file mode 100644 index 00000000000..375d30493fd --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnectionroutetablesummary/version.go @@ -0,0 +1,12 @@ +package expressroutecrossconnectionroutetablesummary + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetablesummary/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnections/README.md b/resource-manager/network/2022-07-01/expressroutecrossconnections/README.md new file mode 100644 index 00000000000..b836627f735 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnections/README.md @@ -0,0 +1,109 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutecrossconnections` Documentation + +The `expressroutecrossconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutecrossconnections" +``` + + +### Client Initialization + +```go +client := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteCrossConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") + +payload := expressroutecrossconnections.ExpressRouteCrossConnection{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteCrossConnectionsClient.Get` + +```go +ctx := context.TODO() +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") + +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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.UpdateTags` + +```go +ctx := context.TODO() +id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") + +payload := expressroutecrossconnections.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/network/2023-04-01/expressroutecrossconnections/client.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/client.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/client.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/constants.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/constants.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/id_expressroutecrossconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/id_expressroutecrossconnection.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/id_expressroutecrossconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/method_get.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/method_get.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/method_list.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/method_list.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/method_updatetags.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/method_updatetags.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecircuitreference.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecircuitreference.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecircuitreference.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecircuitreference.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnection.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnection.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_subresource.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_subresource.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/model_tagsobject.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/model_tagsobject.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/predicates.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutecrossconnections/predicates.go rename to resource-manager/network/2022-07-01/expressroutecrossconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutecrossconnections/version.go b/resource-manager/network/2022-07-01/expressroutecrossconnections/version.go new file mode 100644 index 00000000000..1557ebcc93b --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutecrossconnections/version.go @@ -0,0 +1,12 @@ +package expressroutecrossconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutegateways/README.md b/resource-manager/network/2022-07-01/expressroutegateways/README.md new file mode 100644 index 00000000000..77cb91d0458 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutegateways/README.md @@ -0,0 +1,115 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutegateways` Documentation + +The `expressroutegateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutegateways" +``` + + +### Client Initialization + +```go +client := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteGatewaysClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") + +payload := expressroutegateways.ExpressRouteGateway{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteGatewaysClient.Delete` + +```go +ctx := context.TODO() +id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRouteGatewaysClient.Get` + +```go +ctx := context.TODO() +id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") + +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: `ExpressRouteGatewaysClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +read, err := client.ListByResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExpressRouteGatewaysClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListBySubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExpressRouteGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") + +payload := expressroutegateways.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/expressroutegateways/client.go b/resource-manager/network/2022-07-01/expressroutegateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/client.go rename to resource-manager/network/2022-07-01/expressroutegateways/client.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/constants.go b/resource-manager/network/2022-07-01/expressroutegateways/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/constants.go rename to resource-manager/network/2022-07-01/expressroutegateways/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/id_expressroutegateway.go b/resource-manager/network/2022-07-01/expressroutegateways/id_expressroutegateway.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/id_expressroutegateway.go rename to resource-manager/network/2022-07-01/expressroutegateways/id_expressroutegateway.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/id_expressroutegateway_test.go b/resource-manager/network/2022-07-01/expressroutegateways/id_expressroutegateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/id_expressroutegateway_test.go rename to resource-manager/network/2022-07-01/expressroutegateways/id_expressroutegateway_test.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/method_createorupdate.go b/resource-manager/network/2022-07-01/expressroutegateways/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressroutegateways/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/method_delete.go b/resource-manager/network/2022-07-01/expressroutegateways/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/method_delete.go rename to resource-manager/network/2022-07-01/expressroutegateways/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/method_get.go b/resource-manager/network/2022-07-01/expressroutegateways/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/method_get.go rename to resource-manager/network/2022-07-01/expressroutegateways/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/expressroutegateways/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/expressroutegateways/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/method_listbysubscription.go b/resource-manager/network/2022-07-01/expressroutegateways/method_listbysubscription.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/method_listbysubscription.go rename to resource-manager/network/2022-07-01/expressroutegateways/method_listbysubscription.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/method_updatetags.go b/resource-manager/network/2022-07-01/expressroutegateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/method_updatetags.go rename to resource-manager/network/2022-07-01/expressroutegateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressroutecircuitpeeringid.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressroutecircuitpeeringid.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressroutecircuitpeeringid.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressroutecircuitpeeringid.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressrouteconnection.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressrouteconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressrouteconnection.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressrouteconnection.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressrouteconnectionproperties.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressrouteconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressrouteconnectionproperties.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressrouteconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegateway.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegateway.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegateway.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegateway.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewaylist.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewaylist.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewaylist.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewaylist.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewayproperties.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewayproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewayproperties.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewayproperties.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go b/resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_propagatedroutetable.go b/resource-manager/network/2022-07-01/expressroutegateways/model_propagatedroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_propagatedroutetable.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_propagatedroutetable.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_routingconfiguration.go b/resource-manager/network/2022-07-01/expressroutegateways/model_routingconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_routingconfiguration.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_routingconfiguration.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_staticroute.go b/resource-manager/network/2022-07-01/expressroutegateways/model_staticroute.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_staticroute.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_staticroute.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_staticroutesconfig.go b/resource-manager/network/2022-07-01/expressroutegateways/model_staticroutesconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_staticroutesconfig.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_staticroutesconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_subresource.go b/resource-manager/network/2022-07-01/expressroutegateways/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_subresource.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_tagsobject.go b/resource-manager/network/2022-07-01/expressroutegateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_virtualhubid.go b/resource-manager/network/2022-07-01/expressroutegateways/model_virtualhubid.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_virtualhubid.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_virtualhubid.go diff --git a/resource-manager/network/2023-04-01/expressroutegateways/model_vnetroute.go b/resource-manager/network/2022-07-01/expressroutegateways/model_vnetroute.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutegateways/model_vnetroute.go rename to resource-manager/network/2022-07-01/expressroutegateways/model_vnetroute.go diff --git a/resource-manager/network/2022-07-01/expressroutegateways/version.go b/resource-manager/network/2022-07-01/expressroutegateways/version.go new file mode 100644 index 00000000000..9b32ddceb21 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutegateways/version.go @@ -0,0 +1,12 @@ +package expressroutegateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutegateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressroutelinks/README.md b/resource-manager/network/2022-07-01/expressroutelinks/README.md new file mode 100644 index 00000000000..d4093bb0d57 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutelinks/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressroutelinks` Documentation + +The `expressroutelinks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressroutelinks" +``` + + +### Client Initialization + +```go +client := expressroutelinks.NewExpressRouteLinksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteLinksClient.Get` + +```go +ctx := context.TODO() +id := expressroutelinks.NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue") + +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: `ExpressRouteLinksClient.List` + +```go +ctx := context.TODO() +id := expressroutelinks.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +// 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/network/2023-04-01/expressroutelinks/client.go b/resource-manager/network/2022-07-01/expressroutelinks/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/client.go rename to resource-manager/network/2022-07-01/expressroutelinks/client.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/constants.go b/resource-manager/network/2022-07-01/expressroutelinks/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/constants.go rename to resource-manager/network/2022-07-01/expressroutelinks/constants.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/id_expressrouteport.go b/resource-manager/network/2022-07-01/expressroutelinks/id_expressrouteport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/id_expressrouteport.go rename to resource-manager/network/2022-07-01/expressroutelinks/id_expressrouteport.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/id_expressrouteport_test.go b/resource-manager/network/2022-07-01/expressroutelinks/id_expressrouteport_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/id_expressrouteport_test.go rename to resource-manager/network/2022-07-01/expressroutelinks/id_expressrouteport_test.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/id_link.go b/resource-manager/network/2022-07-01/expressroutelinks/id_link.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/id_link.go rename to resource-manager/network/2022-07-01/expressroutelinks/id_link.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/id_link_test.go b/resource-manager/network/2022-07-01/expressroutelinks/id_link_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/id_link_test.go rename to resource-manager/network/2022-07-01/expressroutelinks/id_link_test.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/method_get.go b/resource-manager/network/2022-07-01/expressroutelinks/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/method_get.go rename to resource-manager/network/2022-07-01/expressroutelinks/method_get.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/method_list.go b/resource-manager/network/2022-07-01/expressroutelinks/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/method_list.go rename to resource-manager/network/2022-07-01/expressroutelinks/method_list.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/model_expressroutelink.go b/resource-manager/network/2022-07-01/expressroutelinks/model_expressroutelink.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/model_expressroutelink.go rename to resource-manager/network/2022-07-01/expressroutelinks/model_expressroutelink.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/model_expressroutelinkmacsecconfig.go b/resource-manager/network/2022-07-01/expressroutelinks/model_expressroutelinkmacsecconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/model_expressroutelinkmacsecconfig.go rename to resource-manager/network/2022-07-01/expressroutelinks/model_expressroutelinkmacsecconfig.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/model_expressroutelinkpropertiesformat.go b/resource-manager/network/2022-07-01/expressroutelinks/model_expressroutelinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/model_expressroutelinkpropertiesformat.go rename to resource-manager/network/2022-07-01/expressroutelinks/model_expressroutelinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressroutelinks/predicates.go b/resource-manager/network/2022-07-01/expressroutelinks/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressroutelinks/predicates.go rename to resource-manager/network/2022-07-01/expressroutelinks/predicates.go diff --git a/resource-manager/network/2022-07-01/expressroutelinks/version.go b/resource-manager/network/2022-07-01/expressroutelinks/version.go new file mode 100644 index 00000000000..9d534eb355c --- /dev/null +++ b/resource-manager/network/2022-07-01/expressroutelinks/version.go @@ -0,0 +1,12 @@ +package expressroutelinks + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutelinks/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressrouteportauthorizations/README.md b/resource-manager/network/2022-07-01/expressrouteportauthorizations/README.md new file mode 100644 index 00000000000..f56a6db7bc4 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteportauthorizations/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteportauthorizations` Documentation + +The `expressrouteportauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressrouteportauthorizations" +``` + + +### Client Initialization + +```go +client := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRoutePortAuthorizationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") + +payload := expressrouteportauthorizations.ExpressRoutePortAuthorization{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRoutePortAuthorizationsClient.Delete` + +```go +ctx := context.TODO() +id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRoutePortAuthorizationsClient.Get` + +```go +ctx := context.TODO() +id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") + +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: `ExpressRoutePortAuthorizationsClient.List` + +```go +ctx := context.TODO() +id := expressrouteportauthorizations.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +// 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/network/2023-04-01/expressrouteportauthorizations/client.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/client.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/client.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/constants.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/constants.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/constants.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteport.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteport.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteport.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteport_test.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteport_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteport_test.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteport_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteportauthorization.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteportauthorization.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteportauthorization.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteportauthorization.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/method_createorupdate.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/method_delete.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/method_delete.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/method_get.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/method_get.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/method_get.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/method_list.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/method_list.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/method_list.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/model_expressrouteportauthorization.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/model_expressrouteportauthorization.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/model_expressrouteportauthorization.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/model_expressrouteportauthorization.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/predicates.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportauthorizations/predicates.go rename to resource-manager/network/2022-07-01/expressrouteportauthorizations/predicates.go diff --git a/resource-manager/network/2022-07-01/expressrouteportauthorizations/version.go b/resource-manager/network/2022-07-01/expressrouteportauthorizations/version.go new file mode 100644 index 00000000000..d50d490e10c --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteportauthorizations/version.go @@ -0,0 +1,12 @@ +package expressrouteportauthorizations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportauthorizations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressrouteports/README.md b/resource-manager/network/2022-07-01/expressrouteports/README.md new file mode 100644 index 00000000000..22a2de22f0e --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteports/README.md @@ -0,0 +1,142 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteports` Documentation + +The `expressrouteports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressrouteports" +``` + + +### Client Initialization + +```go +client := expressrouteports.NewExpressRoutePortsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRoutePortsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +payload := expressrouteports.ExpressRoutePort{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRoutePortsClient.Delete` + +```go +ctx := context.TODO() +id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ExpressRoutePortsClient.GenerateLOA` + +```go +ctx := context.TODO() +id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +payload := expressrouteports.GenerateExpressRoutePortsLOARequest{ + // ... +} + + +read, err := client.GenerateLOA(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExpressRoutePortsClient.Get` + +```go +ctx := context.TODO() +id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.UpdateTags` + +```go +ctx := context.TODO() +id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") + +payload := expressrouteports.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/network/2023-04-01/expressrouteports/client.go b/resource-manager/network/2022-07-01/expressrouteports/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/client.go rename to resource-manager/network/2022-07-01/expressrouteports/client.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/constants.go b/resource-manager/network/2022-07-01/expressrouteports/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/constants.go rename to resource-manager/network/2022-07-01/expressrouteports/constants.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/id_expressrouteport.go b/resource-manager/network/2022-07-01/expressrouteports/id_expressrouteport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/id_expressrouteport.go rename to resource-manager/network/2022-07-01/expressrouteports/id_expressrouteport.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/id_expressrouteport_test.go b/resource-manager/network/2022-07-01/expressrouteports/id_expressrouteport_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/id_expressrouteport_test.go rename to resource-manager/network/2022-07-01/expressrouteports/id_expressrouteport_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_createorupdate.go b/resource-manager/network/2022-07-01/expressrouteports/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_createorupdate.go rename to resource-manager/network/2022-07-01/expressrouteports/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_delete.go b/resource-manager/network/2022-07-01/expressrouteports/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_delete.go rename to resource-manager/network/2022-07-01/expressrouteports/method_delete.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_generateloa.go b/resource-manager/network/2022-07-01/expressrouteports/method_generateloa.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_generateloa.go rename to resource-manager/network/2022-07-01/expressrouteports/method_generateloa.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_get.go b/resource-manager/network/2022-07-01/expressrouteports/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_get.go rename to resource-manager/network/2022-07-01/expressrouteports/method_get.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_list.go b/resource-manager/network/2022-07-01/expressrouteports/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_list.go rename to resource-manager/network/2022-07-01/expressrouteports/method_list.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/expressrouteports/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/expressrouteports/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/method_updatetags.go b/resource-manager/network/2022-07-01/expressrouteports/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/method_updatetags.go rename to resource-manager/network/2022-07-01/expressrouteports/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_expressroutelink.go b/resource-manager/network/2022-07-01/expressrouteports/model_expressroutelink.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_expressroutelink.go rename to resource-manager/network/2022-07-01/expressrouteports/model_expressroutelink.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_expressroutelinkmacsecconfig.go b/resource-manager/network/2022-07-01/expressrouteports/model_expressroutelinkmacsecconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_expressroutelinkmacsecconfig.go rename to resource-manager/network/2022-07-01/expressrouteports/model_expressroutelinkmacsecconfig.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_expressroutelinkpropertiesformat.go b/resource-manager/network/2022-07-01/expressrouteports/model_expressroutelinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_expressroutelinkpropertiesformat.go rename to resource-manager/network/2022-07-01/expressrouteports/model_expressroutelinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_expressrouteport.go b/resource-manager/network/2022-07-01/expressrouteports/model_expressrouteport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_expressrouteport.go rename to resource-manager/network/2022-07-01/expressrouteports/model_expressrouteport.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_expressrouteportpropertiesformat.go b/resource-manager/network/2022-07-01/expressrouteports/model_expressrouteportpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_expressrouteportpropertiesformat.go rename to resource-manager/network/2022-07-01/expressrouteports/model_expressrouteportpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_generateexpressrouteportsloarequest.go b/resource-manager/network/2022-07-01/expressrouteports/model_generateexpressrouteportsloarequest.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_generateexpressrouteportsloarequest.go rename to resource-manager/network/2022-07-01/expressrouteports/model_generateexpressrouteportsloarequest.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_generateexpressrouteportsloaresult.go b/resource-manager/network/2022-07-01/expressrouteports/model_generateexpressrouteportsloaresult.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_generateexpressrouteportsloaresult.go rename to resource-manager/network/2022-07-01/expressrouteports/model_generateexpressrouteportsloaresult.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_subresource.go b/resource-manager/network/2022-07-01/expressrouteports/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_subresource.go rename to resource-manager/network/2022-07-01/expressrouteports/model_subresource.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/model_tagsobject.go b/resource-manager/network/2022-07-01/expressrouteports/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/model_tagsobject.go rename to resource-manager/network/2022-07-01/expressrouteports/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/expressrouteports/predicates.go b/resource-manager/network/2022-07-01/expressrouteports/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteports/predicates.go rename to resource-manager/network/2022-07-01/expressrouteports/predicates.go diff --git a/resource-manager/network/2022-07-01/expressrouteports/version.go b/resource-manager/network/2022-07-01/expressrouteports/version.go new file mode 100644 index 00000000000..a96bf34b07d --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteports/version.go @@ -0,0 +1,12 @@ +package expressrouteports + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteports/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressrouteportslocations/README.md b/resource-manager/network/2022-07-01/expressrouteportslocations/README.md new file mode 100644 index 00000000000..807d32c3d20 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteportslocations/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteportslocations` Documentation + +The `expressrouteportslocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressrouteportslocations" +``` + + +### Client Initialization + +```go +client := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRoutePortsLocationsClient.Get` + +```go +ctx := context.TODO() +id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue") + +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: `ExpressRoutePortsLocationsClient.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 +} +``` diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/client.go b/resource-manager/network/2022-07-01/expressrouteportslocations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/client.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/client.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/constants.go b/resource-manager/network/2022-07-01/expressrouteportslocations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/constants.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/constants.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2022-07-01/expressrouteportslocations/id_expressrouteportslocation.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/id_expressrouteportslocation.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/id_expressrouteportslocation.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2022-07-01/expressrouteportslocations/id_expressrouteportslocation_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/id_expressrouteportslocation_test.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/id_expressrouteportslocation_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/method_get.go b/resource-manager/network/2022-07-01/expressrouteportslocations/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/method_get.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/method_get.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/method_list.go b/resource-manager/network/2022-07-01/expressrouteportslocations/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/method_list.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/method_list.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/model_expressrouteportslocation.go b/resource-manager/network/2022-07-01/expressrouteportslocations/model_expressrouteportslocation.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/model_expressrouteportslocation.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/model_expressrouteportslocation.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go b/resource-manager/network/2022-07-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go b/resource-manager/network/2022-07-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/predicates.go b/resource-manager/network/2022-07-01/expressrouteportslocations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteportslocations/predicates.go rename to resource-manager/network/2022-07-01/expressrouteportslocations/predicates.go diff --git a/resource-manager/network/2022-07-01/expressrouteportslocations/version.go b/resource-manager/network/2022-07-01/expressrouteportslocations/version.go new file mode 100644 index 00000000000..5e70eee4a3f --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteportslocations/version.go @@ -0,0 +1,12 @@ +package expressrouteportslocations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportslocations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressrouteproviderports/README.md b/resource-manager/network/2022-07-01/expressrouteproviderports/README.md new file mode 100644 index 00000000000..e20b7065814 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteproviderports/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteproviderports` Documentation + +The `expressrouteproviderports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressrouteproviderports" +``` + + +### Client Initialization + +```go +client := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteProviderPortsClient.ExpressRouteProviderPort` + +```go +ctx := context.TODO() +id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue") + +read, err := client.ExpressRouteProviderPort(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ExpressRouteProviderPortsClient.LocationList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.LocationList(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions())` can be used to do batched pagination +items, err := client.LocationListComplete(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/client.go b/resource-manager/network/2022-07-01/expressrouteproviderports/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/client.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/client.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2022-07-01/expressrouteproviderports/id_expressrouteproviderport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/id_expressrouteproviderport.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/id_expressrouteproviderport.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2022-07-01/expressrouteproviderports/id_expressrouteproviderport_test.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/id_expressrouteproviderport_test.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/id_expressrouteproviderport_test.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/method_expressrouteproviderport.go b/resource-manager/network/2022-07-01/expressrouteproviderports/method_expressrouteproviderport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/method_expressrouteproviderport.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/method_expressrouteproviderport.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/method_locationlist.go b/resource-manager/network/2022-07-01/expressrouteproviderports/method_locationlist.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/method_locationlist.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/method_locationlist.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/model_expressrouteproviderport.go b/resource-manager/network/2022-07-01/expressrouteproviderports/model_expressrouteproviderport.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/model_expressrouteproviderport.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/model_expressrouteproviderport.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/model_expressrouteproviderportproperties.go b/resource-manager/network/2022-07-01/expressrouteproviderports/model_expressrouteproviderportproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/model_expressrouteproviderportproperties.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/model_expressrouteproviderportproperties.go diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/predicates.go b/resource-manager/network/2022-07-01/expressrouteproviderports/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteproviderports/predicates.go rename to resource-manager/network/2022-07-01/expressrouteproviderports/predicates.go diff --git a/resource-manager/network/2022-07-01/expressrouteproviderports/version.go b/resource-manager/network/2022-07-01/expressrouteproviderports/version.go new file mode 100644 index 00000000000..9f46fb08ec5 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteproviderports/version.go @@ -0,0 +1,12 @@ +package expressrouteproviderports + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteproviderports/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/expressrouteserviceproviders/README.md b/resource-manager/network/2022-07-01/expressrouteserviceproviders/README.md new file mode 100644 index 00000000000..37195d935d5 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteserviceproviders/README.md @@ -0,0 +1,38 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/expressrouteserviceproviders` Documentation + +The `expressrouteserviceproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/expressrouteserviceproviders" +``` + + +### Client Initialization + +```go +client := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ExpressRouteServiceProvidersClient.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 +} +``` diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/client.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/client.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/client.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/client.go diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/constants.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/constants.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/constants.go diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/method_list.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/method_list.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/method_list.go diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/predicates.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/expressrouteserviceproviders/predicates.go rename to resource-manager/network/2022-07-01/expressrouteserviceproviders/predicates.go diff --git a/resource-manager/network/2022-07-01/expressrouteserviceproviders/version.go b/resource-manager/network/2022-07-01/expressrouteserviceproviders/version.go new file mode 100644 index 00000000000..e1cff019b17 --- /dev/null +++ b/resource-manager/network/2022-07-01/expressrouteserviceproviders/version.go @@ -0,0 +1,12 @@ +package expressrouteserviceproviders + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteserviceproviders/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/firewallpolicies/README.md b/resource-manager/network/2022-07-01/firewallpolicies/README.md new file mode 100644 index 00000000000..36de1ac7c7f --- /dev/null +++ b/resource-manager/network/2022-07-01/firewallpolicies/README.md @@ -0,0 +1,237 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/firewallpolicies` Documentation + +The `firewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/firewallpolicies" +``` + + +### Client Initialization + +```go +client := firewallpolicies.NewFirewallPoliciesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `FirewallPoliciesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +payload := firewallpolicies.FirewallPolicy{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `FirewallPoliciesClient.Delete` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesFilterValuesList` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +payload := firewallpolicies.SignatureOverridesFilterValuesQuery{ + // ... +} + + +read, err := client.FirewallPolicyIdpsSignaturesFilterValuesList(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesList` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +payload := firewallpolicies.IDPSQueryObject{ + // ... +} + + +read, err := client.FirewallPolicyIdpsSignaturesList(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesGet` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +read, err := client.FirewallPolicyIdpsSignaturesOverridesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesList` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +read, err := client.FirewallPolicyIdpsSignaturesOverridesList(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPatch` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +payload := firewallpolicies.SignaturesOverrides{ + // ... +} + + +read, err := client.FirewallPolicyIdpsSignaturesOverridesPatch(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPut` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +payload := firewallpolicies.SignaturesOverrides{ + // ... +} + + +read, err := client.FirewallPolicyIdpsSignaturesOverridesPut(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.Get` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +read, err := client.Get(ctx, id, firewallpolicies.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `FirewallPoliciesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `FirewallPoliciesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `FirewallPoliciesClient.UpdateTags` + +```go +ctx := context.TODO() +id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +payload := firewallpolicies.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/network/2023-04-01/firewallpolicies/client.go b/resource-manager/network/2022-07-01/firewallpolicies/client.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/client.go rename to resource-manager/network/2022-07-01/firewallpolicies/client.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/constants.go b/resource-manager/network/2022-07-01/firewallpolicies/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/constants.go rename to resource-manager/network/2022-07-01/firewallpolicies/constants.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/id_firewallpolicy.go b/resource-manager/network/2022-07-01/firewallpolicies/id_firewallpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/id_firewallpolicy.go rename to resource-manager/network/2022-07-01/firewallpolicies/id_firewallpolicy.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/id_firewallpolicy_test.go b/resource-manager/network/2022-07-01/firewallpolicies/id_firewallpolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/id_firewallpolicy_test.go rename to resource-manager/network/2022-07-01/firewallpolicies/id_firewallpolicy_test.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_createorupdate.go b/resource-manager/network/2022-07-01/firewallpolicies/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_createorupdate.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_delete.go b/resource-manager/network/2022-07-01/firewallpolicies/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_delete.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_delete.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go b/resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go b/resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go b/resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go b/resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go b/resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go b/resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_get.go b/resource-manager/network/2022-07-01/firewallpolicies/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_get.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_get.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_list.go b/resource-manager/network/2022-07-01/firewallpolicies/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_list.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_list.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_listall.go b/resource-manager/network/2022-07-01/firewallpolicies/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_listall.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_listall.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/method_updatetags.go b/resource-manager/network/2022-07-01/firewallpolicies/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/method_updatetags.go rename to resource-manager/network/2022-07-01/firewallpolicies/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_dnssettings.go b/resource-manager/network/2022-07-01/firewallpolicies/model_dnssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_dnssettings.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_dnssettings.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_explicitproxy.go b/resource-manager/network/2022-07-01/firewallpolicies/model_explicitproxy.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_explicitproxy.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_explicitproxy.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_filteritems.go b/resource-manager/network/2022-07-01/firewallpolicies/model_filteritems.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_filteritems.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_filteritems.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicy.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicy.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicy.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicycertificateauthority.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicycertificateauthority.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicycertificateauthority.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicycertificateauthority.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyinsights.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyinsights.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyinsights.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyinsights.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetection.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetection.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetection.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetection.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicypropertiesformat.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicysku.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicysku.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicysku.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicysku.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicysnat.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicysnat.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicysnat.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicysnat.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicysql.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicysql.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicysql.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicysql.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicytransportsecurity.go b/resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicytransportsecurity.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_firewallpolicytransportsecurity.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_firewallpolicytransportsecurity.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_idpsqueryobject.go b/resource-manager/network/2022-07-01/firewallpolicies/model_idpsqueryobject.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_idpsqueryobject.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_idpsqueryobject.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_orderby.go b/resource-manager/network/2022-07-01/firewallpolicies/model_orderby.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_orderby.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_orderby.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_queryresults.go b/resource-manager/network/2022-07-01/firewallpolicies/model_queryresults.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_queryresults.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_queryresults.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go b/resource-manager/network/2022-07-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go b/resource-manager/network/2022-07-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_signaturesoverrides.go b/resource-manager/network/2022-07-01/firewallpolicies/model_signaturesoverrides.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_signaturesoverrides.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_signaturesoverrides.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_signaturesoverrideslist.go b/resource-manager/network/2022-07-01/firewallpolicies/model_signaturesoverrideslist.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_signaturesoverrideslist.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_signaturesoverrideslist.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_signaturesoverridesproperties.go b/resource-manager/network/2022-07-01/firewallpolicies/model_signaturesoverridesproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_signaturesoverridesproperties.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_signaturesoverridesproperties.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_singlequeryresult.go b/resource-manager/network/2022-07-01/firewallpolicies/model_singlequeryresult.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_singlequeryresult.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_singlequeryresult.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_subresource.go b/resource-manager/network/2022-07-01/firewallpolicies/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_subresource.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_subresource.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/model_tagsobject.go b/resource-manager/network/2022-07-01/firewallpolicies/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/model_tagsobject.go rename to resource-manager/network/2022-07-01/firewallpolicies/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/firewallpolicies/predicates.go b/resource-manager/network/2022-07-01/firewallpolicies/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicies/predicates.go rename to resource-manager/network/2022-07-01/firewallpolicies/predicates.go diff --git a/resource-manager/network/2022-07-01/firewallpolicies/version.go b/resource-manager/network/2022-07-01/firewallpolicies/version.go new file mode 100644 index 00000000000..bb6abf54203 --- /dev/null +++ b/resource-manager/network/2022-07-01/firewallpolicies/version.go @@ -0,0 +1,12 @@ +package firewallpolicies + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicies/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/README.md b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/README.md new file mode 100644 index 00000000000..6ac2e882147 --- /dev/null +++ b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups` Documentation + +The `firewallpolicyrulecollectiongroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/firewallpolicyrulecollectiongroups" +``` + + +### Client Initialization + +```go +client := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") + +payload := firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroup{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Delete` + +```go +ctx := context.TODO() +id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Get` + +```go +ctx := context.TODO() +id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") + +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: `FirewallPolicyRuleCollectionGroupsClient.List` + +```go +ctx := context.TODO() +id := firewallpolicyrulecollectiongroups.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") + +// 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/network/2023-04-01/firewallpolicyrulecollectiongroups/client.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/client.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/client.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/client.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/constants.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/constants.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/constants.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_createorupdate.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_createorupdate.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_delete.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_delete.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_delete.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_get.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_get.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_get.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_list.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/method_list.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/method_list.go diff --git a/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_applicationrule.go new file mode 100644 index 00000000000..7986fbe7086 --- /dev/null +++ b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_applicationrule.go @@ -0,0 +1,51 @@ +package firewallpolicyrulecollectiongroups + +import ( + "encoding/json" + "fmt" +) + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +var _ FirewallPolicyRule = ApplicationRule{} + +type ApplicationRule struct { + DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` + FqdnTags *[]string `json:"fqdnTags,omitempty"` + Protocols *[]FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` + SourceAddresses *[]string `json:"sourceAddresses,omitempty"` + SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` + TargetFqdns *[]string `json:"targetFqdns,omitempty"` + TargetUrls *[]string `json:"targetUrls,omitempty"` + TerminateTLS *bool `json:"terminateTLS,omitempty"` + WebCategories *[]string `json:"webCategories,omitempty"` + + // Fields inherited from FirewallPolicyRule + Description *string `json:"description,omitempty"` + Name *string `json:"name,omitempty"` +} + +var _ json.Marshaler = ApplicationRule{} + +func (s ApplicationRule) MarshalJSON() ([]byte, error) { + type wrapper ApplicationRule + wrapped := wrapper(s) + encoded, err := json.Marshal(wrapped) + if err != nil { + return nil, fmt.Errorf("marshaling ApplicationRule: %+v", err) + } + + var decoded map[string]interface{} + if err := json.Unmarshal(encoded, &decoded); err != nil { + return nil, fmt.Errorf("unmarshaling ApplicationRule: %+v", err) + } + decoded["ruleType"] = "ApplicationRule" + + encoded, err = json.Marshal(decoded) + if err != nil { + return nil, fmt.Errorf("re-marshaling ApplicationRule: %+v", err) + } + + return encoded, nil +} diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_natrule.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_natrule.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_natrule.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_natrule.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_networkrule.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_networkrule.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_networkrule.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/model_networkrule.go diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/predicates.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/predicates.go rename to resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/predicates.go diff --git a/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/version.go b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/version.go new file mode 100644 index 00000000000..91578111d53 --- /dev/null +++ b/resource-manager/network/2022-07-01/firewallpolicyrulecollectiongroups/version.go @@ -0,0 +1,12 @@ +package firewallpolicyrulecollectiongroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicyrulecollectiongroups/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/flowlogs/README.md b/resource-manager/network/2022-07-01/flowlogs/README.md new file mode 100644 index 00000000000..30cec241b90 --- /dev/null +++ b/resource-manager/network/2022-07-01/flowlogs/README.md @@ -0,0 +1,103 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/flowlogs` Documentation + +The `flowlogs` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/flowlogs" +``` + + +### Client Initialization + +```go +client := flowlogs.NewFlowLogsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `FlowLogsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") + +payload := flowlogs.FlowLog{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `FlowLogsClient.Delete` + +```go +ctx := context.TODO() +id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `FlowLogsClient.Get` + +```go +ctx := context.TODO() +id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") + +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: `FlowLogsClient.List` + +```go +ctx := context.TODO() +id := flowlogs.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +// 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: `FlowLogsClient.UpdateTags` + +```go +ctx := context.TODO() +id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") + +payload := flowlogs.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/network/2023-04-01/flowlogs/client.go b/resource-manager/network/2022-07-01/flowlogs/client.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/client.go rename to resource-manager/network/2022-07-01/flowlogs/client.go diff --git a/resource-manager/network/2023-04-01/flowlogs/constants.go b/resource-manager/network/2022-07-01/flowlogs/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/constants.go rename to resource-manager/network/2022-07-01/flowlogs/constants.go diff --git a/resource-manager/network/2023-04-01/flowlogs/id_flowlog.go b/resource-manager/network/2022-07-01/flowlogs/id_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/id_flowlog.go rename to resource-manager/network/2022-07-01/flowlogs/id_flowlog.go diff --git a/resource-manager/network/2023-04-01/flowlogs/id_flowlog_test.go b/resource-manager/network/2022-07-01/flowlogs/id_flowlog_test.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/id_flowlog_test.go rename to resource-manager/network/2022-07-01/flowlogs/id_flowlog_test.go diff --git a/resource-manager/network/2023-04-01/flowlogs/id_networkwatcher.go b/resource-manager/network/2022-07-01/flowlogs/id_networkwatcher.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/id_networkwatcher.go rename to resource-manager/network/2022-07-01/flowlogs/id_networkwatcher.go diff --git a/resource-manager/network/2023-04-01/flowlogs/id_networkwatcher_test.go b/resource-manager/network/2022-07-01/flowlogs/id_networkwatcher_test.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/id_networkwatcher_test.go rename to resource-manager/network/2022-07-01/flowlogs/id_networkwatcher_test.go diff --git a/resource-manager/network/2023-04-01/flowlogs/method_createorupdate.go b/resource-manager/network/2022-07-01/flowlogs/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/method_createorupdate.go rename to resource-manager/network/2022-07-01/flowlogs/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/flowlogs/method_delete.go b/resource-manager/network/2022-07-01/flowlogs/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/method_delete.go rename to resource-manager/network/2022-07-01/flowlogs/method_delete.go diff --git a/resource-manager/network/2023-04-01/flowlogs/method_get.go b/resource-manager/network/2022-07-01/flowlogs/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/method_get.go rename to resource-manager/network/2022-07-01/flowlogs/method_get.go diff --git a/resource-manager/network/2023-04-01/flowlogs/method_list.go b/resource-manager/network/2022-07-01/flowlogs/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/method_list.go rename to resource-manager/network/2022-07-01/flowlogs/method_list.go diff --git a/resource-manager/network/2023-04-01/flowlogs/method_updatetags.go b/resource-manager/network/2022-07-01/flowlogs/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/method_updatetags.go rename to resource-manager/network/2022-07-01/flowlogs/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_flowlog.go b/resource-manager/network/2022-07-01/flowlogs/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_flowlog.go rename to resource-manager/network/2022-07-01/flowlogs/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/flowlogs/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/flowlogs/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/flowlogs/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/flowlogs/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/flowlogs/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/flowlogs/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_tagsobject.go b/resource-manager/network/2022-07-01/flowlogs/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_tagsobject.go rename to resource-manager/network/2022-07-01/flowlogs/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/flowlogs/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/flowlogs/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/flowlogs/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/flowlogs/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/flowlogs/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/flowlogs/predicates.go b/resource-manager/network/2022-07-01/flowlogs/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/flowlogs/predicates.go rename to resource-manager/network/2022-07-01/flowlogs/predicates.go diff --git a/resource-manager/network/2022-07-01/flowlogs/version.go b/resource-manager/network/2022-07-01/flowlogs/version.go new file mode 100644 index 00000000000..651e172cedb --- /dev/null +++ b/resource-manager/network/2022-07-01/flowlogs/version.go @@ -0,0 +1,12 @@ +package flowlogs + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/flowlogs/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/ipallocations/README.md b/resource-manager/network/2022-07-01/ipallocations/README.md new file mode 100644 index 00000000000..097958c5035 --- /dev/null +++ b/resource-manager/network/2022-07-01/ipallocations/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ipallocations` Documentation + +The `ipallocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/ipallocations" +``` + + +### Client Initialization + +```go +client := ipallocations.NewIPAllocationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `IPAllocationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") + +payload := ipallocations.IPAllocation{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `IPAllocationsClient.Delete` + +```go +ctx := context.TODO() +id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `IPAllocationsClient.Get` + +```go +ctx := context.TODO() +id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") + +read, err := client.Get(ctx, id, ipallocations.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `IPAllocationsClient.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: `IPAllocationsClient.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: `IPAllocationsClient.UpdateTags` + +```go +ctx := context.TODO() +id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") + +payload := ipallocations.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/network/2023-04-01/ipallocations/client.go b/resource-manager/network/2022-07-01/ipallocations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/client.go rename to resource-manager/network/2022-07-01/ipallocations/client.go diff --git a/resource-manager/network/2023-04-01/ipallocations/constants.go b/resource-manager/network/2022-07-01/ipallocations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/constants.go rename to resource-manager/network/2022-07-01/ipallocations/constants.go diff --git a/resource-manager/network/2023-04-01/ipallocations/id_ipallocation.go b/resource-manager/network/2022-07-01/ipallocations/id_ipallocation.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/id_ipallocation.go rename to resource-manager/network/2022-07-01/ipallocations/id_ipallocation.go diff --git a/resource-manager/network/2023-04-01/ipallocations/id_ipallocation_test.go b/resource-manager/network/2022-07-01/ipallocations/id_ipallocation_test.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/id_ipallocation_test.go rename to resource-manager/network/2022-07-01/ipallocations/id_ipallocation_test.go diff --git a/resource-manager/network/2023-04-01/ipallocations/method_createorupdate.go b/resource-manager/network/2022-07-01/ipallocations/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/method_createorupdate.go rename to resource-manager/network/2022-07-01/ipallocations/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/ipallocations/method_delete.go b/resource-manager/network/2022-07-01/ipallocations/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/method_delete.go rename to resource-manager/network/2022-07-01/ipallocations/method_delete.go diff --git a/resource-manager/network/2023-04-01/ipallocations/method_get.go b/resource-manager/network/2022-07-01/ipallocations/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/method_get.go rename to resource-manager/network/2022-07-01/ipallocations/method_get.go diff --git a/resource-manager/network/2023-04-01/ipallocations/method_list.go b/resource-manager/network/2022-07-01/ipallocations/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/method_list.go rename to resource-manager/network/2022-07-01/ipallocations/method_list.go diff --git a/resource-manager/network/2023-04-01/ipallocations/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/ipallocations/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/ipallocations/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/ipallocations/method_updatetags.go b/resource-manager/network/2022-07-01/ipallocations/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/method_updatetags.go rename to resource-manager/network/2022-07-01/ipallocations/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/ipallocations/model_ipallocation.go b/resource-manager/network/2022-07-01/ipallocations/model_ipallocation.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/model_ipallocation.go rename to resource-manager/network/2022-07-01/ipallocations/model_ipallocation.go diff --git a/resource-manager/network/2023-04-01/ipallocations/model_ipallocationpropertiesformat.go b/resource-manager/network/2022-07-01/ipallocations/model_ipallocationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/model_ipallocationpropertiesformat.go rename to resource-manager/network/2022-07-01/ipallocations/model_ipallocationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/ipallocations/model_subresource.go b/resource-manager/network/2022-07-01/ipallocations/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/model_subresource.go rename to resource-manager/network/2022-07-01/ipallocations/model_subresource.go diff --git a/resource-manager/network/2023-04-01/ipallocations/model_tagsobject.go b/resource-manager/network/2022-07-01/ipallocations/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/model_tagsobject.go rename to resource-manager/network/2022-07-01/ipallocations/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/ipallocations/predicates.go b/resource-manager/network/2022-07-01/ipallocations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/ipallocations/predicates.go rename to resource-manager/network/2022-07-01/ipallocations/predicates.go diff --git a/resource-manager/network/2022-07-01/ipallocations/version.go b/resource-manager/network/2022-07-01/ipallocations/version.go new file mode 100644 index 00000000000..be15205d8ca --- /dev/null +++ b/resource-manager/network/2022-07-01/ipallocations/version.go @@ -0,0 +1,12 @@ +package ipallocations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/ipallocations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/ipgroups/README.md b/resource-manager/network/2022-07-01/ipgroups/README.md new file mode 100644 index 00000000000..c1f2dcc1de3 --- /dev/null +++ b/resource-manager/network/2022-07-01/ipgroups/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/ipgroups` Documentation + +The `ipgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/ipgroups" +``` + + +### Client Initialization + +```go +client := ipgroups.NewIPGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `IPGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") + +payload := ipgroups.IPGroup{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `IPGroupsClient.Delete` + +```go +ctx := context.TODO() +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `IPGroupsClient.Get` + +```go +ctx := context.TODO() +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") + +read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `IPGroupsClient.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: `IPGroupsClient.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: `IPGroupsClient.UpdateGroups` + +```go +ctx := context.TODO() +id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") + +payload := ipgroups.TagsObject{ + // ... +} + + +read, err := client.UpdateGroups(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/network/2023-04-01/ipgroups/client.go b/resource-manager/network/2022-07-01/ipgroups/client.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/client.go rename to resource-manager/network/2022-07-01/ipgroups/client.go diff --git a/resource-manager/network/2023-04-01/ipgroups/constants.go b/resource-manager/network/2022-07-01/ipgroups/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/constants.go rename to resource-manager/network/2022-07-01/ipgroups/constants.go diff --git a/resource-manager/network/2023-04-01/ipgroups/id_ipgroup.go b/resource-manager/network/2022-07-01/ipgroups/id_ipgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/id_ipgroup.go rename to resource-manager/network/2022-07-01/ipgroups/id_ipgroup.go diff --git a/resource-manager/network/2023-04-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2022-07-01/ipgroups/id_ipgroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/id_ipgroup_test.go rename to resource-manager/network/2022-07-01/ipgroups/id_ipgroup_test.go diff --git a/resource-manager/network/2023-04-01/ipgroups/method_createorupdate.go b/resource-manager/network/2022-07-01/ipgroups/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/method_createorupdate.go rename to resource-manager/network/2022-07-01/ipgroups/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/ipgroups/method_delete.go b/resource-manager/network/2022-07-01/ipgroups/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/method_delete.go rename to resource-manager/network/2022-07-01/ipgroups/method_delete.go diff --git a/resource-manager/network/2023-04-01/ipgroups/method_get.go b/resource-manager/network/2022-07-01/ipgroups/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/method_get.go rename to resource-manager/network/2022-07-01/ipgroups/method_get.go diff --git a/resource-manager/network/2023-04-01/ipgroups/method_list.go b/resource-manager/network/2022-07-01/ipgroups/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/method_list.go rename to resource-manager/network/2022-07-01/ipgroups/method_list.go diff --git a/resource-manager/network/2023-04-01/ipgroups/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/ipgroups/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/ipgroups/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/ipgroups/method_updategroups.go b/resource-manager/network/2022-07-01/ipgroups/method_updategroups.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/method_updategroups.go rename to resource-manager/network/2022-07-01/ipgroups/method_updategroups.go diff --git a/resource-manager/network/2023-04-01/ipgroups/model_ipgroup.go b/resource-manager/network/2022-07-01/ipgroups/model_ipgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/model_ipgroup.go rename to resource-manager/network/2022-07-01/ipgroups/model_ipgroup.go diff --git a/resource-manager/network/2023-04-01/ipgroups/model_ipgrouppropertiesformat.go b/resource-manager/network/2022-07-01/ipgroups/model_ipgrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/model_ipgrouppropertiesformat.go rename to resource-manager/network/2022-07-01/ipgroups/model_ipgrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/ipgroups/model_subresource.go b/resource-manager/network/2022-07-01/ipgroups/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/model_subresource.go rename to resource-manager/network/2022-07-01/ipgroups/model_subresource.go diff --git a/resource-manager/network/2023-04-01/ipgroups/model_tagsobject.go b/resource-manager/network/2022-07-01/ipgroups/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/model_tagsobject.go rename to resource-manager/network/2022-07-01/ipgroups/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/ipgroups/predicates.go b/resource-manager/network/2022-07-01/ipgroups/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/ipgroups/predicates.go rename to resource-manager/network/2022-07-01/ipgroups/predicates.go diff --git a/resource-manager/network/2022-07-01/ipgroups/version.go b/resource-manager/network/2022-07-01/ipgroups/version.go new file mode 100644 index 00000000000..02cd6fee6ce --- /dev/null +++ b/resource-manager/network/2022-07-01/ipgroups/version.go @@ -0,0 +1,12 @@ +package ipgroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/ipgroups/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/loadbalancers/README.md b/resource-manager/network/2022-07-01/loadbalancers/README.md new file mode 100644 index 00000000000..bcfa80fd484 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/README.md @@ -0,0 +1,428 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/loadbalancers` Documentation + +The `loadbalancers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/loadbalancers" +``` + + +### Client Initialization + +```go +client := loadbalancers.NewLoadBalancersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `LoadBalancersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +payload := loadbalancers.LoadBalancer{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.Delete` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.Get` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +read, err := client.Get(ctx, id, loadbalancers.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.InboundNatRulesCreateOrUpdate` + +```go +ctx := context.TODO() +id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") + +payload := loadbalancers.InboundNatRule{ + // ... +} + + +if err := client.InboundNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.InboundNatRulesDelete` + +```go +ctx := context.TODO() +id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") + +if err := client.InboundNatRulesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.InboundNatRulesGet` + +```go +ctx := context.TODO() +id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") + +read, err := client.InboundNatRulesGet(ctx, id, loadbalancers.DefaultInboundNatRulesGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.InboundNatRulesList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.InboundNatRulesList(ctx, id)` can be used to do batched pagination +items, err := client.InboundNatRulesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `LoadBalancersClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.ListInboundNatRulePortMappings` + +```go +ctx := context.TODO() +id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue") + +payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ + // ... +} + + +if err := client.ListInboundNatRulePortMappingsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsCreateOrUpdate` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") + +payload := loadbalancers.BackendAddressPool{ + // ... +} + + +if err := client.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsDelete` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") + +if err := client.LoadBalancerBackendAddressPoolsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsGet` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") + +read, err := client.LoadBalancerBackendAddressPoolsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.LoadBalancerBackendAddressPoolsList(ctx, id)` can be used to do batched pagination +items, err := client.LoadBalancerBackendAddressPoolsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsGet` + +```go +ctx := context.TODO() +id := loadbalancers.NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue") + +read, err := client.LoadBalancerFrontendIPConfigurationsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.LoadBalancerFrontendIPConfigurationsList(ctx, id)` can be used to do batched pagination +items, err := client.LoadBalancerFrontendIPConfigurationsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesGet` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue") + +read, err := client.LoadBalancerLoadBalancingRulesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.LoadBalancerLoadBalancingRulesList(ctx, id)` can be used to do batched pagination +items, err := client.LoadBalancerLoadBalancingRulesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerNetworkInterfacesList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.LoadBalancerNetworkInterfacesList(ctx, id)` can be used to do batched pagination +items, err := client.LoadBalancerNetworkInterfacesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesGet` + +```go +ctx := context.TODO() +id := loadbalancers.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue") + +read, err := client.LoadBalancerOutboundRulesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.LoadBalancerOutboundRulesList(ctx, id)` can be used to do batched pagination +items, err := client.LoadBalancerOutboundRulesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerProbesGet` + +```go +ctx := context.TODO() +id := loadbalancers.NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue") + +read, err := client.LoadBalancerProbesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `LoadBalancersClient.LoadBalancerProbesList` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +// alternatively `client.LoadBalancerProbesList(ctx, id)` can be used to do batched pagination +items, err := client.LoadBalancerProbesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `LoadBalancersClient.SwapPublicIPAddresses` + +```go +ctx := context.TODO() +id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := loadbalancers.LoadBalancerVipSwapRequest{ + // ... +} + + +if err := client.SwapPublicIPAddressesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `LoadBalancersClient.UpdateTags` + +```go +ctx := context.TODO() +id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + +payload := loadbalancers.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/network/2023-04-01/loadbalancers/client.go b/resource-manager/network/2022-07-01/loadbalancers/client.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/client.go rename to resource-manager/network/2022-07-01/loadbalancers/client.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/constants.go b/resource-manager/network/2022-07-01/loadbalancers/constants.go new file mode 100644 index 00000000000..ad4d2500cd2 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/constants.go @@ -0,0 +1,1230 @@ +package loadbalancers + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type LoadBalancerOutboundRuleProtocol string + +const ( + LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" + LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" + LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" +) + +func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { + return []string{ + string(LoadBalancerOutboundRuleProtocolAll), + string(LoadBalancerOutboundRuleProtocolTcp), + string(LoadBalancerOutboundRuleProtocolUdp), + } +} + +func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerOutboundRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { + vals := map[string]LoadBalancerOutboundRuleProtocol{ + "all": LoadBalancerOutboundRuleProtocolAll, + "tcp": LoadBalancerOutboundRuleProtocolTcp, + "udp": LoadBalancerOutboundRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerOutboundRuleProtocol(input) + return &out, nil +} + +type LoadBalancerSkuName string + +const ( + LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" + LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" + LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" +) + +func PossibleValuesForLoadBalancerSkuName() []string { + return []string{ + string(LoadBalancerSkuNameBasic), + string(LoadBalancerSkuNameGateway), + string(LoadBalancerSkuNameStandard), + } +} + +func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { + vals := map[string]LoadBalancerSkuName{ + "basic": LoadBalancerSkuNameBasic, + "gateway": LoadBalancerSkuNameGateway, + "standard": LoadBalancerSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerSkuName(input) + return &out, nil +} + +type LoadBalancerSkuTier string + +const ( + LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" + LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" +) + +func PossibleValuesForLoadBalancerSkuTier() []string { + return []string{ + string(LoadBalancerSkuTierGlobal), + string(LoadBalancerSkuTierRegional), + } +} + +func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { + vals := map[string]LoadBalancerSkuTier{ + "global": LoadBalancerSkuTierGlobal, + "regional": LoadBalancerSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerSkuTier(input) + return &out, nil +} + +type LoadDistribution string + +const ( + LoadDistributionDefault LoadDistribution = "Default" + LoadDistributionSourceIP LoadDistribution = "SourceIP" + LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" +) + +func PossibleValuesForLoadDistribution() []string { + return []string{ + string(LoadDistributionDefault), + string(LoadDistributionSourceIP), + string(LoadDistributionSourceIPProtocol), + } +} + +func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadDistribution(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadDistribution(input string) (*LoadDistribution, error) { + vals := map[string]LoadDistribution{ + "default": LoadDistributionDefault, + "sourceip": LoadDistributionSourceIP, + "sourceipprotocol": LoadDistributionSourceIPProtocol, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadDistribution(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProbeProtocol string + +const ( + ProbeProtocolHTTP ProbeProtocol = "Http" + ProbeProtocolHTTPS ProbeProtocol = "Https" + ProbeProtocolTcp ProbeProtocol = "Tcp" +) + +func PossibleValuesForProbeProtocol() []string { + return []string{ + string(ProbeProtocolHTTP), + string(ProbeProtocolHTTPS), + string(ProbeProtocolTcp), + } +} + +func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProbeProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProbeProtocol(input string) (*ProbeProtocol, error) { + vals := map[string]ProbeProtocol{ + "http": ProbeProtocolHTTP, + "https": ProbeProtocolHTTPS, + "tcp": ProbeProtocolTcp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProbeProtocol(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2022-07-01/loadbalancers/id_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_backendaddresspool.go rename to resource-manager/network/2022-07-01/loadbalancers/id_backendaddresspool.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_backendaddresspool_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_backendaddresspool_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_backendaddresspool_test.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_frontendipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/id_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/id_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_frontendipconfiguration_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_frontendipconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_frontendipconfiguration_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_frontendipconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_inboundnatrule.go b/resource-manager/network/2022-07-01/loadbalancers/id_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_inboundnatrule.go rename to resource-manager/network/2022-07-01/loadbalancers/id_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_inboundnatrule_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_inboundnatrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_inboundnatrule_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_inboundnatrule_test.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer.go new file mode 100644 index 00000000000..88235454e6a --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer.go @@ -0,0 +1,130 @@ +package loadbalancers + +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(&LoadBalancerId{}) +} + +var _ resourceids.ResourceId = &LoadBalancerId{} + +// LoadBalancerId is a struct representing the Resource ID for a Load Balancer +type LoadBalancerId struct { + SubscriptionId string + ResourceGroupName string + LoadBalancerName string +} + +// NewLoadBalancerID returns a new LoadBalancerId struct +func NewLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) LoadBalancerId { + return LoadBalancerId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + LoadBalancerName: loadBalancerName, + } +} + +// ParseLoadBalancerID parses 'input' into a LoadBalancerId +func ParseLoadBalancerID(input string) (*LoadBalancerId, error) { + parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LoadBalancerId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseLoadBalancerIDInsensitively parses 'input' case-insensitively into a LoadBalancerId +// note: this method should only be used for API response data and not user input +func ParseLoadBalancerIDInsensitively(input string) (*LoadBalancerId, error) { + parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := LoadBalancerId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *LoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) + } + + return nil +} + +// ValidateLoadBalancerID checks that 'input' can be parsed as a Load Balancer ID +func ValidateLoadBalancerID(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 := ParseLoadBalancerID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Load Balancer ID +func (id LoadBalancerId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Load Balancer ID +func (id LoadBalancerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), + resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), + resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), + } +} + +// String returns a human-readable description of this Load Balancer ID +func (id LoadBalancerId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), + } + return fmt.Sprintf("Load Balancer (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer_test.go new file mode 100644 index 00000000000..d4cac1b83d4 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancer_test.go @@ -0,0 +1,282 @@ +package loadbalancers + +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 = &LoadBalancerId{} + +func TestNewLoadBalancerID(t *testing.T) { + id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") + + 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.LoadBalancerName != "loadBalancerValue" { + t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") + } +} + +func TestFormatLoadBalancerID(t *testing.T) { + actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseLoadBalancerID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LoadBalancerId + }{ + { + // 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.Network", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", + Expected: &LoadBalancerId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + LoadBalancerName: "loadBalancerValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { + t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) + } + + } +} + +func TestParseLoadBalancerIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *LoadBalancerId + }{ + { + // 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.Network", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", + Expected: &LoadBalancerId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + LoadBalancerName: "loadBalancerValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", + Expected: &LoadBalancerId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + LoadBalancerName: "lOaDbAlAnCeRvAlUe", + }, + }, + { + // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { + t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) + } + + } +} + +func TestSegmentsForLoadBalancerId(t *testing.T) { + segments := LoadBalancerId{}.Segments() + if len(segments) == 0 { + t.Fatalf("LoadBalancerId 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/network/2023-04-01/loadbalancers/id_loadbalancerbackendaddresspool.go b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancerbackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_loadbalancerbackendaddresspool.go rename to resource-manager/network/2022-07-01/loadbalancers/id_loadbalancerbackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancingrule.go b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_loadbalancingrule.go rename to resource-manager/network/2022-07-01/loadbalancers/id_loadbalancingrule.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancingrule_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_loadbalancingrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_loadbalancingrule_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_loadbalancingrule_test.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_location.go b/resource-manager/network/2022-07-01/loadbalancers/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_location.go rename to resource-manager/network/2022-07-01/loadbalancers/id_location.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_location_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_location_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_location_test.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_outboundrule.go b/resource-manager/network/2022-07-01/loadbalancers/id_outboundrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_outboundrule.go rename to resource-manager/network/2022-07-01/loadbalancers/id_outboundrule.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_outboundrule_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_outboundrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_outboundrule_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_outboundrule_test.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_probe.go b/resource-manager/network/2022-07-01/loadbalancers/id_probe.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_probe.go rename to resource-manager/network/2022-07-01/loadbalancers/id_probe.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_probe_test.go b/resource-manager/network/2022-07-01/loadbalancers/id_probe_test.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/id_probe_test.go rename to resource-manager/network/2022-07-01/loadbalancers/id_probe_test.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_createorupdate.go b/resource-manager/network/2022-07-01/loadbalancers/method_createorupdate.go new file mode 100644 index 00000000000..f67b6b9cb10 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_createorupdate.go @@ -0,0 +1,75 @@ +package loadbalancers + +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 *LoadBalancer +} + +// CreateOrUpdate ... +func (c LoadBalancersClient) CreateOrUpdate(ctx context.Context, id LoadBalancerId, input LoadBalancer) (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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed +func (c LoadBalancersClient) CreateOrUpdateThenPoll(ctx context.Context, id LoadBalancerId, input LoadBalancer) error { + result, err := c.CreateOrUpdate(ctx, id, input) + 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/network/2022-07-01/loadbalancers/method_delete.go b/resource-manager/network/2022-07-01/loadbalancers/method_delete.go new file mode 100644 index 00000000000..54ff21552df --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_delete.go @@ -0,0 +1,71 @@ +package loadbalancers + +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 LoadBalancersClient) Delete(ctx context.Context, id LoadBalancerId) (result DeleteOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + 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 LoadBalancersClient) DeleteThenPoll(ctx context.Context, id LoadBalancerId) 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/network/2022-07-01/loadbalancers/method_get.go b/resource-manager/network/2022-07-01/loadbalancers/method_get.go new file mode 100644 index 00000000000..5d7f179c315 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_get.go @@ -0,0 +1,83 @@ +package loadbalancers + +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 GetOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *LoadBalancer +} + +type GetOperationOptions struct { + Expand *string +} + +func DefaultGetOperationOptions() GetOperationOptions { + return GetOperationOptions{} +} + +func (o GetOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o GetOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o GetOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.Expand != nil { + out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) + } + return &out +} + +// Get ... +func (c LoadBalancersClient) Get(ctx context.Context, id LoadBalancerId, options GetOperationOptions) (result GetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: id.ID(), + OptionsObject: options, + } + + 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 LoadBalancer + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_inboundnatrulescreateorupdate.go b/resource-manager/network/2022-07-01/loadbalancers/method_inboundnatrulescreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_inboundnatrulescreateorupdate.go rename to resource-manager/network/2022-07-01/loadbalancers/method_inboundnatrulescreateorupdate.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_inboundnatrulesdelete.go b/resource-manager/network/2022-07-01/loadbalancers/method_inboundnatrulesdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_inboundnatrulesdelete.go rename to resource-manager/network/2022-07-01/loadbalancers/method_inboundnatrulesdelete.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_inboundnatrulesget.go b/resource-manager/network/2022-07-01/loadbalancers/method_inboundnatrulesget.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_inboundnatrulesget.go rename to resource-manager/network/2022-07-01/loadbalancers/method_inboundnatrulesget.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_inboundnatruleslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_inboundnatruleslist.go new file mode 100644 index 00000000000..70148a8d0be --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_inboundnatruleslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 InboundNatRulesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]InboundNatRule +} + +type InboundNatRulesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []InboundNatRule +} + +// InboundNatRulesList ... +func (c LoadBalancersClient) InboundNatRulesList(ctx context.Context, id LoadBalancerId) (result InboundNatRulesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/inboundNatRules", 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 *[]InboundNatRule `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// InboundNatRulesListComplete retrieves all the results into a single object +func (c LoadBalancersClient) InboundNatRulesListComplete(ctx context.Context, id LoadBalancerId) (InboundNatRulesListCompleteResult, error) { + return c.InboundNatRulesListCompleteMatchingPredicate(ctx, id, InboundNatRuleOperationPredicate{}) +} + +// InboundNatRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) InboundNatRulesListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate InboundNatRuleOperationPredicate) (result InboundNatRulesListCompleteResult, err error) { + items := make([]InboundNatRule, 0) + + resp, err := c.InboundNatRulesList(ctx, id) + if err != nil { + 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 = InboundNatRulesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_list.go b/resource-manager/network/2022-07-01/loadbalancers/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_list.go rename to resource-manager/network/2022-07-01/loadbalancers/method_list.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_listall.go b/resource-manager/network/2022-07-01/loadbalancers/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_listall.go rename to resource-manager/network/2022-07-01/loadbalancers/method_listall.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_listinboundnatruleportmappings.go b/resource-manager/network/2022-07-01/loadbalancers/method_listinboundnatruleportmappings.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_listinboundnatruleportmappings.go rename to resource-manager/network/2022-07-01/loadbalancers/method_listinboundnatruleportmappings.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go new file mode 100644 index 00000000000..3bc6a603964 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 LoadBalancerBackendAddressPoolsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]BackendAddressPool +} + +type LoadBalancerBackendAddressPoolsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []BackendAddressPool +} + +// LoadBalancerBackendAddressPoolsList ... +func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsList(ctx context.Context, id LoadBalancerId) (result LoadBalancerBackendAddressPoolsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/backendAddressPools", 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 *[]BackendAddressPool `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// LoadBalancerBackendAddressPoolsListComplete retrieves all the results into a single object +func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListComplete(ctx context.Context, id LoadBalancerId) (LoadBalancerBackendAddressPoolsListCompleteResult, error) { + return c.LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx, id, BackendAddressPoolOperationPredicate{}) +} + +// LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate BackendAddressPoolOperationPredicate) (result LoadBalancerBackendAddressPoolsListCompleteResult, err error) { + items := make([]BackendAddressPool, 0) + + resp, err := c.LoadBalancerBackendAddressPoolsList(ctx, id) + if err != nil { + 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 = LoadBalancerBackendAddressPoolsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go new file mode 100644 index 00000000000..398324f7c81 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 LoadBalancerFrontendIPConfigurationsListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]FrontendIPConfiguration +} + +type LoadBalancerFrontendIPConfigurationsListCompleteResult struct { + LatestHttpResponse *http.Response + Items []FrontendIPConfiguration +} + +// LoadBalancerFrontendIPConfigurationsList ... +func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsList(ctx context.Context, id LoadBalancerId) (result LoadBalancerFrontendIPConfigurationsListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/frontendIPConfigurations", 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 *[]FrontendIPConfiguration `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// LoadBalancerFrontendIPConfigurationsListComplete retrieves all the results into a single object +func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListComplete(ctx context.Context, id LoadBalancerId) (LoadBalancerFrontendIPConfigurationsListCompleteResult, error) { + return c.LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx, id, FrontendIPConfigurationOperationPredicate{}) +} + +// LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate FrontendIPConfigurationOperationPredicate) (result LoadBalancerFrontendIPConfigurationsListCompleteResult, err error) { + items := make([]FrontendIPConfiguration, 0) + + resp, err := c.LoadBalancerFrontendIPConfigurationsList(ctx, id) + if err != nil { + 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 = LoadBalancerFrontendIPConfigurationsListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go new file mode 100644 index 00000000000..5c371eb79a3 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 LoadBalancerLoadBalancingRulesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]LoadBalancingRule +} + +type LoadBalancerLoadBalancingRulesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []LoadBalancingRule +} + +// LoadBalancerLoadBalancingRulesList ... +func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesList(ctx context.Context, id LoadBalancerId) (result LoadBalancerLoadBalancingRulesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/loadBalancingRules", 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 *[]LoadBalancingRule `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// LoadBalancerLoadBalancingRulesListComplete retrieves all the results into a single object +func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListComplete(ctx context.Context, id LoadBalancerId) (LoadBalancerLoadBalancingRulesListCompleteResult, error) { + return c.LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx, id, LoadBalancingRuleOperationPredicate{}) +} + +// LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate LoadBalancingRuleOperationPredicate) (result LoadBalancerLoadBalancingRulesListCompleteResult, err error) { + items := make([]LoadBalancingRule, 0) + + resp, err := c.LoadBalancerLoadBalancingRulesList(ctx, id) + if err != nil { + 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 = LoadBalancerLoadBalancingRulesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go new file mode 100644 index 00000000000..2b47237317d --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 LoadBalancerNetworkInterfacesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]NetworkInterface +} + +type LoadBalancerNetworkInterfacesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []NetworkInterface +} + +// LoadBalancerNetworkInterfacesList ... +func (c LoadBalancersClient) LoadBalancerNetworkInterfacesList(ctx context.Context, id LoadBalancerId) (result LoadBalancerNetworkInterfacesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// LoadBalancerNetworkInterfacesListComplete retrieves all the results into a single object +func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListComplete(ctx context.Context, id LoadBalancerId) (LoadBalancerNetworkInterfacesListCompleteResult, error) { + return c.LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) +} + +// LoadBalancerNetworkInterfacesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate NetworkInterfaceOperationPredicate) (result LoadBalancerNetworkInterfacesListCompleteResult, err error) { + items := make([]NetworkInterface, 0) + + resp, err := c.LoadBalancerNetworkInterfacesList(ctx, id) + if err != nil { + 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 = LoadBalancerNetworkInterfacesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalanceroutboundrulesget.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalanceroutboundrulesget.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalanceroutboundrulesget.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalanceroutboundrulesget.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_loadbalanceroutboundruleslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalanceroutboundruleslist.go new file mode 100644 index 00000000000..613c988a77f --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalanceroutboundruleslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 LoadBalancerOutboundRulesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]OutboundRule +} + +type LoadBalancerOutboundRulesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []OutboundRule +} + +// LoadBalancerOutboundRulesList ... +func (c LoadBalancersClient) LoadBalancerOutboundRulesList(ctx context.Context, id LoadBalancerId) (result LoadBalancerOutboundRulesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/outboundRules", 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 *[]OutboundRule `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// LoadBalancerOutboundRulesListComplete retrieves all the results into a single object +func (c LoadBalancersClient) LoadBalancerOutboundRulesListComplete(ctx context.Context, id LoadBalancerId) (LoadBalancerOutboundRulesListCompleteResult, error) { + return c.LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx, id, OutboundRuleOperationPredicate{}) +} + +// LoadBalancerOutboundRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate OutboundRuleOperationPredicate) (result LoadBalancerOutboundRulesListCompleteResult, err error) { + items := make([]OutboundRule, 0) + + resp, err := c.LoadBalancerOutboundRulesList(ctx, id) + if err != nil { + 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 = LoadBalancerOutboundRulesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerprobesget.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerprobesget.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerprobesget.go rename to resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerprobesget.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerprobeslist.go b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerprobeslist.go new file mode 100644 index 00000000000..ebd9aabafdc --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_loadbalancerprobeslist.go @@ -0,0 +1,91 @@ +package loadbalancers + +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 LoadBalancerProbesListOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]Probe +} + +type LoadBalancerProbesListCompleteResult struct { + LatestHttpResponse *http.Response + Items []Probe +} + +// LoadBalancerProbesList ... +func (c LoadBalancersClient) LoadBalancerProbesList(ctx context.Context, id LoadBalancerId) (result LoadBalancerProbesListOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/probes", 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 *[]Probe `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// LoadBalancerProbesListComplete retrieves all the results into a single object +func (c LoadBalancersClient) LoadBalancerProbesListComplete(ctx context.Context, id LoadBalancerId) (LoadBalancerProbesListCompleteResult, error) { + return c.LoadBalancerProbesListCompleteMatchingPredicate(ctx, id, ProbeOperationPredicate{}) +} + +// LoadBalancerProbesListCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c LoadBalancersClient) LoadBalancerProbesListCompleteMatchingPredicate(ctx context.Context, id LoadBalancerId, predicate ProbeOperationPredicate) (result LoadBalancerProbesListCompleteResult, err error) { + items := make([]Probe, 0) + + resp, err := c.LoadBalancerProbesList(ctx, id) + if err != nil { + 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 = LoadBalancerProbesListCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_swappublicipaddresses.go b/resource-manager/network/2022-07-01/loadbalancers/method_swappublicipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/method_swappublicipaddresses.go rename to resource-manager/network/2022-07-01/loadbalancers/method_swappublicipaddresses.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/method_updatetags.go b/resource-manager/network/2022-07-01/loadbalancers/method_updatetags.go new file mode 100644 index 00000000000..8087a8767fc --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/method_updatetags.go @@ -0,0 +1,58 @@ +package loadbalancers + +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 *LoadBalancer +} + +// UpdateTags ... +func (c LoadBalancersClient) UpdateTags(ctx context.Context, id LoadBalancerId, 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 LoadBalancer + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go b/resource-manager/network/2022-07-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go rename to resource-manager/network/2022-07-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_backendaddresspool.go b/resource-manager/network/2022-07-01/loadbalancers/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/loadbalancers/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..37a78041bf9 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package loadbalancers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_ddossettings.go b/resource-manager/network/2022-07-01/loadbalancers/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_ddossettings.go rename to resource-manager/network/2022-07-01/loadbalancers/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_delegation.go b/resource-manager/network/2022-07-01/loadbalancers/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_delegation.go rename to resource-manager/network/2022-07-01/loadbalancers/model_delegation.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_flowlog.go b/resource-manager/network/2022-07-01/loadbalancers/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_flowlog.go rename to resource-manager/network/2022-07-01/loadbalancers/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/loadbalancers/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/loadbalancers/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_inboundnatpool.go b/resource-manager/network/2022-07-01/loadbalancers/model_inboundnatpool.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_inboundnatpool.go rename to resource-manager/network/2022-07-01/loadbalancers/model_inboundnatpool.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_inboundnatpoolpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_inboundnatpoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_inboundnatpoolpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_inboundnatpoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_inboundnatrule.go b/resource-manager/network/2022-07-01/loadbalancers/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/loadbalancers/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_inboundnatruleportmapping.go b/resource-manager/network/2022-07-01/loadbalancers/model_inboundnatruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_inboundnatruleportmapping.go rename to resource-manager/network/2022-07-01/loadbalancers/model_inboundnatruleportmapping.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_ipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/loadbalancers/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/loadbalancers/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_iptag.go b/resource-manager/network/2022-07-01/loadbalancers/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_iptag.go rename to resource-manager/network/2022-07-01/loadbalancers/model_iptag.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancer.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancer.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancer.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancer.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancerpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancerpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancerpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancerpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancersku.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancersku.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancersku.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancersku.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancervipswaprequest.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancervipswaprequest.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancervipswaprequest.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancervipswaprequest.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancingrule.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancingrule.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancingrule.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_loadbalancingrulepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_loadbalancingrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_loadbalancingrulepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_loadbalancingrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_natgateway.go b/resource-manager/network/2022-07-01/loadbalancers/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_natgateway.go rename to resource-manager/network/2022-07-01/loadbalancers/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_natgatewaysku.go b/resource-manager/network/2022-07-01/loadbalancers/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/loadbalancers/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_natruleportmapping.go b/resource-manager/network/2022-07-01/loadbalancers/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/loadbalancers/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterface.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterface.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..60cd769c0b2 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package loadbalancers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/loadbalancers/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_outboundrule.go b/resource-manager/network/2022-07-01/loadbalancers/model_outboundrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_outboundrule.go rename to resource-manager/network/2022-07-01/loadbalancers/model_outboundrule.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_outboundrulepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_outboundrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_outboundrulepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_outboundrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpoint.go b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privateendpoint.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..117a6f07de8 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package loadbalancers + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkservice.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_probe.go b/resource-manager/network/2022-07-01/loadbalancers/model_probe.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_probe.go rename to resource-manager/network/2022-07-01/loadbalancers/model_probe.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_probepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_probepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_probepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_probepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_publicipaddress.go b/resource-manager/network/2022-07-01/loadbalancers/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_publicipaddress.go rename to resource-manager/network/2022-07-01/loadbalancers/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/loadbalancers/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..d72d7f32bff --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package loadbalancers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/loadbalancers/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/loadbalancers/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go b/resource-manager/network/2022-07-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go rename to resource-manager/network/2022-07-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/loadbalancers/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/loadbalancers/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_resourceset.go b/resource-manager/network/2022-07-01/loadbalancers/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_resourceset.go rename to resource-manager/network/2022-07-01/loadbalancers/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/loadbalancers/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/loadbalancers/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_route.go b/resource-manager/network/2022-07-01/loadbalancers/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_route.go rename to resource-manager/network/2022-07-01/loadbalancers/model_route.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_routetable.go b/resource-manager/network/2022-07-01/loadbalancers/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_routetable.go rename to resource-manager/network/2022-07-01/loadbalancers/model_routetable.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_securityrule.go b/resource-manager/network/2022-07-01/loadbalancers/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_securityrule.go rename to resource-manager/network/2022-07-01/loadbalancers/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..a0ee5478979 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package loadbalancers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_subnet.go b/resource-manager/network/2022-07-01/loadbalancers/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_subnet.go rename to resource-manager/network/2022-07-01/loadbalancers/model_subnet.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..85906ea27e2 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package loadbalancers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_subresource.go b/resource-manager/network/2022-07-01/loadbalancers/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_subresource.go rename to resource-manager/network/2022-07-01/loadbalancers/model_subresource.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_tagsobject.go b/resource-manager/network/2022-07-01/loadbalancers/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_tagsobject.go rename to resource-manager/network/2022-07-01/loadbalancers/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/loadbalancers/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/loadbalancers/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/loadbalancers/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/loadbalancers/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/loadbalancers/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/loadbalancers/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/loadbalancers/predicates.go b/resource-manager/network/2022-07-01/loadbalancers/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/loadbalancers/predicates.go rename to resource-manager/network/2022-07-01/loadbalancers/predicates.go diff --git a/resource-manager/network/2022-07-01/loadbalancers/version.go b/resource-manager/network/2022-07-01/loadbalancers/version.go new file mode 100644 index 00000000000..252e8398287 --- /dev/null +++ b/resource-manager/network/2022-07-01/loadbalancers/version.go @@ -0,0 +1,12 @@ +package loadbalancers + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/loadbalancers/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/localnetworkgateways/README.md b/resource-manager/network/2022-07-01/localnetworkgateways/README.md new file mode 100644 index 00000000000..000d4265f2b --- /dev/null +++ b/resource-manager/network/2022-07-01/localnetworkgateways/README.md @@ -0,0 +1,104 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/localnetworkgateways` Documentation + +The `localnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/localnetworkgateways" +``` + + +### Client Initialization + +```go +client := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `LocalNetworkGatewaysClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") + +payload := localnetworkgateways.LocalNetworkGateway{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `LocalNetworkGatewaysClient.Delete` + +```go +ctx := context.TODO() +id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `LocalNetworkGatewaysClient.Get` + +```go +ctx := context.TODO() +id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") + +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: `LocalNetworkGatewaysClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `LocalNetworkGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") + +payload := localnetworkgateways.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/network/2023-04-01/localnetworkgateways/client.go b/resource-manager/network/2022-07-01/localnetworkgateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/client.go rename to resource-manager/network/2022-07-01/localnetworkgateways/client.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/constants.go b/resource-manager/network/2022-07-01/localnetworkgateways/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/constants.go rename to resource-manager/network/2022-07-01/localnetworkgateways/constants.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/id_localnetworkgateway.go b/resource-manager/network/2022-07-01/localnetworkgateways/id_localnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/id_localnetworkgateway.go rename to resource-manager/network/2022-07-01/localnetworkgateways/id_localnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/id_localnetworkgateway_test.go b/resource-manager/network/2022-07-01/localnetworkgateways/id_localnetworkgateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/id_localnetworkgateway_test.go rename to resource-manager/network/2022-07-01/localnetworkgateways/id_localnetworkgateway_test.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/method_createorupdate.go b/resource-manager/network/2022-07-01/localnetworkgateways/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/method_createorupdate.go rename to resource-manager/network/2022-07-01/localnetworkgateways/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/method_delete.go b/resource-manager/network/2022-07-01/localnetworkgateways/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/method_delete.go rename to resource-manager/network/2022-07-01/localnetworkgateways/method_delete.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/method_get.go b/resource-manager/network/2022-07-01/localnetworkgateways/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/method_get.go rename to resource-manager/network/2022-07-01/localnetworkgateways/method_get.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/method_list.go b/resource-manager/network/2022-07-01/localnetworkgateways/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/method_list.go rename to resource-manager/network/2022-07-01/localnetworkgateways/method_list.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/method_updatetags.go b/resource-manager/network/2022-07-01/localnetworkgateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/method_updatetags.go rename to resource-manager/network/2022-07-01/localnetworkgateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/model_addressspace.go b/resource-manager/network/2022-07-01/localnetworkgateways/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/model_addressspace.go rename to resource-manager/network/2022-07-01/localnetworkgateways/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/model_bgpsettings.go b/resource-manager/network/2022-07-01/localnetworkgateways/model_bgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/model_bgpsettings.go rename to resource-manager/network/2022-07-01/localnetworkgateways/model_bgpsettings.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2022-07-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go rename to resource-manager/network/2022-07-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/model_localnetworkgateway.go b/resource-manager/network/2022-07-01/localnetworkgateways/model_localnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/model_localnetworkgateway.go rename to resource-manager/network/2022-07-01/localnetworkgateways/model_localnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/model_tagsobject.go b/resource-manager/network/2022-07-01/localnetworkgateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/localnetworkgateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/predicates.go b/resource-manager/network/2022-07-01/localnetworkgateways/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/localnetworkgateways/predicates.go rename to resource-manager/network/2022-07-01/localnetworkgateways/predicates.go diff --git a/resource-manager/network/2022-07-01/localnetworkgateways/version.go b/resource-manager/network/2022-07-01/localnetworkgateways/version.go new file mode 100644 index 00000000000..052dc443844 --- /dev/null +++ b/resource-manager/network/2022-07-01/localnetworkgateways/version.go @@ -0,0 +1,12 @@ +package localnetworkgateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/localnetworkgateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/natgateways/README.md b/resource-manager/network/2022-07-01/natgateways/README.md new file mode 100644 index 00000000000..cdb2bf06e8d --- /dev/null +++ b/resource-manager/network/2022-07-01/natgateways/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/natgateways` Documentation + +The `natgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/natgateways" +``` + + +### Client Initialization + +```go +client := natgateways.NewNatGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NatGatewaysClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") + +payload := natgateways.NatGateway{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NatGatewaysClient.Delete` + +```go +ctx := context.TODO() +id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NatGatewaysClient.Get` + +```go +ctx := context.TODO() +id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") + +read, err := client.Get(ctx, id, natgateways.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NatGatewaysClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `NatGatewaysClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NatGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") + +payload := natgateways.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/network/2023-04-01/natgateways/client.go b/resource-manager/network/2022-07-01/natgateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/client.go rename to resource-manager/network/2022-07-01/natgateways/client.go diff --git a/resource-manager/network/2023-04-01/natgateways/constants.go b/resource-manager/network/2022-07-01/natgateways/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/constants.go rename to resource-manager/network/2022-07-01/natgateways/constants.go diff --git a/resource-manager/network/2023-04-01/natgateways/id_natgateway.go b/resource-manager/network/2022-07-01/natgateways/id_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/id_natgateway.go rename to resource-manager/network/2022-07-01/natgateways/id_natgateway.go diff --git a/resource-manager/network/2023-04-01/natgateways/id_natgateway_test.go b/resource-manager/network/2022-07-01/natgateways/id_natgateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/id_natgateway_test.go rename to resource-manager/network/2022-07-01/natgateways/id_natgateway_test.go diff --git a/resource-manager/network/2023-04-01/natgateways/method_createorupdate.go b/resource-manager/network/2022-07-01/natgateways/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/method_createorupdate.go rename to resource-manager/network/2022-07-01/natgateways/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/natgateways/method_delete.go b/resource-manager/network/2022-07-01/natgateways/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/method_delete.go rename to resource-manager/network/2022-07-01/natgateways/method_delete.go diff --git a/resource-manager/network/2023-04-01/natgateways/method_get.go b/resource-manager/network/2022-07-01/natgateways/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/method_get.go rename to resource-manager/network/2022-07-01/natgateways/method_get.go diff --git a/resource-manager/network/2023-04-01/natgateways/method_list.go b/resource-manager/network/2022-07-01/natgateways/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/method_list.go rename to resource-manager/network/2022-07-01/natgateways/method_list.go diff --git a/resource-manager/network/2023-04-01/natgateways/method_listall.go b/resource-manager/network/2022-07-01/natgateways/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/method_listall.go rename to resource-manager/network/2022-07-01/natgateways/method_listall.go diff --git a/resource-manager/network/2023-04-01/natgateways/method_updatetags.go b/resource-manager/network/2022-07-01/natgateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/method_updatetags.go rename to resource-manager/network/2022-07-01/natgateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/natgateways/model_natgateway.go b/resource-manager/network/2022-07-01/natgateways/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/model_natgateway.go rename to resource-manager/network/2022-07-01/natgateways/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/natgateways/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/natgateways/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/natgateways/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/natgateways/model_natgatewaysku.go b/resource-manager/network/2022-07-01/natgateways/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/natgateways/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/natgateways/model_subresource.go b/resource-manager/network/2022-07-01/natgateways/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/model_subresource.go rename to resource-manager/network/2022-07-01/natgateways/model_subresource.go diff --git a/resource-manager/network/2023-04-01/natgateways/model_tagsobject.go b/resource-manager/network/2022-07-01/natgateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/natgateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/natgateways/predicates.go b/resource-manager/network/2022-07-01/natgateways/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/natgateways/predicates.go rename to resource-manager/network/2022-07-01/natgateways/predicates.go diff --git a/resource-manager/network/2022-07-01/natgateways/version.go b/resource-manager/network/2022-07-01/natgateways/version.go new file mode 100644 index 00000000000..541c283ad06 --- /dev/null +++ b/resource-manager/network/2022-07-01/natgateways/version.go @@ -0,0 +1,12 @@ +package natgateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/natgateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkgroups/README.md b/resource-manager/network/2022-07-01/networkgroups/README.md new file mode 100644 index 00000000000..b12c7dc7fc0 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkgroups/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkgroups` Documentation + +The `networkgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkgroups" +``` + + +### Client Initialization + +```go +client := networkgroups.NewNetworkGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") + +payload := networkgroups.NetworkGroup{ + // ... +} + + +read, err := client.CreateOrUpdate(ctx, id, payload, networkgroups.DefaultCreateOrUpdateOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkGroupsClient.Delete` + +```go +ctx := context.TODO() +id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") + +if err := client.DeleteThenPoll(ctx, id, networkgroups.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkGroupsClient.Get` + +```go +ctx := context.TODO() +id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") + +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: `NetworkGroupsClient.List` + +```go +ctx := context.TODO() +id := networkgroups.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +// alternatively `client.List(ctx, id, networkgroups.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, networkgroups.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/networkgroups/client.go b/resource-manager/network/2022-07-01/networkgroups/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/client.go rename to resource-manager/network/2022-07-01/networkgroups/client.go diff --git a/resource-manager/network/2023-04-01/networkgroups/constants.go b/resource-manager/network/2022-07-01/networkgroups/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/constants.go rename to resource-manager/network/2022-07-01/networkgroups/constants.go diff --git a/resource-manager/network/2023-04-01/networkgroups/id_networkgroup.go b/resource-manager/network/2022-07-01/networkgroups/id_networkgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/id_networkgroup.go rename to resource-manager/network/2022-07-01/networkgroups/id_networkgroup.go diff --git a/resource-manager/network/2023-04-01/networkgroups/id_networkgroup_test.go b/resource-manager/network/2022-07-01/networkgroups/id_networkgroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/id_networkgroup_test.go rename to resource-manager/network/2022-07-01/networkgroups/id_networkgroup_test.go diff --git a/resource-manager/network/2023-04-01/networkgroups/id_networkmanager.go b/resource-manager/network/2022-07-01/networkgroups/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/id_networkmanager.go rename to resource-manager/network/2022-07-01/networkgroups/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/networkgroups/id_networkmanager_test.go b/resource-manager/network/2022-07-01/networkgroups/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/networkgroups/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/networkgroups/method_createorupdate.go b/resource-manager/network/2022-07-01/networkgroups/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/method_createorupdate.go rename to resource-manager/network/2022-07-01/networkgroups/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networkgroups/method_delete.go b/resource-manager/network/2022-07-01/networkgroups/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/method_delete.go rename to resource-manager/network/2022-07-01/networkgroups/method_delete.go diff --git a/resource-manager/network/2023-04-01/networkgroups/method_get.go b/resource-manager/network/2022-07-01/networkgroups/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/method_get.go rename to resource-manager/network/2022-07-01/networkgroups/method_get.go diff --git a/resource-manager/network/2023-04-01/networkgroups/method_list.go b/resource-manager/network/2022-07-01/networkgroups/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/method_list.go rename to resource-manager/network/2022-07-01/networkgroups/method_list.go diff --git a/resource-manager/network/2023-04-01/networkgroups/model_networkgroup.go b/resource-manager/network/2022-07-01/networkgroups/model_networkgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/model_networkgroup.go rename to resource-manager/network/2022-07-01/networkgroups/model_networkgroup.go diff --git a/resource-manager/network/2022-07-01/networkgroups/model_networkgroupproperties.go b/resource-manager/network/2022-07-01/networkgroups/model_networkgroupproperties.go new file mode 100644 index 00000000000..4b35dcc425e --- /dev/null +++ b/resource-manager/network/2022-07-01/networkgroups/model_networkgroupproperties.go @@ -0,0 +1,9 @@ +package networkgroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkGroupProperties struct { + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkgroups/predicates.go b/resource-manager/network/2022-07-01/networkgroups/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networkgroups/predicates.go rename to resource-manager/network/2022-07-01/networkgroups/predicates.go diff --git a/resource-manager/network/2022-07-01/networkgroups/version.go b/resource-manager/network/2022-07-01/networkgroups/version.go new file mode 100644 index 00000000000..ed832eb02da --- /dev/null +++ b/resource-manager/network/2022-07-01/networkgroups/version.go @@ -0,0 +1,12 @@ +package networkgroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkgroups/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkinterfaces/README.md b/resource-manager/network/2022-07-01/networkinterfaces/README.md new file mode 100644 index 00000000000..7a2ed51ae81 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/README.md @@ -0,0 +1,371 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkinterfaces` Documentation + +The `networkinterfaces` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkinterfaces" +``` + + +### Client Initialization + +```go +client := networkinterfaces.NewNetworkInterfacesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkInterfacesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +payload := networkinterfaces.NetworkInterface{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkInterfacesClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkInterfacesClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +read, err := client.Get(ctx, id, networkinterfaces.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkInterfacesClient.GetCloudServiceNetworkInterface` + +```go +ctx := context.TODO() +id := networkinterfaces.NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue") + +read, err := client.GetCloudServiceNetworkInterface(ctx, id, networkinterfaces.DefaultGetCloudServiceNetworkInterfaceOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkInterfacesClient.GetEffectiveRouteTable` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +// alternatively `client.GetEffectiveRouteTable(ctx, id)` can be used to do batched pagination +items, err := client.GetEffectiveRouteTableComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetIPConfiguration` + +```go +ctx := context.TODO() +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") + +read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetNetworkInterface` + +```go +ctx := context.TODO() +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") + +read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkInterfacesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `NetworkInterfacesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.ListCloudServiceNetworkInterfaces` + +```go +ctx := context.TODO() +id := networkinterfaces.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") + +// alternatively `client.ListCloudServiceNetworkInterfaces(ctx, id)` can be used to do batched pagination +items, err := client.ListCloudServiceNetworkInterfacesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces` + +```go +ctx := context.TODO() +id := networkinterfaces.NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue") + +// alternatively `client.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, id)` can be used to do batched pagination +items, err := client.ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.ListEffectiveNetworkSecurityGroups` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +// alternatively `client.ListEffectiveNetworkSecurityGroups(ctx, id)` can be used to do batched pagination +items, err := client.ListEffectiveNetworkSecurityGroupsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetIPConfigurations` + +```go +ctx := context.TODO() +id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") + +// alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination +items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces` + +```go +ctx := context.TODO() +id := networkinterfaces.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") + +// alternatively `client.ListVirtualMachineScaleSetNetworkInterfaces(ctx, id)` can be used to do batched pagination +items, err := client.ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces` + +```go +ctx := context.TODO() +id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue") + +// alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination +items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsGet` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "ipConfigurationValue") + +read, err := client.NetworkInterfaceIPConfigurationsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsList` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +// alternatively `client.NetworkInterfaceIPConfigurationsList(ctx, id)` can be used to do batched pagination +items, err := client.NetworkInterfaceIPConfigurationsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceLoadBalancersList` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +// alternatively `client.NetworkInterfaceLoadBalancersList(ctx, id)` can be used to do batched pagination +items, err := client.NetworkInterfaceLoadBalancersListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` + +```go +ctx := context.TODO() +id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue") + +read, err := client.NetworkInterfaceTapConfigurationsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsList` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +// alternatively `client.NetworkInterfaceTapConfigurationsList(ctx, id)` can be used to do batched pagination +items, err := client.NetworkInterfaceTapConfigurationsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkInterfacesClient.UpdateTags` + +```go +ctx := context.TODO() +id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") + +payload := networkinterfaces.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/azurestackhci/2023-09-01-preview/networkinterfaces/client.go b/resource-manager/network/2022-07-01/networkinterfaces/client.go similarity index 100% rename from resource-manager/azurestackhci/2023-09-01-preview/networkinterfaces/client.go rename to resource-manager/network/2022-07-01/networkinterfaces/client.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/constants.go b/resource-manager/network/2022-07-01/networkinterfaces/constants.go new file mode 100644 index 00000000000..7bf626b0538 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/constants.go @@ -0,0 +1,1362 @@ +package networkinterfaces + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type EffectiveRouteSource string + +const ( + EffectiveRouteSourceDefault EffectiveRouteSource = "Default" + EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" + EffectiveRouteSourceUser EffectiveRouteSource = "User" + EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" +) + +func PossibleValuesForEffectiveRouteSource() []string { + return []string{ + string(EffectiveRouteSourceDefault), + string(EffectiveRouteSourceUnknown), + string(EffectiveRouteSourceUser), + string(EffectiveRouteSourceVirtualNetworkGateway), + } +} + +func (s *EffectiveRouteSource) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEffectiveRouteSource(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEffectiveRouteSource(input string) (*EffectiveRouteSource, error) { + vals := map[string]EffectiveRouteSource{ + "default": EffectiveRouteSourceDefault, + "unknown": EffectiveRouteSourceUnknown, + "user": EffectiveRouteSourceUser, + "virtualnetworkgateway": EffectiveRouteSourceVirtualNetworkGateway, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EffectiveRouteSource(input) + return &out, nil +} + +type EffectiveRouteState string + +const ( + EffectiveRouteStateActive EffectiveRouteState = "Active" + EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" +) + +func PossibleValuesForEffectiveRouteState() []string { + return []string{ + string(EffectiveRouteStateActive), + string(EffectiveRouteStateInvalid), + } +} + +func (s *EffectiveRouteState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEffectiveRouteState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEffectiveRouteState(input string) (*EffectiveRouteState, error) { + vals := map[string]EffectiveRouteState{ + "active": EffectiveRouteStateActive, + "invalid": EffectiveRouteStateInvalid, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EffectiveRouteState(input) + return &out, nil +} + +type EffectiveSecurityRuleProtocol string + +const ( + EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" + EffectiveSecurityRuleProtocolTcp EffectiveSecurityRuleProtocol = "Tcp" + EffectiveSecurityRuleProtocolUdp EffectiveSecurityRuleProtocol = "Udp" +) + +func PossibleValuesForEffectiveSecurityRuleProtocol() []string { + return []string{ + string(EffectiveSecurityRuleProtocolAll), + string(EffectiveSecurityRuleProtocolTcp), + string(EffectiveSecurityRuleProtocolUdp), + } +} + +func (s *EffectiveSecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseEffectiveSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseEffectiveSecurityRuleProtocol(input string) (*EffectiveSecurityRuleProtocol, error) { + vals := map[string]EffectiveSecurityRuleProtocol{ + "all": EffectiveSecurityRuleProtocolAll, + "tcp": EffectiveSecurityRuleProtocolTcp, + "udp": EffectiveSecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := EffectiveSecurityRuleProtocol(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type LoadBalancerOutboundRuleProtocol string + +const ( + LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" + LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" + LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" +) + +func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { + return []string{ + string(LoadBalancerOutboundRuleProtocolAll), + string(LoadBalancerOutboundRuleProtocolTcp), + string(LoadBalancerOutboundRuleProtocolUdp), + } +} + +func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerOutboundRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { + vals := map[string]LoadBalancerOutboundRuleProtocol{ + "all": LoadBalancerOutboundRuleProtocolAll, + "tcp": LoadBalancerOutboundRuleProtocolTcp, + "udp": LoadBalancerOutboundRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerOutboundRuleProtocol(input) + return &out, nil +} + +type LoadBalancerSkuName string + +const ( + LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" + LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" + LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" +) + +func PossibleValuesForLoadBalancerSkuName() []string { + return []string{ + string(LoadBalancerSkuNameBasic), + string(LoadBalancerSkuNameGateway), + string(LoadBalancerSkuNameStandard), + } +} + +func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { + vals := map[string]LoadBalancerSkuName{ + "basic": LoadBalancerSkuNameBasic, + "gateway": LoadBalancerSkuNameGateway, + "standard": LoadBalancerSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerSkuName(input) + return &out, nil +} + +type LoadBalancerSkuTier string + +const ( + LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" + LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" +) + +func PossibleValuesForLoadBalancerSkuTier() []string { + return []string{ + string(LoadBalancerSkuTierGlobal), + string(LoadBalancerSkuTierRegional), + } +} + +func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { + vals := map[string]LoadBalancerSkuTier{ + "global": LoadBalancerSkuTierGlobal, + "regional": LoadBalancerSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerSkuTier(input) + return &out, nil +} + +type LoadDistribution string + +const ( + LoadDistributionDefault LoadDistribution = "Default" + LoadDistributionSourceIP LoadDistribution = "SourceIP" + LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" +) + +func PossibleValuesForLoadDistribution() []string { + return []string{ + string(LoadDistributionDefault), + string(LoadDistributionSourceIP), + string(LoadDistributionSourceIPProtocol), + } +} + +func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadDistribution(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadDistribution(input string) (*LoadDistribution, error) { + vals := map[string]LoadDistribution{ + "default": LoadDistributionDefault, + "sourceip": LoadDistributionSourceIP, + "sourceipprotocol": LoadDistributionSourceIPProtocol, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadDistribution(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProbeProtocol string + +const ( + ProbeProtocolHTTP ProbeProtocol = "Http" + ProbeProtocolHTTPS ProbeProtocol = "Https" + ProbeProtocolTcp ProbeProtocol = "Tcp" +) + +func PossibleValuesForProbeProtocol() []string { + return []string{ + string(ProbeProtocolHTTP), + string(ProbeProtocolHTTPS), + string(ProbeProtocolTcp), + } +} + +func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProbeProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProbeProtocol(input string) (*ProbeProtocol, error) { + vals := map[string]ProbeProtocol{ + "http": ProbeProtocolHTTP, + "https": ProbeProtocolHTTPS, + "tcp": ProbeProtocolTcp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProbeProtocol(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_providercloudservice.go b/resource-manager/network/2022-07-01/networkinterfaces/id_providercloudservice.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_providercloudservice.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_providercloudservice.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_providercloudservice_test.go b/resource-manager/network/2022-07-01/networkinterfaces/id_providercloudservice_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_providercloudservice_test.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_providercloudservice_test.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_roleinstance.go b/resource-manager/network/2022-07-01/networkinterfaces/id_roleinstance.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_roleinstance.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_roleinstance.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_roleinstance_test.go b/resource-manager/network/2022-07-01/networkinterfaces/id_roleinstance_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_roleinstance_test.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_roleinstance_test.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_roleinstancenetworkinterface.go b/resource-manager/network/2022-07-01/networkinterfaces/id_roleinstancenetworkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_roleinstancenetworkinterface.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_roleinstancenetworkinterface.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_roleinstancenetworkinterface_test.go b/resource-manager/network/2022-07-01/networkinterfaces/id_roleinstancenetworkinterface_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_roleinstancenetworkinterface_test.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_roleinstancenetworkinterface_test.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_tapconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/id_tapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_tapconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_tapconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_tapconfiguration_test.go b/resource-manager/network/2022-07-01/networkinterfaces/id_tapconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_tapconfiguration_test.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_tapconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachine.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachine.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachine.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachine_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachine_test.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachine_test.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachinescaleset.go b/resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachinescaleset.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachinescaleset.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachinescaleset.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachinescaleset_test.go b/resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachinescaleset_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/id_virtualmachinescaleset_test.go rename to resource-manager/network/2022-07-01/networkinterfaces/id_virtualmachinescaleset_test.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_createorupdate.go b/resource-manager/network/2022-07-01/networkinterfaces/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_createorupdate.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_delete.go b/resource-manager/network/2022-07-01/networkinterfaces/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_delete.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_delete.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_get.go b/resource-manager/network/2022-07-01/networkinterfaces/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_get.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_get.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_getcloudservicenetworkinterface.go b/resource-manager/network/2022-07-01/networkinterfaces/method_getcloudservicenetworkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_getcloudservicenetworkinterface.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_getcloudservicenetworkinterface.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_geteffectiveroutetable.go b/resource-manager/network/2022-07-01/networkinterfaces/method_geteffectiveroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_geteffectiveroutetable.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_geteffectiveroutetable.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go b/resource-manager/network/2022-07-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_list.go b/resource-manager/network/2022-07-01/networkinterfaces/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_list.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_list.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listall.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listall.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listall.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go b/resource-manager/network/2022-07-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go b/resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go b/resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go b/resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go b/resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go b/resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/method_updatetags.go b/resource-manager/network/2022-07-01/networkinterfaces/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/method_updatetags.go rename to resource-manager/network/2022-07-01/networkinterfaces/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_backendaddresspool.go b/resource-manager/network/2022-07-01/networkinterfaces/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..72034a1a0c3 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package networkinterfaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_ddossettings.go b/resource-manager/network/2022-07-01/networkinterfaces/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_ddossettings.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_delegation.go b/resource-manager/network/2022-07-01/networkinterfaces/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_delegation.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_delegation.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_effectivenetworksecuritygroup.go b/resource-manager/network/2022-07-01/networkinterfaces/model_effectivenetworksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_effectivenetworksecuritygroup.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_effectivenetworksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go b/resource-manager/network/2022-07-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_effectivenetworksecurityrule.go b/resource-manager/network/2022-07-01/networkinterfaces/model_effectivenetworksecurityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_effectivenetworksecurityrule.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_effectivenetworksecurityrule.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_effectiveroute.go b/resource-manager/network/2022-07-01/networkinterfaces/model_effectiveroute.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_effectiveroute.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_effectiveroute.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_flowlog.go b/resource-manager/network/2022-07-01/networkinterfaces/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_flowlog.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/networkinterfaces/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatpool.go b/resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatpool.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatpool.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatpool.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatrule.go b/resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_ipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/networkinterfaces/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_iptag.go b/resource-manager/network/2022-07-01/networkinterfaces/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_iptag.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_iptag.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancer.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancer.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancer.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancer.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancerpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancerpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancerpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancerpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancersku.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancersku.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancersku.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancersku.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancingrule.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancingrule.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancingrule.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_natgateway.go b/resource-manager/network/2022-07-01/networkinterfaces/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_natgateway.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_natgatewaysku.go b/resource-manager/network/2022-07-01/networkinterfaces/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_natruleportmapping.go b/resource-manager/network/2022-07-01/networkinterfaces/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterface.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterface.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..91fa2155d75 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package networkinterfaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_outboundrule.go b/resource-manager/network/2022-07-01/networkinterfaces/model_outboundrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_outboundrule.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_outboundrule.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_outboundrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_outboundrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_outboundrulepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_outboundrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpoint.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privateendpoint.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..65eb62e8518 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package networkinterfaces + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkservice.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_probe.go b/resource-manager/network/2022-07-01/networkinterfaces/model_probe.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_probe.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_probe.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_probepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_probepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_probepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_probepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddress.go b/resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddress.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..a1d9e8885fe --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package networkinterfaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/networkinterfaces/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_resourceset.go b/resource-manager/network/2022-07-01/networkinterfaces/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_resourceset.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/networkinterfaces/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_route.go b/resource-manager/network/2022-07-01/networkinterfaces/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_route.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_route.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_routetable.go b/resource-manager/network/2022-07-01/networkinterfaces/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_routetable.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_routetable.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_securityrule.go b/resource-manager/network/2022-07-01/networkinterfaces/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_securityrule.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..e09bbf04a8b --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package networkinterfaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_subnet.go b/resource-manager/network/2022-07-01/networkinterfaces/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_subnet.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_subnet.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..61ece2d9071 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package networkinterfaces + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_subresource.go b/resource-manager/network/2022-07-01/networkinterfaces/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_subresource.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_subresource.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_tagsobject.go b/resource-manager/network/2022-07-01/networkinterfaces/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_tagsobject.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/networkinterfaces/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/networkinterfaces/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/networkinterfaces/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/networkinterfaces/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkinterfaces/predicates.go b/resource-manager/network/2022-07-01/networkinterfaces/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networkinterfaces/predicates.go rename to resource-manager/network/2022-07-01/networkinterfaces/predicates.go diff --git a/resource-manager/network/2022-07-01/networkinterfaces/version.go b/resource-manager/network/2022-07-01/networkinterfaces/version.go new file mode 100644 index 00000000000..b1019683a8f --- /dev/null +++ b/resource-manager/network/2022-07-01/networkinterfaces/version.go @@ -0,0 +1,12 @@ +package networkinterfaces + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkinterfaces/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/README.md b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/README.md new file mode 100644 index 00000000000..713c29cc75d --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/README.md @@ -0,0 +1,41 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanageractiveconfigurations` Documentation + +The `networkmanageractiveconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkmanageractiveconfigurations" +``` + + +### Client Initialization + +```go +client := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkManagerActiveConfigurationsClient.ListActiveSecurityAdminRules` + +```go +ctx := context.TODO() +id := networkmanageractiveconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +payload := networkmanageractiveconfigurations.ActiveConfigurationParameter{ + // ... +} + + +read, err := client.ListActiveSecurityAdminRules(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/network/2023-04-01/networkmanageractiveconfigurations/client.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/client.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/client.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/constants.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/constants.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/constants.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/id_networkmanager.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/id_networkmanager.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/id_networkmanager_test.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_addressprefixitem.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_addressprefixitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_addressprefixitem.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_addressprefixitem.go diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go new file mode 100644 index 00000000000..b71a27f6304 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go @@ -0,0 +1,17 @@ +package networkmanageractiveconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdminPropertiesFormat struct { + Access SecurityConfigurationRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + Direction SecurityConfigurationRuleDirection `json:"direction"` + Priority int64 `json:"priority"` + Protocol SecurityConfigurationRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + Sources *[]AddressPrefixItem `json:"sources,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_configurationgroup.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_configurationgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_configurationgroup.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_configurationgroup.go diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go new file mode 100644 index 00000000000..495691739ac --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go @@ -0,0 +1,18 @@ +package networkmanageractiveconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DefaultAdminPropertiesFormat struct { + Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` + Description *string `json:"description,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` + Flag *string `json:"flag,omitempty"` + Priority *int64 `json:"priority,omitempty"` + Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + Sources *[]AddressPrefixItem `json:"sources,omitempty"` +} diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_networkgroupproperties.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_networkgroupproperties.go new file mode 100644 index 00000000000..4aa5d8501e7 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_networkgroupproperties.go @@ -0,0 +1,9 @@ +package networkmanageractiveconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkGroupProperties struct { + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go rename to resource-manager/network/2022-07-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/version.go b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/version.go new file mode 100644 index 00000000000..65be468db08 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconfigurations/version.go @@ -0,0 +1,12 @@ +package networkmanageractiveconfigurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconfigurations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/README.md b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/README.md new file mode 100644 index 00000000000..64d87a5a659 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/README.md @@ -0,0 +1,41 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations` Documentation + +The `networkmanageractiveconnectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkmanageractiveconnectivityconfigurations" +``` + + +### Client Initialization + +```go +client := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkManagerActiveConnectivityConfigurationsClient.ListActiveConnectivityConfigurations` + +```go +ctx := context.TODO() +id := networkmanageractiveconnectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +payload := networkmanageractiveconnectivityconfigurations.ActiveConfigurationParameter{ + // ... +} + + +read, err := client.ListActiveConnectivityConfigurations(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/network/2023-04-01/networkmanageractiveconnectivityconfigurations/client.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/client.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/client.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/constants.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/constants.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/constants.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go new file mode 100644 index 00000000000..dccea295bae --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go @@ -0,0 +1,14 @@ +package networkmanageractiveconnectivityconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectivityConfigurationProperties struct { + AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` + ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` + DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` + Description *string `json:"description,omitempty"` + Hubs *[]Hub `json:"hubs,omitempty"` + IsGlobal *IsGlobal `json:"isGlobal,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_hub.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_hub.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_hub.go rename to resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_hub.go diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go new file mode 100644 index 00000000000..a52d39a784c --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go @@ -0,0 +1,9 @@ +package networkmanageractiveconnectivityconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkGroupProperties struct { + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/version.go b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/version.go new file mode 100644 index 00000000000..bbda20b396a --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanageractiveconnectivityconfigurations/version.go @@ -0,0 +1,12 @@ +package networkmanageractiveconnectivityconfigurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconnectivityconfigurations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkmanagerconnections/README.md b/resource-manager/network/2022-07-01/networkmanagerconnections/README.md new file mode 100644 index 00000000000..d4ae19e926c --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagerconnections/README.md @@ -0,0 +1,161 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagerconnections` Documentation + +The `networkmanagerconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkmanagerconnections" +``` + + +### Client Initialization + +```go +client := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") + +payload := networkmanagerconnections.NetworkManagerConnection{ + // ... +} + + +read, err := client.ManagementGroupNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsDelete` + +```go +ctx := context.TODO() +id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") + +read, err := client.ManagementGroupNetworkManagerConnectionsDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsGet` + +```go +ctx := context.TODO() +id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") + +read, err := client.ManagementGroupNetworkManagerConnectionsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsList` + +```go +ctx := context.TODO() +id := commonids.NewManagementGroupID("groupIdValue") + +// alternatively `client.ManagementGroupNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination +items, err := client.ManagementGroupNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") + +payload := networkmanagerconnections.NetworkManagerConnection{ + // ... +} + + +read, err := client.SubscriptionNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsDelete` + +```go +ctx := context.TODO() +id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") + +read, err := client.SubscriptionNetworkManagerConnectionsDelete(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsGet` + +```go +ctx := context.TODO() +id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") + +read, err := client.SubscriptionNetworkManagerConnectionsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.SubscriptionNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination +items, err := client.SubscriptionNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/client.go b/resource-manager/network/2022-07-01/networkmanagerconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/client.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/client.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/constants.go b/resource-manager/network/2022-07-01/networkmanagerconnections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/constants.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/constants.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/id_networkmanagerconnection.go b/resource-manager/network/2022-07-01/networkmanagerconnections/id_networkmanagerconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/id_networkmanagerconnection.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/id_networkmanagerconnection.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/id_networkmanagerconnection_test.go b/resource-manager/network/2022-07-01/networkmanagerconnections/id_networkmanagerconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/id_networkmanagerconnection_test.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/id_networkmanagerconnection_test.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/id_providers2networkmanagerconnection.go b/resource-manager/network/2022-07-01/networkmanagerconnections/id_providers2networkmanagerconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/id_providers2networkmanagerconnection.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/id_providers2networkmanagerconnection.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go b/resource-manager/network/2022-07-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go b/resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/model_networkmanagerconnection.go b/resource-manager/network/2022-07-01/networkmanagerconnections/model_networkmanagerconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/model_networkmanagerconnection.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/model_networkmanagerconnection.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go b/resource-manager/network/2022-07-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/predicates.go b/resource-manager/network/2022-07-01/networkmanagerconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagerconnections/predicates.go rename to resource-manager/network/2022-07-01/networkmanagerconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/networkmanagerconnections/version.go b/resource-manager/network/2022-07-01/networkmanagerconnections/version.go new file mode 100644 index 00000000000..573164dd008 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagerconnections/version.go @@ -0,0 +1,12 @@ +package networkmanagerconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagerconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/README.md b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/README.md new file mode 100644 index 00000000000..e244519b2e4 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/README.md @@ -0,0 +1,42 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration` Documentation + +The `networkmanagereffectiveconnectivityconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration" +``` + + +### Client Initialization + +```go +client := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkManagerEffectiveConnectivityConfigurationClient.ListNetworkManagerEffectiveConnectivityConfigurations` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := networkmanagereffectiveconnectivityconfiguration.QueryRequestOptions{ + // ... +} + + +read, err := client.ListNetworkManagerEffectiveConnectivityConfigurations(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/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/client.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/client.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/client.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/constants.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/constants.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go new file mode 100644 index 00000000000..b765b64e708 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go @@ -0,0 +1,14 @@ +package networkmanagereffectiveconnectivityconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ConnectivityConfigurationProperties struct { + AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` + ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` + DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` + Description *string `json:"description,omitempty"` + Hubs *[]Hub `json:"hubs,omitempty"` + IsGlobal *IsGlobal `json:"isGlobal,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go new file mode 100644 index 00000000000..5b7bec9e8e6 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go @@ -0,0 +1,9 @@ +package networkmanagereffectiveconnectivityconfiguration + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkGroupProperties struct { + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go rename to resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/version.go b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/version.go new file mode 100644 index 00000000000..738b87db371 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectiveconnectivityconfiguration/version.go @@ -0,0 +1,12 @@ +package networkmanagereffectiveconnectivityconfiguration + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectiveconnectivityconfiguration/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/README.md b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/README.md new file mode 100644 index 00000000000..dddea001036 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/README.md @@ -0,0 +1,42 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules` Documentation + +The `networkmanagereffectivesecurityadminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkmanagereffectivesecurityadminrules" +``` + + +### Client Initialization + +```go +client := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkManagerEffectiveSecurityAdminRulesClient.ListNetworkManagerEffectiveSecurityAdminRules` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := networkmanagereffectivesecurityadminrules.QueryRequestOptions{ + // ... +} + + +read, err := client.ListNetworkManagerEffectiveSecurityAdminRules(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/network/2023-04-01/networkmanagereffectivesecurityadminrules/client.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/client.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/client.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/constants.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/constants.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go new file mode 100644 index 00000000000..b76a52edb2e --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go @@ -0,0 +1,17 @@ +package networkmanagereffectivesecurityadminrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type AdminPropertiesFormat struct { + Access SecurityConfigurationRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + Direction SecurityConfigurationRuleDirection `json:"direction"` + Priority int64 `json:"priority"` + Protocol SecurityConfigurationRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + Sources *[]AddressPrefixItem `json:"sources,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go new file mode 100644 index 00000000000..190203916a6 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go @@ -0,0 +1,18 @@ +package networkmanagereffectivesecurityadminrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DefaultAdminPropertiesFormat struct { + Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` + Description *string `json:"description,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` + Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` + Flag *string `json:"flag,omitempty"` + Priority *int64 `json:"priority,omitempty"` + Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` + Sources *[]AddressPrefixItem `json:"sources,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go new file mode 100644 index 00000000000..0f51af45445 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go @@ -0,0 +1,9 @@ +package networkmanagereffectivesecurityadminrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkGroupProperties struct { + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go rename to resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go diff --git a/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/version.go b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/version.go new file mode 100644 index 00000000000..ff20a5815e6 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagereffectivesecurityadminrules/version.go @@ -0,0 +1,12 @@ +package networkmanagereffectivesecurityadminrules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectivesecurityadminrules/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkmanagers/README.md b/resource-manager/network/2022-07-01/networkmanagers/README.md new file mode 100644 index 00000000000..dc124a380b8 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagers/README.md @@ -0,0 +1,163 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkmanagers` Documentation + +The `networkmanagers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkmanagers" +``` + + +### Client Initialization + +```go +client := networkmanagers.NewNetworkManagersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkManagersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +payload := networkmanagers.NetworkManager{ + // ... +} + + +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: `NetworkManagersClient.Delete` + +```go +ctx := context.TODO() +id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +if err := client.DeleteThenPoll(ctx, id, networkmanagers.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkManagersClient.Get` + +```go +ctx := context.TODO() +id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +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: `NetworkManagersClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.List(ctx, id, networkmanagers.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, networkmanagers.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkManagersClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkManagersClient.NetworkManagerCommitsPost` + +```go +ctx := context.TODO() +id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +payload := networkmanagers.NetworkManagerCommit{ + // ... +} + + +if err := client.NetworkManagerCommitsPostThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkManagersClient.NetworkManagerDeploymentStatusList` + +```go +ctx := context.TODO() +id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +payload := networkmanagers.NetworkManagerDeploymentStatusParameter{ + // ... +} + + +read, err := client.NetworkManagerDeploymentStatusList(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkManagersClient.Patch` + +```go +ctx := context.TODO() +id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +payload := networkmanagers.PatchObject{ + // ... +} + + +read, err := client.Patch(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/network/2023-04-01/networkmanagers/client.go b/resource-manager/network/2022-07-01/networkmanagers/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/client.go rename to resource-manager/network/2022-07-01/networkmanagers/client.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/constants.go b/resource-manager/network/2022-07-01/networkmanagers/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/constants.go rename to resource-manager/network/2022-07-01/networkmanagers/constants.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/id_networkmanager.go b/resource-manager/network/2022-07-01/networkmanagers/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/id_networkmanager.go rename to resource-manager/network/2022-07-01/networkmanagers/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/id_networkmanager_test.go b/resource-manager/network/2022-07-01/networkmanagers/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/networkmanagers/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_createorupdate.go b/resource-manager/network/2022-07-01/networkmanagers/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_createorupdate.go rename to resource-manager/network/2022-07-01/networkmanagers/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_delete.go b/resource-manager/network/2022-07-01/networkmanagers/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_delete.go rename to resource-manager/network/2022-07-01/networkmanagers/method_delete.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_get.go b/resource-manager/network/2022-07-01/networkmanagers/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_get.go rename to resource-manager/network/2022-07-01/networkmanagers/method_get.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_list.go b/resource-manager/network/2022-07-01/networkmanagers/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_list.go rename to resource-manager/network/2022-07-01/networkmanagers/method_list.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_listbysubscription.go b/resource-manager/network/2022-07-01/networkmanagers/method_listbysubscription.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_listbysubscription.go rename to resource-manager/network/2022-07-01/networkmanagers/method_listbysubscription.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_networkmanagercommitspost.go b/resource-manager/network/2022-07-01/networkmanagers/method_networkmanagercommitspost.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_networkmanagercommitspost.go rename to resource-manager/network/2022-07-01/networkmanagers/method_networkmanagercommitspost.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go b/resource-manager/network/2022-07-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go rename to resource-manager/network/2022-07-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/method_patch.go b/resource-manager/network/2022-07-01/networkmanagers/method_patch.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/method_patch.go rename to resource-manager/network/2022-07-01/networkmanagers/method_patch.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_crosstenantscopes.go b/resource-manager/network/2022-07-01/networkmanagers/model_crosstenantscopes.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_crosstenantscopes.go rename to resource-manager/network/2022-07-01/networkmanagers/model_crosstenantscopes.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanager.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_networkmanager.go rename to resource-manager/network/2022-07-01/networkmanagers/model_networkmanager.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagercommit.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagercommit.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_networkmanagercommit.go rename to resource-manager/network/2022-07-01/networkmanagers/model_networkmanagercommit.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerdeploymentstatus.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerdeploymentstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerdeploymentstatus.go rename to resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerdeploymentstatus.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go rename to resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go rename to resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go diff --git a/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerproperties.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerproperties.go new file mode 100644 index 00000000000..08fbfdbe8aa --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerproperties.go @@ -0,0 +1,11 @@ +package networkmanagers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkManagerProperties struct { + Description *string `json:"description,omitempty"` + NetworkManagerScopeAccesses []ConfigurationType `json:"networkManagerScopeAccesses"` + NetworkManagerScopes NetworkManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go b/resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go rename to resource-manager/network/2022-07-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/model_patchobject.go b/resource-manager/network/2022-07-01/networkmanagers/model_patchobject.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/model_patchobject.go rename to resource-manager/network/2022-07-01/networkmanagers/model_patchobject.go diff --git a/resource-manager/network/2023-04-01/networkmanagers/predicates.go b/resource-manager/network/2022-07-01/networkmanagers/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networkmanagers/predicates.go rename to resource-manager/network/2022-07-01/networkmanagers/predicates.go diff --git a/resource-manager/network/2022-07-01/networkmanagers/version.go b/resource-manager/network/2022-07-01/networkmanagers/version.go new file mode 100644 index 00000000000..3cbf73e17c9 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkmanagers/version.go @@ -0,0 +1,12 @@ +package networkmanagers + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagers/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkprofiles/README.md b/resource-manager/network/2022-07-01/networkprofiles/README.md new file mode 100644 index 00000000000..bc15cd06756 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/README.md @@ -0,0 +1,125 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkprofiles` Documentation + +The `networkprofiles` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkprofiles" +``` + + +### Client Initialization + +```go +client := networkprofiles.NewNetworkProfilesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkProfilesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") + +payload := networkprofiles.NetworkProfile{ + // ... +} + + +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: `NetworkProfilesClient.Delete` + +```go +ctx := context.TODO() +id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkProfilesClient.Get` + +```go +ctx := context.TODO() +id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") + +read, err := client.Get(ctx, id, networkprofiles.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkProfilesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `NetworkProfilesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkProfilesClient.UpdateTags` + +```go +ctx := context.TODO() +id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") + +payload := networkprofiles.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/network/2023-04-01/networkprofiles/client.go b/resource-manager/network/2022-07-01/networkprofiles/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/client.go rename to resource-manager/network/2022-07-01/networkprofiles/client.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/constants.go b/resource-manager/network/2022-07-01/networkprofiles/constants.go new file mode 100644 index 00000000000..bed0530f6ae --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/constants.go @@ -0,0 +1,1013 @@ +package networkprofiles + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/id_networkprofile.go b/resource-manager/network/2022-07-01/networkprofiles/id_networkprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/id_networkprofile.go rename to resource-manager/network/2022-07-01/networkprofiles/id_networkprofile.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/id_networkprofile_test.go b/resource-manager/network/2022-07-01/networkprofiles/id_networkprofile_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/id_networkprofile_test.go rename to resource-manager/network/2022-07-01/networkprofiles/id_networkprofile_test.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/method_createorupdate.go b/resource-manager/network/2022-07-01/networkprofiles/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/method_createorupdate.go rename to resource-manager/network/2022-07-01/networkprofiles/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/method_delete.go b/resource-manager/network/2022-07-01/networkprofiles/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/method_delete.go rename to resource-manager/network/2022-07-01/networkprofiles/method_delete.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/method_get.go b/resource-manager/network/2022-07-01/networkprofiles/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/method_get.go rename to resource-manager/network/2022-07-01/networkprofiles/method_get.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/method_list.go b/resource-manager/network/2022-07-01/networkprofiles/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/method_list.go rename to resource-manager/network/2022-07-01/networkprofiles/method_list.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/method_listall.go b/resource-manager/network/2022-07-01/networkprofiles/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/method_listall.go rename to resource-manager/network/2022-07-01/networkprofiles/method_listall.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/method_updatetags.go b/resource-manager/network/2022-07-01/networkprofiles/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/method_updatetags.go rename to resource-manager/network/2022-07-01/networkprofiles/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_backendaddresspool.go b/resource-manager/network/2022-07-01/networkprofiles/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/networkprofiles/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..9d09d64790b --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package networkprofiles + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterface.go b/resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterface.go rename to resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterface.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_ddossettings.go b/resource-manager/network/2022-07-01/networkprofiles/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_ddossettings.go rename to resource-manager/network/2022-07-01/networkprofiles/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_delegation.go b/resource-manager/network/2022-07-01/networkprofiles/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_delegation.go rename to resource-manager/network/2022-07-01/networkprofiles/model_delegation.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_flowlog.go b/resource-manager/network/2022-07-01/networkprofiles/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_flowlog.go rename to resource-manager/network/2022-07-01/networkprofiles/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/networkprofiles/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/networkprofiles/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_inboundnatrule.go b/resource-manager/network/2022-07-01/networkprofiles/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/networkprofiles/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_ipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/networkprofiles/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/networkprofiles/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_iptag.go b/resource-manager/network/2022-07-01/networkprofiles/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_iptag.go rename to resource-manager/network/2022-07-01/networkprofiles/model_iptag.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/networkprofiles/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/networkprofiles/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_natgateway.go b/resource-manager/network/2022-07-01/networkprofiles/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_natgateway.go rename to resource-manager/network/2022-07-01/networkprofiles/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_natgatewaysku.go b/resource-manager/network/2022-07-01/networkprofiles/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/networkprofiles/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_natruleportmapping.go b/resource-manager/network/2022-07-01/networkprofiles/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/networkprofiles/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterface.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterface.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..1ea75a21d1e --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package networkprofiles + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkprofile.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkprofile.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkprofile.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkprofilepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_networkprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networkprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networkprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/networkprofiles/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpoint.go b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privateendpoint.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..80bdd4f7f51 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package networkprofiles + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkservice.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_publicipaddress.go b/resource-manager/network/2022-07-01/networkprofiles/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_publicipaddress.go rename to resource-manager/network/2022-07-01/networkprofiles/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/networkprofiles/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..0aabf1df8a7 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package networkprofiles + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/networkprofiles/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/networkprofiles/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/networkprofiles/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/networkprofiles/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_resourceset.go b/resource-manager/network/2022-07-01/networkprofiles/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_resourceset.go rename to resource-manager/network/2022-07-01/networkprofiles/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/networkprofiles/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/networkprofiles/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_route.go b/resource-manager/network/2022-07-01/networkprofiles/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_route.go rename to resource-manager/network/2022-07-01/networkprofiles/model_route.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_routetable.go b/resource-manager/network/2022-07-01/networkprofiles/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_routetable.go rename to resource-manager/network/2022-07-01/networkprofiles/model_routetable.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_securityrule.go b/resource-manager/network/2022-07-01/networkprofiles/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_securityrule.go rename to resource-manager/network/2022-07-01/networkprofiles/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..aafc6796307 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package networkprofiles + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_subnet.go b/resource-manager/network/2022-07-01/networkprofiles/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_subnet.go rename to resource-manager/network/2022-07-01/networkprofiles/model_subnet.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..b53a3d14ed8 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package networkprofiles + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_subresource.go b/resource-manager/network/2022-07-01/networkprofiles/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_subresource.go rename to resource-manager/network/2022-07-01/networkprofiles/model_subresource.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_tagsobject.go b/resource-manager/network/2022-07-01/networkprofiles/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_tagsobject.go rename to resource-manager/network/2022-07-01/networkprofiles/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/networkprofiles/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/networkprofiles/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/networkprofiles/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/networkprofiles/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/networkprofiles/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/networkprofiles/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkprofiles/predicates.go b/resource-manager/network/2022-07-01/networkprofiles/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networkprofiles/predicates.go rename to resource-manager/network/2022-07-01/networkprofiles/predicates.go diff --git a/resource-manager/network/2022-07-01/networkprofiles/version.go b/resource-manager/network/2022-07-01/networkprofiles/version.go new file mode 100644 index 00000000000..d82658f335b --- /dev/null +++ b/resource-manager/network/2022-07-01/networkprofiles/version.go @@ -0,0 +1,12 @@ +package networkprofiles + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkprofiles/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/README.md b/resource-manager/network/2022-07-01/networksecuritygroups/README.md new file mode 100644 index 00000000000..3b823de7c41 --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networksecuritygroups` Documentation + +The `networksecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networksecuritygroups" +``` + + +### Client Initialization + +```go +client := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkSecurityGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") + +payload := networksecuritygroups.NetworkSecurityGroup{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkSecurityGroupsClient.Delete` + +```go +ctx := context.TODO() +id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkSecurityGroupsClient.Get` + +```go +ctx := context.TODO() +id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") + +read, err := client.Get(ctx, id, networksecuritygroups.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkSecurityGroupsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `NetworkSecurityGroupsClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `NetworkSecurityGroupsClient.UpdateTags` + +```go +ctx := context.TODO() +id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") + +payload := networksecuritygroups.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/network/2023-04-01/networksecuritygroups/client.go b/resource-manager/network/2022-07-01/networksecuritygroups/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/client.go rename to resource-manager/network/2022-07-01/networksecuritygroups/client.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/constants.go b/resource-manager/network/2022-07-01/networksecuritygroups/constants.go new file mode 100644 index 00000000000..420a7fb5fc6 --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/constants.go @@ -0,0 +1,1013 @@ +package networksecuritygroups + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/id_networksecuritygroup.go b/resource-manager/network/2022-07-01/networksecuritygroups/id_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/id_networksecuritygroup.go rename to resource-manager/network/2022-07-01/networksecuritygroups/id_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/id_networksecuritygroup_test.go b/resource-manager/network/2022-07-01/networksecuritygroups/id_networksecuritygroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/id_networksecuritygroup_test.go rename to resource-manager/network/2022-07-01/networksecuritygroups/id_networksecuritygroup_test.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/method_createorupdate.go b/resource-manager/network/2022-07-01/networksecuritygroups/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/method_createorupdate.go rename to resource-manager/network/2022-07-01/networksecuritygroups/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/method_delete.go b/resource-manager/network/2022-07-01/networksecuritygroups/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/method_delete.go rename to resource-manager/network/2022-07-01/networksecuritygroups/method_delete.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/method_get.go b/resource-manager/network/2022-07-01/networksecuritygroups/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/method_get.go rename to resource-manager/network/2022-07-01/networksecuritygroups/method_get.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/method_list.go b/resource-manager/network/2022-07-01/networksecuritygroups/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/method_list.go rename to resource-manager/network/2022-07-01/networksecuritygroups/method_list.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/method_listall.go b/resource-manager/network/2022-07-01/networksecuritygroups/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/method_listall.go rename to resource-manager/network/2022-07-01/networksecuritygroups/method_listall.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/method_updatetags.go b/resource-manager/network/2022-07-01/networksecuritygroups/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/method_updatetags.go rename to resource-manager/network/2022-07-01/networksecuritygroups/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_backendaddresspool.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..31e2ba392e4 --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package networksecuritygroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_ddossettings.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_ddossettings.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_delegation.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_delegation.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_delegation.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_flowlog.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_flowlog.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_inboundnatrule.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_iptag.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_iptag.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_iptag.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_natgateway.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_natgateway.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_natgatewaysku.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_natruleportmapping.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterface.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterface.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..e351f4494cc --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package networksecuritygroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpoint.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpoint.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..fd29dace286 --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package networksecuritygroups + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkservice.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddress.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddress.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..9f75eb76e1f --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package networksecuritygroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_resourceset.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_resourceset.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_route.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_route.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_route.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_routetable.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_routetable.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_routetable.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_securityrule.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_securityrule.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..dce4435347d --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package networksecuritygroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_subnet.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_subnet.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_subnet.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..cf92a8574e3 --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package networksecuritygroups + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_subresource.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_subresource.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_subresource.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_tagsobject.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_tagsobject.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/predicates.go b/resource-manager/network/2022-07-01/networksecuritygroups/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networksecuritygroups/predicates.go rename to resource-manager/network/2022-07-01/networksecuritygroups/predicates.go diff --git a/resource-manager/network/2022-07-01/networksecuritygroups/version.go b/resource-manager/network/2022-07-01/networksecuritygroups/version.go new file mode 100644 index 00000000000..4c00f1d2196 --- /dev/null +++ b/resource-manager/network/2022-07-01/networksecuritygroups/version.go @@ -0,0 +1,12 @@ +package networksecuritygroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networksecuritygroups/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkvirtualappliances/README.md b/resource-manager/network/2022-07-01/networkvirtualappliances/README.md new file mode 100644 index 00000000000..7cd12dd91b7 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkvirtualappliances/README.md @@ -0,0 +1,138 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkvirtualappliances` Documentation + +The `networkvirtualappliances` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkvirtualappliances" +``` + + +### Client Initialization + +```go +client := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkVirtualAppliancesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") + +payload := networkvirtualappliances.NetworkVirtualAppliance{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkVirtualAppliancesClient.Delete` + +```go +ctx := context.TODO() +id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkVirtualAppliancesClient.Get` + +```go +ctx := context.TODO() +id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") + +read, err := client.Get(ctx, id, networkvirtualappliances.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkVirtualAppliancesClient.InboundSecurityRuleCreateOrUpdate` + +```go +ctx := context.TODO() +id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue") + +payload := networkvirtualappliances.InboundSecurityRule{ + // ... +} + + +if err := client.InboundSecurityRuleCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.UpdateTags` + +```go +ctx := context.TODO() +id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") + +payload := networkvirtualappliances.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/network/2023-04-01/networkvirtualappliances/client.go b/resource-manager/network/2022-07-01/networkvirtualappliances/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/client.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/client.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/constants.go b/resource-manager/network/2022-07-01/networkvirtualappliances/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/constants.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/constants.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2022-07-01/networkvirtualappliances/id_inboundsecurityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/id_inboundsecurityrule.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/id_inboundsecurityrule.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2022-07-01/networkvirtualappliances/id_inboundsecurityrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/id_inboundsecurityrule_test.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/id_inboundsecurityrule_test.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/id_networkvirtualappliance.go b/resource-manager/network/2022-07-01/networkvirtualappliances/id_networkvirtualappliance.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/id_networkvirtualappliance.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/id_networkvirtualappliance.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/id_networkvirtualappliance_test.go b/resource-manager/network/2022-07-01/networkvirtualappliances/id_networkvirtualappliance_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/id_networkvirtualappliance_test.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/id_networkvirtualappliance_test.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_createorupdate.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_createorupdate.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_delete.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_delete.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_delete.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_get.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_get.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_get.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_list.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_list.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_list.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/method_updatetags.go b/resource-manager/network/2022-07-01/networkvirtualappliances/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/method_updatetags.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_delegationproperties.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_delegationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_delegationproperties.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_delegationproperties.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_inboundsecurityrule.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_inboundsecurityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_inboundsecurityrule.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_inboundsecurityrule.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_inboundsecurityruleproperties.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_inboundsecurityruleproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_inboundsecurityruleproperties.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_inboundsecurityruleproperties.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_inboundsecurityrules.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_inboundsecurityrules.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_inboundsecurityrules.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_inboundsecurityrules.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_networkvirtualappliance.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_networkvirtualappliance.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_networkvirtualappliance.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_networkvirtualappliance.go diff --git a/resource-manager/network/2022-07-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go new file mode 100644 index 00000000000..bbc1a4b7361 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go @@ -0,0 +1,22 @@ +package networkvirtualappliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkVirtualAppliancePropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + BootStrapConfigurationBlobs *[]string `json:"bootStrapConfigurationBlobs,omitempty"` + CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` + CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` + Delegation *DelegationProperties `json:"delegation,omitempty"` + DeploymentType *string `json:"deploymentType,omitempty"` + InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` + NvaSku *VirtualApplianceSkuProperties `json:"nvaSku,omitempty"` + PartnerManagedResource *PartnerManagedResourceProperties `json:"partnerManagedResource,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SshPublicKey *string `json:"sshPublicKey,omitempty"` + VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` + VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` + VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` + VirtualHub *SubResource `json:"virtualHub,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_partnermanagedresourceproperties.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_partnermanagedresourceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_partnermanagedresourceproperties.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_partnermanagedresourceproperties.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_subresource.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_subresource.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_subresource.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_tagsobject.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_tagsobject.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_tagsobject.go diff --git a/resource-manager/network/2022-07-01/networkvirtualappliances/model_virtualappliancenicproperties.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_virtualappliancenicproperties.go new file mode 100644 index 00000000000..ebb4129b0ee --- /dev/null +++ b/resource-manager/network/2022-07-01/networkvirtualappliances/model_virtualappliancenicproperties.go @@ -0,0 +1,10 @@ +package networkvirtualappliances + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualApplianceNicProperties struct { + Name *string `json:"name,omitempty"` + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + PublicIPAddress *string `json:"publicIpAddress,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualapplianceskuproperties.go b/resource-manager/network/2022-07-01/networkvirtualappliances/model_virtualapplianceskuproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualapplianceskuproperties.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/model_virtualapplianceskuproperties.go diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/predicates.go b/resource-manager/network/2022-07-01/networkvirtualappliances/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/networkvirtualappliances/predicates.go rename to resource-manager/network/2022-07-01/networkvirtualappliances/predicates.go diff --git a/resource-manager/network/2022-07-01/networkvirtualappliances/version.go b/resource-manager/network/2022-07-01/networkvirtualappliances/version.go new file mode 100644 index 00000000000..97667631098 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkvirtualappliances/version.go @@ -0,0 +1,12 @@ +package networkvirtualappliances + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkvirtualappliances/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/networkwatchers/README.md b/resource-manager/network/2022-07-01/networkwatchers/README.md new file mode 100644 index 00000000000..fca20f366df --- /dev/null +++ b/resource-manager/network/2022-07-01/networkwatchers/README.md @@ -0,0 +1,331 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/networkwatchers` Documentation + +The `networkwatchers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/networkwatchers" +``` + + +### Client Initialization + +```go +client := networkwatchers.NewNetworkWatchersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `NetworkWatchersClient.CheckConnectivity` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.ConnectivityParameters{ + // ... +} + + +if err := client.CheckConnectivityThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.NetworkWatcher{ + // ... +} + + +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: `NetworkWatchersClient.Delete` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.Get` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +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: `NetworkWatchersClient.GetAzureReachabilityReport` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.AzureReachabilityReportParameters{ + // ... +} + + +if err := client.GetAzureReachabilityReportThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.GetFlowLogStatus` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.FlowLogStatusParameters{ + // ... +} + + +if err := client.GetFlowLogStatusThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.GetNetworkConfigurationDiagnostic` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.NetworkConfigurationDiagnosticParameters{ + // ... +} + + +if err := client.GetNetworkConfigurationDiagnosticThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.GetNextHop` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.NextHopParameters{ + // ... +} + + +if err := client.GetNextHopThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.GetTopology` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.TopologyParameters{ + // ... +} + + +read, err := client.GetTopology(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkWatchersClient.GetTroubleshooting` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.TroubleshootingParameters{ + // ... +} + + +if err := client.GetTroubleshootingThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.GetTroubleshootingResult` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.QueryTroubleshootingParameters{ + // ... +} + + +if err := client.GetTroubleshootingResultThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.GetVMSecurityRules` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.SecurityGroupViewParameters{ + // ... +} + + +if err := client.GetVMSecurityRulesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +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: `NetworkWatchersClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +read, err := client.ListAll(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `NetworkWatchersClient.ListAvailableProviders` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.AvailableProvidersListParameters{ + // ... +} + + +if err := client.ListAvailableProvidersThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.SetFlowLogConfiguration` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.FlowLogInformation{ + // ... +} + + +if err := client.SetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `NetworkWatchersClient.UpdateTags` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.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 +} +``` + + +### Example Usage: `NetworkWatchersClient.VerifyIPFlow` + +```go +ctx := context.TODO() +id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := networkwatchers.VerificationIPFlowParameters{ + // ... +} + + +if err := client.VerifyIPFlowThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/networkwatchers/client.go b/resource-manager/network/2022-07-01/networkwatchers/client.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/client.go rename to resource-manager/network/2022-07-01/networkwatchers/client.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/constants.go b/resource-manager/network/2022-07-01/networkwatchers/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/constants.go rename to resource-manager/network/2022-07-01/networkwatchers/constants.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/id_networkwatcher.go b/resource-manager/network/2022-07-01/networkwatchers/id_networkwatcher.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/id_networkwatcher.go rename to resource-manager/network/2022-07-01/networkwatchers/id_networkwatcher.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/id_networkwatcher_test.go b/resource-manager/network/2022-07-01/networkwatchers/id_networkwatcher_test.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/id_networkwatcher_test.go rename to resource-manager/network/2022-07-01/networkwatchers/id_networkwatcher_test.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_checkconnectivity.go b/resource-manager/network/2022-07-01/networkwatchers/method_checkconnectivity.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_checkconnectivity.go rename to resource-manager/network/2022-07-01/networkwatchers/method_checkconnectivity.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_createorupdate.go b/resource-manager/network/2022-07-01/networkwatchers/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_createorupdate.go rename to resource-manager/network/2022-07-01/networkwatchers/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_delete.go b/resource-manager/network/2022-07-01/networkwatchers/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_delete.go rename to resource-manager/network/2022-07-01/networkwatchers/method_delete.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_get.go b/resource-manager/network/2022-07-01/networkwatchers/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_get.go rename to resource-manager/network/2022-07-01/networkwatchers/method_get.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_getazurereachabilityreport.go b/resource-manager/network/2022-07-01/networkwatchers/method_getazurereachabilityreport.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_getazurereachabilityreport.go rename to resource-manager/network/2022-07-01/networkwatchers/method_getazurereachabilityreport.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_getflowlogstatus.go b/resource-manager/network/2022-07-01/networkwatchers/method_getflowlogstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_getflowlogstatus.go rename to resource-manager/network/2022-07-01/networkwatchers/method_getflowlogstatus.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go b/resource-manager/network/2022-07-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go rename to resource-manager/network/2022-07-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_getnexthop.go b/resource-manager/network/2022-07-01/networkwatchers/method_getnexthop.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_getnexthop.go rename to resource-manager/network/2022-07-01/networkwatchers/method_getnexthop.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_gettopology.go b/resource-manager/network/2022-07-01/networkwatchers/method_gettopology.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_gettopology.go rename to resource-manager/network/2022-07-01/networkwatchers/method_gettopology.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_gettroubleshooting.go b/resource-manager/network/2022-07-01/networkwatchers/method_gettroubleshooting.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_gettroubleshooting.go rename to resource-manager/network/2022-07-01/networkwatchers/method_gettroubleshooting.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_gettroubleshootingresult.go b/resource-manager/network/2022-07-01/networkwatchers/method_gettroubleshootingresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_gettroubleshootingresult.go rename to resource-manager/network/2022-07-01/networkwatchers/method_gettroubleshootingresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_getvmsecurityrules.go b/resource-manager/network/2022-07-01/networkwatchers/method_getvmsecurityrules.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_getvmsecurityrules.go rename to resource-manager/network/2022-07-01/networkwatchers/method_getvmsecurityrules.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_list.go b/resource-manager/network/2022-07-01/networkwatchers/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_list.go rename to resource-manager/network/2022-07-01/networkwatchers/method_list.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_listall.go b/resource-manager/network/2022-07-01/networkwatchers/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_listall.go rename to resource-manager/network/2022-07-01/networkwatchers/method_listall.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_listavailableproviders.go b/resource-manager/network/2022-07-01/networkwatchers/method_listavailableproviders.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_listavailableproviders.go rename to resource-manager/network/2022-07-01/networkwatchers/method_listavailableproviders.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_setflowlogconfiguration.go b/resource-manager/network/2022-07-01/networkwatchers/method_setflowlogconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_setflowlogconfiguration.go rename to resource-manager/network/2022-07-01/networkwatchers/method_setflowlogconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_updatetags.go b/resource-manager/network/2022-07-01/networkwatchers/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_updatetags.go rename to resource-manager/network/2022-07-01/networkwatchers/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/method_verifyipflow.go b/resource-manager/network/2022-07-01/networkwatchers/method_verifyipflow.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/method_verifyipflow.go rename to resource-manager/network/2022-07-01/networkwatchers/method_verifyipflow.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/networkwatchers/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/networkwatchers/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslist.go b/resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslist.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslist.go rename to resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslist.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslistcity.go b/resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslistcity.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslistcity.go rename to resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslistcity.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslistcountry.go b/resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslistcountry.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslistcountry.go rename to resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslistcountry.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslistparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslistparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_availableproviderslistparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_availableproviderslistparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_availableprovidersliststate.go b/resource-manager/network/2022-07-01/networkwatchers/model_availableprovidersliststate.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_availableprovidersliststate.go rename to resource-manager/network/2022-07-01/networkwatchers/model_availableprovidersliststate.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreport.go b/resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreport.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreport.go rename to resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreport.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportitem.go b/resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportitem.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportitem.go rename to resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportitem.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go b/resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go rename to resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportlocation.go b/resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportlocation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportlocation.go rename to resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportlocation.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_azurereachabilityreportparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_azurereachabilityreportparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_connectivitydestination.go b/resource-manager/network/2022-07-01/networkwatchers/model_connectivitydestination.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_connectivitydestination.go rename to resource-manager/network/2022-07-01/networkwatchers/model_connectivitydestination.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_connectivityhop.go b/resource-manager/network/2022-07-01/networkwatchers/model_connectivityhop.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_connectivityhop.go rename to resource-manager/network/2022-07-01/networkwatchers/model_connectivityhop.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_connectivityinformation.go b/resource-manager/network/2022-07-01/networkwatchers/model_connectivityinformation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_connectivityinformation.go rename to resource-manager/network/2022-07-01/networkwatchers/model_connectivityinformation.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_connectivityissue.go b/resource-manager/network/2022-07-01/networkwatchers/model_connectivityissue.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_connectivityissue.go rename to resource-manager/network/2022-07-01/networkwatchers/model_connectivityissue.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_connectivityparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_connectivityparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_connectivityparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_connectivityparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_connectivitysource.go b/resource-manager/network/2022-07-01/networkwatchers/model_connectivitysource.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_connectivitysource.go rename to resource-manager/network/2022-07-01/networkwatchers/model_connectivitysource.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_effectivenetworksecurityrule.go b/resource-manager/network/2022-07-01/networkwatchers/model_effectivenetworksecurityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_effectivenetworksecurityrule.go rename to resource-manager/network/2022-07-01/networkwatchers/model_effectivenetworksecurityrule.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_evaluatednetworksecuritygroup.go b/resource-manager/network/2022-07-01/networkwatchers/model_evaluatednetworksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_evaluatednetworksecuritygroup.go rename to resource-manager/network/2022-07-01/networkwatchers/model_evaluatednetworksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_flowloginformation.go b/resource-manager/network/2022-07-01/networkwatchers/model_flowloginformation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_flowloginformation.go rename to resource-manager/network/2022-07-01/networkwatchers/model_flowloginformation.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_flowlogproperties.go b/resource-manager/network/2022-07-01/networkwatchers/model_flowlogproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_flowlogproperties.go rename to resource-manager/network/2022-07-01/networkwatchers/model_flowlogproperties.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_flowlogstatusparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_flowlogstatusparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_flowlogstatusparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_flowlogstatusparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_hoplink.go b/resource-manager/network/2022-07-01/networkwatchers/model_hoplink.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_hoplink.go rename to resource-manager/network/2022-07-01/networkwatchers/model_hoplink.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_hoplinkproperties.go b/resource-manager/network/2022-07-01/networkwatchers/model_hoplinkproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_hoplinkproperties.go rename to resource-manager/network/2022-07-01/networkwatchers/model_hoplinkproperties.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_httpconfiguration.go b/resource-manager/network/2022-07-01/networkwatchers/model_httpconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_httpconfiguration.go rename to resource-manager/network/2022-07-01/networkwatchers/model_httpconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_httpheader.go b/resource-manager/network/2022-07-01/networkwatchers/model_httpheader.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_httpheader.go rename to resource-manager/network/2022-07-01/networkwatchers/model_httpheader.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_matchedrule.go b/resource-manager/network/2022-07-01/networkwatchers/model_matchedrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_matchedrule.go rename to resource-manager/network/2022-07-01/networkwatchers/model_matchedrule.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkconfigurationdiagnosticresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkconfigurationdiagnosticresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkinterfaceassociation.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkinterfaceassociation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkinterfaceassociation.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkinterfaceassociation.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networksecuritygroupresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_networksecuritygroupresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networksecuritygroupresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networksecuritygroupresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networksecurityrulesevaluationresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_networksecurityrulesevaluationresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networksecurityrulesevaluationresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networksecurityrulesevaluationresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkwatcher.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkwatcher.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkwatcher.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkwatcher.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkwatcherlistresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkwatcherlistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkwatcherlistresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkwatcherlistresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_networkwatcherpropertiesformat.go b/resource-manager/network/2022-07-01/networkwatchers/model_networkwatcherpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_networkwatcherpropertiesformat.go rename to resource-manager/network/2022-07-01/networkwatchers/model_networkwatcherpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_nexthopparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_nexthopparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_nexthopparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_nexthopparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_nexthopresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_nexthopresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_nexthopresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_nexthopresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_protocolconfiguration.go b/resource-manager/network/2022-07-01/networkwatchers/model_protocolconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_protocolconfiguration.go rename to resource-manager/network/2022-07-01/networkwatchers/model_protocolconfiguration.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_querytroubleshootingparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_querytroubleshootingparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_querytroubleshootingparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_querytroubleshootingparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_securitygroupnetworkinterface.go b/resource-manager/network/2022-07-01/networkwatchers/model_securitygroupnetworkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_securitygroupnetworkinterface.go rename to resource-manager/network/2022-07-01/networkwatchers/model_securitygroupnetworkinterface.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_securitygroupviewparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_securitygroupviewparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_securitygroupviewparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_securitygroupviewparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_securitygroupviewresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_securitygroupviewresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_securitygroupviewresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_securitygroupviewresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_securityrule.go b/resource-manager/network/2022-07-01/networkwatchers/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_securityrule.go rename to resource-manager/network/2022-07-01/networkwatchers/model_securityrule.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_securityruleassociations.go b/resource-manager/network/2022-07-01/networkwatchers/model_securityruleassociations.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_securityruleassociations.go rename to resource-manager/network/2022-07-01/networkwatchers/model_securityruleassociations.go diff --git a/resource-manager/network/2022-07-01/networkwatchers/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/networkwatchers/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..4793dcdb5c3 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkwatchers/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package networkwatchers + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_subnetassociation.go b/resource-manager/network/2022-07-01/networkwatchers/model_subnetassociation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_subnetassociation.go rename to resource-manager/network/2022-07-01/networkwatchers/model_subnetassociation.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_subresource.go b/resource-manager/network/2022-07-01/networkwatchers/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_subresource.go rename to resource-manager/network/2022-07-01/networkwatchers/model_subresource.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_tagsobject.go b/resource-manager/network/2022-07-01/networkwatchers/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_tagsobject.go rename to resource-manager/network/2022-07-01/networkwatchers/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_topology.go b/resource-manager/network/2022-07-01/networkwatchers/model_topology.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_topology.go rename to resource-manager/network/2022-07-01/networkwatchers/model_topology.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_topologyassociation.go b/resource-manager/network/2022-07-01/networkwatchers/model_topologyassociation.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_topologyassociation.go rename to resource-manager/network/2022-07-01/networkwatchers/model_topologyassociation.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_topologyparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_topologyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_topologyparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_topologyparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_topologyresource.go b/resource-manager/network/2022-07-01/networkwatchers/model_topologyresource.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_topologyresource.go rename to resource-manager/network/2022-07-01/networkwatchers/model_topologyresource.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/networkwatchers/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/networkwatchers/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingdetails.go b/resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingdetails.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingdetails.go rename to resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingdetails.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingproperties.go b/resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingproperties.go rename to resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingproperties.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingrecommendedactions.go b/resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingrecommendedactions.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingrecommendedactions.go rename to resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingrecommendedactions.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_troubleshootingresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_troubleshootingresult.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_verificationipflowparameters.go b/resource-manager/network/2022-07-01/networkwatchers/model_verificationipflowparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_verificationipflowparameters.go rename to resource-manager/network/2022-07-01/networkwatchers/model_verificationipflowparameters.go diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_verificationipflowresult.go b/resource-manager/network/2022-07-01/networkwatchers/model_verificationipflowresult.go similarity index 100% rename from resource-manager/network/2023-04-01/networkwatchers/model_verificationipflowresult.go rename to resource-manager/network/2022-07-01/networkwatchers/model_verificationipflowresult.go diff --git a/resource-manager/network/2022-07-01/networkwatchers/version.go b/resource-manager/network/2022-07-01/networkwatchers/version.go new file mode 100644 index 00000000000..ba3be395857 --- /dev/null +++ b/resource-manager/network/2022-07-01/networkwatchers/version.go @@ -0,0 +1,12 @@ +package networkwatchers + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/networkwatchers/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/p2svpngateways/README.md b/resource-manager/network/2022-07-01/p2svpngateways/README.md new file mode 100644 index 00000000000..4c7c57f26f7 --- /dev/null +++ b/resource-manager/network/2022-07-01/p2svpngateways/README.md @@ -0,0 +1,113 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/p2svpngateways` Documentation + +The `p2svpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/p2svpngateways" +``` + + +### Client Initialization + +```go +client := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `P2sVpnGatewaysClient.DisconnectP2sVpnConnections` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +payload := p2svpngateways.P2SVpnConnectionRequest{ + // ... +} + + +if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `P2sVpnGatewaysClient.GenerateVpnProfile` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +payload := p2svpngateways.P2SVpnProfileParameters{ + // ... +} + + +if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealth` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealthDetailed` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +payload := p2svpngateways.P2SVpnConnectionHealthRequest{ + // ... +} + + +if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `P2sVpnGatewaysClient.Reset` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +if err := client.ResetThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `P2sVpnGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +payload := p2svpngateways.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/p2svpngateways/client.go b/resource-manager/network/2022-07-01/p2svpngateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/client.go rename to resource-manager/network/2022-07-01/p2svpngateways/client.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/constants.go b/resource-manager/network/2022-07-01/p2svpngateways/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/constants.go rename to resource-manager/network/2022-07-01/p2svpngateways/constants.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/method_disconnectp2svpnconnections.go b/resource-manager/network/2022-07-01/p2svpngateways/method_disconnectp2svpnconnections.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/method_disconnectp2svpnconnections.go rename to resource-manager/network/2022-07-01/p2svpngateways/method_disconnectp2svpnconnections.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/method_generatevpnprofile.go b/resource-manager/network/2022-07-01/p2svpngateways/method_generatevpnprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/method_generatevpnprofile.go rename to resource-manager/network/2022-07-01/p2svpngateways/method_generatevpnprofile.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/method_getp2svpnconnectionhealth.go b/resource-manager/network/2022-07-01/p2svpngateways/method_getp2svpnconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/method_getp2svpnconnectionhealth.go rename to resource-manager/network/2022-07-01/p2svpngateways/method_getp2svpnconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go b/resource-manager/network/2022-07-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go rename to resource-manager/network/2022-07-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/method_reset.go b/resource-manager/network/2022-07-01/p2svpngateways/method_reset.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/method_reset.go rename to resource-manager/network/2022-07-01/p2svpngateways/method_reset.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/method_updatetags.go b/resource-manager/network/2022-07-01/p2svpngateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/method_updatetags.go rename to resource-manager/network/2022-07-01/p2svpngateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_addressspace.go b/resource-manager/network/2022-07-01/p2svpngateways/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_addressspace.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2sconnectionconfiguration.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2sconnectionconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2sconnectionconfiguration.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2sconnectionconfiguration.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnconnectionhealth.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnconnectionrequest.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnconnectionrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnconnectionrequest.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnconnectionrequest.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2svpngateway.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2svpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2svpngateway.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2svpngateway.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2svpngatewayproperties.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2svpngatewayproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2svpngatewayproperties.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2svpngatewayproperties.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnprofileparameters.go b/resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnprofileparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_p2svpnprofileparameters.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_p2svpnprofileparameters.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_propagatedroutetable.go b/resource-manager/network/2022-07-01/p2svpngateways/model_propagatedroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_propagatedroutetable.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_propagatedroutetable.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_routingconfiguration.go b/resource-manager/network/2022-07-01/p2svpngateways/model_routingconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_routingconfiguration.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_routingconfiguration.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_staticroute.go b/resource-manager/network/2022-07-01/p2svpngateways/model_staticroute.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_staticroute.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_staticroute.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_staticroutesconfig.go b/resource-manager/network/2022-07-01/p2svpngateways/model_staticroutesconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_staticroutesconfig.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_staticroutesconfig.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_subresource.go b/resource-manager/network/2022-07-01/p2svpngateways/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_subresource.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_subresource.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_tagsobject.go b/resource-manager/network/2022-07-01/p2svpngateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_vnetroute.go b/resource-manager/network/2022-07-01/p2svpngateways/model_vnetroute.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_vnetroute.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_vnetroute.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_vpnclientconnectionhealth.go b/resource-manager/network/2022-07-01/p2svpngateways/model_vpnclientconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_vpnclientconnectionhealth.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_vpnclientconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2022-07-01/p2svpngateways/model_vpnprofileresponse.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_vpnprofileresponse.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_vpnprofileresponse.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2022-07-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2022-07-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go diff --git a/resource-manager/network/2023-04-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2022-07-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go rename to resource-manager/network/2022-07-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go diff --git a/resource-manager/network/2022-07-01/p2svpngateways/version.go b/resource-manager/network/2022-07-01/p2svpngateways/version.go new file mode 100644 index 00000000000..3101a24c2d3 --- /dev/null +++ b/resource-manager/network/2022-07-01/p2svpngateways/version.go @@ -0,0 +1,12 @@ +package p2svpngateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/p2svpngateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/packetcaptures/README.md b/resource-manager/network/2022-07-01/packetcaptures/README.md new file mode 100644 index 00000000000..ddbbc379759 --- /dev/null +++ b/resource-manager/network/2022-07-01/packetcaptures/README.md @@ -0,0 +1,105 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/packetcaptures` Documentation + +The `packetcaptures` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/packetcaptures" +``` + + +### Client Initialization + +```go +client := packetcaptures.NewPacketCapturesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PacketCapturesClient.Create` + +```go +ctx := context.TODO() +id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") + +payload := packetcaptures.PacketCapture{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PacketCapturesClient.Delete` + +```go +ctx := context.TODO() +id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PacketCapturesClient.Get` + +```go +ctx := context.TODO() +id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") + +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: `PacketCapturesClient.GetStatus` + +```go +ctx := context.TODO() +id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") + +if err := client.GetStatusThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PacketCapturesClient.List` + +```go +ctx := context.TODO() +id := packetcaptures.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +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: `PacketCapturesClient.Stop` + +```go +ctx := context.TODO() +id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") + +if err := client.StopThenPoll(ctx, id); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/packetcaptures/client.go b/resource-manager/network/2022-07-01/packetcaptures/client.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/client.go rename to resource-manager/network/2022-07-01/packetcaptures/client.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/constants.go b/resource-manager/network/2022-07-01/packetcaptures/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/constants.go rename to resource-manager/network/2022-07-01/packetcaptures/constants.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/id_networkwatcher.go b/resource-manager/network/2022-07-01/packetcaptures/id_networkwatcher.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/id_networkwatcher.go rename to resource-manager/network/2022-07-01/packetcaptures/id_networkwatcher.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/id_networkwatcher_test.go b/resource-manager/network/2022-07-01/packetcaptures/id_networkwatcher_test.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/id_networkwatcher_test.go rename to resource-manager/network/2022-07-01/packetcaptures/id_networkwatcher_test.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/id_packetcapture.go b/resource-manager/network/2022-07-01/packetcaptures/id_packetcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/id_packetcapture.go rename to resource-manager/network/2022-07-01/packetcaptures/id_packetcapture.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/id_packetcapture_test.go b/resource-manager/network/2022-07-01/packetcaptures/id_packetcapture_test.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/id_packetcapture_test.go rename to resource-manager/network/2022-07-01/packetcaptures/id_packetcapture_test.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/method_create.go b/resource-manager/network/2022-07-01/packetcaptures/method_create.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/method_create.go rename to resource-manager/network/2022-07-01/packetcaptures/method_create.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/method_delete.go b/resource-manager/network/2022-07-01/packetcaptures/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/method_delete.go rename to resource-manager/network/2022-07-01/packetcaptures/method_delete.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/method_get.go b/resource-manager/network/2022-07-01/packetcaptures/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/method_get.go rename to resource-manager/network/2022-07-01/packetcaptures/method_get.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/method_getstatus.go b/resource-manager/network/2022-07-01/packetcaptures/method_getstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/method_getstatus.go rename to resource-manager/network/2022-07-01/packetcaptures/method_getstatus.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/method_list.go b/resource-manager/network/2022-07-01/packetcaptures/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/method_list.go rename to resource-manager/network/2022-07-01/packetcaptures/method_list.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/method_stop.go b/resource-manager/network/2022-07-01/packetcaptures/method_stop.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/method_stop.go rename to resource-manager/network/2022-07-01/packetcaptures/method_stop.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcapture.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcapture.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcapture.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcapturefilter.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcapturefilter.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcapturefilter.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcapturefilter.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcapturelistresult.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcapturelistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcapturelistresult.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcapturelistresult.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcapturemachinescope.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcapturemachinescope.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcapturemachinescope.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcapturemachinescope.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcaptureparameters.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcaptureparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcaptureparameters.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcaptureparameters.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcapturequerystatusresult.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcapturequerystatusresult.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcapturequerystatusresult.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcapturequerystatusresult.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcaptureresult.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcaptureresult.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcaptureresult.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcaptureresult.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcaptureresultproperties.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcaptureresultproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcaptureresultproperties.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcaptureresultproperties.go diff --git a/resource-manager/network/2023-04-01/packetcaptures/model_packetcapturestoragelocation.go b/resource-manager/network/2022-07-01/packetcaptures/model_packetcapturestoragelocation.go similarity index 100% rename from resource-manager/network/2023-04-01/packetcaptures/model_packetcapturestoragelocation.go rename to resource-manager/network/2022-07-01/packetcaptures/model_packetcapturestoragelocation.go diff --git a/resource-manager/network/2022-07-01/packetcaptures/version.go b/resource-manager/network/2022-07-01/packetcaptures/version.go new file mode 100644 index 00000000000..4749118a673 --- /dev/null +++ b/resource-manager/network/2022-07-01/packetcaptures/version.go @@ -0,0 +1,12 @@ +package packetcaptures + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/packetcaptures/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/README.md new file mode 100644 index 00000000000..cd66f542eb2 --- /dev/null +++ b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections` Documentation + +The `peerexpressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/peerexpressroutecircuitconnections" +``` + + +### Client Initialization + +```go +client := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PeerExpressRouteCircuitConnectionsClient.Get` + +```go +ctx := context.TODO() +id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue") + +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: `PeerExpressRouteCircuitConnectionsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") + +// 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/network/2023-04-01/peerexpressroutecircuitconnections/client.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/client.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/client.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/constants.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/constants.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/constants.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/id_peerconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/id_peerconnection.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/id_peerconnection.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/id_peerconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/id_peerconnection_test.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/id_peerconnection_test.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/method_get.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/method_get.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/method_list.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/method_list.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/model_subresource.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/model_subresource.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/model_subresource.go diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/predicates.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/predicates.go rename to resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/version.go b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/version.go new file mode 100644 index 00000000000..5dc25f57b46 --- /dev/null +++ b/resource-manager/network/2022-07-01/peerexpressroutecircuitconnections/version.go @@ -0,0 +1,12 @@ +package peerexpressroutecircuitconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/peerexpressroutecircuitconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/privatednszonegroups/README.md b/resource-manager/network/2022-07-01/privatednszonegroups/README.md new file mode 100644 index 00000000000..62bb38edbec --- /dev/null +++ b/resource-manager/network/2022-07-01/privatednszonegroups/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privatednszonegroups` Documentation + +The `privatednszonegroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/privatednszonegroups" +``` + + +### Client Initialization + +```go +client := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateDnsZoneGroupsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") + +payload := privatednszonegroups.PrivateDnsZoneGroup{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateDnsZoneGroupsClient.Delete` + +```go +ctx := context.TODO() +id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateDnsZoneGroupsClient.Get` + +```go +ctx := context.TODO() +id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") + +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: `PrivateDnsZoneGroupsClient.List` + +```go +ctx := context.TODO() +id := privatednszonegroups.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") + +// 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/network/2023-04-01/privatednszonegroups/client.go b/resource-manager/network/2022-07-01/privatednszonegroups/client.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/client.go rename to resource-manager/network/2022-07-01/privatednszonegroups/client.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/constants.go b/resource-manager/network/2022-07-01/privatednszonegroups/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/constants.go rename to resource-manager/network/2022-07-01/privatednszonegroups/constants.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/id_privatednszonegroup.go b/resource-manager/network/2022-07-01/privatednszonegroups/id_privatednszonegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/id_privatednszonegroup.go rename to resource-manager/network/2022-07-01/privatednszonegroups/id_privatednszonegroup.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/id_privatednszonegroup_test.go b/resource-manager/network/2022-07-01/privatednszonegroups/id_privatednszonegroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/id_privatednszonegroup_test.go rename to resource-manager/network/2022-07-01/privatednszonegroups/id_privatednszonegroup_test.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/id_privateendpoint.go b/resource-manager/network/2022-07-01/privatednszonegroups/id_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/id_privateendpoint.go rename to resource-manager/network/2022-07-01/privatednszonegroups/id_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/id_privateendpoint_test.go b/resource-manager/network/2022-07-01/privatednszonegroups/id_privateendpoint_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/id_privateendpoint_test.go rename to resource-manager/network/2022-07-01/privatednszonegroups/id_privateendpoint_test.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/method_createorupdate.go b/resource-manager/network/2022-07-01/privatednszonegroups/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/method_createorupdate.go rename to resource-manager/network/2022-07-01/privatednszonegroups/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/method_delete.go b/resource-manager/network/2022-07-01/privatednszonegroups/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/method_delete.go rename to resource-manager/network/2022-07-01/privatednszonegroups/method_delete.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/method_get.go b/resource-manager/network/2022-07-01/privatednszonegroups/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/method_get.go rename to resource-manager/network/2022-07-01/privatednszonegroups/method_get.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/method_list.go b/resource-manager/network/2022-07-01/privatednszonegroups/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/method_list.go rename to resource-manager/network/2022-07-01/privatednszonegroups/method_list.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszoneconfig.go b/resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszoneconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszoneconfig.go rename to resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszoneconfig.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszonegroup.go b/resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszonegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszonegroup.go rename to resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszonegroup.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go b/resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszonepropertiesformat.go b/resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszonepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/model_privatednszonepropertiesformat.go rename to resource-manager/network/2022-07-01/privatednszonegroups/model_privatednszonepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/model_recordset.go b/resource-manager/network/2022-07-01/privatednszonegroups/model_recordset.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/model_recordset.go rename to resource-manager/network/2022-07-01/privatednszonegroups/model_recordset.go diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/predicates.go b/resource-manager/network/2022-07-01/privatednszonegroups/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/privatednszonegroups/predicates.go rename to resource-manager/network/2022-07-01/privatednszonegroups/predicates.go diff --git a/resource-manager/network/2022-07-01/privatednszonegroups/version.go b/resource-manager/network/2022-07-01/privatednszonegroups/version.go new file mode 100644 index 00000000000..b95aa2c99d8 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatednszonegroups/version.go @@ -0,0 +1,12 @@ +package privatednszonegroups + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/privatednszonegroups/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/privateendpoints/README.md b/resource-manager/network/2022-07-01/privateendpoints/README.md new file mode 100644 index 00000000000..17fdce57327 --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/README.md @@ -0,0 +1,134 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privateendpoints` Documentation + +The `privateendpoints` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/privateendpoints" +``` + + +### Client Initialization + +```go +client := privateendpoints.NewPrivateEndpointsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesList` + +```go +ctx := context.TODO() +id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination +items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesListByResourceGroup` + +```go +ctx := context.TODO() +id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") + +// alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PrivateEndpointsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") + +payload := privateendpoints.PrivateEndpoint{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateEndpointsClient.Delete` + +```go +ctx := context.TODO() +id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateEndpointsClient.Get` + +```go +ctx := context.TODO() +id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") + +read, err := client.Get(ctx, id, privateendpoints.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PrivateEndpointsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `PrivateEndpointsClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/privateendpoints/client.go b/resource-manager/network/2022-07-01/privateendpoints/client.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/client.go rename to resource-manager/network/2022-07-01/privateendpoints/client.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/constants.go b/resource-manager/network/2022-07-01/privateendpoints/constants.go new file mode 100644 index 00000000000..2436e142c98 --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/constants.go @@ -0,0 +1,1013 @@ +package privateendpoints + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/id_location.go b/resource-manager/network/2022-07-01/privateendpoints/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/id_location.go rename to resource-manager/network/2022-07-01/privateendpoints/id_location.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/id_location_test.go b/resource-manager/network/2022-07-01/privateendpoints/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/id_location_test.go rename to resource-manager/network/2022-07-01/privateendpoints/id_location_test.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/id_privateendpoint.go b/resource-manager/network/2022-07-01/privateendpoints/id_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/id_privateendpoint.go rename to resource-manager/network/2022-07-01/privateendpoints/id_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/id_privateendpoint_test.go b/resource-manager/network/2022-07-01/privateendpoints/id_privateendpoint_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/id_privateendpoint_test.go rename to resource-manager/network/2022-07-01/privateendpoints/id_privateendpoint_test.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2022-07-01/privateendpoints/id_providerlocation.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/id_providerlocation.go rename to resource-manager/network/2022-07-01/privateendpoints/id_providerlocation.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2022-07-01/privateendpoints/id_providerlocation_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/id_providerlocation_test.go rename to resource-manager/network/2022-07-01/privateendpoints/id_providerlocation_test.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_availableprivateendpointtypeslist.go b/resource-manager/network/2022-07-01/privateendpoints/method_availableprivateendpointtypeslist.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_availableprivateendpointtypeslist.go rename to resource-manager/network/2022-07-01/privateendpoints/method_availableprivateendpointtypeslist.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go b/resource-manager/network/2022-07-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_createorupdate.go b/resource-manager/network/2022-07-01/privateendpoints/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_createorupdate.go rename to resource-manager/network/2022-07-01/privateendpoints/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_delete.go b/resource-manager/network/2022-07-01/privateendpoints/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_delete.go rename to resource-manager/network/2022-07-01/privateendpoints/method_delete.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_get.go b/resource-manager/network/2022-07-01/privateendpoints/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_get.go rename to resource-manager/network/2022-07-01/privateendpoints/method_get.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_list.go b/resource-manager/network/2022-07-01/privateendpoints/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_list.go rename to resource-manager/network/2022-07-01/privateendpoints/method_list.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/method_listbysubscription.go b/resource-manager/network/2022-07-01/privateendpoints/method_listbysubscription.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/method_listbysubscription.go rename to resource-manager/network/2022-07-01/privateendpoints/method_listbysubscription.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_availableprivateendpointtype.go b/resource-manager/network/2022-07-01/privateendpoints/model_availableprivateendpointtype.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_availableprivateendpointtype.go rename to resource-manager/network/2022-07-01/privateendpoints/model_availableprivateendpointtype.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_backendaddresspool.go b/resource-manager/network/2022-07-01/privateendpoints/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/privateendpoints/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..9c21e3e14cb --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package privateendpoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_ddossettings.go b/resource-manager/network/2022-07-01/privateendpoints/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_ddossettings.go rename to resource-manager/network/2022-07-01/privateendpoints/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_delegation.go b/resource-manager/network/2022-07-01/privateendpoints/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_delegation.go rename to resource-manager/network/2022-07-01/privateendpoints/model_delegation.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_flowlog.go b/resource-manager/network/2022-07-01/privateendpoints/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_flowlog.go rename to resource-manager/network/2022-07-01/privateendpoints/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/privateendpoints/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/privateendpoints/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_inboundnatrule.go b/resource-manager/network/2022-07-01/privateendpoints/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/privateendpoints/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_ipconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/privateendpoints/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/privateendpoints/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_iptag.go b/resource-manager/network/2022-07-01/privateendpoints/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_iptag.go rename to resource-manager/network/2022-07-01/privateendpoints/model_iptag.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/privateendpoints/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/privateendpoints/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_natgateway.go b/resource-manager/network/2022-07-01/privateendpoints/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_natgateway.go rename to resource-manager/network/2022-07-01/privateendpoints/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_natgatewaysku.go b/resource-manager/network/2022-07-01/privateendpoints/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/privateendpoints/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_natruleportmapping.go b/resource-manager/network/2022-07-01/privateendpoints/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/privateendpoints/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterface.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterface.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..33a69210c93 --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package privateendpoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/privateendpoints/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpoint.go b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privateendpoint.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..5c9fea54ead --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package privateendpoints + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkservice.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_publicipaddress.go b/resource-manager/network/2022-07-01/privateendpoints/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_publicipaddress.go rename to resource-manager/network/2022-07-01/privateendpoints/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/privateendpoints/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..1ef8cb3fc5f --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package privateendpoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/privateendpoints/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/privateendpoints/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/privateendpoints/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/privateendpoints/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_resourceset.go b/resource-manager/network/2022-07-01/privateendpoints/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_resourceset.go rename to resource-manager/network/2022-07-01/privateendpoints/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/privateendpoints/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/privateendpoints/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_route.go b/resource-manager/network/2022-07-01/privateendpoints/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_route.go rename to resource-manager/network/2022-07-01/privateendpoints/model_route.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_routetable.go b/resource-manager/network/2022-07-01/privateendpoints/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_routetable.go rename to resource-manager/network/2022-07-01/privateendpoints/model_routetable.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_securityrule.go b/resource-manager/network/2022-07-01/privateendpoints/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_securityrule.go rename to resource-manager/network/2022-07-01/privateendpoints/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..9f400379698 --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package privateendpoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_subnet.go b/resource-manager/network/2022-07-01/privateendpoints/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_subnet.go rename to resource-manager/network/2022-07-01/privateendpoints/model_subnet.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..1fce76fffe5 --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package privateendpoints + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_subresource.go b/resource-manager/network/2022-07-01/privateendpoints/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_subresource.go rename to resource-manager/network/2022-07-01/privateendpoints/model_subresource.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/privateendpoints/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/privateendpoints/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/privateendpoints/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/privateendpoints/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/privateendpoints/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/privateendpoints/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privateendpoints/predicates.go b/resource-manager/network/2022-07-01/privateendpoints/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/privateendpoints/predicates.go rename to resource-manager/network/2022-07-01/privateendpoints/predicates.go diff --git a/resource-manager/network/2022-07-01/privateendpoints/version.go b/resource-manager/network/2022-07-01/privateendpoints/version.go new file mode 100644 index 00000000000..67c36b59e93 --- /dev/null +++ b/resource-manager/network/2022-07-01/privateendpoints/version.go @@ -0,0 +1,12 @@ +package privateendpoints + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpoints/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/privatelinkservice/README.md b/resource-manager/network/2022-07-01/privatelinkservice/README.md new file mode 100644 index 00000000000..f1adc2bcb07 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privatelinkservice` Documentation + +The `privatelinkservice` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/privatelinkservice" +``` + + +### Client Initialization + +```go +client := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateLinkServiceClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := privatelinkservice.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") + +payload := privatelinkservice.PrivateLinkService{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/privatelinkservice/client.go b/resource-manager/network/2022-07-01/privatelinkservice/client.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/client.go rename to resource-manager/network/2022-07-01/privatelinkservice/client.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/constants.go b/resource-manager/network/2022-07-01/privatelinkservice/constants.go new file mode 100644 index 00000000000..242e416e631 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/constants.go @@ -0,0 +1,1013 @@ +package privatelinkservice + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/id_privatelinkservice.go b/resource-manager/network/2022-07-01/privatelinkservice/id_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/id_privatelinkservice.go rename to resource-manager/network/2022-07-01/privatelinkservice/id_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/id_privatelinkservice_test.go b/resource-manager/network/2022-07-01/privatelinkservice/id_privatelinkservice_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/id_privatelinkservice_test.go rename to resource-manager/network/2022-07-01/privatelinkservice/id_privatelinkservice_test.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/method_createorupdate.go b/resource-manager/network/2022-07-01/privatelinkservice/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/method_createorupdate.go rename to resource-manager/network/2022-07-01/privatelinkservice/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_backendaddresspool.go b/resource-manager/network/2022-07-01/privatelinkservice/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..b63d022cddb --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package privatelinkservice + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_ddossettings.go b/resource-manager/network/2022-07-01/privatelinkservice/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_ddossettings.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_delegation.go b/resource-manager/network/2022-07-01/privatelinkservice/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_delegation.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_delegation.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_flowlog.go b/resource-manager/network/2022-07-01/privatelinkservice/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_flowlog.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/privatelinkservice/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_inboundnatrule.go b/resource-manager/network/2022-07-01/privatelinkservice/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_ipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/privatelinkservice/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_iptag.go b/resource-manager/network/2022-07-01/privatelinkservice/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_iptag.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_iptag.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/privatelinkservice/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_natgateway.go b/resource-manager/network/2022-07-01/privatelinkservice/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_natgateway.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_natgatewaysku.go b/resource-manager/network/2022-07-01/privatelinkservice/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_natruleportmapping.go b/resource-manager/network/2022-07-01/privatelinkservice/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterface.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterface.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..54e9855adc3 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package privatelinkservice + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpoint.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privateendpoint.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..e4de876b752 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package privatelinkservice + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkservice.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddress.go b/resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddress.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..f36270d84f9 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package privatelinkservice + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/privatelinkservice/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_resourceset.go b/resource-manager/network/2022-07-01/privatelinkservice/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_resourceset.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/privatelinkservice/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_route.go b/resource-manager/network/2022-07-01/privatelinkservice/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_route.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_route.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_routetable.go b/resource-manager/network/2022-07-01/privatelinkservice/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_routetable.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_routetable.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_securityrule.go b/resource-manager/network/2022-07-01/privatelinkservice/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_securityrule.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..15a84e8c5bb --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package privatelinkservice + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_subnet.go b/resource-manager/network/2022-07-01/privatelinkservice/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_subnet.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_subnet.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..4dc1a672220 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package privatelinkservice + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_subresource.go b/resource-manager/network/2022-07-01/privatelinkservice/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_subresource.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_subresource.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/privatelinkservice/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/privatelinkservice/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservice/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservice/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservice/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2022-07-01/privatelinkservice/version.go b/resource-manager/network/2022-07-01/privatelinkservice/version.go new file mode 100644 index 00000000000..ebb3ca8ea74 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservice/version.go @@ -0,0 +1,12 @@ +package privatelinkservice + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservice/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/privatelinkservices/README.md b/resource-manager/network/2022-07-01/privatelinkservices/README.md new file mode 100644 index 00000000000..767913f9d33 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/README.md @@ -0,0 +1,217 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/privatelinkservices` Documentation + +The `privatelinkservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/privatelinkservices" +``` + + +### Client Initialization + +```go +client := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility` + +```go +ctx := context.TODO() +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ + // ... +} + + +if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup` + +```go +ctx := context.TODO() +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") + +payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ + // ... +} + + +if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateLinkServicesClient.Delete` + +```go +ctx := context.TODO() +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateLinkServicesClient.DeletePrivateEndpointConnection` + +```go +ctx := context.TODO() +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") + +if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PrivateLinkServicesClient.Get` + +```go +ctx := context.TODO() +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") + +read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PrivateLinkServicesClient.GetPrivateEndpointConnection` + +```go +ctx := context.TODO() +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") + +read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PrivateLinkServicesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices` + +```go +ctx := context.TODO() +id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination +items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup` + +```go +ctx := context.TODO() +id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") + +// alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PrivateLinkServicesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PrivateLinkServicesClient.ListPrivateEndpointConnections` + +```go +ctx := context.TODO() +id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") + +// alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination +items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PrivateLinkServicesClient.UpdatePrivateEndpointConnection` + +```go +ctx := context.TODO() +id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") + +payload := privatelinkservices.PrivateEndpointConnection{ + // ... +} + + +read, err := client.UpdatePrivateEndpointConnection(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/network/2023-04-01/privatelinkservices/client.go b/resource-manager/network/2022-07-01/privatelinkservices/client.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/client.go rename to resource-manager/network/2022-07-01/privatelinkservices/client.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/constants.go b/resource-manager/network/2022-07-01/privatelinkservices/constants.go new file mode 100644 index 00000000000..d3781dc06a5 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/constants.go @@ -0,0 +1,1013 @@ +package privatelinkservices + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_location.go b/resource-manager/network/2022-07-01/privatelinkservices/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_location.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_location.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_location_test.go b/resource-manager/network/2022-07-01/privatelinkservices/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_location_test.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_location_test.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2022-07-01/privatelinkservices/id_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_privateendpointconnection.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_privateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2022-07-01/privatelinkservices/id_privateendpointconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_privateendpointconnection_test.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_privateendpointconnection_test.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2022-07-01/privatelinkservices/id_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_privatelinkservice.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2022-07-01/privatelinkservices/id_privatelinkservice_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_privatelinkservice_test.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_privatelinkservice_test.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2022-07-01/privatelinkservices/id_providerlocation.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_providerlocation.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_providerlocation.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2022-07-01/privatelinkservices/id_providerlocation_test.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/id_providerlocation_test.go rename to resource-manager/network/2022-07-01/privatelinkservices/id_providerlocation_test.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_checkprivatelinkservicevisibility.go b/resource-manager/network/2022-07-01/privatelinkservices/method_checkprivatelinkservicevisibility.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_checkprivatelinkservicevisibility.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_checkprivatelinkservicevisibility.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go b/resource-manager/network/2022-07-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_delete.go b/resource-manager/network/2022-07-01/privatelinkservices/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_delete.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_delete.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_deleteprivateendpointconnection.go b/resource-manager/network/2022-07-01/privatelinkservices/method_deleteprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_deleteprivateendpointconnection.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_deleteprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_get.go b/resource-manager/network/2022-07-01/privatelinkservices/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_get.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_get.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_getprivateendpointconnection.go b/resource-manager/network/2022-07-01/privatelinkservices/method_getprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_getprivateendpointconnection.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_getprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_list.go b/resource-manager/network/2022-07-01/privatelinkservices/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_list.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_list.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go b/resource-manager/network/2022-07-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go b/resource-manager/network/2022-07-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_listbysubscription.go b/resource-manager/network/2022-07-01/privatelinkservices/method_listbysubscription.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_listbysubscription.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_listbysubscription.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_listprivateendpointconnections.go b/resource-manager/network/2022-07-01/privatelinkservices/method_listprivateendpointconnections.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_listprivateendpointconnections.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_listprivateendpointconnections.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/method_updateprivateendpointconnection.go b/resource-manager/network/2022-07-01/privatelinkservices/method_updateprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/method_updateprivateendpointconnection.go rename to resource-manager/network/2022-07-01/privatelinkservices/method_updateprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_autoapprovedprivatelinkservice.go b/resource-manager/network/2022-07-01/privatelinkservices/model_autoapprovedprivatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_autoapprovedprivatelinkservice.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_autoapprovedprivatelinkservice.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_backendaddresspool.go b/resource-manager/network/2022-07-01/privatelinkservices/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..10ee2869126 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package privatelinkservices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go b/resource-manager/network/2022-07-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_ddossettings.go b/resource-manager/network/2022-07-01/privatelinkservices/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_ddossettings.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_delegation.go b/resource-manager/network/2022-07-01/privatelinkservices/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_delegation.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_delegation.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_flowlog.go b/resource-manager/network/2022-07-01/privatelinkservices/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_flowlog.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/privatelinkservices/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_inboundnatrule.go b/resource-manager/network/2022-07-01/privatelinkservices/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_ipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/privatelinkservices/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_iptag.go b/resource-manager/network/2022-07-01/privatelinkservices/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_iptag.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_iptag.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/privatelinkservices/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_natgateway.go b/resource-manager/network/2022-07-01/privatelinkservices/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_natgateway.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_natgatewaysku.go b/resource-manager/network/2022-07-01/privatelinkservices/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_natruleportmapping.go b/resource-manager/network/2022-07-01/privatelinkservices/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterface.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterface.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..e095e2da96a --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package privatelinkservices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpoint.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privateendpoint.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..79d83621937 --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package privatelinkservices + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkservice.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkservicevisibility.go b/resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkservicevisibility.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_privatelinkservicevisibility.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_privatelinkservicevisibility.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddress.go b/resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddress.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..36ed651b7ec --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package privatelinkservices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/privatelinkservices/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_resourceset.go b/resource-manager/network/2022-07-01/privatelinkservices/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_resourceset.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/privatelinkservices/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_route.go b/resource-manager/network/2022-07-01/privatelinkservices/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_route.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_route.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_routetable.go b/resource-manager/network/2022-07-01/privatelinkservices/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_routetable.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_routetable.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_securityrule.go b/resource-manager/network/2022-07-01/privatelinkservices/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_securityrule.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..1fb3666a2be --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package privatelinkservices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_subnet.go b/resource-manager/network/2022-07-01/privatelinkservices/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_subnet.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_subnet.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..0da71c2b8be --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package privatelinkservices + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_subresource.go b/resource-manager/network/2022-07-01/privatelinkservices/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_subresource.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_subresource.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/privatelinkservices/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/privatelinkservices/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/privatelinkservices/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/privatelinkservices/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/privatelinkservices/predicates.go b/resource-manager/network/2022-07-01/privatelinkservices/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/privatelinkservices/predicates.go rename to resource-manager/network/2022-07-01/privatelinkservices/predicates.go diff --git a/resource-manager/network/2022-07-01/privatelinkservices/version.go b/resource-manager/network/2022-07-01/privatelinkservices/version.go new file mode 100644 index 00000000000..7aa947dcc6f --- /dev/null +++ b/resource-manager/network/2022-07-01/privatelinkservices/version.go @@ -0,0 +1,12 @@ +package privatelinkservices + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservices/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/publicipaddresses/README.md b/resource-manager/network/2022-07-01/publicipaddresses/README.md new file mode 100644 index 00000000000..9b29ce66845 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/README.md @@ -0,0 +1,133 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/publicipaddresses` Documentation + +The `publicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/publicipaddresses" +``` + + +### Client Initialization + +```go +client := publicipaddresses.NewPublicIPAddressesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PublicIPAddressesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") + +payload := publicipaddresses.PublicIPAddress{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PublicIPAddressesClient.DdosProtectionStatus` + +```go +ctx := context.TODO() +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") + +if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PublicIPAddressesClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PublicIPAddressesClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") + +read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PublicIPAddressesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `PublicIPAddressesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PublicIPAddressesClient.UpdateTags` + +```go +ctx := context.TODO() +id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") + +payload := publicipaddresses.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/network/2023-04-01/publicipaddresses/client.go b/resource-manager/network/2022-07-01/publicipaddresses/client.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/client.go rename to resource-manager/network/2022-07-01/publicipaddresses/client.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/constants.go b/resource-manager/network/2022-07-01/publicipaddresses/constants.go new file mode 100644 index 00000000000..e6528ab4517 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/constants.go @@ -0,0 +1,1054 @@ +package publicipaddresses + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type IsWorkloadProtected string + +const ( + IsWorkloadProtectedFalse IsWorkloadProtected = "False" + IsWorkloadProtectedTrue IsWorkloadProtected = "True" +) + +func PossibleValuesForIsWorkloadProtected() []string { + return []string{ + string(IsWorkloadProtectedFalse), + string(IsWorkloadProtectedTrue), + } +} + +func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIsWorkloadProtected(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { + vals := map[string]IsWorkloadProtected{ + "false": IsWorkloadProtectedFalse, + "true": IsWorkloadProtectedTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IsWorkloadProtected(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_createorupdate.go b/resource-manager/network/2022-07-01/publicipaddresses/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_createorupdate.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_ddosprotectionstatus.go b/resource-manager/network/2022-07-01/publicipaddresses/method_ddosprotectionstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_ddosprotectionstatus.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_ddosprotectionstatus.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_delete.go b/resource-manager/network/2022-07-01/publicipaddresses/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_delete.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_delete.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_get.go b/resource-manager/network/2022-07-01/publicipaddresses/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_get.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_get.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_list.go b/resource-manager/network/2022-07-01/publicipaddresses/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_list.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_list.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_listall.go b/resource-manager/network/2022-07-01/publicipaddresses/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_listall.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_listall.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/method_updatetags.go b/resource-manager/network/2022-07-01/publicipaddresses/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/method_updatetags.go rename to resource-manager/network/2022-07-01/publicipaddresses/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_backendaddresspool.go b/resource-manager/network/2022-07-01/publicipaddresses/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..d18a26b3c77 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package publicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_ddossettings.go b/resource-manager/network/2022-07-01/publicipaddresses/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_ddossettings.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_delegation.go b/resource-manager/network/2022-07-01/publicipaddresses/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_delegation.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_delegation.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_flowlog.go b/resource-manager/network/2022-07-01/publicipaddresses/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_flowlog.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/publicipaddresses/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_inboundnatrule.go b/resource-manager/network/2022-07-01/publicipaddresses/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_ipconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/publicipaddresses/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_iptag.go b/resource-manager/network/2022-07-01/publicipaddresses/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_iptag.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_iptag.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/publicipaddresses/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_natgateway.go b/resource-manager/network/2022-07-01/publicipaddresses/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_natgateway.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_natgatewaysku.go b/resource-manager/network/2022-07-01/publicipaddresses/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_natruleportmapping.go b/resource-manager/network/2022-07-01/publicipaddresses/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterface.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterface.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..657ab7001b4 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package publicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpoint.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privateendpoint.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..1f2a5ecad88 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package publicipaddresses + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkservice.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddress.go b/resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddress.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..44d46e7b532 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package publicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_publicipddosprotectionstatusresult.go b/resource-manager/network/2022-07-01/publicipaddresses/model_publicipddosprotectionstatusresult.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_publicipddosprotectionstatusresult.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_publicipddosprotectionstatusresult.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/publicipaddresses/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_resourceset.go b/resource-manager/network/2022-07-01/publicipaddresses/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_resourceset.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/publicipaddresses/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_route.go b/resource-manager/network/2022-07-01/publicipaddresses/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_route.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_route.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_routetable.go b/resource-manager/network/2022-07-01/publicipaddresses/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_routetable.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_routetable.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_securityrule.go b/resource-manager/network/2022-07-01/publicipaddresses/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_securityrule.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..fbac3126ab5 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package publicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_subnet.go b/resource-manager/network/2022-07-01/publicipaddresses/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_subnet.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_subnet.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..6421779b1b2 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package publicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_subresource.go b/resource-manager/network/2022-07-01/publicipaddresses/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_subresource.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_subresource.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_tagsobject.go b/resource-manager/network/2022-07-01/publicipaddresses/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_tagsobject.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/publicipaddresses/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/publicipaddresses/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/publicipaddresses/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/publicipaddresses/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipaddresses/predicates.go b/resource-manager/network/2022-07-01/publicipaddresses/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipaddresses/predicates.go rename to resource-manager/network/2022-07-01/publicipaddresses/predicates.go diff --git a/resource-manager/network/2022-07-01/publicipaddresses/version.go b/resource-manager/network/2022-07-01/publicipaddresses/version.go new file mode 100644 index 00000000000..8656a251427 --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipaddresses/version.go @@ -0,0 +1,12 @@ +package publicipaddresses + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/publicipaddresses/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/publicipprefixes/README.md b/resource-manager/network/2022-07-01/publicipprefixes/README.md new file mode 100644 index 00000000000..b47c173362e --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipprefixes/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/publicipprefixes` Documentation + +The `publicipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/publicipprefixes" +``` + + +### Client Initialization + +```go +client := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `PublicIPPrefixesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") + +payload := publicipprefixes.PublicIPPrefix{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `PublicIPPrefixesClient.Delete` + +```go +ctx := context.TODO() +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `PublicIPPrefixesClient.Get` + +```go +ctx := context.TODO() +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") + +read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `PublicIPPrefixesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `PublicIPPrefixesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `PublicIPPrefixesClient.UpdateTags` + +```go +ctx := context.TODO() +id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") + +payload := publicipprefixes.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/network/2023-04-01/publicipprefixes/client.go b/resource-manager/network/2022-07-01/publicipprefixes/client.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/client.go rename to resource-manager/network/2022-07-01/publicipprefixes/client.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/constants.go b/resource-manager/network/2022-07-01/publicipprefixes/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/constants.go rename to resource-manager/network/2022-07-01/publicipprefixes/constants.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2022-07-01/publicipprefixes/id_publicipprefix.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/id_publicipprefix.go rename to resource-manager/network/2022-07-01/publicipprefixes/id_publicipprefix.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2022-07-01/publicipprefixes/id_publicipprefix_test.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/id_publicipprefix_test.go rename to resource-manager/network/2022-07-01/publicipprefixes/id_publicipprefix_test.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/method_createorupdate.go b/resource-manager/network/2022-07-01/publicipprefixes/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/method_createorupdate.go rename to resource-manager/network/2022-07-01/publicipprefixes/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/method_delete.go b/resource-manager/network/2022-07-01/publicipprefixes/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/method_delete.go rename to resource-manager/network/2022-07-01/publicipprefixes/method_delete.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/method_get.go b/resource-manager/network/2022-07-01/publicipprefixes/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/method_get.go rename to resource-manager/network/2022-07-01/publicipprefixes/method_get.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/method_list.go b/resource-manager/network/2022-07-01/publicipprefixes/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/method_list.go rename to resource-manager/network/2022-07-01/publicipprefixes/method_list.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/method_listall.go b/resource-manager/network/2022-07-01/publicipprefixes/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/method_listall.go rename to resource-manager/network/2022-07-01/publicipprefixes/method_listall.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/method_updatetags.go b/resource-manager/network/2022-07-01/publicipprefixes/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/method_updatetags.go rename to resource-manager/network/2022-07-01/publicipprefixes/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_iptag.go b/resource-manager/network/2022-07-01/publicipprefixes/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_iptag.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_iptag.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_natgateway.go b/resource-manager/network/2022-07-01/publicipprefixes/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_natgateway.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/publicipprefixes/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_natgatewaysku.go b/resource-manager/network/2022-07-01/publicipprefixes/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_publicipprefix.go b/resource-manager/network/2022-07-01/publicipprefixes/model_publicipprefix.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_publicipprefix.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_publicipprefix.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_publicipprefixpropertiesformat.go b/resource-manager/network/2022-07-01/publicipprefixes/model_publicipprefixpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_publicipprefixpropertiesformat.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_publicipprefixpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_publicipprefixsku.go b/resource-manager/network/2022-07-01/publicipprefixes/model_publicipprefixsku.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_publicipprefixsku.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_publicipprefixsku.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_referencedpublicipaddress.go b/resource-manager/network/2022-07-01/publicipprefixes/model_referencedpublicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_referencedpublicipaddress.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_referencedpublicipaddress.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_subresource.go b/resource-manager/network/2022-07-01/publicipprefixes/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_subresource.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_subresource.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/model_tagsobject.go b/resource-manager/network/2022-07-01/publicipprefixes/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/model_tagsobject.go rename to resource-manager/network/2022-07-01/publicipprefixes/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/publicipprefixes/predicates.go b/resource-manager/network/2022-07-01/publicipprefixes/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/publicipprefixes/predicates.go rename to resource-manager/network/2022-07-01/publicipprefixes/predicates.go diff --git a/resource-manager/network/2022-07-01/publicipprefixes/version.go b/resource-manager/network/2022-07-01/publicipprefixes/version.go new file mode 100644 index 00000000000..54cc200f7ed --- /dev/null +++ b/resource-manager/network/2022-07-01/publicipprefixes/version.go @@ -0,0 +1,12 @@ +package publicipprefixes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/publicipprefixes/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/routefilterrules/README.md b/resource-manager/network/2022-07-01/routefilterrules/README.md new file mode 100644 index 00000000000..3da8f39c4c8 --- /dev/null +++ b/resource-manager/network/2022-07-01/routefilterrules/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routefilterrules` Documentation + +The `routefilterrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/routefilterrules" +``` + + +### Client Initialization + +```go +client := routefilterrules.NewRouteFilterRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RouteFilterRulesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") + +payload := routefilterrules.RouteFilterRule{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RouteFilterRulesClient.Delete` + +```go +ctx := context.TODO() +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RouteFilterRulesClient.Get` + +```go +ctx := context.TODO() +id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") + +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: `RouteFilterRulesClient.ListByRouteFilter` + +```go +ctx := context.TODO() +id := routefilterrules.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") + +// alternatively `client.ListByRouteFilter(ctx, id)` can be used to do batched pagination +items, err := client.ListByRouteFilterComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/routefilterrules/client.go b/resource-manager/network/2022-07-01/routefilterrules/client.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/client.go rename to resource-manager/network/2022-07-01/routefilterrules/client.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/constants.go b/resource-manager/network/2022-07-01/routefilterrules/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/constants.go rename to resource-manager/network/2022-07-01/routefilterrules/constants.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/id_routefilter.go b/resource-manager/network/2022-07-01/routefilterrules/id_routefilter.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/id_routefilter.go rename to resource-manager/network/2022-07-01/routefilterrules/id_routefilter.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/id_routefilter_test.go b/resource-manager/network/2022-07-01/routefilterrules/id_routefilter_test.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/id_routefilter_test.go rename to resource-manager/network/2022-07-01/routefilterrules/id_routefilter_test.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2022-07-01/routefilterrules/id_routefilterrule.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/id_routefilterrule.go rename to resource-manager/network/2022-07-01/routefilterrules/id_routefilterrule.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2022-07-01/routefilterrules/id_routefilterrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/id_routefilterrule_test.go rename to resource-manager/network/2022-07-01/routefilterrules/id_routefilterrule_test.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/method_createorupdate.go b/resource-manager/network/2022-07-01/routefilterrules/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/method_createorupdate.go rename to resource-manager/network/2022-07-01/routefilterrules/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/method_delete.go b/resource-manager/network/2022-07-01/routefilterrules/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/method_delete.go rename to resource-manager/network/2022-07-01/routefilterrules/method_delete.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/method_get.go b/resource-manager/network/2022-07-01/routefilterrules/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/method_get.go rename to resource-manager/network/2022-07-01/routefilterrules/method_get.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/method_listbyroutefilter.go b/resource-manager/network/2022-07-01/routefilterrules/method_listbyroutefilter.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/method_listbyroutefilter.go rename to resource-manager/network/2022-07-01/routefilterrules/method_listbyroutefilter.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/model_routefilterrule.go b/resource-manager/network/2022-07-01/routefilterrules/model_routefilterrule.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/model_routefilterrule.go rename to resource-manager/network/2022-07-01/routefilterrules/model_routefilterrule.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/model_routefilterrulepropertiesformat.go b/resource-manager/network/2022-07-01/routefilterrules/model_routefilterrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/model_routefilterrulepropertiesformat.go rename to resource-manager/network/2022-07-01/routefilterrules/model_routefilterrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routefilterrules/predicates.go b/resource-manager/network/2022-07-01/routefilterrules/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilterrules/predicates.go rename to resource-manager/network/2022-07-01/routefilterrules/predicates.go diff --git a/resource-manager/network/2022-07-01/routefilterrules/version.go b/resource-manager/network/2022-07-01/routefilterrules/version.go new file mode 100644 index 00000000000..682d9581b14 --- /dev/null +++ b/resource-manager/network/2022-07-01/routefilterrules/version.go @@ -0,0 +1,12 @@ +package routefilterrules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/routefilterrules/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/routefilters/README.md b/resource-manager/network/2022-07-01/routefilters/README.md new file mode 100644 index 00000000000..513b72c18aa --- /dev/null +++ b/resource-manager/network/2022-07-01/routefilters/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routefilters` Documentation + +The `routefilters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/routefilters" +``` + + +### Client Initialization + +```go +client := routefilters.NewRouteFiltersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RouteFiltersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") + +payload := routefilters.RouteFilter{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RouteFiltersClient.Delete` + +```go +ctx := context.TODO() +id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RouteFiltersClient.Get` + +```go +ctx := context.TODO() +id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") + +read, err := client.Get(ctx, id, routefilters.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RouteFiltersClient.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: `RouteFiltersClient.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: `RouteFiltersClient.UpdateTags` + +```go +ctx := context.TODO() +id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") + +payload := routefilters.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/network/2023-04-01/routefilters/client.go b/resource-manager/network/2022-07-01/routefilters/client.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/client.go rename to resource-manager/network/2022-07-01/routefilters/client.go diff --git a/resource-manager/network/2023-04-01/routefilters/constants.go b/resource-manager/network/2022-07-01/routefilters/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/constants.go rename to resource-manager/network/2022-07-01/routefilters/constants.go diff --git a/resource-manager/network/2023-04-01/routefilters/id_routefilter.go b/resource-manager/network/2022-07-01/routefilters/id_routefilter.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/id_routefilter.go rename to resource-manager/network/2022-07-01/routefilters/id_routefilter.go diff --git a/resource-manager/network/2023-04-01/routefilters/id_routefilter_test.go b/resource-manager/network/2022-07-01/routefilters/id_routefilter_test.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/id_routefilter_test.go rename to resource-manager/network/2022-07-01/routefilters/id_routefilter_test.go diff --git a/resource-manager/network/2023-04-01/routefilters/method_createorupdate.go b/resource-manager/network/2022-07-01/routefilters/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/method_createorupdate.go rename to resource-manager/network/2022-07-01/routefilters/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/routefilters/method_delete.go b/resource-manager/network/2022-07-01/routefilters/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/method_delete.go rename to resource-manager/network/2022-07-01/routefilters/method_delete.go diff --git a/resource-manager/network/2023-04-01/routefilters/method_get.go b/resource-manager/network/2022-07-01/routefilters/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/method_get.go rename to resource-manager/network/2022-07-01/routefilters/method_get.go diff --git a/resource-manager/network/2023-04-01/routefilters/method_list.go b/resource-manager/network/2022-07-01/routefilters/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/method_list.go rename to resource-manager/network/2022-07-01/routefilters/method_list.go diff --git a/resource-manager/network/2023-04-01/routefilters/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/routefilters/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/routefilters/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/routefilters/method_updatetags.go b/resource-manager/network/2022-07-01/routefilters/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/method_updatetags.go rename to resource-manager/network/2022-07-01/routefilters/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitconnection.go b/resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitpeering.go b/resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitpeering.go rename to resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitpeering.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go rename to resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitstats.go b/resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitstats.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressroutecircuitstats.go rename to resource-manager/network/2022-07-01/routefilters/model_expressroutecircuitstats.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_expressrouteconnectionid.go b/resource-manager/network/2022-07-01/routefilters/model_expressrouteconnectionid.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_expressrouteconnectionid.go rename to resource-manager/network/2022-07-01/routefilters/model_expressrouteconnectionid.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2022-07-01/routefilters/model_ipv6circuitconnectionconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_ipv6circuitconnectionconfig.go rename to resource-manager/network/2022-07-01/routefilters/model_ipv6circuitconnectionconfig.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2022-07-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go rename to resource-manager/network/2022-07-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2022-07-01/routefilters/model_peerexpressroutecircuitconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_peerexpressroutecircuitconnection.go rename to resource-manager/network/2022-07-01/routefilters/model_peerexpressroutecircuitconnection.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_routefilter.go b/resource-manager/network/2022-07-01/routefilters/model_routefilter.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_routefilter.go rename to resource-manager/network/2022-07-01/routefilters/model_routefilter.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_routefilterpropertiesformat.go b/resource-manager/network/2022-07-01/routefilters/model_routefilterpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_routefilterpropertiesformat.go rename to resource-manager/network/2022-07-01/routefilters/model_routefilterpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_routefilterrule.go b/resource-manager/network/2022-07-01/routefilters/model_routefilterrule.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_routefilterrule.go rename to resource-manager/network/2022-07-01/routefilters/model_routefilterrule.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_routefilterrulepropertiesformat.go b/resource-manager/network/2022-07-01/routefilters/model_routefilterrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_routefilterrulepropertiesformat.go rename to resource-manager/network/2022-07-01/routefilters/model_routefilterrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_subresource.go b/resource-manager/network/2022-07-01/routefilters/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_subresource.go rename to resource-manager/network/2022-07-01/routefilters/model_subresource.go diff --git a/resource-manager/network/2023-04-01/routefilters/model_tagsobject.go b/resource-manager/network/2022-07-01/routefilters/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/model_tagsobject.go rename to resource-manager/network/2022-07-01/routefilters/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/routefilters/predicates.go b/resource-manager/network/2022-07-01/routefilters/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/routefilters/predicates.go rename to resource-manager/network/2022-07-01/routefilters/predicates.go diff --git a/resource-manager/network/2022-07-01/routefilters/version.go b/resource-manager/network/2022-07-01/routefilters/version.go new file mode 100644 index 00000000000..1670dc71d27 --- /dev/null +++ b/resource-manager/network/2022-07-01/routefilters/version.go @@ -0,0 +1,12 @@ +package routefilters + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/routefilters/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/routes/README.md b/resource-manager/network/2022-07-01/routes/README.md new file mode 100644 index 00000000000..fb5f51d6303 --- /dev/null +++ b/resource-manager/network/2022-07-01/routes/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routes` Documentation + +The `routes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/routes" +``` + + +### Client Initialization + +```go +client := routes.NewRoutesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RoutesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") + +payload := routes.Route{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RoutesClient.Delete` + +```go +ctx := context.TODO() +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RoutesClient.Get` + +```go +ctx := context.TODO() +id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") + +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: `RoutesClient.List` + +```go +ctx := context.TODO() +id := routes.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") + +// 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/network/2023-04-01/routes/client.go b/resource-manager/network/2022-07-01/routes/client.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/client.go rename to resource-manager/network/2022-07-01/routes/client.go diff --git a/resource-manager/network/2023-04-01/routes/constants.go b/resource-manager/network/2022-07-01/routes/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/constants.go rename to resource-manager/network/2022-07-01/routes/constants.go diff --git a/resource-manager/network/2023-04-01/routes/id_route.go b/resource-manager/network/2022-07-01/routes/id_route.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/id_route.go rename to resource-manager/network/2022-07-01/routes/id_route.go diff --git a/resource-manager/network/2023-04-01/routes/id_route_test.go b/resource-manager/network/2022-07-01/routes/id_route_test.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/id_route_test.go rename to resource-manager/network/2022-07-01/routes/id_route_test.go diff --git a/resource-manager/network/2023-04-01/routes/id_routetable.go b/resource-manager/network/2022-07-01/routes/id_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/id_routetable.go rename to resource-manager/network/2022-07-01/routes/id_routetable.go diff --git a/resource-manager/network/2023-04-01/routes/id_routetable_test.go b/resource-manager/network/2022-07-01/routes/id_routetable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/id_routetable_test.go rename to resource-manager/network/2022-07-01/routes/id_routetable_test.go diff --git a/resource-manager/network/2023-04-01/routes/method_createorupdate.go b/resource-manager/network/2022-07-01/routes/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/method_createorupdate.go rename to resource-manager/network/2022-07-01/routes/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/routes/method_delete.go b/resource-manager/network/2022-07-01/routes/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/method_delete.go rename to resource-manager/network/2022-07-01/routes/method_delete.go diff --git a/resource-manager/network/2023-04-01/routes/method_get.go b/resource-manager/network/2022-07-01/routes/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/method_get.go rename to resource-manager/network/2022-07-01/routes/method_get.go diff --git a/resource-manager/network/2023-04-01/routes/method_list.go b/resource-manager/network/2022-07-01/routes/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/method_list.go rename to resource-manager/network/2022-07-01/routes/method_list.go diff --git a/resource-manager/network/2023-04-01/routes/model_route.go b/resource-manager/network/2022-07-01/routes/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/model_route.go rename to resource-manager/network/2022-07-01/routes/model_route.go diff --git a/resource-manager/network/2023-04-01/routes/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/routes/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/routes/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routes/predicates.go b/resource-manager/network/2022-07-01/routes/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/routes/predicates.go rename to resource-manager/network/2022-07-01/routes/predicates.go diff --git a/resource-manager/network/2022-07-01/routes/version.go b/resource-manager/network/2022-07-01/routes/version.go new file mode 100644 index 00000000000..328fbdb296f --- /dev/null +++ b/resource-manager/network/2022-07-01/routes/version.go @@ -0,0 +1,12 @@ +package routes + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/routes/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/routetables/README.md b/resource-manager/network/2022-07-01/routetables/README.md new file mode 100644 index 00000000000..495b372806b --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/routetables` Documentation + +The `routetables` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/routetables" +``` + + +### Client Initialization + +```go +client := routetables.NewRouteTablesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `RouteTablesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") + +payload := routetables.RouteTable{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `RouteTablesClient.Delete` + +```go +ctx := context.TODO() +id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `RouteTablesClient.Get` + +```go +ctx := context.TODO() +id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") + +read, err := client.Get(ctx, id, routetables.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `RouteTablesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `RouteTablesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `RouteTablesClient.UpdateTags` + +```go +ctx := context.TODO() +id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") + +payload := routetables.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/network/2023-04-01/routetables/client.go b/resource-manager/network/2022-07-01/routetables/client.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/client.go rename to resource-manager/network/2022-07-01/routetables/client.go diff --git a/resource-manager/network/2022-07-01/routetables/constants.go b/resource-manager/network/2022-07-01/routetables/constants.go new file mode 100644 index 00000000000..9f8d2c5a432 --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/constants.go @@ -0,0 +1,1013 @@ +package routetables + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/routetables/id_routetable.go b/resource-manager/network/2022-07-01/routetables/id_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/id_routetable.go rename to resource-manager/network/2022-07-01/routetables/id_routetable.go diff --git a/resource-manager/network/2023-04-01/routetables/id_routetable_test.go b/resource-manager/network/2022-07-01/routetables/id_routetable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/id_routetable_test.go rename to resource-manager/network/2022-07-01/routetables/id_routetable_test.go diff --git a/resource-manager/network/2023-04-01/routetables/method_createorupdate.go b/resource-manager/network/2022-07-01/routetables/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/method_createorupdate.go rename to resource-manager/network/2022-07-01/routetables/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/routetables/method_delete.go b/resource-manager/network/2022-07-01/routetables/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/method_delete.go rename to resource-manager/network/2022-07-01/routetables/method_delete.go diff --git a/resource-manager/network/2023-04-01/routetables/method_get.go b/resource-manager/network/2022-07-01/routetables/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/method_get.go rename to resource-manager/network/2022-07-01/routetables/method_get.go diff --git a/resource-manager/network/2023-04-01/routetables/method_list.go b/resource-manager/network/2022-07-01/routetables/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/method_list.go rename to resource-manager/network/2022-07-01/routetables/method_list.go diff --git a/resource-manager/network/2023-04-01/routetables/method_listall.go b/resource-manager/network/2022-07-01/routetables/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/method_listall.go rename to resource-manager/network/2022-07-01/routetables/method_listall.go diff --git a/resource-manager/network/2023-04-01/routetables/method_updatetags.go b/resource-manager/network/2022-07-01/routetables/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/method_updatetags.go rename to resource-manager/network/2022-07-01/routetables/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/routetables/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/routetables/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/routetables/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/routetables/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/routetables/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/routetables/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/routetables/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_backendaddresspool.go b/resource-manager/network/2022-07-01/routetables/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/routetables/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/routetables/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..c1ff3fcd065 --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package routetables + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/routetables/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_ddossettings.go b/resource-manager/network/2022-07-01/routetables/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_ddossettings.go rename to resource-manager/network/2022-07-01/routetables/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/routetables/model_delegation.go b/resource-manager/network/2022-07-01/routetables/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_delegation.go rename to resource-manager/network/2022-07-01/routetables/model_delegation.go diff --git a/resource-manager/network/2023-04-01/routetables/model_flowlog.go b/resource-manager/network/2022-07-01/routetables/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_flowlog.go rename to resource-manager/network/2022-07-01/routetables/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/routetables/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/routetables/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/routetables/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/routetables/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/routetables/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/routetables/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/routetables/model_inboundnatrule.go b/resource-manager/network/2022-07-01/routetables/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/routetables/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/routetables/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_ipconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/routetables/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/routetables/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/routetables/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_iptag.go b/resource-manager/network/2022-07-01/routetables/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_iptag.go rename to resource-manager/network/2022-07-01/routetables/model_iptag.go diff --git a/resource-manager/network/2023-04-01/routetables/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/routetables/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/routetables/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_natgateway.go b/resource-manager/network/2022-07-01/routetables/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_natgateway.go rename to resource-manager/network/2022-07-01/routetables/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/routetables/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_natgatewaysku.go b/resource-manager/network/2022-07-01/routetables/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/routetables/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/routetables/model_natruleportmapping.go b/resource-manager/network/2022-07-01/routetables/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/routetables/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterface.go b/resource-manager/network/2022-07-01/routetables/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterface.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/routetables/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..cc03b90ede8 --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package routetables + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/routetables/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/routetables/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/routetables/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privateendpoint.go b/resource-manager/network/2022-07-01/routetables/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privateendpoint.go rename to resource-manager/network/2022-07-01/routetables/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/routetables/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/routetables/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/routetables/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/routetables/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..4e270701e21 --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package routetables + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/routetables/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/routetables/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/routetables/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/routetables/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/routetables/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkservice.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/routetables/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/routetables/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_publicipaddress.go b/resource-manager/network/2022-07-01/routetables/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_publicipaddress.go rename to resource-manager/network/2022-07-01/routetables/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/routetables/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/routetables/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..d3414edd7f7 --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package routetables + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/routetables/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/routetables/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/routetables/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/routetables/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/routetables/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/routetables/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/routetables/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/routetables/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/routetables/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_resourceset.go b/resource-manager/network/2022-07-01/routetables/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_resourceset.go rename to resource-manager/network/2022-07-01/routetables/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/routetables/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/routetables/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/routetables/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/routetables/model_route.go b/resource-manager/network/2022-07-01/routetables/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_route.go rename to resource-manager/network/2022-07-01/routetables/model_route.go diff --git a/resource-manager/network/2023-04-01/routetables/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_routetable.go b/resource-manager/network/2022-07-01/routetables/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_routetable.go rename to resource-manager/network/2022-07-01/routetables/model_routetable.go diff --git a/resource-manager/network/2023-04-01/routetables/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_securityrule.go b/resource-manager/network/2022-07-01/routetables/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_securityrule.go rename to resource-manager/network/2022-07-01/routetables/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/routetables/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..26d446fad2e --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package routetables + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/routetables/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/routetables/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/model_subnet.go b/resource-manager/network/2022-07-01/routetables/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_subnet.go rename to resource-manager/network/2022-07-01/routetables/model_subnet.go diff --git a/resource-manager/network/2022-07-01/routetables/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..19b8f9de7af --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package routetables + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/routetables/model_subresource.go b/resource-manager/network/2022-07-01/routetables/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_subresource.go rename to resource-manager/network/2022-07-01/routetables/model_subresource.go diff --git a/resource-manager/network/2023-04-01/routetables/model_tagsobject.go b/resource-manager/network/2022-07-01/routetables/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_tagsobject.go rename to resource-manager/network/2022-07-01/routetables/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/routetables/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/routetables/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/routetables/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/routetables/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/routetables/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/routetables/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/routetables/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/routetables/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/routetables/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/routetables/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/routetables/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/routetables/predicates.go b/resource-manager/network/2022-07-01/routetables/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/routetables/predicates.go rename to resource-manager/network/2022-07-01/routetables/predicates.go diff --git a/resource-manager/network/2022-07-01/routetables/version.go b/resource-manager/network/2022-07-01/routetables/version.go new file mode 100644 index 00000000000..3cfcbb77c86 --- /dev/null +++ b/resource-manager/network/2022-07-01/routetables/version.go @@ -0,0 +1,12 @@ +package routetables + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/routetables/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/scopeconnections/README.md b/resource-manager/network/2022-07-01/scopeconnections/README.md new file mode 100644 index 00000000000..134ebf1fd97 --- /dev/null +++ b/resource-manager/network/2022-07-01/scopeconnections/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/scopeconnections` Documentation + +The `scopeconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/scopeconnections" +``` + + +### Client Initialization + +```go +client := scopeconnections.NewScopeConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ScopeConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") + +payload := scopeconnections.ScopeConnection{ + // ... +} + + +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: `ScopeConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") + +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: `ScopeConnectionsClient.Get` + +```go +ctx := context.TODO() +id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") + +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: `ScopeConnectionsClient.List` + +```go +ctx := context.TODO() +id := scopeconnections.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +// alternatively `client.List(ctx, id, scopeconnections.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, scopeconnections.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/scopeconnections/client.go b/resource-manager/network/2022-07-01/scopeconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/client.go rename to resource-manager/network/2022-07-01/scopeconnections/client.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/constants.go b/resource-manager/network/2022-07-01/scopeconnections/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/constants.go rename to resource-manager/network/2022-07-01/scopeconnections/constants.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/id_networkmanager.go b/resource-manager/network/2022-07-01/scopeconnections/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/id_networkmanager.go rename to resource-manager/network/2022-07-01/scopeconnections/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/id_networkmanager_test.go b/resource-manager/network/2022-07-01/scopeconnections/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/scopeconnections/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/id_scopeconnection.go b/resource-manager/network/2022-07-01/scopeconnections/id_scopeconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/id_scopeconnection.go rename to resource-manager/network/2022-07-01/scopeconnections/id_scopeconnection.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/id_scopeconnection_test.go b/resource-manager/network/2022-07-01/scopeconnections/id_scopeconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/id_scopeconnection_test.go rename to resource-manager/network/2022-07-01/scopeconnections/id_scopeconnection_test.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/method_createorupdate.go b/resource-manager/network/2022-07-01/scopeconnections/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/method_createorupdate.go rename to resource-manager/network/2022-07-01/scopeconnections/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/method_delete.go b/resource-manager/network/2022-07-01/scopeconnections/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/method_delete.go rename to resource-manager/network/2022-07-01/scopeconnections/method_delete.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/method_get.go b/resource-manager/network/2022-07-01/scopeconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/method_get.go rename to resource-manager/network/2022-07-01/scopeconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/method_list.go b/resource-manager/network/2022-07-01/scopeconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/method_list.go rename to resource-manager/network/2022-07-01/scopeconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/model_scopeconnection.go b/resource-manager/network/2022-07-01/scopeconnections/model_scopeconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/model_scopeconnection.go rename to resource-manager/network/2022-07-01/scopeconnections/model_scopeconnection.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/model_scopeconnectionproperties.go b/resource-manager/network/2022-07-01/scopeconnections/model_scopeconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/model_scopeconnectionproperties.go rename to resource-manager/network/2022-07-01/scopeconnections/model_scopeconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/scopeconnections/predicates.go b/resource-manager/network/2022-07-01/scopeconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/scopeconnections/predicates.go rename to resource-manager/network/2022-07-01/scopeconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/scopeconnections/version.go b/resource-manager/network/2022-07-01/scopeconnections/version.go new file mode 100644 index 00000000000..f826434ba1d --- /dev/null +++ b/resource-manager/network/2022-07-01/scopeconnections/version.go @@ -0,0 +1,12 @@ +package scopeconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/scopeconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/securityadminconfigurations/README.md b/resource-manager/network/2022-07-01/securityadminconfigurations/README.md new file mode 100644 index 00000000000..de4fead8972 --- /dev/null +++ b/resource-manager/network/2022-07-01/securityadminconfigurations/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/securityadminconfigurations` Documentation + +The `securityadminconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/securityadminconfigurations" +``` + + +### Client Initialization + +```go +client := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SecurityAdminConfigurationsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") + +payload := securityadminconfigurations.SecurityAdminConfiguration{ + // ... +} + + +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: `SecurityAdminConfigurationsClient.Delete` + +```go +ctx := context.TODO() +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") + +if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `SecurityAdminConfigurationsClient.Get` + +```go +ctx := context.TODO() +id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") + +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: `SecurityAdminConfigurationsClient.List` + +```go +ctx := context.TODO() +id := securityadminconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") + +// alternatively `client.List(ctx, id, securityadminconfigurations.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, securityadminconfigurations.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/client.go b/resource-manager/network/2022-07-01/securityadminconfigurations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/client.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/client.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/constants.go b/resource-manager/network/2022-07-01/securityadminconfigurations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/constants.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/constants.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/id_networkmanager.go b/resource-manager/network/2022-07-01/securityadminconfigurations/id_networkmanager.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/id_networkmanager.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/id_networkmanager.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/id_networkmanager_test.go b/resource-manager/network/2022-07-01/securityadminconfigurations/id_networkmanager_test.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/id_networkmanager_test.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/id_networkmanager_test.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2022-07-01/securityadminconfigurations/id_securityadminconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/id_securityadminconfiguration.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/id_securityadminconfiguration.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2022-07-01/securityadminconfigurations/id_securityadminconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/id_securityadminconfiguration_test.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/id_securityadminconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/method_createorupdate.go b/resource-manager/network/2022-07-01/securityadminconfigurations/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/method_createorupdate.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/method_delete.go b/resource-manager/network/2022-07-01/securityadminconfigurations/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/method_delete.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/method_delete.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/method_get.go b/resource-manager/network/2022-07-01/securityadminconfigurations/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/method_get.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/method_get.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/method_list.go b/resource-manager/network/2022-07-01/securityadminconfigurations/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/method_list.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/method_list.go diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/model_securityadminconfiguration.go b/resource-manager/network/2022-07-01/securityadminconfigurations/model_securityadminconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/model_securityadminconfiguration.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/model_securityadminconfiguration.go diff --git a/resource-manager/network/2022-07-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go new file mode 100644 index 00000000000..ad8903223e2 --- /dev/null +++ b/resource-manager/network/2022-07-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go @@ -0,0 +1,10 @@ +package securityadminconfigurations + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityAdminConfigurationPropertiesFormat struct { + ApplyOnNetworkIntentPolicyBasedServices *[]NetworkIntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` + Description *string `json:"description,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/predicates.go b/resource-manager/network/2022-07-01/securityadminconfigurations/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/securityadminconfigurations/predicates.go rename to resource-manager/network/2022-07-01/securityadminconfigurations/predicates.go diff --git a/resource-manager/network/2022-07-01/securityadminconfigurations/version.go b/resource-manager/network/2022-07-01/securityadminconfigurations/version.go new file mode 100644 index 00000000000..77d3c7c0622 --- /dev/null +++ b/resource-manager/network/2022-07-01/securityadminconfigurations/version.go @@ -0,0 +1,12 @@ +package securityadminconfigurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/securityadminconfigurations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/securitypartnerproviders/README.md b/resource-manager/network/2022-07-01/securitypartnerproviders/README.md new file mode 100644 index 00000000000..b9392b8bb7a --- /dev/null +++ b/resource-manager/network/2022-07-01/securitypartnerproviders/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/securitypartnerproviders` Documentation + +The `securitypartnerproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/securitypartnerproviders" +``` + + +### Client Initialization + +```go +client := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SecurityPartnerProvidersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") + +payload := securitypartnerproviders.SecurityPartnerProvider{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SecurityPartnerProvidersClient.Delete` + +```go +ctx := context.TODO() +id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SecurityPartnerProvidersClient.Get` + +```go +ctx := context.TODO() +id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") + +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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.UpdateTags` + +```go +ctx := context.TODO() +id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") + +payload := securitypartnerproviders.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/network/2023-04-01/securitypartnerproviders/client.go b/resource-manager/network/2022-07-01/securitypartnerproviders/client.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/client.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/client.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/constants.go b/resource-manager/network/2022-07-01/securitypartnerproviders/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/constants.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/constants.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/id_securitypartnerprovider.go b/resource-manager/network/2022-07-01/securitypartnerproviders/id_securitypartnerprovider.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/id_securitypartnerprovider.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/id_securitypartnerprovider.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/id_securitypartnerprovider_test.go b/resource-manager/network/2022-07-01/securitypartnerproviders/id_securitypartnerprovider_test.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/id_securitypartnerprovider_test.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/id_securitypartnerprovider_test.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/method_createorupdate.go b/resource-manager/network/2022-07-01/securitypartnerproviders/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/method_createorupdate.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/method_delete.go b/resource-manager/network/2022-07-01/securitypartnerproviders/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/method_delete.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/method_delete.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/method_get.go b/resource-manager/network/2022-07-01/securitypartnerproviders/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/method_get.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/method_get.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/method_list.go b/resource-manager/network/2022-07-01/securitypartnerproviders/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/method_list.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/method_list.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/securitypartnerproviders/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/method_updatetags.go b/resource-manager/network/2022-07-01/securitypartnerproviders/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/method_updatetags.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/model_securitypartnerprovider.go b/resource-manager/network/2022-07-01/securitypartnerproviders/model_securitypartnerprovider.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/model_securitypartnerprovider.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/model_securitypartnerprovider.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go b/resource-manager/network/2022-07-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/model_subresource.go b/resource-manager/network/2022-07-01/securitypartnerproviders/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/model_subresource.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/model_subresource.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/model_tagsobject.go b/resource-manager/network/2022-07-01/securitypartnerproviders/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/model_tagsobject.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/predicates.go b/resource-manager/network/2022-07-01/securitypartnerproviders/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/securitypartnerproviders/predicates.go rename to resource-manager/network/2022-07-01/securitypartnerproviders/predicates.go diff --git a/resource-manager/network/2022-07-01/securitypartnerproviders/version.go b/resource-manager/network/2022-07-01/securitypartnerproviders/version.go new file mode 100644 index 00000000000..0ee95cb1c22 --- /dev/null +++ b/resource-manager/network/2022-07-01/securitypartnerproviders/version.go @@ -0,0 +1,12 @@ +package securitypartnerproviders + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/securitypartnerproviders/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/securityrules/README.md b/resource-manager/network/2022-07-01/securityrules/README.md new file mode 100644 index 00000000000..f1f766b246f --- /dev/null +++ b/resource-manager/network/2022-07-01/securityrules/README.md @@ -0,0 +1,115 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/securityrules` Documentation + +The `securityrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/securityrules" +``` + + +### Client Initialization + +```go +client := securityrules.NewSecurityRulesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SecurityRulesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") + +payload := securityrules.SecurityRule{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SecurityRulesClient.DefaultSecurityRulesGet` + +```go +ctx := context.TODO() +id := securityrules.NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue") + +read, err := client.DefaultSecurityRulesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SecurityRulesClient.DefaultSecurityRulesList` + +```go +ctx := context.TODO() +id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") + +// alternatively `client.DefaultSecurityRulesList(ctx, id)` can be used to do batched pagination +items, err := client.DefaultSecurityRulesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `SecurityRulesClient.Delete` + +```go +ctx := context.TODO() +id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SecurityRulesClient.Get` + +```go +ctx := context.TODO() +id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") + +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: `SecurityRulesClient.List` + +```go +ctx := context.TODO() +id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") + +// 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/network/2023-04-01/securityrules/client.go b/resource-manager/network/2022-07-01/securityrules/client.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/client.go rename to resource-manager/network/2022-07-01/securityrules/client.go diff --git a/resource-manager/network/2023-04-01/securityrules/constants.go b/resource-manager/network/2022-07-01/securityrules/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/constants.go rename to resource-manager/network/2022-07-01/securityrules/constants.go diff --git a/resource-manager/network/2023-04-01/securityrules/id_defaultsecurityrule.go b/resource-manager/network/2022-07-01/securityrules/id_defaultsecurityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/id_defaultsecurityrule.go rename to resource-manager/network/2022-07-01/securityrules/id_defaultsecurityrule.go diff --git a/resource-manager/network/2023-04-01/securityrules/id_defaultsecurityrule_test.go b/resource-manager/network/2022-07-01/securityrules/id_defaultsecurityrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/id_defaultsecurityrule_test.go rename to resource-manager/network/2022-07-01/securityrules/id_defaultsecurityrule_test.go diff --git a/resource-manager/network/2023-04-01/securityrules/id_networksecuritygroup.go b/resource-manager/network/2022-07-01/securityrules/id_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/id_networksecuritygroup.go rename to resource-manager/network/2022-07-01/securityrules/id_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/securityrules/id_networksecuritygroup_test.go b/resource-manager/network/2022-07-01/securityrules/id_networksecuritygroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/id_networksecuritygroup_test.go rename to resource-manager/network/2022-07-01/securityrules/id_networksecuritygroup_test.go diff --git a/resource-manager/network/2023-04-01/securityrules/id_securityrule.go b/resource-manager/network/2022-07-01/securityrules/id_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/id_securityrule.go rename to resource-manager/network/2022-07-01/securityrules/id_securityrule.go diff --git a/resource-manager/network/2023-04-01/securityrules/id_securityrule_test.go b/resource-manager/network/2022-07-01/securityrules/id_securityrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/id_securityrule_test.go rename to resource-manager/network/2022-07-01/securityrules/id_securityrule_test.go diff --git a/resource-manager/network/2023-04-01/securityrules/method_createorupdate.go b/resource-manager/network/2022-07-01/securityrules/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/method_createorupdate.go rename to resource-manager/network/2022-07-01/securityrules/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/securityrules/method_defaultsecurityrulesget.go b/resource-manager/network/2022-07-01/securityrules/method_defaultsecurityrulesget.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/method_defaultsecurityrulesget.go rename to resource-manager/network/2022-07-01/securityrules/method_defaultsecurityrulesget.go diff --git a/resource-manager/network/2023-04-01/securityrules/method_defaultsecurityruleslist.go b/resource-manager/network/2022-07-01/securityrules/method_defaultsecurityruleslist.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/method_defaultsecurityruleslist.go rename to resource-manager/network/2022-07-01/securityrules/method_defaultsecurityruleslist.go diff --git a/resource-manager/network/2023-04-01/securityrules/method_delete.go b/resource-manager/network/2022-07-01/securityrules/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/method_delete.go rename to resource-manager/network/2022-07-01/securityrules/method_delete.go diff --git a/resource-manager/network/2023-04-01/securityrules/method_get.go b/resource-manager/network/2022-07-01/securityrules/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/method_get.go rename to resource-manager/network/2022-07-01/securityrules/method_get.go diff --git a/resource-manager/network/2023-04-01/securityrules/method_list.go b/resource-manager/network/2022-07-01/securityrules/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/method_list.go rename to resource-manager/network/2022-07-01/securityrules/method_list.go diff --git a/resource-manager/network/2023-04-01/securityrules/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/securityrules/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/securityrules/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/securityrules/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/securityrules/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/securityrules/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/securityrules/model_securityrule.go b/resource-manager/network/2022-07-01/securityrules/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/model_securityrule.go rename to resource-manager/network/2022-07-01/securityrules/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/securityrules/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/securityrules/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..c6b46126d39 --- /dev/null +++ b/resource-manager/network/2022-07-01/securityrules/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package securityrules + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/securityrules/predicates.go b/resource-manager/network/2022-07-01/securityrules/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/securityrules/predicates.go rename to resource-manager/network/2022-07-01/securityrules/predicates.go diff --git a/resource-manager/network/2022-07-01/securityrules/version.go b/resource-manager/network/2022-07-01/securityrules/version.go new file mode 100644 index 00000000000..c6b87d6e3bb --- /dev/null +++ b/resource-manager/network/2022-07-01/securityrules/version.go @@ -0,0 +1,12 @@ +package securityrules + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/securityrules/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/README.md b/resource-manager/network/2022-07-01/serviceendpointpolicies/README.md new file mode 100644 index 00000000000..114f6a168aa --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/README.md @@ -0,0 +1,121 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/serviceendpointpolicies` Documentation + +The `serviceendpointpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/serviceendpointpolicies" +``` + + +### Client Initialization + +```go +client := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ServiceEndpointPoliciesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") + +payload := serviceendpointpolicies.ServiceEndpointPolicy{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ServiceEndpointPoliciesClient.Delete` + +```go +ctx := context.TODO() +id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ServiceEndpointPoliciesClient.Get` + +```go +ctx := context.TODO() +id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") + +read, err := client.Get(ctx, id, serviceendpointpolicies.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.UpdateTags` + +```go +ctx := context.TODO() +id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") + +payload := serviceendpointpolicies.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/network/2023-04-01/serviceendpointpolicies/client.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/client.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/client.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/client.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/constants.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/constants.go new file mode 100644 index 00000000000..27a348c9951 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/constants.go @@ -0,0 +1,1013 @@ +package serviceendpointpolicies + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/id_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/id_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/id_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/id_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/method_createorupdate.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/method_createorupdate.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/method_delete.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/method_delete.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/method_delete.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/method_get.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/method_get.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/method_get.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/method_list.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/method_list.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/method_list.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/method_updatetags.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/method_updatetags.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_backendaddresspool.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..bcc53963c2f --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package serviceendpointpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_ddossettings.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_ddossettings.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_delegation.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_delegation.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_delegation.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_flowlog.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_flowlog.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_inboundnatrule.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_iptag.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_iptag.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_iptag.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_natgateway.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_natgateway.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_natgatewaysku.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_natruleportmapping.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterface.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterface.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..a3fa855fe9e --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package serviceendpointpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpoint.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpoint.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..adaf1af02d5 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package serviceendpointpolicies + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkservice.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddress.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddress.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..ed5b245a223 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package serviceendpointpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_resourceset.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_resourceset.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_route.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_route.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_route.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_routetable.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_routetable.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_routetable.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_securityrule.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_securityrule.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..de4e783cf32 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package serviceendpointpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_subnet.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_subnet.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_subnet.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..77393873d44 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package serviceendpointpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_subresource.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_subresource.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_subresource.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_tagsobject.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_tagsobject.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/predicates.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicies/predicates.go rename to resource-manager/network/2022-07-01/serviceendpointpolicies/predicates.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicies/version.go b/resource-manager/network/2022-07-01/serviceendpointpolicies/version.go new file mode 100644 index 00000000000..e663bae7d91 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicies/version.go @@ -0,0 +1,12 @@ +package serviceendpointpolicies + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicies/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/README.md b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/README.md new file mode 100644 index 00000000000..f674b201a11 --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions` Documentation + +The `serviceendpointpolicydefinitions` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/serviceendpointpolicydefinitions" +``` + + +### Client Initialization + +```go +client := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") + +payload := serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinition{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Delete` + +```go +ctx := context.TODO() +id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Get` + +```go +ctx := context.TODO() +id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") + +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: `ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup` + +```go +ctx := context.TODO() +id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") + +// 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 +} +``` diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/client.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/client.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/client.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/client.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/constants.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/constants.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/constants.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_createorupdate.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_createorupdate.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_delete.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_delete.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_delete.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_get.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_get.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_get.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/predicates.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/predicates.go rename to resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/predicates.go diff --git a/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/version.go b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/version.go new file mode 100644 index 00000000000..e7abe16d06d --- /dev/null +++ b/resource-manager/network/2022-07-01/serviceendpointpolicydefinitions/version.go @@ -0,0 +1,12 @@ +package serviceendpointpolicydefinitions + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicydefinitions/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/servicetags/README.md b/resource-manager/network/2022-07-01/servicetags/README.md new file mode 100644 index 00000000000..4f31f42f49a --- /dev/null +++ b/resource-manager/network/2022-07-01/servicetags/README.md @@ -0,0 +1,53 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/servicetags` Documentation + +The `servicetags` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/servicetags" +``` + + +### Client Initialization + +```go +client := servicetags.NewServiceTagsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `ServiceTagsClient.ServiceTagInformationList` + +```go +ctx := context.TODO() +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination +items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `ServiceTagsClient.ServiceTagsList` + +```go +ctx := context.TODO() +id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +read, err := client.ServiceTagsList(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/network/2023-04-01/servicetags/client.go b/resource-manager/network/2022-07-01/servicetags/client.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/client.go rename to resource-manager/network/2022-07-01/servicetags/client.go diff --git a/resource-manager/network/2023-04-01/servicetags/id_location.go b/resource-manager/network/2022-07-01/servicetags/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/id_location.go rename to resource-manager/network/2022-07-01/servicetags/id_location.go diff --git a/resource-manager/network/2023-04-01/servicetags/id_location_test.go b/resource-manager/network/2022-07-01/servicetags/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/id_location_test.go rename to resource-manager/network/2022-07-01/servicetags/id_location_test.go diff --git a/resource-manager/network/2023-04-01/servicetags/method_servicetaginformationlist.go b/resource-manager/network/2022-07-01/servicetags/method_servicetaginformationlist.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/method_servicetaginformationlist.go rename to resource-manager/network/2022-07-01/servicetags/method_servicetaginformationlist.go diff --git a/resource-manager/network/2023-04-01/servicetags/method_servicetagslist.go b/resource-manager/network/2022-07-01/servicetags/method_servicetagslist.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/method_servicetagslist.go rename to resource-manager/network/2022-07-01/servicetags/method_servicetagslist.go diff --git a/resource-manager/network/2023-04-01/servicetags/model_servicetaginformation.go b/resource-manager/network/2022-07-01/servicetags/model_servicetaginformation.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/model_servicetaginformation.go rename to resource-manager/network/2022-07-01/servicetags/model_servicetaginformation.go diff --git a/resource-manager/network/2023-04-01/servicetags/model_servicetaginformationpropertiesformat.go b/resource-manager/network/2022-07-01/servicetags/model_servicetaginformationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/model_servicetaginformationpropertiesformat.go rename to resource-manager/network/2022-07-01/servicetags/model_servicetaginformationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/servicetags/model_servicetagslistresult.go b/resource-manager/network/2022-07-01/servicetags/model_servicetagslistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/model_servicetagslistresult.go rename to resource-manager/network/2022-07-01/servicetags/model_servicetagslistresult.go diff --git a/resource-manager/network/2023-04-01/servicetags/predicates.go b/resource-manager/network/2022-07-01/servicetags/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/servicetags/predicates.go rename to resource-manager/network/2022-07-01/servicetags/predicates.go diff --git a/resource-manager/network/2022-07-01/servicetags/version.go b/resource-manager/network/2022-07-01/servicetags/version.go new file mode 100644 index 00000000000..331e8ed2faa --- /dev/null +++ b/resource-manager/network/2022-07-01/servicetags/version.go @@ -0,0 +1,12 @@ +package servicetags + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/servicetags/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/staticmembers/README.md b/resource-manager/network/2022-07-01/staticmembers/README.md new file mode 100644 index 00000000000..013b2751299 --- /dev/null +++ b/resource-manager/network/2022-07-01/staticmembers/README.md @@ -0,0 +1,90 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/staticmembers` Documentation + +The `staticmembers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/staticmembers" +``` + + +### Client Initialization + +```go +client := staticmembers.NewStaticMembersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `StaticMembersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") + +payload := staticmembers.StaticMember{ + // ... +} + + +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: `StaticMembersClient.Delete` + +```go +ctx := context.TODO() +id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") + +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: `StaticMembersClient.Get` + +```go +ctx := context.TODO() +id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") + +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: `StaticMembersClient.List` + +```go +ctx := context.TODO() +id := staticmembers.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") + +// alternatively `client.List(ctx, id, staticmembers.DefaultListOperationOptions())` can be used to do batched pagination +items, err := client.ListComplete(ctx, id, staticmembers.DefaultListOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/staticmembers/client.go b/resource-manager/network/2022-07-01/staticmembers/client.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/client.go rename to resource-manager/network/2022-07-01/staticmembers/client.go diff --git a/resource-manager/network/2023-04-01/staticmembers/constants.go b/resource-manager/network/2022-07-01/staticmembers/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/constants.go rename to resource-manager/network/2022-07-01/staticmembers/constants.go diff --git a/resource-manager/network/2023-04-01/staticmembers/id_networkgroup.go b/resource-manager/network/2022-07-01/staticmembers/id_networkgroup.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/id_networkgroup.go rename to resource-manager/network/2022-07-01/staticmembers/id_networkgroup.go diff --git a/resource-manager/network/2023-04-01/staticmembers/id_networkgroup_test.go b/resource-manager/network/2022-07-01/staticmembers/id_networkgroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/id_networkgroup_test.go rename to resource-manager/network/2022-07-01/staticmembers/id_networkgroup_test.go diff --git a/resource-manager/network/2023-04-01/staticmembers/id_staticmember.go b/resource-manager/network/2022-07-01/staticmembers/id_staticmember.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/id_staticmember.go rename to resource-manager/network/2022-07-01/staticmembers/id_staticmember.go diff --git a/resource-manager/network/2023-04-01/staticmembers/id_staticmember_test.go b/resource-manager/network/2022-07-01/staticmembers/id_staticmember_test.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/id_staticmember_test.go rename to resource-manager/network/2022-07-01/staticmembers/id_staticmember_test.go diff --git a/resource-manager/network/2023-04-01/staticmembers/method_createorupdate.go b/resource-manager/network/2022-07-01/staticmembers/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/method_createorupdate.go rename to resource-manager/network/2022-07-01/staticmembers/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/staticmembers/method_delete.go b/resource-manager/network/2022-07-01/staticmembers/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/method_delete.go rename to resource-manager/network/2022-07-01/staticmembers/method_delete.go diff --git a/resource-manager/network/2023-04-01/staticmembers/method_get.go b/resource-manager/network/2022-07-01/staticmembers/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/method_get.go rename to resource-manager/network/2022-07-01/staticmembers/method_get.go diff --git a/resource-manager/network/2023-04-01/staticmembers/method_list.go b/resource-manager/network/2022-07-01/staticmembers/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/method_list.go rename to resource-manager/network/2022-07-01/staticmembers/method_list.go diff --git a/resource-manager/network/2023-04-01/staticmembers/model_staticmember.go b/resource-manager/network/2022-07-01/staticmembers/model_staticmember.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/model_staticmember.go rename to resource-manager/network/2022-07-01/staticmembers/model_staticmember.go diff --git a/resource-manager/network/2023-04-01/staticmembers/model_staticmemberproperties.go b/resource-manager/network/2022-07-01/staticmembers/model_staticmemberproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/model_staticmemberproperties.go rename to resource-manager/network/2022-07-01/staticmembers/model_staticmemberproperties.go diff --git a/resource-manager/network/2023-04-01/staticmembers/predicates.go b/resource-manager/network/2022-07-01/staticmembers/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/staticmembers/predicates.go rename to resource-manager/network/2022-07-01/staticmembers/predicates.go diff --git a/resource-manager/network/2022-07-01/staticmembers/version.go b/resource-manager/network/2022-07-01/staticmembers/version.go new file mode 100644 index 00000000000..304d37c2f97 --- /dev/null +++ b/resource-manager/network/2022-07-01/staticmembers/version.go @@ -0,0 +1,12 @@ +package staticmembers + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/staticmembers/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/subnets/README.md b/resource-manager/network/2022-07-01/subnets/README.md new file mode 100644 index 00000000000..12a752f9b57 --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/subnets` Documentation + +The `subnets` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/subnets" +``` + + +### Client Initialization + +```go +client := subnets.NewSubnetsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `SubnetsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +payload := subnets.Subnet{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `SubnetsClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `SubnetsClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +read, err := client.Get(ctx, id, subnets.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `SubnetsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +// 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/network/2023-04-01/subnets/client.go b/resource-manager/network/2022-07-01/subnets/client.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/client.go rename to resource-manager/network/2022-07-01/subnets/client.go diff --git a/resource-manager/network/2022-07-01/subnets/constants.go b/resource-manager/network/2022-07-01/subnets/constants.go new file mode 100644 index 00000000000..466a38e9386 --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/constants.go @@ -0,0 +1,1013 @@ +package subnets + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/subnets/method_createorupdate.go b/resource-manager/network/2022-07-01/subnets/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/method_createorupdate.go rename to resource-manager/network/2022-07-01/subnets/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/subnets/method_delete.go b/resource-manager/network/2022-07-01/subnets/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/method_delete.go rename to resource-manager/network/2022-07-01/subnets/method_delete.go diff --git a/resource-manager/network/2023-04-01/subnets/method_get.go b/resource-manager/network/2022-07-01/subnets/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/method_get.go rename to resource-manager/network/2022-07-01/subnets/method_get.go diff --git a/resource-manager/network/2023-04-01/subnets/method_list.go b/resource-manager/network/2022-07-01/subnets/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/method_list.go rename to resource-manager/network/2022-07-01/subnets/method_list.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/subnets/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/subnets/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/subnets/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/subnets/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/subnets/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/subnets/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/subnets/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_backendaddresspool.go b/resource-manager/network/2022-07-01/subnets/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/subnets/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/subnets/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..9e59212a304 --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package subnets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/subnets/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_ddossettings.go b/resource-manager/network/2022-07-01/subnets/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_ddossettings.go rename to resource-manager/network/2022-07-01/subnets/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/subnets/model_delegation.go b/resource-manager/network/2022-07-01/subnets/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_delegation.go rename to resource-manager/network/2022-07-01/subnets/model_delegation.go diff --git a/resource-manager/network/2023-04-01/subnets/model_flowlog.go b/resource-manager/network/2022-07-01/subnets/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_flowlog.go rename to resource-manager/network/2022-07-01/subnets/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/subnets/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/subnets/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/subnets/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/subnets/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/subnets/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/subnets/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/subnets/model_inboundnatrule.go b/resource-manager/network/2022-07-01/subnets/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/subnets/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/subnets/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_ipconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/subnets/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/subnets/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/subnets/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_iptag.go b/resource-manager/network/2022-07-01/subnets/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_iptag.go rename to resource-manager/network/2022-07-01/subnets/model_iptag.go diff --git a/resource-manager/network/2023-04-01/subnets/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/subnets/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/subnets/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_natgateway.go b/resource-manager/network/2022-07-01/subnets/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_natgateway.go rename to resource-manager/network/2022-07-01/subnets/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/subnets/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_natgatewaysku.go b/resource-manager/network/2022-07-01/subnets/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/subnets/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/subnets/model_natruleportmapping.go b/resource-manager/network/2022-07-01/subnets/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/subnets/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterface.go b/resource-manager/network/2022-07-01/subnets/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterface.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/subnets/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..32b6aab65eb --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package subnets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/subnets/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/subnets/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/subnets/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privateendpoint.go b/resource-manager/network/2022-07-01/subnets/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privateendpoint.go rename to resource-manager/network/2022-07-01/subnets/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/subnets/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/subnets/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/subnets/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/subnets/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..5633d4ca53d --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package subnets + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/subnets/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/subnets/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/subnets/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/subnets/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/subnets/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkservice.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/subnets/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/subnets/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_publicipaddress.go b/resource-manager/network/2022-07-01/subnets/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_publicipaddress.go rename to resource-manager/network/2022-07-01/subnets/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/subnets/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/subnets/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..2421df5949d --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package subnets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/subnets/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/subnets/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/subnets/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/subnets/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/subnets/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/subnets/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/subnets/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/subnets/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/subnets/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_resourceset.go b/resource-manager/network/2022-07-01/subnets/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_resourceset.go rename to resource-manager/network/2022-07-01/subnets/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/subnets/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/subnets/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/subnets/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/subnets/model_route.go b/resource-manager/network/2022-07-01/subnets/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_route.go rename to resource-manager/network/2022-07-01/subnets/model_route.go diff --git a/resource-manager/network/2023-04-01/subnets/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_routetable.go b/resource-manager/network/2022-07-01/subnets/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_routetable.go rename to resource-manager/network/2022-07-01/subnets/model_routetable.go diff --git a/resource-manager/network/2023-04-01/subnets/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_securityrule.go b/resource-manager/network/2022-07-01/subnets/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_securityrule.go rename to resource-manager/network/2022-07-01/subnets/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/subnets/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..3c89ecf91e2 --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package subnets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/subnets/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/subnets/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/model_subnet.go b/resource-manager/network/2022-07-01/subnets/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_subnet.go rename to resource-manager/network/2022-07-01/subnets/model_subnet.go diff --git a/resource-manager/network/2022-07-01/subnets/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..5b12d99f210 --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package subnets + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/subnets/model_subresource.go b/resource-manager/network/2022-07-01/subnets/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_subresource.go rename to resource-manager/network/2022-07-01/subnets/model_subresource.go diff --git a/resource-manager/network/2023-04-01/subnets/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/subnets/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/subnets/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/subnets/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/subnets/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/subnets/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/subnets/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/subnets/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/subnets/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/subnets/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/subnets/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/subnets/predicates.go b/resource-manager/network/2022-07-01/subnets/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/subnets/predicates.go rename to resource-manager/network/2022-07-01/subnets/predicates.go diff --git a/resource-manager/network/2022-07-01/subnets/version.go b/resource-manager/network/2022-07-01/subnets/version.go new file mode 100644 index 00000000000..699ef49e870 --- /dev/null +++ b/resource-manager/network/2022-07-01/subnets/version.go @@ -0,0 +1,12 @@ +package subnets + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/subnets/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/trafficanalytics/README.md b/resource-manager/network/2022-07-01/trafficanalytics/README.md new file mode 100644 index 00000000000..0de9ebe7015 --- /dev/null +++ b/resource-manager/network/2022-07-01/trafficanalytics/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/trafficanalytics` Documentation + +The `trafficanalytics` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/trafficanalytics" +``` + + +### Client Initialization + +```go +client := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `TrafficAnalyticsClient.NetworkWatchersGetFlowLogStatus` + +```go +ctx := context.TODO() +id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := trafficanalytics.FlowLogStatusParameters{ + // ... +} + + +if err := client.NetworkWatchersGetFlowLogStatusThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `TrafficAnalyticsClient.NetworkWatchersSetFlowLogConfiguration` + +```go +ctx := context.TODO() +id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") + +payload := trafficanalytics.FlowLogInformation{ + // ... +} + + +if err := client.NetworkWatchersSetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/trafficanalytics/client.go b/resource-manager/network/2022-07-01/trafficanalytics/client.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/client.go rename to resource-manager/network/2022-07-01/trafficanalytics/client.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/constants.go b/resource-manager/network/2022-07-01/trafficanalytics/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/constants.go rename to resource-manager/network/2022-07-01/trafficanalytics/constants.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/id_networkwatcher.go b/resource-manager/network/2022-07-01/trafficanalytics/id_networkwatcher.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/id_networkwatcher.go rename to resource-manager/network/2022-07-01/trafficanalytics/id_networkwatcher.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/id_networkwatcher_test.go b/resource-manager/network/2022-07-01/trafficanalytics/id_networkwatcher_test.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/id_networkwatcher_test.go rename to resource-manager/network/2022-07-01/trafficanalytics/id_networkwatcher_test.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go b/resource-manager/network/2022-07-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go rename to resource-manager/network/2022-07-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go b/resource-manager/network/2022-07-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go rename to resource-manager/network/2022-07-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/trafficanalytics/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_flowloginformation.go b/resource-manager/network/2022-07-01/trafficanalytics/model_flowloginformation.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_flowloginformation.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_flowloginformation.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_flowlogproperties.go b/resource-manager/network/2022-07-01/trafficanalytics/model_flowlogproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_flowlogproperties.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_flowlogproperties.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_flowlogstatusparameters.go b/resource-manager/network/2022-07-01/trafficanalytics/model_flowlogstatusparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_flowlogstatusparameters.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_flowlogstatusparameters.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/trafficanalytics/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/trafficanalytics/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/trafficanalytics/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/trafficanalytics/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/trafficanalytics/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2022-07-01/trafficanalytics/version.go b/resource-manager/network/2022-07-01/trafficanalytics/version.go new file mode 100644 index 00000000000..ac1c80f9e9f --- /dev/null +++ b/resource-manager/network/2022-07-01/trafficanalytics/version.go @@ -0,0 +1,12 @@ +package trafficanalytics + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/trafficanalytics/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/usages/README.md b/resource-manager/network/2022-07-01/usages/README.md new file mode 100644 index 00000000000..592637267ea --- /dev/null +++ b/resource-manager/network/2022-07-01/usages/README.md @@ -0,0 +1,37 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/usages` Documentation + +The `usages` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/usages" +``` + + +### Client Initialization + +```go +client := usages.NewUsagesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `UsagesClient.List` + +```go +ctx := context.TODO() +id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") + +// 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/network/2023-04-01/usages/client.go b/resource-manager/network/2022-07-01/usages/client.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/client.go rename to resource-manager/network/2022-07-01/usages/client.go diff --git a/resource-manager/network/2023-04-01/usages/constants.go b/resource-manager/network/2022-07-01/usages/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/constants.go rename to resource-manager/network/2022-07-01/usages/constants.go diff --git a/resource-manager/network/2023-04-01/usages/id_location.go b/resource-manager/network/2022-07-01/usages/id_location.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/id_location.go rename to resource-manager/network/2022-07-01/usages/id_location.go diff --git a/resource-manager/network/2023-04-01/usages/id_location_test.go b/resource-manager/network/2022-07-01/usages/id_location_test.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/id_location_test.go rename to resource-manager/network/2022-07-01/usages/id_location_test.go diff --git a/resource-manager/network/2023-04-01/usages/method_list.go b/resource-manager/network/2022-07-01/usages/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/method_list.go rename to resource-manager/network/2022-07-01/usages/method_list.go diff --git a/resource-manager/network/2023-04-01/usages/model_usage.go b/resource-manager/network/2022-07-01/usages/model_usage.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/model_usage.go rename to resource-manager/network/2022-07-01/usages/model_usage.go diff --git a/resource-manager/network/2023-04-01/usages/model_usagename.go b/resource-manager/network/2022-07-01/usages/model_usagename.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/model_usagename.go rename to resource-manager/network/2022-07-01/usages/model_usagename.go diff --git a/resource-manager/network/2023-04-01/usages/predicates.go b/resource-manager/network/2022-07-01/usages/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/usages/predicates.go rename to resource-manager/network/2022-07-01/usages/predicates.go diff --git a/resource-manager/network/2022-07-01/usages/version.go b/resource-manager/network/2022-07-01/usages/version.go new file mode 100644 index 00000000000..cc57fe40b34 --- /dev/null +++ b/resource-manager/network/2022-07-01/usages/version.go @@ -0,0 +1,12 @@ +package usages + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/usages/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/vipswap/README.md b/resource-manager/network/2022-07-01/vipswap/README.md new file mode 100644 index 00000000000..4c23f24dea8 --- /dev/null +++ b/resource-manager/network/2022-07-01/vipswap/README.md @@ -0,0 +1,69 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vipswap` Documentation + +The `vipswap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/vipswap" +``` + + +### Client Initialization + +```go +client := vipswap.NewVipSwapClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VipSwapClient.Create` + +```go +ctx := context.TODO() +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") + +payload := vipswap.SwapResource{ + // ... +} + + +if err := client.CreateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VipSwapClient.Get` + +```go +ctx := context.TODO() +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") + +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: `VipSwapClient.List` + +```go +ctx := context.TODO() +id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") + +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/network/2023-04-01/vipswap/client.go b/resource-manager/network/2022-07-01/vipswap/client.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/client.go rename to resource-manager/network/2022-07-01/vipswap/client.go diff --git a/resource-manager/network/2023-04-01/vipswap/constants.go b/resource-manager/network/2022-07-01/vipswap/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/constants.go rename to resource-manager/network/2022-07-01/vipswap/constants.go diff --git a/resource-manager/network/2023-04-01/vipswap/id_cloudservice.go b/resource-manager/network/2022-07-01/vipswap/id_cloudservice.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/id_cloudservice.go rename to resource-manager/network/2022-07-01/vipswap/id_cloudservice.go diff --git a/resource-manager/network/2023-04-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2022-07-01/vipswap/id_cloudservice_test.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/id_cloudservice_test.go rename to resource-manager/network/2022-07-01/vipswap/id_cloudservice_test.go diff --git a/resource-manager/network/2023-04-01/vipswap/method_create.go b/resource-manager/network/2022-07-01/vipswap/method_create.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/method_create.go rename to resource-manager/network/2022-07-01/vipswap/method_create.go diff --git a/resource-manager/network/2023-04-01/vipswap/method_get.go b/resource-manager/network/2022-07-01/vipswap/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/method_get.go rename to resource-manager/network/2022-07-01/vipswap/method_get.go diff --git a/resource-manager/network/2023-04-01/vipswap/method_list.go b/resource-manager/network/2022-07-01/vipswap/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/method_list.go rename to resource-manager/network/2022-07-01/vipswap/method_list.go diff --git a/resource-manager/network/2023-04-01/vipswap/model_swapresource.go b/resource-manager/network/2022-07-01/vipswap/model_swapresource.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/model_swapresource.go rename to resource-manager/network/2022-07-01/vipswap/model_swapresource.go diff --git a/resource-manager/network/2023-04-01/vipswap/model_swapresourcelistresult.go b/resource-manager/network/2022-07-01/vipswap/model_swapresourcelistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/model_swapresourcelistresult.go rename to resource-manager/network/2022-07-01/vipswap/model_swapresourcelistresult.go diff --git a/resource-manager/network/2023-04-01/vipswap/model_swapresourceproperties.go b/resource-manager/network/2022-07-01/vipswap/model_swapresourceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vipswap/model_swapresourceproperties.go rename to resource-manager/network/2022-07-01/vipswap/model_swapresourceproperties.go diff --git a/resource-manager/network/2022-07-01/vipswap/version.go b/resource-manager/network/2022-07-01/vipswap/version.go new file mode 100644 index 00000000000..b21cc29865a --- /dev/null +++ b/resource-manager/network/2022-07-01/vipswap/version.go @@ -0,0 +1,12 @@ +package vipswap + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vipswap/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualappliancesites/README.md b/resource-manager/network/2022-07-01/virtualappliancesites/README.md new file mode 100644 index 00000000000..35e1f1c0297 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualappliancesites/README.md @@ -0,0 +1,82 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualappliancesites` Documentation + +The `virtualappliancesites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualappliancesites" +``` + + +### Client Initialization + +```go +client := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualApplianceSitesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") + +payload := virtualappliancesites.VirtualApplianceSite{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualApplianceSitesClient.Delete` + +```go +ctx := context.TODO() +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualApplianceSitesClient.Get` + +```go +ctx := context.TODO() +id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") + +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: `VirtualApplianceSitesClient.List` + +```go +ctx := context.TODO() +id := virtualappliancesites.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") + +// 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/network/2023-04-01/virtualappliancesites/client.go b/resource-manager/network/2022-07-01/virtualappliancesites/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/client.go rename to resource-manager/network/2022-07-01/virtualappliancesites/client.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/constants.go b/resource-manager/network/2022-07-01/virtualappliancesites/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/constants.go rename to resource-manager/network/2022-07-01/virtualappliancesites/constants.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/id_networkvirtualappliance.go b/resource-manager/network/2022-07-01/virtualappliancesites/id_networkvirtualappliance.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/id_networkvirtualappliance.go rename to resource-manager/network/2022-07-01/virtualappliancesites/id_networkvirtualappliance.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/id_networkvirtualappliance_test.go b/resource-manager/network/2022-07-01/virtualappliancesites/id_networkvirtualappliance_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/id_networkvirtualappliance_test.go rename to resource-manager/network/2022-07-01/virtualappliancesites/id_networkvirtualappliance_test.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2022-07-01/virtualappliancesites/id_virtualappliancesite.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/id_virtualappliancesite.go rename to resource-manager/network/2022-07-01/virtualappliancesites/id_virtualappliancesite.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2022-07-01/virtualappliancesites/id_virtualappliancesite_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/id_virtualappliancesite_test.go rename to resource-manager/network/2022-07-01/virtualappliancesites/id_virtualappliancesite_test.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualappliancesites/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualappliancesites/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/method_delete.go b/resource-manager/network/2022-07-01/virtualappliancesites/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/method_delete.go rename to resource-manager/network/2022-07-01/virtualappliancesites/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/method_get.go b/resource-manager/network/2022-07-01/virtualappliancesites/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/method_get.go rename to resource-manager/network/2022-07-01/virtualappliancesites/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/method_list.go b/resource-manager/network/2022-07-01/virtualappliancesites/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/method_list.go rename to resource-manager/network/2022-07-01/virtualappliancesites/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/model_breakoutcategorypolicies.go b/resource-manager/network/2022-07-01/virtualappliancesites/model_breakoutcategorypolicies.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/model_breakoutcategorypolicies.go rename to resource-manager/network/2022-07-01/virtualappliancesites/model_breakoutcategorypolicies.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/model_office365policyproperties.go b/resource-manager/network/2022-07-01/virtualappliancesites/model_office365policyproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/model_office365policyproperties.go rename to resource-manager/network/2022-07-01/virtualappliancesites/model_office365policyproperties.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/model_virtualappliancesite.go b/resource-manager/network/2022-07-01/virtualappliancesites/model_virtualappliancesite.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/model_virtualappliancesite.go rename to resource-manager/network/2022-07-01/virtualappliancesites/model_virtualappliancesite.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/model_virtualappliancesiteproperties.go b/resource-manager/network/2022-07-01/virtualappliancesites/model_virtualappliancesiteproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/model_virtualappliancesiteproperties.go rename to resource-manager/network/2022-07-01/virtualappliancesites/model_virtualappliancesiteproperties.go diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/predicates.go b/resource-manager/network/2022-07-01/virtualappliancesites/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualappliancesites/predicates.go rename to resource-manager/network/2022-07-01/virtualappliancesites/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualappliancesites/version.go b/resource-manager/network/2022-07-01/virtualappliancesites/version.go new file mode 100644 index 00000000000..15871e6b59f --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualappliancesites/version.go @@ -0,0 +1,12 @@ +package virtualappliancesites + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualappliancesites/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualapplianceskus/README.md b/resource-manager/network/2022-07-01/virtualapplianceskus/README.md new file mode 100644 index 00000000000..6bebd8cf25b --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualapplianceskus/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualapplianceskus` Documentation + +The `virtualapplianceskus` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualapplianceskus" +``` + + +### Client Initialization + +```go +client := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualApplianceSkusClient.Get` + +```go +ctx := context.TODO() +id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue") + +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: `VirtualApplianceSkusClient.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 +} +``` diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/client.go b/resource-manager/network/2022-07-01/virtualapplianceskus/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/client.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/client.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2022-07-01/virtualapplianceskus/id_networkvirtualappliancesku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/id_networkvirtualappliancesku.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/id_networkvirtualappliancesku.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2022-07-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/method_get.go b/resource-manager/network/2022-07-01/virtualapplianceskus/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/method_get.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/method_list.go b/resource-manager/network/2022-07-01/virtualapplianceskus/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/method_list.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/model_networkvirtualappliancesku.go b/resource-manager/network/2022-07-01/virtualapplianceskus/model_networkvirtualappliancesku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/model_networkvirtualappliancesku.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/model_networkvirtualappliancesku.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go b/resource-manager/network/2022-07-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go b/resource-manager/network/2022-07-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/predicates.go b/resource-manager/network/2022-07-01/virtualapplianceskus/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualapplianceskus/predicates.go rename to resource-manager/network/2022-07-01/virtualapplianceskus/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualapplianceskus/version.go b/resource-manager/network/2022-07-01/virtualapplianceskus/version.go new file mode 100644 index 00000000000..2e83d358313 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualapplianceskus/version.go @@ -0,0 +1,12 @@ +package virtualapplianceskus + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualapplianceskus/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/README.md new file mode 100644 index 00000000000..302e8a92711 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/README.md @@ -0,0 +1,208 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections` Documentation + +The `virtualnetworkgatewayconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualnetworkgatewayconnections" +``` + + +### Client Initialization + +```go +client := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +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: `VirtualNetworkGatewayConnectionsClient.GetIkeSas` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +if err := client.GetIkeSasThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.GetSharedKey` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +read, err := client.GetSharedKey(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `VirtualNetworkGatewayConnectionsClient.ResetConnection` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +if err := client.ResetConnectionThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.ResetSharedKey` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ + // ... +} + + +if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.SetSharedKey` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ + // ... +} + + +if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.StartPacketCapture` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ + // ... +} + + +if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.StopPacketCapture` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ + // ... +} + + +if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewayConnectionsClient.UpdateTags` + +```go +ctx := context.TODO() +id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgatewayconnections.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/client.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/client.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/client.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/constants.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/constants.go new file mode 100644 index 00000000000..4223454aad8 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/constants.go @@ -0,0 +1,1137 @@ +package virtualnetworkgatewayconnections + +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 DhGroup string + +const ( + DhGroupDHGroupOne DhGroup = "DHGroup1" + DhGroupDHGroupOneFour DhGroup = "DHGroup14" + DhGroupDHGroupTwo DhGroup = "DHGroup2" + DhGroupDHGroupTwoFour DhGroup = "DHGroup24" + DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" + DhGroupECPThreeEightFour DhGroup = "ECP384" + DhGroupECPTwoFiveSix DhGroup = "ECP256" + DhGroupNone DhGroup = "None" +) + +func PossibleValuesForDhGroup() []string { + return []string{ + string(DhGroupDHGroupOne), + string(DhGroupDHGroupOneFour), + string(DhGroupDHGroupTwo), + string(DhGroupDHGroupTwoFour), + string(DhGroupDHGroupTwoZeroFourEight), + string(DhGroupECPThreeEightFour), + string(DhGroupECPTwoFiveSix), + string(DhGroupNone), + } +} + +func (s *DhGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDhGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDhGroup(input string) (*DhGroup, error) { + vals := map[string]DhGroup{ + "dhgroup1": DhGroupDHGroupOne, + "dhgroup14": DhGroupDHGroupOneFour, + "dhgroup2": DhGroupDHGroupTwo, + "dhgroup24": DhGroupDHGroupTwoFour, + "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, + "ecp384": DhGroupECPThreeEightFour, + "ecp256": DhGroupECPTwoFiveSix, + "none": DhGroupNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DhGroup(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPsecEncryption string + +const ( + IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" + IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" + IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" + IPsecEncryptionDES IPsecEncryption = "DES" + IPsecEncryptionDESThree IPsecEncryption = "DES3" + IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" + IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" + IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" + IPsecEncryptionNone IPsecEncryption = "None" +) + +func PossibleValuesForIPsecEncryption() []string { + return []string{ + string(IPsecEncryptionAESOneNineTwo), + string(IPsecEncryptionAESOneTwoEight), + string(IPsecEncryptionAESTwoFiveSix), + string(IPsecEncryptionDES), + string(IPsecEncryptionDESThree), + string(IPsecEncryptionGCMAESOneNineTwo), + string(IPsecEncryptionGCMAESOneTwoEight), + string(IPsecEncryptionGCMAESTwoFiveSix), + string(IPsecEncryptionNone), + } +} + +func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPsecEncryption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPsecEncryption(input string) (*IPsecEncryption, error) { + vals := map[string]IPsecEncryption{ + "aes192": IPsecEncryptionAESOneNineTwo, + "aes128": IPsecEncryptionAESOneTwoEight, + "aes256": IPsecEncryptionAESTwoFiveSix, + "des": IPsecEncryptionDES, + "des3": IPsecEncryptionDESThree, + "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, + "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, + "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, + "none": IPsecEncryptionNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPsecEncryption(input) + return &out, nil +} + +type IPsecIntegrity string + +const ( + IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" + IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" + IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" + IPsecIntegrityMDFive IPsecIntegrity = "MD5" + IPsecIntegritySHAOne IPsecIntegrity = "SHA1" + IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" +) + +func PossibleValuesForIPsecIntegrity() []string { + return []string{ + string(IPsecIntegrityGCMAESOneNineTwo), + string(IPsecIntegrityGCMAESOneTwoEight), + string(IPsecIntegrityGCMAESTwoFiveSix), + string(IPsecIntegrityMDFive), + string(IPsecIntegritySHAOne), + string(IPsecIntegritySHATwoFiveSix), + } +} + +func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPsecIntegrity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { + vals := map[string]IPsecIntegrity{ + "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, + "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, + "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, + "md5": IPsecIntegrityMDFive, + "sha1": IPsecIntegritySHAOne, + "sha256": IPsecIntegritySHATwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPsecIntegrity(input) + return &out, nil +} + +type IkeEncryption string + +const ( + IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" + IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" + IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" + IkeEncryptionDES IkeEncryption = "DES" + IkeEncryptionDESThree IkeEncryption = "DES3" + IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" + IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" +) + +func PossibleValuesForIkeEncryption() []string { + return []string{ + string(IkeEncryptionAESOneNineTwo), + string(IkeEncryptionAESOneTwoEight), + string(IkeEncryptionAESTwoFiveSix), + string(IkeEncryptionDES), + string(IkeEncryptionDESThree), + string(IkeEncryptionGCMAESOneTwoEight), + string(IkeEncryptionGCMAESTwoFiveSix), + } +} + +func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIkeEncryption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIkeEncryption(input string) (*IkeEncryption, error) { + vals := map[string]IkeEncryption{ + "aes192": IkeEncryptionAESOneNineTwo, + "aes128": IkeEncryptionAESOneTwoEight, + "aes256": IkeEncryptionAESTwoFiveSix, + "des": IkeEncryptionDES, + "des3": IkeEncryptionDESThree, + "gcmaes128": IkeEncryptionGCMAESOneTwoEight, + "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IkeEncryption(input) + return &out, nil +} + +type IkeIntegrity string + +const ( + IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" + IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" + IkeIntegrityMDFive IkeIntegrity = "MD5" + IkeIntegritySHAOne IkeIntegrity = "SHA1" + IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" + IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" +) + +func PossibleValuesForIkeIntegrity() []string { + return []string{ + string(IkeIntegrityGCMAESOneTwoEight), + string(IkeIntegrityGCMAESTwoFiveSix), + string(IkeIntegrityMDFive), + string(IkeIntegritySHAOne), + string(IkeIntegritySHAThreeEightFour), + string(IkeIntegritySHATwoFiveSix), + } +} + +func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIkeIntegrity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIkeIntegrity(input string) (*IkeIntegrity, error) { + vals := map[string]IkeIntegrity{ + "gcmaes128": IkeIntegrityGCMAESOneTwoEight, + "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, + "md5": IkeIntegrityMDFive, + "sha1": IkeIntegritySHAOne, + "sha384": IkeIntegritySHAThreeEightFour, + "sha256": IkeIntegritySHATwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IkeIntegrity(input) + return &out, nil +} + +type PfsGroup string + +const ( + PfsGroupECPThreeEightFour PfsGroup = "ECP384" + PfsGroupECPTwoFiveSix PfsGroup = "ECP256" + PfsGroupNone PfsGroup = "None" + PfsGroupPFSMM PfsGroup = "PFSMM" + PfsGroupPFSOne PfsGroup = "PFS1" + PfsGroupPFSOneFour PfsGroup = "PFS14" + PfsGroupPFSTwo PfsGroup = "PFS2" + PfsGroupPFSTwoFour PfsGroup = "PFS24" + PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" +) + +func PossibleValuesForPfsGroup() []string { + return []string{ + string(PfsGroupECPThreeEightFour), + string(PfsGroupECPTwoFiveSix), + string(PfsGroupNone), + string(PfsGroupPFSMM), + string(PfsGroupPFSOne), + string(PfsGroupPFSOneFour), + string(PfsGroupPFSTwo), + string(PfsGroupPFSTwoFour), + string(PfsGroupPFSTwoZeroFourEight), + } +} + +func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePfsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePfsGroup(input string) (*PfsGroup, error) { + vals := map[string]PfsGroup{ + "ecp384": PfsGroupECPThreeEightFour, + "ecp256": PfsGroupECPTwoFiveSix, + "none": PfsGroupNone, + "pfsmm": PfsGroupPFSMM, + "pfs1": PfsGroupPFSOne, + "pfs14": PfsGroupPFSOneFour, + "pfs2": PfsGroupPFSTwo, + "pfs24": PfsGroupPFSTwoFour, + "pfs2048": PfsGroupPFSTwoZeroFourEight, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PfsGroup(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionMode string + +const ( + VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" + VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" + VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { + return []string{ + string(VirtualNetworkGatewayConnectionModeDefault), + string(VirtualNetworkGatewayConnectionModeInitiatorOnly), + string(VirtualNetworkGatewayConnectionModeResponderOnly), + } +} + +func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { + vals := map[string]VirtualNetworkGatewayConnectionMode{ + "default": VirtualNetworkGatewayConnectionModeDefault, + "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, + "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionMode(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionProtocol string + +const ( + VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" + VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { + return []string{ + string(VirtualNetworkGatewayConnectionProtocolIKEvOne), + string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), + } +} + +func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { + vals := map[string]VirtualNetworkGatewayConnectionProtocol{ + "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, + "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionProtocol(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionStatus string + +const ( + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { + return []string{ + string(VirtualNetworkGatewayConnectionStatusConnected), + string(VirtualNetworkGatewayConnectionStatusConnecting), + string(VirtualNetworkGatewayConnectionStatusNotConnected), + string(VirtualNetworkGatewayConnectionStatusUnknown), + } +} + +func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { + vals := map[string]VirtualNetworkGatewayConnectionStatus{ + "connected": VirtualNetworkGatewayConnectionStatusConnected, + "connecting": VirtualNetworkGatewayConnectionStatusConnecting, + "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, + "unknown": VirtualNetworkGatewayConnectionStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionStatus(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionType string + +const ( + VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" + VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" + VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { + return []string{ + string(VirtualNetworkGatewayConnectionTypeExpressRoute), + string(VirtualNetworkGatewayConnectionTypeIPsec), + string(VirtualNetworkGatewayConnectionTypeVPNClient), + string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), + } +} + +func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { + vals := map[string]VirtualNetworkGatewayConnectionType{ + "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, + "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, + "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, + "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionType(input) + return &out, nil +} + +type VirtualNetworkGatewaySkuName string + +const ( + VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" + VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" + VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" + VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" + VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" + VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" + VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" + VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" + VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" + VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" + VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" + VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" + VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" + VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" + VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" + VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" + VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" +) + +func PossibleValuesForVirtualNetworkGatewaySkuName() []string { + return []string{ + string(VirtualNetworkGatewaySkuNameBasic), + string(VirtualNetworkGatewaySkuNameErGwOneAZ), + string(VirtualNetworkGatewaySkuNameErGwThreeAZ), + string(VirtualNetworkGatewaySkuNameErGwTwoAZ), + string(VirtualNetworkGatewaySkuNameHighPerformance), + string(VirtualNetworkGatewaySkuNameStandard), + string(VirtualNetworkGatewaySkuNameUltraPerformance), + string(VirtualNetworkGatewaySkuNameVpnGwFive), + string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), + string(VirtualNetworkGatewaySkuNameVpnGwFour), + string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), + string(VirtualNetworkGatewaySkuNameVpnGwOne), + string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), + string(VirtualNetworkGatewaySkuNameVpnGwThree), + string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), + string(VirtualNetworkGatewaySkuNameVpnGwTwo), + string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), + } +} + +func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { + vals := map[string]VirtualNetworkGatewaySkuName{ + "basic": VirtualNetworkGatewaySkuNameBasic, + "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, + "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, + "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, + "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, + "standard": VirtualNetworkGatewaySkuNameStandard, + "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, + "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, + "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, + "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, + "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, + "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, + "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, + "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, + "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, + "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, + "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewaySkuName(input) + return &out, nil +} + +type VirtualNetworkGatewaySkuTier string + +const ( + VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" + VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" + VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" + VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" + VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" + VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" + VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" + VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" + VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" + VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" + VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" + VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" + VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" + VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" + VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" + VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" + VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" +) + +func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { + return []string{ + string(VirtualNetworkGatewaySkuTierBasic), + string(VirtualNetworkGatewaySkuTierErGwOneAZ), + string(VirtualNetworkGatewaySkuTierErGwThreeAZ), + string(VirtualNetworkGatewaySkuTierErGwTwoAZ), + string(VirtualNetworkGatewaySkuTierHighPerformance), + string(VirtualNetworkGatewaySkuTierStandard), + string(VirtualNetworkGatewaySkuTierUltraPerformance), + string(VirtualNetworkGatewaySkuTierVpnGwFive), + string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), + string(VirtualNetworkGatewaySkuTierVpnGwFour), + string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), + string(VirtualNetworkGatewaySkuTierVpnGwOne), + string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), + string(VirtualNetworkGatewaySkuTierVpnGwThree), + string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), + string(VirtualNetworkGatewaySkuTierVpnGwTwo), + string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), + } +} + +func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewaySkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { + vals := map[string]VirtualNetworkGatewaySkuTier{ + "basic": VirtualNetworkGatewaySkuTierBasic, + "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, + "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, + "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, + "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, + "standard": VirtualNetworkGatewaySkuTierStandard, + "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, + "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, + "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, + "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, + "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, + "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, + "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, + "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, + "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, + "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, + "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewaySkuTier(input) + return &out, nil +} + +type VirtualNetworkGatewayType string + +const ( + VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" + VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" + VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" +) + +func PossibleValuesForVirtualNetworkGatewayType() []string { + return []string{ + string(VirtualNetworkGatewayTypeExpressRoute), + string(VirtualNetworkGatewayTypeLocalGateway), + string(VirtualNetworkGatewayTypeVpn), + } +} + +func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { + vals := map[string]VirtualNetworkGatewayType{ + "expressroute": VirtualNetworkGatewayTypeExpressRoute, + "localgateway": VirtualNetworkGatewayTypeLocalGateway, + "vpn": VirtualNetworkGatewayTypeVpn, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayType(input) + return &out, nil +} + +type VpnAuthenticationType string + +const ( + VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" + VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" + VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" +) + +func PossibleValuesForVpnAuthenticationType() []string { + return []string{ + string(VpnAuthenticationTypeAAD), + string(VpnAuthenticationTypeCertificate), + string(VpnAuthenticationTypeRadius), + } +} + +func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { + vals := map[string]VpnAuthenticationType{ + "aad": VpnAuthenticationTypeAAD, + "certificate": VpnAuthenticationTypeCertificate, + "radius": VpnAuthenticationTypeRadius, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnAuthenticationType(input) + return &out, nil +} + +type VpnClientProtocol string + +const ( + VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" + VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" + VpnClientProtocolSSTP VpnClientProtocol = "SSTP" +) + +func PossibleValuesForVpnClientProtocol() []string { + return []string{ + string(VpnClientProtocolIkeVTwo), + string(VpnClientProtocolOpenVPN), + string(VpnClientProtocolSSTP), + } +} + +func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnClientProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { + vals := map[string]VpnClientProtocol{ + "ikev2": VpnClientProtocolIkeVTwo, + "openvpn": VpnClientProtocolOpenVPN, + "sstp": VpnClientProtocolSSTP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnClientProtocol(input) + return &out, nil +} + +type VpnGatewayGeneration string + +const ( + VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" + VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" + VpnGatewayGenerationNone VpnGatewayGeneration = "None" +) + +func PossibleValuesForVpnGatewayGeneration() []string { + return []string{ + string(VpnGatewayGenerationGenerationOne), + string(VpnGatewayGenerationGenerationTwo), + string(VpnGatewayGenerationNone), + } +} + +func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnGatewayGeneration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { + vals := map[string]VpnGatewayGeneration{ + "generation1": VpnGatewayGenerationGenerationOne, + "generation2": VpnGatewayGenerationGenerationTwo, + "none": VpnGatewayGenerationNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnGatewayGeneration(input) + return &out, nil +} + +type VpnNatRuleMode string + +const ( + VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" + VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" +) + +func PossibleValuesForVpnNatRuleMode() []string { + return []string{ + string(VpnNatRuleModeEgressSnat), + string(VpnNatRuleModeIngressSnat), + } +} + +func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnNatRuleMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { + vals := map[string]VpnNatRuleMode{ + "egresssnat": VpnNatRuleModeEgressSnat, + "ingresssnat": VpnNatRuleModeIngressSnat, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnNatRuleMode(input) + return &out, nil +} + +type VpnNatRuleType string + +const ( + VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" + VpnNatRuleTypeStatic VpnNatRuleType = "Static" +) + +func PossibleValuesForVpnNatRuleType() []string { + return []string{ + string(VpnNatRuleTypeDynamic), + string(VpnNatRuleTypeStatic), + } +} + +func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnNatRuleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { + vals := map[string]VpnNatRuleType{ + "dynamic": VpnNatRuleTypeDynamic, + "static": VpnNatRuleTypeStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnNatRuleType(input) + return &out, nil +} + +type VpnPolicyMemberAttributeType string + +const ( + VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" + VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" + VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" +) + +func PossibleValuesForVpnPolicyMemberAttributeType() []string { + return []string{ + string(VpnPolicyMemberAttributeTypeAADGroupId), + string(VpnPolicyMemberAttributeTypeCertificateGroupId), + string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), + } +} + +func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnPolicyMemberAttributeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { + vals := map[string]VpnPolicyMemberAttributeType{ + "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, + "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, + "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnPolicyMemberAttributeType(input) + return &out, nil +} + +type VpnType string + +const ( + VpnTypePolicyBased VpnType = "PolicyBased" + VpnTypeRouteBased VpnType = "RouteBased" +) + +func PossibleValuesForVpnType() []string { + return []string{ + string(VpnTypePolicyBased), + string(VpnTypeRouteBased), + } +} + +func (s *VpnType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnType(input string) (*VpnType, error) { + vals := map[string]VpnType{ + "policybased": VpnTypePolicyBased, + "routebased": VpnTypeRouteBased, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnType(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/id_connection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/id_connection.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/id_connection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/id_connection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/id_connection_test.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/id_connection_test.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_delete.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_delete.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_get.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_get.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_getikesas.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_getikesas.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_getikesas.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_getikesas.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_getsharedkey.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_getsharedkey.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_getsharedkey.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_getsharedkey.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_list.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_list.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_resetconnection.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_resetconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_resetconnection.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_resetconnection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_resetsharedkey.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_resetsharedkey.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_resetsharedkey.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_resetsharedkey.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_setsharedkey.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_setsharedkey.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_setsharedkey.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_setsharedkey.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_startpacketcapture.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_startpacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_startpacketcapture.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_startpacketcapture.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_updatetags.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/method_updatetags.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_addressspace.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_addressspace.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_bgpsettings.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_bgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_bgpsettings.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_bgpsettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_radiusserver.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_radiusserver.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_radiusserver.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_radiusserver.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_subresource.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_subresource.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_tagsobject.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_tagsobject.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go new file mode 100644 index 00000000000..52ff615e5c7 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go @@ -0,0 +1,30 @@ +package virtualnetworkgatewayconnections + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkGatewayPropertiesFormat struct { + ActiveActive *bool `json:"activeActive,omitempty"` + AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` + AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` + BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` + CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` + DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` + EnableBgp *bool `json:"enableBgp,omitempty"` + EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` + EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` + EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` + GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` + GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` + IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` + InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` + NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` + VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` + VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` + VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` + VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` + VpnType *VpnType `json:"vpnType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/predicates.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/predicates.go rename to resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/version.go b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/version.go new file mode 100644 index 00000000000..694e3223d7f --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgatewayconnections/version.go @@ -0,0 +1,12 @@ +package virtualnetworkgatewayconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgatewayconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualnetworkgateways/README.md b/resource-manager/network/2022-07-01/virtualnetworkgateways/README.md new file mode 100644 index 00000000000..394746dfe9b --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgateways/README.md @@ -0,0 +1,414 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworkgateways` Documentation + +The `virtualnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualnetworkgateways" +``` + + +### Client Initialization + +```go +client := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.VirtualNetworkGateway{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVpnConnections` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.P2SVpnConnectionRequest{ + // ... +} + + +if err := client.DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.GenerateVpnProfile` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.VpnClientParameters{ + // ... +} + + +if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.Generatevpnclientpackage` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.VpnClientParameters{ + // ... +} + + +if err := client.GeneratevpnclientpackageThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +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: `VirtualNetworkGatewaysClient.GetAdvertisedRoutes` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.GetAdvertisedRoutesThenPoll(ctx, id, virtualnetworkgateways.DefaultGetAdvertisedRoutesOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.GetBgpPeerStatus` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.GetBgpPeerStatusThenPoll(ctx, id, virtualnetworkgateways.DefaultGetBgpPeerStatusOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.GetLearnedRoutes` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.GetVpnclientConnectionHealthThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientIPsecParameters` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.GetVpnclientIPsecParametersThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `VirtualNetworkGatewaysClient.ListConnections` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +// alternatively `client.ListConnections(ctx, id)` can be used to do batched pagination +items, err := client.ListConnectionsComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.Reset` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.ResetThenPoll(ctx, id, virtualnetworkgateways.DefaultResetOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.ResetVpnClientSharedKey` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +if err := client.ResetVpnClientSharedKeyThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.SetVpnclientIPsecParameters` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.VpnClientIPsecParameters{ + // ... +} + + +if err := client.SetVpnclientIPsecParametersThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.StartPacketCapture` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.VpnPacketCaptureStartParameters{ + // ... +} + + +if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.StopPacketCapture` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.VpnPacketCaptureStopParameters{ + // ... +} + + +if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.SupportedVpnDevices` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +read, err := client.SupportedVpnDevices(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +payload := virtualnetworkgateways.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") + +payload := virtualnetworkgateways.VirtualNetworkGatewayNatRule{ + // ... +} + + +if err := client.VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesDelete` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") + +if err := client.VirtualNetworkGatewayNatRulesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesGet` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") + +read, err := client.VirtualNetworkGatewayNatRulesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") + +// alternatively `client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx, id)` can be used to do batched pagination +items, err := client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworkGatewaysClient.VpnDeviceConfigurationScript` + +```go +ctx := context.TODO() +id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") + +payload := virtualnetworkgateways.VpnDeviceScriptParameters{ + // ... +} + + +read, err := client.VpnDeviceConfigurationScript(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/network/2023-04-01/virtualnetworkgateways/client.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/client.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/client.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkgateways/constants.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/constants.go new file mode 100644 index 00000000000..ae27a0a432f --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgateways/constants.go @@ -0,0 +1,1269 @@ +package virtualnetworkgateways + +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 AuthenticationMethod string + +const ( + AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" + AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" +) + +func PossibleValuesForAuthenticationMethod() []string { + return []string{ + string(AuthenticationMethodEAPMSCHAPvTwo), + string(AuthenticationMethodEAPTLS), + } +} + +func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { + vals := map[string]AuthenticationMethod{ + "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, + "eaptls": AuthenticationMethodEAPTLS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationMethod(input) + return &out, nil +} + +type BgpPeerState string + +const ( + BgpPeerStateConnected BgpPeerState = "Connected" + BgpPeerStateConnecting BgpPeerState = "Connecting" + BgpPeerStateIdle BgpPeerState = "Idle" + BgpPeerStateStopped BgpPeerState = "Stopped" + BgpPeerStateUnknown BgpPeerState = "Unknown" +) + +func PossibleValuesForBgpPeerState() []string { + return []string{ + string(BgpPeerStateConnected), + string(BgpPeerStateConnecting), + string(BgpPeerStateIdle), + string(BgpPeerStateStopped), + string(BgpPeerStateUnknown), + } +} + +func (s *BgpPeerState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseBgpPeerState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseBgpPeerState(input string) (*BgpPeerState, error) { + vals := map[string]BgpPeerState{ + "connected": BgpPeerStateConnected, + "connecting": BgpPeerStateConnecting, + "idle": BgpPeerStateIdle, + "stopped": BgpPeerStateStopped, + "unknown": BgpPeerStateUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := BgpPeerState(input) + return &out, nil +} + +type DhGroup string + +const ( + DhGroupDHGroupOne DhGroup = "DHGroup1" + DhGroupDHGroupOneFour DhGroup = "DHGroup14" + DhGroupDHGroupTwo DhGroup = "DHGroup2" + DhGroupDHGroupTwoFour DhGroup = "DHGroup24" + DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" + DhGroupECPThreeEightFour DhGroup = "ECP384" + DhGroupECPTwoFiveSix DhGroup = "ECP256" + DhGroupNone DhGroup = "None" +) + +func PossibleValuesForDhGroup() []string { + return []string{ + string(DhGroupDHGroupOne), + string(DhGroupDHGroupOneFour), + string(DhGroupDHGroupTwo), + string(DhGroupDHGroupTwoFour), + string(DhGroupDHGroupTwoZeroFourEight), + string(DhGroupECPThreeEightFour), + string(DhGroupECPTwoFiveSix), + string(DhGroupNone), + } +} + +func (s *DhGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDhGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDhGroup(input string) (*DhGroup, error) { + vals := map[string]DhGroup{ + "dhgroup1": DhGroupDHGroupOne, + "dhgroup14": DhGroupDHGroupOneFour, + "dhgroup2": DhGroupDHGroupTwo, + "dhgroup24": DhGroupDHGroupTwoFour, + "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, + "ecp384": DhGroupECPThreeEightFour, + "ecp256": DhGroupECPTwoFiveSix, + "none": DhGroupNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DhGroup(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPsecEncryption string + +const ( + IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" + IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" + IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" + IPsecEncryptionDES IPsecEncryption = "DES" + IPsecEncryptionDESThree IPsecEncryption = "DES3" + IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" + IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" + IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" + IPsecEncryptionNone IPsecEncryption = "None" +) + +func PossibleValuesForIPsecEncryption() []string { + return []string{ + string(IPsecEncryptionAESOneNineTwo), + string(IPsecEncryptionAESOneTwoEight), + string(IPsecEncryptionAESTwoFiveSix), + string(IPsecEncryptionDES), + string(IPsecEncryptionDESThree), + string(IPsecEncryptionGCMAESOneNineTwo), + string(IPsecEncryptionGCMAESOneTwoEight), + string(IPsecEncryptionGCMAESTwoFiveSix), + string(IPsecEncryptionNone), + } +} + +func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPsecEncryption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPsecEncryption(input string) (*IPsecEncryption, error) { + vals := map[string]IPsecEncryption{ + "aes192": IPsecEncryptionAESOneNineTwo, + "aes128": IPsecEncryptionAESOneTwoEight, + "aes256": IPsecEncryptionAESTwoFiveSix, + "des": IPsecEncryptionDES, + "des3": IPsecEncryptionDESThree, + "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, + "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, + "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, + "none": IPsecEncryptionNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPsecEncryption(input) + return &out, nil +} + +type IPsecIntegrity string + +const ( + IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" + IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" + IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" + IPsecIntegrityMDFive IPsecIntegrity = "MD5" + IPsecIntegritySHAOne IPsecIntegrity = "SHA1" + IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" +) + +func PossibleValuesForIPsecIntegrity() []string { + return []string{ + string(IPsecIntegrityGCMAESOneNineTwo), + string(IPsecIntegrityGCMAESOneTwoEight), + string(IPsecIntegrityGCMAESTwoFiveSix), + string(IPsecIntegrityMDFive), + string(IPsecIntegritySHAOne), + string(IPsecIntegritySHATwoFiveSix), + } +} + +func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPsecIntegrity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { + vals := map[string]IPsecIntegrity{ + "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, + "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, + "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, + "md5": IPsecIntegrityMDFive, + "sha1": IPsecIntegritySHAOne, + "sha256": IPsecIntegritySHATwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPsecIntegrity(input) + return &out, nil +} + +type IkeEncryption string + +const ( + IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" + IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" + IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" + IkeEncryptionDES IkeEncryption = "DES" + IkeEncryptionDESThree IkeEncryption = "DES3" + IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" + IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" +) + +func PossibleValuesForIkeEncryption() []string { + return []string{ + string(IkeEncryptionAESOneNineTwo), + string(IkeEncryptionAESOneTwoEight), + string(IkeEncryptionAESTwoFiveSix), + string(IkeEncryptionDES), + string(IkeEncryptionDESThree), + string(IkeEncryptionGCMAESOneTwoEight), + string(IkeEncryptionGCMAESTwoFiveSix), + } +} + +func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIkeEncryption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIkeEncryption(input string) (*IkeEncryption, error) { + vals := map[string]IkeEncryption{ + "aes192": IkeEncryptionAESOneNineTwo, + "aes128": IkeEncryptionAESOneTwoEight, + "aes256": IkeEncryptionAESTwoFiveSix, + "des": IkeEncryptionDES, + "des3": IkeEncryptionDESThree, + "gcmaes128": IkeEncryptionGCMAESOneTwoEight, + "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IkeEncryption(input) + return &out, nil +} + +type IkeIntegrity string + +const ( + IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" + IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" + IkeIntegrityMDFive IkeIntegrity = "MD5" + IkeIntegritySHAOne IkeIntegrity = "SHA1" + IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" + IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" +) + +func PossibleValuesForIkeIntegrity() []string { + return []string{ + string(IkeIntegrityGCMAESOneTwoEight), + string(IkeIntegrityGCMAESTwoFiveSix), + string(IkeIntegrityMDFive), + string(IkeIntegritySHAOne), + string(IkeIntegritySHAThreeEightFour), + string(IkeIntegritySHATwoFiveSix), + } +} + +func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIkeIntegrity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIkeIntegrity(input string) (*IkeIntegrity, error) { + vals := map[string]IkeIntegrity{ + "gcmaes128": IkeIntegrityGCMAESOneTwoEight, + "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, + "md5": IkeIntegrityMDFive, + "sha1": IkeIntegritySHAOne, + "sha384": IkeIntegritySHAThreeEightFour, + "sha256": IkeIntegritySHATwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IkeIntegrity(input) + return &out, nil +} + +type PfsGroup string + +const ( + PfsGroupECPThreeEightFour PfsGroup = "ECP384" + PfsGroupECPTwoFiveSix PfsGroup = "ECP256" + PfsGroupNone PfsGroup = "None" + PfsGroupPFSMM PfsGroup = "PFSMM" + PfsGroupPFSOne PfsGroup = "PFS1" + PfsGroupPFSOneFour PfsGroup = "PFS14" + PfsGroupPFSTwo PfsGroup = "PFS2" + PfsGroupPFSTwoFour PfsGroup = "PFS24" + PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" +) + +func PossibleValuesForPfsGroup() []string { + return []string{ + string(PfsGroupECPThreeEightFour), + string(PfsGroupECPTwoFiveSix), + string(PfsGroupNone), + string(PfsGroupPFSMM), + string(PfsGroupPFSOne), + string(PfsGroupPFSOneFour), + string(PfsGroupPFSTwo), + string(PfsGroupPFSTwoFour), + string(PfsGroupPFSTwoZeroFourEight), + } +} + +func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePfsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePfsGroup(input string) (*PfsGroup, error) { + vals := map[string]PfsGroup{ + "ecp384": PfsGroupECPThreeEightFour, + "ecp256": PfsGroupECPTwoFiveSix, + "none": PfsGroupNone, + "pfsmm": PfsGroupPFSMM, + "pfs1": PfsGroupPFSOne, + "pfs14": PfsGroupPFSOneFour, + "pfs2": PfsGroupPFSTwo, + "pfs24": PfsGroupPFSTwoFour, + "pfs2048": PfsGroupPFSTwoZeroFourEight, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PfsGroup(input) + return &out, nil +} + +type ProcessorArchitecture string + +const ( + ProcessorArchitectureAmdSixFour ProcessorArchitecture = "Amd64" + ProcessorArchitectureXEightSix ProcessorArchitecture = "X86" +) + +func PossibleValuesForProcessorArchitecture() []string { + return []string{ + string(ProcessorArchitectureAmdSixFour), + string(ProcessorArchitectureXEightSix), + } +} + +func (s *ProcessorArchitecture) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProcessorArchitecture(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProcessorArchitecture(input string) (*ProcessorArchitecture, error) { + vals := map[string]ProcessorArchitecture{ + "amd64": ProcessorArchitectureAmdSixFour, + "x86": ProcessorArchitectureXEightSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProcessorArchitecture(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionMode string + +const ( + VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" + VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" + VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { + return []string{ + string(VirtualNetworkGatewayConnectionModeDefault), + string(VirtualNetworkGatewayConnectionModeInitiatorOnly), + string(VirtualNetworkGatewayConnectionModeResponderOnly), + } +} + +func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { + vals := map[string]VirtualNetworkGatewayConnectionMode{ + "default": VirtualNetworkGatewayConnectionModeDefault, + "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, + "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionMode(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionProtocol string + +const ( + VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" + VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { + return []string{ + string(VirtualNetworkGatewayConnectionProtocolIKEvOne), + string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), + } +} + +func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { + vals := map[string]VirtualNetworkGatewayConnectionProtocol{ + "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, + "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionProtocol(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionStatus string + +const ( + VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" + VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" + VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" + VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { + return []string{ + string(VirtualNetworkGatewayConnectionStatusConnected), + string(VirtualNetworkGatewayConnectionStatusConnecting), + string(VirtualNetworkGatewayConnectionStatusNotConnected), + string(VirtualNetworkGatewayConnectionStatusUnknown), + } +} + +func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { + vals := map[string]VirtualNetworkGatewayConnectionStatus{ + "connected": VirtualNetworkGatewayConnectionStatusConnected, + "connecting": VirtualNetworkGatewayConnectionStatusConnecting, + "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, + "unknown": VirtualNetworkGatewayConnectionStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionStatus(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionType string + +const ( + VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" + VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" + VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" + VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { + return []string{ + string(VirtualNetworkGatewayConnectionTypeExpressRoute), + string(VirtualNetworkGatewayConnectionTypeIPsec), + string(VirtualNetworkGatewayConnectionTypeVPNClient), + string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), + } +} + +func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { + vals := map[string]VirtualNetworkGatewayConnectionType{ + "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, + "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, + "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, + "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionType(input) + return &out, nil +} + +type VirtualNetworkGatewaySkuName string + +const ( + VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" + VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" + VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" + VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" + VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" + VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" + VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" + VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" + VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" + VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" + VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" + VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" + VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" + VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" + VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" + VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" + VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" +) + +func PossibleValuesForVirtualNetworkGatewaySkuName() []string { + return []string{ + string(VirtualNetworkGatewaySkuNameBasic), + string(VirtualNetworkGatewaySkuNameErGwOneAZ), + string(VirtualNetworkGatewaySkuNameErGwThreeAZ), + string(VirtualNetworkGatewaySkuNameErGwTwoAZ), + string(VirtualNetworkGatewaySkuNameHighPerformance), + string(VirtualNetworkGatewaySkuNameStandard), + string(VirtualNetworkGatewaySkuNameUltraPerformance), + string(VirtualNetworkGatewaySkuNameVpnGwFive), + string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), + string(VirtualNetworkGatewaySkuNameVpnGwFour), + string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), + string(VirtualNetworkGatewaySkuNameVpnGwOne), + string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), + string(VirtualNetworkGatewaySkuNameVpnGwThree), + string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), + string(VirtualNetworkGatewaySkuNameVpnGwTwo), + string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), + } +} + +func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { + vals := map[string]VirtualNetworkGatewaySkuName{ + "basic": VirtualNetworkGatewaySkuNameBasic, + "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, + "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, + "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, + "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, + "standard": VirtualNetworkGatewaySkuNameStandard, + "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, + "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, + "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, + "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, + "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, + "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, + "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, + "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, + "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, + "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, + "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewaySkuName(input) + return &out, nil +} + +type VirtualNetworkGatewaySkuTier string + +const ( + VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" + VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" + VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" + VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" + VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" + VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" + VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" + VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" + VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" + VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" + VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" + VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" + VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" + VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" + VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" + VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" + VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" +) + +func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { + return []string{ + string(VirtualNetworkGatewaySkuTierBasic), + string(VirtualNetworkGatewaySkuTierErGwOneAZ), + string(VirtualNetworkGatewaySkuTierErGwThreeAZ), + string(VirtualNetworkGatewaySkuTierErGwTwoAZ), + string(VirtualNetworkGatewaySkuTierHighPerformance), + string(VirtualNetworkGatewaySkuTierStandard), + string(VirtualNetworkGatewaySkuTierUltraPerformance), + string(VirtualNetworkGatewaySkuTierVpnGwFive), + string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), + string(VirtualNetworkGatewaySkuTierVpnGwFour), + string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), + string(VirtualNetworkGatewaySkuTierVpnGwOne), + string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), + string(VirtualNetworkGatewaySkuTierVpnGwThree), + string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), + string(VirtualNetworkGatewaySkuTierVpnGwTwo), + string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), + } +} + +func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewaySkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { + vals := map[string]VirtualNetworkGatewaySkuTier{ + "basic": VirtualNetworkGatewaySkuTierBasic, + "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, + "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, + "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, + "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, + "standard": VirtualNetworkGatewaySkuTierStandard, + "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, + "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, + "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, + "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, + "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, + "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, + "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, + "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, + "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, + "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, + "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewaySkuTier(input) + return &out, nil +} + +type VirtualNetworkGatewayType string + +const ( + VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" + VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" + VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" +) + +func PossibleValuesForVirtualNetworkGatewayType() []string { + return []string{ + string(VirtualNetworkGatewayTypeExpressRoute), + string(VirtualNetworkGatewayTypeLocalGateway), + string(VirtualNetworkGatewayTypeVpn), + } +} + +func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { + vals := map[string]VirtualNetworkGatewayType{ + "expressroute": VirtualNetworkGatewayTypeExpressRoute, + "localgateway": VirtualNetworkGatewayTypeLocalGateway, + "vpn": VirtualNetworkGatewayTypeVpn, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayType(input) + return &out, nil +} + +type VpnAuthenticationType string + +const ( + VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" + VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" + VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" +) + +func PossibleValuesForVpnAuthenticationType() []string { + return []string{ + string(VpnAuthenticationTypeAAD), + string(VpnAuthenticationTypeCertificate), + string(VpnAuthenticationTypeRadius), + } +} + +func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { + vals := map[string]VpnAuthenticationType{ + "aad": VpnAuthenticationTypeAAD, + "certificate": VpnAuthenticationTypeCertificate, + "radius": VpnAuthenticationTypeRadius, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnAuthenticationType(input) + return &out, nil +} + +type VpnClientProtocol string + +const ( + VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" + VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" + VpnClientProtocolSSTP VpnClientProtocol = "SSTP" +) + +func PossibleValuesForVpnClientProtocol() []string { + return []string{ + string(VpnClientProtocolIkeVTwo), + string(VpnClientProtocolOpenVPN), + string(VpnClientProtocolSSTP), + } +} + +func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnClientProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { + vals := map[string]VpnClientProtocol{ + "ikev2": VpnClientProtocolIkeVTwo, + "openvpn": VpnClientProtocolOpenVPN, + "sstp": VpnClientProtocolSSTP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnClientProtocol(input) + return &out, nil +} + +type VpnGatewayGeneration string + +const ( + VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" + VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" + VpnGatewayGenerationNone VpnGatewayGeneration = "None" +) + +func PossibleValuesForVpnGatewayGeneration() []string { + return []string{ + string(VpnGatewayGenerationGenerationOne), + string(VpnGatewayGenerationGenerationTwo), + string(VpnGatewayGenerationNone), + } +} + +func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnGatewayGeneration(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { + vals := map[string]VpnGatewayGeneration{ + "generation1": VpnGatewayGenerationGenerationOne, + "generation2": VpnGatewayGenerationGenerationTwo, + "none": VpnGatewayGenerationNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnGatewayGeneration(input) + return &out, nil +} + +type VpnNatRuleMode string + +const ( + VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" + VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" +) + +func PossibleValuesForVpnNatRuleMode() []string { + return []string{ + string(VpnNatRuleModeEgressSnat), + string(VpnNatRuleModeIngressSnat), + } +} + +func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnNatRuleMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { + vals := map[string]VpnNatRuleMode{ + "egresssnat": VpnNatRuleModeEgressSnat, + "ingresssnat": VpnNatRuleModeIngressSnat, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnNatRuleMode(input) + return &out, nil +} + +type VpnNatRuleType string + +const ( + VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" + VpnNatRuleTypeStatic VpnNatRuleType = "Static" +) + +func PossibleValuesForVpnNatRuleType() []string { + return []string{ + string(VpnNatRuleTypeDynamic), + string(VpnNatRuleTypeStatic), + } +} + +func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnNatRuleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { + vals := map[string]VpnNatRuleType{ + "dynamic": VpnNatRuleTypeDynamic, + "static": VpnNatRuleTypeStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnNatRuleType(input) + return &out, nil +} + +type VpnPolicyMemberAttributeType string + +const ( + VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" + VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" + VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" +) + +func PossibleValuesForVpnPolicyMemberAttributeType() []string { + return []string{ + string(VpnPolicyMemberAttributeTypeAADGroupId), + string(VpnPolicyMemberAttributeTypeCertificateGroupId), + string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), + } +} + +func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnPolicyMemberAttributeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { + vals := map[string]VpnPolicyMemberAttributeType{ + "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, + "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, + "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnPolicyMemberAttributeType(input) + return &out, nil +} + +type VpnType string + +const ( + VpnTypePolicyBased VpnType = "PolicyBased" + VpnTypeRouteBased VpnType = "RouteBased" +) + +func PossibleValuesForVpnType() []string { + return []string{ + string(VpnTypePolicyBased), + string(VpnTypeRouteBased), + } +} + +func (s *VpnType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnType(input string) (*VpnType, error) { + vals := map[string]VpnType{ + "policybased": VpnTypePolicyBased, + "routebased": VpnTypeRouteBased, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnType(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/id_connection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/id_connection.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/id_connection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/id_connection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/id_connection_test.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/id_connection_test.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgateway.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgateway.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_delete.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_delete.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_generatevpnclientpackage.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_generatevpnclientpackage.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_generatevpnclientpackage.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_generatevpnclientpackage.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_generatevpnprofile.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_generatevpnprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_generatevpnprofile.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_generatevpnprofile.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_get.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_get.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_getadvertisedroutes.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_getadvertisedroutes.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_getadvertisedroutes.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_getadvertisedroutes.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_getbgppeerstatus.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_getbgppeerstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_getbgppeerstatus.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_getbgppeerstatus.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_getlearnedroutes.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_getlearnedroutes.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_getlearnedroutes.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_getlearnedroutes.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_list.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_list.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_listconnections.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_listconnections.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_listconnections.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_listconnections.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_reset.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_reset.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_reset.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_reset.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_startpacketcapture.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_startpacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_startpacketcapture.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_startpacketcapture.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_stoppacketcapture.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_stoppacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_stoppacketcapture.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_stoppacketcapture.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_supportedvpndevices.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_supportedvpndevices.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_supportedvpndevices.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_supportedvpndevices.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_updatetags.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_updatetags.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_addressspace.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_addressspace.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_bgppeerstatus.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_bgppeerstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_bgppeerstatus.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_bgppeerstatus.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_bgpsettings.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_bgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_bgpsettings.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_bgpsettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_gatewayroute.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_gatewayroute.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_gatewayroute.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_gatewayroute.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_gatewayroutelistresult.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_gatewayroutelistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_gatewayroutelistresult.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_gatewayroutelistresult.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_ipsecpolicy.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_ipsecpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_ipsecpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_ipsecpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_radiusserver.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_radiusserver.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_radiusserver.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_radiusserver.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_subresource.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_subresource.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_tagsobject.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_trafficselectorpolicy.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_trafficselectorpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_trafficselectorpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_trafficselectorpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_tunnelconnectionhealth.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_tunnelconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_tunnelconnectionhealth.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_tunnelconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgateway.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgateway.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go new file mode 100644 index 00000000000..99f3368d17e --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go @@ -0,0 +1,30 @@ +package virtualnetworkgateways + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkGatewayPropertiesFormat struct { + ActiveActive *bool `json:"activeActive,omitempty"` + AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` + AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` + BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` + CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` + DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` + EnableBgp *bool `json:"enableBgp,omitempty"` + EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` + EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` + EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` + GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` + GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` + IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` + InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` + NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` + VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` + VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` + VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` + VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` + VpnType *VpnType `json:"vpnType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientipsecparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientipsecparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientipsecparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientipsecparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrootcertificate.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrootcertificate.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrootcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpndevicescriptparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpndevicescriptparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpndevicescriptparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpndevicescriptparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnnatrulemapping.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnnatrulemapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnnatrulemapping.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnnatrulemapping.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/predicates.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkgateways/predicates.go rename to resource-manager/network/2022-07-01/virtualnetworkgateways/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkgateways/version.go b/resource-manager/network/2022-07-01/virtualnetworkgateways/version.go new file mode 100644 index 00000000000..28946902fed --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkgateways/version.go @@ -0,0 +1,12 @@ +package virtualnetworkgateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualnetworkpeerings/README.md b/resource-manager/network/2022-07-01/virtualnetworkpeerings/README.md new file mode 100644 index 00000000000..4074651b2dc --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkpeerings/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworkpeerings` Documentation + +The `virtualnetworkpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualnetworkpeerings" +``` + + +### Client Initialization + +```go +client := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkPeeringsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") + +payload := virtualnetworkpeerings.VirtualNetworkPeering{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload, virtualnetworkpeerings.DefaultCreateOrUpdateOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkPeeringsClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkPeeringsClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") + +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: `VirtualNetworkPeeringsClient.List` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +// 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/network/2023-04-01/virtualnetworkpeerings/client.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/client.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/client.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/constants.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/constants.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/constants.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/id_virtualnetworkpeering.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/id_virtualnetworkpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/id_virtualnetworkpeering.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/id_virtualnetworkpeering.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/method_delete.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/method_delete.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/method_get.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/method_get.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/method_list.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/method_list.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/model_addressspace.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/model_addressspace.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/model_subresource.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/model_subresource.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkencryption.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkencryption.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkencryption.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkencryption.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkpeering.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkpeering.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkpeering.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/predicates.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworkpeerings/predicates.go rename to resource-manager/network/2022-07-01/virtualnetworkpeerings/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualnetworkpeerings/version.go b/resource-manager/network/2022-07-01/virtualnetworkpeerings/version.go new file mode 100644 index 00000000000..db1a3bef982 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworkpeerings/version.go @@ -0,0 +1,12 @@ +package virtualnetworkpeerings + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkpeerings/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualnetworks/README.md b/resource-manager/network/2022-07-01/virtualnetworks/README.md new file mode 100644 index 00000000000..4328cb8f625 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/README.md @@ -0,0 +1,239 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworks` Documentation + +The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualnetworks" +``` + + +### Client Initialization + +```go +client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworksClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.VirtualNetwork{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +read, err := client.Get(ctx, id, virtualnetworks.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworksClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `VirtualNetworksClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.ResourceNavigationLinksList` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +// alternatively `client.ResourceNavigationLinksList(ctx, id)` can be used to do batched pagination +items, err := client.ResourceNavigationLinksListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.ServiceAssociationLinksList` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +// alternatively `client.ServiceAssociationLinksList(ctx, id)` can be used to do batched pagination +items, err := client.ServiceAssociationLinksListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.SubnetsPrepareNetworkPolicies` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +payload := virtualnetworks.PrepareNetworkPoliciesRequest{ + // ... +} + + +if err := client.SubnetsPrepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.SubnetsUnprepareNetworkPolicies` + +```go +ctx := context.TODO() +id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") + +payload := virtualnetworks.UnprepareNetworkPoliciesRequest{ + // ... +} + + +if err := client.SubnetsUnprepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworksClient.UpdateTags` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +payload := virtualnetworks.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 +} +``` + + +### Example Usage: `VirtualNetworksClient.VirtualNetworksCheckIPAddressAvailability` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +read, err := client.VirtualNetworksCheckIPAddressAvailability(ctx, id, virtualnetworks.DefaultVirtualNetworksCheckIPAddressAvailabilityOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualNetworksClient.VirtualNetworksListDdosProtectionStatus` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +// alternatively `client.VirtualNetworksListDdosProtectionStatus(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions())` can be used to do batched pagination +items, err := client.VirtualNetworksListDdosProtectionStatusComplete(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions()) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworksClient.VirtualNetworksListUsage` + +```go +ctx := context.TODO() +id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") + +// alternatively `client.VirtualNetworksListUsage(ctx, id)` can be used to do batched pagination +items, err := client.VirtualNetworksListUsageComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-05-01/virtualnetworks/client.go b/resource-manager/network/2022-07-01/virtualnetworks/client.go similarity index 100% rename from resource-manager/network/2023-05-01/virtualnetworks/client.go rename to resource-manager/network/2022-07-01/virtualnetworks/client.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/constants.go b/resource-manager/network/2022-07-01/virtualnetworks/constants.go new file mode 100644 index 00000000000..059e144a736 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/constants.go @@ -0,0 +1,1186 @@ +package virtualnetworks + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type IsWorkloadProtected string + +const ( + IsWorkloadProtectedFalse IsWorkloadProtected = "False" + IsWorkloadProtectedTrue IsWorkloadProtected = "True" +) + +func PossibleValuesForIsWorkloadProtected() []string { + return []string{ + string(IsWorkloadProtectedFalse), + string(IsWorkloadProtectedTrue), + } +} + +func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIsWorkloadProtected(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { + vals := map[string]IsWorkloadProtected{ + "false": IsWorkloadProtectedFalse, + "true": IsWorkloadProtectedTrue, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IsWorkloadProtected(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkEncryptionEnforcement string + +const ( + VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" + VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" +) + +func PossibleValuesForVirtualNetworkEncryptionEnforcement() []string { + return []string{ + string(VirtualNetworkEncryptionEnforcementAllowUnencrypted), + string(VirtualNetworkEncryptionEnforcementDropUnencrypted), + } +} + +func (s *VirtualNetworkEncryptionEnforcement) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkEncryptionEnforcement(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkEncryptionEnforcement(input string) (*VirtualNetworkEncryptionEnforcement, error) { + vals := map[string]VirtualNetworkEncryptionEnforcement{ + "allowunencrypted": VirtualNetworkEncryptionEnforcementAllowUnencrypted, + "dropunencrypted": VirtualNetworkEncryptionEnforcementDropUnencrypted, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkEncryptionEnforcement(input) + return &out, nil +} + +type VirtualNetworkPeeringLevel string + +const ( + VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" + VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" + VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" + VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" +) + +func PossibleValuesForVirtualNetworkPeeringLevel() []string { + return []string{ + string(VirtualNetworkPeeringLevelFullyInSync), + string(VirtualNetworkPeeringLevelLocalAndRemoteNotInSync), + string(VirtualNetworkPeeringLevelLocalNotInSync), + string(VirtualNetworkPeeringLevelRemoteNotInSync), + } +} + +func (s *VirtualNetworkPeeringLevel) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPeeringLevel(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPeeringLevel(input string) (*VirtualNetworkPeeringLevel, error) { + vals := map[string]VirtualNetworkPeeringLevel{ + "fullyinsync": VirtualNetworkPeeringLevelFullyInSync, + "localandremotenotinsync": VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, + "localnotinsync": VirtualNetworkPeeringLevelLocalNotInSync, + "remotenotinsync": VirtualNetworkPeeringLevelRemoteNotInSync, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPeeringLevel(input) + return &out, nil +} + +type VirtualNetworkPeeringState string + +const ( + VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" + VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" + VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" +) + +func PossibleValuesForVirtualNetworkPeeringState() []string { + return []string{ + string(VirtualNetworkPeeringStateConnected), + string(VirtualNetworkPeeringStateDisconnected), + string(VirtualNetworkPeeringStateInitiated), + } +} + +func (s *VirtualNetworkPeeringState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPeeringState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPeeringState(input string) (*VirtualNetworkPeeringState, error) { + vals := map[string]VirtualNetworkPeeringState{ + "connected": VirtualNetworkPeeringStateConnected, + "disconnected": VirtualNetworkPeeringStateDisconnected, + "initiated": VirtualNetworkPeeringStateInitiated, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPeeringState(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualnetworks/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_delete.go b/resource-manager/network/2022-07-01/virtualnetworks/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_delete.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_get.go b/resource-manager/network/2022-07-01/virtualnetworks/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_get.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_list.go b/resource-manager/network/2022-07-01/virtualnetworks/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_list.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_listall.go b/resource-manager/network/2022-07-01/virtualnetworks/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_listall.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_listall.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_resourcenavigationlinkslist.go b/resource-manager/network/2022-07-01/virtualnetworks/method_resourcenavigationlinkslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_resourcenavigationlinkslist.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_resourcenavigationlinkslist.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_serviceassociationlinkslist.go b/resource-manager/network/2022-07-01/virtualnetworks/method_serviceassociationlinkslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_serviceassociationlinkslist.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_serviceassociationlinkslist.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_subnetspreparenetworkpolicies.go b/resource-manager/network/2022-07-01/virtualnetworks/method_subnetspreparenetworkpolicies.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_subnetspreparenetworkpolicies.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_subnetspreparenetworkpolicies.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go b/resource-manager/network/2022-07-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_updatetags.go b/resource-manager/network/2022-07-01/virtualnetworks/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_updatetags.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go b/resource-manager/network/2022-07-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go b/resource-manager/network/2022-07-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/method_virtualnetworkslistusage.go b/resource-manager/network/2022-07-01/virtualnetworks/method_virtualnetworkslistusage.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/method_virtualnetworkslistusage.go rename to resource-manager/network/2022-07-01/virtualnetworks/method_virtualnetworkslistusage.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_addressspace.go b/resource-manager/network/2022-07-01/virtualnetworks/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_addressspace.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_backendaddresspool.go b/resource-manager/network/2022-07-01/virtualnetworks/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..af9dbefab27 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_ddossettings.go b/resource-manager/network/2022-07-01/virtualnetworks/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_ddossettings.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_delegation.go b/resource-manager/network/2022-07-01/virtualnetworks/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_delegation.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_delegation.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_dhcpoptions.go b/resource-manager/network/2022-07-01/virtualnetworks/model_dhcpoptions.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_dhcpoptions.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_dhcpoptions.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_flowlog.go b/resource-manager/network/2022-07-01/virtualnetworks/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_flowlog.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/virtualnetworks/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_inboundnatrule.go b/resource-manager/network/2022-07-01/virtualnetworks/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_ipaddressavailabilityresult.go b/resource-manager/network/2022-07-01/virtualnetworks/model_ipaddressavailabilityresult.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_ipaddressavailabilityresult.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_ipaddressavailabilityresult.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_ipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/virtualnetworks/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_iptag.go b/resource-manager/network/2022-07-01/virtualnetworks/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_iptag.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_iptag.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/virtualnetworks/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_natgateway.go b/resource-manager/network/2022-07-01/virtualnetworks/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_natgateway.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_natgatewaysku.go b/resource-manager/network/2022-07-01/virtualnetworks/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_natruleportmapping.go b/resource-manager/network/2022-07-01/virtualnetworks/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkintentpolicy.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkintentpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkintentpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkintentpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkintentpolicyconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkintentpolicyconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkintentpolicyconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkintentpolicyconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterface.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterface.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..d6b3046fc75 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_preparenetworkpoliciesrequest.go b/resource-manager/network/2022-07-01/virtualnetworks/model_preparenetworkpoliciesrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_preparenetworkpoliciesrequest.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_preparenetworkpoliciesrequest.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpoint.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privateendpoint.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..6e88d534cbf --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package virtualnetworks + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkservice.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddress.go b/resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddress.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..303439f2292 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_publicipddosprotectionstatusresult.go b/resource-manager/network/2022-07-01/virtualnetworks/model_publicipddosprotectionstatusresult.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_publicipddosprotectionstatusresult.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_publicipddosprotectionstatusresult.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/virtualnetworks/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_resourceset.go b/resource-manager/network/2022-07-01/virtualnetworks/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_resourceset.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/virtualnetworks/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_route.go b/resource-manager/network/2022-07-01/virtualnetworks/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_route.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_route.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_routetable.go b/resource-manager/network/2022-07-01/virtualnetworks/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_routetable.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_routetable.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_securityrule.go b/resource-manager/network/2022-07-01/virtualnetworks/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_securityrule.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..68166568c5f --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_subnet.go b/resource-manager/network/2022-07-01/virtualnetworks/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_subnet.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_subnet.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..211cc9803f7 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_subresource.go b/resource-manager/network/2022-07-01/virtualnetworks/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_subresource.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_tagsobject.go b/resource-manager/network/2022-07-01/virtualnetworks/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_tagsobject.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/virtualnetworks/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go b/resource-manager/network/2022-07-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetwork.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetwork.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetwork.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetwork.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkbgpcommunities.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkbgpcommunities.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkbgpcommunities.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkbgpcommunities.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkencryption.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkencryption.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkencryption.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkencryption.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpeering.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpeering.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpeering.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpropertiesformat.go new file mode 100644 index 00000000000..63bb4c78c65 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkpropertiesformat.go @@ -0,0 +1,20 @@ +package virtualnetworks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type VirtualNetworkPropertiesFormat struct { + AddressSpace *AddressSpace `json:"addressSpace,omitempty"` + BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` + DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` + DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` + EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` + EnableVMProtection *bool `json:"enableVmProtection,omitempty"` + Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` + FlowTimeoutInMinutes *int64 `json:"flowTimeoutInMinutes,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + Subnets *[]Subnet `json:"subnets,omitempty"` + VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkusage.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkusage.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkusage.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkusage.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkusagename.go b/resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkusagename.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkusagename.go rename to resource-manager/network/2022-07-01/virtualnetworks/model_virtualnetworkusagename.go diff --git a/resource-manager/network/2023-04-01/virtualnetworks/predicates.go b/resource-manager/network/2022-07-01/virtualnetworks/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworks/predicates.go rename to resource-manager/network/2022-07-01/virtualnetworks/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualnetworks/version.go b/resource-manager/network/2022-07-01/virtualnetworks/version.go new file mode 100644 index 00000000000..56e2fb7db0e --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworks/version.go @@ -0,0 +1,12 @@ +package virtualnetworks + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/README.md b/resource-manager/network/2022-07-01/virtualnetworktap/README.md new file mode 100644 index 00000000000..072b5ee3493 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/README.md @@ -0,0 +1,86 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworktap` Documentation + +The `virtualnetworktap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualnetworktap" +``` + + +### Client Initialization + +```go +client := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkTapClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") + +payload := virtualnetworktap.VirtualNetworkTap{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkTapClient.Delete` + +```go +ctx := context.TODO() +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualNetworkTapClient.Get` + +```go +ctx := context.TODO() +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") + +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: `VirtualNetworkTapClient.UpdateTags` + +```go +ctx := context.TODO() +id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") + +payload := virtualnetworktap.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/network/2023-04-01/virtualnetworktap/client.go b/resource-manager/network/2022-07-01/virtualnetworktap/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/client.go rename to resource-manager/network/2022-07-01/virtualnetworktap/client.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/constants.go b/resource-manager/network/2022-07-01/virtualnetworktap/constants.go new file mode 100644 index 00000000000..20a150eb595 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/constants.go @@ -0,0 +1,1013 @@ +package virtualnetworktap + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2022-07-01/virtualnetworktap/id_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/id_virtualnetworktap.go rename to resource-manager/network/2022-07-01/virtualnetworktap/id_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2022-07-01/virtualnetworktap/id_virtualnetworktap_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/id_virtualnetworktap_test.go rename to resource-manager/network/2022-07-01/virtualnetworktap/id_virtualnetworktap_test.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualnetworktap/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualnetworktap/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/method_delete.go b/resource-manager/network/2022-07-01/virtualnetworktap/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/method_delete.go rename to resource-manager/network/2022-07-01/virtualnetworktap/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/method_get.go b/resource-manager/network/2022-07-01/virtualnetworktap/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/method_get.go rename to resource-manager/network/2022-07-01/virtualnetworktap/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/method_updatetags.go b/resource-manager/network/2022-07-01/virtualnetworktap/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/method_updatetags.go rename to resource-manager/network/2022-07-01/virtualnetworktap/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_backendaddresspool.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..05a9e141168 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package virtualnetworktap + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_ddossettings.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_ddossettings.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_delegation.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_delegation.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_delegation.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_flowlog.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_flowlog.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_inboundnatrule.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_iptag.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_iptag.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_iptag.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_natgateway.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_natgateway.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_natgatewaysku.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_natruleportmapping.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterface.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterface.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..671ae2c84ba --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package virtualnetworktap + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpoint.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpoint.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..78130e93af9 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package virtualnetworktap + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkservice.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddress.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddress.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..838ec9ca294 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package virtualnetworktap + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_resourceset.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_resourceset.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_route.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_route.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_route.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_routetable.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_routetable.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_routetable.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_securityrule.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_securityrule.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..8e6a22e6f1d --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package virtualnetworktap + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_subnet.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_subnet.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_subnet.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..136008f68f6 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package virtualnetworktap + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_subresource.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_subresource.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_tagsobject.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_tagsobject.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktap/version.go b/resource-manager/network/2022-07-01/virtualnetworktap/version.go new file mode 100644 index 00000000000..13d62326aaa --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktap/version.go @@ -0,0 +1,12 @@ +package virtualnetworktap + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktap/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/README.md b/resource-manager/network/2022-07-01/virtualnetworktaps/README.md new file mode 100644 index 00000000000..f069612d056 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/README.md @@ -0,0 +1,55 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualnetworktaps` Documentation + +The `virtualnetworktaps` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualnetworktaps" +``` + + +### Client Initialization + +```go +client := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualNetworkTapsClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualNetworkTapsClient.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 +} +``` diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/client.go b/resource-manager/network/2022-07-01/virtualnetworktaps/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/client.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/client.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/constants.go b/resource-manager/network/2022-07-01/virtualnetworktaps/constants.go new file mode 100644 index 00000000000..ec6c33780c3 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/constants.go @@ -0,0 +1,1013 @@ +package virtualnetworktaps + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/method_listall.go b/resource-manager/network/2022-07-01/virtualnetworktaps/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/method_listall.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/method_listall.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualnetworktaps/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_backendaddresspool.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..e04619de88e --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package virtualnetworktaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_ddossettings.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_ddossettings.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_delegation.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_delegation.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_delegation.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_flowlog.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_flowlog.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_inboundnatrule.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_iptag.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_iptag.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_iptag.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_natgateway.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_natgateway.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_natgatewaysku.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_natruleportmapping.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterface.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterface.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..35b3ceb7ece --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package virtualnetworktaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpoint.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpoint.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..0db7d18e597 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package virtualnetworktaps + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkservice.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddress.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddress.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..b2dc7a62f43 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package virtualnetworktaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_resourceset.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_resourceset.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_route.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_route.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_route.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_routetable.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_routetable.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_routetable.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_securityrule.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_securityrule.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..f5eabcc3a8c --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package virtualnetworktaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_subnet.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_subnet.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_subnet.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..245215acd61 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package virtualnetworktaps + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_subresource.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_subresource.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/predicates.go b/resource-manager/network/2022-07-01/virtualnetworktaps/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualnetworktaps/predicates.go rename to resource-manager/network/2022-07-01/virtualnetworktaps/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualnetworktaps/version.go b/resource-manager/network/2022-07-01/virtualnetworktaps/version.go new file mode 100644 index 00000000000..637567ffafc --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualnetworktaps/version.go @@ -0,0 +1,12 @@ +package virtualnetworktaps + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktaps/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualrouterpeerings/README.md b/resource-manager/network/2022-07-01/virtualrouterpeerings/README.md new file mode 100644 index 00000000000..3887bef9f26 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualrouterpeerings/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualrouterpeerings` Documentation + +The `virtualrouterpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualrouterpeerings" +``` + + +### Client Initialization + +```go +client := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualRouterPeeringsClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") + +payload := virtualrouterpeerings.VirtualRouterPeering{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualRouterPeeringsClient.Delete` + +```go +ctx := context.TODO() +id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualRouterPeeringsClient.Get` + +```go +ctx := context.TODO() +id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") + +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: `VirtualRouterPeeringsClient.List` + +```go +ctx := context.TODO() +id := virtualrouterpeerings.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") + +// 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/network/2023-04-01/virtualrouterpeerings/client.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/client.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/client.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/constants.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/constants.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/constants.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/id_virtualrouter.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/id_virtualrouter.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/id_virtualrouter.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/id_virtualrouter.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/id_virtualrouter_test.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/id_virtualrouter_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/id_virtualrouter_test.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/id_virtualrouter_test.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/method_delete.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/method_delete.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/method_get.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/method_get.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/method_list.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/method_list.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/model_virtualrouterpeering.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/model_virtualrouterpeering.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/model_virtualrouterpeering.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/model_virtualrouterpeering.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/predicates.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouterpeerings/predicates.go rename to resource-manager/network/2022-07-01/virtualrouterpeerings/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualrouterpeerings/version.go b/resource-manager/network/2022-07-01/virtualrouterpeerings/version.go new file mode 100644 index 00000000000..5192e68dc68 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualrouterpeerings/version.go @@ -0,0 +1,12 @@ +package virtualrouterpeerings + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouterpeerings/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualrouters/README.md b/resource-manager/network/2022-07-01/virtualrouters/README.md new file mode 100644 index 00000000000..e835a057b0c --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualrouters/README.md @@ -0,0 +1,100 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualrouters` Documentation + +The `virtualrouters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualrouters" +``` + + +### Client Initialization + +```go +client := virtualrouters.NewVirtualRoutersClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualRoutersClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") + +payload := virtualrouters.VirtualRouter{ + // ... +} + + +if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualRoutersClient.Delete` + +```go +ctx := context.TODO() +id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualRoutersClient.Get` + +```go +ctx := context.TODO() +id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") + +read, err := client.Get(ctx, id, virtualrouters.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualRoutersClient.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: `VirtualRoutersClient.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 +} +``` diff --git a/resource-manager/network/2023-04-01/virtualrouters/client.go b/resource-manager/network/2022-07-01/virtualrouters/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/client.go rename to resource-manager/network/2022-07-01/virtualrouters/client.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/constants.go b/resource-manager/network/2022-07-01/virtualrouters/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/constants.go rename to resource-manager/network/2022-07-01/virtualrouters/constants.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/id_virtualrouter.go b/resource-manager/network/2022-07-01/virtualrouters/id_virtualrouter.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/id_virtualrouter.go rename to resource-manager/network/2022-07-01/virtualrouters/id_virtualrouter.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/id_virtualrouter_test.go b/resource-manager/network/2022-07-01/virtualrouters/id_virtualrouter_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/id_virtualrouter_test.go rename to resource-manager/network/2022-07-01/virtualrouters/id_virtualrouter_test.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/method_createorupdate.go b/resource-manager/network/2022-07-01/virtualrouters/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/method_createorupdate.go rename to resource-manager/network/2022-07-01/virtualrouters/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/method_delete.go b/resource-manager/network/2022-07-01/virtualrouters/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/method_delete.go rename to resource-manager/network/2022-07-01/virtualrouters/method_delete.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/method_get.go b/resource-manager/network/2022-07-01/virtualrouters/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/method_get.go rename to resource-manager/network/2022-07-01/virtualrouters/method_get.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/method_list.go b/resource-manager/network/2022-07-01/virtualrouters/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/method_list.go rename to resource-manager/network/2022-07-01/virtualrouters/method_list.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/method_listbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualrouters/method_listbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/method_listbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualrouters/method_listbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/model_subresource.go b/resource-manager/network/2022-07-01/virtualrouters/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/model_subresource.go rename to resource-manager/network/2022-07-01/virtualrouters/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/model_virtualrouter.go b/resource-manager/network/2022-07-01/virtualrouters/model_virtualrouter.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/model_virtualrouter.go rename to resource-manager/network/2022-07-01/virtualrouters/model_virtualrouter.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/model_virtualrouterpropertiesformat.go b/resource-manager/network/2022-07-01/virtualrouters/model_virtualrouterpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/model_virtualrouterpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualrouters/model_virtualrouterpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualrouters/predicates.go b/resource-manager/network/2022-07-01/virtualrouters/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualrouters/predicates.go rename to resource-manager/network/2022-07-01/virtualrouters/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualrouters/version.go b/resource-manager/network/2022-07-01/virtualrouters/version.go new file mode 100644 index 00000000000..f21bc668f7f --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualrouters/version.go @@ -0,0 +1,12 @@ +package virtualrouters + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouters/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/virtualwans/README.md b/resource-manager/network/2022-07-01/virtualwans/README.md new file mode 100644 index 00000000000..3b7fd39ede7 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/README.md @@ -0,0 +1,1406 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/virtualwans` Documentation + +The `virtualwans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/virtualwans" +``` + + +### Client Initialization + +```go +client := virtualwans.NewVirtualWANsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") + +payload := virtualwans.VpnServerConfigurationPolicyGroup{ + // ... +} + + +if err := client.ConfigurationPolicyGroupsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") + +if err := client.ConfigurationPolicyGroupsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsGet` + +```go +ctx := context.TODO() +id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") + +read, err := client.ConfigurationPolicyGroupsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsListByVpnServerConfiguration` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") + +// alternatively `client.ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx, id)` can be used to do batched pagination +items, err := client.ConfigurationPolicyGroupsListByVpnServerConfigurationComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.Generatevirtualwanvpnserverconfigurationvpnprofile` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +payload := virtualwans.VirtualWanVpnProfileParameters{ + // ... +} + + +if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.HubRouteTablesCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") + +payload := virtualwans.HubRouteTable{ + // ... +} + + +if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.HubRouteTablesDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") + +if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.HubRouteTablesGet` + +```go +ctx := context.TODO() +id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") + +read, err := client.HubRouteTablesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.HubRouteTablesList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.HubRouteTablesList(ctx, id)` can be used to do batched pagination +items, err := client.HubRouteTablesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") + +payload := virtualwans.HubVirtualNetworkConnection{ + // ... +} + + +if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") + +if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsGet` + +```go +ctx := context.TODO() +id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") + +read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.HubVirtualNetworkConnectionsList(ctx, id)` can be used to do batched pagination +items, err := client.HubVirtualNetworkConnectionsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.NatRulesCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") + +payload := virtualwans.VpnGatewayNatRule{ + // ... +} + + +if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.NatRulesDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") + +if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.NatRulesGet` + +```go +ctx := context.TODO() +id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") + +read, err := client.NatRulesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.NatRulesListByVpnGateway` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +// alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination +items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.P2sVpnGatewaysCreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +payload := virtualwans.P2SVpnGateway{ + // ... +} + + +if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.P2sVpnGatewaysDelete` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.P2sVpnGatewaysGet` + +```go +ctx := context.TODO() +id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") + +read, err := client.P2sVpnGatewaysGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.P2sVpnGatewaysList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.P2sVpnGatewaysList(ctx, id)` can be used to do batched pagination +items, err := client.P2sVpnGatewaysListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.P2sVpnGatewaysListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.P2sVpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.P2sVpnGatewaysListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.RouteMapsCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") + +payload := virtualwans.RouteMap{ + // ... +} + + +if err := client.RouteMapsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.RouteMapsDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") + +if err := client.RouteMapsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.RouteMapsGet` + +```go +ctx := context.TODO() +id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") + +read, err := client.RouteMapsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.RouteMapsList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.RouteMapsList(ctx, id)` can be used to do batched pagination +items, err := client.RouteMapsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.RoutingIntentCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") + +payload := virtualwans.RoutingIntent{ + // ... +} + + +if err := client.RoutingIntentCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.RoutingIntentDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") + +if err := client.RoutingIntentDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.RoutingIntentGet` + +```go +ctx := context.TODO() +id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") + +read, err := client.RoutingIntentGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.RoutingIntentList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.RoutingIntentList(ctx, id)` can be used to do batched pagination +items, err := client.RoutingIntentListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.SupportedSecurityProviders` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +read, err := client.SupportedSecurityProviders(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.UpdateTags` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +payload := virtualwans.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 +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionCreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") + +payload := virtualwans.BgpConnection{ + // ... +} + + +if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionDelete` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") + +if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionGet` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") + +read, err := client.VirtualHubBgpConnectionGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.VirtualHubBgpConnectionsList(ctx, id)` can be used to do batched pagination +items, err := client.VirtualHubBgpConnectionsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListAdvertisedRoutes` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") + +if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListLearnedRoutes` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") + +if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationCreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") + +payload := virtualwans.HubIPConfiguration{ + // ... +} + + +if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationDelete` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") + +if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationGet` + +```go +ctx := context.TODO() +id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") + +read, err := client.VirtualHubIPConfigurationGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.VirtualHubIPConfigurationList(ctx, id)` can be used to do batched pagination +items, err := client.VirtualHubIPConfigurationListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") + +payload := virtualwans.VirtualHubRouteTableV2{ + // ... +} + + +if err := client.VirtualHubRouteTableV2sCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") + +if err := client.VirtualHubRouteTableV2sDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") + +read, err := client.VirtualHubRouteTableV2sGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +// alternatively `client.VirtualHubRouteTableV2sList(ctx, id)` can be used to do batched pagination +items, err := client.VirtualHubRouteTableV2sListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +payload := virtualwans.VirtualHub{ + // ... +} + + +if err := client.VirtualHubsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +if err := client.VirtualHubsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +read, err := client.VirtualHubsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsGetEffectiveVirtualHubRoutes` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +payload := virtualwans.EffectiveRoutesParameters{ + // ... +} + + +if err := client.VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsGetInboundRoutes` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +payload := virtualwans.GetInboundRoutesParameters{ + // ... +} + + +if err := client.VirtualHubsGetInboundRoutesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsGetOutboundRoutes` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +payload := virtualwans.GetOutboundRoutesParameters{ + // ... +} + + +if err := client.VirtualHubsGetOutboundRoutesThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.VirtualHubsList(ctx, id)` can be used to do batched pagination +items, err := client.VirtualHubsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.VirtualHubsListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.VirtualHubsListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualHubsUpdateTags` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") + +payload := virtualwans.TagsObject{ + // ... +} + + +read, err := client.VirtualHubsUpdateTags(ctx, id, payload) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualWansCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +payload := virtualwans.VirtualWAN{ + // ... +} + + +if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualWansDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualWansGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +read, err := client.VirtualWansGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualWansList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.VirtualWansList(ctx, id)` can be used to do batched pagination +items, err := client.VirtualWansListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VirtualWansListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.VirtualWansListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.VirtualWansListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnConnectionsCreateOrUpdate` + +```go +ctx := context.TODO() +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") + +payload := virtualwans.VpnConnection{ + // ... +} + + +if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnConnectionsDelete` + +```go +ctx := context.TODO() +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") + +if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnConnectionsGet` + +```go +ctx := context.TODO() +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") + +read, err := client.VpnConnectionsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VpnConnectionsListByVpnGateway` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +// alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination +items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnConnectionsStartPacketCapture` + +```go +ctx := context.TODO() +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") + +payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ + // ... +} + + +if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnConnectionsStopPacketCapture` + +```go +ctx := context.TODO() +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") + +payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ + // ... +} + + +if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnGatewaysCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +payload := virtualwans.VpnGateway{ + // ... +} + + +if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnGatewaysDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnGatewaysGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +read, err := client.VpnGatewaysGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VpnGatewaysList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.VpnGatewaysList(ctx, id)` can be used to do batched pagination +items, err := client.VpnGatewaysListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnGatewaysListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.VpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.VpnGatewaysListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnLinkConnectionsGetIkeSas` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") + +if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnLinkConnectionsListByVpnConnection` + +```go +ctx := context.TODO() +id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") + +// alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination +items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnServerConfigurationsAssociatedWithVirtualWanList` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnServerConfigurationsCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") + +payload := virtualwans.VpnServerConfiguration{ + // ... +} + + +if err := client.VpnServerConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnServerConfigurationsDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") + +if err := client.VpnServerConfigurationsDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnServerConfigurationsGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") + +read, err := client.VpnServerConfigurationsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VpnServerConfigurationsList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.VpnServerConfigurationsList(ctx, id)` can be used to do batched pagination +items, err := client.VpnServerConfigurationsListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnServerConfigurationsListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.VpnServerConfigurationsListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.VpnServerConfigurationsListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSiteLinkConnectionsGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") + +read, err := client.VpnSiteLinkConnectionsGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSiteLinksGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue") + +read, err := client.VpnSiteLinksGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSiteLinksListByVpnSite` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") + +// alternatively `client.VpnSiteLinksListByVpnSite(ctx, id)` can be used to do batched pagination +items, err := client.VpnSiteLinksListByVpnSiteComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSitesConfigurationDownload` + +```go +ctx := context.TODO() +id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") + +payload := virtualwans.GetVpnSitesConfigurationRequest{ + // ... +} + + +if err := client.VpnSitesConfigurationDownloadThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSitesCreateOrUpdate` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") + +payload := virtualwans.VpnSite{ + // ... +} + + +if err := client.VpnSitesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSitesDelete` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") + +if err := client.VpnSitesDeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSitesGet` + +```go +ctx := context.TODO() +id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") + +read, err := client.VpnSitesGet(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSitesList` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.VpnSitesList(ctx, id)` can be used to do batched pagination +items, err := client.VpnSitesListComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VirtualWANsClient.VpnSitesListByResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.VpnSitesListByResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.VpnSitesListByResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/virtualwans/client.go b/resource-manager/network/2022-07-01/virtualwans/client.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/client.go rename to resource-manager/network/2022-07-01/virtualwans/client.go diff --git a/resource-manager/network/2022-07-01/virtualwans/constants.go b/resource-manager/network/2022-07-01/virtualwans/constants.go new file mode 100644 index 00000000000..ce5d770b21d --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/constants.go @@ -0,0 +1,2197 @@ +package virtualwans + +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 AuthenticationMethod string + +const ( + AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" + AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" +) + +func PossibleValuesForAuthenticationMethod() []string { + return []string{ + string(AuthenticationMethodEAPMSCHAPvTwo), + string(AuthenticationMethodEAPTLS), + } +} + +func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseAuthenticationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { + vals := map[string]AuthenticationMethod{ + "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, + "eaptls": AuthenticationMethodEAPTLS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := AuthenticationMethod(input) + return &out, nil +} + +type DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type DhGroup string + +const ( + DhGroupDHGroupOne DhGroup = "DHGroup1" + DhGroupDHGroupOneFour DhGroup = "DHGroup14" + DhGroupDHGroupTwo DhGroup = "DHGroup2" + DhGroupDHGroupTwoFour DhGroup = "DHGroup24" + DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" + DhGroupECPThreeEightFour DhGroup = "ECP384" + DhGroupECPTwoFiveSix DhGroup = "ECP256" + DhGroupNone DhGroup = "None" +) + +func PossibleValuesForDhGroup() []string { + return []string{ + string(DhGroupDHGroupOne), + string(DhGroupDHGroupOneFour), + string(DhGroupDHGroupTwo), + string(DhGroupDHGroupTwoFour), + string(DhGroupDHGroupTwoZeroFourEight), + string(DhGroupECPThreeEightFour), + string(DhGroupECPTwoFiveSix), + string(DhGroupNone), + } +} + +func (s *DhGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDhGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDhGroup(input string) (*DhGroup, error) { + vals := map[string]DhGroup{ + "dhgroup1": DhGroupDHGroupOne, + "dhgroup14": DhGroupDHGroupOneFour, + "dhgroup2": DhGroupDHGroupTwo, + "dhgroup24": DhGroupDHGroupTwoFour, + "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, + "ecp384": DhGroupECPThreeEightFour, + "ecp256": DhGroupECPTwoFiveSix, + "none": DhGroupNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DhGroup(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type HubBgpConnectionStatus string + +const ( + HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" + HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" + HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" + HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" +) + +func PossibleValuesForHubBgpConnectionStatus() []string { + return []string{ + string(HubBgpConnectionStatusConnected), + string(HubBgpConnectionStatusConnecting), + string(HubBgpConnectionStatusNotConnected), + string(HubBgpConnectionStatusUnknown), + } +} + +func (s *HubBgpConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHubBgpConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHubBgpConnectionStatus(input string) (*HubBgpConnectionStatus, error) { + vals := map[string]HubBgpConnectionStatus{ + "connected": HubBgpConnectionStatusConnected, + "connecting": HubBgpConnectionStatusConnecting, + "notconnected": HubBgpConnectionStatusNotConnected, + "unknown": HubBgpConnectionStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HubBgpConnectionStatus(input) + return &out, nil +} + +type HubRoutingPreference string + +const ( + HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" + HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" + HubRoutingPreferenceVpnGateway HubRoutingPreference = "VpnGateway" +) + +func PossibleValuesForHubRoutingPreference() []string { + return []string{ + string(HubRoutingPreferenceASPath), + string(HubRoutingPreferenceExpressRoute), + string(HubRoutingPreferenceVpnGateway), + } +} + +func (s *HubRoutingPreference) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseHubRoutingPreference(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseHubRoutingPreference(input string) (*HubRoutingPreference, error) { + vals := map[string]HubRoutingPreference{ + "aspath": HubRoutingPreferenceASPath, + "expressroute": HubRoutingPreferenceExpressRoute, + "vpngateway": HubRoutingPreferenceVpnGateway, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := HubRoutingPreference(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type IPsecEncryption string + +const ( + IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" + IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" + IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" + IPsecEncryptionDES IPsecEncryption = "DES" + IPsecEncryptionDESThree IPsecEncryption = "DES3" + IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" + IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" + IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" + IPsecEncryptionNone IPsecEncryption = "None" +) + +func PossibleValuesForIPsecEncryption() []string { + return []string{ + string(IPsecEncryptionAESOneNineTwo), + string(IPsecEncryptionAESOneTwoEight), + string(IPsecEncryptionAESTwoFiveSix), + string(IPsecEncryptionDES), + string(IPsecEncryptionDESThree), + string(IPsecEncryptionGCMAESOneNineTwo), + string(IPsecEncryptionGCMAESOneTwoEight), + string(IPsecEncryptionGCMAESTwoFiveSix), + string(IPsecEncryptionNone), + } +} + +func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPsecEncryption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPsecEncryption(input string) (*IPsecEncryption, error) { + vals := map[string]IPsecEncryption{ + "aes192": IPsecEncryptionAESOneNineTwo, + "aes128": IPsecEncryptionAESOneTwoEight, + "aes256": IPsecEncryptionAESTwoFiveSix, + "des": IPsecEncryptionDES, + "des3": IPsecEncryptionDESThree, + "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, + "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, + "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, + "none": IPsecEncryptionNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPsecEncryption(input) + return &out, nil +} + +type IPsecIntegrity string + +const ( + IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" + IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" + IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" + IPsecIntegrityMDFive IPsecIntegrity = "MD5" + IPsecIntegritySHAOne IPsecIntegrity = "SHA1" + IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" +) + +func PossibleValuesForIPsecIntegrity() []string { + return []string{ + string(IPsecIntegrityGCMAESOneNineTwo), + string(IPsecIntegrityGCMAESOneTwoEight), + string(IPsecIntegrityGCMAESTwoFiveSix), + string(IPsecIntegrityMDFive), + string(IPsecIntegritySHAOne), + string(IPsecIntegritySHATwoFiveSix), + } +} + +func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPsecIntegrity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { + vals := map[string]IPsecIntegrity{ + "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, + "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, + "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, + "md5": IPsecIntegrityMDFive, + "sha1": IPsecIntegritySHAOne, + "sha256": IPsecIntegritySHATwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPsecIntegrity(input) + return &out, nil +} + +type IkeEncryption string + +const ( + IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" + IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" + IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" + IkeEncryptionDES IkeEncryption = "DES" + IkeEncryptionDESThree IkeEncryption = "DES3" + IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" + IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" +) + +func PossibleValuesForIkeEncryption() []string { + return []string{ + string(IkeEncryptionAESOneNineTwo), + string(IkeEncryptionAESOneTwoEight), + string(IkeEncryptionAESTwoFiveSix), + string(IkeEncryptionDES), + string(IkeEncryptionDESThree), + string(IkeEncryptionGCMAESOneTwoEight), + string(IkeEncryptionGCMAESTwoFiveSix), + } +} + +func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIkeEncryption(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIkeEncryption(input string) (*IkeEncryption, error) { + vals := map[string]IkeEncryption{ + "aes192": IkeEncryptionAESOneNineTwo, + "aes128": IkeEncryptionAESOneTwoEight, + "aes256": IkeEncryptionAESTwoFiveSix, + "des": IkeEncryptionDES, + "des3": IkeEncryptionDESThree, + "gcmaes128": IkeEncryptionGCMAESOneTwoEight, + "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IkeEncryption(input) + return &out, nil +} + +type IkeIntegrity string + +const ( + IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" + IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" + IkeIntegrityMDFive IkeIntegrity = "MD5" + IkeIntegritySHAOne IkeIntegrity = "SHA1" + IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" + IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" +) + +func PossibleValuesForIkeIntegrity() []string { + return []string{ + string(IkeIntegrityGCMAESOneTwoEight), + string(IkeIntegrityGCMAESTwoFiveSix), + string(IkeIntegrityMDFive), + string(IkeIntegritySHAOne), + string(IkeIntegritySHAThreeEightFour), + string(IkeIntegritySHATwoFiveSix), + } +} + +func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIkeIntegrity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIkeIntegrity(input string) (*IkeIntegrity, error) { + vals := map[string]IkeIntegrity{ + "gcmaes128": IkeIntegrityGCMAESOneTwoEight, + "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, + "md5": IkeIntegrityMDFive, + "sha1": IkeIntegritySHAOne, + "sha384": IkeIntegritySHAThreeEightFour, + "sha256": IkeIntegritySHATwoFiveSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IkeIntegrity(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type NextStep string + +const ( + NextStepContinue NextStep = "Continue" + NextStepTerminate NextStep = "Terminate" + NextStepUnknown NextStep = "Unknown" +) + +func PossibleValuesForNextStep() []string { + return []string{ + string(NextStepContinue), + string(NextStepTerminate), + string(NextStepUnknown), + } +} + +func (s *NextStep) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNextStep(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNextStep(input string) (*NextStep, error) { + vals := map[string]NextStep{ + "continue": NextStepContinue, + "terminate": NextStepTerminate, + "unknown": NextStepUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NextStep(input) + return &out, nil +} + +type OfficeTrafficCategory string + +const ( + OfficeTrafficCategoryAll OfficeTrafficCategory = "All" + OfficeTrafficCategoryNone OfficeTrafficCategory = "None" + OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" + OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" +) + +func PossibleValuesForOfficeTrafficCategory() []string { + return []string{ + string(OfficeTrafficCategoryAll), + string(OfficeTrafficCategoryNone), + string(OfficeTrafficCategoryOptimize), + string(OfficeTrafficCategoryOptimizeAndAllow), + } +} + +func (s *OfficeTrafficCategory) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOfficeTrafficCategory(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOfficeTrafficCategory(input string) (*OfficeTrafficCategory, error) { + vals := map[string]OfficeTrafficCategory{ + "all": OfficeTrafficCategoryAll, + "none": OfficeTrafficCategoryNone, + "optimize": OfficeTrafficCategoryOptimize, + "optimizeandallow": OfficeTrafficCategoryOptimizeAndAllow, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OfficeTrafficCategory(input) + return &out, nil +} + +type PfsGroup string + +const ( + PfsGroupECPThreeEightFour PfsGroup = "ECP384" + PfsGroupECPTwoFiveSix PfsGroup = "ECP256" + PfsGroupNone PfsGroup = "None" + PfsGroupPFSMM PfsGroup = "PFSMM" + PfsGroupPFSOne PfsGroup = "PFS1" + PfsGroupPFSOneFour PfsGroup = "PFS14" + PfsGroupPFSTwo PfsGroup = "PFS2" + PfsGroupPFSTwoFour PfsGroup = "PFS24" + PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" +) + +func PossibleValuesForPfsGroup() []string { + return []string{ + string(PfsGroupECPThreeEightFour), + string(PfsGroupECPTwoFiveSix), + string(PfsGroupNone), + string(PfsGroupPFSMM), + string(PfsGroupPFSOne), + string(PfsGroupPFSOneFour), + string(PfsGroupPFSTwo), + string(PfsGroupPFSTwoFour), + string(PfsGroupPFSTwoZeroFourEight), + } +} + +func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePfsGroup(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePfsGroup(input string) (*PfsGroup, error) { + vals := map[string]PfsGroup{ + "ecp384": PfsGroupECPThreeEightFour, + "ecp256": PfsGroupECPTwoFiveSix, + "none": PfsGroupNone, + "pfsmm": PfsGroupPFSMM, + "pfs1": PfsGroupPFSOne, + "pfs14": PfsGroupPFSOneFour, + "pfs2": PfsGroupPFSTwo, + "pfs24": PfsGroupPFSTwoFour, + "pfs2048": PfsGroupPFSTwoZeroFourEight, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PfsGroup(input) + return &out, nil +} + +type PreferredRoutingGateway string + +const ( + PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" + PreferredRoutingGatewayNone PreferredRoutingGateway = "None" + PreferredRoutingGatewayVpnGateway PreferredRoutingGateway = "VpnGateway" +) + +func PossibleValuesForPreferredRoutingGateway() []string { + return []string{ + string(PreferredRoutingGatewayExpressRoute), + string(PreferredRoutingGatewayNone), + string(PreferredRoutingGatewayVpnGateway), + } +} + +func (s *PreferredRoutingGateway) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePreferredRoutingGateway(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePreferredRoutingGateway(input string) (*PreferredRoutingGateway, error) { + vals := map[string]PreferredRoutingGateway{ + "expressroute": PreferredRoutingGatewayExpressRoute, + "none": PreferredRoutingGatewayNone, + "vpngateway": PreferredRoutingGatewayVpnGateway, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PreferredRoutingGateway(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteMapActionType string + +const ( + RouteMapActionTypeAdd RouteMapActionType = "Add" + RouteMapActionTypeDrop RouteMapActionType = "Drop" + RouteMapActionTypeRemove RouteMapActionType = "Remove" + RouteMapActionTypeReplace RouteMapActionType = "Replace" + RouteMapActionTypeUnknown RouteMapActionType = "Unknown" +) + +func PossibleValuesForRouteMapActionType() []string { + return []string{ + string(RouteMapActionTypeAdd), + string(RouteMapActionTypeDrop), + string(RouteMapActionTypeRemove), + string(RouteMapActionTypeReplace), + string(RouteMapActionTypeUnknown), + } +} + +func (s *RouteMapActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteMapActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteMapActionType(input string) (*RouteMapActionType, error) { + vals := map[string]RouteMapActionType{ + "add": RouteMapActionTypeAdd, + "drop": RouteMapActionTypeDrop, + "remove": RouteMapActionTypeRemove, + "replace": RouteMapActionTypeReplace, + "unknown": RouteMapActionTypeUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteMapActionType(input) + return &out, nil +} + +type RouteMapMatchCondition string + +const ( + RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" + RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" + RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" + RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" + RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" +) + +func PossibleValuesForRouteMapMatchCondition() []string { + return []string{ + string(RouteMapMatchConditionContains), + string(RouteMapMatchConditionEquals), + string(RouteMapMatchConditionNotContains), + string(RouteMapMatchConditionNotEquals), + string(RouteMapMatchConditionUnknown), + } +} + +func (s *RouteMapMatchCondition) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteMapMatchCondition(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteMapMatchCondition(input string) (*RouteMapMatchCondition, error) { + vals := map[string]RouteMapMatchCondition{ + "contains": RouteMapMatchConditionContains, + "equals": RouteMapMatchConditionEquals, + "notcontains": RouteMapMatchConditionNotContains, + "notequals": RouteMapMatchConditionNotEquals, + "unknown": RouteMapMatchConditionUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteMapMatchCondition(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type RoutingState string + +const ( + RoutingStateFailed RoutingState = "Failed" + RoutingStateNone RoutingState = "None" + RoutingStateProvisioned RoutingState = "Provisioned" + RoutingStateProvisioning RoutingState = "Provisioning" +) + +func PossibleValuesForRoutingState() []string { + return []string{ + string(RoutingStateFailed), + string(RoutingStateNone), + string(RoutingStateProvisioned), + string(RoutingStateProvisioning), + } +} + +func (s *RoutingState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRoutingState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRoutingState(input string) (*RoutingState, error) { + vals := map[string]RoutingState{ + "failed": RoutingStateFailed, + "none": RoutingStateNone, + "provisioned": RoutingStateProvisioned, + "provisioning": RoutingStateProvisioning, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RoutingState(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkGatewayConnectionProtocol string + +const ( + VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" + VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" +) + +func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { + return []string{ + string(VirtualNetworkGatewayConnectionProtocolIKEvOne), + string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), + } +} + +func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { + vals := map[string]VirtualNetworkGatewayConnectionProtocol{ + "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, + "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkGatewayConnectionProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} + +type VirtualWanSecurityProviderType string + +const ( + VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" + VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" +) + +func PossibleValuesForVirtualWanSecurityProviderType() []string { + return []string{ + string(VirtualWanSecurityProviderTypeExternal), + string(VirtualWanSecurityProviderTypeNative), + } +} + +func (s *VirtualWanSecurityProviderType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualWanSecurityProviderType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualWanSecurityProviderType(input string) (*VirtualWanSecurityProviderType, error) { + vals := map[string]VirtualWanSecurityProviderType{ + "external": VirtualWanSecurityProviderTypeExternal, + "native": VirtualWanSecurityProviderTypeNative, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualWanSecurityProviderType(input) + return &out, nil +} + +type VnetLocalRouteOverrideCriteria string + +const ( + VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" + VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" +) + +func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { + return []string{ + string(VnetLocalRouteOverrideCriteriaContains), + string(VnetLocalRouteOverrideCriteriaEqual), + } +} + +func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVnetLocalRouteOverrideCriteria(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { + vals := map[string]VnetLocalRouteOverrideCriteria{ + "contains": VnetLocalRouteOverrideCriteriaContains, + "equal": VnetLocalRouteOverrideCriteriaEqual, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VnetLocalRouteOverrideCriteria(input) + return &out, nil +} + +type VpnAuthenticationType string + +const ( + VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" + VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" + VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" +) + +func PossibleValuesForVpnAuthenticationType() []string { + return []string{ + string(VpnAuthenticationTypeAAD), + string(VpnAuthenticationTypeCertificate), + string(VpnAuthenticationTypeRadius), + } +} + +func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnAuthenticationType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { + vals := map[string]VpnAuthenticationType{ + "aad": VpnAuthenticationTypeAAD, + "certificate": VpnAuthenticationTypeCertificate, + "radius": VpnAuthenticationTypeRadius, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnAuthenticationType(input) + return &out, nil +} + +type VpnConnectionStatus string + +const ( + VpnConnectionStatusConnected VpnConnectionStatus = "Connected" + VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" + VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" + VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" +) + +func PossibleValuesForVpnConnectionStatus() []string { + return []string{ + string(VpnConnectionStatusConnected), + string(VpnConnectionStatusConnecting), + string(VpnConnectionStatusNotConnected), + string(VpnConnectionStatusUnknown), + } +} + +func (s *VpnConnectionStatus) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnConnectionStatus(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnConnectionStatus(input string) (*VpnConnectionStatus, error) { + vals := map[string]VpnConnectionStatus{ + "connected": VpnConnectionStatusConnected, + "connecting": VpnConnectionStatusConnecting, + "notconnected": VpnConnectionStatusNotConnected, + "unknown": VpnConnectionStatusUnknown, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnConnectionStatus(input) + return &out, nil +} + +type VpnGatewayTunnelingProtocol string + +const ( + VpnGatewayTunnelingProtocolIkeVTwo VpnGatewayTunnelingProtocol = "IkeV2" + VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" +) + +func PossibleValuesForVpnGatewayTunnelingProtocol() []string { + return []string{ + string(VpnGatewayTunnelingProtocolIkeVTwo), + string(VpnGatewayTunnelingProtocolOpenVPN), + } +} + +func (s *VpnGatewayTunnelingProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnGatewayTunnelingProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnGatewayTunnelingProtocol(input string) (*VpnGatewayTunnelingProtocol, error) { + vals := map[string]VpnGatewayTunnelingProtocol{ + "ikev2": VpnGatewayTunnelingProtocolIkeVTwo, + "openvpn": VpnGatewayTunnelingProtocolOpenVPN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnGatewayTunnelingProtocol(input) + return &out, nil +} + +type VpnLinkConnectionMode string + +const ( + VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" + VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" + VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" +) + +func PossibleValuesForVpnLinkConnectionMode() []string { + return []string{ + string(VpnLinkConnectionModeDefault), + string(VpnLinkConnectionModeInitiatorOnly), + string(VpnLinkConnectionModeResponderOnly), + } +} + +func (s *VpnLinkConnectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnLinkConnectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnLinkConnectionMode(input string) (*VpnLinkConnectionMode, error) { + vals := map[string]VpnLinkConnectionMode{ + "default": VpnLinkConnectionModeDefault, + "initiatoronly": VpnLinkConnectionModeInitiatorOnly, + "responderonly": VpnLinkConnectionModeResponderOnly, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnLinkConnectionMode(input) + return &out, nil +} + +type VpnNatRuleMode string + +const ( + VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" + VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" +) + +func PossibleValuesForVpnNatRuleMode() []string { + return []string{ + string(VpnNatRuleModeEgressSnat), + string(VpnNatRuleModeIngressSnat), + } +} + +func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnNatRuleMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { + vals := map[string]VpnNatRuleMode{ + "egresssnat": VpnNatRuleModeEgressSnat, + "ingresssnat": VpnNatRuleModeIngressSnat, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnNatRuleMode(input) + return &out, nil +} + +type VpnNatRuleType string + +const ( + VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" + VpnNatRuleTypeStatic VpnNatRuleType = "Static" +) + +func PossibleValuesForVpnNatRuleType() []string { + return []string{ + string(VpnNatRuleTypeDynamic), + string(VpnNatRuleTypeStatic), + } +} + +func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnNatRuleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { + vals := map[string]VpnNatRuleType{ + "dynamic": VpnNatRuleTypeDynamic, + "static": VpnNatRuleTypeStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnNatRuleType(input) + return &out, nil +} + +type VpnPolicyMemberAttributeType string + +const ( + VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" + VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" + VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" +) + +func PossibleValuesForVpnPolicyMemberAttributeType() []string { + return []string{ + string(VpnPolicyMemberAttributeTypeAADGroupId), + string(VpnPolicyMemberAttributeTypeCertificateGroupId), + string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), + } +} + +func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVpnPolicyMemberAttributeType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { + vals := map[string]VpnPolicyMemberAttributeType{ + "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, + "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, + "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VpnPolicyMemberAttributeType(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/virtualwans/id_configurationpolicygroup.go b/resource-manager/network/2022-07-01/virtualwans/id_configurationpolicygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_configurationpolicygroup.go rename to resource-manager/network/2022-07-01/virtualwans/id_configurationpolicygroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_configurationpolicygroup_test.go b/resource-manager/network/2022-07-01/virtualwans/id_configurationpolicygroup_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_configurationpolicygroup_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_configurationpolicygroup_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2022-07-01/virtualwans/id_hubroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_hubroutetable.go rename to resource-manager/network/2022-07-01/virtualwans/id_hubroutetable.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2022-07-01/virtualwans/id_hubroutetable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_hubroutetable_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_hubroutetable_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2022-07-01/virtualwans/id_hubvirtualnetworkconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_hubvirtualnetworkconnection.go rename to resource-manager/network/2022-07-01/virtualwans/id_hubvirtualnetworkconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2022-07-01/virtualwans/id_hubvirtualnetworkconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_hubvirtualnetworkconnection_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_hubvirtualnetworkconnection_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_natrule.go b/resource-manager/network/2022-07-01/virtualwans/id_natrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_natrule.go rename to resource-manager/network/2022-07-01/virtualwans/id_natrule.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_natrule_test.go b/resource-manager/network/2022-07-01/virtualwans/id_natrule_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_natrule_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_natrule_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_routemap.go b/resource-manager/network/2022-07-01/virtualwans/id_routemap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_routemap.go rename to resource-manager/network/2022-07-01/virtualwans/id_routemap.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_routemap_test.go b/resource-manager/network/2022-07-01/virtualwans/id_routemap_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_routemap_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_routemap_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_routingintent.go b/resource-manager/network/2022-07-01/virtualwans/id_routingintent.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_routingintent.go rename to resource-manager/network/2022-07-01/virtualwans/id_routingintent.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_routingintent_test.go b/resource-manager/network/2022-07-01/virtualwans/id_routingintent_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_routingintent_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_routingintent_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_virtualhub.go b/resource-manager/network/2022-07-01/virtualwans/id_virtualhub.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_virtualhub.go rename to resource-manager/network/2022-07-01/virtualwans/id_virtualhub.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_virtualhub_test.go b/resource-manager/network/2022-07-01/virtualwans/id_virtualhub_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_virtualhub_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_virtualhub_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_virtualhubroutetable.go b/resource-manager/network/2022-07-01/virtualwans/id_virtualhubroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_virtualhubroutetable.go rename to resource-manager/network/2022-07-01/virtualwans/id_virtualhubroutetable.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_virtualhubroutetable_test.go b/resource-manager/network/2022-07-01/virtualwans/id_virtualhubroutetable_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_virtualhubroutetable_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_virtualhubroutetable_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_virtualwan.go b/resource-manager/network/2022-07-01/virtualwans/id_virtualwan.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_virtualwan.go rename to resource-manager/network/2022-07-01/virtualwans/id_virtualwan.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2022-07-01/virtualwans/id_virtualwan_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_virtualwan_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_virtualwan_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpngateway.go b/resource-manager/network/2022-07-01/virtualwans/id_vpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpngateway.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpngateway.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2022-07-01/virtualwans/id_vpngateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpngateway_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpngateway_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnlinkconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnlinkconnection.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnlinkconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnlinkconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnlinkconnection_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnlinkconnection_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnserverconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnserverconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnserverconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnserverconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnserverconfiguration_test.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnserverconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnserverconfiguration_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnserverconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnsite.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnsite.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnsite.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnsite.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnsite_test.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnsite_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnsite_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnsite_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnsitelink.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnsitelink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnsitelink.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnsitelink.go diff --git a/resource-manager/network/2023-04-01/virtualwans/id_vpnsitelink_test.go b/resource-manager/network/2022-07-01/virtualwans/id_vpnsitelink_test.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/id_vpnsitelink_test.go rename to resource-manager/network/2022-07-01/virtualwans/id_vpnsitelink_test.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupsdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupsdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupsdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupsget.go b/resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupsget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go b/resource-manager/network/2022-07-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go rename to resource-manager/network/2022-07-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubroutetablescreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_hubroutetablescreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubroutetablescreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubroutetablescreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubroutetablesdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_hubroutetablesdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubroutetablesdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubroutetablesdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubroutetablesget.go b/resource-manager/network/2022-07-01/virtualwans/method_hubroutetablesget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubroutetablesget.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubroutetablesget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubroutetableslist.go b/resource-manager/network/2022-07-01/virtualwans/method_hubroutetableslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubroutetableslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubroutetableslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionsget.go b/resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionsget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionslist.go b/resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_hubvirtualnetworkconnectionslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_hubvirtualnetworkconnectionslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_natrulescreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_natrulescreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_natrulescreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_natrulescreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_natrulesdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_natrulesdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_natrulesdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_natrulesdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_natrulesget.go b/resource-manager/network/2022-07-01/virtualwans/method_natrulesget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_natrulesget.go rename to resource-manager/network/2022-07-01/virtualwans/method_natrulesget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_natruleslistbyvpngateway.go b/resource-manager/network/2022-07-01/virtualwans/method_natruleslistbyvpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_natruleslistbyvpngateway.go rename to resource-manager/network/2022-07-01/virtualwans/method_natruleslistbyvpngateway.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewayscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewayscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewayscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewayscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewaysdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewaysdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewaysdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewaysdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewaysget.go b/resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewaysget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewaysget.go rename to resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewaysget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewayslist.go b/resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewayslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewayslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewayslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routemapscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_routemapscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routemapscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_routemapscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routemapsdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_routemapsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routemapsdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_routemapsdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routemapsget.go b/resource-manager/network/2022-07-01/virtualwans/method_routemapsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routemapsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_routemapsget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routemapslist.go b/resource-manager/network/2022-07-01/virtualwans/method_routemapslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routemapslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_routemapslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routingintentcreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_routingintentcreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routingintentcreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_routingintentcreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routingintentdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_routingintentdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routingintentdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_routingintentdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routingintentget.go b/resource-manager/network/2022-07-01/virtualwans/method_routingintentget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routingintentget.go rename to resource-manager/network/2022-07-01/virtualwans/method_routingintentget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_routingintentlist.go b/resource-manager/network/2022-07-01/virtualwans/method_routingintentlist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_routingintentlist.go rename to resource-manager/network/2022-07-01/virtualwans/method_routingintentlist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_supportedsecurityproviders.go b/resource-manager/network/2022-07-01/virtualwans/method_supportedsecurityproviders.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_supportedsecurityproviders.go rename to resource-manager/network/2022-07-01/virtualwans/method_supportedsecurityproviders.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_updatetags.go b/resource-manager/network/2022-07-01/virtualwans/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_updatetags.go rename to resource-manager/network/2022-07-01/virtualwans/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectiondelete.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectiondelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectiondelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectiondelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionget.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionget.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslist.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslist.go diff --git a/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go new file mode 100644 index 00000000000..e39e9d0a4b8 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go @@ -0,0 +1,72 @@ +package virtualwans + +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 VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *PeerRouteList +} + +// VirtualHubBgpConnectionsListAdvertisedRoutes ... +func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/advertisedRoutes", 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 +} + +// VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll performs VirtualHubBgpConnectionsListAdvertisedRoutes then polls until it's completed +func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { + result, err := c.VirtualHubBgpConnectionsListAdvertisedRoutes(ctx, id) + if err != nil { + return fmt.Errorf("performing VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go new file mode 100644 index 00000000000..adce21b7014 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go @@ -0,0 +1,72 @@ +package virtualwans + +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 VirtualHubBgpConnectionsListLearnedRoutesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *PeerRouteList +} + +// VirtualHubBgpConnectionsListLearnedRoutes ... +func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListLearnedRoutesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/learnedRoutes", 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 +} + +// VirtualHubBgpConnectionsListLearnedRoutesThenPoll performs VirtualHubBgpConnectionsListLearnedRoutes then polls until it's completed +func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { + result, err := c.VirtualHubBgpConnectionsListLearnedRoutes(ctx, id) + if err != nil { + return fmt.Errorf("performing VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationget.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationget.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationlist.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationlist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubipconfigurationlist.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubipconfigurationlist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2sdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2sdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2sdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2sdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2sget.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2sget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2sget.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2sget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2slist.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2slist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubroutetablev2slist.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubroutetablev2slist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubsdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubsdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsget.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubsget.go diff --git a/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go new file mode 100644 index 00000000000..da163f2cba2 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go @@ -0,0 +1,74 @@ +package virtualwans + +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 VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VirtualHubsGetEffectiveVirtualHubRoutes ... +func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutes(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) (result VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/effectiveRoutes", 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 +} + +// VirtualHubsGetEffectiveVirtualHubRoutesThenPoll performs VirtualHubsGetEffectiveVirtualHubRoutes then polls until it's completed +func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) error { + result, err := c.VirtualHubsGetEffectiveVirtualHubRoutes(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetinboundroutes.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetinboundroutes.go new file mode 100644 index 00000000000..2bb5ea498e2 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetinboundroutes.go @@ -0,0 +1,74 @@ +package virtualwans + +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 VirtualHubsGetInboundRoutesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VirtualHubsGetInboundRoutes ... +func (c VirtualWANsClient) VirtualHubsGetInboundRoutes(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) (result VirtualHubsGetInboundRoutesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/inboundRoutes", 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 +} + +// VirtualHubsGetInboundRoutesThenPoll performs VirtualHubsGetInboundRoutes then polls until it's completed +func (c VirtualWANsClient) VirtualHubsGetInboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) error { + result, err := c.VirtualHubsGetInboundRoutes(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VirtualHubsGetInboundRoutes: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VirtualHubsGetInboundRoutes: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetoutboundroutes.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetoutboundroutes.go new file mode 100644 index 00000000000..38d480f2a36 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsgetoutboundroutes.go @@ -0,0 +1,74 @@ +package virtualwans + +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 VirtualHubsGetOutboundRoutesOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +// VirtualHubsGetOutboundRoutes ... +func (c VirtualWANsClient) VirtualHubsGetOutboundRoutes(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) (result VirtualHubsGetOutboundRoutesOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/outboundRoutes", 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 +} + +// VirtualHubsGetOutboundRoutesThenPoll performs VirtualHubsGetOutboundRoutes then polls until it's completed +func (c VirtualWANsClient) VirtualHubsGetOutboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) error { + result, err := c.VirtualHubsGetOutboundRoutes(ctx, id, input) + if err != nil { + return fmt.Errorf("performing VirtualHubsGetOutboundRoutes: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after VirtualHubsGetOutboundRoutes: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubslist.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubslistbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsupdatetags.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualhubsupdatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualhubsupdatetags.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualhubsupdatetags.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualwanscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualwanscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualwanscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualwanscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualwansdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualwansdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualwansdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualwansdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualwansget.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualwansget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualwansget.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualwansget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualwanslist.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualwanslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualwanslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualwanslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualwanslistbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualwans/method_virtualwanslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_virtualwanslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualwans/method_virtualwanslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsget.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionslistbyvpngateway.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionslistbyvpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionslistbyvpngateway.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionslistbyvpngateway.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsstartpacketcapture.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsstartpacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsstartpacketcapture.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsstartpacketcapture.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsstoppacketcapture.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsstoppacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnconnectionsstoppacketcapture.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnconnectionsstoppacketcapture.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpngatewayscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_vpngatewayscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpngatewayscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpngatewayscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpngatewaysdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_vpngatewaysdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpngatewaysdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpngatewaysdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpngatewaysget.go b/resource-manager/network/2022-07-01/virtualwans/method_vpngatewaysget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpngatewaysget.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpngatewaysget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpngatewayslist.go b/resource-manager/network/2022-07-01/virtualwans/method_vpngatewayslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpngatewayslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpngatewayslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpngatewayslistbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualwans/method_vpngatewayslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpngatewayslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpngatewayslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnlinkconnectionsgetikesas.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnlinkconnectionsgetikesas.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnlinkconnectionsgetikesas.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnlinkconnectionsgetikesas.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationsdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationsdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationsdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationsdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationsget.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationsget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationslist.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitelinkconnectionsget.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitelinkconnectionsget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitelinkconnectionsget.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitelinkconnectionsget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitelinksget.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitelinksget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitelinksget.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitelinksget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitesconfigurationdownload.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitesconfigurationdownload.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitesconfigurationdownload.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitesconfigurationdownload.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitescreateorupdate.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitescreateorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitescreateorupdate.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitescreateorupdate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitesdelete.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitesdelete.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitesdelete.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitesdelete.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsitesget.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsitesget.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsitesget.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsitesget.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsiteslist.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsiteslist.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsiteslist.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsiteslist.go diff --git a/resource-manager/network/2023-04-01/virtualwans/method_vpnsiteslistbyresourcegroup.go b/resource-manager/network/2022-07-01/virtualwans/method_vpnsiteslistbyresourcegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/method_vpnsiteslistbyresourcegroup.go rename to resource-manager/network/2022-07-01/virtualwans/method_vpnsiteslistbyresourcegroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_aadauthenticationparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_aadauthenticationparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_aadauthenticationparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_aadauthenticationparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_action.go b/resource-manager/network/2022-07-01/virtualwans/model_action.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_action.go rename to resource-manager/network/2022-07-01/virtualwans/model_action.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_addressspace.go b/resource-manager/network/2022-07-01/virtualwans/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_addressspace.go rename to resource-manager/network/2022-07-01/virtualwans/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_backendaddresspool.go b/resource-manager/network/2022-07-01/virtualwans/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/virtualwans/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..f82284cb3a4 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package virtualwans + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_bgpconnection.go b/resource-manager/network/2022-07-01/virtualwans/model_bgpconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_bgpconnection.go rename to resource-manager/network/2022-07-01/virtualwans/model_bgpconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_bgpconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_bgpconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_bgpconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_bgpconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_bgpsettings.go b/resource-manager/network/2022-07-01/virtualwans/model_bgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_bgpsettings.go rename to resource-manager/network/2022-07-01/virtualwans/model_bgpsettings.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_criterion.go b/resource-manager/network/2022-07-01/virtualwans/model_criterion.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_criterion.go rename to resource-manager/network/2022-07-01/virtualwans/model_criterion.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ddossettings.go b/resource-manager/network/2022-07-01/virtualwans/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ddossettings.go rename to resource-manager/network/2022-07-01/virtualwans/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_delegation.go b/resource-manager/network/2022-07-01/virtualwans/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_delegation.go rename to resource-manager/network/2022-07-01/virtualwans/model_delegation.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_deviceproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_deviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_deviceproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_deviceproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutesparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_effectiveroutesparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_effectiveroutesparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_effectiveroutesparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_flowlog.go b/resource-manager/network/2022-07-01/virtualwans/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_flowlog.go rename to resource-manager/network/2022-07-01/virtualwans/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/virtualwans/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/virtualwans/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_getinboundroutesparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_getinboundroutesparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_getinboundroutesparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_getinboundroutesparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_getoutboundroutesparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_getoutboundroutesparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_getoutboundroutesparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_getoutboundroutesparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2022-07-01/virtualwans/model_getvpnsitesconfigurationrequest.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_getvpnsitesconfigurationrequest.go rename to resource-manager/network/2022-07-01/virtualwans/model_getvpnsitesconfigurationrequest.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_hubipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_hubipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubroute.go b/resource-manager/network/2022-07-01/virtualwans/model_hubroute.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubroute.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubroute.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubroutetable.go b/resource-manager/network/2022-07-01/virtualwans/model_hubroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubroutetable.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubroutetable.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubroutetableproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_hubroutetableproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubroutetableproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubroutetableproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubvirtualnetworkconnection.go b/resource-manager/network/2022-07-01/virtualwans/model_hubvirtualnetworkconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubvirtualnetworkconnection.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubvirtualnetworkconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_inboundnatrule.go b/resource-manager/network/2022-07-01/virtualwans/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/virtualwans/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationbgppeeringaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationbgppeeringaddress.go rename to resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationbgppeeringaddress.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_ipsecpolicy.go b/resource-manager/network/2022-07-01/virtualwans/model_ipsecpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_ipsecpolicy.go rename to resource-manager/network/2022-07-01/virtualwans/model_ipsecpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_iptag.go b/resource-manager/network/2022-07-01/virtualwans/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_iptag.go rename to resource-manager/network/2022-07-01/virtualwans/model_iptag.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/virtualwans/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/virtualwans/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_natgateway.go b/resource-manager/network/2022-07-01/virtualwans/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_natgateway.go rename to resource-manager/network/2022-07-01/virtualwans/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_natgatewaysku.go b/resource-manager/network/2022-07-01/virtualwans/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/virtualwans/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_natruleportmapping.go b/resource-manager/network/2022-07-01/virtualwans/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/virtualwans/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterface.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterface.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..862d1f57282 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package virtualwans + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/virtualwans/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/virtualwans/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_o365breakoutcategorypolicies.go b/resource-manager/network/2022-07-01/virtualwans/model_o365breakoutcategorypolicies.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_o365breakoutcategorypolicies.go rename to resource-manager/network/2022-07-01/virtualwans/model_o365breakoutcategorypolicies.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_o365policyproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_o365policyproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_o365policyproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_o365policyproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_p2sconnectionconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_p2sconnectionconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_p2sconnectionconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_p2sconnectionconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_p2sconnectionconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_p2sconnectionconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_p2sconnectionconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_p2svpngateway.go b/resource-manager/network/2022-07-01/virtualwans/model_p2svpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_p2svpngateway.go rename to resource-manager/network/2022-07-01/virtualwans/model_p2svpngateway.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_p2svpngatewayproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_p2svpngatewayproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_p2svpngatewayproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_p2svpngatewayproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_parameter.go b/resource-manager/network/2022-07-01/virtualwans/model_parameter.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_parameter.go rename to resource-manager/network/2022-07-01/virtualwans/model_parameter.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_peerroute.go b/resource-manager/network/2022-07-01/virtualwans/model_peerroute.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_peerroute.go rename to resource-manager/network/2022-07-01/virtualwans/model_peerroute.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_peerroutelist.go b/resource-manager/network/2022-07-01/virtualwans/model_peerroutelist.go new file mode 100644 index 00000000000..03e35b11bdf --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_peerroutelist.go @@ -0,0 +1,8 @@ +package virtualwans + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PeerRouteList struct { + Value *[]PeerRoute `json:"value,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privateendpoint.go b/resource-manager/network/2022-07-01/virtualwans/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privateendpoint.go rename to resource-manager/network/2022-07-01/virtualwans/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/virtualwans/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/virtualwans/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..9c1fa6ebf3a --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package virtualwans + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkservice.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_propagatedroutetable.go b/resource-manager/network/2022-07-01/virtualwans/model_propagatedroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_propagatedroutetable.go rename to resource-manager/network/2022-07-01/virtualwans/model_propagatedroutetable.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_publicipaddress.go b/resource-manager/network/2022-07-01/virtualwans/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_publicipaddress.go rename to resource-manager/network/2022-07-01/virtualwans/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/virtualwans/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..941ad0689a8 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package virtualwans + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/virtualwans/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/virtualwans/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_radiusserver.go b/resource-manager/network/2022-07-01/virtualwans/model_radiusserver.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_radiusserver.go rename to resource-manager/network/2022-07-01/virtualwans/model_radiusserver.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/virtualwans/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/virtualwans/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/virtualwans/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_resourceset.go b/resource-manager/network/2022-07-01/virtualwans/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_resourceset.go rename to resource-manager/network/2022-07-01/virtualwans/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_route.go b/resource-manager/network/2022-07-01/virtualwans/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_route.go rename to resource-manager/network/2022-07-01/virtualwans/model_route.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routemap.go b/resource-manager/network/2022-07-01/virtualwans/model_routemap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routemap.go rename to resource-manager/network/2022-07-01/virtualwans/model_routemap.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routemapproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_routemapproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routemapproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_routemapproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routemaprule.go b/resource-manager/network/2022-07-01/virtualwans/model_routemaprule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routemaprule.go rename to resource-manager/network/2022-07-01/virtualwans/model_routemaprule.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routetable.go b/resource-manager/network/2022-07-01/virtualwans/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routetable.go rename to resource-manager/network/2022-07-01/virtualwans/model_routetable.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routingconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_routingconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routingconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_routingconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routingintent.go b/resource-manager/network/2022-07-01/virtualwans/model_routingintent.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routingintent.go rename to resource-manager/network/2022-07-01/virtualwans/model_routingintent.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routingintentproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_routingintentproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routingintentproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_routingintentproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_routingpolicy.go b/resource-manager/network/2022-07-01/virtualwans/model_routingpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_routingpolicy.go rename to resource-manager/network/2022-07-01/virtualwans/model_routingpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_securityrule.go b/resource-manager/network/2022-07-01/virtualwans/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_securityrule.go rename to resource-manager/network/2022-07-01/virtualwans/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..731cb001e5f --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package virtualwans + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_staticroute.go b/resource-manager/network/2022-07-01/virtualwans/model_staticroute.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_staticroute.go rename to resource-manager/network/2022-07-01/virtualwans/model_staticroute.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_staticroutesconfig.go b/resource-manager/network/2022-07-01/virtualwans/model_staticroutesconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_staticroutesconfig.go rename to resource-manager/network/2022-07-01/virtualwans/model_staticroutesconfig.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_subnet.go b/resource-manager/network/2022-07-01/virtualwans/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_subnet.go rename to resource-manager/network/2022-07-01/virtualwans/model_subnet.go diff --git a/resource-manager/network/2022-07-01/virtualwans/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..773cdaf6d36 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package virtualwans + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_subresource.go b/resource-manager/network/2022-07-01/virtualwans/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_subresource.go rename to resource-manager/network/2022-07-01/virtualwans/model_subresource.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_tagsobject.go b/resource-manager/network/2022-07-01/virtualwans/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_tagsobject.go rename to resource-manager/network/2022-07-01/virtualwans/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_trafficselectorpolicy.go b/resource-manager/network/2022-07-01/virtualwans/model_trafficselectorpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_trafficselectorpolicy.go rename to resource-manager/network/2022-07-01/virtualwans/model_trafficselectorpolicy.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhub.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhub.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhub.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhub.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhubproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhubproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhubproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubroute.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhubroute.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhubroute.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhubroute.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutetable.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutetable.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutetable.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutetablev2.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutetablev2.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutetablev2.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutetablev2.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutetablev2properties.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutetablev2properties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutetablev2properties.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutetablev2properties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutev2.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutev2.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualhubroutev2.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualhubroutev2.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualrouterautoscaleconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualrouterautoscaleconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualrouterautoscaleconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualrouterautoscaleconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualwan.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualwan.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualwan.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualwan.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualwanproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualwanproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualwanproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualwanproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualwansecurityprovider.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualwansecurityprovider.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualwansecurityprovider.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualwansecurityprovider.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualwansecurityproviders.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualwansecurityproviders.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualwansecurityproviders.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualwansecurityproviders.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualwanvpnprofileparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_virtualwanvpnprofileparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_virtualwanvpnprofileparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_virtualwanvpnprofileparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vnetroute.go b/resource-manager/network/2022-07-01/virtualwans/model_vnetroute.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vnetroute.go rename to resource-manager/network/2022-07-01/virtualwans/model_vnetroute.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnclientconnectionhealth.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnclientconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnclientconnectionhealth.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnclientconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnconnection.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnconnection.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpngateway.go b/resource-manager/network/2022-07-01/virtualwans/model_vpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpngateway.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpngateway.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpngatewayipconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_vpngatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpngatewayipconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpngatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpngatewaynatrule.go b/resource-manager/network/2022-07-01/virtualwans/model_vpngatewaynatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpngatewaynatrule.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpngatewaynatrule.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpngatewaynatruleproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpngatewaynatruleproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpngatewaynatruleproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpngatewaynatruleproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpngatewayproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpngatewayproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpngatewayproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpngatewayproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnlinkbgpsettings.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnlinkbgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnlinkbgpsettings.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnlinkbgpsettings.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnlinkproviderproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnlinkproviderproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnlinkproviderproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnlinkproviderproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnnatrulemapping.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnnatrulemapping.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnnatrulemapping.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnnatrulemapping.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnprofileresponse.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnprofileresponse.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnprofileresponse.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfiguration.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfiguration.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfiguration.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationpolicygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationpolicygroup.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationpolicygroup.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationsresponse.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationsresponse.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigurationsresponse.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigurationsresponse.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnsite.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnsite.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnsite.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnsite.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnsitelink.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnsitelink.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnsitelink.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnsitelink.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnsitelinkconnection.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnsitelinkconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnsitelinkconnection.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnsitelinkconnection.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnsitelinkconnectionproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnsitelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnsitelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnsitelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnsitelinkproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnsitelinkproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnsitelinkproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnsitelinkproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/model_vpnsiteproperties.go b/resource-manager/network/2022-07-01/virtualwans/model_vpnsiteproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/model_vpnsiteproperties.go rename to resource-manager/network/2022-07-01/virtualwans/model_vpnsiteproperties.go diff --git a/resource-manager/network/2023-04-01/virtualwans/predicates.go b/resource-manager/network/2022-07-01/virtualwans/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/virtualwans/predicates.go rename to resource-manager/network/2022-07-01/virtualwans/predicates.go diff --git a/resource-manager/network/2022-07-01/virtualwans/version.go b/resource-manager/network/2022-07-01/virtualwans/version.go new file mode 100644 index 00000000000..0a5d6970e23 --- /dev/null +++ b/resource-manager/network/2022-07-01/virtualwans/version.go @@ -0,0 +1,12 @@ +package virtualwans + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/virtualwans/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/README.md b/resource-manager/network/2022-07-01/vmsspublicipaddresses/README.md new file mode 100644 index 00000000000..13be8ae5e35 --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/README.md @@ -0,0 +1,71 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vmsspublicipaddresses` Documentation + +The `vmsspublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/vmsspublicipaddresses" +``` + + +### Client Initialization + +```go +client := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress` + +```go +ctx := context.TODO() +id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") + +read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses` + +```go +ctx := context.TODO() +id := vmsspublicipaddresses.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") + +// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx, id)` can be used to do batched pagination +items, err := client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses` + +```go +ctx := context.TODO() +id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") + +// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination +items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/client.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/client.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/client.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/client.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/constants.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/constants.go new file mode 100644 index 00000000000..59520ace857 --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/constants.go @@ -0,0 +1,1013 @@ +package vmsspublicipaddresses + +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 DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/id_virtualmachinescaleset.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/id_virtualmachinescaleset.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/id_virtualmachinescaleset.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/id_virtualmachinescaleset.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_backendaddresspool.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..1066643d554 --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package vmsspublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ddossettings.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ddossettings.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_delegation.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_delegation.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_delegation.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_flowlog.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_flowlog.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_inboundnatrule.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_iptag.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_iptag.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_iptag.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natgateway.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natgateway.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natgatewaysku.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natruleportmapping.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterface.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterface.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..a3373e765f6 --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package vmsspublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpoint.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpoint.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..e36b5a203af --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package vmsspublicipaddresses + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkservice.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddress.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddress.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..ffd59c141ce --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package vmsspublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_resourceset.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_resourceset.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_route.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_route.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_route.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_routetable.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_routetable.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_routetable.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_securityrule.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_securityrule.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..143b0d4a97e --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package vmsspublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subnet.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subnet.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subnet.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..89e36c708ad --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package vmsspublicipaddresses + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subresource.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subresource.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_subresource.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/predicates.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/vmsspublicipaddresses/predicates.go rename to resource-manager/network/2022-07-01/vmsspublicipaddresses/predicates.go diff --git a/resource-manager/network/2022-07-01/vmsspublicipaddresses/version.go b/resource-manager/network/2022-07-01/vmsspublicipaddresses/version.go new file mode 100644 index 00000000000..a4f0e7150ac --- /dev/null +++ b/resource-manager/network/2022-07-01/vmsspublicipaddresses/version.go @@ -0,0 +1,12 @@ +package vmsspublicipaddresses + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vmsspublicipaddresses/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/vpngateways/README.md b/resource-manager/network/2022-07-01/vpngateways/README.md new file mode 100644 index 00000000000..86737ba9c48 --- /dev/null +++ b/resource-manager/network/2022-07-01/vpngateways/README.md @@ -0,0 +1,83 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpngateways` Documentation + +The `vpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/vpngateways" +``` + + +### Client Initialization + +```go +client := vpngateways.NewVpnGatewaysClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VpnGatewaysClient.Reset` + +```go +ctx := context.TODO() +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +if err := client.ResetThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `VpnGatewaysClient.StartPacketCapture` + +```go +ctx := context.TODO() +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ + // ... +} + + +if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VpnGatewaysClient.StopPacketCapture` + +```go +ctx := context.TODO() +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ + // ... +} + + +if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `VpnGatewaysClient.UpdateTags` + +```go +ctx := context.TODO() +id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") + +payload := vpngateways.TagsObject{ + // ... +} + + +if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/network/2023-04-01/vpngateways/client.go b/resource-manager/network/2022-07-01/vpngateways/client.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/client.go rename to resource-manager/network/2022-07-01/vpngateways/client.go diff --git a/resource-manager/network/2023-04-01/vpngateways/constants.go b/resource-manager/network/2022-07-01/vpngateways/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/constants.go rename to resource-manager/network/2022-07-01/vpngateways/constants.go diff --git a/resource-manager/network/2023-04-01/vpngateways/id_vpngateway.go b/resource-manager/network/2022-07-01/vpngateways/id_vpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/id_vpngateway.go rename to resource-manager/network/2022-07-01/vpngateways/id_vpngateway.go diff --git a/resource-manager/network/2023-04-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2022-07-01/vpngateways/id_vpngateway_test.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/id_vpngateway_test.go rename to resource-manager/network/2022-07-01/vpngateways/id_vpngateway_test.go diff --git a/resource-manager/network/2022-07-01/vpngateways/method_reset.go b/resource-manager/network/2022-07-01/vpngateways/method_reset.go new file mode 100644 index 00000000000..050beb9b26f --- /dev/null +++ b/resource-manager/network/2022-07-01/vpngateways/method_reset.go @@ -0,0 +1,71 @@ +package vpngateways + +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 ResetOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *VpnGateway +} + +// Reset ... +func (c VpnGatewaysClient) Reset(ctx context.Context, id VpnGatewayId) (result ResetOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/reset", 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 +} + +// ResetThenPoll performs Reset then polls until it's completed +func (c VpnGatewaysClient) ResetThenPoll(ctx context.Context, id VpnGatewayId) error { + result, err := c.Reset(ctx, id) + if err != nil { + return fmt.Errorf("performing Reset: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after Reset: %+v", err) + } + + return nil +} diff --git a/resource-manager/network/2023-04-01/vpngateways/method_startpacketcapture.go b/resource-manager/network/2022-07-01/vpngateways/method_startpacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/method_startpacketcapture.go rename to resource-manager/network/2022-07-01/vpngateways/method_startpacketcapture.go diff --git a/resource-manager/network/2023-04-01/vpngateways/method_stoppacketcapture.go b/resource-manager/network/2022-07-01/vpngateways/method_stoppacketcapture.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/method_stoppacketcapture.go rename to resource-manager/network/2022-07-01/vpngateways/method_stoppacketcapture.go diff --git a/resource-manager/network/2023-04-01/vpngateways/method_updatetags.go b/resource-manager/network/2022-07-01/vpngateways/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/method_updatetags.go rename to resource-manager/network/2022-07-01/vpngateways/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_bgpsettings.go b/resource-manager/network/2022-07-01/vpngateways/model_bgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_bgpsettings.go rename to resource-manager/network/2022-07-01/vpngateways/model_bgpsettings.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2022-07-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go rename to resource-manager/network/2022-07-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2022-07-01/vpngateways/model_ipconfigurationbgppeeringaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_ipconfigurationbgppeeringaddress.go rename to resource-manager/network/2022-07-01/vpngateways/model_ipconfigurationbgppeeringaddress.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_ipsecpolicy.go b/resource-manager/network/2022-07-01/vpngateways/model_ipsecpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_ipsecpolicy.go rename to resource-manager/network/2022-07-01/vpngateways/model_ipsecpolicy.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_propagatedroutetable.go b/resource-manager/network/2022-07-01/vpngateways/model_propagatedroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_propagatedroutetable.go rename to resource-manager/network/2022-07-01/vpngateways/model_propagatedroutetable.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_routingconfiguration.go b/resource-manager/network/2022-07-01/vpngateways/model_routingconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_routingconfiguration.go rename to resource-manager/network/2022-07-01/vpngateways/model_routingconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_staticroute.go b/resource-manager/network/2022-07-01/vpngateways/model_staticroute.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_staticroute.go rename to resource-manager/network/2022-07-01/vpngateways/model_staticroute.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_staticroutesconfig.go b/resource-manager/network/2022-07-01/vpngateways/model_staticroutesconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_staticroutesconfig.go rename to resource-manager/network/2022-07-01/vpngateways/model_staticroutesconfig.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_subresource.go b/resource-manager/network/2022-07-01/vpngateways/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_subresource.go rename to resource-manager/network/2022-07-01/vpngateways/model_subresource.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_tagsobject.go b/resource-manager/network/2022-07-01/vpngateways/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_tagsobject.go rename to resource-manager/network/2022-07-01/vpngateways/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_trafficselectorpolicy.go b/resource-manager/network/2022-07-01/vpngateways/model_trafficselectorpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_trafficselectorpolicy.go rename to resource-manager/network/2022-07-01/vpngateways/model_trafficselectorpolicy.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vnetroute.go b/resource-manager/network/2022-07-01/vpngateways/model_vnetroute.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vnetroute.go rename to resource-manager/network/2022-07-01/vpngateways/model_vnetroute.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpnconnection.go b/resource-manager/network/2022-07-01/vpngateways/model_vpnconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpnconnection.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpnconnection.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpnconnectionproperties.go b/resource-manager/network/2022-07-01/vpngateways/model_vpnconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpnconnectionproperties.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpnconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngateway.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngateway.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngateway.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngatewayipconfiguration.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngatewayipconfiguration.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngatewaynatrule.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngatewaynatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngatewaynatrule.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngatewaynatrule.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngatewaynatruleproperties.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngatewaynatruleproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngatewaynatruleproperties.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngatewaynatruleproperties.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpngatewayproperties.go b/resource-manager/network/2022-07-01/vpngateways/model_vpngatewayproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpngatewayproperties.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpngatewayproperties.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpnnatrulemapping.go b/resource-manager/network/2022-07-01/vpngateways/model_vpnnatrulemapping.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpnnatrulemapping.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpnnatrulemapping.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpnsitelinkconnection.go b/resource-manager/network/2022-07-01/vpngateways/model_vpnsitelinkconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpnsitelinkconnection.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpnsitelinkconnection.go diff --git a/resource-manager/network/2023-04-01/vpngateways/model_vpnsitelinkconnectionproperties.go b/resource-manager/network/2022-07-01/vpngateways/model_vpnsitelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpngateways/model_vpnsitelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/vpngateways/model_vpnsitelinkconnectionproperties.go diff --git a/resource-manager/network/2022-07-01/vpngateways/version.go b/resource-manager/network/2022-07-01/vpngateways/version.go new file mode 100644 index 00000000000..ac1a98d2a43 --- /dev/null +++ b/resource-manager/network/2022-07-01/vpngateways/version.go @@ -0,0 +1,12 @@ +package vpngateways + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vpngateways/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2023-04-01/vpnlinkconnections/client.go b/resource-manager/network/2022-07-01/vpnlinkconnections/client.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnlinkconnections/client.go rename to resource-manager/network/2022-07-01/vpnlinkconnections/client.go diff --git a/resource-manager/network/2023-04-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2022-07-01/vpnlinkconnections/id_vpnlinkconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnlinkconnections/id_vpnlinkconnection.go rename to resource-manager/network/2022-07-01/vpnlinkconnections/id_vpnlinkconnection.go diff --git a/resource-manager/network/2023-04-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2022-07-01/vpnlinkconnections/id_vpnlinkconnection_test.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnlinkconnections/id_vpnlinkconnection_test.go rename to resource-manager/network/2022-07-01/vpnlinkconnections/id_vpnlinkconnection_test.go diff --git a/resource-manager/network/2023-04-01/vpnlinkconnections/method_resetconnection.go b/resource-manager/network/2022-07-01/vpnlinkconnections/method_resetconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnlinkconnections/method_resetconnection.go rename to resource-manager/network/2022-07-01/vpnlinkconnections/method_resetconnection.go diff --git a/resource-manager/network/2022-07-01/vpnlinkconnections/version.go b/resource-manager/network/2022-07-01/vpnlinkconnections/version.go new file mode 100644 index 00000000000..b0b4c0a690c --- /dev/null +++ b/resource-manager/network/2022-07-01/vpnlinkconnections/version.go @@ -0,0 +1,12 @@ +package vpnlinkconnections + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vpnlinkconnections/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/vpnserverconfigurations/README.md b/resource-manager/network/2022-07-01/vpnserverconfigurations/README.md new file mode 100644 index 00000000000..5b96ff10e55 --- /dev/null +++ b/resource-manager/network/2022-07-01/vpnserverconfigurations/README.md @@ -0,0 +1,41 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpnserverconfigurations` Documentation + +The `vpnserverconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/vpnserverconfigurations" +``` + + +### Client Initialization + +```go +client := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VpnServerConfigurationsClient.UpdateTags` + +```go +ctx := context.TODO() +id := vpnserverconfigurations.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") + +payload := vpnserverconfigurations.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/network/2023-04-01/vpnserverconfigurations/client.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/client.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/client.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/client.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/constants.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/constants.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/constants.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/id_vpnserverconfiguration.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/id_vpnserverconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/id_vpnserverconfiguration.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/id_vpnserverconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/method_updatetags.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/method_updatetags.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_aadauthenticationparameters.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_aadauthenticationparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_aadauthenticationparameters.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_aadauthenticationparameters.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_addressspace.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_addressspace.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_ipsecpolicy.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_ipsecpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_ipsecpolicy.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_ipsecpolicy.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2svpngateway.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2svpngateway.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2svpngateway.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2svpngateway.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2svpngatewayproperties.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2svpngatewayproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_p2svpngatewayproperties.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_p2svpngatewayproperties.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_propagatedroutetable.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_propagatedroutetable.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_propagatedroutetable.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_propagatedroutetable.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_radiusserver.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_radiusserver.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_radiusserver.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_radiusserver.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_routingconfiguration.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_routingconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_routingconfiguration.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_routingconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_staticroute.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_staticroute.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_staticroute.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_staticroute.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_staticroutesconfig.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_staticroutesconfig.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_staticroutesconfig.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_staticroutesconfig.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_subresource.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_subresource.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_subresource.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_tagsobject.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_tagsobject.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vnetroute.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vnetroute.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vnetroute.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vnetroute.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfiguration.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfiguration.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfiguration.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go rename to resource-manager/network/2022-07-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go diff --git a/resource-manager/network/2022-07-01/vpnserverconfigurations/version.go b/resource-manager/network/2022-07-01/vpnserverconfigurations/version.go new file mode 100644 index 00000000000..496c804f8dc --- /dev/null +++ b/resource-manager/network/2022-07-01/vpnserverconfigurations/version.go @@ -0,0 +1,12 @@ +package vpnserverconfigurations + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vpnserverconfigurations/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/vpnsites/README.md b/resource-manager/network/2022-07-01/vpnsites/README.md new file mode 100644 index 00000000000..bb7658947fe --- /dev/null +++ b/resource-manager/network/2022-07-01/vpnsites/README.md @@ -0,0 +1,41 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/vpnsites` Documentation + +The `vpnsites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/vpnsites" +``` + + +### Client Initialization + +```go +client := vpnsites.NewVpnSitesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `VpnSitesClient.UpdateTags` + +```go +ctx := context.TODO() +id := vpnsites.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") + +payload := vpnsites.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/network/2023-04-01/vpnsites/client.go b/resource-manager/network/2022-07-01/vpnsites/client.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/client.go rename to resource-manager/network/2022-07-01/vpnsites/client.go diff --git a/resource-manager/network/2023-04-01/vpnsites/constants.go b/resource-manager/network/2022-07-01/vpnsites/constants.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/constants.go rename to resource-manager/network/2022-07-01/vpnsites/constants.go diff --git a/resource-manager/network/2023-04-01/vpnsites/id_vpnsite.go b/resource-manager/network/2022-07-01/vpnsites/id_vpnsite.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/id_vpnsite.go rename to resource-manager/network/2022-07-01/vpnsites/id_vpnsite.go diff --git a/resource-manager/network/2023-04-01/vpnsites/id_vpnsite_test.go b/resource-manager/network/2022-07-01/vpnsites/id_vpnsite_test.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/id_vpnsite_test.go rename to resource-manager/network/2022-07-01/vpnsites/id_vpnsite_test.go diff --git a/resource-manager/network/2023-04-01/vpnsites/method_updatetags.go b/resource-manager/network/2022-07-01/vpnsites/method_updatetags.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/method_updatetags.go rename to resource-manager/network/2022-07-01/vpnsites/method_updatetags.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_addressspace.go b/resource-manager/network/2022-07-01/vpnsites/model_addressspace.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_addressspace.go rename to resource-manager/network/2022-07-01/vpnsites/model_addressspace.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_bgpsettings.go b/resource-manager/network/2022-07-01/vpnsites/model_bgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_bgpsettings.go rename to resource-manager/network/2022-07-01/vpnsites/model_bgpsettings.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_deviceproperties.go b/resource-manager/network/2022-07-01/vpnsites/model_deviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_deviceproperties.go rename to resource-manager/network/2022-07-01/vpnsites/model_deviceproperties.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2022-07-01/vpnsites/model_ipconfigurationbgppeeringaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_ipconfigurationbgppeeringaddress.go rename to resource-manager/network/2022-07-01/vpnsites/model_ipconfigurationbgppeeringaddress.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_o365breakoutcategorypolicies.go b/resource-manager/network/2022-07-01/vpnsites/model_o365breakoutcategorypolicies.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_o365breakoutcategorypolicies.go rename to resource-manager/network/2022-07-01/vpnsites/model_o365breakoutcategorypolicies.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_o365policyproperties.go b/resource-manager/network/2022-07-01/vpnsites/model_o365policyproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_o365policyproperties.go rename to resource-manager/network/2022-07-01/vpnsites/model_o365policyproperties.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_subresource.go b/resource-manager/network/2022-07-01/vpnsites/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_subresource.go rename to resource-manager/network/2022-07-01/vpnsites/model_subresource.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_tagsobject.go b/resource-manager/network/2022-07-01/vpnsites/model_tagsobject.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_tagsobject.go rename to resource-manager/network/2022-07-01/vpnsites/model_tagsobject.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_vpnlinkbgpsettings.go b/resource-manager/network/2022-07-01/vpnsites/model_vpnlinkbgpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_vpnlinkbgpsettings.go rename to resource-manager/network/2022-07-01/vpnsites/model_vpnlinkbgpsettings.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_vpnlinkproviderproperties.go b/resource-manager/network/2022-07-01/vpnsites/model_vpnlinkproviderproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_vpnlinkproviderproperties.go rename to resource-manager/network/2022-07-01/vpnsites/model_vpnlinkproviderproperties.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_vpnsite.go b/resource-manager/network/2022-07-01/vpnsites/model_vpnsite.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_vpnsite.go rename to resource-manager/network/2022-07-01/vpnsites/model_vpnsite.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_vpnsitelink.go b/resource-manager/network/2022-07-01/vpnsites/model_vpnsitelink.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_vpnsitelink.go rename to resource-manager/network/2022-07-01/vpnsites/model_vpnsitelink.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_vpnsitelinkproperties.go b/resource-manager/network/2022-07-01/vpnsites/model_vpnsitelinkproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_vpnsitelinkproperties.go rename to resource-manager/network/2022-07-01/vpnsites/model_vpnsitelinkproperties.go diff --git a/resource-manager/network/2023-04-01/vpnsites/model_vpnsiteproperties.go b/resource-manager/network/2022-07-01/vpnsites/model_vpnsiteproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/vpnsites/model_vpnsiteproperties.go rename to resource-manager/network/2022-07-01/vpnsites/model_vpnsiteproperties.go diff --git a/resource-manager/network/2022-07-01/vpnsites/version.go b/resource-manager/network/2022-07-01/vpnsites/version.go new file mode 100644 index 00000000000..a1fc993d789 --- /dev/null +++ b/resource-manager/network/2022-07-01/vpnsites/version.go @@ -0,0 +1,12 @@ +package vpnsites + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/vpnsites/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/README.md new file mode 100644 index 00000000000..7fbd395ca2e --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/README.md @@ -0,0 +1,104 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/webapplicationfirewallpolicies` Documentation + +The `webapplicationfirewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/webapplicationfirewallpolicies" +``` + + +### Client Initialization + +```go +client := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WebApplicationFirewallPoliciesClient.CreateOrUpdate` + +```go +ctx := context.TODO() +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") + +payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ + // ... +} + + +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: `WebApplicationFirewallPoliciesClient.Delete` + +```go +ctx := context.TODO() +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") + +if err := client.DeleteThenPoll(ctx, id); err != nil { + // handle the error +} +``` + + +### Example Usage: `WebApplicationFirewallPoliciesClient.Get` + +```go +ctx := context.TODO() +id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") + +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: `WebApplicationFirewallPoliciesClient.List` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// 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: `WebApplicationFirewallPoliciesClient.ListAll` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination +items, err := client.ListAllComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/client.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/client.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/client.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/client.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/constants.go new file mode 100644 index 00000000000..1a5699ac417 --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/constants.go @@ -0,0 +1,2372 @@ +package webapplicationfirewallpolicies + +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 ActionType string + +const ( + ActionTypeAllow ActionType = "Allow" + ActionTypeAnomalyScoring ActionType = "AnomalyScoring" + ActionTypeBlock ActionType = "Block" + ActionTypeLog ActionType = "Log" +) + +func PossibleValuesForActionType() []string { + return []string{ + string(ActionTypeAllow), + string(ActionTypeAnomalyScoring), + string(ActionTypeBlock), + string(ActionTypeLog), + } +} + +func (s *ActionType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseActionType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseActionType(input string) (*ActionType, error) { + vals := map[string]ActionType{ + "allow": ActionTypeAllow, + "anomalyscoring": ActionTypeAnomalyScoring, + "block": ActionTypeBlock, + "log": ActionTypeLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ActionType(input) + return &out, nil +} + +type ApplicationGatewayClientRevocationOptions string + +const ( + ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" + ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" +) + +func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { + return []string{ + string(ApplicationGatewayClientRevocationOptionsNone), + string(ApplicationGatewayClientRevocationOptionsOCSP), + } +} + +func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayClientRevocationOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { + vals := map[string]ApplicationGatewayClientRevocationOptions{ + "none": ApplicationGatewayClientRevocationOptionsNone, + "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayClientRevocationOptions(input) + return &out, nil +} + +type ApplicationGatewayCookieBasedAffinity string + +const ( + ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" + ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" +) + +func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { + return []string{ + string(ApplicationGatewayCookieBasedAffinityDisabled), + string(ApplicationGatewayCookieBasedAffinityEnabled), + } +} + +func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayCookieBasedAffinity(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { + vals := map[string]ApplicationGatewayCookieBasedAffinity{ + "disabled": ApplicationGatewayCookieBasedAffinityDisabled, + "enabled": ApplicationGatewayCookieBasedAffinityEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayCookieBasedAffinity(input) + return &out, nil +} + +type ApplicationGatewayCustomErrorStatusCode string + +const ( + ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" + ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" +) + +func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { + return []string{ + string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), + string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), + } +} + +func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { + vals := map[string]ApplicationGatewayCustomErrorStatusCode{ + "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, + "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayCustomErrorStatusCode(input) + return &out, nil +} + +type ApplicationGatewayFirewallMode string + +const ( + ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" + ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" +) + +func PossibleValuesForApplicationGatewayFirewallMode() []string { + return []string{ + string(ApplicationGatewayFirewallModeDetection), + string(ApplicationGatewayFirewallModePrevention), + } +} + +func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayFirewallMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { + vals := map[string]ApplicationGatewayFirewallMode{ + "detection": ApplicationGatewayFirewallModeDetection, + "prevention": ApplicationGatewayFirewallModePrevention, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayFirewallMode(input) + return &out, nil +} + +type ApplicationGatewayLoadDistributionAlgorithm string + +const ( + ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" + ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" + ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" +) + +func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { + return []string{ + string(ApplicationGatewayLoadDistributionAlgorithmIPHash), + string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), + string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), + } +} + +func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { + vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ + "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, + "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, + "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayLoadDistributionAlgorithm(input) + return &out, nil +} + +type ApplicationGatewayOperationalState string + +const ( + ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" + ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" + ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" + ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" +) + +func PossibleValuesForApplicationGatewayOperationalState() []string { + return []string{ + string(ApplicationGatewayOperationalStateRunning), + string(ApplicationGatewayOperationalStateStarting), + string(ApplicationGatewayOperationalStateStopped), + string(ApplicationGatewayOperationalStateStopping), + } +} + +func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayOperationalState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { + vals := map[string]ApplicationGatewayOperationalState{ + "running": ApplicationGatewayOperationalStateRunning, + "starting": ApplicationGatewayOperationalStateStarting, + "stopped": ApplicationGatewayOperationalStateStopped, + "stopping": ApplicationGatewayOperationalStateStopping, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayOperationalState(input) + return &out, nil +} + +type ApplicationGatewayProtocol string + +const ( + ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" + ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" + ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" + ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" +) + +func PossibleValuesForApplicationGatewayProtocol() []string { + return []string{ + string(ApplicationGatewayProtocolHTTP), + string(ApplicationGatewayProtocolHTTPS), + string(ApplicationGatewayProtocolTcp), + string(ApplicationGatewayProtocolTls), + } +} + +func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { + vals := map[string]ApplicationGatewayProtocol{ + "http": ApplicationGatewayProtocolHTTP, + "https": ApplicationGatewayProtocolHTTPS, + "tcp": ApplicationGatewayProtocolTcp, + "tls": ApplicationGatewayProtocolTls, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayProtocol(input) + return &out, nil +} + +type ApplicationGatewayRedirectType string + +const ( + ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" + ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" + ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" + ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" +) + +func PossibleValuesForApplicationGatewayRedirectType() []string { + return []string{ + string(ApplicationGatewayRedirectTypeFound), + string(ApplicationGatewayRedirectTypePermanent), + string(ApplicationGatewayRedirectTypeSeeOther), + string(ApplicationGatewayRedirectTypeTemporary), + } +} + +func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayRedirectType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { + vals := map[string]ApplicationGatewayRedirectType{ + "found": ApplicationGatewayRedirectTypeFound, + "permanent": ApplicationGatewayRedirectTypePermanent, + "seeother": ApplicationGatewayRedirectTypeSeeOther, + "temporary": ApplicationGatewayRedirectTypeTemporary, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayRedirectType(input) + return &out, nil +} + +type ApplicationGatewayRequestRoutingRuleType string + +const ( + ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" + ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" +) + +func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { + return []string{ + string(ApplicationGatewayRequestRoutingRuleTypeBasic), + string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), + } +} + +func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { + vals := map[string]ApplicationGatewayRequestRoutingRuleType{ + "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, + "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayRequestRoutingRuleType(input) + return &out, nil +} + +type ApplicationGatewaySkuName string + +const ( + ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" + ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" + ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" + ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" + ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" + ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" + ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" +) + +func PossibleValuesForApplicationGatewaySkuName() []string { + return []string{ + string(ApplicationGatewaySkuNameStandardLarge), + string(ApplicationGatewaySkuNameStandardMedium), + string(ApplicationGatewaySkuNameStandardSmall), + string(ApplicationGatewaySkuNameStandardVTwo), + string(ApplicationGatewaySkuNameWAFLarge), + string(ApplicationGatewaySkuNameWAFMedium), + string(ApplicationGatewaySkuNameWAFVTwo), + } +} + +func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { + vals := map[string]ApplicationGatewaySkuName{ + "standard_large": ApplicationGatewaySkuNameStandardLarge, + "standard_medium": ApplicationGatewaySkuNameStandardMedium, + "standard_small": ApplicationGatewaySkuNameStandardSmall, + "standard_v2": ApplicationGatewaySkuNameStandardVTwo, + "waf_large": ApplicationGatewaySkuNameWAFLarge, + "waf_medium": ApplicationGatewaySkuNameWAFMedium, + "waf_v2": ApplicationGatewaySkuNameWAFVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySkuName(input) + return &out, nil +} + +type ApplicationGatewaySslCipherSuite string + +const ( + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" + ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" + ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" + ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" +) + +func PossibleValuesForApplicationGatewaySslCipherSuite() []string { + return []string{ + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), + string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), + } +} + +func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslCipherSuite(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { + vals := map[string]ApplicationGatewaySslCipherSuite{ + "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, + "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, + "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, + "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, + "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, + "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, + "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, + "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, + "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, + "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, + "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, + "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, + "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, + "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, + "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, + "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, + "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, + "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, + "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslCipherSuite(input) + return &out, nil +} + +type ApplicationGatewaySslPolicyName string + +const ( + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" + ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" +) + +func PossibleValuesForApplicationGatewaySslPolicyName() []string { + return []string{ + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), + string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), + } +} + +func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslPolicyName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { + vals := map[string]ApplicationGatewaySslPolicyName{ + "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, + "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, + "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, + "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, + "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslPolicyName(input) + return &out, nil +} + +type ApplicationGatewaySslPolicyType string + +const ( + ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" + ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" + ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" +) + +func PossibleValuesForApplicationGatewaySslPolicyType() []string { + return []string{ + string(ApplicationGatewaySslPolicyTypeCustom), + string(ApplicationGatewaySslPolicyTypeCustomVTwo), + string(ApplicationGatewaySslPolicyTypePredefined), + } +} + +func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslPolicyType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { + vals := map[string]ApplicationGatewaySslPolicyType{ + "custom": ApplicationGatewaySslPolicyTypeCustom, + "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, + "predefined": ApplicationGatewaySslPolicyTypePredefined, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslPolicyType(input) + return &out, nil +} + +type ApplicationGatewaySslProtocol string + +const ( + ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" + ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" + ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" + ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" +) + +func PossibleValuesForApplicationGatewaySslProtocol() []string { + return []string{ + string(ApplicationGatewaySslProtocolTLSvOneOne), + string(ApplicationGatewaySslProtocolTLSvOneThree), + string(ApplicationGatewaySslProtocolTLSvOneTwo), + string(ApplicationGatewaySslProtocolTLSvOneZero), + } +} + +func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewaySslProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { + vals := map[string]ApplicationGatewaySslProtocol{ + "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, + "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, + "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, + "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewaySslProtocol(input) + return &out, nil +} + +type ApplicationGatewayTier string + +const ( + ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" + ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" + ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" + ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" +) + +func PossibleValuesForApplicationGatewayTier() []string { + return []string{ + string(ApplicationGatewayTierStandard), + string(ApplicationGatewayTierStandardVTwo), + string(ApplicationGatewayTierWAF), + string(ApplicationGatewayTierWAFVTwo), + } +} + +func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseApplicationGatewayTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { + vals := map[string]ApplicationGatewayTier{ + "standard": ApplicationGatewayTierStandard, + "standard_v2": ApplicationGatewayTierStandardVTwo, + "waf": ApplicationGatewayTierWAF, + "waf_v2": ApplicationGatewayTierWAFVTwo, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ApplicationGatewayTier(input) + return &out, nil +} + +type DdosSettingsProtectionMode string + +const ( + DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" + DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" + DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" +) + +func PossibleValuesForDdosSettingsProtectionMode() []string { + return []string{ + string(DdosSettingsProtectionModeDisabled), + string(DdosSettingsProtectionModeEnabled), + string(DdosSettingsProtectionModeVirtualNetworkInherited), + } +} + +func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDdosSettingsProtectionMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { + vals := map[string]DdosSettingsProtectionMode{ + "disabled": DdosSettingsProtectionModeDisabled, + "enabled": DdosSettingsProtectionModeEnabled, + "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DdosSettingsProtectionMode(input) + return &out, nil +} + +type DeleteOptions string + +const ( + DeleteOptionsDelete DeleteOptions = "Delete" + DeleteOptionsDetach DeleteOptions = "Detach" +) + +func PossibleValuesForDeleteOptions() []string { + return []string{ + string(DeleteOptionsDelete), + string(DeleteOptionsDetach), + } +} + +func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeleteOptions(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeleteOptions(input string) (*DeleteOptions, error) { + vals := map[string]DeleteOptions{ + "delete": DeleteOptionsDelete, + "detach": DeleteOptionsDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeleteOptions(input) + return &out, nil +} + +type FlowLogFormatType string + +const ( + FlowLogFormatTypeJSON FlowLogFormatType = "JSON" +) + +func PossibleValuesForFlowLogFormatType() []string { + return []string{ + string(FlowLogFormatTypeJSON), + } +} + +func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseFlowLogFormatType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { + vals := map[string]FlowLogFormatType{ + "json": FlowLogFormatTypeJSON, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := FlowLogFormatType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelInterfaceType string + +const ( + GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" + GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" + GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" +) + +func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { + return []string{ + string(GatewayLoadBalancerTunnelInterfaceTypeExternal), + string(GatewayLoadBalancerTunnelInterfaceTypeInternal), + string(GatewayLoadBalancerTunnelInterfaceTypeNone), + } +} + +func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { + vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ + "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, + "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, + "none": GatewayLoadBalancerTunnelInterfaceTypeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelInterfaceType(input) + return &out, nil +} + +type GatewayLoadBalancerTunnelProtocol string + +const ( + GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" + GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" + GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" +) + +func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { + return []string{ + string(GatewayLoadBalancerTunnelProtocolNative), + string(GatewayLoadBalancerTunnelProtocolNone), + string(GatewayLoadBalancerTunnelProtocolVXLAN), + } +} + +func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { + vals := map[string]GatewayLoadBalancerTunnelProtocol{ + "native": GatewayLoadBalancerTunnelProtocolNative, + "none": GatewayLoadBalancerTunnelProtocolNone, + "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := GatewayLoadBalancerTunnelProtocol(input) + return &out, nil +} + +type IPAllocationMethod string + +const ( + IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" + IPAllocationMethodStatic IPAllocationMethod = "Static" +) + +func PossibleValuesForIPAllocationMethod() []string { + return []string{ + string(IPAllocationMethodDynamic), + string(IPAllocationMethodStatic), + } +} + +func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPAllocationMethod(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { + vals := map[string]IPAllocationMethod{ + "dynamic": IPAllocationMethodDynamic, + "static": IPAllocationMethodStatic, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPAllocationMethod(input) + return &out, nil +} + +type IPVersion string + +const ( + IPVersionIPvFour IPVersion = "IPv4" + IPVersionIPvSix IPVersion = "IPv6" +) + +func PossibleValuesForIPVersion() []string { + return []string{ + string(IPVersionIPvFour), + string(IPVersionIPvSix), + } +} + +func (s *IPVersion) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseIPVersion(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseIPVersion(input string) (*IPVersion, error) { + vals := map[string]IPVersion{ + "ipv4": IPVersionIPvFour, + "ipv6": IPVersionIPvSix, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := IPVersion(input) + return &out, nil +} + +type LoadBalancerBackendAddressAdminState string + +const ( + LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" + LoadBalancerBackendAddressAdminStateDrain LoadBalancerBackendAddressAdminState = "Drain" + LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" + LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" +) + +func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { + return []string{ + string(LoadBalancerBackendAddressAdminStateDown), + string(LoadBalancerBackendAddressAdminStateDrain), + string(LoadBalancerBackendAddressAdminStateNone), + string(LoadBalancerBackendAddressAdminStateUp), + } +} + +func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseLoadBalancerBackendAddressAdminState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { + vals := map[string]LoadBalancerBackendAddressAdminState{ + "down": LoadBalancerBackendAddressAdminStateDown, + "drain": LoadBalancerBackendAddressAdminStateDrain, + "none": LoadBalancerBackendAddressAdminStateNone, + "up": LoadBalancerBackendAddressAdminStateUp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := LoadBalancerBackendAddressAdminState(input) + return &out, nil +} + +type ManagedRuleEnabledState string + +const ( + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" +) + +func PossibleValuesForManagedRuleEnabledState() []string { + return []string{ + string(ManagedRuleEnabledStateDisabled), + string(ManagedRuleEnabledStateEnabled), + } +} + +func (s *ManagedRuleEnabledState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseManagedRuleEnabledState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseManagedRuleEnabledState(input string) (*ManagedRuleEnabledState, error) { + vals := map[string]ManagedRuleEnabledState{ + "disabled": ManagedRuleEnabledStateDisabled, + "enabled": ManagedRuleEnabledStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ManagedRuleEnabledState(input) + return &out, nil +} + +type NatGatewaySkuName string + +const ( + NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" +) + +func PossibleValuesForNatGatewaySkuName() []string { + return []string{ + string(NatGatewaySkuNameStandard), + } +} + +func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNatGatewaySkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { + vals := map[string]NatGatewaySkuName{ + "standard": NatGatewaySkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NatGatewaySkuName(input) + return &out, nil +} + +type NetworkInterfaceAuxiliaryMode string + +const ( + NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" + NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" + NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" +) + +func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { + return []string{ + string(NetworkInterfaceAuxiliaryModeFloating), + string(NetworkInterfaceAuxiliaryModeMaxConnections), + string(NetworkInterfaceAuxiliaryModeNone), + } +} + +func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceAuxiliaryMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { + vals := map[string]NetworkInterfaceAuxiliaryMode{ + "floating": NetworkInterfaceAuxiliaryModeFloating, + "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, + "none": NetworkInterfaceAuxiliaryModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceAuxiliaryMode(input) + return &out, nil +} + +type NetworkInterfaceMigrationPhase string + +const ( + NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" + NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" + NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" + NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" + NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" +) + +func PossibleValuesForNetworkInterfaceMigrationPhase() []string { + return []string{ + string(NetworkInterfaceMigrationPhaseAbort), + string(NetworkInterfaceMigrationPhaseCommit), + string(NetworkInterfaceMigrationPhaseCommitted), + string(NetworkInterfaceMigrationPhaseNone), + string(NetworkInterfaceMigrationPhasePrepare), + } +} + +func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { + vals := map[string]NetworkInterfaceMigrationPhase{ + "abort": NetworkInterfaceMigrationPhaseAbort, + "commit": NetworkInterfaceMigrationPhaseCommit, + "committed": NetworkInterfaceMigrationPhaseCommitted, + "none": NetworkInterfaceMigrationPhaseNone, + "prepare": NetworkInterfaceMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceMigrationPhase(input) + return &out, nil +} + +type NetworkInterfaceNicType string + +const ( + NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" + NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" +) + +func PossibleValuesForNetworkInterfaceNicType() []string { + return []string{ + string(NetworkInterfaceNicTypeElastic), + string(NetworkInterfaceNicTypeStandard), + } +} + +func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseNetworkInterfaceNicType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { + vals := map[string]NetworkInterfaceNicType{ + "elastic": NetworkInterfaceNicTypeElastic, + "standard": NetworkInterfaceNicTypeStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := NetworkInterfaceNicType(input) + return &out, nil +} + +type OwaspCrsExclusionEntryMatchVariable string + +const ( + OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" + OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" + OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" + OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" + OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" + OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" + OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" + OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" + OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" +) + +func PossibleValuesForOwaspCrsExclusionEntryMatchVariable() []string { + return []string{ + string(OwaspCrsExclusionEntryMatchVariableRequestArgKeys), + string(OwaspCrsExclusionEntryMatchVariableRequestArgNames), + string(OwaspCrsExclusionEntryMatchVariableRequestArgValues), + string(OwaspCrsExclusionEntryMatchVariableRequestCookieKeys), + string(OwaspCrsExclusionEntryMatchVariableRequestCookieNames), + string(OwaspCrsExclusionEntryMatchVariableRequestCookieValues), + string(OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys), + string(OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), + string(OwaspCrsExclusionEntryMatchVariableRequestHeaderValues), + } +} + +func (s *OwaspCrsExclusionEntryMatchVariable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOwaspCrsExclusionEntryMatchVariable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOwaspCrsExclusionEntryMatchVariable(input string) (*OwaspCrsExclusionEntryMatchVariable, error) { + vals := map[string]OwaspCrsExclusionEntryMatchVariable{ + "requestargkeys": OwaspCrsExclusionEntryMatchVariableRequestArgKeys, + "requestargnames": OwaspCrsExclusionEntryMatchVariableRequestArgNames, + "requestargvalues": OwaspCrsExclusionEntryMatchVariableRequestArgValues, + "requestcookiekeys": OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, + "requestcookienames": OwaspCrsExclusionEntryMatchVariableRequestCookieNames, + "requestcookievalues": OwaspCrsExclusionEntryMatchVariableRequestCookieValues, + "requestheaderkeys": OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, + "requestheadernames": OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, + "requestheadervalues": OwaspCrsExclusionEntryMatchVariableRequestHeaderValues, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OwaspCrsExclusionEntryMatchVariable(input) + return &out, nil +} + +type OwaspCrsExclusionEntrySelectorMatchOperator string + +const ( + OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" + OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" + OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" + OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" + OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" +) + +func PossibleValuesForOwaspCrsExclusionEntrySelectorMatchOperator() []string { + return []string{ + string(OwaspCrsExclusionEntrySelectorMatchOperatorContains), + string(OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), + string(OwaspCrsExclusionEntrySelectorMatchOperatorEquals), + string(OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny), + string(OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), + } +} + +func (s *OwaspCrsExclusionEntrySelectorMatchOperator) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseOwaspCrsExclusionEntrySelectorMatchOperator(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseOwaspCrsExclusionEntrySelectorMatchOperator(input string) (*OwaspCrsExclusionEntrySelectorMatchOperator, error) { + vals := map[string]OwaspCrsExclusionEntrySelectorMatchOperator{ + "contains": OwaspCrsExclusionEntrySelectorMatchOperatorContains, + "endswith": OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, + "equals": OwaspCrsExclusionEntrySelectorMatchOperatorEquals, + "equalsany": OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, + "startswith": OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := OwaspCrsExclusionEntrySelectorMatchOperator(input) + return &out, nil +} + +type ProvisioningState string + +const ( + ProvisioningStateDeleting ProvisioningState = "Deleting" + ProvisioningStateFailed ProvisioningState = "Failed" + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +func PossibleValuesForProvisioningState() []string { + return []string{ + string(ProvisioningStateDeleting), + string(ProvisioningStateFailed), + string(ProvisioningStateSucceeded), + string(ProvisioningStateUpdating), + } +} + +func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseProvisioningState(input string) (*ProvisioningState, error) { + vals := map[string]ProvisioningState{ + "deleting": ProvisioningStateDeleting, + "failed": ProvisioningStateFailed, + "succeeded": ProvisioningStateSucceeded, + "updating": ProvisioningStateUpdating, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ProvisioningState(input) + return &out, nil +} + +type PublicIPAddressMigrationPhase string + +const ( + PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" + PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" + PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" + PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" + PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" +) + +func PossibleValuesForPublicIPAddressMigrationPhase() []string { + return []string{ + string(PublicIPAddressMigrationPhaseAbort), + string(PublicIPAddressMigrationPhaseCommit), + string(PublicIPAddressMigrationPhaseCommitted), + string(PublicIPAddressMigrationPhaseNone), + string(PublicIPAddressMigrationPhasePrepare), + } +} + +func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressMigrationPhase(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { + vals := map[string]PublicIPAddressMigrationPhase{ + "abort": PublicIPAddressMigrationPhaseAbort, + "commit": PublicIPAddressMigrationPhaseCommit, + "committed": PublicIPAddressMigrationPhaseCommitted, + "none": PublicIPAddressMigrationPhaseNone, + "prepare": PublicIPAddressMigrationPhasePrepare, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressMigrationPhase(input) + return &out, nil +} + +type PublicIPAddressSkuName string + +const ( + PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" + PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" +) + +func PossibleValuesForPublicIPAddressSkuName() []string { + return []string{ + string(PublicIPAddressSkuNameBasic), + string(PublicIPAddressSkuNameStandard), + } +} + +func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuName(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { + vals := map[string]PublicIPAddressSkuName{ + "basic": PublicIPAddressSkuNameBasic, + "standard": PublicIPAddressSkuNameStandard, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuName(input) + return &out, nil +} + +type PublicIPAddressSkuTier string + +const ( + PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" + PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" +) + +func PossibleValuesForPublicIPAddressSkuTier() []string { + return []string{ + string(PublicIPAddressSkuTierGlobal), + string(PublicIPAddressSkuTierRegional), + } +} + +func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parsePublicIPAddressSkuTier(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { + vals := map[string]PublicIPAddressSkuTier{ + "global": PublicIPAddressSkuTierGlobal, + "regional": PublicIPAddressSkuTierRegional, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := PublicIPAddressSkuTier(input) + return &out, nil +} + +type RouteNextHopType string + +const ( + RouteNextHopTypeInternet RouteNextHopType = "Internet" + RouteNextHopTypeNone RouteNextHopType = "None" + RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" + RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" + RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" +) + +func PossibleValuesForRouteNextHopType() []string { + return []string{ + string(RouteNextHopTypeInternet), + string(RouteNextHopTypeNone), + string(RouteNextHopTypeVirtualAppliance), + string(RouteNextHopTypeVirtualNetworkGateway), + string(RouteNextHopTypeVnetLocal), + } +} + +func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseRouteNextHopType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseRouteNextHopType(input string) (*RouteNextHopType, error) { + vals := map[string]RouteNextHopType{ + "internet": RouteNextHopTypeInternet, + "none": RouteNextHopTypeNone, + "virtualappliance": RouteNextHopTypeVirtualAppliance, + "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, + "vnetlocal": RouteNextHopTypeVnetLocal, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := RouteNextHopType(input) + return &out, nil +} + +type SecurityRuleAccess string + +const ( + SecurityRuleAccessAllow SecurityRuleAccess = "Allow" + SecurityRuleAccessDeny SecurityRuleAccess = "Deny" +) + +func PossibleValuesForSecurityRuleAccess() []string { + return []string{ + string(SecurityRuleAccessAllow), + string(SecurityRuleAccessDeny), + } +} + +func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleAccess(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { + vals := map[string]SecurityRuleAccess{ + "allow": SecurityRuleAccessAllow, + "deny": SecurityRuleAccessDeny, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleAccess(input) + return &out, nil +} + +type SecurityRuleDirection string + +const ( + SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" + SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" +) + +func PossibleValuesForSecurityRuleDirection() []string { + return []string{ + string(SecurityRuleDirectionInbound), + string(SecurityRuleDirectionOutbound), + } +} + +func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleDirection(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { + vals := map[string]SecurityRuleDirection{ + "inbound": SecurityRuleDirectionInbound, + "outbound": SecurityRuleDirectionOutbound, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleDirection(input) + return &out, nil +} + +type SecurityRuleProtocol string + +const ( + SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" + SecurityRuleProtocolAny SecurityRuleProtocol = "*" + SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" + SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" + SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" + SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" +) + +func PossibleValuesForSecurityRuleProtocol() []string { + return []string{ + string(SecurityRuleProtocolAh), + string(SecurityRuleProtocolAny), + string(SecurityRuleProtocolEsp), + string(SecurityRuleProtocolIcmp), + string(SecurityRuleProtocolTcp), + string(SecurityRuleProtocolUdp), + } +} + +func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseSecurityRuleProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { + vals := map[string]SecurityRuleProtocol{ + "ah": SecurityRuleProtocolAh, + "*": SecurityRuleProtocolAny, + "esp": SecurityRuleProtocolEsp, + "icmp": SecurityRuleProtocolIcmp, + "tcp": SecurityRuleProtocolTcp, + "udp": SecurityRuleProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := SecurityRuleProtocol(input) + return &out, nil +} + +type TransportProtocol string + +const ( + TransportProtocolAll TransportProtocol = "All" + TransportProtocolTcp TransportProtocol = "Tcp" + TransportProtocolUdp TransportProtocol = "Udp" +) + +func PossibleValuesForTransportProtocol() []string { + return []string{ + string(TransportProtocolAll), + string(TransportProtocolTcp), + string(TransportProtocolUdp), + } +} + +func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseTransportProtocol(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseTransportProtocol(input string) (*TransportProtocol, error) { + vals := map[string]TransportProtocol{ + "all": TransportProtocolAll, + "tcp": TransportProtocolTcp, + "udp": TransportProtocolUdp, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := TransportProtocol(input) + return &out, nil +} + +type VirtualNetworkPrivateEndpointNetworkPolicies string + +const ( + VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" + VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), + string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ + "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateEndpointNetworkPolicies(input) + return &out, nil +} + +type VirtualNetworkPrivateLinkServiceNetworkPolicies string + +const ( + VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" + VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" +) + +func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { + return []string{ + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), + string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), + } +} + +func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { + vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ + "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, + "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) + return &out, nil +} + +type WebApplicationFirewallAction string + +const ( + WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" + WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" + WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" +) + +func PossibleValuesForWebApplicationFirewallAction() []string { + return []string{ + string(WebApplicationFirewallActionAllow), + string(WebApplicationFirewallActionBlock), + string(WebApplicationFirewallActionLog), + } +} + +func (s *WebApplicationFirewallAction) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallAction(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallAction(input string) (*WebApplicationFirewallAction, error) { + vals := map[string]WebApplicationFirewallAction{ + "allow": WebApplicationFirewallActionAllow, + "block": WebApplicationFirewallActionBlock, + "log": WebApplicationFirewallActionLog, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallAction(input) + return &out, nil +} + +type WebApplicationFirewallEnabledState string + +const ( + WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" + WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" +) + +func PossibleValuesForWebApplicationFirewallEnabledState() []string { + return []string{ + string(WebApplicationFirewallEnabledStateDisabled), + string(WebApplicationFirewallEnabledStateEnabled), + } +} + +func (s *WebApplicationFirewallEnabledState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallEnabledState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallEnabledState(input string) (*WebApplicationFirewallEnabledState, error) { + vals := map[string]WebApplicationFirewallEnabledState{ + "disabled": WebApplicationFirewallEnabledStateDisabled, + "enabled": WebApplicationFirewallEnabledStateEnabled, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallEnabledState(input) + return &out, nil +} + +type WebApplicationFirewallMatchVariable string + +const ( + WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" + WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" + WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" + WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" + WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" + WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" + WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" + WebApplicationFirewallMatchVariableRequestUri WebApplicationFirewallMatchVariable = "RequestUri" +) + +func PossibleValuesForWebApplicationFirewallMatchVariable() []string { + return []string{ + string(WebApplicationFirewallMatchVariablePostArgs), + string(WebApplicationFirewallMatchVariableQueryString), + string(WebApplicationFirewallMatchVariableRemoteAddr), + string(WebApplicationFirewallMatchVariableRequestBody), + string(WebApplicationFirewallMatchVariableRequestCookies), + string(WebApplicationFirewallMatchVariableRequestHeaders), + string(WebApplicationFirewallMatchVariableRequestMethod), + string(WebApplicationFirewallMatchVariableRequestUri), + } +} + +func (s *WebApplicationFirewallMatchVariable) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallMatchVariable(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallMatchVariable(input string) (*WebApplicationFirewallMatchVariable, error) { + vals := map[string]WebApplicationFirewallMatchVariable{ + "postargs": WebApplicationFirewallMatchVariablePostArgs, + "querystring": WebApplicationFirewallMatchVariableQueryString, + "remoteaddr": WebApplicationFirewallMatchVariableRemoteAddr, + "requestbody": WebApplicationFirewallMatchVariableRequestBody, + "requestcookies": WebApplicationFirewallMatchVariableRequestCookies, + "requestheaders": WebApplicationFirewallMatchVariableRequestHeaders, + "requestmethod": WebApplicationFirewallMatchVariableRequestMethod, + "requesturi": WebApplicationFirewallMatchVariableRequestUri, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallMatchVariable(input) + return &out, nil +} + +type WebApplicationFirewallMode string + +const ( + WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" + WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" +) + +func PossibleValuesForWebApplicationFirewallMode() []string { + return []string{ + string(WebApplicationFirewallModeDetection), + string(WebApplicationFirewallModePrevention), + } +} + +func (s *WebApplicationFirewallMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallMode(input string) (*WebApplicationFirewallMode, error) { + vals := map[string]WebApplicationFirewallMode{ + "detection": WebApplicationFirewallModeDetection, + "prevention": WebApplicationFirewallModePrevention, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallMode(input) + return &out, nil +} + +type WebApplicationFirewallOperator string + +const ( + WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" + WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" + WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" + WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" + WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" + WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" + WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" + WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" + WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" + WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" + WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" + WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" +) + +func PossibleValuesForWebApplicationFirewallOperator() []string { + return []string{ + string(WebApplicationFirewallOperatorAny), + string(WebApplicationFirewallOperatorBeginsWith), + string(WebApplicationFirewallOperatorContains), + string(WebApplicationFirewallOperatorEndsWith), + string(WebApplicationFirewallOperatorEqual), + string(WebApplicationFirewallOperatorGeoMatch), + string(WebApplicationFirewallOperatorGreaterThan), + string(WebApplicationFirewallOperatorGreaterThanOrEqual), + string(WebApplicationFirewallOperatorIPMatch), + string(WebApplicationFirewallOperatorLessThan), + string(WebApplicationFirewallOperatorLessThanOrEqual), + string(WebApplicationFirewallOperatorRegex), + } +} + +func (s *WebApplicationFirewallOperator) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallOperator(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallOperator(input string) (*WebApplicationFirewallOperator, error) { + vals := map[string]WebApplicationFirewallOperator{ + "any": WebApplicationFirewallOperatorAny, + "beginswith": WebApplicationFirewallOperatorBeginsWith, + "contains": WebApplicationFirewallOperatorContains, + "endswith": WebApplicationFirewallOperatorEndsWith, + "equal": WebApplicationFirewallOperatorEqual, + "geomatch": WebApplicationFirewallOperatorGeoMatch, + "greaterthan": WebApplicationFirewallOperatorGreaterThan, + "greaterthanorequal": WebApplicationFirewallOperatorGreaterThanOrEqual, + "ipmatch": WebApplicationFirewallOperatorIPMatch, + "lessthan": WebApplicationFirewallOperatorLessThan, + "lessthanorequal": WebApplicationFirewallOperatorLessThanOrEqual, + "regex": WebApplicationFirewallOperatorRegex, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallOperator(input) + return &out, nil +} + +type WebApplicationFirewallPolicyResourceState string + +const ( + WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" + WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" + WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" + WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" + WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" + WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" +) + +func PossibleValuesForWebApplicationFirewallPolicyResourceState() []string { + return []string{ + string(WebApplicationFirewallPolicyResourceStateCreating), + string(WebApplicationFirewallPolicyResourceStateDeleting), + string(WebApplicationFirewallPolicyResourceStateDisabled), + string(WebApplicationFirewallPolicyResourceStateDisabling), + string(WebApplicationFirewallPolicyResourceStateEnabled), + string(WebApplicationFirewallPolicyResourceStateEnabling), + } +} + +func (s *WebApplicationFirewallPolicyResourceState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallPolicyResourceState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallPolicyResourceState(input string) (*WebApplicationFirewallPolicyResourceState, error) { + vals := map[string]WebApplicationFirewallPolicyResourceState{ + "creating": WebApplicationFirewallPolicyResourceStateCreating, + "deleting": WebApplicationFirewallPolicyResourceStateDeleting, + "disabled": WebApplicationFirewallPolicyResourceStateDisabled, + "disabling": WebApplicationFirewallPolicyResourceStateDisabling, + "enabled": WebApplicationFirewallPolicyResourceStateEnabled, + "enabling": WebApplicationFirewallPolicyResourceStateEnabling, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallPolicyResourceState(input) + return &out, nil +} + +type WebApplicationFirewallRuleType string + +const ( + WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" + WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" +) + +func PossibleValuesForWebApplicationFirewallRuleType() []string { + return []string{ + string(WebApplicationFirewallRuleTypeInvalid), + string(WebApplicationFirewallRuleTypeMatchRule), + } +} + +func (s *WebApplicationFirewallRuleType) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallRuleType(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallRuleType(input string) (*WebApplicationFirewallRuleType, error) { + vals := map[string]WebApplicationFirewallRuleType{ + "invalid": WebApplicationFirewallRuleTypeInvalid, + "matchrule": WebApplicationFirewallRuleTypeMatchRule, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallRuleType(input) + return &out, nil +} + +type WebApplicationFirewallTransform string + +const ( + WebApplicationFirewallTransformHtmlEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" + WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" + WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" + WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" + WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" + WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" + WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" +) + +func PossibleValuesForWebApplicationFirewallTransform() []string { + return []string{ + string(WebApplicationFirewallTransformHtmlEntityDecode), + string(WebApplicationFirewallTransformLowercase), + string(WebApplicationFirewallTransformRemoveNulls), + string(WebApplicationFirewallTransformTrim), + string(WebApplicationFirewallTransformUppercase), + string(WebApplicationFirewallTransformUrlDecode), + string(WebApplicationFirewallTransformUrlEncode), + } +} + +func (s *WebApplicationFirewallTransform) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseWebApplicationFirewallTransform(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewallTransform, error) { + vals := map[string]WebApplicationFirewallTransform{ + "htmlentitydecode": WebApplicationFirewallTransformHtmlEntityDecode, + "lowercase": WebApplicationFirewallTransformLowercase, + "removenulls": WebApplicationFirewallTransformRemoveNulls, + "trim": WebApplicationFirewallTransformTrim, + "uppercase": WebApplicationFirewallTransformUppercase, + "urldecode": WebApplicationFirewallTransformUrlDecode, + "urlencode": WebApplicationFirewallTransformUrlEncode, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := WebApplicationFirewallTransform(input) + return &out, nil +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_createorupdate.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_createorupdate.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_createorupdate.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_createorupdate.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_delete.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_delete.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_delete.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_delete.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_get.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_get.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_get.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_list.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_list.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_list.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_list.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_listall.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_listall.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/method_listall.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/method_listall.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgateway.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgateway.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgateway.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go new file mode 100644 index 00000000000..4535447263c --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go @@ -0,0 +1,42 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ApplicationGatewayPropertiesFormat struct { + AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` + AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` + BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` + BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` + BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` + CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` + EnableFips *bool `json:"enableFips,omitempty"` + EnableHTTP2 *bool `json:"enableHttp2,omitempty"` + FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` + ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` + FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` + FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` + GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` + GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` + HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` + Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` + LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` + OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` + PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` + Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` + RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` + RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` + Sku *ApplicationGatewaySku `json:"sku,omitempty"` + SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` + SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` + SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` + TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` + TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` + UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` + WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_backendaddresspool.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_backendaddresspool.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_backendaddresspool.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_backendaddresspool.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go new file mode 100644 index 00000000000..d3079086b6c --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go @@ -0,0 +1,18 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type BackendAddressPoolPropertiesFormat struct { + BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` + DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` + InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` + LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` + LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` + Location *string `json:"location,omitempty"` + OutboundRule *SubResource `json:"outboundRule,omitempty"` + OutboundRules *[]SubResource `json:"outboundRules,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` + VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ddossettings.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ddossettings.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ddossettings.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ddossettings.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_delegation.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_delegation.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_delegation.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_delegation.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_flowlog.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_flowlog.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_flowlog.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_flowlog.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_inboundnatrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_inboundnatrule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_inboundnatrule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_inboundnatrule.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_iptag.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_iptag.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_iptag.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_iptag.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedruleoverride.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedruleoverride.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedruleoverride.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedruleoverride.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedruleset.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedruleset.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_managedruleset.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_managedruleset.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_matchcondition.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_matchcondition.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_matchcondition.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_matchcondition.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_matchvariable.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_matchvariable.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_matchvariable.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_matchvariable.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natgateway.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natgateway.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natgateway.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natgateway.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natgatewaysku.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natgatewaysku.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natgatewaysku.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natgatewaysku.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natruleportmapping.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natruleportmapping.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_natruleportmapping.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_natruleportmapping.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterface.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterface.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterface.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterface.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go new file mode 100644 index 00000000000..2903b80c29d --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go @@ -0,0 +1,28 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type NetworkInterfacePropertiesFormat struct { + AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` + DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` + DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` + DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` + EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` + EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` + HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` + IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` + MacAddress *string `json:"macAddress,omitempty"` + MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` + Primary *bool `json:"primary,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + ResourceGuid *string `json:"resourceGuid,omitempty"` + TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` + VirtualMachine *SubResource `json:"virtualMachine,omitempty"` + VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` + WorkloadType *string `json:"workloadType,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networksecuritygroup.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networksecuritygroup.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networksecuritygroup.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networksecuritygroup.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_policysettings.go new file mode 100644 index 00000000000..801aaef1aa3 --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_policysettings.go @@ -0,0 +1,14 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PolicySettings struct { + CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` + CustomBlockResponseStatusCode *int64 `json:"customBlockResponseStatusCode,omitempty"` + FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` + MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` + Mode *WebApplicationFirewallMode `json:"mode,omitempty"` + RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` + State *WebApplicationFirewallEnabledState `json:"state,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpoint.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpoint.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpoint.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpoint.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointconnection.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointconnection.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointconnection.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go new file mode 100644 index 00000000000..df004959290 --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go @@ -0,0 +1,11 @@ +package webapplicationfirewallpolicies + +// 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 { + LinkIdentifier *string `json:"linkIdentifier,omitempty"` + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privateendpointproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkservice.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkservice.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkservice.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkservice.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddress.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddress.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddress.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddress.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go new file mode 100644 index 00000000000..db15b0f9aab --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go @@ -0,0 +1,10 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type PublicIPAddressDnsSettings struct { + DomainNameLabel *string `json:"domainNameLabel,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + ReverseFqdn *string `json:"reverseFqdn,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddresssku.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddresssku.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddresssku.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_publicipaddresssku.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_resourceset.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_resourceset.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_resourceset.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_resourceset.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_route.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_route.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_route.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_route.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_routepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_routepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_routepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_routepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_routetable.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_routetable.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_routetable.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_routetable.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_securityrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_securityrule.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_securityrule.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_securityrule.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go new file mode 100644 index 00000000000..a1c193d96ce --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go @@ -0,0 +1,23 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SecurityRulePropertiesFormat struct { + Access SecurityRuleAccess `json:"access"` + Description *string `json:"description,omitempty"` + DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` + DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` + DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` + DestinationPortRange *string `json:"destinationPortRange,omitempty"` + DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` + Direction SecurityRuleDirection `json:"direction"` + Priority *int64 `json:"priority,omitempty"` + Protocol SecurityRuleProtocol `json:"protocol"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` + SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` + SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` + SourcePortRange *string `json:"sourcePortRange,omitempty"` + SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceassociationlink.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceassociationlink.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceassociationlink.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceassociationlink.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subnet.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subnet.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subnet.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subnet.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go new file mode 100644 index 00000000000..da319769f2c --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go @@ -0,0 +1,26 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type SubnetPropertiesFormat struct { + AddressPrefix *string `json:"addressPrefix,omitempty"` + AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` + ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIpConfigurations,omitempty"` + Delegations *[]Delegation `json:"delegations,omitempty"` + IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` + IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` + IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` + NatGateway *SubResource `json:"natGateway,omitempty"` + NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` + PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` + PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` + PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` + ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` + Purpose *string `json:"purpose,omitempty"` + ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` + RouteTable *RouteTable `json:"routeTable,omitempty"` + ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` + ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` + ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subresource.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subresource.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subresource.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_subresource.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_virtualnetworktap.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_virtualnetworktap.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_virtualnetworktap.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_virtualnetworktap.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go new file mode 100644 index 00000000000..3dd59404536 --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go @@ -0,0 +1,13 @@ +package webapplicationfirewallpolicies + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type WebApplicationFirewallCustomRule struct { + Action WebApplicationFirewallAction `json:"action"` + Etag *string `json:"etag,omitempty"` + MatchConditions []MatchCondition `json:"matchConditions"` + Name *string `json:"name,omitempty"` + Priority int64 `json:"priority"` + RuleType WebApplicationFirewallRuleType `json:"ruleType"` +} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/predicates.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/webapplicationfirewallpolicies/predicates.go rename to resource-manager/network/2022-07-01/webapplicationfirewallpolicies/predicates.go diff --git a/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/version.go b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/version.go new file mode 100644 index 00000000000..5df9c2b9158 --- /dev/null +++ b/resource-manager/network/2022-07-01/webapplicationfirewallpolicies/version.go @@ -0,0 +1,12 @@ +package webapplicationfirewallpolicies + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/webapplicationfirewallpolicies/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2022-07-01/webcategories/README.md b/resource-manager/network/2022-07-01/webcategories/README.md new file mode 100644 index 00000000000..b9472f2a2e3 --- /dev/null +++ b/resource-manager/network/2022-07-01/webcategories/README.md @@ -0,0 +1,54 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2022-07-01/webcategories` Documentation + +The `webcategories` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2022-07-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/network/2022-07-01/webcategories" +``` + + +### Client Initialization + +```go +client := webcategories.NewWebCategoriesClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `WebCategoriesClient.Get` + +```go +ctx := context.TODO() +id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue") + +read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `WebCategoriesClient.ListBySubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListBySubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` diff --git a/resource-manager/network/2023-04-01/webcategories/client.go b/resource-manager/network/2022-07-01/webcategories/client.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/client.go rename to resource-manager/network/2022-07-01/webcategories/client.go diff --git a/resource-manager/network/2023-04-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2022-07-01/webcategories/id_azurewebcategory.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/id_azurewebcategory.go rename to resource-manager/network/2022-07-01/webcategories/id_azurewebcategory.go diff --git a/resource-manager/network/2023-04-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2022-07-01/webcategories/id_azurewebcategory_test.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/id_azurewebcategory_test.go rename to resource-manager/network/2022-07-01/webcategories/id_azurewebcategory_test.go diff --git a/resource-manager/network/2023-04-01/webcategories/method_get.go b/resource-manager/network/2022-07-01/webcategories/method_get.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/method_get.go rename to resource-manager/network/2022-07-01/webcategories/method_get.go diff --git a/resource-manager/network/2023-04-01/webcategories/method_listbysubscription.go b/resource-manager/network/2022-07-01/webcategories/method_listbysubscription.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/method_listbysubscription.go rename to resource-manager/network/2022-07-01/webcategories/method_listbysubscription.go diff --git a/resource-manager/network/2023-04-01/webcategories/model_azurewebcategory.go b/resource-manager/network/2022-07-01/webcategories/model_azurewebcategory.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/model_azurewebcategory.go rename to resource-manager/network/2022-07-01/webcategories/model_azurewebcategory.go diff --git a/resource-manager/network/2023-04-01/webcategories/model_azurewebcategorypropertiesformat.go b/resource-manager/network/2022-07-01/webcategories/model_azurewebcategorypropertiesformat.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/model_azurewebcategorypropertiesformat.go rename to resource-manager/network/2022-07-01/webcategories/model_azurewebcategorypropertiesformat.go diff --git a/resource-manager/network/2023-04-01/webcategories/predicates.go b/resource-manager/network/2022-07-01/webcategories/predicates.go similarity index 100% rename from resource-manager/network/2023-04-01/webcategories/predicates.go rename to resource-manager/network/2022-07-01/webcategories/predicates.go diff --git a/resource-manager/network/2022-07-01/webcategories/version.go b/resource-manager/network/2022-07-01/webcategories/version.go new file mode 100644 index 00000000000..93a97fdefa2 --- /dev/null +++ b/resource-manager/network/2022-07-01/webcategories/version.go @@ -0,0 +1,12 @@ +package webcategories + +import "fmt" + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +const defaultApiVersion = "2022-07-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/webcategories/%s", defaultApiVersion) +} diff --git a/resource-manager/network/2023-04-01/adminrulecollections/README.md b/resource-manager/network/2023-04-01/adminrulecollections/README.md deleted file mode 100644 index 7c3f8451b92..00000000000 --- a/resource-manager/network/2023-04-01/adminrulecollections/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/adminrulecollections` Documentation - -The `adminrulecollections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/adminrulecollections" -``` - - -### Client Initialization - -```go -client := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdminRuleCollectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -payload := adminrulecollections.AdminRuleCollection{ - // ... -} - - -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: `AdminRuleCollectionsClient.Delete` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AdminRuleCollectionsClient.Get` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -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: `AdminRuleCollectionsClient.List` - -```go -ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -// alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go b/resource-manager/network/2023-04-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go deleted file mode 100644 index 43e02d8ca9c..00000000000 --- a/resource-manager/network/2023-04-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminRuleCollectionPropertiesFormat struct { - AppliesToGroups []NetworkManagerSecurityGroupItem `json:"appliesToGroups"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/adminrulecollections/version.go b/resource-manager/network/2023-04-01/adminrulecollections/version.go deleted file mode 100644 index 682a0a8aacd..00000000000 --- a/resource-manager/network/2023-04-01/adminrulecollections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrulecollections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/adminrulecollections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/adminrules/README.md b/resource-manager/network/2023-04-01/adminrules/README.md deleted file mode 100644 index 5db8d0c9d22..00000000000 --- a/resource-manager/network/2023-04-01/adminrules/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/adminrules` Documentation - -The `adminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/adminrules" -``` - - -### Client Initialization - -```go -client := adminrules.NewAdminRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdminRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -payload := adminrules.BaseAdminRule{ - // ... -} - - -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: `AdminRulesClient.Delete` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AdminRulesClient.Get` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -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: `AdminRulesClient.List` - -```go -ctx := context.TODO() -id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -// 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/network/2023-04-01/adminrules/model_adminpropertiesformat.go b/resource-manager/network/2023-04-01/adminrules/model_adminpropertiesformat.go deleted file mode 100644 index a0e21af6c0d..00000000000 --- a/resource-manager/network/2023-04-01/adminrules/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/adminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-04-01/adminrules/model_defaultadminpropertiesformat.go deleted file mode 100644 index a8242069c88..00000000000 --- a/resource-manager/network/2023-04-01/adminrules/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/adminrules/version.go b/resource-manager/network/2023-04-01/adminrules/version.go deleted file mode 100644 index 06293a3925d..00000000000 --- a/resource-manager/network/2023-04-01/adminrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/adminrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/README.md deleted file mode 100644 index 01c9354ba11..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections` Documentation - -The `applicationgatewayprivateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/applicationgatewayprivateendpointconnections" -``` - - -### Client Initialization - -```go -client := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Get` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -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: `ApplicationGatewayPrivateEndpointConnectionsClient.List` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -// 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: `ApplicationGatewayPrivateEndpointConnectionsClient.Update` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/constants.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/constants.go deleted file mode 100644 index 815302663c9..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index d3eb3749cba..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 4b7b529ab7d..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index f1877976742..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go deleted file mode 100644 index 38e3265c5cf..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go deleted file mode 100644 index ad268f42e3d..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go deleted file mode 100644 index 7d4289b8ec2..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/version.go b/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/version.go deleted file mode 100644 index 7b97227680c..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivateendpointconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/README.md b/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/README.md deleted file mode 100644 index 7b1411315ce..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources` Documentation - -The `applicationgatewayprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/applicationgatewayprivatelinkresources" -``` - - -### Client Initialization - -```go -client := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayPrivateLinkResourcesClient.List` - -```go -ctx := context.TODO() -id := applicationgatewayprivatelinkresources.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -// 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/network/2023-04-01/applicationgatewayprivatelinkresources/version.go b/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/version.go deleted file mode 100644 index f2b689b4cf4..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/README.md b/resource-manager/network/2023-04-01/applicationgateways/README.md deleted file mode 100644 index 75c450f11a0..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/README.md +++ /dev/null @@ -1,287 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgateways` Documentation - -The `applicationgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/applicationgateways" -``` - - -### Client Initialization - -```go -client := applicationgateways.NewApplicationGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewaysClient.BackendHealth` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.BackendHealthThenPoll(ctx, id, applicationgateways.DefaultBackendHealthOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.BackendHealthOnDemand` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.ApplicationGatewayOnDemandProbe{ - // ... -} - - -if err := client.BackendHealthOnDemandThenPoll(ctx, id, payload, applicationgateways.DefaultBackendHealthOnDemandOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.ApplicationGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Get` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -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: `ApplicationGatewaysClient.GetSslPredefinedPolicy` - -```go -ctx := context.TODO() -id := applicationgateways.NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue") - -read, err := client.GetSslPredefinedPolicy(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ApplicationGatewaysClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableRequestHeaders` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableRequestHeaders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableResponseHeaders` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableResponseHeaders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableServerVariables` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableServerVariables(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableSslOptions` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableSslOptions(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAvailableSslPredefinedPolicies(ctx, id)` can be used to do batched pagination -items, err := client.ListAvailableSslPredefinedPoliciesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableWafRuleSets` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableWafRuleSets(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Start` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Stop` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.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/network/2023-04-01/applicationgateways/constants.go b/resource-manager/network/2023-04-01/applicationgateways/constants.go deleted file mode 100644 index 7fe9ed5e6fa..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/constants.go +++ /dev/null @@ -1,2119 +0,0 @@ -package applicationgateways - -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 ApplicationGatewayBackendHealthServerHealth string - -const ( - ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" - ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" - ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" - ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" -) - -func PossibleValuesForApplicationGatewayBackendHealthServerHealth() []string { - return []string{ - string(ApplicationGatewayBackendHealthServerHealthDown), - string(ApplicationGatewayBackendHealthServerHealthDraining), - string(ApplicationGatewayBackendHealthServerHealthPartial), - string(ApplicationGatewayBackendHealthServerHealthUnknown), - string(ApplicationGatewayBackendHealthServerHealthUp), - } -} - -func (s *ApplicationGatewayBackendHealthServerHealth) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayBackendHealthServerHealth(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayBackendHealthServerHealth(input string) (*ApplicationGatewayBackendHealthServerHealth, error) { - vals := map[string]ApplicationGatewayBackendHealthServerHealth{ - "down": ApplicationGatewayBackendHealthServerHealthDown, - "draining": ApplicationGatewayBackendHealthServerHealthDraining, - "partial": ApplicationGatewayBackendHealthServerHealthPartial, - "unknown": ApplicationGatewayBackendHealthServerHealthUnknown, - "up": ApplicationGatewayBackendHealthServerHealthUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayBackendHealthServerHealth(input) - return &out, nil -} - -type ApplicationGatewayClientRevocationOptions string - -const ( - ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" - ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { - return []string{ - string(ApplicationGatewayClientRevocationOptionsNone), - string(ApplicationGatewayClientRevocationOptionsOCSP), - } -} - -func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayClientRevocationOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { - vals := map[string]ApplicationGatewayClientRevocationOptions{ - "none": ApplicationGatewayClientRevocationOptionsNone, - "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayClientRevocationOptions(input) - return &out, nil -} - -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { - return []string{ - string(ApplicationGatewayCookieBasedAffinityDisabled), - string(ApplicationGatewayCookieBasedAffinityEnabled), - } -} - -func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCookieBasedAffinity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { - vals := map[string]ApplicationGatewayCookieBasedAffinity{ - "disabled": ApplicationGatewayCookieBasedAffinityDisabled, - "enabled": ApplicationGatewayCookieBasedAffinityEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCookieBasedAffinity(input) - return &out, nil -} - -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" -) - -func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { - return []string{ - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), - } -} - -func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { - vals := map[string]ApplicationGatewayCustomErrorStatusCode{ - "httpstatus500": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred, - "httpstatus504": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour, - "httpstatus503": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree, - "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, - "httpstatus400": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred, - "httpstatus408": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight, - "httpstatus405": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive, - "httpstatus404": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour, - "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCustomErrorStatusCode(input) - return &out, nil -} - -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -func PossibleValuesForApplicationGatewayFirewallMode() []string { - return []string{ - string(ApplicationGatewayFirewallModeDetection), - string(ApplicationGatewayFirewallModePrevention), - } -} - -func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { - vals := map[string]ApplicationGatewayFirewallMode{ - "detection": ApplicationGatewayFirewallModeDetection, - "prevention": ApplicationGatewayFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallMode(input) - return &out, nil -} - -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { - return []string{ - string(ApplicationGatewayLoadDistributionAlgorithmIPHash), - string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), - string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - } -} - -func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { - vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ - "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, - "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayLoadDistributionAlgorithm(input) - return &out, nil -} - -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -func PossibleValuesForApplicationGatewayOperationalState() []string { - return []string{ - string(ApplicationGatewayOperationalStateRunning), - string(ApplicationGatewayOperationalStateStarting), - string(ApplicationGatewayOperationalStateStopped), - string(ApplicationGatewayOperationalStateStopping), - } -} - -func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayOperationalState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { - vals := map[string]ApplicationGatewayOperationalState{ - "running": ApplicationGatewayOperationalStateRunning, - "starting": ApplicationGatewayOperationalStateStarting, - "stopped": ApplicationGatewayOperationalStateStopped, - "stopping": ApplicationGatewayOperationalStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayOperationalState(input) - return &out, nil -} - -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" -) - -func PossibleValuesForApplicationGatewayProtocol() []string { - return []string{ - string(ApplicationGatewayProtocolHTTP), - string(ApplicationGatewayProtocolHTTPS), - string(ApplicationGatewayProtocolTcp), - string(ApplicationGatewayProtocolTls), - } -} - -func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { - vals := map[string]ApplicationGatewayProtocol{ - "http": ApplicationGatewayProtocolHTTP, - "https": ApplicationGatewayProtocolHTTPS, - "tcp": ApplicationGatewayProtocolTcp, - "tls": ApplicationGatewayProtocolTls, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayProtocol(input) - return &out, nil -} - -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -func PossibleValuesForApplicationGatewayRedirectType() []string { - return []string{ - string(ApplicationGatewayRedirectTypeFound), - string(ApplicationGatewayRedirectTypePermanent), - string(ApplicationGatewayRedirectTypeSeeOther), - string(ApplicationGatewayRedirectTypeTemporary), - } -} - -func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRedirectType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { - vals := map[string]ApplicationGatewayRedirectType{ - "found": ApplicationGatewayRedirectTypeFound, - "permanent": ApplicationGatewayRedirectTypePermanent, - "seeother": ApplicationGatewayRedirectTypeSeeOther, - "temporary": ApplicationGatewayRedirectTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRedirectType(input) - return &out, nil -} - -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { - return []string{ - string(ApplicationGatewayRequestRoutingRuleTypeBasic), - string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - } -} - -func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { - vals := map[string]ApplicationGatewayRequestRoutingRuleType{ - "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, - "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRequestRoutingRuleType(input) - return &out, nil -} - -type ApplicationGatewaySkuName string - -const ( - ApplicationGatewaySkuNameBasic ApplicationGatewaySkuName = "Basic" - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" -) - -func PossibleValuesForApplicationGatewaySkuName() []string { - return []string{ - string(ApplicationGatewaySkuNameBasic), - string(ApplicationGatewaySkuNameStandardLarge), - string(ApplicationGatewaySkuNameStandardMedium), - string(ApplicationGatewaySkuNameStandardSmall), - string(ApplicationGatewaySkuNameStandardVTwo), - string(ApplicationGatewaySkuNameWAFLarge), - string(ApplicationGatewaySkuNameWAFMedium), - string(ApplicationGatewaySkuNameWAFVTwo), - } -} - -func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { - vals := map[string]ApplicationGatewaySkuName{ - "basic": ApplicationGatewaySkuNameBasic, - "standard_large": ApplicationGatewaySkuNameStandardLarge, - "standard_medium": ApplicationGatewaySkuNameStandardMedium, - "standard_small": ApplicationGatewaySkuNameStandardSmall, - "standard_v2": ApplicationGatewaySkuNameStandardVTwo, - "waf_large": ApplicationGatewaySkuNameWAFLarge, - "waf_medium": ApplicationGatewaySkuNameWAFMedium, - "waf_v2": ApplicationGatewaySkuNameWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySkuName(input) - return &out, nil -} - -type ApplicationGatewaySslCipherSuite string - -const ( - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -) - -func PossibleValuesForApplicationGatewaySslCipherSuite() []string { - return []string{ - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), - } -} - -func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslCipherSuite(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { - vals := map[string]ApplicationGatewaySslCipherSuite{ - "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, - "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, - "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, - "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, - "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, - "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, - "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslCipherSuite(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyName string - -const ( - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -func PossibleValuesForApplicationGatewaySslPolicyName() []string { - return []string{ - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), - } -} - -func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { - vals := map[string]ApplicationGatewaySslPolicyName{ - "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, - "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, - "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, - "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, - "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyName(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyType string - -const ( - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" -) - -func PossibleValuesForApplicationGatewaySslPolicyType() []string { - return []string{ - string(ApplicationGatewaySslPolicyTypeCustom), - string(ApplicationGatewaySslPolicyTypeCustomVTwo), - string(ApplicationGatewaySslPolicyTypePredefined), - } -} - -func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { - vals := map[string]ApplicationGatewaySslPolicyType{ - "custom": ApplicationGatewaySslPolicyTypeCustom, - "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, - "predefined": ApplicationGatewaySslPolicyTypePredefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyType(input) - return &out, nil -} - -type ApplicationGatewaySslProtocol string - -const ( - ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" - ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" - ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" - ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" -) - -func PossibleValuesForApplicationGatewaySslProtocol() []string { - return []string{ - string(ApplicationGatewaySslProtocolTLSvOneOne), - string(ApplicationGatewaySslProtocolTLSvOneThree), - string(ApplicationGatewaySslProtocolTLSvOneTwo), - string(ApplicationGatewaySslProtocolTLSvOneZero), - } -} - -func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { - vals := map[string]ApplicationGatewaySslProtocol{ - "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, - "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, - "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, - "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslProtocol(input) - return &out, nil -} - -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTier() []string { - return []string{ - string(ApplicationGatewayTierBasic), - string(ApplicationGatewayTierStandard), - string(ApplicationGatewayTierStandardVTwo), - string(ApplicationGatewayTierWAF), - string(ApplicationGatewayTierWAFVTwo), - } -} - -func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { - vals := map[string]ApplicationGatewayTier{ - "basic": ApplicationGatewayTierBasic, - "standard": ApplicationGatewayTierStandard, - "standard_v2": ApplicationGatewayTierStandardVTwo, - "waf": ApplicationGatewayTierWAF, - "waf_v2": ApplicationGatewayTierWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTier(input) - return &out, nil -} - -type ApplicationGatewayTierTypes string - -const ( - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" - ApplicationGatewayTierTypesStandardVTwo ApplicationGatewayTierTypes = "Standard_v2" - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - ApplicationGatewayTierTypesWAFVTwo ApplicationGatewayTierTypes = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTierTypes() []string { - return []string{ - string(ApplicationGatewayTierTypesStandard), - string(ApplicationGatewayTierTypesStandardVTwo), - string(ApplicationGatewayTierTypesWAF), - string(ApplicationGatewayTierTypesWAFVTwo), - } -} - -func (s *ApplicationGatewayTierTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTierTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTierTypes(input string) (*ApplicationGatewayTierTypes, error) { - vals := map[string]ApplicationGatewayTierTypes{ - "standard": ApplicationGatewayTierTypesStandard, - "standard_v2": ApplicationGatewayTierTypesStandardVTwo, - "waf": ApplicationGatewayTierTypesWAF, - "waf_v2": ApplicationGatewayTierTypesWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTierTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleActionTypes string - -const ( - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" - ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" -) - -func PossibleValuesForApplicationGatewayWafRuleActionTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleActionTypesAllow), - string(ApplicationGatewayWafRuleActionTypesAnomalyScoring), - string(ApplicationGatewayWafRuleActionTypesBlock), - string(ApplicationGatewayWafRuleActionTypesLog), - string(ApplicationGatewayWafRuleActionTypesNone), - } -} - -func (s *ApplicationGatewayWafRuleActionTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleActionTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleActionTypes(input string) (*ApplicationGatewayWafRuleActionTypes, error) { - vals := map[string]ApplicationGatewayWafRuleActionTypes{ - "allow": ApplicationGatewayWafRuleActionTypesAllow, - "anomalyscoring": ApplicationGatewayWafRuleActionTypesAnomalyScoring, - "block": ApplicationGatewayWafRuleActionTypesBlock, - "log": ApplicationGatewayWafRuleActionTypesLog, - "none": ApplicationGatewayWafRuleActionTypesNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleActionTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleStateTypes string - -const ( - ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" -) - -func PossibleValuesForApplicationGatewayWafRuleStateTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleStateTypesDisabled), - string(ApplicationGatewayWafRuleStateTypesEnabled), - } -} - -func (s *ApplicationGatewayWafRuleStateTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleStateTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleStateTypes(input string) (*ApplicationGatewayWafRuleStateTypes, error) { - vals := map[string]ApplicationGatewayWafRuleStateTypes{ - "disabled": ApplicationGatewayWafRuleStateTypesDisabled, - "enabled": ApplicationGatewayWafRuleStateTypesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleStateTypes(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypropertiesformat.go deleted file mode 100644 index 1332febd49d..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ /dev/null @@ -1,43 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPropertiesFormat struct { - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - DefaultPredefinedSslPolicy *ApplicationGatewaySslPolicyName `json:"defaultPredefinedSslPolicy,omitempty"` - EnableFips *bool `json:"enableFips,omitempty"` - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/applicationgateways/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 74aca7bc73d..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 302d4c3283d..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointconnectionproperties.go deleted file mode 100644 index baec08812d8..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/applicationgateways/model_publicipaddressdnssettings.go deleted file mode 100644 index 4aeba6f0581..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/applicationgateways/model_securityrulepropertiesformat.go deleted file mode 100644 index c96607c5d20..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/applicationgateways/model_subnetpropertiesformat.go deleted file mode 100644 index 3ff5721db4e..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/applicationgateways/version.go b/resource-manager/network/2023-04-01/applicationgateways/version.go deleted file mode 100644 index 87f0a98d537..00000000000 --- a/resource-manager/network/2023-04-01/applicationgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/README.md deleted file mode 100644 index c00203cbfe8..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests` Documentation - -The `applicationgatewaywafdynamicmanifests` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/applicationgatewaywafdynamicmanifests" -``` - - -### Client Initialization - -```go -client := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.DefaultGet` - -```go -ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.DefaultGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.Get` - -```go -ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.Get(ctx, id)` can be used to do batched pagination -items, err := client.GetComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/version.go b/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/version.go deleted file mode 100644 index 4ec54ec5e85..00000000000 --- a/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewaywafdynamicmanifests/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/applicationsecuritygroups/README.md b/resource-manager/network/2023-04-01/applicationsecuritygroups/README.md deleted file mode 100644 index 5caad15829d..00000000000 --- a/resource-manager/network/2023-04-01/applicationsecuritygroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationsecuritygroups` Documentation - -The `applicationsecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/applicationsecuritygroups" -``` - - -### Client Initialization - -```go -client := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -payload := applicationsecuritygroups.ApplicationSecurityGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -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: `ApplicationSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ApplicationSecurityGroupsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.UpdateTags` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -payload := applicationsecuritygroups.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/network/2023-04-01/applicationsecuritygroups/version.go b/resource-manager/network/2023-04-01/applicationsecuritygroups/version.go deleted file mode 100644 index 6966ccffc1d..00000000000 --- a/resource-manager/network/2023-04-01/applicationsecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationsecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationsecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/availabledelegations/README.md b/resource-manager/network/2023-04-01/availabledelegations/README.md deleted file mode 100644 index 4b251554f81..00000000000 --- a/resource-manager/network/2023-04-01/availabledelegations/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/availabledelegations` Documentation - -The `availabledelegations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/availabledelegations" -``` - - -### Client Initialization - -```go -client := availabledelegations.NewAvailableDelegationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AvailableDelegationsClient.AvailableDelegationsList` - -```go -ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableDelegationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AvailableDelegationsClient.AvailableResourceGroupDelegationsList` - -```go -ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/availabledelegations/version.go b/resource-manager/network/2023-04-01/availabledelegations/version.go deleted file mode 100644 index 0b2f4f703d8..00000000000 --- a/resource-manager/network/2023-04-01/availabledelegations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package availabledelegations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/availabledelegations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/availableservicealiases/README.md b/resource-manager/network/2023-04-01/availableservicealiases/README.md deleted file mode 100644 index 5a155608f9c..00000000000 --- a/resource-manager/network/2023-04-01/availableservicealiases/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/availableservicealiases` Documentation - -The `availableservicealiases` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/availableservicealiases" -``` - - -### Client Initialization - -```go -client := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AvailableServiceAliasesClient.List` - -```go -ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// 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: `AvailableServiceAliasesClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// 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 -} -``` diff --git a/resource-manager/network/2023-04-01/availableservicealiases/version.go b/resource-manager/network/2023-04-01/availableservicealiases/version.go deleted file mode 100644 index 159a1d6f178..00000000000 --- a/resource-manager/network/2023-04-01/availableservicealiases/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package availableservicealiases - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/availableservicealiases/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/README.md b/resource-manager/network/2023-04-01/azurefirewalls/README.md deleted file mode 100644 index 096bf696ab5..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/README.md +++ /dev/null @@ -1,146 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/azurefirewalls` Documentation - -The `azurefirewalls` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/azurefirewalls" -``` - - -### Client Initialization - -```go -client := azurefirewalls.NewAzureFirewallsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AzureFirewallsClient.AzureFirewallsListLearnedPrefixes` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -if err := client.AzureFirewallsListLearnedPrefixesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.AzureFirewall{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.Delete` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.Get` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -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: `AzureFirewallsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `AzureFirewallsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AzureFirewallsClient.PacketCapture` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.FirewallPacketCaptureParameters{ - // ... -} - - -if err := client.PacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.UpdateTags` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/azurefirewalls/constants.go b/resource-manager/network/2023-04-01/azurefirewalls/constants.go deleted file mode 100644 index d7a3af8fb71..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/constants.go +++ /dev/null @@ -1,412 +0,0 @@ -package azurefirewalls - -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 AzureFirewallApplicationRuleProtocolType string - -const ( - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" - AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" -) - -func PossibleValuesForAzureFirewallApplicationRuleProtocolType() []string { - return []string{ - string(AzureFirewallApplicationRuleProtocolTypeHTTP), - string(AzureFirewallApplicationRuleProtocolTypeHTTPS), - string(AzureFirewallApplicationRuleProtocolTypeMssql), - } -} - -func (s *AzureFirewallApplicationRuleProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallApplicationRuleProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallApplicationRuleProtocolType(input string) (*AzureFirewallApplicationRuleProtocolType, error) { - vals := map[string]AzureFirewallApplicationRuleProtocolType{ - "http": AzureFirewallApplicationRuleProtocolTypeHTTP, - "https": AzureFirewallApplicationRuleProtocolTypeHTTPS, - "mssql": AzureFirewallApplicationRuleProtocolTypeMssql, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallApplicationRuleProtocolType(input) - return &out, nil -} - -type AzureFirewallNatRCActionType string - -const ( - AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" - AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" -) - -func PossibleValuesForAzureFirewallNatRCActionType() []string { - return []string{ - string(AzureFirewallNatRCActionTypeDnat), - string(AzureFirewallNatRCActionTypeSnat), - } -} - -func (s *AzureFirewallNatRCActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallNatRCActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallNatRCActionType(input string) (*AzureFirewallNatRCActionType, error) { - vals := map[string]AzureFirewallNatRCActionType{ - "dnat": AzureFirewallNatRCActionTypeDnat, - "snat": AzureFirewallNatRCActionTypeSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallNatRCActionType(input) - return &out, nil -} - -type AzureFirewallNetworkRuleProtocol string - -const ( - AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" - AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" - AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" - AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -func PossibleValuesForAzureFirewallNetworkRuleProtocol() []string { - return []string{ - string(AzureFirewallNetworkRuleProtocolAny), - string(AzureFirewallNetworkRuleProtocolICMP), - string(AzureFirewallNetworkRuleProtocolTCP), - string(AzureFirewallNetworkRuleProtocolUDP), - } -} - -func (s *AzureFirewallNetworkRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallNetworkRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallNetworkRuleProtocol(input string) (*AzureFirewallNetworkRuleProtocol, error) { - vals := map[string]AzureFirewallNetworkRuleProtocol{ - "any": AzureFirewallNetworkRuleProtocolAny, - "icmp": AzureFirewallNetworkRuleProtocolICMP, - "tcp": AzureFirewallNetworkRuleProtocolTCP, - "udp": AzureFirewallNetworkRuleProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallNetworkRuleProtocol(input) - return &out, nil -} - -type AzureFirewallPacketCaptureFlagsType string - -const ( - AzureFirewallPacketCaptureFlagsTypeAck AzureFirewallPacketCaptureFlagsType = "ack" - AzureFirewallPacketCaptureFlagsTypeFin AzureFirewallPacketCaptureFlagsType = "fin" - AzureFirewallPacketCaptureFlagsTypePush AzureFirewallPacketCaptureFlagsType = "push" - AzureFirewallPacketCaptureFlagsTypeRst AzureFirewallPacketCaptureFlagsType = "rst" - AzureFirewallPacketCaptureFlagsTypeSyn AzureFirewallPacketCaptureFlagsType = "syn" - AzureFirewallPacketCaptureFlagsTypeUrg AzureFirewallPacketCaptureFlagsType = "urg" -) - -func PossibleValuesForAzureFirewallPacketCaptureFlagsType() []string { - return []string{ - string(AzureFirewallPacketCaptureFlagsTypeAck), - string(AzureFirewallPacketCaptureFlagsTypeFin), - string(AzureFirewallPacketCaptureFlagsTypePush), - string(AzureFirewallPacketCaptureFlagsTypeRst), - string(AzureFirewallPacketCaptureFlagsTypeSyn), - string(AzureFirewallPacketCaptureFlagsTypeUrg), - } -} - -func (s *AzureFirewallPacketCaptureFlagsType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallPacketCaptureFlagsType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallPacketCaptureFlagsType(input string) (*AzureFirewallPacketCaptureFlagsType, error) { - vals := map[string]AzureFirewallPacketCaptureFlagsType{ - "ack": AzureFirewallPacketCaptureFlagsTypeAck, - "fin": AzureFirewallPacketCaptureFlagsTypeFin, - "push": AzureFirewallPacketCaptureFlagsTypePush, - "rst": AzureFirewallPacketCaptureFlagsTypeRst, - "syn": AzureFirewallPacketCaptureFlagsTypeSyn, - "urg": AzureFirewallPacketCaptureFlagsTypeUrg, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallPacketCaptureFlagsType(input) - return &out, nil -} - -type AzureFirewallRCActionType string - -const ( - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -func PossibleValuesForAzureFirewallRCActionType() []string { - return []string{ - string(AzureFirewallRCActionTypeAllow), - string(AzureFirewallRCActionTypeDeny), - } -} - -func (s *AzureFirewallRCActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallRCActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallRCActionType(input string) (*AzureFirewallRCActionType, error) { - vals := map[string]AzureFirewallRCActionType{ - "allow": AzureFirewallRCActionTypeAllow, - "deny": AzureFirewallRCActionTypeDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallRCActionType(input) - return &out, nil -} - -type AzureFirewallSkuName string - -const ( - AzureFirewallSkuNameAZFWHub AzureFirewallSkuName = "AZFW_Hub" - AzureFirewallSkuNameAZFWVNet AzureFirewallSkuName = "AZFW_VNet" -) - -func PossibleValuesForAzureFirewallSkuName() []string { - return []string{ - string(AzureFirewallSkuNameAZFWHub), - string(AzureFirewallSkuNameAZFWVNet), - } -} - -func (s *AzureFirewallSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallSkuName(input string) (*AzureFirewallSkuName, error) { - vals := map[string]AzureFirewallSkuName{ - "azfw_hub": AzureFirewallSkuNameAZFWHub, - "azfw_vnet": AzureFirewallSkuNameAZFWVNet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallSkuName(input) - return &out, nil -} - -type AzureFirewallSkuTier string - -const ( - AzureFirewallSkuTierBasic AzureFirewallSkuTier = "Basic" - AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" - AzureFirewallSkuTierStandard AzureFirewallSkuTier = "Standard" -) - -func PossibleValuesForAzureFirewallSkuTier() []string { - return []string{ - string(AzureFirewallSkuTierBasic), - string(AzureFirewallSkuTierPremium), - string(AzureFirewallSkuTierStandard), - } -} - -func (s *AzureFirewallSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallSkuTier(input string) (*AzureFirewallSkuTier, error) { - vals := map[string]AzureFirewallSkuTier{ - "basic": AzureFirewallSkuTierBasic, - "premium": AzureFirewallSkuTierPremium, - "standard": AzureFirewallSkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallSkuTier(input) - return &out, nil -} - -type AzureFirewallThreatIntelMode string - -const ( - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -func PossibleValuesForAzureFirewallThreatIntelMode() []string { - return []string{ - string(AzureFirewallThreatIntelModeAlert), - string(AzureFirewallThreatIntelModeDeny), - string(AzureFirewallThreatIntelModeOff), - } -} - -func (s *AzureFirewallThreatIntelMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallThreatIntelMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallThreatIntelMode(input string) (*AzureFirewallThreatIntelMode, error) { - vals := map[string]AzureFirewallThreatIntelMode{ - "alert": AzureFirewallThreatIntelModeAlert, - "deny": AzureFirewallThreatIntelModeDeny, - "off": AzureFirewallThreatIntelModeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallThreatIntelMode(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/method_packetcapture.go b/resource-manager/network/2023-04-01/azurefirewalls/method_packetcapture.go deleted file mode 100644 index a2b211da6c7..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/method_packetcapture.go +++ /dev/null @@ -1,73 +0,0 @@ -package azurefirewalls - -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 PacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// PacketCapture ... -func (c AzureFirewallsClient) PacketCapture(ctx context.Context, id AzureFirewallId, input FirewallPacketCaptureParameters) (result PacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/packetCapture", 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 -} - -// PacketCaptureThenPoll performs PacketCapture then polls until it's completed -func (c AzureFirewallsClient) PacketCaptureThenPoll(ctx context.Context, id AzureFirewallId, input FirewallPacketCaptureParameters) error { - result, err := c.PacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go b/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go deleted file mode 100644 index edcc08e5590..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPacketCaptureFlags struct { - Type *AzureFirewallPacketCaptureFlagsType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcapturerule.go b/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcapturerule.go deleted file mode 100644 index 4d9921e3243..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/model_azurefirewallpacketcapturerule.go +++ /dev/null @@ -1,10 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPacketCaptureRule struct { - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Destinations *[]string `json:"destinations,omitempty"` - Sources *[]string `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparameters.go b/resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparameters.go deleted file mode 100644 index 258aca5b011..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPacketCaptureParameters struct { - Id *string `json:"id,omitempty"` - Properties *FirewallPacketCaptureParametersFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go b/resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go deleted file mode 100644 index c0c639f2390..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPacketCaptureParametersFormat struct { - DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` - FileName *string `json:"fileName,omitempty"` - Filters *[]AzureFirewallPacketCaptureRule `json:"filters,omitempty"` - Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` - NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` - Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/azurefirewalls/version.go b/resource-manager/network/2023-04-01/azurefirewalls/version.go deleted file mode 100644 index 911f4b643ae..00000000000 --- a/resource-manager/network/2023-04-01/azurefirewalls/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package azurefirewalls - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/azurefirewalls/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/bastionhosts/README.md b/resource-manager/network/2023-04-01/bastionhosts/README.md deleted file mode 100644 index 4aacd7cf5b0..00000000000 --- a/resource-manager/network/2023-04-01/bastionhosts/README.md +++ /dev/null @@ -1,217 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/bastionhosts` Documentation - -The `bastionhosts` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/bastionhosts" -``` - - -### Client Initialization - -```go -client := bastionhosts.NewBastionHostsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BastionHostsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionHost{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.Delete` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DeleteBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DisconnectActiveSessions` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.SessionIds{ - // ... -} - - -// alternatively `client.DisconnectActiveSessions(ctx, id, payload)` can be used to do batched pagination -items, err := client.DisconnectActiveSessionsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.Get` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -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: `BastionHostsClient.GetActiveSessions` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -// alternatively `client.GetActiveSessions(ctx, id)` can be used to do batched pagination -items, err := client.GetActiveSessionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.GetBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.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: `BastionHostsClient.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: `BastionHostsClient.PutBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.UpdateTags` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/bastionhosts/model_bastionhostpropertiesformat.go b/resource-manager/network/2023-04-01/bastionhosts/model_bastionhostpropertiesformat.go deleted file mode 100644 index 925008fd0ce..00000000000 --- a/resource-manager/network/2023-04-01/bastionhosts/model_bastionhostpropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostPropertiesFormat struct { - DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` - DnsName *string `json:"dnsName,omitempty"` - EnableFileCopy *bool `json:"enableFileCopy,omitempty"` - EnableIPConnect *bool `json:"enableIpConnect,omitempty"` - EnableKerberos *bool `json:"enableKerberos,omitempty"` - EnableShareableLink *bool `json:"enableShareableLink,omitempty"` - EnableTunneling *bool `json:"enableTunneling,omitempty"` - IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ScaleUnits *int64 `json:"scaleUnits,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/bastionhosts/version.go b/resource-manager/network/2023-04-01/bastionhosts/version.go deleted file mode 100644 index cb3a0fb514c..00000000000 --- a/resource-manager/network/2023-04-01/bastionhosts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bastionhosts/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/README.md b/resource-manager/network/2023-04-01/bastionshareablelink/README.md deleted file mode 100644 index eaa3f86d76f..00000000000 --- a/resource-manager/network/2023-04-01/bastionshareablelink/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/bastionshareablelink` Documentation - -The `bastionshareablelink` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/bastionshareablelink" -``` - - -### Client Initialization - -```go -client := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BastionShareableLinkClient.DeleteBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionShareableLinkClient.GetBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionShareableLinkClient.PutBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/bastionshareablelink/version.go b/resource-manager/network/2023-04-01/bastionshareablelink/version.go deleted file mode 100644 index 73cd9c3bb11..00000000000 --- a/resource-manager/network/2023-04-01/bastionshareablelink/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionshareablelink - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bastionshareablelink/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/README.md b/resource-manager/network/2023-04-01/bgpservicecommunities/README.md deleted file mode 100644 index c0a746c5d6d..00000000000 --- a/resource-manager/network/2023-04-01/bgpservicecommunities/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/bgpservicecommunities` Documentation - -The `bgpservicecommunities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/bgpservicecommunities" -``` - - -### Client Initialization - -```go -client := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BgpServiceCommunitiesClient.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 -} -``` diff --git a/resource-manager/network/2023-04-01/bgpservicecommunities/version.go b/resource-manager/network/2023-04-01/bgpservicecommunities/version.go deleted file mode 100644 index c8408f95ce2..00000000000 --- a/resource-manager/network/2023-04-01/bgpservicecommunities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bgpservicecommunities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bgpservicecommunities/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/README.md b/resource-manager/network/2023-04-01/checkdnsavailabilities/README.md deleted file mode 100644 index e221ef93266..00000000000 --- a/resource-manager/network/2023-04-01/checkdnsavailabilities/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/checkdnsavailabilities` Documentation - -The `checkdnsavailabilities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/checkdnsavailabilities" -``` - - -### Client Initialization - -```go -client := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CheckDnsAvailabilitiesClient.CheckDnsNameAvailability` - -```go -ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/network/2023-04-01/checkdnsavailabilities/version.go b/resource-manager/network/2023-04-01/checkdnsavailabilities/version.go deleted file mode 100644 index 5e6235778a2..00000000000 --- a/resource-manager/network/2023-04-01/checkdnsavailabilities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package checkdnsavailabilities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/checkdnsavailabilities/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/client.go b/resource-manager/network/2023-04-01/client.go deleted file mode 100644 index b48215503e7..00000000000 --- a/resource-manager/network/2023-04-01/client.go +++ /dev/null @@ -1,982 +0,0 @@ -package v2023_04_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/network/2023-04-01/adminrulecollections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/adminrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgatewayprivateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgatewayprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationgatewaywafdynamicmanifests" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/applicationsecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/availabledelegations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/availableservicealiases" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/azurefirewalls" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/bastionhosts" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/bastionshareablelink" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/bgpservicecommunities" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/checkdnsavailabilities" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/cloudservicepublicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/connectionmonitors" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/connectivityconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/customipprefixes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ddoscustompolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ddosprotectionplans" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/dscpconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/dscpconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/endpointservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitarptable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitauthorizations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitroutestable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuits" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitstats" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutegateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutelinks" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteportauthorizations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteports" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteportslocations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteproviderports" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteserviceproviders" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/firewallpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/flowlogs" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ipallocations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ipgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/loadbalancers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/localnetworkgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/natgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkinterfaces" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanageractiveconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagerconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkprofiles" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networksecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkvirtualappliances" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkwatchers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/p2svpngateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/packetcaptures" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privatednszonegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privateendpoints" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privatelinkservice" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privatelinkservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/publicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/publicipprefixes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routefilterrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routefilters" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routetables" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/scopeconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/securityadminconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/securitypartnerproviders" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/securityrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/serviceendpointpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/servicetags" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/staticmembers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/subnets" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/trafficanalytics" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/usages" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vipswap" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualappliancesites" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualapplianceskus" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworkgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworkpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworks" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworktap" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworktaps" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualrouterpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualrouters" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualwans" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vmsspublicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpngateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpnlinkconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpnserverconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpnsites" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/webapplicationfirewallpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/webcategories" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - AdminRuleCollections *adminrulecollections.AdminRuleCollectionsClient - AdminRules *adminrules.AdminRulesClient - ApplicationGatewayPrivateEndpointConnections *applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnectionsClient - ApplicationGatewayPrivateLinkResources *applicationgatewayprivatelinkresources.ApplicationGatewayPrivateLinkResourcesClient - ApplicationGatewayWafDynamicManifests *applicationgatewaywafdynamicmanifests.ApplicationGatewayWafDynamicManifestsClient - ApplicationGateways *applicationgateways.ApplicationGatewaysClient - ApplicationSecurityGroups *applicationsecuritygroups.ApplicationSecurityGroupsClient - AvailableDelegations *availabledelegations.AvailableDelegationsClient - AvailableServiceAliases *availableservicealiases.AvailableServiceAliasesClient - AzureFirewalls *azurefirewalls.AzureFirewallsClient - BastionHosts *bastionhosts.BastionHostsClient - BastionShareableLink *bastionshareablelink.BastionShareableLinkClient - BgpServiceCommunities *bgpservicecommunities.BgpServiceCommunitiesClient - CheckDnsAvailabilities *checkdnsavailabilities.CheckDnsAvailabilitiesClient - CloudServicePublicIPAddresses *cloudservicepublicipaddresses.CloudServicePublicIPAddressesClient - ConnectionMonitors *connectionmonitors.ConnectionMonitorsClient - ConnectivityConfigurations *connectivityconfigurations.ConnectivityConfigurationsClient - CustomIPPrefixes *customipprefixes.CustomIPPrefixesClient - DdosCustomPolicies *ddoscustompolicies.DdosCustomPoliciesClient - DdosProtectionPlans *ddosprotectionplans.DdosProtectionPlansClient - DscpConfiguration *dscpconfiguration.DscpConfigurationClient - DscpConfigurations *dscpconfigurations.DscpConfigurationsClient - EndpointServices *endpointservices.EndpointServicesClient - ExpressRouteCircuitArpTable *expressroutecircuitarptable.ExpressRouteCircuitArpTableClient - ExpressRouteCircuitAuthorizations *expressroutecircuitauthorizations.ExpressRouteCircuitAuthorizationsClient - ExpressRouteCircuitConnections *expressroutecircuitconnections.ExpressRouteCircuitConnectionsClient - ExpressRouteCircuitPeerings *expressroutecircuitpeerings.ExpressRouteCircuitPeeringsClient - ExpressRouteCircuitRoutesTable *expressroutecircuitroutestable.ExpressRouteCircuitRoutesTableClient - ExpressRouteCircuitRoutesTableSummary *expressroutecircuitroutestablesummary.ExpressRouteCircuitRoutesTableSummaryClient - ExpressRouteCircuitStats *expressroutecircuitstats.ExpressRouteCircuitStatsClient - ExpressRouteCircuits *expressroutecircuits.ExpressRouteCircuitsClient - ExpressRouteConnections *expressrouteconnections.ExpressRouteConnectionsClient - ExpressRouteCrossConnectionArpTable *expressroutecrossconnectionarptable.ExpressRouteCrossConnectionArpTableClient - ExpressRouteCrossConnectionPeerings *expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeeringsClient - ExpressRouteCrossConnectionRouteTable *expressroutecrossconnectionroutetable.ExpressRouteCrossConnectionRouteTableClient - ExpressRouteCrossConnectionRouteTableSummary *expressroutecrossconnectionroutetablesummary.ExpressRouteCrossConnectionRouteTableSummaryClient - ExpressRouteCrossConnections *expressroutecrossconnections.ExpressRouteCrossConnectionsClient - ExpressRouteGateways *expressroutegateways.ExpressRouteGatewaysClient - ExpressRouteLinks *expressroutelinks.ExpressRouteLinksClient - ExpressRoutePortAuthorizations *expressrouteportauthorizations.ExpressRoutePortAuthorizationsClient - ExpressRoutePorts *expressrouteports.ExpressRoutePortsClient - ExpressRoutePortsLocations *expressrouteportslocations.ExpressRoutePortsLocationsClient - ExpressRouteProviderPorts *expressrouteproviderports.ExpressRouteProviderPortsClient - ExpressRouteServiceProviders *expressrouteserviceproviders.ExpressRouteServiceProvidersClient - FirewallPolicies *firewallpolicies.FirewallPoliciesClient - FirewallPolicyRuleCollectionGroups *firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroupsClient - FlowLogs *flowlogs.FlowLogsClient - IPAllocations *ipallocations.IPAllocationsClient - IPGroups *ipgroups.IPGroupsClient - LoadBalancers *loadbalancers.LoadBalancersClient - LocalNetworkGateways *localnetworkgateways.LocalNetworkGatewaysClient - NatGateways *natgateways.NatGatewaysClient - NetworkGroups *networkgroups.NetworkGroupsClient - NetworkInterfaces *networkinterfaces.NetworkInterfacesClient - NetworkManagerActiveConfigurations *networkmanageractiveconfigurations.NetworkManagerActiveConfigurationsClient - NetworkManagerActiveConnectivityConfigurations *networkmanageractiveconnectivityconfigurations.NetworkManagerActiveConnectivityConfigurationsClient - NetworkManagerConnections *networkmanagerconnections.NetworkManagerConnectionsClient - NetworkManagerEffectiveConnectivityConfiguration *networkmanagereffectiveconnectivityconfiguration.NetworkManagerEffectiveConnectivityConfigurationClient - NetworkManagerEffectiveSecurityAdminRules *networkmanagereffectivesecurityadminrules.NetworkManagerEffectiveSecurityAdminRulesClient - NetworkManagers *networkmanagers.NetworkManagersClient - NetworkProfiles *networkprofiles.NetworkProfilesClient - NetworkSecurityGroups *networksecuritygroups.NetworkSecurityGroupsClient - NetworkVirtualAppliances *networkvirtualappliances.NetworkVirtualAppliancesClient - NetworkWatchers *networkwatchers.NetworkWatchersClient - P2sVpnGateways *p2svpngateways.P2sVpnGatewaysClient - PacketCaptures *packetcaptures.PacketCapturesClient - PeerExpressRouteCircuitConnections *peerexpressroutecircuitconnections.PeerExpressRouteCircuitConnectionsClient - PrivateDnsZoneGroups *privatednszonegroups.PrivateDnsZoneGroupsClient - PrivateEndpoints *privateendpoints.PrivateEndpointsClient - PrivateLinkService *privatelinkservice.PrivateLinkServiceClient - PrivateLinkServices *privatelinkservices.PrivateLinkServicesClient - PublicIPAddresses *publicipaddresses.PublicIPAddressesClient - PublicIPPrefixes *publicipprefixes.PublicIPPrefixesClient - RouteFilterRules *routefilterrules.RouteFilterRulesClient - RouteFilters *routefilters.RouteFiltersClient - RouteTables *routetables.RouteTablesClient - Routes *routes.RoutesClient - ScopeConnections *scopeconnections.ScopeConnectionsClient - SecurityAdminConfigurations *securityadminconfigurations.SecurityAdminConfigurationsClient - SecurityPartnerProviders *securitypartnerproviders.SecurityPartnerProvidersClient - SecurityRules *securityrules.SecurityRulesClient - ServiceEndpointPolicies *serviceendpointpolicies.ServiceEndpointPoliciesClient - ServiceEndpointPolicyDefinitions *serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinitionsClient - ServiceTags *servicetags.ServiceTagsClient - StaticMembers *staticmembers.StaticMembersClient - Subnets *subnets.SubnetsClient - TrafficAnalytics *trafficanalytics.TrafficAnalyticsClient - Usages *usages.UsagesClient - VMSSPublicIPAddresses *vmsspublicipaddresses.VMSSPublicIPAddressesClient - VipSwap *vipswap.VipSwapClient - VirtualApplianceSites *virtualappliancesites.VirtualApplianceSitesClient - VirtualApplianceSkus *virtualapplianceskus.VirtualApplianceSkusClient - VirtualNetworkGatewayConnections *virtualnetworkgatewayconnections.VirtualNetworkGatewayConnectionsClient - VirtualNetworkGateways *virtualnetworkgateways.VirtualNetworkGatewaysClient - VirtualNetworkPeerings *virtualnetworkpeerings.VirtualNetworkPeeringsClient - VirtualNetworkTap *virtualnetworktap.VirtualNetworkTapClient - VirtualNetworkTaps *virtualnetworktaps.VirtualNetworkTapsClient - VirtualNetworks *virtualnetworks.VirtualNetworksClient - VirtualRouterPeerings *virtualrouterpeerings.VirtualRouterPeeringsClient - VirtualRouters *virtualrouters.VirtualRoutersClient - VirtualWANs *virtualwans.VirtualWANsClient - VpnGateways *vpngateways.VpnGatewaysClient - VpnLinkConnections *vpnlinkconnections.VpnLinkConnectionsClient - VpnServerConfigurations *vpnserverconfigurations.VpnServerConfigurationsClient - VpnSites *vpnsites.VpnSitesClient - WebApplicationFirewallPolicies *webapplicationfirewallpolicies.WebApplicationFirewallPoliciesClient - WebCategories *webcategories.WebCategoriesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - adminRuleCollectionsClient, err := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdminRuleCollections client: %+v", err) - } - configureFunc(adminRuleCollectionsClient.Client) - - adminRulesClient, err := adminrules.NewAdminRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdminRules client: %+v", err) - } - configureFunc(adminRulesClient.Client) - - applicationGatewayPrivateEndpointConnectionsClient, err := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayPrivateEndpointConnections client: %+v", err) - } - configureFunc(applicationGatewayPrivateEndpointConnectionsClient.Client) - - applicationGatewayPrivateLinkResourcesClient, err := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayPrivateLinkResources client: %+v", err) - } - configureFunc(applicationGatewayPrivateLinkResourcesClient.Client) - - applicationGatewayWafDynamicManifestsClient, err := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayWafDynamicManifests client: %+v", err) - } - configureFunc(applicationGatewayWafDynamicManifestsClient.Client) - - applicationGatewaysClient, err := applicationgateways.NewApplicationGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGateways client: %+v", err) - } - configureFunc(applicationGatewaysClient.Client) - - applicationSecurityGroupsClient, err := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationSecurityGroups client: %+v", err) - } - configureFunc(applicationSecurityGroupsClient.Client) - - availableDelegationsClient, err := availabledelegations.NewAvailableDelegationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AvailableDelegations client: %+v", err) - } - configureFunc(availableDelegationsClient.Client) - - availableServiceAliasesClient, err := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AvailableServiceAliases client: %+v", err) - } - configureFunc(availableServiceAliasesClient.Client) - - azureFirewallsClient, err := azurefirewalls.NewAzureFirewallsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AzureFirewalls client: %+v", err) - } - configureFunc(azureFirewallsClient.Client) - - bastionHostsClient, err := bastionhosts.NewBastionHostsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BastionHosts client: %+v", err) - } - configureFunc(bastionHostsClient.Client) - - bastionShareableLinkClient, err := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BastionShareableLink client: %+v", err) - } - configureFunc(bastionShareableLinkClient.Client) - - bgpServiceCommunitiesClient, err := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BgpServiceCommunities client: %+v", err) - } - configureFunc(bgpServiceCommunitiesClient.Client) - - checkDnsAvailabilitiesClient, err := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CheckDnsAvailabilities client: %+v", err) - } - configureFunc(checkDnsAvailabilitiesClient.Client) - - cloudServicePublicIPAddressesClient, err := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CloudServicePublicIPAddresses client: %+v", err) - } - configureFunc(cloudServicePublicIPAddressesClient.Client) - - connectionMonitorsClient, err := connectionmonitors.NewConnectionMonitorsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConnectionMonitors client: %+v", err) - } - configureFunc(connectionMonitorsClient.Client) - - connectivityConfigurationsClient, err := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConnectivityConfigurations client: %+v", err) - } - configureFunc(connectivityConfigurationsClient.Client) - - customIPPrefixesClient, err := customipprefixes.NewCustomIPPrefixesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CustomIPPrefixes client: %+v", err) - } - configureFunc(customIPPrefixesClient.Client) - - ddosCustomPoliciesClient, err := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DdosCustomPolicies client: %+v", err) - } - configureFunc(ddosCustomPoliciesClient.Client) - - ddosProtectionPlansClient, err := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DdosProtectionPlans client: %+v", err) - } - configureFunc(ddosProtectionPlansClient.Client) - - dscpConfigurationClient, err := dscpconfiguration.NewDscpConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DscpConfiguration client: %+v", err) - } - configureFunc(dscpConfigurationClient.Client) - - dscpConfigurationsClient, err := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DscpConfigurations client: %+v", err) - } - configureFunc(dscpConfigurationsClient.Client) - - endpointServicesClient, err := endpointservices.NewEndpointServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EndpointServices client: %+v", err) - } - configureFunc(endpointServicesClient.Client) - - expressRouteCircuitArpTableClient, err := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitArpTable client: %+v", err) - } - configureFunc(expressRouteCircuitArpTableClient.Client) - - expressRouteCircuitAuthorizationsClient, err := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitAuthorizations client: %+v", err) - } - configureFunc(expressRouteCircuitAuthorizationsClient.Client) - - expressRouteCircuitConnectionsClient, err := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitConnections client: %+v", err) - } - configureFunc(expressRouteCircuitConnectionsClient.Client) - - expressRouteCircuitPeeringsClient, err := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitPeerings client: %+v", err) - } - configureFunc(expressRouteCircuitPeeringsClient.Client) - - expressRouteCircuitRoutesTableClient, err := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTable client: %+v", err) - } - configureFunc(expressRouteCircuitRoutesTableClient.Client) - - expressRouteCircuitRoutesTableSummaryClient, err := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTableSummary client: %+v", err) - } - configureFunc(expressRouteCircuitRoutesTableSummaryClient.Client) - - expressRouteCircuitStatsClient, err := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitStats client: %+v", err) - } - configureFunc(expressRouteCircuitStatsClient.Client) - - expressRouteCircuitsClient, err := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuits client: %+v", err) - } - configureFunc(expressRouteCircuitsClient.Client) - - expressRouteConnectionsClient, err := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteConnections client: %+v", err) - } - configureFunc(expressRouteConnectionsClient.Client) - - expressRouteCrossConnectionArpTableClient, err := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionArpTable client: %+v", err) - } - configureFunc(expressRouteCrossConnectionArpTableClient.Client) - - expressRouteCrossConnectionPeeringsClient, err := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionPeerings client: %+v", err) - } - configureFunc(expressRouteCrossConnectionPeeringsClient.Client) - - expressRouteCrossConnectionRouteTableClient, err := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTable client: %+v", err) - } - configureFunc(expressRouteCrossConnectionRouteTableClient.Client) - - expressRouteCrossConnectionRouteTableSummaryClient, err := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTableSummary client: %+v", err) - } - configureFunc(expressRouteCrossConnectionRouteTableSummaryClient.Client) - - expressRouteCrossConnectionsClient, err := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnections client: %+v", err) - } - configureFunc(expressRouteCrossConnectionsClient.Client) - - expressRouteGatewaysClient, err := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteGateways client: %+v", err) - } - configureFunc(expressRouteGatewaysClient.Client) - - expressRouteLinksClient, err := expressroutelinks.NewExpressRouteLinksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteLinks client: %+v", err) - } - configureFunc(expressRouteLinksClient.Client) - - expressRoutePortAuthorizationsClient, err := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePortAuthorizations client: %+v", err) - } - configureFunc(expressRoutePortAuthorizationsClient.Client) - - expressRoutePortsClient, err := expressrouteports.NewExpressRoutePortsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePorts client: %+v", err) - } - configureFunc(expressRoutePortsClient.Client) - - expressRoutePortsLocationsClient, err := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePortsLocations client: %+v", err) - } - configureFunc(expressRoutePortsLocationsClient.Client) - - expressRouteProviderPortsClient, err := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteProviderPorts client: %+v", err) - } - configureFunc(expressRouteProviderPortsClient.Client) - - expressRouteServiceProvidersClient, err := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteServiceProviders client: %+v", err) - } - configureFunc(expressRouteServiceProvidersClient.Client) - - firewallPoliciesClient, err := firewallpolicies.NewFirewallPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallPolicies client: %+v", err) - } - configureFunc(firewallPoliciesClient.Client) - - firewallPolicyRuleCollectionGroupsClient, err := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallPolicyRuleCollectionGroups client: %+v", err) - } - configureFunc(firewallPolicyRuleCollectionGroupsClient.Client) - - flowLogsClient, err := flowlogs.NewFlowLogsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FlowLogs client: %+v", err) - } - configureFunc(flowLogsClient.Client) - - iPAllocationsClient, err := ipallocations.NewIPAllocationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IPAllocations client: %+v", err) - } - configureFunc(iPAllocationsClient.Client) - - iPGroupsClient, err := ipgroups.NewIPGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IPGroups client: %+v", err) - } - configureFunc(iPGroupsClient.Client) - - loadBalancersClient, err := loadbalancers.NewLoadBalancersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LoadBalancers client: %+v", err) - } - configureFunc(loadBalancersClient.Client) - - localNetworkGatewaysClient, err := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LocalNetworkGateways client: %+v", err) - } - configureFunc(localNetworkGatewaysClient.Client) - - natGatewaysClient, err := natgateways.NewNatGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NatGateways client: %+v", err) - } - configureFunc(natGatewaysClient.Client) - - networkGroupsClient, err := networkgroups.NewNetworkGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkGroups client: %+v", err) - } - configureFunc(networkGroupsClient.Client) - - networkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkInterfaces client: %+v", err) - } - configureFunc(networkInterfacesClient.Client) - - networkManagerActiveConfigurationsClient, err := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerActiveConfigurations client: %+v", err) - } - configureFunc(networkManagerActiveConfigurationsClient.Client) - - networkManagerActiveConnectivityConfigurationsClient, err := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerActiveConnectivityConfigurations client: %+v", err) - } - configureFunc(networkManagerActiveConnectivityConfigurationsClient.Client) - - networkManagerConnectionsClient, err := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerConnections client: %+v", err) - } - configureFunc(networkManagerConnectionsClient.Client) - - networkManagerEffectiveConnectivityConfigurationClient, err := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerEffectiveConnectivityConfiguration client: %+v", err) - } - configureFunc(networkManagerEffectiveConnectivityConfigurationClient.Client) - - networkManagerEffectiveSecurityAdminRulesClient, err := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerEffectiveSecurityAdminRules client: %+v", err) - } - configureFunc(networkManagerEffectiveSecurityAdminRulesClient.Client) - - networkManagersClient, err := networkmanagers.NewNetworkManagersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagers client: %+v", err) - } - configureFunc(networkManagersClient.Client) - - networkProfilesClient, err := networkprofiles.NewNetworkProfilesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkProfiles client: %+v", err) - } - configureFunc(networkProfilesClient.Client) - - networkSecurityGroupsClient, err := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkSecurityGroups client: %+v", err) - } - configureFunc(networkSecurityGroupsClient.Client) - - networkVirtualAppliancesClient, err := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkVirtualAppliances client: %+v", err) - } - configureFunc(networkVirtualAppliancesClient.Client) - - networkWatchersClient, err := networkwatchers.NewNetworkWatchersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkWatchers client: %+v", err) - } - configureFunc(networkWatchersClient.Client) - - p2sVpnGatewaysClient, err := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building P2sVpnGateways client: %+v", err) - } - configureFunc(p2sVpnGatewaysClient.Client) - - packetCapturesClient, err := packetcaptures.NewPacketCapturesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PacketCaptures client: %+v", err) - } - configureFunc(packetCapturesClient.Client) - - peerExpressRouteCircuitConnectionsClient, err := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PeerExpressRouteCircuitConnections client: %+v", err) - } - configureFunc(peerExpressRouteCircuitConnectionsClient.Client) - - privateDnsZoneGroupsClient, err := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateDnsZoneGroups client: %+v", err) - } - configureFunc(privateDnsZoneGroupsClient.Client) - - privateEndpointsClient, err := privateendpoints.NewPrivateEndpointsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateEndpoints client: %+v", err) - } - configureFunc(privateEndpointsClient.Client) - - privateLinkServiceClient, err := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkService client: %+v", err) - } - configureFunc(privateLinkServiceClient.Client) - - privateLinkServicesClient, err := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkServices client: %+v", err) - } - configureFunc(privateLinkServicesClient.Client) - - publicIPAddressesClient, err := publicipaddresses.NewPublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicIPAddresses client: %+v", err) - } - configureFunc(publicIPAddressesClient.Client) - - publicIPPrefixesClient, err := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicIPPrefixes client: %+v", err) - } - configureFunc(publicIPPrefixesClient.Client) - - routeFilterRulesClient, err := routefilterrules.NewRouteFilterRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteFilterRules client: %+v", err) - } - configureFunc(routeFilterRulesClient.Client) - - routeFiltersClient, err := routefilters.NewRouteFiltersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteFilters client: %+v", err) - } - configureFunc(routeFiltersClient.Client) - - routeTablesClient, err := routetables.NewRouteTablesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteTables client: %+v", err) - } - configureFunc(routeTablesClient.Client) - - routesClient, err := routes.NewRoutesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Routes client: %+v", err) - } - configureFunc(routesClient.Client) - - scopeConnectionsClient, err := scopeconnections.NewScopeConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ScopeConnections client: %+v", err) - } - configureFunc(scopeConnectionsClient.Client) - - securityAdminConfigurationsClient, err := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityAdminConfigurations client: %+v", err) - } - configureFunc(securityAdminConfigurationsClient.Client) - - securityPartnerProvidersClient, err := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityPartnerProviders client: %+v", err) - } - configureFunc(securityPartnerProvidersClient.Client) - - securityRulesClient, err := securityrules.NewSecurityRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityRules client: %+v", err) - } - configureFunc(securityRulesClient.Client) - - serviceEndpointPoliciesClient, err := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceEndpointPolicies client: %+v", err) - } - configureFunc(serviceEndpointPoliciesClient.Client) - - serviceEndpointPolicyDefinitionsClient, err := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceEndpointPolicyDefinitions client: %+v", err) - } - configureFunc(serviceEndpointPolicyDefinitionsClient.Client) - - serviceTagsClient, err := servicetags.NewServiceTagsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceTags client: %+v", err) - } - configureFunc(serviceTagsClient.Client) - - staticMembersClient, err := staticmembers.NewStaticMembersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building StaticMembers client: %+v", err) - } - configureFunc(staticMembersClient.Client) - - subnetsClient, err := subnets.NewSubnetsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Subnets client: %+v", err) - } - configureFunc(subnetsClient.Client) - - trafficAnalyticsClient, err := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building TrafficAnalytics client: %+v", err) - } - configureFunc(trafficAnalyticsClient.Client) - - usagesClient, err := usages.NewUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Usages client: %+v", err) - } - configureFunc(usagesClient.Client) - - vMSSPublicIPAddressesClient, err := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VMSSPublicIPAddresses client: %+v", err) - } - configureFunc(vMSSPublicIPAddressesClient.Client) - - vipSwapClient, err := vipswap.NewVipSwapClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VipSwap client: %+v", err) - } - configureFunc(vipSwapClient.Client) - - virtualApplianceSitesClient, err := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualApplianceSites client: %+v", err) - } - configureFunc(virtualApplianceSitesClient.Client) - - virtualApplianceSkusClient, err := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualApplianceSkus client: %+v", err) - } - configureFunc(virtualApplianceSkusClient.Client) - - virtualNetworkGatewayConnectionsClient, err := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkGatewayConnections client: %+v", err) - } - configureFunc(virtualNetworkGatewayConnectionsClient.Client) - - virtualNetworkGatewaysClient, err := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkGateways client: %+v", err) - } - configureFunc(virtualNetworkGatewaysClient.Client) - - virtualNetworkPeeringsClient, err := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkPeerings client: %+v", err) - } - configureFunc(virtualNetworkPeeringsClient.Client) - - virtualNetworkTapClient, err := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkTap client: %+v", err) - } - configureFunc(virtualNetworkTapClient.Client) - - virtualNetworkTapsClient, err := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkTaps client: %+v", err) - } - configureFunc(virtualNetworkTapsClient.Client) - - virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) - } - configureFunc(virtualNetworksClient.Client) - - virtualRouterPeeringsClient, err := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualRouterPeerings client: %+v", err) - } - configureFunc(virtualRouterPeeringsClient.Client) - - virtualRoutersClient, err := virtualrouters.NewVirtualRoutersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualRouters client: %+v", err) - } - configureFunc(virtualRoutersClient.Client) - - virtualWANsClient, err := virtualwans.NewVirtualWANsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualWANs client: %+v", err) - } - configureFunc(virtualWANsClient.Client) - - vpnGatewaysClient, err := vpngateways.NewVpnGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnGateways client: %+v", err) - } - configureFunc(vpnGatewaysClient.Client) - - vpnLinkConnectionsClient, err := vpnlinkconnections.NewVpnLinkConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnLinkConnections client: %+v", err) - } - configureFunc(vpnLinkConnectionsClient.Client) - - vpnServerConfigurationsClient, err := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnServerConfigurations client: %+v", err) - } - configureFunc(vpnServerConfigurationsClient.Client) - - vpnSitesClient, err := vpnsites.NewVpnSitesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnSites client: %+v", err) - } - configureFunc(vpnSitesClient.Client) - - webApplicationFirewallPoliciesClient, err := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebApplicationFirewallPolicies client: %+v", err) - } - configureFunc(webApplicationFirewallPoliciesClient.Client) - - webCategoriesClient, err := webcategories.NewWebCategoriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebCategories client: %+v", err) - } - configureFunc(webCategoriesClient.Client) - - return &Client{ - AdminRuleCollections: adminRuleCollectionsClient, - AdminRules: adminRulesClient, - ApplicationGatewayPrivateEndpointConnections: applicationGatewayPrivateEndpointConnectionsClient, - ApplicationGatewayPrivateLinkResources: applicationGatewayPrivateLinkResourcesClient, - ApplicationGatewayWafDynamicManifests: applicationGatewayWafDynamicManifestsClient, - ApplicationGateways: applicationGatewaysClient, - ApplicationSecurityGroups: applicationSecurityGroupsClient, - AvailableDelegations: availableDelegationsClient, - AvailableServiceAliases: availableServiceAliasesClient, - AzureFirewalls: azureFirewallsClient, - BastionHosts: bastionHostsClient, - BastionShareableLink: bastionShareableLinkClient, - BgpServiceCommunities: bgpServiceCommunitiesClient, - CheckDnsAvailabilities: checkDnsAvailabilitiesClient, - CloudServicePublicIPAddresses: cloudServicePublicIPAddressesClient, - ConnectionMonitors: connectionMonitorsClient, - ConnectivityConfigurations: connectivityConfigurationsClient, - CustomIPPrefixes: customIPPrefixesClient, - DdosCustomPolicies: ddosCustomPoliciesClient, - DdosProtectionPlans: ddosProtectionPlansClient, - DscpConfiguration: dscpConfigurationClient, - DscpConfigurations: dscpConfigurationsClient, - EndpointServices: endpointServicesClient, - ExpressRouteCircuitArpTable: expressRouteCircuitArpTableClient, - ExpressRouteCircuitAuthorizations: expressRouteCircuitAuthorizationsClient, - ExpressRouteCircuitConnections: expressRouteCircuitConnectionsClient, - ExpressRouteCircuitPeerings: expressRouteCircuitPeeringsClient, - ExpressRouteCircuitRoutesTable: expressRouteCircuitRoutesTableClient, - ExpressRouteCircuitRoutesTableSummary: expressRouteCircuitRoutesTableSummaryClient, - ExpressRouteCircuitStats: expressRouteCircuitStatsClient, - ExpressRouteCircuits: expressRouteCircuitsClient, - ExpressRouteConnections: expressRouteConnectionsClient, - ExpressRouteCrossConnectionArpTable: expressRouteCrossConnectionArpTableClient, - ExpressRouteCrossConnectionPeerings: expressRouteCrossConnectionPeeringsClient, - ExpressRouteCrossConnectionRouteTable: expressRouteCrossConnectionRouteTableClient, - ExpressRouteCrossConnectionRouteTableSummary: expressRouteCrossConnectionRouteTableSummaryClient, - ExpressRouteCrossConnections: expressRouteCrossConnectionsClient, - ExpressRouteGateways: expressRouteGatewaysClient, - ExpressRouteLinks: expressRouteLinksClient, - ExpressRoutePortAuthorizations: expressRoutePortAuthorizationsClient, - ExpressRoutePorts: expressRoutePortsClient, - ExpressRoutePortsLocations: expressRoutePortsLocationsClient, - ExpressRouteProviderPorts: expressRouteProviderPortsClient, - ExpressRouteServiceProviders: expressRouteServiceProvidersClient, - FirewallPolicies: firewallPoliciesClient, - FirewallPolicyRuleCollectionGroups: firewallPolicyRuleCollectionGroupsClient, - FlowLogs: flowLogsClient, - IPAllocations: iPAllocationsClient, - IPGroups: iPGroupsClient, - LoadBalancers: loadBalancersClient, - LocalNetworkGateways: localNetworkGatewaysClient, - NatGateways: natGatewaysClient, - NetworkGroups: networkGroupsClient, - NetworkInterfaces: networkInterfacesClient, - NetworkManagerActiveConfigurations: networkManagerActiveConfigurationsClient, - NetworkManagerActiveConnectivityConfigurations: networkManagerActiveConnectivityConfigurationsClient, - NetworkManagerConnections: networkManagerConnectionsClient, - NetworkManagerEffectiveConnectivityConfiguration: networkManagerEffectiveConnectivityConfigurationClient, - NetworkManagerEffectiveSecurityAdminRules: networkManagerEffectiveSecurityAdminRulesClient, - NetworkManagers: networkManagersClient, - NetworkProfiles: networkProfilesClient, - NetworkSecurityGroups: networkSecurityGroupsClient, - NetworkVirtualAppliances: networkVirtualAppliancesClient, - NetworkWatchers: networkWatchersClient, - P2sVpnGateways: p2sVpnGatewaysClient, - PacketCaptures: packetCapturesClient, - PeerExpressRouteCircuitConnections: peerExpressRouteCircuitConnectionsClient, - PrivateDnsZoneGroups: privateDnsZoneGroupsClient, - PrivateEndpoints: privateEndpointsClient, - PrivateLinkService: privateLinkServiceClient, - PrivateLinkServices: privateLinkServicesClient, - PublicIPAddresses: publicIPAddressesClient, - PublicIPPrefixes: publicIPPrefixesClient, - RouteFilterRules: routeFilterRulesClient, - RouteFilters: routeFiltersClient, - RouteTables: routeTablesClient, - Routes: routesClient, - ScopeConnections: scopeConnectionsClient, - SecurityAdminConfigurations: securityAdminConfigurationsClient, - SecurityPartnerProviders: securityPartnerProvidersClient, - SecurityRules: securityRulesClient, - ServiceEndpointPolicies: serviceEndpointPoliciesClient, - ServiceEndpointPolicyDefinitions: serviceEndpointPolicyDefinitionsClient, - ServiceTags: serviceTagsClient, - StaticMembers: staticMembersClient, - Subnets: subnetsClient, - TrafficAnalytics: trafficAnalyticsClient, - Usages: usagesClient, - VMSSPublicIPAddresses: vMSSPublicIPAddressesClient, - VipSwap: vipSwapClient, - VirtualApplianceSites: virtualApplianceSitesClient, - VirtualApplianceSkus: virtualApplianceSkusClient, - VirtualNetworkGatewayConnections: virtualNetworkGatewayConnectionsClient, - VirtualNetworkGateways: virtualNetworkGatewaysClient, - VirtualNetworkPeerings: virtualNetworkPeeringsClient, - VirtualNetworkTap: virtualNetworkTapClient, - VirtualNetworkTaps: virtualNetworkTapsClient, - VirtualNetworks: virtualNetworksClient, - VirtualRouterPeerings: virtualRouterPeeringsClient, - VirtualRouters: virtualRoutersClient, - VirtualWANs: virtualWANsClient, - VpnGateways: vpnGatewaysClient, - VpnLinkConnections: vpnLinkConnectionsClient, - VpnServerConfigurations: vpnServerConfigurationsClient, - VpnSites: vpnSitesClient, - WebApplicationFirewallPolicies: webApplicationFirewallPoliciesClient, - WebCategories: webCategoriesClient, - }, nil -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/README.md b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/README.md deleted file mode 100644 index 56db111dd54..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/README.md +++ /dev/null @@ -1,71 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/cloudservicepublicipaddresses` Documentation - -The `cloudservicepublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/cloudservicepublicipaddresses" -``` - - -### Client Initialization - -```go -client := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesGetCloudServicePublicIPAddress` - -```go -ctx := context.TODO() -id := commonids.NewCloudServicesPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") - -read, err := client.PublicIPAddressesGetCloudServicePublicIPAddress(ctx, id, cloudservicepublicipaddresses.DefaultPublicIPAddressesGetCloudServicePublicIPAddressOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServicePublicIPAddresses` - -```go -ctx := context.TODO() -id := cloudservicepublicipaddresses.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - -// alternatively `client.PublicIPAddressesListCloudServicePublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListCloudServicePublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses` - -```go -ctx := context.TODO() -id := commonids.NewCloudServicesIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue") - -// alternatively `client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/constants.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/constants.go deleted file mode 100644 index 775730aae62..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package cloudservicepublicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 8b7c7a5e9a7..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 32854c40bbf..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index a4a672bb9ea..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 59fc873f762..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index 3918c59b2ce..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index 7ab10544095..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/version.go b/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/version.go deleted file mode 100644 index 97d16c9368a..00000000000 --- a/resource-manager/network/2023-04-01/cloudservicepublicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/cloudservicepublicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/connectionmonitors/README.md b/resource-manager/network/2023-04-01/connectionmonitors/README.md deleted file mode 100644 index 6eb53be4f58..00000000000 --- a/resource-manager/network/2023-04-01/connectionmonitors/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/connectionmonitors` Documentation - -The `connectionmonitors` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/connectionmonitors" -``` - - -### Client Initialization - -```go -client := connectionmonitors.NewConnectionMonitorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConnectionMonitorsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -payload := connectionmonitors.ConnectionMonitor{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, connectionmonitors.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Delete` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Get` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -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: `ConnectionMonitorsClient.List` - -```go -ctx := context.TODO() -id := connectionmonitors.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `ConnectionMonitorsClient.Query` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.QueryThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Start` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Stop` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.UpdateTags` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -payload := connectionmonitors.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/network/2023-04-01/connectionmonitors/version.go b/resource-manager/network/2023-04-01/connectionmonitors/version.go deleted file mode 100644 index da84f8a3b6b..00000000000 --- a/resource-manager/network/2023-04-01/connectionmonitors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectionmonitors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/connectionmonitors/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/README.md b/resource-manager/network/2023-04-01/connectivityconfigurations/README.md deleted file mode 100644 index 72cb2be610a..00000000000 --- a/resource-manager/network/2023-04-01/connectivityconfigurations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/connectivityconfigurations` Documentation - -The `connectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/connectivityconfigurations" -``` - - -### Client Initialization - -```go -client := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConnectivityConfigurationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -payload := connectivityconfigurations.ConnectivityConfiguration{ - // ... -} - - -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: `ConnectivityConfigurationsClient.Delete` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectivityConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -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: `ConnectivityConfigurationsClient.List` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, connectivityconfigurations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, connectivityconfigurations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivityconfigurationproperties.go deleted file mode 100644 index 643d3c116ab..00000000000 --- a/resource-manager/network/2023-04-01/connectivityconfigurations/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/connectivityconfigurations/version.go b/resource-manager/network/2023-04-01/connectivityconfigurations/version.go deleted file mode 100644 index eceb4f2d059..00000000000 --- a/resource-manager/network/2023-04-01/connectivityconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectivityconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/connectivityconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/customipprefixes/README.md b/resource-manager/network/2023-04-01/customipprefixes/README.md deleted file mode 100644 index 7387103a64f..00000000000 --- a/resource-manager/network/2023-04-01/customipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/customipprefixes` Documentation - -The `customipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/customipprefixes" -``` - - -### Client Initialization - -```go -client := customipprefixes.NewCustomIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CustomIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -payload := customipprefixes.CustomIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `CustomIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `CustomIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CustomIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `CustomIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CustomIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -payload := customipprefixes.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/network/2023-04-01/customipprefixes/version.go b/resource-manager/network/2023-04-01/customipprefixes/version.go deleted file mode 100644 index b7468184946..00000000000 --- a/resource-manager/network/2023-04-01/customipprefixes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package customipprefixes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/customipprefixes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/ddoscustompolicies/README.md b/resource-manager/network/2023-04-01/ddoscustompolicies/README.md deleted file mode 100644 index f99c8c4f467..00000000000 --- a/resource-manager/network/2023-04-01/ddoscustompolicies/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ddoscustompolicies` Documentation - -The `ddoscustompolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/ddoscustompolicies" -``` - - -### Client Initialization - -```go -client := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DdosCustomPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -payload := ddoscustompolicies.DdosCustomPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosCustomPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosCustomPoliciesClient.Get` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -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: `DdosCustomPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -payload := ddoscustompolicies.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/network/2023-04-01/ddoscustompolicies/version.go b/resource-manager/network/2023-04-01/ddoscustompolicies/version.go deleted file mode 100644 index 57be8e34cc6..00000000000 --- a/resource-manager/network/2023-04-01/ddoscustompolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ddoscustompolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ddoscustompolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/ddosprotectionplans/README.md b/resource-manager/network/2023-04-01/ddosprotectionplans/README.md deleted file mode 100644 index a5e8b8109b5..00000000000 --- a/resource-manager/network/2023-04-01/ddosprotectionplans/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ddosprotectionplans` Documentation - -The `ddosprotectionplans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/ddosprotectionplans" -``` - - -### Client Initialization - -```go -client := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DdosProtectionPlansClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -payload := ddosprotectionplans.DdosProtectionPlan{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosProtectionPlansClient.Delete` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosProtectionPlansClient.Get` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.UpdateTags` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -payload := ddosprotectionplans.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/network/2023-04-01/ddosprotectionplans/version.go b/resource-manager/network/2023-04-01/ddosprotectionplans/version.go deleted file mode 100644 index b50a5f3dfb1..00000000000 --- a/resource-manager/network/2023-04-01/ddosprotectionplans/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ddosprotectionplans - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ddosprotectionplans/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/README.md b/resource-manager/network/2023-04-01/dscpconfiguration/README.md deleted file mode 100644 index 0535838386e..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/README.md +++ /dev/null @@ -1,65 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/dscpconfiguration` Documentation - -The `dscpconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/dscpconfiguration" -``` - - -### Client Initialization - -```go -client := dscpconfiguration.NewDscpConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DscpConfigurationClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -payload := dscpconfiguration.DscpConfiguration{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DscpConfigurationClient.Delete` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DscpConfigurationClient.Get` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -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 -} -``` diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/constants.go b/resource-manager/network/2023-04-01/dscpconfiguration/constants.go deleted file mode 100644 index fccfd261eb9..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/constants.go +++ /dev/null @@ -1,1213 +0,0 @@ -package dscpconfiguration - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTcp ProtocolType = "Tcp" - ProtocolTypeUdp ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeAh), - string(ProtocolTypeAll), - string(ProtocolTypeDoNotUse), - string(ProtocolTypeEsp), - string(ProtocolTypeGre), - string(ProtocolTypeIcmp), - string(ProtocolTypeTcp), - string(ProtocolTypeUdp), - string(ProtocolTypeVxlan), - } -} - -func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProtocolType(input string) (*ProtocolType, error) { - vals := map[string]ProtocolType{ - "ah": ProtocolTypeAh, - "all": ProtocolTypeAll, - "donotuse": ProtocolTypeDoNotUse, - "esp": ProtocolTypeEsp, - "gre": ProtocolTypeGre, - "icmp": ProtocolTypeIcmp, - "tcp": ProtocolTypeTcp, - "udp": ProtocolTypeUdp, - "vxlan": ProtocolTypeVxlan, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtocolType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 8bbfd2e47e3..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacepropertiesformat.go deleted file mode 100644 index d01f01f77fa..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointconnectionproperties.go deleted file mode 100644 index a3590daea44..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddressdnssettings.go deleted file mode 100644 index 9c3cb7a4ffe..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfiguration/model_securityrulepropertiesformat.go deleted file mode 100644 index 313bad92221..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfiguration/model_subnetpropertiesformat.go deleted file mode 100644 index 2321b7e8d12..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfiguration/version.go b/resource-manager/network/2023-04-01/dscpconfiguration/version.go deleted file mode 100644 index 45ba8375523..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/README.md b/resource-manager/network/2023-04-01/dscpconfigurations/README.md deleted file mode 100644 index a63fc6d6c91..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/dscpconfigurations` Documentation - -The `dscpconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/dscpconfigurations" -``` - - -### Client Initialization - -```go -client := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DscpConfigurationsClient.DscpConfigurationList` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.DscpConfigurationList(ctx, id)` can be used to do batched pagination -items, err := client.DscpConfigurationListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DscpConfigurationsClient.DscpConfigurationListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.DscpConfigurationListAll(ctx, id)` can be used to do batched pagination -items, err := client.DscpConfigurationListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/constants.go b/resource-manager/network/2023-04-01/dscpconfigurations/constants.go deleted file mode 100644 index fa8c7e737d7..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/constants.go +++ /dev/null @@ -1,1213 +0,0 @@ -package dscpconfigurations - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTcp ProtocolType = "Tcp" - ProtocolTypeUdp ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeAh), - string(ProtocolTypeAll), - string(ProtocolTypeDoNotUse), - string(ProtocolTypeEsp), - string(ProtocolTypeGre), - string(ProtocolTypeIcmp), - string(ProtocolTypeTcp), - string(ProtocolTypeUdp), - string(ProtocolTypeVxlan), - } -} - -func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProtocolType(input string) (*ProtocolType, error) { - vals := map[string]ProtocolType{ - "ah": ProtocolTypeAh, - "all": ProtocolTypeAll, - "donotuse": ProtocolTypeDoNotUse, - "esp": ProtocolTypeEsp, - "gre": ProtocolTypeGre, - "icmp": ProtocolTypeIcmp, - "tcp": ProtocolTypeTcp, - "udp": ProtocolTypeUdp, - "vxlan": ProtocolTypeVxlan, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtocolType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 9d15cc6c925..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 1d542c19b57..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointconnectionproperties.go deleted file mode 100644 index b41f2269c5b..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddressdnssettings.go deleted file mode 100644 index adee4abe556..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfigurations/model_securityrulepropertiesformat.go deleted file mode 100644 index d43f1f5f3b1..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/dscpconfigurations/model_subnetpropertiesformat.go deleted file mode 100644 index 6fc0633d4d9..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/dscpconfigurations/version.go b/resource-manager/network/2023-04-01/dscpconfigurations/version.go deleted file mode 100644 index 964e6491f3d..00000000000 --- a/resource-manager/network/2023-04-01/dscpconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/endpointservices/README.md b/resource-manager/network/2023-04-01/endpointservices/README.md deleted file mode 100644 index 8b6a51191d8..00000000000 --- a/resource-manager/network/2023-04-01/endpointservices/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/endpointservices` Documentation - -The `endpointservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/endpointservices" -``` - - -### Client Initialization - -```go -client := endpointservices.NewEndpointServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EndpointServicesClient.AvailableEndpointServicesList` - -```go -ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableEndpointServicesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/endpointservices/version.go b/resource-manager/network/2023-04-01/endpointservices/version.go deleted file mode 100644 index 8b988ee42c6..00000000000 --- a/resource-manager/network/2023-04-01/endpointservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package endpointservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/endpointservices/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/README.md b/resource-manager/network/2023-04-01/expressroutecircuitarptable/README.md deleted file mode 100644 index 9b873ef493c..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitarptable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitarptable` Documentation - -The `expressroutecircuitarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitarptable" -``` - - -### Client Initialization - -```go -client := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitArpTableClient.ExpressRouteCircuitsListArpTable` - -```go -ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue") - -// alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutecircuitarptable/version.go b/resource-manager/network/2023-04-01/expressroutecircuitarptable/version.go deleted file mode 100644 index 36d93d2b8dc..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitarptable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitarptable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitarptable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/README.md deleted file mode 100644 index f298a3220f7..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitauthorizations` Documentation - -The `expressroutecircuitauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitauthorizations" -``` - - -### Client Initialization - -```go -client := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -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: `ExpressRouteCircuitAuthorizationsClient.List` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -// 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/network/2023-04-01/expressroutecircuitauthorizations/version.go b/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/version.go deleted file mode 100644 index 911971af334..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitauthorizations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitauthorizations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitauthorizations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitconnections/README.md b/resource-manager/network/2023-04-01/expressroutecircuitconnections/README.md deleted file mode 100644 index c99665f186d..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitconnections/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitconnections` Documentation - -The `expressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitconnections" -``` - - -### Client Initialization - -```go -client := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -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: `ExpressRouteCircuitConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -// 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/network/2023-04-01/expressroutecircuitconnections/version.go b/resource-manager/network/2023-04-01/expressroutecircuitconnections/version.go deleted file mode 100644 index f3217b60c83..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2023-04-01/expressroutecircuitpeerings/README.md deleted file mode 100644 index 3d57779fdfa..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitpeerings` Documentation - -The `expressroutecircuitpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitpeerings" -``` - - -### Client Initialization - -```go -client := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -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: `ExpressRouteCircuitPeeringsClient.List` - -```go -ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -// 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/network/2023-04-01/expressroutecircuitpeerings/version.go b/resource-manager/network/2023-04-01/expressroutecircuitpeerings/version.go deleted file mode 100644 index eaea3c7f496..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2023-04-01/expressroutecircuitroutestable/README.md deleted file mode 100644 index 1102e80c134..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitroutestable` Documentation - -The `expressroutecircuitroutestable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitroutestable" -``` - - -### Client Initialization - -```go -client := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitRoutesTableClient.ExpressRouteCircuitsListRoutesTable` - -```go -ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue") - -// alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/version.go b/resource-manager/network/2023-04-01/expressroutecircuitroutestable/version.go deleted file mode 100644 index c43cb68c4a6..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitroutestable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/README.md deleted file mode 100644 index 8650bf63e35..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary` Documentation - -The `expressroutecircuitroutestablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitroutestablesummary" -``` - - -### Client Initialization - -```go -client := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitRoutesTableSummaryClient.ExpressRouteCircuitsListRoutesTableSummary` - -```go -ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue") - -// alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/version.go b/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/version.go deleted file mode 100644 index 28845540836..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitroutestablesummary/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestablesummary - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestablesummary/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/README.md b/resource-manager/network/2023-04-01/expressroutecircuits/README.md deleted file mode 100644 index 7c6ca9d8ce3..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuits/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuits` Documentation - -The `expressroutecircuits` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuits" -``` - - -### Client Initialization - -```go -client := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -payload := expressroutecircuits.ExpressRouteCircuit{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -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: `ExpressRouteCircuitsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ExpressRouteCircuitsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -payload := expressroutecircuits.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/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go b/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go deleted file mode 100644 index 89faee5aa48..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPropertiesFormat struct { - AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationStatus *string `json:"authorizationStatus,omitempty"` - Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` - BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` - CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` - ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceKey *string `json:"serviceKey,omitempty"` - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - Stag *int64 `json:"stag,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuits/version.go b/resource-manager/network/2023-04-01/expressroutecircuits/version.go deleted file mode 100644 index ccaf773aff9..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuits/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuits/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecircuitstats/README.md b/resource-manager/network/2023-04-01/expressroutecircuitstats/README.md deleted file mode 100644 index 0f785e284d1..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitstats/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecircuitstats` Documentation - -The `expressroutecircuitstats` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecircuitstats" -``` - - -### Client Initialization - -```go -client := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetPeeringStats` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetStats` - -```go -ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -read, err := client.ExpressRouteCircuitsGetStats(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/network/2023-04-01/expressroutecircuitstats/version.go b/resource-manager/network/2023-04-01/expressroutecircuitstats/version.go deleted file mode 100644 index 0272093d41e..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecircuitstats/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitstats - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitstats/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressrouteconnections/README.md b/resource-manager/network/2023-04-01/expressrouteconnections/README.md deleted file mode 100644 index 41a594c3928..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteconnections/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteconnections` Documentation - -The `expressrouteconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressrouteconnections" -``` - - -### Client Initialization - -```go -client := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -payload := expressrouteconnections.ExpressRouteConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -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: `ExpressRouteConnectionsClient.List` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -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/network/2023-04-01/expressrouteconnections/version.go b/resource-manager/network/2023-04-01/expressrouteconnections/version.go deleted file mode 100644 index a8cd6e76185..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/README.md deleted file mode 100644 index da5a3895754..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable` Documentation - -The `expressroutecrossconnectionarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecrossconnectionarptable" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionArpTableClient.ExpressRouteCrossConnectionsListArpTable` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue") - -// alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/version.go b/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/version.go deleted file mode 100644 index 5e4b631a13f..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionarptable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionarptable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionarptable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/README.md deleted file mode 100644 index 46a8b421359..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings` Documentation - -The `expressroutecrossconnectionpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecrossconnectionpeerings" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -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: `ExpressRouteCrossConnectionPeeringsClient.List` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -// 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/network/2023-04-01/expressroutecrossconnectionpeerings/version.go b/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/version.go deleted file mode 100644 index 87af59a5f9c..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/README.md deleted file mode 100644 index 443d5694e25..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable` Documentation - -The `expressroutecrossconnectionroutetable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecrossconnectionroutetable" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionRouteTableClient.ExpressRouteCrossConnectionsListRoutesTable` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue") - -// alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/version.go b/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/version.go deleted file mode 100644 index cdc660fef24..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/README.md deleted file mode 100644 index 79448848280..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary` Documentation - -The `expressroutecrossconnectionroutetablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecrossconnectionroutetablesummary" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionRouteTableSummaryClient.ExpressRouteCrossConnectionsListRoutesTableSummary` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue") - -// alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/version.go b/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/version.go deleted file mode 100644 index d29954d9f58..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnectionroutetablesummary/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetablesummary/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutecrossconnections/README.md b/resource-manager/network/2023-04-01/expressroutecrossconnections/README.md deleted file mode 100644 index 3095c6baaa3..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnections/README.md +++ /dev/null @@ -1,109 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutecrossconnections` Documentation - -The `expressroutecrossconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutecrossconnections" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -payload := expressroutecrossconnections.ExpressRouteCrossConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -payload := expressroutecrossconnections.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/network/2023-04-01/expressroutecrossconnections/version.go b/resource-manager/network/2023-04-01/expressroutecrossconnections/version.go deleted file mode 100644 index fa4745c82c1..00000000000 --- a/resource-manager/network/2023-04-01/expressroutecrossconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutegateways/README.md b/resource-manager/network/2023-04-01/expressroutegateways/README.md deleted file mode 100644 index efe796ef97a..00000000000 --- a/resource-manager/network/2023-04-01/expressroutegateways/README.md +++ /dev/null @@ -1,115 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutegateways` Documentation - -The `expressroutegateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutegateways" -``` - - -### Client Initialization - -```go -client := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -payload := expressroutegateways.ExpressRouteGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.Get` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -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: `ExpressRouteGatewaysClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.ListByResourceGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListBySubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -payload := expressroutegateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/expressroutegateways/version.go b/resource-manager/network/2023-04-01/expressroutegateways/version.go deleted file mode 100644 index 685954d7d20..00000000000 --- a/resource-manager/network/2023-04-01/expressroutegateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutegateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressroutelinks/README.md b/resource-manager/network/2023-04-01/expressroutelinks/README.md deleted file mode 100644 index a5946d331d3..00000000000 --- a/resource-manager/network/2023-04-01/expressroutelinks/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressroutelinks` Documentation - -The `expressroutelinks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressroutelinks" -``` - - -### Client Initialization - -```go -client := expressroutelinks.NewExpressRouteLinksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteLinksClient.Get` - -```go -ctx := context.TODO() -id := expressroutelinks.NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue") - -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: `ExpressRouteLinksClient.List` - -```go -ctx := context.TODO() -id := expressroutelinks.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -// 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/network/2023-04-01/expressroutelinks/version.go b/resource-manager/network/2023-04-01/expressroutelinks/version.go deleted file mode 100644 index 4de682ff638..00000000000 --- a/resource-manager/network/2023-04-01/expressroutelinks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutelinks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutelinks/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressrouteportauthorizations/README.md b/resource-manager/network/2023-04-01/expressrouteportauthorizations/README.md deleted file mode 100644 index ead5e0ec84f..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteportauthorizations/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteportauthorizations` Documentation - -The `expressrouteportauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressrouteportauthorizations" -``` - - -### Client Initialization - -```go -client := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -payload := expressrouteportauthorizations.ExpressRoutePortAuthorization{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -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: `ExpressRoutePortAuthorizationsClient.List` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -// 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/network/2023-04-01/expressrouteportauthorizations/version.go b/resource-manager/network/2023-04-01/expressrouteportauthorizations/version.go deleted file mode 100644 index 393f0b39118..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteportauthorizations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportauthorizations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportauthorizations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressrouteports/README.md b/resource-manager/network/2023-04-01/expressrouteports/README.md deleted file mode 100644 index 00476be3432..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteports/README.md +++ /dev/null @@ -1,142 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteports` Documentation - -The `expressrouteports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressrouteports" -``` - - -### Client Initialization - -```go -client := expressrouteports.NewExpressRoutePortsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.ExpressRoutePort{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortsClient.GenerateLOA` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.GenerateExpressRoutePortsLOARequest{ - // ... -} - - -read, err := client.GenerateLOA(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRoutePortsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.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/network/2023-04-01/expressrouteports/version.go b/resource-manager/network/2023-04-01/expressrouteports/version.go deleted file mode 100644 index 4a4a7afdc20..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteports/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteports - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteports/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/README.md b/resource-manager/network/2023-04-01/expressrouteportslocations/README.md deleted file mode 100644 index 5853ce489a1..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteportslocations/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteportslocations` Documentation - -The `expressrouteportslocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressrouteportslocations" -``` - - -### Client Initialization - -```go -client := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortsLocationsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue") - -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: `ExpressRoutePortsLocationsClient.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 -} -``` diff --git a/resource-manager/network/2023-04-01/expressrouteportslocations/version.go b/resource-manager/network/2023-04-01/expressrouteportslocations/version.go deleted file mode 100644 index c6189b6fe81..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteportslocations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportslocations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportslocations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/README.md b/resource-manager/network/2023-04-01/expressrouteproviderports/README.md deleted file mode 100644 index 339f986ea58..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteproviderports/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteproviderports` Documentation - -The `expressrouteproviderports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressrouteproviderports" -``` - - -### Client Initialization - -```go -client := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteProviderPortsClient.ExpressRouteProviderPort` - -```go -ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue") - -read, err := client.ExpressRouteProviderPort(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteProviderPortsClient.LocationList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.LocationList(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions())` can be used to do batched pagination -items, err := client.LocationListComplete(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/expressrouteproviderports/version.go b/resource-manager/network/2023-04-01/expressrouteproviderports/version.go deleted file mode 100644 index 10be93a3188..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteproviderports/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteproviderports - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteproviderports/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/README.md b/resource-manager/network/2023-04-01/expressrouteserviceproviders/README.md deleted file mode 100644 index 4859705f064..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteserviceproviders/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/expressrouteserviceproviders` Documentation - -The `expressrouteserviceproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/expressrouteserviceproviders" -``` - - -### Client Initialization - -```go -client := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteServiceProvidersClient.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 -} -``` diff --git a/resource-manager/network/2023-04-01/expressrouteserviceproviders/version.go b/resource-manager/network/2023-04-01/expressrouteserviceproviders/version.go deleted file mode 100644 index 8c613101ee5..00000000000 --- a/resource-manager/network/2023-04-01/expressrouteserviceproviders/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteserviceproviders - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteserviceproviders/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/firewallpolicies/README.md b/resource-manager/network/2023-04-01/firewallpolicies/README.md deleted file mode 100644 index 3d8ae11aec8..00000000000 --- a/resource-manager/network/2023-04-01/firewallpolicies/README.md +++ /dev/null @@ -1,237 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/firewallpolicies` Documentation - -The `firewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/firewallpolicies" -``` - - -### Client Initialization - -```go -client := firewallpolicies.NewFirewallPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.FirewallPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesFilterValuesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignatureOverridesFilterValuesQuery{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesFilterValuesList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.IDPSQueryObject{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesGet` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.FirewallPolicyIdpsSignaturesOverridesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.FirewallPolicyIdpsSignaturesOverridesList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPatch` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignaturesOverrides{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesOverridesPatch(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPut` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignaturesOverrides{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesOverridesPut(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.Get` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.Get(ctx, id, firewallpolicies.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `FirewallPoliciesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `FirewallPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.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/network/2023-04-01/firewallpolicies/version.go b/resource-manager/network/2023-04-01/firewallpolicies/version.go deleted file mode 100644 index d7493ce5a81..00000000000 --- a/resource-manager/network/2023-04-01/firewallpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/README.md b/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/README.md deleted file mode 100644 index ee0d83259c5..00000000000 --- a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups` Documentation - -The `firewallpolicyrulecollectiongroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/firewallpolicyrulecollectiongroups" -``` - - -### Client Initialization - -```go -client := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -payload := firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Delete` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Get` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -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: `FirewallPolicyRuleCollectionGroupsClient.List` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -// 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/network/2023-04-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_applicationrule.go deleted file mode 100644 index 3e2815413ed..00000000000 --- a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ /dev/null @@ -1,52 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = ApplicationRule{} - -type ApplicationRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - FqdnTags *[]string `json:"fqdnTags,omitempty"` - HTTPHeadersToInsert *[]FirewallPolicyHTTPHeaderToInsert `json:"httpHeadersToInsert,omitempty"` - Protocols *[]FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` - TerminateTLS *bool `json:"terminateTLS,omitempty"` - WebCategories *[]string `json:"webCategories,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = ApplicationRule{} - -func (s ApplicationRule) MarshalJSON() ([]byte, error) { - type wrapper ApplicationRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ApplicationRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ApplicationRule: %+v", err) - } - decoded["ruleType"] = "ApplicationRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ApplicationRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go b/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go deleted file mode 100644 index f7dd43c6089..00000000000 --- a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyHTTPHeaderToInsert struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/version.go b/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/version.go deleted file mode 100644 index c9ac5708d25..00000000000 --- a/resource-manager/network/2023-04-01/firewallpolicyrulecollectiongroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicyrulecollectiongroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/flowlogs/README.md b/resource-manager/network/2023-04-01/flowlogs/README.md deleted file mode 100644 index a419c4e8baf..00000000000 --- a/resource-manager/network/2023-04-01/flowlogs/README.md +++ /dev/null @@ -1,103 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/flowlogs` Documentation - -The `flowlogs` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/flowlogs" -``` - - -### Client Initialization - -```go -client := flowlogs.NewFlowLogsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FlowLogsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -payload := flowlogs.FlowLog{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FlowLogsClient.Delete` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FlowLogsClient.Get` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -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: `FlowLogsClient.List` - -```go -ctx := context.TODO() -id := flowlogs.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -// 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: `FlowLogsClient.UpdateTags` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -payload := flowlogs.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/network/2023-04-01/flowlogs/version.go b/resource-manager/network/2023-04-01/flowlogs/version.go deleted file mode 100644 index e0158de7799..00000000000 --- a/resource-manager/network/2023-04-01/flowlogs/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package flowlogs - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/flowlogs/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/ipallocations/README.md b/resource-manager/network/2023-04-01/ipallocations/README.md deleted file mode 100644 index c9fc778ddeb..00000000000 --- a/resource-manager/network/2023-04-01/ipallocations/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ipallocations` Documentation - -The `ipallocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/ipallocations" -``` - - -### Client Initialization - -```go -client := ipallocations.NewIPAllocationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IPAllocationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -payload := ipallocations.IPAllocation{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPAllocationsClient.Delete` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPAllocationsClient.Get` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -read, err := client.Get(ctx, id, ipallocations.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IPAllocationsClient.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: `IPAllocationsClient.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: `IPAllocationsClient.UpdateTags` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -payload := ipallocations.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/network/2023-04-01/ipallocations/version.go b/resource-manager/network/2023-04-01/ipallocations/version.go deleted file mode 100644 index 33398bbd5b4..00000000000 --- a/resource-manager/network/2023-04-01/ipallocations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ipallocations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ipallocations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/ipgroups/README.md b/resource-manager/network/2023-04-01/ipgroups/README.md deleted file mode 100644 index 44a3410d686..00000000000 --- a/resource-manager/network/2023-04-01/ipgroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/ipgroups` Documentation - -The `ipgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/ipgroups" -``` - - -### Client Initialization - -```go -client := ipgroups.NewIPGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IPGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -payload := ipgroups.IPGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPGroupsClient.Delete` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPGroupsClient.Get` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IPGroupsClient.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: `IPGroupsClient.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: `IPGroupsClient.UpdateGroups` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -payload := ipgroups.TagsObject{ - // ... -} - - -read, err := client.UpdateGroups(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/network/2023-04-01/ipgroups/version.go b/resource-manager/network/2023-04-01/ipgroups/version.go deleted file mode 100644 index b488ee108d0..00000000000 --- a/resource-manager/network/2023-04-01/ipgroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ipgroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ipgroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/README.md b/resource-manager/network/2023-04-01/loadbalancers/README.md deleted file mode 100644 index c71f420a2c6..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/README.md +++ /dev/null @@ -1,449 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/loadbalancers` Documentation - -The `loadbalancers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/loadbalancers" -``` - - -### Client Initialization - -```go -client := loadbalancers.NewLoadBalancersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LoadBalancersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -payload := loadbalancers.LoadBalancer{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.Delete` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.Get` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -read, err := client.Get(ctx, id, loadbalancers.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -payload := loadbalancers.InboundNatRule{ - // ... -} - - -if err := client.InboundNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesDelete` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -if err := client.InboundNatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -read, err := client.InboundNatRulesGet(ctx, id, loadbalancers.DefaultInboundNatRulesGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.InboundNatRulesList(ctx, id)` can be used to do batched pagination -items, err := client.InboundNatRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LoadBalancersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.ListInboundNatRulePortMappings` - -```go -ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue") - -payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ - // ... -} - - -if err := client.ListInboundNatRulePortMappingsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsCreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -payload := loadbalancers.BackendAddressPool{ - // ... -} - - -if err := client.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsDelete` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -if err := client.LoadBalancerBackendAddressPoolsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -read, err := client.LoadBalancerBackendAddressPoolsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerBackendAddressPoolsList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerBackendAddressPoolsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue") - -read, err := client.LoadBalancerFrontendIPConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerFrontendIPConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerFrontendIPConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue") - -read, err := client.LoadBalancerLoadBalancingRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerLoadBalancingRulesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerLoadBalancingRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerNetworkInterfacesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerNetworkInterfacesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerNetworkInterfacesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue") - -read, err := client.LoadBalancerOutboundRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerOutboundRulesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerOutboundRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerProbesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue") - -read, err := client.LoadBalancerProbesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerProbesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerProbesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerProbesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.MigrateToIPBased` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue") - -payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ - // ... -} - - -read, err := client.MigrateToIPBased(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.SwapPublicIPAddresses` - -```go -ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := loadbalancers.LoadBalancerVipSwapRequest{ - // ... -} - - -if err := client.SwapPublicIPAddressesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.UpdateTags` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -payload := loadbalancers.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/network/2023-04-01/loadbalancers/constants.go b/resource-manager/network/2023-04-01/loadbalancers/constants.go deleted file mode 100644 index 0e8874db62b..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/constants.go +++ /dev/null @@ -1,1368 +0,0 @@ -package loadbalancers - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" -) - -func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { - return []string{ - string(LoadBalancerOutboundRuleProtocolAll), - string(LoadBalancerOutboundRuleProtocolTcp), - string(LoadBalancerOutboundRuleProtocolUdp), - } -} - -func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerOutboundRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { - vals := map[string]LoadBalancerOutboundRuleProtocol{ - "all": LoadBalancerOutboundRuleProtocolAll, - "tcp": LoadBalancerOutboundRuleProtocolTcp, - "udp": LoadBalancerOutboundRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerOutboundRuleProtocol(input) - return &out, nil -} - -type LoadBalancerSkuName string - -const ( - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -func PossibleValuesForLoadBalancerSkuName() []string { - return []string{ - string(LoadBalancerSkuNameBasic), - string(LoadBalancerSkuNameGateway), - string(LoadBalancerSkuNameStandard), - } -} - -func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { - vals := map[string]LoadBalancerSkuName{ - "basic": LoadBalancerSkuNameBasic, - "gateway": LoadBalancerSkuNameGateway, - "standard": LoadBalancerSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuName(input) - return &out, nil -} - -type LoadBalancerSkuTier string - -const ( - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" -) - -func PossibleValuesForLoadBalancerSkuTier() []string { - return []string{ - string(LoadBalancerSkuTierGlobal), - string(LoadBalancerSkuTierRegional), - } -} - -func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { - vals := map[string]LoadBalancerSkuTier{ - "global": LoadBalancerSkuTierGlobal, - "regional": LoadBalancerSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuTier(input) - return &out, nil -} - -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -func PossibleValuesForLoadDistribution() []string { - return []string{ - string(LoadDistributionDefault), - string(LoadDistributionSourceIP), - string(LoadDistributionSourceIPProtocol), - } -} - -func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadDistribution(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadDistribution(input string) (*LoadDistribution, error) { - vals := map[string]LoadDistribution{ - "default": LoadDistributionDefault, - "sourceip": LoadDistributionSourceIP, - "sourceipprotocol": LoadDistributionSourceIPProtocol, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadDistribution(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTcp ProbeProtocol = "Tcp" -) - -func PossibleValuesForProbeProtocol() []string { - return []string{ - string(ProbeProtocolHTTP), - string(ProbeProtocolHTTPS), - string(ProbeProtocolTcp), - } -} - -func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProbeProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProbeProtocol(input string) (*ProbeProtocol, error) { - vals := map[string]ProbeProtocol{ - "http": ProbeProtocolHTTP, - "https": ProbeProtocolHTTPS, - "tcp": ProbeProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProbeProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer.go deleted file mode 100644 index 35278257e30..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer.go +++ /dev/null @@ -1,130 +0,0 @@ -package loadbalancers - -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(&LoadBalancerId{}) -} - -var _ resourceids.ResourceId = &LoadBalancerId{} - -// LoadBalancerId is a struct representing the Resource ID for a Load Balancer -type LoadBalancerId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string -} - -// NewLoadBalancerID returns a new LoadBalancerId struct -func NewLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) LoadBalancerId { - return LoadBalancerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - } -} - -// ParseLoadBalancerID parses 'input' into a LoadBalancerId -func ParseLoadBalancerID(input string) (*LoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancerIDInsensitively parses 'input' case-insensitively into a LoadBalancerId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancerIDInsensitively(input string) (*LoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - return nil -} - -// ValidateLoadBalancerID checks that 'input' can be parsed as a Load Balancer ID -func ValidateLoadBalancerID(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 := ParseLoadBalancerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancer ID -func (id LoadBalancerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancer ID -func (id LoadBalancerId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - } -} - -// String returns a human-readable description of this Load Balancer ID -func (id LoadBalancerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - } - return fmt.Sprintf("Load Balancer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer_test.go deleted file mode 100644 index 88f22b83175..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/id_loadbalancer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadbalancers - -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 = &LoadBalancerId{} - -func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } -} - -func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestParseLoadBalancerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestSegmentsForLoadBalancerId(t *testing.T) { - segments := LoadBalancerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancerId 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/network/2023-04-01/loadbalancers/id_providerloadbalancer.go b/resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer.go deleted file mode 100644 index 88ab98c83ad..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer.go +++ /dev/null @@ -1,130 +0,0 @@ -package loadbalancers - -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(&ProviderLoadBalancerId{}) -} - -var _ resourceids.ResourceId = &ProviderLoadBalancerId{} - -// ProviderLoadBalancerId is a struct representing the Resource ID for a Provider Load Balancer -type ProviderLoadBalancerId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string -} - -// NewProviderLoadBalancerID returns a new ProviderLoadBalancerId struct -func NewProviderLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) ProviderLoadBalancerId { - return ProviderLoadBalancerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - } -} - -// ParseProviderLoadBalancerID parses 'input' into a ProviderLoadBalancerId -func ParseProviderLoadBalancerID(input string) (*ProviderLoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLoadBalancerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLoadBalancerIDInsensitively parses 'input' case-insensitively into a ProviderLoadBalancerId -// note: this method should only be used for API response data and not user input -func ParseProviderLoadBalancerIDInsensitively(input string) (*ProviderLoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLoadBalancerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - return nil -} - -// ValidateProviderLoadBalancerID checks that 'input' can be parsed as a Provider Load Balancer ID -func ValidateProviderLoadBalancerID(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 := ParseProviderLoadBalancerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Load Balancer ID -func (id ProviderLoadBalancerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Load Balancer ID -func (id ProviderLoadBalancerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - } -} - -// String returns a human-readable description of this Provider Load Balancer ID -func (id ProviderLoadBalancerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - } - return fmt.Sprintf("Provider Load Balancer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer_test.go b/resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer_test.go deleted file mode 100644 index e721a740f82..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/id_providerloadbalancer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadbalancers - -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 = &ProviderLoadBalancerId{} - -func TestNewProviderLoadBalancerID(t *testing.T) { - id := NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } -} - -func TestFormatProviderLoadBalancerID(t *testing.T) { - actual := NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLoadBalancerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLoadBalancerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestParseProviderLoadBalancerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLoadBalancerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestSegmentsForProviderLoadBalancerId(t *testing.T) { - segments := ProviderLoadBalancerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLoadBalancerId 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/network/2023-04-01/loadbalancers/method_createorupdate.go b/resource-manager/network/2023-04-01/loadbalancers/method_createorupdate.go deleted file mode 100644 index 891038c3395..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 *LoadBalancer -} - -// CreateOrUpdate ... -func (c LoadBalancersClient) CreateOrUpdate(ctx context.Context, id ProviderLoadBalancerId, input LoadBalancer) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) CreateOrUpdateThenPoll(ctx context.Context, id ProviderLoadBalancerId, input LoadBalancer) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-04-01/loadbalancers/method_delete.go b/resource-manager/network/2023-04-01/loadbalancers/method_delete.go deleted file mode 100644 index bf7acc08d90..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 LoadBalancersClient) Delete(ctx context.Context, id ProviderLoadBalancerId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LoadBalancersClient) DeleteThenPoll(ctx context.Context, id ProviderLoadBalancerId) 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/network/2023-04-01/loadbalancers/method_get.go b/resource-manager/network/2023-04-01/loadbalancers/method_get.go deleted file mode 100644 index a183aa5c7ae..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package loadbalancers - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *LoadBalancer -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c LoadBalancersClient) Get(ctx context.Context, id ProviderLoadBalancerId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 LoadBalancer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_inboundnatruleslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_inboundnatruleslist.go deleted file mode 100644 index e4b3847d83e..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_inboundnatruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 InboundNatRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]InboundNatRule -} - -type InboundNatRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []InboundNatRule -} - -// InboundNatRulesList ... -func (c LoadBalancersClient) InboundNatRulesList(ctx context.Context, id ProviderLoadBalancerId) (result InboundNatRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/inboundNatRules", 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 *[]InboundNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// InboundNatRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) InboundNatRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (InboundNatRulesListCompleteResult, error) { - return c.InboundNatRulesListCompleteMatchingPredicate(ctx, id, InboundNatRuleOperationPredicate{}) -} - -// InboundNatRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) InboundNatRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate InboundNatRuleOperationPredicate) (result InboundNatRulesListCompleteResult, err error) { - items := make([]InboundNatRule, 0) - - resp, err := c.InboundNatRulesList(ctx, id) - if err != nil { - 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 = InboundNatRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go deleted file mode 100644 index 7f6204b9606..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BackendAddressPool -} - -type LoadBalancerBackendAddressPoolsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsList ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerBackendAddressPoolsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/backendAddressPools", 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 *[]BackendAddressPool `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerBackendAddressPoolsListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerBackendAddressPoolsListCompleteResult, error) { - return c.LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx, id, BackendAddressPoolOperationPredicate{}) -} - -// LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate BackendAddressPoolOperationPredicate) (result LoadBalancerBackendAddressPoolsListCompleteResult, err error) { - items := make([]BackendAddressPool, 0) - - resp, err := c.LoadBalancerBackendAddressPoolsList(ctx, id) - if err != nil { - 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 = LoadBalancerBackendAddressPoolsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go deleted file mode 100644 index afce18597ba..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerFrontendIPConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FrontendIPConfiguration -} - -type LoadBalancerFrontendIPConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfigurationsList ... -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerFrontendIPConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/frontendIPConfigurations", 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 *[]FrontendIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerFrontendIPConfigurationsListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerFrontendIPConfigurationsListCompleteResult, error) { - return c.LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx, id, FrontendIPConfigurationOperationPredicate{}) -} - -// LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate FrontendIPConfigurationOperationPredicate) (result LoadBalancerFrontendIPConfigurationsListCompleteResult, err error) { - items := make([]FrontendIPConfiguration, 0) - - resp, err := c.LoadBalancerFrontendIPConfigurationsList(ctx, id) - if err != nil { - 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 = LoadBalancerFrontendIPConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go deleted file mode 100644 index 0bc29256da8..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerLoadBalancingRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancingRule -} - -type LoadBalancerLoadBalancingRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancingRule -} - -// LoadBalancerLoadBalancingRulesList ... -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerLoadBalancingRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/loadBalancingRules", 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 *[]LoadBalancingRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerLoadBalancingRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerLoadBalancingRulesListCompleteResult, error) { - return c.LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx, id, LoadBalancingRuleOperationPredicate{}) -} - -// LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate LoadBalancingRuleOperationPredicate) (result LoadBalancerLoadBalancingRulesListCompleteResult, err error) { - items := make([]LoadBalancingRule, 0) - - resp, err := c.LoadBalancerLoadBalancingRulesList(ctx, id) - if err != nil { - 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 = LoadBalancerLoadBalancingRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go deleted file mode 100644 index 90c70aa0330..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerNetworkInterfacesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type LoadBalancerNetworkInterfacesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// LoadBalancerNetworkInterfacesList ... -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerNetworkInterfacesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerNetworkInterfacesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerNetworkInterfacesListCompleteResult, error) { - return c.LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// LoadBalancerNetworkInterfacesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate NetworkInterfaceOperationPredicate) (result LoadBalancerNetworkInterfacesListCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.LoadBalancerNetworkInterfacesList(ctx, id) - if err != nil { - 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 = LoadBalancerNetworkInterfacesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalanceroutboundruleslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_loadbalanceroutboundruleslist.go deleted file mode 100644 index b0e91ba7b50..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalanceroutboundruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerOutboundRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]OutboundRule -} - -type LoadBalancerOutboundRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []OutboundRule -} - -// LoadBalancerOutboundRulesList ... -func (c LoadBalancersClient) LoadBalancerOutboundRulesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerOutboundRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/outboundRules", 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 *[]OutboundRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerOutboundRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerOutboundRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerOutboundRulesListCompleteResult, error) { - return c.LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx, id, OutboundRuleOperationPredicate{}) -} - -// LoadBalancerOutboundRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate OutboundRuleOperationPredicate) (result LoadBalancerOutboundRulesListCompleteResult, err error) { - items := make([]OutboundRule, 0) - - resp, err := c.LoadBalancerOutboundRulesList(ctx, id) - if err != nil { - 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 = LoadBalancerOutboundRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerprobeslist.go b/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerprobeslist.go deleted file mode 100644 index c0852a82dad..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_loadbalancerprobeslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerProbesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Probe -} - -type LoadBalancerProbesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Probe -} - -// LoadBalancerProbesList ... -func (c LoadBalancersClient) LoadBalancerProbesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerProbesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/probes", 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 *[]Probe `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerProbesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerProbesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerProbesListCompleteResult, error) { - return c.LoadBalancerProbesListCompleteMatchingPredicate(ctx, id, ProbeOperationPredicate{}) -} - -// LoadBalancerProbesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerProbesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate ProbeOperationPredicate) (result LoadBalancerProbesListCompleteResult, err error) { - items := make([]Probe, 0) - - resp, err := c.LoadBalancerProbesList(ctx, id) - if err != nil { - 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 = LoadBalancerProbesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_migratetoipbased.go b/resource-manager/network/2023-04-01/loadbalancers/method_migratetoipbased.go deleted file mode 100644 index 249adebb4a8..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_migratetoipbased.go +++ /dev/null @@ -1,59 +0,0 @@ -package loadbalancers - -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 MigrateToIPBasedOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MigratedPools -} - -// MigrateToIPBased ... -func (c LoadBalancersClient) MigrateToIPBased(ctx context.Context, id LoadBalancerId, input MigrateLoadBalancerToIPBasedRequest) (result MigrateToIPBasedOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/migrateToIpBased", 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 MigratedPools - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/method_updatetags.go b/resource-manager/network/2023-04-01/loadbalancers/method_updatetags.go deleted file mode 100644 index dd8a4561326..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package loadbalancers - -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 *LoadBalancer -} - -// UpdateTags ... -func (c LoadBalancersClient) UpdateTags(ctx context.Context, id ProviderLoadBalancerId, 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 LoadBalancer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/loadbalancers/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 6ce42b19e79..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_migratedpools.go b/resource-manager/network/2023-04-01/loadbalancers/model_migratedpools.go deleted file mode 100644 index 043a11e0729..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_migratedpools.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MigratedPools struct { - MigratedPools *[]string `json:"migratedPools,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go b/resource-manager/network/2023-04-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go deleted file mode 100644 index 7b22e45af7d..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MigrateLoadBalancerToIPBasedRequest struct { - Pools *[]string `json:"pools,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 2923295fe73..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointconnectionproperties.go deleted file mode 100644 index 0db98da1f3a..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/loadbalancers/model_publicipaddressdnssettings.go deleted file mode 100644 index 270d14db8a5..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/loadbalancers/model_securityrulepropertiesformat.go deleted file mode 100644 index 000a9d8a16f..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/loadbalancers/model_subnetpropertiesformat.go deleted file mode 100644 index 03b4dde75aa..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/loadbalancers/version.go b/resource-manager/network/2023-04-01/loadbalancers/version.go deleted file mode 100644 index 019bb21575c..00000000000 --- a/resource-manager/network/2023-04-01/loadbalancers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/loadbalancers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/localnetworkgateways/README.md b/resource-manager/network/2023-04-01/localnetworkgateways/README.md deleted file mode 100644 index e434aaf57ea..00000000000 --- a/resource-manager/network/2023-04-01/localnetworkgateways/README.md +++ /dev/null @@ -1,104 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/localnetworkgateways` Documentation - -The `localnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/localnetworkgateways" -``` - - -### Client Initialization - -```go -client := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LocalNetworkGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -payload := localnetworkgateways.LocalNetworkGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LocalNetworkGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LocalNetworkGatewaysClient.Get` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -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: `LocalNetworkGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LocalNetworkGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -payload := localnetworkgateways.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/network/2023-04-01/localnetworkgateways/version.go b/resource-manager/network/2023-04-01/localnetworkgateways/version.go deleted file mode 100644 index 7df0a76db9f..00000000000 --- a/resource-manager/network/2023-04-01/localnetworkgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package localnetworkgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/localnetworkgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/natgateways/README.md b/resource-manager/network/2023-04-01/natgateways/README.md deleted file mode 100644 index cca45c0de58..00000000000 --- a/resource-manager/network/2023-04-01/natgateways/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/natgateways` Documentation - -The `natgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/natgateways" -``` - - -### Client Initialization - -```go -client := natgateways.NewNatGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NatGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -payload := natgateways.NatGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NatGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NatGatewaysClient.Get` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -read, err := client.Get(ctx, id, natgateways.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NatGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NatGatewaysClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NatGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -payload := natgateways.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/network/2023-04-01/natgateways/version.go b/resource-manager/network/2023-04-01/natgateways/version.go deleted file mode 100644 index c4171820b44..00000000000 --- a/resource-manager/network/2023-04-01/natgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package natgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/natgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkgroups/README.md b/resource-manager/network/2023-04-01/networkgroups/README.md deleted file mode 100644 index 8049dc7e84b..00000000000 --- a/resource-manager/network/2023-04-01/networkgroups/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkgroups` Documentation - -The `networkgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkgroups" -``` - - -### Client Initialization - -```go -client := networkgroups.NewNetworkGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -payload := networkgroups.NetworkGroup{ - // ... -} - - -read, err := client.CreateOrUpdate(ctx, id, payload, networkgroups.DefaultCreateOrUpdateOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkGroupsClient.Delete` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -if err := client.DeleteThenPoll(ctx, id, networkgroups.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkGroupsClient.Get` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -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: `NetworkGroupsClient.List` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, networkgroups.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, networkgroups.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/networkgroups/model_networkgroupproperties.go b/resource-manager/network/2023-04-01/networkgroups/model_networkgroupproperties.go deleted file mode 100644 index 69e5d9d5b22..00000000000 --- a/resource-manager/network/2023-04-01/networkgroups/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkgroups/version.go b/resource-manager/network/2023-04-01/networkgroups/version.go deleted file mode 100644 index 50c1904f714..00000000000 --- a/resource-manager/network/2023-04-01/networkgroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkgroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkgroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/README.md b/resource-manager/network/2023-04-01/networkinterfaces/README.md deleted file mode 100644 index f075724ef8f..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/README.md +++ /dev/null @@ -1,371 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkinterfaces` Documentation - -The `networkinterfaces` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkinterfaces" -``` - - -### Client Initialization - -```go -client := networkinterfaces.NewNetworkInterfacesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkInterfacesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.NetworkInterface{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -read, err := client.Get(ctx, id, networkinterfaces.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetCloudServiceNetworkInterface` - -```go -ctx := context.TODO() -id := networkinterfaces.NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue") - -read, err := client.GetCloudServiceNetworkInterface(ctx, id, networkinterfaces.DefaultGetCloudServiceNetworkInterfaceOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetEffectiveRouteTable` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.GetEffectiveRouteTable(ctx, id)` can be used to do batched pagination -items, err := client.GetEffectiveRouteTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetIPConfiguration` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") - -read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetNetworkInterface` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") - -read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkInterfacesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListCloudServiceNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - -// alternatively `client.ListCloudServiceNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListCloudServiceNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue") - -// alternatively `client.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListEffectiveNetworkSecurityGroups` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.ListEffectiveNetworkSecurityGroups(ctx, id)` can be used to do batched pagination -items, err := client.ListEffectiveNetworkSecurityGroupsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetIPConfigurations` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") - -// alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - -// alternatively `client.ListVirtualMachineScaleSetNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue") - -// alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsGet` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "ipConfigurationValue") - -read, err := client.NetworkInterfaceIPConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceIPConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceIPConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceLoadBalancersList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceLoadBalancersList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceLoadBalancersListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` - -```go -ctx := context.TODO() -id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue") - -read, err := client.NetworkInterfaceTapConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceTapConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceTapConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.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/network/2023-04-01/networkinterfaces/client.go b/resource-manager/network/2023-04-01/networkinterfaces/client.go deleted file mode 100644 index cd098aeccdf..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkinterfaces - -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 NetworkInterfacesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkInterfacesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkInterfacesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkinterfaces", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkInterfacesClient: %+v", err) - } - - return &NetworkInterfacesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/constants.go b/resource-manager/network/2023-04-01/networkinterfaces/constants.go deleted file mode 100644 index fc9528b4c86..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/constants.go +++ /dev/null @@ -1,1500 +0,0 @@ -package networkinterfaces - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type EffectiveRouteSource string - -const ( - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - EffectiveRouteSourceUser EffectiveRouteSource = "User" - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -func PossibleValuesForEffectiveRouteSource() []string { - return []string{ - string(EffectiveRouteSourceDefault), - string(EffectiveRouteSourceUnknown), - string(EffectiveRouteSourceUser), - string(EffectiveRouteSourceVirtualNetworkGateway), - } -} - -func (s *EffectiveRouteSource) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveRouteSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveRouteSource(input string) (*EffectiveRouteSource, error) { - vals := map[string]EffectiveRouteSource{ - "default": EffectiveRouteSourceDefault, - "unknown": EffectiveRouteSourceUnknown, - "user": EffectiveRouteSourceUser, - "virtualnetworkgateway": EffectiveRouteSourceVirtualNetworkGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveRouteSource(input) - return &out, nil -} - -type EffectiveRouteState string - -const ( - EffectiveRouteStateActive EffectiveRouteState = "Active" - EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" -) - -func PossibleValuesForEffectiveRouteState() []string { - return []string{ - string(EffectiveRouteStateActive), - string(EffectiveRouteStateInvalid), - } -} - -func (s *EffectiveRouteState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveRouteState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveRouteState(input string) (*EffectiveRouteState, error) { - vals := map[string]EffectiveRouteState{ - "active": EffectiveRouteStateActive, - "invalid": EffectiveRouteStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveRouteState(input) - return &out, nil -} - -type EffectiveSecurityRuleProtocol string - -const ( - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - EffectiveSecurityRuleProtocolTcp EffectiveSecurityRuleProtocol = "Tcp" - EffectiveSecurityRuleProtocolUdp EffectiveSecurityRuleProtocol = "Udp" -) - -func PossibleValuesForEffectiveSecurityRuleProtocol() []string { - return []string{ - string(EffectiveSecurityRuleProtocolAll), - string(EffectiveSecurityRuleProtocolTcp), - string(EffectiveSecurityRuleProtocolUdp), - } -} - -func (s *EffectiveSecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveSecurityRuleProtocol(input string) (*EffectiveSecurityRuleProtocol, error) { - vals := map[string]EffectiveSecurityRuleProtocol{ - "all": EffectiveSecurityRuleProtocolAll, - "tcp": EffectiveSecurityRuleProtocolTcp, - "udp": EffectiveSecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveSecurityRuleProtocol(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" -) - -func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { - return []string{ - string(LoadBalancerOutboundRuleProtocolAll), - string(LoadBalancerOutboundRuleProtocolTcp), - string(LoadBalancerOutboundRuleProtocolUdp), - } -} - -func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerOutboundRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { - vals := map[string]LoadBalancerOutboundRuleProtocol{ - "all": LoadBalancerOutboundRuleProtocolAll, - "tcp": LoadBalancerOutboundRuleProtocolTcp, - "udp": LoadBalancerOutboundRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerOutboundRuleProtocol(input) - return &out, nil -} - -type LoadBalancerSkuName string - -const ( - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -func PossibleValuesForLoadBalancerSkuName() []string { - return []string{ - string(LoadBalancerSkuNameBasic), - string(LoadBalancerSkuNameGateway), - string(LoadBalancerSkuNameStandard), - } -} - -func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { - vals := map[string]LoadBalancerSkuName{ - "basic": LoadBalancerSkuNameBasic, - "gateway": LoadBalancerSkuNameGateway, - "standard": LoadBalancerSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuName(input) - return &out, nil -} - -type LoadBalancerSkuTier string - -const ( - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" -) - -func PossibleValuesForLoadBalancerSkuTier() []string { - return []string{ - string(LoadBalancerSkuTierGlobal), - string(LoadBalancerSkuTierRegional), - } -} - -func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { - vals := map[string]LoadBalancerSkuTier{ - "global": LoadBalancerSkuTierGlobal, - "regional": LoadBalancerSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuTier(input) - return &out, nil -} - -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -func PossibleValuesForLoadDistribution() []string { - return []string{ - string(LoadDistributionDefault), - string(LoadDistributionSourceIP), - string(LoadDistributionSourceIPProtocol), - } -} - -func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadDistribution(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadDistribution(input string) (*LoadDistribution, error) { - vals := map[string]LoadDistribution{ - "default": LoadDistributionDefault, - "sourceip": LoadDistributionSourceIP, - "sourceipprotocol": LoadDistributionSourceIPProtocol, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadDistribution(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTcp ProbeProtocol = "Tcp" -) - -func PossibleValuesForProbeProtocol() []string { - return []string{ - string(ProbeProtocolHTTP), - string(ProbeProtocolHTTPS), - string(ProbeProtocolTcp), - } -} - -func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProbeProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProbeProtocol(input string) (*ProbeProtocol, error) { - vals := map[string]ProbeProtocol{ - "http": ProbeProtocolHTTP, - "https": ProbeProtocolHTTPS, - "tcp": ProbeProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProbeProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 7c5d918e43a..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 3fd3da2e6e6..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointconnectionproperties.go deleted file mode 100644 index eb2204732ec..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddressdnssettings.go deleted file mode 100644 index 9a6ffc1106a..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/networkinterfaces/model_securityrulepropertiesformat.go deleted file mode 100644 index 0ff4ba975dc..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/networkinterfaces/model_subnetpropertiesformat.go deleted file mode 100644 index c8311698c1c..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkinterfaces/version.go b/resource-manager/network/2023-04-01/networkinterfaces/version.go deleted file mode 100644 index b1cbec692dd..00000000000 --- a/resource-manager/network/2023-04-01/networkinterfaces/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkinterfaces/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/README.md b/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/README.md deleted file mode 100644 index 2622cdf0cab..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanageractiveconfigurations` Documentation - -The `networkmanageractiveconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkmanageractiveconfigurations" -``` - - -### Client Initialization - -```go -client := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerActiveConfigurationsClient.ListActiveSecurityAdminRules` - -```go -ctx := context.TODO() -id := networkmanageractiveconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanageractiveconfigurations.ActiveConfigurationParameter{ - // ... -} - - -read, err := client.ListActiveSecurityAdminRules(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/network/2023-04-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go b/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go deleted file mode 100644 index afc108f8ff4..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go deleted file mode 100644 index 665a643ae5e..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_networkgroupproperties.go b/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_networkgroupproperties.go deleted file mode 100644 index ed891dc195e..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/version.go b/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/version.go deleted file mode 100644 index 9d6c79c9205..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanageractiveconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/README.md b/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/README.md deleted file mode 100644 index 8788ce9734b..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations` Documentation - -The `networkmanageractiveconnectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkmanageractiveconnectivityconfigurations" -``` - - -### Client Initialization - -```go -client := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerActiveConnectivityConfigurationsClient.ListActiveConnectivityConfigurations` - -```go -ctx := context.TODO() -id := networkmanageractiveconnectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanageractiveconnectivityconfigurations.ActiveConfigurationParameter{ - // ... -} - - -read, err := client.ListActiveConnectivityConfigurations(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/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go deleted file mode 100644 index 07a3c4a945c..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go b/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go deleted file mode 100644 index 46f87e5058e..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/version.go b/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/version.go deleted file mode 100644 index a47e9ec16c0..00000000000 --- a/resource-manager/network/2023-04-01/networkmanageractiveconnectivityconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconnectivityconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/README.md b/resource-manager/network/2023-04-01/networkmanagerconnections/README.md deleted file mode 100644 index b396343e1e4..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagerconnections/README.md +++ /dev/null @@ -1,161 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagerconnections` Documentation - -The `networkmanagerconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkmanagerconnections" -``` - - -### Client Initialization - -```go -client := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -payload := networkmanagerconnections.NetworkManagerConnection{ - // ... -} - - -read, err := client.ManagementGroupNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsDelete` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -read, err := client.ManagementGroupNetworkManagerConnectionsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsGet` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -read, err := client.ManagementGroupNetworkManagerConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsList` - -```go -ctx := context.TODO() -id := commonids.NewManagementGroupID("groupIdValue") - -// alternatively `client.ManagementGroupNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination -items, err := client.ManagementGroupNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -payload := networkmanagerconnections.NetworkManagerConnection{ - // ... -} - - -read, err := client.SubscriptionNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsDelete` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -read, err := client.SubscriptionNetworkManagerConnectionsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsGet` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -read, err := client.SubscriptionNetworkManagerConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.SubscriptionNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination -items, err := client.SubscriptionNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/networkmanagerconnections/version.go b/resource-manager/network/2023-04-01/networkmanagerconnections/version.go deleted file mode 100644 index 1df7eb604b6..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagerconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagerconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagerconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/README.md b/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/README.md deleted file mode 100644 index ecdbfa61263..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration` Documentation - -The `networkmanagereffectiveconnectivityconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration" -``` - - -### Client Initialization - -```go -client := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerEffectiveConnectivityConfigurationClient.ListNetworkManagerEffectiveConnectivityConfigurations` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := networkmanagereffectiveconnectivityconfiguration.QueryRequestOptions{ - // ... -} - - -read, err := client.ListNetworkManagerEffectiveConnectivityConfigurations(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/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go deleted file mode 100644 index 04f8fd3c40e..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go b/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go deleted file mode 100644 index ae331bfec1d..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/version.go b/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/version.go deleted file mode 100644 index 1007641c5f0..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectiveconnectivityconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectiveconnectivityconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/README.md b/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/README.md deleted file mode 100644 index a637ac83a7b..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules` Documentation - -The `networkmanagereffectivesecurityadminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkmanagereffectivesecurityadminrules" -``` - - -### Client Initialization - -```go -client := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerEffectiveSecurityAdminRulesClient.ListNetworkManagerEffectiveSecurityAdminRules` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := networkmanagereffectivesecurityadminrules.QueryRequestOptions{ - // ... -} - - -read, err := client.ListNetworkManagerEffectiveSecurityAdminRules(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/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go b/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go deleted file mode 100644 index bc26b08e48e..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go deleted file mode 100644 index 1b0e64dbae7..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go b/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go deleted file mode 100644 index 5890d573ff4..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/version.go b/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/version.go deleted file mode 100644 index 389ad8f791f..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagereffectivesecurityadminrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectivesecurityadminrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkmanagers/README.md b/resource-manager/network/2023-04-01/networkmanagers/README.md deleted file mode 100644 index 6f1c59a92f8..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagers/README.md +++ /dev/null @@ -1,163 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkmanagers` Documentation - -The `networkmanagers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkmanagers" -``` - - -### Client Initialization - -```go -client := networkmanagers.NewNetworkManagersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManager{ - // ... -} - - -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: `NetworkManagersClient.Delete` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -if err := client.DeleteThenPoll(ctx, id, networkmanagers.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkManagersClient.Get` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -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: `NetworkManagersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.List(ctx, id, networkmanagers.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, networkmanagers.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagersClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagersClient.NetworkManagerCommitsPost` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManagerCommit{ - // ... -} - - -if err := client.NetworkManagerCommitsPostThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkManagersClient.NetworkManagerDeploymentStatusList` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManagerDeploymentStatusParameter{ - // ... -} - - -read, err := client.NetworkManagerDeploymentStatusList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagersClient.Patch` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.PatchObject{ - // ... -} - - -read, err := client.Patch(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/network/2023-04-01/networkmanagers/model_networkmanagerproperties.go b/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerproperties.go deleted file mode 100644 index 46dc5161ee2..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagers/model_networkmanagerproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerProperties struct { - Description *string `json:"description,omitempty"` - NetworkManagerScopeAccesses []ConfigurationType `json:"networkManagerScopeAccesses"` - NetworkManagerScopes NetworkManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkmanagers/version.go b/resource-manager/network/2023-04-01/networkmanagers/version.go deleted file mode 100644 index 360cf3ee5a4..00000000000 --- a/resource-manager/network/2023-04-01/networkmanagers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/README.md b/resource-manager/network/2023-04-01/networkprofiles/README.md deleted file mode 100644 index 4801284a70f..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkprofiles` Documentation - -The `networkprofiles` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkprofiles" -``` - - -### Client Initialization - -```go -client := networkprofiles.NewNetworkProfilesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkProfilesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -payload := networkprofiles.NetworkProfile{ - // ... -} - - -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: `NetworkProfilesClient.Delete` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkProfilesClient.Get` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -read, err := client.Get(ctx, id, networkprofiles.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkProfilesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkProfilesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkProfilesClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -payload := networkprofiles.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/network/2023-04-01/networkprofiles/constants.go b/resource-manager/network/2023-04-01/networkprofiles/constants.go deleted file mode 100644 index 27dbe02bb51..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package networkprofiles - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/networkprofiles/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index d1e4d94bf27..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 8e4c0b29d33..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointconnectionproperties.go deleted file mode 100644 index ae03a204241..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/networkprofiles/model_publicipaddressdnssettings.go deleted file mode 100644 index 3172667a9f8..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/networkprofiles/model_securityrulepropertiesformat.go deleted file mode 100644 index 5a6f0550760..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/networkprofiles/model_subnetpropertiesformat.go deleted file mode 100644 index bccc38cd921..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkprofiles/version.go b/resource-manager/network/2023-04-01/networkprofiles/version.go deleted file mode 100644 index b782cff8eab..00000000000 --- a/resource-manager/network/2023-04-01/networkprofiles/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkprofiles/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/README.md b/resource-manager/network/2023-04-01/networksecuritygroups/README.md deleted file mode 100644 index f53354110b7..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networksecuritygroups` Documentation - -The `networksecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networksecuritygroups" -``` - - -### Client Initialization - -```go -client := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -payload := networksecuritygroups.NetworkSecurityGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -read, err := client.Get(ctx, id, networksecuritygroups.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkSecurityGroupsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.UpdateTags` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -payload := networksecuritygroups.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/network/2023-04-01/networksecuritygroups/constants.go b/resource-manager/network/2023-04-01/networksecuritygroups/constants.go deleted file mode 100644 index 95804969bbd..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package networksecuritygroups - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 80cdae2e912..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 95a8c67d71c..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointconnectionproperties.go deleted file mode 100644 index 9649070d1a7..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddressdnssettings.go deleted file mode 100644 index 2db9ef3f2c3..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/networksecuritygroups/model_securityrulepropertiesformat.go deleted file mode 100644 index 01270911682..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/networksecuritygroups/model_subnetpropertiesformat.go deleted file mode 100644 index 210e772e083..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networksecuritygroups/version.go b/resource-manager/network/2023-04-01/networksecuritygroups/version.go deleted file mode 100644 index 34c4b67c53d..00000000000 --- a/resource-manager/network/2023-04-01/networksecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networksecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/README.md b/resource-manager/network/2023-04-01/networkvirtualappliances/README.md deleted file mode 100644 index 5c3c8b57357..00000000000 --- a/resource-manager/network/2023-04-01/networkvirtualappliances/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkvirtualappliances` Documentation - -The `networkvirtualappliances` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkvirtualappliances" -``` - - -### Client Initialization - -```go -client := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -payload := networkvirtualappliances.NetworkVirtualAppliance{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.Delete` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.Get` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -read, err := client.Get(ctx, id, networkvirtualappliances.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.InboundSecurityRuleCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue") - -payload := networkvirtualappliances.InboundSecurityRule{ - // ... -} - - -if err := client.InboundSecurityRuleCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -payload := networkvirtualappliances.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/network/2023-04-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go b/resource-manager/network/2023-04-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go deleted file mode 100644 index e43f34e93b2..00000000000 --- a/resource-manager/network/2023-04-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualAppliancePropertiesFormat struct { - AdditionalNics *[]VirtualApplianceAdditionalNicProperties `json:"additionalNics,omitempty"` - AddressPrefix *string `json:"addressPrefix,omitempty"` - BootStrapConfigurationBlobs *[]string `json:"bootStrapConfigurationBlobs,omitempty"` - CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` - Delegation *DelegationProperties `json:"delegation,omitempty"` - DeploymentType *string `json:"deploymentType,omitempty"` - InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` - NvaSku *VirtualApplianceSkuProperties `json:"nvaSku,omitempty"` - PartnerManagedResource *PartnerManagedResourceProperties `json:"partnerManagedResource,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SshPublicKey *string `json:"sshPublicKey,omitempty"` - VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` - VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` - VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go b/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go deleted file mode 100644 index 7eb59c309c1..00000000000 --- a/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceAdditionalNicProperties struct { - HasPublicIP *bool `json:"hasPublicIp,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualappliancenicproperties.go b/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualappliancenicproperties.go deleted file mode 100644 index bfd6f5f914b..00000000000 --- a/resource-manager/network/2023-04-01/networkvirtualappliances/model_virtualappliancenicproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceNicProperties struct { - InstanceName *string `json:"instanceName,omitempty"` - Name *string `json:"name,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkvirtualappliances/version.go b/resource-manager/network/2023-04-01/networkvirtualappliances/version.go deleted file mode 100644 index 6320459ba52..00000000000 --- a/resource-manager/network/2023-04-01/networkvirtualappliances/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkvirtualappliances - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkvirtualappliances/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/networkwatchers/README.md b/resource-manager/network/2023-04-01/networkwatchers/README.md deleted file mode 100644 index e8dd075cd0a..00000000000 --- a/resource-manager/network/2023-04-01/networkwatchers/README.md +++ /dev/null @@ -1,331 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/networkwatchers` Documentation - -The `networkwatchers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/networkwatchers" -``` - - -### Client Initialization - -```go -client := networkwatchers.NewNetworkWatchersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkWatchersClient.CheckConnectivity` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.ConnectivityParameters{ - // ... -} - - -if err := client.CheckConnectivityThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NetworkWatcher{ - // ... -} - - -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: `NetworkWatchersClient.Delete` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.Get` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `NetworkWatchersClient.GetAzureReachabilityReport` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.AzureReachabilityReportParameters{ - // ... -} - - -if err := client.GetAzureReachabilityReportThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetFlowLogStatus` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.FlowLogStatusParameters{ - // ... -} - - -if err := client.GetFlowLogStatusThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetNetworkConfigurationDiagnostic` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NetworkConfigurationDiagnosticParameters{ - // ... -} - - -if err := client.GetNetworkConfigurationDiagnosticThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetNextHop` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NextHopParameters{ - // ... -} - - -if err := client.GetNextHopThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTopology` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.TopologyParameters{ - // ... -} - - -read, err := client.GetTopology(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTroubleshooting` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.TroubleshootingParameters{ - // ... -} - - -if err := client.GetTroubleshootingThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTroubleshootingResult` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.QueryTroubleshootingParameters{ - // ... -} - - -if err := client.GetTroubleshootingResultThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetVMSecurityRules` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.SecurityGroupViewParameters{ - // ... -} - - -if err := client.GetVMSecurityRulesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -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: `NetworkWatchersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAll(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkWatchersClient.ListAvailableProviders` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.AvailableProvidersListParameters{ - // ... -} - - -if err := client.ListAvailableProvidersThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.SetFlowLogConfiguration` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.FlowLogInformation{ - // ... -} - - -if err := client.SetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.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 -} -``` - - -### Example Usage: `NetworkWatchersClient.VerifyIPFlow` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.VerificationIPFlowParameters{ - // ... -} - - -if err := client.VerifyIPFlowThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/networkwatchers/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/networkwatchers/model_securityrulepropertiesformat.go deleted file mode 100644 index ae100c6915e..00000000000 --- a/resource-manager/network/2023-04-01/networkwatchers/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/networkwatchers/version.go b/resource-manager/network/2023-04-01/networkwatchers/version.go deleted file mode 100644 index d96ac75e0a2..00000000000 --- a/resource-manager/network/2023-04-01/networkwatchers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkwatchers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/p2svpngateways/README.md b/resource-manager/network/2023-04-01/p2svpngateways/README.md deleted file mode 100644 index 7c13bfca5b1..00000000000 --- a/resource-manager/network/2023-04-01/p2svpngateways/README.md +++ /dev/null @@ -1,113 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/p2svpngateways` Documentation - -The `p2svpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/p2svpngateways" -``` - - -### Client Initialization - -```go -client := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `P2sVpnGatewaysClient.DisconnectP2sVpnConnections` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnConnectionRequest{ - // ... -} - - -if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GenerateVpnProfile` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnProfileParameters{ - // ... -} - - -if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealth` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealthDetailed` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnConnectionHealthRequest{ - // ... -} - - -if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.ResetThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/p2svpngateways/version.go b/resource-manager/network/2023-04-01/p2svpngateways/version.go deleted file mode 100644 index 7fa5dacb0de..00000000000 --- a/resource-manager/network/2023-04-01/p2svpngateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/p2svpngateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/packetcaptures/README.md b/resource-manager/network/2023-04-01/packetcaptures/README.md deleted file mode 100644 index d84c2c181f4..00000000000 --- a/resource-manager/network/2023-04-01/packetcaptures/README.md +++ /dev/null @@ -1,105 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/packetcaptures` Documentation - -The `packetcaptures` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/packetcaptures" -``` - - -### Client Initialization - -```go -client := packetcaptures.NewPacketCapturesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PacketCapturesClient.Create` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -payload := packetcaptures.PacketCapture{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.Delete` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.Get` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -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: `PacketCapturesClient.GetStatus` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.GetStatusThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.List` - -```go -ctx := context.TODO() -id := packetcaptures.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `PacketCapturesClient.Stop` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/packetcaptures/version.go b/resource-manager/network/2023-04-01/packetcaptures/version.go deleted file mode 100644 index f14563c47fb..00000000000 --- a/resource-manager/network/2023-04-01/packetcaptures/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package packetcaptures - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/packetcaptures/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/README.md deleted file mode 100644 index 4f122a56d71..00000000000 --- a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections` Documentation - -The `peerexpressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/peerexpressroutecircuitconnections" -``` - - -### Client Initialization - -```go -client := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PeerExpressRouteCircuitConnectionsClient.Get` - -```go -ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue") - -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: `PeerExpressRouteCircuitConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -// 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/network/2023-04-01/peerexpressroutecircuitconnections/version.go b/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/version.go deleted file mode 100644 index a1779ba65f5..00000000000 --- a/resource-manager/network/2023-04-01/peerexpressroutecircuitconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package peerexpressroutecircuitconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/peerexpressroutecircuitconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/privatednszonegroups/README.md b/resource-manager/network/2023-04-01/privatednszonegroups/README.md deleted file mode 100644 index 10ce05eb382..00000000000 --- a/resource-manager/network/2023-04-01/privatednszonegroups/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privatednszonegroups` Documentation - -The `privatednszonegroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/privatednszonegroups" -``` - - -### Client Initialization - -```go -client := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -payload := privatednszonegroups.PrivateDnsZoneGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.Delete` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.Get` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -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: `PrivateDnsZoneGroupsClient.List` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -// 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/network/2023-04-01/privatednszonegroups/version.go b/resource-manager/network/2023-04-01/privatednszonegroups/version.go deleted file mode 100644 index 825c68c5ca5..00000000000 --- a/resource-manager/network/2023-04-01/privatednszonegroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatednszonegroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatednszonegroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/README.md b/resource-manager/network/2023-04-01/privateendpoints/README.md deleted file mode 100644 index 3ecac2cbff0..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/README.md +++ /dev/null @@ -1,134 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privateendpoints` Documentation - -The `privateendpoints` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/privateendpoints" -``` - - -### Client Initialization - -```go -client := privateendpoints.NewPrivateEndpointsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesList` - -```go -ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination -items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesListByResourceGroup` - -```go -ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateEndpointsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -payload := privateendpoints.PrivateEndpoint{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointsClient.Delete` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointsClient.Get` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -read, err := client.Get(ctx, id, privateendpoints.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateEndpointsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PrivateEndpointsClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/privateendpoints/constants.go b/resource-manager/network/2023-04-01/privateendpoints/constants.go deleted file mode 100644 index fe61de76a0e..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privateendpoints - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/privateendpoints/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 7079b861291..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacepropertiesformat.go deleted file mode 100644 index a5fd36f9266..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8c0662fe4e2..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/privateendpoints/model_publicipaddressdnssettings.go deleted file mode 100644 index bc8acd1515a..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/privateendpoints/model_securityrulepropertiesformat.go deleted file mode 100644 index 2b19d6a628d..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/privateendpoints/model_subnetpropertiesformat.go deleted file mode 100644 index 01c2d0455ce..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privateendpoints/version.go b/resource-manager/network/2023-04-01/privateendpoints/version.go deleted file mode 100644 index b6036c6529b..00000000000 --- a/resource-manager/network/2023-04-01/privateendpoints/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpoints/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/README.md b/resource-manager/network/2023-04-01/privatelinkservice/README.md deleted file mode 100644 index 6b64f5532bf..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privatelinkservice` Documentation - -The `privatelinkservice` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/privatelinkservice" -``` - - -### Client Initialization - -```go -client := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkServiceClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatelinkservice.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -payload := privatelinkservice.PrivateLinkService{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/privatelinkservice/constants.go b/resource-manager/network/2023-04-01/privatelinkservice/constants.go deleted file mode 100644 index daeb4295f4c..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privatelinkservice - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index dad3a1cbb7e..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 79f71ee5063..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8cdbcae827f..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddressdnssettings.go deleted file mode 100644 index b2e6f22b6be..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservice/model_securityrulepropertiesformat.go deleted file mode 100644 index 141c746c9fc..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservice/model_subnetpropertiesformat.go deleted file mode 100644 index d0603886fd8..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservice/version.go b/resource-manager/network/2023-04-01/privatelinkservice/version.go deleted file mode 100644 index 172cc6be37c..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservice/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservice/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/README.md b/resource-manager/network/2023-04-01/privatelinkservices/README.md deleted file mode 100644 index 3da12eda98e..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/README.md +++ /dev/null @@ -1,217 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/privatelinkservices` Documentation - -The `privatelinkservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/privatelinkservices" -``` - - -### Client Initialization - -```go -client := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility` - -```go -ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ - // ... -} - - -if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup` - -```go -ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ - // ... -} - - -if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.Delete` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.DeletePrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.Get` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkServicesClient.GetPrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkServicesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices` - -```go -ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination -items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup` - -```go -ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListPrivateEndpointConnections` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -// alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination -items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.UpdatePrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -payload := privatelinkservices.PrivateEndpointConnection{ - // ... -} - - -read, err := client.UpdatePrivateEndpointConnection(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/network/2023-04-01/privatelinkservices/constants.go b/resource-manager/network/2023-04-01/privatelinkservices/constants.go deleted file mode 100644 index 2205983377c..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privatelinkservices - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 4fe2c6dad02..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 1c2bfc6ae43..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointconnectionproperties.go deleted file mode 100644 index 5966a68df2a..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddressdnssettings.go deleted file mode 100644 index 268300edf0b..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservices/model_securityrulepropertiesformat.go deleted file mode 100644 index 52b151efed9..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/privatelinkservices/model_subnetpropertiesformat.go deleted file mode 100644 index c45ef181de2..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/privatelinkservices/version.go b/resource-manager/network/2023-04-01/privatelinkservices/version.go deleted file mode 100644 index f284025cd0a..00000000000 --- a/resource-manager/network/2023-04-01/privatelinkservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservices/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/README.md b/resource-manager/network/2023-04-01/publicipaddresses/README.md deleted file mode 100644 index ed1f6fc1b12..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/README.md +++ /dev/null @@ -1,133 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/publicipaddresses` Documentation - -The `publicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/publicipaddresses" -``` - - -### Client Initialization - -```go -client := publicipaddresses.NewPublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPAddressesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -payload := publicipaddresses.PublicIPAddress{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.DdosProtectionStatus` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPAddressesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PublicIPAddressesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPAddressesClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -payload := publicipaddresses.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/network/2023-04-01/publicipaddresses/constants.go b/resource-manager/network/2023-04-01/publicipaddresses/constants.go deleted file mode 100644 index aae5236ba68..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/constants.go +++ /dev/null @@ -1,1192 +0,0 @@ -package publicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IsWorkloadProtected string - -const ( - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -func PossibleValuesForIsWorkloadProtected() []string { - return []string{ - string(IsWorkloadProtectedFalse), - string(IsWorkloadProtectedTrue), - } -} - -func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsWorkloadProtected(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { - vals := map[string]IsWorkloadProtected{ - "false": IsWorkloadProtectedFalse, - "true": IsWorkloadProtectedTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsWorkloadProtected(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index b4b3a346a35..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index b50c25d8086..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8a20b5b22e7..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 19bd5c73bdd..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/publicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index e076569ccb4..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/publicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index 97b1a3a4493..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/publicipaddresses/version.go b/resource-manager/network/2023-04-01/publicipaddresses/version.go deleted file mode 100644 index 49a8b343f52..00000000000 --- a/resource-manager/network/2023-04-01/publicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/publicipprefixes/README.md b/resource-manager/network/2023-04-01/publicipprefixes/README.md deleted file mode 100644 index 4787bfc592c..00000000000 --- a/resource-manager/network/2023-04-01/publicipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/publicipprefixes` Documentation - -The `publicipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/publicipprefixes" -``` - - -### Client Initialization - -```go -client := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -payload := publicipprefixes.PublicIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PublicIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -payload := publicipprefixes.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/network/2023-04-01/publicipprefixes/version.go b/resource-manager/network/2023-04-01/publicipprefixes/version.go deleted file mode 100644 index 888b0abe61a..00000000000 --- a/resource-manager/network/2023-04-01/publicipprefixes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipprefixes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicipprefixes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/routefilterrules/README.md b/resource-manager/network/2023-04-01/routefilterrules/README.md deleted file mode 100644 index f0436b95265..00000000000 --- a/resource-manager/network/2023-04-01/routefilterrules/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routefilterrules` Documentation - -The `routefilterrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/routefilterrules" -``` - - -### Client Initialization - -```go -client := routefilterrules.NewRouteFilterRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteFilterRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -payload := routefilterrules.RouteFilterRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFilterRulesClient.Delete` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFilterRulesClient.Get` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -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: `RouteFilterRulesClient.ListByRouteFilter` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -// alternatively `client.ListByRouteFilter(ctx, id)` can be used to do batched pagination -items, err := client.ListByRouteFilterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/routefilterrules/version.go b/resource-manager/network/2023-04-01/routefilterrules/version.go deleted file mode 100644 index 5a2571f4ba5..00000000000 --- a/resource-manager/network/2023-04-01/routefilterrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilterrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routefilterrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/routefilters/README.md b/resource-manager/network/2023-04-01/routefilters/README.md deleted file mode 100644 index 7c4b9c01eea..00000000000 --- a/resource-manager/network/2023-04-01/routefilters/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routefilters` Documentation - -The `routefilters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/routefilters" -``` - - -### Client Initialization - -```go -client := routefilters.NewRouteFiltersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteFiltersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -payload := routefilters.RouteFilter{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFiltersClient.Delete` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFiltersClient.Get` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -read, err := client.Get(ctx, id, routefilters.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RouteFiltersClient.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: `RouteFiltersClient.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: `RouteFiltersClient.UpdateTags` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -payload := routefilters.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/network/2023-04-01/routefilters/version.go b/resource-manager/network/2023-04-01/routefilters/version.go deleted file mode 100644 index 397672a07ae..00000000000 --- a/resource-manager/network/2023-04-01/routefilters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routefilters/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/routes/README.md b/resource-manager/network/2023-04-01/routes/README.md deleted file mode 100644 index 867495584bd..00000000000 --- a/resource-manager/network/2023-04-01/routes/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routes` Documentation - -The `routes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/routes" -``` - - -### Client Initialization - -```go -client := routes.NewRoutesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RoutesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -payload := routes.Route{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RoutesClient.Delete` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RoutesClient.Get` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -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: `RoutesClient.List` - -```go -ctx := context.TODO() -id := routes.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -// 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/network/2023-04-01/routes/version.go b/resource-manager/network/2023-04-01/routes/version.go deleted file mode 100644 index 388f66f1581..00000000000 --- a/resource-manager/network/2023-04-01/routes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/routetables/README.md b/resource-manager/network/2023-04-01/routetables/README.md deleted file mode 100644 index 9bb45f1a376..00000000000 --- a/resource-manager/network/2023-04-01/routetables/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/routetables` Documentation - -The `routetables` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/routetables" -``` - - -### Client Initialization - -```go -client := routetables.NewRouteTablesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteTablesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -payload := routetables.RouteTable{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteTablesClient.Delete` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteTablesClient.Get` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -read, err := client.Get(ctx, id, routetables.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RouteTablesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `RouteTablesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `RouteTablesClient.UpdateTags` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -payload := routetables.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/network/2023-04-01/routetables/constants.go b/resource-manager/network/2023-04-01/routetables/constants.go deleted file mode 100644 index 4a244a372fb..00000000000 --- a/resource-manager/network/2023-04-01/routetables/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package routetables - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/routetables/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/routetables/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 34067eb4dc7..00000000000 --- a/resource-manager/network/2023-04-01/routetables/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/routetables/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/routetables/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 4cc36c8f7f5..00000000000 --- a/resource-manager/network/2023-04-01/routetables/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/routetables/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/routetables/model_privateendpointconnectionproperties.go deleted file mode 100644 index f8d3eeab02b..00000000000 --- a/resource-manager/network/2023-04-01/routetables/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/routetables/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/routetables/model_publicipaddressdnssettings.go deleted file mode 100644 index 84b1e72e903..00000000000 --- a/resource-manager/network/2023-04-01/routetables/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/routetables/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/routetables/model_securityrulepropertiesformat.go deleted file mode 100644 index 636af5195f0..00000000000 --- a/resource-manager/network/2023-04-01/routetables/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/routetables/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/routetables/model_subnetpropertiesformat.go deleted file mode 100644 index 95f54741d81..00000000000 --- a/resource-manager/network/2023-04-01/routetables/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/routetables/version.go b/resource-manager/network/2023-04-01/routetables/version.go deleted file mode 100644 index 6b3f6a7acca..00000000000 --- a/resource-manager/network/2023-04-01/routetables/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routetables/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/scopeconnections/README.md b/resource-manager/network/2023-04-01/scopeconnections/README.md deleted file mode 100644 index 4e97058768c..00000000000 --- a/resource-manager/network/2023-04-01/scopeconnections/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/scopeconnections` Documentation - -The `scopeconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/scopeconnections" -``` - - -### Client Initialization - -```go -client := scopeconnections.NewScopeConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScopeConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -payload := scopeconnections.ScopeConnection{ - // ... -} - - -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: `ScopeConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -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: `ScopeConnectionsClient.Get` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -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: `ScopeConnectionsClient.List` - -```go -ctx := context.TODO() -id := scopeconnections.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, scopeconnections.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, scopeconnections.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/scopeconnections/version.go b/resource-manager/network/2023-04-01/scopeconnections/version.go deleted file mode 100644 index a75344ef344..00000000000 --- a/resource-manager/network/2023-04-01/scopeconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package scopeconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/scopeconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/README.md b/resource-manager/network/2023-04-01/securityadminconfigurations/README.md deleted file mode 100644 index c3ac45ff819..00000000000 --- a/resource-manager/network/2023-04-01/securityadminconfigurations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/securityadminconfigurations` Documentation - -The `securityadminconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/securityadminconfigurations" -``` - - -### Client Initialization - -```go -client := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityAdminConfigurationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -payload := securityadminconfigurations.SecurityAdminConfiguration{ - // ... -} - - -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: `SecurityAdminConfigurationsClient.Delete` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityAdminConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -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: `SecurityAdminConfigurationsClient.List` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, securityadminconfigurations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, securityadminconfigurations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go b/resource-manager/network/2023-04-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go deleted file mode 100644 index cf9ecff7791..00000000000 --- a/resource-manager/network/2023-04-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package securityadminconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAdminConfigurationPropertiesFormat struct { - ApplyOnNetworkIntentPolicyBasedServices *[]NetworkIntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/securityadminconfigurations/version.go b/resource-manager/network/2023-04-01/securityadminconfigurations/version.go deleted file mode 100644 index 6a750b12993..00000000000 --- a/resource-manager/network/2023-04-01/securityadminconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityadminconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securityadminconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/securitypartnerproviders/README.md b/resource-manager/network/2023-04-01/securitypartnerproviders/README.md deleted file mode 100644 index 35efbde3187..00000000000 --- a/resource-manager/network/2023-04-01/securitypartnerproviders/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/securitypartnerproviders` Documentation - -The `securitypartnerproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/securitypartnerproviders" -``` - - -### Client Initialization - -```go -client := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityPartnerProvidersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -payload := securitypartnerproviders.SecurityPartnerProvider{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityPartnerProvidersClient.Delete` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityPartnerProvidersClient.Get` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.UpdateTags` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -payload := securitypartnerproviders.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/network/2023-04-01/securitypartnerproviders/version.go b/resource-manager/network/2023-04-01/securitypartnerproviders/version.go deleted file mode 100644 index 019c3a13abd..00000000000 --- a/resource-manager/network/2023-04-01/securitypartnerproviders/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitypartnerproviders - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securitypartnerproviders/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/securityrules/README.md b/resource-manager/network/2023-04-01/securityrules/README.md deleted file mode 100644 index 9f060c0c411..00000000000 --- a/resource-manager/network/2023-04-01/securityrules/README.md +++ /dev/null @@ -1,115 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/securityrules` Documentation - -The `securityrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/securityrules" -``` - - -### Client Initialization - -```go -client := securityrules.NewSecurityRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -payload := securityrules.SecurityRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityRulesClient.DefaultSecurityRulesGet` - -```go -ctx := context.TODO() -id := securityrules.NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue") - -read, err := client.DefaultSecurityRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityRulesClient.DefaultSecurityRulesList` - -```go -ctx := context.TODO() -id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -// alternatively `client.DefaultSecurityRulesList(ctx, id)` can be used to do batched pagination -items, err := client.DefaultSecurityRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `SecurityRulesClient.Delete` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityRulesClient.Get` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -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: `SecurityRulesClient.List` - -```go -ctx := context.TODO() -id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -// 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/network/2023-04-01/securityrules/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/securityrules/model_securityrulepropertiesformat.go deleted file mode 100644 index a7e44555d95..00000000000 --- a/resource-manager/network/2023-04-01/securityrules/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/securityrules/version.go b/resource-manager/network/2023-04-01/securityrules/version.go deleted file mode 100644 index 08895fe50ae..00000000000 --- a/resource-manager/network/2023-04-01/securityrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securityrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/README.md b/resource-manager/network/2023-04-01/serviceendpointpolicies/README.md deleted file mode 100644 index a1129e7b83e..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/serviceendpointpolicies` Documentation - -The `serviceendpointpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/serviceendpointpolicies" -``` - - -### Client Initialization - -```go -client := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -payload := serviceendpointpolicies.ServiceEndpointPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.Get` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -read, err := client.Get(ctx, id, serviceendpointpolicies.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -payload := serviceendpointpolicies.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/network/2023-04-01/serviceendpointpolicies/constants.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/constants.go deleted file mode 100644 index e18805b64d6..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package serviceendpointpolicies - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 4d71c4769d0..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go deleted file mode 100644 index bdbb3dec753..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go deleted file mode 100644 index 9468576ebfd..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddressdnssettings.go deleted file mode 100644 index d28111e34e8..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/model_securityrulepropertiesformat.go deleted file mode 100644 index 8d5f321605a..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/model_subnetpropertiesformat.go deleted file mode 100644 index 78947f02f56..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicies/version.go b/resource-manager/network/2023-04-01/serviceendpointpolicies/version.go deleted file mode 100644 index 938db14d87c..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/README.md b/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/README.md deleted file mode 100644 index 6032ed9e55f..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions` Documentation - -The `serviceendpointpolicydefinitions` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/serviceendpointpolicydefinitions" -``` - - -### Client Initialization - -```go -client := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -payload := serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinition{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Delete` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Get` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -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: `ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -// 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 -} -``` diff --git a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/version.go b/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/version.go deleted file mode 100644 index 66e77b44ebb..00000000000 --- a/resource-manager/network/2023-04-01/serviceendpointpolicydefinitions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicydefinitions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicydefinitions/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/servicetags/README.md b/resource-manager/network/2023-04-01/servicetags/README.md deleted file mode 100644 index 0484866a1fc..00000000000 --- a/resource-manager/network/2023-04-01/servicetags/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/servicetags` Documentation - -The `servicetags` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/servicetags" -``` - - -### Client Initialization - -```go -client := servicetags.NewServiceTagsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceTagsClient.ServiceTagInformationList` - -```go -ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination -items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ServiceTagsClient.ServiceTagsList` - -```go -ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.ServiceTagsList(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/network/2023-04-01/servicetags/version.go b/resource-manager/network/2023-04-01/servicetags/version.go deleted file mode 100644 index 2cb098fdbde..00000000000 --- a/resource-manager/network/2023-04-01/servicetags/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package servicetags - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/servicetags/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/staticmembers/README.md b/resource-manager/network/2023-04-01/staticmembers/README.md deleted file mode 100644 index cca6fa0e35a..00000000000 --- a/resource-manager/network/2023-04-01/staticmembers/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/staticmembers` Documentation - -The `staticmembers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/staticmembers" -``` - - -### Client Initialization - -```go -client := staticmembers.NewStaticMembersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `StaticMembersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -payload := staticmembers.StaticMember{ - // ... -} - - -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: `StaticMembersClient.Delete` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -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: `StaticMembersClient.Get` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -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: `StaticMembersClient.List` - -```go -ctx := context.TODO() -id := staticmembers.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -// alternatively `client.List(ctx, id, staticmembers.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, staticmembers.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/staticmembers/version.go b/resource-manager/network/2023-04-01/staticmembers/version.go deleted file mode 100644 index c716b06c69c..00000000000 --- a/resource-manager/network/2023-04-01/staticmembers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package staticmembers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/staticmembers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/subnets/README.md b/resource-manager/network/2023-04-01/subnets/README.md deleted file mode 100644 index 39840ae3f20..00000000000 --- a/resource-manager/network/2023-04-01/subnets/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/subnets` Documentation - -The `subnets` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/subnets" -``` - - -### Client Initialization - -```go -client := subnets.NewSubnetsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SubnetsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := subnets.Subnet{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SubnetsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SubnetsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -read, err := client.Get(ctx, id, subnets.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SubnetsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// 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/network/2023-04-01/subnets/constants.go b/resource-manager/network/2023-04-01/subnets/constants.go deleted file mode 100644 index dd21353a40b..00000000000 --- a/resource-manager/network/2023-04-01/subnets/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package subnets - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/subnets/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/subnets/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 561224fe97e..00000000000 --- a/resource-manager/network/2023-04-01/subnets/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/subnets/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/subnets/model_networkinterfacepropertiesformat.go deleted file mode 100644 index dadc9421016..00000000000 --- a/resource-manager/network/2023-04-01/subnets/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/subnets/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/subnets/model_privateendpointconnectionproperties.go deleted file mode 100644 index ff12b5a54fc..00000000000 --- a/resource-manager/network/2023-04-01/subnets/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/subnets/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/subnets/model_publicipaddressdnssettings.go deleted file mode 100644 index d002238e788..00000000000 --- a/resource-manager/network/2023-04-01/subnets/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/subnets/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/subnets/model_securityrulepropertiesformat.go deleted file mode 100644 index cad2dbd820c..00000000000 --- a/resource-manager/network/2023-04-01/subnets/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/subnets/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/subnets/model_subnetpropertiesformat.go deleted file mode 100644 index 5094062f846..00000000000 --- a/resource-manager/network/2023-04-01/subnets/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/subnets/version.go b/resource-manager/network/2023-04-01/subnets/version.go deleted file mode 100644 index 204dd686eca..00000000000 --- a/resource-manager/network/2023-04-01/subnets/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/subnets/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/trafficanalytics/README.md b/resource-manager/network/2023-04-01/trafficanalytics/README.md deleted file mode 100644 index 5a63ecee1f3..00000000000 --- a/resource-manager/network/2023-04-01/trafficanalytics/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/trafficanalytics` Documentation - -The `trafficanalytics` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/trafficanalytics" -``` - - -### Client Initialization - -```go -client := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `TrafficAnalyticsClient.NetworkWatchersGetFlowLogStatus` - -```go -ctx := context.TODO() -id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := trafficanalytics.FlowLogStatusParameters{ - // ... -} - - -if err := client.NetworkWatchersGetFlowLogStatusThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `TrafficAnalyticsClient.NetworkWatchersSetFlowLogConfiguration` - -```go -ctx := context.TODO() -id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := trafficanalytics.FlowLogInformation{ - // ... -} - - -if err := client.NetworkWatchersSetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/trafficanalytics/version.go b/resource-manager/network/2023-04-01/trafficanalytics/version.go deleted file mode 100644 index 499d3106dad..00000000000 --- a/resource-manager/network/2023-04-01/trafficanalytics/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package trafficanalytics - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/trafficanalytics/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/usages/README.md b/resource-manager/network/2023-04-01/usages/README.md deleted file mode 100644 index 89ff3ef8b8f..00000000000 --- a/resource-manager/network/2023-04-01/usages/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/usages` Documentation - -The `usages` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/usages" -``` - - -### Client Initialization - -```go -client := usages.NewUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UsagesClient.List` - -```go -ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// 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/network/2023-04-01/usages/version.go b/resource-manager/network/2023-04-01/usages/version.go deleted file mode 100644 index 31971f4c048..00000000000 --- a/resource-manager/network/2023-04-01/usages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package usages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/usages/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/vipswap/README.md b/resource-manager/network/2023-04-01/vipswap/README.md deleted file mode 100644 index 50581cee564..00000000000 --- a/resource-manager/network/2023-04-01/vipswap/README.md +++ /dev/null @@ -1,69 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vipswap` Documentation - -The `vipswap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/vipswap" -``` - - -### Client Initialization - -```go -client := vipswap.NewVipSwapClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VipSwapClient.Create` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -payload := vipswap.SwapResource{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VipSwapClient.Get` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -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: `VipSwapClient.List` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -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/network/2023-04-01/vipswap/version.go b/resource-manager/network/2023-04-01/vipswap/version.go deleted file mode 100644 index b6ad744d505..00000000000 --- a/resource-manager/network/2023-04-01/vipswap/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vipswap - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vipswap/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualappliancesites/README.md b/resource-manager/network/2023-04-01/virtualappliancesites/README.md deleted file mode 100644 index 42f6edc92b2..00000000000 --- a/resource-manager/network/2023-04-01/virtualappliancesites/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualappliancesites` Documentation - -The `virtualappliancesites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualappliancesites" -``` - - -### Client Initialization - -```go -client := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualApplianceSitesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -payload := virtualappliancesites.VirtualApplianceSite{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualApplianceSitesClient.Delete` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualApplianceSitesClient.Get` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -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: `VirtualApplianceSitesClient.List` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -// 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/network/2023-04-01/virtualappliancesites/version.go b/resource-manager/network/2023-04-01/virtualappliancesites/version.go deleted file mode 100644 index df539ee5863..00000000000 --- a/resource-manager/network/2023-04-01/virtualappliancesites/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualappliancesites - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualappliancesites/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/README.md b/resource-manager/network/2023-04-01/virtualapplianceskus/README.md deleted file mode 100644 index b244faf266a..00000000000 --- a/resource-manager/network/2023-04-01/virtualapplianceskus/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualapplianceskus` Documentation - -The `virtualapplianceskus` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualapplianceskus" -``` - - -### Client Initialization - -```go -client := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualApplianceSkusClient.Get` - -```go -ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue") - -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: `VirtualApplianceSkusClient.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 -} -``` diff --git a/resource-manager/network/2023-04-01/virtualapplianceskus/version.go b/resource-manager/network/2023-04-01/virtualapplianceskus/version.go deleted file mode 100644 index 2ad917a8e11..00000000000 --- a/resource-manager/network/2023-04-01/virtualapplianceskus/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualapplianceskus - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualapplianceskus/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/README.md deleted file mode 100644 index d6902c188d6..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/README.md +++ /dev/null @@ -1,208 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections` Documentation - -The `virtualnetworkgatewayconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualnetworkgatewayconnections" -``` - - -### Client Initialization - -```go -client := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -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: `VirtualNetworkGatewayConnectionsClient.GetIkeSas` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.GetIkeSasThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.GetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -read, err := client.GetSharedKey(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworkGatewayConnectionsClient.ResetConnection` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.ResetConnectionThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.ResetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ - // ... -} - - -if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.SetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ - // ... -} - - -if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/constants.go b/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/constants.go deleted file mode 100644 index 9512f88b641..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/constants.go +++ /dev/null @@ -1,1178 +0,0 @@ -package virtualnetworkgatewayconnections - -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 AdminState string - -const ( - AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" -) - -func PossibleValuesForAdminState() []string { - return []string{ - string(AdminStateDisabled), - string(AdminStateEnabled), - } -} - -func (s *AdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminState(input string) (*AdminState, error) { - vals := map[string]AdminState{ - "disabled": AdminStateDisabled, - "enabled": AdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminState(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { - return []string{ - string(VirtualNetworkGatewayConnectionModeDefault), - string(VirtualNetworkGatewayConnectionModeInitiatorOnly), - string(VirtualNetworkGatewayConnectionModeResponderOnly), - } -} - -func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { - vals := map[string]VirtualNetworkGatewayConnectionMode{ - "default": VirtualNetworkGatewayConnectionModeDefault, - "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, - "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionMode(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { - return []string{ - string(VirtualNetworkGatewayConnectionStatusConnected), - string(VirtualNetworkGatewayConnectionStatusConnecting), - string(VirtualNetworkGatewayConnectionStatusNotConnected), - string(VirtualNetworkGatewayConnectionStatusUnknown), - } -} - -func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { - vals := map[string]VirtualNetworkGatewayConnectionStatus{ - "connected": VirtualNetworkGatewayConnectionStatusConnected, - "connecting": VirtualNetworkGatewayConnectionStatusConnecting, - "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, - "unknown": VirtualNetworkGatewayConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionStatus(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { - return []string{ - string(VirtualNetworkGatewayConnectionTypeExpressRoute), - string(VirtualNetworkGatewayConnectionTypeIPsec), - string(VirtualNetworkGatewayConnectionTypeVPNClient), - string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), - } -} - -func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { - vals := map[string]VirtualNetworkGatewayConnectionType{ - "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, - "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, - "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, - "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionType(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuName string - -const ( - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" - VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" - VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" - VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" - VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" - VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" - VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuName() []string { - return []string{ - string(VirtualNetworkGatewaySkuNameBasic), - string(VirtualNetworkGatewaySkuNameErGwOneAZ), - string(VirtualNetworkGatewaySkuNameErGwThreeAZ), - string(VirtualNetworkGatewaySkuNameErGwTwoAZ), - string(VirtualNetworkGatewaySkuNameHighPerformance), - string(VirtualNetworkGatewaySkuNameStandard), - string(VirtualNetworkGatewaySkuNameUltraPerformance), - string(VirtualNetworkGatewaySkuNameVpnGwFive), - string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuNameVpnGwFour), - string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), - string(VirtualNetworkGatewaySkuNameVpnGwOne), - string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), - string(VirtualNetworkGatewaySkuNameVpnGwThree), - string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuNameVpnGwTwo), - string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { - vals := map[string]VirtualNetworkGatewaySkuName{ - "basic": VirtualNetworkGatewaySkuNameBasic, - "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, - "standard": VirtualNetworkGatewaySkuNameStandard, - "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuName(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuTier string - -const ( - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" - VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" - VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" - VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" - VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" - VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" - VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { - return []string{ - string(VirtualNetworkGatewaySkuTierBasic), - string(VirtualNetworkGatewaySkuTierErGwOneAZ), - string(VirtualNetworkGatewaySkuTierErGwThreeAZ), - string(VirtualNetworkGatewaySkuTierErGwTwoAZ), - string(VirtualNetworkGatewaySkuTierHighPerformance), - string(VirtualNetworkGatewaySkuTierStandard), - string(VirtualNetworkGatewaySkuTierUltraPerformance), - string(VirtualNetworkGatewaySkuTierVpnGwFive), - string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuTierVpnGwFour), - string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), - string(VirtualNetworkGatewaySkuTierVpnGwOne), - string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), - string(VirtualNetworkGatewaySkuTierVpnGwThree), - string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuTierVpnGwTwo), - string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { - vals := map[string]VirtualNetworkGatewaySkuTier{ - "basic": VirtualNetworkGatewaySkuTierBasic, - "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, - "standard": VirtualNetworkGatewaySkuTierStandard, - "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuTier(input) - return &out, nil -} - -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -func PossibleValuesForVirtualNetworkGatewayType() []string { - return []string{ - string(VirtualNetworkGatewayTypeExpressRoute), - string(VirtualNetworkGatewayTypeLocalGateway), - string(VirtualNetworkGatewayTypeVpn), - } -} - -func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { - vals := map[string]VirtualNetworkGatewayType{ - "expressroute": VirtualNetworkGatewayTypeExpressRoute, - "localgateway": VirtualNetworkGatewayTypeLocalGateway, - "vpn": VirtualNetworkGatewayTypeVpn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayType(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnClientProtocol string - -const ( - VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" -) - -func PossibleValuesForVpnClientProtocol() []string { - return []string{ - string(VpnClientProtocolIkeVTwo), - string(VpnClientProtocolOpenVPN), - string(VpnClientProtocolSSTP), - } -} - -func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnClientProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { - vals := map[string]VpnClientProtocol{ - "ikev2": VpnClientProtocolIkeVTwo, - "openvpn": VpnClientProtocolOpenVPN, - "sstp": VpnClientProtocolSSTP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnClientProtocol(input) - return &out, nil -} - -type VpnGatewayGeneration string - -const ( - VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" - VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -func PossibleValuesForVpnGatewayGeneration() []string { - return []string{ - string(VpnGatewayGenerationGenerationOne), - string(VpnGatewayGenerationGenerationTwo), - string(VpnGatewayGenerationNone), - } -} - -func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { - vals := map[string]VpnGatewayGeneration{ - "generation1": VpnGatewayGenerationGenerationOne, - "generation2": VpnGatewayGenerationGenerationTwo, - "none": VpnGatewayGenerationNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayGeneration(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} - -type VpnType string - -const ( - VpnTypePolicyBased VpnType = "PolicyBased" - VpnTypeRouteBased VpnType = "RouteBased" -) - -func PossibleValuesForVpnType() []string { - return []string{ - string(VpnTypePolicyBased), - string(VpnTypeRouteBased), - } -} - -func (s *VpnType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnType(input string) (*VpnType, error) { - vals := map[string]VpnType{ - "policybased": VpnTypePolicyBased, - "routebased": VpnTypeRouteBased, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go deleted file mode 100644 index 10120af76de..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,31 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPropertiesFormat struct { - ActiveActive *bool `json:"activeActive,omitempty"` - AdminState *AdminState `json:"adminState,omitempty"` - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - VpnType *VpnType `json:"vpnType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/version.go b/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/version.go deleted file mode 100644 index cb837580578..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgatewayconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgatewayconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/README.md b/resource-manager/network/2023-04-01/virtualnetworkgateways/README.md deleted file mode 100644 index 3cfe2459b76..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgateways/README.md +++ /dev/null @@ -1,414 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworkgateways` Documentation - -The `virtualnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualnetworkgateways" -``` - - -### Client Initialization - -```go -client := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VirtualNetworkGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVpnConnections` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.P2SVpnConnectionRequest{ - // ... -} - - -if err := client.DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GenerateVpnProfile` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientParameters{ - // ... -} - - -if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Generatevpnclientpackage` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientParameters{ - // ... -} - - -if err := client.GeneratevpnclientpackageThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -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: `VirtualNetworkGatewaysClient.GetAdvertisedRoutes` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetAdvertisedRoutesThenPoll(ctx, id, virtualnetworkgateways.DefaultGetAdvertisedRoutesOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetBgpPeerStatus` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetBgpPeerStatusThenPoll(ctx, id, virtualnetworkgateways.DefaultGetBgpPeerStatusOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetLearnedRoutes` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnclientConnectionHealthThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientIPsecParameters` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnclientIPsecParametersThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworkGatewaysClient.ListConnections` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -// alternatively `client.ListConnections(ctx, id)` can be used to do batched pagination -items, err := client.ListConnectionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.ResetThenPoll(ctx, id, virtualnetworkgateways.DefaultResetOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.ResetVpnClientSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.ResetVpnClientSharedKeyThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.SetVpnclientIPsecParameters` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientIPsecParameters{ - // ... -} - - -if err := client.SetVpnclientIPsecParametersThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.SupportedVpnDevices` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -read, err := client.SupportedVpnDevices(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -payload := virtualnetworkgateways.VirtualNetworkGatewayNatRule{ - // ... -} - - -if err := client.VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesDelete` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -if err := client.VirtualNetworkGatewayNatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesGet` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -read, err := client.VirtualNetworkGatewayNatRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -// alternatively `client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx, id)` can be used to do batched pagination -items, err := client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VpnDeviceConfigurationScript` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgateways.VpnDeviceScriptParameters{ - // ... -} - - -read, err := client.VpnDeviceConfigurationScript(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/network/2023-04-01/virtualnetworkgateways/constants.go b/resource-manager/network/2023-04-01/virtualnetworkgateways/constants.go deleted file mode 100644 index f68568a74fe..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgateways/constants.go +++ /dev/null @@ -1,1310 +0,0 @@ -package virtualnetworkgateways - -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 AdminState string - -const ( - AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" -) - -func PossibleValuesForAdminState() []string { - return []string{ - string(AdminStateDisabled), - string(AdminStateEnabled), - } -} - -func (s *AdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminState(input string) (*AdminState, error) { - vals := map[string]AdminState{ - "disabled": AdminStateDisabled, - "enabled": AdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminState(input) - return &out, nil -} - -type AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type BgpPeerState string - -const ( - BgpPeerStateConnected BgpPeerState = "Connected" - BgpPeerStateConnecting BgpPeerState = "Connecting" - BgpPeerStateIdle BgpPeerState = "Idle" - BgpPeerStateStopped BgpPeerState = "Stopped" - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -func PossibleValuesForBgpPeerState() []string { - return []string{ - string(BgpPeerStateConnected), - string(BgpPeerStateConnecting), - string(BgpPeerStateIdle), - string(BgpPeerStateStopped), - string(BgpPeerStateUnknown), - } -} - -func (s *BgpPeerState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBgpPeerState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBgpPeerState(input string) (*BgpPeerState, error) { - vals := map[string]BgpPeerState{ - "connected": BgpPeerStateConnected, - "connecting": BgpPeerStateConnecting, - "idle": BgpPeerStateIdle, - "stopped": BgpPeerStateStopped, - "unknown": BgpPeerStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BgpPeerState(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProcessorArchitecture string - -const ( - ProcessorArchitectureAmdSixFour ProcessorArchitecture = "Amd64" - ProcessorArchitectureXEightSix ProcessorArchitecture = "X86" -) - -func PossibleValuesForProcessorArchitecture() []string { - return []string{ - string(ProcessorArchitectureAmdSixFour), - string(ProcessorArchitectureXEightSix), - } -} - -func (s *ProcessorArchitecture) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProcessorArchitecture(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProcessorArchitecture(input string) (*ProcessorArchitecture, error) { - vals := map[string]ProcessorArchitecture{ - "amd64": ProcessorArchitectureAmdSixFour, - "x86": ProcessorArchitectureXEightSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProcessorArchitecture(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { - return []string{ - string(VirtualNetworkGatewayConnectionModeDefault), - string(VirtualNetworkGatewayConnectionModeInitiatorOnly), - string(VirtualNetworkGatewayConnectionModeResponderOnly), - } -} - -func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { - vals := map[string]VirtualNetworkGatewayConnectionMode{ - "default": VirtualNetworkGatewayConnectionModeDefault, - "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, - "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionMode(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { - return []string{ - string(VirtualNetworkGatewayConnectionStatusConnected), - string(VirtualNetworkGatewayConnectionStatusConnecting), - string(VirtualNetworkGatewayConnectionStatusNotConnected), - string(VirtualNetworkGatewayConnectionStatusUnknown), - } -} - -func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { - vals := map[string]VirtualNetworkGatewayConnectionStatus{ - "connected": VirtualNetworkGatewayConnectionStatusConnected, - "connecting": VirtualNetworkGatewayConnectionStatusConnecting, - "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, - "unknown": VirtualNetworkGatewayConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionStatus(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { - return []string{ - string(VirtualNetworkGatewayConnectionTypeExpressRoute), - string(VirtualNetworkGatewayConnectionTypeIPsec), - string(VirtualNetworkGatewayConnectionTypeVPNClient), - string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), - } -} - -func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { - vals := map[string]VirtualNetworkGatewayConnectionType{ - "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, - "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, - "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, - "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionType(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuName string - -const ( - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" - VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" - VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" - VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" - VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" - VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" - VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuName() []string { - return []string{ - string(VirtualNetworkGatewaySkuNameBasic), - string(VirtualNetworkGatewaySkuNameErGwOneAZ), - string(VirtualNetworkGatewaySkuNameErGwThreeAZ), - string(VirtualNetworkGatewaySkuNameErGwTwoAZ), - string(VirtualNetworkGatewaySkuNameHighPerformance), - string(VirtualNetworkGatewaySkuNameStandard), - string(VirtualNetworkGatewaySkuNameUltraPerformance), - string(VirtualNetworkGatewaySkuNameVpnGwFive), - string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuNameVpnGwFour), - string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), - string(VirtualNetworkGatewaySkuNameVpnGwOne), - string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), - string(VirtualNetworkGatewaySkuNameVpnGwThree), - string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuNameVpnGwTwo), - string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { - vals := map[string]VirtualNetworkGatewaySkuName{ - "basic": VirtualNetworkGatewaySkuNameBasic, - "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, - "standard": VirtualNetworkGatewaySkuNameStandard, - "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuName(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuTier string - -const ( - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" - VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" - VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" - VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" - VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" - VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" - VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { - return []string{ - string(VirtualNetworkGatewaySkuTierBasic), - string(VirtualNetworkGatewaySkuTierErGwOneAZ), - string(VirtualNetworkGatewaySkuTierErGwThreeAZ), - string(VirtualNetworkGatewaySkuTierErGwTwoAZ), - string(VirtualNetworkGatewaySkuTierHighPerformance), - string(VirtualNetworkGatewaySkuTierStandard), - string(VirtualNetworkGatewaySkuTierUltraPerformance), - string(VirtualNetworkGatewaySkuTierVpnGwFive), - string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuTierVpnGwFour), - string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), - string(VirtualNetworkGatewaySkuTierVpnGwOne), - string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), - string(VirtualNetworkGatewaySkuTierVpnGwThree), - string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuTierVpnGwTwo), - string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { - vals := map[string]VirtualNetworkGatewaySkuTier{ - "basic": VirtualNetworkGatewaySkuTierBasic, - "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, - "standard": VirtualNetworkGatewaySkuTierStandard, - "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuTier(input) - return &out, nil -} - -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -func PossibleValuesForVirtualNetworkGatewayType() []string { - return []string{ - string(VirtualNetworkGatewayTypeExpressRoute), - string(VirtualNetworkGatewayTypeLocalGateway), - string(VirtualNetworkGatewayTypeVpn), - } -} - -func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { - vals := map[string]VirtualNetworkGatewayType{ - "expressroute": VirtualNetworkGatewayTypeExpressRoute, - "localgateway": VirtualNetworkGatewayTypeLocalGateway, - "vpn": VirtualNetworkGatewayTypeVpn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayType(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnClientProtocol string - -const ( - VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" -) - -func PossibleValuesForVpnClientProtocol() []string { - return []string{ - string(VpnClientProtocolIkeVTwo), - string(VpnClientProtocolOpenVPN), - string(VpnClientProtocolSSTP), - } -} - -func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnClientProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { - vals := map[string]VpnClientProtocol{ - "ikev2": VpnClientProtocolIkeVTwo, - "openvpn": VpnClientProtocolOpenVPN, - "sstp": VpnClientProtocolSSTP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnClientProtocol(input) - return &out, nil -} - -type VpnGatewayGeneration string - -const ( - VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" - VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -func PossibleValuesForVpnGatewayGeneration() []string { - return []string{ - string(VpnGatewayGenerationGenerationOne), - string(VpnGatewayGenerationGenerationTwo), - string(VpnGatewayGenerationNone), - } -} - -func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { - vals := map[string]VpnGatewayGeneration{ - "generation1": VpnGatewayGenerationGenerationOne, - "generation2": VpnGatewayGenerationGenerationTwo, - "none": VpnGatewayGenerationNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayGeneration(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} - -type VpnType string - -const ( - VpnTypePolicyBased VpnType = "PolicyBased" - VpnTypeRouteBased VpnType = "RouteBased" -) - -func PossibleValuesForVpnType() []string { - return []string{ - string(VpnTypePolicyBased), - string(VpnTypeRouteBased), - } -} - -func (s *VpnType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnType(input string) (*VpnType, error) { - vals := map[string]VpnType{ - "policybased": VpnTypePolicyBased, - "routebased": VpnTypeRouteBased, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go deleted file mode 100644 index 5734ed1a1fb..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,31 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPropertiesFormat struct { - ActiveActive *bool `json:"activeActive,omitempty"` - AdminState *AdminState `json:"adminState,omitempty"` - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - VpnType *VpnType `json:"vpnType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkgateways/version.go b/resource-manager/network/2023-04-01/virtualnetworkgateways/version.go deleted file mode 100644 index 93e8b527f04..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualnetworkpeerings/README.md b/resource-manager/network/2023-04-01/virtualnetworkpeerings/README.md deleted file mode 100644 index 0882a334105..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworkpeerings` Documentation - -The `virtualnetworkpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualnetworkpeerings" -``` - - -### Client Initialization - -```go -client := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -payload := virtualnetworkpeerings.VirtualNetworkPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, virtualnetworkpeerings.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -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: `VirtualNetworkPeeringsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// 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/network/2023-04-01/virtualnetworkpeerings/version.go b/resource-manager/network/2023-04-01/virtualnetworkpeerings/version.go deleted file mode 100644 index bd3f80cbd24..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworkpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/README.md b/resource-manager/network/2023-04-01/virtualnetworks/README.md deleted file mode 100644 index ba0c370b4ec..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/README.md +++ /dev/null @@ -1,239 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworks` Documentation - -The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualnetworks" -``` - - -### Client Initialization - -```go -client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := virtualnetworks.VirtualNetwork{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -read, err := client.Get(ctx, id, virtualnetworks.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworksClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworksClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.ResourceNavigationLinksList` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -// alternatively `client.ResourceNavigationLinksList(ctx, id)` can be used to do batched pagination -items, err := client.ResourceNavigationLinksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.ServiceAssociationLinksList` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -// alternatively `client.ServiceAssociationLinksList(ctx, id)` can be used to do batched pagination -items, err := client.ServiceAssociationLinksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.SubnetsPrepareNetworkPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := virtualnetworks.PrepareNetworkPoliciesRequest{ - // ... -} - - -if err := client.SubnetsPrepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.SubnetsUnprepareNetworkPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := virtualnetworks.UnprepareNetworkPoliciesRequest{ - // ... -} - - -if err := client.SubnetsUnprepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := virtualnetworks.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 -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksCheckIPAddressAvailability` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -read, err := client.VirtualNetworksCheckIPAddressAvailability(ctx, id, virtualnetworks.DefaultVirtualNetworksCheckIPAddressAvailabilityOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksListDdosProtectionStatus` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// alternatively `client.VirtualNetworksListDdosProtectionStatus(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions())` can be used to do batched pagination -items, err := client.VirtualNetworksListDdosProtectionStatusComplete(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksListUsage` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// alternatively `client.VirtualNetworksListUsage(ctx, id)` can be used to do batched pagination -items, err := client.VirtualNetworksListUsageComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/virtualnetworks/constants.go b/resource-manager/network/2023-04-01/virtualnetworks/constants.go deleted file mode 100644 index 785c3650439..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/constants.go +++ /dev/null @@ -1,1324 +0,0 @@ -package virtualnetworks - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IsWorkloadProtected string - -const ( - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -func PossibleValuesForIsWorkloadProtected() []string { - return []string{ - string(IsWorkloadProtectedFalse), - string(IsWorkloadProtectedTrue), - } -} - -func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsWorkloadProtected(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { - vals := map[string]IsWorkloadProtected{ - "false": IsWorkloadProtectedFalse, - "true": IsWorkloadProtectedTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsWorkloadProtected(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkEncryptionEnforcement string - -const ( - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -func PossibleValuesForVirtualNetworkEncryptionEnforcement() []string { - return []string{ - string(VirtualNetworkEncryptionEnforcementAllowUnencrypted), - string(VirtualNetworkEncryptionEnforcementDropUnencrypted), - } -} - -func (s *VirtualNetworkEncryptionEnforcement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkEncryptionEnforcement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkEncryptionEnforcement(input string) (*VirtualNetworkEncryptionEnforcement, error) { - vals := map[string]VirtualNetworkEncryptionEnforcement{ - "allowunencrypted": VirtualNetworkEncryptionEnforcementAllowUnencrypted, - "dropunencrypted": VirtualNetworkEncryptionEnforcementDropUnencrypted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkEncryptionEnforcement(input) - return &out, nil -} - -type VirtualNetworkPeeringLevel string - -const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -func PossibleValuesForVirtualNetworkPeeringLevel() []string { - return []string{ - string(VirtualNetworkPeeringLevelFullyInSync), - string(VirtualNetworkPeeringLevelLocalAndRemoteNotInSync), - string(VirtualNetworkPeeringLevelLocalNotInSync), - string(VirtualNetworkPeeringLevelRemoteNotInSync), - } -} - -func (s *VirtualNetworkPeeringLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringLevel(input string) (*VirtualNetworkPeeringLevel, error) { - vals := map[string]VirtualNetworkPeeringLevel{ - "fullyinsync": VirtualNetworkPeeringLevelFullyInSync, - "localandremotenotinsync": VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, - "localnotinsync": VirtualNetworkPeeringLevelLocalNotInSync, - "remotenotinsync": VirtualNetworkPeeringLevelRemoteNotInSync, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringLevel(input) - return &out, nil -} - -type VirtualNetworkPeeringState string - -const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -func PossibleValuesForVirtualNetworkPeeringState() []string { - return []string{ - string(VirtualNetworkPeeringStateConnected), - string(VirtualNetworkPeeringStateDisconnected), - string(VirtualNetworkPeeringStateInitiated), - } -} - -func (s *VirtualNetworkPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringState(input string) (*VirtualNetworkPeeringState, error) { - vals := map[string]VirtualNetworkPeeringState{ - "connected": VirtualNetworkPeeringStateConnected, - "disconnected": VirtualNetworkPeeringStateDisconnected, - "initiated": VirtualNetworkPeeringStateInitiated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringState(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index b5357aa1b58..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacepropertiesformat.go deleted file mode 100644 index f38dee01e75..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointconnectionproperties.go deleted file mode 100644 index badbc227dee..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddressdnssettings.go deleted file mode 100644 index 1e10d9bb32a..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworks/model_securityrulepropertiesformat.go deleted file mode 100644 index af160e60e64..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworks/model_subnetpropertiesformat.go deleted file mode 100644 index 599b6927d9c..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpropertiesformat.go deleted file mode 100644 index a6ad3b4e3a0..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/model_virtualnetworkpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPropertiesFormat struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` - EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` - EnableVMProtection *bool `json:"enableVmProtection,omitempty"` - Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlowTimeoutInMinutes *int64 `json:"flowTimeoutInMinutes,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` - VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworks/version.go b/resource-manager/network/2023-04-01/virtualnetworks/version.go deleted file mode 100644 index f95888ff1e4..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/README.md b/resource-manager/network/2023-04-01/virtualnetworktap/README.md deleted file mode 100644 index 5cc0f2e649d..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworktap` Documentation - -The `virtualnetworktap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualnetworktap" -``` - - -### Client Initialization - -```go -client := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkTapClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -payload := virtualnetworktap.VirtualNetworkTap{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkTapClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkTapClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -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: `VirtualNetworkTapClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -payload := virtualnetworktap.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/network/2023-04-01/virtualnetworktap/constants.go b/resource-manager/network/2023-04-01/virtualnetworktap/constants.go deleted file mode 100644 index fd73f5ab17a..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package virtualnetworktap - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 6ac563af429..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 0428a2c793c..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointconnectionproperties.go deleted file mode 100644 index f6119badaa5..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddressdnssettings.go deleted file mode 100644 index 5e531cfaa59..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktap/model_securityrulepropertiesformat.go deleted file mode 100644 index 8b92ef45964..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktap/model_subnetpropertiesformat.go deleted file mode 100644 index f179399d941..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktap/version.go b/resource-manager/network/2023-04-01/virtualnetworktap/version.go deleted file mode 100644 index 87a77703f7a..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktap/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktap/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/README.md b/resource-manager/network/2023-04-01/virtualnetworktaps/README.md deleted file mode 100644 index 05d0c7b3758..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualnetworktaps` Documentation - -The `virtualnetworktaps` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualnetworktaps" -``` - - -### Client Initialization - -```go -client := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkTapsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkTapsClient.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 -} -``` diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/constants.go b/resource-manager/network/2023-04-01/virtualnetworktaps/constants.go deleted file mode 100644 index 6a84040cbb3..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package virtualnetworktaps - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 9afb32298d3..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 9cb7ea2624a..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointconnectionproperties.go deleted file mode 100644 index d6ea54d1367..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddressdnssettings.go deleted file mode 100644 index a22c5ccb482..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktaps/model_securityrulepropertiesformat.go deleted file mode 100644 index 549b4d495a6..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/virtualnetworktaps/model_subnetpropertiesformat.go deleted file mode 100644 index be802f29a97..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualnetworktaps/version.go b/resource-manager/network/2023-04-01/virtualnetworktaps/version.go deleted file mode 100644 index b0aba4b0912..00000000000 --- a/resource-manager/network/2023-04-01/virtualnetworktaps/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktaps/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualrouterpeerings/README.md b/resource-manager/network/2023-04-01/virtualrouterpeerings/README.md deleted file mode 100644 index 6027b582602..00000000000 --- a/resource-manager/network/2023-04-01/virtualrouterpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualrouterpeerings` Documentation - -The `virtualrouterpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualrouterpeerings" -``` - - -### Client Initialization - -```go -client := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualRouterPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -payload := virtualrouterpeerings.VirtualRouterPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRouterPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRouterPeeringsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -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: `VirtualRouterPeeringsClient.List` - -```go -ctx := context.TODO() -id := virtualrouterpeerings.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -// 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/network/2023-04-01/virtualrouterpeerings/version.go b/resource-manager/network/2023-04-01/virtualrouterpeerings/version.go deleted file mode 100644 index 85e56a5d513..00000000000 --- a/resource-manager/network/2023-04-01/virtualrouterpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouterpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouterpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualrouters/README.md b/resource-manager/network/2023-04-01/virtualrouters/README.md deleted file mode 100644 index 8703a462e5b..00000000000 --- a/resource-manager/network/2023-04-01/virtualrouters/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualrouters` Documentation - -The `virtualrouters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualrouters" -``` - - -### Client Initialization - -```go -client := virtualrouters.NewVirtualRoutersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualRoutersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -payload := virtualrouters.VirtualRouter{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRoutersClient.Delete` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRoutersClient.Get` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -read, err := client.Get(ctx, id, virtualrouters.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualRoutersClient.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: `VirtualRoutersClient.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 -} -``` diff --git a/resource-manager/network/2023-04-01/virtualrouters/version.go b/resource-manager/network/2023-04-01/virtualrouters/version.go deleted file mode 100644 index 53a1d99de04..00000000000 --- a/resource-manager/network/2023-04-01/virtualrouters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouters/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/virtualwans/README.md b/resource-manager/network/2023-04-01/virtualwans/README.md deleted file mode 100644 index f00ad130d88..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/README.md +++ /dev/null @@ -1,1406 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/virtualwans` Documentation - -The `virtualwans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/virtualwans" -``` - - -### Client Initialization - -```go -client := virtualwans.NewVirtualWANsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -payload := virtualwans.VpnServerConfigurationPolicyGroup{ - // ... -} - - -if err := client.ConfigurationPolicyGroupsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -if err := client.ConfigurationPolicyGroupsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -read, err := client.ConfigurationPolicyGroupsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsListByVpnServerConfiguration` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -// alternatively `client.ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx, id)` can be used to do batched pagination -items, err := client.ConfigurationPolicyGroupsListByVpnServerConfigurationComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.Generatevirtualwanvpnserverconfigurationvpnprofile` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.VirtualWanVpnProfileParameters{ - // ... -} - - -if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -payload := virtualwans.HubRouteTable{ - // ... -} - - -if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -read, err := client.HubRouteTablesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.HubRouteTablesList(ctx, id)` can be used to do batched pagination -items, err := client.HubRouteTablesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -payload := virtualwans.HubVirtualNetworkConnection{ - // ... -} - - -if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.HubVirtualNetworkConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.HubVirtualNetworkConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -payload := virtualwans.VpnGatewayNatRule{ - // ... -} - - -if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -read, err := client.NatRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesListByVpnGateway` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -// alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination -items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := virtualwans.P2SVpnGateway{ - // ... -} - - -if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -read, err := client.P2sVpnGatewaysGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.P2sVpnGatewaysList(ctx, id)` can be used to do batched pagination -items, err := client.P2sVpnGatewaysListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.P2sVpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.P2sVpnGatewaysListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -payload := virtualwans.RouteMap{ - // ... -} - - -if err := client.RouteMapsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -if err := client.RouteMapsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -read, err := client.RouteMapsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.RouteMapsList(ctx, id)` can be used to do batched pagination -items, err := client.RouteMapsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -payload := virtualwans.RoutingIntent{ - // ... -} - - -if err := client.RoutingIntentCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -if err := client.RoutingIntentDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentGet` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -read, err := client.RoutingIntentGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.RoutingIntentList(ctx, id)` can be used to do batched pagination -items, err := client.RoutingIntentListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.SupportedSecurityProviders` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -read, err := client.SupportedSecurityProviders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.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 -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -payload := virtualwans.BgpConnection{ - // ... -} - - -if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -read, err := client.VirtualHubBgpConnectionGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubBgpConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubBgpConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListAdvertisedRoutes` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListLearnedRoutes` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -payload := virtualwans.HubIPConfiguration{ - // ... -} - - -if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -read, err := client.VirtualHubIPConfigurationGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubIPConfigurationList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubIPConfigurationListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -payload := virtualwans.VirtualHubRouteTableV2{ - // ... -} - - -if err := client.VirtualHubRouteTableV2sCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -if err := client.VirtualHubRouteTableV2sDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -read, err := client.VirtualHubRouteTableV2sGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubRouteTableV2sList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubRouteTableV2sListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.VirtualHub{ - // ... -} - - -if err := client.VirtualHubsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -if err := client.VirtualHubsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -read, err := client.VirtualHubsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetEffectiveVirtualHubRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.EffectiveRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetInboundRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.GetInboundRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetInboundRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetOutboundRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.GetOutboundRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetOutboundRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VirtualHubsList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VirtualHubsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsUpdateTags` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.TagsObject{ - // ... -} - - -read, err := client.VirtualHubsUpdateTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.VirtualWAN{ - // ... -} - - -if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -read, err := client.VirtualWansGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VirtualWansList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualWansListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VirtualWansListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VirtualWansListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnection{ - // ... -} - - -if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsDelete` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsGet` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -read, err := client.VpnConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsListByVpnGateway` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -// alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination -items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsStartPacketCapture` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ - // ... -} - - -if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsStopPacketCapture` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ - // ... -} - - -if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := virtualwans.VpnGateway{ - // ... -} - - -if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -read, err := client.VpnGatewaysGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnGatewaysList(ctx, id)` can be used to do batched pagination -items, err := client.VpnGatewaysListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnGatewaysListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnLinkConnectionsGetIkeSas` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - -if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnLinkConnectionsListByVpnConnection` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -// alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination -items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsAssociatedWithVirtualWanList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -payload := virtualwans.VpnServerConfiguration{ - // ... -} - - -if err := client.VpnServerConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -if err := client.VpnServerConfigurationsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -read, err := client.VpnServerConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnServerConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.VpnServerConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnServerConfigurationsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnServerConfigurationsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinkConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - -read, err := client.VpnSiteLinkConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinksGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue") - -read, err := client.VpnSiteLinksGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinksListByVpnSite` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -// alternatively `client.VpnSiteLinksListByVpnSite(ctx, id)` can be used to do batched pagination -items, err := client.VpnSiteLinksListByVpnSiteComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesConfigurationDownload` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.GetVpnSitesConfigurationRequest{ - // ... -} - - -if err := client.VpnSitesConfigurationDownloadThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -payload := virtualwans.VpnSite{ - // ... -} - - -if err := client.VpnSitesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -if err := client.VpnSitesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -read, err := client.VpnSitesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnSitesList(ctx, id)` can be used to do batched pagination -items, err := client.VpnSitesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnSitesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnSitesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/virtualwans/constants.go b/resource-manager/network/2023-04-01/virtualwans/constants.go deleted file mode 100644 index d26250d416b..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/constants.go +++ /dev/null @@ -1,2335 +0,0 @@ -package virtualwans - -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 AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type HubBgpConnectionStatus string - -const ( - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" - HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" -) - -func PossibleValuesForHubBgpConnectionStatus() []string { - return []string{ - string(HubBgpConnectionStatusConnected), - string(HubBgpConnectionStatusConnecting), - string(HubBgpConnectionStatusNotConnected), - string(HubBgpConnectionStatusUnknown), - } -} - -func (s *HubBgpConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHubBgpConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHubBgpConnectionStatus(input string) (*HubBgpConnectionStatus, error) { - vals := map[string]HubBgpConnectionStatus{ - "connected": HubBgpConnectionStatusConnected, - "connecting": HubBgpConnectionStatusConnecting, - "notconnected": HubBgpConnectionStatusNotConnected, - "unknown": HubBgpConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HubBgpConnectionStatus(input) - return &out, nil -} - -type HubRoutingPreference string - -const ( - HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" - HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" - HubRoutingPreferenceVpnGateway HubRoutingPreference = "VpnGateway" -) - -func PossibleValuesForHubRoutingPreference() []string { - return []string{ - string(HubRoutingPreferenceASPath), - string(HubRoutingPreferenceExpressRoute), - string(HubRoutingPreferenceVpnGateway), - } -} - -func (s *HubRoutingPreference) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHubRoutingPreference(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHubRoutingPreference(input string) (*HubRoutingPreference, error) { - vals := map[string]HubRoutingPreference{ - "aspath": HubRoutingPreferenceASPath, - "expressroute": HubRoutingPreferenceExpressRoute, - "vpngateway": HubRoutingPreferenceVpnGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HubRoutingPreference(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type NextStep string - -const ( - NextStepContinue NextStep = "Continue" - NextStepTerminate NextStep = "Terminate" - NextStepUnknown NextStep = "Unknown" -) - -func PossibleValuesForNextStep() []string { - return []string{ - string(NextStepContinue), - string(NextStepTerminate), - string(NextStepUnknown), - } -} - -func (s *NextStep) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNextStep(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNextStep(input string) (*NextStep, error) { - vals := map[string]NextStep{ - "continue": NextStepContinue, - "terminate": NextStepTerminate, - "unknown": NextStepUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NextStep(input) - return &out, nil -} - -type OfficeTrafficCategory string - -const ( - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -func PossibleValuesForOfficeTrafficCategory() []string { - return []string{ - string(OfficeTrafficCategoryAll), - string(OfficeTrafficCategoryNone), - string(OfficeTrafficCategoryOptimize), - string(OfficeTrafficCategoryOptimizeAndAllow), - } -} - -func (s *OfficeTrafficCategory) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOfficeTrafficCategory(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOfficeTrafficCategory(input string) (*OfficeTrafficCategory, error) { - vals := map[string]OfficeTrafficCategory{ - "all": OfficeTrafficCategoryAll, - "none": OfficeTrafficCategoryNone, - "optimize": OfficeTrafficCategoryOptimize, - "optimizeandallow": OfficeTrafficCategoryOptimizeAndAllow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OfficeTrafficCategory(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type PreferredRoutingGateway string - -const ( - PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" - PreferredRoutingGatewayNone PreferredRoutingGateway = "None" - PreferredRoutingGatewayVpnGateway PreferredRoutingGateway = "VpnGateway" -) - -func PossibleValuesForPreferredRoutingGateway() []string { - return []string{ - string(PreferredRoutingGatewayExpressRoute), - string(PreferredRoutingGatewayNone), - string(PreferredRoutingGatewayVpnGateway), - } -} - -func (s *PreferredRoutingGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePreferredRoutingGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePreferredRoutingGateway(input string) (*PreferredRoutingGateway, error) { - vals := map[string]PreferredRoutingGateway{ - "expressroute": PreferredRoutingGatewayExpressRoute, - "none": PreferredRoutingGatewayNone, - "vpngateway": PreferredRoutingGatewayVpnGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PreferredRoutingGateway(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteMapActionType string - -const ( - RouteMapActionTypeAdd RouteMapActionType = "Add" - RouteMapActionTypeDrop RouteMapActionType = "Drop" - RouteMapActionTypeRemove RouteMapActionType = "Remove" - RouteMapActionTypeReplace RouteMapActionType = "Replace" - RouteMapActionTypeUnknown RouteMapActionType = "Unknown" -) - -func PossibleValuesForRouteMapActionType() []string { - return []string{ - string(RouteMapActionTypeAdd), - string(RouteMapActionTypeDrop), - string(RouteMapActionTypeRemove), - string(RouteMapActionTypeReplace), - string(RouteMapActionTypeUnknown), - } -} - -func (s *RouteMapActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteMapActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteMapActionType(input string) (*RouteMapActionType, error) { - vals := map[string]RouteMapActionType{ - "add": RouteMapActionTypeAdd, - "drop": RouteMapActionTypeDrop, - "remove": RouteMapActionTypeRemove, - "replace": RouteMapActionTypeReplace, - "unknown": RouteMapActionTypeUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteMapActionType(input) - return &out, nil -} - -type RouteMapMatchCondition string - -const ( - RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" - RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" - RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" - RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" - RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" -) - -func PossibleValuesForRouteMapMatchCondition() []string { - return []string{ - string(RouteMapMatchConditionContains), - string(RouteMapMatchConditionEquals), - string(RouteMapMatchConditionNotContains), - string(RouteMapMatchConditionNotEquals), - string(RouteMapMatchConditionUnknown), - } -} - -func (s *RouteMapMatchCondition) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteMapMatchCondition(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteMapMatchCondition(input string) (*RouteMapMatchCondition, error) { - vals := map[string]RouteMapMatchCondition{ - "contains": RouteMapMatchConditionContains, - "equals": RouteMapMatchConditionEquals, - "notcontains": RouteMapMatchConditionNotContains, - "notequals": RouteMapMatchConditionNotEquals, - "unknown": RouteMapMatchConditionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteMapMatchCondition(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type RoutingState string - -const ( - RoutingStateFailed RoutingState = "Failed" - RoutingStateNone RoutingState = "None" - RoutingStateProvisioned RoutingState = "Provisioned" - RoutingStateProvisioning RoutingState = "Provisioning" -) - -func PossibleValuesForRoutingState() []string { - return []string{ - string(RoutingStateFailed), - string(RoutingStateNone), - string(RoutingStateProvisioned), - string(RoutingStateProvisioning), - } -} - -func (s *RoutingState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRoutingState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRoutingState(input string) (*RoutingState, error) { - vals := map[string]RoutingState{ - "failed": RoutingStateFailed, - "none": RoutingStateNone, - "provisioned": RoutingStateProvisioned, - "provisioning": RoutingStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RoutingState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} - -type VirtualWanSecurityProviderType string - -const ( - VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" - VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" -) - -func PossibleValuesForVirtualWanSecurityProviderType() []string { - return []string{ - string(VirtualWanSecurityProviderTypeExternal), - string(VirtualWanSecurityProviderTypeNative), - } -} - -func (s *VirtualWanSecurityProviderType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualWanSecurityProviderType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualWanSecurityProviderType(input string) (*VirtualWanSecurityProviderType, error) { - vals := map[string]VirtualWanSecurityProviderType{ - "external": VirtualWanSecurityProviderTypeExternal, - "native": VirtualWanSecurityProviderTypeNative, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualWanSecurityProviderType(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnConnectionStatus string - -const ( - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -func PossibleValuesForVpnConnectionStatus() []string { - return []string{ - string(VpnConnectionStatusConnected), - string(VpnConnectionStatusConnecting), - string(VpnConnectionStatusNotConnected), - string(VpnConnectionStatusUnknown), - } -} - -func (s *VpnConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnConnectionStatus(input string) (*VpnConnectionStatus, error) { - vals := map[string]VpnConnectionStatus{ - "connected": VpnConnectionStatusConnected, - "connecting": VpnConnectionStatusConnecting, - "notconnected": VpnConnectionStatusNotConnected, - "unknown": VpnConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnConnectionStatus(input) - return &out, nil -} - -type VpnGatewayTunnelingProtocol string - -const ( - VpnGatewayTunnelingProtocolIkeVTwo VpnGatewayTunnelingProtocol = "IkeV2" - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -func PossibleValuesForVpnGatewayTunnelingProtocol() []string { - return []string{ - string(VpnGatewayTunnelingProtocolIkeVTwo), - string(VpnGatewayTunnelingProtocolOpenVPN), - } -} - -func (s *VpnGatewayTunnelingProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayTunnelingProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayTunnelingProtocol(input string) (*VpnGatewayTunnelingProtocol, error) { - vals := map[string]VpnGatewayTunnelingProtocol{ - "ikev2": VpnGatewayTunnelingProtocolIkeVTwo, - "openvpn": VpnGatewayTunnelingProtocolOpenVPN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayTunnelingProtocol(input) - return &out, nil -} - -type VpnLinkConnectionMode string - -const ( - VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" - VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" - VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVpnLinkConnectionMode() []string { - return []string{ - string(VpnLinkConnectionModeDefault), - string(VpnLinkConnectionModeInitiatorOnly), - string(VpnLinkConnectionModeResponderOnly), - } -} - -func (s *VpnLinkConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnLinkConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnLinkConnectionMode(input string) (*VpnLinkConnectionMode, error) { - vals := map[string]VpnLinkConnectionMode{ - "default": VpnLinkConnectionModeDefault, - "initiatoronly": VpnLinkConnectionModeInitiatorOnly, - "responderonly": VpnLinkConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnLinkConnectionMode(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go b/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go deleted file mode 100644 index 6c0c2308e2b..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *map[string][]PeerRoute -} - -// VirtualHubBgpConnectionsListAdvertisedRoutes ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/advertisedRoutes", 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 -} - -// VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll performs VirtualHubBgpConnectionsListAdvertisedRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionsListAdvertisedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go b/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go deleted file mode 100644 index 4c6842802ef..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListLearnedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *map[string][]PeerRoute -} - -// VirtualHubBgpConnectionsListLearnedRoutes ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListLearnedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/learnedRoutes", 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 -} - -// VirtualHubBgpConnectionsListLearnedRoutesThenPoll performs VirtualHubBgpConnectionsListLearnedRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionsListLearnedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go b/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go deleted file mode 100644 index 1bbae403695..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubEffectiveRouteList -} - -// VirtualHubsGetEffectiveVirtualHubRoutes ... -func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutes(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) (result VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveRoutes", 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 -} - -// VirtualHubsGetEffectiveVirtualHubRoutesThenPoll performs VirtualHubsGetEffectiveVirtualHubRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) error { - result, err := c.VirtualHubsGetEffectiveVirtualHubRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetinboundroutes.go b/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetinboundroutes.go deleted file mode 100644 index 03114d0c238..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetinboundroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetInboundRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *EffectiveRouteMapRouteList -} - -// VirtualHubsGetInboundRoutes ... -func (c VirtualWANsClient) VirtualHubsGetInboundRoutes(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) (result VirtualHubsGetInboundRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/inboundRoutes", 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 -} - -// VirtualHubsGetInboundRoutesThenPoll performs VirtualHubsGetInboundRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetInboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) error { - result, err := c.VirtualHubsGetInboundRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetInboundRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetInboundRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetoutboundroutes.go b/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetoutboundroutes.go deleted file mode 100644 index 9a715f99613..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/method_virtualhubsgetoutboundroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetOutboundRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *EffectiveRouteMapRouteList -} - -// VirtualHubsGetOutboundRoutes ... -func (c VirtualWANsClient) VirtualHubsGetOutboundRoutes(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) (result VirtualHubsGetOutboundRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/outboundRoutes", 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 -} - -// VirtualHubsGetOutboundRoutesThenPoll performs VirtualHubsGetOutboundRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetOutboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) error { - result, err := c.VirtualHubsGetOutboundRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetOutboundRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetOutboundRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/virtualwans/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 210c422933e..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproute.go b/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproute.go deleted file mode 100644 index 3a565a687e8..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRouteMapRoute struct { - AsPath *string `json:"asPath,omitempty"` - BgpCommunities *string `json:"bgpCommunities,omitempty"` - Prefix *string `json:"prefix,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproutelist.go b/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproutelist.go deleted file mode 100644 index 326acde877b..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_effectiveroutemaproutelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRouteMapRouteList struct { - Value *[]EffectiveRouteMapRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/virtualwans/model_networkinterfacepropertiesformat.go deleted file mode 100644 index eb6875aa05e..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/virtualwans/model_privateendpointconnectionproperties.go deleted file mode 100644 index f54855d1288..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/virtualwans/model_publicipaddressdnssettings.go deleted file mode 100644 index 2a95851cb0c..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/virtualwans/model_securityrulepropertiesformat.go deleted file mode 100644 index 547a37a71ce..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/virtualwans/model_subnetpropertiesformat.go deleted file mode 100644 index be51bf35107..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroute.go b/resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroute.go deleted file mode 100644 index d46894da2a8..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroute.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubEffectiveRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - AsPath *string `json:"asPath,omitempty"` - NextHopType *string `json:"nextHopType,omitempty"` - NextHops *[]string `json:"nextHops,omitempty"` - RouteOrigin *string `json:"routeOrigin,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroutelist.go b/resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroutelist.go deleted file mode 100644 index 3ea5b7b15e4..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/model_virtualhubeffectiveroutelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubEffectiveRouteList struct { - Value *[]VirtualHubEffectiveRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/virtualwans/version.go b/resource-manager/network/2023-04-01/virtualwans/version.go deleted file mode 100644 index c5aefa374ba..00000000000 --- a/resource-manager/network/2023-04-01/virtualwans/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualwans/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/README.md b/resource-manager/network/2023-04-01/vmsspublicipaddresses/README.md deleted file mode 100644 index d011d2bc8eb..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/README.md +++ /dev/null @@ -1,71 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vmsspublicipaddresses` Documentation - -The `vmsspublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/vmsspublicipaddresses" -``` - - -### Client Initialization - -```go -client := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") - -read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses` - -```go -ctx := context.TODO() -id := vmsspublicipaddresses.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - -// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") - -// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/constants.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/constants.go deleted file mode 100644 index c753c0f93e2..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package vmsspublicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index da2c343dcde..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 67403077a5f..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index edd52323b43..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 5c5c8e381d5..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index 45a25e92fa7..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index c4a547c3c94..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/vmsspublicipaddresses/version.go b/resource-manager/network/2023-04-01/vmsspublicipaddresses/version.go deleted file mode 100644 index f44000379f7..00000000000 --- a/resource-manager/network/2023-04-01/vmsspublicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vmsspublicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/vpngateways/README.md b/resource-manager/network/2023-04-01/vpngateways/README.md deleted file mode 100644 index b0f41d6c9bd..00000000000 --- a/resource-manager/network/2023-04-01/vpngateways/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpngateways` Documentation - -The `vpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/vpngateways" -``` - - -### Client Initialization - -```go -client := vpngateways.NewVpnGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-04-01/vpngateways/method_reset.go b/resource-manager/network/2023-04-01/vpngateways/method_reset.go deleted file mode 100644 index ca8defc383b..00000000000 --- a/resource-manager/network/2023-04-01/vpngateways/method_reset.go +++ /dev/null @@ -1,99 +0,0 @@ -package vpngateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -type ResetOperationOptions struct { - IPConfigurationId *string -} - -func DefaultResetOperationOptions() ResetOperationOptions { - return ResetOperationOptions{} -} - -func (o ResetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ResetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ResetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPConfigurationId != nil { - out.Append("ipConfigurationId", fmt.Sprintf("%v", *o.IPConfigurationId)) - } - return &out -} - -// Reset ... -func (c VpnGatewaysClient) Reset(ctx context.Context, id VpnGatewayId, options ResetOperationOptions) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", id.ID()), - OptionsObject: options, - } - - 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c VpnGatewaysClient) ResetThenPoll(ctx context.Context, id VpnGatewayId, options ResetOperationOptions) error { - result, err := c.Reset(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-04-01/vpngateways/version.go b/resource-manager/network/2023-04-01/vpngateways/version.go deleted file mode 100644 index f29ef418445..00000000000 --- a/resource-manager/network/2023-04-01/vpngateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpngateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/vpnlinkconnections/version.go b/resource-manager/network/2023-04-01/vpnlinkconnections/version.go deleted file mode 100644 index 32071de49d2..00000000000 --- a/resource-manager/network/2023-04-01/vpnlinkconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnlinkconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnlinkconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/vpnserverconfigurations/README.md b/resource-manager/network/2023-04-01/vpnserverconfigurations/README.md deleted file mode 100644 index 5b47a8ea801..00000000000 --- a/resource-manager/network/2023-04-01/vpnserverconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpnserverconfigurations` Documentation - -The `vpnserverconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/vpnserverconfigurations" -``` - - -### Client Initialization - -```go -client := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnServerConfigurationsClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpnserverconfigurations.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -payload := vpnserverconfigurations.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/network/2023-04-01/vpnserverconfigurations/version.go b/resource-manager/network/2023-04-01/vpnserverconfigurations/version.go deleted file mode 100644 index 481aee17597..00000000000 --- a/resource-manager/network/2023-04-01/vpnserverconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnserverconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/vpnsites/README.md b/resource-manager/network/2023-04-01/vpnsites/README.md deleted file mode 100644 index c5b8c359657..00000000000 --- a/resource-manager/network/2023-04-01/vpnsites/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/vpnsites` Documentation - -The `vpnsites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/vpnsites" -``` - - -### Client Initialization - -```go -client := vpnsites.NewVpnSitesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnSitesClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpnsites.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -payload := vpnsites.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/network/2023-04-01/vpnsites/version.go b/resource-manager/network/2023-04-01/vpnsites/version.go deleted file mode 100644 index 684a37e9bd8..00000000000 --- a/resource-manager/network/2023-04-01/vpnsites/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnsites/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/README.md deleted file mode 100644 index cc4318ce2fa..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/README.md +++ /dev/null @@ -1,104 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/webapplicationfirewallpolicies` Documentation - -The `webapplicationfirewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/webapplicationfirewallpolicies" -``` - - -### Client Initialization - -```go -client := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebApplicationFirewallPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ - // ... -} - - -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: `WebApplicationFirewallPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `WebApplicationFirewallPoliciesClient.Get` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -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: `WebApplicationFirewallPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `WebApplicationFirewallPoliciesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/constants.go deleted file mode 100644 index 6fefcb921c2..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/constants.go +++ /dev/null @@ -1,2842 +0,0 @@ -package webapplicationfirewallpolicies - -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 ActionType string - -const ( - ActionTypeAllow ActionType = "Allow" - ActionTypeAnomalyScoring ActionType = "AnomalyScoring" - ActionTypeBlock ActionType = "Block" - ActionTypeLog ActionType = "Log" -) - -func PossibleValuesForActionType() []string { - return []string{ - string(ActionTypeAllow), - string(ActionTypeAnomalyScoring), - string(ActionTypeBlock), - string(ActionTypeLog), - } -} - -func (s *ActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionType(input string) (*ActionType, error) { - vals := map[string]ActionType{ - "allow": ActionTypeAllow, - "anomalyscoring": ActionTypeAnomalyScoring, - "block": ActionTypeBlock, - "log": ActionTypeLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionType(input) - return &out, nil -} - -type ApplicationGatewayClientRevocationOptions string - -const ( - ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" - ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { - return []string{ - string(ApplicationGatewayClientRevocationOptionsNone), - string(ApplicationGatewayClientRevocationOptionsOCSP), - } -} - -func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayClientRevocationOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { - vals := map[string]ApplicationGatewayClientRevocationOptions{ - "none": ApplicationGatewayClientRevocationOptionsNone, - "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayClientRevocationOptions(input) - return &out, nil -} - -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { - return []string{ - string(ApplicationGatewayCookieBasedAffinityDisabled), - string(ApplicationGatewayCookieBasedAffinityEnabled), - } -} - -func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCookieBasedAffinity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { - vals := map[string]ApplicationGatewayCookieBasedAffinity{ - "disabled": ApplicationGatewayCookieBasedAffinityDisabled, - "enabled": ApplicationGatewayCookieBasedAffinityEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCookieBasedAffinity(input) - return &out, nil -} - -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" -) - -func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { - return []string{ - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), - } -} - -func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { - vals := map[string]ApplicationGatewayCustomErrorStatusCode{ - "httpstatus500": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred, - "httpstatus504": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour, - "httpstatus503": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree, - "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, - "httpstatus400": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred, - "httpstatus408": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight, - "httpstatus405": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive, - "httpstatus404": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour, - "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCustomErrorStatusCode(input) - return &out, nil -} - -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -func PossibleValuesForApplicationGatewayFirewallMode() []string { - return []string{ - string(ApplicationGatewayFirewallModeDetection), - string(ApplicationGatewayFirewallModePrevention), - } -} - -func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { - vals := map[string]ApplicationGatewayFirewallMode{ - "detection": ApplicationGatewayFirewallModeDetection, - "prevention": ApplicationGatewayFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallMode(input) - return &out, nil -} - -type ApplicationGatewayFirewallRateLimitDuration string - -const ( - ApplicationGatewayFirewallRateLimitDurationFiveMins ApplicationGatewayFirewallRateLimitDuration = "FiveMins" - ApplicationGatewayFirewallRateLimitDurationOneMin ApplicationGatewayFirewallRateLimitDuration = "OneMin" -) - -func PossibleValuesForApplicationGatewayFirewallRateLimitDuration() []string { - return []string{ - string(ApplicationGatewayFirewallRateLimitDurationFiveMins), - string(ApplicationGatewayFirewallRateLimitDurationOneMin), - } -} - -func (s *ApplicationGatewayFirewallRateLimitDuration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallRateLimitDuration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallRateLimitDuration(input string) (*ApplicationGatewayFirewallRateLimitDuration, error) { - vals := map[string]ApplicationGatewayFirewallRateLimitDuration{ - "fivemins": ApplicationGatewayFirewallRateLimitDurationFiveMins, - "onemin": ApplicationGatewayFirewallRateLimitDurationOneMin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallRateLimitDuration(input) - return &out, nil -} - -type ApplicationGatewayFirewallUserSessionVariable string - -const ( - ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" - ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" - ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" -) - -func PossibleValuesForApplicationGatewayFirewallUserSessionVariable() []string { - return []string{ - string(ApplicationGatewayFirewallUserSessionVariableClientAddr), - string(ApplicationGatewayFirewallUserSessionVariableGeoLocation), - string(ApplicationGatewayFirewallUserSessionVariableNone), - } -} - -func (s *ApplicationGatewayFirewallUserSessionVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallUserSessionVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallUserSessionVariable(input string) (*ApplicationGatewayFirewallUserSessionVariable, error) { - vals := map[string]ApplicationGatewayFirewallUserSessionVariable{ - "clientaddr": ApplicationGatewayFirewallUserSessionVariableClientAddr, - "geolocation": ApplicationGatewayFirewallUserSessionVariableGeoLocation, - "none": ApplicationGatewayFirewallUserSessionVariableNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallUserSessionVariable(input) - return &out, nil -} - -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { - return []string{ - string(ApplicationGatewayLoadDistributionAlgorithmIPHash), - string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), - string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - } -} - -func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { - vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ - "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, - "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayLoadDistributionAlgorithm(input) - return &out, nil -} - -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -func PossibleValuesForApplicationGatewayOperationalState() []string { - return []string{ - string(ApplicationGatewayOperationalStateRunning), - string(ApplicationGatewayOperationalStateStarting), - string(ApplicationGatewayOperationalStateStopped), - string(ApplicationGatewayOperationalStateStopping), - } -} - -func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayOperationalState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { - vals := map[string]ApplicationGatewayOperationalState{ - "running": ApplicationGatewayOperationalStateRunning, - "starting": ApplicationGatewayOperationalStateStarting, - "stopped": ApplicationGatewayOperationalStateStopped, - "stopping": ApplicationGatewayOperationalStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayOperationalState(input) - return &out, nil -} - -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" -) - -func PossibleValuesForApplicationGatewayProtocol() []string { - return []string{ - string(ApplicationGatewayProtocolHTTP), - string(ApplicationGatewayProtocolHTTPS), - string(ApplicationGatewayProtocolTcp), - string(ApplicationGatewayProtocolTls), - } -} - -func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { - vals := map[string]ApplicationGatewayProtocol{ - "http": ApplicationGatewayProtocolHTTP, - "https": ApplicationGatewayProtocolHTTPS, - "tcp": ApplicationGatewayProtocolTcp, - "tls": ApplicationGatewayProtocolTls, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayProtocol(input) - return &out, nil -} - -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -func PossibleValuesForApplicationGatewayRedirectType() []string { - return []string{ - string(ApplicationGatewayRedirectTypeFound), - string(ApplicationGatewayRedirectTypePermanent), - string(ApplicationGatewayRedirectTypeSeeOther), - string(ApplicationGatewayRedirectTypeTemporary), - } -} - -func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRedirectType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { - vals := map[string]ApplicationGatewayRedirectType{ - "found": ApplicationGatewayRedirectTypeFound, - "permanent": ApplicationGatewayRedirectTypePermanent, - "seeother": ApplicationGatewayRedirectTypeSeeOther, - "temporary": ApplicationGatewayRedirectTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRedirectType(input) - return &out, nil -} - -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { - return []string{ - string(ApplicationGatewayRequestRoutingRuleTypeBasic), - string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - } -} - -func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { - vals := map[string]ApplicationGatewayRequestRoutingRuleType{ - "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, - "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRequestRoutingRuleType(input) - return &out, nil -} - -type ApplicationGatewaySkuName string - -const ( - ApplicationGatewaySkuNameBasic ApplicationGatewaySkuName = "Basic" - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" -) - -func PossibleValuesForApplicationGatewaySkuName() []string { - return []string{ - string(ApplicationGatewaySkuNameBasic), - string(ApplicationGatewaySkuNameStandardLarge), - string(ApplicationGatewaySkuNameStandardMedium), - string(ApplicationGatewaySkuNameStandardSmall), - string(ApplicationGatewaySkuNameStandardVTwo), - string(ApplicationGatewaySkuNameWAFLarge), - string(ApplicationGatewaySkuNameWAFMedium), - string(ApplicationGatewaySkuNameWAFVTwo), - } -} - -func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { - vals := map[string]ApplicationGatewaySkuName{ - "basic": ApplicationGatewaySkuNameBasic, - "standard_large": ApplicationGatewaySkuNameStandardLarge, - "standard_medium": ApplicationGatewaySkuNameStandardMedium, - "standard_small": ApplicationGatewaySkuNameStandardSmall, - "standard_v2": ApplicationGatewaySkuNameStandardVTwo, - "waf_large": ApplicationGatewaySkuNameWAFLarge, - "waf_medium": ApplicationGatewaySkuNameWAFMedium, - "waf_v2": ApplicationGatewaySkuNameWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySkuName(input) - return &out, nil -} - -type ApplicationGatewaySslCipherSuite string - -const ( - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -) - -func PossibleValuesForApplicationGatewaySslCipherSuite() []string { - return []string{ - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), - } -} - -func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslCipherSuite(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { - vals := map[string]ApplicationGatewaySslCipherSuite{ - "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, - "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, - "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, - "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, - "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, - "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, - "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslCipherSuite(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyName string - -const ( - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -func PossibleValuesForApplicationGatewaySslPolicyName() []string { - return []string{ - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), - } -} - -func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { - vals := map[string]ApplicationGatewaySslPolicyName{ - "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, - "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, - "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, - "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, - "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyName(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyType string - -const ( - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" -) - -func PossibleValuesForApplicationGatewaySslPolicyType() []string { - return []string{ - string(ApplicationGatewaySslPolicyTypeCustom), - string(ApplicationGatewaySslPolicyTypeCustomVTwo), - string(ApplicationGatewaySslPolicyTypePredefined), - } -} - -func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { - vals := map[string]ApplicationGatewaySslPolicyType{ - "custom": ApplicationGatewaySslPolicyTypeCustom, - "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, - "predefined": ApplicationGatewaySslPolicyTypePredefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyType(input) - return &out, nil -} - -type ApplicationGatewaySslProtocol string - -const ( - ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" - ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" - ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" - ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" -) - -func PossibleValuesForApplicationGatewaySslProtocol() []string { - return []string{ - string(ApplicationGatewaySslProtocolTLSvOneOne), - string(ApplicationGatewaySslProtocolTLSvOneThree), - string(ApplicationGatewaySslProtocolTLSvOneTwo), - string(ApplicationGatewaySslProtocolTLSvOneZero), - } -} - -func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { - vals := map[string]ApplicationGatewaySslProtocol{ - "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, - "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, - "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, - "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslProtocol(input) - return &out, nil -} - -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTier() []string { - return []string{ - string(ApplicationGatewayTierBasic), - string(ApplicationGatewayTierStandard), - string(ApplicationGatewayTierStandardVTwo), - string(ApplicationGatewayTierWAF), - string(ApplicationGatewayTierWAFVTwo), - } -} - -func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { - vals := map[string]ApplicationGatewayTier{ - "basic": ApplicationGatewayTierBasic, - "standard": ApplicationGatewayTierStandard, - "standard_v2": ApplicationGatewayTierStandardVTwo, - "waf": ApplicationGatewayTierWAF, - "waf_v2": ApplicationGatewayTierWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTier(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type ManagedRuleEnabledState string - -const ( - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" - ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" -) - -func PossibleValuesForManagedRuleEnabledState() []string { - return []string{ - string(ManagedRuleEnabledStateDisabled), - string(ManagedRuleEnabledStateEnabled), - } -} - -func (s *ManagedRuleEnabledState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseManagedRuleEnabledState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseManagedRuleEnabledState(input string) (*ManagedRuleEnabledState, error) { - vals := map[string]ManagedRuleEnabledState{ - "disabled": ManagedRuleEnabledStateDisabled, - "enabled": ManagedRuleEnabledStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedRuleEnabledState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type OwaspCrsExclusionEntryMatchVariable string - -const ( - OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" - OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" -) - -func PossibleValuesForOwaspCrsExclusionEntryMatchVariable() []string { - return []string{ - string(OwaspCrsExclusionEntryMatchVariableRequestArgKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestArgNames), - string(OwaspCrsExclusionEntryMatchVariableRequestArgValues), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieNames), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieValues), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderValues), - } -} - -func (s *OwaspCrsExclusionEntryMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwaspCrsExclusionEntryMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwaspCrsExclusionEntryMatchVariable(input string) (*OwaspCrsExclusionEntryMatchVariable, error) { - vals := map[string]OwaspCrsExclusionEntryMatchVariable{ - "requestargkeys": OwaspCrsExclusionEntryMatchVariableRequestArgKeys, - "requestargnames": OwaspCrsExclusionEntryMatchVariableRequestArgNames, - "requestargvalues": OwaspCrsExclusionEntryMatchVariableRequestArgValues, - "requestcookiekeys": OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, - "requestcookienames": OwaspCrsExclusionEntryMatchVariableRequestCookieNames, - "requestcookievalues": OwaspCrsExclusionEntryMatchVariableRequestCookieValues, - "requestheaderkeys": OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, - "requestheadernames": OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, - "requestheadervalues": OwaspCrsExclusionEntryMatchVariableRequestHeaderValues, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwaspCrsExclusionEntryMatchVariable(input) - return &out, nil -} - -type OwaspCrsExclusionEntrySelectorMatchOperator string - -const ( - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" -) - -func PossibleValuesForOwaspCrsExclusionEntrySelectorMatchOperator() []string { - return []string{ - string(OwaspCrsExclusionEntrySelectorMatchOperatorContains), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEquals), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny), - string(OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - } -} - -func (s *OwaspCrsExclusionEntrySelectorMatchOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwaspCrsExclusionEntrySelectorMatchOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwaspCrsExclusionEntrySelectorMatchOperator(input string) (*OwaspCrsExclusionEntrySelectorMatchOperator, error) { - vals := map[string]OwaspCrsExclusionEntrySelectorMatchOperator{ - "contains": OwaspCrsExclusionEntrySelectorMatchOperatorContains, - "endswith": OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, - "equals": OwaspCrsExclusionEntrySelectorMatchOperatorEquals, - "equalsany": OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, - "startswith": OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwaspCrsExclusionEntrySelectorMatchOperator(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type ScrubbingRuleEntryMatchOperator string - -const ( - ScrubbingRuleEntryMatchOperatorEquals ScrubbingRuleEntryMatchOperator = "Equals" - ScrubbingRuleEntryMatchOperatorEqualsAny ScrubbingRuleEntryMatchOperator = "EqualsAny" -) - -func PossibleValuesForScrubbingRuleEntryMatchOperator() []string { - return []string{ - string(ScrubbingRuleEntryMatchOperatorEquals), - string(ScrubbingRuleEntryMatchOperatorEqualsAny), - } -} - -func (s *ScrubbingRuleEntryMatchOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryMatchOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryMatchOperator(input string) (*ScrubbingRuleEntryMatchOperator, error) { - vals := map[string]ScrubbingRuleEntryMatchOperator{ - "equals": ScrubbingRuleEntryMatchOperatorEquals, - "equalsany": ScrubbingRuleEntryMatchOperatorEqualsAny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryMatchOperator(input) - return &out, nil -} - -type ScrubbingRuleEntryMatchVariable string - -const ( - ScrubbingRuleEntryMatchVariableRequestArgNames ScrubbingRuleEntryMatchVariable = "RequestArgNames" - ScrubbingRuleEntryMatchVariableRequestCookieNames ScrubbingRuleEntryMatchVariable = "RequestCookieNames" - ScrubbingRuleEntryMatchVariableRequestHeaderNames ScrubbingRuleEntryMatchVariable = "RequestHeaderNames" - ScrubbingRuleEntryMatchVariableRequestIPAddress ScrubbingRuleEntryMatchVariable = "RequestIPAddress" - ScrubbingRuleEntryMatchVariableRequestJSONArgNames ScrubbingRuleEntryMatchVariable = "RequestJSONArgNames" - ScrubbingRuleEntryMatchVariableRequestPostArgNames ScrubbingRuleEntryMatchVariable = "RequestPostArgNames" -) - -func PossibleValuesForScrubbingRuleEntryMatchVariable() []string { - return []string{ - string(ScrubbingRuleEntryMatchVariableRequestArgNames), - string(ScrubbingRuleEntryMatchVariableRequestCookieNames), - string(ScrubbingRuleEntryMatchVariableRequestHeaderNames), - string(ScrubbingRuleEntryMatchVariableRequestIPAddress), - string(ScrubbingRuleEntryMatchVariableRequestJSONArgNames), - string(ScrubbingRuleEntryMatchVariableRequestPostArgNames), - } -} - -func (s *ScrubbingRuleEntryMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryMatchVariable(input string) (*ScrubbingRuleEntryMatchVariable, error) { - vals := map[string]ScrubbingRuleEntryMatchVariable{ - "requestargnames": ScrubbingRuleEntryMatchVariableRequestArgNames, - "requestcookienames": ScrubbingRuleEntryMatchVariableRequestCookieNames, - "requestheadernames": ScrubbingRuleEntryMatchVariableRequestHeaderNames, - "requestipaddress": ScrubbingRuleEntryMatchVariableRequestIPAddress, - "requestjsonargnames": ScrubbingRuleEntryMatchVariableRequestJSONArgNames, - "requestpostargnames": ScrubbingRuleEntryMatchVariableRequestPostArgNames, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryMatchVariable(input) - return &out, nil -} - -type ScrubbingRuleEntryState string - -const ( - ScrubbingRuleEntryStateDisabled ScrubbingRuleEntryState = "Disabled" - ScrubbingRuleEntryStateEnabled ScrubbingRuleEntryState = "Enabled" -) - -func PossibleValuesForScrubbingRuleEntryState() []string { - return []string{ - string(ScrubbingRuleEntryStateDisabled), - string(ScrubbingRuleEntryStateEnabled), - } -} - -func (s *ScrubbingRuleEntryState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryState(input string) (*ScrubbingRuleEntryState, error) { - vals := map[string]ScrubbingRuleEntryState{ - "disabled": ScrubbingRuleEntryStateDisabled, - "enabled": ScrubbingRuleEntryStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} - -type WebApplicationFirewallAction string - -const ( - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -func PossibleValuesForWebApplicationFirewallAction() []string { - return []string{ - string(WebApplicationFirewallActionAllow), - string(WebApplicationFirewallActionBlock), - string(WebApplicationFirewallActionLog), - } -} - -func (s *WebApplicationFirewallAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallAction(input string) (*WebApplicationFirewallAction, error) { - vals := map[string]WebApplicationFirewallAction{ - "allow": WebApplicationFirewallActionAllow, - "block": WebApplicationFirewallActionBlock, - "log": WebApplicationFirewallActionLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallAction(input) - return &out, nil -} - -type WebApplicationFirewallEnabledState string - -const ( - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallEnabledState() []string { - return []string{ - string(WebApplicationFirewallEnabledStateDisabled), - string(WebApplicationFirewallEnabledStateEnabled), - } -} - -func (s *WebApplicationFirewallEnabledState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallEnabledState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallEnabledState(input string) (*WebApplicationFirewallEnabledState, error) { - vals := map[string]WebApplicationFirewallEnabledState{ - "disabled": WebApplicationFirewallEnabledStateDisabled, - "enabled": WebApplicationFirewallEnabledStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallEnabledState(input) - return &out, nil -} - -type WebApplicationFirewallMatchVariable string - -const ( - WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" - WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" - WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" - WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - WebApplicationFirewallMatchVariableRequestUri WebApplicationFirewallMatchVariable = "RequestUri" -) - -func PossibleValuesForWebApplicationFirewallMatchVariable() []string { - return []string{ - string(WebApplicationFirewallMatchVariablePostArgs), - string(WebApplicationFirewallMatchVariableQueryString), - string(WebApplicationFirewallMatchVariableRemoteAddr), - string(WebApplicationFirewallMatchVariableRequestBody), - string(WebApplicationFirewallMatchVariableRequestCookies), - string(WebApplicationFirewallMatchVariableRequestHeaders), - string(WebApplicationFirewallMatchVariableRequestMethod), - string(WebApplicationFirewallMatchVariableRequestUri), - } -} - -func (s *WebApplicationFirewallMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallMatchVariable(input string) (*WebApplicationFirewallMatchVariable, error) { - vals := map[string]WebApplicationFirewallMatchVariable{ - "postargs": WebApplicationFirewallMatchVariablePostArgs, - "querystring": WebApplicationFirewallMatchVariableQueryString, - "remoteaddr": WebApplicationFirewallMatchVariableRemoteAddr, - "requestbody": WebApplicationFirewallMatchVariableRequestBody, - "requestcookies": WebApplicationFirewallMatchVariableRequestCookies, - "requestheaders": WebApplicationFirewallMatchVariableRequestHeaders, - "requestmethod": WebApplicationFirewallMatchVariableRequestMethod, - "requesturi": WebApplicationFirewallMatchVariableRequestUri, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallMatchVariable(input) - return &out, nil -} - -type WebApplicationFirewallMode string - -const ( - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -func PossibleValuesForWebApplicationFirewallMode() []string { - return []string{ - string(WebApplicationFirewallModeDetection), - string(WebApplicationFirewallModePrevention), - } -} - -func (s *WebApplicationFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallMode(input string) (*WebApplicationFirewallMode, error) { - vals := map[string]WebApplicationFirewallMode{ - "detection": WebApplicationFirewallModeDetection, - "prevention": WebApplicationFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallMode(input) - return &out, nil -} - -type WebApplicationFirewallOperator string - -const ( - WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -func PossibleValuesForWebApplicationFirewallOperator() []string { - return []string{ - string(WebApplicationFirewallOperatorAny), - string(WebApplicationFirewallOperatorBeginsWith), - string(WebApplicationFirewallOperatorContains), - string(WebApplicationFirewallOperatorEndsWith), - string(WebApplicationFirewallOperatorEqual), - string(WebApplicationFirewallOperatorGeoMatch), - string(WebApplicationFirewallOperatorGreaterThan), - string(WebApplicationFirewallOperatorGreaterThanOrEqual), - string(WebApplicationFirewallOperatorIPMatch), - string(WebApplicationFirewallOperatorLessThan), - string(WebApplicationFirewallOperatorLessThanOrEqual), - string(WebApplicationFirewallOperatorRegex), - } -} - -func (s *WebApplicationFirewallOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallOperator(input string) (*WebApplicationFirewallOperator, error) { - vals := map[string]WebApplicationFirewallOperator{ - "any": WebApplicationFirewallOperatorAny, - "beginswith": WebApplicationFirewallOperatorBeginsWith, - "contains": WebApplicationFirewallOperatorContains, - "endswith": WebApplicationFirewallOperatorEndsWith, - "equal": WebApplicationFirewallOperatorEqual, - "geomatch": WebApplicationFirewallOperatorGeoMatch, - "greaterthan": WebApplicationFirewallOperatorGreaterThan, - "greaterthanorequal": WebApplicationFirewallOperatorGreaterThanOrEqual, - "ipmatch": WebApplicationFirewallOperatorIPMatch, - "lessthan": WebApplicationFirewallOperatorLessThan, - "lessthanorequal": WebApplicationFirewallOperatorLessThanOrEqual, - "regex": WebApplicationFirewallOperatorRegex, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallOperator(input) - return &out, nil -} - -type WebApplicationFirewallPolicyResourceState string - -const ( - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -func PossibleValuesForWebApplicationFirewallPolicyResourceState() []string { - return []string{ - string(WebApplicationFirewallPolicyResourceStateCreating), - string(WebApplicationFirewallPolicyResourceStateDeleting), - string(WebApplicationFirewallPolicyResourceStateDisabled), - string(WebApplicationFirewallPolicyResourceStateDisabling), - string(WebApplicationFirewallPolicyResourceStateEnabled), - string(WebApplicationFirewallPolicyResourceStateEnabling), - } -} - -func (s *WebApplicationFirewallPolicyResourceState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallPolicyResourceState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallPolicyResourceState(input string) (*WebApplicationFirewallPolicyResourceState, error) { - vals := map[string]WebApplicationFirewallPolicyResourceState{ - "creating": WebApplicationFirewallPolicyResourceStateCreating, - "deleting": WebApplicationFirewallPolicyResourceStateDeleting, - "disabled": WebApplicationFirewallPolicyResourceStateDisabled, - "disabling": WebApplicationFirewallPolicyResourceStateDisabling, - "enabled": WebApplicationFirewallPolicyResourceStateEnabled, - "enabling": WebApplicationFirewallPolicyResourceStateEnabling, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallPolicyResourceState(input) - return &out, nil -} - -type WebApplicationFirewallRuleType string - -const ( - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" - WebApplicationFirewallRuleTypeRateLimitRule WebApplicationFirewallRuleType = "RateLimitRule" -) - -func PossibleValuesForWebApplicationFirewallRuleType() []string { - return []string{ - string(WebApplicationFirewallRuleTypeInvalid), - string(WebApplicationFirewallRuleTypeMatchRule), - string(WebApplicationFirewallRuleTypeRateLimitRule), - } -} - -func (s *WebApplicationFirewallRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallRuleType(input string) (*WebApplicationFirewallRuleType, error) { - vals := map[string]WebApplicationFirewallRuleType{ - "invalid": WebApplicationFirewallRuleTypeInvalid, - "matchrule": WebApplicationFirewallRuleTypeMatchRule, - "ratelimitrule": WebApplicationFirewallRuleTypeRateLimitRule, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallRuleType(input) - return &out, nil -} - -type WebApplicationFirewallScrubbingState string - -const ( - WebApplicationFirewallScrubbingStateDisabled WebApplicationFirewallScrubbingState = "Disabled" - WebApplicationFirewallScrubbingStateEnabled WebApplicationFirewallScrubbingState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallScrubbingState() []string { - return []string{ - string(WebApplicationFirewallScrubbingStateDisabled), - string(WebApplicationFirewallScrubbingStateEnabled), - } -} - -func (s *WebApplicationFirewallScrubbingState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallScrubbingState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallScrubbingState(input string) (*WebApplicationFirewallScrubbingState, error) { - vals := map[string]WebApplicationFirewallScrubbingState{ - "disabled": WebApplicationFirewallScrubbingStateDisabled, - "enabled": WebApplicationFirewallScrubbingStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallScrubbingState(input) - return &out, nil -} - -type WebApplicationFirewallState string - -const ( - WebApplicationFirewallStateDisabled WebApplicationFirewallState = "Disabled" - WebApplicationFirewallStateEnabled WebApplicationFirewallState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallState() []string { - return []string{ - string(WebApplicationFirewallStateDisabled), - string(WebApplicationFirewallStateEnabled), - } -} - -func (s *WebApplicationFirewallState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallState(input string) (*WebApplicationFirewallState, error) { - vals := map[string]WebApplicationFirewallState{ - "disabled": WebApplicationFirewallStateDisabled, - "enabled": WebApplicationFirewallStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallState(input) - return &out, nil -} - -type WebApplicationFirewallTransform string - -const ( - WebApplicationFirewallTransformHtmlEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" - WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" - WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" -) - -func PossibleValuesForWebApplicationFirewallTransform() []string { - return []string{ - string(WebApplicationFirewallTransformHtmlEntityDecode), - string(WebApplicationFirewallTransformLowercase), - string(WebApplicationFirewallTransformRemoveNulls), - string(WebApplicationFirewallTransformTrim), - string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), - } -} - -func (s *WebApplicationFirewallTransform) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallTransform(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewallTransform, error) { - vals := map[string]WebApplicationFirewallTransform{ - "htmlentitydecode": WebApplicationFirewallTransformHtmlEntityDecode, - "lowercase": WebApplicationFirewallTransformLowercase, - "removenulls": WebApplicationFirewallTransformRemoveNulls, - "trim": WebApplicationFirewallTransformTrim, - "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallTransform(input) - return &out, nil -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go deleted file mode 100644 index f4f485b405b..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ /dev/null @@ -1,43 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPropertiesFormat struct { - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - DefaultPredefinedSslPolicy *ApplicationGatewaySslPolicyName `json:"defaultPredefinedSslPolicy,omitempty"` - EnableFips *bool `json:"enableFips,omitempty"` - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index ddf54b50116..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyusersession.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyusersession.go deleted file mode 100644 index 5995831381a..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyusersession.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupByUserSession struct { - GroupByVariables []GroupByVariable `json:"groupByVariables"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyvariable.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyvariable.go deleted file mode 100644 index 132602a8758..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_groupbyvariable.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupByVariable struct { - VariableName ApplicationGatewayFirewallUserSessionVariable `json:"variableName"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go deleted file mode 100644 index e24f37ad4e4..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettings.go deleted file mode 100644 index ad2543067d3..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettings.go +++ /dev/null @@ -1,18 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PolicySettings struct { - CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` - CustomBlockResponseStatusCode *int64 `json:"customBlockResponseStatusCode,omitempty"` - FileUploadEnforcement *bool `json:"fileUploadEnforcement,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - LogScrubbing *PolicySettingsLogScrubbing `json:"logScrubbing,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - Mode *WebApplicationFirewallMode `json:"mode,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RequestBodyEnforcement *bool `json:"requestBodyEnforcement,omitempty"` - RequestBodyInspectLimitInKB *int64 `json:"requestBodyInspectLimitInKB,omitempty"` - State *WebApplicationFirewallEnabledState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go deleted file mode 100644 index a97418be867..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PolicySettingsLogScrubbing struct { - ScrubbingRules *[]WebApplicationFirewallScrubbingRules `json:"scrubbingRules,omitempty"` - State *WebApplicationFirewallScrubbingState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go deleted file mode 100644 index dbd38c8e4ca..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go deleted file mode 100644 index c122bbf9d00..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go deleted file mode 100644 index d40d084432c..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go deleted file mode 100644 index e98defaa49c..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go +++ /dev/null @@ -1,26 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go deleted file mode 100644 index c66c1257253..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallCustomRule struct { - Action WebApplicationFirewallAction `json:"action"` - Etag *string `json:"etag,omitempty"` - GroupByUserSession *[]GroupByUserSession `json:"groupByUserSession,omitempty"` - MatchConditions []MatchCondition `json:"matchConditions"` - Name *string `json:"name,omitempty"` - Priority int64 `json:"priority"` - RateLimitDuration *ApplicationGatewayFirewallRateLimitDuration `json:"rateLimitDuration,omitempty"` - RateLimitThreshold *int64 `json:"rateLimitThreshold,omitempty"` - RuleType WebApplicationFirewallRuleType `json:"ruleType"` - State *WebApplicationFirewallState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go deleted file mode 100644 index b3d3f6dd209..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallScrubbingRules struct { - MatchVariable ScrubbingRuleEntryMatchVariable `json:"matchVariable"` - Selector *string `json:"selector,omitempty"` - SelectorMatchOperator ScrubbingRuleEntryMatchOperator `json:"selectorMatchOperator"` - State *ScrubbingRuleEntryState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/version.go b/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/version.go deleted file mode 100644 index c998f9a2044..00000000000 --- a/resource-manager/network/2023-04-01/webapplicationfirewallpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webapplicationfirewallpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-04-01/webcategories/README.md b/resource-manager/network/2023-04-01/webcategories/README.md deleted file mode 100644 index 49a260fa6cb..00000000000 --- a/resource-manager/network/2023-04-01/webcategories/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-04-01/webcategories` Documentation - -The `webcategories` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-04-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/network/2023-04-01/webcategories" -``` - - -### Client Initialization - -```go -client := webcategories.NewWebCategoriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebCategoriesClient.Get` - -```go -ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue") - -read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `WebCategoriesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-04-01/webcategories/version.go b/resource-manager/network/2023-04-01/webcategories/version.go deleted file mode 100644 index b17fb4332bd..00000000000 --- a/resource-manager/network/2023-04-01/webcategories/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webcategories - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webcategories/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/README.md b/resource-manager/network/2023-05-01/adminrulecollections/README.md deleted file mode 100644 index 8621c4410f3..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/adminrulecollections` Documentation - -The `adminrulecollections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/adminrulecollections" -``` - - -### Client Initialization - -```go -client := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdminRuleCollectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -payload := adminrulecollections.AdminRuleCollection{ - // ... -} - - -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: `AdminRuleCollectionsClient.Delete` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AdminRuleCollectionsClient.Get` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -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: `AdminRuleCollectionsClient.List` - -```go -ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -// alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/adminrulecollections/client.go b/resource-manager/network/2023-05-01/adminrulecollections/client.go deleted file mode 100644 index adbf2674d97..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package adminrulecollections - -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 AdminRuleCollectionsClient struct { - Client *resourcemanager.Client -} - -func NewAdminRuleCollectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*AdminRuleCollectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "adminrulecollections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AdminRuleCollectionsClient: %+v", err) - } - - return &AdminRuleCollectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/constants.go b/resource-manager/network/2023-05-01/adminrulecollections/constants.go deleted file mode 100644 index d3e735bf0f1..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package adminrulecollections - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection.go b/resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection.go deleted file mode 100644 index 5c84e59671e..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection.go +++ /dev/null @@ -1,148 +0,0 @@ -package adminrulecollections - -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(&RuleCollectionId{}) -} - -var _ resourceids.ResourceId = &RuleCollectionId{} - -// RuleCollectionId is a struct representing the Resource ID for a Rule Collection -type RuleCollectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string - RuleCollectionName string -} - -// NewRuleCollectionID returns a new RuleCollectionId struct -func NewRuleCollectionID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string) RuleCollectionId { - return RuleCollectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - RuleCollectionName: ruleCollectionName, - } -} - -// ParseRuleCollectionID parses 'input' into a RuleCollectionId -func ParseRuleCollectionID(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleCollectionIDInsensitively parses 'input' case-insensitively into a RuleCollectionId -// note: this method should only be used for API response data and not user input -func ParseRuleCollectionIDInsensitively(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleCollectionId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - if id.RuleCollectionName, ok = input.Parsed["ruleCollectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionName", input) - } - - return nil -} - -// ValidateRuleCollectionID checks that 'input' can be parsed as a Rule Collection ID -func ValidateRuleCollectionID(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 := ParseRuleCollectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule Collection ID -func (id RuleCollectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s/ruleCollections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName, id.RuleCollectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule Collection ID -func (id RuleCollectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), - resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionValue"), - } -} - -// String returns a human-readable description of this Rule Collection ID -func (id RuleCollectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - fmt.Sprintf("Rule Collection Name: %q", id.RuleCollectionName), - } - return fmt.Sprintf("Rule Collection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection_test.go b/resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection_test.go deleted file mode 100644 index f887adb5138..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/id_rulecollection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package adminrulecollections - -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 = &RuleCollectionId{} - -func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } - - if id.RuleCollectionName != "ruleCollectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionName'", id.RuleCollectionName, "ruleCollectionValue") - } -} - -func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleCollectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestParseRuleCollectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - RuleCollectionName: "rUlEcOlLeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestSegmentsForRuleCollectionId(t *testing.T) { - segments := RuleCollectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleCollectionId 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/network/2023-05-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration.go deleted file mode 100644 index b8186efef3b..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package adminrulecollections - -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(&SecurityAdminConfigurationId{}) -} - -var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} - -// SecurityAdminConfigurationId is a struct representing the Resource ID for a Security Admin Configuration -type SecurityAdminConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string -} - -// NewSecurityAdminConfigurationID returns a new SecurityAdminConfigurationId struct -func NewSecurityAdminConfigurationID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string) SecurityAdminConfigurationId { - return SecurityAdminConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - } -} - -// ParseSecurityAdminConfigurationID parses 'input' into a SecurityAdminConfigurationId -func ParseSecurityAdminConfigurationID(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityAdminConfigurationIDInsensitively parses 'input' case-insensitively into a SecurityAdminConfigurationId -// note: this method should only be used for API response data and not user input -func ParseSecurityAdminConfigurationIDInsensitively(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityAdminConfigurationId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - return nil -} - -// ValidateSecurityAdminConfigurationID checks that 'input' can be parsed as a Security Admin Configuration ID -func ValidateSecurityAdminConfigurationID(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 := ParseSecurityAdminConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Admin Configuration ID -func (id SecurityAdminConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - } -} - -// String returns a human-readable description of this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - } - return fmt.Sprintf("Security Admin Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration_test.go deleted file mode 100644 index 1dbffe93a7e..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/id_securityadminconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package adminrulecollections - -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 = &SecurityAdminConfigurationId{} - -func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } -} - -func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityAdminConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestSegmentsForSecurityAdminConfigurationId(t *testing.T) { - segments := SecurityAdminConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityAdminConfigurationId 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/network/2023-05-01/adminrulecollections/method_createorupdate.go b/resource-manager/network/2023-05-01/adminrulecollections/method_createorupdate.go deleted file mode 100644 index 67a6db6eb7b..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package adminrulecollections - -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 *AdminRuleCollection -} - -// CreateOrUpdate ... -func (c AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, id RuleCollectionId, input AdminRuleCollection) (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 AdminRuleCollection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/method_delete.go b/resource-manager/network/2023-05-01/adminrulecollections/method_delete.go deleted file mode 100644 index 2a158c78562..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package adminrulecollections - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 AdminRuleCollectionsClient) Delete(ctx context.Context, id RuleCollectionId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 AdminRuleCollectionsClient) DeleteThenPoll(ctx context.Context, id RuleCollectionId, 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/network/2023-05-01/adminrulecollections/method_get.go b/resource-manager/network/2023-05-01/adminrulecollections/method_get.go deleted file mode 100644 index 8beb93c5eca..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package adminrulecollections - -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 *AdminRuleCollection -} - -// Get ... -func (c AdminRuleCollectionsClient) Get(ctx context.Context, id RuleCollectionId) (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 AdminRuleCollection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/method_list.go b/resource-manager/network/2023-05-01/adminrulecollections/method_list.go deleted file mode 100644 index b7d5d537d04..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package adminrulecollections - -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 *[]AdminRuleCollection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AdminRuleCollection -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c AdminRuleCollectionsClient) List(ctx context.Context, id SecurityAdminConfigurationId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ruleCollections", id.ID()), - OptionsObject: options, - } - - 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 *[]AdminRuleCollection `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 AdminRuleCollectionsClient) ListComplete(ctx context.Context, id SecurityAdminConfigurationId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, AdminRuleCollectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AdminRuleCollectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id SecurityAdminConfigurationId, options ListOperationOptions, predicate AdminRuleCollectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AdminRuleCollection, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/adminrulecollections/model_adminrulecollection.go b/resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollection.go deleted file mode 100644 index aea91d2ba70..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollection.go +++ /dev/null @@ -1,17 +0,0 @@ -package adminrulecollections - -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 AdminRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AdminRuleCollectionPropertiesFormat `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go b/resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go deleted file mode 100644 index 43e02d8ca9c..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminRuleCollectionPropertiesFormat struct { - AppliesToGroups []NetworkManagerSecurityGroupItem `json:"appliesToGroups"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2023-05-01/adminrulecollections/model_networkmanagersecuritygroupitem.go deleted file mode 100644 index ce59c38f4fd..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/model_networkmanagersecuritygroupitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerSecurityGroupItem struct { - NetworkGroupId string `json:"networkGroupId"` -} diff --git a/resource-manager/network/2023-05-01/adminrulecollections/predicates.go b/resource-manager/network/2023-05-01/adminrulecollections/predicates.go deleted file mode 100644 index 67b37b95643..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminRuleCollectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AdminRuleCollectionOperationPredicate) Matches(input AdminRuleCollection) 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.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/network/2023-05-01/adminrulecollections/version.go b/resource-manager/network/2023-05-01/adminrulecollections/version.go deleted file mode 100644 index 5376e7de6da..00000000000 --- a/resource-manager/network/2023-05-01/adminrulecollections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrulecollections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/adminrulecollections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/adminrules/README.md b/resource-manager/network/2023-05-01/adminrules/README.md deleted file mode 100644 index 8523d0006d0..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/adminrules` Documentation - -The `adminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/adminrules" -``` - - -### Client Initialization - -```go -client := adminrules.NewAdminRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdminRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -payload := adminrules.BaseAdminRule{ - // ... -} - - -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: `AdminRulesClient.Delete` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AdminRulesClient.Get` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -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: `AdminRulesClient.List` - -```go -ctx := context.TODO() -id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -// 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/network/2023-05-01/adminrules/client.go b/resource-manager/network/2023-05-01/adminrules/client.go deleted file mode 100644 index 40da5b4d0a4..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package adminrules - -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 AdminRulesClient struct { - Client *resourcemanager.Client -} - -func NewAdminRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AdminRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "adminrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AdminRulesClient: %+v", err) - } - - return &AdminRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/adminrules/constants.go b/resource-manager/network/2023-05-01/adminrules/constants.go deleted file mode 100644 index fbaa03c5543..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package adminrules - -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 AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -func PossibleValuesForAddressPrefixType() []string { - return []string{ - string(AddressPrefixTypeIPPrefix), - string(AddressPrefixTypeServiceTag), - } -} - -func (s *AddressPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAddressPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAddressPrefixType(input string) (*AddressPrefixType, error) { - vals := map[string]AddressPrefixType{ - "ipprefix": AddressPrefixTypeIPPrefix, - "servicetag": AddressPrefixTypeServiceTag, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AddressPrefixType(input) - return &out, nil -} - -type AdminRuleKind string - -const ( - AdminRuleKindCustom AdminRuleKind = "Custom" - AdminRuleKindDefault AdminRuleKind = "Default" -) - -func PossibleValuesForAdminRuleKind() []string { - return []string{ - string(AdminRuleKindCustom), - string(AdminRuleKindDefault), - } -} - -func (s *AdminRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminRuleKind(input string) (*AdminRuleKind, error) { - vals := map[string]AdminRuleKind{ - "custom": AdminRuleKindCustom, - "default": AdminRuleKindDefault, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminRuleKind(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -func PossibleValuesForSecurityConfigurationRuleAccess() []string { - return []string{ - string(SecurityConfigurationRuleAccessAllow), - string(SecurityConfigurationRuleAccessAlwaysAllow), - string(SecurityConfigurationRuleAccessDeny), - } -} - -func (s *SecurityConfigurationRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleAccess(input string) (*SecurityConfigurationRuleAccess, error) { - vals := map[string]SecurityConfigurationRuleAccess{ - "allow": SecurityConfigurationRuleAccessAllow, - "alwaysallow": SecurityConfigurationRuleAccessAlwaysAllow, - "deny": SecurityConfigurationRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleAccess(input) - return &out, nil -} - -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityConfigurationRuleDirection() []string { - return []string{ - string(SecurityConfigurationRuleDirectionInbound), - string(SecurityConfigurationRuleDirectionOutbound), - } -} - -func (s *SecurityConfigurationRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleDirection(input string) (*SecurityConfigurationRuleDirection, error) { - vals := map[string]SecurityConfigurationRuleDirection{ - "inbound": SecurityConfigurationRuleDirectionInbound, - "outbound": SecurityConfigurationRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleDirection(input) - return &out, nil -} - -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTcp SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUdp SecurityConfigurationRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityConfigurationRuleProtocol() []string { - return []string{ - string(SecurityConfigurationRuleProtocolAh), - string(SecurityConfigurationRuleProtocolAny), - string(SecurityConfigurationRuleProtocolEsp), - string(SecurityConfigurationRuleProtocolIcmp), - string(SecurityConfigurationRuleProtocolTcp), - string(SecurityConfigurationRuleProtocolUdp), - } -} - -func (s *SecurityConfigurationRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleProtocol(input string) (*SecurityConfigurationRuleProtocol, error) { - vals := map[string]SecurityConfigurationRuleProtocol{ - "ah": SecurityConfigurationRuleProtocolAh, - "any": SecurityConfigurationRuleProtocolAny, - "esp": SecurityConfigurationRuleProtocolEsp, - "icmp": SecurityConfigurationRuleProtocolIcmp, - "tcp": SecurityConfigurationRuleProtocolTcp, - "udp": SecurityConfigurationRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/adminrules/id_rule.go b/resource-manager/network/2023-05-01/adminrules/id_rule.go deleted file mode 100644 index 3b132449062..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/id_rule.go +++ /dev/null @@ -1,157 +0,0 @@ -package adminrules - -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(&RuleId{}) -} - -var _ resourceids.ResourceId = &RuleId{} - -// RuleId is a struct representing the Resource ID for a Rule -type RuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string - RuleCollectionName string - RuleName string -} - -// NewRuleID returns a new RuleId struct -func NewRuleID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string, ruleName string) RuleId { - return RuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - RuleCollectionName: ruleCollectionName, - RuleName: ruleName, - } -} - -// ParseRuleID parses 'input' into a RuleId -func ParseRuleID(input string) (*RuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleIDInsensitively parses 'input' case-insensitively into a RuleId -// note: this method should only be used for API response data and not user input -func ParseRuleIDInsensitively(input string) (*RuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - if id.RuleCollectionName, ok = input.Parsed["ruleCollectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionName", input) - } - - if id.RuleName, ok = input.Parsed["ruleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleName", input) - } - - return nil -} - -// ValidateRuleID checks that 'input' can be parsed as a Rule ID -func ValidateRuleID(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 := ParseRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule ID -func (id RuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s/ruleCollections/%s/rules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName, id.RuleCollectionName, id.RuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule ID -func (id RuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), - resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionValue"), - resourceids.StaticSegment("staticRules", "rules", "rules"), - resourceids.UserSpecifiedSegment("ruleName", "ruleValue"), - } -} - -// String returns a human-readable description of this Rule ID -func (id RuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - fmt.Sprintf("Rule Collection Name: %q", id.RuleCollectionName), - fmt.Sprintf("Rule Name: %q", id.RuleName), - } - return fmt.Sprintf("Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/adminrules/id_rule_test.go b/resource-manager/network/2023-05-01/adminrules/id_rule_test.go deleted file mode 100644 index 755182392b5..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/id_rule_test.go +++ /dev/null @@ -1,417 +0,0 @@ -package adminrules - -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 = &RuleId{} - -func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } - - if id.RuleCollectionName != "ruleCollectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionName'", id.RuleCollectionName, "ruleCollectionValue") - } - - if id.RuleName != "ruleValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleName'", id.RuleName, "ruleValue") - } -} - -func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue", - Expected: &RuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - RuleName: "ruleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - if actual.RuleName != v.Expected.RuleName { - t.Fatalf("Expected %q but got %q for RuleName", v.Expected.RuleName, actual.RuleName) - } - - } -} - -func TestParseRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/rUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue", - Expected: &RuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - RuleName: "ruleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/rUlEs/rUlEvAlUe", - Expected: &RuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - RuleCollectionName: "rUlEcOlLeCtIoNvAlUe", - RuleName: "rUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/rUlEs/rUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - if actual.RuleName != v.Expected.RuleName { - t.Fatalf("Expected %q but got %q for RuleName", v.Expected.RuleName, actual.RuleName) - } - - } -} - -func TestSegmentsForRuleId(t *testing.T) { - segments := RuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleId 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/network/2023-05-01/adminrules/id_rulecollection.go b/resource-manager/network/2023-05-01/adminrules/id_rulecollection.go deleted file mode 100644 index 6dd9dd5b0a8..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/id_rulecollection.go +++ /dev/null @@ -1,148 +0,0 @@ -package adminrules - -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(&RuleCollectionId{}) -} - -var _ resourceids.ResourceId = &RuleCollectionId{} - -// RuleCollectionId is a struct representing the Resource ID for a Rule Collection -type RuleCollectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string - RuleCollectionName string -} - -// NewRuleCollectionID returns a new RuleCollectionId struct -func NewRuleCollectionID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string) RuleCollectionId { - return RuleCollectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - RuleCollectionName: ruleCollectionName, - } -} - -// ParseRuleCollectionID parses 'input' into a RuleCollectionId -func ParseRuleCollectionID(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleCollectionIDInsensitively parses 'input' case-insensitively into a RuleCollectionId -// note: this method should only be used for API response data and not user input -func ParseRuleCollectionIDInsensitively(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleCollectionId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - if id.RuleCollectionName, ok = input.Parsed["ruleCollectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionName", input) - } - - return nil -} - -// ValidateRuleCollectionID checks that 'input' can be parsed as a Rule Collection ID -func ValidateRuleCollectionID(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 := ParseRuleCollectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule Collection ID -func (id RuleCollectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s/ruleCollections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName, id.RuleCollectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule Collection ID -func (id RuleCollectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), - resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionValue"), - } -} - -// String returns a human-readable description of this Rule Collection ID -func (id RuleCollectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - fmt.Sprintf("Rule Collection Name: %q", id.RuleCollectionName), - } - return fmt.Sprintf("Rule Collection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/adminrules/id_rulecollection_test.go b/resource-manager/network/2023-05-01/adminrules/id_rulecollection_test.go deleted file mode 100644 index f93da939de7..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/id_rulecollection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package adminrules - -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 = &RuleCollectionId{} - -func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } - - if id.RuleCollectionName != "ruleCollectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionName'", id.RuleCollectionName, "ruleCollectionValue") - } -} - -func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleCollectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestParseRuleCollectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - RuleCollectionName: "rUlEcOlLeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestSegmentsForRuleCollectionId(t *testing.T) { - segments := RuleCollectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleCollectionId 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/network/2023-05-01/adminrules/method_createorupdate.go b/resource-manager/network/2023-05-01/adminrules/method_createorupdate.go deleted file mode 100644 index d936a5666f1..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package adminrules - -import ( - "context" - "encoding/json" - "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 *BaseAdminRule -} - -// CreateOrUpdate ... -func (c AdminRulesClient) CreateOrUpdate(ctx context.Context, id RuleId, input BaseAdminRule) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalBaseAdminRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/network/2023-05-01/adminrules/method_delete.go b/resource-manager/network/2023-05-01/adminrules/method_delete.go deleted file mode 100644 index 6d7b0f948b8..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package adminrules - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 AdminRulesClient) Delete(ctx context.Context, id RuleId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 AdminRulesClient) DeleteThenPoll(ctx context.Context, id RuleId, 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/network/2023-05-01/adminrules/method_get.go b/resource-manager/network/2023-05-01/adminrules/method_get.go deleted file mode 100644 index 94337a0e139..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package adminrules - -import ( - "context" - "encoding/json" - "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 *BaseAdminRule -} - -// Get ... -func (c AdminRulesClient) Get(ctx context.Context, id RuleId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalBaseAdminRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/network/2023-05-01/adminrules/method_list.go b/resource-manager/network/2023-05-01/adminrules/method_list.go deleted file mode 100644 index 977c19ec540..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package adminrules - -import ( - "context" - "encoding/json" - "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 *[]BaseAdminRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BaseAdminRule -} - -// List ... -func (c AdminRulesClient) List(ctx context.Context, id RuleCollectionId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/rules", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]BaseAdminRule, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalBaseAdminRuleImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for BaseAdminRule (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AdminRulesClient) ListComplete(ctx context.Context, id RuleCollectionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BaseAdminRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AdminRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id RuleCollectionId, predicate BaseAdminRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]BaseAdminRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/adminrules/model_addressprefixitem.go b/resource-manager/network/2023-05-01/adminrules/model_addressprefixitem.go deleted file mode 100644 index 223aec22448..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/model_addressprefixitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressPrefixItem struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/adminrules/model_adminpropertiesformat.go b/resource-manager/network/2023-05-01/adminrules/model_adminpropertiesformat.go deleted file mode 100644 index a0e21af6c0d..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/adminrules/model_adminrule.go b/resource-manager/network/2023-05-01/adminrules/model_adminrule.go deleted file mode 100644 index 8544cf3cd71..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/model_adminrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package adminrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ BaseAdminRule = AdminRule{} - -type AdminRule struct { - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from BaseAdminRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AdminRule{} - -func (s AdminRule) MarshalJSON() ([]byte, error) { - type wrapper AdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AdminRule: %+v", err) - } - decoded["kind"] = "Custom" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/adminrules/model_baseadminrule.go b/resource-manager/network/2023-05-01/adminrules/model_baseadminrule.go deleted file mode 100644 index bbcabba727e..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/model_baseadminrule.go +++ /dev/null @@ -1,61 +0,0 @@ -package adminrules - -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 BaseAdminRule interface { -} - -// RawBaseAdminRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawBaseAdminRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalBaseAdminRuleImplementation(input []byte) (BaseAdminRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling BaseAdminRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Custom") { - var out AdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AdminRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Default") { - var out DefaultAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DefaultAdminRule: %+v", err) - } - return out, nil - } - - out := RawBaseAdminRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-05-01/adminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-05-01/adminrules/model_defaultadminpropertiesformat.go deleted file mode 100644 index a8242069c88..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/adminrules/model_defaultadminrule.go b/resource-manager/network/2023-05-01/adminrules/model_defaultadminrule.go deleted file mode 100644 index 7a93ae7edc9..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/model_defaultadminrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package adminrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ BaseAdminRule = DefaultAdminRule{} - -type DefaultAdminRule struct { - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from BaseAdminRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DefaultAdminRule{} - -func (s DefaultAdminRule) MarshalJSON() ([]byte, error) { - type wrapper DefaultAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DefaultAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DefaultAdminRule: %+v", err) - } - decoded["kind"] = "Default" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DefaultAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/adminrules/predicates.go b/resource-manager/network/2023-05-01/adminrules/predicates.go deleted file mode 100644 index f594b9ac1be..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BaseAdminRuleOperationPredicate struct { -} - -func (p BaseAdminRuleOperationPredicate) Matches(input BaseAdminRule) bool { - - return true -} diff --git a/resource-manager/network/2023-05-01/adminrules/version.go b/resource-manager/network/2023-05-01/adminrules/version.go deleted file mode 100644 index 8cd225bac5c..00000000000 --- a/resource-manager/network/2023-05-01/adminrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/adminrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/README.md deleted file mode 100644 index 1c9295e50a0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections` Documentation - -The `applicationgatewayprivateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/applicationgatewayprivateendpointconnections" -``` - - -### Client Initialization - -```go -client := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Get` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -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: `ApplicationGatewayPrivateEndpointConnectionsClient.List` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -// 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: `ApplicationGatewayPrivateEndpointConnectionsClient.Update` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/client.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/client.go deleted file mode 100644 index 10a57c1c475..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 ApplicationGatewayPrivateEndpointConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewayPrivateEndpointConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgatewayprivateendpointconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewayPrivateEndpointConnectionsClient: %+v", err) - } - - return &ApplicationGatewayPrivateEndpointConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/constants.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/constants.go deleted file mode 100644 index 815302663c9..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go deleted file mode 100644 index e1cb4795761..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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(&ApplicationGatewayId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayId{} - -// ApplicationGatewayId is a struct representing the Resource ID for a Application Gateway -type ApplicationGatewayId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string -} - -// NewApplicationGatewayID returns a new ApplicationGatewayId struct -func NewApplicationGatewayID(subscriptionId string, resourceGroupName string, applicationGatewayName string) ApplicationGatewayId { - return ApplicationGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - } -} - -// ParseApplicationGatewayID parses 'input' into a ApplicationGatewayId -func ParseApplicationGatewayID(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayIDInsensitively(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - return nil -} - -// ValidateApplicationGatewayID checks that 'input' can be parsed as a Application Gateway ID -func ValidateApplicationGatewayID(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 := ParseApplicationGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway ID -func (id ApplicationGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway ID -func (id ApplicationGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - } -} - -// String returns a human-readable description of this Application Gateway ID -func (id ApplicationGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - } - return fmt.Sprintf("Application Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go deleted file mode 100644 index abc9f9e0c40..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 = &ApplicationGatewayId{} - -func TestNewApplicationGatewayID(t *testing.T) { - id := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } -} - -func TestFormatApplicationGatewayID(t *testing.T) { - actual := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestParseApplicationGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestSegmentsForApplicationGatewayId(t *testing.T) { - segments := ApplicationGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayId 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/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index aad51fee91b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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(&ApplicationGatewayPrivateEndpointConnectionId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayPrivateEndpointConnectionId{} - -// ApplicationGatewayPrivateEndpointConnectionId is a struct representing the Resource ID for a Application Gateway Private Endpoint Connection -type ApplicationGatewayPrivateEndpointConnectionId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string - PrivateEndpointConnectionName string -} - -// NewApplicationGatewayPrivateEndpointConnectionID returns a new ApplicationGatewayPrivateEndpointConnectionId struct -func NewApplicationGatewayPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, applicationGatewayName string, privateEndpointConnectionName string) ApplicationGatewayPrivateEndpointConnectionId { - return ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - PrivateEndpointConnectionName: privateEndpointConnectionName, - } -} - -// ParseApplicationGatewayPrivateEndpointConnectionID parses 'input' into a ApplicationGatewayPrivateEndpointConnectionId -func ParseApplicationGatewayPrivateEndpointConnectionID(input string) (*ApplicationGatewayPrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayPrivateEndpointConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayPrivateEndpointConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayPrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayPrivateEndpointConnectionId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(input string) (*ApplicationGatewayPrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayPrivateEndpointConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayPrivateEndpointConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayPrivateEndpointConnectionId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) - } - - return nil -} - -// ValidateApplicationGatewayPrivateEndpointConnectionID checks that 'input' can be parsed as a Application Gateway Private Endpoint Connection ID -func ValidateApplicationGatewayPrivateEndpointConnectionID(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 := ParseApplicationGatewayPrivateEndpointConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway Private Endpoint Connection ID -func (id ApplicationGatewayPrivateEndpointConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s/privateEndpointConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName, id.PrivateEndpointConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway Private Endpoint Connection ID -func (id ApplicationGatewayPrivateEndpointConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// String returns a human-readable description of this Application Gateway Private Endpoint Connection ID -func (id ApplicationGatewayPrivateEndpointConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), - } - return fmt.Sprintf("Application Gateway Private Endpoint Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go deleted file mode 100644 index 89bf57821c8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 = &ApplicationGatewayPrivateEndpointConnectionId{} - -func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayPrivateEndpointConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayPrivateEndpointConnectionID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - if actual.PrivateEndpointConnectionName != v.Expected.PrivateEndpointConnectionName { - t.Fatalf("Expected %q but got %q for PrivateEndpointConnectionName", v.Expected.PrivateEndpointConnectionName, actual.PrivateEndpointConnectionName) - } - - } -} - -func TestParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayPrivateEndpointConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - if actual.PrivateEndpointConnectionName != v.Expected.PrivateEndpointConnectionName { - t.Fatalf("Expected %q but got %q for PrivateEndpointConnectionName", v.Expected.PrivateEndpointConnectionName, actual.PrivateEndpointConnectionName) - } - - } -} - -func TestSegmentsForApplicationGatewayPrivateEndpointConnectionId(t *testing.T) { - segments := ApplicationGatewayPrivateEndpointConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayPrivateEndpointConnectionId 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/network/2023-05-01/applicationgatewayprivateendpointconnections/method_delete.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_delete.go deleted file mode 100644 index 8a25d1654cc..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 ApplicationGatewayPrivateEndpointConnectionsClient) Delete(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationGatewayPrivateEndpointConnectionsClient) DeleteThenPoll(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId) 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/network/2023-05-01/applicationgatewayprivateendpointconnections/method_get.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_get.go deleted file mode 100644 index f3f7a21ab28..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 *ApplicationGatewayPrivateEndpointConnection -} - -// Get ... -func (c ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId) (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 ApplicationGatewayPrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_list.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_list.go deleted file mode 100644 index 3ea8f85bf3f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 *[]ApplicationGatewayPrivateEndpointConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewayPrivateEndpointConnection -} - -// List ... -func (c ApplicationGatewayPrivateEndpointConnectionsClient) List(ctx context.Context, id ApplicationGatewayId) (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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]ApplicationGatewayPrivateEndpointConnection `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 ApplicationGatewayPrivateEndpointConnectionsClient) ListComplete(ctx context.Context, id ApplicationGatewayId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationGatewayPrivateEndpointConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewayPrivateEndpointConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id ApplicationGatewayId, predicate ApplicationGatewayPrivateEndpointConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationGatewayPrivateEndpointConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/applicationgatewayprivateendpointconnections/method_update.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_update.go deleted file mode 100644 index 394f02e54dd..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayPrivateEndpointConnection -} - -// Update ... -func (c ApplicationGatewayPrivateEndpointConnectionsClient) Update(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId, input ApplicationGatewayPrivateEndpointConnection) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ApplicationGatewayPrivateEndpointConnectionsClient) UpdateThenPoll(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId, input ApplicationGatewayPrivateEndpointConnection) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 19262bd584a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 049337217fe..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 508dc9994b4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 89d75010a65..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 5d46fc4d14d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index 899ea09f853..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go deleted file mode 100644 index 19f24417e8b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go deleted file mode 100644 index 6cfad393dcc..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index f494b4f811b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go deleted file mode 100644 index f5906c781bd..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index d3eb3749cba..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 0e7c2876d57..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ddossettings.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ddossettings.go deleted file mode 100644 index 84bb3713a5f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_delegation.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_delegation.go deleted file mode 100644 index db8d3269de6..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlog.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlog.go deleted file mode 100644 index b3f068af815..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go deleted file mode 100644 index 0b6831f6fa6..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go deleted file mode 100644 index 922ced2b2f1..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go deleted file mode 100644 index 5d4f44391e7..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index f8184b617b0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index d1d69ce0587..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go deleted file mode 100644 index a9b0e096bd3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 30f69829656..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go deleted file mode 100644 index 38591b7aaa2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go deleted file mode 100644 index a118ebdd4e1..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 75728fa1ebe..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index b2f70477897..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_iptag.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_iptag.go deleted file mode 100644 index c1aef66c21f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go deleted file mode 100644 index 7c55794d5db..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 786682fa462..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgateway.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgateway.go deleted file mode 100644 index f7258d97962..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7384cd2e1a6..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go deleted file mode 100644 index 17af8527640..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go deleted file mode 100644 index d1f6b522fcc..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterface.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterface.go deleted file mode 100644 index 27dd4a4a08a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go deleted file mode 100644 index 6b7723bb374..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 5b9d0f918bf..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index fc79de05a6f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 96eeeb31d67..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 4b7b529ab7d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 54a119f8358..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 2812f9ea959..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go deleted file mode 100644 index cb2c6128022..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 2ec03e22f7c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go deleted file mode 100644 index c59c28f78d1..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go deleted file mode 100644 index ad89494737c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index f1877976742..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go deleted file mode 100644 index bd3c50f01ac..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index f3ec0dcc86e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go deleted file mode 100644 index d7be5354bcd..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go deleted file mode 100644 index 78a6c7ebba8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go deleted file mode 100644 index 5cc8a8e4dbf..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 461fb1081a9..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 6be96efd9df..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 3c19c2d4de4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index c81dae99663..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go deleted file mode 100644 index dc3f962814c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go deleted file mode 100644 index e89345d55bc..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go deleted file mode 100644 index 38e3265c5cf..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go deleted file mode 100644 index f699284c895..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go deleted file mode 100644 index b74d0311a75..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go deleted file mode 100644 index 0274f951e3c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go deleted file mode 100644 index 4182988a892..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourceset.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourceset.go deleted file mode 100644 index 075d9853046..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go deleted file mode 100644 index 2b030c17554..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_route.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_route.go deleted file mode 100644 index 939f9379822..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go deleted file mode 100644 index 4afa3c6bed4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetable.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetable.go deleted file mode 100644 index 8a1cf00052b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go deleted file mode 100644 index c3a2020ea09..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrule.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrule.go deleted file mode 100644 index e892509d682..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go deleted file mode 100644 index ad268f42e3d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go deleted file mode 100644 index 208a786f7a0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index eaf8e403c15..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go deleted file mode 100644 index a8da5cf7bca..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go deleted file mode 100644 index 0871d765423..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 9051f5afd03..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index c8f3720498a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 27a0c5e36ce..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go deleted file mode 100644 index fa1f92d606a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnet.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnet.go deleted file mode 100644 index 315bdbd9d59..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go deleted file mode 100644 index 44895bdbae8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subresource.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subresource.go deleted file mode 100644 index 7cea1d49c02..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 860948a52b3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go deleted file mode 100644 index 92e4c14749f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go deleted file mode 100644 index 7c49436256c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 131405acb48..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/predicates.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/predicates.go deleted file mode 100644 index 46757c5239b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ApplicationGatewayPrivateEndpointConnectionOperationPredicate) Matches(input ApplicationGatewayPrivateEndpointConnection) 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.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/network/2023-05-01/applicationgatewayprivateendpointconnections/version.go b/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/version.go deleted file mode 100644 index f8a1cda52ac..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivateendpointconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/README.md b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/README.md deleted file mode 100644 index 35c0dd47771..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources` Documentation - -The `applicationgatewayprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/applicationgatewayprivatelinkresources" -``` - - -### Client Initialization - -```go -client := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayPrivateLinkResourcesClient.List` - -```go -ctx := context.TODO() -id := applicationgatewayprivatelinkresources.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -// 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/network/2023-05-01/applicationgatewayprivatelinkresources/client.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/client.go deleted file mode 100644 index 9e064641526..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewayprivatelinkresources - -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 ApplicationGatewayPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewayPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgatewayprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewayPrivateLinkResourcesClient: %+v", err) - } - - return &ApplicationGatewayPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway.go deleted file mode 100644 index f86cb06512e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationgatewayprivatelinkresources - -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(&ApplicationGatewayId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayId{} - -// ApplicationGatewayId is a struct representing the Resource ID for a Application Gateway -type ApplicationGatewayId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string -} - -// NewApplicationGatewayID returns a new ApplicationGatewayId struct -func NewApplicationGatewayID(subscriptionId string, resourceGroupName string, applicationGatewayName string) ApplicationGatewayId { - return ApplicationGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - } -} - -// ParseApplicationGatewayID parses 'input' into a ApplicationGatewayId -func ParseApplicationGatewayID(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayIDInsensitively(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - return nil -} - -// ValidateApplicationGatewayID checks that 'input' can be parsed as a Application Gateway ID -func ValidateApplicationGatewayID(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 := ParseApplicationGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway ID -func (id ApplicationGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway ID -func (id ApplicationGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - } -} - -// String returns a human-readable description of this Application Gateway ID -func (id ApplicationGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - } - return fmt.Sprintf("Application Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go deleted file mode 100644 index 5c994f79587..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationgatewayprivatelinkresources - -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 = &ApplicationGatewayId{} - -func TestNewApplicationGatewayID(t *testing.T) { - id := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } -} - -func TestFormatApplicationGatewayID(t *testing.T) { - actual := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestParseApplicationGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestSegmentsForApplicationGatewayId(t *testing.T) { - segments := ApplicationGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayId 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/network/2023-05-01/applicationgatewayprivatelinkresources/method_list.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/method_list.go deleted file mode 100644 index 9d2d22e7464..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package applicationgatewayprivatelinkresources - -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 *[]ApplicationGatewayPrivateLinkResource -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewayPrivateLinkResource -} - -// List ... -func (c ApplicationGatewayPrivateLinkResourcesClient) List(ctx context.Context, id ApplicationGatewayId) (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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]ApplicationGatewayPrivateLinkResource `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 ApplicationGatewayPrivateLinkResourcesClient) ListComplete(ctx context.Context, id ApplicationGatewayId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationGatewayPrivateLinkResourceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewayPrivateLinkResourcesClient) ListCompleteMatchingPredicate(ctx context.Context, id ApplicationGatewayId, predicate ApplicationGatewayPrivateLinkResourceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationGatewayPrivateLinkResource, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go deleted file mode 100644 index c3c4b5afa06..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go deleted file mode 100644 index 0f4b9748324..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/predicates.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/predicates.go deleted file mode 100644 index e93c21bb751..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package applicationgatewayprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkResourceOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ApplicationGatewayPrivateLinkResourceOperationPredicate) Matches(input ApplicationGatewayPrivateLinkResource) 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.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/network/2023-05-01/applicationgatewayprivatelinkresources/version.go b/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/version.go deleted file mode 100644 index 8669ea0279c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/README.md b/resource-manager/network/2023-05-01/applicationgateways/README.md deleted file mode 100644 index 7c3ace5c20d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/README.md +++ /dev/null @@ -1,287 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgateways` Documentation - -The `applicationgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/applicationgateways" -``` - - -### Client Initialization - -```go -client := applicationgateways.NewApplicationGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewaysClient.BackendHealth` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.BackendHealthThenPoll(ctx, id, applicationgateways.DefaultBackendHealthOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.BackendHealthOnDemand` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.ApplicationGatewayOnDemandProbe{ - // ... -} - - -if err := client.BackendHealthOnDemandThenPoll(ctx, id, payload, applicationgateways.DefaultBackendHealthOnDemandOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.ApplicationGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Get` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -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: `ApplicationGatewaysClient.GetSslPredefinedPolicy` - -```go -ctx := context.TODO() -id := applicationgateways.NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue") - -read, err := client.GetSslPredefinedPolicy(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ApplicationGatewaysClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableRequestHeaders` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableRequestHeaders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableResponseHeaders` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableResponseHeaders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableServerVariables` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableServerVariables(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableSslOptions` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableSslOptions(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAvailableSslPredefinedPolicies(ctx, id)` can be used to do batched pagination -items, err := client.ListAvailableSslPredefinedPoliciesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableWafRuleSets` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableWafRuleSets(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Start` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Stop` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.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/network/2023-05-01/applicationgateways/client.go b/resource-manager/network/2023-05-01/applicationgateways/client.go deleted file mode 100644 index 9608bf47106..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgateways - -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 ApplicationGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewaysClient: %+v", err) - } - - return &ApplicationGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/constants.go b/resource-manager/network/2023-05-01/applicationgateways/constants.go deleted file mode 100644 index 7fe9ed5e6fa..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/constants.go +++ /dev/null @@ -1,2119 +0,0 @@ -package applicationgateways - -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 ApplicationGatewayBackendHealthServerHealth string - -const ( - ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" - ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" - ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" - ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" -) - -func PossibleValuesForApplicationGatewayBackendHealthServerHealth() []string { - return []string{ - string(ApplicationGatewayBackendHealthServerHealthDown), - string(ApplicationGatewayBackendHealthServerHealthDraining), - string(ApplicationGatewayBackendHealthServerHealthPartial), - string(ApplicationGatewayBackendHealthServerHealthUnknown), - string(ApplicationGatewayBackendHealthServerHealthUp), - } -} - -func (s *ApplicationGatewayBackendHealthServerHealth) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayBackendHealthServerHealth(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayBackendHealthServerHealth(input string) (*ApplicationGatewayBackendHealthServerHealth, error) { - vals := map[string]ApplicationGatewayBackendHealthServerHealth{ - "down": ApplicationGatewayBackendHealthServerHealthDown, - "draining": ApplicationGatewayBackendHealthServerHealthDraining, - "partial": ApplicationGatewayBackendHealthServerHealthPartial, - "unknown": ApplicationGatewayBackendHealthServerHealthUnknown, - "up": ApplicationGatewayBackendHealthServerHealthUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayBackendHealthServerHealth(input) - return &out, nil -} - -type ApplicationGatewayClientRevocationOptions string - -const ( - ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" - ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { - return []string{ - string(ApplicationGatewayClientRevocationOptionsNone), - string(ApplicationGatewayClientRevocationOptionsOCSP), - } -} - -func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayClientRevocationOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { - vals := map[string]ApplicationGatewayClientRevocationOptions{ - "none": ApplicationGatewayClientRevocationOptionsNone, - "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayClientRevocationOptions(input) - return &out, nil -} - -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { - return []string{ - string(ApplicationGatewayCookieBasedAffinityDisabled), - string(ApplicationGatewayCookieBasedAffinityEnabled), - } -} - -func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCookieBasedAffinity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { - vals := map[string]ApplicationGatewayCookieBasedAffinity{ - "disabled": ApplicationGatewayCookieBasedAffinityDisabled, - "enabled": ApplicationGatewayCookieBasedAffinityEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCookieBasedAffinity(input) - return &out, nil -} - -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" -) - -func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { - return []string{ - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), - } -} - -func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { - vals := map[string]ApplicationGatewayCustomErrorStatusCode{ - "httpstatus500": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred, - "httpstatus504": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour, - "httpstatus503": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree, - "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, - "httpstatus400": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred, - "httpstatus408": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight, - "httpstatus405": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive, - "httpstatus404": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour, - "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCustomErrorStatusCode(input) - return &out, nil -} - -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -func PossibleValuesForApplicationGatewayFirewallMode() []string { - return []string{ - string(ApplicationGatewayFirewallModeDetection), - string(ApplicationGatewayFirewallModePrevention), - } -} - -func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { - vals := map[string]ApplicationGatewayFirewallMode{ - "detection": ApplicationGatewayFirewallModeDetection, - "prevention": ApplicationGatewayFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallMode(input) - return &out, nil -} - -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { - return []string{ - string(ApplicationGatewayLoadDistributionAlgorithmIPHash), - string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), - string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - } -} - -func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { - vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ - "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, - "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayLoadDistributionAlgorithm(input) - return &out, nil -} - -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -func PossibleValuesForApplicationGatewayOperationalState() []string { - return []string{ - string(ApplicationGatewayOperationalStateRunning), - string(ApplicationGatewayOperationalStateStarting), - string(ApplicationGatewayOperationalStateStopped), - string(ApplicationGatewayOperationalStateStopping), - } -} - -func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayOperationalState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { - vals := map[string]ApplicationGatewayOperationalState{ - "running": ApplicationGatewayOperationalStateRunning, - "starting": ApplicationGatewayOperationalStateStarting, - "stopped": ApplicationGatewayOperationalStateStopped, - "stopping": ApplicationGatewayOperationalStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayOperationalState(input) - return &out, nil -} - -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" -) - -func PossibleValuesForApplicationGatewayProtocol() []string { - return []string{ - string(ApplicationGatewayProtocolHTTP), - string(ApplicationGatewayProtocolHTTPS), - string(ApplicationGatewayProtocolTcp), - string(ApplicationGatewayProtocolTls), - } -} - -func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { - vals := map[string]ApplicationGatewayProtocol{ - "http": ApplicationGatewayProtocolHTTP, - "https": ApplicationGatewayProtocolHTTPS, - "tcp": ApplicationGatewayProtocolTcp, - "tls": ApplicationGatewayProtocolTls, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayProtocol(input) - return &out, nil -} - -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -func PossibleValuesForApplicationGatewayRedirectType() []string { - return []string{ - string(ApplicationGatewayRedirectTypeFound), - string(ApplicationGatewayRedirectTypePermanent), - string(ApplicationGatewayRedirectTypeSeeOther), - string(ApplicationGatewayRedirectTypeTemporary), - } -} - -func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRedirectType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { - vals := map[string]ApplicationGatewayRedirectType{ - "found": ApplicationGatewayRedirectTypeFound, - "permanent": ApplicationGatewayRedirectTypePermanent, - "seeother": ApplicationGatewayRedirectTypeSeeOther, - "temporary": ApplicationGatewayRedirectTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRedirectType(input) - return &out, nil -} - -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { - return []string{ - string(ApplicationGatewayRequestRoutingRuleTypeBasic), - string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - } -} - -func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { - vals := map[string]ApplicationGatewayRequestRoutingRuleType{ - "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, - "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRequestRoutingRuleType(input) - return &out, nil -} - -type ApplicationGatewaySkuName string - -const ( - ApplicationGatewaySkuNameBasic ApplicationGatewaySkuName = "Basic" - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" -) - -func PossibleValuesForApplicationGatewaySkuName() []string { - return []string{ - string(ApplicationGatewaySkuNameBasic), - string(ApplicationGatewaySkuNameStandardLarge), - string(ApplicationGatewaySkuNameStandardMedium), - string(ApplicationGatewaySkuNameStandardSmall), - string(ApplicationGatewaySkuNameStandardVTwo), - string(ApplicationGatewaySkuNameWAFLarge), - string(ApplicationGatewaySkuNameWAFMedium), - string(ApplicationGatewaySkuNameWAFVTwo), - } -} - -func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { - vals := map[string]ApplicationGatewaySkuName{ - "basic": ApplicationGatewaySkuNameBasic, - "standard_large": ApplicationGatewaySkuNameStandardLarge, - "standard_medium": ApplicationGatewaySkuNameStandardMedium, - "standard_small": ApplicationGatewaySkuNameStandardSmall, - "standard_v2": ApplicationGatewaySkuNameStandardVTwo, - "waf_large": ApplicationGatewaySkuNameWAFLarge, - "waf_medium": ApplicationGatewaySkuNameWAFMedium, - "waf_v2": ApplicationGatewaySkuNameWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySkuName(input) - return &out, nil -} - -type ApplicationGatewaySslCipherSuite string - -const ( - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -) - -func PossibleValuesForApplicationGatewaySslCipherSuite() []string { - return []string{ - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), - } -} - -func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslCipherSuite(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { - vals := map[string]ApplicationGatewaySslCipherSuite{ - "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, - "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, - "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, - "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, - "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, - "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, - "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslCipherSuite(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyName string - -const ( - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -func PossibleValuesForApplicationGatewaySslPolicyName() []string { - return []string{ - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), - } -} - -func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { - vals := map[string]ApplicationGatewaySslPolicyName{ - "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, - "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, - "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, - "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, - "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyName(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyType string - -const ( - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" -) - -func PossibleValuesForApplicationGatewaySslPolicyType() []string { - return []string{ - string(ApplicationGatewaySslPolicyTypeCustom), - string(ApplicationGatewaySslPolicyTypeCustomVTwo), - string(ApplicationGatewaySslPolicyTypePredefined), - } -} - -func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { - vals := map[string]ApplicationGatewaySslPolicyType{ - "custom": ApplicationGatewaySslPolicyTypeCustom, - "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, - "predefined": ApplicationGatewaySslPolicyTypePredefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyType(input) - return &out, nil -} - -type ApplicationGatewaySslProtocol string - -const ( - ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" - ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" - ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" - ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" -) - -func PossibleValuesForApplicationGatewaySslProtocol() []string { - return []string{ - string(ApplicationGatewaySslProtocolTLSvOneOne), - string(ApplicationGatewaySslProtocolTLSvOneThree), - string(ApplicationGatewaySslProtocolTLSvOneTwo), - string(ApplicationGatewaySslProtocolTLSvOneZero), - } -} - -func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { - vals := map[string]ApplicationGatewaySslProtocol{ - "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, - "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, - "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, - "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslProtocol(input) - return &out, nil -} - -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTier() []string { - return []string{ - string(ApplicationGatewayTierBasic), - string(ApplicationGatewayTierStandard), - string(ApplicationGatewayTierStandardVTwo), - string(ApplicationGatewayTierWAF), - string(ApplicationGatewayTierWAFVTwo), - } -} - -func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { - vals := map[string]ApplicationGatewayTier{ - "basic": ApplicationGatewayTierBasic, - "standard": ApplicationGatewayTierStandard, - "standard_v2": ApplicationGatewayTierStandardVTwo, - "waf": ApplicationGatewayTierWAF, - "waf_v2": ApplicationGatewayTierWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTier(input) - return &out, nil -} - -type ApplicationGatewayTierTypes string - -const ( - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" - ApplicationGatewayTierTypesStandardVTwo ApplicationGatewayTierTypes = "Standard_v2" - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - ApplicationGatewayTierTypesWAFVTwo ApplicationGatewayTierTypes = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTierTypes() []string { - return []string{ - string(ApplicationGatewayTierTypesStandard), - string(ApplicationGatewayTierTypesStandardVTwo), - string(ApplicationGatewayTierTypesWAF), - string(ApplicationGatewayTierTypesWAFVTwo), - } -} - -func (s *ApplicationGatewayTierTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTierTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTierTypes(input string) (*ApplicationGatewayTierTypes, error) { - vals := map[string]ApplicationGatewayTierTypes{ - "standard": ApplicationGatewayTierTypesStandard, - "standard_v2": ApplicationGatewayTierTypesStandardVTwo, - "waf": ApplicationGatewayTierTypesWAF, - "waf_v2": ApplicationGatewayTierTypesWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTierTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleActionTypes string - -const ( - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" - ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" -) - -func PossibleValuesForApplicationGatewayWafRuleActionTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleActionTypesAllow), - string(ApplicationGatewayWafRuleActionTypesAnomalyScoring), - string(ApplicationGatewayWafRuleActionTypesBlock), - string(ApplicationGatewayWafRuleActionTypesLog), - string(ApplicationGatewayWafRuleActionTypesNone), - } -} - -func (s *ApplicationGatewayWafRuleActionTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleActionTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleActionTypes(input string) (*ApplicationGatewayWafRuleActionTypes, error) { - vals := map[string]ApplicationGatewayWafRuleActionTypes{ - "allow": ApplicationGatewayWafRuleActionTypesAllow, - "anomalyscoring": ApplicationGatewayWafRuleActionTypesAnomalyScoring, - "block": ApplicationGatewayWafRuleActionTypesBlock, - "log": ApplicationGatewayWafRuleActionTypesLog, - "none": ApplicationGatewayWafRuleActionTypesNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleActionTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleStateTypes string - -const ( - ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" -) - -func PossibleValuesForApplicationGatewayWafRuleStateTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleStateTypesDisabled), - string(ApplicationGatewayWafRuleStateTypesEnabled), - } -} - -func (s *ApplicationGatewayWafRuleStateTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleStateTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleStateTypes(input string) (*ApplicationGatewayWafRuleStateTypes, error) { - vals := map[string]ApplicationGatewayWafRuleStateTypes{ - "disabled": ApplicationGatewayWafRuleStateTypesDisabled, - "enabled": ApplicationGatewayWafRuleStateTypesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleStateTypes(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway.go b/resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway.go deleted file mode 100644 index 0611edc8513..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationgateways - -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(&ApplicationGatewayId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayId{} - -// ApplicationGatewayId is a struct representing the Resource ID for a Application Gateway -type ApplicationGatewayId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string -} - -// NewApplicationGatewayID returns a new ApplicationGatewayId struct -func NewApplicationGatewayID(subscriptionId string, resourceGroupName string, applicationGatewayName string) ApplicationGatewayId { - return ApplicationGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - } -} - -// ParseApplicationGatewayID parses 'input' into a ApplicationGatewayId -func ParseApplicationGatewayID(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayIDInsensitively(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - return nil -} - -// ValidateApplicationGatewayID checks that 'input' can be parsed as a Application Gateway ID -func ValidateApplicationGatewayID(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 := ParseApplicationGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway ID -func (id ApplicationGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway ID -func (id ApplicationGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - } -} - -// String returns a human-readable description of this Application Gateway ID -func (id ApplicationGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - } - return fmt.Sprintf("Application Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway_test.go b/resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway_test.go deleted file mode 100644 index 9c3eeb06904..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/id_applicationgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationgateways - -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 = &ApplicationGatewayId{} - -func TestNewApplicationGatewayID(t *testing.T) { - id := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } -} - -func TestFormatApplicationGatewayID(t *testing.T) { - actual := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestParseApplicationGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestSegmentsForApplicationGatewayId(t *testing.T) { - segments := ApplicationGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayId 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/network/2023-05-01/applicationgateways/id_predefinedpolicy.go b/resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy.go deleted file mode 100644 index f22e541bda3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy.go +++ /dev/null @@ -1,123 +0,0 @@ -package applicationgateways - -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(&PredefinedPolicyId{}) -} - -var _ resourceids.ResourceId = &PredefinedPolicyId{} - -// PredefinedPolicyId is a struct representing the Resource ID for a Predefined Policy -type PredefinedPolicyId struct { - SubscriptionId string - PredefinedPolicyName string -} - -// NewPredefinedPolicyID returns a new PredefinedPolicyId struct -func NewPredefinedPolicyID(subscriptionId string, predefinedPolicyName string) PredefinedPolicyId { - return PredefinedPolicyId{ - SubscriptionId: subscriptionId, - PredefinedPolicyName: predefinedPolicyName, - } -} - -// ParsePredefinedPolicyID parses 'input' into a PredefinedPolicyId -func ParsePredefinedPolicyID(input string) (*PredefinedPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&PredefinedPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PredefinedPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePredefinedPolicyIDInsensitively parses 'input' case-insensitively into a PredefinedPolicyId -// note: this method should only be used for API response data and not user input -func ParsePredefinedPolicyIDInsensitively(input string) (*PredefinedPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&PredefinedPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PredefinedPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PredefinedPolicyId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.PredefinedPolicyName, ok = input.Parsed["predefinedPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "predefinedPolicyName", input) - } - - return nil -} - -// ValidatePredefinedPolicyID checks that 'input' can be parsed as a Predefined Policy ID -func ValidatePredefinedPolicyID(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 := ParsePredefinedPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Predefined Policy ID -func (id PredefinedPolicyId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.PredefinedPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Predefined Policy ID -func (id PredefinedPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGatewayAvailableSslOptions", "applicationGatewayAvailableSslOptions", "applicationGatewayAvailableSslOptions"), - resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.StaticSegment("staticPredefinedPolicies", "predefinedPolicies", "predefinedPolicies"), - resourceids.UserSpecifiedSegment("predefinedPolicyName", "predefinedPolicyValue"), - } -} - -// String returns a human-readable description of this Predefined Policy ID -func (id PredefinedPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Predefined Policy Name: %q", id.PredefinedPolicyName), - } - return fmt.Sprintf("Predefined Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy_test.go b/resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy_test.go deleted file mode 100644 index 9ecaa5d023e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/id_predefinedpolicy_test.go +++ /dev/null @@ -1,267 +0,0 @@ -package applicationgateways - -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 = &PredefinedPolicyId{} - -func TestNewPredefinedPolicyID(t *testing.T) { - id := NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue") - - 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.PredefinedPolicyName != "predefinedPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'PredefinedPolicyName'", id.PredefinedPolicyName, "predefinedPolicyValue") - } -} - -func TestFormatPredefinedPolicyID(t *testing.T) { - actual := NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePredefinedPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PredefinedPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue", - Expected: &PredefinedPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PredefinedPolicyName: "predefinedPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePredefinedPolicyID(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.PredefinedPolicyName != v.Expected.PredefinedPolicyName { - t.Fatalf("Expected %q but got %q for PredefinedPolicyName", v.Expected.PredefinedPolicyName, actual.PredefinedPolicyName) - } - - } -} - -func TestParsePredefinedPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PredefinedPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt/pReDeFiNeDpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue", - Expected: &PredefinedPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PredefinedPolicyName: "predefinedPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt/pReDeFiNeDpOlIcIeS/pReDeFiNeDpOlIcYvAlUe", - Expected: &PredefinedPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PredefinedPolicyName: "pReDeFiNeDpOlIcYvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt/pReDeFiNeDpOlIcIeS/pReDeFiNeDpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePredefinedPolicyIDInsensitively(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.PredefinedPolicyName != v.Expected.PredefinedPolicyName { - t.Fatalf("Expected %q but got %q for PredefinedPolicyName", v.Expected.PredefinedPolicyName, actual.PredefinedPolicyName) - } - - } -} - -func TestSegmentsForPredefinedPolicyId(t *testing.T) { - segments := PredefinedPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PredefinedPolicyId 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/network/2023-05-01/applicationgateways/method_backendhealth.go b/resource-manager/network/2023-05-01/applicationgateways/method_backendhealth.go deleted file mode 100644 index bc7254fd7d6..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_backendhealth.go +++ /dev/null @@ -1,99 +0,0 @@ -package applicationgateways - -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 BackendHealthOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayBackendHealth -} - -type BackendHealthOperationOptions struct { - Expand *string -} - -func DefaultBackendHealthOperationOptions() BackendHealthOperationOptions { - return BackendHealthOperationOptions{} -} - -func (o BackendHealthOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o BackendHealthOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o BackendHealthOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// BackendHealth ... -func (c ApplicationGatewaysClient) BackendHealth(ctx context.Context, id ApplicationGatewayId, options BackendHealthOperationOptions) (result BackendHealthOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/backendhealth", id.ID()), - OptionsObject: options, - } - - 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 -} - -// BackendHealthThenPoll performs BackendHealth then polls until it's completed -func (c ApplicationGatewaysClient) BackendHealthThenPoll(ctx context.Context, id ApplicationGatewayId, options BackendHealthOperationOptions) error { - result, err := c.BackendHealth(ctx, id, options) - if err != nil { - return fmt.Errorf("performing BackendHealth: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after BackendHealth: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_backendhealthondemand.go b/resource-manager/network/2023-05-01/applicationgateways/method_backendhealthondemand.go deleted file mode 100644 index c99e1e55de2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_backendhealthondemand.go +++ /dev/null @@ -1,103 +0,0 @@ -package applicationgateways - -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 BackendHealthOnDemandOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayBackendHealthOnDemand -} - -type BackendHealthOnDemandOperationOptions struct { - Expand *string -} - -func DefaultBackendHealthOnDemandOperationOptions() BackendHealthOnDemandOperationOptions { - return BackendHealthOnDemandOperationOptions{} -} - -func (o BackendHealthOnDemandOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o BackendHealthOnDemandOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o BackendHealthOnDemandOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// BackendHealthOnDemand ... -func (c ApplicationGatewaysClient) BackendHealthOnDemand(ctx context.Context, id ApplicationGatewayId, input ApplicationGatewayOnDemandProbe, options BackendHealthOnDemandOperationOptions) (result BackendHealthOnDemandOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getBackendHealthOnDemand", id.ID()), - OptionsObject: options, - } - - 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 -} - -// BackendHealthOnDemandThenPoll performs BackendHealthOnDemand then polls until it's completed -func (c ApplicationGatewaysClient) BackendHealthOnDemandThenPoll(ctx context.Context, id ApplicationGatewayId, input ApplicationGatewayOnDemandProbe, options BackendHealthOnDemandOperationOptions) error { - result, err := c.BackendHealthOnDemand(ctx, id, input, options) - if err != nil { - return fmt.Errorf("performing BackendHealthOnDemand: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after BackendHealthOnDemand: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_createorupdate.go b/resource-manager/network/2023-05-01/applicationgateways/method_createorupdate.go deleted file mode 100644 index 66330483b32..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package applicationgateways - -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 *ApplicationGateway -} - -// CreateOrUpdate ... -func (c ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, id ApplicationGatewayId, input ApplicationGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ApplicationGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id ApplicationGatewayId, input ApplicationGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/applicationgateways/method_delete.go b/resource-manager/network/2023-05-01/applicationgateways/method_delete.go deleted file mode 100644 index 6769fa69c24..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applicationgateways - -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 ApplicationGatewaysClient) Delete(ctx context.Context, id ApplicationGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationGatewaysClient) DeleteThenPoll(ctx context.Context, id ApplicationGatewayId) 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/network/2023-05-01/applicationgateways/method_get.go b/resource-manager/network/2023-05-01/applicationgateways/method_get.go deleted file mode 100644 index 03000d91a47..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationgateways - -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 *ApplicationGateway -} - -// Get ... -func (c ApplicationGatewaysClient) Get(ctx context.Context, id ApplicationGatewayId) (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 ApplicationGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_getsslpredefinedpolicy.go b/resource-manager/network/2023-05-01/applicationgateways/method_getsslpredefinedpolicy.go deleted file mode 100644 index 97530703e81..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_getsslpredefinedpolicy.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationgateways - -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 GetSslPredefinedPolicyOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewaySslPredefinedPolicy -} - -// GetSslPredefinedPolicy ... -func (c ApplicationGatewaysClient) GetSslPredefinedPolicy(ctx context.Context, id PredefinedPolicyId) (result GetSslPredefinedPolicyOperationResponse, 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 ApplicationGatewaySslPredefinedPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_list.go b/resource-manager/network/2023-05-01/applicationgateways/method_list.go deleted file mode 100644 index 3770e6793df..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationgateways - -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 *[]ApplicationGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGateway -} - -// List ... -func (c ApplicationGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGateways", 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 *[]ApplicationGateway `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 ApplicationGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ApplicationGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/applicationgateways/method_listall.go b/resource-manager/network/2023-05-01/applicationgateways/method_listall.go deleted file mode 100644 index 486009336b4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationgateways - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationGateway -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGateway -} - -// ListAll ... -func (c ApplicationGatewaysClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGateways", 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 *[]ApplicationGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ApplicationGatewaysClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, ApplicationGatewayOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewaysClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplicationGatewayOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]ApplicationGateway, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablerequestheaders.go b/resource-manager/network/2023-05-01/applicationgateways/method_listavailablerequestheaders.go deleted file mode 100644 index 634799c7f70..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablerequestheaders.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableRequestHeadersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]string -} - -// ListAvailableRequestHeaders ... -func (c ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableRequestHeadersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders", 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 []string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_listavailableresponseheaders.go b/resource-manager/network/2023-05-01/applicationgateways/method_listavailableresponseheaders.go deleted file mode 100644 index fe99c70d2e7..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listavailableresponseheaders.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableResponseHeadersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]string -} - -// ListAvailableResponseHeaders ... -func (c ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableResponseHeadersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders", 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 []string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_listavailableservervariables.go b/resource-manager/network/2023-05-01/applicationgateways/method_listavailableservervariables.go deleted file mode 100644 index b48bb86d765..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listavailableservervariables.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableServerVariablesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]string -} - -// ListAvailableServerVariables ... -func (c ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableServerVariablesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableServerVariables", 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 []string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablessloptions.go b/resource-manager/network/2023-05-01/applicationgateways/method_listavailablessloptions.go deleted file mode 100644 index 386a33e5e84..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablessloptions.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableSslOptionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayAvailableSslOptions -} - -// ListAvailableSslOptions ... -func (c ApplicationGatewaysClient) ListAvailableSslOptions(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableSslOptionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/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 ApplicationGatewayAvailableSslOptions - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablesslpredefinedpolicies.go b/resource-manager/network/2023-05-01/applicationgateways/method_listavailablesslpredefinedpolicies.go deleted file mode 100644 index 8eb0fca135d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablesslpredefinedpolicies.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationgateways - -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 ListAvailableSslPredefinedPoliciesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationGatewaySslPredefinedPolicy -} - -type ListAvailableSslPredefinedPoliciesCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewaySslPredefinedPolicy -} - -// ListAvailableSslPredefinedPolicies ... -func (c ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableSslPredefinedPoliciesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", 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 *[]ApplicationGatewaySslPredefinedPolicy `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAvailableSslPredefinedPoliciesComplete retrieves all the results into a single object -func (c ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesComplete(ctx context.Context, id commonids.SubscriptionId) (ListAvailableSslPredefinedPoliciesCompleteResult, error) { - return c.ListAvailableSslPredefinedPoliciesCompleteMatchingPredicate(ctx, id, ApplicationGatewaySslPredefinedPolicyOperationPredicate{}) -} - -// ListAvailableSslPredefinedPoliciesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplicationGatewaySslPredefinedPolicyOperationPredicate) (result ListAvailableSslPredefinedPoliciesCompleteResult, err error) { - items := make([]ApplicationGatewaySslPredefinedPolicy, 0) - - resp, err := c.ListAvailableSslPredefinedPolicies(ctx, id) - if err != nil { - 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 = ListAvailableSslPredefinedPoliciesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablewafrulesets.go b/resource-manager/network/2023-05-01/applicationgateways/method_listavailablewafrulesets.go deleted file mode 100644 index 3df1a2db564..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_listavailablewafrulesets.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableWafRuleSetsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayAvailableWafRuleSetsResult -} - -// ListAvailableWafRuleSets ... -func (c ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableWafRuleSetsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets", 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 ApplicationGatewayAvailableWafRuleSetsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/method_start.go b/resource-manager/network/2023-05-01/applicationgateways/method_start.go deleted file mode 100644 index 828fc60cb3c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_start.go +++ /dev/null @@ -1,70 +0,0 @@ -package applicationgateways - -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 StartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Start ... -func (c ApplicationGatewaysClient) Start(ctx context.Context, id ApplicationGatewayId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ApplicationGatewaysClient) StartThenPoll(ctx context.Context, id ApplicationGatewayId) 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/network/2023-05-01/applicationgateways/method_stop.go b/resource-manager/network/2023-05-01/applicationgateways/method_stop.go deleted file mode 100644 index 75b68cdf697..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package applicationgateways - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c ApplicationGatewaysClient) Stop(ctx context.Context, id ApplicationGatewayId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ApplicationGatewaysClient) StopThenPoll(ctx context.Context, id ApplicationGatewayId) 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/network/2023-05-01/applicationgateways/method_updatetags.go b/resource-manager/network/2023-05-01/applicationgateways/method_updatetags.go deleted file mode 100644 index d22b3615559..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package applicationgateways - -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 *ApplicationGateway -} - -// UpdateTags ... -func (c ApplicationGatewaysClient) UpdateTags(ctx context.Context, id ApplicationGatewayId, 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 ApplicationGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgateway.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgateway.go deleted file mode 100644 index 26c26a88927..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgateway.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "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 ApplicationGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go deleted file mode 100644 index 21a1fec007f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go deleted file mode 100644 index 37f5189d68a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go deleted file mode 100644 index e8f13521e07..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAutoscaleConfiguration struct { - MaxCapacity *int64 `json:"maxCapacity,omitempty"` - MinCapacity int64 `json:"minCapacity"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptions.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptions.go deleted file mode 100644 index 18677bfa9ad..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptions.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAvailableSslOptions struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go deleted file mode 100644 index 552b956629b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { - AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` - AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` - DefaultPolicy *ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` - PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go deleted file mode 100644 index b960a888077..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAvailableWafRuleSetsResult struct { - Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 9245b4581ff..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index e62cc5f5a6a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 92e4b6fcae0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealth.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealth.go deleted file mode 100644 index b8439220957..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealth.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealth struct { - BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go deleted file mode 100644 index 00f4c87c142..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthHTTPSettings struct { - BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` - Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go deleted file mode 100644 index 3bf6d17e80c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthOnDemand struct { - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthpool.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthpool.go deleted file mode 100644 index b32fffdf614..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthpool.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthPool struct { - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthserver.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthserver.go deleted file mode 100644 index c11aed154b2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhealthserver.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthServer struct { - Address *string `json:"address,omitempty"` - Health *ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` - HealthProbeLog *string `json:"healthProbeLog,omitempty"` - IPConfiguration *NetworkInterfaceIPConfiguration `json:"ipConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go deleted file mode 100644 index 7cfbecd3506..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go deleted file mode 100644 index 68ccfd35301..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - CookieBasedAffinity *ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - HostName *string `json:"hostName,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestTimeout *int64 `json:"requestTimeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettings.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettings.go deleted file mode 100644 index 435626e7296..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go deleted file mode 100644 index 5d5c1275f2e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - HostName *string `json:"hostName,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go deleted file mode 100644 index 7be179f89f0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayClientAuthConfiguration struct { - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` - VerifyClientRevocation *ApplicationGatewayClientRevocationOptions `json:"verifyClientRevocation,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayconnectiondraining.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayconnectiondraining.go deleted file mode 100644 index f40777a88f8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayconnectiondraining.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayConnectionDraining struct { - DrainTimeoutInSec int64 `json:"drainTimeoutInSec"` - Enabled bool `json:"enabled"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaycustomerror.go deleted file mode 100644 index 532de5a8e93..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaycustomerror.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` - StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go deleted file mode 100644 index 30534c50f52..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallDisabledRuleGroup struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]int64 `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallexclusion.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallexclusion.go deleted file mode 100644 index 77bfe2cf65c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallexclusion.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallExclusion struct { - MatchVariable string `json:"matchVariable"` - Selector string `json:"selector"` - SelectorMatchOperator string `json:"selectorMatchOperator"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrule.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrule.go deleted file mode 100644 index c9a89bac633..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRule struct { - Action *ApplicationGatewayWafRuleActionTypes `json:"action,omitempty"` - Description *string `json:"description,omitempty"` - RuleId int64 `json:"ruleId"` - RuleIdString *string `json:"ruleIdString,omitempty"` - State *ApplicationGatewayWafRuleStateTypes `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go deleted file mode 100644 index 06c7cbffb38..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleGroup struct { - Description *string `json:"description,omitempty"` - RuleGroupName string `json:"ruleGroupName"` - Rules []ApplicationGatewayFirewallRule `json:"rules"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallruleset.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallruleset.go deleted file mode 100644 index 3eb74351624..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallruleset.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleSet struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go deleted file mode 100644 index f0bd967c325..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleGroups []ApplicationGatewayFirewallRuleGroup `json:"ruleGroups"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` - Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go deleted file mode 100644 index 16f3a44fe68..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go deleted file mode 100644 index 45f83bbaa11..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendport.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendport.go deleted file mode 100644 index 9b3c8763e01..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendport.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go deleted file mode 100644 index a9399610b8b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPortPropertiesFormat struct { - Port *int64 `json:"port,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayglobalconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayglobalconfiguration.go deleted file mode 100644 index 8f031b6ad38..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayglobalconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayGlobalConfiguration struct { - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayheaderconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayheaderconfiguration.go deleted file mode 100644 index cf7e02d4617..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayheaderconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHeaderConfiguration struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistener.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistener.go deleted file mode 100644 index 457c3af7d7b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go deleted file mode 100644 index 7d3436f6186..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - HostName *string `json:"hostName,omitempty"` - HostNames *[]string `json:"hostNames,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 7b513c56359..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 67b2b22486e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistener.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistener.go deleted file mode 100644 index eb251dad173..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go deleted file mode 100644 index fc21e21099b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListenerPropertiesFormat struct { - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go deleted file mode 100644 index 9c07ad54259..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go deleted file mode 100644 index 9ae762454d0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { - LoadDistributionAlgorithm *ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` - LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go deleted file mode 100644 index 5db29bd27a5..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTarget struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go deleted file mode 100644 index cd785c4126e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - WeightPerServer *int64 `json:"weightPerServer,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayondemandprobe.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayondemandprobe.go deleted file mode 100644 index 6ee19e174e2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayondemandprobe.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayOnDemandProbe struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - Host *string `json:"host,omitempty"` - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrule.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrule.go deleted file mode 100644 index ae684eb5860..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go deleted file mode 100644 index c0586444c85..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Paths *[]string `json:"paths,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index 8099219aff4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go deleted file mode 100644 index 400c841d704..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go deleted file mode 100644 index 1997234fb4d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go deleted file mode 100644 index b86b3f17014..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go deleted file mode 100644 index ad8bfa28be7..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go deleted file mode 100644 index b2d2b2af23a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobe.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobe.go deleted file mode 100644 index 9b27b4f7133..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobe.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go deleted file mode 100644 index 68ccf1eaaaf..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbeHealthResponseMatch struct { - Body *string `json:"body,omitempty"` - StatusCodes *[]string `json:"statusCodes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go deleted file mode 100644 index dab5ee7ae23..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbePropertiesFormat struct { - Host *string `json:"host,omitempty"` - Interval *int64 `json:"interval,omitempty"` - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - MinServers *int64 `json:"minServers,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - UnhealthyThreshold *int64 `json:"unhealthyThreshold,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypropertiesformat.go deleted file mode 100644 index 1332febd49d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ /dev/null @@ -1,43 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPropertiesFormat struct { - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - DefaultPredefinedSslPolicy *ApplicationGatewaySslPolicyName `json:"defaultPredefinedSslPolicy,omitempty"` - EnableFips *bool `json:"enableFips,omitempty"` - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfiguration.go deleted file mode 100644 index 99a2df5f0de..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go deleted file mode 100644 index 07b97214f7f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - IncludePath *bool `json:"includePath,omitempty"` - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - PathRules *[]SubResource `json:"pathRules,omitempty"` - RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` - TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` - UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrule.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrule.go deleted file mode 100644 index 8968674820d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go deleted file mode 100644 index d7ab0f3f4d9..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - HTTPListener *SubResource `json:"httpListener,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - UrlPathMap *SubResource `json:"urlPathMap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterule.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterule.go deleted file mode 100644 index 6ce3b9a1f5d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterule.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRule struct { - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` - Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - Name *string `json:"name,omitempty"` - RuleSequence *int64 `json:"ruleSequence,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go deleted file mode 100644 index 02be2e1f37b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleActionSet struct { - RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulecondition.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulecondition.go deleted file mode 100644 index c7e6af3b85a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulecondition.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleCondition struct { - IgnoreCase *bool `json:"ignoreCase,omitempty"` - Negate *bool `json:"negate,omitempty"` - Pattern *string `json:"pattern,omitempty"` - Variable *string `json:"variable,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleset.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleset.go deleted file mode 100644 index 571e9038508..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriteruleset.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go deleted file mode 100644 index 031206c13ce..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrule.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrule.go deleted file mode 100644 index 448709de6b4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go deleted file mode 100644 index 5be00552534..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendSettings *SubResource `json:"backendSettings,omitempty"` - Listener *SubResource `json:"listener,omitempty"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysku.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysku.go deleted file mode 100644 index 99350cf8ec7..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *ApplicationGatewaySkuName `json:"name,omitempty"` - Tier *ApplicationGatewayTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificate.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificate.go deleted file mode 100644 index 1f589867862..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go deleted file mode 100644 index 1c92efb93bd..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - Password *string `json:"password,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpolicy.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpolicy.go deleted file mode 100644 index be42ac49a18..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPolicy struct { - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - MinProtocolVersion *ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` - PolicyName *ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` - PolicyType *ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go deleted file mode 100644 index a7932dc66db..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPredefinedPolicy struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go deleted file mode 100644 index 15702750dea..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - MinProtocolVersion *ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofile.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofile.go deleted file mode 100644 index 609877668f8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go deleted file mode 100644 index a7c5ae2c883..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfilePropertiesFormat struct { - ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - TrustedClientCertificates *[]SubResource `json:"trustedClientCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go deleted file mode 100644 index 731b46860d7..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedClientCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go deleted file mode 100644 index 67b5d91461d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { - ClientCertIssuerDN *string `json:"clientCertIssuerDN,omitempty"` - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ValidatedCertData *string `json:"validatedCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go deleted file mode 100644 index 12343718b35..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go deleted file mode 100644 index 7aeb8e0a84e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlconfiguration.go deleted file mode 100644 index 18491c35f12..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlConfiguration struct { - ModifiedPath *string `json:"modifiedPath,omitempty"` - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - Reroute *bool `json:"reroute,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmap.go deleted file mode 100644 index 5fc06877578..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmap.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go deleted file mode 100644 index ef8e7e8e02f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMapPropertiesFormat struct { - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go deleted file mode 100644 index 561512df449..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - Enabled bool `json:"enabled"` - Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode"` - MaxRequestBodySize *int64 `json:"maxRequestBodySize,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygroup.go deleted file mode 100644 index 71e4f60a5a0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index c8593cff776..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspool.go b/resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspool.go deleted file mode 100644 index 1a7d2037c67..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 74aca7bc73d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 821207ea54b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_ddossettings.go b/resource-manager/network/2023-05-01/applicationgateways/model_ddossettings.go deleted file mode 100644 index afe28edd8fc..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_delegation.go b/resource-manager/network/2023-05-01/applicationgateways/model_delegation.go deleted file mode 100644 index dde48e048ee..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_flowlog.go b/resource-manager/network/2023-05-01/applicationgateways/model_flowlog.go deleted file mode 100644 index 8d1c520da14..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/applicationgateways/model_flowlogformatparameters.go deleted file mode 100644 index 79d541b9318..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_flowlogpropertiesformat.go deleted file mode 100644 index 666f7fd230f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfiguration.go deleted file mode 100644 index 6af1ef34991..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index dfcbf3e5aca..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 81f73592309..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrule.go b/resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrule.go deleted file mode 100644 index e8326d63cdd..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index e68b37342b3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_ipconfiguration.go deleted file mode 100644 index 3035f84c596..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofile.go deleted file mode 100644 index edb884d2718..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1c6df0dcda2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 5de8de82f9e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_iptag.go b/resource-manager/network/2023-05-01/applicationgateways/model_iptag.go deleted file mode 100644 index e423a8c0593..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// 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/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddress.go deleted file mode 100644 index a4bb848daa5..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index ab1822cd6b6..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_natgateway.go b/resource-manager/network/2023-05-01/applicationgateways/model_natgateway.go deleted file mode 100644 index eb51b102cad..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package applicationgateways - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_natgatewaypropertiesformat.go deleted file mode 100644 index 21ac8a2eca2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_natgatewaysku.go b/resource-manager/network/2023-05-01/applicationgateways/model_natgatewaysku.go deleted file mode 100644 index 54ee08d2498..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_natruleportmapping.go b/resource-manager/network/2023-05-01/applicationgateways/model_natruleportmapping.go deleted file mode 100644 index 1ca2ef21443..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterface.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterface.go deleted file mode 100644 index 73b1cb41a52..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacednssettings.go deleted file mode 100644 index 92961ce7d04..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 1be55bfe469..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index fed49bbe9de..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 70234aeb42f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 302d4c3283d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 8dc17186426..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 199c278ace0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygroup.go deleted file mode 100644 index 14268c44ed0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index e16fb5f6fb3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpoint.go b/resource-manager/network/2023-05-01/applicationgateways/model_privateendpoint.go deleted file mode 100644 index 4ec26559664..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnection.go deleted file mode 100644 index 72911c666f8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/applicationgateways/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnectionproperties.go deleted file mode 100644 index baec08812d8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfiguration.go deleted file mode 100644 index 7cae9c3cf71..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index f1f5adead63..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointproperties.go deleted file mode 100644 index 832b7f18a5d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkservice.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkservice.go deleted file mode 100644 index 238c6ee31c6..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnection.go deleted file mode 100644 index ee88d81eb06..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 26b1b21ad32..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 2d2970905b0..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 18d6fcdf24d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 02fc04bab97..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceproperties.go deleted file mode 100644 index eb543330122..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddress.go b/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddress.go deleted file mode 100644 index c17efae3e57..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddressdnssettings.go deleted file mode 100644 index 4aeba6f0581..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresspropertiesformat.go deleted file mode 100644 index d714bdf3daa..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresssku.go deleted file mode 100644 index 976ba6d175a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlink.go deleted file mode 100644 index 0aeedfe5241..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlinkformat.go deleted file mode 100644 index 540e9b96c41..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_resourceset.go b/resource-manager/network/2023-05-01/applicationgateways/model_resourceset.go deleted file mode 100644 index 05c6f87a097..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/applicationgateways/model_retentionpolicyparameters.go deleted file mode 100644 index aed6889cbab..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_route.go b/resource-manager/network/2023-05-01/applicationgateways/model_route.go deleted file mode 100644 index 8b16e63b0d4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_routepropertiesformat.go deleted file mode 100644 index e5c5f698874..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_routetable.go b/resource-manager/network/2023-05-01/applicationgateways/model_routetable.go deleted file mode 100644 index 6b3d63e8b6c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_routetablepropertiesformat.go deleted file mode 100644 index af2c694b5db..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_securityrule.go b/resource-manager/network/2023-05-01/applicationgateways/model_securityrule.go deleted file mode 100644 index ef187da7432..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_securityrulepropertiesformat.go deleted file mode 100644 index c96607c5d20..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlink.go deleted file mode 100644 index fcd770e8b43..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 74146988caf..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 508b02893d3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicy.go deleted file mode 100644 index 3c9d04af717..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 3c52f56e9ea..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 0ccd3a839f3..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index edd49bd36a4..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5cae7444005..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_subnet.go b/resource-manager/network/2023-05-01/applicationgateways/model_subnet.go deleted file mode 100644 index 9bad3a3150c..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_subnetpropertiesformat.go deleted file mode 100644 index ef5a25aa181..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_subresource.go b/resource-manager/network/2023-05-01/applicationgateways/model_subresource.go deleted file mode 100644 index 5e7297f22b2..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_tagsobject.go b/resource-manager/network/2023-05-01/applicationgateways/model_tagsobject.go deleted file mode 100644 index d5962ed5647..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// 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/network/2023-05-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 65767115778..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsproperties.go deleted file mode 100644 index b9b39e7b346..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktap.go deleted file mode 100644 index 610065f3a8a..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index a7db53f1629..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/predicates.go b/resource-manager/network/2023-05-01/applicationgateways/predicates.go deleted file mode 100644 index c51e6f7b000..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/predicates.go +++ /dev/null @@ -1,55 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ApplicationGatewayOperationPredicate) Matches(input ApplicationGateway) 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 && (input.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 ApplicationGatewaySslPredefinedPolicyOperationPredicate struct { - Id *string - Name *string -} - -func (p ApplicationGatewaySslPredefinedPolicyOperationPredicate) Matches(input ApplicationGatewaySslPredefinedPolicy) 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 - } - - return true -} diff --git a/resource-manager/network/2023-05-01/applicationgateways/version.go b/resource-manager/network/2023-05-01/applicationgateways/version.go deleted file mode 100644 index fe474d56c79..00000000000 --- a/resource-manager/network/2023-05-01/applicationgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/README.md deleted file mode 100644 index 87350c02212..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests` Documentation - -The `applicationgatewaywafdynamicmanifests` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/applicationgatewaywafdynamicmanifests" -``` - - -### Client Initialization - -```go -client := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.DefaultGet` - -```go -ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.DefaultGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.Get` - -```go -ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.Get(ctx, id)` can be used to do batched pagination -items, err := client.GetComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/client.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/client.go deleted file mode 100644 index 507d8e55929..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 ApplicationGatewayWafDynamicManifestsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewayWafDynamicManifestsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgatewaywafdynamicmanifests", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewayWafDynamicManifestsClient: %+v", err) - } - - return &ApplicationGatewayWafDynamicManifestsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/constants.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/constants.go deleted file mode 100644 index 0d7db7ea47d..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/constants.go +++ /dev/null @@ -1,195 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 ApplicationGatewayRuleSetStatusOptions string - -const ( - ApplicationGatewayRuleSetStatusOptionsDeprecated ApplicationGatewayRuleSetStatusOptions = "Deprecated" - ApplicationGatewayRuleSetStatusOptionsGA ApplicationGatewayRuleSetStatusOptions = "GA" - ApplicationGatewayRuleSetStatusOptionsPreview ApplicationGatewayRuleSetStatusOptions = "Preview" - ApplicationGatewayRuleSetStatusOptionsSupported ApplicationGatewayRuleSetStatusOptions = "Supported" -) - -func PossibleValuesForApplicationGatewayRuleSetStatusOptions() []string { - return []string{ - string(ApplicationGatewayRuleSetStatusOptionsDeprecated), - string(ApplicationGatewayRuleSetStatusOptionsGA), - string(ApplicationGatewayRuleSetStatusOptionsPreview), - string(ApplicationGatewayRuleSetStatusOptionsSupported), - } -} - -func (s *ApplicationGatewayRuleSetStatusOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRuleSetStatusOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRuleSetStatusOptions(input string) (*ApplicationGatewayRuleSetStatusOptions, error) { - vals := map[string]ApplicationGatewayRuleSetStatusOptions{ - "deprecated": ApplicationGatewayRuleSetStatusOptionsDeprecated, - "ga": ApplicationGatewayRuleSetStatusOptionsGA, - "preview": ApplicationGatewayRuleSetStatusOptionsPreview, - "supported": ApplicationGatewayRuleSetStatusOptionsSupported, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRuleSetStatusOptions(input) - return &out, nil -} - -type ApplicationGatewayTierTypes string - -const ( - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" - ApplicationGatewayTierTypesStandardVTwo ApplicationGatewayTierTypes = "Standard_v2" - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - ApplicationGatewayTierTypesWAFVTwo ApplicationGatewayTierTypes = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTierTypes() []string { - return []string{ - string(ApplicationGatewayTierTypesStandard), - string(ApplicationGatewayTierTypesStandardVTwo), - string(ApplicationGatewayTierTypesWAF), - string(ApplicationGatewayTierTypesWAFVTwo), - } -} - -func (s *ApplicationGatewayTierTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTierTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTierTypes(input string) (*ApplicationGatewayTierTypes, error) { - vals := map[string]ApplicationGatewayTierTypes{ - "standard": ApplicationGatewayTierTypesStandard, - "standard_v2": ApplicationGatewayTierTypesStandardVTwo, - "waf": ApplicationGatewayTierTypesWAF, - "waf_v2": ApplicationGatewayTierTypesWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTierTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleActionTypes string - -const ( - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" - ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" -) - -func PossibleValuesForApplicationGatewayWafRuleActionTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleActionTypesAllow), - string(ApplicationGatewayWafRuleActionTypesAnomalyScoring), - string(ApplicationGatewayWafRuleActionTypesBlock), - string(ApplicationGatewayWafRuleActionTypesLog), - string(ApplicationGatewayWafRuleActionTypesNone), - } -} - -func (s *ApplicationGatewayWafRuleActionTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleActionTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleActionTypes(input string) (*ApplicationGatewayWafRuleActionTypes, error) { - vals := map[string]ApplicationGatewayWafRuleActionTypes{ - "allow": ApplicationGatewayWafRuleActionTypesAllow, - "anomalyscoring": ApplicationGatewayWafRuleActionTypesAnomalyScoring, - "block": ApplicationGatewayWafRuleActionTypesBlock, - "log": ApplicationGatewayWafRuleActionTypesLog, - "none": ApplicationGatewayWafRuleActionTypesNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleActionTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleStateTypes string - -const ( - ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" -) - -func PossibleValuesForApplicationGatewayWafRuleStateTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleStateTypesDisabled), - string(ApplicationGatewayWafRuleStateTypesEnabled), - } -} - -func (s *ApplicationGatewayWafRuleStateTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleStateTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleStateTypes(input string) (*ApplicationGatewayWafRuleStateTypes, error) { - vals := map[string]ApplicationGatewayWafRuleStateTypes{ - "disabled": ApplicationGatewayWafRuleStateTypesDisabled, - "enabled": ApplicationGatewayWafRuleStateTypesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleStateTypes(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location.go deleted file mode 100644 index 03b931e4e2f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location_test.go deleted file mode 100644 index e88af2f1854..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_defaultget.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_defaultget.go deleted file mode 100644 index 0a6682174de..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_defaultget.go +++ /dev/null @@ -1,55 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 DefaultGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayWafDynamicManifestResult -} - -// DefaultGet ... -func (c ApplicationGatewayWafDynamicManifestsClient) DefaultGet(ctx context.Context, id LocationId) (result DefaultGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/applicationGatewayWafDynamicManifests/dafault", 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 ApplicationGatewayWafDynamicManifestResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_get.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_get.go deleted file mode 100644 index 7bcff9d682b..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/method_get.go +++ /dev/null @@ -1,91 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationGatewayWafDynamicManifestResult -} - -type GetCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewayWafDynamicManifestResult -} - -// Get ... -func (c ApplicationGatewayWafDynamicManifestsClient) Get(ctx context.Context, id LocationId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/applicationGatewayWafDynamicManifests", 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 *[]ApplicationGatewayWafDynamicManifestResult `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetComplete retrieves all the results into a single object -func (c ApplicationGatewayWafDynamicManifestsClient) GetComplete(ctx context.Context, id LocationId) (GetCompleteResult, error) { - return c.GetCompleteMatchingPredicate(ctx, id, ApplicationGatewayWafDynamicManifestResultOperationPredicate{}) -} - -// GetCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewayWafDynamicManifestsClient) GetCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate ApplicationGatewayWafDynamicManifestResultOperationPredicate) (result GetCompleteResult, err error) { - items := make([]ApplicationGatewayWafDynamicManifestResult, 0) - - resp, err := c.Get(ctx, id) - if err != nil { - 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 = GetCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go deleted file mode 100644 index 401a87a86a8..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallManifestRuleSet struct { - RuleGroups []ApplicationGatewayFirewallRuleGroup `json:"ruleGroups"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` - Status *ApplicationGatewayRuleSetStatusOptions `json:"status,omitempty"` - Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go deleted file mode 100644 index 723193ddc36..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRule struct { - Action *ApplicationGatewayWafRuleActionTypes `json:"action,omitempty"` - Description *string `json:"description,omitempty"` - RuleId int64 `json:"ruleId"` - RuleIdString *string `json:"ruleIdString,omitempty"` - State *ApplicationGatewayWafRuleStateTypes `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go deleted file mode 100644 index f9aefdfc147..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleGroup struct { - Description *string `json:"description,omitempty"` - RuleGroupName string `json:"ruleGroupName"` - Rules []ApplicationGatewayFirewallRule `json:"rules"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go deleted file mode 100644 index d68d61add58..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWafDynamicManifestPropertiesResult struct { - AvailableRuleSets *[]ApplicationGatewayFirewallManifestRuleSet `json:"availableRuleSets,omitempty"` - DefaultRuleSet *DefaultRuleSetPropertyFormat `json:"defaultRuleSet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go deleted file mode 100644 index 763ec4aad23..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWafDynamicManifestResult struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayWafDynamicManifestPropertiesResult `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go deleted file mode 100644 index b69c307217f..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultRuleSetPropertyFormat struct { - RuleSetType *string `json:"ruleSetType,omitempty"` - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/predicates.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/predicates.go deleted file mode 100644 index 9714d21637e..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWafDynamicManifestResultOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ApplicationGatewayWafDynamicManifestResultOperationPredicate) Matches(input ApplicationGatewayWafDynamicManifestResult) 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/network/2023-05-01/applicationgatewaywafdynamicmanifests/version.go b/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/version.go deleted file mode 100644 index 455edcdcece..00000000000 --- a/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewaywafdynamicmanifests/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/README.md b/resource-manager/network/2023-05-01/applicationsecuritygroups/README.md deleted file mode 100644 index 3c116773f87..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationsecuritygroups` Documentation - -The `applicationsecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/applicationsecuritygroups" -``` - - -### Client Initialization - -```go -client := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -payload := applicationsecuritygroups.ApplicationSecurityGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -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: `ApplicationSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ApplicationSecurityGroupsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.UpdateTags` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -payload := applicationsecuritygroups.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/network/2023-05-01/applicationsecuritygroups/client.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/client.go deleted file mode 100644 index e607d64a7d3..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationsecuritygroups - -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 ApplicationSecurityGroupsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationSecurityGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationSecurityGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationsecuritygroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationSecurityGroupsClient: %+v", err) - } - - return &ApplicationSecurityGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/constants.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/constants.go deleted file mode 100644 index a226eb6274e..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package applicationsecuritygroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup.go deleted file mode 100644 index a776d455c05..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationsecuritygroups - -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(&ApplicationSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &ApplicationSecurityGroupId{} - -// ApplicationSecurityGroupId is a struct representing the Resource ID for a Application Security Group -type ApplicationSecurityGroupId struct { - SubscriptionId string - ResourceGroupName string - ApplicationSecurityGroupName string -} - -// NewApplicationSecurityGroupID returns a new ApplicationSecurityGroupId struct -func NewApplicationSecurityGroupID(subscriptionId string, resourceGroupName string, applicationSecurityGroupName string) ApplicationSecurityGroupId { - return ApplicationSecurityGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationSecurityGroupName: applicationSecurityGroupName, - } -} - -// ParseApplicationSecurityGroupID parses 'input' into a ApplicationSecurityGroupId -func ParseApplicationSecurityGroupID(input string) (*ApplicationSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationSecurityGroupIDInsensitively parses 'input' case-insensitively into a ApplicationSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseApplicationSecurityGroupIDInsensitively(input string) (*ApplicationSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationSecurityGroupId) 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.ApplicationSecurityGroupName, ok = input.Parsed["applicationSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationSecurityGroupName", input) - } - - return nil -} - -// ValidateApplicationSecurityGroupID checks that 'input' can be parsed as a Application Security Group ID -func ValidateApplicationSecurityGroupID(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 := ParseApplicationSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Security Group ID -func (id ApplicationSecurityGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationSecurityGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Security Group ID -func (id ApplicationSecurityGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationSecurityGroups", "applicationSecurityGroups", "applicationSecurityGroups"), - resourceids.UserSpecifiedSegment("applicationSecurityGroupName", "applicationSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Application Security Group ID -func (id ApplicationSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Security Group Name: %q", id.ApplicationSecurityGroupName), - } - return fmt.Sprintf("Application Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go deleted file mode 100644 index 88b1a241a83..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationsecuritygroups - -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 = &ApplicationSecurityGroupId{} - -func TestNewApplicationSecurityGroupID(t *testing.T) { - id := NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - - 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.ApplicationSecurityGroupName != "applicationSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationSecurityGroupName'", id.ApplicationSecurityGroupName, "applicationSecurityGroupValue") - } -} - -func TestFormatApplicationSecurityGroupID(t *testing.T) { - actual := NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue", - Expected: &ApplicationSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationSecurityGroupName: "applicationSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationSecurityGroupID(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.ApplicationSecurityGroupName != v.Expected.ApplicationSecurityGroupName { - t.Fatalf("Expected %q but got %q for ApplicationSecurityGroupName", v.Expected.ApplicationSecurityGroupName, actual.ApplicationSecurityGroupName) - } - - } -} - -func TestParseApplicationSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnSeCuRiTyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue", - Expected: &ApplicationSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationSecurityGroupName: "applicationSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnSeCuRiTyGrOuPs/aPpLiCaTiOnSeCuRiTyGrOuPvAlUe", - Expected: &ApplicationSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationSecurityGroupName: "aPpLiCaTiOnSeCuRiTyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnSeCuRiTyGrOuPs/aPpLiCaTiOnSeCuRiTyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationSecurityGroupIDInsensitively(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.ApplicationSecurityGroupName != v.Expected.ApplicationSecurityGroupName { - t.Fatalf("Expected %q but got %q for ApplicationSecurityGroupName", v.Expected.ApplicationSecurityGroupName, actual.ApplicationSecurityGroupName) - } - - } -} - -func TestSegmentsForApplicationSecurityGroupId(t *testing.T) { - segments := ApplicationSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationSecurityGroupId 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/network/2023-05-01/applicationsecuritygroups/method_createorupdate.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/method_createorupdate.go deleted file mode 100644 index f2b60b46a6a..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package applicationsecuritygroups - -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 *ApplicationSecurityGroup -} - -// CreateOrUpdate ... -func (c ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context, id ApplicationSecurityGroupId, input ApplicationSecurityGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ApplicationSecurityGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id ApplicationSecurityGroupId, input ApplicationSecurityGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/applicationsecuritygroups/method_delete.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/method_delete.go deleted file mode 100644 index 6d16cb628e3..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applicationsecuritygroups - -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 ApplicationSecurityGroupsClient) Delete(ctx context.Context, id ApplicationSecurityGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationSecurityGroupsClient) DeleteThenPoll(ctx context.Context, id ApplicationSecurityGroupId) 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/network/2023-05-01/applicationsecuritygroups/method_get.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/method_get.go deleted file mode 100644 index 5990e4033ff..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationsecuritygroups - -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 *ApplicationSecurityGroup -} - -// Get ... -func (c ApplicationSecurityGroupsClient) Get(ctx context.Context, id ApplicationSecurityGroupId) (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 ApplicationSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_list.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/method_list.go deleted file mode 100644 index c5131274b67..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationsecuritygroups - -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 *[]ApplicationSecurityGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationSecurityGroup -} - -// List ... -func (c ApplicationSecurityGroupsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationSecurityGroups", 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 *[]ApplicationSecurityGroup `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 ApplicationSecurityGroupsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationSecurityGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationSecurityGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ApplicationSecurityGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationSecurityGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/applicationsecuritygroups/method_listall.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/method_listall.go deleted file mode 100644 index 52ce737d92d..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationsecuritygroups - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationSecurityGroup -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationSecurityGroup -} - -// ListAll ... -func (c ApplicationSecurityGroupsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationSecurityGroups", 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 *[]ApplicationSecurityGroup `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ApplicationSecurityGroupsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, ApplicationSecurityGroupOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationSecurityGroupsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplicationSecurityGroupOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]ApplicationSecurityGroup, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_updatetags.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/method_updatetags.go deleted file mode 100644 index 0343cea5693..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package applicationsecuritygroups - -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 *ApplicationSecurityGroup -} - -// UpdateTags ... -func (c ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, id ApplicationSecurityGroupId, 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 ApplicationSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygroup.go deleted file mode 100644 index 56c89e2151e..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationsecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index c54772935da..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationsecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/applicationsecuritygroups/model_tagsobject.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/model_tagsobject.go deleted file mode 100644 index b945e6c9cdf..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationsecuritygroups - -// 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/network/2023-05-01/applicationsecuritygroups/predicates.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/predicates.go deleted file mode 100644 index 6ea534ecd89..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package applicationsecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ApplicationSecurityGroupOperationPredicate) Matches(input ApplicationSecurityGroup) 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 && (input.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/network/2023-05-01/applicationsecuritygroups/version.go b/resource-manager/network/2023-05-01/applicationsecuritygroups/version.go deleted file mode 100644 index 3a5f44c1745..00000000000 --- a/resource-manager/network/2023-05-01/applicationsecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationsecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationsecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/README.md b/resource-manager/network/2023-05-01/availabledelegations/README.md deleted file mode 100644 index 786d096272b..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/availabledelegations` Documentation - -The `availabledelegations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/availabledelegations" -``` - - -### Client Initialization - -```go -client := availabledelegations.NewAvailableDelegationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AvailableDelegationsClient.AvailableDelegationsList` - -```go -ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableDelegationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AvailableDelegationsClient.AvailableResourceGroupDelegationsList` - -```go -ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/availabledelegations/client.go b/resource-manager/network/2023-05-01/availabledelegations/client.go deleted file mode 100644 index ff6ff754bce..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package availabledelegations - -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 AvailableDelegationsClient struct { - Client *resourcemanager.Client -} - -func NewAvailableDelegationsClientWithBaseURI(sdkApi sdkEnv.Api) (*AvailableDelegationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "availabledelegations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AvailableDelegationsClient: %+v", err) - } - - return &AvailableDelegationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/id_location.go b/resource-manager/network/2023-05-01/availabledelegations/id_location.go deleted file mode 100644 index 411da010546..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package availabledelegations - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/availabledelegations/id_location_test.go b/resource-manager/network/2023-05-01/availabledelegations/id_location_test.go deleted file mode 100644 index c8a4e105cc4..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package availabledelegations - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2023-05-01/availabledelegations/id_providerlocation.go deleted file mode 100644 index 18b359986fc..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package availabledelegations - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2023-05-01/availabledelegations/id_providerlocation_test.go deleted file mode 100644 index 71efff5776b..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package availabledelegations - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-05-01/availabledelegations/method_availabledelegationslist.go b/resource-manager/network/2023-05-01/availabledelegations/method_availabledelegationslist.go deleted file mode 100644 index 053f6f860c6..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/method_availabledelegationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package availabledelegations - -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 AvailableDelegationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailableDelegation -} - -type AvailableDelegationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableDelegation -} - -// AvailableDelegationsList ... -func (c AvailableDelegationsClient) AvailableDelegationsList(ctx context.Context, id LocationId) (result AvailableDelegationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableDelegations", 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 *[]AvailableDelegation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailableDelegationsListComplete retrieves all the results into a single object -func (c AvailableDelegationsClient) AvailableDelegationsListComplete(ctx context.Context, id LocationId) (AvailableDelegationsListCompleteResult, error) { - return c.AvailableDelegationsListCompleteMatchingPredicate(ctx, id, AvailableDelegationOperationPredicate{}) -} - -// AvailableDelegationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableDelegationsClient) AvailableDelegationsListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AvailableDelegationOperationPredicate) (result AvailableDelegationsListCompleteResult, err error) { - items := make([]AvailableDelegation, 0) - - resp, err := c.AvailableDelegationsList(ctx, id) - if err != nil { - 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 = AvailableDelegationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/method_availableresourcegroupdelegationslist.go b/resource-manager/network/2023-05-01/availabledelegations/method_availableresourcegroupdelegationslist.go deleted file mode 100644 index 48a41795beb..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/method_availableresourcegroupdelegationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package availabledelegations - -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 AvailableResourceGroupDelegationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailableDelegation -} - -type AvailableResourceGroupDelegationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableDelegation -} - -// AvailableResourceGroupDelegationsList ... -func (c AvailableDelegationsClient) AvailableResourceGroupDelegationsList(ctx context.Context, id ProviderLocationId) (result AvailableResourceGroupDelegationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableDelegations", 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 *[]AvailableDelegation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailableResourceGroupDelegationsListComplete retrieves all the results into a single object -func (c AvailableDelegationsClient) AvailableResourceGroupDelegationsListComplete(ctx context.Context, id ProviderLocationId) (AvailableResourceGroupDelegationsListCompleteResult, error) { - return c.AvailableResourceGroupDelegationsListCompleteMatchingPredicate(ctx, id, AvailableDelegationOperationPredicate{}) -} - -// AvailableResourceGroupDelegationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableDelegationsClient) AvailableResourceGroupDelegationsListCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AvailableDelegationOperationPredicate) (result AvailableResourceGroupDelegationsListCompleteResult, err error) { - items := make([]AvailableDelegation, 0) - - resp, err := c.AvailableResourceGroupDelegationsList(ctx, id) - if err != nil { - 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 = AvailableResourceGroupDelegationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/model_availabledelegation.go b/resource-manager/network/2023-05-01/availabledelegations/model_availabledelegation.go deleted file mode 100644 index 0fa5dba60d1..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/model_availabledelegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package availabledelegations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableDelegation struct { - Actions *[]string `json:"actions,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/predicates.go b/resource-manager/network/2023-05-01/availabledelegations/predicates.go deleted file mode 100644 index caf6b904077..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package availabledelegations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableDelegationOperationPredicate struct { - Id *string - Name *string - ServiceName *string - Type *string -} - -func (p AvailableDelegationOperationPredicate) Matches(input AvailableDelegation) 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.ServiceName != nil && (input.ServiceName == nil || *p.ServiceName != *input.ServiceName) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/availabledelegations/version.go b/resource-manager/network/2023-05-01/availabledelegations/version.go deleted file mode 100644 index 8f02440702d..00000000000 --- a/resource-manager/network/2023-05-01/availabledelegations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package availabledelegations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/availabledelegations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/availableservicealiases/README.md b/resource-manager/network/2023-05-01/availableservicealiases/README.md deleted file mode 100644 index 3a6cf7cd10b..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/availableservicealiases` Documentation - -The `availableservicealiases` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/availableservicealiases" -``` - - -### Client Initialization - -```go -client := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AvailableServiceAliasesClient.List` - -```go -ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// 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: `AvailableServiceAliasesClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// 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 -} -``` diff --git a/resource-manager/network/2023-05-01/availableservicealiases/client.go b/resource-manager/network/2023-05-01/availableservicealiases/client.go deleted file mode 100644 index 383e80f6061..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package availableservicealiases - -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 AvailableServiceAliasesClient struct { - Client *resourcemanager.Client -} - -func NewAvailableServiceAliasesClientWithBaseURI(sdkApi sdkEnv.Api) (*AvailableServiceAliasesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "availableservicealiases", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AvailableServiceAliasesClient: %+v", err) - } - - return &AvailableServiceAliasesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/availableservicealiases/id_location.go b/resource-manager/network/2023-05-01/availableservicealiases/id_location.go deleted file mode 100644 index 5bff2b43759..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package availableservicealiases - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/availableservicealiases/id_location_test.go b/resource-manager/network/2023-05-01/availableservicealiases/id_location_test.go deleted file mode 100644 index d04df9ce9ca..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package availableservicealiases - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation.go deleted file mode 100644 index 7ec8519458c..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package availableservicealiases - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation_test.go deleted file mode 100644 index 07702c8432c..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package availableservicealiases - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-05-01/availableservicealiases/method_list.go b/resource-manager/network/2023-05-01/availableservicealiases/method_list.go deleted file mode 100644 index d3eb8df811b..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package availableservicealiases - -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 *[]AvailableServiceAlias -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableServiceAlias -} - -// List ... -func (c AvailableServiceAliasesClient) List(ctx context.Context, id LocationId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableServiceAliases", 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 *[]AvailableServiceAlias `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 AvailableServiceAliasesClient) ListComplete(ctx context.Context, id LocationId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AvailableServiceAliasOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableServiceAliasesClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AvailableServiceAliasOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AvailableServiceAlias, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/availableservicealiases/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/availableservicealiases/method_listbyresourcegroup.go deleted file mode 100644 index 4ccf14cc451..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/method_listbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package availableservicealiases - -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 ListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailableServiceAlias -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableServiceAlias -} - -// ListByResourceGroup ... -func (c AvailableServiceAliasesClient) ListByResourceGroup(ctx context.Context, id ProviderLocationId) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableServiceAliases", 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 *[]AvailableServiceAlias `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 AvailableServiceAliasesClient) ListByResourceGroupComplete(ctx context.Context, id ProviderLocationId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, AvailableServiceAliasOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableServiceAliasesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AvailableServiceAliasOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]AvailableServiceAlias, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/availableservicealiases/model_availableservicealias.go b/resource-manager/network/2023-05-01/availableservicealiases/model_availableservicealias.go deleted file mode 100644 index b5f6cfd263b..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/model_availableservicealias.go +++ /dev/null @@ -1,11 +0,0 @@ -package availableservicealiases - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableServiceAlias struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/availableservicealiases/predicates.go b/resource-manager/network/2023-05-01/availableservicealiases/predicates.go deleted file mode 100644 index afe2abff9ab..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package availableservicealiases - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableServiceAliasOperationPredicate struct { - Id *string - Name *string - ResourceName *string - Type *string -} - -func (p AvailableServiceAliasOperationPredicate) Matches(input AvailableServiceAlias) 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.ResourceName != nil && (input.ResourceName == nil || *p.ResourceName != *input.ResourceName) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/availableservicealiases/version.go b/resource-manager/network/2023-05-01/availableservicealiases/version.go deleted file mode 100644 index 743fadf812f..00000000000 --- a/resource-manager/network/2023-05-01/availableservicealiases/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package availableservicealiases - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/availableservicealiases/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/README.md b/resource-manager/network/2023-05-01/azurefirewalls/README.md deleted file mode 100644 index c34e932a71e..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/README.md +++ /dev/null @@ -1,146 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/azurefirewalls` Documentation - -The `azurefirewalls` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/azurefirewalls" -``` - - -### Client Initialization - -```go -client := azurefirewalls.NewAzureFirewallsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AzureFirewallsClient.AzureFirewallsListLearnedPrefixes` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -if err := client.AzureFirewallsListLearnedPrefixesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.AzureFirewall{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.Delete` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.Get` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -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: `AzureFirewallsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `AzureFirewallsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AzureFirewallsClient.PacketCapture` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.FirewallPacketCaptureParameters{ - // ... -} - - -if err := client.PacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.UpdateTags` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/azurefirewalls/client.go b/resource-manager/network/2023-05-01/azurefirewalls/client.go deleted file mode 100644 index e1119aea925..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package azurefirewalls - -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 AzureFirewallsClient struct { - Client *resourcemanager.Client -} - -func NewAzureFirewallsClientWithBaseURI(sdkApi sdkEnv.Api) (*AzureFirewallsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "azurefirewalls", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AzureFirewallsClient: %+v", err) - } - - return &AzureFirewallsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/constants.go b/resource-manager/network/2023-05-01/azurefirewalls/constants.go deleted file mode 100644 index d7a3af8fb71..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/constants.go +++ /dev/null @@ -1,412 +0,0 @@ -package azurefirewalls - -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 AzureFirewallApplicationRuleProtocolType string - -const ( - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" - AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" -) - -func PossibleValuesForAzureFirewallApplicationRuleProtocolType() []string { - return []string{ - string(AzureFirewallApplicationRuleProtocolTypeHTTP), - string(AzureFirewallApplicationRuleProtocolTypeHTTPS), - string(AzureFirewallApplicationRuleProtocolTypeMssql), - } -} - -func (s *AzureFirewallApplicationRuleProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallApplicationRuleProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallApplicationRuleProtocolType(input string) (*AzureFirewallApplicationRuleProtocolType, error) { - vals := map[string]AzureFirewallApplicationRuleProtocolType{ - "http": AzureFirewallApplicationRuleProtocolTypeHTTP, - "https": AzureFirewallApplicationRuleProtocolTypeHTTPS, - "mssql": AzureFirewallApplicationRuleProtocolTypeMssql, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallApplicationRuleProtocolType(input) - return &out, nil -} - -type AzureFirewallNatRCActionType string - -const ( - AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" - AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" -) - -func PossibleValuesForAzureFirewallNatRCActionType() []string { - return []string{ - string(AzureFirewallNatRCActionTypeDnat), - string(AzureFirewallNatRCActionTypeSnat), - } -} - -func (s *AzureFirewallNatRCActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallNatRCActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallNatRCActionType(input string) (*AzureFirewallNatRCActionType, error) { - vals := map[string]AzureFirewallNatRCActionType{ - "dnat": AzureFirewallNatRCActionTypeDnat, - "snat": AzureFirewallNatRCActionTypeSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallNatRCActionType(input) - return &out, nil -} - -type AzureFirewallNetworkRuleProtocol string - -const ( - AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" - AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" - AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" - AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -func PossibleValuesForAzureFirewallNetworkRuleProtocol() []string { - return []string{ - string(AzureFirewallNetworkRuleProtocolAny), - string(AzureFirewallNetworkRuleProtocolICMP), - string(AzureFirewallNetworkRuleProtocolTCP), - string(AzureFirewallNetworkRuleProtocolUDP), - } -} - -func (s *AzureFirewallNetworkRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallNetworkRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallNetworkRuleProtocol(input string) (*AzureFirewallNetworkRuleProtocol, error) { - vals := map[string]AzureFirewallNetworkRuleProtocol{ - "any": AzureFirewallNetworkRuleProtocolAny, - "icmp": AzureFirewallNetworkRuleProtocolICMP, - "tcp": AzureFirewallNetworkRuleProtocolTCP, - "udp": AzureFirewallNetworkRuleProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallNetworkRuleProtocol(input) - return &out, nil -} - -type AzureFirewallPacketCaptureFlagsType string - -const ( - AzureFirewallPacketCaptureFlagsTypeAck AzureFirewallPacketCaptureFlagsType = "ack" - AzureFirewallPacketCaptureFlagsTypeFin AzureFirewallPacketCaptureFlagsType = "fin" - AzureFirewallPacketCaptureFlagsTypePush AzureFirewallPacketCaptureFlagsType = "push" - AzureFirewallPacketCaptureFlagsTypeRst AzureFirewallPacketCaptureFlagsType = "rst" - AzureFirewallPacketCaptureFlagsTypeSyn AzureFirewallPacketCaptureFlagsType = "syn" - AzureFirewallPacketCaptureFlagsTypeUrg AzureFirewallPacketCaptureFlagsType = "urg" -) - -func PossibleValuesForAzureFirewallPacketCaptureFlagsType() []string { - return []string{ - string(AzureFirewallPacketCaptureFlagsTypeAck), - string(AzureFirewallPacketCaptureFlagsTypeFin), - string(AzureFirewallPacketCaptureFlagsTypePush), - string(AzureFirewallPacketCaptureFlagsTypeRst), - string(AzureFirewallPacketCaptureFlagsTypeSyn), - string(AzureFirewallPacketCaptureFlagsTypeUrg), - } -} - -func (s *AzureFirewallPacketCaptureFlagsType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallPacketCaptureFlagsType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallPacketCaptureFlagsType(input string) (*AzureFirewallPacketCaptureFlagsType, error) { - vals := map[string]AzureFirewallPacketCaptureFlagsType{ - "ack": AzureFirewallPacketCaptureFlagsTypeAck, - "fin": AzureFirewallPacketCaptureFlagsTypeFin, - "push": AzureFirewallPacketCaptureFlagsTypePush, - "rst": AzureFirewallPacketCaptureFlagsTypeRst, - "syn": AzureFirewallPacketCaptureFlagsTypeSyn, - "urg": AzureFirewallPacketCaptureFlagsTypeUrg, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallPacketCaptureFlagsType(input) - return &out, nil -} - -type AzureFirewallRCActionType string - -const ( - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -func PossibleValuesForAzureFirewallRCActionType() []string { - return []string{ - string(AzureFirewallRCActionTypeAllow), - string(AzureFirewallRCActionTypeDeny), - } -} - -func (s *AzureFirewallRCActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallRCActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallRCActionType(input string) (*AzureFirewallRCActionType, error) { - vals := map[string]AzureFirewallRCActionType{ - "allow": AzureFirewallRCActionTypeAllow, - "deny": AzureFirewallRCActionTypeDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallRCActionType(input) - return &out, nil -} - -type AzureFirewallSkuName string - -const ( - AzureFirewallSkuNameAZFWHub AzureFirewallSkuName = "AZFW_Hub" - AzureFirewallSkuNameAZFWVNet AzureFirewallSkuName = "AZFW_VNet" -) - -func PossibleValuesForAzureFirewallSkuName() []string { - return []string{ - string(AzureFirewallSkuNameAZFWHub), - string(AzureFirewallSkuNameAZFWVNet), - } -} - -func (s *AzureFirewallSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallSkuName(input string) (*AzureFirewallSkuName, error) { - vals := map[string]AzureFirewallSkuName{ - "azfw_hub": AzureFirewallSkuNameAZFWHub, - "azfw_vnet": AzureFirewallSkuNameAZFWVNet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallSkuName(input) - return &out, nil -} - -type AzureFirewallSkuTier string - -const ( - AzureFirewallSkuTierBasic AzureFirewallSkuTier = "Basic" - AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" - AzureFirewallSkuTierStandard AzureFirewallSkuTier = "Standard" -) - -func PossibleValuesForAzureFirewallSkuTier() []string { - return []string{ - string(AzureFirewallSkuTierBasic), - string(AzureFirewallSkuTierPremium), - string(AzureFirewallSkuTierStandard), - } -} - -func (s *AzureFirewallSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallSkuTier(input string) (*AzureFirewallSkuTier, error) { - vals := map[string]AzureFirewallSkuTier{ - "basic": AzureFirewallSkuTierBasic, - "premium": AzureFirewallSkuTierPremium, - "standard": AzureFirewallSkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallSkuTier(input) - return &out, nil -} - -type AzureFirewallThreatIntelMode string - -const ( - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -func PossibleValuesForAzureFirewallThreatIntelMode() []string { - return []string{ - string(AzureFirewallThreatIntelModeAlert), - string(AzureFirewallThreatIntelModeDeny), - string(AzureFirewallThreatIntelModeOff), - } -} - -func (s *AzureFirewallThreatIntelMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallThreatIntelMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallThreatIntelMode(input string) (*AzureFirewallThreatIntelMode, error) { - vals := map[string]AzureFirewallThreatIntelMode{ - "alert": AzureFirewallThreatIntelModeAlert, - "deny": AzureFirewallThreatIntelModeDeny, - "off": AzureFirewallThreatIntelModeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallThreatIntelMode(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall.go b/resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall.go deleted file mode 100644 index 20ab073f448..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall.go +++ /dev/null @@ -1,130 +0,0 @@ -package azurefirewalls - -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(&AzureFirewallId{}) -} - -var _ resourceids.ResourceId = &AzureFirewallId{} - -// AzureFirewallId is a struct representing the Resource ID for a Azure Firewall -type AzureFirewallId struct { - SubscriptionId string - ResourceGroupName string - AzureFirewallName string -} - -// NewAzureFirewallID returns a new AzureFirewallId struct -func NewAzureFirewallID(subscriptionId string, resourceGroupName string, azureFirewallName string) AzureFirewallId { - return AzureFirewallId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AzureFirewallName: azureFirewallName, - } -} - -// ParseAzureFirewallID parses 'input' into a AzureFirewallId -func ParseAzureFirewallID(input string) (*AzureFirewallId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureFirewallId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureFirewallId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAzureFirewallIDInsensitively parses 'input' case-insensitively into a AzureFirewallId -// note: this method should only be used for API response data and not user input -func ParseAzureFirewallIDInsensitively(input string) (*AzureFirewallId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureFirewallId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureFirewallId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AzureFirewallId) 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.AzureFirewallName, ok = input.Parsed["azureFirewallName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "azureFirewallName", input) - } - - return nil -} - -// ValidateAzureFirewallID checks that 'input' can be parsed as a Azure Firewall ID -func ValidateAzureFirewallID(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 := ParseAzureFirewallID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Azure Firewall ID -func (id AzureFirewallId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/azureFirewalls/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AzureFirewallName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Azure Firewall ID -func (id AzureFirewallId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticAzureFirewalls", "azureFirewalls", "azureFirewalls"), - resourceids.UserSpecifiedSegment("azureFirewallName", "azureFirewallValue"), - } -} - -// String returns a human-readable description of this Azure Firewall ID -func (id AzureFirewallId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Azure Firewall Name: %q", id.AzureFirewallName), - } - return fmt.Sprintf("Azure Firewall (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall_test.go b/resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall_test.go deleted file mode 100644 index 9819b454d9e..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/id_azurefirewall_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package azurefirewalls - -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 = &AzureFirewallId{} - -func TestNewAzureFirewallID(t *testing.T) { - id := NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - - 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.AzureFirewallName != "azureFirewallValue" { - t.Fatalf("Expected %q but got %q for Segment 'AzureFirewallName'", id.AzureFirewallName, "azureFirewallValue") - } -} - -func TestFormatAzureFirewallID(t *testing.T) { - actual := NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAzureFirewallID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureFirewallId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue", - Expected: &AzureFirewallId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AzureFirewallName: "azureFirewallValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureFirewallID(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.AzureFirewallName != v.Expected.AzureFirewallName { - t.Fatalf("Expected %q but got %q for AzureFirewallName", v.Expected.AzureFirewallName, actual.AzureFirewallName) - } - - } -} - -func TestParseAzureFirewallIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureFirewallId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReFiReWaLlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue", - Expected: &AzureFirewallId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AzureFirewallName: "azureFirewallValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReFiReWaLlS/aZuReFiReWaLlVaLuE", - Expected: &AzureFirewallId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AzureFirewallName: "aZuReFiReWaLlVaLuE", - }, - }, - { - // 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.nEtWoRk/aZuReFiReWaLlS/aZuReFiReWaLlVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureFirewallIDInsensitively(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.AzureFirewallName != v.Expected.AzureFirewallName { - t.Fatalf("Expected %q but got %q for AzureFirewallName", v.Expected.AzureFirewallName, actual.AzureFirewallName) - } - - } -} - -func TestSegmentsForAzureFirewallId(t *testing.T) { - segments := AzureFirewallId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AzureFirewallId 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/network/2023-05-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go b/resource-manager/network/2023-05-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go deleted file mode 100644 index 79c6c0ccfd6..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go +++ /dev/null @@ -1,71 +0,0 @@ -package azurefirewalls - -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 AzureFirewallsListLearnedPrefixesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *IPPrefixesList -} - -// AzureFirewallsListLearnedPrefixes ... -func (c AzureFirewallsClient) AzureFirewallsListLearnedPrefixes(ctx context.Context, id AzureFirewallId) (result AzureFirewallsListLearnedPrefixesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/learnedIPPrefixes", 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 -} - -// AzureFirewallsListLearnedPrefixesThenPoll performs AzureFirewallsListLearnedPrefixes then polls until it's completed -func (c AzureFirewallsClient) AzureFirewallsListLearnedPrefixesThenPoll(ctx context.Context, id AzureFirewallId) error { - result, err := c.AzureFirewallsListLearnedPrefixes(ctx, id) - if err != nil { - return fmt.Errorf("performing AzureFirewallsListLearnedPrefixes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after AzureFirewallsListLearnedPrefixes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/method_createorupdate.go b/resource-manager/network/2023-05-01/azurefirewalls/method_createorupdate.go deleted file mode 100644 index fdd7520026c..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package azurefirewalls - -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 *AzureFirewall -} - -// CreateOrUpdate ... -func (c AzureFirewallsClient) CreateOrUpdate(ctx context.Context, id AzureFirewallId, input AzureFirewall) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c AzureFirewallsClient) CreateOrUpdateThenPoll(ctx context.Context, id AzureFirewallId, input AzureFirewall) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/azurefirewalls/method_delete.go b/resource-manager/network/2023-05-01/azurefirewalls/method_delete.go deleted file mode 100644 index 04fddc41723..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package azurefirewalls - -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 AzureFirewallsClient) Delete(ctx context.Context, id AzureFirewallId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 AzureFirewallsClient) DeleteThenPoll(ctx context.Context, id AzureFirewallId) 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/network/2023-05-01/azurefirewalls/method_get.go b/resource-manager/network/2023-05-01/azurefirewalls/method_get.go deleted file mode 100644 index 7fa6155aa4a..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package azurefirewalls - -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 *AzureFirewall -} - -// Get ... -func (c AzureFirewallsClient) Get(ctx context.Context, id AzureFirewallId) (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 AzureFirewall - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/method_list.go b/resource-manager/network/2023-05-01/azurefirewalls/method_list.go deleted file mode 100644 index 7a6095743be..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package azurefirewalls - -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 *[]AzureFirewall -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureFirewall -} - -// List ... -func (c AzureFirewallsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/azureFirewalls", 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 *[]AzureFirewall `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 AzureFirewallsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AzureFirewallOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AzureFirewallsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AzureFirewallOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AzureFirewall, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/azurefirewalls/method_listall.go b/resource-manager/network/2023-05-01/azurefirewalls/method_listall.go deleted file mode 100644 index 86c7935255b..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package azurefirewalls - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AzureFirewall -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureFirewall -} - -// ListAll ... -func (c AzureFirewallsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/azureFirewalls", 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 *[]AzureFirewall `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c AzureFirewallsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, AzureFirewallOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AzureFirewallsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AzureFirewallOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]AzureFirewall, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/method_packetcapture.go b/resource-manager/network/2023-05-01/azurefirewalls/method_packetcapture.go deleted file mode 100644 index a2b211da6c7..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_packetcapture.go +++ /dev/null @@ -1,73 +0,0 @@ -package azurefirewalls - -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 PacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// PacketCapture ... -func (c AzureFirewallsClient) PacketCapture(ctx context.Context, id AzureFirewallId, input FirewallPacketCaptureParameters) (result PacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/packetCapture", 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 -} - -// PacketCaptureThenPoll performs PacketCapture then polls until it's completed -func (c AzureFirewallsClient) PacketCaptureThenPoll(ctx context.Context, id AzureFirewallId, input FirewallPacketCaptureParameters) error { - result, err := c.PacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/method_updatetags.go b/resource-manager/network/2023-05-01/azurefirewalls/method_updatetags.go deleted file mode 100644 index 1d404977af9..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package azurefirewalls - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *AzureFirewall -} - -// UpdateTags ... -func (c AzureFirewallsClient) UpdateTags(ctx context.Context, id AzureFirewallId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c AzureFirewallsClient) UpdateTagsThenPoll(ctx context.Context, id AzureFirewallId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/azurefirewalls/model_azurefirewall.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewall.go deleted file mode 100644 index da4d4ccf5f7..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewall.go +++ /dev/null @@ -1,19 +0,0 @@ -package azurefirewalls - -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 AzureFirewall struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrule.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrule.go deleted file mode 100644 index c74f6235d09..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrule.go +++ /dev/null @@ -1,14 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRule struct { - Description *string `json:"description,omitempty"` - FqdnTags *[]string `json:"fqdnTags,omitempty"` - Name *string `json:"name,omitempty"` - Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TargetFqdns *[]string `json:"targetFqdns,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go deleted file mode 100644 index 0307e6e7b33..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go deleted file mode 100644 index bd5d09f330d..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { - Action *AzureFirewallRCAction `json:"action,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go deleted file mode 100644 index 8ea63b2ef92..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRuleProtocol struct { - Port *int64 `json:"port,omitempty"` - ProtocolType *AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfiguration.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfiguration.go deleted file mode 100644 index 3456ba0b1ad..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go deleted file mode 100644 index cca79069337..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipgroups.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipgroups.go deleted file mode 100644 index e26c8540a65..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallipgroups.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallIPGroups struct { - ChangeNumber *string `json:"changeNumber,omitempty"` - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrcaction.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrcaction.go deleted file mode 100644 index 9c9250aef39..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrcaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRCAction struct { - Type *AzureFirewallNatRCActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrule.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrule.go deleted file mode 100644 index 70c0d009eab..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRule struct { - Description *string `json:"description,omitempty"` - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Name *string `json:"name,omitempty"` - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TranslatedAddress *string `json:"translatedAddress,omitempty"` - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - TranslatedPort *string `json:"translatedPort,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollection.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollection.go deleted file mode 100644 index d06cf19e359..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollection.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallNatRuleCollectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go deleted file mode 100644 index 774ac6902bc..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRuleCollectionProperties struct { - Action *AzureFirewallNatRCAction `json:"action,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]AzureFirewallNatRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrule.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrule.go deleted file mode 100644 index 6833c1f7509..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrule.go +++ /dev/null @@ -1,16 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNetworkRule struct { - Description *string `json:"description,omitempty"` - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Name *string `json:"name,omitempty"` - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go deleted file mode 100644 index ea5f2ba0d2b..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNetworkRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go deleted file mode 100644 index be71e063370..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { - Action *AzureFirewallRCAction `json:"action,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go deleted file mode 100644 index edcc08e5590..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPacketCaptureFlags struct { - Type *AzureFirewallPacketCaptureFlagsType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcapturerule.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcapturerule.go deleted file mode 100644 index 4d9921e3243..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpacketcapturerule.go +++ /dev/null @@ -1,10 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPacketCaptureRule struct { - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Destinations *[]string `json:"destinations,omitempty"` - Sources *[]string `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpropertiesformat.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpropertiesformat.go deleted file mode 100644 index 0e8c463423f..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpropertiesformat.go +++ /dev/null @@ -1,20 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPropertiesFormat struct { - AdditionalProperties *map[string]string `json:"additionalProperties,omitempty"` - ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - HubIPAddresses *HubIPAddresses `json:"hubIPAddresses,omitempty"` - IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` - IPGroups *[]AzureFirewallIPGroups `json:"ipGroups,omitempty"` - ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"` - NatRuleCollections *[]AzureFirewallNatRuleCollection `json:"natRuleCollections,omitempty"` - NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Sku *AzureFirewallSku `json:"sku,omitempty"` - ThreatIntelMode *AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpublicipaddress.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpublicipaddress.go deleted file mode 100644 index c5dff4f3fff..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallpublicipaddress.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPublicIPAddress struct { - Address *string `json:"address,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallrcaction.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallrcaction.go deleted file mode 100644 index 752c166b62b..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallrcaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallRCAction struct { - Type *AzureFirewallRCActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallsku.go b/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallsku.go deleted file mode 100644 index 46f81c15dbc..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_azurefirewallsku.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallSku struct { - Name *AzureFirewallSkuName `json:"name,omitempty"` - Tier *AzureFirewallSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparameters.go b/resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparameters.go deleted file mode 100644 index 258aca5b011..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPacketCaptureParameters struct { - Id *string `json:"id,omitempty"` - Properties *FirewallPacketCaptureParametersFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go b/resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go deleted file mode 100644 index c0c639f2390..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPacketCaptureParametersFormat struct { - DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` - FileName *string `json:"fileName,omitempty"` - Filters *[]AzureFirewallPacketCaptureRule `json:"filters,omitempty"` - Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` - NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` - Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_hubipaddresses.go b/resource-manager/network/2023-05-01/azurefirewalls/model_hubipaddresses.go deleted file mode 100644 index 2fa8e41de6b..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_hubipaddresses.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubIPAddresses struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PublicIPs *HubPublicIPAddresses `json:"publicIPs,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_hubpublicipaddresses.go b/resource-manager/network/2023-05-01/azurefirewalls/model_hubpublicipaddresses.go deleted file mode 100644 index 48ee3132846..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_hubpublicipaddresses.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubPublicIPAddresses struct { - Addresses *[]AzureFirewallPublicIPAddress `json:"addresses,omitempty"` - Count *int64 `json:"count,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_ipprefixeslist.go b/resource-manager/network/2023-05-01/azurefirewalls/model_ipprefixeslist.go deleted file mode 100644 index 3d2ea0d9a9e..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_ipprefixeslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPPrefixesList struct { - IPPrefixes *[]string `json:"ipPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_subresource.go b/resource-manager/network/2023-05-01/azurefirewalls/model_subresource.go deleted file mode 100644 index 3a39f2458c4..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/azurefirewalls/model_tagsobject.go b/resource-manager/network/2023-05-01/azurefirewalls/model_tagsobject.go deleted file mode 100644 index 3b70ce55bcd..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// 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/network/2023-05-01/azurefirewalls/predicates.go b/resource-manager/network/2023-05-01/azurefirewalls/predicates.go deleted file mode 100644 index 68ca8da5623..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p AzureFirewallOperationPredicate) Matches(input AzureFirewall) 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 && (input.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/network/2023-05-01/azurefirewalls/version.go b/resource-manager/network/2023-05-01/azurefirewalls/version.go deleted file mode 100644 index 7d393aae319..00000000000 --- a/resource-manager/network/2023-05-01/azurefirewalls/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package azurefirewalls - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/azurefirewalls/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/README.md b/resource-manager/network/2023-05-01/bastionhosts/README.md deleted file mode 100644 index 04688597a76..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/README.md +++ /dev/null @@ -1,217 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/bastionhosts` Documentation - -The `bastionhosts` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/bastionhosts" -``` - - -### Client Initialization - -```go -client := bastionhosts.NewBastionHostsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BastionHostsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionHost{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.Delete` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DeleteBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DisconnectActiveSessions` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.SessionIds{ - // ... -} - - -// alternatively `client.DisconnectActiveSessions(ctx, id, payload)` can be used to do batched pagination -items, err := client.DisconnectActiveSessionsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.Get` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -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: `BastionHostsClient.GetActiveSessions` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -// alternatively `client.GetActiveSessions(ctx, id)` can be used to do batched pagination -items, err := client.GetActiveSessionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.GetBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.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: `BastionHostsClient.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: `BastionHostsClient.PutBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.UpdateTags` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/bastionhosts/client.go b/resource-manager/network/2023-05-01/bastionhosts/client.go deleted file mode 100644 index 95e06c7f523..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bastionhosts - -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 BastionHostsClient struct { - Client *resourcemanager.Client -} - -func NewBastionHostsClientWithBaseURI(sdkApi sdkEnv.Api) (*BastionHostsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bastionhosts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BastionHostsClient: %+v", err) - } - - return &BastionHostsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/constants.go b/resource-manager/network/2023-05-01/bastionhosts/constants.go deleted file mode 100644 index d218831ec92..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/constants.go +++ /dev/null @@ -1,180 +0,0 @@ -package bastionhosts - -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 BastionConnectProtocol string - -const ( - BastionConnectProtocolRDP BastionConnectProtocol = "RDP" - BastionConnectProtocolSSH BastionConnectProtocol = "SSH" -) - -func PossibleValuesForBastionConnectProtocol() []string { - return []string{ - string(BastionConnectProtocolRDP), - string(BastionConnectProtocolSSH), - } -} - -func (s *BastionConnectProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBastionConnectProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBastionConnectProtocol(input string) (*BastionConnectProtocol, error) { - vals := map[string]BastionConnectProtocol{ - "rdp": BastionConnectProtocolRDP, - "ssh": BastionConnectProtocolSSH, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BastionConnectProtocol(input) - return &out, nil -} - -type BastionHostSkuName string - -const ( - BastionHostSkuNameBasic BastionHostSkuName = "Basic" - BastionHostSkuNameStandard BastionHostSkuName = "Standard" -) - -func PossibleValuesForBastionHostSkuName() []string { - return []string{ - string(BastionHostSkuNameBasic), - string(BastionHostSkuNameStandard), - } -} - -func (s *BastionHostSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBastionHostSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBastionHostSkuName(input string) (*BastionHostSkuName, error) { - vals := map[string]BastionHostSkuName{ - "basic": BastionHostSkuNameBasic, - "standard": BastionHostSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BastionHostSkuName(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/id_bastionhost.go b/resource-manager/network/2023-05-01/bastionhosts/id_bastionhost.go deleted file mode 100644 index 66012e2eda5..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/id_bastionhost.go +++ /dev/null @@ -1,130 +0,0 @@ -package bastionhosts - -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(&BastionHostId{}) -} - -var _ resourceids.ResourceId = &BastionHostId{} - -// BastionHostId is a struct representing the Resource ID for a Bastion Host -type BastionHostId struct { - SubscriptionId string - ResourceGroupName string - BastionHostName string -} - -// NewBastionHostID returns a new BastionHostId struct -func NewBastionHostID(subscriptionId string, resourceGroupName string, bastionHostName string) BastionHostId { - return BastionHostId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - BastionHostName: bastionHostName, - } -} - -// ParseBastionHostID parses 'input' into a BastionHostId -func ParseBastionHostID(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBastionHostIDInsensitively parses 'input' case-insensitively into a BastionHostId -// note: this method should only be used for API response data and not user input -func ParseBastionHostIDInsensitively(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BastionHostId) 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.BastionHostName, ok = input.Parsed["bastionHostName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bastionHostName", input) - } - - return nil -} - -// ValidateBastionHostID checks that 'input' can be parsed as a Bastion Host ID -func ValidateBastionHostID(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 := ParseBastionHostID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bastion Host ID -func (id BastionHostId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/bastionHosts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.BastionHostName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bastion Host ID -func (id BastionHostId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticBastionHosts", "bastionHosts", "bastionHosts"), - resourceids.UserSpecifiedSegment("bastionHostName", "bastionHostValue"), - } -} - -// String returns a human-readable description of this Bastion Host ID -func (id BastionHostId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Bastion Host Name: %q", id.BastionHostName), - } - return fmt.Sprintf("Bastion Host (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/id_bastionhost_test.go b/resource-manager/network/2023-05-01/bastionhosts/id_bastionhost_test.go deleted file mode 100644 index 025eba0aa75..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/id_bastionhost_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bastionhosts - -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 = &BastionHostId{} - -func TestNewBastionHostID(t *testing.T) { - id := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - - 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.BastionHostName != "bastionHostValue" { - t.Fatalf("Expected %q but got %q for Segment 'BastionHostName'", id.BastionHostName, "bastionHostValue") - } -} - -func TestFormatBastionHostID(t *testing.T) { - actual := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBastionHostID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostID(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestParseBastionHostIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BastionHostName: "bAsTiOnHoStVaLuE", - }, - }, - { - // 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.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostIDInsensitively(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestSegmentsForBastionHostId(t *testing.T) { - segments := BastionHostId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BastionHostId 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/network/2023-05-01/bastionhosts/method_createorupdate.go b/resource-manager/network/2023-05-01/bastionhosts/method_createorupdate.go deleted file mode 100644 index fe735012d1f..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package bastionhosts - -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 *BastionHost -} - -// CreateOrUpdate ... -func (c BastionHostsClient) CreateOrUpdate(ctx context.Context, id BastionHostId, input BastionHost) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c BastionHostsClient) CreateOrUpdateThenPoll(ctx context.Context, id BastionHostId, input BastionHost) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/bastionhosts/method_delete.go b/resource-manager/network/2023-05-01/bastionhosts/method_delete.go deleted file mode 100644 index 5eebbeeeed3..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package bastionhosts - -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 BastionHostsClient) Delete(ctx context.Context, id BastionHostId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 BastionHostsClient) DeleteThenPoll(ctx context.Context, id BastionHostId) 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/network/2023-05-01/bastionhosts/method_deletebastionshareablelink.go b/resource-manager/network/2023-05-01/bastionhosts/method_deletebastionshareablelink.go deleted file mode 100644 index 24694223a11..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_deletebastionshareablelink.go +++ /dev/null @@ -1,74 +0,0 @@ -package bastionhosts - -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 DeleteBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeleteBastionShareableLink ... -func (c BastionHostsClient) DeleteBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result DeleteBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/deleteShareableLinks", 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 -} - -// DeleteBastionShareableLinkThenPoll performs DeleteBastionShareableLink then polls until it's completed -func (c BastionHostsClient) DeleteBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.DeleteBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DeleteBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeleteBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/method_disconnectactivesessions.go b/resource-manager/network/2023-05-01/bastionhosts/method_disconnectactivesessions.go deleted file mode 100644 index 3a130339543..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_disconnectactivesessions.go +++ /dev/null @@ -1,91 +0,0 @@ -package bastionhosts - -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 DisconnectActiveSessionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionSessionState -} - -type DisconnectActiveSessionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionSessionState -} - -// DisconnectActiveSessions ... -func (c BastionHostsClient) DisconnectActiveSessions(ctx context.Context, id BastionHostId, input SessionIds) (result DisconnectActiveSessionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnectActiveSessions", 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 *[]BastionSessionState `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DisconnectActiveSessionsComplete retrieves all the results into a single object -func (c BastionHostsClient) DisconnectActiveSessionsComplete(ctx context.Context, id BastionHostId, input SessionIds) (DisconnectActiveSessionsCompleteResult, error) { - return c.DisconnectActiveSessionsCompleteMatchingPredicate(ctx, id, input, BastionSessionStateOperationPredicate{}) -} - -// DisconnectActiveSessionsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) DisconnectActiveSessionsCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input SessionIds, predicate BastionSessionStateOperationPredicate) (result DisconnectActiveSessionsCompleteResult, err error) { - items := make([]BastionSessionState, 0) - - resp, err := c.DisconnectActiveSessions(ctx, id, input) - if err != nil { - 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 = DisconnectActiveSessionsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/method_get.go b/resource-manager/network/2023-05-01/bastionhosts/method_get.go deleted file mode 100644 index 71b1a85a45f..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bastionhosts - -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 *BastionHost -} - -// Get ... -func (c BastionHostsClient) Get(ctx context.Context, id BastionHostId) (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 BastionHost - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/method_getactivesessions.go b/resource-manager/network/2023-05-01/bastionhosts/method_getactivesessions.go deleted file mode 100644 index bc50f38fc50..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_getactivesessions.go +++ /dev/null @@ -1,76 +0,0 @@ -package bastionhosts - -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 GetActiveSessionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionActiveSession -} - -type GetActiveSessionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionActiveSession -} - -// GetActiveSessions ... -func (c BastionHostsClient) GetActiveSessions(ctx context.Context, id BastionHostId) (result GetActiveSessionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getActiveSessions", 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 -} - -// GetActiveSessionsThenPoll performs GetActiveSessions then polls until it's completed -func (c BastionHostsClient) GetActiveSessionsThenPoll(ctx context.Context, id BastionHostId) error { - result, err := c.GetActiveSessions(ctx, id) - if err != nil { - return fmt.Errorf("performing GetActiveSessions: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetActiveSessions: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/method_getbastionshareablelink.go b/resource-manager/network/2023-05-01/bastionhosts/method_getbastionshareablelink.go deleted file mode 100644 index 1d277c1e88c..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_getbastionshareablelink.go +++ /dev/null @@ -1,91 +0,0 @@ -package bastionhosts - -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 GetBastionShareableLinkOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type GetBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// GetBastionShareableLink ... -func (c BastionHostsClient) GetBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result GetBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getShareableLinks", 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 *[]BastionShareableLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetBastionShareableLinkComplete retrieves all the results into a single object -func (c BastionHostsClient) GetBastionShareableLinkComplete(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (GetBastionShareableLinkCompleteResult, error) { - return c.GetBastionShareableLinkCompleteMatchingPredicate(ctx, id, input, BastionShareableLinkOperationPredicate{}) -} - -// GetBastionShareableLinkCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) GetBastionShareableLinkCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest, predicate BastionShareableLinkOperationPredicate) (result GetBastionShareableLinkCompleteResult, err error) { - items := make([]BastionShareableLink, 0) - - resp, err := c.GetBastionShareableLink(ctx, id, input) - if err != nil { - 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 = GetBastionShareableLinkCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/method_list.go b/resource-manager/network/2023-05-01/bastionhosts/method_list.go deleted file mode 100644 index db4bc8f1fae..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package bastionhosts - -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 *[]BastionHost -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionHost -} - -// List ... -func (c BastionHostsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/bastionHosts", 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 *[]BastionHost `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 BastionHostsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BastionHostOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate BastionHostOperationPredicate) (result ListCompleteResult, err error) { - items := make([]BastionHost, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/bastionhosts/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/bastionhosts/method_listbyresourcegroup.go deleted file mode 100644 index 20db6e5a89f..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package bastionhosts - -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 *[]BastionHost -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionHost -} - -// ListByResourceGroup ... -func (c BastionHostsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/bastionHosts", 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 *[]BastionHost `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 BastionHostsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, BastionHostOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate BastionHostOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]BastionHost, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/bastionhosts/method_putbastionshareablelink.go b/resource-manager/network/2023-05-01/bastionhosts/method_putbastionshareablelink.go deleted file mode 100644 index 5f6e7438551..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_putbastionshareablelink.go +++ /dev/null @@ -1,80 +0,0 @@ -package bastionhosts - -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 PutBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type PutBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// PutBastionShareableLink ... -func (c BastionHostsClient) PutBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result PutBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createShareableLinks", 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 -} - -// PutBastionShareableLinkThenPoll performs PutBastionShareableLink then polls until it's completed -func (c BastionHostsClient) PutBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.PutBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PutBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PutBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/method_updatetags.go b/resource-manager/network/2023-05-01/bastionhosts/method_updatetags.go deleted file mode 100644 index 697efefb0c8..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package bastionhosts - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BastionHost -} - -// UpdateTags ... -func (c BastionHostsClient) UpdateTags(ctx context.Context, id BastionHostId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c BastionHostsClient) UpdateTagsThenPoll(ctx context.Context, id BastionHostId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/bastionhosts/model_bastionactivesession.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionactivesession.go deleted file mode 100644 index 4f5fe8c844e..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionactivesession.go +++ /dev/null @@ -1,18 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionActiveSession struct { - Protocol *BastionConnectProtocol `json:"protocol,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` - SessionDurationInMins *float64 `json:"sessionDurationInMins,omitempty"` - SessionId *string `json:"sessionId,omitempty"` - StartTime *interface{} `json:"startTime,omitempty"` - TargetHostName *string `json:"targetHostName,omitempty"` - TargetIPAddress *string `json:"targetIpAddress,omitempty"` - TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` - TargetSubscriptionId *string `json:"targetSubscriptionId,omitempty"` - UserName *string `json:"userName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhost.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionhost.go deleted file mode 100644 index e9545c59424..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhost.go +++ /dev/null @@ -1,15 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHost struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BastionHostPropertiesFormat `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfiguration.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfiguration.go deleted file mode 100644 index efda704773c..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go deleted file mode 100644 index 34d950723a1..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostIPConfigurationPropertiesFormat struct { - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress SubResource `json:"publicIPAddress"` - Subnet SubResource `json:"subnet"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformat.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformat.go deleted file mode 100644 index 32bf85022ef..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostPropertiesFormat struct { - DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` - DnsName *string `json:"dnsName,omitempty"` - EnableFileCopy *bool `json:"enableFileCopy,omitempty"` - EnableIPConnect *bool `json:"enableIpConnect,omitempty"` - EnableKerberos *bool `json:"enableKerberos,omitempty"` - EnableShareableLink *bool `json:"enableShareableLink,omitempty"` - EnableTunneling *bool `json:"enableTunneling,omitempty"` - IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` - NetworkAcls *BastionHostPropertiesFormatNetworkAcls `json:"networkAcls,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ScaleUnits *int64 `json:"scaleUnits,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go deleted file mode 100644 index f217ff8d9ae..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostPropertiesFormatNetworkAcls struct { - IPRules *[]IPRule `json:"ipRules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionsessionstate.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionsessionstate.go deleted file mode 100644 index f60a5f77620..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionsessionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionSessionState struct { - Message *string `json:"message,omitempty"` - SessionId *string `json:"sessionId,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelink.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelink.go deleted file mode 100644 index 4da004b8f53..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLink struct { - Bsl *string `json:"bsl,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - Message *string `json:"message,omitempty"` - VM Resource `json:"vm"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelinklistrequest.go b/resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelinklistrequest.go deleted file mode 100644 index 925995fca64..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_bastionshareablelinklistrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkListRequest struct { - VMs *[]BastionShareableLink `json:"vms,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_iprule.go b/resource-manager/network/2023-05-01/bastionhosts/model_iprule.go deleted file mode 100644 index a54a84aac8e..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_iprule.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPRule struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_resource.go b/resource-manager/network/2023-05-01/bastionhosts/model_resource.go deleted file mode 100644 index 17e7756ce3c..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_resource.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Resource struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_sessionids.go b/resource-manager/network/2023-05-01/bastionhosts/model_sessionids.go deleted file mode 100644 index a74e44a3ebd..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_sessionids.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionIds struct { - SessionIds *[]string `json:"sessionIds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_sku.go b/resource-manager/network/2023-05-01/bastionhosts/model_sku.go deleted file mode 100644 index 1a8a8749a46..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_sku.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Name *BastionHostSkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_subresource.go b/resource-manager/network/2023-05-01/bastionhosts/model_subresource.go deleted file mode 100644 index 7a0a23a149a..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/model_tagsobject.go b/resource-manager/network/2023-05-01/bastionhosts/model_tagsobject.go deleted file mode 100644 index 73566b88f0b..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// 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/network/2023-05-01/bastionhosts/predicates.go b/resource-manager/network/2023-05-01/bastionhosts/predicates.go deleted file mode 100644 index 3c3835a32d0..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/predicates.go +++ /dev/null @@ -1,141 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionActiveSessionOperationPredicate struct { - ResourceType *string - SessionDurationInMins *float64 - SessionId *string - StartTime *interface{} - TargetHostName *string - TargetIPAddress *string - TargetResourceGroup *string - TargetResourceId *string - TargetSubscriptionId *string - UserName *string -} - -func (p BastionActiveSessionOperationPredicate) Matches(input BastionActiveSession) bool { - - if p.ResourceType != nil && (input.ResourceType == nil || *p.ResourceType != *input.ResourceType) { - return false - } - - if p.SessionDurationInMins != nil && (input.SessionDurationInMins == nil || *p.SessionDurationInMins != *input.SessionDurationInMins) { - return false - } - - if p.SessionId != nil && (input.SessionId == nil || *p.SessionId != *input.SessionId) { - return false - } - - if p.StartTime != nil && (input.StartTime == nil || *p.StartTime != *input.StartTime) { - return false - } - - if p.TargetHostName != nil && (input.TargetHostName == nil || *p.TargetHostName != *input.TargetHostName) { - return false - } - - if p.TargetIPAddress != nil && (input.TargetIPAddress == nil || *p.TargetIPAddress != *input.TargetIPAddress) { - return false - } - - if p.TargetResourceGroup != nil && (input.TargetResourceGroup == nil || *p.TargetResourceGroup != *input.TargetResourceGroup) { - return false - } - - if p.TargetResourceId != nil && (input.TargetResourceId == nil || *p.TargetResourceId != *input.TargetResourceId) { - return false - } - - if p.TargetSubscriptionId != nil && (input.TargetSubscriptionId == nil || *p.TargetSubscriptionId != *input.TargetSubscriptionId) { - return false - } - - if p.UserName != nil && (input.UserName == nil || *p.UserName != *input.UserName) { - return false - } - - return true -} - -type BastionHostOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p BastionHostOperationPredicate) Matches(input BastionHost) 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 && (input.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 BastionSessionStateOperationPredicate struct { - Message *string - SessionId *string - State *string -} - -func (p BastionSessionStateOperationPredicate) Matches(input BastionSessionState) bool { - - if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { - return false - } - - if p.SessionId != nil && (input.SessionId == nil || *p.SessionId != *input.SessionId) { - return false - } - - if p.State != nil && (input.State == nil || *p.State != *input.State) { - return false - } - - return true -} - -type BastionShareableLinkOperationPredicate struct { - Bsl *string - CreatedAt *string - Message *string -} - -func (p BastionShareableLinkOperationPredicate) Matches(input BastionShareableLink) bool { - - if p.Bsl != nil && (input.Bsl == nil || *p.Bsl != *input.Bsl) { - return false - } - - if p.CreatedAt != nil && (input.CreatedAt == nil || *p.CreatedAt != *input.CreatedAt) { - return false - } - - if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/bastionhosts/version.go b/resource-manager/network/2023-05-01/bastionhosts/version.go deleted file mode 100644 index d1f7a809be4..00000000000 --- a/resource-manager/network/2023-05-01/bastionhosts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bastionhosts/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/README.md b/resource-manager/network/2023-05-01/bastionshareablelink/README.md deleted file mode 100644 index f2e71a4e7b4..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/bastionshareablelink` Documentation - -The `bastionshareablelink` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/bastionshareablelink" -``` - - -### Client Initialization - -```go -client := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BastionShareableLinkClient.DeleteBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionShareableLinkClient.GetBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionShareableLinkClient.PutBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/client.go b/resource-manager/network/2023-05-01/bastionshareablelink/client.go deleted file mode 100644 index 9c49b25b52f..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bastionshareablelink - -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 BastionShareableLinkClient struct { - Client *resourcemanager.Client -} - -func NewBastionShareableLinkClientWithBaseURI(sdkApi sdkEnv.Api) (*BastionShareableLinkClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bastionshareablelink", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BastionShareableLinkClient: %+v", err) - } - - return &BastionShareableLinkClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost.go b/resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost.go deleted file mode 100644 index b2cc2bfc5be..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost.go +++ /dev/null @@ -1,130 +0,0 @@ -package bastionshareablelink - -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(&BastionHostId{}) -} - -var _ resourceids.ResourceId = &BastionHostId{} - -// BastionHostId is a struct representing the Resource ID for a Bastion Host -type BastionHostId struct { - SubscriptionId string - ResourceGroupName string - BastionHostName string -} - -// NewBastionHostID returns a new BastionHostId struct -func NewBastionHostID(subscriptionId string, resourceGroupName string, bastionHostName string) BastionHostId { - return BastionHostId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - BastionHostName: bastionHostName, - } -} - -// ParseBastionHostID parses 'input' into a BastionHostId -func ParseBastionHostID(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBastionHostIDInsensitively parses 'input' case-insensitively into a BastionHostId -// note: this method should only be used for API response data and not user input -func ParseBastionHostIDInsensitively(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BastionHostId) 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.BastionHostName, ok = input.Parsed["bastionHostName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bastionHostName", input) - } - - return nil -} - -// ValidateBastionHostID checks that 'input' can be parsed as a Bastion Host ID -func ValidateBastionHostID(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 := ParseBastionHostID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bastion Host ID -func (id BastionHostId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/bastionHosts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.BastionHostName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bastion Host ID -func (id BastionHostId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticBastionHosts", "bastionHosts", "bastionHosts"), - resourceids.UserSpecifiedSegment("bastionHostName", "bastionHostValue"), - } -} - -// String returns a human-readable description of this Bastion Host ID -func (id BastionHostId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Bastion Host Name: %q", id.BastionHostName), - } - return fmt.Sprintf("Bastion Host (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost_test.go b/resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost_test.go deleted file mode 100644 index ee09527e52f..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/id_bastionhost_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bastionshareablelink - -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 = &BastionHostId{} - -func TestNewBastionHostID(t *testing.T) { - id := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - - 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.BastionHostName != "bastionHostValue" { - t.Fatalf("Expected %q but got %q for Segment 'BastionHostName'", id.BastionHostName, "bastionHostValue") - } -} - -func TestFormatBastionHostID(t *testing.T) { - actual := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBastionHostID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostID(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestParseBastionHostIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BastionHostName: "bAsTiOnHoStVaLuE", - }, - }, - { - // 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.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostIDInsensitively(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestSegmentsForBastionHostId(t *testing.T) { - segments := BastionHostId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BastionHostId 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/network/2023-05-01/bastionshareablelink/method_deletebastionshareablelink.go b/resource-manager/network/2023-05-01/bastionshareablelink/method_deletebastionshareablelink.go deleted file mode 100644 index 6b46bbc5fea..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/method_deletebastionshareablelink.go +++ /dev/null @@ -1,74 +0,0 @@ -package bastionshareablelink - -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 DeleteBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeleteBastionShareableLink ... -func (c BastionShareableLinkClient) DeleteBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result DeleteBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/deleteShareableLinks", 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 -} - -// DeleteBastionShareableLinkThenPoll performs DeleteBastionShareableLink then polls until it's completed -func (c BastionShareableLinkClient) DeleteBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.DeleteBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DeleteBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeleteBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/method_getbastionshareablelink.go b/resource-manager/network/2023-05-01/bastionshareablelink/method_getbastionshareablelink.go deleted file mode 100644 index 689ab2d57fc..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/method_getbastionshareablelink.go +++ /dev/null @@ -1,91 +0,0 @@ -package bastionshareablelink - -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 GetBastionShareableLinkOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type GetBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// GetBastionShareableLink ... -func (c BastionShareableLinkClient) GetBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result GetBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getShareableLinks", 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 *[]BastionShareableLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetBastionShareableLinkComplete retrieves all the results into a single object -func (c BastionShareableLinkClient) GetBastionShareableLinkComplete(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (GetBastionShareableLinkCompleteResult, error) { - return c.GetBastionShareableLinkCompleteMatchingPredicate(ctx, id, input, BastionShareableLinkOperationPredicate{}) -} - -// GetBastionShareableLinkCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionShareableLinkClient) GetBastionShareableLinkCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest, predicate BastionShareableLinkOperationPredicate) (result GetBastionShareableLinkCompleteResult, err error) { - items := make([]BastionShareableLink, 0) - - resp, err := c.GetBastionShareableLink(ctx, id, input) - if err != nil { - 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 = GetBastionShareableLinkCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/method_putbastionshareablelink.go b/resource-manager/network/2023-05-01/bastionshareablelink/method_putbastionshareablelink.go deleted file mode 100644 index bf85b28ee63..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/method_putbastionshareablelink.go +++ /dev/null @@ -1,80 +0,0 @@ -package bastionshareablelink - -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 PutBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type PutBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// PutBastionShareableLink ... -func (c BastionShareableLinkClient) PutBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result PutBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createShareableLinks", 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 -} - -// PutBastionShareableLinkThenPoll performs PutBastionShareableLink then polls until it's completed -func (c BastionShareableLinkClient) PutBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.PutBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PutBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PutBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelink.go b/resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelink.go deleted file mode 100644 index a0bc0647825..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLink struct { - Bsl *string `json:"bsl,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - Message *string `json:"message,omitempty"` - VM Resource `json:"vm"` -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelinklistrequest.go b/resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelinklistrequest.go deleted file mode 100644 index e41fcb083d8..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/model_bastionshareablelinklistrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkListRequest struct { - VMs *[]BastionShareableLink `json:"vms,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/model_resource.go b/resource-manager/network/2023-05-01/bastionshareablelink/model_resource.go deleted file mode 100644 index 31d5ef85703..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/model_resource.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Resource struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/predicates.go b/resource-manager/network/2023-05-01/bastionshareablelink/predicates.go deleted file mode 100644 index 15f07095262..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkOperationPredicate struct { - Bsl *string - CreatedAt *string - Message *string -} - -func (p BastionShareableLinkOperationPredicate) Matches(input BastionShareableLink) bool { - - if p.Bsl != nil && (input.Bsl == nil || *p.Bsl != *input.Bsl) { - return false - } - - if p.CreatedAt != nil && (input.CreatedAt == nil || *p.CreatedAt != *input.CreatedAt) { - return false - } - - if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/bastionshareablelink/version.go b/resource-manager/network/2023-05-01/bastionshareablelink/version.go deleted file mode 100644 index e9c5c4f8881..00000000000 --- a/resource-manager/network/2023-05-01/bastionshareablelink/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionshareablelink - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bastionshareablelink/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/bgpservicecommunities/README.md b/resource-manager/network/2023-05-01/bgpservicecommunities/README.md deleted file mode 100644 index 182a522d1ac..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/bgpservicecommunities` Documentation - -The `bgpservicecommunities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/bgpservicecommunities" -``` - - -### Client Initialization - -```go -client := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BgpServiceCommunitiesClient.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 -} -``` diff --git a/resource-manager/network/2023-05-01/bgpservicecommunities/client.go b/resource-manager/network/2023-05-01/bgpservicecommunities/client.go deleted file mode 100644 index 07cf4f59649..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bgpservicecommunities - -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 BgpServiceCommunitiesClient struct { - Client *resourcemanager.Client -} - -func NewBgpServiceCommunitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*BgpServiceCommunitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bgpservicecommunities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BgpServiceCommunitiesClient: %+v", err) - } - - return &BgpServiceCommunitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/bgpservicecommunities/method_list.go b/resource-manager/network/2023-05-01/bgpservicecommunities/method_list.go deleted file mode 100644 index d15a74f2d18..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package bgpservicecommunities - -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 *[]BgpServiceCommunity -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BgpServiceCommunity -} - -// List ... -func (c BgpServiceCommunitiesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/bgpServiceCommunities", 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 *[]BgpServiceCommunity `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 BgpServiceCommunitiesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BgpServiceCommunityOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BgpServiceCommunitiesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate BgpServiceCommunityOperationPredicate) (result ListCompleteResult, err error) { - items := make([]BgpServiceCommunity, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/bgpservicecommunities/model_bgpcommunity.go b/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpcommunity.go deleted file mode 100644 index 87cd63647eb..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpcommunity.go +++ /dev/null @@ -1,13 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BGPCommunity struct { - CommunityName *string `json:"communityName,omitempty"` - CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` - CommunityValue *string `json:"communityValue,omitempty"` - IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` - ServiceGroup *string `json:"serviceGroup,omitempty"` - ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunity.go b/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunity.go deleted file mode 100644 index 0fad9ca63e5..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunity.go +++ /dev/null @@ -1,13 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpServiceCommunity struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go b/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go deleted file mode 100644 index 5bf2c270ecc..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpServiceCommunityPropertiesFormat struct { - BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/bgpservicecommunities/predicates.go b/resource-manager/network/2023-05-01/bgpservicecommunities/predicates.go deleted file mode 100644 index 2e90f55ae55..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpServiceCommunityOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p BgpServiceCommunityOperationPredicate) Matches(input BgpServiceCommunity) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/network/2023-05-01/bgpservicecommunities/version.go b/resource-manager/network/2023-05-01/bgpservicecommunities/version.go deleted file mode 100644 index 1596658c2f8..00000000000 --- a/resource-manager/network/2023-05-01/bgpservicecommunities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bgpservicecommunities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bgpservicecommunities/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/checkdnsavailabilities/README.md b/resource-manager/network/2023-05-01/checkdnsavailabilities/README.md deleted file mode 100644 index a4435a475e4..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/checkdnsavailabilities` Documentation - -The `checkdnsavailabilities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/checkdnsavailabilities" -``` - - -### Client Initialization - -```go -client := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CheckDnsAvailabilitiesClient.CheckDnsNameAvailability` - -```go -ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/network/2023-05-01/checkdnsavailabilities/client.go b/resource-manager/network/2023-05-01/checkdnsavailabilities/client.go deleted file mode 100644 index 14eb1a4baa0..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package checkdnsavailabilities - -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 CheckDnsAvailabilitiesClient struct { - Client *resourcemanager.Client -} - -func NewCheckDnsAvailabilitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*CheckDnsAvailabilitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "checkdnsavailabilities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CheckDnsAvailabilitiesClient: %+v", err) - } - - return &CheckDnsAvailabilitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2023-05-01/checkdnsavailabilities/id_location.go deleted file mode 100644 index 1adf8c560da..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package checkdnsavailabilities - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2023-05-01/checkdnsavailabilities/id_location_test.go deleted file mode 100644 index 17ddce78457..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package checkdnsavailabilities - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/checkdnsavailabilities/method_checkdnsnameavailability.go b/resource-manager/network/2023-05-01/checkdnsavailabilities/method_checkdnsnameavailability.go deleted file mode 100644 index 7a516978d72..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/method_checkdnsnameavailability.go +++ /dev/null @@ -1,83 +0,0 @@ -package checkdnsavailabilities - -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 CheckDnsNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DnsNameAvailabilityResult -} - -type CheckDnsNameAvailabilityOperationOptions struct { - DomainNameLabel *string -} - -func DefaultCheckDnsNameAvailabilityOperationOptions() CheckDnsNameAvailabilityOperationOptions { - return CheckDnsNameAvailabilityOperationOptions{} -} - -func (o CheckDnsNameAvailabilityOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CheckDnsNameAvailabilityOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CheckDnsNameAvailabilityOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.DomainNameLabel != nil { - out.Append("domainNameLabel", fmt.Sprintf("%v", *o.DomainNameLabel)) - } - return &out -} - -// CheckDnsNameAvailability ... -func (c CheckDnsAvailabilitiesClient) CheckDnsNameAvailability(ctx context.Context, id LocationId, options CheckDnsNameAvailabilityOperationOptions) (result CheckDnsNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/checkDnsNameAvailability", id.ID()), - OptionsObject: options, - } - - 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 DnsNameAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go b/resource-manager/network/2023-05-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go deleted file mode 100644 index e12398a149f..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdnsavailabilities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsNameAvailabilityResult struct { - Available *bool `json:"available,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/checkdnsavailabilities/version.go b/resource-manager/network/2023-05-01/checkdnsavailabilities/version.go deleted file mode 100644 index 8f2392bd382..00000000000 --- a/resource-manager/network/2023-05-01/checkdnsavailabilities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package checkdnsavailabilities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/checkdnsavailabilities/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/client.go b/resource-manager/network/2023-05-01/client.go deleted file mode 100644 index ca97c058005..00000000000 --- a/resource-manager/network/2023-05-01/client.go +++ /dev/null @@ -1,982 +0,0 @@ -package v2023_05_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/network/2023-05-01/adminrulecollections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/adminrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgatewayprivateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgatewayprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationgatewaywafdynamicmanifests" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/applicationsecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/availabledelegations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/availableservicealiases" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/azurefirewalls" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/bastionhosts" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/bastionshareablelink" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/bgpservicecommunities" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/checkdnsavailabilities" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/cloudservicepublicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/connectionmonitors" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/connectivityconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/customipprefixes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ddoscustompolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ddosprotectionplans" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/dscpconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/dscpconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/endpointservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitarptable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitroutestable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitstats" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutegateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutelinks" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteportauthorizations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteports" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteportslocations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteproviderports" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteserviceproviders" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/firewallpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/flowlogs" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ipallocations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ipgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/loadbalancers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/localnetworkgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/natgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkinterfaces" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanageractiveconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagerconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkprofiles" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networksecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkvirtualappliances" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkwatchers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/p2svpngateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/packetcaptures" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privatednszonegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privateendpoints" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privatelinkservice" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privatelinkservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/publicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/publicipprefixes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routefilterrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routefilters" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routetables" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/scopeconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securityadminconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securitypartnerproviders" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securityrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/serviceendpointpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/servicetags" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/staticmembers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/subnets" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/trafficanalytics" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/usages" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vipswap" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualappliancesites" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualapplianceskus" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworkgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworkpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworks" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworktap" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworktaps" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualrouterpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualrouters" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualwans" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vmsspublicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpngateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpnlinkconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpnserverconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpnsites" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/webapplicationfirewallpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/webcategories" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - AdminRuleCollections *adminrulecollections.AdminRuleCollectionsClient - AdminRules *adminrules.AdminRulesClient - ApplicationGatewayPrivateEndpointConnections *applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnectionsClient - ApplicationGatewayPrivateLinkResources *applicationgatewayprivatelinkresources.ApplicationGatewayPrivateLinkResourcesClient - ApplicationGatewayWafDynamicManifests *applicationgatewaywafdynamicmanifests.ApplicationGatewayWafDynamicManifestsClient - ApplicationGateways *applicationgateways.ApplicationGatewaysClient - ApplicationSecurityGroups *applicationsecuritygroups.ApplicationSecurityGroupsClient - AvailableDelegations *availabledelegations.AvailableDelegationsClient - AvailableServiceAliases *availableservicealiases.AvailableServiceAliasesClient - AzureFirewalls *azurefirewalls.AzureFirewallsClient - BastionHosts *bastionhosts.BastionHostsClient - BastionShareableLink *bastionshareablelink.BastionShareableLinkClient - BgpServiceCommunities *bgpservicecommunities.BgpServiceCommunitiesClient - CheckDnsAvailabilities *checkdnsavailabilities.CheckDnsAvailabilitiesClient - CloudServicePublicIPAddresses *cloudservicepublicipaddresses.CloudServicePublicIPAddressesClient - ConnectionMonitors *connectionmonitors.ConnectionMonitorsClient - ConnectivityConfigurations *connectivityconfigurations.ConnectivityConfigurationsClient - CustomIPPrefixes *customipprefixes.CustomIPPrefixesClient - DdosCustomPolicies *ddoscustompolicies.DdosCustomPoliciesClient - DdosProtectionPlans *ddosprotectionplans.DdosProtectionPlansClient - DscpConfiguration *dscpconfiguration.DscpConfigurationClient - DscpConfigurations *dscpconfigurations.DscpConfigurationsClient - EndpointServices *endpointservices.EndpointServicesClient - ExpressRouteCircuitArpTable *expressroutecircuitarptable.ExpressRouteCircuitArpTableClient - ExpressRouteCircuitAuthorizations *expressroutecircuitauthorizations.ExpressRouteCircuitAuthorizationsClient - ExpressRouteCircuitConnections *expressroutecircuitconnections.ExpressRouteCircuitConnectionsClient - ExpressRouteCircuitPeerings *expressroutecircuitpeerings.ExpressRouteCircuitPeeringsClient - ExpressRouteCircuitRoutesTable *expressroutecircuitroutestable.ExpressRouteCircuitRoutesTableClient - ExpressRouteCircuitRoutesTableSummary *expressroutecircuitroutestablesummary.ExpressRouteCircuitRoutesTableSummaryClient - ExpressRouteCircuitStats *expressroutecircuitstats.ExpressRouteCircuitStatsClient - ExpressRouteCircuits *expressroutecircuits.ExpressRouteCircuitsClient - ExpressRouteConnections *expressrouteconnections.ExpressRouteConnectionsClient - ExpressRouteCrossConnectionArpTable *expressroutecrossconnectionarptable.ExpressRouteCrossConnectionArpTableClient - ExpressRouteCrossConnectionPeerings *expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeeringsClient - ExpressRouteCrossConnectionRouteTable *expressroutecrossconnectionroutetable.ExpressRouteCrossConnectionRouteTableClient - ExpressRouteCrossConnectionRouteTableSummary *expressroutecrossconnectionroutetablesummary.ExpressRouteCrossConnectionRouteTableSummaryClient - ExpressRouteCrossConnections *expressroutecrossconnections.ExpressRouteCrossConnectionsClient - ExpressRouteGateways *expressroutegateways.ExpressRouteGatewaysClient - ExpressRouteLinks *expressroutelinks.ExpressRouteLinksClient - ExpressRoutePortAuthorizations *expressrouteportauthorizations.ExpressRoutePortAuthorizationsClient - ExpressRoutePorts *expressrouteports.ExpressRoutePortsClient - ExpressRoutePortsLocations *expressrouteportslocations.ExpressRoutePortsLocationsClient - ExpressRouteProviderPorts *expressrouteproviderports.ExpressRouteProviderPortsClient - ExpressRouteServiceProviders *expressrouteserviceproviders.ExpressRouteServiceProvidersClient - FirewallPolicies *firewallpolicies.FirewallPoliciesClient - FirewallPolicyRuleCollectionGroups *firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroupsClient - FlowLogs *flowlogs.FlowLogsClient - IPAllocations *ipallocations.IPAllocationsClient - IPGroups *ipgroups.IPGroupsClient - LoadBalancers *loadbalancers.LoadBalancersClient - LocalNetworkGateways *localnetworkgateways.LocalNetworkGatewaysClient - NatGateways *natgateways.NatGatewaysClient - NetworkGroups *networkgroups.NetworkGroupsClient - NetworkInterfaces *networkinterfaces.NetworkInterfacesClient - NetworkManagerActiveConfigurations *networkmanageractiveconfigurations.NetworkManagerActiveConfigurationsClient - NetworkManagerActiveConnectivityConfigurations *networkmanageractiveconnectivityconfigurations.NetworkManagerActiveConnectivityConfigurationsClient - NetworkManagerConnections *networkmanagerconnections.NetworkManagerConnectionsClient - NetworkManagerEffectiveConnectivityConfiguration *networkmanagereffectiveconnectivityconfiguration.NetworkManagerEffectiveConnectivityConfigurationClient - NetworkManagerEffectiveSecurityAdminRules *networkmanagereffectivesecurityadminrules.NetworkManagerEffectiveSecurityAdminRulesClient - NetworkManagers *networkmanagers.NetworkManagersClient - NetworkProfiles *networkprofiles.NetworkProfilesClient - NetworkSecurityGroups *networksecuritygroups.NetworkSecurityGroupsClient - NetworkVirtualAppliances *networkvirtualappliances.NetworkVirtualAppliancesClient - NetworkWatchers *networkwatchers.NetworkWatchersClient - P2sVpnGateways *p2svpngateways.P2sVpnGatewaysClient - PacketCaptures *packetcaptures.PacketCapturesClient - PeerExpressRouteCircuitConnections *peerexpressroutecircuitconnections.PeerExpressRouteCircuitConnectionsClient - PrivateDnsZoneGroups *privatednszonegroups.PrivateDnsZoneGroupsClient - PrivateEndpoints *privateendpoints.PrivateEndpointsClient - PrivateLinkService *privatelinkservice.PrivateLinkServiceClient - PrivateLinkServices *privatelinkservices.PrivateLinkServicesClient - PublicIPAddresses *publicipaddresses.PublicIPAddressesClient - PublicIPPrefixes *publicipprefixes.PublicIPPrefixesClient - RouteFilterRules *routefilterrules.RouteFilterRulesClient - RouteFilters *routefilters.RouteFiltersClient - RouteTables *routetables.RouteTablesClient - Routes *routes.RoutesClient - ScopeConnections *scopeconnections.ScopeConnectionsClient - SecurityAdminConfigurations *securityadminconfigurations.SecurityAdminConfigurationsClient - SecurityPartnerProviders *securitypartnerproviders.SecurityPartnerProvidersClient - SecurityRules *securityrules.SecurityRulesClient - ServiceEndpointPolicies *serviceendpointpolicies.ServiceEndpointPoliciesClient - ServiceEndpointPolicyDefinitions *serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinitionsClient - ServiceTags *servicetags.ServiceTagsClient - StaticMembers *staticmembers.StaticMembersClient - Subnets *subnets.SubnetsClient - TrafficAnalytics *trafficanalytics.TrafficAnalyticsClient - Usages *usages.UsagesClient - VMSSPublicIPAddresses *vmsspublicipaddresses.VMSSPublicIPAddressesClient - VipSwap *vipswap.VipSwapClient - VirtualApplianceSites *virtualappliancesites.VirtualApplianceSitesClient - VirtualApplianceSkus *virtualapplianceskus.VirtualApplianceSkusClient - VirtualNetworkGatewayConnections *virtualnetworkgatewayconnections.VirtualNetworkGatewayConnectionsClient - VirtualNetworkGateways *virtualnetworkgateways.VirtualNetworkGatewaysClient - VirtualNetworkPeerings *virtualnetworkpeerings.VirtualNetworkPeeringsClient - VirtualNetworkTap *virtualnetworktap.VirtualNetworkTapClient - VirtualNetworkTaps *virtualnetworktaps.VirtualNetworkTapsClient - VirtualNetworks *virtualnetworks.VirtualNetworksClient - VirtualRouterPeerings *virtualrouterpeerings.VirtualRouterPeeringsClient - VirtualRouters *virtualrouters.VirtualRoutersClient - VirtualWANs *virtualwans.VirtualWANsClient - VpnGateways *vpngateways.VpnGatewaysClient - VpnLinkConnections *vpnlinkconnections.VpnLinkConnectionsClient - VpnServerConfigurations *vpnserverconfigurations.VpnServerConfigurationsClient - VpnSites *vpnsites.VpnSitesClient - WebApplicationFirewallPolicies *webapplicationfirewallpolicies.WebApplicationFirewallPoliciesClient - WebCategories *webcategories.WebCategoriesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - adminRuleCollectionsClient, err := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdminRuleCollections client: %+v", err) - } - configureFunc(adminRuleCollectionsClient.Client) - - adminRulesClient, err := adminrules.NewAdminRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdminRules client: %+v", err) - } - configureFunc(adminRulesClient.Client) - - applicationGatewayPrivateEndpointConnectionsClient, err := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayPrivateEndpointConnections client: %+v", err) - } - configureFunc(applicationGatewayPrivateEndpointConnectionsClient.Client) - - applicationGatewayPrivateLinkResourcesClient, err := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayPrivateLinkResources client: %+v", err) - } - configureFunc(applicationGatewayPrivateLinkResourcesClient.Client) - - applicationGatewayWafDynamicManifestsClient, err := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayWafDynamicManifests client: %+v", err) - } - configureFunc(applicationGatewayWafDynamicManifestsClient.Client) - - applicationGatewaysClient, err := applicationgateways.NewApplicationGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGateways client: %+v", err) - } - configureFunc(applicationGatewaysClient.Client) - - applicationSecurityGroupsClient, err := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationSecurityGroups client: %+v", err) - } - configureFunc(applicationSecurityGroupsClient.Client) - - availableDelegationsClient, err := availabledelegations.NewAvailableDelegationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AvailableDelegations client: %+v", err) - } - configureFunc(availableDelegationsClient.Client) - - availableServiceAliasesClient, err := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AvailableServiceAliases client: %+v", err) - } - configureFunc(availableServiceAliasesClient.Client) - - azureFirewallsClient, err := azurefirewalls.NewAzureFirewallsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AzureFirewalls client: %+v", err) - } - configureFunc(azureFirewallsClient.Client) - - bastionHostsClient, err := bastionhosts.NewBastionHostsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BastionHosts client: %+v", err) - } - configureFunc(bastionHostsClient.Client) - - bastionShareableLinkClient, err := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BastionShareableLink client: %+v", err) - } - configureFunc(bastionShareableLinkClient.Client) - - bgpServiceCommunitiesClient, err := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BgpServiceCommunities client: %+v", err) - } - configureFunc(bgpServiceCommunitiesClient.Client) - - checkDnsAvailabilitiesClient, err := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CheckDnsAvailabilities client: %+v", err) - } - configureFunc(checkDnsAvailabilitiesClient.Client) - - cloudServicePublicIPAddressesClient, err := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CloudServicePublicIPAddresses client: %+v", err) - } - configureFunc(cloudServicePublicIPAddressesClient.Client) - - connectionMonitorsClient, err := connectionmonitors.NewConnectionMonitorsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConnectionMonitors client: %+v", err) - } - configureFunc(connectionMonitorsClient.Client) - - connectivityConfigurationsClient, err := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConnectivityConfigurations client: %+v", err) - } - configureFunc(connectivityConfigurationsClient.Client) - - customIPPrefixesClient, err := customipprefixes.NewCustomIPPrefixesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CustomIPPrefixes client: %+v", err) - } - configureFunc(customIPPrefixesClient.Client) - - ddosCustomPoliciesClient, err := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DdosCustomPolicies client: %+v", err) - } - configureFunc(ddosCustomPoliciesClient.Client) - - ddosProtectionPlansClient, err := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DdosProtectionPlans client: %+v", err) - } - configureFunc(ddosProtectionPlansClient.Client) - - dscpConfigurationClient, err := dscpconfiguration.NewDscpConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DscpConfiguration client: %+v", err) - } - configureFunc(dscpConfigurationClient.Client) - - dscpConfigurationsClient, err := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DscpConfigurations client: %+v", err) - } - configureFunc(dscpConfigurationsClient.Client) - - endpointServicesClient, err := endpointservices.NewEndpointServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EndpointServices client: %+v", err) - } - configureFunc(endpointServicesClient.Client) - - expressRouteCircuitArpTableClient, err := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitArpTable client: %+v", err) - } - configureFunc(expressRouteCircuitArpTableClient.Client) - - expressRouteCircuitAuthorizationsClient, err := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitAuthorizations client: %+v", err) - } - configureFunc(expressRouteCircuitAuthorizationsClient.Client) - - expressRouteCircuitConnectionsClient, err := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitConnections client: %+v", err) - } - configureFunc(expressRouteCircuitConnectionsClient.Client) - - expressRouteCircuitPeeringsClient, err := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitPeerings client: %+v", err) - } - configureFunc(expressRouteCircuitPeeringsClient.Client) - - expressRouteCircuitRoutesTableClient, err := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTable client: %+v", err) - } - configureFunc(expressRouteCircuitRoutesTableClient.Client) - - expressRouteCircuitRoutesTableSummaryClient, err := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTableSummary client: %+v", err) - } - configureFunc(expressRouteCircuitRoutesTableSummaryClient.Client) - - expressRouteCircuitStatsClient, err := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitStats client: %+v", err) - } - configureFunc(expressRouteCircuitStatsClient.Client) - - expressRouteCircuitsClient, err := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuits client: %+v", err) - } - configureFunc(expressRouteCircuitsClient.Client) - - expressRouteConnectionsClient, err := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteConnections client: %+v", err) - } - configureFunc(expressRouteConnectionsClient.Client) - - expressRouteCrossConnectionArpTableClient, err := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionArpTable client: %+v", err) - } - configureFunc(expressRouteCrossConnectionArpTableClient.Client) - - expressRouteCrossConnectionPeeringsClient, err := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionPeerings client: %+v", err) - } - configureFunc(expressRouteCrossConnectionPeeringsClient.Client) - - expressRouteCrossConnectionRouteTableClient, err := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTable client: %+v", err) - } - configureFunc(expressRouteCrossConnectionRouteTableClient.Client) - - expressRouteCrossConnectionRouteTableSummaryClient, err := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTableSummary client: %+v", err) - } - configureFunc(expressRouteCrossConnectionRouteTableSummaryClient.Client) - - expressRouteCrossConnectionsClient, err := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnections client: %+v", err) - } - configureFunc(expressRouteCrossConnectionsClient.Client) - - expressRouteGatewaysClient, err := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteGateways client: %+v", err) - } - configureFunc(expressRouteGatewaysClient.Client) - - expressRouteLinksClient, err := expressroutelinks.NewExpressRouteLinksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteLinks client: %+v", err) - } - configureFunc(expressRouteLinksClient.Client) - - expressRoutePortAuthorizationsClient, err := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePortAuthorizations client: %+v", err) - } - configureFunc(expressRoutePortAuthorizationsClient.Client) - - expressRoutePortsClient, err := expressrouteports.NewExpressRoutePortsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePorts client: %+v", err) - } - configureFunc(expressRoutePortsClient.Client) - - expressRoutePortsLocationsClient, err := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePortsLocations client: %+v", err) - } - configureFunc(expressRoutePortsLocationsClient.Client) - - expressRouteProviderPortsClient, err := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteProviderPorts client: %+v", err) - } - configureFunc(expressRouteProviderPortsClient.Client) - - expressRouteServiceProvidersClient, err := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteServiceProviders client: %+v", err) - } - configureFunc(expressRouteServiceProvidersClient.Client) - - firewallPoliciesClient, err := firewallpolicies.NewFirewallPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallPolicies client: %+v", err) - } - configureFunc(firewallPoliciesClient.Client) - - firewallPolicyRuleCollectionGroupsClient, err := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallPolicyRuleCollectionGroups client: %+v", err) - } - configureFunc(firewallPolicyRuleCollectionGroupsClient.Client) - - flowLogsClient, err := flowlogs.NewFlowLogsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FlowLogs client: %+v", err) - } - configureFunc(flowLogsClient.Client) - - iPAllocationsClient, err := ipallocations.NewIPAllocationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IPAllocations client: %+v", err) - } - configureFunc(iPAllocationsClient.Client) - - iPGroupsClient, err := ipgroups.NewIPGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IPGroups client: %+v", err) - } - configureFunc(iPGroupsClient.Client) - - loadBalancersClient, err := loadbalancers.NewLoadBalancersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LoadBalancers client: %+v", err) - } - configureFunc(loadBalancersClient.Client) - - localNetworkGatewaysClient, err := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LocalNetworkGateways client: %+v", err) - } - configureFunc(localNetworkGatewaysClient.Client) - - natGatewaysClient, err := natgateways.NewNatGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NatGateways client: %+v", err) - } - configureFunc(natGatewaysClient.Client) - - networkGroupsClient, err := networkgroups.NewNetworkGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkGroups client: %+v", err) - } - configureFunc(networkGroupsClient.Client) - - networkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkInterfaces client: %+v", err) - } - configureFunc(networkInterfacesClient.Client) - - networkManagerActiveConfigurationsClient, err := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerActiveConfigurations client: %+v", err) - } - configureFunc(networkManagerActiveConfigurationsClient.Client) - - networkManagerActiveConnectivityConfigurationsClient, err := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerActiveConnectivityConfigurations client: %+v", err) - } - configureFunc(networkManagerActiveConnectivityConfigurationsClient.Client) - - networkManagerConnectionsClient, err := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerConnections client: %+v", err) - } - configureFunc(networkManagerConnectionsClient.Client) - - networkManagerEffectiveConnectivityConfigurationClient, err := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerEffectiveConnectivityConfiguration client: %+v", err) - } - configureFunc(networkManagerEffectiveConnectivityConfigurationClient.Client) - - networkManagerEffectiveSecurityAdminRulesClient, err := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerEffectiveSecurityAdminRules client: %+v", err) - } - configureFunc(networkManagerEffectiveSecurityAdminRulesClient.Client) - - networkManagersClient, err := networkmanagers.NewNetworkManagersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagers client: %+v", err) - } - configureFunc(networkManagersClient.Client) - - networkProfilesClient, err := networkprofiles.NewNetworkProfilesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkProfiles client: %+v", err) - } - configureFunc(networkProfilesClient.Client) - - networkSecurityGroupsClient, err := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkSecurityGroups client: %+v", err) - } - configureFunc(networkSecurityGroupsClient.Client) - - networkVirtualAppliancesClient, err := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkVirtualAppliances client: %+v", err) - } - configureFunc(networkVirtualAppliancesClient.Client) - - networkWatchersClient, err := networkwatchers.NewNetworkWatchersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkWatchers client: %+v", err) - } - configureFunc(networkWatchersClient.Client) - - p2sVpnGatewaysClient, err := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building P2sVpnGateways client: %+v", err) - } - configureFunc(p2sVpnGatewaysClient.Client) - - packetCapturesClient, err := packetcaptures.NewPacketCapturesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PacketCaptures client: %+v", err) - } - configureFunc(packetCapturesClient.Client) - - peerExpressRouteCircuitConnectionsClient, err := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PeerExpressRouteCircuitConnections client: %+v", err) - } - configureFunc(peerExpressRouteCircuitConnectionsClient.Client) - - privateDnsZoneGroupsClient, err := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateDnsZoneGroups client: %+v", err) - } - configureFunc(privateDnsZoneGroupsClient.Client) - - privateEndpointsClient, err := privateendpoints.NewPrivateEndpointsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateEndpoints client: %+v", err) - } - configureFunc(privateEndpointsClient.Client) - - privateLinkServiceClient, err := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkService client: %+v", err) - } - configureFunc(privateLinkServiceClient.Client) - - privateLinkServicesClient, err := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkServices client: %+v", err) - } - configureFunc(privateLinkServicesClient.Client) - - publicIPAddressesClient, err := publicipaddresses.NewPublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicIPAddresses client: %+v", err) - } - configureFunc(publicIPAddressesClient.Client) - - publicIPPrefixesClient, err := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicIPPrefixes client: %+v", err) - } - configureFunc(publicIPPrefixesClient.Client) - - routeFilterRulesClient, err := routefilterrules.NewRouteFilterRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteFilterRules client: %+v", err) - } - configureFunc(routeFilterRulesClient.Client) - - routeFiltersClient, err := routefilters.NewRouteFiltersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteFilters client: %+v", err) - } - configureFunc(routeFiltersClient.Client) - - routeTablesClient, err := routetables.NewRouteTablesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteTables client: %+v", err) - } - configureFunc(routeTablesClient.Client) - - routesClient, err := routes.NewRoutesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Routes client: %+v", err) - } - configureFunc(routesClient.Client) - - scopeConnectionsClient, err := scopeconnections.NewScopeConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ScopeConnections client: %+v", err) - } - configureFunc(scopeConnectionsClient.Client) - - securityAdminConfigurationsClient, err := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityAdminConfigurations client: %+v", err) - } - configureFunc(securityAdminConfigurationsClient.Client) - - securityPartnerProvidersClient, err := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityPartnerProviders client: %+v", err) - } - configureFunc(securityPartnerProvidersClient.Client) - - securityRulesClient, err := securityrules.NewSecurityRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityRules client: %+v", err) - } - configureFunc(securityRulesClient.Client) - - serviceEndpointPoliciesClient, err := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceEndpointPolicies client: %+v", err) - } - configureFunc(serviceEndpointPoliciesClient.Client) - - serviceEndpointPolicyDefinitionsClient, err := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceEndpointPolicyDefinitions client: %+v", err) - } - configureFunc(serviceEndpointPolicyDefinitionsClient.Client) - - serviceTagsClient, err := servicetags.NewServiceTagsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceTags client: %+v", err) - } - configureFunc(serviceTagsClient.Client) - - staticMembersClient, err := staticmembers.NewStaticMembersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building StaticMembers client: %+v", err) - } - configureFunc(staticMembersClient.Client) - - subnetsClient, err := subnets.NewSubnetsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Subnets client: %+v", err) - } - configureFunc(subnetsClient.Client) - - trafficAnalyticsClient, err := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building TrafficAnalytics client: %+v", err) - } - configureFunc(trafficAnalyticsClient.Client) - - usagesClient, err := usages.NewUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Usages client: %+v", err) - } - configureFunc(usagesClient.Client) - - vMSSPublicIPAddressesClient, err := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VMSSPublicIPAddresses client: %+v", err) - } - configureFunc(vMSSPublicIPAddressesClient.Client) - - vipSwapClient, err := vipswap.NewVipSwapClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VipSwap client: %+v", err) - } - configureFunc(vipSwapClient.Client) - - virtualApplianceSitesClient, err := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualApplianceSites client: %+v", err) - } - configureFunc(virtualApplianceSitesClient.Client) - - virtualApplianceSkusClient, err := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualApplianceSkus client: %+v", err) - } - configureFunc(virtualApplianceSkusClient.Client) - - virtualNetworkGatewayConnectionsClient, err := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkGatewayConnections client: %+v", err) - } - configureFunc(virtualNetworkGatewayConnectionsClient.Client) - - virtualNetworkGatewaysClient, err := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkGateways client: %+v", err) - } - configureFunc(virtualNetworkGatewaysClient.Client) - - virtualNetworkPeeringsClient, err := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkPeerings client: %+v", err) - } - configureFunc(virtualNetworkPeeringsClient.Client) - - virtualNetworkTapClient, err := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkTap client: %+v", err) - } - configureFunc(virtualNetworkTapClient.Client) - - virtualNetworkTapsClient, err := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkTaps client: %+v", err) - } - configureFunc(virtualNetworkTapsClient.Client) - - virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) - } - configureFunc(virtualNetworksClient.Client) - - virtualRouterPeeringsClient, err := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualRouterPeerings client: %+v", err) - } - configureFunc(virtualRouterPeeringsClient.Client) - - virtualRoutersClient, err := virtualrouters.NewVirtualRoutersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualRouters client: %+v", err) - } - configureFunc(virtualRoutersClient.Client) - - virtualWANsClient, err := virtualwans.NewVirtualWANsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualWANs client: %+v", err) - } - configureFunc(virtualWANsClient.Client) - - vpnGatewaysClient, err := vpngateways.NewVpnGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnGateways client: %+v", err) - } - configureFunc(vpnGatewaysClient.Client) - - vpnLinkConnectionsClient, err := vpnlinkconnections.NewVpnLinkConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnLinkConnections client: %+v", err) - } - configureFunc(vpnLinkConnectionsClient.Client) - - vpnServerConfigurationsClient, err := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnServerConfigurations client: %+v", err) - } - configureFunc(vpnServerConfigurationsClient.Client) - - vpnSitesClient, err := vpnsites.NewVpnSitesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnSites client: %+v", err) - } - configureFunc(vpnSitesClient.Client) - - webApplicationFirewallPoliciesClient, err := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebApplicationFirewallPolicies client: %+v", err) - } - configureFunc(webApplicationFirewallPoliciesClient.Client) - - webCategoriesClient, err := webcategories.NewWebCategoriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebCategories client: %+v", err) - } - configureFunc(webCategoriesClient.Client) - - return &Client{ - AdminRuleCollections: adminRuleCollectionsClient, - AdminRules: adminRulesClient, - ApplicationGatewayPrivateEndpointConnections: applicationGatewayPrivateEndpointConnectionsClient, - ApplicationGatewayPrivateLinkResources: applicationGatewayPrivateLinkResourcesClient, - ApplicationGatewayWafDynamicManifests: applicationGatewayWafDynamicManifestsClient, - ApplicationGateways: applicationGatewaysClient, - ApplicationSecurityGroups: applicationSecurityGroupsClient, - AvailableDelegations: availableDelegationsClient, - AvailableServiceAliases: availableServiceAliasesClient, - AzureFirewalls: azureFirewallsClient, - BastionHosts: bastionHostsClient, - BastionShareableLink: bastionShareableLinkClient, - BgpServiceCommunities: bgpServiceCommunitiesClient, - CheckDnsAvailabilities: checkDnsAvailabilitiesClient, - CloudServicePublicIPAddresses: cloudServicePublicIPAddressesClient, - ConnectionMonitors: connectionMonitorsClient, - ConnectivityConfigurations: connectivityConfigurationsClient, - CustomIPPrefixes: customIPPrefixesClient, - DdosCustomPolicies: ddosCustomPoliciesClient, - DdosProtectionPlans: ddosProtectionPlansClient, - DscpConfiguration: dscpConfigurationClient, - DscpConfigurations: dscpConfigurationsClient, - EndpointServices: endpointServicesClient, - ExpressRouteCircuitArpTable: expressRouteCircuitArpTableClient, - ExpressRouteCircuitAuthorizations: expressRouteCircuitAuthorizationsClient, - ExpressRouteCircuitConnections: expressRouteCircuitConnectionsClient, - ExpressRouteCircuitPeerings: expressRouteCircuitPeeringsClient, - ExpressRouteCircuitRoutesTable: expressRouteCircuitRoutesTableClient, - ExpressRouteCircuitRoutesTableSummary: expressRouteCircuitRoutesTableSummaryClient, - ExpressRouteCircuitStats: expressRouteCircuitStatsClient, - ExpressRouteCircuits: expressRouteCircuitsClient, - ExpressRouteConnections: expressRouteConnectionsClient, - ExpressRouteCrossConnectionArpTable: expressRouteCrossConnectionArpTableClient, - ExpressRouteCrossConnectionPeerings: expressRouteCrossConnectionPeeringsClient, - ExpressRouteCrossConnectionRouteTable: expressRouteCrossConnectionRouteTableClient, - ExpressRouteCrossConnectionRouteTableSummary: expressRouteCrossConnectionRouteTableSummaryClient, - ExpressRouteCrossConnections: expressRouteCrossConnectionsClient, - ExpressRouteGateways: expressRouteGatewaysClient, - ExpressRouteLinks: expressRouteLinksClient, - ExpressRoutePortAuthorizations: expressRoutePortAuthorizationsClient, - ExpressRoutePorts: expressRoutePortsClient, - ExpressRoutePortsLocations: expressRoutePortsLocationsClient, - ExpressRouteProviderPorts: expressRouteProviderPortsClient, - ExpressRouteServiceProviders: expressRouteServiceProvidersClient, - FirewallPolicies: firewallPoliciesClient, - FirewallPolicyRuleCollectionGroups: firewallPolicyRuleCollectionGroupsClient, - FlowLogs: flowLogsClient, - IPAllocations: iPAllocationsClient, - IPGroups: iPGroupsClient, - LoadBalancers: loadBalancersClient, - LocalNetworkGateways: localNetworkGatewaysClient, - NatGateways: natGatewaysClient, - NetworkGroups: networkGroupsClient, - NetworkInterfaces: networkInterfacesClient, - NetworkManagerActiveConfigurations: networkManagerActiveConfigurationsClient, - NetworkManagerActiveConnectivityConfigurations: networkManagerActiveConnectivityConfigurationsClient, - NetworkManagerConnections: networkManagerConnectionsClient, - NetworkManagerEffectiveConnectivityConfiguration: networkManagerEffectiveConnectivityConfigurationClient, - NetworkManagerEffectiveSecurityAdminRules: networkManagerEffectiveSecurityAdminRulesClient, - NetworkManagers: networkManagersClient, - NetworkProfiles: networkProfilesClient, - NetworkSecurityGroups: networkSecurityGroupsClient, - NetworkVirtualAppliances: networkVirtualAppliancesClient, - NetworkWatchers: networkWatchersClient, - P2sVpnGateways: p2sVpnGatewaysClient, - PacketCaptures: packetCapturesClient, - PeerExpressRouteCircuitConnections: peerExpressRouteCircuitConnectionsClient, - PrivateDnsZoneGroups: privateDnsZoneGroupsClient, - PrivateEndpoints: privateEndpointsClient, - PrivateLinkService: privateLinkServiceClient, - PrivateLinkServices: privateLinkServicesClient, - PublicIPAddresses: publicIPAddressesClient, - PublicIPPrefixes: publicIPPrefixesClient, - RouteFilterRules: routeFilterRulesClient, - RouteFilters: routeFiltersClient, - RouteTables: routeTablesClient, - Routes: routesClient, - ScopeConnections: scopeConnectionsClient, - SecurityAdminConfigurations: securityAdminConfigurationsClient, - SecurityPartnerProviders: securityPartnerProvidersClient, - SecurityRules: securityRulesClient, - ServiceEndpointPolicies: serviceEndpointPoliciesClient, - ServiceEndpointPolicyDefinitions: serviceEndpointPolicyDefinitionsClient, - ServiceTags: serviceTagsClient, - StaticMembers: staticMembersClient, - Subnets: subnetsClient, - TrafficAnalytics: trafficAnalyticsClient, - Usages: usagesClient, - VMSSPublicIPAddresses: vMSSPublicIPAddressesClient, - VipSwap: vipSwapClient, - VirtualApplianceSites: virtualApplianceSitesClient, - VirtualApplianceSkus: virtualApplianceSkusClient, - VirtualNetworkGatewayConnections: virtualNetworkGatewayConnectionsClient, - VirtualNetworkGateways: virtualNetworkGatewaysClient, - VirtualNetworkPeerings: virtualNetworkPeeringsClient, - VirtualNetworkTap: virtualNetworkTapClient, - VirtualNetworkTaps: virtualNetworkTapsClient, - VirtualNetworks: virtualNetworksClient, - VirtualRouterPeerings: virtualRouterPeeringsClient, - VirtualRouters: virtualRoutersClient, - VirtualWANs: virtualWANsClient, - VpnGateways: vpnGatewaysClient, - VpnLinkConnections: vpnLinkConnectionsClient, - VpnServerConfigurations: vpnServerConfigurationsClient, - VpnSites: vpnSitesClient, - WebApplicationFirewallPolicies: webApplicationFirewallPoliciesClient, - WebCategories: webCategoriesClient, - }, nil -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/README.md b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/README.md deleted file mode 100644 index 9a700d0fd9e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/README.md +++ /dev/null @@ -1,71 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/cloudservicepublicipaddresses` Documentation - -The `cloudservicepublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/cloudservicepublicipaddresses" -``` - - -### Client Initialization - -```go -client := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesGetCloudServicePublicIPAddress` - -```go -ctx := context.TODO() -id := commonids.NewCloudServicesPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") - -read, err := client.PublicIPAddressesGetCloudServicePublicIPAddress(ctx, id, cloudservicepublicipaddresses.DefaultPublicIPAddressesGetCloudServicePublicIPAddressOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServicePublicIPAddresses` - -```go -ctx := context.TODO() -id := cloudservicepublicipaddresses.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - -// alternatively `client.PublicIPAddressesListCloudServicePublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListCloudServicePublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses` - -```go -ctx := context.TODO() -id := commonids.NewCloudServicesIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue") - -// alternatively `client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/client.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/client.go deleted file mode 100644 index 4eebc5f720f..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package cloudservicepublicipaddresses - -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 CloudServicePublicIPAddressesClient struct { - Client *resourcemanager.Client -} - -func NewCloudServicePublicIPAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*CloudServicePublicIPAddressesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "cloudservicepublicipaddresses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CloudServicePublicIPAddressesClient: %+v", err) - } - - return &CloudServicePublicIPAddressesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/constants.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/constants.go deleted file mode 100644 index 775730aae62..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package cloudservicepublicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice.go deleted file mode 100644 index 2750d8acfa0..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package cloudservicepublicipaddresses - -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(&ProviderCloudServiceId{}) -} - -var _ resourceids.ResourceId = &ProviderCloudServiceId{} - -// ProviderCloudServiceId is a struct representing the Resource ID for a Provider Cloud Service -type ProviderCloudServiceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string -} - -// NewProviderCloudServiceID returns a new ProviderCloudServiceId struct -func NewProviderCloudServiceID(subscriptionId string, resourceGroupName string, cloudServiceName string) ProviderCloudServiceId { - return ProviderCloudServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - } -} - -// ParseProviderCloudServiceID parses 'input' into a ProviderCloudServiceId -func ParseProviderCloudServiceID(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderCloudServiceIDInsensitively parses 'input' case-insensitively into a ProviderCloudServiceId -// note: this method should only be used for API response data and not user input -func ParseProviderCloudServiceIDInsensitively(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderCloudServiceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - return nil -} - -// ValidateProviderCloudServiceID checks that 'input' can be parsed as a Provider Cloud Service ID -func ValidateProviderCloudServiceID(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 := ParseProviderCloudServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Cloud Service ID -func (id ProviderCloudServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Cloud Service ID -func (id ProviderCloudServiceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - } -} - -// String returns a human-readable description of this Provider Cloud Service ID -func (id ProviderCloudServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - } - return fmt.Sprintf("Provider Cloud Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice_test.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice_test.go deleted file mode 100644 index 8e5ffd9994a..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/id_providercloudservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package cloudservicepublicipaddresses - -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 = &ProviderCloudServiceId{} - -func TestNewProviderCloudServiceID(t *testing.T) { - id := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } -} - -func TestFormatProviderCloudServiceID(t *testing.T) { - actual := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderCloudServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestParseProviderCloudServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestSegmentsForProviderCloudServiceId(t *testing.T) { - segments := ProviderCloudServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderCloudServiceId 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/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go deleted file mode 100644 index b9661797464..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go +++ /dev/null @@ -1,84 +0,0 @@ -package cloudservicepublicipaddresses - -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 PublicIPAddressesGetCloudServicePublicIPAddressOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -type PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions struct { - Expand *string -} - -func DefaultPublicIPAddressesGetCloudServicePublicIPAddressOperationOptions() PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions { - return PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions{} -} - -func (o PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// PublicIPAddressesGetCloudServicePublicIPAddress ... -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesGetCloudServicePublicIPAddress(ctx context.Context, id commonids.CloudServicesPublicIPAddressId, options PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) (result PublicIPAddressesGetCloudServicePublicIPAddressOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go deleted file mode 100644 index 4fb77eb453b..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go +++ /dev/null @@ -1,91 +0,0 @@ -package cloudservicepublicipaddresses - -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 PublicIPAddressesListCloudServicePublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListCloudServicePublicIPAddresses ... -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServicePublicIPAddresses(ctx context.Context, id ProviderCloudServiceId) (result PublicIPAddressesListCloudServicePublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListCloudServicePublicIPAddressesComplete retrieves all the results into a single object -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServicePublicIPAddressesComplete(ctx context.Context, id ProviderCloudServiceId) (PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListCloudServicePublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListCloudServicePublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServicePublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id ProviderCloudServiceId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListCloudServicePublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go deleted file mode 100644 index 5482119cfa2..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go +++ /dev/null @@ -1,92 +0,0 @@ -package cloudservicepublicipaddresses - -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 PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses ... -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx context.Context, id commonids.CloudServicesIPConfigurationId) (result PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete retrieves all the results into a single object -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete(ctx context.Context, id commonids.CloudServicesIPConfigurationId) (PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id commonids.CloudServicesIPConfigurationId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go deleted file mode 100644 index da0843dfe84..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 0752ac86606..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index c5e25b3ac40..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 3301a914b9a..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index d142ad28f06..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go deleted file mode 100644 index db43b3a90d7..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 26c6e3c6d63..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspool.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspool.go deleted file mode 100644 index 11a0db48c3e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 8b7c7a5e9a7..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 852fda62a32..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ddossettings.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ddossettings.go deleted file mode 100644 index e76df1830ad..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_delegation.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_delegation.go deleted file mode 100644 index 37ba2738f03..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlog.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlog.go deleted file mode 100644 index b5951b65269..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go deleted file mode 100644 index 22cce73755f..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go deleted file mode 100644 index 81d0d4ee738..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go deleted file mode 100644 index 6ef8b18a318..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package cloudservicepublicipaddresses - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index d76b004d004..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 623add5b390..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrule.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrule.go deleted file mode 100644 index 2bf55038c2e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 9e9fd000882..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfiguration.go deleted file mode 100644 index 7aa8cbae351..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go deleted file mode 100644 index cae99b1bc9d..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index d32ff6abc99..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index f1c212d87d9..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_iptag.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_iptag.go deleted file mode 100644 index 9cd0c420107..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// 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/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go deleted file mode 100644 index e95c784d170..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index f2cc5fa6b36..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgateway.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgateway.go deleted file mode 100644 index d2e737891d0..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package cloudservicepublicipaddresses - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go deleted file mode 100644 index 6e1be1ad8f0..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaysku.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaysku.go deleted file mode 100644 index 0e1a31e6f56..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natruleportmapping.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natruleportmapping.go deleted file mode 100644 index 9f648ba378f..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterface.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterface.go deleted file mode 100644 index 8fa35f5b27b..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go deleted file mode 100644 index 7841bbdaa74..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 2060396975d..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 331b8b4a8b7..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index e933a3bcc7e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 32854c40bbf..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 417528f526c..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 800ba33402b..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygroup.go deleted file mode 100644 index 4a17b77a5f7..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 75b57179c0e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpoint.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpoint.go deleted file mode 100644 index 092678d20e9..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnection.go deleted file mode 100644 index 390ed6a1a9e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index a4a672bb9ea..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go deleted file mode 100644 index f4475d0d46b..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index cd3b594722d..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointproperties.go deleted file mode 100644 index b6fab9bddb7..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkservice.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkservice.go deleted file mode 100644 index 47d7bc6cfba..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go deleted file mode 100644 index c2e1ed2f2bb..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 12d313e2c8e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 9c295f72e4e..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 2293fa06105..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index f0b249690b3..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go deleted file mode 100644 index fea2fefdf6d..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddress.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddress.go deleted file mode 100644 index 0d91d1ce77a..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 59fc873f762..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 5a1a9082ad9..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresssku.go deleted file mode 100644 index 0d24d3ce3e2..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go deleted file mode 100644 index a374b51e3ce..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go deleted file mode 100644 index bb8074b7c24..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourceset.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourceset.go deleted file mode 100644 index ea408a54b5a..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go deleted file mode 100644 index a92e570a340..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_route.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_route.go deleted file mode 100644 index ca309e6a8db..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routepropertiesformat.go deleted file mode 100644 index e981b239ff0..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetable.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetable.go deleted file mode 100644 index cfe4b1aaec3..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go deleted file mode 100644 index 14537e9f6ea..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrule.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrule.go deleted file mode 100644 index 68880b23db6..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index 3918c59b2ce..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlink.go deleted file mode 100644 index 18402efabea..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 283dae7d051..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go deleted file mode 100644 index cb30d331149..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go deleted file mode 100644 index 51af3fd8470..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 84bd144ecd4..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 723f9f28975..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index de8c74ebf8a..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 63759ece07d..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnet.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnet.go deleted file mode 100644 index 4ae7149a7a9..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index 19810c29c1f..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subresource.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subresource.go deleted file mode 100644 index ee542355418..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 6e884100df3..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go deleted file mode 100644 index e38b924bdf6..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktap.go deleted file mode 100644 index 9dc686dd12f..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index c0dae0b7388..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/predicates.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/predicates.go deleted file mode 100644 index f27f03144ee..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPAddressOperationPredicate) Matches(input PublicIPAddress) 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 && (input.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/network/2023-05-01/cloudservicepublicipaddresses/version.go b/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/version.go deleted file mode 100644 index 124b2000557..00000000000 --- a/resource-manager/network/2023-05-01/cloudservicepublicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/cloudservicepublicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/README.md b/resource-manager/network/2023-05-01/connectionmonitors/README.md deleted file mode 100644 index a337496dd72..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/connectionmonitors` Documentation - -The `connectionmonitors` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/connectionmonitors" -``` - - -### Client Initialization - -```go -client := connectionmonitors.NewConnectionMonitorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConnectionMonitorsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -payload := connectionmonitors.ConnectionMonitor{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, connectionmonitors.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Delete` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Get` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -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: `ConnectionMonitorsClient.List` - -```go -ctx := context.TODO() -id := connectionmonitors.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `ConnectionMonitorsClient.Query` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.QueryThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Start` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Stop` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.UpdateTags` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -payload := connectionmonitors.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/network/2023-05-01/connectionmonitors/client.go b/resource-manager/network/2023-05-01/connectionmonitors/client.go deleted file mode 100644 index a8ff516ce50..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorsClient struct { - Client *resourcemanager.Client -} - -func NewConnectionMonitorsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConnectionMonitorsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "connectionmonitors", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConnectionMonitorsClient: %+v", err) - } - - return &ConnectionMonitorsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/constants.go b/resource-manager/network/2023-05-01/connectionmonitors/constants.go deleted file mode 100644 index 7747a3a8316..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/constants.go +++ /dev/null @@ -1,770 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorEndpointFilterItemType string - -const ( - ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" -) - -func PossibleValuesForConnectionMonitorEndpointFilterItemType() []string { - return []string{ - string(ConnectionMonitorEndpointFilterItemTypeAgentAddress), - } -} - -func (s *ConnectionMonitorEndpointFilterItemType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorEndpointFilterItemType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorEndpointFilterItemType(input string) (*ConnectionMonitorEndpointFilterItemType, error) { - vals := map[string]ConnectionMonitorEndpointFilterItemType{ - "agentaddress": ConnectionMonitorEndpointFilterItemTypeAgentAddress, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorEndpointFilterItemType(input) - return &out, nil -} - -type ConnectionMonitorEndpointFilterType string - -const ( - ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" -) - -func PossibleValuesForConnectionMonitorEndpointFilterType() []string { - return []string{ - string(ConnectionMonitorEndpointFilterTypeInclude), - } -} - -func (s *ConnectionMonitorEndpointFilterType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorEndpointFilterType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorEndpointFilterType(input string) (*ConnectionMonitorEndpointFilterType, error) { - vals := map[string]ConnectionMonitorEndpointFilterType{ - "include": ConnectionMonitorEndpointFilterTypeInclude, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorEndpointFilterType(input) - return &out, nil -} - -type ConnectionMonitorSourceStatus string - -const ( - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -func PossibleValuesForConnectionMonitorSourceStatus() []string { - return []string{ - string(ConnectionMonitorSourceStatusActive), - string(ConnectionMonitorSourceStatusInactive), - string(ConnectionMonitorSourceStatusUnknown), - } -} - -func (s *ConnectionMonitorSourceStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorSourceStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorSourceStatus(input string) (*ConnectionMonitorSourceStatus, error) { - vals := map[string]ConnectionMonitorSourceStatus{ - "active": ConnectionMonitorSourceStatusActive, - "inactive": ConnectionMonitorSourceStatusInactive, - "unknown": ConnectionMonitorSourceStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorSourceStatus(input) - return &out, nil -} - -type ConnectionMonitorTestConfigurationProtocol string - -const ( - ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" - ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" - ConnectionMonitorTestConfigurationProtocolTcp ConnectionMonitorTestConfigurationProtocol = "Tcp" -) - -func PossibleValuesForConnectionMonitorTestConfigurationProtocol() []string { - return []string{ - string(ConnectionMonitorTestConfigurationProtocolHTTP), - string(ConnectionMonitorTestConfigurationProtocolIcmp), - string(ConnectionMonitorTestConfigurationProtocolTcp), - } -} - -func (s *ConnectionMonitorTestConfigurationProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorTestConfigurationProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorTestConfigurationProtocol(input string) (*ConnectionMonitorTestConfigurationProtocol, error) { - vals := map[string]ConnectionMonitorTestConfigurationProtocol{ - "http": ConnectionMonitorTestConfigurationProtocolHTTP, - "icmp": ConnectionMonitorTestConfigurationProtocolIcmp, - "tcp": ConnectionMonitorTestConfigurationProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorTestConfigurationProtocol(input) - return &out, nil -} - -type ConnectionMonitorType string - -const ( - ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" - ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" -) - -func PossibleValuesForConnectionMonitorType() []string { - return []string{ - string(ConnectionMonitorTypeMultiEndpoint), - string(ConnectionMonitorTypeSingleSourceDestination), - } -} - -func (s *ConnectionMonitorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorType(input string) (*ConnectionMonitorType, error) { - vals := map[string]ConnectionMonitorType{ - "multiendpoint": ConnectionMonitorTypeMultiEndpoint, - "singlesourcedestination": ConnectionMonitorTypeSingleSourceDestination, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorType(input) - return &out, nil -} - -type ConnectionState string - -const ( - ConnectionStateReachable ConnectionState = "Reachable" - ConnectionStateUnknown ConnectionState = "Unknown" - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -func PossibleValuesForConnectionState() []string { - return []string{ - string(ConnectionStateReachable), - string(ConnectionStateUnknown), - string(ConnectionStateUnreachable), - } -} - -func (s *ConnectionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionState(input string) (*ConnectionState, error) { - vals := map[string]ConnectionState{ - "reachable": ConnectionStateReachable, - "unknown": ConnectionStateUnknown, - "unreachable": ConnectionStateUnreachable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionState(input) - return &out, nil -} - -type CoverageLevel string - -const ( - CoverageLevelAboveAverage CoverageLevel = "AboveAverage" - CoverageLevelAverage CoverageLevel = "Average" - CoverageLevelBelowAverage CoverageLevel = "BelowAverage" - CoverageLevelDefault CoverageLevel = "Default" - CoverageLevelFull CoverageLevel = "Full" - CoverageLevelLow CoverageLevel = "Low" -) - -func PossibleValuesForCoverageLevel() []string { - return []string{ - string(CoverageLevelAboveAverage), - string(CoverageLevelAverage), - string(CoverageLevelBelowAverage), - string(CoverageLevelDefault), - string(CoverageLevelFull), - string(CoverageLevelLow), - } -} - -func (s *CoverageLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCoverageLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCoverageLevel(input string) (*CoverageLevel, error) { - vals := map[string]CoverageLevel{ - "aboveaverage": CoverageLevelAboveAverage, - "average": CoverageLevelAverage, - "belowaverage": CoverageLevelBelowAverage, - "default": CoverageLevelDefault, - "full": CoverageLevelFull, - "low": CoverageLevelLow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CoverageLevel(input) - return &out, nil -} - -type DestinationPortBehavior string - -const ( - DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" - DestinationPortBehaviorNone DestinationPortBehavior = "None" -) - -func PossibleValuesForDestinationPortBehavior() []string { - return []string{ - string(DestinationPortBehaviorListenIfAvailable), - string(DestinationPortBehaviorNone), - } -} - -func (s *DestinationPortBehavior) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDestinationPortBehavior(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDestinationPortBehavior(input string) (*DestinationPortBehavior, error) { - vals := map[string]DestinationPortBehavior{ - "listenifavailable": DestinationPortBehaviorListenIfAvailable, - "none": DestinationPortBehaviorNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DestinationPortBehavior(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeAzureArcVM EndpointType = "AzureArcVM" - EndpointTypeAzureSubnet EndpointType = "AzureSubnet" - EndpointTypeAzureVM EndpointType = "AzureVM" - EndpointTypeAzureVMSS EndpointType = "AzureVMSS" - EndpointTypeAzureVNet EndpointType = "AzureVNet" - EndpointTypeExternalAddress EndpointType = "ExternalAddress" - EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" - EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeAzureArcVM), - string(EndpointTypeAzureSubnet), - string(EndpointTypeAzureVM), - string(EndpointTypeAzureVMSS), - string(EndpointTypeAzureVNet), - string(EndpointTypeExternalAddress), - string(EndpointTypeMMAWorkspaceMachine), - string(EndpointTypeMMAWorkspaceNetwork), - } -} - -func (s *EndpointType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEndpointType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "azurearcvm": EndpointTypeAzureArcVM, - "azuresubnet": EndpointTypeAzureSubnet, - "azurevm": EndpointTypeAzureVM, - "azurevmss": EndpointTypeAzureVMSS, - "azurevnet": EndpointTypeAzureVNet, - "externaladdress": EndpointTypeExternalAddress, - "mmaworkspacemachine": EndpointTypeMMAWorkspaceMachine, - "mmaworkspacenetwork": EndpointTypeMMAWorkspaceNetwork, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type EvaluationState string - -const ( - EvaluationStateCompleted EvaluationState = "Completed" - EvaluationStateInProgress EvaluationState = "InProgress" - EvaluationStateNotStarted EvaluationState = "NotStarted" -) - -func PossibleValuesForEvaluationState() []string { - return []string{ - string(EvaluationStateCompleted), - string(EvaluationStateInProgress), - string(EvaluationStateNotStarted), - } -} - -func (s *EvaluationState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEvaluationState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEvaluationState(input string) (*EvaluationState, error) { - vals := map[string]EvaluationState{ - "completed": EvaluationStateCompleted, - "inprogress": EvaluationStateInProgress, - "notstarted": EvaluationStateNotStarted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EvaluationState(input) - return &out, nil -} - -type HTTPConfigurationMethod string - -const ( - HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" - HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" -) - -func PossibleValuesForHTTPConfigurationMethod() []string { - return []string{ - string(HTTPConfigurationMethodGet), - string(HTTPConfigurationMethodPost), - } -} - -func (s *HTTPConfigurationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHTTPConfigurationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHTTPConfigurationMethod(input string) (*HTTPConfigurationMethod, error) { - vals := map[string]HTTPConfigurationMethod{ - "get": HTTPConfigurationMethodGet, - "post": HTTPConfigurationMethodPost, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HTTPConfigurationMethod(input) - return &out, nil -} - -type IssueType string - -const ( - IssueTypeAgentStopped IssueType = "AgentStopped" - IssueTypeDnsResolution IssueType = "DnsResolution" - IssueTypeGuestFirewall IssueType = "GuestFirewall" - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - IssueTypePlatform IssueType = "Platform" - IssueTypePortThrottled IssueType = "PortThrottled" - IssueTypeSocketBind IssueType = "SocketBind" - IssueTypeUnknown IssueType = "Unknown" - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -func PossibleValuesForIssueType() []string { - return []string{ - string(IssueTypeAgentStopped), - string(IssueTypeDnsResolution), - string(IssueTypeGuestFirewall), - string(IssueTypeNetworkSecurityRule), - string(IssueTypePlatform), - string(IssueTypePortThrottled), - string(IssueTypeSocketBind), - string(IssueTypeUnknown), - string(IssueTypeUserDefinedRoute), - } -} - -func (s *IssueType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIssueType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIssueType(input string) (*IssueType, error) { - vals := map[string]IssueType{ - "agentstopped": IssueTypeAgentStopped, - "dnsresolution": IssueTypeDnsResolution, - "guestfirewall": IssueTypeGuestFirewall, - "networksecurityrule": IssueTypeNetworkSecurityRule, - "platform": IssueTypePlatform, - "portthrottled": IssueTypePortThrottled, - "socketbind": IssueTypeSocketBind, - "unknown": IssueTypeUnknown, - "userdefinedroute": IssueTypeUserDefinedRoute, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IssueType(input) - return &out, nil -} - -type Origin string - -const ( - OriginInbound Origin = "Inbound" - OriginLocal Origin = "Local" - OriginOutbound Origin = "Outbound" -) - -func PossibleValuesForOrigin() []string { - return []string{ - string(OriginInbound), - string(OriginLocal), - string(OriginOutbound), - } -} - -func (s *Origin) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOrigin(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOrigin(input string) (*Origin, error) { - vals := map[string]Origin{ - "inbound": OriginInbound, - "local": OriginLocal, - "outbound": OriginOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Origin(input) - return &out, nil -} - -type OutputType string - -const ( - OutputTypeWorkspace OutputType = "Workspace" -) - -func PossibleValuesForOutputType() []string { - return []string{ - string(OutputTypeWorkspace), - } -} - -func (s *OutputType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOutputType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOutputType(input string) (*OutputType, error) { - vals := map[string]OutputType{ - "workspace": OutputTypeWorkspace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OutputType(input) - return &out, nil -} - -type PreferredIPVersion string - -const ( - PreferredIPVersionIPvFour PreferredIPVersion = "IPv4" - PreferredIPVersionIPvSix PreferredIPVersion = "IPv6" -) - -func PossibleValuesForPreferredIPVersion() []string { - return []string{ - string(PreferredIPVersionIPvFour), - string(PreferredIPVersionIPvSix), - } -} - -func (s *PreferredIPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePreferredIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePreferredIPVersion(input string) (*PreferredIPVersion, error) { - vals := map[string]PreferredIPVersion{ - "ipv4": PreferredIPVersionIPvFour, - "ipv6": PreferredIPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PreferredIPVersion(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type Severity string - -const ( - SeverityError Severity = "Error" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityError), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "error": SeverityError, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor.go b/resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor.go deleted file mode 100644 index 10d851fd213..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor.go +++ /dev/null @@ -1,139 +0,0 @@ -package connectionmonitors - -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(&ConnectionMonitorId{}) -} - -var _ resourceids.ResourceId = &ConnectionMonitorId{} - -// ConnectionMonitorId is a struct representing the Resource ID for a Connection Monitor -type ConnectionMonitorId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string - ConnectionMonitorName string -} - -// NewConnectionMonitorID returns a new ConnectionMonitorId struct -func NewConnectionMonitorID(subscriptionId string, resourceGroupName string, networkWatcherName string, connectionMonitorName string) ConnectionMonitorId { - return ConnectionMonitorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - ConnectionMonitorName: connectionMonitorName, - } -} - -// ParseConnectionMonitorID parses 'input' into a ConnectionMonitorId -func ParseConnectionMonitorID(input string) (*ConnectionMonitorId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionMonitorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionMonitorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectionMonitorIDInsensitively parses 'input' case-insensitively into a ConnectionMonitorId -// note: this method should only be used for API response data and not user input -func ParseConnectionMonitorIDInsensitively(input string) (*ConnectionMonitorId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionMonitorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionMonitorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectionMonitorId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - if id.ConnectionMonitorName, ok = input.Parsed["connectionMonitorName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionMonitorName", input) - } - - return nil -} - -// ValidateConnectionMonitorID checks that 'input' can be parsed as a Connection Monitor ID -func ValidateConnectionMonitorID(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 := ParseConnectionMonitorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connection Monitor ID -func (id ConnectionMonitorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s/connectionMonitors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName, id.ConnectionMonitorName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connection Monitor ID -func (id ConnectionMonitorId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - resourceids.StaticSegment("staticConnectionMonitors", "connectionMonitors", "connectionMonitors"), - resourceids.UserSpecifiedSegment("connectionMonitorName", "connectionMonitorValue"), - } -} - -// String returns a human-readable description of this Connection Monitor ID -func (id ConnectionMonitorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - fmt.Sprintf("Connection Monitor Name: %q", id.ConnectionMonitorName), - } - return fmt.Sprintf("Connection Monitor (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor_test.go b/resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor_test.go deleted file mode 100644 index 06c34a9c63c..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/id_connectionmonitor_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package connectionmonitors - -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 = &ConnectionMonitorId{} - -func TestNewConnectionMonitorID(t *testing.T) { - id := NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } - - if id.ConnectionMonitorName != "connectionMonitorValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionMonitorName'", id.ConnectionMonitorName, "connectionMonitorValue") - } -} - -func TestFormatConnectionMonitorID(t *testing.T) { - actual := NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectionMonitorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionMonitorId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue", - Expected: &ConnectionMonitorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - ConnectionMonitorName: "connectionMonitorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionMonitorID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.ConnectionMonitorName != v.Expected.ConnectionMonitorName { - t.Fatalf("Expected %q but got %q for ConnectionMonitorName", v.Expected.ConnectionMonitorName, actual.ConnectionMonitorName) - } - - } -} - -func TestParseConnectionMonitorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionMonitorId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/cOnNeCtIoNmOnItOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue", - Expected: &ConnectionMonitorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - ConnectionMonitorName: "connectionMonitorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/cOnNeCtIoNmOnItOrS/cOnNeCtIoNmOnItOrVaLuE", - Expected: &ConnectionMonitorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - ConnectionMonitorName: "cOnNeCtIoNmOnItOrVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/cOnNeCtIoNmOnItOrS/cOnNeCtIoNmOnItOrVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionMonitorIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.ConnectionMonitorName != v.Expected.ConnectionMonitorName { - t.Fatalf("Expected %q but got %q for ConnectionMonitorName", v.Expected.ConnectionMonitorName, actual.ConnectionMonitorName) - } - - } -} - -func TestSegmentsForConnectionMonitorId(t *testing.T) { - segments := ConnectionMonitorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectionMonitorId 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/network/2023-05-01/connectionmonitors/id_networkwatcher.go b/resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher.go deleted file mode 100644 index c112368b0b7..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package connectionmonitors - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher_test.go b/resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher_test.go deleted file mode 100644 index 05fd2d98cbd..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package connectionmonitors - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-05-01/connectionmonitors/method_createorupdate.go b/resource-manager/network/2023-05-01/connectionmonitors/method_createorupdate.go deleted file mode 100644 index b54a54e92b1..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_createorupdate.go +++ /dev/null @@ -1,103 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorResult -} - -type CreateOrUpdateOperationOptions struct { - Migrate *string -} - -func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions { - return CreateOrUpdateOperationOptions{} -} - -func (o CreateOrUpdateOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CreateOrUpdateOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CreateOrUpdateOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Migrate != nil { - out.Append("migrate", fmt.Sprintf("%v", *o.Migrate)) - } - return &out -} - -// CreateOrUpdate ... -func (c ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, id ConnectionMonitorId, input ConnectionMonitor, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 ConnectionMonitorsClient) CreateOrUpdateThenPoll(ctx context.Context, id ConnectionMonitorId, input ConnectionMonitor, 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/network/2023-05-01/connectionmonitors/method_delete.go b/resource-manager/network/2023-05-01/connectionmonitors/method_delete.go deleted file mode 100644 index a0d6aebb3f1..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorsClient) Delete(ctx context.Context, id ConnectionMonitorId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c ConnectionMonitorsClient) DeleteThenPoll(ctx context.Context, id ConnectionMonitorId) 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/network/2023-05-01/connectionmonitors/method_get.go b/resource-manager/network/2023-05-01/connectionmonitors/method_get.go deleted file mode 100644 index 883ffbdfd40..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorResult -} - -// Get ... -func (c ConnectionMonitorsClient) Get(ctx context.Context, id ConnectionMonitorId) (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 ConnectionMonitorResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/method_list.go b/resource-manager/network/2023-05-01/connectionmonitors/method_list.go deleted file mode 100644 index 40de4efcac7..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorListResult -} - -// List ... -func (c ConnectionMonitorsClient) List(ctx context.Context, id NetworkWatcherId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connectionMonitors", 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 ConnectionMonitorListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/method_query.go b/resource-manager/network/2023-05-01/connectionmonitors/method_query.go deleted file mode 100644 index ee985b11689..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_query.go +++ /dev/null @@ -1,71 +0,0 @@ -package connectionmonitors - -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 QueryOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionMonitorQueryResult -} - -// Query ... -func (c ConnectionMonitorsClient) Query(ctx context.Context, id ConnectionMonitorId) (result QueryOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/query", 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 -} - -// QueryThenPoll performs Query then polls until it's completed -func (c ConnectionMonitorsClient) QueryThenPoll(ctx context.Context, id ConnectionMonitorId) error { - result, err := c.Query(ctx, id) - if err != nil { - return fmt.Errorf("performing Query: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Query: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/method_start.go b/resource-manager/network/2023-05-01/connectionmonitors/method_start.go deleted file mode 100644 index f5f3ef3ba4e..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_start.go +++ /dev/null @@ -1,70 +0,0 @@ -package connectionmonitors - -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 StartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Start ... -func (c ConnectionMonitorsClient) Start(ctx context.Context, id ConnectionMonitorId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ConnectionMonitorsClient) StartThenPoll(ctx context.Context, id ConnectionMonitorId) 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/network/2023-05-01/connectionmonitors/method_stop.go b/resource-manager/network/2023-05-01/connectionmonitors/method_stop.go deleted file mode 100644 index 44a5d3c56a7..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package connectionmonitors - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c ConnectionMonitorsClient) Stop(ctx context.Context, id ConnectionMonitorId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ConnectionMonitorsClient) StopThenPoll(ctx context.Context, id ConnectionMonitorId) 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/network/2023-05-01/connectionmonitors/method_updatetags.go b/resource-manager/network/2023-05-01/connectionmonitors/method_updatetags.go deleted file mode 100644 index 04091a0b16c..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorResult -} - -// UpdateTags ... -func (c ConnectionMonitorsClient) UpdateTags(ctx context.Context, id ConnectionMonitorId, 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 ConnectionMonitorResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitor.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitor.go deleted file mode 100644 index 0257ef7bed9..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitor.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitor struct { - Location *string `json:"location,omitempty"` - Properties ConnectionMonitorParameters `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitordestination.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitordestination.go deleted file mode 100644 index 2c1eaeadd69..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitordestination.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorDestination struct { - Address *string `json:"address,omitempty"` - Port *int64 `json:"port,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpoint.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpoint.go deleted file mode 100644 index 570c394f371..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpoint.go +++ /dev/null @@ -1,14 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpoint struct { - Address *string `json:"address,omitempty"` - CoverageLevel *CoverageLevel `json:"coverageLevel,omitempty"` - Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` - Name string `json:"name"` - ResourceId *string `json:"resourceId,omitempty"` - Scope *ConnectionMonitorEndpointScope `json:"scope,omitempty"` - Type *EndpointType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilter.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilter.go deleted file mode 100644 index f861681a10c..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilter.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointFilter struct { - Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` - Type *ConnectionMonitorEndpointFilterType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go deleted file mode 100644 index 49a3320062d..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointFilterItem struct { - Address *string `json:"address,omitempty"` - Type *ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscope.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscope.go deleted file mode 100644 index 36bb68efcaa..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscope.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointScope struct { - Exclude *[]ConnectionMonitorEndpointScopeItem `json:"exclude,omitempty"` - Include *[]ConnectionMonitorEndpointScopeItem `json:"include,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go deleted file mode 100644 index e73b5e20b3b..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointScopeItem struct { - Address *string `json:"address,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go deleted file mode 100644 index 51af2309e94..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go +++ /dev/null @@ -1,13 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorHTTPConfiguration struct { - Method *HTTPConfigurationMethod `json:"method,omitempty"` - Path *string `json:"path,omitempty"` - Port *int64 `json:"port,omitempty"` - PreferHTTPS *bool `json:"preferHTTPS,omitempty"` - RequestHeaders *[]HTTPHeader `json:"requestHeaders,omitempty"` - ValidStatusCodeRanges *[]string `json:"validStatusCodeRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go deleted file mode 100644 index 6468613d1af..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorIcmpConfiguration struct { - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorlistresult.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorlistresult.go deleted file mode 100644 index 2e3014360ae..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorListResult struct { - Value *[]ConnectionMonitorResult `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoroutput.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoroutput.go deleted file mode 100644 index fcacc064d79..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitoroutput.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorOutput struct { - Type *OutputType `json:"type,omitempty"` - WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorparameters.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorparameters.go deleted file mode 100644 index d529e518683..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorparameters.go +++ /dev/null @@ -1,16 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorParameters struct { - AutoStart *bool `json:"autoStart,omitempty"` - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - MonitoringIntervalInSeconds *int64 `json:"monitoringIntervalInSeconds,omitempty"` - Notes *string `json:"notes,omitempty"` - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - Source *ConnectionMonitorSource `json:"source,omitempty"` - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorqueryresult.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorqueryresult.go deleted file mode 100644 index 455f34530d5..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorqueryresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorQueryResult struct { - SourceStatus *ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"` - States *[]ConnectionStateSnapshot `json:"states,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresult.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresult.go deleted file mode 100644 index 439794014f7..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresult.go +++ /dev/null @@ -1,14 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorResult struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ConnectionMonitorResultProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresultproperties.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresultproperties.go deleted file mode 100644 index 0299f7f69a7..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorresultproperties.go +++ /dev/null @@ -1,38 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorResultProperties struct { - AutoStart *bool `json:"autoStart,omitempty"` - ConnectionMonitorType *ConnectionMonitorType `json:"connectionMonitorType,omitempty"` - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - MonitoringIntervalInSeconds *int64 `json:"monitoringIntervalInSeconds,omitempty"` - MonitoringStatus *string `json:"monitoringStatus,omitempty"` - Notes *string `json:"notes,omitempty"` - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Source *ConnectionMonitorSource `json:"source,omitempty"` - StartTime *string `json:"startTime,omitempty"` - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` -} - -func (o *ConnectionMonitorResultProperties) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ConnectionMonitorResultProperties) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsource.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsource.go deleted file mode 100644 index 39fa1ef2bdc..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsource.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorSource struct { - Port *int64 `json:"port,omitempty"` - ResourceId string `json:"resourceId"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go deleted file mode 100644 index 9f6ca6fac8b..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorSuccessThreshold struct { - ChecksFailedPercent *int64 `json:"checksFailedPercent,omitempty"` - RoundTripTimeMs *float64 `json:"roundTripTimeMs,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortcpconfiguration.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortcpconfiguration.go deleted file mode 100644 index 99fdbf40239..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortcpconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorTcpConfiguration struct { - DestinationPortBehavior *DestinationPortBehavior `json:"destinationPortBehavior,omitempty"` - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` - Port *int64 `json:"port,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestconfiguration.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestconfiguration.go deleted file mode 100644 index c4aa04feaba..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestconfiguration.go +++ /dev/null @@ -1,15 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorTestConfiguration struct { - HTTPConfiguration *ConnectionMonitorHTTPConfiguration `json:"httpConfiguration,omitempty"` - IcmpConfiguration *ConnectionMonitorIcmpConfiguration `json:"icmpConfiguration,omitempty"` - Name string `json:"name"` - PreferredIPVersion *PreferredIPVersion `json:"preferredIPVersion,omitempty"` - Protocol ConnectionMonitorTestConfigurationProtocol `json:"protocol"` - SuccessThreshold *ConnectionMonitorSuccessThreshold `json:"successThreshold,omitempty"` - TcpConfiguration *ConnectionMonitorTcpConfiguration `json:"tcpConfiguration,omitempty"` - TestFrequencySec *int64 `json:"testFrequencySec,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestgroup.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestgroup.go deleted file mode 100644 index 6eaa922f55a..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitortestgroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorTestGroup struct { - Destinations []string `json:"destinations"` - Disable *bool `json:"disable,omitempty"` - Name string `json:"name"` - Sources []string `json:"sources"` - TestConfigurations []string `json:"testConfigurations"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorworkspacesettings.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorworkspacesettings.go deleted file mode 100644 index ae23c31662f..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionmonitorworkspacesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorWorkspaceSettings struct { - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionstatesnapshot.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectionstatesnapshot.go deleted file mode 100644 index 060c3bece81..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectionstatesnapshot.go +++ /dev/null @@ -1,47 +0,0 @@ -package connectionmonitors - -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 ConnectionStateSnapshot struct { - AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` - ConnectionState *ConnectionState `json:"connectionState,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EvaluationState *EvaluationState `json:"evaluationState,omitempty"` - Hops *[]ConnectivityHop `json:"hops,omitempty"` - MaxLatencyInMs *int64 `json:"maxLatencyInMs,omitempty"` - MinLatencyInMs *int64 `json:"minLatencyInMs,omitempty"` - ProbesFailed *int64 `json:"probesFailed,omitempty"` - ProbesSent *int64 `json:"probesSent,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *ConnectionStateSnapshot) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ConnectionStateSnapshot) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *ConnectionStateSnapshot) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ConnectionStateSnapshot) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectivityhop.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectivityhop.go deleted file mode 100644 index b93b627ac70..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectivityhop.go +++ /dev/null @@ -1,16 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityHop struct { - Address *string `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - Links *[]HopLink `json:"links,omitempty"` - NextHopIds *[]string `json:"nextHopIds,omitempty"` - PreviousHopIds *[]string `json:"previousHopIds,omitempty"` - PreviousLinks *[]HopLink `json:"previousLinks,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_connectivityissue.go b/resource-manager/network/2023-05-01/connectionmonitors/model_connectivityissue.go deleted file mode 100644 index ff7c6cdaf11..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_connectivityissue.go +++ /dev/null @@ -1,11 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityIssue struct { - Context *[]map[string]string `json:"context,omitempty"` - Origin *Origin `json:"origin,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Type *IssueType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_hoplink.go b/resource-manager/network/2023-05-01/connectionmonitors/model_hoplink.go deleted file mode 100644 index c2b18cd5be1..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_hoplink.go +++ /dev/null @@ -1,13 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLink struct { - Context *map[string]string `json:"context,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - LinkType *string `json:"linkType,omitempty"` - NextHopId *string `json:"nextHopId,omitempty"` - Properties *HopLinkProperties `json:"properties,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_hoplinkproperties.go b/resource-manager/network/2023-05-01/connectionmonitors/model_hoplinkproperties.go deleted file mode 100644 index d38f1875957..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_hoplinkproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLinkProperties struct { - RoundTripTimeAvg *int64 `json:"roundTripTimeAvg,omitempty"` - RoundTripTimeMax *int64 `json:"roundTripTimeMax,omitempty"` - RoundTripTimeMin *int64 `json:"roundTripTimeMin,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_httpheader.go b/resource-manager/network/2023-05-01/connectionmonitors/model_httpheader.go deleted file mode 100644 index 7cae34688aa..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_httpheader.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPHeader struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectionmonitors/model_tagsobject.go b/resource-manager/network/2023-05-01/connectionmonitors/model_tagsobject.go deleted file mode 100644 index d9e7e6413ff..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// 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/network/2023-05-01/connectionmonitors/version.go b/resource-manager/network/2023-05-01/connectionmonitors/version.go deleted file mode 100644 index 6663451757f..00000000000 --- a/resource-manager/network/2023-05-01/connectionmonitors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectionmonitors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/connectionmonitors/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/README.md b/resource-manager/network/2023-05-01/connectivityconfigurations/README.md deleted file mode 100644 index 00be1737bb8..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/connectivityconfigurations` Documentation - -The `connectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/connectivityconfigurations" -``` - - -### Client Initialization - -```go -client := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConnectivityConfigurationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -payload := connectivityconfigurations.ConnectivityConfiguration{ - // ... -} - - -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: `ConnectivityConfigurationsClient.Delete` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectivityConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -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: `ConnectivityConfigurationsClient.List` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, connectivityconfigurations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, connectivityconfigurations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/client.go b/resource-manager/network/2023-05-01/connectivityconfigurations/client.go deleted file mode 100644 index 7fb783f963a..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package connectivityconfigurations - -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 ConnectivityConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewConnectivityConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConnectivityConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "connectivityconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConnectivityConfigurationsClient: %+v", err) - } - - return &ConnectivityConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/constants.go b/resource-manager/network/2023-05-01/connectivityconfigurations/constants.go deleted file mode 100644 index e9642441352..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/constants.go +++ /dev/null @@ -1,262 +0,0 @@ -package connectivityconfigurations - -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 ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -func PossibleValuesForConnectivityTopology() []string { - return []string{ - string(ConnectivityTopologyHubAndSpoke), - string(ConnectivityTopologyMesh), - } -} - -func (s *ConnectivityTopology) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityTopology(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityTopology(input string) (*ConnectivityTopology, error) { - vals := map[string]ConnectivityTopology{ - "hubandspoke": ConnectivityTopologyHubAndSpoke, - "mesh": ConnectivityTopologyMesh, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityTopology(input) - return &out, nil -} - -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -func PossibleValuesForDeleteExistingPeering() []string { - return []string{ - string(DeleteExistingPeeringFalse), - string(DeleteExistingPeeringTrue), - } -} - -func (s *DeleteExistingPeering) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteExistingPeering(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteExistingPeering(input string) (*DeleteExistingPeering, error) { - vals := map[string]DeleteExistingPeering{ - "false": DeleteExistingPeeringFalse, - "true": DeleteExistingPeeringTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteExistingPeering(input) - return &out, nil -} - -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -func PossibleValuesForGroupConnectivity() []string { - return []string{ - string(GroupConnectivityDirectlyConnected), - string(GroupConnectivityNone), - } -} - -func (s *GroupConnectivity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGroupConnectivity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGroupConnectivity(input string) (*GroupConnectivity, error) { - vals := map[string]GroupConnectivity{ - "directlyconnected": GroupConnectivityDirectlyConnected, - "none": GroupConnectivityNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GroupConnectivity(input) - return &out, nil -} - -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -func PossibleValuesForIsGlobal() []string { - return []string{ - string(IsGlobalFalse), - string(IsGlobalTrue), - } -} - -func (s *IsGlobal) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsGlobal(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsGlobal(input string) (*IsGlobal, error) { - vals := map[string]IsGlobal{ - "false": IsGlobalFalse, - "true": IsGlobalTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsGlobal(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -func PossibleValuesForUseHubGateway() []string { - return []string{ - string(UseHubGatewayFalse), - string(UseHubGatewayTrue), - } -} - -func (s *UseHubGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUseHubGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUseHubGateway(input string) (*UseHubGateway, error) { - vals := map[string]UseHubGateway{ - "false": UseHubGatewayFalse, - "true": UseHubGatewayTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UseHubGateway(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration.go deleted file mode 100644 index d00d054bd40..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package connectivityconfigurations - -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(&ConnectivityConfigurationId{}) -} - -var _ resourceids.ResourceId = &ConnectivityConfigurationId{} - -// ConnectivityConfigurationId is a struct representing the Resource ID for a Connectivity Configuration -type ConnectivityConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - ConnectivityConfigurationName string -} - -// NewConnectivityConfigurationID returns a new ConnectivityConfigurationId struct -func NewConnectivityConfigurationID(subscriptionId string, resourceGroupName string, networkManagerName string, connectivityConfigurationName string) ConnectivityConfigurationId { - return ConnectivityConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - ConnectivityConfigurationName: connectivityConfigurationName, - } -} - -// ParseConnectivityConfigurationID parses 'input' into a ConnectivityConfigurationId -func ParseConnectivityConfigurationID(input string) (*ConnectivityConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectivityConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectivityConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectivityConfigurationIDInsensitively parses 'input' case-insensitively into a ConnectivityConfigurationId -// note: this method should only be used for API response data and not user input -func ParseConnectivityConfigurationIDInsensitively(input string) (*ConnectivityConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectivityConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectivityConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectivityConfigurationId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.ConnectivityConfigurationName, ok = input.Parsed["connectivityConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectivityConfigurationName", input) - } - - return nil -} - -// ValidateConnectivityConfigurationID checks that 'input' can be parsed as a Connectivity Configuration ID -func ValidateConnectivityConfigurationID(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 := ParseConnectivityConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connectivity Configuration ID -func (id ConnectivityConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/connectivityConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.ConnectivityConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connectivity Configuration ID -func (id ConnectivityConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticConnectivityConfigurations", "connectivityConfigurations", "connectivityConfigurations"), - resourceids.UserSpecifiedSegment("connectivityConfigurationName", "connectivityConfigurationValue"), - } -} - -// String returns a human-readable description of this Connectivity Configuration ID -func (id ConnectivityConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Connectivity Configuration Name: %q", id.ConnectivityConfigurationName), - } - return fmt.Sprintf("Connectivity Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration_test.go deleted file mode 100644 index 49deadd7a10..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/id_connectivityconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package connectivityconfigurations - -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 = &ConnectivityConfigurationId{} - -func TestNewConnectivityConfigurationID(t *testing.T) { - id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.ConnectivityConfigurationName != "connectivityConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "connectivityConfigurationValue") - } -} - -func TestFormatConnectivityConfigurationID(t *testing.T) { - actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectivityConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectivityConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue", - Expected: &ConnectivityConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ConnectivityConfigurationName: "connectivityConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectivityConfigurationID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ConnectivityConfigurationName != v.Expected.ConnectivityConfigurationName { - t.Fatalf("Expected %q but got %q for ConnectivityConfigurationName", v.Expected.ConnectivityConfigurationName, actual.ConnectivityConfigurationName) - } - - } -} - -func TestParseConnectivityConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectivityConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/cOnNeCtIvItYcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue", - Expected: &ConnectivityConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ConnectivityConfigurationName: "connectivityConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnVaLuE", - Expected: &ConnectivityConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - ConnectivityConfigurationName: "cOnNeCtIvItYcOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectivityConfigurationIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ConnectivityConfigurationName != v.Expected.ConnectivityConfigurationName { - t.Fatalf("Expected %q but got %q for ConnectivityConfigurationName", v.Expected.ConnectivityConfigurationName, actual.ConnectivityConfigurationName) - } - - } -} - -func TestSegmentsForConnectivityConfigurationId(t *testing.T) { - segments := ConnectivityConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectivityConfigurationId 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/network/2023-05-01/connectivityconfigurations/id_networkmanager.go b/resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager.go deleted file mode 100644 index 1f7b8c3216b..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package connectivityconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager_test.go deleted file mode 100644 index a27bf99d861..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package connectivityconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/connectivityconfigurations/method_createorupdate.go b/resource-manager/network/2023-05-01/connectivityconfigurations/method_createorupdate.go deleted file mode 100644 index 3ad8680898d..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package connectivityconfigurations - -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 *ConnectivityConfiguration -} - -// CreateOrUpdate ... -func (c ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Context, id ConnectivityConfigurationId, input ConnectivityConfiguration) (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 ConnectivityConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/method_delete.go b/resource-manager/network/2023-05-01/connectivityconfigurations/method_delete.go deleted file mode 100644 index 39d9c109838..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package connectivityconfigurations - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 ConnectivityConfigurationsClient) Delete(ctx context.Context, id ConnectivityConfigurationId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 ConnectivityConfigurationsClient) DeleteThenPoll(ctx context.Context, id ConnectivityConfigurationId, 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/network/2023-05-01/connectivityconfigurations/method_get.go b/resource-manager/network/2023-05-01/connectivityconfigurations/method_get.go deleted file mode 100644 index d8769033b0a..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package connectivityconfigurations - -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 *ConnectivityConfiguration -} - -// Get ... -func (c ConnectivityConfigurationsClient) Get(ctx context.Context, id ConnectivityConfigurationId) (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 ConnectivityConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/method_list.go b/resource-manager/network/2023-05-01/connectivityconfigurations/method_list.go deleted file mode 100644 index 27b1f2a035f..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package connectivityconfigurations - -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 *[]ConnectivityConfiguration -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ConnectivityConfiguration -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c ConnectivityConfigurationsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connectivityConfigurations", id.ID()), - OptionsObject: options, - } - - 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 *[]ConnectivityConfiguration `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 ConnectivityConfigurationsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, ConnectivityConfigurationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ConnectivityConfigurationsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate ConnectivityConfigurationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ConnectivityConfiguration, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/connectivityconfigurations/model_connectivityconfiguration.go b/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfiguration.go deleted file mode 100644 index 7c6238540d1..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package connectivityconfigurations - -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 ConnectivityConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfigurationproperties.go deleted file mode 100644 index 643d3c116ab..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivitygroupitem.go b/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivitygroupitem.go deleted file mode 100644 index 0ac02d12f1a..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/model_connectivitygroupitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityGroupItem struct { - GroupConnectivity GroupConnectivity `json:"groupConnectivity"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - NetworkGroupId string `json:"networkGroupId"` - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/model_hub.go b/resource-manager/network/2023-05-01/connectivityconfigurations/model_hub.go deleted file mode 100644 index 5e43da03fdd..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/model_hub.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Hub struct { - ResourceId *string `json:"resourceId,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/connectivityconfigurations/predicates.go b/resource-manager/network/2023-05-01/connectivityconfigurations/predicates.go deleted file mode 100644 index ecab73247f2..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ConnectivityConfigurationOperationPredicate) Matches(input ConnectivityConfiguration) 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.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/network/2023-05-01/connectivityconfigurations/version.go b/resource-manager/network/2023-05-01/connectivityconfigurations/version.go deleted file mode 100644 index 478e2c9a785..00000000000 --- a/resource-manager/network/2023-05-01/connectivityconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectivityconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/connectivityconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/README.md b/resource-manager/network/2023-05-01/customipprefixes/README.md deleted file mode 100644 index f0b85c0ffda..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/customipprefixes` Documentation - -The `customipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/customipprefixes" -``` - - -### Client Initialization - -```go -client := customipprefixes.NewCustomIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CustomIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -payload := customipprefixes.CustomIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `CustomIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `CustomIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CustomIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `CustomIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CustomIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -payload := customipprefixes.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/network/2023-05-01/customipprefixes/client.go b/resource-manager/network/2023-05-01/customipprefixes/client.go deleted file mode 100644 index 1e1c6887c4a..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package customipprefixes - -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 CustomIPPrefixesClient struct { - Client *resourcemanager.Client -} - -func NewCustomIPPrefixesClientWithBaseURI(sdkApi sdkEnv.Api) (*CustomIPPrefixesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "customipprefixes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CustomIPPrefixesClient: %+v", err) - } - - return &CustomIPPrefixesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/constants.go b/resource-manager/network/2023-05-01/customipprefixes/constants.go deleted file mode 100644 index 2c9a9f7c2e2..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/constants.go +++ /dev/null @@ -1,222 +0,0 @@ -package customipprefixes - -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 CommissionedState string - -const ( - CommissionedStateCommissioned CommissionedState = "Commissioned" - CommissionedStateCommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" - CommissionedStateCommissioning CommissionedState = "Commissioning" - CommissionedStateDecommissioning CommissionedState = "Decommissioning" - CommissionedStateDeprovisioned CommissionedState = "Deprovisioned" - CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" - CommissionedStateProvisioned CommissionedState = "Provisioned" - CommissionedStateProvisioning CommissionedState = "Provisioning" -) - -func PossibleValuesForCommissionedState() []string { - return []string{ - string(CommissionedStateCommissioned), - string(CommissionedStateCommissionedNoInternetAdvertise), - string(CommissionedStateCommissioning), - string(CommissionedStateDecommissioning), - string(CommissionedStateDeprovisioned), - string(CommissionedStateDeprovisioning), - string(CommissionedStateProvisioned), - string(CommissionedStateProvisioning), - } -} - -func (s *CommissionedState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCommissionedState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCommissionedState(input string) (*CommissionedState, error) { - vals := map[string]CommissionedState{ - "commissioned": CommissionedStateCommissioned, - "commissionednointernetadvertise": CommissionedStateCommissionedNoInternetAdvertise, - "commissioning": CommissionedStateCommissioning, - "decommissioning": CommissionedStateDecommissioning, - "deprovisioned": CommissionedStateDeprovisioned, - "deprovisioning": CommissionedStateDeprovisioning, - "provisioned": CommissionedStateProvisioned, - "provisioning": CommissionedStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CommissionedState(input) - return &out, nil -} - -type CustomIPPrefixType string - -const ( - CustomIPPrefixTypeChild CustomIPPrefixType = "Child" - CustomIPPrefixTypeParent CustomIPPrefixType = "Parent" - CustomIPPrefixTypeSingular CustomIPPrefixType = "Singular" -) - -func PossibleValuesForCustomIPPrefixType() []string { - return []string{ - string(CustomIPPrefixTypeChild), - string(CustomIPPrefixTypeParent), - string(CustomIPPrefixTypeSingular), - } -} - -func (s *CustomIPPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCustomIPPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCustomIPPrefixType(input string) (*CustomIPPrefixType, error) { - vals := map[string]CustomIPPrefixType{ - "child": CustomIPPrefixTypeChild, - "parent": CustomIPPrefixTypeParent, - "singular": CustomIPPrefixTypeSingular, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CustomIPPrefixType(input) - return &out, nil -} - -type Geo string - -const ( - GeoAFRI Geo = "AFRI" - GeoAPAC Geo = "APAC" - GeoAQ Geo = "AQ" - GeoEURO Geo = "EURO" - GeoGLOBAL Geo = "GLOBAL" - GeoLATAM Geo = "LATAM" - GeoME Geo = "ME" - GeoNAM Geo = "NAM" - GeoOCEANIA Geo = "OCEANIA" -) - -func PossibleValuesForGeo() []string { - return []string{ - string(GeoAFRI), - string(GeoAPAC), - string(GeoAQ), - string(GeoEURO), - string(GeoGLOBAL), - string(GeoLATAM), - string(GeoME), - string(GeoNAM), - string(GeoOCEANIA), - } -} - -func (s *Geo) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGeo(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGeo(input string) (*Geo, error) { - vals := map[string]Geo{ - "afri": GeoAFRI, - "apac": GeoAPAC, - "aq": GeoAQ, - "euro": GeoEURO, - "global": GeoGLOBAL, - "latam": GeoLATAM, - "me": GeoME, - "nam": GeoNAM, - "oceania": GeoOCEANIA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Geo(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2023-05-01/customipprefixes/id_customipprefix.go deleted file mode 100644 index d4206cbdfb5..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/id_customipprefix.go +++ /dev/null @@ -1,130 +0,0 @@ -package customipprefixes - -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(&CustomIPPrefixId{}) -} - -var _ resourceids.ResourceId = &CustomIPPrefixId{} - -// CustomIPPrefixId is a struct representing the Resource ID for a Custom I P Prefix -type CustomIPPrefixId struct { - SubscriptionId string - ResourceGroupName string - CustomIPPrefixName string -} - -// NewCustomIPPrefixID returns a new CustomIPPrefixId struct -func NewCustomIPPrefixID(subscriptionId string, resourceGroupName string, customIPPrefixName string) CustomIPPrefixId { - return CustomIPPrefixId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CustomIPPrefixName: customIPPrefixName, - } -} - -// ParseCustomIPPrefixID parses 'input' into a CustomIPPrefixId -func ParseCustomIPPrefixID(input string) (*CustomIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&CustomIPPrefixId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CustomIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCustomIPPrefixIDInsensitively parses 'input' case-insensitively into a CustomIPPrefixId -// note: this method should only be used for API response data and not user input -func ParseCustomIPPrefixIDInsensitively(input string) (*CustomIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&CustomIPPrefixId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CustomIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CustomIPPrefixId) 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.CustomIPPrefixName, ok = input.Parsed["customIPPrefixName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "customIPPrefixName", input) - } - - return nil -} - -// ValidateCustomIPPrefixID checks that 'input' can be parsed as a Custom I P Prefix ID -func ValidateCustomIPPrefixID(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 := ParseCustomIPPrefixID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Custom I P Prefix ID -func (id CustomIPPrefixId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/customIPPrefixes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CustomIPPrefixName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Custom I P Prefix ID -func (id CustomIPPrefixId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticCustomIPPrefixes", "customIPPrefixes", "customIPPrefixes"), - resourceids.UserSpecifiedSegment("customIPPrefixName", "customIPPrefixValue"), - } -} - -// String returns a human-readable description of this Custom I P Prefix ID -func (id CustomIPPrefixId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Custom I P Prefix Name: %q", id.CustomIPPrefixName), - } - return fmt.Sprintf("Custom I P Prefix (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2023-05-01/customipprefixes/id_customipprefix_test.go deleted file mode 100644 index 7e3034445fa..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/id_customipprefix_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package customipprefixes - -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 = &CustomIPPrefixId{} - -func TestNewCustomIPPrefixID(t *testing.T) { - id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - - 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.CustomIPPrefixName != "customIPPrefixValue" { - t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIPPrefixValue") - } -} - -func TestFormatCustomIPPrefixID(t *testing.T) { - actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCustomIPPrefixID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CustomIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue", - Expected: &CustomIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCustomIPPrefixID(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.CustomIPPrefixName != v.Expected.CustomIPPrefixName { - t.Fatalf("Expected %q but got %q for CustomIPPrefixName", v.Expected.CustomIPPrefixName, actual.CustomIPPrefixName) - } - - } -} - -func TestParseCustomIPPrefixIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CustomIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cUsToMiPpReFiXeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue", - Expected: &CustomIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cUsToMiPpReFiXeS/cUsToMiPpReFiXvAlUe", - Expected: &CustomIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CustomIPPrefixName: "cUsToMiPpReFiXvAlUe", - }, - }, - { - // 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.nEtWoRk/cUsToMiPpReFiXeS/cUsToMiPpReFiXvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCustomIPPrefixIDInsensitively(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.CustomIPPrefixName != v.Expected.CustomIPPrefixName { - t.Fatalf("Expected %q but got %q for CustomIPPrefixName", v.Expected.CustomIPPrefixName, actual.CustomIPPrefixName) - } - - } -} - -func TestSegmentsForCustomIPPrefixId(t *testing.T) { - segments := CustomIPPrefixId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CustomIPPrefixId 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/network/2023-05-01/customipprefixes/method_createorupdate.go b/resource-manager/network/2023-05-01/customipprefixes/method_createorupdate.go deleted file mode 100644 index 88925ffb667..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package customipprefixes - -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 *CustomIPPrefix -} - -// CreateOrUpdate ... -func (c CustomIPPrefixesClient) CreateOrUpdate(ctx context.Context, id CustomIPPrefixId, input CustomIPPrefix) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c CustomIPPrefixesClient) CreateOrUpdateThenPoll(ctx context.Context, id CustomIPPrefixId, input CustomIPPrefix) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/customipprefixes/method_delete.go b/resource-manager/network/2023-05-01/customipprefixes/method_delete.go deleted file mode 100644 index 2233d70928d..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package customipprefixes - -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 CustomIPPrefixesClient) Delete(ctx context.Context, id CustomIPPrefixId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 CustomIPPrefixesClient) DeleteThenPoll(ctx context.Context, id CustomIPPrefixId) 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/network/2023-05-01/customipprefixes/method_get.go b/resource-manager/network/2023-05-01/customipprefixes/method_get.go deleted file mode 100644 index 04442324994..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package customipprefixes - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CustomIPPrefix -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c CustomIPPrefixesClient) Get(ctx context.Context, id CustomIPPrefixId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 CustomIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/method_list.go b/resource-manager/network/2023-05-01/customipprefixes/method_list.go deleted file mode 100644 index 94c8ee791eb..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package customipprefixes - -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 *[]CustomIPPrefix -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []CustomIPPrefix -} - -// List ... -func (c CustomIPPrefixesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/customIPPrefixes", 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 *[]CustomIPPrefix `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 CustomIPPrefixesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, CustomIPPrefixOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CustomIPPrefixesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate CustomIPPrefixOperationPredicate) (result ListCompleteResult, err error) { - items := make([]CustomIPPrefix, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/customipprefixes/method_listall.go b/resource-manager/network/2023-05-01/customipprefixes/method_listall.go deleted file mode 100644 index b68a43fd89e..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package customipprefixes - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]CustomIPPrefix -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []CustomIPPrefix -} - -// ListAll ... -func (c CustomIPPrefixesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/customIPPrefixes", 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 *[]CustomIPPrefix `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c CustomIPPrefixesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, CustomIPPrefixOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CustomIPPrefixesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate CustomIPPrefixOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]CustomIPPrefix, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/method_updatetags.go b/resource-manager/network/2023-05-01/customipprefixes/method_updatetags.go deleted file mode 100644 index c61802109c3..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package customipprefixes - -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 *CustomIPPrefix -} - -// UpdateTags ... -func (c CustomIPPrefixesClient) UpdateTags(ctx context.Context, id CustomIPPrefixId, 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 CustomIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/model_customipprefix.go b/resource-manager/network/2023-05-01/customipprefixes/model_customipprefix.go deleted file mode 100644 index fc3d26ef7a4..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/model_customipprefix.go +++ /dev/null @@ -1,21 +0,0 @@ -package customipprefixes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 CustomIPPrefix struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *CustomIPPrefixPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/model_customipprefixpropertiesformat.go b/resource-manager/network/2023-05-01/customipprefixes/model_customipprefixpropertiesformat.go deleted file mode 100644 index f26a83b6b83..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/model_customipprefixpropertiesformat.go +++ /dev/null @@ -1,22 +0,0 @@ -package customipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomIPPrefixPropertiesFormat struct { - Asn *string `json:"asn,omitempty"` - AuthorizationMessage *string `json:"authorizationMessage,omitempty"` - ChildCustomIPPrefixes *[]SubResource `json:"childCustomIpPrefixes,omitempty"` - Cidr *string `json:"cidr,omitempty"` - CommissionedState *CommissionedState `json:"commissionedState,omitempty"` - CustomIPPrefixParent *SubResource `json:"customIpPrefixParent,omitempty"` - ExpressRouteAdvertise *bool `json:"expressRouteAdvertise,omitempty"` - FailedReason *string `json:"failedReason,omitempty"` - Geo *Geo `json:"geo,omitempty"` - NoInternetAdvertise *bool `json:"noInternetAdvertise,omitempty"` - PrefixType *CustomIPPrefixType `json:"prefixType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SignedMessage *string `json:"signedMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/model_subresource.go b/resource-manager/network/2023-05-01/customipprefixes/model_subresource.go deleted file mode 100644 index 2428ad08fc0..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package customipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/customipprefixes/model_tagsobject.go b/resource-manager/network/2023-05-01/customipprefixes/model_tagsobject.go deleted file mode 100644 index f1f3aea2b6e..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package customipprefixes - -// 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/network/2023-05-01/customipprefixes/predicates.go b/resource-manager/network/2023-05-01/customipprefixes/predicates.go deleted file mode 100644 index 288f9cfa042..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package customipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomIPPrefixOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p CustomIPPrefixOperationPredicate) Matches(input CustomIPPrefix) 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 && (input.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/network/2023-05-01/customipprefixes/version.go b/resource-manager/network/2023-05-01/customipprefixes/version.go deleted file mode 100644 index 809cba0db91..00000000000 --- a/resource-manager/network/2023-05-01/customipprefixes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package customipprefixes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/customipprefixes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/README.md b/resource-manager/network/2023-05-01/ddoscustompolicies/README.md deleted file mode 100644 index eef9c95ece3..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ddoscustompolicies` Documentation - -The `ddoscustompolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/ddoscustompolicies" -``` - - -### Client Initialization - -```go -client := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DdosCustomPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -payload := ddoscustompolicies.DdosCustomPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosCustomPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosCustomPoliciesClient.Get` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -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: `DdosCustomPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -payload := ddoscustompolicies.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/network/2023-05-01/ddoscustompolicies/client.go b/resource-manager/network/2023-05-01/ddoscustompolicies/client.go deleted file mode 100644 index e6985cefaee..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ddoscustompolicies - -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 DdosCustomPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewDdosCustomPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*DdosCustomPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ddoscustompolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DdosCustomPoliciesClient: %+v", err) - } - - return &DdosCustomPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/constants.go b/resource-manager/network/2023-05-01/ddoscustompolicies/constants.go deleted file mode 100644 index e62adb4c84b..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package ddoscustompolicies - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy.go b/resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy.go deleted file mode 100644 index 1898126aafc..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package ddoscustompolicies - -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(&DdosCustomPolicyId{}) -} - -var _ resourceids.ResourceId = &DdosCustomPolicyId{} - -// DdosCustomPolicyId is a struct representing the Resource ID for a Ddos Custom Policy -type DdosCustomPolicyId struct { - SubscriptionId string - ResourceGroupName string - DdosCustomPolicyName string -} - -// NewDdosCustomPolicyID returns a new DdosCustomPolicyId struct -func NewDdosCustomPolicyID(subscriptionId string, resourceGroupName string, ddosCustomPolicyName string) DdosCustomPolicyId { - return DdosCustomPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DdosCustomPolicyName: ddosCustomPolicyName, - } -} - -// ParseDdosCustomPolicyID parses 'input' into a DdosCustomPolicyId -func ParseDdosCustomPolicyID(input string) (*DdosCustomPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosCustomPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosCustomPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDdosCustomPolicyIDInsensitively parses 'input' case-insensitively into a DdosCustomPolicyId -// note: this method should only be used for API response data and not user input -func ParseDdosCustomPolicyIDInsensitively(input string) (*DdosCustomPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosCustomPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosCustomPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DdosCustomPolicyId) 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.DdosCustomPolicyName, ok = input.Parsed["ddosCustomPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ddosCustomPolicyName", input) - } - - return nil -} - -// ValidateDdosCustomPolicyID checks that 'input' can be parsed as a Ddos Custom Policy ID -func ValidateDdosCustomPolicyID(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 := ParseDdosCustomPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Ddos Custom Policy ID -func (id DdosCustomPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ddosCustomPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DdosCustomPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Ddos Custom Policy ID -func (id DdosCustomPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticDdosCustomPolicies", "ddosCustomPolicies", "ddosCustomPolicies"), - resourceids.UserSpecifiedSegment("ddosCustomPolicyName", "ddosCustomPolicyValue"), - } -} - -// String returns a human-readable description of this Ddos Custom Policy ID -func (id DdosCustomPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ddos Custom Policy Name: %q", id.DdosCustomPolicyName), - } - return fmt.Sprintf("Ddos Custom Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy_test.go b/resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy_test.go deleted file mode 100644 index 9e3bda7a007..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/id_ddoscustompolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ddoscustompolicies - -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 = &DdosCustomPolicyId{} - -func TestNewDdosCustomPolicyID(t *testing.T) { - id := NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - - 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.DdosCustomPolicyName != "ddosCustomPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'DdosCustomPolicyName'", id.DdosCustomPolicyName, "ddosCustomPolicyValue") - } -} - -func TestFormatDdosCustomPolicyID(t *testing.T) { - actual := NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDdosCustomPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosCustomPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue", - Expected: &DdosCustomPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosCustomPolicyName: "ddosCustomPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosCustomPolicyID(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.DdosCustomPolicyName != v.Expected.DdosCustomPolicyName { - t.Fatalf("Expected %q but got %q for DdosCustomPolicyName", v.Expected.DdosCustomPolicyName, actual.DdosCustomPolicyName) - } - - } -} - -func TestParseDdosCustomPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosCustomPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoScUsToMpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue", - Expected: &DdosCustomPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosCustomPolicyName: "ddosCustomPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoScUsToMpOlIcIeS/dDoScUsToMpOlIcYvAlUe", - Expected: &DdosCustomPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DdosCustomPolicyName: "dDoScUsToMpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/dDoScUsToMpOlIcIeS/dDoScUsToMpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosCustomPolicyIDInsensitively(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.DdosCustomPolicyName != v.Expected.DdosCustomPolicyName { - t.Fatalf("Expected %q but got %q for DdosCustomPolicyName", v.Expected.DdosCustomPolicyName, actual.DdosCustomPolicyName) - } - - } -} - -func TestSegmentsForDdosCustomPolicyId(t *testing.T) { - segments := DdosCustomPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DdosCustomPolicyId 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/network/2023-05-01/ddoscustompolicies/method_createorupdate.go b/resource-manager/network/2023-05-01/ddoscustompolicies/method_createorupdate.go deleted file mode 100644 index ea81bb5382f..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ddoscustompolicies - -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 *DdosCustomPolicy -} - -// CreateOrUpdate ... -func (c DdosCustomPoliciesClient) CreateOrUpdate(ctx context.Context, id DdosCustomPolicyId, input DdosCustomPolicy) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DdosCustomPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id DdosCustomPolicyId, input DdosCustomPolicy) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/ddoscustompolicies/method_delete.go b/resource-manager/network/2023-05-01/ddoscustompolicies/method_delete.go deleted file mode 100644 index 78624333195..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ddoscustompolicies - -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 DdosCustomPoliciesClient) Delete(ctx context.Context, id DdosCustomPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 DdosCustomPoliciesClient) DeleteThenPoll(ctx context.Context, id DdosCustomPolicyId) 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/network/2023-05-01/ddoscustompolicies/method_get.go b/resource-manager/network/2023-05-01/ddoscustompolicies/method_get.go deleted file mode 100644 index 07a8cdf6ad0..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package ddoscustompolicies - -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 *DdosCustomPolicy -} - -// Get ... -func (c DdosCustomPoliciesClient) Get(ctx context.Context, id DdosCustomPolicyId) (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 DdosCustomPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/method_updatetags.go b/resource-manager/network/2023-05-01/ddoscustompolicies/method_updatetags.go deleted file mode 100644 index b64aa2cb519..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package ddoscustompolicies - -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 *DdosCustomPolicy -} - -// UpdateTags ... -func (c DdosCustomPoliciesClient) UpdateTags(ctx context.Context, id DdosCustomPolicyId, 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 DdosCustomPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicy.go b/resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicy.go deleted file mode 100644 index 21c20585880..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicy.go +++ /dev/null @@ -1,14 +0,0 @@ -package ddoscustompolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosCustomPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DdosCustomPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go b/resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go deleted file mode 100644 index fad59051390..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package ddoscustompolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosCustomPolicyPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ddoscustompolicies/model_tagsobject.go b/resource-manager/network/2023-05-01/ddoscustompolicies/model_tagsobject.go deleted file mode 100644 index 3b93ba90100..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ddoscustompolicies - -// 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/network/2023-05-01/ddoscustompolicies/version.go b/resource-manager/network/2023-05-01/ddoscustompolicies/version.go deleted file mode 100644 index eb41e698ebf..00000000000 --- a/resource-manager/network/2023-05-01/ddoscustompolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ddoscustompolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ddoscustompolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/README.md b/resource-manager/network/2023-05-01/ddosprotectionplans/README.md deleted file mode 100644 index 21a5efbe17f..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ddosprotectionplans` Documentation - -The `ddosprotectionplans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/ddosprotectionplans" -``` - - -### Client Initialization - -```go -client := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DdosProtectionPlansClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -payload := ddosprotectionplans.DdosProtectionPlan{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosProtectionPlansClient.Delete` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosProtectionPlansClient.Get` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.UpdateTags` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -payload := ddosprotectionplans.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/network/2023-05-01/ddosprotectionplans/client.go b/resource-manager/network/2023-05-01/ddosprotectionplans/client.go deleted file mode 100644 index de83f23ea42..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ddosprotectionplans - -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 DdosProtectionPlansClient struct { - Client *resourcemanager.Client -} - -func NewDdosProtectionPlansClientWithBaseURI(sdkApi sdkEnv.Api) (*DdosProtectionPlansClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ddosprotectionplans", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DdosProtectionPlansClient: %+v", err) - } - - return &DdosProtectionPlansClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/constants.go b/resource-manager/network/2023-05-01/ddosprotectionplans/constants.go deleted file mode 100644 index ec2a63ded59..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package ddosprotectionplans - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan.go b/resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan.go deleted file mode 100644 index 1be4cad64d9..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan.go +++ /dev/null @@ -1,130 +0,0 @@ -package ddosprotectionplans - -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(&DdosProtectionPlanId{}) -} - -var _ resourceids.ResourceId = &DdosProtectionPlanId{} - -// DdosProtectionPlanId is a struct representing the Resource ID for a Ddos Protection Plan -type DdosProtectionPlanId struct { - SubscriptionId string - ResourceGroupName string - DdosProtectionPlanName string -} - -// NewDdosProtectionPlanID returns a new DdosProtectionPlanId struct -func NewDdosProtectionPlanID(subscriptionId string, resourceGroupName string, ddosProtectionPlanName string) DdosProtectionPlanId { - return DdosProtectionPlanId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DdosProtectionPlanName: ddosProtectionPlanName, - } -} - -// ParseDdosProtectionPlanID parses 'input' into a DdosProtectionPlanId -func ParseDdosProtectionPlanID(input string) (*DdosProtectionPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosProtectionPlanId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosProtectionPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDdosProtectionPlanIDInsensitively parses 'input' case-insensitively into a DdosProtectionPlanId -// note: this method should only be used for API response data and not user input -func ParseDdosProtectionPlanIDInsensitively(input string) (*DdosProtectionPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosProtectionPlanId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosProtectionPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DdosProtectionPlanId) 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.DdosProtectionPlanName, ok = input.Parsed["ddosProtectionPlanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ddosProtectionPlanName", input) - } - - return nil -} - -// ValidateDdosProtectionPlanID checks that 'input' can be parsed as a Ddos Protection Plan ID -func ValidateDdosProtectionPlanID(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 := ParseDdosProtectionPlanID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Ddos Protection Plan ID -func (id DdosProtectionPlanId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ddosProtectionPlans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DdosProtectionPlanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Ddos Protection Plan ID -func (id DdosProtectionPlanId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticDdosProtectionPlans", "ddosProtectionPlans", "ddosProtectionPlans"), - resourceids.UserSpecifiedSegment("ddosProtectionPlanName", "ddosProtectionPlanValue"), - } -} - -// String returns a human-readable description of this Ddos Protection Plan ID -func (id DdosProtectionPlanId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ddos Protection Plan Name: %q", id.DdosProtectionPlanName), - } - return fmt.Sprintf("Ddos Protection Plan (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan_test.go b/resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan_test.go deleted file mode 100644 index 27a6df418c1..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/id_ddosprotectionplan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ddosprotectionplans - -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 = &DdosProtectionPlanId{} - -func TestNewDdosProtectionPlanID(t *testing.T) { - id := NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - - 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.DdosProtectionPlanName != "ddosProtectionPlanValue" { - t.Fatalf("Expected %q but got %q for Segment 'DdosProtectionPlanName'", id.DdosProtectionPlanName, "ddosProtectionPlanValue") - } -} - -func TestFormatDdosProtectionPlanID(t *testing.T) { - actual := NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDdosProtectionPlanID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosProtectionPlanId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue", - Expected: &DdosProtectionPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosProtectionPlanName: "ddosProtectionPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosProtectionPlanID(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.DdosProtectionPlanName != v.Expected.DdosProtectionPlanName { - t.Fatalf("Expected %q but got %q for DdosProtectionPlanName", v.Expected.DdosProtectionPlanName, actual.DdosProtectionPlanName) - } - - } -} - -func TestParseDdosProtectionPlanIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosProtectionPlanId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoSpRoTeCtIoNpLaNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue", - Expected: &DdosProtectionPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosProtectionPlanName: "ddosProtectionPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoSpRoTeCtIoNpLaNs/dDoSpRoTeCtIoNpLaNvAlUe", - Expected: &DdosProtectionPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DdosProtectionPlanName: "dDoSpRoTeCtIoNpLaNvAlUe", - }, - }, - { - // 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.nEtWoRk/dDoSpRoTeCtIoNpLaNs/dDoSpRoTeCtIoNpLaNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosProtectionPlanIDInsensitively(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.DdosProtectionPlanName != v.Expected.DdosProtectionPlanName { - t.Fatalf("Expected %q but got %q for DdosProtectionPlanName", v.Expected.DdosProtectionPlanName, actual.DdosProtectionPlanName) - } - - } -} - -func TestSegmentsForDdosProtectionPlanId(t *testing.T) { - segments := DdosProtectionPlanId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DdosProtectionPlanId 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/network/2023-05-01/ddosprotectionplans/method_createorupdate.go b/resource-manager/network/2023-05-01/ddosprotectionplans/method_createorupdate.go deleted file mode 100644 index 4cd5100b040..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ddosprotectionplans - -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 *DdosProtectionPlan -} - -// CreateOrUpdate ... -func (c DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, id DdosProtectionPlanId, input DdosProtectionPlan) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DdosProtectionPlansClient) CreateOrUpdateThenPoll(ctx context.Context, id DdosProtectionPlanId, input DdosProtectionPlan) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/ddosprotectionplans/method_delete.go b/resource-manager/network/2023-05-01/ddosprotectionplans/method_delete.go deleted file mode 100644 index 43d058cf8b8..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ddosprotectionplans - -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 DdosProtectionPlansClient) Delete(ctx context.Context, id DdosProtectionPlanId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 DdosProtectionPlansClient) DeleteThenPoll(ctx context.Context, id DdosProtectionPlanId) 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/network/2023-05-01/ddosprotectionplans/method_get.go b/resource-manager/network/2023-05-01/ddosprotectionplans/method_get.go deleted file mode 100644 index 9003f8a00c3..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package ddosprotectionplans - -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 *DdosProtectionPlan -} - -// Get ... -func (c DdosProtectionPlansClient) Get(ctx context.Context, id DdosProtectionPlanId) (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 DdosProtectionPlan - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/method_list.go b/resource-manager/network/2023-05-01/ddosprotectionplans/method_list.go deleted file mode 100644 index c6116ac3b4a..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package ddosprotectionplans - -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 *[]DdosProtectionPlan -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DdosProtectionPlan -} - -// List ... -func (c DdosProtectionPlansClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ddosProtectionPlans", 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 *[]DdosProtectionPlan `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 DdosProtectionPlansClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DdosProtectionPlanOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DdosProtectionPlansClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DdosProtectionPlanOperationPredicate) (result ListCompleteResult, err error) { - items := make([]DdosProtectionPlan, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/ddosprotectionplans/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/ddosprotectionplans/method_listbyresourcegroup.go deleted file mode 100644 index ae3e8de89b1..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package ddosprotectionplans - -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 *[]DdosProtectionPlan -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []DdosProtectionPlan -} - -// ListByResourceGroup ... -func (c DdosProtectionPlansClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ddosProtectionPlans", 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 *[]DdosProtectionPlan `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 DdosProtectionPlansClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DdosProtectionPlanOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DdosProtectionPlansClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DdosProtectionPlanOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]DdosProtectionPlan, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/ddosprotectionplans/method_updatetags.go b/resource-manager/network/2023-05-01/ddosprotectionplans/method_updatetags.go deleted file mode 100644 index 07e469082e6..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package ddosprotectionplans - -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 *DdosProtectionPlan -} - -// UpdateTags ... -func (c DdosProtectionPlansClient) UpdateTags(ctx context.Context, id DdosProtectionPlanId, 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 DdosProtectionPlan - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplan.go b/resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplan.go deleted file mode 100644 index 3313192e51b..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplan.go +++ /dev/null @@ -1,14 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosProtectionPlan struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go b/resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go deleted file mode 100644 index b1f0f51665d..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosProtectionPlanPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/model_subresource.go b/resource-manager/network/2023-05-01/ddosprotectionplans/model_subresource.go deleted file mode 100644 index 066803386d8..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ddosprotectionplans/model_tagsobject.go b/resource-manager/network/2023-05-01/ddosprotectionplans/model_tagsobject.go deleted file mode 100644 index 99bf4d851b5..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ddosprotectionplans - -// 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/network/2023-05-01/ddosprotectionplans/predicates.go b/resource-manager/network/2023-05-01/ddosprotectionplans/predicates.go deleted file mode 100644 index 6ad9bbf5374..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosProtectionPlanOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p DdosProtectionPlanOperationPredicate) Matches(input DdosProtectionPlan) 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 && (input.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/network/2023-05-01/ddosprotectionplans/version.go b/resource-manager/network/2023-05-01/ddosprotectionplans/version.go deleted file mode 100644 index 6ba53e82fa5..00000000000 --- a/resource-manager/network/2023-05-01/ddosprotectionplans/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ddosprotectionplans - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ddosprotectionplans/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/README.md b/resource-manager/network/2023-05-01/dscpconfiguration/README.md deleted file mode 100644 index 2b4037efdc6..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/README.md +++ /dev/null @@ -1,65 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/dscpconfiguration` Documentation - -The `dscpconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/dscpconfiguration" -``` - - -### Client Initialization - -```go -client := dscpconfiguration.NewDscpConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DscpConfigurationClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -payload := dscpconfiguration.DscpConfiguration{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DscpConfigurationClient.Delete` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DscpConfigurationClient.Get` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -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 -} -``` diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/client.go b/resource-manager/network/2023-05-01/dscpconfiguration/client.go deleted file mode 100644 index ed6cfe7aa08..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dscpconfiguration - -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 DscpConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewDscpConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*DscpConfigurationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dscpconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DscpConfigurationClient: %+v", err) - } - - return &DscpConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/constants.go b/resource-manager/network/2023-05-01/dscpconfiguration/constants.go deleted file mode 100644 index fccfd261eb9..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/constants.go +++ /dev/null @@ -1,1213 +0,0 @@ -package dscpconfiguration - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTcp ProtocolType = "Tcp" - ProtocolTypeUdp ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeAh), - string(ProtocolTypeAll), - string(ProtocolTypeDoNotUse), - string(ProtocolTypeEsp), - string(ProtocolTypeGre), - string(ProtocolTypeIcmp), - string(ProtocolTypeTcp), - string(ProtocolTypeUdp), - string(ProtocolTypeVxlan), - } -} - -func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProtocolType(input string) (*ProtocolType, error) { - vals := map[string]ProtocolType{ - "ah": ProtocolTypeAh, - "all": ProtocolTypeAll, - "donotuse": ProtocolTypeDoNotUse, - "esp": ProtocolTypeEsp, - "gre": ProtocolTypeGre, - "icmp": ProtocolTypeIcmp, - "tcp": ProtocolTypeTcp, - "udp": ProtocolTypeUdp, - "vxlan": ProtocolTypeVxlan, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtocolType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration.go deleted file mode 100644 index 8eb56f33d98..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -package dscpconfiguration - -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(&DscpConfigurationId{}) -} - -var _ resourceids.ResourceId = &DscpConfigurationId{} - -// DscpConfigurationId is a struct representing the Resource ID for a Dscp Configuration -type DscpConfigurationId struct { - SubscriptionId string - ResourceGroupName string - DscpConfigurationName string -} - -// NewDscpConfigurationID returns a new DscpConfigurationId struct -func NewDscpConfigurationID(subscriptionId string, resourceGroupName string, dscpConfigurationName string) DscpConfigurationId { - return DscpConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DscpConfigurationName: dscpConfigurationName, - } -} - -// ParseDscpConfigurationID parses 'input' into a DscpConfigurationId -func ParseDscpConfigurationID(input string) (*DscpConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&DscpConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DscpConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDscpConfigurationIDInsensitively parses 'input' case-insensitively into a DscpConfigurationId -// note: this method should only be used for API response data and not user input -func ParseDscpConfigurationIDInsensitively(input string) (*DscpConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&DscpConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DscpConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DscpConfigurationId) 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.DscpConfigurationName, ok = input.Parsed["dscpConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dscpConfigurationName", input) - } - - return nil -} - -// ValidateDscpConfigurationID checks that 'input' can be parsed as a Dscp Configuration ID -func ValidateDscpConfigurationID(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 := ParseDscpConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Dscp Configuration ID -func (id DscpConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/dscpConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DscpConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Dscp Configuration ID -func (id DscpConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticDscpConfigurations", "dscpConfigurations", "dscpConfigurations"), - resourceids.UserSpecifiedSegment("dscpConfigurationName", "dscpConfigurationValue"), - } -} - -// String returns a human-readable description of this Dscp Configuration ID -func (id DscpConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Dscp Configuration Name: %q", id.DscpConfigurationName), - } - return fmt.Sprintf("Dscp Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration_test.go b/resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration_test.go deleted file mode 100644 index c30eb45fbe9..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/id_dscpconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package dscpconfiguration - -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 = &DscpConfigurationId{} - -func TestNewDscpConfigurationID(t *testing.T) { - id := NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - - 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.DscpConfigurationName != "dscpConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'DscpConfigurationName'", id.DscpConfigurationName, "dscpConfigurationValue") - } -} - -func TestFormatDscpConfigurationID(t *testing.T) { - actual := NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDscpConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DscpConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue", - Expected: &DscpConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DscpConfigurationName: "dscpConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDscpConfigurationID(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.DscpConfigurationName != v.Expected.DscpConfigurationName { - t.Fatalf("Expected %q but got %q for DscpConfigurationName", v.Expected.DscpConfigurationName, actual.DscpConfigurationName) - } - - } -} - -func TestParseDscpConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DscpConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dScPcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue", - Expected: &DscpConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DscpConfigurationName: "dscpConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dScPcOnFiGuRaTiOnS/dScPcOnFiGuRaTiOnVaLuE", - Expected: &DscpConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DscpConfigurationName: "dScPcOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/dScPcOnFiGuRaTiOnS/dScPcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDscpConfigurationIDInsensitively(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.DscpConfigurationName != v.Expected.DscpConfigurationName { - t.Fatalf("Expected %q but got %q for DscpConfigurationName", v.Expected.DscpConfigurationName, actual.DscpConfigurationName) - } - - } -} - -func TestSegmentsForDscpConfigurationId(t *testing.T) { - segments := DscpConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DscpConfigurationId 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/network/2023-05-01/dscpconfiguration/method_createorupdate.go b/resource-manager/network/2023-05-01/dscpconfiguration/method_createorupdate.go deleted file mode 100644 index e2262349c4f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package dscpconfiguration - -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 *DscpConfiguration -} - -// CreateOrUpdate ... -func (c DscpConfigurationClient) CreateOrUpdate(ctx context.Context, id DscpConfigurationId, input DscpConfiguration) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DscpConfigurationClient) CreateOrUpdateThenPoll(ctx context.Context, id DscpConfigurationId, input DscpConfiguration) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/dscpconfiguration/method_delete.go b/resource-manager/network/2023-05-01/dscpconfiguration/method_delete.go deleted file mode 100644 index 85639c01f9b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package dscpconfiguration - -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 DscpConfigurationClient) Delete(ctx context.Context, id DscpConfigurationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 DscpConfigurationClient) DeleteThenPoll(ctx context.Context, id DscpConfigurationId) 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/network/2023-05-01/dscpconfiguration/method_get.go b/resource-manager/network/2023-05-01/dscpconfiguration/method_get.go deleted file mode 100644 index 1563a9b978b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package dscpconfiguration - -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 *DscpConfiguration -} - -// Get ... -func (c DscpConfigurationClient) Get(ctx context.Context, id DscpConfigurationId) (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 DscpConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 440846baae7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 663b98879ff..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 5070a712a0c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfiguration.go deleted file mode 100644 index a3ca72a1804..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 2072ac671c8..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygroup.go deleted file mode 100644 index 067b344a691..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 4a7009c2a6b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspool.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspool.go deleted file mode 100644 index fdc704e5a94..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 8bbfd2e47e3..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 2a2e974962b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_ddossettings.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_ddossettings.go deleted file mode 100644 index dca2e7cd55f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_delegation.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_delegation.go deleted file mode 100644 index 8c1fa9b43c0..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfiguration.go deleted file mode 100644 index 04e403de3a4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DscpConfigurationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go deleted file mode 100644 index 97130781ef7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfigurationPropertiesFormat struct { - AssociatedNetworkInterfaces *[]NetworkInterface `json:"associatedNetworkInterfaces,omitempty"` - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - QosCollectionId *string `json:"qosCollectionId,omitempty"` - QosDefinitionCollection *[]QosDefinition `json:"qosDefinitionCollection,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlog.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlog.go deleted file mode 100644 index f4d7ea329fc..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogformatparameters.go deleted file mode 100644 index f759162156c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogpropertiesformat.go deleted file mode 100644 index 71ebfa45fde..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfiguration.go deleted file mode 100644 index e5b91931aa4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfiguration - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index cc67d340130..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index c498ae3b999..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrule.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrule.go deleted file mode 100644 index cae42b6f078..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 6ee4c243e27..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfiguration.go deleted file mode 100644 index b79aa52af20..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofile.go deleted file mode 100644 index 51858f8645f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1a288ffd425..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 1c2988eec98..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_iptag.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_iptag.go deleted file mode 100644 index f54e708d614..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// 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/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddress.go deleted file mode 100644 index cf9e4a0b97f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index f1b9e0732ac..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_natgateway.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_natgateway.go deleted file mode 100644 index bd2135c7219..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package dscpconfiguration - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaypropertiesformat.go deleted file mode 100644 index a748c883e51..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaysku.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaysku.go deleted file mode 100644 index 38065785ee7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_natruleportmapping.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_natruleportmapping.go deleted file mode 100644 index 4f0a40c3c84..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterface.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterface.go deleted file mode 100644 index 2c8dff0b372..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacednssettings.go deleted file mode 100644 index db01e0a6931..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfiguration.go deleted file mode 100644 index cbe1f2ef1bc..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 1901cc2fecb..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 235a6d0bfc4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacepropertiesformat.go deleted file mode 100644 index d01f01f77fa..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 9141e163666..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index b1504509e4c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygroup.go deleted file mode 100644 index 79ddb5537a1..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 76177bde258..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpoint.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpoint.go deleted file mode 100644 index b8b7f950b24..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnection.go deleted file mode 100644 index f374ac95239..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/dscpconfiguration/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnectionproperties.go deleted file mode 100644 index a3590daea44..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfiguration.go deleted file mode 100644 index d15e9404362..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index fbd74e39c9c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointproperties.go deleted file mode 100644 index 9bddc7a4349..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkservice.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkservice.go deleted file mode 100644 index 3f4dea0d52f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnection.go deleted file mode 100644 index ca5cf780e20..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 7fa3b795937..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 003e73140c9..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 1a98c978c4e..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 298e27cde46..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceproperties.go deleted file mode 100644 index 1852ce3fa31..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddress.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddress.go deleted file mode 100644 index d57ce42d098..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddressdnssettings.go deleted file mode 100644 index 9c3cb7a4ffe..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 2745ba7952e..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresssku.go deleted file mode 100644 index 184f29e9bf9..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_qosdefinition.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_qosdefinition.go deleted file mode 100644 index ad3c5e88a17..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_qosdefinition.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosDefinition struct { - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_qosiprange.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_qosiprange.go deleted file mode 100644 index 9de17d31fd5..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_qosiprange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosIPRange struct { - EndIP *string `json:"endIP,omitempty"` - StartIP *string `json:"startIP,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_qosportrange.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_qosportrange.go deleted file mode 100644 index fec0d277115..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_qosportrange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosPortRange struct { - End *int64 `json:"end,omitempty"` - Start *int64 `json:"start,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlink.go deleted file mode 100644 index e5b6bc9921c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlinkformat.go deleted file mode 100644 index 7119a8ad8fd..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_resourceset.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_resourceset.go deleted file mode 100644 index eb8146e0601..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_retentionpolicyparameters.go deleted file mode 100644 index 73bc84cb5f0..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_route.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_route.go deleted file mode 100644 index 43d479a10b9..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_routepropertiesformat.go deleted file mode 100644 index f0ba5752c84..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_routetable.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_routetable.go deleted file mode 100644 index ffa38a33f5c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_routetablepropertiesformat.go deleted file mode 100644 index f2d7db2da04..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_securityrule.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_securityrule.go deleted file mode 100644 index 670a04f125b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_securityrulepropertiesformat.go deleted file mode 100644 index 313bad92221..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlink.go deleted file mode 100644 index 51b7b88b0b4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index e74136ad481..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_servicedelegationpropertiesformat.go deleted file mode 100644 index ee33b9b67db..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicy.go deleted file mode 100644 index a4c7c550a6c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinition.go deleted file mode 100644 index d902694b0cc..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index acf884117e3..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 94a2649c90d..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 638a6d73f52..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_subnet.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_subnet.go deleted file mode 100644 index 0c94d71385f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_subnetpropertiesformat.go deleted file mode 100644 index bce567b1018..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_subresource.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_subresource.go deleted file mode 100644 index 16bee506d8d..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 84d2f9e07a1..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsproperties.go deleted file mode 100644 index a1e61262ce4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktap.go deleted file mode 100644 index 6b0b8a746c6..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index cbbb01641bc..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfiguration/version.go b/resource-manager/network/2023-05-01/dscpconfiguration/version.go deleted file mode 100644 index 5ac6c8d36b7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/README.md b/resource-manager/network/2023-05-01/dscpconfigurations/README.md deleted file mode 100644 index fd70077b123..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/dscpconfigurations` Documentation - -The `dscpconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/dscpconfigurations" -``` - - -### Client Initialization - -```go -client := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DscpConfigurationsClient.DscpConfigurationList` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.DscpConfigurationList(ctx, id)` can be used to do batched pagination -items, err := client.DscpConfigurationListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DscpConfigurationsClient.DscpConfigurationListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.DscpConfigurationListAll(ctx, id)` can be used to do batched pagination -items, err := client.DscpConfigurationListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/client.go b/resource-manager/network/2023-05-01/dscpconfigurations/client.go deleted file mode 100644 index ef38b8d0533..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dscpconfigurations - -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 DscpConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewDscpConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*DscpConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dscpconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DscpConfigurationsClient: %+v", err) - } - - return &DscpConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/constants.go b/resource-manager/network/2023-05-01/dscpconfigurations/constants.go deleted file mode 100644 index fa8c7e737d7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/constants.go +++ /dev/null @@ -1,1213 +0,0 @@ -package dscpconfigurations - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTcp ProtocolType = "Tcp" - ProtocolTypeUdp ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeAh), - string(ProtocolTypeAll), - string(ProtocolTypeDoNotUse), - string(ProtocolTypeEsp), - string(ProtocolTypeGre), - string(ProtocolTypeIcmp), - string(ProtocolTypeTcp), - string(ProtocolTypeUdp), - string(ProtocolTypeVxlan), - } -} - -func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProtocolType(input string) (*ProtocolType, error) { - vals := map[string]ProtocolType{ - "ah": ProtocolTypeAh, - "all": ProtocolTypeAll, - "donotuse": ProtocolTypeDoNotUse, - "esp": ProtocolTypeEsp, - "gre": ProtocolTypeGre, - "icmp": ProtocolTypeIcmp, - "tcp": ProtocolTypeTcp, - "udp": ProtocolTypeUdp, - "vxlan": ProtocolTypeVxlan, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtocolType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlist.go b/resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlist.go deleted file mode 100644 index da4c9e46617..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlist.go +++ /dev/null @@ -1,92 +0,0 @@ -package dscpconfigurations - -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 DscpConfigurationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DscpConfiguration -} - -type DscpConfigurationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DscpConfiguration -} - -// DscpConfigurationList ... -func (c DscpConfigurationsClient) DscpConfigurationList(ctx context.Context, id commonids.ResourceGroupId) (result DscpConfigurationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/dscpConfigurations", 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 *[]DscpConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DscpConfigurationListComplete retrieves all the results into a single object -func (c DscpConfigurationsClient) DscpConfigurationListComplete(ctx context.Context, id commonids.ResourceGroupId) (DscpConfigurationListCompleteResult, error) { - return c.DscpConfigurationListCompleteMatchingPredicate(ctx, id, DscpConfigurationOperationPredicate{}) -} - -// DscpConfigurationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DscpConfigurationsClient) DscpConfigurationListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DscpConfigurationOperationPredicate) (result DscpConfigurationListCompleteResult, err error) { - items := make([]DscpConfiguration, 0) - - resp, err := c.DscpConfigurationList(ctx, id) - if err != nil { - 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 = DscpConfigurationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlistall.go b/resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlistall.go deleted file mode 100644 index d6ea5baccc3..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/method_dscpconfigurationlistall.go +++ /dev/null @@ -1,92 +0,0 @@ -package dscpconfigurations - -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 DscpConfigurationListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DscpConfiguration -} - -type DscpConfigurationListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []DscpConfiguration -} - -// DscpConfigurationListAll ... -func (c DscpConfigurationsClient) DscpConfigurationListAll(ctx context.Context, id commonids.SubscriptionId) (result DscpConfigurationListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/dscpConfigurations", 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 *[]DscpConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DscpConfigurationListAllComplete retrieves all the results into a single object -func (c DscpConfigurationsClient) DscpConfigurationListAllComplete(ctx context.Context, id commonids.SubscriptionId) (DscpConfigurationListAllCompleteResult, error) { - return c.DscpConfigurationListAllCompleteMatchingPredicate(ctx, id, DscpConfigurationOperationPredicate{}) -} - -// DscpConfigurationListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DscpConfigurationsClient) DscpConfigurationListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DscpConfigurationOperationPredicate) (result DscpConfigurationListAllCompleteResult, err error) { - items := make([]DscpConfiguration, 0) - - resp, err := c.DscpConfigurationListAll(ctx, id) - if err != nil { - 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 = DscpConfigurationListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b7b1e084f2c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 2ee5c1c3577..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index e420a9bdc67..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 1c532c8b751..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 461f708325f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygroup.go deleted file mode 100644 index 7c885418df4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 06db97d0e6f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspool.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspool.go deleted file mode 100644 index 9063fe9528b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 9d15cc6c925..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 29791c2c31f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_ddossettings.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_ddossettings.go deleted file mode 100644 index 0a6ba1cc0f5..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_delegation.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_delegation.go deleted file mode 100644 index 3db69c6181a..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfiguration.go deleted file mode 100644 index addfd61ed3c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DscpConfigurationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go deleted file mode 100644 index 3de3861ee9e..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfigurationPropertiesFormat struct { - AssociatedNetworkInterfaces *[]NetworkInterface `json:"associatedNetworkInterfaces,omitempty"` - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - QosCollectionId *string `json:"qosCollectionId,omitempty"` - QosDefinitionCollection *[]QosDefinition `json:"qosDefinitionCollection,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlog.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlog.go deleted file mode 100644 index b06c467c3bc..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogformatparameters.go deleted file mode 100644 index c2ca6492542..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogpropertiesformat.go deleted file mode 100644 index 70fecb2d852..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfiguration.go deleted file mode 100644 index 55b02b251ca..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfigurations - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 04b3e1aafc3..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index fba1a411047..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrule.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrule.go deleted file mode 100644 index b60bfcd7088..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 598cd5d43a5..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfiguration.go deleted file mode 100644 index 2532732b5b2..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofile.go deleted file mode 100644 index ce6d532c39b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index afde579aaa3..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index c5919fd2db3..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_iptag.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_iptag.go deleted file mode 100644 index f38ed9d8c65..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// 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/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddress.go deleted file mode 100644 index 7ad5779c262..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 313080c155c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_natgateway.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_natgateway.go deleted file mode 100644 index 64ee487573f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package dscpconfigurations - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaypropertiesformat.go deleted file mode 100644 index d6a3124790e..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaysku.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaysku.go deleted file mode 100644 index f13dbd3d8fa..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_natruleportmapping.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_natruleportmapping.go deleted file mode 100644 index 4f09709144d..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterface.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterface.go deleted file mode 100644 index 0b5454d16ca..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacednssettings.go deleted file mode 100644 index 11f9a45a307..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfiguration.go deleted file mode 100644 index d4cb1b886b6..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 0b175cf4025..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 483630c9a12..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 1d542c19b57..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 134cf5c3661..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index f77ecd6167d..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygroup.go deleted file mode 100644 index f9ea08d3a85..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 0cac57de47f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpoint.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpoint.go deleted file mode 100644 index 0e5fb891d8c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnection.go deleted file mode 100644 index 64a8a54e559..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/dscpconfigurations/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnectionproperties.go deleted file mode 100644 index b41f2269c5b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfiguration.go deleted file mode 100644 index cee431f3b19..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 8ffd50d3002..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointproperties.go deleted file mode 100644 index b098e9d6023..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkservice.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkservice.go deleted file mode 100644 index 60b183ef94a..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnection.go deleted file mode 100644 index 963c255ab64..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 9f2e27f4720..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 3662d04a08f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index d0932cbb597..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index b471f35042f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceproperties.go deleted file mode 100644 index 0054e8840ee..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddress.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddress.go deleted file mode 100644 index 4fc95713929..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddressdnssettings.go deleted file mode 100644 index adee4abe556..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresspropertiesformat.go deleted file mode 100644 index b1758ec95ac..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresssku.go deleted file mode 100644 index a429ae17ad7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_qosdefinition.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_qosdefinition.go deleted file mode 100644 index c578549b24d..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_qosdefinition.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosDefinition struct { - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_qosiprange.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_qosiprange.go deleted file mode 100644 index a7109f45e97..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_qosiprange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosIPRange struct { - EndIP *string `json:"endIP,omitempty"` - StartIP *string `json:"startIP,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_qosportrange.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_qosportrange.go deleted file mode 100644 index 1c241e416d6..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_qosportrange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosPortRange struct { - End *int64 `json:"end,omitempty"` - Start *int64 `json:"start,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlink.go deleted file mode 100644 index a441a261d0b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlinkformat.go deleted file mode 100644 index 42c361f9ff9..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_resourceset.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_resourceset.go deleted file mode 100644 index 36c2929fe5c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_retentionpolicyparameters.go deleted file mode 100644 index 6cb1197a4d8..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_route.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_route.go deleted file mode 100644 index 58b9462885c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_routepropertiesformat.go deleted file mode 100644 index 57d611a55aa..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_routetable.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_routetable.go deleted file mode 100644 index 3c19f2937d7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_routetablepropertiesformat.go deleted file mode 100644 index 8d9f9c65d1c..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_securityrule.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_securityrule.go deleted file mode 100644 index eefb302d3d0..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_securityrulepropertiesformat.go deleted file mode 100644 index d43f1f5f3b1..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlink.go deleted file mode 100644 index e968a6667b0..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 3756e4aca2b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 4576bcc01d0..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicy.go deleted file mode 100644 index e1bf0604459..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 9693e4de6b7..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index c277cb3ff86..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 31009213cca..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpropertiesformat.go deleted file mode 100644 index a134bda64bd..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_subnet.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_subnet.go deleted file mode 100644 index 6c58caf5de4..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_subnetpropertiesformat.go deleted file mode 100644 index c9f490d17cd..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_subresource.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_subresource.go deleted file mode 100644 index f4f23a8234b..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index f9dd4dab77f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsproperties.go deleted file mode 100644 index 6e509b308b5..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktap.go deleted file mode 100644 index ae0f9ad6412..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index bc1c19bd39f..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/dscpconfigurations/predicates.go b/resource-manager/network/2023-05-01/dscpconfigurations/predicates.go deleted file mode 100644 index 7628df6beb6..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfigurationOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p DscpConfigurationOperationPredicate) Matches(input DscpConfiguration) 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 && (input.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/network/2023-05-01/dscpconfigurations/version.go b/resource-manager/network/2023-05-01/dscpconfigurations/version.go deleted file mode 100644 index 4c5db15da22..00000000000 --- a/resource-manager/network/2023-05-01/dscpconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/endpointservices/README.md b/resource-manager/network/2023-05-01/endpointservices/README.md deleted file mode 100644 index 04c04170905..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/endpointservices` Documentation - -The `endpointservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/endpointservices" -``` - - -### Client Initialization - -```go -client := endpointservices.NewEndpointServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EndpointServicesClient.AvailableEndpointServicesList` - -```go -ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableEndpointServicesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/endpointservices/client.go b/resource-manager/network/2023-05-01/endpointservices/client.go deleted file mode 100644 index c04faa1ffd8..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package endpointservices - -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 EndpointServicesClient struct { - Client *resourcemanager.Client -} - -func NewEndpointServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*EndpointServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "endpointservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EndpointServicesClient: %+v", err) - } - - return &EndpointServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/endpointservices/id_location.go b/resource-manager/network/2023-05-01/endpointservices/id_location.go deleted file mode 100644 index b3f9df03861..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package endpointservices - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/endpointservices/id_location_test.go b/resource-manager/network/2023-05-01/endpointservices/id_location_test.go deleted file mode 100644 index 3d471721e64..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package endpointservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/endpointservices/method_availableendpointserviceslist.go b/resource-manager/network/2023-05-01/endpointservices/method_availableendpointserviceslist.go deleted file mode 100644 index 5122506c25f..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/method_availableendpointserviceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package endpointservices - -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 AvailableEndpointServicesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]EndpointServiceResult -} - -type AvailableEndpointServicesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EndpointServiceResult -} - -// AvailableEndpointServicesList ... -func (c EndpointServicesClient) AvailableEndpointServicesList(ctx context.Context, id LocationId) (result AvailableEndpointServicesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualNetworkAvailableEndpointServices", 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 *[]EndpointServiceResult `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailableEndpointServicesListComplete retrieves all the results into a single object -func (c EndpointServicesClient) AvailableEndpointServicesListComplete(ctx context.Context, id LocationId) (AvailableEndpointServicesListCompleteResult, error) { - return c.AvailableEndpointServicesListCompleteMatchingPredicate(ctx, id, EndpointServiceResultOperationPredicate{}) -} - -// AvailableEndpointServicesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EndpointServicesClient) AvailableEndpointServicesListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate EndpointServiceResultOperationPredicate) (result AvailableEndpointServicesListCompleteResult, err error) { - items := make([]EndpointServiceResult, 0) - - resp, err := c.AvailableEndpointServicesList(ctx, id) - if err != nil { - 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 = AvailableEndpointServicesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/endpointservices/model_endpointserviceresult.go b/resource-manager/network/2023-05-01/endpointservices/model_endpointserviceresult.go deleted file mode 100644 index eae6c698d45..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/model_endpointserviceresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package endpointservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointServiceResult struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/endpointservices/predicates.go b/resource-manager/network/2023-05-01/endpointservices/predicates.go deleted file mode 100644 index 9a5ec06a288..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package endpointservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointServiceResultOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EndpointServiceResultOperationPredicate) Matches(input EndpointServiceResult) 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/network/2023-05-01/endpointservices/version.go b/resource-manager/network/2023-05-01/endpointservices/version.go deleted file mode 100644 index b97ad68e234..00000000000 --- a/resource-manager/network/2023-05-01/endpointservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package endpointservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/endpointservices/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/README.md b/resource-manager/network/2023-05-01/expressroutecircuitarptable/README.md deleted file mode 100644 index e57bfd5e826..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitarptable` Documentation - -The `expressroutecircuitarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitarptable" -``` - - -### Client Initialization - -```go -client := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitArpTableClient.ExpressRouteCircuitsListArpTable` - -```go -ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue") - -// alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/client.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/client.go deleted file mode 100644 index a927b3e2a41..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitarptable - -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 ExpressRouteCircuitArpTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitArpTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitArpTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitarptable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitArpTableClient: %+v", err) - } - - return &ExpressRouteCircuitArpTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable.go deleted file mode 100644 index c01410283c1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitarptable - -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(&ArpTableId{}) -} - -var _ resourceids.ResourceId = &ArpTableId{} - -// ArpTableId is a struct representing the Resource ID for a Arp Table -type ArpTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - ArpTableName string -} - -// NewArpTableID returns a new ArpTableId struct -func NewArpTableID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, arpTableName string) ArpTableId { - return ArpTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - ArpTableName: arpTableName, - } -} - -// ParseArpTableID parses 'input' into a ArpTableId -func ParseArpTableID(input string) (*ArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArpTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseArpTableIDInsensitively parses 'input' case-insensitively into a ArpTableId -// note: this method should only be used for API response data and not user input -func ParseArpTableIDInsensitively(input string) (*ArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArpTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ArpTableId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.ArpTableName, ok = input.Parsed["arpTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arpTableName", input) - } - - return nil -} - -// ValidateArpTableID checks that 'input' can be parsed as a Arp Table ID -func ValidateArpTableID(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 := ParseArpTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Arp Table ID -func (id ArpTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/arpTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.ArpTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Arp Table ID -func (id ArpTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "arpTableValue"), - } -} - -// String returns a human-readable description of this Arp Table ID -func (id ArpTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Arp Table Name: %q", id.ArpTableName), - } - return fmt.Sprintf("Arp Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable_test.go deleted file mode 100644 index 1221091045b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/id_arptable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitarptable - -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 = &ArpTableId{} - -func TestNewArpTableID(t *testing.T) { - id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.ArpTableName != "arpTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableValue") - } -} - -func TestFormatArpTableID(t *testing.T) { - actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseArpTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &ArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArpTableID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestParseArpTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &ArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe", - Expected: &ArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - ArpTableName: "aRpTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArpTableIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestSegmentsForArpTableId(t *testing.T) { - segments := ArpTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ArpTableId 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/network/2023-05-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go deleted file mode 100644 index 6e9e9491ca8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitarptable - -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 ExpressRouteCircuitsListArpTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitArpTable -} - -type ExpressRouteCircuitsListArpTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitArpTable -} - -// ExpressRouteCircuitsListArpTable ... -func (c ExpressRouteCircuitArpTableClient) ExpressRouteCircuitsListArpTable(ctx context.Context, id ArpTableId) (result ExpressRouteCircuitsListArpTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCircuitsListArpTableThenPoll performs ExpressRouteCircuitsListArpTable then polls until it's completed -func (c ExpressRouteCircuitArpTableClient) ExpressRouteCircuitsListArpTableThenPoll(ctx context.Context, id ArpTableId) error { - result, err := c.ExpressRouteCircuitsListArpTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCircuitsListArpTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCircuitsListArpTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go deleted file mode 100644 index 8b4183dd49f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuitarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTable struct { - Age *int64 `json:"age,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - Interface *string `json:"interface,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/predicates.go deleted file mode 100644 index 4143b82875f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTableOperationPredicate struct { - Age *int64 - IPAddress *string - Interface *string - MacAddress *string -} - -func (p ExpressRouteCircuitArpTableOperationPredicate) Matches(input ExpressRouteCircuitArpTable) bool { - - if p.Age != nil && (input.Age == nil || *p.Age != *input.Age) { - return false - } - - if p.IPAddress != nil && (input.IPAddress == nil || *p.IPAddress != *input.IPAddress) { - return false - } - - if p.Interface != nil && (input.Interface == nil || *p.Interface != *input.Interface) { - return false - } - - if p.MacAddress != nil && (input.MacAddress == nil || *p.MacAddress != *input.MacAddress) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitarptable/version.go b/resource-manager/network/2023-05-01/expressroutecircuitarptable/version.go deleted file mode 100644 index 890ca7a8ef2..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitarptable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitarptable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitarptable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md deleted file mode 100644 index c56db3c7824..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitauthorizations` Documentation - -The `expressroutecircuitauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitauthorizations" -``` - - -### Client Initialization - -```go -client := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -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: `ExpressRouteCircuitAuthorizationsClient.List` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -// 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/network/2023-05-01/expressroutecircuitauthorizations/client.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go deleted file mode 100644 index 8060a80be1e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitauthorizations - -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 ExpressRouteCircuitAuthorizationsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitAuthorizationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitauthorizations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitAuthorizationsClient: %+v", err) - } - - return &ExpressRouteCircuitAuthorizationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go deleted file mode 100644 index 052d235a64f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressroutecircuitauthorizations - -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 AuthorizationUseStatus string - -const ( - AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" -) - -func PossibleValuesForAuthorizationUseStatus() []string { - return []string{ - string(AuthorizationUseStatusAvailable), - string(AuthorizationUseStatusInUse), - } -} - -func (s *AuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthorizationUseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthorizationUseStatus(input string) (*AuthorizationUseStatus, error) { - vals := map[string]AuthorizationUseStatus{ - "available": AuthorizationUseStatusAvailable, - "inuse": AuthorizationUseStatusInUse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthorizationUseStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go deleted file mode 100644 index b659c5a5b8c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressroutecircuitauthorizations - -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(&AuthorizationId{}) -} - -var _ resourceids.ResourceId = &AuthorizationId{} - -// AuthorizationId is a struct representing the Resource ID for a Authorization -type AuthorizationId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - AuthorizationName string -} - -// NewAuthorizationID returns a new AuthorizationId struct -func NewAuthorizationID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, authorizationName string) AuthorizationId { - return AuthorizationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - AuthorizationName: authorizationName, - } -} - -// ParseAuthorizationID parses 'input' into a AuthorizationId -func ParseAuthorizationID(input string) (*AuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&AuthorizationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAuthorizationIDInsensitively parses 'input' case-insensitively into a AuthorizationId -// note: this method should only be used for API response data and not user input -func ParseAuthorizationIDInsensitively(input string) (*AuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&AuthorizationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AuthorizationId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.AuthorizationName, ok = input.Parsed["authorizationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "authorizationName", input) - } - - return nil -} - -// ValidateAuthorizationID checks that 'input' can be parsed as a Authorization ID -func ValidateAuthorizationID(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 := ParseAuthorizationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Authorization ID -func (id AuthorizationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/authorizations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.AuthorizationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Authorization ID -func (id AuthorizationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), - resourceids.UserSpecifiedSegment("authorizationName", "authorizationValue"), - } -} - -// String returns a human-readable description of this Authorization ID -func (id AuthorizationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Authorization Name: %q", id.AuthorizationName), - } - return fmt.Sprintf("Authorization (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization_test.go deleted file mode 100644 index 1f61685e6e4..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_authorization_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressroutecircuitauthorizations - -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 = &AuthorizationId{} - -func TestNewAuthorizationID(t *testing.T) { - id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.AuthorizationName != "authorizationValue" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationName'", id.AuthorizationName, "authorizationValue") - } -} - -func TestFormatAuthorizationID(t *testing.T) { - actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAuthorizationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue", - Expected: &AuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAuthorizationID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestParseAuthorizationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/aUtHoRiZaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue", - Expected: &AuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE", - Expected: &AuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - AuthorizationName: "aUtHoRiZaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAuthorizationIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestSegmentsForAuthorizationId(t *testing.T) { - segments := AuthorizationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AuthorizationId 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/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go deleted file mode 100644 index a46fa52bf5d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuitauthorizations - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go deleted file mode 100644 index d174a2ea14b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuitauthorizations - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go deleted file mode 100644 index 5fe3d709320..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecircuitauthorizations - -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 *ExpressRouteCircuitAuthorization -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, id AuthorizationId, input ExpressRouteCircuitAuthorization) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateThenPoll(ctx context.Context, id AuthorizationId, input ExpressRouteCircuitAuthorization) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go deleted file mode 100644 index b2c01bb7f11..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecircuitauthorizations - -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 ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, id AuthorizationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitAuthorizationsClient) DeleteThenPoll(ctx context.Context, id AuthorizationId) 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/network/2023-05-01/expressroutecircuitauthorizations/method_get.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go deleted file mode 100644 index 19e783a8675..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecircuitauthorizations - -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 *ExpressRouteCircuitAuthorization -} - -// Get ... -func (c ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, id AuthorizationId) (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 ExpressRouteCircuitAuthorization - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go deleted file mode 100644 index 41207f1453f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutecircuitauthorizations - -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 *[]ExpressRouteCircuitAuthorization -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitAuthorization -} - -// List ... -func (c ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, id ExpressRouteCircuitId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/authorizations", 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 *[]ExpressRouteCircuitAuthorization `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 ExpressRouteCircuitAuthorizationsClient) ListComplete(ctx context.Context, id ExpressRouteCircuitId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitAuthorizationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitAuthorizationsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCircuitId, predicate ExpressRouteCircuitAuthorizationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuitAuthorization, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go deleted file mode 100644 index e3d3f2bdb8d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuitauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthorizationPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go deleted file mode 100644 index b4b084362fc..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitAuthorization struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go deleted file mode 100644 index 3533e80a13e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitAuthorizationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitAuthorizationOperationPredicate) Matches(input ExpressRouteCircuitAuthorization) 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.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/network/2023-05-01/expressroutecircuitauthorizations/version.go b/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go deleted file mode 100644 index 9bda3850477..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitauthorizations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitauthorizations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitauthorizations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md b/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md deleted file mode 100644 index 5eda7b39569..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitconnections` Documentation - -The `expressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitconnections" -``` - - -### Client Initialization - -```go -client := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -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: `ExpressRouteCircuitConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -// 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/network/2023-05-01/expressroutecircuitconnections/client.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go deleted file mode 100644 index 333eff0e189..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitconnections - -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 ExpressRouteCircuitConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitConnectionsClient: %+v", err) - } - - return &ExpressRouteCircuitConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go deleted file mode 100644 index 8bfeb3344f9..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package expressroutecircuitconnections - -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 CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go deleted file mode 100644 index 0e2e6d6c894..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitconnections - -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(&PeeringConnectionId{}) -} - -var _ resourceids.ResourceId = &PeeringConnectionId{} - -// PeeringConnectionId is a struct representing the Resource ID for a Peering Connection -type PeeringConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - ConnectionName string -} - -// NewPeeringConnectionID returns a new PeeringConnectionId struct -func NewPeeringConnectionID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, connectionName string) PeeringConnectionId { - return PeeringConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - ConnectionName: connectionName, - } -} - -// ParsePeeringConnectionID parses 'input' into a PeeringConnectionId -func ParsePeeringConnectionID(input string) (*PeeringConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringConnectionIDInsensitively parses 'input' case-insensitively into a PeeringConnectionId -// note: this method should only be used for API response data and not user input -func ParsePeeringConnectionIDInsensitively(input string) (*PeeringConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringConnectionId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.ConnectionName, ok = input.Parsed["connectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionName", input) - } - - return nil -} - -// ValidatePeeringConnectionID checks that 'input' can be parsed as a Peering Connection ID -func ValidatePeeringConnectionID(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 := ParsePeeringConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Connection ID -func (id PeeringConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/connections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.ConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Connection ID -func (id PeeringConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), - } -} - -// String returns a human-readable description of this Peering Connection ID -func (id PeeringConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Connection Name: %q", id.ConnectionName), - } - return fmt.Sprintf("Peering Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection_test.go deleted file mode 100644 index 4a132672fdf..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/id_peeringconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitconnections - -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 = &PeeringConnectionId{} - -func TestNewPeeringConnectionID(t *testing.T) { - id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.ConnectionName != "connectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionValue") - } -} - -func TestFormatPeeringConnectionID(t *testing.T) { - actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue", - Expected: &PeeringConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringConnectionID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestParsePeeringConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/cOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue", - Expected: &PeeringConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/cOnNeCtIoNs/cOnNeCtIoNvAlUe", - Expected: &PeeringConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - ConnectionName: "cOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/cOnNeCtIoNs/cOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringConnectionIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestSegmentsForPeeringConnectionId(t *testing.T) { - segments := PeeringConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringConnectionId 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/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go deleted file mode 100644 index 25bb50bd1b3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecircuitconnections - -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 *ExpressRouteCircuitConnection -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Context, id PeeringConnectionId, input ExpressRouteCircuitConnection) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id PeeringConnectionId, input ExpressRouteCircuitConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutecircuitconnections/method_delete.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go deleted file mode 100644 index 1d813338ead..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecircuitconnections - -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 ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, id PeeringConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitConnectionsClient) DeleteThenPoll(ctx context.Context, id PeeringConnectionId) 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/network/2023-05-01/expressroutecircuitconnections/method_get.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go deleted file mode 100644 index 0a4a18dd7cc..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecircuitconnections - -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 *ExpressRouteCircuitConnection -} - -// Get ... -func (c ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, id PeeringConnectionId) (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 ExpressRouteCircuitConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go deleted file mode 100644 index a87f7d44ffe..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecircuitconnections - -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 *[]ExpressRouteCircuitConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitConnection -} - -// List ... -func (c ExpressRouteCircuitConnectionsClient) List(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connections", 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 *[]ExpressRouteCircuitConnection `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 ExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, predicate ExpressRouteCircuitConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuitConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go deleted file mode 100644 index 689bf9a8e12..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index a1bf981acf3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index 580b8a8dcd7..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go deleted file mode 100644 index d6673ed96dc..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go deleted file mode 100644 index 6c65b4df05d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitConnectionOperationPredicate) Matches(input ExpressRouteCircuitConnection) 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.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/network/2023-05-01/expressroutecircuitconnections/version.go b/resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go deleted file mode 100644 index caf7c8e29a5..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md deleted file mode 100644 index e2b352d2823..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitpeerings` Documentation - -The `expressroutecircuitpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitpeerings" -``` - - -### Client Initialization - -```go -client := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -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: `ExpressRouteCircuitPeeringsClient.List` - -```go -ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -// 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/network/2023-05-01/expressroutecircuitpeerings/client.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go deleted file mode 100644 index 63ac4daefad..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitpeerings - -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 ExpressRouteCircuitPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitPeeringsClient: %+v", err) - } - - return &ExpressRouteCircuitPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go deleted file mode 100644 index 98d21da2c70..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/constants.go +++ /dev/null @@ -1,274 +0,0 @@ -package expressroutecircuitpeerings - -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 CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go deleted file mode 100644 index 51f74b9a362..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuitpeerings - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go deleted file mode 100644 index 13448a74c27..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuitpeerings - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go deleted file mode 100644 index a9056870582..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitpeerings - -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 *ExpressRouteCircuitPeering -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, input ExpressRouteCircuitPeering) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, input ExpressRouteCircuitPeering) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutecircuitpeerings/method_delete.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go deleted file mode 100644 index 241c45fa414..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package expressroutecircuitpeerings - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitPeeringsClient) DeleteThenPoll(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) 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/network/2023-05-01/expressroutecircuitpeerings/method_get.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go deleted file mode 100644 index 0937d0e96a9..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package expressroutecircuitpeerings - -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 *ExpressRouteCircuitPeering -} - -// Get ... -func (c ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (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 ExpressRouteCircuitPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go deleted file mode 100644 index fc141f435cc..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutecircuitpeerings - -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 *[]ExpressRouteCircuitPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitPeering -} - -// List ... -func (c ExpressRouteCircuitPeeringsClient) List(ctx context.Context, id ExpressRouteCircuitId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerings", 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 *[]ExpressRouteCircuitPeering `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 ExpressRouteCircuitPeeringsClient) ListComplete(ctx context.Context, id ExpressRouteCircuitId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCircuitId, predicate ExpressRouteCircuitPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuitPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go deleted file mode 100644 index f0bf62174ce..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index f89ab3b51e4..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go deleted file mode 100644 index 5e47a7f0266..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 67b575213fe..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go deleted file mode 100644 index a54ef389df4..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringPropertiesFormat struct { - AzureASN *int64 `json:"azureASN,omitempty"` - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go deleted file mode 100644 index 8239e6299db..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go deleted file mode 100644 index f06a355d7fa..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index ae00db3c45c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 93ee020eec6..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index bc9218f9280..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 72eba9f327f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go deleted file mode 100644 index 3143d87b0ee..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go deleted file mode 100644 index 1e725c4e63a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitPeeringOperationPredicate) Matches(input ExpressRouteCircuitPeering) 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.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/network/2023-05-01/expressroutecircuitpeerings/version.go b/resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go deleted file mode 100644 index a23657064da..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/README.md deleted file mode 100644 index 2ebf23973fb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitroutestable` Documentation - -The `expressroutecircuitroutestable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitroutestable" -``` - - -### Client Initialization - -```go -client := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitRoutesTableClient.ExpressRouteCircuitsListRoutesTable` - -```go -ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue") - -// alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/client.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/client.go deleted file mode 100644 index 925b7f29bae..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitroutestable - -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 ExpressRouteCircuitRoutesTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitRoutesTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitRoutesTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitroutestable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitRoutesTableClient: %+v", err) - } - - return &ExpressRouteCircuitRoutesTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable.go deleted file mode 100644 index 895e343bf35..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitroutestable - -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(&PeeringRouteTableId{}) -} - -var _ resourceids.ResourceId = &PeeringRouteTableId{} - -// PeeringRouteTableId is a struct representing the Resource ID for a Peering Route Table -type PeeringRouteTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - RouteTableName string -} - -// NewPeeringRouteTableID returns a new PeeringRouteTableId struct -func NewPeeringRouteTableID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, routeTableName string) PeeringRouteTableId { - return PeeringRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - RouteTableName: routeTableName, - } -} - -// ParsePeeringRouteTableID parses 'input' into a PeeringRouteTableId -func ParsePeeringRouteTableID(input string) (*PeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringRouteTableIDInsensitively parses 'input' case-insensitively into a PeeringRouteTableId -// note: this method should only be used for API response data and not user input -func ParsePeeringRouteTableIDInsensitively(input string) (*PeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringRouteTableId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidatePeeringRouteTableID checks that 'input' can be parsed as a Peering Route Table ID -func ValidatePeeringRouteTableID(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 := ParsePeeringRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Route Table ID -func (id PeeringRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Route Table ID -func (id PeeringRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Peering Route Table ID -func (id PeeringRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Peering Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable_test.go deleted file mode 100644 index d631d27ad1b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/id_peeringroutetable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitroutestable - -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 = &PeeringRouteTableId{} - -func TestNewPeeringRouteTableID(t *testing.T) { - id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatPeeringRouteTableID(t *testing.T) { - actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &PeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTableID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParsePeeringRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &PeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &PeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTableIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForPeeringRouteTableId(t *testing.T) { - segments := PeeringRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringRouteTableId 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/network/2023-05-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go deleted file mode 100644 index 0d55eeb8353..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitroutestable - -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 ExpressRouteCircuitsListRoutesTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitRoutesTable -} - -type ExpressRouteCircuitsListRoutesTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitRoutesTable -} - -// ExpressRouteCircuitsListRoutesTable ... -func (c ExpressRouteCircuitRoutesTableClient) ExpressRouteCircuitsListRoutesTable(ctx context.Context, id PeeringRouteTableId) (result ExpressRouteCircuitsListRoutesTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCircuitsListRoutesTableThenPoll performs ExpressRouteCircuitsListRoutesTable then polls until it's completed -func (c ExpressRouteCircuitRoutesTableClient) ExpressRouteCircuitsListRoutesTableThenPoll(ctx context.Context, id PeeringRouteTableId) error { - result, err := c.ExpressRouteCircuitsListRoutesTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCircuitsListRoutesTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCircuitsListRoutesTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go deleted file mode 100644 index d70d9310d29..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTable struct { - LocPrf *string `json:"locPrf,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Path *string `json:"path,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/predicates.go deleted file mode 100644 index 81d29805310..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecircuitroutestable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableOperationPredicate struct { - LocPrf *string - Network *string - NextHop *string - Path *string - Weight *int64 -} - -func (p ExpressRouteCircuitRoutesTableOperationPredicate) Matches(input ExpressRouteCircuitRoutesTable) bool { - - if p.LocPrf != nil && (input.LocPrf == nil || *p.LocPrf != *input.LocPrf) { - return false - } - - if p.Network != nil && (input.Network == nil || *p.Network != *input.Network) { - return false - } - - if p.NextHop != nil && (input.NextHop == nil || *p.NextHop != *input.NextHop) { - return false - } - - if p.Path != nil && (input.Path == nil || *p.Path != *input.Path) { - return false - } - - if p.Weight != nil && (input.Weight == nil || *p.Weight != *input.Weight) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/version.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestable/version.go deleted file mode 100644 index 3d43d356f99..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/README.md deleted file mode 100644 index de21f04545e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary` Documentation - -The `expressroutecircuitroutestablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitroutestablesummary" -``` - - -### Client Initialization - -```go -client := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitRoutesTableSummaryClient.ExpressRouteCircuitsListRoutesTableSummary` - -```go -ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue") - -// alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/client.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/client.go deleted file mode 100644 index 5565926cb76..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitroutestablesummary - -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 ExpressRouteCircuitRoutesTableSummaryClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitRoutesTableSummaryClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitroutestablesummary", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitRoutesTableSummaryClient: %+v", err) - } - - return &ExpressRouteCircuitRoutesTableSummaryClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary.go deleted file mode 100644 index 16c5b0c301a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitroutestablesummary - -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(&RouteTablesSummaryId{}) -} - -var _ resourceids.ResourceId = &RouteTablesSummaryId{} - -// RouteTablesSummaryId is a struct representing the Resource ID for a Route Tables Summary -type RouteTablesSummaryId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - RouteTablesSummaryName string -} - -// NewRouteTablesSummaryID returns a new RouteTablesSummaryId struct -func NewRouteTablesSummaryID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, routeTablesSummaryName string) RouteTablesSummaryId { - return RouteTablesSummaryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - RouteTablesSummaryName: routeTablesSummaryName, - } -} - -// ParseRouteTablesSummaryID parses 'input' into a RouteTablesSummaryId -func ParseRouteTablesSummaryID(input string) (*RouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTablesSummaryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteTablesSummaryIDInsensitively parses 'input' case-insensitively into a RouteTablesSummaryId -// note: this method should only be used for API response data and not user input -func ParseRouteTablesSummaryIDInsensitively(input string) (*RouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTablesSummaryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteTablesSummaryId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTablesSummaryName, ok = input.Parsed["routeTablesSummaryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTablesSummaryName", input) - } - - return nil -} - -// ValidateRouteTablesSummaryID checks that 'input' can be parsed as a Route Tables Summary ID -func ValidateRouteTablesSummaryID(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 := ParseRouteTablesSummaryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Tables Summary ID -func (id RouteTablesSummaryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/routeTablesSummary/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.RouteTablesSummaryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Tables Summary ID -func (id RouteTablesSummaryId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryValue"), - } -} - -// String returns a human-readable description of this Route Tables Summary ID -func (id RouteTablesSummaryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Tables Summary Name: %q", id.RouteTablesSummaryName), - } - return fmt.Sprintf("Route Tables Summary (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go deleted file mode 100644 index a011758594c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitroutestablesummary - -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 = &RouteTablesSummaryId{} - -func TestNewRouteTablesSummaryID(t *testing.T) { - id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTablesSummaryName != "routeTablesSummaryValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryValue") - } -} - -func TestFormatRouteTablesSummaryID(t *testing.T) { - actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteTablesSummaryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &RouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTablesSummaryID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestParseRouteTablesSummaryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &RouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe", - Expected: &RouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTablesSummaryIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestSegmentsForRouteTablesSummaryId(t *testing.T) { - segments := RouteTablesSummaryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteTablesSummaryId 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/network/2023-05-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go deleted file mode 100644 index 200e1b6b1e8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitroutestablesummary - -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 ExpressRouteCircuitsListRoutesTableSummaryOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitRoutesTableSummary -} - -type ExpressRouteCircuitsListRoutesTableSummaryCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitRoutesTableSummary -} - -// ExpressRouteCircuitsListRoutesTableSummary ... -func (c ExpressRouteCircuitRoutesTableSummaryClient) ExpressRouteCircuitsListRoutesTableSummary(ctx context.Context, id RouteTablesSummaryId) (result ExpressRouteCircuitsListRoutesTableSummaryOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCircuitsListRoutesTableSummaryThenPoll performs ExpressRouteCircuitsListRoutesTableSummary then polls until it's completed -func (c ExpressRouteCircuitRoutesTableSummaryClient) ExpressRouteCircuitsListRoutesTableSummaryThenPoll(ctx context.Context, id RouteTablesSummaryId) error { - result, err := c.ExpressRouteCircuitsListRoutesTableSummary(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCircuitsListRoutesTableSummary: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCircuitsListRoutesTableSummary: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go deleted file mode 100644 index 926fc450623..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableSummary struct { - As *int64 `json:"as,omitempty"` - Neighbor *string `json:"neighbor,omitempty"` - StatePfxRcd *string `json:"statePfxRcd,omitempty"` - UpDown *string `json:"upDown,omitempty"` - V *int64 `json:"v,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/predicates.go deleted file mode 100644 index 1d9991e4b00..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecircuitroutestablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableSummaryOperationPredicate struct { - As *int64 - Neighbor *string - StatePfxRcd *string - UpDown *string - V *int64 -} - -func (p ExpressRouteCircuitRoutesTableSummaryOperationPredicate) Matches(input ExpressRouteCircuitRoutesTableSummary) bool { - - if p.As != nil && (input.As == nil || *p.As != *input.As) { - return false - } - - if p.Neighbor != nil && (input.Neighbor == nil || *p.Neighbor != *input.Neighbor) { - return false - } - - if p.StatePfxRcd != nil && (input.StatePfxRcd == nil || *p.StatePfxRcd != *input.StatePfxRcd) { - return false - } - - if p.UpDown != nil && (input.UpDown == nil || *p.UpDown != *input.UpDown) { - return false - } - - if p.V != nil && (input.V == nil || *p.V != *input.V) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/version.go b/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/version.go deleted file mode 100644 index f58ed6a971e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitroutestablesummary/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestablesummary - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestablesummary/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/README.md b/resource-manager/network/2023-05-01/expressroutecircuits/README.md deleted file mode 100644 index bcb3bc9576b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuits` Documentation - -The `expressroutecircuits` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuits" -``` - - -### Client Initialization - -```go -client := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -payload := expressroutecircuits.ExpressRouteCircuit{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -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: `ExpressRouteCircuitsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ExpressRouteCircuitsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -payload := expressroutecircuits.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/network/2023-05-01/expressroutecircuits/client.go b/resource-manager/network/2023-05-01/expressroutecircuits/client.go deleted file mode 100644 index cd12ab163e6..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuits - -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 ExpressRouteCircuitsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuits", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitsClient: %+v", err) - } - - return &ExpressRouteCircuitsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/constants.go b/resource-manager/network/2023-05-01/expressroutecircuits/constants.go deleted file mode 100644 index 017902fa091..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/constants.go +++ /dev/null @@ -1,450 +0,0 @@ -package expressroutecircuits - -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 AuthorizationUseStatus string - -const ( - AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" -) - -func PossibleValuesForAuthorizationUseStatus() []string { - return []string{ - string(AuthorizationUseStatusAvailable), - string(AuthorizationUseStatusInUse), - } -} - -func (s *AuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthorizationUseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthorizationUseStatus(input string) (*AuthorizationUseStatus, error) { - vals := map[string]AuthorizationUseStatus{ - "available": AuthorizationUseStatusAvailable, - "inuse": AuthorizationUseStatusInUse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthorizationUseStatus(input) - return &out, nil -} - -type CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRouteCircuitSkuFamily string - -const ( - ExpressRouteCircuitSkuFamilyMeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - ExpressRouteCircuitSkuFamilyUnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" -) - -func PossibleValuesForExpressRouteCircuitSkuFamily() []string { - return []string{ - string(ExpressRouteCircuitSkuFamilyMeteredData), - string(ExpressRouteCircuitSkuFamilyUnlimitedData), - } -} - -func (s *ExpressRouteCircuitSkuFamily) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitSkuFamily(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitSkuFamily(input string) (*ExpressRouteCircuitSkuFamily, error) { - vals := map[string]ExpressRouteCircuitSkuFamily{ - "metereddata": ExpressRouteCircuitSkuFamilyMeteredData, - "unlimiteddata": ExpressRouteCircuitSkuFamilyUnlimitedData, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitSkuFamily(input) - return &out, nil -} - -type ExpressRouteCircuitSkuTier string - -const ( - ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" - ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" -) - -func PossibleValuesForExpressRouteCircuitSkuTier() []string { - return []string{ - string(ExpressRouteCircuitSkuTierBasic), - string(ExpressRouteCircuitSkuTierLocal), - string(ExpressRouteCircuitSkuTierPremium), - string(ExpressRouteCircuitSkuTierStandard), - } -} - -func (s *ExpressRouteCircuitSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitSkuTier(input string) (*ExpressRouteCircuitSkuTier, error) { - vals := map[string]ExpressRouteCircuitSkuTier{ - "basic": ExpressRouteCircuitSkuTierBasic, - "local": ExpressRouteCircuitSkuTierLocal, - "premium": ExpressRouteCircuitSkuTierPremium, - "standard": ExpressRouteCircuitSkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitSkuTier(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ServiceProviderProvisioningState string - -const ( - ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" - ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" -) - -func PossibleValuesForServiceProviderProvisioningState() []string { - return []string{ - string(ServiceProviderProvisioningStateDeprovisioning), - string(ServiceProviderProvisioningStateNotProvisioned), - string(ServiceProviderProvisioningStateProvisioned), - string(ServiceProviderProvisioningStateProvisioning), - } -} - -func (s *ServiceProviderProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServiceProviderProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServiceProviderProvisioningState(input string) (*ServiceProviderProvisioningState, error) { - vals := map[string]ServiceProviderProvisioningState{ - "deprovisioning": ServiceProviderProvisioningStateDeprovisioning, - "notprovisioned": ServiceProviderProvisioningStateNotProvisioned, - "provisioned": ServiceProviderProvisioningStateProvisioned, - "provisioning": ServiceProviderProvisioningStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceProviderProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go deleted file mode 100644 index d48e8e429e7..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuits - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit_test.go deleted file mode 100644 index f5006a32349..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuits - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-05-01/expressroutecircuits/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go deleted file mode 100644 index 399156eb14e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecircuits - -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 *ExpressRouteCircuit -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteCircuitId, input ExpressRouteCircuit) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteCircuitId, input ExpressRouteCircuit) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutecircuits/method_delete.go b/resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go deleted file mode 100644 index 91f8aa53bed..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecircuits - -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 ExpressRouteCircuitsClient) Delete(ctx context.Context, id ExpressRouteCircuitId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitsClient) DeleteThenPoll(ctx context.Context, id ExpressRouteCircuitId) 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/network/2023-05-01/expressroutecircuits/method_get.go b/resource-manager/network/2023-05-01/expressroutecircuits/method_get.go deleted file mode 100644 index 2047441e60b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecircuits - -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 *ExpressRouteCircuit -} - -// Get ... -func (c ExpressRouteCircuitsClient) Get(ctx context.Context, id ExpressRouteCircuitId) (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 ExpressRouteCircuit - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go b/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go deleted file mode 100644 index b21064c5d1a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecircuits - -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 *[]ExpressRouteCircuit -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuit -} - -// List ... -func (c ExpressRouteCircuitsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCircuits", 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 *[]ExpressRouteCircuit `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 ExpressRouteCircuitsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRouteCircuitOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuit, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecircuits/method_listall.go b/resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go deleted file mode 100644 index be1cf07c562..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecircuits - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuit -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuit -} - -// ListAll ... -func (c ExpressRouteCircuitsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCircuits", 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 *[]ExpressRouteCircuit `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ExpressRouteCircuitsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteCircuitOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]ExpressRouteCircuit, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go b/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go deleted file mode 100644 index 8426eb683b2..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package expressroutecircuits - -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 *ExpressRouteCircuit -} - -// UpdateTags ... -func (c ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, id ExpressRouteCircuitId, 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 ExpressRouteCircuit - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go deleted file mode 100644 index a539b0f44a2..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_authorizationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthorizationPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go deleted file mode 100644 index a74493fcec8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuit.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuit struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go deleted file mode 100644 index 2942811a91c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitauthorization.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitAuthorization struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go deleted file mode 100644 index 901ef503724..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 897f772964a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go deleted file mode 100644 index d7431190482..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 836b1d5e963..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go deleted file mode 100644 index 87a88e75638..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringPropertiesFormat struct { - AzureASN *int64 `json:"azureASN,omitempty"` - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go deleted file mode 100644 index 89faee5aa48..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPropertiesFormat struct { - AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationStatus *string `json:"authorizationStatus,omitempty"` - Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` - BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` - CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` - ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceKey *string `json:"serviceKey,omitempty"` - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - Stag *int64 `json:"stag,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go deleted file mode 100644 index 432cdaf5a4a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitServiceProviderProperties struct { - BandwidthInMbps *int64 `json:"bandwidthInMbps,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - ServiceProviderName *string `json:"serviceProviderName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go deleted file mode 100644 index 186629b51a6..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitsku.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitSku struct { - Family *ExpressRouteCircuitSkuFamily `json:"family,omitempty"` - Name *string `json:"name,omitempty"` - Tier *ExpressRouteCircuitSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go deleted file mode 100644 index ca8cd2c52bc..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go deleted file mode 100644 index 70b79aa3ec7..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_expressrouteconnectionid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index 49a42177273..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 02e4a94b316..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index e52a6b6f8c3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 804baee319a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go deleted file mode 100644 index daf852a98a9..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go b/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go deleted file mode 100644 index 585eaaba376..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuits - -// 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/network/2023-05-01/expressroutecircuits/predicates.go b/resource-manager/network/2023-05-01/expressroutecircuits/predicates.go deleted file mode 100644 index 3fdbc040dbf..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitOperationPredicate) Matches(input ExpressRouteCircuit) 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 && (input.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/network/2023-05-01/expressroutecircuits/version.go b/resource-manager/network/2023-05-01/expressroutecircuits/version.go deleted file mode 100644 index 52739551056..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuits/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuits/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitstats/README.md b/resource-manager/network/2023-05-01/expressroutecircuitstats/README.md deleted file mode 100644 index b1a23bcb0b3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecircuitstats` Documentation - -The `expressroutecircuitstats` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecircuitstats" -``` - - -### Client Initialization - -```go -client := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetPeeringStats` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetStats` - -```go -ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -read, err := client.ExpressRouteCircuitsGetStats(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/network/2023-05-01/expressroutecircuitstats/client.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/client.go deleted file mode 100644 index 43a397e1cc1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitstats - -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 ExpressRouteCircuitStatsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitStatsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitStatsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitstats", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitStatsClient: %+v", err) - } - - return &ExpressRouteCircuitStatsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit.go deleted file mode 100644 index cf235dfe96f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuitstats - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit_test.go deleted file mode 100644 index 735aeca4792..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuitstats - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go deleted file mode 100644 index 5473e8458e6..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go +++ /dev/null @@ -1,56 +0,0 @@ -package expressroutecircuitstats - -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 ExpressRouteCircuitsGetPeeringStatsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteCircuitStats -} - -// ExpressRouteCircuitsGetPeeringStats ... -func (c ExpressRouteCircuitStatsClient) ExpressRouteCircuitsGetPeeringStats(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ExpressRouteCircuitsGetPeeringStatsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/stats", 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 ExpressRouteCircuitStats - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go deleted file mode 100644 index 4bd3c09b58e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go +++ /dev/null @@ -1,55 +0,0 @@ -package expressroutecircuitstats - -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 ExpressRouteCircuitsGetStatsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteCircuitStats -} - -// ExpressRouteCircuitsGetStats ... -func (c ExpressRouteCircuitStatsClient) ExpressRouteCircuitsGetStats(ctx context.Context, id ExpressRouteCircuitId) (result ExpressRouteCircuitsGetStatsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/stats", 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 ExpressRouteCircuitStats - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitstats/model_expressroutecircuitstats.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/model_expressroutecircuitstats.go deleted file mode 100644 index f93c0daeba8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuitstats - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecircuitstats/version.go b/resource-manager/network/2023-05-01/expressroutecircuitstats/version.go deleted file mode 100644 index c87b902eba3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecircuitstats/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitstats - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitstats/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/README.md b/resource-manager/network/2023-05-01/expressrouteconnections/README.md deleted file mode 100644 index 4bea20338a6..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteconnections` Documentation - -The `expressrouteconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressrouteconnections" -``` - - -### Client Initialization - -```go -client := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -payload := expressrouteconnections.ExpressRouteConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -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: `ExpressRouteConnectionsClient.List` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -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/network/2023-05-01/expressrouteconnections/client.go b/resource-manager/network/2023-05-01/expressrouteconnections/client.go deleted file mode 100644 index 59b056f90da..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteconnections - -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 ExpressRouteConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteConnectionsClient: %+v", err) - } - - return &ExpressRouteConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/constants.go b/resource-manager/network/2023-05-01/expressrouteconnections/constants.go deleted file mode 100644 index 571bcb03c1e..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressrouteconnections - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection.go deleted file mode 100644 index 7bba12f409b..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressrouteconnections - -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(&ExpressRouteConnectionId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteConnectionId{} - -// ExpressRouteConnectionId is a struct representing the Resource ID for a Express Route Connection -type ExpressRouteConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteGatewayName string - ExpressRouteConnectionName string -} - -// NewExpressRouteConnectionID returns a new ExpressRouteConnectionId struct -func NewExpressRouteConnectionID(subscriptionId string, resourceGroupName string, expressRouteGatewayName string, expressRouteConnectionName string) ExpressRouteConnectionId { - return ExpressRouteConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteGatewayName: expressRouteGatewayName, - ExpressRouteConnectionName: expressRouteConnectionName, - } -} - -// ParseExpressRouteConnectionID parses 'input' into a ExpressRouteConnectionId -func ParseExpressRouteConnectionID(input string) (*ExpressRouteConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteConnectionIDInsensitively parses 'input' case-insensitively into a ExpressRouteConnectionId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteConnectionIDInsensitively(input string) (*ExpressRouteConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteConnectionId) 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.ExpressRouteGatewayName, ok = input.Parsed["expressRouteGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteGatewayName", input) - } - - if id.ExpressRouteConnectionName, ok = input.Parsed["expressRouteConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteConnectionName", input) - } - - return nil -} - -// ValidateExpressRouteConnectionID checks that 'input' can be parsed as a Express Route Connection ID -func ValidateExpressRouteConnectionID(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 := ParseExpressRouteConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Connection ID -func (id ExpressRouteConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteGateways/%s/expressRouteConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteGatewayName, id.ExpressRouteConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Connection ID -func (id ExpressRouteConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), - resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayValue"), - resourceids.StaticSegment("staticExpressRouteConnections", "expressRouteConnections", "expressRouteConnections"), - resourceids.UserSpecifiedSegment("expressRouteConnectionName", "expressRouteConnectionValue"), - } -} - -// String returns a human-readable description of this Express Route Connection ID -func (id ExpressRouteConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Gateway Name: %q", id.ExpressRouteGatewayName), - fmt.Sprintf("Express Route Connection Name: %q", id.ExpressRouteConnectionName), - } - return fmt.Sprintf("Express Route Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection_test.go deleted file mode 100644 index 1cf5c6183dc..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressrouteconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressrouteconnections - -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 = &ExpressRouteConnectionId{} - -func TestNewExpressRouteConnectionID(t *testing.T) { - id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - - 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.ExpressRouteGatewayName != "expressRouteGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayValue") - } - - if id.ExpressRouteConnectionName != "expressRouteConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "expressRouteConnectionValue") - } -} - -func TestFormatExpressRouteConnectionID(t *testing.T) { - actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue", - Expected: &ExpressRouteConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - ExpressRouteConnectionName: "expressRouteConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteConnectionID(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - if actual.ExpressRouteConnectionName != v.Expected.ExpressRouteConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteConnectionName", v.Expected.ExpressRouteConnectionName, actual.ExpressRouteConnectionName) - } - - } -} - -func TestParseExpressRouteConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/eXpReSsRoUtEcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue", - Expected: &ExpressRouteConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - ExpressRouteConnectionName: "expressRouteConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNvAlUe", - Expected: &ExpressRouteConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyVaLuE", - ExpressRouteConnectionName: "eXpReSsRoUtEcOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteConnectionIDInsensitively(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - if actual.ExpressRouteConnectionName != v.Expected.ExpressRouteConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteConnectionName", v.Expected.ExpressRouteConnectionName, actual.ExpressRouteConnectionName) - } - - } -} - -func TestSegmentsForExpressRouteConnectionId(t *testing.T) { - segments := ExpressRouteConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteConnectionId 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/network/2023-05-01/expressrouteconnections/id_expressroutegateway.go b/resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway.go deleted file mode 100644 index 6df37b9a7d8..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressrouteconnections - -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(&ExpressRouteGatewayId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteGatewayId{} - -// ExpressRouteGatewayId is a struct representing the Resource ID for a Express Route Gateway -type ExpressRouteGatewayId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteGatewayName string -} - -// NewExpressRouteGatewayID returns a new ExpressRouteGatewayId struct -func NewExpressRouteGatewayID(subscriptionId string, resourceGroupName string, expressRouteGatewayName string) ExpressRouteGatewayId { - return ExpressRouteGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteGatewayName: expressRouteGatewayName, - } -} - -// ParseExpressRouteGatewayID parses 'input' into a ExpressRouteGatewayId -func ParseExpressRouteGatewayID(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteGatewayIDInsensitively parses 'input' case-insensitively into a ExpressRouteGatewayId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteGatewayIDInsensitively(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteGatewayId) 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.ExpressRouteGatewayName, ok = input.Parsed["expressRouteGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteGatewayName", input) - } - - return nil -} - -// ValidateExpressRouteGatewayID checks that 'input' can be parsed as a Express Route Gateway ID -func ValidateExpressRouteGatewayID(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 := ParseExpressRouteGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Gateway ID -func (id ExpressRouteGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Gateway ID -func (id ExpressRouteGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), - resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayValue"), - } -} - -// String returns a human-readable description of this Express Route Gateway ID -func (id ExpressRouteGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Gateway Name: %q", id.ExpressRouteGatewayName), - } - return fmt.Sprintf("Express Route Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway_test.go b/resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway_test.go deleted file mode 100644 index 2ba620612ce..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/id_expressroutegateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressrouteconnections - -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 = &ExpressRouteGatewayId{} - -func TestNewExpressRouteGatewayID(t *testing.T) { - id := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - - 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.ExpressRouteGatewayName != "expressRouteGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayValue") - } -} - -func TestFormatExpressRouteGatewayID(t *testing.T) { - actual := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayID(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestParseExpressRouteGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayIDInsensitively(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestSegmentsForExpressRouteGatewayId(t *testing.T) { - segments := ExpressRouteGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteGatewayId 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/network/2023-05-01/expressrouteconnections/method_createorupdate.go b/resource-manager/network/2023-05-01/expressrouteconnections/method_createorupdate.go deleted file mode 100644 index 37e7c0ceddb..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressrouteconnections - -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 *ExpressRouteConnection -} - -// CreateOrUpdate ... -func (c ExpressRouteConnectionsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteConnectionId, input ExpressRouteConnection) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteConnectionId, input ExpressRouteConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressrouteconnections/method_delete.go b/resource-manager/network/2023-05-01/expressrouteconnections/method_delete.go deleted file mode 100644 index 8f3816bde32..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressrouteconnections - -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 ExpressRouteConnectionsClient) Delete(ctx context.Context, id ExpressRouteConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteConnectionsClient) DeleteThenPoll(ctx context.Context, id ExpressRouteConnectionId) 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/network/2023-05-01/expressrouteconnections/method_get.go b/resource-manager/network/2023-05-01/expressrouteconnections/method_get.go deleted file mode 100644 index ae0992fa45d..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteconnections - -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 *ExpressRouteConnection -} - -// Get ... -func (c ExpressRouteConnectionsClient) Get(ctx context.Context, id ExpressRouteConnectionId) (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 ExpressRouteConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/method_list.go b/resource-manager/network/2023-05-01/expressrouteconnections/method_list.go deleted file mode 100644 index e9090e1dd56..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package expressrouteconnections - -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 *ExpressRouteConnectionList -} - -// List ... -func (c ExpressRouteConnectionsClient) List(ctx context.Context, id ExpressRouteGatewayId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/expressRouteConnections", 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 ExpressRouteConnectionList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressroutecircuitpeeringid.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_expressroutecircuitpeeringid.go deleted file mode 100644 index 3a30ff411e8..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressroutecircuitpeeringid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnection.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnection.go deleted file mode 100644 index 1e31fa6c860..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnection.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnection struct { - Id *string `json:"id,omitempty"` - Name string `json:"name"` - Properties *ExpressRouteConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionlist.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionlist.go deleted file mode 100644 index a16565b3cd5..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionlist.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionList struct { - Value *[]ExpressRouteConnection `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionproperties.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionproperties.go deleted file mode 100644 index 2e9dddfbc1a..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_expressrouteconnectionproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionProperties struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteCircuitPeering ExpressRouteCircuitPeeringId `json:"expressRouteCircuitPeering"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_propagatedroutetable.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_propagatedroutetable.go deleted file mode 100644 index 7279e13359c..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_routingconfiguration.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_routingconfiguration.go deleted file mode 100644 index 4e1904d9c6e..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_staticroute.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_staticroute.go deleted file mode 100644 index c1e414bbe16..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_staticroutesconfig.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_staticroutesconfig.go deleted file mode 100644 index 9ee286419ac..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_subresource.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_subresource.go deleted file mode 100644 index 5a5f53696f8..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/model_vnetroute.go b/resource-manager/network/2023-05-01/expressrouteconnections/model_vnetroute.go deleted file mode 100644 index 9e296eed5de..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteconnections/version.go b/resource-manager/network/2023-05-01/expressrouteconnections/version.go deleted file mode 100644 index e97e2798697..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/README.md deleted file mode 100644 index c0e046a0deb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable` Documentation - -The `expressroutecrossconnectionarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecrossconnectionarptable" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionArpTableClient.ExpressRouteCrossConnectionsListArpTable` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue") - -// alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/client.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/client.go deleted file mode 100644 index 07328f2f394..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionarptable - -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 ExpressRouteCrossConnectionArpTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionArpTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionArpTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionarptable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionArpTableClient: %+v", err) - } - - return &ExpressRouteCrossConnectionArpTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable.go deleted file mode 100644 index a90eea8a4cb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecrossconnectionarptable - -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(&PeeringArpTableId{}) -} - -var _ resourceids.ResourceId = &PeeringArpTableId{} - -// PeeringArpTableId is a struct representing the Resource ID for a Peering Arp Table -type PeeringArpTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string - ArpTableName string -} - -// NewPeeringArpTableID returns a new PeeringArpTableId struct -func NewPeeringArpTableID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string, arpTableName string) PeeringArpTableId { - return PeeringArpTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - ArpTableName: arpTableName, - } -} - -// ParsePeeringArpTableID parses 'input' into a PeeringArpTableId -func ParsePeeringArpTableID(input string) (*PeeringArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringArpTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringArpTableIDInsensitively parses 'input' case-insensitively into a PeeringArpTableId -// note: this method should only be used for API response data and not user input -func ParsePeeringArpTableIDInsensitively(input string) (*PeeringArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringArpTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringArpTableId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.ArpTableName, ok = input.Parsed["arpTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arpTableName", input) - } - - return nil -} - -// ValidatePeeringArpTableID checks that 'input' can be parsed as a Peering Arp Table ID -func ValidatePeeringArpTableID(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 := ParsePeeringArpTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Arp Table ID -func (id PeeringArpTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s/arpTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName, id.ArpTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Arp Table ID -func (id PeeringArpTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "arpTableValue"), - } -} - -// String returns a human-readable description of this Peering Arp Table ID -func (id PeeringArpTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Arp Table Name: %q", id.ArpTableName), - } - return fmt.Sprintf("Peering Arp Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go deleted file mode 100644 index 31143355e4b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecrossconnectionarptable - -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 = &PeeringArpTableId{} - -func TestNewPeeringArpTableID(t *testing.T) { - id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.ArpTableName != "arpTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableValue") - } -} - -func TestFormatPeeringArpTableID(t *testing.T) { - actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringArpTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &PeeringArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringArpTableID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestParsePeeringArpTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &PeeringArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe", - Expected: &PeeringArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - ArpTableName: "aRpTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringArpTableIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestSegmentsForPeeringArpTableId(t *testing.T) { - segments := PeeringArpTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringArpTableId 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/network/2023-05-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go deleted file mode 100644 index 93cb5d74c61..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecrossconnectionarptable - -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 ExpressRouteCrossConnectionsListArpTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitArpTable -} - -type ExpressRouteCrossConnectionsListArpTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitArpTable -} - -// ExpressRouteCrossConnectionsListArpTable ... -func (c ExpressRouteCrossConnectionArpTableClient) ExpressRouteCrossConnectionsListArpTable(ctx context.Context, id PeeringArpTableId) (result ExpressRouteCrossConnectionsListArpTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCrossConnectionsListArpTableThenPoll performs ExpressRouteCrossConnectionsListArpTable then polls until it's completed -func (c ExpressRouteCrossConnectionArpTableClient) ExpressRouteCrossConnectionsListArpTableThenPoll(ctx context.Context, id PeeringArpTableId) error { - result, err := c.ExpressRouteCrossConnectionsListArpTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCrossConnectionsListArpTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCrossConnectionsListArpTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go deleted file mode 100644 index eb25fb1e02d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnectionarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTable struct { - Age *int64 `json:"age,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - Interface *string `json:"interface,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/predicates.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/predicates.go deleted file mode 100644 index 75df45b22f9..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecrossconnectionarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTableOperationPredicate struct { - Age *int64 - IPAddress *string - Interface *string - MacAddress *string -} - -func (p ExpressRouteCircuitArpTableOperationPredicate) Matches(input ExpressRouteCircuitArpTable) bool { - - if p.Age != nil && (input.Age == nil || *p.Age != *input.Age) { - return false - } - - if p.IPAddress != nil && (input.IPAddress == nil || *p.IPAddress != *input.IPAddress) { - return false - } - - if p.Interface != nil && (input.Interface == nil || *p.Interface != *input.Interface) { - return false - } - - if p.MacAddress != nil && (input.MacAddress == nil || *p.MacAddress != *input.MacAddress) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/version.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/version.go deleted file mode 100644 index 6754b2423e1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionarptable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionarptable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionarptable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/README.md deleted file mode 100644 index 9400542b0fb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings` Documentation - -The `expressroutecrossconnectionpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecrossconnectionpeerings" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -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: `ExpressRouteCrossConnectionPeeringsClient.List` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -// 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/network/2023-05-01/expressroutecrossconnectionpeerings/client.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/client.go deleted file mode 100644 index 90cbc899dcb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 ExpressRouteCrossConnectionPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionPeeringsClient: %+v", err) - } - - return &ExpressRouteCrossConnectionPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/constants.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/constants.go deleted file mode 100644 index 96dec453442..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/constants.go +++ /dev/null @@ -1,230 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go deleted file mode 100644 index 626b69cff73..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecrossconnectionpeerings - -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(&ExpressRouteCrossConnectionId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} - -// ExpressRouteCrossConnectionId is a struct representing the Resource ID for a Express Route Cross Connection -type ExpressRouteCrossConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string -} - -// NewExpressRouteCrossConnectionID returns a new ExpressRouteCrossConnectionId struct -func NewExpressRouteCrossConnectionID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string) ExpressRouteCrossConnectionId { - return ExpressRouteCrossConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - } -} - -// ParseExpressRouteCrossConnectionID parses 'input' into a ExpressRouteCrossConnectionId -func ParseExpressRouteCrossConnectionID(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCrossConnectionIDInsensitively parses 'input' case-insensitively into a ExpressRouteCrossConnectionId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCrossConnectionIDInsensitively(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCrossConnectionId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - return nil -} - -// ValidateExpressRouteCrossConnectionID checks that 'input' can be parsed as a Express Route Cross Connection ID -func ValidateExpressRouteCrossConnectionID(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 := ParseExpressRouteCrossConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - } -} - -// String returns a human-readable description of this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - } - return fmt.Sprintf("Express Route Cross Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go deleted file mode 100644 index 5314f35860d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 = &ExpressRouteCrossConnectionId{} - -func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } -} - -func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCrossConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestSegmentsForExpressRouteCrossConnectionId(t *testing.T) { - segments := ExpressRouteCrossConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCrossConnectionId 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/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering.go deleted file mode 100644 index f9e45b10c99..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressroutecrossconnectionpeerings - -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(&PeeringId{}) -} - -var _ resourceids.ResourceId = &PeeringId{} - -// PeeringId is a struct representing the Resource ID for a Peering -type PeeringId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string -} - -// NewPeeringID returns a new PeeringId struct -func NewPeeringID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string) PeeringId { - return PeeringId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - } -} - -// ParsePeeringID parses 'input' into a PeeringId -func ParsePeeringID(input string) (*PeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringIDInsensitively parses 'input' case-insensitively into a PeeringId -// note: this method should only be used for API response data and not user input -func ParsePeeringIDInsensitively(input string) (*PeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - return nil -} - -// ValidatePeeringID checks that 'input' can be parsed as a Peering ID -func ValidatePeeringID(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 := ParsePeeringID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering ID -func (id PeeringId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering ID -func (id PeeringId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - } -} - -// String returns a human-readable description of this Peering ID -func (id PeeringId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - } - return fmt.Sprintf("Peering (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering_test.go deleted file mode 100644 index 77d161773d2..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/id_peering_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 = &PeeringId{} - -func TestNewPeeringID(t *testing.T) { - id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } -} - -func TestFormatPeeringID(t *testing.T) { - actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Expected: &PeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - } -} - -func TestParsePeeringIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Expected: &PeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Expected: &PeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - } -} - -func TestSegmentsForPeeringId(t *testing.T) { - segments := PeeringId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringId 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/network/2023-05-01/expressroutecrossconnectionpeerings/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_createorupdate.go deleted file mode 100644 index 4cfa59c5d29..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 *ExpressRouteCrossConnectionPeering -} - -// CreateOrUpdate ... -func (c ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx context.Context, id PeeringId, input ExpressRouteCrossConnectionPeering) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id PeeringId, input ExpressRouteCrossConnectionPeering) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutecrossconnectionpeerings/method_delete.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_delete.go deleted file mode 100644 index f2073ab1bd3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 ExpressRouteCrossConnectionPeeringsClient) Delete(ctx context.Context, id PeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCrossConnectionPeeringsClient) DeleteThenPoll(ctx context.Context, id PeeringId) 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/network/2023-05-01/expressroutecrossconnectionpeerings/method_get.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_get.go deleted file mode 100644 index b53171627d6..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 *ExpressRouteCrossConnectionPeering -} - -// Get ... -func (c ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, id PeeringId) (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 ExpressRouteCrossConnectionPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_list.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_list.go deleted file mode 100644 index 3c542220690..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 *[]ExpressRouteCrossConnectionPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnectionPeering -} - -// List ... -func (c ExpressRouteCrossConnectionPeeringsClient) List(ctx context.Context, id ExpressRouteCrossConnectionId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerings", 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 *[]ExpressRouteCrossConnectionPeering `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 ExpressRouteCrossConnectionPeeringsClient) ListComplete(ctx context.Context, id ExpressRouteCrossConnectionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCrossConnectionPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCrossConnectionPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCrossConnectionId, predicate ExpressRouteCrossConnectionPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCrossConnectionPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 298b61e03ee..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go deleted file mode 100644 index 3244f828098..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go deleted file mode 100644 index 64330e5a7ea..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeeringProperties struct { - AzureASN *int64 `json:"azureASN,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index ec7f2c4a72c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_subresource.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_subresource.go deleted file mode 100644 index 919b934c547..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/predicates.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/predicates.go deleted file mode 100644 index abec5984ec1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p ExpressRouteCrossConnectionPeeringOperationPredicate) Matches(input ExpressRouteCrossConnectionPeering) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/version.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/version.go deleted file mode 100644 index c21486f72df..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/README.md deleted file mode 100644 index 1d99716cd77..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable` Documentation - -The `expressroutecrossconnectionroutetable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecrossconnectionroutetable" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionRouteTableClient.ExpressRouteCrossConnectionsListRoutesTable` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue") - -// alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/client.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/client.go deleted file mode 100644 index 210d81d68a9..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionroutetable - -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 ExpressRouteCrossConnectionRouteTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionRouteTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionRouteTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionroutetable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionRouteTableClient: %+v", err) - } - - return &ExpressRouteCrossConnectionRouteTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go deleted file mode 100644 index 9a8910626cd..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecrossconnectionroutetable - -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(&ExpressRouteCrossConnectionPeeringRouteTableId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCrossConnectionPeeringRouteTableId{} - -// ExpressRouteCrossConnectionPeeringRouteTableId is a struct representing the Resource ID for a Express Route Cross Connection Peering Route Table -type ExpressRouteCrossConnectionPeeringRouteTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string - RouteTableName string -} - -// NewExpressRouteCrossConnectionPeeringRouteTableID returns a new ExpressRouteCrossConnectionPeeringRouteTableId struct -func NewExpressRouteCrossConnectionPeeringRouteTableID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string, routeTableName string) ExpressRouteCrossConnectionPeeringRouteTableId { - return ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - RouteTableName: routeTableName, - } -} - -// ParseExpressRouteCrossConnectionPeeringRouteTableID parses 'input' into a ExpressRouteCrossConnectionPeeringRouteTableId -func ParseExpressRouteCrossConnectionPeeringRouteTableID(input string) (*ExpressRouteCrossConnectionPeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionPeeringRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionPeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively parses 'input' case-insensitively into a ExpressRouteCrossConnectionPeeringRouteTableId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(input string) (*ExpressRouteCrossConnectionPeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionPeeringRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionPeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCrossConnectionPeeringRouteTableId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateExpressRouteCrossConnectionPeeringRouteTableID checks that 'input' can be parsed as a Express Route Cross Connection Peering Route Table ID -func ValidateExpressRouteCrossConnectionPeeringRouteTableID(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 := ParseExpressRouteCrossConnectionPeeringRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Cross Connection Peering Route Table ID -func (id ExpressRouteCrossConnectionPeeringRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Cross Connection Peering Route Table ID -func (id ExpressRouteCrossConnectionPeeringRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Express Route Cross Connection Peering Route Table ID -func (id ExpressRouteCrossConnectionPeeringRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Express Route Cross Connection Peering Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go deleted file mode 100644 index 5340522791f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecrossconnectionroutetable - -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 = &ExpressRouteCrossConnectionPeeringRouteTableId{} - -func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionPeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionPeeringRouteTableID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionPeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForExpressRouteCrossConnectionPeeringRouteTableId(t *testing.T) { - segments := ExpressRouteCrossConnectionPeeringRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCrossConnectionPeeringRouteTableId 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/network/2023-05-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go deleted file mode 100644 index 75e866bbea7..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecrossconnectionroutetable - -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 ExpressRouteCrossConnectionsListRoutesTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitRoutesTable -} - -type ExpressRouteCrossConnectionsListRoutesTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitRoutesTable -} - -// ExpressRouteCrossConnectionsListRoutesTable ... -func (c ExpressRouteCrossConnectionRouteTableClient) ExpressRouteCrossConnectionsListRoutesTable(ctx context.Context, id ExpressRouteCrossConnectionPeeringRouteTableId) (result ExpressRouteCrossConnectionsListRoutesTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCrossConnectionsListRoutesTableThenPoll performs ExpressRouteCrossConnectionsListRoutesTable then polls until it's completed -func (c ExpressRouteCrossConnectionRouteTableClient) ExpressRouteCrossConnectionsListRoutesTableThenPoll(ctx context.Context, id ExpressRouteCrossConnectionPeeringRouteTableId) error { - result, err := c.ExpressRouteCrossConnectionsListRoutesTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCrossConnectionsListRoutesTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCrossConnectionsListRoutesTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go deleted file mode 100644 index 4861d1c6ca2..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTable struct { - LocPrf *string `json:"locPrf,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Path *string `json:"path,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/predicates.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/predicates.go deleted file mode 100644 index 2f1a6174bb4..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecrossconnectionroutetable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableOperationPredicate struct { - LocPrf *string - Network *string - NextHop *string - Path *string - Weight *int64 -} - -func (p ExpressRouteCircuitRoutesTableOperationPredicate) Matches(input ExpressRouteCircuitRoutesTable) bool { - - if p.LocPrf != nil && (input.LocPrf == nil || *p.LocPrf != *input.LocPrf) { - return false - } - - if p.Network != nil && (input.Network == nil || *p.Network != *input.Network) { - return false - } - - if p.NextHop != nil && (input.NextHop == nil || *p.NextHop != *input.NextHop) { - return false - } - - if p.Path != nil && (input.Path == nil || *p.Path != *input.Path) { - return false - } - - if p.Weight != nil && (input.Weight == nil || *p.Weight != *input.Weight) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/version.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/version.go deleted file mode 100644 index 997d3bd6531..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/README.md deleted file mode 100644 index ba6a7e55226..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary` Documentation - -The `expressroutecrossconnectionroutetablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecrossconnectionroutetablesummary" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionRouteTableSummaryClient.ExpressRouteCrossConnectionsListRoutesTableSummary` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue") - -// alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/client.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/client.go deleted file mode 100644 index 5329fa515af..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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 ExpressRouteCrossConnectionRouteTableSummaryClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionRouteTableSummaryClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionroutetablesummary", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionRouteTableSummaryClient: %+v", err) - } - - return &ExpressRouteCrossConnectionRouteTableSummaryClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go deleted file mode 100644 index ea69383cd3a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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(&PeeringRouteTablesSummaryId{}) -} - -var _ resourceids.ResourceId = &PeeringRouteTablesSummaryId{} - -// PeeringRouteTablesSummaryId is a struct representing the Resource ID for a Peering Route Tables Summary -type PeeringRouteTablesSummaryId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string - RouteTablesSummaryName string -} - -// NewPeeringRouteTablesSummaryID returns a new PeeringRouteTablesSummaryId struct -func NewPeeringRouteTablesSummaryID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string, routeTablesSummaryName string) PeeringRouteTablesSummaryId { - return PeeringRouteTablesSummaryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - RouteTablesSummaryName: routeTablesSummaryName, - } -} - -// ParsePeeringRouteTablesSummaryID parses 'input' into a PeeringRouteTablesSummaryId -func ParsePeeringRouteTablesSummaryID(input string) (*PeeringRouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTablesSummaryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringRouteTablesSummaryIDInsensitively parses 'input' case-insensitively into a PeeringRouteTablesSummaryId -// note: this method should only be used for API response data and not user input -func ParsePeeringRouteTablesSummaryIDInsensitively(input string) (*PeeringRouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTablesSummaryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringRouteTablesSummaryId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTablesSummaryName, ok = input.Parsed["routeTablesSummaryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTablesSummaryName", input) - } - - return nil -} - -// ValidatePeeringRouteTablesSummaryID checks that 'input' can be parsed as a Peering Route Tables Summary ID -func ValidatePeeringRouteTablesSummaryID(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 := ParsePeeringRouteTablesSummaryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Route Tables Summary ID -func (id PeeringRouteTablesSummaryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s/routeTablesSummary/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName, id.RouteTablesSummaryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Route Tables Summary ID -func (id PeeringRouteTablesSummaryId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryValue"), - } -} - -// String returns a human-readable description of this Peering Route Tables Summary ID -func (id PeeringRouteTablesSummaryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Tables Summary Name: %q", id.RouteTablesSummaryName), - } - return fmt.Sprintf("Peering Route Tables Summary (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go deleted file mode 100644 index df9578d4e3b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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 = &PeeringRouteTablesSummaryId{} - -func TestNewPeeringRouteTablesSummaryID(t *testing.T) { - id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTablesSummaryName != "routeTablesSummaryValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryValue") - } -} - -func TestFormatPeeringRouteTablesSummaryID(t *testing.T) { - actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringRouteTablesSummaryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &PeeringRouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTablesSummaryID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestParsePeeringRouteTablesSummaryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &PeeringRouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe", - Expected: &PeeringRouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTablesSummaryIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestSegmentsForPeeringRouteTablesSummaryId(t *testing.T) { - segments := PeeringRouteTablesSummaryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringRouteTablesSummaryId 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/network/2023-05-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go deleted file mode 100644 index 06c63e507a1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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 ExpressRouteCrossConnectionsListRoutesTableSummaryOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCrossConnectionRoutesTableSummary -} - -type ExpressRouteCrossConnectionsListRoutesTableSummaryCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnectionRoutesTableSummary -} - -// ExpressRouteCrossConnectionsListRoutesTableSummary ... -func (c ExpressRouteCrossConnectionRouteTableSummaryClient) ExpressRouteCrossConnectionsListRoutesTableSummary(ctx context.Context, id PeeringRouteTablesSummaryId) (result ExpressRouteCrossConnectionsListRoutesTableSummaryOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCrossConnectionsListRoutesTableSummaryThenPoll performs ExpressRouteCrossConnectionsListRoutesTableSummary then polls until it's completed -func (c ExpressRouteCrossConnectionRouteTableSummaryClient) ExpressRouteCrossConnectionsListRoutesTableSummaryThenPoll(ctx context.Context, id PeeringRouteTablesSummaryId) error { - result, err := c.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCrossConnectionsListRoutesTableSummary: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCrossConnectionsListRoutesTableSummary: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go deleted file mode 100644 index e13df051962..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionRoutesTableSummary struct { - Asn *int64 `json:"asn,omitempty"` - Neighbor *string `json:"neighbor,omitempty"` - StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` - UpDown *string `json:"upDown,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/predicates.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/predicates.go deleted file mode 100644 index 8399718cebc..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionRoutesTableSummaryOperationPredicate struct { - Asn *int64 - Neighbor *string - StateOrPrefixesReceived *string - UpDown *string -} - -func (p ExpressRouteCrossConnectionRoutesTableSummaryOperationPredicate) Matches(input ExpressRouteCrossConnectionRoutesTableSummary) bool { - - if p.Asn != nil && (input.Asn == nil || *p.Asn != *input.Asn) { - return false - } - - if p.Neighbor != nil && (input.Neighbor == nil || *p.Neighbor != *input.Neighbor) { - return false - } - - if p.StateOrPrefixesReceived != nil && (input.StateOrPrefixesReceived == nil || *p.StateOrPrefixesReceived != *input.StateOrPrefixesReceived) { - return false - } - - if p.UpDown != nil && (input.UpDown == nil || *p.UpDown != *input.UpDown) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/version.go b/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/version.go deleted file mode 100644 index 02cf7ce478d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnectionroutetablesummary/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetablesummary/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/README.md b/resource-manager/network/2023-05-01/expressroutecrossconnections/README.md deleted file mode 100644 index 42427f585ce..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/README.md +++ /dev/null @@ -1,109 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutecrossconnections` Documentation - -The `expressroutecrossconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutecrossconnections" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -payload := expressroutecrossconnections.ExpressRouteCrossConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -payload := expressroutecrossconnections.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/network/2023-05-01/expressroutecrossconnections/client.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/client.go deleted file mode 100644 index 67aa896c58d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnections - -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 ExpressRouteCrossConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionsClient: %+v", err) - } - - return &ExpressRouteCrossConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/constants.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/constants.go deleted file mode 100644 index 2e9d3456d55..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package expressroutecrossconnections - -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 ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ServiceProviderProvisioningState string - -const ( - ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" - ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" -) - -func PossibleValuesForServiceProviderProvisioningState() []string { - return []string{ - string(ServiceProviderProvisioningStateDeprovisioning), - string(ServiceProviderProvisioningStateNotProvisioned), - string(ServiceProviderProvisioningStateProvisioned), - string(ServiceProviderProvisioningStateProvisioning), - } -} - -func (s *ServiceProviderProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServiceProviderProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServiceProviderProvisioningState(input string) (*ServiceProviderProvisioningState, error) { - vals := map[string]ServiceProviderProvisioningState{ - "deprovisioning": ServiceProviderProvisioningStateDeprovisioning, - "notprovisioned": ServiceProviderProvisioningStateNotProvisioned, - "provisioned": ServiceProviderProvisioningStateProvisioned, - "provisioning": ServiceProviderProvisioningStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceProviderProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection.go deleted file mode 100644 index 3748db0d3a2..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecrossconnections - -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(&ExpressRouteCrossConnectionId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} - -// ExpressRouteCrossConnectionId is a struct representing the Resource ID for a Express Route Cross Connection -type ExpressRouteCrossConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string -} - -// NewExpressRouteCrossConnectionID returns a new ExpressRouteCrossConnectionId struct -func NewExpressRouteCrossConnectionID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string) ExpressRouteCrossConnectionId { - return ExpressRouteCrossConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - } -} - -// ParseExpressRouteCrossConnectionID parses 'input' into a ExpressRouteCrossConnectionId -func ParseExpressRouteCrossConnectionID(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCrossConnectionIDInsensitively parses 'input' case-insensitively into a ExpressRouteCrossConnectionId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCrossConnectionIDInsensitively(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCrossConnectionId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - return nil -} - -// ValidateExpressRouteCrossConnectionID checks that 'input' can be parsed as a Express Route Cross Connection ID -func ValidateExpressRouteCrossConnectionID(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 := ParseExpressRouteCrossConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - } -} - -// String returns a human-readable description of this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - } - return fmt.Sprintf("Express Route Cross Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go deleted file mode 100644 index 6fd5722f1a8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecrossconnections - -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 = &ExpressRouteCrossConnectionId{} - -func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } -} - -func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCrossConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestSegmentsForExpressRouteCrossConnectionId(t *testing.T) { - segments := ExpressRouteCrossConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCrossConnectionId 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/network/2023-05-01/expressroutecrossconnections/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/method_createorupdate.go deleted file mode 100644 index bc67ec4a5f8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/method_createorupdate.go +++ /dev/null @@ -1,74 +0,0 @@ -package expressroutecrossconnections - -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 *ExpressRouteCrossConnection -} - -// CreateOrUpdate ... -func (c ExpressRouteCrossConnectionsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteCrossConnectionId, input ExpressRouteCrossConnection) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCrossConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteCrossConnectionId, input ExpressRouteCrossConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutecrossconnections/method_get.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/method_get.go deleted file mode 100644 index 250556ca005..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecrossconnections - -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 *ExpressRouteCrossConnection -} - -// Get ... -func (c ExpressRouteCrossConnectionsClient) Get(ctx context.Context, id ExpressRouteCrossConnectionId) (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 ExpressRouteCrossConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/method_list.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/method_list.go deleted file mode 100644 index f422a663eea..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecrossconnections - -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 *[]ExpressRouteCrossConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnection -} - -// List ... -func (c ExpressRouteCrossConnectionsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCrossConnections", 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 *[]ExpressRouteCrossConnection `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 ExpressRouteCrossConnectionsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCrossConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCrossConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteCrossConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCrossConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecrossconnections/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/method_listbyresourcegroup.go deleted file mode 100644 index 42ee8a98379..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecrossconnections - -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 *[]ExpressRouteCrossConnection -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnection -} - -// ListByResourceGroup ... -func (c ExpressRouteCrossConnectionsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCrossConnections", 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 *[]ExpressRouteCrossConnection `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 ExpressRouteCrossConnectionsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ExpressRouteCrossConnectionOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCrossConnectionsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRouteCrossConnectionOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ExpressRouteCrossConnection, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutecrossconnections/method_updatetags.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/method_updatetags.go deleted file mode 100644 index 0c627c7653a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package expressroutecrossconnections - -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 *ExpressRouteCrossConnection -} - -// UpdateTags ... -func (c ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, id ExpressRouteCrossConnectionId, 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 ExpressRouteCrossConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 08d50c826a9..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitreference.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitreference.go deleted file mode 100644 index cbf4167bab5..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecircuitreference.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitReference struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnection.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnection.go deleted file mode 100644 index 52da62754ff..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnection.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go deleted file mode 100644 index e207a422215..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go deleted file mode 100644 index 0d9a1673538..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeeringProperties struct { - AzureASN *int64 `json:"azureASN,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go deleted file mode 100644 index 84515d8082c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionProperties struct { - BandwidthInMbps *int64 `json:"bandwidthInMbps,omitempty"` - ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - STag *int64 `json:"sTag,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 0101ae80d9e..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_subresource.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_subresource.go deleted file mode 100644 index b2922ebb4d1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_tagsobject.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/model_tagsobject.go deleted file mode 100644 index f47ce1a3f42..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnections - -// 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/network/2023-05-01/expressroutecrossconnections/predicates.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/predicates.go deleted file mode 100644 index f3d9b3a8dff..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteCrossConnectionOperationPredicate) Matches(input ExpressRouteCrossConnection) 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 && (input.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/network/2023-05-01/expressroutecrossconnections/version.go b/resource-manager/network/2023-05-01/expressroutecrossconnections/version.go deleted file mode 100644 index fac35978704..00000000000 --- a/resource-manager/network/2023-05-01/expressroutecrossconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/README.md b/resource-manager/network/2023-05-01/expressroutegateways/README.md deleted file mode 100644 index 0069f808963..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/README.md +++ /dev/null @@ -1,115 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutegateways` Documentation - -The `expressroutegateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutegateways" -``` - - -### Client Initialization - -```go -client := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -payload := expressroutegateways.ExpressRouteGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.Get` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -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: `ExpressRouteGatewaysClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.ListByResourceGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListBySubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -payload := expressroutegateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/expressroutegateways/client.go b/resource-manager/network/2023-05-01/expressroutegateways/client.go deleted file mode 100644 index a1f21a852ef..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutegateways - -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 ExpressRouteGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutegateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteGatewaysClient: %+v", err) - } - - return &ExpressRouteGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/constants.go b/resource-manager/network/2023-05-01/expressroutegateways/constants.go deleted file mode 100644 index ce8f5d5f24a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressroutegateways - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway.go b/resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway.go deleted file mode 100644 index 0e06d43d298..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutegateways - -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(&ExpressRouteGatewayId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteGatewayId{} - -// ExpressRouteGatewayId is a struct representing the Resource ID for a Express Route Gateway -type ExpressRouteGatewayId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteGatewayName string -} - -// NewExpressRouteGatewayID returns a new ExpressRouteGatewayId struct -func NewExpressRouteGatewayID(subscriptionId string, resourceGroupName string, expressRouteGatewayName string) ExpressRouteGatewayId { - return ExpressRouteGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteGatewayName: expressRouteGatewayName, - } -} - -// ParseExpressRouteGatewayID parses 'input' into a ExpressRouteGatewayId -func ParseExpressRouteGatewayID(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteGatewayIDInsensitively parses 'input' case-insensitively into a ExpressRouteGatewayId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteGatewayIDInsensitively(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteGatewayId) 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.ExpressRouteGatewayName, ok = input.Parsed["expressRouteGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteGatewayName", input) - } - - return nil -} - -// ValidateExpressRouteGatewayID checks that 'input' can be parsed as a Express Route Gateway ID -func ValidateExpressRouteGatewayID(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 := ParseExpressRouteGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Gateway ID -func (id ExpressRouteGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Gateway ID -func (id ExpressRouteGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), - resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayValue"), - } -} - -// String returns a human-readable description of this Express Route Gateway ID -func (id ExpressRouteGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Gateway Name: %q", id.ExpressRouteGatewayName), - } - return fmt.Sprintf("Express Route Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway_test.go b/resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway_test.go deleted file mode 100644 index cdb895a55c3..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/id_expressroutegateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutegateways - -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 = &ExpressRouteGatewayId{} - -func TestNewExpressRouteGatewayID(t *testing.T) { - id := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - - 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.ExpressRouteGatewayName != "expressRouteGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayValue") - } -} - -func TestFormatExpressRouteGatewayID(t *testing.T) { - actual := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayID(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestParseExpressRouteGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayIDInsensitively(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestSegmentsForExpressRouteGatewayId(t *testing.T) { - segments := ExpressRouteGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteGatewayId 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/network/2023-05-01/expressroutegateways/method_createorupdate.go b/resource-manager/network/2023-05-01/expressroutegateways/method_createorupdate.go deleted file mode 100644 index b02bd6b5ebb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutegateways - -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 *ExpressRouteGateway -} - -// CreateOrUpdate ... -func (c ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, id ExpressRouteGatewayId, input ExpressRouteGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteGatewayId, input ExpressRouteGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressroutegateways/method_delete.go b/resource-manager/network/2023-05-01/expressroutegateways/method_delete.go deleted file mode 100644 index 200f12cef03..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutegateways - -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 ExpressRouteGatewaysClient) Delete(ctx context.Context, id ExpressRouteGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteGatewaysClient) DeleteThenPoll(ctx context.Context, id ExpressRouteGatewayId) 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/network/2023-05-01/expressroutegateways/method_get.go b/resource-manager/network/2023-05-01/expressroutegateways/method_get.go deleted file mode 100644 index 74f38c464bb..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutegateways - -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 *ExpressRouteGateway -} - -// Get ... -func (c ExpressRouteGatewaysClient) Get(ctx context.Context, id ExpressRouteGatewayId) (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 ExpressRouteGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/expressroutegateways/method_listbyresourcegroup.go deleted file mode 100644 index 4676a67757a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/method_listbyresourcegroup.go +++ /dev/null @@ -1,56 +0,0 @@ -package expressroutegateways - -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 *ExpressRouteGatewayList -} - -// ListByResourceGroup ... -func (c ExpressRouteGatewaysClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteGateways", 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 ExpressRouteGatewayList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/method_listbysubscription.go b/resource-manager/network/2023-05-01/expressroutegateways/method_listbysubscription.go deleted file mode 100644 index ba74ca537ae..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/method_listbysubscription.go +++ /dev/null @@ -1,56 +0,0 @@ -package expressroutegateways - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteGatewayList -} - -// ListBySubscription ... -func (c ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteGateways", 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 ExpressRouteGatewayList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/method_updatetags.go b/resource-manager/network/2023-05-01/expressroutegateways/method_updatetags.go deleted file mode 100644 index 26c61ce6010..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutegateways - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteGateway -} - -// UpdateTags ... -func (c ExpressRouteGatewaysClient) UpdateTags(ctx context.Context, id ExpressRouteGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c ExpressRouteGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id ExpressRouteGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/expressroutegateways/model_expressroutecircuitpeeringid.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutecircuitpeeringid.go deleted file mode 100644 index 832d97a1174..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutecircuitpeeringid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnection.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnection.go deleted file mode 100644 index 99219dd6cfd..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnection.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnection struct { - Id *string `json:"id,omitempty"` - Name string `json:"name"` - Properties *ExpressRouteConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnectionproperties.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnectionproperties.go deleted file mode 100644 index 931b412129f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressrouteconnectionproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionProperties struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteCircuitPeering ExpressRouteCircuitPeeringId `json:"expressRouteCircuitPeering"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegateway.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegateway.go deleted file mode 100644 index 5505ff540a8..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaylist.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaylist.go deleted file mode 100644 index 51667424380..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaylist.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayList struct { - Value *[]ExpressRouteGateway `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewayproperties.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewayproperties.go deleted file mode 100644 index 4860e7d555a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewayproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayProperties struct { - AllowNonVirtualWanTraffic *bool `json:"allowNonVirtualWanTraffic,omitempty"` - AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub VirtualHubId `json:"virtualHub"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go deleted file mode 100644 index 60677f25d4c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { - Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds `json:"bounds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go b/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go deleted file mode 100644 index 65a1ccb474b..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_propagatedroutetable.go b/resource-manager/network/2023-05-01/expressroutegateways/model_propagatedroutetable.go deleted file mode 100644 index 93c6f306054..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_routingconfiguration.go b/resource-manager/network/2023-05-01/expressroutegateways/model_routingconfiguration.go deleted file mode 100644 index 670d9907881..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_staticroute.go b/resource-manager/network/2023-05-01/expressroutegateways/model_staticroute.go deleted file mode 100644 index 29422baf743..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_staticroutesconfig.go b/resource-manager/network/2023-05-01/expressroutegateways/model_staticroutesconfig.go deleted file mode 100644 index d570d0ec17a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_subresource.go b/resource-manager/network/2023-05-01/expressroutegateways/model_subresource.go deleted file mode 100644 index f86e3493340..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_tagsobject.go b/resource-manager/network/2023-05-01/expressroutegateways/model_tagsobject.go deleted file mode 100644 index 706aff41cd4..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// 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/network/2023-05-01/expressroutegateways/model_virtualhubid.go b/resource-manager/network/2023-05-01/expressroutegateways/model_virtualhubid.go deleted file mode 100644 index 41cb5ff6fd1..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_virtualhubid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/model_vnetroute.go b/resource-manager/network/2023-05-01/expressroutegateways/model_vnetroute.go deleted file mode 100644 index c9586e946c6..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutegateways/version.go b/resource-manager/network/2023-05-01/expressroutegateways/version.go deleted file mode 100644 index 7f5f41e1bce..00000000000 --- a/resource-manager/network/2023-05-01/expressroutegateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutegateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/README.md b/resource-manager/network/2023-05-01/expressroutelinks/README.md deleted file mode 100644 index 2fb9a467334..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressroutelinks` Documentation - -The `expressroutelinks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressroutelinks" -``` - - -### Client Initialization - -```go -client := expressroutelinks.NewExpressRouteLinksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteLinksClient.Get` - -```go -ctx := context.TODO() -id := expressroutelinks.NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue") - -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: `ExpressRouteLinksClient.List` - -```go -ctx := context.TODO() -id := expressroutelinks.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -// 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/network/2023-05-01/expressroutelinks/client.go b/resource-manager/network/2023-05-01/expressroutelinks/client.go deleted file mode 100644 index 42ba283bf4a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutelinks - -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 ExpressRouteLinksClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteLinksClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteLinksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutelinks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteLinksClient: %+v", err) - } - - return &ExpressRouteLinksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/constants.go b/resource-manager/network/2023-05-01/expressroutelinks/constants.go deleted file mode 100644 index bc075bf128a..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package expressroutelinks - -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 ExpressRouteLinkAdminState string - -const ( - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkAdminState() []string { - return []string{ - string(ExpressRouteLinkAdminStateDisabled), - string(ExpressRouteLinkAdminStateEnabled), - } -} - -func (s *ExpressRouteLinkAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkAdminState(input string) (*ExpressRouteLinkAdminState, error) { - vals := map[string]ExpressRouteLinkAdminState{ - "disabled": ExpressRouteLinkAdminStateDisabled, - "enabled": ExpressRouteLinkAdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkAdminState(input) - return &out, nil -} - -type ExpressRouteLinkConnectorType string - -const ( - ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" - ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" -) - -func PossibleValuesForExpressRouteLinkConnectorType() []string { - return []string{ - string(ExpressRouteLinkConnectorTypeLC), - string(ExpressRouteLinkConnectorTypeSC), - } -} - -func (s *ExpressRouteLinkConnectorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkConnectorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkConnectorType(input string) (*ExpressRouteLinkConnectorType, error) { - vals := map[string]ExpressRouteLinkConnectorType{ - "lc": ExpressRouteLinkConnectorTypeLC, - "sc": ExpressRouteLinkConnectorTypeSC, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkConnectorType(input) - return &out, nil -} - -type ExpressRouteLinkMacSecCipher string - -const ( - ExpressRouteLinkMacSecCipherGcmAesOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAes128" - ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAes256" - ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAesXpn256" -) - -func PossibleValuesForExpressRouteLinkMacSecCipher() []string { - return []string{ - string(ExpressRouteLinkMacSecCipherGcmAesOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix), - string(ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix), - } -} - -func (s *ExpressRouteLinkMacSecCipher) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecCipher(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecCipher(input string) (*ExpressRouteLinkMacSecCipher, error) { - vals := map[string]ExpressRouteLinkMacSecCipher{ - "gcmaes128": ExpressRouteLinkMacSecCipherGcmAesOneTwoEight, - "gcmaes256": ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix, - "gcmaesxpn128": ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight, - "gcmaesxpn256": ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecCipher(input) - return &out, nil -} - -type ExpressRouteLinkMacSecSciState string - -const ( - ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkMacSecSciState() []string { - return []string{ - string(ExpressRouteLinkMacSecSciStateDisabled), - string(ExpressRouteLinkMacSecSciStateEnabled), - } -} - -func (s *ExpressRouteLinkMacSecSciState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecSciState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecSciState(input string) (*ExpressRouteLinkMacSecSciState, error) { - vals := map[string]ExpressRouteLinkMacSecSciState{ - "disabled": ExpressRouteLinkMacSecSciStateDisabled, - "enabled": ExpressRouteLinkMacSecSciStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecSciState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport.go b/resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport.go deleted file mode 100644 index fdf651cde65..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutelinks - -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(&ExpressRoutePortId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortId{} - -// ExpressRoutePortId is a struct representing the Resource ID for a Express Route Port -type ExpressRoutePortId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string -} - -// NewExpressRoutePortID returns a new ExpressRoutePortId struct -func NewExpressRoutePortID(subscriptionId string, resourceGroupName string, expressRoutePortName string) ExpressRoutePortId { - return ExpressRoutePortId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - } -} - -// ParseExpressRoutePortID parses 'input' into a ExpressRoutePortId -func ParseExpressRoutePortID(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortIDInsensitively(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - return nil -} - -// ValidateExpressRoutePortID checks that 'input' can be parsed as a Express Route Port ID -func ValidateExpressRoutePortID(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 := ParseExpressRoutePortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port ID -func (id ExpressRoutePortId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port ID -func (id ExpressRoutePortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - } -} - -// String returns a human-readable description of this Express Route Port ID -func (id ExpressRoutePortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - } - return fmt.Sprintf("Express Route Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport_test.go b/resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport_test.go deleted file mode 100644 index de5ddef3250..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/id_expressrouteport_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutelinks - -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 = &ExpressRoutePortId{} - -func TestNewExpressRoutePortID(t *testing.T) { - id := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } -} - -func TestFormatExpressRoutePortID(t *testing.T) { - actual := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestParseExpressRoutePortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestSegmentsForExpressRoutePortId(t *testing.T) { - segments := ExpressRoutePortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortId 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/network/2023-05-01/expressroutelinks/id_link.go b/resource-manager/network/2023-05-01/expressroutelinks/id_link.go deleted file mode 100644 index ff86b5a2798..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/id_link.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressroutelinks - -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(&LinkId{}) -} - -var _ resourceids.ResourceId = &LinkId{} - -// LinkId is a struct representing the Resource ID for a Link -type LinkId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string - LinkName string -} - -// NewLinkID returns a new LinkId struct -func NewLinkID(subscriptionId string, resourceGroupName string, expressRoutePortName string, linkName string) LinkId { - return LinkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - LinkName: linkName, - } -} - -// ParseLinkID parses 'input' into a LinkId -func ParseLinkID(input string) (*LinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&LinkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLinkIDInsensitively parses 'input' case-insensitively into a LinkId -// note: this method should only be used for API response data and not user input -func ParseLinkIDInsensitively(input string) (*LinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&LinkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LinkId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - if id.LinkName, ok = input.Parsed["linkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "linkName", input) - } - - return nil -} - -// ValidateLinkID checks that 'input' can be parsed as a Link ID -func ValidateLinkID(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 := ParseLinkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Link ID -func (id LinkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s/links/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName, id.LinkName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Link ID -func (id LinkId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - resourceids.StaticSegment("staticLinks", "links", "links"), - resourceids.UserSpecifiedSegment("linkName", "linkValue"), - } -} - -// String returns a human-readable description of this Link ID -func (id LinkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - fmt.Sprintf("Link Name: %q", id.LinkName), - } - return fmt.Sprintf("Link (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/id_link_test.go b/resource-manager/network/2023-05-01/expressroutelinks/id_link_test.go deleted file mode 100644 index 970951aa93c..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/id_link_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressroutelinks - -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 = &LinkId{} - -func TestNewLinkID(t *testing.T) { - id := NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } - - if id.LinkName != "linkValue" { - t.Fatalf("Expected %q but got %q for Segment 'LinkName'", id.LinkName, "linkValue") - } -} - -func TestFormatLinkID(t *testing.T) { - actual := NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLinkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue", - Expected: &LinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - LinkName: "linkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLinkID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.LinkName != v.Expected.LinkName { - t.Fatalf("Expected %q but got %q for LinkName", v.Expected.LinkName, actual.LinkName) - } - - } -} - -func TestParseLinkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/lInKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue", - Expected: &LinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - LinkName: "linkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/lInKs/lInKvAlUe", - Expected: &LinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - LinkName: "lInKvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/lInKs/lInKvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLinkIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.LinkName != v.Expected.LinkName { - t.Fatalf("Expected %q but got %q for LinkName", v.Expected.LinkName, actual.LinkName) - } - - } -} - -func TestSegmentsForLinkId(t *testing.T) { - segments := LinkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LinkId 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/network/2023-05-01/expressroutelinks/method_get.go b/resource-manager/network/2023-05-01/expressroutelinks/method_get.go deleted file mode 100644 index 25857a7f294..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutelinks - -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 *ExpressRouteLink -} - -// Get ... -func (c ExpressRouteLinksClient) Get(ctx context.Context, id LinkId) (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 ExpressRouteLink - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/method_list.go b/resource-manager/network/2023-05-01/expressroutelinks/method_list.go deleted file mode 100644 index 387950ca63d..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutelinks - -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 *[]ExpressRouteLink -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteLink -} - -// List ... -func (c ExpressRouteLinksClient) List(ctx context.Context, id ExpressRoutePortId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/links", 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 *[]ExpressRouteLink `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 ExpressRouteLinksClient) ListComplete(ctx context.Context, id ExpressRoutePortId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteLinkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteLinksClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRoutePortId, predicate ExpressRouteLinkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteLink, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressroutelinks/model_expressroutelink.go b/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelink.go deleted file mode 100644 index d8919f16d71..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkmacsecconfig.go b/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkmacsecconfig.go deleted file mode 100644 index 91551b3b16f..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkmacsecconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkMacSecConfig struct { - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - Cipher *ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - SciState *ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkpropertiesformat.go b/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkpropertiesformat.go deleted file mode 100644 index 6d9466ff4ff..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/model_expressroutelinkpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkPropertiesFormat struct { - AdminState *ExpressRouteLinkAdminState `json:"adminState,omitempty"` - ColoLocation *string `json:"coloLocation,omitempty"` - ConnectorType *ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` - InterfaceName *string `json:"interfaceName,omitempty"` - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` - PatchPanelId *string `json:"patchPanelId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RackId *string `json:"rackId,omitempty"` - RouterName *string `json:"routerName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/predicates.go b/resource-manager/network/2023-05-01/expressroutelinks/predicates.go deleted file mode 100644 index bd6127afc55..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p ExpressRouteLinkOperationPredicate) Matches(input ExpressRouteLink) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/expressroutelinks/version.go b/resource-manager/network/2023-05-01/expressroutelinks/version.go deleted file mode 100644 index f89fc1cf8a5..00000000000 --- a/resource-manager/network/2023-05-01/expressroutelinks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutelinks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutelinks/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/README.md b/resource-manager/network/2023-05-01/expressrouteportauthorizations/README.md deleted file mode 100644 index c6cd55b8db7..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteportauthorizations` Documentation - -The `expressrouteportauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressrouteportauthorizations" -``` - - -### Client Initialization - -```go -client := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -payload := expressrouteportauthorizations.ExpressRoutePortAuthorization{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -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: `ExpressRoutePortAuthorizationsClient.List` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -// 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/network/2023-05-01/expressrouteportauthorizations/client.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/client.go deleted file mode 100644 index a6a1e906e85..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteportauthorizations - -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 ExpressRoutePortAuthorizationsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRoutePortAuthorizationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRoutePortAuthorizationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteportauthorizations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRoutePortAuthorizationsClient: %+v", err) - } - - return &ExpressRoutePortAuthorizationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/constants.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/constants.go deleted file mode 100644 index 3fbd20f1075..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressrouteportauthorizations - -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 ExpressRoutePortAuthorizationUseStatus string - -const ( - ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" - ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" -) - -func PossibleValuesForExpressRoutePortAuthorizationUseStatus() []string { - return []string{ - string(ExpressRoutePortAuthorizationUseStatusAvailable), - string(ExpressRoutePortAuthorizationUseStatusInUse), - } -} - -func (s *ExpressRoutePortAuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePortAuthorizationUseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePortAuthorizationUseStatus(input string) (*ExpressRoutePortAuthorizationUseStatus, error) { - vals := map[string]ExpressRoutePortAuthorizationUseStatus{ - "available": ExpressRoutePortAuthorizationUseStatusAvailable, - "inuse": ExpressRoutePortAuthorizationUseStatusInUse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePortAuthorizationUseStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport.go deleted file mode 100644 index 9fffd1964c0..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressrouteportauthorizations - -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(&ExpressRoutePortId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortId{} - -// ExpressRoutePortId is a struct representing the Resource ID for a Express Route Port -type ExpressRoutePortId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string -} - -// NewExpressRoutePortID returns a new ExpressRoutePortId struct -func NewExpressRoutePortID(subscriptionId string, resourceGroupName string, expressRoutePortName string) ExpressRoutePortId { - return ExpressRoutePortId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - } -} - -// ParseExpressRoutePortID parses 'input' into a ExpressRoutePortId -func ParseExpressRoutePortID(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortIDInsensitively(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - return nil -} - -// ValidateExpressRoutePortID checks that 'input' can be parsed as a Express Route Port ID -func ValidateExpressRoutePortID(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 := ParseExpressRoutePortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port ID -func (id ExpressRoutePortId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port ID -func (id ExpressRoutePortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - } -} - -// String returns a human-readable description of this Express Route Port ID -func (id ExpressRoutePortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - } - return fmt.Sprintf("Express Route Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport_test.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport_test.go deleted file mode 100644 index 3202d0fbe70..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteport_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressrouteportauthorizations - -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 = &ExpressRoutePortId{} - -func TestNewExpressRoutePortID(t *testing.T) { - id := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } -} - -func TestFormatExpressRoutePortID(t *testing.T) { - actual := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestParseExpressRoutePortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestSegmentsForExpressRoutePortId(t *testing.T) { - segments := ExpressRoutePortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortId 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/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization.go deleted file mode 100644 index 4042eea1718..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressrouteportauthorizations - -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(&ExpressRoutePortAuthorizationId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortAuthorizationId{} - -// ExpressRoutePortAuthorizationId is a struct representing the Resource ID for a Express Route Port Authorization -type ExpressRoutePortAuthorizationId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string - AuthorizationName string -} - -// NewExpressRoutePortAuthorizationID returns a new ExpressRoutePortAuthorizationId struct -func NewExpressRoutePortAuthorizationID(subscriptionId string, resourceGroupName string, expressRoutePortName string, authorizationName string) ExpressRoutePortAuthorizationId { - return ExpressRoutePortAuthorizationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - AuthorizationName: authorizationName, - } -} - -// ParseExpressRoutePortAuthorizationID parses 'input' into a ExpressRoutePortAuthorizationId -func ParseExpressRoutePortAuthorizationID(input string) (*ExpressRoutePortAuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortAuthorizationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortAuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortAuthorizationIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortAuthorizationId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortAuthorizationIDInsensitively(input string) (*ExpressRoutePortAuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortAuthorizationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortAuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortAuthorizationId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - if id.AuthorizationName, ok = input.Parsed["authorizationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "authorizationName", input) - } - - return nil -} - -// ValidateExpressRoutePortAuthorizationID checks that 'input' can be parsed as a Express Route Port Authorization ID -func ValidateExpressRoutePortAuthorizationID(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 := ParseExpressRoutePortAuthorizationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port Authorization ID -func (id ExpressRoutePortAuthorizationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s/authorizations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName, id.AuthorizationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port Authorization ID -func (id ExpressRoutePortAuthorizationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), - resourceids.UserSpecifiedSegment("authorizationName", "authorizationValue"), - } -} - -// String returns a human-readable description of this Express Route Port Authorization ID -func (id ExpressRoutePortAuthorizationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - fmt.Sprintf("Authorization Name: %q", id.AuthorizationName), - } - return fmt.Sprintf("Express Route Port Authorization (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go deleted file mode 100644 index 2c7b32a0618..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressrouteportauthorizations - -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 = &ExpressRoutePortAuthorizationId{} - -func TestNewExpressRoutePortAuthorizationID(t *testing.T) { - id := NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } - - if id.AuthorizationName != "authorizationValue" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationName'", id.AuthorizationName, "authorizationValue") - } -} - -func TestFormatExpressRoutePortAuthorizationID(t *testing.T) { - actual := NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortAuthorizationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortAuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue", - Expected: &ExpressRoutePortAuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortAuthorizationID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestParseExpressRoutePortAuthorizationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortAuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/aUtHoRiZaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue", - Expected: &ExpressRoutePortAuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE", - Expected: &ExpressRoutePortAuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - AuthorizationName: "aUtHoRiZaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortAuthorizationIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestSegmentsForExpressRoutePortAuthorizationId(t *testing.T) { - segments := ExpressRoutePortAuthorizationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortAuthorizationId 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/network/2023-05-01/expressrouteportauthorizations/method_createorupdate.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_createorupdate.go deleted file mode 100644 index 9e08a949ed3..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressrouteportauthorizations - -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 *ExpressRoutePortAuthorization -} - -// CreateOrUpdate ... -func (c ExpressRoutePortAuthorizationsClient) CreateOrUpdate(ctx context.Context, id ExpressRoutePortAuthorizationId, input ExpressRoutePortAuthorization) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRoutePortAuthorizationsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRoutePortAuthorizationId, input ExpressRoutePortAuthorization) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressrouteportauthorizations/method_delete.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_delete.go deleted file mode 100644 index 8940670b615..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressrouteportauthorizations - -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 ExpressRoutePortAuthorizationsClient) Delete(ctx context.Context, id ExpressRoutePortAuthorizationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRoutePortAuthorizationsClient) DeleteThenPoll(ctx context.Context, id ExpressRoutePortAuthorizationId) 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/network/2023-05-01/expressrouteportauthorizations/method_get.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_get.go deleted file mode 100644 index 0dd81644eba..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteportauthorizations - -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 *ExpressRoutePortAuthorization -} - -// Get ... -func (c ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, id ExpressRoutePortAuthorizationId) (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 ExpressRoutePortAuthorization - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_list.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_list.go deleted file mode 100644 index 01e0d857a47..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressrouteportauthorizations - -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 *[]ExpressRoutePortAuthorization -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePortAuthorization -} - -// List ... -func (c ExpressRoutePortAuthorizationsClient) List(ctx context.Context, id ExpressRoutePortId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/authorizations", 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 *[]ExpressRoutePortAuthorization `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 ExpressRoutePortAuthorizationsClient) ListComplete(ctx context.Context, id ExpressRoutePortId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRoutePortAuthorizationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortAuthorizationsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRoutePortId, predicate ExpressRoutePortAuthorizationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRoutePortAuthorization, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorization.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorization.go deleted file mode 100644 index aee29af0a99..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorization.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortAuthorization struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRoutePortAuthorizationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go deleted file mode 100644 index 9370c4f6323..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteportauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortAuthorizationPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationUseStatus *ExpressRoutePortAuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - CircuitResourceUri *string `json:"circuitResourceUri,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteportauthorizations/predicates.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/predicates.go deleted file mode 100644 index d12fc29e52a..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressrouteportauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortAuthorizationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRoutePortAuthorizationOperationPredicate) Matches(input ExpressRoutePortAuthorization) 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.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/network/2023-05-01/expressrouteportauthorizations/version.go b/resource-manager/network/2023-05-01/expressrouteportauthorizations/version.go deleted file mode 100644 index 08a6c280224..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportauthorizations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportauthorizations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportauthorizations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/README.md b/resource-manager/network/2023-05-01/expressrouteports/README.md deleted file mode 100644 index 9d2bfa00c5c..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/README.md +++ /dev/null @@ -1,142 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteports` Documentation - -The `expressrouteports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressrouteports" -``` - - -### Client Initialization - -```go -client := expressrouteports.NewExpressRoutePortsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.ExpressRoutePort{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortsClient.GenerateLOA` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.GenerateExpressRoutePortsLOARequest{ - // ... -} - - -read, err := client.GenerateLOA(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRoutePortsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.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/network/2023-05-01/expressrouteports/client.go b/resource-manager/network/2023-05-01/expressrouteports/client.go deleted file mode 100644 index 7b73cfca2af..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteports - -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 ExpressRoutePortsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRoutePortsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRoutePortsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteports", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRoutePortsClient: %+v", err) - } - - return &ExpressRoutePortsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/constants.go b/resource-manager/network/2023-05-01/expressrouteports/constants.go deleted file mode 100644 index 0c08bc2c72f..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/constants.go +++ /dev/null @@ -1,309 +0,0 @@ -package expressrouteports - -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 ExpressRouteLinkAdminState string - -const ( - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkAdminState() []string { - return []string{ - string(ExpressRouteLinkAdminStateDisabled), - string(ExpressRouteLinkAdminStateEnabled), - } -} - -func (s *ExpressRouteLinkAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkAdminState(input string) (*ExpressRouteLinkAdminState, error) { - vals := map[string]ExpressRouteLinkAdminState{ - "disabled": ExpressRouteLinkAdminStateDisabled, - "enabled": ExpressRouteLinkAdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkAdminState(input) - return &out, nil -} - -type ExpressRouteLinkConnectorType string - -const ( - ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" - ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" -) - -func PossibleValuesForExpressRouteLinkConnectorType() []string { - return []string{ - string(ExpressRouteLinkConnectorTypeLC), - string(ExpressRouteLinkConnectorTypeSC), - } -} - -func (s *ExpressRouteLinkConnectorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkConnectorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkConnectorType(input string) (*ExpressRouteLinkConnectorType, error) { - vals := map[string]ExpressRouteLinkConnectorType{ - "lc": ExpressRouteLinkConnectorTypeLC, - "sc": ExpressRouteLinkConnectorTypeSC, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkConnectorType(input) - return &out, nil -} - -type ExpressRouteLinkMacSecCipher string - -const ( - ExpressRouteLinkMacSecCipherGcmAesOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAes128" - ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAes256" - ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAesXpn256" -) - -func PossibleValuesForExpressRouteLinkMacSecCipher() []string { - return []string{ - string(ExpressRouteLinkMacSecCipherGcmAesOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix), - string(ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix), - } -} - -func (s *ExpressRouteLinkMacSecCipher) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecCipher(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecCipher(input string) (*ExpressRouteLinkMacSecCipher, error) { - vals := map[string]ExpressRouteLinkMacSecCipher{ - "gcmaes128": ExpressRouteLinkMacSecCipherGcmAesOneTwoEight, - "gcmaes256": ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix, - "gcmaesxpn128": ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight, - "gcmaesxpn256": ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecCipher(input) - return &out, nil -} - -type ExpressRouteLinkMacSecSciState string - -const ( - ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkMacSecSciState() []string { - return []string{ - string(ExpressRouteLinkMacSecSciStateDisabled), - string(ExpressRouteLinkMacSecSciStateEnabled), - } -} - -func (s *ExpressRouteLinkMacSecSciState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecSciState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecSciState(input string) (*ExpressRouteLinkMacSecSciState, error) { - vals := map[string]ExpressRouteLinkMacSecSciState{ - "disabled": ExpressRouteLinkMacSecSciStateDisabled, - "enabled": ExpressRouteLinkMacSecSciStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecSciState(input) - return &out, nil -} - -type ExpressRoutePortsBillingType string - -const ( - ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" - ExpressRoutePortsBillingTypeUnlimitedData ExpressRoutePortsBillingType = "UnlimitedData" -) - -func PossibleValuesForExpressRoutePortsBillingType() []string { - return []string{ - string(ExpressRoutePortsBillingTypeMeteredData), - string(ExpressRoutePortsBillingTypeUnlimitedData), - } -} - -func (s *ExpressRoutePortsBillingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePortsBillingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePortsBillingType(input string) (*ExpressRoutePortsBillingType, error) { - vals := map[string]ExpressRoutePortsBillingType{ - "metereddata": ExpressRoutePortsBillingTypeMeteredData, - "unlimiteddata": ExpressRoutePortsBillingTypeUnlimitedData, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePortsBillingType(input) - return &out, nil -} - -type ExpressRoutePortsEncapsulation string - -const ( - ExpressRoutePortsEncapsulationDotOneQ ExpressRoutePortsEncapsulation = "Dot1Q" - ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -func PossibleValuesForExpressRoutePortsEncapsulation() []string { - return []string{ - string(ExpressRoutePortsEncapsulationDotOneQ), - string(ExpressRoutePortsEncapsulationQinQ), - } -} - -func (s *ExpressRoutePortsEncapsulation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePortsEncapsulation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePortsEncapsulation(input string) (*ExpressRoutePortsEncapsulation, error) { - vals := map[string]ExpressRoutePortsEncapsulation{ - "dot1q": ExpressRoutePortsEncapsulationDotOneQ, - "qinq": ExpressRoutePortsEncapsulationQinQ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePortsEncapsulation(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport.go b/resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport.go deleted file mode 100644 index 6ac3a3831e8..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressrouteports - -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(&ExpressRoutePortId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortId{} - -// ExpressRoutePortId is a struct representing the Resource ID for a Express Route Port -type ExpressRoutePortId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string -} - -// NewExpressRoutePortID returns a new ExpressRoutePortId struct -func NewExpressRoutePortID(subscriptionId string, resourceGroupName string, expressRoutePortName string) ExpressRoutePortId { - return ExpressRoutePortId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - } -} - -// ParseExpressRoutePortID parses 'input' into a ExpressRoutePortId -func ParseExpressRoutePortID(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortIDInsensitively(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - return nil -} - -// ValidateExpressRoutePortID checks that 'input' can be parsed as a Express Route Port ID -func ValidateExpressRoutePortID(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 := ParseExpressRoutePortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port ID -func (id ExpressRoutePortId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port ID -func (id ExpressRoutePortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - } -} - -// String returns a human-readable description of this Express Route Port ID -func (id ExpressRoutePortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - } - return fmt.Sprintf("Express Route Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport_test.go b/resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport_test.go deleted file mode 100644 index ddf9459854a..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/id_expressrouteport_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressrouteports - -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 = &ExpressRoutePortId{} - -func TestNewExpressRoutePortID(t *testing.T) { - id := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } -} - -func TestFormatExpressRoutePortID(t *testing.T) { - actual := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestParseExpressRoutePortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestSegmentsForExpressRoutePortId(t *testing.T) { - segments := ExpressRoutePortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortId 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/network/2023-05-01/expressrouteports/method_createorupdate.go b/resource-manager/network/2023-05-01/expressrouteports/method_createorupdate.go deleted file mode 100644 index 34782a4d4f3..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressrouteports - -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 *ExpressRoutePort -} - -// CreateOrUpdate ... -func (c ExpressRoutePortsClient) CreateOrUpdate(ctx context.Context, id ExpressRoutePortId, input ExpressRoutePort) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRoutePortsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRoutePortId, input ExpressRoutePort) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/expressrouteports/method_delete.go b/resource-manager/network/2023-05-01/expressrouteports/method_delete.go deleted file mode 100644 index 899e7de35bd..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressrouteports - -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 ExpressRoutePortsClient) Delete(ctx context.Context, id ExpressRoutePortId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRoutePortsClient) DeleteThenPoll(ctx context.Context, id ExpressRoutePortId) 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/network/2023-05-01/expressrouteports/method_generateloa.go b/resource-manager/network/2023-05-01/expressrouteports/method_generateloa.go deleted file mode 100644 index d0010451bf9..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_generateloa.go +++ /dev/null @@ -1,59 +0,0 @@ -package expressrouteports - -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 GenerateLOAOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *GenerateExpressRoutePortsLOAResult -} - -// GenerateLOA ... -func (c ExpressRoutePortsClient) GenerateLOA(ctx context.Context, id ExpressRoutePortId, input GenerateExpressRoutePortsLOARequest) (result GenerateLOAOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generateLoa", 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 GenerateExpressRoutePortsLOAResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/method_get.go b/resource-manager/network/2023-05-01/expressrouteports/method_get.go deleted file mode 100644 index 0f35b842ad6..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteports - -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 *ExpressRoutePort -} - -// Get ... -func (c ExpressRoutePortsClient) Get(ctx context.Context, id ExpressRoutePortId) (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 ExpressRoutePort - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/method_list.go b/resource-manager/network/2023-05-01/expressrouteports/method_list.go deleted file mode 100644 index 04ce9e24ba1..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteports - -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 *[]ExpressRoutePort -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePort -} - -// List ... -func (c ExpressRoutePortsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRoutePorts", 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 *[]ExpressRoutePort `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 ExpressRoutePortsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRoutePortOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRoutePortOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRoutePort, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressrouteports/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/expressrouteports/method_listbyresourcegroup.go deleted file mode 100644 index bef430c396b..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteports - -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 *[]ExpressRoutePort -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePort -} - -// ListByResourceGroup ... -func (c ExpressRoutePortsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRoutePorts", 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 *[]ExpressRoutePort `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 ExpressRoutePortsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ExpressRoutePortOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRoutePortOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ExpressRoutePort, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/expressrouteports/method_updatetags.go b/resource-manager/network/2023-05-01/expressrouteports/method_updatetags.go deleted file mode 100644 index fef0242df71..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package expressrouteports - -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 *ExpressRoutePort -} - -// UpdateTags ... -func (c ExpressRoutePortsClient) UpdateTags(ctx context.Context, id ExpressRoutePortId, 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 ExpressRoutePort - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelink.go b/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelink.go deleted file mode 100644 index 60ed59156ad..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkmacsecconfig.go b/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkmacsecconfig.go deleted file mode 100644 index f41c94b3401..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkmacsecconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkMacSecConfig struct { - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - Cipher *ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - SciState *ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkpropertiesformat.go b/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkpropertiesformat.go deleted file mode 100644 index a9fd2f6e03d..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_expressroutelinkpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkPropertiesFormat struct { - AdminState *ExpressRouteLinkAdminState `json:"adminState,omitempty"` - ColoLocation *string `json:"coloLocation,omitempty"` - ConnectorType *ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` - InterfaceName *string `json:"interfaceName,omitempty"` - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` - PatchPanelId *string `json:"patchPanelId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RackId *string `json:"rackId,omitempty"` - RouterName *string `json:"routerName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_expressrouteport.go b/resource-manager/network/2023-05-01/expressrouteports/model_expressrouteport.go deleted file mode 100644 index 4e2aa94784f..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_expressrouteport.go +++ /dev/null @@ -1,19 +0,0 @@ -package expressrouteports - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRoutePortPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_expressrouteportpropertiesformat.go b/resource-manager/network/2023-05-01/expressrouteports/model_expressrouteportpropertiesformat.go deleted file mode 100644 index 897d5ea08de..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_expressrouteportpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortPropertiesFormat struct { - AllocationDate *string `json:"allocationDate,omitempty"` - BandwidthInGbps *int64 `json:"bandwidthInGbps,omitempty"` - BillingType *ExpressRoutePortsBillingType `json:"billingType,omitempty"` - Circuits *[]SubResource `json:"circuits,omitempty"` - Encapsulation *ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` - EtherType *string `json:"etherType,omitempty"` - Links *[]ExpressRouteLink `json:"links,omitempty"` - Mtu *string `json:"mtu,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloarequest.go b/resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloarequest.go deleted file mode 100644 index d588660f834..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloarequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateExpressRoutePortsLOARequest struct { - CustomerName string `json:"customerName"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloaresult.go b/resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloaresult.go deleted file mode 100644 index 54defeace0f..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_generateexpressrouteportsloaresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateExpressRoutePortsLOAResult struct { - EncodedContent *string `json:"encodedContent,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_subresource.go b/resource-manager/network/2023-05-01/expressrouteports/model_subresource.go deleted file mode 100644 index ef7329a3163..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteports/model_tagsobject.go b/resource-manager/network/2023-05-01/expressrouteports/model_tagsobject.go deleted file mode 100644 index d0cb6f9d317..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// 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/network/2023-05-01/expressrouteports/predicates.go b/resource-manager/network/2023-05-01/expressrouteports/predicates.go deleted file mode 100644 index 7339fac991b..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRoutePortOperationPredicate) Matches(input ExpressRoutePort) 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 && (input.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/network/2023-05-01/expressrouteports/version.go b/resource-manager/network/2023-05-01/expressrouteports/version.go deleted file mode 100644 index d0906bc251f..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteports/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteports - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteports/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/README.md b/resource-manager/network/2023-05-01/expressrouteportslocations/README.md deleted file mode 100644 index 7303a1f6880..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteportslocations` Documentation - -The `expressrouteportslocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressrouteportslocations" -``` - - -### Client Initialization - -```go -client := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortsLocationsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue") - -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: `ExpressRoutePortsLocationsClient.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 -} -``` diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/client.go b/resource-manager/network/2023-05-01/expressrouteportslocations/client.go deleted file mode 100644 index 070961a7825..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteportslocations - -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 ExpressRoutePortsLocationsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRoutePortsLocationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRoutePortsLocationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteportslocations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRoutePortsLocationsClient: %+v", err) - } - - return &ExpressRoutePortsLocationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/constants.go b/resource-manager/network/2023-05-01/expressrouteportslocations/constants.go deleted file mode 100644 index 79d7bad3ae5..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package expressrouteportslocations - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation.go deleted file mode 100644 index 94e09ce7a77..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation.go +++ /dev/null @@ -1,121 +0,0 @@ -package expressrouteportslocations - -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(&ExpressRoutePortsLocationId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortsLocationId{} - -// ExpressRoutePortsLocationId is a struct representing the Resource ID for a Express Route Ports Location -type ExpressRoutePortsLocationId struct { - SubscriptionId string - ExpressRoutePortsLocationName string -} - -// NewExpressRoutePortsLocationID returns a new ExpressRoutePortsLocationId struct -func NewExpressRoutePortsLocationID(subscriptionId string, expressRoutePortsLocationName string) ExpressRoutePortsLocationId { - return ExpressRoutePortsLocationId{ - SubscriptionId: subscriptionId, - ExpressRoutePortsLocationName: expressRoutePortsLocationName, - } -} - -// ParseExpressRoutePortsLocationID parses 'input' into a ExpressRoutePortsLocationId -func ParseExpressRoutePortsLocationID(input string) (*ExpressRoutePortsLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortsLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortsLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortsLocationIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortsLocationId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortsLocationIDInsensitively(input string) (*ExpressRoutePortsLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortsLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortsLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortsLocationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ExpressRoutePortsLocationName, ok = input.Parsed["expressRoutePortsLocationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortsLocationName", input) - } - - return nil -} - -// ValidateExpressRoutePortsLocationID checks that 'input' can be parsed as a Express Route Ports Location ID -func ValidateExpressRoutePortsLocationID(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 := ParseExpressRoutePortsLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Ports Location ID -func (id ExpressRoutePortsLocationId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/expressRoutePortsLocations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ExpressRoutePortsLocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Ports Location ID -func (id ExpressRoutePortsLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePortsLocations", "expressRoutePortsLocations", "expressRoutePortsLocations"), - resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "expressRoutePortsLocationValue"), - } -} - -// String returns a human-readable description of this Express Route Ports Location ID -func (id ExpressRoutePortsLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Express Route Ports Location Name: %q", id.ExpressRoutePortsLocationName), - } - return fmt.Sprintf("Express Route Ports Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation_test.go deleted file mode 100644 index f10f6641906..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/id_expressrouteportslocation_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package expressrouteportslocations - -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 = &ExpressRoutePortsLocationId{} - -func TestNewExpressRoutePortsLocationID(t *testing.T) { - id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue") - - 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.ExpressRoutePortsLocationName != "expressRoutePortsLocationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "expressRoutePortsLocationValue") - } -} - -func TestFormatExpressRoutePortsLocationID(t *testing.T) { - actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortsLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortsLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue", - Expected: &ExpressRoutePortsLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "expressRoutePortsLocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortsLocationID(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.ExpressRoutePortsLocationName != v.Expected.ExpressRoutePortsLocationName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortsLocationName", v.Expected.ExpressRoutePortsLocationName, actual.ExpressRoutePortsLocationName) - } - - } -} - -func TestParseExpressRoutePortsLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortsLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue", - Expected: &ExpressRoutePortsLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "expressRoutePortsLocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnVaLuE", - Expected: &ExpressRoutePortsLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "eXpReSsRoUtEpOrTsLoCaTiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortsLocationIDInsensitively(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.ExpressRoutePortsLocationName != v.Expected.ExpressRoutePortsLocationName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortsLocationName", v.Expected.ExpressRoutePortsLocationName, actual.ExpressRoutePortsLocationName) - } - - } -} - -func TestSegmentsForExpressRoutePortsLocationId(t *testing.T) { - segments := ExpressRoutePortsLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortsLocationId 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/network/2023-05-01/expressrouteportslocations/method_get.go b/resource-manager/network/2023-05-01/expressrouteportslocations/method_get.go deleted file mode 100644 index 58048a2240a..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteportslocations - -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 *ExpressRoutePortsLocation -} - -// Get ... -func (c ExpressRoutePortsLocationsClient) Get(ctx context.Context, id ExpressRoutePortsLocationId) (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 ExpressRoutePortsLocation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/method_list.go b/resource-manager/network/2023-05-01/expressrouteportslocations/method_list.go deleted file mode 100644 index 760fa0a81bd..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteportslocations - -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 *[]ExpressRoutePortsLocation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePortsLocation -} - -// List ... -func (c ExpressRoutePortsLocationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRoutePortsLocations", 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 *[]ExpressRoutePortsLocation `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 ExpressRoutePortsLocationsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRoutePortsLocationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortsLocationsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRoutePortsLocationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRoutePortsLocation, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocation.go b/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocation.go deleted file mode 100644 index 86d94dc7922..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocation.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocation struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRoutePortsLocationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go b/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go deleted file mode 100644 index 018cb977672..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocationBandwidths struct { - OfferName *string `json:"offerName,omitempty"` - ValueInGbps *int64 `json:"valueInGbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go b/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go deleted file mode 100644 index fa52c31306b..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocationPropertiesFormat struct { - Address *string `json:"address,omitempty"` - AvailableBandwidths *[]ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"` - Contact *string `json:"contact,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteportslocations/predicates.go b/resource-manager/network/2023-05-01/expressrouteportslocations/predicates.go deleted file mode 100644 index 3b345c2e1f5..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocationOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRoutePortsLocationOperationPredicate) Matches(input ExpressRoutePortsLocation) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/network/2023-05-01/expressrouteportslocations/version.go b/resource-manager/network/2023-05-01/expressrouteportslocations/version.go deleted file mode 100644 index e9024dcfbd4..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteportslocations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportslocations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportslocations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/README.md b/resource-manager/network/2023-05-01/expressrouteproviderports/README.md deleted file mode 100644 index 3c25b683246..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteproviderports` Documentation - -The `expressrouteproviderports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressrouteproviderports" -``` - - -### Client Initialization - -```go -client := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteProviderPortsClient.ExpressRouteProviderPort` - -```go -ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue") - -read, err := client.ExpressRouteProviderPort(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteProviderPortsClient.LocationList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.LocationList(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions())` can be used to do batched pagination -items, err := client.LocationListComplete(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/client.go b/resource-manager/network/2023-05-01/expressrouteproviderports/client.go deleted file mode 100644 index 696d17bbfd6..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteproviderports - -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 ExpressRouteProviderPortsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteProviderPortsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteProviderPortsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteproviderports", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteProviderPortsClient: %+v", err) - } - - return &ExpressRouteProviderPortsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport.go deleted file mode 100644 index 2e734bb82c3..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport.go +++ /dev/null @@ -1,121 +0,0 @@ -package expressrouteproviderports - -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(&ExpressRouteProviderPortId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteProviderPortId{} - -// ExpressRouteProviderPortId is a struct representing the Resource ID for a Express Route Provider Port -type ExpressRouteProviderPortId struct { - SubscriptionId string - ExpressRouteProviderPortName string -} - -// NewExpressRouteProviderPortID returns a new ExpressRouteProviderPortId struct -func NewExpressRouteProviderPortID(subscriptionId string, expressRouteProviderPortName string) ExpressRouteProviderPortId { - return ExpressRouteProviderPortId{ - SubscriptionId: subscriptionId, - ExpressRouteProviderPortName: expressRouteProviderPortName, - } -} - -// ParseExpressRouteProviderPortID parses 'input' into a ExpressRouteProviderPortId -func ParseExpressRouteProviderPortID(input string) (*ExpressRouteProviderPortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteProviderPortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteProviderPortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteProviderPortIDInsensitively parses 'input' case-insensitively into a ExpressRouteProviderPortId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteProviderPortIDInsensitively(input string) (*ExpressRouteProviderPortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteProviderPortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteProviderPortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteProviderPortId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ExpressRouteProviderPortName, ok = input.Parsed["expressRouteProviderPortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteProviderPortName", input) - } - - return nil -} - -// ValidateExpressRouteProviderPortID checks that 'input' can be parsed as a Express Route Provider Port ID -func ValidateExpressRouteProviderPortID(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 := ParseExpressRouteProviderPortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Provider Port ID -func (id ExpressRouteProviderPortId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/expressRouteProviderPorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ExpressRouteProviderPortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Provider Port ID -func (id ExpressRouteProviderPortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteProviderPorts", "expressRouteProviderPorts", "expressRouteProviderPorts"), - resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "expressRouteProviderPortValue"), - } -} - -// String returns a human-readable description of this Express Route Provider Port ID -func (id ExpressRouteProviderPortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Express Route Provider Port Name: %q", id.ExpressRouteProviderPortName), - } - return fmt.Sprintf("Express Route Provider Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport_test.go deleted file mode 100644 index 1c4f938991d..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/id_expressrouteproviderport_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package expressrouteproviderports - -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 = &ExpressRouteProviderPortId{} - -func TestNewExpressRouteProviderPortID(t *testing.T) { - id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue") - - 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.ExpressRouteProviderPortName != "expressRouteProviderPortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "expressRouteProviderPortValue") - } -} - -func TestFormatExpressRouteProviderPortID(t *testing.T) { - actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteProviderPortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteProviderPortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue", - Expected: &ExpressRouteProviderPortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "expressRouteProviderPortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteProviderPortID(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.ExpressRouteProviderPortName != v.Expected.ExpressRouteProviderPortName { - t.Fatalf("Expected %q but got %q for ExpressRouteProviderPortName", v.Expected.ExpressRouteProviderPortName, actual.ExpressRouteProviderPortName) - } - - } -} - -func TestParseExpressRouteProviderPortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteProviderPortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue", - Expected: &ExpressRouteProviderPortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "expressRouteProviderPortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTvAlUe", - Expected: &ExpressRouteProviderPortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "eXpReSsRoUtEpRoViDeRpOrTvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteProviderPortIDInsensitively(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.ExpressRouteProviderPortName != v.Expected.ExpressRouteProviderPortName { - t.Fatalf("Expected %q but got %q for ExpressRouteProviderPortName", v.Expected.ExpressRouteProviderPortName, actual.ExpressRouteProviderPortName) - } - - } -} - -func TestSegmentsForExpressRouteProviderPortId(t *testing.T) { - segments := ExpressRouteProviderPortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteProviderPortId 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/network/2023-05-01/expressrouteproviderports/method_expressrouteproviderport.go b/resource-manager/network/2023-05-01/expressrouteproviderports/method_expressrouteproviderport.go deleted file mode 100644 index 95cb93096c7..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/method_expressrouteproviderport.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteproviderports - -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 ExpressRouteProviderPortOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteProviderPort -} - -// ExpressRouteProviderPort ... -func (c ExpressRouteProviderPortsClient) ExpressRouteProviderPort(ctx context.Context, id ExpressRouteProviderPortId) (result ExpressRouteProviderPortOperationResponse, 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 ExpressRouteProviderPort - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/method_locationlist.go b/resource-manager/network/2023-05-01/expressrouteproviderports/method_locationlist.go deleted file mode 100644 index b96fb2b5dc9..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/method_locationlist.go +++ /dev/null @@ -1,120 +0,0 @@ -package expressrouteproviderports - -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 LocationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteProviderPort -} - -type LocationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteProviderPort -} - -type LocationListOperationOptions struct { - Filter *string -} - -func DefaultLocationListOperationOptions() LocationListOperationOptions { - return LocationListOperationOptions{} -} - -func (o LocationListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o LocationListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o LocationListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - return &out -} - -// LocationList ... -func (c ExpressRouteProviderPortsClient) LocationList(ctx context.Context, id commonids.SubscriptionId, options LocationListOperationOptions) (result LocationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteProviderPorts", id.ID()), - OptionsObject: options, - } - - 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 *[]ExpressRouteProviderPort `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LocationListComplete retrieves all the results into a single object -func (c ExpressRouteProviderPortsClient) LocationListComplete(ctx context.Context, id commonids.SubscriptionId, options LocationListOperationOptions) (LocationListCompleteResult, error) { - return c.LocationListCompleteMatchingPredicate(ctx, id, options, ExpressRouteProviderPortOperationPredicate{}) -} - -// LocationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteProviderPortsClient) LocationListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options LocationListOperationOptions, predicate ExpressRouteProviderPortOperationPredicate) (result LocationListCompleteResult, err error) { - items := make([]ExpressRouteProviderPort, 0) - - resp, err := c.LocationList(ctx, id, options) - if err != nil { - 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 = LocationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderport.go b/resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderport.go deleted file mode 100644 index 9bb3723c40e..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderport.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressrouteproviderports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteProviderPort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteProviderPortProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderportproperties.go b/resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderportproperties.go deleted file mode 100644 index d0a93ccf046..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/model_expressrouteproviderportproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressrouteproviderports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteProviderPortProperties struct { - OverprovisionFactor *int64 `json:"overprovisionFactor,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - PortBandwidthInMbps *int64 `json:"portBandwidthInMbps,omitempty"` - PortPairDescriptor *string `json:"portPairDescriptor,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - RemainingBandwidthInMbps *int64 `json:"remainingBandwidthInMbps,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - UsedBandwidthInMbps *int64 `json:"usedBandwidthInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteproviderports/predicates.go b/resource-manager/network/2023-05-01/expressrouteproviderports/predicates.go deleted file mode 100644 index ea48d5c374c..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressrouteproviderports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteProviderPortOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteProviderPortOperationPredicate) Matches(input ExpressRouteProviderPort) 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 && (input.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/network/2023-05-01/expressrouteproviderports/version.go b/resource-manager/network/2023-05-01/expressrouteproviderports/version.go deleted file mode 100644 index d0943209499..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteproviderports/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteproviderports - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteproviderports/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/README.md b/resource-manager/network/2023-05-01/expressrouteserviceproviders/README.md deleted file mode 100644 index 7b0d6aa801b..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/expressrouteserviceproviders` Documentation - -The `expressrouteserviceproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/expressrouteserviceproviders" -``` - - -### Client Initialization - -```go -client := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteServiceProvidersClient.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 -} -``` diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/client.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/client.go deleted file mode 100644 index d071b668e37..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteserviceproviders - -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 ExpressRouteServiceProvidersClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteServiceProvidersClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteServiceProvidersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteserviceproviders", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteServiceProvidersClient: %+v", err) - } - - return &ExpressRouteServiceProvidersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/constants.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/constants.go deleted file mode 100644 index 7e0b7b9a059..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package expressrouteserviceproviders - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/method_list.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/method_list.go deleted file mode 100644 index c53d4842f36..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteserviceproviders - -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 *[]ExpressRouteServiceProvider -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteServiceProvider -} - -// List ... -func (c ExpressRouteServiceProvidersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteServiceProviders", 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 *[]ExpressRouteServiceProvider `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 ExpressRouteServiceProvidersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteServiceProviderOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteServiceProvidersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteServiceProviderOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteServiceProvider, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go deleted file mode 100644 index 156136ef150..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProvider struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go deleted file mode 100644 index 72758b5e1d5..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProviderBandwidthsOffered struct { - OfferName *string `json:"offerName,omitempty"` - ValueInMbps *int64 `json:"valueInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go deleted file mode 100644 index e3c3cc178f9..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProviderPropertiesFormat struct { - BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` - PeeringLocations *[]string `json:"peeringLocations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/expressrouteserviceproviders/predicates.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/predicates.go deleted file mode 100644 index d2c605983d7..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProviderOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteServiceProviderOperationPredicate) Matches(input ExpressRouteServiceProvider) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/network/2023-05-01/expressrouteserviceproviders/version.go b/resource-manager/network/2023-05-01/expressrouteserviceproviders/version.go deleted file mode 100644 index 83f62ef19dc..00000000000 --- a/resource-manager/network/2023-05-01/expressrouteserviceproviders/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteserviceproviders - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteserviceproviders/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/README.md b/resource-manager/network/2023-05-01/firewallpolicies/README.md deleted file mode 100644 index 9140ef2ce1b..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/README.md +++ /dev/null @@ -1,237 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/firewallpolicies` Documentation - -The `firewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/firewallpolicies" -``` - - -### Client Initialization - -```go -client := firewallpolicies.NewFirewallPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.FirewallPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesFilterValuesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignatureOverridesFilterValuesQuery{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesFilterValuesList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.IDPSQueryObject{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesGet` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.FirewallPolicyIdpsSignaturesOverridesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.FirewallPolicyIdpsSignaturesOverridesList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPatch` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignaturesOverrides{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesOverridesPatch(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPut` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignaturesOverrides{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesOverridesPut(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.Get` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.Get(ctx, id, firewallpolicies.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `FirewallPoliciesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `FirewallPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.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/network/2023-05-01/firewallpolicies/client.go b/resource-manager/network/2023-05-01/firewallpolicies/client.go deleted file mode 100644 index a162ae7a1c4..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package firewallpolicies - -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 FirewallPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewFirewallPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*FirewallPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "firewallpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FirewallPoliciesClient: %+v", err) - } - - return &FirewallPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/constants.go b/resource-manager/network/2023-05-01/firewallpolicies/constants.go deleted file mode 100644 index 6a392fdaa9f..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/constants.go +++ /dev/null @@ -1,366 +0,0 @@ -package firewallpolicies - -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 AutoLearnPrivateRangesMode string - -const ( - AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" - AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" -) - -func PossibleValuesForAutoLearnPrivateRangesMode() []string { - return []string{ - string(AutoLearnPrivateRangesModeDisabled), - string(AutoLearnPrivateRangesModeEnabled), - } -} - -func (s *AutoLearnPrivateRangesMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutoLearnPrivateRangesMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutoLearnPrivateRangesMode(input string) (*AutoLearnPrivateRangesMode, error) { - vals := map[string]AutoLearnPrivateRangesMode{ - "disabled": AutoLearnPrivateRangesModeDisabled, - "enabled": AutoLearnPrivateRangesModeEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutoLearnPrivateRangesMode(input) - return &out, nil -} - -type AzureFirewallThreatIntelMode string - -const ( - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -func PossibleValuesForAzureFirewallThreatIntelMode() []string { - return []string{ - string(AzureFirewallThreatIntelModeAlert), - string(AzureFirewallThreatIntelModeDeny), - string(AzureFirewallThreatIntelModeOff), - } -} - -func (s *AzureFirewallThreatIntelMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallThreatIntelMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallThreatIntelMode(input string) (*AzureFirewallThreatIntelMode, error) { - vals := map[string]AzureFirewallThreatIntelMode{ - "alert": AzureFirewallThreatIntelModeAlert, - "deny": AzureFirewallThreatIntelModeDeny, - "off": AzureFirewallThreatIntelModeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallThreatIntelMode(input) - return &out, nil -} - -type FirewallPolicyIDPSQuerySortOrder string - -const ( - FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" - FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" -) - -func PossibleValuesForFirewallPolicyIDPSQuerySortOrder() []string { - return []string{ - string(FirewallPolicyIDPSQuerySortOrderAscending), - string(FirewallPolicyIDPSQuerySortOrderDescending), - } -} - -func (s *FirewallPolicyIDPSQuerySortOrder) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIDPSQuerySortOrder(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIDPSQuerySortOrder(input string) (*FirewallPolicyIDPSQuerySortOrder, error) { - vals := map[string]FirewallPolicyIDPSQuerySortOrder{ - "ascending": FirewallPolicyIDPSQuerySortOrderAscending, - "descending": FirewallPolicyIDPSQuerySortOrderDescending, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIDPSQuerySortOrder(input) - return &out, nil -} - -type FirewallPolicyIDPSSignatureDirection int64 - -const ( - FirewallPolicyIDPSSignatureDirectionOne FirewallPolicyIDPSSignatureDirection = 1 - FirewallPolicyIDPSSignatureDirectionTwo FirewallPolicyIDPSSignatureDirection = 2 - FirewallPolicyIDPSSignatureDirectionZero FirewallPolicyIDPSSignatureDirection = 0 -) - -func PossibleValuesForFirewallPolicyIDPSSignatureDirection() []int64 { - return []int64{ - int64(FirewallPolicyIDPSSignatureDirectionOne), - int64(FirewallPolicyIDPSSignatureDirectionTwo), - int64(FirewallPolicyIDPSSignatureDirectionZero), - } -} - -type FirewallPolicyIDPSSignatureMode int64 - -const ( - FirewallPolicyIDPSSignatureModeOne FirewallPolicyIDPSSignatureMode = 1 - FirewallPolicyIDPSSignatureModeTwo FirewallPolicyIDPSSignatureMode = 2 - FirewallPolicyIDPSSignatureModeZero FirewallPolicyIDPSSignatureMode = 0 -) - -func PossibleValuesForFirewallPolicyIDPSSignatureMode() []int64 { - return []int64{ - int64(FirewallPolicyIDPSSignatureModeOne), - int64(FirewallPolicyIDPSSignatureModeTwo), - int64(FirewallPolicyIDPSSignatureModeZero), - } -} - -type FirewallPolicyIDPSSignatureSeverity int64 - -const ( - FirewallPolicyIDPSSignatureSeverityOne FirewallPolicyIDPSSignatureSeverity = 1 - FirewallPolicyIDPSSignatureSeverityThree FirewallPolicyIDPSSignatureSeverity = 3 - FirewallPolicyIDPSSignatureSeverityTwo FirewallPolicyIDPSSignatureSeverity = 2 -) - -func PossibleValuesForFirewallPolicyIDPSSignatureSeverity() []int64 { - return []int64{ - int64(FirewallPolicyIDPSSignatureSeverityOne), - int64(FirewallPolicyIDPSSignatureSeverityThree), - int64(FirewallPolicyIDPSSignatureSeverityTwo), - } -} - -type FirewallPolicyIntrusionDetectionProtocol string - -const ( - FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" - FirewallPolicyIntrusionDetectionProtocolICMP FirewallPolicyIntrusionDetectionProtocol = "ICMP" - FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" - FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" -) - -func PossibleValuesForFirewallPolicyIntrusionDetectionProtocol() []string { - return []string{ - string(FirewallPolicyIntrusionDetectionProtocolANY), - string(FirewallPolicyIntrusionDetectionProtocolICMP), - string(FirewallPolicyIntrusionDetectionProtocolTCP), - string(FirewallPolicyIntrusionDetectionProtocolUDP), - } -} - -func (s *FirewallPolicyIntrusionDetectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIntrusionDetectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIntrusionDetectionProtocol(input string) (*FirewallPolicyIntrusionDetectionProtocol, error) { - vals := map[string]FirewallPolicyIntrusionDetectionProtocol{ - "any": FirewallPolicyIntrusionDetectionProtocolANY, - "icmp": FirewallPolicyIntrusionDetectionProtocolICMP, - "tcp": FirewallPolicyIntrusionDetectionProtocolTCP, - "udp": FirewallPolicyIntrusionDetectionProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIntrusionDetectionProtocol(input) - return &out, nil -} - -type FirewallPolicyIntrusionDetectionStateType string - -const ( - FirewallPolicyIntrusionDetectionStateTypeAlert FirewallPolicyIntrusionDetectionStateType = "Alert" - FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" - FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" -) - -func PossibleValuesForFirewallPolicyIntrusionDetectionStateType() []string { - return []string{ - string(FirewallPolicyIntrusionDetectionStateTypeAlert), - string(FirewallPolicyIntrusionDetectionStateTypeDeny), - string(FirewallPolicyIntrusionDetectionStateTypeOff), - } -} - -func (s *FirewallPolicyIntrusionDetectionStateType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIntrusionDetectionStateType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIntrusionDetectionStateType(input string) (*FirewallPolicyIntrusionDetectionStateType, error) { - vals := map[string]FirewallPolicyIntrusionDetectionStateType{ - "alert": FirewallPolicyIntrusionDetectionStateTypeAlert, - "deny": FirewallPolicyIntrusionDetectionStateTypeDeny, - "off": FirewallPolicyIntrusionDetectionStateTypeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIntrusionDetectionStateType(input) - return &out, nil -} - -type FirewallPolicySkuTier string - -const ( - FirewallPolicySkuTierBasic FirewallPolicySkuTier = "Basic" - FirewallPolicySkuTierPremium FirewallPolicySkuTier = "Premium" - FirewallPolicySkuTierStandard FirewallPolicySkuTier = "Standard" -) - -func PossibleValuesForFirewallPolicySkuTier() []string { - return []string{ - string(FirewallPolicySkuTierBasic), - string(FirewallPolicySkuTierPremium), - string(FirewallPolicySkuTierStandard), - } -} - -func (s *FirewallPolicySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicySkuTier(input string) (*FirewallPolicySkuTier, error) { - vals := map[string]FirewallPolicySkuTier{ - "basic": FirewallPolicySkuTierBasic, - "premium": FirewallPolicySkuTierPremium, - "standard": FirewallPolicySkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicySkuTier(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy.go b/resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy.go deleted file mode 100644 index b3ab374101c..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package firewallpolicies - -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(&FirewallPolicyId{}) -} - -var _ resourceids.ResourceId = &FirewallPolicyId{} - -// FirewallPolicyId is a struct representing the Resource ID for a Firewall Policy -type FirewallPolicyId struct { - SubscriptionId string - ResourceGroupName string - FirewallPolicyName string -} - -// NewFirewallPolicyID returns a new FirewallPolicyId struct -func NewFirewallPolicyID(subscriptionId string, resourceGroupName string, firewallPolicyName string) FirewallPolicyId { - return FirewallPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FirewallPolicyName: firewallPolicyName, - } -} - -// ParseFirewallPolicyID parses 'input' into a FirewallPolicyId -func ParseFirewallPolicyID(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFirewallPolicyIDInsensitively parses 'input' case-insensitively into a FirewallPolicyId -// note: this method should only be used for API response data and not user input -func ParseFirewallPolicyIDInsensitively(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FirewallPolicyId) 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.FirewallPolicyName, ok = input.Parsed["firewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallPolicyName", input) - } - - return nil -} - -// ValidateFirewallPolicyID checks that 'input' can be parsed as a Firewall Policy ID -func ValidateFirewallPolicyID(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 := ParseFirewallPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Firewall Policy ID -func (id FirewallPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/firewallPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FirewallPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Firewall Policy ID -func (id FirewallPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticFirewallPolicies", "firewallPolicies", "firewallPolicies"), - resourceids.UserSpecifiedSegment("firewallPolicyName", "firewallPolicyValue"), - } -} - -// String returns a human-readable description of this Firewall Policy ID -func (id FirewallPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Firewall Policy Name: %q", id.FirewallPolicyName), - } - return fmt.Sprintf("Firewall Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy_test.go b/resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy_test.go deleted file mode 100644 index ef55791e4fc..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/id_firewallpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package firewallpolicies - -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 = &FirewallPolicyId{} - -func TestNewFirewallPolicyID(t *testing.T) { - id := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - - 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.FirewallPolicyName != "firewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallPolicyName'", id.FirewallPolicyName, "firewallPolicyValue") - } -} - -func TestFormatFirewallPolicyID(t *testing.T) { - actual := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFirewallPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyID(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestParseFirewallPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FirewallPolicyName: "fIrEwAlLpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyIDInsensitively(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestSegmentsForFirewallPolicyId(t *testing.T) { - segments := FirewallPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FirewallPolicyId 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/network/2023-05-01/firewallpolicies/method_createorupdate.go b/resource-manager/network/2023-05-01/firewallpolicies/method_createorupdate.go deleted file mode 100644 index 0492bbef61e..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package firewallpolicies - -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 *FirewallPolicy -} - -// CreateOrUpdate ... -func (c FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, id FirewallPolicyId, input FirewallPolicy) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FirewallPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id FirewallPolicyId, input FirewallPolicy) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/firewallpolicies/method_delete.go b/resource-manager/network/2023-05-01/firewallpolicies/method_delete.go deleted file mode 100644 index 432932fda66..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package firewallpolicies - -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 FirewallPoliciesClient) Delete(ctx context.Context, id FirewallPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 FirewallPoliciesClient) DeleteThenPoll(ctx context.Context, id FirewallPolicyId) 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/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go b/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go deleted file mode 100644 index e13bba542e4..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesFilterValuesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignatureOverridesFilterValuesResponse -} - -// FirewallPolicyIdpsSignaturesFilterValuesList ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesFilterValuesList(ctx context.Context, id FirewallPolicyId, input SignatureOverridesFilterValuesQuery) (result FirewallPolicyIdpsSignaturesFilterValuesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listIdpsFilterOptions", 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 SignatureOverridesFilterValuesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go b/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go deleted file mode 100644 index 3317a5b3046..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *QueryResults -} - -// FirewallPolicyIdpsSignaturesList ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesList(ctx context.Context, id FirewallPolicyId, input IDPSQueryObject) (result FirewallPolicyIdpsSignaturesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listIdpsSignatures", 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 QueryResults - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go b/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go deleted file mode 100644 index 0a494459f55..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go +++ /dev/null @@ -1,55 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesGet ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesGet(ctx context.Context, id FirewallPolicyId) (result FirewallPolicyIdpsSignaturesOverridesGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/signatureOverrides/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 SignaturesOverrides - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go b/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go deleted file mode 100644 index 0fb145a6c0c..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverridesList -} - -// FirewallPolicyIdpsSignaturesOverridesList ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesList(ctx context.Context, id FirewallPolicyId) (result FirewallPolicyIdpsSignaturesOverridesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/signatureOverrides", 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 SignaturesOverridesList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go b/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go deleted file mode 100644 index 99eb2fc1d38..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesPatchOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesPatch ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesPatch(ctx context.Context, id FirewallPolicyId, input SignaturesOverrides) (result FirewallPolicyIdpsSignaturesOverridesPatchOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/signatureOverrides/default", 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 SignaturesOverrides - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go b/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go deleted file mode 100644 index 2b131f1a401..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesPutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesPut ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesPut(ctx context.Context, id FirewallPolicyId, input SignaturesOverrides) (result FirewallPolicyIdpsSignaturesOverridesPutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/signatureOverrides/default", 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 SignaturesOverrides - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_get.go b/resource-manager/network/2023-05-01/firewallpolicies/method_get.go deleted file mode 100644 index 6d04656e020..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package firewallpolicies - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FirewallPolicy -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c FirewallPoliciesClient) Get(ctx context.Context, id FirewallPolicyId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 FirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_list.go b/resource-manager/network/2023-05-01/firewallpolicies/method_list.go deleted file mode 100644 index 1ae7b3c4431..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package firewallpolicies - -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 *[]FirewallPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FirewallPolicy -} - -// List ... -func (c FirewallPoliciesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/firewallPolicies", 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 *[]FirewallPolicy `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 FirewallPoliciesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FirewallPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FirewallPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate FirewallPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FirewallPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/firewallpolicies/method_listall.go b/resource-manager/network/2023-05-01/firewallpolicies/method_listall.go deleted file mode 100644 index 146af1a313f..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package firewallpolicies - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FirewallPolicy -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []FirewallPolicy -} - -// ListAll ... -func (c FirewallPoliciesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/firewallPolicies", 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 *[]FirewallPolicy `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c FirewallPoliciesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, FirewallPolicyOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FirewallPoliciesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate FirewallPolicyOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]FirewallPolicy, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/method_updatetags.go b/resource-manager/network/2023-05-01/firewallpolicies/method_updatetags.go deleted file mode 100644 index 05b103ecce7..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package firewallpolicies - -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 *FirewallPolicy -} - -// UpdateTags ... -func (c FirewallPoliciesClient) UpdateTags(ctx context.Context, id FirewallPolicyId, 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 FirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_dnssettings.go b/resource-manager/network/2023-05-01/firewallpolicies/model_dnssettings.go deleted file mode 100644 index 6983f66f9dd..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_dnssettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsSettings struct { - EnableProxy *bool `json:"enableProxy,omitempty"` - RequireProxyForNetworkRules *bool `json:"requireProxyForNetworkRules,omitempty"` - Servers *[]string `json:"servers,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_explicitproxy.go b/resource-manager/network/2023-05-01/firewallpolicies/model_explicitproxy.go deleted file mode 100644 index d8af7221ddf..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_explicitproxy.go +++ /dev/null @@ -1,13 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExplicitProxy struct { - EnableExplicitProxy *bool `json:"enableExplicitProxy,omitempty"` - EnablePacFile *bool `json:"enablePacFile,omitempty"` - HTTPPort *int64 `json:"httpPort,omitempty"` - HTTPSPort *int64 `json:"httpsPort,omitempty"` - PacFile *string `json:"pacFile,omitempty"` - PacFilePort *int64 `json:"pacFilePort,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_filteritems.go b/resource-manager/network/2023-05-01/firewallpolicies/model_filteritems.go deleted file mode 100644 index 943657d23f0..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_filteritems.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FilterItems struct { - Field *string `json:"field,omitempty"` - Values *[]string `json:"values,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicy.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicy.go deleted file mode 100644 index fb85165c9d9..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicy.go +++ /dev/null @@ -1,19 +0,0 @@ -package firewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FirewallPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicycertificateauthority.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicycertificateauthority.go deleted file mode 100644 index b1d1e5fcdd8..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicycertificateauthority.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyCertificateAuthority struct { - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyinsights.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyinsights.go deleted file mode 100644 index 5af7b2e446d..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyinsights.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyInsights struct { - IsEnabled *bool `json:"isEnabled,omitempty"` - LogAnalyticsResources *FirewallPolicyLogAnalyticsResources `json:"logAnalyticsResources,omitempty"` - RetentionDays *int64 `json:"retentionDays,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetection.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetection.go deleted file mode 100644 index eac1fe0da0f..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetection.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetection struct { - Configuration *FirewallPolicyIntrusionDetectionConfiguration `json:"configuration,omitempty"` - Mode *FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go deleted file mode 100644 index 088a6c5515f..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go +++ /dev/null @@ -1,15 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications struct { - Description *string `json:"description,omitempty"` - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Name *string `json:"name,omitempty"` - Protocol *FirewallPolicyIntrusionDetectionProtocol `json:"protocol,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go deleted file mode 100644 index dce919867c0..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetectionConfiguration struct { - BypassTrafficSettings *[]FirewallPolicyIntrusionDetectionBypassTrafficSpecifications `json:"bypassTrafficSettings,omitempty"` - PrivateRanges *[]string `json:"privateRanges,omitempty"` - SignatureOverrides *[]FirewallPolicyIntrusionDetectionSignatureSpecification `json:"signatureOverrides,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go deleted file mode 100644 index 2bae7fe0f04..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetectionSignatureSpecification struct { - Id *string `json:"id,omitempty"` - Mode *FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go deleted file mode 100644 index 4f1280d942b..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyLogAnalyticsResources struct { - DefaultWorkspaceId *SubResource `json:"defaultWorkspaceId,omitempty"` - Workspaces *[]FirewallPolicyLogAnalyticsWorkspace `json:"workspaces,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go deleted file mode 100644 index 4cc72aa7cbb..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyLogAnalyticsWorkspace struct { - Region *string `json:"region,omitempty"` - WorkspaceId *SubResource `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicypropertiesformat.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicypropertiesformat.go deleted file mode 100644 index b439737323d..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicypropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyPropertiesFormat struct { - BasePolicy *SubResource `json:"basePolicy,omitempty"` - ChildPolicies *[]SubResource `json:"childPolicies,omitempty"` - DnsSettings *DnsSettings `json:"dnsSettings,omitempty"` - ExplicitProxy *ExplicitProxy `json:"explicitProxy,omitempty"` - Firewalls *[]SubResource `json:"firewalls,omitempty"` - Insights *FirewallPolicyInsights `json:"insights,omitempty"` - IntrusionDetection *FirewallPolicyIntrusionDetection `json:"intrusionDetection,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleCollectionGroups *[]SubResource `json:"ruleCollectionGroups,omitempty"` - Size *string `json:"size,omitempty"` - Sku *FirewallPolicySku `json:"sku,omitempty"` - Snat *FirewallPolicySNAT `json:"snat,omitempty"` - Sql *FirewallPolicySQL `json:"sql,omitempty"` - ThreatIntelMode *AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"` - TransportSecurity *FirewallPolicyTransportSecurity `json:"transportSecurity,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysku.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysku.go deleted file mode 100644 index 6c0cef08260..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicySku struct { - Tier *FirewallPolicySkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysnat.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysnat.go deleted file mode 100644 index 33dcf12744e..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysnat.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicySNAT struct { - AutoLearnPrivateRanges *AutoLearnPrivateRangesMode `json:"autoLearnPrivateRanges,omitempty"` - PrivateRanges *[]string `json:"privateRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysql.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysql.go deleted file mode 100644 index 32e50565577..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicysql.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicySQL struct { - AllowSqlRedirect *bool `json:"allowSqlRedirect,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go deleted file mode 100644 index 376fba1c268..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyThreatIntelWhitelist struct { - Fqdns *[]string `json:"fqdns,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicytransportsecurity.go b/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicytransportsecurity.go deleted file mode 100644 index 9fdbf9b4877..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_firewallpolicytransportsecurity.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyTransportSecurity struct { - CertificateAuthority *FirewallPolicyCertificateAuthority `json:"certificateAuthority,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_idpsqueryobject.go b/resource-manager/network/2023-05-01/firewallpolicies/model_idpsqueryobject.go deleted file mode 100644 index 3a1aca509b6..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_idpsqueryobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IDPSQueryObject struct { - Filters *[]FilterItems `json:"filters,omitempty"` - OrderBy *OrderBy `json:"orderBy,omitempty"` - ResultsPerPage *int64 `json:"resultsPerPage,omitempty"` - Search *string `json:"search,omitempty"` - Skip *int64 `json:"skip,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_orderby.go b/resource-manager/network/2023-05-01/firewallpolicies/model_orderby.go deleted file mode 100644 index db1d05e4478..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_orderby.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OrderBy struct { - Field *string `json:"field,omitempty"` - Order *FirewallPolicyIDPSQuerySortOrder `json:"order,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_queryresults.go b/resource-manager/network/2023-05-01/firewallpolicies/model_queryresults.go deleted file mode 100644 index 4c0591a2f83..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_queryresults.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryResults struct { - MatchingRecordsCount *int64 `json:"matchingRecordsCount,omitempty"` - Signatures *[]SingleQueryResult `json:"signatures,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go b/resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go deleted file mode 100644 index 718d141e3c0..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignatureOverridesFilterValuesQuery struct { - FilterName *string `json:"filterName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go b/resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go deleted file mode 100644 index 4b135d882ba..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignatureOverridesFilterValuesResponse struct { - FilterValues *[]string `json:"filterValues,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrides.go b/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrides.go deleted file mode 100644 index 2f1b84510c9..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrides.go +++ /dev/null @@ -1,11 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignaturesOverrides struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SignaturesOverridesProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrideslist.go b/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrideslist.go deleted file mode 100644 index d403a4eb590..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverrideslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignaturesOverridesList struct { - Value *[]SignaturesOverrides `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverridesproperties.go b/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverridesproperties.go deleted file mode 100644 index a93d8699c02..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_signaturesoverridesproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignaturesOverridesProperties struct { - Signatures *map[string]string `json:"signatures,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_singlequeryresult.go b/resource-manager/network/2023-05-01/firewallpolicies/model_singlequeryresult.go deleted file mode 100644 index cbf78585e56..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_singlequeryresult.go +++ /dev/null @@ -1,18 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SingleQueryResult struct { - Description *string `json:"description,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Direction *FirewallPolicyIDPSSignatureDirection `json:"direction,omitempty"` - Group *string `json:"group,omitempty"` - InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Mode *FirewallPolicyIDPSSignatureMode `json:"mode,omitempty"` - Protocol *string `json:"protocol,omitempty"` - Severity *FirewallPolicyIDPSSignatureSeverity `json:"severity,omitempty"` - SignatureId *int64 `json:"signatureId,omitempty"` - SourcePorts *[]string `json:"sourcePorts,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_subresource.go b/resource-manager/network/2023-05-01/firewallpolicies/model_subresource.go deleted file mode 100644 index abee9f81d03..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicies/model_tagsobject.go b/resource-manager/network/2023-05-01/firewallpolicies/model_tagsobject.go deleted file mode 100644 index 22cc23110be..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// 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/network/2023-05-01/firewallpolicies/predicates.go b/resource-manager/network/2023-05-01/firewallpolicies/predicates.go deleted file mode 100644 index 2640042ba7a..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p FirewallPolicyOperationPredicate) Matches(input FirewallPolicy) 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 && (input.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/network/2023-05-01/firewallpolicies/version.go b/resource-manager/network/2023-05-01/firewallpolicies/version.go deleted file mode 100644 index ad9019c166c..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/README.md b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/README.md deleted file mode 100644 index 5d0f582347d..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups` Documentation - -The `firewallpolicyrulecollectiongroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/firewallpolicyrulecollectiongroups" -``` - - -### Client Initialization - -```go -client := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -payload := firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Delete` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Get` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -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: `FirewallPolicyRuleCollectionGroupsClient.List` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -// 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/network/2023-05-01/firewallpolicyrulecollectiongroups/client.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/client.go deleted file mode 100644 index ef562ceb4a0..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRuleCollectionGroupsClient struct { - Client *resourcemanager.Client -} - -func NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*FirewallPolicyRuleCollectionGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "firewallpolicyrulecollectiongroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FirewallPolicyRuleCollectionGroupsClient: %+v", err) - } - - return &FirewallPolicyRuleCollectionGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/constants.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/constants.go deleted file mode 100644 index 73fd6902a8b..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/constants.go +++ /dev/null @@ -1,309 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyFilterRuleCollectionActionType string - -const ( - FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" - FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" -) - -func PossibleValuesForFirewallPolicyFilterRuleCollectionActionType() []string { - return []string{ - string(FirewallPolicyFilterRuleCollectionActionTypeAllow), - string(FirewallPolicyFilterRuleCollectionActionTypeDeny), - } -} - -func (s *FirewallPolicyFilterRuleCollectionActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyFilterRuleCollectionActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyFilterRuleCollectionActionType(input string) (*FirewallPolicyFilterRuleCollectionActionType, error) { - vals := map[string]FirewallPolicyFilterRuleCollectionActionType{ - "allow": FirewallPolicyFilterRuleCollectionActionTypeAllow, - "deny": FirewallPolicyFilterRuleCollectionActionTypeDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyFilterRuleCollectionActionType(input) - return &out, nil -} - -type FirewallPolicyNatRuleCollectionActionType string - -const ( - FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" -) - -func PossibleValuesForFirewallPolicyNatRuleCollectionActionType() []string { - return []string{ - string(FirewallPolicyNatRuleCollectionActionTypeDNAT), - } -} - -func (s *FirewallPolicyNatRuleCollectionActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyNatRuleCollectionActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyNatRuleCollectionActionType(input string) (*FirewallPolicyNatRuleCollectionActionType, error) { - vals := map[string]FirewallPolicyNatRuleCollectionActionType{ - "dnat": FirewallPolicyNatRuleCollectionActionTypeDNAT, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyNatRuleCollectionActionType(input) - return &out, nil -} - -type FirewallPolicyRuleApplicationProtocolType string - -const ( - FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" - FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" -) - -func PossibleValuesForFirewallPolicyRuleApplicationProtocolType() []string { - return []string{ - string(FirewallPolicyRuleApplicationProtocolTypeHTTP), - string(FirewallPolicyRuleApplicationProtocolTypeHTTPS), - } -} - -func (s *FirewallPolicyRuleApplicationProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleApplicationProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleApplicationProtocolType(input string) (*FirewallPolicyRuleApplicationProtocolType, error) { - vals := map[string]FirewallPolicyRuleApplicationProtocolType{ - "http": FirewallPolicyRuleApplicationProtocolTypeHTTP, - "https": FirewallPolicyRuleApplicationProtocolTypeHTTPS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleApplicationProtocolType(input) - return &out, nil -} - -type FirewallPolicyRuleCollectionType string - -const ( - FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyFilterRuleCollection" - FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyNatRuleCollection" -) - -func PossibleValuesForFirewallPolicyRuleCollectionType() []string { - return []string{ - string(FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - string(FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - } -} - -func (s *FirewallPolicyRuleCollectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleCollectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleCollectionType(input string) (*FirewallPolicyRuleCollectionType, error) { - vals := map[string]FirewallPolicyRuleCollectionType{ - "firewallpolicyfilterrulecollection": FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection, - "firewallpolicynatrulecollection": FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleCollectionType(input) - return &out, nil -} - -type FirewallPolicyRuleNetworkProtocol string - -const ( - FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" - FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" - FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" - FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" -) - -func PossibleValuesForFirewallPolicyRuleNetworkProtocol() []string { - return []string{ - string(FirewallPolicyRuleNetworkProtocolAny), - string(FirewallPolicyRuleNetworkProtocolICMP), - string(FirewallPolicyRuleNetworkProtocolTCP), - string(FirewallPolicyRuleNetworkProtocolUDP), - } -} - -func (s *FirewallPolicyRuleNetworkProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleNetworkProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleNetworkProtocol(input string) (*FirewallPolicyRuleNetworkProtocol, error) { - vals := map[string]FirewallPolicyRuleNetworkProtocol{ - "any": FirewallPolicyRuleNetworkProtocolAny, - "icmp": FirewallPolicyRuleNetworkProtocolICMP, - "tcp": FirewallPolicyRuleNetworkProtocolTCP, - "udp": FirewallPolicyRuleNetworkProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleNetworkProtocol(input) - return &out, nil -} - -type FirewallPolicyRuleType string - -const ( - FirewallPolicyRuleTypeApplicationRule FirewallPolicyRuleType = "ApplicationRule" - FirewallPolicyRuleTypeNatRule FirewallPolicyRuleType = "NatRule" - FirewallPolicyRuleTypeNetworkRule FirewallPolicyRuleType = "NetworkRule" -) - -func PossibleValuesForFirewallPolicyRuleType() []string { - return []string{ - string(FirewallPolicyRuleTypeApplicationRule), - string(FirewallPolicyRuleTypeNatRule), - string(FirewallPolicyRuleTypeNetworkRule), - } -} - -func (s *FirewallPolicyRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleType(input string) (*FirewallPolicyRuleType, error) { - vals := map[string]FirewallPolicyRuleType{ - "applicationrule": FirewallPolicyRuleTypeApplicationRule, - "natrule": FirewallPolicyRuleTypeNatRule, - "networkrule": FirewallPolicyRuleTypeNetworkRule, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go deleted file mode 100644 index 9a3d14e2193..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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(&FirewallPolicyId{}) -} - -var _ resourceids.ResourceId = &FirewallPolicyId{} - -// FirewallPolicyId is a struct representing the Resource ID for a Firewall Policy -type FirewallPolicyId struct { - SubscriptionId string - ResourceGroupName string - FirewallPolicyName string -} - -// NewFirewallPolicyID returns a new FirewallPolicyId struct -func NewFirewallPolicyID(subscriptionId string, resourceGroupName string, firewallPolicyName string) FirewallPolicyId { - return FirewallPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FirewallPolicyName: firewallPolicyName, - } -} - -// ParseFirewallPolicyID parses 'input' into a FirewallPolicyId -func ParseFirewallPolicyID(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFirewallPolicyIDInsensitively parses 'input' case-insensitively into a FirewallPolicyId -// note: this method should only be used for API response data and not user input -func ParseFirewallPolicyIDInsensitively(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FirewallPolicyId) 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.FirewallPolicyName, ok = input.Parsed["firewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallPolicyName", input) - } - - return nil -} - -// ValidateFirewallPolicyID checks that 'input' can be parsed as a Firewall Policy ID -func ValidateFirewallPolicyID(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 := ParseFirewallPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Firewall Policy ID -func (id FirewallPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/firewallPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FirewallPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Firewall Policy ID -func (id FirewallPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticFirewallPolicies", "firewallPolicies", "firewallPolicies"), - resourceids.UserSpecifiedSegment("firewallPolicyName", "firewallPolicyValue"), - } -} - -// String returns a human-readable description of this Firewall Policy ID -func (id FirewallPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Firewall Policy Name: %q", id.FirewallPolicyName), - } - return fmt.Sprintf("Firewall Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go deleted file mode 100644 index d44f67c1a8e..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 = &FirewallPolicyId{} - -func TestNewFirewallPolicyID(t *testing.T) { - id := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - - 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.FirewallPolicyName != "firewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallPolicyName'", id.FirewallPolicyName, "firewallPolicyValue") - } -} - -func TestFormatFirewallPolicyID(t *testing.T) { - actual := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFirewallPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyID(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestParseFirewallPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FirewallPolicyName: "fIrEwAlLpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyIDInsensitively(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestSegmentsForFirewallPolicyId(t *testing.T) { - segments := FirewallPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FirewallPolicyId 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/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go deleted file mode 100644 index 5af7b6ffe79..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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(&RuleCollectionGroupId{}) -} - -var _ resourceids.ResourceId = &RuleCollectionGroupId{} - -// RuleCollectionGroupId is a struct representing the Resource ID for a Rule Collection Group -type RuleCollectionGroupId struct { - SubscriptionId string - ResourceGroupName string - FirewallPolicyName string - RuleCollectionGroupName string -} - -// NewRuleCollectionGroupID returns a new RuleCollectionGroupId struct -func NewRuleCollectionGroupID(subscriptionId string, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) RuleCollectionGroupId { - return RuleCollectionGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FirewallPolicyName: firewallPolicyName, - RuleCollectionGroupName: ruleCollectionGroupName, - } -} - -// ParseRuleCollectionGroupID parses 'input' into a RuleCollectionGroupId -func ParseRuleCollectionGroupID(input string) (*RuleCollectionGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleCollectionGroupIDInsensitively parses 'input' case-insensitively into a RuleCollectionGroupId -// note: this method should only be used for API response data and not user input -func ParseRuleCollectionGroupIDInsensitively(input string) (*RuleCollectionGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleCollectionGroupId) 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.FirewallPolicyName, ok = input.Parsed["firewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallPolicyName", input) - } - - if id.RuleCollectionGroupName, ok = input.Parsed["ruleCollectionGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionGroupName", input) - } - - return nil -} - -// ValidateRuleCollectionGroupID checks that 'input' can be parsed as a Rule Collection Group ID -func ValidateRuleCollectionGroupID(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 := ParseRuleCollectionGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule Collection Group ID -func (id RuleCollectionGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/firewallPolicies/%s/ruleCollectionGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FirewallPolicyName, id.RuleCollectionGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule Collection Group ID -func (id RuleCollectionGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticFirewallPolicies", "firewallPolicies", "firewallPolicies"), - resourceids.UserSpecifiedSegment("firewallPolicyName", "firewallPolicyValue"), - resourceids.StaticSegment("staticRuleCollectionGroups", "ruleCollectionGroups", "ruleCollectionGroups"), - resourceids.UserSpecifiedSegment("ruleCollectionGroupName", "ruleCollectionGroupValue"), - } -} - -// String returns a human-readable description of this Rule Collection Group ID -func (id RuleCollectionGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Firewall Policy Name: %q", id.FirewallPolicyName), - fmt.Sprintf("Rule Collection Group Name: %q", id.RuleCollectionGroupName), - } - return fmt.Sprintf("Rule Collection Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go deleted file mode 100644 index fc951be50ba..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 = &RuleCollectionGroupId{} - -func TestNewRuleCollectionGroupID(t *testing.T) { - id := NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - - 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.FirewallPolicyName != "firewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallPolicyName'", id.FirewallPolicyName, "firewallPolicyValue") - } - - if id.RuleCollectionGroupName != "ruleCollectionGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionGroupName'", id.RuleCollectionGroupName, "ruleCollectionGroupValue") - } -} - -func TestFormatRuleCollectionGroupID(t *testing.T) { - actual := NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleCollectionGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue", - Expected: &RuleCollectionGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - RuleCollectionGroupName: "ruleCollectionGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionGroupID(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - if actual.RuleCollectionGroupName != v.Expected.RuleCollectionGroupName { - t.Fatalf("Expected %q but got %q for RuleCollectionGroupName", v.Expected.RuleCollectionGroupName, actual.RuleCollectionGroupName) - } - - } -} - -func TestParseRuleCollectionGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/rUlEcOlLeCtIoNgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue", - Expected: &RuleCollectionGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - RuleCollectionGroupName: "ruleCollectionGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/rUlEcOlLeCtIoNgRoUpS/rUlEcOlLeCtIoNgRoUpVaLuE", - Expected: &RuleCollectionGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FirewallPolicyName: "fIrEwAlLpOlIcYvAlUe", - RuleCollectionGroupName: "rUlEcOlLeCtIoNgRoUpVaLuE", - }, - }, - { - // 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.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/rUlEcOlLeCtIoNgRoUpS/rUlEcOlLeCtIoNgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionGroupIDInsensitively(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - if actual.RuleCollectionGroupName != v.Expected.RuleCollectionGroupName { - t.Fatalf("Expected %q but got %q for RuleCollectionGroupName", v.Expected.RuleCollectionGroupName, actual.RuleCollectionGroupName) - } - - } -} - -func TestSegmentsForRuleCollectionGroupId(t *testing.T) { - segments := RuleCollectionGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleCollectionGroupId 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/network/2023-05-01/firewallpolicyrulecollectiongroups/method_createorupdate.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_createorupdate.go deleted file mode 100644 index b067734262c..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 *FirewallPolicyRuleCollectionGroup -} - -// CreateOrUpdate ... -func (c FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdate(ctx context.Context, id RuleCollectionGroupId, input FirewallPolicyRuleCollectionGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id RuleCollectionGroupId, input FirewallPolicyRuleCollectionGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/firewallpolicyrulecollectiongroups/method_delete.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_delete.go deleted file mode 100644 index 159bb061b84..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRuleCollectionGroupsClient) Delete(ctx context.Context, id RuleCollectionGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 FirewallPolicyRuleCollectionGroupsClient) DeleteThenPoll(ctx context.Context, id RuleCollectionGroupId) 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/network/2023-05-01/firewallpolicyrulecollectiongroups/method_get.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_get.go deleted file mode 100644 index 9c1602d7177..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 *FirewallPolicyRuleCollectionGroup -} - -// Get ... -func (c FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, id RuleCollectionGroupId) (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 FirewallPolicyRuleCollectionGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_list.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_list.go deleted file mode 100644 index d873a974633..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 *[]FirewallPolicyRuleCollectionGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FirewallPolicyRuleCollectionGroup -} - -// List ... -func (c FirewallPolicyRuleCollectionGroupsClient) List(ctx context.Context, id FirewallPolicyId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ruleCollectionGroups", 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 *[]FirewallPolicyRuleCollectionGroup `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 FirewallPolicyRuleCollectionGroupsClient) ListComplete(ctx context.Context, id FirewallPolicyId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FirewallPolicyRuleCollectionGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FirewallPolicyRuleCollectionGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id FirewallPolicyId, predicate FirewallPolicyRuleCollectionGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FirewallPolicyRuleCollectionGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_applicationrule.go deleted file mode 100644 index 3e2815413ed..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ /dev/null @@ -1,52 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = ApplicationRule{} - -type ApplicationRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - FqdnTags *[]string `json:"fqdnTags,omitempty"` - HTTPHeadersToInsert *[]FirewallPolicyHTTPHeaderToInsert `json:"httpHeadersToInsert,omitempty"` - Protocols *[]FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` - TerminateTLS *bool `json:"terminateTLS,omitempty"` - WebCategories *[]string `json:"webCategories,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = ApplicationRule{} - -func (s ApplicationRule) MarshalJSON() ([]byte, error) { - type wrapper ApplicationRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ApplicationRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ApplicationRule: %+v", err) - } - decoded["ruleType"] = "ApplicationRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ApplicationRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go deleted file mode 100644 index 6e9762da492..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go +++ /dev/null @@ -1,81 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRuleCollection = FirewallPolicyFilterRuleCollection{} - -type FirewallPolicyFilterRuleCollection struct { - Action *FirewallPolicyFilterRuleCollectionAction `json:"action,omitempty"` - Rules *[]FirewallPolicyRule `json:"rules,omitempty"` - - // Fields inherited from FirewallPolicyRuleCollection - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` -} - -var _ json.Marshaler = FirewallPolicyFilterRuleCollection{} - -func (s FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { - type wrapper FirewallPolicyFilterRuleCollection - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FirewallPolicyFilterRuleCollection: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyFilterRuleCollection: %+v", err) - } - decoded["ruleCollectionType"] = "FirewallPolicyFilterRuleCollection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FirewallPolicyFilterRuleCollection: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &FirewallPolicyFilterRuleCollection{} - -func (s *FirewallPolicyFilterRuleCollection) UnmarshalJSON(bytes []byte) error { - type alias FirewallPolicyFilterRuleCollection - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into FirewallPolicyFilterRuleCollection: %+v", err) - } - - s.Action = decoded.Action - s.Name = decoded.Name - s.Priority = decoded.Priority - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling FirewallPolicyFilterRuleCollection into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["rules"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Rules into list []json.RawMessage: %+v", err) - } - - output := make([]FirewallPolicyRule, 0) - for i, val := range listTemp { - impl, err := unmarshalFirewallPolicyRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Rules' for 'FirewallPolicyFilterRuleCollection': %+v", i, err) - } - output = append(output, impl) - } - s.Rules = &output - } - return nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go deleted file mode 100644 index 42d0cb7d127..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyFilterRuleCollectionAction struct { - Type *FirewallPolicyFilterRuleCollectionActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go deleted file mode 100644 index f7dd43c6089..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyHTTPHeaderToInsert struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go deleted file mode 100644 index 114889c0540..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go +++ /dev/null @@ -1,81 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRuleCollection = FirewallPolicyNatRuleCollection{} - -type FirewallPolicyNatRuleCollection struct { - Action *FirewallPolicyNatRuleCollectionAction `json:"action,omitempty"` - Rules *[]FirewallPolicyRule `json:"rules,omitempty"` - - // Fields inherited from FirewallPolicyRuleCollection - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` -} - -var _ json.Marshaler = FirewallPolicyNatRuleCollection{} - -func (s FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { - type wrapper FirewallPolicyNatRuleCollection - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FirewallPolicyNatRuleCollection: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyNatRuleCollection: %+v", err) - } - decoded["ruleCollectionType"] = "FirewallPolicyNatRuleCollection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FirewallPolicyNatRuleCollection: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &FirewallPolicyNatRuleCollection{} - -func (s *FirewallPolicyNatRuleCollection) UnmarshalJSON(bytes []byte) error { - type alias FirewallPolicyNatRuleCollection - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into FirewallPolicyNatRuleCollection: %+v", err) - } - - s.Action = decoded.Action - s.Name = decoded.Name - s.Priority = decoded.Priority - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling FirewallPolicyNatRuleCollection into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["rules"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Rules into list []json.RawMessage: %+v", err) - } - - output := make([]FirewallPolicyRule, 0) - for i, val := range listTemp { - impl, err := unmarshalFirewallPolicyRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Rules' for 'FirewallPolicyNatRuleCollection': %+v", i, err) - } - output = append(output, impl) - } - s.Rules = &output - } - return nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go deleted file mode 100644 index 0b31f5d8ffa..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyNatRuleCollectionAction struct { - Type *FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go deleted file mode 100644 index 5cd71ef998a..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go +++ /dev/null @@ -1,69 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRule interface { -} - -// RawFirewallPolicyRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawFirewallPolicyRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalFirewallPolicyRuleImplementation(input []byte) (FirewallPolicyRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyRule into map[string]interface: %+v", err) - } - - value, ok := temp["ruleType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "ApplicationRule") { - var out ApplicationRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ApplicationRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NatRule") { - var out NatRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NatRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NetworkRule") { - var out NetworkRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NetworkRule: %+v", err) - } - return out, nil - } - - out := RawFirewallPolicyRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go deleted file mode 100644 index cc2db178d08..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleApplicationProtocol struct { - Port *int64 `json:"port,omitempty"` - ProtocolType *FirewallPolicyRuleApplicationProtocolType `json:"protocolType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go deleted file mode 100644 index 30f1b958dc8..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go +++ /dev/null @@ -1,61 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRuleCollection interface { -} - -// RawFirewallPolicyRuleCollectionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawFirewallPolicyRuleCollectionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalFirewallPolicyRuleCollectionImplementation(input []byte) (FirewallPolicyRuleCollection, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyRuleCollection into map[string]interface: %+v", err) - } - - value, ok := temp["ruleCollectionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "FirewallPolicyFilterRuleCollection") { - var out FirewallPolicyFilterRuleCollection - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FirewallPolicyFilterRuleCollection: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "FirewallPolicyNatRuleCollection") { - var out FirewallPolicyNatRuleCollection - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FirewallPolicyNatRuleCollection: %+v", err) - } - return out, nil - } - - out := RawFirewallPolicyRuleCollectionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go deleted file mode 100644 index 3cd2b948905..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleCollectionGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FirewallPolicyRuleCollectionGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go deleted file mode 100644 index e395e7aa41f..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go +++ /dev/null @@ -1,53 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleCollectionGroupProperties struct { - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleCollections *[]FirewallPolicyRuleCollection `json:"ruleCollections,omitempty"` - Size *string `json:"size,omitempty"` -} - -var _ json.Unmarshaler = &FirewallPolicyRuleCollectionGroupProperties{} - -func (s *FirewallPolicyRuleCollectionGroupProperties) UnmarshalJSON(bytes []byte) error { - type alias FirewallPolicyRuleCollectionGroupProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into FirewallPolicyRuleCollectionGroupProperties: %+v", err) - } - - s.Priority = decoded.Priority - s.ProvisioningState = decoded.ProvisioningState - s.Size = decoded.Size - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling FirewallPolicyRuleCollectionGroupProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["ruleCollections"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling RuleCollections into list []json.RawMessage: %+v", err) - } - - output := make([]FirewallPolicyRuleCollection, 0) - for i, val := range listTemp { - impl, err := unmarshalFirewallPolicyRuleCollectionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'RuleCollections' for 'FirewallPolicyRuleCollectionGroupProperties': %+v", i, err) - } - output = append(output, impl) - } - s.RuleCollections = &output - } - return nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_natrule.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_natrule.go deleted file mode 100644 index 5354374d68c..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_natrule.go +++ /dev/null @@ -1,50 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = NatRule{} - -type NatRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TranslatedAddress *string `json:"translatedAddress,omitempty"` - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - TranslatedPort *string `json:"translatedPort,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = NatRule{} - -func (s NatRule) MarshalJSON() ([]byte, error) { - type wrapper NatRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NatRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NatRule: %+v", err) - } - decoded["ruleType"] = "NatRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NatRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_networkrule.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_networkrule.go deleted file mode 100644 index 7548f48a194..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/model_networkrule.go +++ /dev/null @@ -1,49 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = NetworkRule{} - -type NetworkRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = NetworkRule{} - -func (s NetworkRule) MarshalJSON() ([]byte, error) { - type wrapper NetworkRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NetworkRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NetworkRule: %+v", err) - } - decoded["ruleType"] = "NetworkRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NetworkRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/predicates.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/predicates.go deleted file mode 100644 index 9762acada56..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleCollectionGroupOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p FirewallPolicyRuleCollectionGroupOperationPredicate) Matches(input FirewallPolicyRuleCollectionGroup) 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.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/network/2023-05-01/firewallpolicyrulecollectiongroups/version.go b/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/version.go deleted file mode 100644 index 528420490e2..00000000000 --- a/resource-manager/network/2023-05-01/firewallpolicyrulecollectiongroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicyrulecollectiongroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/flowlogs/README.md b/resource-manager/network/2023-05-01/flowlogs/README.md deleted file mode 100644 index 197ddbfc537..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/README.md +++ /dev/null @@ -1,103 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/flowlogs` Documentation - -The `flowlogs` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/flowlogs" -``` - - -### Client Initialization - -```go -client := flowlogs.NewFlowLogsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FlowLogsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -payload := flowlogs.FlowLog{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FlowLogsClient.Delete` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FlowLogsClient.Get` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -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: `FlowLogsClient.List` - -```go -ctx := context.TODO() -id := flowlogs.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -// 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: `FlowLogsClient.UpdateTags` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -payload := flowlogs.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/network/2023-05-01/flowlogs/client.go b/resource-manager/network/2023-05-01/flowlogs/client.go deleted file mode 100644 index 9368055263b..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package flowlogs - -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 FlowLogsClient struct { - Client *resourcemanager.Client -} - -func NewFlowLogsClientWithBaseURI(sdkApi sdkEnv.Api) (*FlowLogsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "flowlogs", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FlowLogsClient: %+v", err) - } - - return &FlowLogsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/flowlogs/constants.go b/resource-manager/network/2023-05-01/flowlogs/constants.go deleted file mode 100644 index e5e97eea109..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/constants.go +++ /dev/null @@ -1,95 +0,0 @@ -package flowlogs - -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 FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/flowlogs/id_flowlog.go b/resource-manager/network/2023-05-01/flowlogs/id_flowlog.go deleted file mode 100644 index 65f0fddaf41..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/id_flowlog.go +++ /dev/null @@ -1,139 +0,0 @@ -package flowlogs - -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(&FlowLogId{}) -} - -var _ resourceids.ResourceId = &FlowLogId{} - -// FlowLogId is a struct representing the Resource ID for a Flow Log -type FlowLogId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string - FlowLogName string -} - -// NewFlowLogID returns a new FlowLogId struct -func NewFlowLogID(subscriptionId string, resourceGroupName string, networkWatcherName string, flowLogName string) FlowLogId { - return FlowLogId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - FlowLogName: flowLogName, - } -} - -// ParseFlowLogID parses 'input' into a FlowLogId -func ParseFlowLogID(input string) (*FlowLogId, error) { - parser := resourceids.NewParserFromResourceIdType(&FlowLogId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FlowLogId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFlowLogIDInsensitively parses 'input' case-insensitively into a FlowLogId -// note: this method should only be used for API response data and not user input -func ParseFlowLogIDInsensitively(input string) (*FlowLogId, error) { - parser := resourceids.NewParserFromResourceIdType(&FlowLogId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FlowLogId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FlowLogId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - if id.FlowLogName, ok = input.Parsed["flowLogName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "flowLogName", input) - } - - return nil -} - -// ValidateFlowLogID checks that 'input' can be parsed as a Flow Log ID -func ValidateFlowLogID(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 := ParseFlowLogID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Flow Log ID -func (id FlowLogId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s/flowLogs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName, id.FlowLogName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Flow Log ID -func (id FlowLogId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - resourceids.StaticSegment("staticFlowLogs", "flowLogs", "flowLogs"), - resourceids.UserSpecifiedSegment("flowLogName", "flowLogValue"), - } -} - -// String returns a human-readable description of this Flow Log ID -func (id FlowLogId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - fmt.Sprintf("Flow Log Name: %q", id.FlowLogName), - } - return fmt.Sprintf("Flow Log (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/flowlogs/id_flowlog_test.go b/resource-manager/network/2023-05-01/flowlogs/id_flowlog_test.go deleted file mode 100644 index b57a529ab52..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/id_flowlog_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package flowlogs - -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 = &FlowLogId{} - -func TestNewFlowLogID(t *testing.T) { - id := NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } - - if id.FlowLogName != "flowLogValue" { - t.Fatalf("Expected %q but got %q for Segment 'FlowLogName'", id.FlowLogName, "flowLogValue") - } -} - -func TestFormatFlowLogID(t *testing.T) { - actual := NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFlowLogID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FlowLogId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue", - Expected: &FlowLogId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - FlowLogName: "flowLogValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFlowLogID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.FlowLogName != v.Expected.FlowLogName { - t.Fatalf("Expected %q but got %q for FlowLogName", v.Expected.FlowLogName, actual.FlowLogName) - } - - } -} - -func TestParseFlowLogIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FlowLogId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/fLoWlOgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue", - Expected: &FlowLogId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - FlowLogName: "flowLogValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/fLoWlOgS/fLoWlOgVaLuE", - Expected: &FlowLogId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - FlowLogName: "fLoWlOgVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/fLoWlOgS/fLoWlOgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFlowLogIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.FlowLogName != v.Expected.FlowLogName { - t.Fatalf("Expected %q but got %q for FlowLogName", v.Expected.FlowLogName, actual.FlowLogName) - } - - } -} - -func TestSegmentsForFlowLogId(t *testing.T) { - segments := FlowLogId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FlowLogId 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/network/2023-05-01/flowlogs/id_networkwatcher.go b/resource-manager/network/2023-05-01/flowlogs/id_networkwatcher.go deleted file mode 100644 index 480aa5be344..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package flowlogs - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/flowlogs/id_networkwatcher_test.go b/resource-manager/network/2023-05-01/flowlogs/id_networkwatcher_test.go deleted file mode 100644 index 8d877dbc644..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package flowlogs - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-05-01/flowlogs/method_createorupdate.go b/resource-manager/network/2023-05-01/flowlogs/method_createorupdate.go deleted file mode 100644 index 9469b674d32..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package flowlogs - -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 *FlowLog -} - -// CreateOrUpdate ... -func (c FlowLogsClient) CreateOrUpdate(ctx context.Context, id FlowLogId, input FlowLog) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FlowLogsClient) CreateOrUpdateThenPoll(ctx context.Context, id FlowLogId, input FlowLog) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/flowlogs/method_delete.go b/resource-manager/network/2023-05-01/flowlogs/method_delete.go deleted file mode 100644 index 1ff7776fa73..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package flowlogs - -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 FlowLogsClient) Delete(ctx context.Context, id FlowLogId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c FlowLogsClient) DeleteThenPoll(ctx context.Context, id FlowLogId) 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/network/2023-05-01/flowlogs/method_get.go b/resource-manager/network/2023-05-01/flowlogs/method_get.go deleted file mode 100644 index 91942eff6d3..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package flowlogs - -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 *FlowLog -} - -// Get ... -func (c FlowLogsClient) Get(ctx context.Context, id FlowLogId) (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 FlowLog - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/flowlogs/method_list.go b/resource-manager/network/2023-05-01/flowlogs/method_list.go deleted file mode 100644 index 56da8115500..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package flowlogs - -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 *[]FlowLog -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FlowLog -} - -// List ... -func (c FlowLogsClient) List(ctx context.Context, id NetworkWatcherId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/flowLogs", 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 *[]FlowLog `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 FlowLogsClient) ListComplete(ctx context.Context, id NetworkWatcherId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FlowLogOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FlowLogsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkWatcherId, predicate FlowLogOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FlowLog, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/flowlogs/method_updatetags.go b/resource-manager/network/2023-05-01/flowlogs/method_updatetags.go deleted file mode 100644 index 7ef9682b564..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package flowlogs - -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 *FlowLog -} - -// UpdateTags ... -func (c FlowLogsClient) UpdateTags(ctx context.Context, id FlowLogId, 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 FlowLog - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/flowlogs/model_flowlog.go b/resource-manager/network/2023-05-01/flowlogs/model_flowlog.go deleted file mode 100644 index 6cb0c1a33b5..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/flowlogs/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/flowlogs/model_flowlogformatparameters.go deleted file mode 100644 index 16ca58e95a3..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/flowlogs/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/flowlogs/model_flowlogpropertiesformat.go deleted file mode 100644 index e08f8fc6124..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/flowlogs/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/flowlogs/model_retentionpolicyparameters.go deleted file mode 100644 index 37f07668bea..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/flowlogs/model_tagsobject.go b/resource-manager/network/2023-05-01/flowlogs/model_tagsobject.go deleted file mode 100644 index c5cd354ef29..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package flowlogs - -// 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/network/2023-05-01/flowlogs/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 5b935e5f27b..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsproperties.go deleted file mode 100644 index d6d9faede4b..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/flowlogs/predicates.go b/resource-manager/network/2023-05-01/flowlogs/predicates.go deleted file mode 100644 index 746df2611cc..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p FlowLogOperationPredicate) Matches(input FlowLog) 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 && (input.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/network/2023-05-01/flowlogs/version.go b/resource-manager/network/2023-05-01/flowlogs/version.go deleted file mode 100644 index b7dbefc21c0..00000000000 --- a/resource-manager/network/2023-05-01/flowlogs/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package flowlogs - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/flowlogs/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/ipallocations/README.md b/resource-manager/network/2023-05-01/ipallocations/README.md deleted file mode 100644 index 1dd93e70501..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ipallocations` Documentation - -The `ipallocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/ipallocations" -``` - - -### Client Initialization - -```go -client := ipallocations.NewIPAllocationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IPAllocationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -payload := ipallocations.IPAllocation{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPAllocationsClient.Delete` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPAllocationsClient.Get` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -read, err := client.Get(ctx, id, ipallocations.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IPAllocationsClient.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: `IPAllocationsClient.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: `IPAllocationsClient.UpdateTags` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -payload := ipallocations.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/network/2023-05-01/ipallocations/client.go b/resource-manager/network/2023-05-01/ipallocations/client.go deleted file mode 100644 index 0450bb3a685..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ipallocations - -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 IPAllocationsClient struct { - Client *resourcemanager.Client -} - -func NewIPAllocationsClientWithBaseURI(sdkApi sdkEnv.Api) (*IPAllocationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ipallocations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IPAllocationsClient: %+v", err) - } - - return &IPAllocationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/ipallocations/constants.go b/resource-manager/network/2023-05-01/ipallocations/constants.go deleted file mode 100644 index da0323d2ad0..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipallocations - -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 IPAllocationType string - -const ( - IPAllocationTypeHypernet IPAllocationType = "Hypernet" - IPAllocationTypeUndefined IPAllocationType = "Undefined" -) - -func PossibleValuesForIPAllocationType() []string { - return []string{ - string(IPAllocationTypeHypernet), - string(IPAllocationTypeUndefined), - } -} - -func (s *IPAllocationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationType(input string) (*IPAllocationType, error) { - vals := map[string]IPAllocationType{ - "hypernet": IPAllocationTypeHypernet, - "undefined": IPAllocationTypeUndefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationType(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/ipallocations/id_ipallocation.go b/resource-manager/network/2023-05-01/ipallocations/id_ipallocation.go deleted file mode 100644 index 1f45e0c491f..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/id_ipallocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package ipallocations - -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(&IPAllocationId{}) -} - -var _ resourceids.ResourceId = &IPAllocationId{} - -// IPAllocationId is a struct representing the Resource ID for a I P Allocation -type IPAllocationId struct { - SubscriptionId string - ResourceGroupName string - IpAllocationName string -} - -// NewIPAllocationID returns a new IPAllocationId struct -func NewIPAllocationID(subscriptionId string, resourceGroupName string, ipAllocationName string) IPAllocationId { - return IPAllocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IpAllocationName: ipAllocationName, - } -} - -// ParseIPAllocationID parses 'input' into a IPAllocationId -func ParseIPAllocationID(input string) (*IPAllocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPAllocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPAllocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIPAllocationIDInsensitively parses 'input' case-insensitively into a IPAllocationId -// note: this method should only be used for API response data and not user input -func ParseIPAllocationIDInsensitively(input string) (*IPAllocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPAllocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPAllocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IPAllocationId) 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.IpAllocationName, ok = input.Parsed["ipAllocationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ipAllocationName", input) - } - - return nil -} - -// ValidateIPAllocationID checks that 'input' can be parsed as a I P Allocation ID -func ValidateIPAllocationID(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 := ParseIPAllocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted I P Allocation ID -func (id IPAllocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ipAllocations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IpAllocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this I P Allocation ID -func (id IPAllocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticIpAllocations", "ipAllocations", "ipAllocations"), - resourceids.UserSpecifiedSegment("ipAllocationName", "ipAllocationValue"), - } -} - -// String returns a human-readable description of this I P Allocation ID -func (id IPAllocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ip Allocation Name: %q", id.IpAllocationName), - } - return fmt.Sprintf("I P Allocation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/ipallocations/id_ipallocation_test.go b/resource-manager/network/2023-05-01/ipallocations/id_ipallocation_test.go deleted file mode 100644 index 35284a7ef67..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/id_ipallocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ipallocations - -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 = &IPAllocationId{} - -func TestNewIPAllocationID(t *testing.T) { - id := NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - - 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.IpAllocationName != "ipAllocationValue" { - t.Fatalf("Expected %q but got %q for Segment 'IpAllocationName'", id.IpAllocationName, "ipAllocationValue") - } -} - -func TestFormatIPAllocationID(t *testing.T) { - actual := NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIPAllocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPAllocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue", - Expected: &IPAllocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpAllocationName: "ipAllocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPAllocationID(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.IpAllocationName != v.Expected.IpAllocationName { - t.Fatalf("Expected %q but got %q for IpAllocationName", v.Expected.IpAllocationName, actual.IpAllocationName) - } - - } -} - -func TestParseIPAllocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPAllocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPaLlOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue", - Expected: &IPAllocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpAllocationName: "ipAllocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPaLlOcAtIoNs/iPaLlOcAtIoNvAlUe", - Expected: &IPAllocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpAllocationName: "iPaLlOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/iPaLlOcAtIoNs/iPaLlOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPAllocationIDInsensitively(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.IpAllocationName != v.Expected.IpAllocationName { - t.Fatalf("Expected %q but got %q for IpAllocationName", v.Expected.IpAllocationName, actual.IpAllocationName) - } - - } -} - -func TestSegmentsForIPAllocationId(t *testing.T) { - segments := IPAllocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IPAllocationId 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/network/2023-05-01/ipallocations/method_createorupdate.go b/resource-manager/network/2023-05-01/ipallocations/method_createorupdate.go deleted file mode 100644 index 6b097aa0b1a..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ipallocations - -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 *IPAllocation -} - -// CreateOrUpdate ... -func (c IPAllocationsClient) CreateOrUpdate(ctx context.Context, id IPAllocationId, input IPAllocation) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c IPAllocationsClient) CreateOrUpdateThenPoll(ctx context.Context, id IPAllocationId, input IPAllocation) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/ipallocations/method_delete.go b/resource-manager/network/2023-05-01/ipallocations/method_delete.go deleted file mode 100644 index 2e272e0b823..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ipallocations - -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 IPAllocationsClient) Delete(ctx context.Context, id IPAllocationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 IPAllocationsClient) DeleteThenPoll(ctx context.Context, id IPAllocationId) 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/network/2023-05-01/ipallocations/method_get.go b/resource-manager/network/2023-05-01/ipallocations/method_get.go deleted file mode 100644 index 6d8c674b8b8..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package ipallocations - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPAllocation -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c IPAllocationsClient) Get(ctx context.Context, id IPAllocationId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 IPAllocation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ipallocations/method_list.go b/resource-manager/network/2023-05-01/ipallocations/method_list.go deleted file mode 100644 index e1f24020606..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipallocations - -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 *[]IPAllocation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPAllocation -} - -// List ... -func (c IPAllocationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipAllocations", 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 *[]IPAllocation `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 IPAllocationsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, IPAllocationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPAllocationsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IPAllocationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IPAllocation, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/ipallocations/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/ipallocations/method_listbyresourcegroup.go deleted file mode 100644 index 9a7f784e207..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipallocations - -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 *[]IPAllocation -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPAllocation -} - -// ListByResourceGroup ... -func (c IPAllocationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipAllocations", 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 *[]IPAllocation `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 IPAllocationsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, IPAllocationOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPAllocationsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IPAllocationOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]IPAllocation, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/ipallocations/method_updatetags.go b/resource-manager/network/2023-05-01/ipallocations/method_updatetags.go deleted file mode 100644 index 792fe909fcb..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package ipallocations - -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 *IPAllocation -} - -// UpdateTags ... -func (c IPAllocationsClient) UpdateTags(ctx context.Context, id IPAllocationId, 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 IPAllocation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ipallocations/model_ipallocation.go b/resource-manager/network/2023-05-01/ipallocations/model_ipallocation.go deleted file mode 100644 index d59b8140ce3..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/model_ipallocation.go +++ /dev/null @@ -1,14 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAllocation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPAllocationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ipallocations/model_ipallocationpropertiesformat.go b/resource-manager/network/2023-05-01/ipallocations/model_ipallocationpropertiesformat.go deleted file mode 100644 index ee1eec041ee..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/model_ipallocationpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAllocationPropertiesFormat struct { - AllocationTags *map[string]string `json:"allocationTags,omitempty"` - IPamAllocationId *string `json:"ipamAllocationId,omitempty"` - Prefix *string `json:"prefix,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` - PrefixType *IPVersion `json:"prefixType,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - Type *IPAllocationType `json:"type,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ipallocations/model_subresource.go b/resource-manager/network/2023-05-01/ipallocations/model_subresource.go deleted file mode 100644 index 3d4e1d6d386..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ipallocations/model_tagsobject.go b/resource-manager/network/2023-05-01/ipallocations/model_tagsobject.go deleted file mode 100644 index e07b18f03bb..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipallocations - -// 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/network/2023-05-01/ipallocations/predicates.go b/resource-manager/network/2023-05-01/ipallocations/predicates.go deleted file mode 100644 index 5f4e136ae66..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAllocationOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p IPAllocationOperationPredicate) Matches(input IPAllocation) 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 && (input.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/network/2023-05-01/ipallocations/version.go b/resource-manager/network/2023-05-01/ipallocations/version.go deleted file mode 100644 index 95e94033466..00000000000 --- a/resource-manager/network/2023-05-01/ipallocations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ipallocations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ipallocations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/ipgroups/README.md b/resource-manager/network/2023-05-01/ipgroups/README.md deleted file mode 100644 index d97710df801..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/ipgroups` Documentation - -The `ipgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/ipgroups" -``` - - -### Client Initialization - -```go -client := ipgroups.NewIPGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IPGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -payload := ipgroups.IPGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPGroupsClient.Delete` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPGroupsClient.Get` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IPGroupsClient.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: `IPGroupsClient.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: `IPGroupsClient.UpdateGroups` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -payload := ipgroups.TagsObject{ - // ... -} - - -read, err := client.UpdateGroups(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/network/2023-05-01/ipgroups/client.go b/resource-manager/network/2023-05-01/ipgroups/client.go deleted file mode 100644 index 3e21fe9f946..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ipgroups - -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 IPGroupsClient struct { - Client *resourcemanager.Client -} - -func NewIPGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*IPGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ipgroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IPGroupsClient: %+v", err) - } - - return &IPGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/ipgroups/constants.go b/resource-manager/network/2023-05-01/ipgroups/constants.go deleted file mode 100644 index a50092f263a..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package ipgroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/ipgroups/id_ipgroup.go b/resource-manager/network/2023-05-01/ipgroups/id_ipgroup.go deleted file mode 100644 index 7b564788b08..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/id_ipgroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package ipgroups - -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(&IPGroupId{}) -} - -var _ resourceids.ResourceId = &IPGroupId{} - -// IPGroupId is a struct representing the Resource ID for a I P Group -type IPGroupId struct { - SubscriptionId string - ResourceGroupName string - IpGroupName string -} - -// NewIPGroupID returns a new IPGroupId struct -func NewIPGroupID(subscriptionId string, resourceGroupName string, ipGroupName string) IPGroupId { - return IPGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IpGroupName: ipGroupName, - } -} - -// ParseIPGroupID parses 'input' into a IPGroupId -func ParseIPGroupID(input string) (*IPGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIPGroupIDInsensitively parses 'input' case-insensitively into a IPGroupId -// note: this method should only be used for API response data and not user input -func ParseIPGroupIDInsensitively(input string) (*IPGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IPGroupId) 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.IpGroupName, ok = input.Parsed["ipGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ipGroupName", input) - } - - return nil -} - -// ValidateIPGroupID checks that 'input' can be parsed as a I P Group ID -func ValidateIPGroupID(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 := ParseIPGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted I P Group ID -func (id IPGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ipGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IpGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this I P Group ID -func (id IPGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticIpGroups", "ipGroups", "ipGroups"), - resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupValue"), - } -} - -// String returns a human-readable description of this I P Group ID -func (id IPGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ip Group Name: %q", id.IpGroupName), - } - return fmt.Sprintf("I P Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2023-05-01/ipgroups/id_ipgroup_test.go deleted file mode 100644 index 22968e22020..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/id_ipgroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ipgroups - -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 = &IPGroupId{} - -func TestNewIPGroupID(t *testing.T) { - id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - - 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.IpGroupName != "ipGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupValue") - } -} - -func TestFormatIPGroupID(t *testing.T) { - actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIPGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue", - Expected: &IPGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPGroupID(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.IpGroupName != v.Expected.IpGroupName { - t.Fatalf("Expected %q but got %q for IpGroupName", v.Expected.IpGroupName, actual.IpGroupName) - } - - } -} - -func TestParseIPGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue", - Expected: &IPGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpVaLuE", - Expected: &IPGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpGroupName: "iPgRoUpVaLuE", - }, - }, - { - // 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.nEtWoRk/iPgRoUpS/iPgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPGroupIDInsensitively(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.IpGroupName != v.Expected.IpGroupName { - t.Fatalf("Expected %q but got %q for IpGroupName", v.Expected.IpGroupName, actual.IpGroupName) - } - - } -} - -func TestSegmentsForIPGroupId(t *testing.T) { - segments := IPGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IPGroupId 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/network/2023-05-01/ipgroups/method_createorupdate.go b/resource-manager/network/2023-05-01/ipgroups/method_createorupdate.go deleted file mode 100644 index fe09b1c7bf6..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ipgroups - -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 *IPGroup -} - -// CreateOrUpdate ... -func (c IPGroupsClient) CreateOrUpdate(ctx context.Context, id IPGroupId, input IPGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c IPGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id IPGroupId, input IPGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/ipgroups/method_delete.go b/resource-manager/network/2023-05-01/ipgroups/method_delete.go deleted file mode 100644 index 1e1797dd8d3..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ipgroups - -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 IPGroupsClient) Delete(ctx context.Context, id IPGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 IPGroupsClient) DeleteThenPoll(ctx context.Context, id IPGroupId) 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/network/2023-05-01/ipgroups/method_get.go b/resource-manager/network/2023-05-01/ipgroups/method_get.go deleted file mode 100644 index c1a0a108f8e..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package ipgroups - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPGroup -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c IPGroupsClient) Get(ctx context.Context, id IPGroupId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 IPGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ipgroups/method_list.go b/resource-manager/network/2023-05-01/ipgroups/method_list.go deleted file mode 100644 index a1edbd26600..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipgroups - -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 *[]IPGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPGroup -} - -// List ... -func (c IPGroupsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipGroups", 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 *[]IPGroup `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 IPGroupsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, IPGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IPGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IPGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/ipgroups/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/ipgroups/method_listbyresourcegroup.go deleted file mode 100644 index 96af39068d9..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipgroups - -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 *[]IPGroup -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPGroup -} - -// ListByResourceGroup ... -func (c IPGroupsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipGroups", 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 *[]IPGroup `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 IPGroupsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, IPGroupOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPGroupsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IPGroupOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]IPGroup, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/ipgroups/method_updategroups.go b/resource-manager/network/2023-05-01/ipgroups/method_updategroups.go deleted file mode 100644 index 67a51b18e05..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/method_updategroups.go +++ /dev/null @@ -1,58 +0,0 @@ -package ipgroups - -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 UpdateGroupsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPGroup -} - -// UpdateGroups ... -func (c IPGroupsClient) UpdateGroups(ctx context.Context, id IPGroupId, input TagsObject) (result UpdateGroupsOperationResponse, 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 IPGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/ipgroups/model_ipgroup.go b/resource-manager/network/2023-05-01/ipgroups/model_ipgroup.go deleted file mode 100644 index 7f586ce2b06..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/model_ipgroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ipgroups/model_ipgrouppropertiesformat.go b/resource-manager/network/2023-05-01/ipgroups/model_ipgrouppropertiesformat.go deleted file mode 100644 index 866075a1038..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/model_ipgrouppropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPGroupPropertiesFormat struct { - FirewallPolicies *[]SubResource `json:"firewallPolicies,omitempty"` - Firewalls *[]SubResource `json:"firewalls,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ipgroups/model_subresource.go b/resource-manager/network/2023-05-01/ipgroups/model_subresource.go deleted file mode 100644 index 5e6c0552f0c..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/ipgroups/model_tagsobject.go b/resource-manager/network/2023-05-01/ipgroups/model_tagsobject.go deleted file mode 100644 index df59e42aff4..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipgroups - -// 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/network/2023-05-01/ipgroups/predicates.go b/resource-manager/network/2023-05-01/ipgroups/predicates.go deleted file mode 100644 index a64e98c2290..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPGroupOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p IPGroupOperationPredicate) Matches(input IPGroup) 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 && (input.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/network/2023-05-01/ipgroups/version.go b/resource-manager/network/2023-05-01/ipgroups/version.go deleted file mode 100644 index be272617be3..00000000000 --- a/resource-manager/network/2023-05-01/ipgroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ipgroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ipgroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/README.md b/resource-manager/network/2023-05-01/loadbalancers/README.md deleted file mode 100644 index a5a751cd2a9..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/README.md +++ /dev/null @@ -1,449 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/loadbalancers` Documentation - -The `loadbalancers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/loadbalancers" -``` - - -### Client Initialization - -```go -client := loadbalancers.NewLoadBalancersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LoadBalancersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -payload := loadbalancers.LoadBalancer{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.Delete` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.Get` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -read, err := client.Get(ctx, id, loadbalancers.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -payload := loadbalancers.InboundNatRule{ - // ... -} - - -if err := client.InboundNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesDelete` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -if err := client.InboundNatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -read, err := client.InboundNatRulesGet(ctx, id, loadbalancers.DefaultInboundNatRulesGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.InboundNatRulesList(ctx, id)` can be used to do batched pagination -items, err := client.InboundNatRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LoadBalancersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.ListInboundNatRulePortMappings` - -```go -ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue") - -payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ - // ... -} - - -if err := client.ListInboundNatRulePortMappingsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsCreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -payload := loadbalancers.BackendAddressPool{ - // ... -} - - -if err := client.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsDelete` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -if err := client.LoadBalancerBackendAddressPoolsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -read, err := client.LoadBalancerBackendAddressPoolsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerBackendAddressPoolsList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerBackendAddressPoolsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue") - -read, err := client.LoadBalancerFrontendIPConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerFrontendIPConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerFrontendIPConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue") - -read, err := client.LoadBalancerLoadBalancingRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerLoadBalancingRulesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerLoadBalancingRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerNetworkInterfacesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerNetworkInterfacesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerNetworkInterfacesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue") - -read, err := client.LoadBalancerOutboundRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerOutboundRulesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerOutboundRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerProbesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue") - -read, err := client.LoadBalancerProbesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerProbesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerProbesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerProbesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.MigrateToIPBased` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue") - -payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ - // ... -} - - -read, err := client.MigrateToIPBased(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.SwapPublicIPAddresses` - -```go -ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := loadbalancers.LoadBalancerVipSwapRequest{ - // ... -} - - -if err := client.SwapPublicIPAddressesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.UpdateTags` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -payload := loadbalancers.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/network/2023-05-01/loadbalancers/client.go b/resource-manager/network/2023-05-01/loadbalancers/client.go deleted file mode 100644 index 3d84973a709..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package loadbalancers - -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 LoadBalancersClient struct { - Client *resourcemanager.Client -} - -func NewLoadBalancersClientWithBaseURI(sdkApi sdkEnv.Api) (*LoadBalancersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "loadbalancers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LoadBalancersClient: %+v", err) - } - - return &LoadBalancersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/constants.go b/resource-manager/network/2023-05-01/loadbalancers/constants.go deleted file mode 100644 index 0e8874db62b..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/constants.go +++ /dev/null @@ -1,1368 +0,0 @@ -package loadbalancers - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" -) - -func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { - return []string{ - string(LoadBalancerOutboundRuleProtocolAll), - string(LoadBalancerOutboundRuleProtocolTcp), - string(LoadBalancerOutboundRuleProtocolUdp), - } -} - -func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerOutboundRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { - vals := map[string]LoadBalancerOutboundRuleProtocol{ - "all": LoadBalancerOutboundRuleProtocolAll, - "tcp": LoadBalancerOutboundRuleProtocolTcp, - "udp": LoadBalancerOutboundRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerOutboundRuleProtocol(input) - return &out, nil -} - -type LoadBalancerSkuName string - -const ( - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -func PossibleValuesForLoadBalancerSkuName() []string { - return []string{ - string(LoadBalancerSkuNameBasic), - string(LoadBalancerSkuNameGateway), - string(LoadBalancerSkuNameStandard), - } -} - -func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { - vals := map[string]LoadBalancerSkuName{ - "basic": LoadBalancerSkuNameBasic, - "gateway": LoadBalancerSkuNameGateway, - "standard": LoadBalancerSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuName(input) - return &out, nil -} - -type LoadBalancerSkuTier string - -const ( - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" -) - -func PossibleValuesForLoadBalancerSkuTier() []string { - return []string{ - string(LoadBalancerSkuTierGlobal), - string(LoadBalancerSkuTierRegional), - } -} - -func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { - vals := map[string]LoadBalancerSkuTier{ - "global": LoadBalancerSkuTierGlobal, - "regional": LoadBalancerSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuTier(input) - return &out, nil -} - -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -func PossibleValuesForLoadDistribution() []string { - return []string{ - string(LoadDistributionDefault), - string(LoadDistributionSourceIP), - string(LoadDistributionSourceIPProtocol), - } -} - -func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadDistribution(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadDistribution(input string) (*LoadDistribution, error) { - vals := map[string]LoadDistribution{ - "default": LoadDistributionDefault, - "sourceip": LoadDistributionSourceIP, - "sourceipprotocol": LoadDistributionSourceIPProtocol, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadDistribution(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTcp ProbeProtocol = "Tcp" -) - -func PossibleValuesForProbeProtocol() []string { - return []string{ - string(ProbeProtocolHTTP), - string(ProbeProtocolHTTPS), - string(ProbeProtocolTcp), - } -} - -func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProbeProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProbeProtocol(input string) (*ProbeProtocol, error) { - vals := map[string]ProbeProtocol{ - "http": ProbeProtocolHTTP, - "https": ProbeProtocolHTTPS, - "tcp": ProbeProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProbeProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool.go deleted file mode 100644 index 57be52cf337..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&BackendAddressPoolId{}) -} - -var _ resourceids.ResourceId = &BackendAddressPoolId{} - -// BackendAddressPoolId is a struct representing the Resource ID for a Backend Address Pool -type BackendAddressPoolId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - BackendAddressPoolName string -} - -// NewBackendAddressPoolID returns a new BackendAddressPoolId struct -func NewBackendAddressPoolID(subscriptionId string, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) BackendAddressPoolId { - return BackendAddressPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - BackendAddressPoolName: backendAddressPoolName, - } -} - -// ParseBackendAddressPoolID parses 'input' into a BackendAddressPoolId -func ParseBackendAddressPoolID(input string) (*BackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&BackendAddressPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBackendAddressPoolIDInsensitively parses 'input' case-insensitively into a BackendAddressPoolId -// note: this method should only be used for API response data and not user input -func ParseBackendAddressPoolIDInsensitively(input string) (*BackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&BackendAddressPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BackendAddressPoolId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.BackendAddressPoolName, ok = input.Parsed["backendAddressPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backendAddressPoolName", input) - } - - return nil -} - -// ValidateBackendAddressPoolID checks that 'input' can be parsed as a Backend Address Pool ID -func ValidateBackendAddressPoolID(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 := ParseBackendAddressPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Backend Address Pool ID -func (id BackendAddressPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/backendAddressPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.BackendAddressPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Backend Address Pool ID -func (id BackendAddressPoolId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolValue"), - } -} - -// String returns a human-readable description of this Backend Address Pool ID -func (id BackendAddressPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Backend Address Pool Name: %q", id.BackendAddressPoolName), - } - return fmt.Sprintf("Backend Address Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool_test.go deleted file mode 100644 index f21fb27becf..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_backendaddresspool_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &BackendAddressPoolId{} - -func TestNewBackendAddressPoolID(t *testing.T) { - id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.BackendAddressPoolName != "backendAddressPoolValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolValue") - } -} - -func TestFormatBackendAddressPoolID(t *testing.T) { - actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBackendAddressPoolID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BackendAddressPoolId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &BackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBackendAddressPoolID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestParseBackendAddressPoolIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BackendAddressPoolId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &BackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe", - Expected: &BackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBackendAddressPoolIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestSegmentsForBackendAddressPoolId(t *testing.T) { - segments := BackendAddressPoolId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BackendAddressPoolId 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/network/2023-05-01/loadbalancers/id_frontendipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration.go deleted file mode 100644 index dd3cba98217..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&FrontendIPConfigurationId{}) -} - -var _ resourceids.ResourceId = &FrontendIPConfigurationId{} - -// FrontendIPConfigurationId is a struct representing the Resource ID for a Frontend I P Configuration -type FrontendIPConfigurationId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - FrontendIPConfigurationName string -} - -// NewFrontendIPConfigurationID returns a new FrontendIPConfigurationId struct -func NewFrontendIPConfigurationID(subscriptionId string, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) FrontendIPConfigurationId { - return FrontendIPConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - FrontendIPConfigurationName: frontendIPConfigurationName, - } -} - -// ParseFrontendIPConfigurationID parses 'input' into a FrontendIPConfigurationId -func ParseFrontendIPConfigurationID(input string) (*FrontendIPConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&FrontendIPConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FrontendIPConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFrontendIPConfigurationIDInsensitively parses 'input' case-insensitively into a FrontendIPConfigurationId -// note: this method should only be used for API response data and not user input -func ParseFrontendIPConfigurationIDInsensitively(input string) (*FrontendIPConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&FrontendIPConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FrontendIPConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FrontendIPConfigurationId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.FrontendIPConfigurationName, ok = input.Parsed["frontendIPConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "frontendIPConfigurationName", input) - } - - return nil -} - -// ValidateFrontendIPConfigurationID checks that 'input' can be parsed as a Frontend I P Configuration ID -func ValidateFrontendIPConfigurationID(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 := ParseFrontendIPConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Frontend I P Configuration ID -func (id FrontendIPConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/frontendIPConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.FrontendIPConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Frontend I P Configuration ID -func (id FrontendIPConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticFrontendIPConfigurations", "frontendIPConfigurations", "frontendIPConfigurations"), - resourceids.UserSpecifiedSegment("frontendIPConfigurationName", "frontendIPConfigurationValue"), - } -} - -// String returns a human-readable description of this Frontend I P Configuration ID -func (id FrontendIPConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Frontend I P Configuration Name: %q", id.FrontendIPConfigurationName), - } - return fmt.Sprintf("Frontend I P Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration_test.go deleted file mode 100644 index 06fbc5508d7..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_frontendipconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &FrontendIPConfigurationId{} - -func TestNewFrontendIPConfigurationID(t *testing.T) { - id := NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.FrontendIPConfigurationName != "frontendIPConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'FrontendIPConfigurationName'", id.FrontendIPConfigurationName, "frontendIPConfigurationValue") - } -} - -func TestFormatFrontendIPConfigurationID(t *testing.T) { - actual := NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFrontendIPConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FrontendIPConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue", - Expected: &FrontendIPConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - FrontendIPConfigurationName: "frontendIPConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFrontendIPConfigurationID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.FrontendIPConfigurationName != v.Expected.FrontendIPConfigurationName { - t.Fatalf("Expected %q but got %q for FrontendIPConfigurationName", v.Expected.FrontendIPConfigurationName, actual.FrontendIPConfigurationName) - } - - } -} - -func TestParseFrontendIPConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FrontendIPConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/fRoNtEnDiPcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue", - Expected: &FrontendIPConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - FrontendIPConfigurationName: "frontendIPConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/fRoNtEnDiPcOnFiGuRaTiOnS/fRoNtEnDiPcOnFiGuRaTiOnVaLuE", - Expected: &FrontendIPConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - FrontendIPConfigurationName: "fRoNtEnDiPcOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/fRoNtEnDiPcOnFiGuRaTiOnS/fRoNtEnDiPcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFrontendIPConfigurationIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.FrontendIPConfigurationName != v.Expected.FrontendIPConfigurationName { - t.Fatalf("Expected %q but got %q for FrontendIPConfigurationName", v.Expected.FrontendIPConfigurationName, actual.FrontendIPConfigurationName) - } - - } -} - -func TestSegmentsForFrontendIPConfigurationId(t *testing.T) { - segments := FrontendIPConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FrontendIPConfigurationId 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/network/2023-05-01/loadbalancers/id_inboundnatrule.go b/resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule.go deleted file mode 100644 index a460bece352..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&InboundNatRuleId{}) -} - -var _ resourceids.ResourceId = &InboundNatRuleId{} - -// InboundNatRuleId is a struct representing the Resource ID for a Inbound Nat Rule -type InboundNatRuleId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - InboundNatRuleName string -} - -// NewInboundNatRuleID returns a new InboundNatRuleId struct -func NewInboundNatRuleID(subscriptionId string, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) InboundNatRuleId { - return InboundNatRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - InboundNatRuleName: inboundNatRuleName, - } -} - -// ParseInboundNatRuleID parses 'input' into a InboundNatRuleId -func ParseInboundNatRuleID(input string) (*InboundNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundNatRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseInboundNatRuleIDInsensitively parses 'input' case-insensitively into a InboundNatRuleId -// note: this method should only be used for API response data and not user input -func ParseInboundNatRuleIDInsensitively(input string) (*InboundNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundNatRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *InboundNatRuleId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.InboundNatRuleName, ok = input.Parsed["inboundNatRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "inboundNatRuleName", input) - } - - return nil -} - -// ValidateInboundNatRuleID checks that 'input' can be parsed as a Inbound Nat Rule ID -func ValidateInboundNatRuleID(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 := ParseInboundNatRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Inbound Nat Rule ID -func (id InboundNatRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/inboundNatRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.InboundNatRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Inbound Nat Rule ID -func (id InboundNatRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticInboundNatRules", "inboundNatRules", "inboundNatRules"), - resourceids.UserSpecifiedSegment("inboundNatRuleName", "inboundNatRuleValue"), - } -} - -// String returns a human-readable description of this Inbound Nat Rule ID -func (id InboundNatRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Inbound Nat Rule Name: %q", id.InboundNatRuleName), - } - return fmt.Sprintf("Inbound Nat Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule_test.go deleted file mode 100644 index fc4882733d2..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_inboundnatrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &InboundNatRuleId{} - -func TestNewInboundNatRuleID(t *testing.T) { - id := NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.InboundNatRuleName != "inboundNatRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'InboundNatRuleName'", id.InboundNatRuleName, "inboundNatRuleValue") - } -} - -func TestFormatInboundNatRuleID(t *testing.T) { - actual := NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseInboundNatRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue", - Expected: &InboundNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - InboundNatRuleName: "inboundNatRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundNatRuleID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.InboundNatRuleName != v.Expected.InboundNatRuleName { - t.Fatalf("Expected %q but got %q for InboundNatRuleName", v.Expected.InboundNatRuleName, actual.InboundNatRuleName) - } - - } -} - -func TestParseInboundNatRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/iNbOuNdNaTrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue", - Expected: &InboundNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - InboundNatRuleName: "inboundNatRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/iNbOuNdNaTrUlEs/iNbOuNdNaTrUlEvAlUe", - Expected: &InboundNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - InboundNatRuleName: "iNbOuNdNaTrUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/iNbOuNdNaTrUlEs/iNbOuNdNaTrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundNatRuleIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.InboundNatRuleName != v.Expected.InboundNatRuleName { - t.Fatalf("Expected %q but got %q for InboundNatRuleName", v.Expected.InboundNatRuleName, actual.InboundNatRuleName) - } - - } -} - -func TestSegmentsForInboundNatRuleId(t *testing.T) { - segments := InboundNatRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("InboundNatRuleId 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/network/2023-05-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer.go deleted file mode 100644 index 35278257e30..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer.go +++ /dev/null @@ -1,130 +0,0 @@ -package loadbalancers - -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(&LoadBalancerId{}) -} - -var _ resourceids.ResourceId = &LoadBalancerId{} - -// LoadBalancerId is a struct representing the Resource ID for a Load Balancer -type LoadBalancerId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string -} - -// NewLoadBalancerID returns a new LoadBalancerId struct -func NewLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) LoadBalancerId { - return LoadBalancerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - } -} - -// ParseLoadBalancerID parses 'input' into a LoadBalancerId -func ParseLoadBalancerID(input string) (*LoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancerIDInsensitively parses 'input' case-insensitively into a LoadBalancerId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancerIDInsensitively(input string) (*LoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - return nil -} - -// ValidateLoadBalancerID checks that 'input' can be parsed as a Load Balancer ID -func ValidateLoadBalancerID(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 := ParseLoadBalancerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancer ID -func (id LoadBalancerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancer ID -func (id LoadBalancerId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - } -} - -// String returns a human-readable description of this Load Balancer ID -func (id LoadBalancerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - } - return fmt.Sprintf("Load Balancer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer_test.go deleted file mode 100644 index 88f22b83175..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadbalancers - -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 = &LoadBalancerId{} - -func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } -} - -func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestParseLoadBalancerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestSegmentsForLoadBalancerId(t *testing.T) { - segments := LoadBalancerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancerId 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/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool.go b/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool.go deleted file mode 100644 index d8fafa2347f..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&LoadBalancerBackendAddressPoolId{}) -} - -var _ resourceids.ResourceId = &LoadBalancerBackendAddressPoolId{} - -// LoadBalancerBackendAddressPoolId is a struct representing the Resource ID for a Load Balancer Backend Address Pool -type LoadBalancerBackendAddressPoolId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - BackendAddressPoolName string -} - -// NewLoadBalancerBackendAddressPoolID returns a new LoadBalancerBackendAddressPoolId struct -func NewLoadBalancerBackendAddressPoolID(subscriptionId string, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) LoadBalancerBackendAddressPoolId { - return LoadBalancerBackendAddressPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - BackendAddressPoolName: backendAddressPoolName, - } -} - -// ParseLoadBalancerBackendAddressPoolID parses 'input' into a LoadBalancerBackendAddressPoolId -func ParseLoadBalancerBackendAddressPoolID(input string) (*LoadBalancerBackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerBackendAddressPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerBackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancerBackendAddressPoolIDInsensitively parses 'input' case-insensitively into a LoadBalancerBackendAddressPoolId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancerBackendAddressPoolIDInsensitively(input string) (*LoadBalancerBackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerBackendAddressPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerBackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancerBackendAddressPoolId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.BackendAddressPoolName, ok = input.Parsed["backendAddressPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backendAddressPoolName", input) - } - - return nil -} - -// ValidateLoadBalancerBackendAddressPoolID checks that 'input' can be parsed as a Load Balancer Backend Address Pool ID -func ValidateLoadBalancerBackendAddressPoolID(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 := ParseLoadBalancerBackendAddressPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancer Backend Address Pool ID -func (id LoadBalancerBackendAddressPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/backendAddressPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.BackendAddressPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancer Backend Address Pool ID -func (id LoadBalancerBackendAddressPoolId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolValue"), - } -} - -// String returns a human-readable description of this Load Balancer Backend Address Pool ID -func (id LoadBalancerBackendAddressPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Backend Address Pool Name: %q", id.BackendAddressPoolName), - } - return fmt.Sprintf("Load Balancer Backend Address Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go deleted file mode 100644 index d30f52580c2..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &LoadBalancerBackendAddressPoolId{} - -func TestNewLoadBalancerBackendAddressPoolID(t *testing.T) { - id := NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.BackendAddressPoolName != "backendAddressPoolValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolValue") - } -} - -func TestFormatLoadBalancerBackendAddressPoolID(t *testing.T) { - actual := NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancerBackendAddressPoolID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerBackendAddressPoolId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &LoadBalancerBackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerBackendAddressPoolID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestParseLoadBalancerBackendAddressPoolIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerBackendAddressPoolId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &LoadBalancerBackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe", - Expected: &LoadBalancerBackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerBackendAddressPoolIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestSegmentsForLoadBalancerBackendAddressPoolId(t *testing.T) { - segments := LoadBalancerBackendAddressPoolId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancerBackendAddressPoolId 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/network/2023-05-01/loadbalancers/id_loadbalancingrule.go b/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule.go deleted file mode 100644 index 31e911e38af..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&LoadBalancingRuleId{}) -} - -var _ resourceids.ResourceId = &LoadBalancingRuleId{} - -// LoadBalancingRuleId is a struct representing the Resource ID for a Load Balancing Rule -type LoadBalancingRuleId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - LoadBalancingRuleName string -} - -// NewLoadBalancingRuleID returns a new LoadBalancingRuleId struct -func NewLoadBalancingRuleID(subscriptionId string, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) LoadBalancingRuleId { - return LoadBalancingRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - LoadBalancingRuleName: loadBalancingRuleName, - } -} - -// ParseLoadBalancingRuleID parses 'input' into a LoadBalancingRuleId -func ParseLoadBalancingRuleID(input string) (*LoadBalancingRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancingRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancingRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancingRuleIDInsensitively parses 'input' case-insensitively into a LoadBalancingRuleId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancingRuleIDInsensitively(input string) (*LoadBalancingRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancingRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancingRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancingRuleId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.LoadBalancingRuleName, ok = input.Parsed["loadBalancingRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancingRuleName", input) - } - - return nil -} - -// ValidateLoadBalancingRuleID checks that 'input' can be parsed as a Load Balancing Rule ID -func ValidateLoadBalancingRuleID(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 := ParseLoadBalancingRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancing Rule ID -func (id LoadBalancingRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/loadBalancingRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.LoadBalancingRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancing Rule ID -func (id LoadBalancingRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticLoadBalancingRules", "loadBalancingRules", "loadBalancingRules"), - resourceids.UserSpecifiedSegment("loadBalancingRuleName", "loadBalancingRuleValue"), - } -} - -// String returns a human-readable description of this Load Balancing Rule ID -func (id LoadBalancingRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Load Balancing Rule Name: %q", id.LoadBalancingRuleName), - } - return fmt.Sprintf("Load Balancing Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule_test.go deleted file mode 100644 index 0cedccca2be..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_loadbalancingrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &LoadBalancingRuleId{} - -func TestNewLoadBalancingRuleID(t *testing.T) { - id := NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.LoadBalancingRuleName != "loadBalancingRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancingRuleName'", id.LoadBalancingRuleName, "loadBalancingRuleValue") - } -} - -func TestFormatLoadBalancingRuleID(t *testing.T) { - actual := NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancingRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancingRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue", - Expected: &LoadBalancingRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - LoadBalancingRuleName: "loadBalancingRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancingRuleID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.LoadBalancingRuleName != v.Expected.LoadBalancingRuleName { - t.Fatalf("Expected %q but got %q for LoadBalancingRuleName", v.Expected.LoadBalancingRuleName, actual.LoadBalancingRuleName) - } - - } -} - -func TestParseLoadBalancingRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancingRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/lOaDbAlAnCiNgRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue", - Expected: &LoadBalancingRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - LoadBalancingRuleName: "loadBalancingRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/lOaDbAlAnCiNgRuLeS/lOaDbAlAnCiNgRuLeVaLuE", - Expected: &LoadBalancingRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - LoadBalancingRuleName: "lOaDbAlAnCiNgRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/lOaDbAlAnCiNgRuLeS/lOaDbAlAnCiNgRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancingRuleIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.LoadBalancingRuleName != v.Expected.LoadBalancingRuleName { - t.Fatalf("Expected %q but got %q for LoadBalancingRuleName", v.Expected.LoadBalancingRuleName, actual.LoadBalancingRuleName) - } - - } -} - -func TestSegmentsForLoadBalancingRuleId(t *testing.T) { - segments := LoadBalancingRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancingRuleId 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/network/2023-05-01/loadbalancers/id_location.go b/resource-manager/network/2023-05-01/loadbalancers/id_location.go deleted file mode 100644 index 4a38c5ea3e7..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package loadbalancers - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/loadbalancers/id_location_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_location_test.go deleted file mode 100644 index ea456af0f8a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package loadbalancers - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/loadbalancers/id_outboundrule.go b/resource-manager/network/2023-05-01/loadbalancers/id_outboundrule.go deleted file mode 100644 index 89837637300..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_outboundrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&OutboundRuleId{}) -} - -var _ resourceids.ResourceId = &OutboundRuleId{} - -// OutboundRuleId is a struct representing the Resource ID for a Outbound Rule -type OutboundRuleId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - OutboundRuleName string -} - -// NewOutboundRuleID returns a new OutboundRuleId struct -func NewOutboundRuleID(subscriptionId string, resourceGroupName string, loadBalancerName string, outboundRuleName string) OutboundRuleId { - return OutboundRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - OutboundRuleName: outboundRuleName, - } -} - -// ParseOutboundRuleID parses 'input' into a OutboundRuleId -func ParseOutboundRuleID(input string) (*OutboundRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&OutboundRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OutboundRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOutboundRuleIDInsensitively parses 'input' case-insensitively into a OutboundRuleId -// note: this method should only be used for API response data and not user input -func ParseOutboundRuleIDInsensitively(input string) (*OutboundRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&OutboundRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OutboundRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OutboundRuleId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.OutboundRuleName, ok = input.Parsed["outboundRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "outboundRuleName", input) - } - - return nil -} - -// ValidateOutboundRuleID checks that 'input' can be parsed as a Outbound Rule ID -func ValidateOutboundRuleID(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 := ParseOutboundRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Outbound Rule ID -func (id OutboundRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/outboundRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.OutboundRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Outbound Rule ID -func (id OutboundRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticOutboundRules", "outboundRules", "outboundRules"), - resourceids.UserSpecifiedSegment("outboundRuleName", "outboundRuleValue"), - } -} - -// String returns a human-readable description of this Outbound Rule ID -func (id OutboundRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Outbound Rule Name: %q", id.OutboundRuleName), - } - return fmt.Sprintf("Outbound Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_outboundrule_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_outboundrule_test.go deleted file mode 100644 index 9f2d3f6d83a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_outboundrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &OutboundRuleId{} - -func TestNewOutboundRuleID(t *testing.T) { - id := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.OutboundRuleName != "outboundRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'OutboundRuleName'", id.OutboundRuleName, "outboundRuleValue") - } -} - -func TestFormatOutboundRuleID(t *testing.T) { - actual := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOutboundRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OutboundRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue", - Expected: &OutboundRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - OutboundRuleName: "outboundRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOutboundRuleID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.OutboundRuleName != v.Expected.OutboundRuleName { - t.Fatalf("Expected %q but got %q for OutboundRuleName", v.Expected.OutboundRuleName, actual.OutboundRuleName) - } - - } -} - -func TestParseOutboundRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OutboundRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/oUtBoUnDrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue", - Expected: &OutboundRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - OutboundRuleName: "outboundRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/oUtBoUnDrUlEs/oUtBoUnDrUlEvAlUe", - Expected: &OutboundRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - OutboundRuleName: "oUtBoUnDrUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/oUtBoUnDrUlEs/oUtBoUnDrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOutboundRuleIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.OutboundRuleName != v.Expected.OutboundRuleName { - t.Fatalf("Expected %q but got %q for OutboundRuleName", v.Expected.OutboundRuleName, actual.OutboundRuleName) - } - - } -} - -func TestSegmentsForOutboundRuleId(t *testing.T) { - segments := OutboundRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OutboundRuleId 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/network/2023-05-01/loadbalancers/id_probe.go b/resource-manager/network/2023-05-01/loadbalancers/id_probe.go deleted file mode 100644 index 46ab09a65c9..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_probe.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&ProbeId{}) -} - -var _ resourceids.ResourceId = &ProbeId{} - -// ProbeId is a struct representing the Resource ID for a Probe -type ProbeId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - ProbeName string -} - -// NewProbeID returns a new ProbeId struct -func NewProbeID(subscriptionId string, resourceGroupName string, loadBalancerName string, probeName string) ProbeId { - return ProbeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - ProbeName: probeName, - } -} - -// ParseProbeID parses 'input' into a ProbeId -func ParseProbeID(input string) (*ProbeId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProbeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProbeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProbeIDInsensitively parses 'input' case-insensitively into a ProbeId -// note: this method should only be used for API response data and not user input -func ParseProbeIDInsensitively(input string) (*ProbeId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProbeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProbeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProbeId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.ProbeName, ok = input.Parsed["probeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "probeName", input) - } - - return nil -} - -// ValidateProbeID checks that 'input' can be parsed as a Probe ID -func ValidateProbeID(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 := ParseProbeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Probe ID -func (id ProbeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/probes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.ProbeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Probe ID -func (id ProbeId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticProbes", "probes", "probes"), - resourceids.UserSpecifiedSegment("probeName", "probeValue"), - } -} - -// String returns a human-readable description of this Probe ID -func (id ProbeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Probe Name: %q", id.ProbeName), - } - return fmt.Sprintf("Probe (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_probe_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_probe_test.go deleted file mode 100644 index 7e711899c23..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_probe_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &ProbeId{} - -func TestNewProbeID(t *testing.T) { - id := NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.ProbeName != "probeValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProbeName'", id.ProbeName, "probeValue") - } -} - -func TestFormatProbeID(t *testing.T) { - actual := NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProbeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProbeId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue", - Expected: &ProbeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - ProbeName: "probeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProbeID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.ProbeName != v.Expected.ProbeName { - t.Fatalf("Expected %q but got %q for ProbeName", v.Expected.ProbeName, actual.ProbeName) - } - - } -} - -func TestParseProbeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProbeId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/pRoBeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue", - Expected: &ProbeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - ProbeName: "probeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/pRoBeS/pRoBeVaLuE", - Expected: &ProbeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - ProbeName: "pRoBeVaLuE", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/pRoBeS/pRoBeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProbeIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.ProbeName != v.Expected.ProbeName { - t.Fatalf("Expected %q but got %q for ProbeName", v.Expected.ProbeName, actual.ProbeName) - } - - } -} - -func TestSegmentsForProbeId(t *testing.T) { - segments := ProbeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProbeId 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/network/2023-05-01/loadbalancers/id_providerloadbalancer.go b/resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer.go deleted file mode 100644 index 88ab98c83ad..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer.go +++ /dev/null @@ -1,130 +0,0 @@ -package loadbalancers - -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(&ProviderLoadBalancerId{}) -} - -var _ resourceids.ResourceId = &ProviderLoadBalancerId{} - -// ProviderLoadBalancerId is a struct representing the Resource ID for a Provider Load Balancer -type ProviderLoadBalancerId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string -} - -// NewProviderLoadBalancerID returns a new ProviderLoadBalancerId struct -func NewProviderLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) ProviderLoadBalancerId { - return ProviderLoadBalancerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - } -} - -// ParseProviderLoadBalancerID parses 'input' into a ProviderLoadBalancerId -func ParseProviderLoadBalancerID(input string) (*ProviderLoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLoadBalancerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLoadBalancerIDInsensitively parses 'input' case-insensitively into a ProviderLoadBalancerId -// note: this method should only be used for API response data and not user input -func ParseProviderLoadBalancerIDInsensitively(input string) (*ProviderLoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLoadBalancerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - return nil -} - -// ValidateProviderLoadBalancerID checks that 'input' can be parsed as a Provider Load Balancer ID -func ValidateProviderLoadBalancerID(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 := ParseProviderLoadBalancerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Load Balancer ID -func (id ProviderLoadBalancerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Load Balancer ID -func (id ProviderLoadBalancerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - } -} - -// String returns a human-readable description of this Provider Load Balancer ID -func (id ProviderLoadBalancerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - } - return fmt.Sprintf("Provider Load Balancer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer_test.go b/resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer_test.go deleted file mode 100644 index e721a740f82..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/id_providerloadbalancer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadbalancers - -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 = &ProviderLoadBalancerId{} - -func TestNewProviderLoadBalancerID(t *testing.T) { - id := NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } -} - -func TestFormatProviderLoadBalancerID(t *testing.T) { - actual := NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLoadBalancerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLoadBalancerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestParseProviderLoadBalancerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLoadBalancerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestSegmentsForProviderLoadBalancerId(t *testing.T) { - segments := ProviderLoadBalancerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLoadBalancerId 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/network/2023-05-01/loadbalancers/method_createorupdate.go b/resource-manager/network/2023-05-01/loadbalancers/method_createorupdate.go deleted file mode 100644 index 891038c3395..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 *LoadBalancer -} - -// CreateOrUpdate ... -func (c LoadBalancersClient) CreateOrUpdate(ctx context.Context, id ProviderLoadBalancerId, input LoadBalancer) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) CreateOrUpdateThenPoll(ctx context.Context, id ProviderLoadBalancerId, input LoadBalancer) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/loadbalancers/method_delete.go b/resource-manager/network/2023-05-01/loadbalancers/method_delete.go deleted file mode 100644 index bf7acc08d90..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 LoadBalancersClient) Delete(ctx context.Context, id ProviderLoadBalancerId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LoadBalancersClient) DeleteThenPoll(ctx context.Context, id ProviderLoadBalancerId) 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/network/2023-05-01/loadbalancers/method_get.go b/resource-manager/network/2023-05-01/loadbalancers/method_get.go deleted file mode 100644 index a183aa5c7ae..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package loadbalancers - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *LoadBalancer -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c LoadBalancersClient) Get(ctx context.Context, id ProviderLoadBalancerId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 LoadBalancer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulescreateorupdate.go b/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulescreateorupdate.go deleted file mode 100644 index e052f632164..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 InboundNatRulesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *InboundNatRule -} - -// InboundNatRulesCreateOrUpdate ... -func (c LoadBalancersClient) InboundNatRulesCreateOrUpdate(ctx context.Context, id InboundNatRuleId, input InboundNatRule) (result InboundNatRulesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// InboundNatRulesCreateOrUpdateThenPoll performs InboundNatRulesCreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) InboundNatRulesCreateOrUpdateThenPoll(ctx context.Context, id InboundNatRuleId, input InboundNatRule) error { - result, err := c.InboundNatRulesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing InboundNatRulesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InboundNatRulesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesdelete.go b/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesdelete.go deleted file mode 100644 index 2d19b62f757..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 InboundNatRulesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// InboundNatRulesDelete ... -func (c LoadBalancersClient) InboundNatRulesDelete(ctx context.Context, id InboundNatRuleId) (result InboundNatRulesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// InboundNatRulesDeleteThenPoll performs InboundNatRulesDelete then polls until it's completed -func (c LoadBalancersClient) InboundNatRulesDeleteThenPoll(ctx context.Context, id InboundNatRuleId) error { - result, err := c.InboundNatRulesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing InboundNatRulesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InboundNatRulesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesget.go b/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesget.go deleted file mode 100644 index 06666b1d382..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatrulesget.go +++ /dev/null @@ -1,83 +0,0 @@ -package loadbalancers - -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 InboundNatRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *InboundNatRule -} - -type InboundNatRulesGetOperationOptions struct { - Expand *string -} - -func DefaultInboundNatRulesGetOperationOptions() InboundNatRulesGetOperationOptions { - return InboundNatRulesGetOperationOptions{} -} - -func (o InboundNatRulesGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o InboundNatRulesGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o InboundNatRulesGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// InboundNatRulesGet ... -func (c LoadBalancersClient) InboundNatRulesGet(ctx context.Context, id InboundNatRuleId, options InboundNatRulesGetOperationOptions) (result InboundNatRulesGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 InboundNatRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatruleslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatruleslist.go deleted file mode 100644 index e4b3847d83e..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_inboundnatruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 InboundNatRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]InboundNatRule -} - -type InboundNatRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []InboundNatRule -} - -// InboundNatRulesList ... -func (c LoadBalancersClient) InboundNatRulesList(ctx context.Context, id ProviderLoadBalancerId) (result InboundNatRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/inboundNatRules", 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 *[]InboundNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// InboundNatRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) InboundNatRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (InboundNatRulesListCompleteResult, error) { - return c.InboundNatRulesListCompleteMatchingPredicate(ctx, id, InboundNatRuleOperationPredicate{}) -} - -// InboundNatRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) InboundNatRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate InboundNatRuleOperationPredicate) (result InboundNatRulesListCompleteResult, err error) { - items := make([]InboundNatRule, 0) - - resp, err := c.InboundNatRulesList(ctx, id) - if err != nil { - 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 = InboundNatRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_list.go b/resource-manager/network/2023-05-01/loadbalancers/method_list.go deleted file mode 100644 index fb130044cb5..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package loadbalancers - -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 *[]LoadBalancer -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancer -} - -// List ... -func (c LoadBalancersClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/loadBalancers", 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 *[]LoadBalancer `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 LoadBalancersClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, LoadBalancerOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LoadBalancerOperationPredicate) (result ListCompleteResult, err error) { - items := make([]LoadBalancer, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/loadbalancers/method_listall.go b/resource-manager/network/2023-05-01/loadbalancers/method_listall.go deleted file mode 100644 index 674e5b649f7..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package loadbalancers - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancer -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancer -} - -// ListAll ... -func (c LoadBalancersClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/loadBalancers", 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 *[]LoadBalancer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c LoadBalancersClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, LoadBalancerOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LoadBalancerOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]LoadBalancer, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_listinboundnatruleportmappings.go b/resource-manager/network/2023-05-01/loadbalancers/method_listinboundnatruleportmappings.go deleted file mode 100644 index 967f42debed..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_listinboundnatruleportmappings.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 ListInboundNatRulePortMappingsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BackendAddressInboundNatRulePortMappings -} - -// ListInboundNatRulePortMappings ... -func (c LoadBalancersClient) ListInboundNatRulePortMappings(ctx context.Context, id BackendAddressPoolId, input QueryInboundNatRulePortMappingRequest) (result ListInboundNatRulePortMappingsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryInboundNatRulePortMapping", 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 -} - -// ListInboundNatRulePortMappingsThenPoll performs ListInboundNatRulePortMappings then polls until it's completed -func (c LoadBalancersClient) ListInboundNatRulePortMappingsThenPoll(ctx context.Context, id BackendAddressPoolId, input QueryInboundNatRulePortMappingRequest) error { - result, err := c.ListInboundNatRulePortMappings(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ListInboundNatRulePortMappings: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ListInboundNatRulePortMappings: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go deleted file mode 100644 index 3f34a765cbf..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsCreateOrUpdate ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsCreateOrUpdate(ctx context.Context, id LoadBalancerBackendAddressPoolId, input BackendAddressPool) (result LoadBalancerBackendAddressPoolsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll performs LoadBalancerBackendAddressPoolsCreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx context.Context, id LoadBalancerBackendAddressPoolId, input BackendAddressPool) error { - result, err := c.LoadBalancerBackendAddressPoolsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing LoadBalancerBackendAddressPoolsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after LoadBalancerBackendAddressPoolsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go deleted file mode 100644 index 748b8b97657..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// LoadBalancerBackendAddressPoolsDelete ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsDelete(ctx context.Context, id LoadBalancerBackendAddressPoolId) (result LoadBalancerBackendAddressPoolsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// LoadBalancerBackendAddressPoolsDeleteThenPoll performs LoadBalancerBackendAddressPoolsDelete then polls until it's completed -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsDeleteThenPoll(ctx context.Context, id LoadBalancerBackendAddressPoolId) error { - result, err := c.LoadBalancerBackendAddressPoolsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing LoadBalancerBackendAddressPoolsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after LoadBalancerBackendAddressPoolsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go deleted file mode 100644 index 96451e22451..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsGet ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsGet(ctx context.Context, id LoadBalancerBackendAddressPoolId) (result LoadBalancerBackendAddressPoolsGetOperationResponse, 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 BackendAddressPool - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go deleted file mode 100644 index 7f6204b9606..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BackendAddressPool -} - -type LoadBalancerBackendAddressPoolsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsList ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerBackendAddressPoolsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/backendAddressPools", 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 *[]BackendAddressPool `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerBackendAddressPoolsListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerBackendAddressPoolsListCompleteResult, error) { - return c.LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx, id, BackendAddressPoolOperationPredicate{}) -} - -// LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate BackendAddressPoolOperationPredicate) (result LoadBalancerBackendAddressPoolsListCompleteResult, err error) { - items := make([]BackendAddressPool, 0) - - resp, err := c.LoadBalancerBackendAddressPoolsList(ctx, id) - if err != nil { - 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 = LoadBalancerBackendAddressPoolsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go deleted file mode 100644 index eeb2cc8b0ed..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerFrontendIPConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfigurationsGet ... -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsGet(ctx context.Context, id FrontendIPConfigurationId) (result LoadBalancerFrontendIPConfigurationsGetOperationResponse, 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 FrontendIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go deleted file mode 100644 index afce18597ba..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerFrontendIPConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FrontendIPConfiguration -} - -type LoadBalancerFrontendIPConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfigurationsList ... -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerFrontendIPConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/frontendIPConfigurations", 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 *[]FrontendIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerFrontendIPConfigurationsListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerFrontendIPConfigurationsListCompleteResult, error) { - return c.LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx, id, FrontendIPConfigurationOperationPredicate{}) -} - -// LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate FrontendIPConfigurationOperationPredicate) (result LoadBalancerFrontendIPConfigurationsListCompleteResult, err error) { - items := make([]FrontendIPConfiguration, 0) - - resp, err := c.LoadBalancerFrontendIPConfigurationsList(ctx, id) - if err != nil { - 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 = LoadBalancerFrontendIPConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go deleted file mode 100644 index 265ec20a693..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerLoadBalancingRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *LoadBalancingRule -} - -// LoadBalancerLoadBalancingRulesGet ... -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesGet(ctx context.Context, id LoadBalancingRuleId) (result LoadBalancerLoadBalancingRulesGetOperationResponse, 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 LoadBalancingRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go deleted file mode 100644 index 0bc29256da8..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerLoadBalancingRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancingRule -} - -type LoadBalancerLoadBalancingRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancingRule -} - -// LoadBalancerLoadBalancingRulesList ... -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerLoadBalancingRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/loadBalancingRules", 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 *[]LoadBalancingRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerLoadBalancingRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerLoadBalancingRulesListCompleteResult, error) { - return c.LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx, id, LoadBalancingRuleOperationPredicate{}) -} - -// LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate LoadBalancingRuleOperationPredicate) (result LoadBalancerLoadBalancingRulesListCompleteResult, err error) { - items := make([]LoadBalancingRule, 0) - - resp, err := c.LoadBalancerLoadBalancingRulesList(ctx, id) - if err != nil { - 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 = LoadBalancerLoadBalancingRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go deleted file mode 100644 index 90c70aa0330..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerNetworkInterfacesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type LoadBalancerNetworkInterfacesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// LoadBalancerNetworkInterfacesList ... -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerNetworkInterfacesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerNetworkInterfacesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerNetworkInterfacesListCompleteResult, error) { - return c.LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// LoadBalancerNetworkInterfacesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate NetworkInterfaceOperationPredicate) (result LoadBalancerNetworkInterfacesListCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.LoadBalancerNetworkInterfacesList(ctx, id) - if err != nil { - 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 = LoadBalancerNetworkInterfacesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundrulesget.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundrulesget.go deleted file mode 100644 index 5e221d46329..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerOutboundRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *OutboundRule -} - -// LoadBalancerOutboundRulesGet ... -func (c LoadBalancersClient) LoadBalancerOutboundRulesGet(ctx context.Context, id OutboundRuleId) (result LoadBalancerOutboundRulesGetOperationResponse, 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 OutboundRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundruleslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundruleslist.go deleted file mode 100644 index b0e91ba7b50..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalanceroutboundruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerOutboundRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]OutboundRule -} - -type LoadBalancerOutboundRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []OutboundRule -} - -// LoadBalancerOutboundRulesList ... -func (c LoadBalancersClient) LoadBalancerOutboundRulesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerOutboundRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/outboundRules", 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 *[]OutboundRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerOutboundRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerOutboundRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerOutboundRulesListCompleteResult, error) { - return c.LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx, id, OutboundRuleOperationPredicate{}) -} - -// LoadBalancerOutboundRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate OutboundRuleOperationPredicate) (result LoadBalancerOutboundRulesListCompleteResult, err error) { - items := make([]OutboundRule, 0) - - resp, err := c.LoadBalancerOutboundRulesList(ctx, id) - if err != nil { - 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 = LoadBalancerOutboundRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobesget.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobesget.go deleted file mode 100644 index 2901255109e..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerProbesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Probe -} - -// LoadBalancerProbesGet ... -func (c LoadBalancersClient) LoadBalancerProbesGet(ctx context.Context, id ProbeId) (result LoadBalancerProbesGetOperationResponse, 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 Probe - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobeslist.go b/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobeslist.go deleted file mode 100644 index c0852a82dad..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_loadbalancerprobeslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerProbesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Probe -} - -type LoadBalancerProbesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Probe -} - -// LoadBalancerProbesList ... -func (c LoadBalancersClient) LoadBalancerProbesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerProbesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/probes", 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 *[]Probe `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerProbesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerProbesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerProbesListCompleteResult, error) { - return c.LoadBalancerProbesListCompleteMatchingPredicate(ctx, id, ProbeOperationPredicate{}) -} - -// LoadBalancerProbesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerProbesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate ProbeOperationPredicate) (result LoadBalancerProbesListCompleteResult, err error) { - items := make([]Probe, 0) - - resp, err := c.LoadBalancerProbesList(ctx, id) - if err != nil { - 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 = LoadBalancerProbesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_migratetoipbased.go b/resource-manager/network/2023-05-01/loadbalancers/method_migratetoipbased.go deleted file mode 100644 index 249adebb4a8..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_migratetoipbased.go +++ /dev/null @@ -1,59 +0,0 @@ -package loadbalancers - -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 MigrateToIPBasedOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MigratedPools -} - -// MigrateToIPBased ... -func (c LoadBalancersClient) MigrateToIPBased(ctx context.Context, id LoadBalancerId, input MigrateLoadBalancerToIPBasedRequest) (result MigrateToIPBasedOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/migrateToIpBased", 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 MigratedPools - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_swappublicipaddresses.go b/resource-manager/network/2023-05-01/loadbalancers/method_swappublicipaddresses.go deleted file mode 100644 index ea34d09163d..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_swappublicipaddresses.go +++ /dev/null @@ -1,74 +0,0 @@ -package loadbalancers - -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 SwapPublicIPAddressesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SwapPublicIPAddresses ... -func (c LoadBalancersClient) SwapPublicIPAddresses(ctx context.Context, id LocationId, input LoadBalancerVipSwapRequest) (result SwapPublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/setLoadBalancerFrontendPublicIpAddresses", 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 -} - -// SwapPublicIPAddressesThenPoll performs SwapPublicIPAddresses then polls until it's completed -func (c LoadBalancersClient) SwapPublicIPAddressesThenPoll(ctx context.Context, id LocationId, input LoadBalancerVipSwapRequest) error { - result, err := c.SwapPublicIPAddresses(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SwapPublicIPAddresses: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SwapPublicIPAddresses: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/method_updatetags.go b/resource-manager/network/2023-05-01/loadbalancers/method_updatetags.go deleted file mode 100644 index dd8a4561326..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package loadbalancers - -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 *LoadBalancer -} - -// UpdateTags ... -func (c LoadBalancersClient) UpdateTags(ctx context.Context, id ProviderLoadBalancerId, 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 LoadBalancer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddress.go deleted file mode 100644 index ba8ecb73101..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index ae525920084..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 339eab474ad..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 85af1e99371..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index ba22dcca046..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygroup.go deleted file mode 100644 index a39478d2c00..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 6ab25279d91..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go b/resource-manager/network/2023-05-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go deleted file mode 100644 index 4e124f8b471..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressInboundNatRulePortMappings struct { - InboundNatRulePortMappings *[]InboundNatRulePortMapping `json:"inboundNatRulePortMappings,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspool.go b/resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspool.go deleted file mode 100644 index f21aa313263..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 6ce42b19e79..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index bdb38484c9a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_ddossettings.go b/resource-manager/network/2023-05-01/loadbalancers/model_ddossettings.go deleted file mode 100644 index 49f08256215..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_delegation.go b/resource-manager/network/2023-05-01/loadbalancers/model_delegation.go deleted file mode 100644 index ca1a156ae30..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_flowlog.go b/resource-manager/network/2023-05-01/loadbalancers/model_flowlog.go deleted file mode 100644 index 90210c29260..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/loadbalancers/model_flowlogformatparameters.go deleted file mode 100644 index fa0c6c067e8..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_flowlogpropertiesformat.go deleted file mode 100644 index 4c800ad5f68..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfiguration.go deleted file mode 100644 index aee3ea162e5..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package loadbalancers - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 3ec56d01ffe..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 0b58f57fe92..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpool.go b/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpool.go deleted file mode 100644 index d89dc6f5777..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpool.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpoolpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpoolpropertiesformat.go deleted file mode 100644 index df78a1ed77a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatpoolpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPoolPropertiesFormat struct { - BackendPort int64 `json:"backendPort"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPortRangeEnd int64 `json:"frontendPortRangeEnd"` - FrontendPortRangeStart int64 `json:"frontendPortRangeStart"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrule.go b/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrule.go deleted file mode 100644 index adb4dbeea97..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatruleportmapping.go b/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatruleportmapping.go deleted file mode 100644 index f2e3789517f..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatruleportmapping.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 3e2eb61ad03..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_ipconfiguration.go deleted file mode 100644 index 8d6200049ae..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofile.go deleted file mode 100644 index 96c0f6e1f83..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 42790e1043c..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 4d288c5dd29..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_iptag.go b/resource-manager/network/2023-05-01/loadbalancers/model_iptag.go deleted file mode 100644 index bf32e63b59f..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// 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/network/2023-05-01/loadbalancers/model_loadbalancer.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancer.go deleted file mode 100644 index 76572914bb6..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancer.go +++ /dev/null @@ -1,20 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancer struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - Sku *LoadBalancerSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddress.go deleted file mode 100644 index c85572e3101..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 92e1899840b..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerpropertiesformat.go deleted file mode 100644 index 7ffa00517b8..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancerpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerPropertiesFormat struct { - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - Probes *[]Probe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancersku.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancersku.go deleted file mode 100644 index 1575eae78c5..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerSku struct { - Name *LoadBalancerSkuName `json:"name,omitempty"` - Tier *LoadBalancerSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequest.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequest.go deleted file mode 100644 index 8bea43b7a0d..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerVipSwapRequest struct { - FrontendIPConfigurations *[]LoadBalancerVipSwapRequestFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go deleted file mode 100644 index fd4e68458a9..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { - Id *string `json:"id,omitempty"` - Properties *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go deleted file mode 100644 index 56e8c5d7e4e..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrule.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrule.go deleted file mode 100644 index ff651417937..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrulepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrulepropertiesformat.go deleted file mode 100644 index 4b1908352dd..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_loadbalancingrulepropertiesformat.go +++ /dev/null @@ -1,20 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort int64 `json:"frontendPort"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LoadDistribution *LoadDistribution `json:"loadDistribution,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_migratedpools.go b/resource-manager/network/2023-05-01/loadbalancers/model_migratedpools.go deleted file mode 100644 index 043a11e0729..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_migratedpools.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MigratedPools struct { - MigratedPools *[]string `json:"migratedPools,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go b/resource-manager/network/2023-05-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go deleted file mode 100644 index 7b22e45af7d..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MigrateLoadBalancerToIPBasedRequest struct { - Pools *[]string `json:"pools,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_natgateway.go b/resource-manager/network/2023-05-01/loadbalancers/model_natgateway.go deleted file mode 100644 index 0eb10d867d8..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package loadbalancers - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_natgatewaypropertiesformat.go deleted file mode 100644 index 4903d67cdc0..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_natgatewaysku.go b/resource-manager/network/2023-05-01/loadbalancers/model_natgatewaysku.go deleted file mode 100644 index d503f4fbbfb..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_natruleportmapping.go b/resource-manager/network/2023-05-01/loadbalancers/model_natruleportmapping.go deleted file mode 100644 index d0afcac5584..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterface.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterface.go deleted file mode 100644 index 3a7fc490368..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacednssettings.go deleted file mode 100644 index 91dbc787d0a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 60978bfaf56..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 6dcb491a3d7..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index d0e35f43bfb..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 2923295fe73..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 86c1f45766f..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 60f5f46a243..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygroup.go deleted file mode 100644 index e4baa9839d3..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index a3c43420ed8..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_outboundrule.go b/resource-manager/network/2023-05-01/loadbalancers/model_outboundrule.go deleted file mode 100644 index 1dfd6977a6a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_outboundrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OutboundRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_outboundrulepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_outboundrulepropertiesformat.go deleted file mode 100644 index 3c7b13886c0..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_outboundrulepropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRulePropertiesFormat struct { - AllocatedOutboundPorts *int64 `json:"allocatedOutboundPorts,omitempty"` - BackendAddressPool SubResource `json:"backendAddressPool"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfigurations []SubResource `json:"frontendIPConfigurations"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol LoadBalancerOutboundRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpoint.go b/resource-manager/network/2023-05-01/loadbalancers/model_privateendpoint.go deleted file mode 100644 index 1b7d03d287c..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnection.go deleted file mode 100644 index 4324f758e00..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/loadbalancers/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnectionproperties.go deleted file mode 100644 index 0db98da1f3a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfiguration.go deleted file mode 100644 index 5bae49165b4..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 7b4d544edd6..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointproperties.go deleted file mode 100644 index b949c31f69e..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkservice.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkservice.go deleted file mode 100644 index 90ac8b3e5ca..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnection.go deleted file mode 100644 index 7657685128f..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 047e30a886a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index a4eb6e38f9b..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index fef899c9ed5..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 0209c2ffc37..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceproperties.go deleted file mode 100644 index f3e3d05de18..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_probe.go b/resource-manager/network/2023-05-01/loadbalancers/model_probe.go deleted file mode 100644 index 07c805bf4b6..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_probe.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Probe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_probepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_probepropertiesformat.go deleted file mode 100644 index ddc84044699..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_probepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProbePropertiesFormat struct { - IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - NumberOfProbes *int64 `json:"numberOfProbes,omitempty"` - Port int64 `json:"port"` - ProbeThreshold *int64 `json:"probeThreshold,omitempty"` - Protocol ProbeProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestPath *string `json:"requestPath,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddress.go b/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddress.go deleted file mode 100644 index bdc0de0a218..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddressdnssettings.go deleted file mode 100644 index 270d14db8a5..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 5a73a6d016d..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresssku.go deleted file mode 100644 index b15c3f179cf..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go b/resource-manager/network/2023-05-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go deleted file mode 100644 index 537750e7e89..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryInboundNatRulePortMappingRequest struct { - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlink.go deleted file mode 100644 index 264f22dde08..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlinkformat.go deleted file mode 100644 index 4b34d1eca84..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_resourceset.go b/resource-manager/network/2023-05-01/loadbalancers/model_resourceset.go deleted file mode 100644 index 6d37b1b6861..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/loadbalancers/model_retentionpolicyparameters.go deleted file mode 100644 index 36d6b05e540..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_route.go b/resource-manager/network/2023-05-01/loadbalancers/model_route.go deleted file mode 100644 index 60ee56ca15b..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_routepropertiesformat.go deleted file mode 100644 index dad41f27203..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_routetable.go b/resource-manager/network/2023-05-01/loadbalancers/model_routetable.go deleted file mode 100644 index e6d4f4faa3d..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_routetablepropertiesformat.go deleted file mode 100644 index 1169823e36a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_securityrule.go b/resource-manager/network/2023-05-01/loadbalancers/model_securityrule.go deleted file mode 100644 index 1bd37068862..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_securityrulepropertiesformat.go deleted file mode 100644 index 000a9d8a16f..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlink.go deleted file mode 100644 index 880f8a061c0..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 5984df7dfe6..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 18a1fb457e6..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicy.go deleted file mode 100644 index 00941b4063a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinition.go deleted file mode 100644 index b1f2f8e3300..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 0f54d85448c..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 74afcc602fc..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5610d7f722b..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_subnet.go b/resource-manager/network/2023-05-01/loadbalancers/model_subnet.go deleted file mode 100644 index 802fd17a35b..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_subnetpropertiesformat.go deleted file mode 100644 index 3745628cad5..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_subresource.go b/resource-manager/network/2023-05-01/loadbalancers/model_subresource.go deleted file mode 100644 index e288e1dcb19..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_tagsobject.go b/resource-manager/network/2023-05-01/loadbalancers/model_tagsobject.go deleted file mode 100644 index 6b83deef865..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// 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/network/2023-05-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index ecbf7509a1e..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsproperties.go deleted file mode 100644 index 2503ab90312..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktap.go deleted file mode 100644 index ca9e2389b65..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 5cac0b1e63a..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/loadbalancers/predicates.go b/resource-manager/network/2023-05-01/loadbalancers/predicates.go deleted file mode 100644 index 82f247704c6..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/predicates.go +++ /dev/null @@ -1,238 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BackendAddressPoolOperationPredicate) Matches(input BackendAddressPool) 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.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 FrontendIPConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p FrontendIPConfigurationOperationPredicate) Matches(input FrontendIPConfiguration) 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.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 InboundNatRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p InboundNatRuleOperationPredicate) Matches(input InboundNatRule) 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.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 LoadBalancerOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p LoadBalancerOperationPredicate) Matches(input LoadBalancer) 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 && (input.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 LoadBalancingRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p LoadBalancingRuleOperationPredicate) Matches(input LoadBalancingRule) 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.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 NetworkInterfaceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkInterfaceOperationPredicate) Matches(input NetworkInterface) 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 && (input.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 OutboundRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p OutboundRuleOperationPredicate) Matches(input OutboundRule) 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.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 ProbeOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ProbeOperationPredicate) Matches(input Probe) 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.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/network/2023-05-01/loadbalancers/version.go b/resource-manager/network/2023-05-01/loadbalancers/version.go deleted file mode 100644 index 08213c6de10..00000000000 --- a/resource-manager/network/2023-05-01/loadbalancers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/loadbalancers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/README.md b/resource-manager/network/2023-05-01/localnetworkgateways/README.md deleted file mode 100644 index c231b4a395f..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/README.md +++ /dev/null @@ -1,104 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/localnetworkgateways` Documentation - -The `localnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/localnetworkgateways" -``` - - -### Client Initialization - -```go -client := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LocalNetworkGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -payload := localnetworkgateways.LocalNetworkGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LocalNetworkGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LocalNetworkGatewaysClient.Get` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -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: `LocalNetworkGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LocalNetworkGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -payload := localnetworkgateways.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/network/2023-05-01/localnetworkgateways/client.go b/resource-manager/network/2023-05-01/localnetworkgateways/client.go deleted file mode 100644 index 90a3468c9f3..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package localnetworkgateways - -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 LocalNetworkGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewLocalNetworkGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*LocalNetworkGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "localnetworkgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LocalNetworkGatewaysClient: %+v", err) - } - - return &LocalNetworkGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/constants.go b/resource-manager/network/2023-05-01/localnetworkgateways/constants.go deleted file mode 100644 index f82efef3b1f..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package localnetworkgateways - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway.go b/resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway.go deleted file mode 100644 index b3c0d3a0339..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package localnetworkgateways - -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(&LocalNetworkGatewayId{}) -} - -var _ resourceids.ResourceId = &LocalNetworkGatewayId{} - -// LocalNetworkGatewayId is a struct representing the Resource ID for a Local Network Gateway -type LocalNetworkGatewayId struct { - SubscriptionId string - ResourceGroupName string - LocalNetworkGatewayName string -} - -// NewLocalNetworkGatewayID returns a new LocalNetworkGatewayId struct -func NewLocalNetworkGatewayID(subscriptionId string, resourceGroupName string, localNetworkGatewayName string) LocalNetworkGatewayId { - return LocalNetworkGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocalNetworkGatewayName: localNetworkGatewayName, - } -} - -// ParseLocalNetworkGatewayID parses 'input' into a LocalNetworkGatewayId -func ParseLocalNetworkGatewayID(input string) (*LocalNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocalNetworkGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocalNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLocalNetworkGatewayIDInsensitively parses 'input' case-insensitively into a LocalNetworkGatewayId -// note: this method should only be used for API response data and not user input -func ParseLocalNetworkGatewayIDInsensitively(input string) (*LocalNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocalNetworkGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocalNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LocalNetworkGatewayId) 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.LocalNetworkGatewayName, ok = input.Parsed["localNetworkGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "localNetworkGatewayName", input) - } - - return nil -} - -// ValidateLocalNetworkGatewayID checks that 'input' can be parsed as a Local Network Gateway ID -func ValidateLocalNetworkGatewayID(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 := ParseLocalNetworkGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Local Network Gateway ID -func (id LocalNetworkGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/localNetworkGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocalNetworkGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Local Network Gateway ID -func (id LocalNetworkGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocalNetworkGateways", "localNetworkGateways", "localNetworkGateways"), - resourceids.UserSpecifiedSegment("localNetworkGatewayName", "localNetworkGatewayValue"), - } -} - -// String returns a human-readable description of this Local Network Gateway ID -func (id LocalNetworkGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Local Network Gateway Name: %q", id.LocalNetworkGatewayName), - } - return fmt.Sprintf("Local Network Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway_test.go b/resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway_test.go deleted file mode 100644 index f1ee1ad0e64..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/id_localnetworkgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package localnetworkgateways - -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 = &LocalNetworkGatewayId{} - -func TestNewLocalNetworkGatewayID(t *testing.T) { - id := NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - - 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.LocalNetworkGatewayName != "localNetworkGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocalNetworkGatewayName'", id.LocalNetworkGatewayName, "localNetworkGatewayValue") - } -} - -func TestFormatLocalNetworkGatewayID(t *testing.T) { - actual := NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLocalNetworkGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocalNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue", - Expected: &LocalNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocalNetworkGatewayName: "localNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocalNetworkGatewayID(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.LocalNetworkGatewayName != v.Expected.LocalNetworkGatewayName { - t.Fatalf("Expected %q but got %q for LocalNetworkGatewayName", v.Expected.LocalNetworkGatewayName, actual.LocalNetworkGatewayName) - } - - } -} - -func TestParseLocalNetworkGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocalNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAlNeTwOrKgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue", - Expected: &LocalNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocalNetworkGatewayName: "localNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAlNeTwOrKgAtEwAyS/lOcAlNeTwOrKgAtEwAyVaLuE", - Expected: &LocalNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocalNetworkGatewayName: "lOcAlNeTwOrKgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/lOcAlNeTwOrKgAtEwAyS/lOcAlNeTwOrKgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocalNetworkGatewayIDInsensitively(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.LocalNetworkGatewayName != v.Expected.LocalNetworkGatewayName { - t.Fatalf("Expected %q but got %q for LocalNetworkGatewayName", v.Expected.LocalNetworkGatewayName, actual.LocalNetworkGatewayName) - } - - } -} - -func TestSegmentsForLocalNetworkGatewayId(t *testing.T) { - segments := LocalNetworkGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LocalNetworkGatewayId 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/network/2023-05-01/localnetworkgateways/method_createorupdate.go b/resource-manager/network/2023-05-01/localnetworkgateways/method_createorupdate.go deleted file mode 100644 index 1b41558abaa..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package localnetworkgateways - -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 *LocalNetworkGateway -} - -// CreateOrUpdate ... -func (c LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, id LocalNetworkGatewayId, input LocalNetworkGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LocalNetworkGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id LocalNetworkGatewayId, input LocalNetworkGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/localnetworkgateways/method_delete.go b/resource-manager/network/2023-05-01/localnetworkgateways/method_delete.go deleted file mode 100644 index 2b155d2b9e7..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package localnetworkgateways - -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 LocalNetworkGatewaysClient) Delete(ctx context.Context, id LocalNetworkGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LocalNetworkGatewaysClient) DeleteThenPoll(ctx context.Context, id LocalNetworkGatewayId) 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/network/2023-05-01/localnetworkgateways/method_get.go b/resource-manager/network/2023-05-01/localnetworkgateways/method_get.go deleted file mode 100644 index 08da8072f93..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package localnetworkgateways - -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 *LocalNetworkGateway -} - -// Get ... -func (c LocalNetworkGatewaysClient) Get(ctx context.Context, id LocalNetworkGatewayId) (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 LocalNetworkGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/method_list.go b/resource-manager/network/2023-05-01/localnetworkgateways/method_list.go deleted file mode 100644 index b33751a1a6c..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package localnetworkgateways - -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 *[]LocalNetworkGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LocalNetworkGateway -} - -// List ... -func (c LocalNetworkGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/localNetworkGateways", 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 *[]LocalNetworkGateway `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 LocalNetworkGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, LocalNetworkGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LocalNetworkGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LocalNetworkGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]LocalNetworkGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/localnetworkgateways/method_updatetags.go b/resource-manager/network/2023-05-01/localnetworkgateways/method_updatetags.go deleted file mode 100644 index c20950665de..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package localnetworkgateways - -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 *LocalNetworkGateway -} - -// UpdateTags ... -func (c LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, id LocalNetworkGatewayId, 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 LocalNetworkGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/model_addressspace.go b/resource-manager/network/2023-05-01/localnetworkgateways/model_addressspace.go deleted file mode 100644 index 232140416bf..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/model_bgpsettings.go b/resource-manager/network/2023-05-01/localnetworkgateways/model_bgpsettings.go deleted file mode 100644 index 9d3dfccb4b1..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-05-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index 4778a80b432..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgateway.go b/resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgateway.go deleted file mode 100644 index 684fe705afc..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties LocalNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go deleted file mode 100644 index fb7a91a8c71..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGatewayPropertiesFormat struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/localnetworkgateways/model_tagsobject.go b/resource-manager/network/2023-05-01/localnetworkgateways/model_tagsobject.go deleted file mode 100644 index 214a0886d9b..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package localnetworkgateways - -// 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/network/2023-05-01/localnetworkgateways/predicates.go b/resource-manager/network/2023-05-01/localnetworkgateways/predicates.go deleted file mode 100644 index d4e529f8a9c..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p LocalNetworkGatewayOperationPredicate) Matches(input LocalNetworkGateway) 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 && (input.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/network/2023-05-01/localnetworkgateways/version.go b/resource-manager/network/2023-05-01/localnetworkgateways/version.go deleted file mode 100644 index cdeb592b69d..00000000000 --- a/resource-manager/network/2023-05-01/localnetworkgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package localnetworkgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/localnetworkgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/natgateways/README.md b/resource-manager/network/2023-05-01/natgateways/README.md deleted file mode 100644 index 77347324a09..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/natgateways` Documentation - -The `natgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/natgateways" -``` - - -### Client Initialization - -```go -client := natgateways.NewNatGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NatGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -payload := natgateways.NatGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NatGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NatGatewaysClient.Get` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -read, err := client.Get(ctx, id, natgateways.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NatGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NatGatewaysClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NatGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -payload := natgateways.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/network/2023-05-01/natgateways/client.go b/resource-manager/network/2023-05-01/natgateways/client.go deleted file mode 100644 index 10d7c1f9e5f..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package natgateways - -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 NatGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewNatGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*NatGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "natgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NatGatewaysClient: %+v", err) - } - - return &NatGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/natgateways/constants.go b/resource-manager/network/2023-05-01/natgateways/constants.go deleted file mode 100644 index db752936aa3..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/constants.go +++ /dev/null @@ -1,95 +0,0 @@ -package natgateways - -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 NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/natgateways/id_natgateway.go b/resource-manager/network/2023-05-01/natgateways/id_natgateway.go deleted file mode 100644 index 95f33162e5e..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/id_natgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package natgateways - -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(&NatGatewayId{}) -} - -var _ resourceids.ResourceId = &NatGatewayId{} - -// NatGatewayId is a struct representing the Resource ID for a Nat Gateway -type NatGatewayId struct { - SubscriptionId string - ResourceGroupName string - NatGatewayName string -} - -// NewNatGatewayID returns a new NatGatewayId struct -func NewNatGatewayID(subscriptionId string, resourceGroupName string, natGatewayName string) NatGatewayId { - return NatGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NatGatewayName: natGatewayName, - } -} - -// ParseNatGatewayID parses 'input' into a NatGatewayId -func ParseNatGatewayID(input string) (*NatGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNatGatewayIDInsensitively parses 'input' case-insensitively into a NatGatewayId -// note: this method should only be used for API response data and not user input -func ParseNatGatewayIDInsensitively(input string) (*NatGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NatGatewayId) 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.NatGatewayName, ok = input.Parsed["natGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "natGatewayName", input) - } - - return nil -} - -// ValidateNatGatewayID checks that 'input' can be parsed as a Nat Gateway ID -func ValidateNatGatewayID(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 := ParseNatGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Nat Gateway ID -func (id NatGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/natGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NatGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Nat Gateway ID -func (id NatGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNatGateways", "natGateways", "natGateways"), - resourceids.UserSpecifiedSegment("natGatewayName", "natGatewayValue"), - } -} - -// String returns a human-readable description of this Nat Gateway ID -func (id NatGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Nat Gateway Name: %q", id.NatGatewayName), - } - return fmt.Sprintf("Nat Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/natgateways/id_natgateway_test.go b/resource-manager/network/2023-05-01/natgateways/id_natgateway_test.go deleted file mode 100644 index 3d502524a2f..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/id_natgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package natgateways - -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 = &NatGatewayId{} - -func TestNewNatGatewayID(t *testing.T) { - id := NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - - 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.NatGatewayName != "natGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'NatGatewayName'", id.NatGatewayName, "natGatewayValue") - } -} - -func TestFormatNatGatewayID(t *testing.T) { - actual := NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNatGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue", - Expected: &NatGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NatGatewayName: "natGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatGatewayID(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.NatGatewayName != v.Expected.NatGatewayName { - t.Fatalf("Expected %q but got %q for NatGatewayName", v.Expected.NatGatewayName, actual.NatGatewayName) - } - - } -} - -func TestParseNatGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nAtGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue", - Expected: &NatGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NatGatewayName: "natGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nAtGaTeWaYs/nAtGaTeWaYvAlUe", - Expected: &NatGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NatGatewayName: "nAtGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/nAtGaTeWaYs/nAtGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatGatewayIDInsensitively(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.NatGatewayName != v.Expected.NatGatewayName { - t.Fatalf("Expected %q but got %q for NatGatewayName", v.Expected.NatGatewayName, actual.NatGatewayName) - } - - } -} - -func TestSegmentsForNatGatewayId(t *testing.T) { - segments := NatGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NatGatewayId 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/network/2023-05-01/natgateways/method_createorupdate.go b/resource-manager/network/2023-05-01/natgateways/method_createorupdate.go deleted file mode 100644 index 34a53aff5ac..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package natgateways - -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 *NatGateway -} - -// CreateOrUpdate ... -func (c NatGatewaysClient) CreateOrUpdate(ctx context.Context, id NatGatewayId, input NatGateway) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NatGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id NatGatewayId, input NatGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/natgateways/method_delete.go b/resource-manager/network/2023-05-01/natgateways/method_delete.go deleted file mode 100644 index d03d142add6..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package natgateways - -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 NatGatewaysClient) Delete(ctx context.Context, id NatGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NatGatewaysClient) DeleteThenPoll(ctx context.Context, id NatGatewayId) 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/network/2023-05-01/natgateways/method_get.go b/resource-manager/network/2023-05-01/natgateways/method_get.go deleted file mode 100644 index 43cb3094813..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package natgateways - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NatGateway -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NatGatewaysClient) Get(ctx context.Context, id NatGatewayId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NatGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/natgateways/method_list.go b/resource-manager/network/2023-05-01/natgateways/method_list.go deleted file mode 100644 index dc70e51b7f5..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package natgateways - -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 *[]NatGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NatGateway -} - -// List ... -func (c NatGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/natGateways", 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 *[]NatGateway `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 NatGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NatGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NatGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NatGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NatGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/natgateways/method_listall.go b/resource-manager/network/2023-05-01/natgateways/method_listall.go deleted file mode 100644 index 871848dafc8..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package natgateways - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NatGateway -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NatGateway -} - -// ListAll ... -func (c NatGatewaysClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/natGateways", 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 *[]NatGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NatGatewaysClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NatGatewayOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NatGatewaysClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NatGatewayOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NatGateway, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/natgateways/method_updatetags.go b/resource-manager/network/2023-05-01/natgateways/method_updatetags.go deleted file mode 100644 index b5dbabece39..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package natgateways - -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 *NatGateway -} - -// UpdateTags ... -func (c NatGatewaysClient) UpdateTags(ctx context.Context, id NatGatewayId, 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 NatGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/natgateways/model_natgateway.go b/resource-manager/network/2023-05-01/natgateways/model_natgateway.go deleted file mode 100644 index 0aabf1ead87..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package natgateways - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/natgateways/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/natgateways/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7bfde80e4d9..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/natgateways/model_natgatewaysku.go b/resource-manager/network/2023-05-01/natgateways/model_natgatewaysku.go deleted file mode 100644 index 962d747cc17..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/natgateways/model_subresource.go b/resource-manager/network/2023-05-01/natgateways/model_subresource.go deleted file mode 100644 index ea00694667d..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/natgateways/model_tagsobject.go b/resource-manager/network/2023-05-01/natgateways/model_tagsobject.go deleted file mode 100644 index c5e055c3a58..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package natgateways - -// 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/network/2023-05-01/natgateways/predicates.go b/resource-manager/network/2023-05-01/natgateways/predicates.go deleted file mode 100644 index c0e09cf2f07..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NatGatewayOperationPredicate) Matches(input NatGateway) 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 && (input.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/network/2023-05-01/natgateways/version.go b/resource-manager/network/2023-05-01/natgateways/version.go deleted file mode 100644 index 67a208bb6da..00000000000 --- a/resource-manager/network/2023-05-01/natgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package natgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/natgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkgroups/README.md b/resource-manager/network/2023-05-01/networkgroups/README.md deleted file mode 100644 index cd9cac91cd4..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkgroups` Documentation - -The `networkgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkgroups" -``` - - -### Client Initialization - -```go -client := networkgroups.NewNetworkGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -payload := networkgroups.NetworkGroup{ - // ... -} - - -read, err := client.CreateOrUpdate(ctx, id, payload, networkgroups.DefaultCreateOrUpdateOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkGroupsClient.Delete` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -if err := client.DeleteThenPoll(ctx, id, networkgroups.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkGroupsClient.Get` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -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: `NetworkGroupsClient.List` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, networkgroups.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, networkgroups.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/networkgroups/client.go b/resource-manager/network/2023-05-01/networkgroups/client.go deleted file mode 100644 index 3cfe1e1eebf..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkgroups - -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 NetworkGroupsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkgroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkGroupsClient: %+v", err) - } - - return &NetworkGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkgroups/constants.go b/resource-manager/network/2023-05-01/networkgroups/constants.go deleted file mode 100644 index 3bc1d35bd51..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package networkgroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkgroups/id_networkgroup.go b/resource-manager/network/2023-05-01/networkgroups/id_networkgroup.go deleted file mode 100644 index e92b4d5d7c0..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/id_networkgroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkgroups - -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(&NetworkGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkGroupId{} - -// NetworkGroupId is a struct representing the Resource ID for a Network Group -type NetworkGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - NetworkGroupName string -} - -// NewNetworkGroupID returns a new NetworkGroupId struct -func NewNetworkGroupID(subscriptionId string, resourceGroupName string, networkManagerName string, networkGroupName string) NetworkGroupId { - return NetworkGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - NetworkGroupName: networkGroupName, - } -} - -// ParseNetworkGroupID parses 'input' into a NetworkGroupId -func ParseNetworkGroupID(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkGroupIDInsensitively parses 'input' case-insensitively into a NetworkGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkGroupIDInsensitively(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkGroupId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.NetworkGroupName, ok = input.Parsed["networkGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkGroupName", input) - } - - return nil -} - -// ValidateNetworkGroupID checks that 'input' can be parsed as a Network Group ID -func ValidateNetworkGroupID(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 := ParseNetworkGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Group ID -func (id NetworkGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/networkGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.NetworkGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Group ID -func (id NetworkGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticNetworkGroups", "networkGroups", "networkGroups"), - resourceids.UserSpecifiedSegment("networkGroupName", "networkGroupValue"), - } -} - -// String returns a human-readable description of this Network Group ID -func (id NetworkGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Network Group Name: %q", id.NetworkGroupName), - } - return fmt.Sprintf("Network Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkgroups/id_networkgroup_test.go b/resource-manager/network/2023-05-01/networkgroups/id_networkgroup_test.go deleted file mode 100644 index 5224081b110..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/id_networkgroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkgroups - -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 = &NetworkGroupId{} - -func TestNewNetworkGroupID(t *testing.T) { - id := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.NetworkGroupName != "networkGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkGroupName'", id.NetworkGroupName, "networkGroupValue") - } -} - -func TestFormatNetworkGroupID(t *testing.T) { - actual := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestParseNetworkGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - NetworkGroupName: "nEtWoRkGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestSegmentsForNetworkGroupId(t *testing.T) { - segments := NetworkGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkGroupId 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/network/2023-05-01/networkgroups/id_networkmanager.go b/resource-manager/network/2023-05-01/networkgroups/id_networkmanager.go deleted file mode 100644 index 58b8bb2d432..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkgroups - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkgroups/id_networkmanager_test.go b/resource-manager/network/2023-05-01/networkgroups/id_networkmanager_test.go deleted file mode 100644 index e48b7115869..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkgroups - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/networkgroups/method_createorupdate.go b/resource-manager/network/2023-05-01/networkgroups/method_createorupdate.go deleted file mode 100644 index dcb392d1ae2..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/method_createorupdate.go +++ /dev/null @@ -1,88 +0,0 @@ -package networkgroups - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkGroup -} - -type CreateOrUpdateOperationOptions struct { - IfMatch *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)) - } - 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 NetworkGroupsClient) CreateOrUpdate(ctx context.Context, id NetworkGroupId, input NetworkGroup, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 NetworkGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkgroups/method_delete.go b/resource-manager/network/2023-05-01/networkgroups/method_delete.go deleted file mode 100644 index 567e0fb203a..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package networkgroups - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 NetworkGroupsClient) Delete(ctx context.Context, id NetworkGroupId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkGroupsClient) DeleteThenPoll(ctx context.Context, id NetworkGroupId, 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/network/2023-05-01/networkgroups/method_get.go b/resource-manager/network/2023-05-01/networkgroups/method_get.go deleted file mode 100644 index 554db15d016..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkgroups - -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 *NetworkGroup -} - -// Get ... -func (c NetworkGroupsClient) Get(ctx context.Context, id NetworkGroupId) (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 NetworkGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkgroups/method_list.go b/resource-manager/network/2023-05-01/networkgroups/method_list.go deleted file mode 100644 index 84c759e9e2c..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package networkgroups - -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 *[]NetworkGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkGroup -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c NetworkGroupsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkGroups", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkGroup `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 NetworkGroupsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, NetworkGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate NetworkGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkGroup, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/networkgroups/model_networkgroup.go b/resource-manager/network/2023-05-01/networkgroups/model_networkgroup.go deleted file mode 100644 index c35ded0ac80..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/model_networkgroup.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkgroups - -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 NetworkGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkgroups/model_networkgroupproperties.go b/resource-manager/network/2023-05-01/networkgroups/model_networkgroupproperties.go deleted file mode 100644 index 69e5d9d5b22..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkgroups/predicates.go b/resource-manager/network/2023-05-01/networkgroups/predicates.go deleted file mode 100644 index 621d0d7b40a..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package networkgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkGroupOperationPredicate) Matches(input NetworkGroup) 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.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/network/2023-05-01/networkgroups/version.go b/resource-manager/network/2023-05-01/networkgroups/version.go deleted file mode 100644 index 577fe584703..00000000000 --- a/resource-manager/network/2023-05-01/networkgroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkgroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkgroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/README.md b/resource-manager/network/2023-05-01/networkinterfaces/README.md deleted file mode 100644 index 76c52440680..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/README.md +++ /dev/null @@ -1,371 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkinterfaces` Documentation - -The `networkinterfaces` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkinterfaces" -``` - - -### Client Initialization - -```go -client := networkinterfaces.NewNetworkInterfacesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkInterfacesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.NetworkInterface{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -read, err := client.Get(ctx, id, networkinterfaces.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetCloudServiceNetworkInterface` - -```go -ctx := context.TODO() -id := networkinterfaces.NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue") - -read, err := client.GetCloudServiceNetworkInterface(ctx, id, networkinterfaces.DefaultGetCloudServiceNetworkInterfaceOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetEffectiveRouteTable` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.GetEffectiveRouteTable(ctx, id)` can be used to do batched pagination -items, err := client.GetEffectiveRouteTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetIPConfiguration` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") - -read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetNetworkInterface` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") - -read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkInterfacesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListCloudServiceNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - -// alternatively `client.ListCloudServiceNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListCloudServiceNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue") - -// alternatively `client.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListEffectiveNetworkSecurityGroups` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.ListEffectiveNetworkSecurityGroups(ctx, id)` can be used to do batched pagination -items, err := client.ListEffectiveNetworkSecurityGroupsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetIPConfigurations` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") - -// alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - -// alternatively `client.ListVirtualMachineScaleSetNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue") - -// alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsGet` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "ipConfigurationValue") - -read, err := client.NetworkInterfaceIPConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceIPConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceIPConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceLoadBalancersList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceLoadBalancersList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceLoadBalancersListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` - -```go -ctx := context.TODO() -id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue") - -read, err := client.NetworkInterfaceTapConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceTapConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceTapConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.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/network/2023-05-01/networkinterfaces/client.go b/resource-manager/network/2023-05-01/networkinterfaces/client.go deleted file mode 100644 index cd098aeccdf..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkinterfaces - -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 NetworkInterfacesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkInterfacesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkInterfacesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkinterfaces", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkInterfacesClient: %+v", err) - } - - return &NetworkInterfacesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/constants.go b/resource-manager/network/2023-05-01/networkinterfaces/constants.go deleted file mode 100644 index fc9528b4c86..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/constants.go +++ /dev/null @@ -1,1500 +0,0 @@ -package networkinterfaces - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type EffectiveRouteSource string - -const ( - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - EffectiveRouteSourceUser EffectiveRouteSource = "User" - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -func PossibleValuesForEffectiveRouteSource() []string { - return []string{ - string(EffectiveRouteSourceDefault), - string(EffectiveRouteSourceUnknown), - string(EffectiveRouteSourceUser), - string(EffectiveRouteSourceVirtualNetworkGateway), - } -} - -func (s *EffectiveRouteSource) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveRouteSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveRouteSource(input string) (*EffectiveRouteSource, error) { - vals := map[string]EffectiveRouteSource{ - "default": EffectiveRouteSourceDefault, - "unknown": EffectiveRouteSourceUnknown, - "user": EffectiveRouteSourceUser, - "virtualnetworkgateway": EffectiveRouteSourceVirtualNetworkGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveRouteSource(input) - return &out, nil -} - -type EffectiveRouteState string - -const ( - EffectiveRouteStateActive EffectiveRouteState = "Active" - EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" -) - -func PossibleValuesForEffectiveRouteState() []string { - return []string{ - string(EffectiveRouteStateActive), - string(EffectiveRouteStateInvalid), - } -} - -func (s *EffectiveRouteState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveRouteState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveRouteState(input string) (*EffectiveRouteState, error) { - vals := map[string]EffectiveRouteState{ - "active": EffectiveRouteStateActive, - "invalid": EffectiveRouteStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveRouteState(input) - return &out, nil -} - -type EffectiveSecurityRuleProtocol string - -const ( - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - EffectiveSecurityRuleProtocolTcp EffectiveSecurityRuleProtocol = "Tcp" - EffectiveSecurityRuleProtocolUdp EffectiveSecurityRuleProtocol = "Udp" -) - -func PossibleValuesForEffectiveSecurityRuleProtocol() []string { - return []string{ - string(EffectiveSecurityRuleProtocolAll), - string(EffectiveSecurityRuleProtocolTcp), - string(EffectiveSecurityRuleProtocolUdp), - } -} - -func (s *EffectiveSecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveSecurityRuleProtocol(input string) (*EffectiveSecurityRuleProtocol, error) { - vals := map[string]EffectiveSecurityRuleProtocol{ - "all": EffectiveSecurityRuleProtocolAll, - "tcp": EffectiveSecurityRuleProtocolTcp, - "udp": EffectiveSecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveSecurityRuleProtocol(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" -) - -func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { - return []string{ - string(LoadBalancerOutboundRuleProtocolAll), - string(LoadBalancerOutboundRuleProtocolTcp), - string(LoadBalancerOutboundRuleProtocolUdp), - } -} - -func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerOutboundRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { - vals := map[string]LoadBalancerOutboundRuleProtocol{ - "all": LoadBalancerOutboundRuleProtocolAll, - "tcp": LoadBalancerOutboundRuleProtocolTcp, - "udp": LoadBalancerOutboundRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerOutboundRuleProtocol(input) - return &out, nil -} - -type LoadBalancerSkuName string - -const ( - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -func PossibleValuesForLoadBalancerSkuName() []string { - return []string{ - string(LoadBalancerSkuNameBasic), - string(LoadBalancerSkuNameGateway), - string(LoadBalancerSkuNameStandard), - } -} - -func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { - vals := map[string]LoadBalancerSkuName{ - "basic": LoadBalancerSkuNameBasic, - "gateway": LoadBalancerSkuNameGateway, - "standard": LoadBalancerSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuName(input) - return &out, nil -} - -type LoadBalancerSkuTier string - -const ( - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" -) - -func PossibleValuesForLoadBalancerSkuTier() []string { - return []string{ - string(LoadBalancerSkuTierGlobal), - string(LoadBalancerSkuTierRegional), - } -} - -func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { - vals := map[string]LoadBalancerSkuTier{ - "global": LoadBalancerSkuTierGlobal, - "regional": LoadBalancerSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuTier(input) - return &out, nil -} - -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -func PossibleValuesForLoadDistribution() []string { - return []string{ - string(LoadDistributionDefault), - string(LoadDistributionSourceIP), - string(LoadDistributionSourceIPProtocol), - } -} - -func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadDistribution(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadDistribution(input string) (*LoadDistribution, error) { - vals := map[string]LoadDistribution{ - "default": LoadDistributionDefault, - "sourceip": LoadDistributionSourceIP, - "sourceipprotocol": LoadDistributionSourceIPProtocol, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadDistribution(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTcp ProbeProtocol = "Tcp" -) - -func PossibleValuesForProbeProtocol() []string { - return []string{ - string(ProbeProtocolHTTP), - string(ProbeProtocolHTTPS), - string(ProbeProtocolTcp), - } -} - -func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProbeProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProbeProtocol(input string) (*ProbeProtocol, error) { - vals := map[string]ProbeProtocol{ - "http": ProbeProtocolHTTP, - "https": ProbeProtocolHTTPS, - "tcp": ProbeProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProbeProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice.go b/resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice.go deleted file mode 100644 index e3a9af48f96..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkinterfaces - -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(&ProviderCloudServiceId{}) -} - -var _ resourceids.ResourceId = &ProviderCloudServiceId{} - -// ProviderCloudServiceId is a struct representing the Resource ID for a Provider Cloud Service -type ProviderCloudServiceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string -} - -// NewProviderCloudServiceID returns a new ProviderCloudServiceId struct -func NewProviderCloudServiceID(subscriptionId string, resourceGroupName string, cloudServiceName string) ProviderCloudServiceId { - return ProviderCloudServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - } -} - -// ParseProviderCloudServiceID parses 'input' into a ProviderCloudServiceId -func ParseProviderCloudServiceID(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderCloudServiceIDInsensitively parses 'input' case-insensitively into a ProviderCloudServiceId -// note: this method should only be used for API response data and not user input -func ParseProviderCloudServiceIDInsensitively(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderCloudServiceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - return nil -} - -// ValidateProviderCloudServiceID checks that 'input' can be parsed as a Provider Cloud Service ID -func ValidateProviderCloudServiceID(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 := ParseProviderCloudServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Cloud Service ID -func (id ProviderCloudServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Cloud Service ID -func (id ProviderCloudServiceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - } -} - -// String returns a human-readable description of this Provider Cloud Service ID -func (id ProviderCloudServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - } - return fmt.Sprintf("Provider Cloud Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice_test.go b/resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice_test.go deleted file mode 100644 index a29f672a8b4..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_providercloudservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkinterfaces - -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 = &ProviderCloudServiceId{} - -func TestNewProviderCloudServiceID(t *testing.T) { - id := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } -} - -func TestFormatProviderCloudServiceID(t *testing.T) { - actual := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderCloudServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestParseProviderCloudServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestSegmentsForProviderCloudServiceId(t *testing.T) { - segments := ProviderCloudServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderCloudServiceId 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/network/2023-05-01/networkinterfaces/id_roleinstance.go b/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance.go deleted file mode 100644 index 69a75e612e0..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkinterfaces - -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(&RoleInstanceId{}) -} - -var _ resourceids.ResourceId = &RoleInstanceId{} - -// RoleInstanceId is a struct representing the Resource ID for a Role Instance -type RoleInstanceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string - RoleInstanceName string -} - -// NewRoleInstanceID returns a new RoleInstanceId struct -func NewRoleInstanceID(subscriptionId string, resourceGroupName string, cloudServiceName string, roleInstanceName string) RoleInstanceId { - return RoleInstanceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - RoleInstanceName: roleInstanceName, - } -} - -// ParseRoleInstanceID parses 'input' into a RoleInstanceId -func ParseRoleInstanceID(input string) (*RoleInstanceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoleInstanceIDInsensitively parses 'input' case-insensitively into a RoleInstanceId -// note: this method should only be used for API response data and not user input -func ParseRoleInstanceIDInsensitively(input string) (*RoleInstanceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoleInstanceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - if id.RoleInstanceName, ok = input.Parsed["roleInstanceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "roleInstanceName", input) - } - - return nil -} - -// ValidateRoleInstanceID checks that 'input' can be parsed as a Role Instance ID -func ValidateRoleInstanceID(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 := ParseRoleInstanceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Role Instance ID -func (id RoleInstanceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s/roleInstances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName, id.RoleInstanceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Role Instance ID -func (id RoleInstanceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - resourceids.StaticSegment("staticRoleInstances", "roleInstances", "roleInstances"), - resourceids.UserSpecifiedSegment("roleInstanceName", "roleInstanceValue"), - } -} - -// String returns a human-readable description of this Role Instance ID -func (id RoleInstanceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - fmt.Sprintf("Role Instance Name: %q", id.RoleInstanceName), - } - return fmt.Sprintf("Role Instance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance_test.go b/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance_test.go deleted file mode 100644 index 77f33a78522..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstance_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkinterfaces - -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 = &RoleInstanceId{} - -func TestNewRoleInstanceID(t *testing.T) { - id := NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } - - if id.RoleInstanceName != "roleInstanceValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoleInstanceName'", id.RoleInstanceName, "roleInstanceValue") - } -} - -func TestFormatRoleInstanceID(t *testing.T) { - actual := NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoleInstanceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Expected: &RoleInstanceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - } -} - -func TestParseRoleInstanceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Expected: &RoleInstanceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe", - Expected: &RoleInstanceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - RoleInstanceName: "rOlEiNsTaNcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - } -} - -func TestSegmentsForRoleInstanceId(t *testing.T) { - segments := RoleInstanceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoleInstanceId 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/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface.go b/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface.go deleted file mode 100644 index 4a96fd5d010..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface.go +++ /dev/null @@ -1,148 +0,0 @@ -package networkinterfaces - -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(&RoleInstanceNetworkInterfaceId{}) -} - -var _ resourceids.ResourceId = &RoleInstanceNetworkInterfaceId{} - -// RoleInstanceNetworkInterfaceId is a struct representing the Resource ID for a Role Instance Network Interface -type RoleInstanceNetworkInterfaceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string - RoleInstanceName string - NetworkInterfaceName string -} - -// NewRoleInstanceNetworkInterfaceID returns a new RoleInstanceNetworkInterfaceId struct -func NewRoleInstanceNetworkInterfaceID(subscriptionId string, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string) RoleInstanceNetworkInterfaceId { - return RoleInstanceNetworkInterfaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - RoleInstanceName: roleInstanceName, - NetworkInterfaceName: networkInterfaceName, - } -} - -// ParseRoleInstanceNetworkInterfaceID parses 'input' into a RoleInstanceNetworkInterfaceId -func ParseRoleInstanceNetworkInterfaceID(input string) (*RoleInstanceNetworkInterfaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceNetworkInterfaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceNetworkInterfaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoleInstanceNetworkInterfaceIDInsensitively parses 'input' case-insensitively into a RoleInstanceNetworkInterfaceId -// note: this method should only be used for API response data and not user input -func ParseRoleInstanceNetworkInterfaceIDInsensitively(input string) (*RoleInstanceNetworkInterfaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceNetworkInterfaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceNetworkInterfaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoleInstanceNetworkInterfaceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - if id.RoleInstanceName, ok = input.Parsed["roleInstanceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "roleInstanceName", input) - } - - if id.NetworkInterfaceName, ok = input.Parsed["networkInterfaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkInterfaceName", input) - } - - return nil -} - -// ValidateRoleInstanceNetworkInterfaceID checks that 'input' can be parsed as a Role Instance Network Interface ID -func ValidateRoleInstanceNetworkInterfaceID(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 := ParseRoleInstanceNetworkInterfaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Role Instance Network Interface ID -func (id RoleInstanceNetworkInterfaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s/roleInstances/%s/networkInterfaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName, id.RoleInstanceName, id.NetworkInterfaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Role Instance Network Interface ID -func (id RoleInstanceNetworkInterfaceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - resourceids.StaticSegment("staticRoleInstances", "roleInstances", "roleInstances"), - resourceids.UserSpecifiedSegment("roleInstanceName", "roleInstanceValue"), - resourceids.StaticSegment("staticNetworkInterfaces", "networkInterfaces", "networkInterfaces"), - resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), - } -} - -// String returns a human-readable description of this Role Instance Network Interface ID -func (id RoleInstanceNetworkInterfaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - fmt.Sprintf("Role Instance Name: %q", id.RoleInstanceName), - fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), - } - return fmt.Sprintf("Role Instance Network Interface (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface_test.go b/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface_test.go deleted file mode 100644 index 706f13b517d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_roleinstancenetworkinterface_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package networkinterfaces - -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 = &RoleInstanceNetworkInterfaceId{} - -func TestNewRoleInstanceNetworkInterfaceID(t *testing.T) { - id := NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } - - if id.RoleInstanceName != "roleInstanceValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoleInstanceName'", id.RoleInstanceName, "roleInstanceValue") - } - - if id.NetworkInterfaceName != "networkInterfaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkInterfaceName'", id.NetworkInterfaceName, "networkInterfaceValue") - } -} - -func TestFormatRoleInstanceNetworkInterfaceID(t *testing.T) { - actual := NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoleInstanceNetworkInterfaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceNetworkInterfaceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue", - Expected: &RoleInstanceNetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - NetworkInterfaceName: "networkInterfaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceNetworkInterfaceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - if actual.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - } -} - -func TestParseRoleInstanceNetworkInterfaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceNetworkInterfaceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/nEtWoRkInTeRfAcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue", - Expected: &RoleInstanceNetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - NetworkInterfaceName: "networkInterfaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe", - Expected: &RoleInstanceNetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - RoleInstanceName: "rOlEiNsTaNcEvAlUe", - NetworkInterfaceName: "nEtWoRkInTeRfAcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceNetworkInterfaceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - if actual.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - } -} - -func TestSegmentsForRoleInstanceNetworkInterfaceId(t *testing.T) { - segments := RoleInstanceNetworkInterfaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoleInstanceNetworkInterfaceId 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/network/2023-05-01/networkinterfaces/id_tapconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration.go deleted file mode 100644 index 0778222d9c9..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkinterfaces - -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(&TapConfigurationId{}) -} - -var _ resourceids.ResourceId = &TapConfigurationId{} - -// TapConfigurationId is a struct representing the Resource ID for a Tap Configuration -type TapConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkInterfaceName string - TapConfigurationName string -} - -// NewTapConfigurationID returns a new TapConfigurationId struct -func NewTapConfigurationID(subscriptionId string, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) TapConfigurationId { - return TapConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkInterfaceName: networkInterfaceName, - TapConfigurationName: tapConfigurationName, - } -} - -// ParseTapConfigurationID parses 'input' into a TapConfigurationId -func ParseTapConfigurationID(input string) (*TapConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&TapConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TapConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseTapConfigurationIDInsensitively parses 'input' case-insensitively into a TapConfigurationId -// note: this method should only be used for API response data and not user input -func ParseTapConfigurationIDInsensitively(input string) (*TapConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&TapConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TapConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *TapConfigurationId) 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.NetworkInterfaceName, ok = input.Parsed["networkInterfaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkInterfaceName", input) - } - - if id.TapConfigurationName, ok = input.Parsed["tapConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "tapConfigurationName", input) - } - - return nil -} - -// ValidateTapConfigurationID checks that 'input' can be parsed as a Tap Configuration ID -func ValidateTapConfigurationID(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 := ParseTapConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Tap Configuration ID -func (id TapConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkInterfaces/%s/tapConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkInterfaceName, id.TapConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Tap Configuration ID -func (id TapConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkInterfaces", "networkInterfaces", "networkInterfaces"), - resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), - resourceids.StaticSegment("staticTapConfigurations", "tapConfigurations", "tapConfigurations"), - resourceids.UserSpecifiedSegment("tapConfigurationName", "tapConfigurationValue"), - } -} - -// String returns a human-readable description of this Tap Configuration ID -func (id TapConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), - fmt.Sprintf("Tap Configuration Name: %q", id.TapConfigurationName), - } - return fmt.Sprintf("Tap Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration_test.go b/resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration_test.go deleted file mode 100644 index ee4786ae2fb..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_tapconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkinterfaces - -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 = &TapConfigurationId{} - -func TestNewTapConfigurationID(t *testing.T) { - id := NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue") - - 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.NetworkInterfaceName != "networkInterfaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkInterfaceName'", id.NetworkInterfaceName, "networkInterfaceValue") - } - - if id.TapConfigurationName != "tapConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'TapConfigurationName'", id.TapConfigurationName, "tapConfigurationValue") - } -} - -func TestFormatTapConfigurationID(t *testing.T) { - actual := NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseTapConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TapConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue", - Expected: &TapConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkInterfaceName: "networkInterfaceValue", - TapConfigurationName: "tapConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTapConfigurationID(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.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - if actual.TapConfigurationName != v.Expected.TapConfigurationName { - t.Fatalf("Expected %q but got %q for TapConfigurationName", v.Expected.TapConfigurationName, actual.TapConfigurationName) - } - - } -} - -func TestParseTapConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TapConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/tApCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue", - Expected: &TapConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkInterfaceName: "networkInterfaceValue", - TapConfigurationName: "tapConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/tApCoNfIgUrAtIoNs/tApCoNfIgUrAtIoNvAlUe", - Expected: &TapConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkInterfaceName: "nEtWoRkInTeRfAcEvAlUe", - TapConfigurationName: "tApCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/tApCoNfIgUrAtIoNs/tApCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTapConfigurationIDInsensitively(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.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - if actual.TapConfigurationName != v.Expected.TapConfigurationName { - t.Fatalf("Expected %q but got %q for TapConfigurationName", v.Expected.TapConfigurationName, actual.TapConfigurationName) - } - - } -} - -func TestSegmentsForTapConfigurationId(t *testing.T) { - segments := TapConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("TapConfigurationId 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/network/2023-05-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine.go deleted file mode 100644 index e2f2dde8684..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkinterfaces - -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(&VirtualMachineId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineId{} - -// VirtualMachineId is a struct representing the Resource ID for a Virtual Machine -type VirtualMachineId struct { - SubscriptionId string - ResourceGroupName string - VirtualMachineScaleSetName string - VirtualMachineName string -} - -// NewVirtualMachineID returns a new VirtualMachineId struct -func NewVirtualMachineID(subscriptionId string, resourceGroupName string, virtualMachineScaleSetName string, virtualMachineName string) VirtualMachineId { - return VirtualMachineId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualMachineScaleSetName: virtualMachineScaleSetName, - VirtualMachineName: virtualMachineName, - } -} - -// ParseVirtualMachineID parses 'input' into a VirtualMachineId -func ParseVirtualMachineID(input string) (*VirtualMachineId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineIDInsensitively(input string) (*VirtualMachineId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineId) 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.VirtualMachineScaleSetName, ok = input.Parsed["virtualMachineScaleSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineScaleSetName", input) - } - - if id.VirtualMachineName, ok = input.Parsed["virtualMachineName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineName", input) - } - - return nil -} - -// ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID -func ValidateVirtualMachineID(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 := ParseVirtualMachineID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine ID -func (id VirtualMachineId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineScaleSetName, id.VirtualMachineName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine ID -func (id VirtualMachineId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), - resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineValue"), - } -} - -// String returns a human-readable description of this Virtual Machine ID -func (id VirtualMachineId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), - fmt.Sprintf("Virtual Machine Name: %q", id.VirtualMachineName), - } - return fmt.Sprintf("Virtual Machine (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine_test.go deleted file mode 100644 index 86c89e5742e..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachine_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkinterfaces - -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 = &VirtualMachineId{} - -func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue") - - 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.VirtualMachineScaleSetName != "virtualMachineScaleSetValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetValue") - } - - if id.VirtualMachineName != "virtualMachineValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineValue") - } -} - -func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - VirtualMachineName: "virtualMachineValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineID(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - if actual.VirtualMachineName != v.Expected.VirtualMachineName { - t.Fatalf("Expected %q but got %q for VirtualMachineName", v.Expected.VirtualMachineName, actual.VirtualMachineName) - } - - } -} - -func TestParseVirtualMachineIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/vIrTuAlMaChInEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - VirtualMachineName: "virtualMachineValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/vIrTuAlMaChInEs/vIrTuAlMaChInEvAlUe", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTvAlUe", - VirtualMachineName: "vIrTuAlMaChInEvAlUe", - }, - }, - { - // 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.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/vIrTuAlMaChInEs/vIrTuAlMaChInEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineIDInsensitively(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - if actual.VirtualMachineName != v.Expected.VirtualMachineName { - t.Fatalf("Expected %q but got %q for VirtualMachineName", v.Expected.VirtualMachineName, actual.VirtualMachineName) - } - - } -} - -func TestSegmentsForVirtualMachineId(t *testing.T) { - segments := VirtualMachineId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineId 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/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset.go b/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset.go deleted file mode 100644 index e9a264c0a89..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkinterfaces - -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(&VirtualMachineScaleSetId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineScaleSetId{} - -// VirtualMachineScaleSetId is a struct representing the Resource ID for a Virtual Machine Scale Set -type VirtualMachineScaleSetId struct { - SubscriptionId string - ResourceGroupName string - VirtualMachineScaleSetName string -} - -// NewVirtualMachineScaleSetID returns a new VirtualMachineScaleSetId struct -func NewVirtualMachineScaleSetID(subscriptionId string, resourceGroupName string, virtualMachineScaleSetName string) VirtualMachineScaleSetId { - return VirtualMachineScaleSetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualMachineScaleSetName: virtualMachineScaleSetName, - } -} - -// ParseVirtualMachineScaleSetID parses 'input' into a VirtualMachineScaleSetId -func ParseVirtualMachineScaleSetID(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineScaleSetIDInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineScaleSetIDInsensitively(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineScaleSetId) 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.VirtualMachineScaleSetName, ok = input.Parsed["virtualMachineScaleSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineScaleSetName", input) - } - - return nil -} - -// ValidateVirtualMachineScaleSetID checks that 'input' can be parsed as a Virtual Machine Scale Set ID -func ValidateVirtualMachineScaleSetID(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 := ParseVirtualMachineScaleSetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineScaleSetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), - } -} - -// String returns a human-readable description of this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), - } - return fmt.Sprintf("Virtual Machine Scale Set (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset_test.go b/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset_test.go deleted file mode 100644 index 541e8675bd0..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/id_virtualmachinescaleset_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkinterfaces - -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 = &VirtualMachineScaleSetId{} - -func TestNewVirtualMachineScaleSetID(t *testing.T) { - id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - - 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.VirtualMachineScaleSetName != "virtualMachineScaleSetValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetValue") - } -} - -func TestFormatVirtualMachineScaleSetID(t *testing.T) { - actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineScaleSetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetID(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestParseVirtualMachineScaleSetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTvAlUe", - }, - }, - { - // 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.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetIDInsensitively(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestSegmentsForVirtualMachineScaleSetId(t *testing.T) { - segments := VirtualMachineScaleSetId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineScaleSetId 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/network/2023-05-01/networkinterfaces/method_createorupdate.go b/resource-manager/network/2023-05-01/networkinterfaces/method_createorupdate.go deleted file mode 100644 index 5686c1db5f0..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package networkinterfaces - -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 *NetworkInterface -} - -// CreateOrUpdate ... -func (c NetworkInterfacesClient) CreateOrUpdate(ctx context.Context, id commonids.NetworkInterfaceId, input NetworkInterface) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkInterfacesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.NetworkInterfaceId, input NetworkInterface) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/networkinterfaces/method_delete.go b/resource-manager/network/2023-05-01/networkinterfaces/method_delete.go deleted file mode 100644 index 99f476e3fa9..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package networkinterfaces - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c NetworkInterfacesClient) Delete(ctx context.Context, id commonids.NetworkInterfaceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkInterfacesClient) DeleteThenPoll(ctx context.Context, id commonids.NetworkInterfaceId) 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/network/2023-05-01/networkinterfaces/method_get.go b/resource-manager/network/2023-05-01/networkinterfaces/method_get.go deleted file mode 100644 index 14f4f1d8a0c..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package networkinterfaces - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkInterfacesClient) Get(ctx context.Context, id commonids.NetworkInterfaceId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_getcloudservicenetworkinterface.go b/resource-manager/network/2023-05-01/networkinterfaces/method_getcloudservicenetworkinterface.go deleted file mode 100644 index b828e37133d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_getcloudservicenetworkinterface.go +++ /dev/null @@ -1,83 +0,0 @@ -package networkinterfaces - -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 GetCloudServiceNetworkInterfaceOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -type GetCloudServiceNetworkInterfaceOperationOptions struct { - Expand *string -} - -func DefaultGetCloudServiceNetworkInterfaceOperationOptions() GetCloudServiceNetworkInterfaceOperationOptions { - return GetCloudServiceNetworkInterfaceOperationOptions{} -} - -func (o GetCloudServiceNetworkInterfaceOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetCloudServiceNetworkInterfaceOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetCloudServiceNetworkInterfaceOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetCloudServiceNetworkInterface ... -func (c NetworkInterfacesClient) GetCloudServiceNetworkInterface(ctx context.Context, id RoleInstanceNetworkInterfaceId, options GetCloudServiceNetworkInterfaceOperationOptions) (result GetCloudServiceNetworkInterfaceOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_geteffectiveroutetable.go b/resource-manager/network/2023-05-01/networkinterfaces/method_geteffectiveroutetable.go deleted file mode 100644 index e64977d2735..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_geteffectiveroutetable.go +++ /dev/null @@ -1,77 +0,0 @@ -package networkinterfaces - -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 GetEffectiveRouteTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]EffectiveRoute -} - -type GetEffectiveRouteTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []EffectiveRoute -} - -// GetEffectiveRouteTable ... -func (c NetworkInterfacesClient) GetEffectiveRouteTable(ctx context.Context, id commonids.NetworkInterfaceId) (result GetEffectiveRouteTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveRouteTable", 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 -} - -// GetEffectiveRouteTableThenPoll performs GetEffectiveRouteTable then polls until it's completed -func (c NetworkInterfacesClient) GetEffectiveRouteTableThenPoll(ctx context.Context, id commonids.NetworkInterfaceId) error { - result, err := c.GetEffectiveRouteTable(ctx, id) - if err != nil { - return fmt.Errorf("performing GetEffectiveRouteTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetEffectiveRouteTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go deleted file mode 100644 index c30d98304ca..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go +++ /dev/null @@ -1,84 +0,0 @@ -package networkinterfaces - -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 GetVirtualMachineScaleSetIPConfigurationOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaceIPConfiguration -} - -type GetVirtualMachineScaleSetIPConfigurationOperationOptions struct { - Expand *string -} - -func DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions() GetVirtualMachineScaleSetIPConfigurationOperationOptions { - return GetVirtualMachineScaleSetIPConfigurationOperationOptions{} -} - -func (o GetVirtualMachineScaleSetIPConfigurationOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetVirtualMachineScaleSetIPConfigurationOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetVirtualMachineScaleSetIPConfigurationOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetVirtualMachineScaleSetIPConfiguration ... -func (c NetworkInterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId, options GetVirtualMachineScaleSetIPConfigurationOperationOptions) (result GetVirtualMachineScaleSetIPConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterfaceIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go b/resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go deleted file mode 100644 index 17ffc7f419c..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go +++ /dev/null @@ -1,84 +0,0 @@ -package networkinterfaces - -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 GetVirtualMachineScaleSetNetworkInterfaceOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -type GetVirtualMachineScaleSetNetworkInterfaceOperationOptions struct { - Expand *string -} - -func DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions() GetVirtualMachineScaleSetNetworkInterfaceOperationOptions { - return GetVirtualMachineScaleSetNetworkInterfaceOperationOptions{} -} - -func (o GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetVirtualMachineScaleSetNetworkInterface ... -func (c NetworkInterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) (result GetVirtualMachineScaleSetNetworkInterfaceOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_list.go b/resource-manager/network/2023-05-01/networkinterfaces/method_list.go deleted file mode 100644 index d3196047dfa..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 *[]NetworkInterface -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// List ... -func (c NetworkInterfacesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkInterfaces", 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 *[]NetworkInterface `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 NetworkInterfacesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkInterfaceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/networkinterfaces/method_listall.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listall.go deleted file mode 100644 index b4b4d1f8064..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListAll ... -func (c NetworkInterfacesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkInterfaceOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go deleted file mode 100644 index 7f558dee830..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListCloudServiceNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListCloudServiceNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListCloudServiceNetworkInterfaces ... -func (c NetworkInterfacesClient) ListCloudServiceNetworkInterfaces(ctx context.Context, id ProviderCloudServiceId) (result ListCloudServiceNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListCloudServiceNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListCloudServiceNetworkInterfacesComplete(ctx context.Context, id ProviderCloudServiceId) (ListCloudServiceNetworkInterfacesCompleteResult, error) { - return c.ListCloudServiceNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListCloudServiceNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCloudServiceNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id ProviderCloudServiceId, predicate NetworkInterfaceOperationPredicate) (result ListCloudServiceNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListCloudServiceNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListCloudServiceNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go deleted file mode 100644 index d09b4050535..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListCloudServiceRoleInstanceNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListCloudServiceRoleInstanceNetworkInterfaces ... -func (c NetworkInterfacesClient) ListCloudServiceRoleInstanceNetworkInterfaces(ctx context.Context, id RoleInstanceId) (result ListCloudServiceRoleInstanceNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListCloudServiceRoleInstanceNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx context.Context, id RoleInstanceId) (ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult, error) { - return c.ListCloudServiceRoleInstanceNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListCloudServiceRoleInstanceNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id RoleInstanceId, predicate NetworkInterfaceOperationPredicate) (result ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go deleted file mode 100644 index 50661e67194..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go +++ /dev/null @@ -1,77 +0,0 @@ -package networkinterfaces - -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 ListEffectiveNetworkSecurityGroupsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]EffectiveNetworkSecurityGroup -} - -type ListEffectiveNetworkSecurityGroupsCompleteResult struct { - LatestHttpResponse *http.Response - Items []EffectiveNetworkSecurityGroup -} - -// ListEffectiveNetworkSecurityGroups ... -func (c NetworkInterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Context, id commonids.NetworkInterfaceId) (result ListEffectiveNetworkSecurityGroupsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveNetworkSecurityGroups", 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 -} - -// ListEffectiveNetworkSecurityGroupsThenPoll performs ListEffectiveNetworkSecurityGroups then polls until it's completed -func (c NetworkInterfacesClient) ListEffectiveNetworkSecurityGroupsThenPoll(ctx context.Context, id commonids.NetworkInterfaceId) error { - result, err := c.ListEffectiveNetworkSecurityGroups(ctx, id) - if err != nil { - return fmt.Errorf("performing ListEffectiveNetworkSecurityGroups: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ListEffectiveNetworkSecurityGroups: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go deleted file mode 100644 index f7fac31de07..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkinterfaces - -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 ListVirtualMachineScaleSetIPConfigurationsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaceIPConfiguration -} - -type ListVirtualMachineScaleSetIPConfigurationsCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaceIPConfiguration -} - -type ListVirtualMachineScaleSetIPConfigurationsOperationOptions struct { - Expand *string -} - -func DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions() ListVirtualMachineScaleSetIPConfigurationsOperationOptions { - return ListVirtualMachineScaleSetIPConfigurationsOperationOptions{} -} - -func (o ListVirtualMachineScaleSetIPConfigurationsOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListVirtualMachineScaleSetIPConfigurationsOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListVirtualMachineScaleSetIPConfigurationsOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// ListVirtualMachineScaleSetIPConfigurations ... -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options ListVirtualMachineScaleSetIPConfigurationsOperationOptions) (result ListVirtualMachineScaleSetIPConfigurationsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ipConfigurations", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkInterfaceIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListVirtualMachineScaleSetIPConfigurationsComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetIPConfigurationsComplete(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options ListVirtualMachineScaleSetIPConfigurationsOperationOptions) (ListVirtualMachineScaleSetIPConfigurationsCompleteResult, error) { - return c.ListVirtualMachineScaleSetIPConfigurationsCompleteMatchingPredicate(ctx, id, options, NetworkInterfaceIPConfigurationOperationPredicate{}) -} - -// ListVirtualMachineScaleSetIPConfigurationsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetIPConfigurationsCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options ListVirtualMachineScaleSetIPConfigurationsOperationOptions, predicate NetworkInterfaceIPConfigurationOperationPredicate) (result ListVirtualMachineScaleSetIPConfigurationsCompleteResult, err error) { - items := make([]NetworkInterfaceIPConfiguration, 0) - - resp, err := c.ListVirtualMachineScaleSetIPConfigurations(ctx, id, options) - if err != nil { - 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 = ListVirtualMachineScaleSetIPConfigurationsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go deleted file mode 100644 index 0a35fbc96ef..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListVirtualMachineScaleSetNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListVirtualMachineScaleSetNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListVirtualMachineScaleSetNetworkInterfaces ... -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, id VirtualMachineScaleSetId) (result ListVirtualMachineScaleSetNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListVirtualMachineScaleSetNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx context.Context, id VirtualMachineScaleSetId) (ListVirtualMachineScaleSetNetworkInterfacesCompleteResult, error) { - return c.ListVirtualMachineScaleSetNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListVirtualMachineScaleSetNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id VirtualMachineScaleSetId, predicate NetworkInterfaceOperationPredicate) (result ListVirtualMachineScaleSetNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListVirtualMachineScaleSetNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListVirtualMachineScaleSetNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go b/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go deleted file mode 100644 index 9abb01f1d41..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListVirtualMachineScaleSetVMNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListVirtualMachineScaleSetVMNetworkInterfaces ... -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx context.Context, id VirtualMachineId) (result ListVirtualMachineScaleSetVMNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx context.Context, id VirtualMachineId) (ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult, error) { - return c.ListVirtualMachineScaleSetVMNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id VirtualMachineId, predicate NetworkInterfaceOperationPredicate) (result ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go b/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go deleted file mode 100644 index 90e537d0982..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go +++ /dev/null @@ -1,55 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceIPConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaceIPConfiguration -} - -// NetworkInterfaceIPConfigurationsGet ... -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsGet(ctx context.Context, id commonids.NetworkInterfaceIPConfigurationId) (result NetworkInterfaceIPConfigurationsGetOperationResponse, 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 NetworkInterfaceIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go b/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go deleted file mode 100644 index ca6507341bd..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceIPConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaceIPConfiguration -} - -type NetworkInterfaceIPConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaceIPConfiguration -} - -// NetworkInterfaceIPConfigurationsList ... -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsList(ctx context.Context, id commonids.NetworkInterfaceId) (result NetworkInterfaceIPConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ipConfigurations", 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 *[]NetworkInterfaceIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkInterfaceIPConfigurationsListComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsListComplete(ctx context.Context, id commonids.NetworkInterfaceId) (NetworkInterfaceIPConfigurationsListCompleteResult, error) { - return c.NetworkInterfaceIPConfigurationsListCompleteMatchingPredicate(ctx, id, NetworkInterfaceIPConfigurationOperationPredicate{}) -} - -// NetworkInterfaceIPConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.NetworkInterfaceId, predicate NetworkInterfaceIPConfigurationOperationPredicate) (result NetworkInterfaceIPConfigurationsListCompleteResult, err error) { - items := make([]NetworkInterfaceIPConfiguration, 0) - - resp, err := c.NetworkInterfaceIPConfigurationsList(ctx, id) - if err != nil { - 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 = NetworkInterfaceIPConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go b/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go deleted file mode 100644 index c79ea48c03e..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceLoadBalancersListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancer -} - -type NetworkInterfaceLoadBalancersListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancer -} - -// NetworkInterfaceLoadBalancersList ... -func (c NetworkInterfacesClient) NetworkInterfaceLoadBalancersList(ctx context.Context, id commonids.NetworkInterfaceId) (result NetworkInterfaceLoadBalancersListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/loadBalancers", 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 *[]LoadBalancer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkInterfaceLoadBalancersListComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) NetworkInterfaceLoadBalancersListComplete(ctx context.Context, id commonids.NetworkInterfaceId) (NetworkInterfaceLoadBalancersListCompleteResult, error) { - return c.NetworkInterfaceLoadBalancersListCompleteMatchingPredicate(ctx, id, LoadBalancerOperationPredicate{}) -} - -// NetworkInterfaceLoadBalancersListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) NetworkInterfaceLoadBalancersListCompleteMatchingPredicate(ctx context.Context, id commonids.NetworkInterfaceId, predicate LoadBalancerOperationPredicate) (result NetworkInterfaceLoadBalancersListCompleteResult, err error) { - items := make([]LoadBalancer, 0) - - resp, err := c.NetworkInterfaceLoadBalancersList(ctx, id) - if err != nil { - 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 = NetworkInterfaceLoadBalancersListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go b/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go deleted file mode 100644 index 868ecfb43d5..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceTapConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaceTapConfiguration -} - -// NetworkInterfaceTapConfigurationsGet ... -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsGet(ctx context.Context, id TapConfigurationId) (result NetworkInterfaceTapConfigurationsGetOperationResponse, 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 NetworkInterfaceTapConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go b/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go deleted file mode 100644 index e470acc5259..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceTapConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaceTapConfiguration -} - -type NetworkInterfaceTapConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaceTapConfiguration -} - -// NetworkInterfaceTapConfigurationsList ... -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsList(ctx context.Context, id commonids.NetworkInterfaceId) (result NetworkInterfaceTapConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/tapConfigurations", 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 *[]NetworkInterfaceTapConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkInterfaceTapConfigurationsListComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsListComplete(ctx context.Context, id commonids.NetworkInterfaceId) (NetworkInterfaceTapConfigurationsListCompleteResult, error) { - return c.NetworkInterfaceTapConfigurationsListCompleteMatchingPredicate(ctx, id, NetworkInterfaceTapConfigurationOperationPredicate{}) -} - -// NetworkInterfaceTapConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.NetworkInterfaceId, predicate NetworkInterfaceTapConfigurationOperationPredicate) (result NetworkInterfaceTapConfigurationsListCompleteResult, err error) { - items := make([]NetworkInterfaceTapConfiguration, 0) - - resp, err := c.NetworkInterfaceTapConfigurationsList(ctx, id) - if err != nil { - 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 = NetworkInterfaceTapConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/method_updatetags.go b/resource-manager/network/2023-05-01/networkinterfaces/method_updatetags.go deleted file mode 100644 index ca8e31de55a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/method_updatetags.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkinterfaces - -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 UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -// UpdateTags ... -func (c NetworkInterfacesClient) UpdateTags(ctx context.Context, id commonids.NetworkInterfaceId, 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 126f8350b09..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 15c656ad057..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 34912a8fcbd..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 3b83d83c7c9..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index dd810dfed2c..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygroup.go deleted file mode 100644 index 2948e0c794a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index aa06b33fbe1..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspool.go b/resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspool.go deleted file mode 100644 index bd329cce127..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 7c5d918e43a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index e0be4a6b6f6..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_ddossettings.go b/resource-manager/network/2023-05-01/networkinterfaces/model_ddossettings.go deleted file mode 100644 index 4902360d689..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_delegation.go b/resource-manager/network/2023-05-01/networkinterfaces/model_delegation.go deleted file mode 100644 index 5fb9effbb1b..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroup.go b/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroup.go deleted file mode 100644 index 5c66ee3a9b5..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityGroup struct { - Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - TagMap *map[string][]string `json:"tagMap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go b/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go deleted file mode 100644 index 3c6248c32c9..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityGroupAssociation struct { - NetworkInterface *SubResource `json:"networkInterface,omitempty"` - NetworkManager *SubResource `json:"networkManager,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecurityrule.go b/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecurityrule.go deleted file mode 100644 index 9c9dd92e515..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_effectivenetworksecurityrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityRule struct { - Access *SecurityRuleAccess `json:"access,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction *SecurityRuleDirection `json:"direction,omitempty"` - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_effectiveroute.go b/resource-manager/network/2023-05-01/networkinterfaces/model_effectiveroute.go deleted file mode 100644 index aa9dac67810..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_effectiveroute.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRoute struct { - AddressPrefix *[]string `json:"addressPrefix,omitempty"` - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` - NextHopType *RouteNextHopType `json:"nextHopType,omitempty"` - Source *EffectiveRouteSource `json:"source,omitempty"` - State *EffectiveRouteState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_flowlog.go b/resource-manager/network/2023-05-01/networkinterfaces/model_flowlog.go deleted file mode 100644 index c2f71983a36..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/networkinterfaces/model_flowlogformatparameters.go deleted file mode 100644 index 43abd6c1532..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_flowlogpropertiesformat.go deleted file mode 100644 index e594a5d3819..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfiguration.go deleted file mode 100644 index 35c07477d52..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkinterfaces - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 174b1d44662..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 8562c4824fb..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpool.go b/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpool.go deleted file mode 100644 index a16659ffff0..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go deleted file mode 100644 index 4586e6ec1dc..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPoolPropertiesFormat struct { - BackendPort int64 `json:"backendPort"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPortRangeEnd int64 `json:"frontendPortRangeEnd"` - FrontendPortRangeStart int64 `json:"frontendPortRangeStart"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrule.go b/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrule.go deleted file mode 100644 index a41993b3c8d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 9a882cfef22..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfiguration.go deleted file mode 100644 index c1294125f57..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofile.go deleted file mode 100644 index b5f591fbc35..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 0027cc6adbe..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 1338f55c4e1..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_iptag.go b/resource-manager/network/2023-05-01/networkinterfaces/model_iptag.go deleted file mode 100644 index c2dc282ad0e..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// 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/network/2023-05-01/networkinterfaces/model_loadbalancer.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancer.go deleted file mode 100644 index aaa7bd9d086..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancer.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancer struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - Sku *LoadBalancerSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddress.go deleted file mode 100644 index 58da623122f..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 192b497dd13..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerpropertiesformat.go deleted file mode 100644 index b0c27be8bab..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancerpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerPropertiesFormat struct { - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - Probes *[]Probe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancersku.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancersku.go deleted file mode 100644 index e10cf68701b..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerSku struct { - Name *LoadBalancerSkuName `json:"name,omitempty"` - Tier *LoadBalancerSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrule.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrule.go deleted file mode 100644 index 5ca9aca81f1..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go deleted file mode 100644 index 79fe798b88d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort int64 `json:"frontendPort"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LoadDistribution *LoadDistribution `json:"loadDistribution,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_natgateway.go b/resource-manager/network/2023-05-01/networkinterfaces/model_natgateway.go deleted file mode 100644 index 7fe571d7a74..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkinterfaces - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaypropertiesformat.go deleted file mode 100644 index 9da53fae58a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaysku.go b/resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaysku.go deleted file mode 100644 index aff4514b5e7..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_natruleportmapping.go b/resource-manager/network/2023-05-01/networkinterfaces/model_natruleportmapping.go deleted file mode 100644 index 05068ac7e2f..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterface.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterface.go deleted file mode 100644 index 286c9562aaf..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacednssettings.go deleted file mode 100644 index af3e4e75519..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfiguration.go deleted file mode 100644 index ca861570a5d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index abcc6fdfc5b..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 1baf3488ee0..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 3fd3da2e6e6..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfiguration.go deleted file mode 100644 index e67a81616a9..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 72010ae8dac..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygroup.go deleted file mode 100644 index 05ed91fcd1a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index ce8a013b83a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_outboundrule.go b/resource-manager/network/2023-05-01/networkinterfaces/model_outboundrule.go deleted file mode 100644 index 2afc56da4cc..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_outboundrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OutboundRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_outboundrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_outboundrulepropertiesformat.go deleted file mode 100644 index 4cc4e2f5087..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_outboundrulepropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRulePropertiesFormat struct { - AllocatedOutboundPorts *int64 `json:"allocatedOutboundPorts,omitempty"` - BackendAddressPool SubResource `json:"backendAddressPool"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfigurations []SubResource `json:"frontendIPConfigurations"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol LoadBalancerOutboundRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpoint.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpoint.go deleted file mode 100644 index da5835bccba..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnection.go deleted file mode 100644 index 81a07962195..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/networkinterfaces/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnectionproperties.go deleted file mode 100644 index eb2204732ec..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfiguration.go deleted file mode 100644 index 085039e25e2..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 802747eb32e..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointproperties.go deleted file mode 100644 index ea496b7d032..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkservice.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkservice.go deleted file mode 100644 index 7dcd5f985b9..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnection.go deleted file mode 100644 index 5e32cbfab8a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 355c3d254f2..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 367b48d2fd6..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 3893fd72b02..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index e1c0b0da64c..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceproperties.go deleted file mode 100644 index 2356695f6d1..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_probe.go b/resource-manager/network/2023-05-01/networkinterfaces/model_probe.go deleted file mode 100644 index d935d63eee6..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_probe.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Probe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_probepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_probepropertiesformat.go deleted file mode 100644 index 343b46540f7..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_probepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProbePropertiesFormat struct { - IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - NumberOfProbes *int64 `json:"numberOfProbes,omitempty"` - Port int64 `json:"port"` - ProbeThreshold *int64 `json:"probeThreshold,omitempty"` - Protocol ProbeProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestPath *string `json:"requestPath,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddress.go b/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddress.go deleted file mode 100644 index e89fe49804b..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddressdnssettings.go deleted file mode 100644 index 9a6ffc1106a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresspropertiesformat.go deleted file mode 100644 index b13efec6d42..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresssku.go deleted file mode 100644 index 4f6513789bc..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlink.go deleted file mode 100644 index 4a3f135d98d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlinkformat.go deleted file mode 100644 index aa59d57de52..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_resourceset.go b/resource-manager/network/2023-05-01/networkinterfaces/model_resourceset.go deleted file mode 100644 index 48356d239d8..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/networkinterfaces/model_retentionpolicyparameters.go deleted file mode 100644 index fe69c5c3389..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_route.go b/resource-manager/network/2023-05-01/networkinterfaces/model_route.go deleted file mode 100644 index 8dd1c1c5cbe..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_routepropertiesformat.go deleted file mode 100644 index b031c9a871e..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_routetable.go b/resource-manager/network/2023-05-01/networkinterfaces/model_routetable.go deleted file mode 100644 index 31df96e7b73..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_routetablepropertiesformat.go deleted file mode 100644 index 3c524eb8fe1..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_securityrule.go b/resource-manager/network/2023-05-01/networkinterfaces/model_securityrule.go deleted file mode 100644 index af9210ebc2f..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_securityrulepropertiesformat.go deleted file mode 100644 index 0ff4ba975dc..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlink.go deleted file mode 100644 index 88ebd302e70..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 538945df5d3..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 8444d0d495d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicy.go deleted file mode 100644 index c77c2e3460a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 6f523978f5b..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index ddd9db6fe47..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 2692b80393d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 041498d2501..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_subnet.go b/resource-manager/network/2023-05-01/networkinterfaces/model_subnet.go deleted file mode 100644 index 47a0e306b4a..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_subnetpropertiesformat.go deleted file mode 100644 index e9d9e3404ed..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_subresource.go b/resource-manager/network/2023-05-01/networkinterfaces/model_subresource.go deleted file mode 100644 index 28fa931dbee..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_tagsobject.go b/resource-manager/network/2023-05-01/networkinterfaces/model_tagsobject.go deleted file mode 100644 index 32bf2f0b066..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// 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/network/2023-05-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index bd0b0fa5fe0..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsproperties.go deleted file mode 100644 index 302f5bfcc4d..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktap.go deleted file mode 100644 index 315bcaef069..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 90ce2721f15..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkinterfaces/predicates.go b/resource-manager/network/2023-05-01/networkinterfaces/predicates.go deleted file mode 100644 index c58ed4a328b..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/predicates.go +++ /dev/null @@ -1,152 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityGroupOperationPredicate struct { -} - -func (p EffectiveNetworkSecurityGroupOperationPredicate) Matches(input EffectiveNetworkSecurityGroup) bool { - - return true -} - -type EffectiveRouteOperationPredicate struct { - DisableBgpRoutePropagation *bool - Name *string -} - -func (p EffectiveRouteOperationPredicate) Matches(input EffectiveRoute) bool { - - if p.DisableBgpRoutePropagation != nil && (input.DisableBgpRoutePropagation == nil || *p.DisableBgpRoutePropagation != *input.DisableBgpRoutePropagation) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type LoadBalancerOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p LoadBalancerOperationPredicate) Matches(input LoadBalancer) 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 && (input.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 NetworkInterfaceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkInterfaceOperationPredicate) Matches(input NetworkInterface) 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 && (input.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 NetworkInterfaceIPConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkInterfaceIPConfigurationOperationPredicate) Matches(input NetworkInterfaceIPConfiguration) 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.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 NetworkInterfaceTapConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkInterfaceTapConfigurationOperationPredicate) Matches(input NetworkInterfaceTapConfiguration) 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.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/network/2023-05-01/networkinterfaces/version.go b/resource-manager/network/2023-05-01/networkinterfaces/version.go deleted file mode 100644 index aba98fd1fb2..00000000000 --- a/resource-manager/network/2023-05-01/networkinterfaces/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkinterfaces/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/README.md b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/README.md deleted file mode 100644 index d4b9fe93cd2..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanageractiveconfigurations` Documentation - -The `networkmanageractiveconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkmanageractiveconfigurations" -``` - - -### Client Initialization - -```go -client := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerActiveConfigurationsClient.ListActiveSecurityAdminRules` - -```go -ctx := context.TODO() -id := networkmanageractiveconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanageractiveconfigurations.ActiveConfigurationParameter{ - // ... -} - - -read, err := client.ListActiveSecurityAdminRules(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/network/2023-05-01/networkmanageractiveconfigurations/client.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/client.go deleted file mode 100644 index fd577e53f33..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanageractiveconfigurations - -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 NetworkManagerActiveConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerActiveConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerActiveConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanageractiveconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerActiveConfigurationsClient: %+v", err) - } - - return &NetworkManagerActiveConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/constants.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/constants.go deleted file mode 100644 index e4a2b230b6e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package networkmanageractiveconfigurations - -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 AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -func PossibleValuesForAddressPrefixType() []string { - return []string{ - string(AddressPrefixTypeIPPrefix), - string(AddressPrefixTypeServiceTag), - } -} - -func (s *AddressPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAddressPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAddressPrefixType(input string) (*AddressPrefixType, error) { - vals := map[string]AddressPrefixType{ - "ipprefix": AddressPrefixTypeIPPrefix, - "servicetag": AddressPrefixTypeServiceTag, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AddressPrefixType(input) - return &out, nil -} - -type EffectiveAdminRuleKind string - -const ( - EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" - EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" -) - -func PossibleValuesForEffectiveAdminRuleKind() []string { - return []string{ - string(EffectiveAdminRuleKindCustom), - string(EffectiveAdminRuleKindDefault), - } -} - -func (s *EffectiveAdminRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveAdminRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveAdminRuleKind(input string) (*EffectiveAdminRuleKind, error) { - vals := map[string]EffectiveAdminRuleKind{ - "custom": EffectiveAdminRuleKindCustom, - "default": EffectiveAdminRuleKindDefault, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveAdminRuleKind(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -func PossibleValuesForSecurityConfigurationRuleAccess() []string { - return []string{ - string(SecurityConfigurationRuleAccessAllow), - string(SecurityConfigurationRuleAccessAlwaysAllow), - string(SecurityConfigurationRuleAccessDeny), - } -} - -func (s *SecurityConfigurationRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleAccess(input string) (*SecurityConfigurationRuleAccess, error) { - vals := map[string]SecurityConfigurationRuleAccess{ - "allow": SecurityConfigurationRuleAccessAllow, - "alwaysallow": SecurityConfigurationRuleAccessAlwaysAllow, - "deny": SecurityConfigurationRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleAccess(input) - return &out, nil -} - -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityConfigurationRuleDirection() []string { - return []string{ - string(SecurityConfigurationRuleDirectionInbound), - string(SecurityConfigurationRuleDirectionOutbound), - } -} - -func (s *SecurityConfigurationRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleDirection(input string) (*SecurityConfigurationRuleDirection, error) { - vals := map[string]SecurityConfigurationRuleDirection{ - "inbound": SecurityConfigurationRuleDirectionInbound, - "outbound": SecurityConfigurationRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleDirection(input) - return &out, nil -} - -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTcp SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUdp SecurityConfigurationRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityConfigurationRuleProtocol() []string { - return []string{ - string(SecurityConfigurationRuleProtocolAh), - string(SecurityConfigurationRuleProtocolAny), - string(SecurityConfigurationRuleProtocolEsp), - string(SecurityConfigurationRuleProtocolIcmp), - string(SecurityConfigurationRuleProtocolTcp), - string(SecurityConfigurationRuleProtocolUdp), - } -} - -func (s *SecurityConfigurationRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleProtocol(input string) (*SecurityConfigurationRuleProtocol, error) { - vals := map[string]SecurityConfigurationRuleProtocol{ - "ah": SecurityConfigurationRuleProtocolAh, - "any": SecurityConfigurationRuleProtocolAny, - "esp": SecurityConfigurationRuleProtocolEsp, - "icmp": SecurityConfigurationRuleProtocolIcmp, - "tcp": SecurityConfigurationRuleProtocolTcp, - "udp": SecurityConfigurationRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager.go deleted file mode 100644 index ee0e5e5a9c8..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkmanageractiveconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager_test.go deleted file mode 100644 index e1c6ebe2617..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkmanageractiveconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go deleted file mode 100644 index 0a882c8e731..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanageractiveconfigurations - -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 ListActiveSecurityAdminRulesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ActiveSecurityAdminRulesListResult -} - -// ListActiveSecurityAdminRules ... -func (c NetworkManagerActiveConfigurationsClient) ListActiveSecurityAdminRules(ctx context.Context, id NetworkManagerId, input ActiveConfigurationParameter) (result ListActiveSecurityAdminRulesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listActiveSecurityAdminRules", 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 ActiveSecurityAdminRulesListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go deleted file mode 100644 index c19193dfd82..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go +++ /dev/null @@ -1,61 +0,0 @@ -package networkmanageractiveconfigurations - -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 ActiveBaseSecurityAdminRule interface { -} - -// RawActiveBaseSecurityAdminRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawActiveBaseSecurityAdminRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalActiveBaseSecurityAdminRuleImplementation(input []byte) (ActiveBaseSecurityAdminRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ActiveBaseSecurityAdminRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Default") { - var out ActiveDefaultSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActiveDefaultSecurityAdminRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Custom") { - var out ActiveSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActiveSecurityAdminRule: %+v", err) - } - return out, nil - } - - out := RawActiveBaseSecurityAdminRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go deleted file mode 100644 index 309a4998c1b..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveConfigurationParameter struct { - Regions *[]string `json:"regions,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go deleted file mode 100644 index 371ee82ef8c..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go +++ /dev/null @@ -1,63 +0,0 @@ -package networkmanageractiveconfigurations - -import ( - "encoding/json" - "fmt" - "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. - -var _ ActiveBaseSecurityAdminRule = ActiveDefaultSecurityAdminRule{} - -type ActiveDefaultSecurityAdminRule struct { - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from ActiveBaseSecurityAdminRule - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - Region *string `json:"region,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -func (o *ActiveDefaultSecurityAdminRule) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveDefaultSecurityAdminRule) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} - -var _ json.Marshaler = ActiveDefaultSecurityAdminRule{} - -func (s ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper ActiveDefaultSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActiveDefaultSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActiveDefaultSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Default" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActiveDefaultSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go deleted file mode 100644 index 70266c6ff7c..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go +++ /dev/null @@ -1,63 +0,0 @@ -package networkmanageractiveconfigurations - -import ( - "encoding/json" - "fmt" - "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. - -var _ ActiveBaseSecurityAdminRule = ActiveSecurityAdminRule{} - -type ActiveSecurityAdminRule struct { - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from ActiveBaseSecurityAdminRule - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - Region *string `json:"region,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -func (o *ActiveSecurityAdminRule) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveSecurityAdminRule) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} - -var _ json.Marshaler = ActiveSecurityAdminRule{} - -func (s ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper ActiveSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActiveSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActiveSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Custom" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActiveSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go deleted file mode 100644 index c9007f5e0f3..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go +++ /dev/null @@ -1,49 +0,0 @@ -package networkmanageractiveconfigurations - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveSecurityAdminRulesListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]ActiveBaseSecurityAdminRule `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &ActiveSecurityAdminRulesListResult{} - -func (s *ActiveSecurityAdminRulesListResult) UnmarshalJSON(bytes []byte) error { - type alias ActiveSecurityAdminRulesListResult - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into ActiveSecurityAdminRulesListResult: %+v", err) - } - - s.SkipToken = decoded.SkipToken - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling ActiveSecurityAdminRulesListResult into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]ActiveBaseSecurityAdminRule, 0) - for i, val := range listTemp { - impl, err := unmarshalActiveBaseSecurityAdminRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'ActiveSecurityAdminRulesListResult': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_addressprefixitem.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_addressprefixitem.go deleted file mode 100644 index f82ae16f590..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_addressprefixitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressPrefixItem struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go deleted file mode 100644 index afc108f8ff4..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_configurationgroup.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_configurationgroup.go deleted file mode 100644 index be051a18f2d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go deleted file mode 100644 index 665a643ae5e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkgroupproperties.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkgroupproperties.go deleted file mode 100644 index ed891dc195e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go deleted file mode 100644 index 6457c3d0001..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerSecurityGroupItem struct { - NetworkGroupId string `json:"networkGroupId"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/version.go b/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/version.go deleted file mode 100644 index 3b95af93d3d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanageractiveconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/README.md b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/README.md deleted file mode 100644 index 805cb883370..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations` Documentation - -The `networkmanageractiveconnectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkmanageractiveconnectivityconfigurations" -``` - - -### Client Initialization - -```go -client := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerActiveConnectivityConfigurationsClient.ListActiveConnectivityConfigurations` - -```go -ctx := context.TODO() -id := networkmanageractiveconnectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanageractiveconnectivityconfigurations.ActiveConfigurationParameter{ - // ... -} - - -read, err := client.ListActiveConnectivityConfigurations(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/network/2023-05-01/networkmanageractiveconnectivityconfigurations/client.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/client.go deleted file mode 100644 index 25282a2bad5..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 NetworkManagerActiveConnectivityConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerActiveConnectivityConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanageractiveconnectivityconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerActiveConnectivityConfigurationsClient: %+v", err) - } - - return &NetworkManagerActiveConnectivityConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/constants.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/constants.go deleted file mode 100644 index ce9e85b744a..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/constants.go +++ /dev/null @@ -1,262 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -func PossibleValuesForConnectivityTopology() []string { - return []string{ - string(ConnectivityTopologyHubAndSpoke), - string(ConnectivityTopologyMesh), - } -} - -func (s *ConnectivityTopology) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityTopology(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityTopology(input string) (*ConnectivityTopology, error) { - vals := map[string]ConnectivityTopology{ - "hubandspoke": ConnectivityTopologyHubAndSpoke, - "mesh": ConnectivityTopologyMesh, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityTopology(input) - return &out, nil -} - -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -func PossibleValuesForDeleteExistingPeering() []string { - return []string{ - string(DeleteExistingPeeringFalse), - string(DeleteExistingPeeringTrue), - } -} - -func (s *DeleteExistingPeering) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteExistingPeering(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteExistingPeering(input string) (*DeleteExistingPeering, error) { - vals := map[string]DeleteExistingPeering{ - "false": DeleteExistingPeeringFalse, - "true": DeleteExistingPeeringTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteExistingPeering(input) - return &out, nil -} - -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -func PossibleValuesForGroupConnectivity() []string { - return []string{ - string(GroupConnectivityDirectlyConnected), - string(GroupConnectivityNone), - } -} - -func (s *GroupConnectivity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGroupConnectivity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGroupConnectivity(input string) (*GroupConnectivity, error) { - vals := map[string]GroupConnectivity{ - "directlyconnected": GroupConnectivityDirectlyConnected, - "none": GroupConnectivityNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GroupConnectivity(input) - return &out, nil -} - -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -func PossibleValuesForIsGlobal() []string { - return []string{ - string(IsGlobalFalse), - string(IsGlobalTrue), - } -} - -func (s *IsGlobal) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsGlobal(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsGlobal(input string) (*IsGlobal, error) { - vals := map[string]IsGlobal{ - "false": IsGlobalFalse, - "true": IsGlobalTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsGlobal(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -func PossibleValuesForUseHubGateway() []string { - return []string{ - string(UseHubGatewayFalse), - string(UseHubGatewayTrue), - } -} - -func (s *UseHubGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUseHubGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUseHubGateway(input string) (*UseHubGateway, error) { - vals := map[string]UseHubGateway{ - "false": UseHubGatewayFalse, - "true": UseHubGatewayTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UseHubGateway(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go deleted file mode 100644 index 4b1919fa120..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go deleted file mode 100644 index ba44a76acbb..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go deleted file mode 100644 index a4c1e51550d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 ListActiveConnectivityConfigurationsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ActiveConnectivityConfigurationsListResult -} - -// ListActiveConnectivityConfigurations ... -func (c NetworkManagerActiveConnectivityConfigurationsClient) ListActiveConnectivityConfigurations(ctx context.Context, id NetworkManagerId, input ActiveConfigurationParameter) (result ListActiveConnectivityConfigurationsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listActiveConnectivityConfigurations", 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 ActiveConnectivityConfigurationsListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go deleted file mode 100644 index 835513d64ee..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveConfigurationParameter struct { - Regions *[]string `json:"regions,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go deleted file mode 100644 index b836614744d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go +++ /dev/null @@ -1,30 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 ActiveConnectivityConfiguration struct { - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` - Id *string `json:"id,omitempty"` - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` - Region *string `json:"region,omitempty"` -} - -func (o *ActiveConnectivityConfiguration) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveConnectivityConfiguration) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go deleted file mode 100644 index 6fbfafeb4f7..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveConnectivityConfigurationsListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]ActiveConnectivityConfiguration `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go deleted file mode 100644 index 2f7ac6eb77f..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go deleted file mode 100644 index 07a3c4a945c..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go deleted file mode 100644 index 18571eaa75f..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityGroupItem struct { - GroupConnectivity GroupConnectivity `json:"groupConnectivity"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - NetworkGroupId string `json:"networkGroupId"` - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_hub.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_hub.go deleted file mode 100644 index 6d2eef46795..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_hub.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Hub struct { - ResourceId *string `json:"resourceId,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go deleted file mode 100644 index 46f87e5058e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/version.go b/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/version.go deleted file mode 100644 index 6684613f1ba..00000000000 --- a/resource-manager/network/2023-05-01/networkmanageractiveconnectivityconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconnectivityconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/README.md b/resource-manager/network/2023-05-01/networkmanagerconnections/README.md deleted file mode 100644 index 8ebe94f2c25..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/README.md +++ /dev/null @@ -1,161 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagerconnections` Documentation - -The `networkmanagerconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkmanagerconnections" -``` - - -### Client Initialization - -```go -client := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -payload := networkmanagerconnections.NetworkManagerConnection{ - // ... -} - - -read, err := client.ManagementGroupNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsDelete` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -read, err := client.ManagementGroupNetworkManagerConnectionsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsGet` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -read, err := client.ManagementGroupNetworkManagerConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsList` - -```go -ctx := context.TODO() -id := commonids.NewManagementGroupID("groupIdValue") - -// alternatively `client.ManagementGroupNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination -items, err := client.ManagementGroupNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -payload := networkmanagerconnections.NetworkManagerConnection{ - // ... -} - - -read, err := client.SubscriptionNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsDelete` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -read, err := client.SubscriptionNetworkManagerConnectionsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsGet` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -read, err := client.SubscriptionNetworkManagerConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.SubscriptionNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination -items, err := client.SubscriptionNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/client.go b/resource-manager/network/2023-05-01/networkmanagerconnections/client.go deleted file mode 100644 index 3cfa72a376e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagerconnections - -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 NetworkManagerConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagerconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerConnectionsClient: %+v", err) - } - - return &NetworkManagerConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/constants.go b/resource-manager/network/2023-05-01/networkmanagerconnections/constants.go deleted file mode 100644 index 47d6adfd207..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package networkmanagerconnections - -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 ScopeConnectionState string - -const ( - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" - ScopeConnectionStateConnected ScopeConnectionState = "Connected" - ScopeConnectionStatePending ScopeConnectionState = "Pending" - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" -) - -func PossibleValuesForScopeConnectionState() []string { - return []string{ - string(ScopeConnectionStateConflict), - string(ScopeConnectionStateConnected), - string(ScopeConnectionStatePending), - string(ScopeConnectionStateRejected), - string(ScopeConnectionStateRevoked), - } -} - -func (s *ScopeConnectionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScopeConnectionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScopeConnectionState(input string) (*ScopeConnectionState, error) { - vals := map[string]ScopeConnectionState{ - "conflict": ScopeConnectionStateConflict, - "connected": ScopeConnectionStateConnected, - "pending": ScopeConnectionStatePending, - "rejected": ScopeConnectionStateRejected, - "revoked": ScopeConnectionStateRevoked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScopeConnectionState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection.go b/resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection.go deleted file mode 100644 index 066e316e2cb..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection.go +++ /dev/null @@ -1,121 +0,0 @@ -package networkmanagerconnections - -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(&NetworkManagerConnectionId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerConnectionId{} - -// NetworkManagerConnectionId is a struct representing the Resource ID for a Network Manager Connection -type NetworkManagerConnectionId struct { - SubscriptionId string - NetworkManagerConnectionName string -} - -// NewNetworkManagerConnectionID returns a new NetworkManagerConnectionId struct -func NewNetworkManagerConnectionID(subscriptionId string, networkManagerConnectionName string) NetworkManagerConnectionId { - return NetworkManagerConnectionId{ - SubscriptionId: subscriptionId, - NetworkManagerConnectionName: networkManagerConnectionName, - } -} - -// ParseNetworkManagerConnectionID parses 'input' into a NetworkManagerConnectionId -func ParseNetworkManagerConnectionID(input string) (*NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerConnectionIDInsensitively parses 'input' case-insensitively into a NetworkManagerConnectionId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerConnectionIDInsensitively(input string) (*NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerConnectionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.NetworkManagerConnectionName, ok = input.Parsed["networkManagerConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerConnectionName", input) - } - - return nil -} - -// ValidateNetworkManagerConnectionID checks that 'input' can be parsed as a Network Manager Connection ID -func ValidateNetworkManagerConnectionID(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 := ParseNetworkManagerConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager Connection ID -func (id NetworkManagerConnectionId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/networkManagerConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.NetworkManagerConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager Connection ID -func (id NetworkManagerConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagerConnections", "networkManagerConnections", "networkManagerConnections"), - resourceids.UserSpecifiedSegment("networkManagerConnectionName", "networkManagerConnectionValue"), - } -} - -// String returns a human-readable description of this Network Manager Connection ID -func (id NetworkManagerConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Network Manager Connection Name: %q", id.NetworkManagerConnectionName), - } - return fmt.Sprintf("Network Manager Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection_test.go b/resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection_test.go deleted file mode 100644 index acb385214fd..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/id_networkmanagerconnection_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package networkmanagerconnections - -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 = &NetworkManagerConnectionId{} - -func TestNewNetworkManagerConnectionID(t *testing.T) { - id := NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - - 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.NetworkManagerConnectionName != "networkManagerConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerConnectionName'", id.NetworkManagerConnectionName, "networkManagerConnectionValue") - } -} - -func TestFormatNetworkManagerConnectionID(t *testing.T) { - actual := NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &NetworkManagerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerConnectionID(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.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestParseNetworkManagerConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &NetworkManagerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - Expected: &NetworkManagerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkManagerConnectionName: "nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerConnectionIDInsensitively(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.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestSegmentsForNetworkManagerConnectionId(t *testing.T) { - segments := NetworkManagerConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerConnectionId 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/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection.go b/resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection.go deleted file mode 100644 index 81d73abef15..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection.go +++ /dev/null @@ -1,123 +0,0 @@ -package networkmanagerconnections - -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(&Providers2NetworkManagerConnectionId{}) -} - -var _ resourceids.ResourceId = &Providers2NetworkManagerConnectionId{} - -// Providers2NetworkManagerConnectionId is a struct representing the Resource ID for a Providers 2 Network Manager Connection -type Providers2NetworkManagerConnectionId struct { - ManagementGroupId string - NetworkManagerConnectionName string -} - -// NewProviders2NetworkManagerConnectionID returns a new Providers2NetworkManagerConnectionId struct -func NewProviders2NetworkManagerConnectionID(managementGroupId string, networkManagerConnectionName string) Providers2NetworkManagerConnectionId { - return Providers2NetworkManagerConnectionId{ - ManagementGroupId: managementGroupId, - NetworkManagerConnectionName: networkManagerConnectionName, - } -} - -// ParseProviders2NetworkManagerConnectionID parses 'input' into a Providers2NetworkManagerConnectionId -func ParseProviders2NetworkManagerConnectionID(input string) (*Providers2NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&Providers2NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := Providers2NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviders2NetworkManagerConnectionIDInsensitively parses 'input' case-insensitively into a Providers2NetworkManagerConnectionId -// note: this method should only be used for API response data and not user input -func ParseProviders2NetworkManagerConnectionIDInsensitively(input string) (*Providers2NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&Providers2NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := Providers2NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *Providers2NetworkManagerConnectionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.ManagementGroupId, ok = input.Parsed["managementGroupId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "managementGroupId", input) - } - - if id.NetworkManagerConnectionName, ok = input.Parsed["networkManagerConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerConnectionName", input) - } - - return nil -} - -// ValidateProviders2NetworkManagerConnectionID checks that 'input' can be parsed as a Providers 2 Network Manager Connection ID -func ValidateProviders2NetworkManagerConnectionID(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 := ParseProviders2NetworkManagerConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Providers 2 Network Manager Connection ID -func (id Providers2NetworkManagerConnectionId) ID() string { - fmtString := "/providers/Microsoft.Management/managementGroups/%s/providers/Microsoft.Network/networkManagerConnections/%s" - return fmt.Sprintf(fmtString, id.ManagementGroupId, id.NetworkManagerConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Providers 2 Network Manager Connection ID -func (id Providers2NetworkManagerConnectionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftManagement", "Microsoft.Management", "Microsoft.Management"), - resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), - resourceids.UserSpecifiedSegment("managementGroupId", "managementGroupIdValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagerConnections", "networkManagerConnections", "networkManagerConnections"), - resourceids.UserSpecifiedSegment("networkManagerConnectionName", "networkManagerConnectionValue"), - } -} - -// String returns a human-readable description of this Providers 2 Network Manager Connection ID -func (id Providers2NetworkManagerConnectionId) String() string { - components := []string{ - fmt.Sprintf("Management Group: %q", id.ManagementGroupId), - fmt.Sprintf("Network Manager Connection Name: %q", id.NetworkManagerConnectionName), - } - return fmt.Sprintf("Providers 2 Network Manager Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go b/resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go deleted file mode 100644 index 0ee86660877..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go +++ /dev/null @@ -1,267 +0,0 @@ -package networkmanagerconnections - -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 = &Providers2NetworkManagerConnectionId{} - -func TestNewProviders2NetworkManagerConnectionID(t *testing.T) { - id := NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - - if id.ManagementGroupId != "managementGroupIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagementGroupId'", id.ManagementGroupId, "managementGroupIdValue") - } - - if id.NetworkManagerConnectionName != "networkManagerConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerConnectionName'", id.NetworkManagerConnectionName, "networkManagerConnectionValue") - } -} - -func TestFormatProviders2NetworkManagerConnectionID(t *testing.T) { - actual := NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue").ID() - expected := "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviders2NetworkManagerConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *Providers2NetworkManagerConnectionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &Providers2NetworkManagerConnectionId{ - ManagementGroupId: "managementGroupIdValue", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviders2NetworkManagerConnectionID(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.ManagementGroupId != v.Expected.ManagementGroupId { - t.Fatalf("Expected %q but got %q for ManagementGroupId", v.Expected.ManagementGroupId, actual.ManagementGroupId) - } - - if actual.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestParseProviders2NetworkManagerConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *Providers2NetworkManagerConnectionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &Providers2NetworkManagerConnectionId{ - ManagementGroupId: "managementGroupIdValue", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - Expected: &Providers2NetworkManagerConnectionId{ - ManagementGroupId: "mAnAgEmEnTgRoUpIdVaLuE", - NetworkManagerConnectionName: "nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviders2NetworkManagerConnectionIDInsensitively(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.ManagementGroupId != v.Expected.ManagementGroupId { - t.Fatalf("Expected %q but got %q for ManagementGroupId", v.Expected.ManagementGroupId, actual.ManagementGroupId) - } - - if actual.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestSegmentsForProviders2NetworkManagerConnectionId(t *testing.T) { - segments := Providers2NetworkManagerConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("Providers2NetworkManagerConnectionId 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/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go deleted file mode 100644 index cddf4364027..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// ManagementGroupNetworkManagerConnectionsCreateOrUpdate ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsCreateOrUpdate(ctx context.Context, id Providers2NetworkManagerConnectionId, input NetworkManagerConnection) (result ManagementGroupNetworkManagerConnectionsCreateOrUpdateOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go deleted file mode 100644 index 83c0e93f95b..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// ManagementGroupNetworkManagerConnectionsDelete ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsDelete(ctx context.Context, id Providers2NetworkManagerConnectionId) (result ManagementGroupNetworkManagerConnectionsDeleteOperationResponse, 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/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go deleted file mode 100644 index 9e0447e4aea..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// ManagementGroupNetworkManagerConnectionsGet ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsGet(ctx context.Context, id Providers2NetworkManagerConnectionId) (result ManagementGroupNetworkManagerConnectionsGetOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go deleted file mode 100644 index fac033855a5..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkManagerConnection -} - -type ManagementGroupNetworkManagerConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManagerConnection -} - -type ManagementGroupNetworkManagerConnectionsListOperationOptions struct { - Top *int64 -} - -func DefaultManagementGroupNetworkManagerConnectionsListOperationOptions() ManagementGroupNetworkManagerConnectionsListOperationOptions { - return ManagementGroupNetworkManagerConnectionsListOperationOptions{} -} - -func (o ManagementGroupNetworkManagerConnectionsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ManagementGroupNetworkManagerConnectionsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ManagementGroupNetworkManagerConnectionsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// ManagementGroupNetworkManagerConnectionsList ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsList(ctx context.Context, id commonids.ManagementGroupId, options ManagementGroupNetworkManagerConnectionsListOperationOptions) (result ManagementGroupNetworkManagerConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagerConnections", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManagerConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ManagementGroupNetworkManagerConnectionsListComplete retrieves all the results into a single object -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsListComplete(ctx context.Context, id commonids.ManagementGroupId, options ManagementGroupNetworkManagerConnectionsListOperationOptions) (ManagementGroupNetworkManagerConnectionsListCompleteResult, error) { - return c.ManagementGroupNetworkManagerConnectionsListCompleteMatchingPredicate(ctx, id, options, NetworkManagerConnectionOperationPredicate{}) -} - -// ManagementGroupNetworkManagerConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsListCompleteMatchingPredicate(ctx context.Context, id commonids.ManagementGroupId, options ManagementGroupNetworkManagerConnectionsListOperationOptions, predicate NetworkManagerConnectionOperationPredicate) (result ManagementGroupNetworkManagerConnectionsListCompleteResult, err error) { - items := make([]NetworkManagerConnection, 0) - - resp, err := c.ManagementGroupNetworkManagerConnectionsList(ctx, id, options) - if err != nil { - 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 = ManagementGroupNetworkManagerConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go deleted file mode 100644 index 4447d41cf06..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// SubscriptionNetworkManagerConnectionsCreateOrUpdate ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsCreateOrUpdate(ctx context.Context, id NetworkManagerConnectionId, input NetworkManagerConnection) (result SubscriptionNetworkManagerConnectionsCreateOrUpdateOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go deleted file mode 100644 index 43ebf8bb5e4..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// SubscriptionNetworkManagerConnectionsDelete ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsDelete(ctx context.Context, id NetworkManagerConnectionId) (result SubscriptionNetworkManagerConnectionsDeleteOperationResponse, 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/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go deleted file mode 100644 index 5f0b27a080c..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// SubscriptionNetworkManagerConnectionsGet ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsGet(ctx context.Context, id NetworkManagerConnectionId) (result SubscriptionNetworkManagerConnectionsGetOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go b/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go deleted file mode 100644 index ab6843bb734..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkManagerConnection -} - -type SubscriptionNetworkManagerConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManagerConnection -} - -type SubscriptionNetworkManagerConnectionsListOperationOptions struct { - Top *int64 -} - -func DefaultSubscriptionNetworkManagerConnectionsListOperationOptions() SubscriptionNetworkManagerConnectionsListOperationOptions { - return SubscriptionNetworkManagerConnectionsListOperationOptions{} -} - -func (o SubscriptionNetworkManagerConnectionsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o SubscriptionNetworkManagerConnectionsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o SubscriptionNetworkManagerConnectionsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// SubscriptionNetworkManagerConnectionsList ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsList(ctx context.Context, id commonids.SubscriptionId, options SubscriptionNetworkManagerConnectionsListOperationOptions) (result SubscriptionNetworkManagerConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagerConnections", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManagerConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SubscriptionNetworkManagerConnectionsListComplete retrieves all the results into a single object -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsListComplete(ctx context.Context, id commonids.SubscriptionId, options SubscriptionNetworkManagerConnectionsListOperationOptions) (SubscriptionNetworkManagerConnectionsListCompleteResult, error) { - return c.SubscriptionNetworkManagerConnectionsListCompleteMatchingPredicate(ctx, id, options, NetworkManagerConnectionOperationPredicate{}) -} - -// SubscriptionNetworkManagerConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options SubscriptionNetworkManagerConnectionsListOperationOptions, predicate NetworkManagerConnectionOperationPredicate) (result SubscriptionNetworkManagerConnectionsListCompleteResult, err error) { - items := make([]NetworkManagerConnection, 0) - - resp, err := c.SubscriptionNetworkManagerConnectionsList(ctx, id, options) - if err != nil { - 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 = SubscriptionNetworkManagerConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnection.go b/resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnection.go deleted file mode 100644 index a7548b73699..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnection.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkmanagerconnections - -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 NetworkManagerConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkManagerConnectionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go b/resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go deleted file mode 100644 index faec43c2f30..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagerconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerConnectionProperties struct { - ConnectionState *ScopeConnectionState `json:"connectionState,omitempty"` - Description *string `json:"description,omitempty"` - NetworkManagerId *string `json:"networkManagerId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagerconnections/predicates.go b/resource-manager/network/2023-05-01/networkmanagerconnections/predicates.go deleted file mode 100644 index 145b7b7261a..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package networkmanagerconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkManagerConnectionOperationPredicate) Matches(input NetworkManagerConnection) 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.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/network/2023-05-01/networkmanagerconnections/version.go b/resource-manager/network/2023-05-01/networkmanagerconnections/version.go deleted file mode 100644 index f0870e7f5c9..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagerconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagerconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagerconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/README.md b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/README.md deleted file mode 100644 index c93421e6284..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration` Documentation - -The `networkmanagereffectiveconnectivityconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration" -``` - - -### Client Initialization - -```go -client := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerEffectiveConnectivityConfigurationClient.ListNetworkManagerEffectiveConnectivityConfigurations` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := networkmanagereffectiveconnectivityconfiguration.QueryRequestOptions{ - // ... -} - - -read, err := client.ListNetworkManagerEffectiveConnectivityConfigurations(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/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/client.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/client.go deleted file mode 100644 index 2f234ee82ef..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -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 NetworkManagerEffectiveConnectivityConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerEffectiveConnectivityConfigurationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagereffectiveconnectivityconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerEffectiveConnectivityConfigurationClient: %+v", err) - } - - return &NetworkManagerEffectiveConnectivityConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go deleted file mode 100644 index 06b5b5629ff..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ /dev/null @@ -1,262 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -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 ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -func PossibleValuesForConnectivityTopology() []string { - return []string{ - string(ConnectivityTopologyHubAndSpoke), - string(ConnectivityTopologyMesh), - } -} - -func (s *ConnectivityTopology) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityTopology(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityTopology(input string) (*ConnectivityTopology, error) { - vals := map[string]ConnectivityTopology{ - "hubandspoke": ConnectivityTopologyHubAndSpoke, - "mesh": ConnectivityTopologyMesh, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityTopology(input) - return &out, nil -} - -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -func PossibleValuesForDeleteExistingPeering() []string { - return []string{ - string(DeleteExistingPeeringFalse), - string(DeleteExistingPeeringTrue), - } -} - -func (s *DeleteExistingPeering) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteExistingPeering(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteExistingPeering(input string) (*DeleteExistingPeering, error) { - vals := map[string]DeleteExistingPeering{ - "false": DeleteExistingPeeringFalse, - "true": DeleteExistingPeeringTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteExistingPeering(input) - return &out, nil -} - -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -func PossibleValuesForGroupConnectivity() []string { - return []string{ - string(GroupConnectivityDirectlyConnected), - string(GroupConnectivityNone), - } -} - -func (s *GroupConnectivity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGroupConnectivity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGroupConnectivity(input string) (*GroupConnectivity, error) { - vals := map[string]GroupConnectivity{ - "directlyconnected": GroupConnectivityDirectlyConnected, - "none": GroupConnectivityNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GroupConnectivity(input) - return &out, nil -} - -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -func PossibleValuesForIsGlobal() []string { - return []string{ - string(IsGlobalFalse), - string(IsGlobalTrue), - } -} - -func (s *IsGlobal) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsGlobal(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsGlobal(input string) (*IsGlobal, error) { - vals := map[string]IsGlobal{ - "false": IsGlobalFalse, - "true": IsGlobalTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsGlobal(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -func PossibleValuesForUseHubGateway() []string { - return []string{ - string(UseHubGatewayFalse), - string(UseHubGatewayTrue), - } -} - -func (s *UseHubGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUseHubGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUseHubGateway(input string) (*UseHubGateway, error) { - vals := map[string]UseHubGateway{ - "false": UseHubGatewayFalse, - "true": UseHubGatewayTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UseHubGateway(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go deleted file mode 100644 index d752edf32eb..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go +++ /dev/null @@ -1,60 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -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 ListNetworkManagerEffectiveConnectivityConfigurationsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerEffectiveConnectivityConfigurationListResult -} - -// ListNetworkManagerEffectiveConnectivityConfigurations ... -func (c NetworkManagerEffectiveConnectivityConfigurationClient) ListNetworkManagerEffectiveConnectivityConfigurations(ctx context.Context, id commonids.VirtualNetworkId, input QueryRequestOptions) (result ListNetworkManagerEffectiveConnectivityConfigurationsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listNetworkManagerEffectiveConnectivityConfigurations", 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 NetworkManagerEffectiveConnectivityConfigurationListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go deleted file mode 100644 index 219b2fe208e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go deleted file mode 100644 index 04f8fd3c40e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go deleted file mode 100644 index d034adb388c..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityGroupItem struct { - GroupConnectivity GroupConnectivity `json:"groupConnectivity"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - NetworkGroupId string `json:"networkGroupId"` - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go deleted file mode 100644 index ace2b882974..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveConnectivityConfiguration struct { - ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` - Id *string `json:"id,omitempty"` - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go deleted file mode 100644 index 5564a1b1595..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Hub struct { - ResourceId *string `json:"resourceId,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go deleted file mode 100644 index ae331bfec1d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go deleted file mode 100644 index 566b11872ea..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerEffectiveConnectivityConfigurationListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]EffectiveConnectivityConfiguration `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go deleted file mode 100644 index b861fc62fb3..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryRequestOptions struct { - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/version.go b/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/version.go deleted file mode 100644 index 62212aaf155..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectiveconnectivityconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectiveconnectivityconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/README.md b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/README.md deleted file mode 100644 index 56487d19230..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules` Documentation - -The `networkmanagereffectivesecurityadminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkmanagereffectivesecurityadminrules" -``` - - -### Client Initialization - -```go -client := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerEffectiveSecurityAdminRulesClient.ListNetworkManagerEffectiveSecurityAdminRules` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := networkmanagereffectivesecurityadminrules.QueryRequestOptions{ - // ... -} - - -read, err := client.ListNetworkManagerEffectiveSecurityAdminRules(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/network/2023-05-01/networkmanagereffectivesecurityadminrules/client.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/client.go deleted file mode 100644 index c83126c132c..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 NetworkManagerEffectiveSecurityAdminRulesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerEffectiveSecurityAdminRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagereffectivesecurityadminrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerEffectiveSecurityAdminRulesClient: %+v", err) - } - - return &NetworkManagerEffectiveSecurityAdminRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/constants.go deleted file mode 100644 index 280bd1bc97d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -func PossibleValuesForAddressPrefixType() []string { - return []string{ - string(AddressPrefixTypeIPPrefix), - string(AddressPrefixTypeServiceTag), - } -} - -func (s *AddressPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAddressPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAddressPrefixType(input string) (*AddressPrefixType, error) { - vals := map[string]AddressPrefixType{ - "ipprefix": AddressPrefixTypeIPPrefix, - "servicetag": AddressPrefixTypeServiceTag, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AddressPrefixType(input) - return &out, nil -} - -type EffectiveAdminRuleKind string - -const ( - EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" - EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" -) - -func PossibleValuesForEffectiveAdminRuleKind() []string { - return []string{ - string(EffectiveAdminRuleKindCustom), - string(EffectiveAdminRuleKindDefault), - } -} - -func (s *EffectiveAdminRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveAdminRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveAdminRuleKind(input string) (*EffectiveAdminRuleKind, error) { - vals := map[string]EffectiveAdminRuleKind{ - "custom": EffectiveAdminRuleKindCustom, - "default": EffectiveAdminRuleKindDefault, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveAdminRuleKind(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -func PossibleValuesForSecurityConfigurationRuleAccess() []string { - return []string{ - string(SecurityConfigurationRuleAccessAllow), - string(SecurityConfigurationRuleAccessAlwaysAllow), - string(SecurityConfigurationRuleAccessDeny), - } -} - -func (s *SecurityConfigurationRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleAccess(input string) (*SecurityConfigurationRuleAccess, error) { - vals := map[string]SecurityConfigurationRuleAccess{ - "allow": SecurityConfigurationRuleAccessAllow, - "alwaysallow": SecurityConfigurationRuleAccessAlwaysAllow, - "deny": SecurityConfigurationRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleAccess(input) - return &out, nil -} - -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityConfigurationRuleDirection() []string { - return []string{ - string(SecurityConfigurationRuleDirectionInbound), - string(SecurityConfigurationRuleDirectionOutbound), - } -} - -func (s *SecurityConfigurationRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleDirection(input string) (*SecurityConfigurationRuleDirection, error) { - vals := map[string]SecurityConfigurationRuleDirection{ - "inbound": SecurityConfigurationRuleDirectionInbound, - "outbound": SecurityConfigurationRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleDirection(input) - return &out, nil -} - -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTcp SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUdp SecurityConfigurationRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityConfigurationRuleProtocol() []string { - return []string{ - string(SecurityConfigurationRuleProtocolAh), - string(SecurityConfigurationRuleProtocolAny), - string(SecurityConfigurationRuleProtocolEsp), - string(SecurityConfigurationRuleProtocolIcmp), - string(SecurityConfigurationRuleProtocolTcp), - string(SecurityConfigurationRuleProtocolUdp), - } -} - -func (s *SecurityConfigurationRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleProtocol(input string) (*SecurityConfigurationRuleProtocol, error) { - vals := map[string]SecurityConfigurationRuleProtocol{ - "ah": SecurityConfigurationRuleProtocolAh, - "any": SecurityConfigurationRuleProtocolAny, - "esp": SecurityConfigurationRuleProtocolEsp, - "icmp": SecurityConfigurationRuleProtocolIcmp, - "tcp": SecurityConfigurationRuleProtocolTcp, - "udp": SecurityConfigurationRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go deleted file mode 100644 index a69d081c810..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go +++ /dev/null @@ -1,60 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 ListNetworkManagerEffectiveSecurityAdminRulesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerEffectiveSecurityAdminRulesListResult -} - -// ListNetworkManagerEffectiveSecurityAdminRules ... -func (c NetworkManagerEffectiveSecurityAdminRulesClient) ListNetworkManagerEffectiveSecurityAdminRules(ctx context.Context, id commonids.VirtualNetworkId, input QueryRequestOptions) (result ListNetworkManagerEffectiveSecurityAdminRulesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listNetworkManagerEffectiveSecurityAdminRules", 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 NetworkManagerEffectiveSecurityAdminRulesListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go deleted file mode 100644 index 36a40aa2b75..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressPrefixItem struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go deleted file mode 100644 index bc26b08e48e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go deleted file mode 100644 index bfc45b0ab70..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go deleted file mode 100644 index 1b0e64dbae7..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go deleted file mode 100644 index 9ef5715f8e4..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go +++ /dev/null @@ -1,61 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 EffectiveBaseSecurityAdminRule interface { -} - -// RawEffectiveBaseSecurityAdminRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEffectiveBaseSecurityAdminRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEffectiveBaseSecurityAdminRuleImplementation(input []byte) (EffectiveBaseSecurityAdminRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EffectiveBaseSecurityAdminRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Default") { - var out EffectiveDefaultSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EffectiveDefaultSecurityAdminRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Custom") { - var out EffectiveSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EffectiveSecurityAdminRule: %+v", err) - } - return out, nil - } - - out := RawEffectiveBaseSecurityAdminRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go deleted file mode 100644 index 17d5e7fdeb7..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go +++ /dev/null @@ -1,46 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EffectiveBaseSecurityAdminRule = EffectiveDefaultSecurityAdminRule{} - -type EffectiveDefaultSecurityAdminRule struct { - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from EffectiveBaseSecurityAdminRule - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -var _ json.Marshaler = EffectiveDefaultSecurityAdminRule{} - -func (s EffectiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper EffectiveDefaultSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EffectiveDefaultSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EffectiveDefaultSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Default" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EffectiveDefaultSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go deleted file mode 100644 index ae90f9154f9..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go +++ /dev/null @@ -1,46 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EffectiveBaseSecurityAdminRule = EffectiveSecurityAdminRule{} - -type EffectiveSecurityAdminRule struct { - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from EffectiveBaseSecurityAdminRule - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -var _ json.Marshaler = EffectiveSecurityAdminRule{} - -func (s EffectiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper EffectiveSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EffectiveSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EffectiveSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Custom" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EffectiveSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go deleted file mode 100644 index 5890d573ff4..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go deleted file mode 100644 index 941c8a93ed6..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go +++ /dev/null @@ -1,49 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerEffectiveSecurityAdminRulesListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]EffectiveBaseSecurityAdminRule `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &NetworkManagerEffectiveSecurityAdminRulesListResult{} - -func (s *NetworkManagerEffectiveSecurityAdminRulesListResult) UnmarshalJSON(bytes []byte) error { - type alias NetworkManagerEffectiveSecurityAdminRulesListResult - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into NetworkManagerEffectiveSecurityAdminRulesListResult: %+v", err) - } - - s.SkipToken = decoded.SkipToken - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling NetworkManagerEffectiveSecurityAdminRulesListResult into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]EffectiveBaseSecurityAdminRule, 0) - for i, val := range listTemp { - impl, err := unmarshalEffectiveBaseSecurityAdminRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'NetworkManagerEffectiveSecurityAdminRulesListResult': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go deleted file mode 100644 index 47b6055e402..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerSecurityGroupItem struct { - NetworkGroupId string `json:"networkGroupId"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go deleted file mode 100644 index 21a08175183..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryRequestOptions struct { - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/version.go b/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/version.go deleted file mode 100644 index a8feed62faa..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagereffectivesecurityadminrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectivesecurityadminrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/README.md b/resource-manager/network/2023-05-01/networkmanagers/README.md deleted file mode 100644 index 84623620e6d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/README.md +++ /dev/null @@ -1,163 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkmanagers` Documentation - -The `networkmanagers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkmanagers" -``` - - -### Client Initialization - -```go -client := networkmanagers.NewNetworkManagersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManager{ - // ... -} - - -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: `NetworkManagersClient.Delete` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -if err := client.DeleteThenPoll(ctx, id, networkmanagers.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkManagersClient.Get` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -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: `NetworkManagersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.List(ctx, id, networkmanagers.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, networkmanagers.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagersClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagersClient.NetworkManagerCommitsPost` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManagerCommit{ - // ... -} - - -if err := client.NetworkManagerCommitsPostThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkManagersClient.NetworkManagerDeploymentStatusList` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManagerDeploymentStatusParameter{ - // ... -} - - -read, err := client.NetworkManagerDeploymentStatusList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagersClient.Patch` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.PatchObject{ - // ... -} - - -read, err := client.Patch(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/network/2023-05-01/networkmanagers/client.go b/resource-manager/network/2023-05-01/networkmanagers/client.go deleted file mode 100644 index b27df28e126..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagers - -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 NetworkManagersClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagersClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagersClient: %+v", err) - } - - return &NetworkManagersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/constants.go b/resource-manager/network/2023-05-01/networkmanagers/constants.go deleted file mode 100644 index 2aa86ac1963..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -package networkmanagers - -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 ConfigurationType string - -const ( - ConfigurationTypeConnectivity ConfigurationType = "Connectivity" - ConfigurationTypeSecurityAdmin ConfigurationType = "SecurityAdmin" -) - -func PossibleValuesForConfigurationType() []string { - return []string{ - string(ConfigurationTypeConnectivity), - string(ConfigurationTypeSecurityAdmin), - } -} - -func (s *ConfigurationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfigurationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfigurationType(input string) (*ConfigurationType, error) { - vals := map[string]ConfigurationType{ - "connectivity": ConfigurationTypeConnectivity, - "securityadmin": ConfigurationTypeSecurityAdmin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfigurationType(input) - return &out, nil -} - -type DeploymentStatus string - -const ( - DeploymentStatusDeployed DeploymentStatus = "Deployed" - DeploymentStatusDeploying DeploymentStatus = "Deploying" - DeploymentStatusFailed DeploymentStatus = "Failed" - DeploymentStatusNotStarted DeploymentStatus = "NotStarted" -) - -func PossibleValuesForDeploymentStatus() []string { - return []string{ - string(DeploymentStatusDeployed), - string(DeploymentStatusDeploying), - string(DeploymentStatusFailed), - string(DeploymentStatusNotStarted), - } -} - -func (s *DeploymentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeploymentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeploymentStatus(input string) (*DeploymentStatus, error) { - vals := map[string]DeploymentStatus{ - "deployed": DeploymentStatusDeployed, - "deploying": DeploymentStatusDeploying, - "failed": DeploymentStatusFailed, - "notstarted": DeploymentStatusNotStarted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeploymentStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/id_networkmanager.go b/resource-manager/network/2023-05-01/networkmanagers/id_networkmanager.go deleted file mode 100644 index 63481203294..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkmanagers - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/id_networkmanager_test.go b/resource-manager/network/2023-05-01/networkmanagers/id_networkmanager_test.go deleted file mode 100644 index 0feea61327e..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkmanagers - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/networkmanagers/method_createorupdate.go b/resource-manager/network/2023-05-01/networkmanagers/method_createorupdate.go deleted file mode 100644 index 5fb5c949cd6..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagers - -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 *NetworkManager -} - -// CreateOrUpdate ... -func (c NetworkManagersClient) CreateOrUpdate(ctx context.Context, id NetworkManagerId, input NetworkManager) (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 NetworkManager - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/method_delete.go b/resource-manager/network/2023-05-01/networkmanagers/method_delete.go deleted file mode 100644 index ec825f20cb1..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package networkmanagers - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 NetworkManagersClient) Delete(ctx context.Context, id NetworkManagerId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkManagersClient) DeleteThenPoll(ctx context.Context, id NetworkManagerId, 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/network/2023-05-01/networkmanagers/method_get.go b/resource-manager/network/2023-05-01/networkmanagers/method_get.go deleted file mode 100644 index c9f3acddeae..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkmanagers - -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 *NetworkManager -} - -// Get ... -func (c NetworkManagersClient) Get(ctx context.Context, id NetworkManagerId) (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 NetworkManager - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/method_list.go b/resource-manager/network/2023-05-01/networkmanagers/method_list.go deleted file mode 100644 index bc9fb671ceb..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_list.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagers - -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 *[]NetworkManager -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManager -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c NetworkManagersClient) List(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagers", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManager `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 NetworkManagersClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, NetworkManagerOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions, predicate NetworkManagerOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkManager, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/networkmanagers/method_listbysubscription.go b/resource-manager/network/2023-05-01/networkmanagers/method_listbysubscription.go deleted file mode 100644 index c5d880d0198..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_listbysubscription.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagers - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkManager -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManager -} - -type ListBySubscriptionOperationOptions struct { - Top *int64 -} - -func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { - return ListBySubscriptionOperationOptions{} -} - -func (o ListBySubscriptionOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListBySubscriptionOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListBySubscriptionOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// ListBySubscription ... -func (c NetworkManagersClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagers", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManager `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c NetworkManagersClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, NetworkManagerOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate NetworkManagerOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]NetworkManager, 0) - - resp, err := c.ListBySubscription(ctx, id, options) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/method_networkmanagercommitspost.go b/resource-manager/network/2023-05-01/networkmanagers/method_networkmanagercommitspost.go deleted file mode 100644 index 6d93c0512d6..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_networkmanagercommitspost.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkmanagers - -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 NetworkManagerCommitsPostOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerCommit -} - -// NetworkManagerCommitsPost ... -func (c NetworkManagersClient) NetworkManagerCommitsPost(ctx context.Context, id NetworkManagerId, input NetworkManagerCommit) (result NetworkManagerCommitsPostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/commit", 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 -} - -// NetworkManagerCommitsPostThenPoll performs NetworkManagerCommitsPost then polls until it's completed -func (c NetworkManagersClient) NetworkManagerCommitsPostThenPoll(ctx context.Context, id NetworkManagerId, input NetworkManagerCommit) error { - result, err := c.NetworkManagerCommitsPost(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkManagerCommitsPost: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkManagerCommitsPost: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go b/resource-manager/network/2023-05-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go deleted file mode 100644 index f9a88725d0f..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagers - -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 NetworkManagerDeploymentStatusListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerDeploymentStatusListResult -} - -// NetworkManagerDeploymentStatusList ... -func (c NetworkManagersClient) NetworkManagerDeploymentStatusList(ctx context.Context, id NetworkManagerId, input NetworkManagerDeploymentStatusParameter) (result NetworkManagerDeploymentStatusListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listDeploymentStatus", 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 NetworkManagerDeploymentStatusListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/method_patch.go b/resource-manager/network/2023-05-01/networkmanagers/method_patch.go deleted file mode 100644 index e3810b6e4b4..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/method_patch.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkmanagers - -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 PatchOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManager -} - -// Patch ... -func (c NetworkManagersClient) Patch(ctx context.Context, id NetworkManagerId, input PatchObject) (result PatchOperationResponse, 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 NetworkManager - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_crosstenantscopes.go b/resource-manager/network/2023-05-01/networkmanagers/model_crosstenantscopes.go deleted file mode 100644 index 537d9c70d4a..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_crosstenantscopes.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossTenantScopes struct { - ManagementGroups *[]string `json:"managementGroups,omitempty"` - Subscriptions *[]string `json:"subscriptions,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanager.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanager.go deleted file mode 100644 index 8f98dec3ed2..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanager.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanagers - -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 NetworkManager struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkManagerProperties `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/network/2023-05-01/networkmanagers/model_networkmanagercommit.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagercommit.go deleted file mode 100644 index 8649d0c0da8..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagercommit.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerCommit struct { - CommitId *string `json:"commitId,omitempty"` - CommitType ConfigurationType `json:"commitType"` - ConfigurationIds *[]string `json:"configurationIds,omitempty"` - TargetLocations []string `json:"targetLocations"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatus.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatus.go deleted file mode 100644 index 5727d45e848..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatus.go +++ /dev/null @@ -1,31 +0,0 @@ -package networkmanagers - -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 NetworkManagerDeploymentStatus struct { - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationIds *[]string `json:"configurationIds,omitempty"` - DeploymentStatus *DeploymentStatus `json:"deploymentStatus,omitempty"` - DeploymentType *ConfigurationType `json:"deploymentType,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - Region *string `json:"region,omitempty"` -} - -func (o *NetworkManagerDeploymentStatus) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *NetworkManagerDeploymentStatus) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go deleted file mode 100644 index 26a44c297a2..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerDeploymentStatusListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]NetworkManagerDeploymentStatus `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go deleted file mode 100644 index 1eb70a07ac3..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerDeploymentStatusParameter struct { - DeploymentTypes *[]ConfigurationType `json:"deploymentTypes,omitempty"` - Regions *[]string `json:"regions,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerproperties.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerproperties.go deleted file mode 100644 index 46dc5161ee2..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerProperties struct { - Description *string `json:"description,omitempty"` - NetworkManagerScopeAccesses []ConfigurationType `json:"networkManagerScopeAccesses"` - NetworkManagerScopes NetworkManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go b/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go deleted file mode 100644 index 2a91fc5b601..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerPropertiesNetworkManagerScopes struct { - CrossTenantScopes *[]CrossTenantScopes `json:"crossTenantScopes,omitempty"` - ManagementGroups *[]string `json:"managementGroups,omitempty"` - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/model_patchobject.go b/resource-manager/network/2023-05-01/networkmanagers/model_patchobject.go deleted file mode 100644 index 775ef598685..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/model_patchobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchObject struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkmanagers/predicates.go b/resource-manager/network/2023-05-01/networkmanagers/predicates.go deleted file mode 100644 index 7c1597c2666..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkManagerOperationPredicate) Matches(input NetworkManager) 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 && (input.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/network/2023-05-01/networkmanagers/version.go b/resource-manager/network/2023-05-01/networkmanagers/version.go deleted file mode 100644 index b50062cd88d..00000000000 --- a/resource-manager/network/2023-05-01/networkmanagers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/README.md b/resource-manager/network/2023-05-01/networkprofiles/README.md deleted file mode 100644 index d932e0c935f..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkprofiles` Documentation - -The `networkprofiles` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkprofiles" -``` - - -### Client Initialization - -```go -client := networkprofiles.NewNetworkProfilesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkProfilesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -payload := networkprofiles.NetworkProfile{ - // ... -} - - -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: `NetworkProfilesClient.Delete` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkProfilesClient.Get` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -read, err := client.Get(ctx, id, networkprofiles.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkProfilesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkProfilesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkProfilesClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -payload := networkprofiles.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/network/2023-05-01/networkprofiles/client.go b/resource-manager/network/2023-05-01/networkprofiles/client.go deleted file mode 100644 index 17b4bf31068..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkprofiles - -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 NetworkProfilesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkProfilesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkProfilesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkprofiles", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkProfilesClient: %+v", err) - } - - return &NetworkProfilesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/constants.go b/resource-manager/network/2023-05-01/networkprofiles/constants.go deleted file mode 100644 index 27dbe02bb51..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package networkprofiles - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/id_networkprofile.go b/resource-manager/network/2023-05-01/networkprofiles/id_networkprofile.go deleted file mode 100644 index b1bbf9c9343..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/id_networkprofile.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkprofiles - -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(&NetworkProfileId{}) -} - -var _ resourceids.ResourceId = &NetworkProfileId{} - -// NetworkProfileId is a struct representing the Resource ID for a Network Profile -type NetworkProfileId struct { - SubscriptionId string - ResourceGroupName string - NetworkProfileName string -} - -// NewNetworkProfileID returns a new NetworkProfileId struct -func NewNetworkProfileID(subscriptionId string, resourceGroupName string, networkProfileName string) NetworkProfileId { - return NetworkProfileId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkProfileName: networkProfileName, - } -} - -// ParseNetworkProfileID parses 'input' into a NetworkProfileId -func ParseNetworkProfileID(input string) (*NetworkProfileId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkProfileId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkProfileId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkProfileIDInsensitively parses 'input' case-insensitively into a NetworkProfileId -// note: this method should only be used for API response data and not user input -func ParseNetworkProfileIDInsensitively(input string) (*NetworkProfileId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkProfileId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkProfileId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkProfileId) 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.NetworkProfileName, ok = input.Parsed["networkProfileName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkProfileName", input) - } - - return nil -} - -// ValidateNetworkProfileID checks that 'input' can be parsed as a Network Profile ID -func ValidateNetworkProfileID(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 := ParseNetworkProfileID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Profile ID -func (id NetworkProfileId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkProfiles/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkProfileName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Profile ID -func (id NetworkProfileId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkProfiles", "networkProfiles", "networkProfiles"), - resourceids.UserSpecifiedSegment("networkProfileName", "networkProfileValue"), - } -} - -// String returns a human-readable description of this Network Profile ID -func (id NetworkProfileId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Profile Name: %q", id.NetworkProfileName), - } - return fmt.Sprintf("Network Profile (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/id_networkprofile_test.go b/resource-manager/network/2023-05-01/networkprofiles/id_networkprofile_test.go deleted file mode 100644 index 934223e4aee..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/id_networkprofile_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkprofiles - -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 = &NetworkProfileId{} - -func TestNewNetworkProfileID(t *testing.T) { - id := NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - - 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.NetworkProfileName != "networkProfileValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkProfileName'", id.NetworkProfileName, "networkProfileValue") - } -} - -func TestFormatNetworkProfileID(t *testing.T) { - actual := NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkProfileID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkProfileId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue", - Expected: &NetworkProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkProfileName: "networkProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkProfileID(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.NetworkProfileName != v.Expected.NetworkProfileName { - t.Fatalf("Expected %q but got %q for NetworkProfileName", v.Expected.NetworkProfileName, actual.NetworkProfileName) - } - - } -} - -func TestParseNetworkProfileIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkProfileId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkPrOfIlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue", - Expected: &NetworkProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkProfileName: "networkProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkPrOfIlEs/nEtWoRkPrOfIlEvAlUe", - Expected: &NetworkProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkProfileName: "nEtWoRkPrOfIlEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkPrOfIlEs/nEtWoRkPrOfIlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkProfileIDInsensitively(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.NetworkProfileName != v.Expected.NetworkProfileName { - t.Fatalf("Expected %q but got %q for NetworkProfileName", v.Expected.NetworkProfileName, actual.NetworkProfileName) - } - - } -} - -func TestSegmentsForNetworkProfileId(t *testing.T) { - segments := NetworkProfileId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkProfileId 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/network/2023-05-01/networkprofiles/method_createorupdate.go b/resource-manager/network/2023-05-01/networkprofiles/method_createorupdate.go deleted file mode 100644 index 94d3a856780..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkprofiles - -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 *NetworkProfile -} - -// CreateOrUpdate ... -func (c NetworkProfilesClient) CreateOrUpdate(ctx context.Context, id NetworkProfileId, input NetworkProfile) (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 NetworkProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/method_delete.go b/resource-manager/network/2023-05-01/networkprofiles/method_delete.go deleted file mode 100644 index c5564f89c85..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package networkprofiles - -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 NetworkProfilesClient) Delete(ctx context.Context, id NetworkProfileId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkProfilesClient) DeleteThenPoll(ctx context.Context, id NetworkProfileId) 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/network/2023-05-01/networkprofiles/method_get.go b/resource-manager/network/2023-05-01/networkprofiles/method_get.go deleted file mode 100644 index 3b462d08204..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package networkprofiles - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkProfile -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkProfilesClient) Get(ctx context.Context, id NetworkProfileId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/method_list.go b/resource-manager/network/2023-05-01/networkprofiles/method_list.go deleted file mode 100644 index 61f2b02ff26..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkprofiles - -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 *[]NetworkProfile -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkProfile -} - -// List ... -func (c NetworkProfilesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkProfiles", 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 *[]NetworkProfile `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 NetworkProfilesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkProfileOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkProfilesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkProfileOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkProfile, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/networkprofiles/method_listall.go b/resource-manager/network/2023-05-01/networkprofiles/method_listall.go deleted file mode 100644 index d45f54454e4..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkprofiles - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkProfile -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkProfile -} - -// ListAll ... -func (c NetworkProfilesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkProfiles", 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 *[]NetworkProfile `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkProfilesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkProfileOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkProfilesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkProfileOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkProfile, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/method_updatetags.go b/resource-manager/network/2023-05-01/networkprofiles/method_updatetags.go deleted file mode 100644 index f0bfb2f14f7..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkprofiles - -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 *NetworkProfile -} - -// UpdateTags ... -func (c NetworkProfilesClient) UpdateTags(ctx context.Context, id NetworkProfileId, 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 NetworkProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 0452928be63..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 03bee9ad4ae..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 7a1eea7761a..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 4e9c7a30701..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index b3a527e5678..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygroup.go deleted file mode 100644 index a3c9e8c4026..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 962d80f7a83..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspool.go b/resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspool.go deleted file mode 100644 index b7491b172ed..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index d1e4d94bf27..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterface.go b/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterface.go deleted file mode 100644 index 8319fdf7442..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterface.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterface struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ContainerNetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfiguration.go deleted file mode 100644 index 1d0f89e15b4..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ContainerNetworkInterfaceConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go deleted file mode 100644 index 1e85f54153a..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { - ContainerNetworkInterfaces *[]SubResource `json:"containerNetworkInterfaces,omitempty"` - IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go deleted file mode 100644 index e74b8c6d59e..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ContainerNetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 07db6c62c7a..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go deleted file mode 100644 index 1c1efc89484..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfacePropertiesFormat struct { - Container *SubResource `json:"container,omitempty"` - ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfiguration,omitempty"` - IPConfigurations *[]ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 4860aa0e2f3..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_ddossettings.go b/resource-manager/network/2023-05-01/networkprofiles/model_ddossettings.go deleted file mode 100644 index c5dc78bcc06..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_delegation.go b/resource-manager/network/2023-05-01/networkprofiles/model_delegation.go deleted file mode 100644 index 0195b7d30c3..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_flowlog.go b/resource-manager/network/2023-05-01/networkprofiles/model_flowlog.go deleted file mode 100644 index f60e3c562cb..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/networkprofiles/model_flowlogformatparameters.go deleted file mode 100644 index b92557232ff..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_flowlogpropertiesformat.go deleted file mode 100644 index adaaab9bc0c..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfiguration.go deleted file mode 100644 index db5d6938998..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkprofiles - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 82aea183299..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index cb7a2956f0e..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrule.go b/resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrule.go deleted file mode 100644 index 6b089d6c65c..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 0a3a0779932..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_ipconfiguration.go deleted file mode 100644 index 940760b2c92..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofile.go deleted file mode 100644 index 373777029b1..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index ad8fa03c4f4..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index b90aa191e92..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_iptag.go b/resource-manager/network/2023-05-01/networkprofiles/model_iptag.go deleted file mode 100644 index 2e45e454060..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// 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/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddress.go deleted file mode 100644 index 4484795804f..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 203a8fab13e..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_natgateway.go b/resource-manager/network/2023-05-01/networkprofiles/model_natgateway.go deleted file mode 100644 index 6197c623763..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkprofiles - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_natgatewaypropertiesformat.go deleted file mode 100644 index 1c1b918fa25..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_natgatewaysku.go b/resource-manager/network/2023-05-01/networkprofiles/model_natgatewaysku.go deleted file mode 100644 index c3c91d290f2..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_natruleportmapping.go b/resource-manager/network/2023-05-01/networkprofiles/model_natruleportmapping.go deleted file mode 100644 index 033011c8a8b..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterface.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterface.go deleted file mode 100644 index 68e610eeff9..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacednssettings.go deleted file mode 100644 index 8451913a32f..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 139342da931..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 2456f55b927..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 2d7d8aa1bc8..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 8e4c0b29d33..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfiguration.go deleted file mode 100644 index daf580431c6..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 8a7e2121888..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkprofile.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkprofile.go deleted file mode 100644 index b11865bfdd6..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkProfilePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networkprofilepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_networkprofilepropertiesformat.go deleted file mode 100644 index cf66d34892c..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networkprofilepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfilePropertiesFormat struct { - ContainerNetworkInterfaceConfigurations *[]ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"` - ContainerNetworkInterfaces *[]ContainerNetworkInterface `json:"containerNetworkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygroup.go deleted file mode 100644 index b24d89a9bdf..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 4a7e6641883..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpoint.go b/resource-manager/network/2023-05-01/networkprofiles/model_privateendpoint.go deleted file mode 100644 index 5fcc4823c22..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnection.go deleted file mode 100644 index 5ef26aa759d..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/networkprofiles/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnectionproperties.go deleted file mode 100644 index ae03a204241..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfiguration.go deleted file mode 100644 index eb56313d0fe..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index c252cc443f7..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointproperties.go deleted file mode 100644 index d63068a30ea..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkservice.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkservice.go deleted file mode 100644 index 13e1f313103..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnection.go deleted file mode 100644 index f7c7b981511..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 36ba1ab614d..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 6c4d7083fb9..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 556206b6040..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 7cdb9347d51..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceproperties.go deleted file mode 100644 index bc001bea3c0..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddress.go b/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddress.go deleted file mode 100644 index 040a0bb56e8..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddressdnssettings.go deleted file mode 100644 index 3172667a9f8..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 9e8c3ce846b..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresssku.go deleted file mode 100644 index af7b63fcdc5..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlink.go deleted file mode 100644 index d8706b6bc4d..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlinkformat.go deleted file mode 100644 index b9a518cd2ae..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_resourceset.go b/resource-manager/network/2023-05-01/networkprofiles/model_resourceset.go deleted file mode 100644 index 028384b4467..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/networkprofiles/model_retentionpolicyparameters.go deleted file mode 100644 index a39da241fee..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_route.go b/resource-manager/network/2023-05-01/networkprofiles/model_route.go deleted file mode 100644 index 01d1b1aee3b..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_routepropertiesformat.go deleted file mode 100644 index a0fba15da36..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_routetable.go b/resource-manager/network/2023-05-01/networkprofiles/model_routetable.go deleted file mode 100644 index e98510e4a99..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_routetablepropertiesformat.go deleted file mode 100644 index d3d001ea19c..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_securityrule.go b/resource-manager/network/2023-05-01/networkprofiles/model_securityrule.go deleted file mode 100644 index d3a303b69a8..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_securityrulepropertiesformat.go deleted file mode 100644 index 5a6f0550760..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlink.go deleted file mode 100644 index 185baa31acb..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index a8ddcda5b29..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_servicedelegationpropertiesformat.go deleted file mode 100644 index bbe89cb1074..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicy.go deleted file mode 100644 index fc7682e49f7..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 49d3abcfdf1..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 59c9a98a4df..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index c41bd5c801b..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpropertiesformat.go deleted file mode 100644 index e791f2598de..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_subnet.go b/resource-manager/network/2023-05-01/networkprofiles/model_subnet.go deleted file mode 100644 index 92e0d90839e..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_subnetpropertiesformat.go deleted file mode 100644 index 76ce29ba181..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_subresource.go b/resource-manager/network/2023-05-01/networkprofiles/model_subresource.go deleted file mode 100644 index e7710003aae..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_tagsobject.go b/resource-manager/network/2023-05-01/networkprofiles/model_tagsobject.go deleted file mode 100644 index 4b300699106..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// 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/network/2023-05-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 43e8bd0f29a..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsproperties.go deleted file mode 100644 index 67da0952e73..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktap.go deleted file mode 100644 index 21bb960f571..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 3e8521e5beb..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkprofiles/predicates.go b/resource-manager/network/2023-05-01/networkprofiles/predicates.go deleted file mode 100644 index c8b72ff46b2..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfileOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkProfileOperationPredicate) Matches(input NetworkProfile) 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 && (input.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/network/2023-05-01/networkprofiles/version.go b/resource-manager/network/2023-05-01/networkprofiles/version.go deleted file mode 100644 index c2ce78e9a65..00000000000 --- a/resource-manager/network/2023-05-01/networkprofiles/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkprofiles/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/README.md b/resource-manager/network/2023-05-01/networksecuritygroups/README.md deleted file mode 100644 index 4d95ea03af7..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networksecuritygroups` Documentation - -The `networksecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networksecuritygroups" -``` - - -### Client Initialization - -```go -client := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -payload := networksecuritygroups.NetworkSecurityGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -read, err := client.Get(ctx, id, networksecuritygroups.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkSecurityGroupsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.UpdateTags` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -payload := networksecuritygroups.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/network/2023-05-01/networksecuritygroups/client.go b/resource-manager/network/2023-05-01/networksecuritygroups/client.go deleted file mode 100644 index a8d26110c7c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networksecuritygroups - -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 NetworkSecurityGroupsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkSecurityGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkSecurityGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networksecuritygroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkSecurityGroupsClient: %+v", err) - } - - return &NetworkSecurityGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/constants.go b/resource-manager/network/2023-05-01/networksecuritygroups/constants.go deleted file mode 100644 index 95804969bbd..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package networksecuritygroups - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup.go b/resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup.go deleted file mode 100644 index 4ab431d74a9..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package networksecuritygroups - -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(&NetworkSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkSecurityGroupId{} - -// NetworkSecurityGroupId is a struct representing the Resource ID for a Network Security Group -type NetworkSecurityGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string -} - -// NewNetworkSecurityGroupID returns a new NetworkSecurityGroupId struct -func NewNetworkSecurityGroupID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string) NetworkSecurityGroupId { - return NetworkSecurityGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - } -} - -// ParseNetworkSecurityGroupID parses 'input' into a NetworkSecurityGroupId -func ParseNetworkSecurityGroupID(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkSecurityGroupIDInsensitively parses 'input' case-insensitively into a NetworkSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkSecurityGroupIDInsensitively(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkSecurityGroupId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - return nil -} - -// ValidateNetworkSecurityGroupID checks that 'input' can be parsed as a Network Security Group ID -func ValidateNetworkSecurityGroupID(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 := ParseNetworkSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Security Group ID -func (id NetworkSecurityGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Security Group ID -func (id NetworkSecurityGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Network Security Group ID -func (id NetworkSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - } - return fmt.Sprintf("Network Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup_test.go b/resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup_test.go deleted file mode 100644 index 87524f03d0e..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/id_networksecuritygroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networksecuritygroups - -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 = &NetworkSecurityGroupId{} - -func TestNewNetworkSecurityGroupID(t *testing.T) { - id := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } -} - -func TestFormatNetworkSecurityGroupID(t *testing.T) { - actual := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestParseNetworkSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestSegmentsForNetworkSecurityGroupId(t *testing.T) { - segments := NetworkSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkSecurityGroupId 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/network/2023-05-01/networksecuritygroups/method_createorupdate.go b/resource-manager/network/2023-05-01/networksecuritygroups/method_createorupdate.go deleted file mode 100644 index cb77896aae4..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networksecuritygroups - -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 *NetworkSecurityGroup -} - -// CreateOrUpdate ... -func (c NetworkSecurityGroupsClient) CreateOrUpdate(ctx context.Context, id NetworkSecurityGroupId, input NetworkSecurityGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkSecurityGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id NetworkSecurityGroupId, input NetworkSecurityGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/networksecuritygroups/method_delete.go b/resource-manager/network/2023-05-01/networksecuritygroups/method_delete.go deleted file mode 100644 index 103ca330a5b..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package networksecuritygroups - -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 NetworkSecurityGroupsClient) Delete(ctx context.Context, id NetworkSecurityGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkSecurityGroupsClient) DeleteThenPoll(ctx context.Context, id NetworkSecurityGroupId) 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/network/2023-05-01/networksecuritygroups/method_get.go b/resource-manager/network/2023-05-01/networksecuritygroups/method_get.go deleted file mode 100644 index debc457321c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package networksecuritygroups - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkSecurityGroup -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkSecurityGroupsClient) Get(ctx context.Context, id NetworkSecurityGroupId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/method_list.go b/resource-manager/network/2023-05-01/networksecuritygroups/method_list.go deleted file mode 100644 index 7a9e914eda9..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networksecuritygroups - -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 *[]NetworkSecurityGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkSecurityGroup -} - -// List ... -func (c NetworkSecurityGroupsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkSecurityGroups", 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 *[]NetworkSecurityGroup `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 NetworkSecurityGroupsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkSecurityGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkSecurityGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkSecurityGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkSecurityGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/networksecuritygroups/method_listall.go b/resource-manager/network/2023-05-01/networksecuritygroups/method_listall.go deleted file mode 100644 index 2701b95bac0..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networksecuritygroups - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkSecurityGroup -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkSecurityGroup -} - -// ListAll ... -func (c NetworkSecurityGroupsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkSecurityGroups", 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 *[]NetworkSecurityGroup `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkSecurityGroupsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkSecurityGroupOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkSecurityGroupsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkSecurityGroupOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkSecurityGroup, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/method_updatetags.go b/resource-manager/network/2023-05-01/networksecuritygroups/method_updatetags.go deleted file mode 100644 index 362cad00c7d..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networksecuritygroups - -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 *NetworkSecurityGroup -} - -// UpdateTags ... -func (c NetworkSecurityGroupsClient) UpdateTags(ctx context.Context, id NetworkSecurityGroupId, 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 NetworkSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 62c1c3109c0..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 17bf1792be8..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index d96a3011a25..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfiguration.go deleted file mode 100644 index ebf65a382d3..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index e6f11b94c01..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygroup.go deleted file mode 100644 index 50a0b0f53a7..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 5443c32837a..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspool.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspool.go deleted file mode 100644 index 0a216964329..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 80cdae2e912..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index d6dd55786fc..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_ddossettings.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_ddossettings.go deleted file mode 100644 index 4b0d4e3dc9b..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_delegation.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_delegation.go deleted file mode 100644 index 42805b01ada..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlog.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlog.go deleted file mode 100644 index eee82c2d3b6..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogformatparameters.go deleted file mode 100644 index fdad354f6b8..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogpropertiesformat.go deleted file mode 100644 index bab4d923b54..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfiguration.go deleted file mode 100644 index 24b23145d47..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package networksecuritygroups - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 5322ea68f34..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index fff6be9708f..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrule.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrule.go deleted file mode 100644 index 6391fbf065c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 725fec85751..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfiguration.go deleted file mode 100644 index b9eec53b855..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofile.go deleted file mode 100644 index 4885926d9aa..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index ec7f93c0f2b..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index ca12abb4992..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_iptag.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_iptag.go deleted file mode 100644 index 3f5348f3776..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// 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/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddress.go deleted file mode 100644 index 8c8a91a5d1f..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 1843fe9fb85..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_natgateway.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_natgateway.go deleted file mode 100644 index 8d6ecb14bc5..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package networksecuritygroups - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaypropertiesformat.go deleted file mode 100644 index 389e752880f..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaysku.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaysku.go deleted file mode 100644 index 5e842304f20..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_natruleportmapping.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_natruleportmapping.go deleted file mode 100644 index 30f812c7c78..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterface.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterface.go deleted file mode 100644 index a4a62c2d6ea..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacednssettings.go deleted file mode 100644 index f3819f01474..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 40cf733a9f0..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index caa03f6e413..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 4199a4aa864..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 95a8c67d71c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 5e60c1bbfc4..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d110d193645..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygroup.go deleted file mode 100644 index dd84b3efc89..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 704a86496f2..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpoint.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpoint.go deleted file mode 100644 index 753cd13341b..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnection.go deleted file mode 100644 index b28eaa1a213..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/networksecuritygroups/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnectionproperties.go deleted file mode 100644 index 9649070d1a7..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfiguration.go deleted file mode 100644 index af86de8f897..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 550ef75ec1d..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointproperties.go deleted file mode 100644 index 36ad3ca4ffb..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkservice.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkservice.go deleted file mode 100644 index f880da9d89d..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnection.go deleted file mode 100644 index 3a721ae3637..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 50b8f7e352f..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 619e38d131d..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index dcbf418522b..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index abc8d2f4904..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceproperties.go deleted file mode 100644 index 5d51b182a49..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddress.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddress.go deleted file mode 100644 index 7b797b006f5..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddressdnssettings.go deleted file mode 100644 index 2db9ef3f2c3..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresspropertiesformat.go deleted file mode 100644 index cac3fce28ce..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresssku.go deleted file mode 100644 index 24fe5573abd..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlink.go deleted file mode 100644 index 8d6ec604942..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlinkformat.go deleted file mode 100644 index 0bf207481cb..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_resourceset.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_resourceset.go deleted file mode 100644 index 751d06dd732..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_retentionpolicyparameters.go deleted file mode 100644 index b1e9035c2f8..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_route.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_route.go deleted file mode 100644 index 9b712ab4e81..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_routepropertiesformat.go deleted file mode 100644 index 3225a4673f2..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_routetable.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_routetable.go deleted file mode 100644 index 9aff39efe9e..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_routetablepropertiesformat.go deleted file mode 100644 index 5eee448b410..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_securityrule.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_securityrule.go deleted file mode 100644 index 1119115e9eb..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_securityrulepropertiesformat.go deleted file mode 100644 index 01270911682..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlink.go deleted file mode 100644 index 050ee6cb43f..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 81a4ac35e4a..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 089e2e1dc0c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicy.go deleted file mode 100644 index 6ca2d4bff53..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 2a8648b7931..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index c70380704b7..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 3000410cde3..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 299fb5fdadb..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_subnet.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_subnet.go deleted file mode 100644 index 499cc289ec3..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_subnetpropertiesformat.go deleted file mode 100644 index ff8ab429e75..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_subresource.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_subresource.go deleted file mode 100644 index 8fa7fe6b59d..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_tagsobject.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_tagsobject.go deleted file mode 100644 index bb9ad0a6373..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// 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/network/2023-05-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index ddb354c4a7c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsproperties.go deleted file mode 100644 index f74d8a12ecb..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktap.go deleted file mode 100644 index cfc1b073467..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 01620fae8c8..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networksecuritygroups/predicates.go b/resource-manager/network/2023-05-01/networksecuritygroups/predicates.go deleted file mode 100644 index b9f6d3f3df5..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkSecurityGroupOperationPredicate) Matches(input NetworkSecurityGroup) 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 && (input.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/network/2023-05-01/networksecuritygroups/version.go b/resource-manager/network/2023-05-01/networksecuritygroups/version.go deleted file mode 100644 index 3c7a41ac25c..00000000000 --- a/resource-manager/network/2023-05-01/networksecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networksecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/README.md b/resource-manager/network/2023-05-01/networkvirtualappliances/README.md deleted file mode 100644 index f8cfdfdfd22..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkvirtualappliances` Documentation - -The `networkvirtualappliances` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkvirtualappliances" -``` - - -### Client Initialization - -```go -client := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -payload := networkvirtualappliances.NetworkVirtualAppliance{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.Delete` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.Get` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -read, err := client.Get(ctx, id, networkvirtualappliances.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.InboundSecurityRuleCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue") - -payload := networkvirtualappliances.InboundSecurityRule{ - // ... -} - - -if err := client.InboundSecurityRuleCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -payload := networkvirtualappliances.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/network/2023-05-01/networkvirtualappliances/client.go b/resource-manager/network/2023-05-01/networkvirtualappliances/client.go deleted file mode 100644 index cfaeae574de..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkvirtualappliances - -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 NetworkVirtualAppliancesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkVirtualAppliancesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkVirtualAppliancesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkvirtualappliances", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkVirtualAppliancesClient: %+v", err) - } - - return &NetworkVirtualAppliancesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/constants.go b/resource-manager/network/2023-05-01/networkvirtualappliances/constants.go deleted file mode 100644 index d744d8f8da2..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package networkvirtualappliances - -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 InboundSecurityRulesProtocol string - -const ( - InboundSecurityRulesProtocolTCP InboundSecurityRulesProtocol = "TCP" - InboundSecurityRulesProtocolUDP InboundSecurityRulesProtocol = "UDP" -) - -func PossibleValuesForInboundSecurityRulesProtocol() []string { - return []string{ - string(InboundSecurityRulesProtocolTCP), - string(InboundSecurityRulesProtocolUDP), - } -} - -func (s *InboundSecurityRulesProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInboundSecurityRulesProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInboundSecurityRulesProtocol(input string) (*InboundSecurityRulesProtocol, error) { - vals := map[string]InboundSecurityRulesProtocol{ - "tcp": InboundSecurityRulesProtocolTCP, - "udp": InboundSecurityRulesProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InboundSecurityRulesProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule.go deleted file mode 100644 index d920466b92f..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkvirtualappliances - -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(&InboundSecurityRuleId{}) -} - -var _ resourceids.ResourceId = &InboundSecurityRuleId{} - -// InboundSecurityRuleId is a struct representing the Resource ID for a Inbound Security Rule -type InboundSecurityRuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string - InboundSecurityRuleName string -} - -// NewInboundSecurityRuleID returns a new InboundSecurityRuleId struct -func NewInboundSecurityRuleID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string, inboundSecurityRuleName string) InboundSecurityRuleId { - return InboundSecurityRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - InboundSecurityRuleName: inboundSecurityRuleName, - } -} - -// ParseInboundSecurityRuleID parses 'input' into a InboundSecurityRuleId -func ParseInboundSecurityRuleID(input string) (*InboundSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundSecurityRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseInboundSecurityRuleIDInsensitively parses 'input' case-insensitively into a InboundSecurityRuleId -// note: this method should only be used for API response data and not user input -func ParseInboundSecurityRuleIDInsensitively(input string) (*InboundSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundSecurityRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *InboundSecurityRuleId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - if id.InboundSecurityRuleName, ok = input.Parsed["inboundSecurityRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "inboundSecurityRuleName", input) - } - - return nil -} - -// ValidateInboundSecurityRuleID checks that 'input' can be parsed as a Inbound Security Rule ID -func ValidateInboundSecurityRuleID(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 := ParseInboundSecurityRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Inbound Security Rule ID -func (id InboundSecurityRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s/inboundSecurityRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName, id.InboundSecurityRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Inbound Security Rule ID -func (id InboundSecurityRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - resourceids.StaticSegment("staticInboundSecurityRules", "inboundSecurityRules", "inboundSecurityRules"), - resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "inboundSecurityRuleValue"), - } -} - -// String returns a human-readable description of this Inbound Security Rule ID -func (id InboundSecurityRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - fmt.Sprintf("Inbound Security Rule Name: %q", id.InboundSecurityRuleName), - } - return fmt.Sprintf("Inbound Security Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule_test.go deleted file mode 100644 index af0ac85fdd5..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/id_inboundsecurityrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkvirtualappliances - -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 = &InboundSecurityRuleId{} - -func TestNewInboundSecurityRuleID(t *testing.T) { - id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } - - if id.InboundSecurityRuleName != "inboundSecurityRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "inboundSecurityRuleValue") - } -} - -func TestFormatInboundSecurityRuleID(t *testing.T) { - actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseInboundSecurityRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue", - Expected: &InboundSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - InboundSecurityRuleName: "inboundSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundSecurityRuleID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.InboundSecurityRuleName != v.Expected.InboundSecurityRuleName { - t.Fatalf("Expected %q but got %q for InboundSecurityRuleName", v.Expected.InboundSecurityRuleName, actual.InboundSecurityRuleName) - } - - } -} - -func TestParseInboundSecurityRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/iNbOuNdSeCuRiTyRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue", - Expected: &InboundSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - InboundSecurityRuleName: "inboundSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeVaLuE", - Expected: &InboundSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - InboundSecurityRuleName: "iNbOuNdSeCuRiTyRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundSecurityRuleIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.InboundSecurityRuleName != v.Expected.InboundSecurityRuleName { - t.Fatalf("Expected %q but got %q for InboundSecurityRuleName", v.Expected.InboundSecurityRuleName, actual.InboundSecurityRuleName) - } - - } -} - -func TestSegmentsForInboundSecurityRuleId(t *testing.T) { - segments := InboundSecurityRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("InboundSecurityRuleId 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/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance.go b/resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance.go deleted file mode 100644 index f222e101e79..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkvirtualappliances - -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(&NetworkVirtualApplianceId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceId{} - -// NetworkVirtualApplianceId is a struct representing the Resource ID for a Network Virtual Appliance -type NetworkVirtualApplianceId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string -} - -// NewNetworkVirtualApplianceID returns a new NetworkVirtualApplianceId struct -func NewNetworkVirtualApplianceID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string) NetworkVirtualApplianceId { - return NetworkVirtualApplianceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - } -} - -// ParseNetworkVirtualApplianceID parses 'input' into a NetworkVirtualApplianceId -func ParseNetworkVirtualApplianceID(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceIDInsensitively(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceID checks that 'input' can be parsed as a Network Virtual Appliance ID -func ValidateNetworkVirtualApplianceID(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 := ParseNetworkVirtualApplianceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - } - return fmt.Sprintf("Network Virtual Appliance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance_test.go b/resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance_test.go deleted file mode 100644 index f7a054f6e8c..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/id_networkvirtualappliance_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkvirtualappliances - -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 = &NetworkVirtualApplianceId{} - -func TestNewNetworkVirtualApplianceID(t *testing.T) { - id := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } -} - -func TestFormatNetworkVirtualApplianceID(t *testing.T) { - actual := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestParseNetworkVirtualApplianceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceId(t *testing.T) { - segments := NetworkVirtualApplianceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceId 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/network/2023-05-01/networkvirtualappliances/method_createorupdate.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_createorupdate.go deleted file mode 100644 index aa9b339951d..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkvirtualappliances - -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 *NetworkVirtualAppliance -} - -// CreateOrUpdate ... -func (c NetworkVirtualAppliancesClient) CreateOrUpdate(ctx context.Context, id NetworkVirtualApplianceId, input NetworkVirtualAppliance) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkVirtualAppliancesClient) CreateOrUpdateThenPoll(ctx context.Context, id NetworkVirtualApplianceId, input NetworkVirtualAppliance) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/networkvirtualappliances/method_delete.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_delete.go deleted file mode 100644 index 9eb9b6f13ac..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package networkvirtualappliances - -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 NetworkVirtualAppliancesClient) Delete(ctx context.Context, id NetworkVirtualApplianceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkVirtualAppliancesClient) DeleteThenPoll(ctx context.Context, id NetworkVirtualApplianceId) 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/network/2023-05-01/networkvirtualappliances/method_get.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_get.go deleted file mode 100644 index ee11638f574..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package networkvirtualappliances - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkVirtualAppliance -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkVirtualAppliancesClient) Get(ctx context.Context, id NetworkVirtualApplianceId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkVirtualAppliance - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go deleted file mode 100644 index 6c268a71480..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkvirtualappliances - -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 InboundSecurityRuleCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *InboundSecurityRule -} - -// InboundSecurityRuleCreateOrUpdate ... -func (c NetworkVirtualAppliancesClient) InboundSecurityRuleCreateOrUpdate(ctx context.Context, id InboundSecurityRuleId, input InboundSecurityRule) (result InboundSecurityRuleCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// InboundSecurityRuleCreateOrUpdateThenPoll performs InboundSecurityRuleCreateOrUpdate then polls until it's completed -func (c NetworkVirtualAppliancesClient) InboundSecurityRuleCreateOrUpdateThenPoll(ctx context.Context, id InboundSecurityRuleId, input InboundSecurityRule) error { - result, err := c.InboundSecurityRuleCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing InboundSecurityRuleCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InboundSecurityRuleCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/method_list.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_list.go deleted file mode 100644 index d956634ada9..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkvirtualappliances - -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 *[]NetworkVirtualAppliance -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualAppliance -} - -// List ... -func (c NetworkVirtualAppliancesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkVirtualAppliances", 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 *[]NetworkVirtualAppliance `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 NetworkVirtualAppliancesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkVirtualAppliancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkVirtualApplianceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkVirtualAppliance, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/networkvirtualappliances/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_listbyresourcegroup.go deleted file mode 100644 index 90c252ee012..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkvirtualappliances - -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 *[]NetworkVirtualAppliance -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualAppliance -} - -// ListByResourceGroup ... -func (c NetworkVirtualAppliancesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkVirtualAppliances", 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 *[]NetworkVirtualAppliance `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 NetworkVirtualAppliancesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkVirtualAppliancesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkVirtualApplianceOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]NetworkVirtualAppliance, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/networkvirtualappliances/method_updatetags.go b/resource-manager/network/2023-05-01/networkvirtualappliances/method_updatetags.go deleted file mode 100644 index 25a5f9e94c5..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkvirtualappliances - -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 *NetworkVirtualAppliance -} - -// UpdateTags ... -func (c NetworkVirtualAppliancesClient) UpdateTags(ctx context.Context, id NetworkVirtualApplianceId, 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 NetworkVirtualAppliance - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_delegationproperties.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_delegationproperties.go deleted file mode 100644 index cf2170e1c38..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_delegationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DelegationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrule.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrule.go deleted file mode 100644 index f921a8c6534..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundSecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundSecurityRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityruleproperties.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityruleproperties.go deleted file mode 100644 index 11569615b5c..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityruleproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundSecurityRuleProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]InboundSecurityRules `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrules.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrules.go deleted file mode 100644 index c03db57794b..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_inboundsecurityrules.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundSecurityRules struct { - DestinationPortRange *int64 `json:"destinationPortRange,omitempty"` - Protocol *InboundSecurityRulesProtocol `json:"protocol,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliance.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliance.go deleted file mode 100644 index 03612c989df..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliance.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkvirtualappliances - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualAppliance struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkVirtualAppliancePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go deleted file mode 100644 index e43f34e93b2..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualAppliancePropertiesFormat struct { - AdditionalNics *[]VirtualApplianceAdditionalNicProperties `json:"additionalNics,omitempty"` - AddressPrefix *string `json:"addressPrefix,omitempty"` - BootStrapConfigurationBlobs *[]string `json:"bootStrapConfigurationBlobs,omitempty"` - CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` - Delegation *DelegationProperties `json:"delegation,omitempty"` - DeploymentType *string `json:"deploymentType,omitempty"` - InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` - NvaSku *VirtualApplianceSkuProperties `json:"nvaSku,omitempty"` - PartnerManagedResource *PartnerManagedResourceProperties `json:"partnerManagedResource,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SshPublicKey *string `json:"sshPublicKey,omitempty"` - VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` - VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` - VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_partnermanagedresourceproperties.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_partnermanagedresourceproperties.go deleted file mode 100644 index e89793be377..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_partnermanagedresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PartnerManagedResourceProperties struct { - Id *string `json:"id,omitempty"` - InternalLoadBalancerId *string `json:"internalLoadBalancerId,omitempty"` - StandardLoadBalancerId *string `json:"standardLoadBalancerId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_subresource.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_subresource.go deleted file mode 100644 index 8df29cf1031..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_tagsobject.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_tagsobject.go deleted file mode 100644 index 3ad1ec8468c..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkvirtualappliances - -// 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/network/2023-05-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go deleted file mode 100644 index 7eb59c309c1..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceAdditionalNicProperties struct { - HasPublicIP *bool `json:"hasPublicIp,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualappliancenicproperties.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualappliancenicproperties.go deleted file mode 100644 index bfd6f5f914b..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualappliancenicproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceNicProperties struct { - InstanceName *string `json:"instanceName,omitempty"` - Name *string `json:"name,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceskuproperties.go b/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceskuproperties.go deleted file mode 100644 index b194523806f..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/model_virtualapplianceskuproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSkuProperties struct { - BundledScaleUnit *string `json:"bundledScaleUnit,omitempty"` - MarketPlaceVersion *string `json:"marketPlaceVersion,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkvirtualappliances/predicates.go b/resource-manager/network/2023-05-01/networkvirtualappliances/predicates.go deleted file mode 100644 index 676b2af6c25..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkVirtualApplianceOperationPredicate) Matches(input NetworkVirtualAppliance) 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 && (input.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/network/2023-05-01/networkvirtualappliances/version.go b/resource-manager/network/2023-05-01/networkvirtualappliances/version.go deleted file mode 100644 index 64dcb2db5df..00000000000 --- a/resource-manager/network/2023-05-01/networkvirtualappliances/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkvirtualappliances - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkvirtualappliances/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/README.md b/resource-manager/network/2023-05-01/networkwatchers/README.md deleted file mode 100644 index 65ab8c93aa1..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/README.md +++ /dev/null @@ -1,331 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/networkwatchers` Documentation - -The `networkwatchers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/networkwatchers" -``` - - -### Client Initialization - -```go -client := networkwatchers.NewNetworkWatchersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkWatchersClient.CheckConnectivity` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.ConnectivityParameters{ - // ... -} - - -if err := client.CheckConnectivityThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NetworkWatcher{ - // ... -} - - -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: `NetworkWatchersClient.Delete` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.Get` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `NetworkWatchersClient.GetAzureReachabilityReport` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.AzureReachabilityReportParameters{ - // ... -} - - -if err := client.GetAzureReachabilityReportThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetFlowLogStatus` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.FlowLogStatusParameters{ - // ... -} - - -if err := client.GetFlowLogStatusThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetNetworkConfigurationDiagnostic` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NetworkConfigurationDiagnosticParameters{ - // ... -} - - -if err := client.GetNetworkConfigurationDiagnosticThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetNextHop` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NextHopParameters{ - // ... -} - - -if err := client.GetNextHopThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTopology` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.TopologyParameters{ - // ... -} - - -read, err := client.GetTopology(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTroubleshooting` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.TroubleshootingParameters{ - // ... -} - - -if err := client.GetTroubleshootingThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTroubleshootingResult` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.QueryTroubleshootingParameters{ - // ... -} - - -if err := client.GetTroubleshootingResultThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetVMSecurityRules` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.SecurityGroupViewParameters{ - // ... -} - - -if err := client.GetVMSecurityRulesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -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: `NetworkWatchersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAll(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkWatchersClient.ListAvailableProviders` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.AvailableProvidersListParameters{ - // ... -} - - -if err := client.ListAvailableProvidersThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.SetFlowLogConfiguration` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.FlowLogInformation{ - // ... -} - - -if err := client.SetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.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 -} -``` - - -### Example Usage: `NetworkWatchersClient.VerifyIPFlow` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.VerificationIPFlowParameters{ - // ... -} - - -if err := client.VerifyIPFlowThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/networkwatchers/client.go b/resource-manager/network/2023-05-01/networkwatchers/client.go deleted file mode 100644 index 2068ab14817..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkwatchers - -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 NetworkWatchersClient struct { - Client *resourcemanager.Client -} - -func NewNetworkWatchersClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkWatchersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkwatchers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkWatchersClient: %+v", err) - } - - return &NetworkWatchersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/constants.go b/resource-manager/network/2023-05-01/networkwatchers/constants.go deleted file mode 100644 index 2e400cad0f7..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/constants.go +++ /dev/null @@ -1,855 +0,0 @@ -package networkwatchers - -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 Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -func PossibleValuesForAccess() []string { - return []string{ - string(AccessAllow), - string(AccessDeny), - } -} - -func (s *Access) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccess(input string) (*Access, error) { - vals := map[string]Access{ - "allow": AccessAllow, - "deny": AccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Access(input) - return &out, nil -} - -type AssociationType string - -const ( - AssociationTypeAssociated AssociationType = "Associated" - AssociationTypeContains AssociationType = "Contains" -) - -func PossibleValuesForAssociationType() []string { - return []string{ - string(AssociationTypeAssociated), - string(AssociationTypeContains), - } -} - -func (s *AssociationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAssociationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAssociationType(input string) (*AssociationType, error) { - vals := map[string]AssociationType{ - "associated": AssociationTypeAssociated, - "contains": AssociationTypeContains, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AssociationType(input) - return &out, nil -} - -type ConnectionStatus string - -const ( - ConnectionStatusConnected ConnectionStatus = "Connected" - ConnectionStatusDegraded ConnectionStatus = "Degraded" - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -func PossibleValuesForConnectionStatus() []string { - return []string{ - string(ConnectionStatusConnected), - string(ConnectionStatusDegraded), - string(ConnectionStatusDisconnected), - string(ConnectionStatusUnknown), - } -} - -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{ - "connected": ConnectionStatusConnected, - "degraded": ConnectionStatusDegraded, - "disconnected": ConnectionStatusDisconnected, - "unknown": ConnectionStatusUnknown, - } - 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 Direction string - -const ( - DirectionInbound Direction = "Inbound" - DirectionOutbound Direction = "Outbound" -) - -func PossibleValuesForDirection() []string { - return []string{ - string(DirectionInbound), - string(DirectionOutbound), - } -} - -func (s *Direction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDirection(input string) (*Direction, error) { - vals := map[string]Direction{ - "inbound": DirectionInbound, - "outbound": DirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Direction(input) - return &out, nil -} - -type EffectiveSecurityRuleProtocol string - -const ( - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - EffectiveSecurityRuleProtocolTcp EffectiveSecurityRuleProtocol = "Tcp" - EffectiveSecurityRuleProtocolUdp EffectiveSecurityRuleProtocol = "Udp" -) - -func PossibleValuesForEffectiveSecurityRuleProtocol() []string { - return []string{ - string(EffectiveSecurityRuleProtocolAll), - string(EffectiveSecurityRuleProtocolTcp), - string(EffectiveSecurityRuleProtocolUdp), - } -} - -func (s *EffectiveSecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveSecurityRuleProtocol(input string) (*EffectiveSecurityRuleProtocol, error) { - vals := map[string]EffectiveSecurityRuleProtocol{ - "all": EffectiveSecurityRuleProtocolAll, - "tcp": EffectiveSecurityRuleProtocolTcp, - "udp": EffectiveSecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveSecurityRuleProtocol(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type HTTPMethod string - -const ( - HTTPMethodGet HTTPMethod = "Get" -) - -func PossibleValuesForHTTPMethod() []string { - return []string{ - string(HTTPMethodGet), - } -} - -func (s *HTTPMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHTTPMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHTTPMethod(input string) (*HTTPMethod, error) { - vals := map[string]HTTPMethod{ - "get": HTTPMethodGet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HTTPMethod(input) - return &out, nil -} - -type IPFlowProtocol string - -const ( - IPFlowProtocolTCP IPFlowProtocol = "TCP" - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -func PossibleValuesForIPFlowProtocol() []string { - return []string{ - string(IPFlowProtocolTCP), - string(IPFlowProtocolUDP), - } -} - -func (s *IPFlowProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPFlowProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPFlowProtocol(input string) (*IPFlowProtocol, error) { - vals := map[string]IPFlowProtocol{ - "tcp": IPFlowProtocolTCP, - "udp": IPFlowProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPFlowProtocol(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IssueType string - -const ( - IssueTypeAgentStopped IssueType = "AgentStopped" - IssueTypeDnsResolution IssueType = "DnsResolution" - IssueTypeGuestFirewall IssueType = "GuestFirewall" - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - IssueTypePlatform IssueType = "Platform" - IssueTypePortThrottled IssueType = "PortThrottled" - IssueTypeSocketBind IssueType = "SocketBind" - IssueTypeUnknown IssueType = "Unknown" - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -func PossibleValuesForIssueType() []string { - return []string{ - string(IssueTypeAgentStopped), - string(IssueTypeDnsResolution), - string(IssueTypeGuestFirewall), - string(IssueTypeNetworkSecurityRule), - string(IssueTypePlatform), - string(IssueTypePortThrottled), - string(IssueTypeSocketBind), - string(IssueTypeUnknown), - string(IssueTypeUserDefinedRoute), - } -} - -func (s *IssueType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIssueType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIssueType(input string) (*IssueType, error) { - vals := map[string]IssueType{ - "agentstopped": IssueTypeAgentStopped, - "dnsresolution": IssueTypeDnsResolution, - "guestfirewall": IssueTypeGuestFirewall, - "networksecurityrule": IssueTypeNetworkSecurityRule, - "platform": IssueTypePlatform, - "portthrottled": IssueTypePortThrottled, - "socketbind": IssueTypeSocketBind, - "unknown": IssueTypeUnknown, - "userdefinedroute": IssueTypeUserDefinedRoute, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IssueType(input) - return &out, nil -} - -type NextHopType string - -const ( - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - NextHopTypeInternet NextHopType = "Internet" - NextHopTypeNone NextHopType = "None" - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -func PossibleValuesForNextHopType() []string { - return []string{ - string(NextHopTypeHyperNetGateway), - string(NextHopTypeInternet), - string(NextHopTypeNone), - string(NextHopTypeVirtualAppliance), - string(NextHopTypeVirtualNetworkGateway), - string(NextHopTypeVnetLocal), - } -} - -func (s *NextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNextHopType(input string) (*NextHopType, error) { - vals := map[string]NextHopType{ - "hypernetgateway": NextHopTypeHyperNetGateway, - "internet": NextHopTypeInternet, - "none": NextHopTypeNone, - "virtualappliance": NextHopTypeVirtualAppliance, - "virtualnetworkgateway": NextHopTypeVirtualNetworkGateway, - "vnetlocal": NextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NextHopType(input) - return &out, nil -} - -type Origin string - -const ( - OriginInbound Origin = "Inbound" - OriginLocal Origin = "Local" - OriginOutbound Origin = "Outbound" -) - -func PossibleValuesForOrigin() []string { - return []string{ - string(OriginInbound), - string(OriginLocal), - string(OriginOutbound), - } -} - -func (s *Origin) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOrigin(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOrigin(input string) (*Origin, error) { - vals := map[string]Origin{ - "inbound": OriginInbound, - "local": OriginLocal, - "outbound": OriginOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Origin(input) - return &out, nil -} - -type Protocol string - -const ( - ProtocolHTTP Protocol = "Http" - ProtocolHTTPS Protocol = "Https" - ProtocolIcmp Protocol = "Icmp" - ProtocolTcp Protocol = "Tcp" -) - -func PossibleValuesForProtocol() []string { - return []string{ - string(ProtocolHTTP), - string(ProtocolHTTPS), - string(ProtocolIcmp), - string(ProtocolTcp), - } -} - -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{ - "http": ProtocolHTTP, - "https": ProtocolHTTPS, - "icmp": ProtocolIcmp, - "tcp": ProtocolTcp, - } - 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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type Severity string - -const ( - SeverityError Severity = "Error" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityError), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "error": SeverityError, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} - -type VerbosityLevel string - -const ( - VerbosityLevelFull VerbosityLevel = "Full" - VerbosityLevelMinimum VerbosityLevel = "Minimum" - VerbosityLevelNormal VerbosityLevel = "Normal" -) - -func PossibleValuesForVerbosityLevel() []string { - return []string{ - string(VerbosityLevelFull), - string(VerbosityLevelMinimum), - string(VerbosityLevelNormal), - } -} - -func (s *VerbosityLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVerbosityLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVerbosityLevel(input string) (*VerbosityLevel, error) { - vals := map[string]VerbosityLevel{ - "full": VerbosityLevelFull, - "minimum": VerbosityLevelMinimum, - "normal": VerbosityLevelNormal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VerbosityLevel(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher.go b/resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher.go deleted file mode 100644 index b8bb1f7f4a6..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkwatchers - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher_test.go b/resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher_test.go deleted file mode 100644 index 7136dc10343..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkwatchers - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-05-01/networkwatchers/method_checkconnectivity.go b/resource-manager/network/2023-05-01/networkwatchers/method_checkconnectivity.go deleted file mode 100644 index a41a47a9dbf..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_checkconnectivity.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 CheckConnectivityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectivityInformation -} - -// CheckConnectivity ... -func (c NetworkWatchersClient) CheckConnectivity(ctx context.Context, id NetworkWatcherId, input ConnectivityParameters) (result CheckConnectivityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/connectivityCheck", 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 -} - -// CheckConnectivityThenPoll performs CheckConnectivity then polls until it's completed -func (c NetworkWatchersClient) CheckConnectivityThenPoll(ctx context.Context, id NetworkWatcherId, input ConnectivityParameters) error { - result, err := c.CheckConnectivity(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CheckConnectivity: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CheckConnectivity: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_createorupdate.go b/resource-manager/network/2023-05-01/networkwatchers/method_createorupdate.go deleted file mode 100644 index ecb006e2007..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkwatchers - -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 *NetworkWatcher -} - -// CreateOrUpdate ... -func (c NetworkWatchersClient) CreateOrUpdate(ctx context.Context, id NetworkWatcherId, input NetworkWatcher) (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 NetworkWatcher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_delete.go b/resource-manager/network/2023-05-01/networkwatchers/method_delete.go deleted file mode 100644 index 4c59058ef03..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package networkwatchers - -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 NetworkWatchersClient) Delete(ctx context.Context, id NetworkWatcherId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c NetworkWatchersClient) DeleteThenPoll(ctx context.Context, id NetworkWatcherId) 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/network/2023-05-01/networkwatchers/method_get.go b/resource-manager/network/2023-05-01/networkwatchers/method_get.go deleted file mode 100644 index 000ae087b18..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkwatchers - -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 *NetworkWatcher -} - -// Get ... -func (c NetworkWatchersClient) Get(ctx context.Context, id NetworkWatcherId) (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 NetworkWatcher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_getazurereachabilityreport.go b/resource-manager/network/2023-05-01/networkwatchers/method_getazurereachabilityreport.go deleted file mode 100644 index 54a23dc1c18..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_getazurereachabilityreport.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetAzureReachabilityReportOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *AzureReachabilityReport -} - -// GetAzureReachabilityReport ... -func (c NetworkWatchersClient) GetAzureReachabilityReport(ctx context.Context, id NetworkWatcherId, input AzureReachabilityReportParameters) (result GetAzureReachabilityReportOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/azureReachabilityReport", 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 -} - -// GetAzureReachabilityReportThenPoll performs GetAzureReachabilityReport then polls until it's completed -func (c NetworkWatchersClient) GetAzureReachabilityReportThenPoll(ctx context.Context, id NetworkWatcherId, input AzureReachabilityReportParameters) error { - result, err := c.GetAzureReachabilityReport(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetAzureReachabilityReport: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetAzureReachabilityReport: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_getflowlogstatus.go b/resource-manager/network/2023-05-01/networkwatchers/method_getflowlogstatus.go deleted file mode 100644 index af6f975c691..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_getflowlogstatus.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetFlowLogStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// GetFlowLogStatus ... -func (c NetworkWatchersClient) GetFlowLogStatus(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) (result GetFlowLogStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryFlowLogStatus", 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 -} - -// GetFlowLogStatusThenPoll performs GetFlowLogStatus then polls until it's completed -func (c NetworkWatchersClient) GetFlowLogStatusThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) error { - result, err := c.GetFlowLogStatus(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetFlowLogStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetFlowLogStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go b/resource-manager/network/2023-05-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go deleted file mode 100644 index de67c4ef4d4..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetNetworkConfigurationDiagnosticOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NetworkConfigurationDiagnosticResponse -} - -// GetNetworkConfigurationDiagnostic ... -func (c NetworkWatchersClient) GetNetworkConfigurationDiagnostic(ctx context.Context, id NetworkWatcherId, input NetworkConfigurationDiagnosticParameters) (result GetNetworkConfigurationDiagnosticOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/networkConfigurationDiagnostic", 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 -} - -// GetNetworkConfigurationDiagnosticThenPoll performs GetNetworkConfigurationDiagnostic then polls until it's completed -func (c NetworkWatchersClient) GetNetworkConfigurationDiagnosticThenPoll(ctx context.Context, id NetworkWatcherId, input NetworkConfigurationDiagnosticParameters) error { - result, err := c.GetNetworkConfigurationDiagnostic(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetNetworkConfigurationDiagnostic: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetNetworkConfigurationDiagnostic: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_getnexthop.go b/resource-manager/network/2023-05-01/networkwatchers/method_getnexthop.go deleted file mode 100644 index 56fe43d4d11..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_getnexthop.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetNextHopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NextHopResult -} - -// GetNextHop ... -func (c NetworkWatchersClient) GetNextHop(ctx context.Context, id NetworkWatcherId, input NextHopParameters) (result GetNextHopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/nextHop", 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 -} - -// GetNextHopThenPoll performs GetNextHop then polls until it's completed -func (c NetworkWatchersClient) GetNextHopThenPoll(ctx context.Context, id NetworkWatcherId, input NextHopParameters) error { - result, err := c.GetNextHop(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetNextHop: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetNextHop: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_gettopology.go b/resource-manager/network/2023-05-01/networkwatchers/method_gettopology.go deleted file mode 100644 index 8a1c6caef60..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_gettopology.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkwatchers - -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 GetTopologyOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Topology -} - -// GetTopology ... -func (c NetworkWatchersClient) GetTopology(ctx context.Context, id NetworkWatcherId, input TopologyParameters) (result GetTopologyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/topology", 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 Topology - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshooting.go b/resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshooting.go deleted file mode 100644 index 9b5522b8119..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshooting.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetTroubleshootingOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *TroubleshootingResult -} - -// GetTroubleshooting ... -func (c NetworkWatchersClient) GetTroubleshooting(ctx context.Context, id NetworkWatcherId, input TroubleshootingParameters) (result GetTroubleshootingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/troubleshoot", 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 -} - -// GetTroubleshootingThenPoll performs GetTroubleshooting then polls until it's completed -func (c NetworkWatchersClient) GetTroubleshootingThenPoll(ctx context.Context, id NetworkWatcherId, input TroubleshootingParameters) error { - result, err := c.GetTroubleshooting(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetTroubleshooting: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetTroubleshooting: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshootingresult.go b/resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshootingresult.go deleted file mode 100644 index fc9651abd21..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_gettroubleshootingresult.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetTroubleshootingResultOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *TroubleshootingResult -} - -// GetTroubleshootingResult ... -func (c NetworkWatchersClient) GetTroubleshootingResult(ctx context.Context, id NetworkWatcherId, input QueryTroubleshootingParameters) (result GetTroubleshootingResultOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryTroubleshootResult", 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 -} - -// GetTroubleshootingResultThenPoll performs GetTroubleshootingResult then polls until it's completed -func (c NetworkWatchersClient) GetTroubleshootingResultThenPoll(ctx context.Context, id NetworkWatcherId, input QueryTroubleshootingParameters) error { - result, err := c.GetTroubleshootingResult(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetTroubleshootingResult: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetTroubleshootingResult: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_getvmsecurityrules.go b/resource-manager/network/2023-05-01/networkwatchers/method_getvmsecurityrules.go deleted file mode 100644 index 1c8a917ab09..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_getvmsecurityrules.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetVMSecurityRulesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *SecurityGroupViewResult -} - -// GetVMSecurityRules ... -func (c NetworkWatchersClient) GetVMSecurityRules(ctx context.Context, id NetworkWatcherId, input SecurityGroupViewParameters) (result GetVMSecurityRulesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/securityGroupView", 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 -} - -// GetVMSecurityRulesThenPoll performs GetVMSecurityRules then polls until it's completed -func (c NetworkWatchersClient) GetVMSecurityRulesThenPoll(ctx context.Context, id NetworkWatcherId, input SecurityGroupViewParameters) error { - result, err := c.GetVMSecurityRules(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetVMSecurityRules: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVMSecurityRules: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_list.go b/resource-manager/network/2023-05-01/networkwatchers/method_list.go deleted file mode 100644 index 8263c7b4f93..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package networkwatchers - -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 *NetworkWatcherListResult -} - -// List ... -func (c NetworkWatchersClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkWatchers", 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 NetworkWatcherListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_listall.go b/resource-manager/network/2023-05-01/networkwatchers/method_listall.go deleted file mode 100644 index 845a2449946..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_listall.go +++ /dev/null @@ -1,56 +0,0 @@ -package networkwatchers - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkWatcherListResult -} - -// ListAll ... -func (c NetworkWatchersClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkWatchers", 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 NetworkWatcherListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_listavailableproviders.go b/resource-manager/network/2023-05-01/networkwatchers/method_listavailableproviders.go deleted file mode 100644 index 12768222c1e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_listavailableproviders.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 ListAvailableProvidersOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *AvailableProvidersList -} - -// ListAvailableProviders ... -func (c NetworkWatchersClient) ListAvailableProviders(ctx context.Context, id NetworkWatcherId, input AvailableProvidersListParameters) (result ListAvailableProvidersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/availableProvidersList", 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 -} - -// ListAvailableProvidersThenPoll performs ListAvailableProviders then polls until it's completed -func (c NetworkWatchersClient) ListAvailableProvidersThenPoll(ctx context.Context, id NetworkWatcherId, input AvailableProvidersListParameters) error { - result, err := c.ListAvailableProviders(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ListAvailableProviders: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ListAvailableProviders: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_setflowlogconfiguration.go b/resource-manager/network/2023-05-01/networkwatchers/method_setflowlogconfiguration.go deleted file mode 100644 index 183183d38e9..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_setflowlogconfiguration.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 SetFlowLogConfigurationOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// SetFlowLogConfiguration ... -func (c NetworkWatchersClient) SetFlowLogConfiguration(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) (result SetFlowLogConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/configureFlowLog", 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 -} - -// SetFlowLogConfigurationThenPoll performs SetFlowLogConfiguration then polls until it's completed -func (c NetworkWatchersClient) SetFlowLogConfigurationThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) error { - result, err := c.SetFlowLogConfiguration(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SetFlowLogConfiguration: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SetFlowLogConfiguration: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_updatetags.go b/resource-manager/network/2023-05-01/networkwatchers/method_updatetags.go deleted file mode 100644 index 1ace78e7dc5..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkwatchers - -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 *NetworkWatcher -} - -// UpdateTags ... -func (c NetworkWatchersClient) UpdateTags(ctx context.Context, id NetworkWatcherId, 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 NetworkWatcher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/method_verifyipflow.go b/resource-manager/network/2023-05-01/networkwatchers/method_verifyipflow.go deleted file mode 100644 index 1ef266cf37c..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/method_verifyipflow.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 VerifyIPFlowOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VerificationIPFlowResult -} - -// VerifyIPFlow ... -func (c NetworkWatchersClient) VerifyIPFlow(ctx context.Context, id NetworkWatcherId, input VerificationIPFlowParameters) (result VerifyIPFlowOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ipFlowVerify", 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 -} - -// VerifyIPFlowThenPoll performs VerifyIPFlow then polls until it's completed -func (c NetworkWatchersClient) VerifyIPFlowThenPoll(ctx context.Context, id NetworkWatcherId, input VerificationIPFlowParameters) error { - result, err := c.VerifyIPFlow(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VerifyIPFlow: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VerifyIPFlow: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygroup.go deleted file mode 100644 index d93456b39dc..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 1edb4c6e9fd..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslist.go b/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslist.go deleted file mode 100644 index f97306f3eb4..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersList struct { - Countries []AvailableProvidersListCountry `json:"countries"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcity.go b/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcity.go deleted file mode 100644 index ad5727a8ad0..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcity.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListCity struct { - CityName *string `json:"cityName,omitempty"` - Providers *[]string `json:"providers,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcountry.go b/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcountry.go deleted file mode 100644 index 98f3996ac17..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistcountry.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListCountry struct { - CountryName *string `json:"countryName,omitempty"` - Providers *[]string `json:"providers,omitempty"` - States *[]AvailableProvidersListState `json:"states,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistparameters.go deleted file mode 100644 index e884f5cdb40..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_availableproviderslistparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListParameters struct { - AzureLocations *[]string `json:"azureLocations,omitempty"` - City *string `json:"city,omitempty"` - Country *string `json:"country,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_availableprovidersliststate.go b/resource-manager/network/2023-05-01/networkwatchers/model_availableprovidersliststate.go deleted file mode 100644 index 3504bafbcf0..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_availableprovidersliststate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListState struct { - Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` - Providers *[]string `json:"providers,omitempty"` - StateName *string `json:"stateName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreport.go b/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreport.go deleted file mode 100644 index e045a1522bc..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreport.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureReachabilityReport struct { - AggregationLevel string `json:"aggregationLevel"` - ProviderLocation AzureReachabilityReportLocation `json:"providerLocation"` - ReachabilityReport []AzureReachabilityReportItem `json:"reachabilityReport"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportitem.go b/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportitem.go deleted file mode 100644 index 50e7da37b25..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportitem.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureReachabilityReportItem struct { - AzureLocation *string `json:"azureLocation,omitempty"` - Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` - Provider *string `json:"provider,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go b/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go deleted file mode 100644 index 6755737d707..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go +++ /dev/null @@ -1,27 +0,0 @@ -package networkwatchers - -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 AzureReachabilityReportLatencyInfo struct { - Score *int64 `json:"score,omitempty"` - TimeStamp *string `json:"timeStamp,omitempty"` -} - -func (o *AzureReachabilityReportLatencyInfo) GetTimeStampAsTime() (*time.Time, error) { - if o.TimeStamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeStamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureReachabilityReportLatencyInfo) SetTimeStampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeStamp = &formatted -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlocation.go b/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlocation.go deleted file mode 100644 index 15b7ba2a6ee..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportlocation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureReachabilityReportLocation struct { - City *string `json:"city,omitempty"` - Country string `json:"country"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportparameters.go deleted file mode 100644 index 81d91ee2074..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_azurereachabilityreportparameters.go +++ /dev/null @@ -1,36 +0,0 @@ -package networkwatchers - -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 AzureReachabilityReportParameters struct { - AzureLocations *[]string `json:"azureLocations,omitempty"` - EndTime string `json:"endTime"` - ProviderLocation AzureReachabilityReportLocation `json:"providerLocation"` - Providers *[]string `json:"providers,omitempty"` - StartTime string `json:"startTime"` -} - -func (o *AzureReachabilityReportParameters) GetEndTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureReachabilityReportParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = formatted -} - -func (o *AzureReachabilityReportParameters) GetStartTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureReachabilityReportParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = formatted -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_connectivitydestination.go b/resource-manager/network/2023-05-01/networkwatchers/model_connectivitydestination.go deleted file mode 100644 index fd92ab947d7..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_connectivitydestination.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityDestination struct { - Address *string `json:"address,omitempty"` - Port *int64 `json:"port,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityhop.go b/resource-manager/network/2023-05-01/networkwatchers/model_connectivityhop.go deleted file mode 100644 index b199aef7d99..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityhop.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityHop struct { - Address *string `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - Links *[]HopLink `json:"links,omitempty"` - NextHopIds *[]string `json:"nextHopIds,omitempty"` - PreviousHopIds *[]string `json:"previousHopIds,omitempty"` - PreviousLinks *[]HopLink `json:"previousLinks,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityinformation.go b/resource-manager/network/2023-05-01/networkwatchers/model_connectivityinformation.go deleted file mode 100644 index 0ce37ca8e82..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityinformation.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityInformation struct { - AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` - ConnectionStatus *ConnectionStatus `json:"connectionStatus,omitempty"` - Hops *[]ConnectivityHop `json:"hops,omitempty"` - MaxLatencyInMs *int64 `json:"maxLatencyInMs,omitempty"` - MinLatencyInMs *int64 `json:"minLatencyInMs,omitempty"` - ProbesFailed *int64 `json:"probesFailed,omitempty"` - ProbesSent *int64 `json:"probesSent,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityissue.go b/resource-manager/network/2023-05-01/networkwatchers/model_connectivityissue.go deleted file mode 100644 index ba9f23e149c..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityissue.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityIssue struct { - Context *[]map[string]string `json:"context,omitempty"` - Origin *Origin `json:"origin,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Type *IssueType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_connectivityparameters.go deleted file mode 100644 index 2fd0eea7e96..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_connectivityparameters.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityParameters struct { - Destination ConnectivityDestination `json:"destination"` - PreferredIPVersion *IPVersion `json:"preferredIPVersion,omitempty"` - Protocol *Protocol `json:"protocol,omitempty"` - ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` - Source ConnectivitySource `json:"source"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_connectivitysource.go b/resource-manager/network/2023-05-01/networkwatchers/model_connectivitysource.go deleted file mode 100644 index 471f2e79c48..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_connectivitysource.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivitySource struct { - Port *int64 `json:"port,omitempty"` - ResourceId string `json:"resourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_effectivenetworksecurityrule.go b/resource-manager/network/2023-05-01/networkwatchers/model_effectivenetworksecurityrule.go deleted file mode 100644 index 738fb4c583d..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_effectivenetworksecurityrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityRule struct { - Access *SecurityRuleAccess `json:"access,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction *SecurityRuleDirection `json:"direction,omitempty"` - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_evaluatednetworksecuritygroup.go b/resource-manager/network/2023-05-01/networkwatchers/model_evaluatednetworksecuritygroup.go deleted file mode 100644 index c471d60f7c3..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_evaluatednetworksecuritygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EvaluatedNetworkSecurityGroup struct { - AppliedTo *string `json:"appliedTo,omitempty"` - MatchedRule *MatchedRule `json:"matchedRule,omitempty"` - NetworkSecurityGroupId *string `json:"networkSecurityGroupId,omitempty"` - RulesEvaluationResult *[]NetworkSecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_flowlogformatparameters.go deleted file mode 100644 index 804e14368ee..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_flowloginformation.go b/resource-manager/network/2023-05-01/networkwatchers/model_flowloginformation.go deleted file mode 100644 index e624cdf59fe..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_flowloginformation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogInformation struct { - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Properties FlowLogProperties `json:"properties"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_flowlogproperties.go b/resource-manager/network/2023-05-01/networkwatchers/model_flowlogproperties.go deleted file mode 100644 index c51e0fd967e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_flowlogproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogProperties struct { - Enabled bool `json:"enabled"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_flowlogstatusparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_flowlogstatusparameters.go deleted file mode 100644 index 7adddbce138..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_flowlogstatusparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogStatusParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_hoplink.go b/resource-manager/network/2023-05-01/networkwatchers/model_hoplink.go deleted file mode 100644 index ad0c1a88c32..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_hoplink.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLink struct { - Context *map[string]string `json:"context,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - LinkType *string `json:"linkType,omitempty"` - NextHopId *string `json:"nextHopId,omitempty"` - Properties *HopLinkProperties `json:"properties,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_hoplinkproperties.go b/resource-manager/network/2023-05-01/networkwatchers/model_hoplinkproperties.go deleted file mode 100644 index efce6d24581..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_hoplinkproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLinkProperties struct { - RoundTripTimeAvg *int64 `json:"roundTripTimeAvg,omitempty"` - RoundTripTimeMax *int64 `json:"roundTripTimeMax,omitempty"` - RoundTripTimeMin *int64 `json:"roundTripTimeMin,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_httpconfiguration.go b/resource-manager/network/2023-05-01/networkwatchers/model_httpconfiguration.go deleted file mode 100644 index e469c4b2e2a..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_httpconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPConfiguration struct { - Headers *[]HTTPHeader `json:"headers,omitempty"` - Method *HTTPMethod `json:"method,omitempty"` - ValidStatusCodes *[]int64 `json:"validStatusCodes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_httpheader.go b/resource-manager/network/2023-05-01/networkwatchers/model_httpheader.go deleted file mode 100644 index 5f0b41332f3..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_httpheader.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPHeader struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_matchedrule.go b/resource-manager/network/2023-05-01/networkwatchers/model_matchedrule.go deleted file mode 100644 index 7ccb0bf4ff1..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_matchedrule.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MatchedRule struct { - Action *string `json:"action,omitempty"` - RuleName *string `json:"ruleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go deleted file mode 100644 index 62d57417ce8..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticParameters struct { - Profiles []NetworkConfigurationDiagnosticProfile `json:"profiles"` - TargetResourceId string `json:"targetResourceId"` - VerbosityLevel *VerbosityLevel `json:"verbosityLevel,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go deleted file mode 100644 index 2591d3cb1bc..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticProfile struct { - Destination string `json:"destination"` - DestinationPort string `json:"destinationPort"` - Direction Direction `json:"direction"` - Protocol string `json:"protocol"` - Source string `json:"source"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go deleted file mode 100644 index a30c9686e57..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticResponse struct { - Results *[]NetworkConfigurationDiagnosticResult `json:"results,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresult.go deleted file mode 100644 index c0c796377f7..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkconfigurationdiagnosticresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticResult struct { - NetworkSecurityGroupResult *NetworkSecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` - Profile *NetworkConfigurationDiagnosticProfile `json:"profile,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkinterfaceassociation.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkinterfaceassociation.go deleted file mode 100644 index 0583e0225fd..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkinterfaceassociation.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceAssociation struct { - Id *string `json:"id,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networksecuritygroupresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_networksecuritygroupresult.go deleted file mode 100644 index 60f125dff53..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networksecuritygroupresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupResult struct { - EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"` - SecurityRuleAccessResult *SecurityRuleAccess `json:"securityRuleAccessResult,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networksecurityrulesevaluationresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_networksecurityrulesevaluationresult.go deleted file mode 100644 index c54e4c0dc86..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networksecurityrulesevaluationresult.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityRulesEvaluationResult struct { - DestinationMatched *bool `json:"destinationMatched,omitempty"` - DestinationPortMatched *bool `json:"destinationPortMatched,omitempty"` - Name *string `json:"name,omitempty"` - ProtocolMatched *bool `json:"protocolMatched,omitempty"` - SourceMatched *bool `json:"sourceMatched,omitempty"` - SourcePortMatched *bool `json:"sourcePortMatched,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcher.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcher.go deleted file mode 100644 index 4f58f1863d8..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcher.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkWatcher struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkWatcherPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherlistresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherlistresult.go deleted file mode 100644 index b78fc59bf86..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkWatcherListResult struct { - Value *[]NetworkWatcher `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherpropertiesformat.go b/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherpropertiesformat.go deleted file mode 100644 index d0d1c07ed9e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_networkwatcherpropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkWatcherPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_nexthopparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_nexthopparameters.go deleted file mode 100644 index b8a7b00f4f3..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_nexthopparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NextHopParameters struct { - DestinationIPAddress string `json:"destinationIPAddress"` - SourceIPAddress string `json:"sourceIPAddress"` - TargetNicResourceId *string `json:"targetNicResourceId,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_nexthopresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_nexthopresult.go deleted file mode 100644 index a8a2ba32b01..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_nexthopresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NextHopResult struct { - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType *NextHopType `json:"nextHopType,omitempty"` - RouteTableId *string `json:"routeTableId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_protocolconfiguration.go b/resource-manager/network/2023-05-01/networkwatchers/model_protocolconfiguration.go deleted file mode 100644 index e4592ed2fe5..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_protocolconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProtocolConfiguration struct { - HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_querytroubleshootingparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_querytroubleshootingparameters.go deleted file mode 100644 index d6bf4abce2c..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_querytroubleshootingparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryTroubleshootingParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_retentionpolicyparameters.go deleted file mode 100644 index 64b952abec0..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupnetworkinterface.go b/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupnetworkinterface.go deleted file mode 100644 index e22bcd0a9ed..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupnetworkinterface.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupNetworkInterface struct { - Id *string `json:"id,omitempty"` - SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewparameters.go deleted file mode 100644 index 9cbdf854c96..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupViewParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewresult.go deleted file mode 100644 index eff95f05919..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_securitygroupviewresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupViewResult struct { - NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_securityrule.go b/resource-manager/network/2023-05-01/networkwatchers/model_securityrule.go deleted file mode 100644 index c1dded9fca0..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_securityruleassociations.go b/resource-manager/network/2023-05-01/networkwatchers/model_securityruleassociations.go deleted file mode 100644 index 0ce7cc68a9c..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_securityruleassociations.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRuleAssociations struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - NetworkInterfaceAssociation *NetworkInterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` - SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/networkwatchers/model_securityrulepropertiesformat.go deleted file mode 100644 index ae100c6915e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_subnetassociation.go b/resource-manager/network/2023-05-01/networkwatchers/model_subnetassociation.go deleted file mode 100644 index 8b89222ca9e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_subnetassociation.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetAssociation struct { - Id *string `json:"id,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_subresource.go b/resource-manager/network/2023-05-01/networkwatchers/model_subresource.go deleted file mode 100644 index b98b68a29dd..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_tagsobject.go b/resource-manager/network/2023-05-01/networkwatchers/model_tagsobject.go deleted file mode 100644 index f022d1785d9..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// 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/network/2023-05-01/networkwatchers/model_topology.go b/resource-manager/network/2023-05-01/networkwatchers/model_topology.go deleted file mode 100644 index c582a36ae6c..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_topology.go +++ /dev/null @@ -1,41 +0,0 @@ -package networkwatchers - -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 Topology struct { - CreatedDateTime *string `json:"createdDateTime,omitempty"` - Id *string `json:"id,omitempty"` - LastModified *string `json:"lastModified,omitempty"` - Resources *[]TopologyResource `json:"resources,omitempty"` -} - -func (o *Topology) GetCreatedDateTimeAsTime() (*time.Time, error) { - if o.CreatedDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *Topology) SetCreatedDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateTime = &formatted -} - -func (o *Topology) GetLastModifiedAsTime() (*time.Time, error) { - if o.LastModified == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModified, "2006-01-02T15:04:05Z07:00") -} - -func (o *Topology) SetLastModifiedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModified = &formatted -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_topologyassociation.go b/resource-manager/network/2023-05-01/networkwatchers/model_topologyassociation.go deleted file mode 100644 index 9607c85650b..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_topologyassociation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TopologyAssociation struct { - AssociationType *AssociationType `json:"associationType,omitempty"` - Name *string `json:"name,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_topologyparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_topologyparameters.go deleted file mode 100644 index 25bc77b5345..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_topologyparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TopologyParameters struct { - TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` - TargetSubnet *SubResource `json:"targetSubnet,omitempty"` - TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_topologyresource.go b/resource-manager/network/2023-05-01/networkwatchers/model_topologyresource.go deleted file mode 100644 index e126c541c8e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_topologyresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TopologyResource struct { - Associations *[]TopologyAssociation `json:"associations,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 63df321f46e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsproperties.go deleted file mode 100644 index 415ca1a8f5e..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingdetails.go b/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingdetails.go deleted file mode 100644 index 2bc7443b168..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingdetails.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingDetails struct { - Detail *string `json:"detail,omitempty"` - Id *string `json:"id,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` - RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` - Summary *string `json:"summary,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingparameters.go deleted file mode 100644 index 5ee881c84a7..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingParameters struct { - Properties TroubleshootingProperties `json:"properties"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingproperties.go b/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingproperties.go deleted file mode 100644 index 8d187050a32..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingProperties struct { - StorageId string `json:"storageId"` - StoragePath string `json:"storagePath"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingrecommendedactions.go b/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingrecommendedactions.go deleted file mode 100644 index c4e5781e659..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingrecommendedactions.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingRecommendedActions struct { - ActionId *string `json:"actionId,omitempty"` - ActionText *string `json:"actionText,omitempty"` - ActionUri *string `json:"actionUri,omitempty"` - ActionUriText *string `json:"actionUriText,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingresult.go deleted file mode 100644 index 62df62353d2..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_troubleshootingresult.go +++ /dev/null @@ -1,41 +0,0 @@ -package networkwatchers - -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 TroubleshootingResult struct { - Code *string `json:"code,omitempty"` - EndTime *string `json:"endTime,omitempty"` - Results *[]TroubleshootingDetails `json:"results,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *TroubleshootingResult) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *TroubleshootingResult) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *TroubleshootingResult) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *TroubleshootingResult) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowparameters.go b/resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowparameters.go deleted file mode 100644 index 05165f3ed26..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VerificationIPFlowParameters struct { - Direction Direction `json:"direction"` - LocalIPAddress string `json:"localIPAddress"` - LocalPort string `json:"localPort"` - Protocol IPFlowProtocol `json:"protocol"` - RemoteIPAddress string `json:"remoteIPAddress"` - RemotePort string `json:"remotePort"` - TargetNicResourceId *string `json:"targetNicResourceId,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowresult.go b/resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowresult.go deleted file mode 100644 index 97318928bd8..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/model_verificationipflowresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VerificationIPFlowResult struct { - Access *Access `json:"access,omitempty"` - RuleName *string `json:"ruleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/networkwatchers/version.go b/resource-manager/network/2023-05-01/networkwatchers/version.go deleted file mode 100644 index 2c438cff076..00000000000 --- a/resource-manager/network/2023-05-01/networkwatchers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkwatchers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/README.md b/resource-manager/network/2023-05-01/p2svpngateways/README.md deleted file mode 100644 index 523d9522fba..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/README.md +++ /dev/null @@ -1,113 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/p2svpngateways` Documentation - -The `p2svpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/p2svpngateways" -``` - - -### Client Initialization - -```go -client := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `P2sVpnGatewaysClient.DisconnectP2sVpnConnections` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnConnectionRequest{ - // ... -} - - -if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GenerateVpnProfile` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnProfileParameters{ - // ... -} - - -if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealth` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealthDetailed` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnConnectionHealthRequest{ - // ... -} - - -if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.ResetThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/p2svpngateways/client.go b/resource-manager/network/2023-05-01/p2svpngateways/client.go deleted file mode 100644 index 3d458041de0..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package p2svpngateways - -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 P2sVpnGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewP2sVpnGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*P2sVpnGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "p2svpngateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating P2sVpnGatewaysClient: %+v", err) - } - - return &P2sVpnGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/constants.go b/resource-manager/network/2023-05-01/p2svpngateways/constants.go deleted file mode 100644 index e0d727fd608..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/constants.go +++ /dev/null @@ -1,183 +0,0 @@ -package p2svpngateways - -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 AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/method_disconnectp2svpnconnections.go b/resource-manager/network/2023-05-01/p2svpngateways/method_disconnectp2svpnconnections.go deleted file mode 100644 index c7746ee57d0..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/method_disconnectp2svpnconnections.go +++ /dev/null @@ -1,75 +0,0 @@ -package p2svpngateways - -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 DisconnectP2sVpnConnectionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DisconnectP2sVpnConnections ... -func (c P2sVpnGatewaysClient) DisconnectP2sVpnConnections(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionRequest) (result DisconnectP2sVpnConnectionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnectP2sVpnConnections", 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 -} - -// DisconnectP2sVpnConnectionsThenPoll performs DisconnectP2sVpnConnections then polls until it's completed -func (c P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionRequest) error { - result, err := c.DisconnectP2sVpnConnections(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DisconnectP2sVpnConnections: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DisconnectP2sVpnConnections: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/method_generatevpnprofile.go b/resource-manager/network/2023-05-01/p2svpngateways/method_generatevpnprofile.go deleted file mode 100644 index b3c5acf03dc..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/method_generatevpnprofile.go +++ /dev/null @@ -1,76 +0,0 @@ -package p2svpngateways - -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 GenerateVpnProfileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnProfileResponse -} - -// GenerateVpnProfile ... -func (c P2sVpnGatewaysClient) GenerateVpnProfile(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnProfileParameters) (result GenerateVpnProfileOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatevpnprofile", 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 -} - -// GenerateVpnProfileThenPoll performs GenerateVpnProfile then polls until it's completed -func (c P2sVpnGatewaysClient) GenerateVpnProfileThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnProfileParameters) error { - result, err := c.GenerateVpnProfile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GenerateVpnProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GenerateVpnProfile: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealth.go b/resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealth.go deleted file mode 100644 index dab0de414a2..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealth.go +++ /dev/null @@ -1,72 +0,0 @@ -package p2svpngateways - -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 GetP2sVpnConnectionHealthOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// GetP2sVpnConnectionHealth ... -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealth(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result GetP2sVpnConnectionHealthOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getP2sVpnConnectionHealth", 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 -} - -// GetP2sVpnConnectionHealthThenPoll performs GetP2sVpnConnectionHealth then polls until it's completed -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealthThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) error { - result, err := c.GetP2sVpnConnectionHealth(ctx, id) - if err != nil { - return fmt.Errorf("performing GetP2sVpnConnectionHealth: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetP2sVpnConnectionHealth: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go b/resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go deleted file mode 100644 index d5c274634f2..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go +++ /dev/null @@ -1,76 +0,0 @@ -package p2svpngateways - -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 GetP2sVpnConnectionHealthDetailedOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnConnectionHealth -} - -// GetP2sVpnConnectionHealthDetailed ... -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailed(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionHealthRequest) (result GetP2sVpnConnectionHealthDetailedOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getP2sVpnConnectionHealthDetailed", 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 -} - -// GetP2sVpnConnectionHealthDetailedThenPoll performs GetP2sVpnConnectionHealthDetailed then polls until it's completed -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionHealthRequest) error { - result, err := c.GetP2sVpnConnectionHealthDetailed(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetP2sVpnConnectionHealthDetailed: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetP2sVpnConnectionHealthDetailed: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/method_reset.go b/resource-manager/network/2023-05-01/p2svpngateways/method_reset.go deleted file mode 100644 index d00e0082c46..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/method_reset.go +++ /dev/null @@ -1,72 +0,0 @@ -package p2svpngateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// Reset ... -func (c P2sVpnGatewaysClient) Reset(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c P2sVpnGatewaysClient) ResetThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) error { - result, err := c.Reset(ctx, id) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/method_updatetags.go b/resource-manager/network/2023-05-01/p2svpngateways/method_updatetags.go deleted file mode 100644 index e1cbbdbc914..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/method_updatetags.go +++ /dev/null @@ -1,76 +0,0 @@ -package p2svpngateways - -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 *P2SVpnGateway -} - -// UpdateTags ... -func (c P2sVpnGatewaysClient) UpdateTags(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c P2sVpnGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/p2svpngateways/model_addressspace.go b/resource-manager/network/2023-05-01/p2svpngateways/model_addressspace.go deleted file mode 100644 index 7c79876f047..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfiguration.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfiguration.go deleted file mode 100644 index 278f2d7145d..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go deleted file mode 100644 index 33a16482774..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfigurationProperties struct { - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealth.go deleted file mode 100644 index 42b227bbf63..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealth.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionHealth struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go deleted file mode 100644 index d0cd806bd05..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionHealthRequest struct { - OutputBlobSasUrl *string `json:"outputBlobSasUrl,omitempty"` - VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionrequest.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionrequest.go deleted file mode 100644 index f7b746fc648..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnconnectionrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionRequest struct { - VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngateway.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngateway.go deleted file mode 100644 index 522c7458570..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SVpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngatewayproperties.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngatewayproperties.go deleted file mode 100644 index 6099821abd6..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpngatewayproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGatewayProperties struct { - CustomDnsServers *[]string `json:"customDnsServers,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnprofileparameters.go b/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnprofileparameters.go deleted file mode 100644 index 7f798f2ae40..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_p2svpnprofileparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnProfileParameters struct { - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_propagatedroutetable.go b/resource-manager/network/2023-05-01/p2svpngateways/model_propagatedroutetable.go deleted file mode 100644 index f137f52cc84..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_routingconfiguration.go b/resource-manager/network/2023-05-01/p2svpngateways/model_routingconfiguration.go deleted file mode 100644 index abe87c9515c..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_staticroute.go b/resource-manager/network/2023-05-01/p2svpngateways/model_staticroute.go deleted file mode 100644 index 0a7ee0c9c99..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_staticroutesconfig.go b/resource-manager/network/2023-05-01/p2svpngateways/model_staticroutesconfig.go deleted file mode 100644 index 063926c25d3..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_subresource.go b/resource-manager/network/2023-05-01/p2svpngateways/model_subresource.go deleted file mode 100644 index 80d7b205b99..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_tagsobject.go b/resource-manager/network/2023-05-01/p2svpngateways/model_tagsobject.go deleted file mode 100644 index f314ca6d15c..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// 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/network/2023-05-01/p2svpngateways/model_vnetroute.go b/resource-manager/network/2023-05-01/p2svpngateways/model_vnetroute.go deleted file mode 100644 index 445ec97bfa1..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnclientconnectionhealth.go b/resource-manager/network/2023-05-01/p2svpngateways/model_vpnclientconnectionhealth.go deleted file mode 100644 index fb3596341d9..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnclientconnectionhealth.go +++ /dev/null @@ -1,11 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealth struct { - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - VpnClientConnectionsCount *int64 `json:"vpnClientConnectionsCount,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2023-05-01/p2svpngateways/model_vpnprofileresponse.go deleted file mode 100644 index 55f4d81d16c..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnprofileresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go deleted file mode 100644 index fe026c0a264..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go deleted file mode 100644 index cebb5053164..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go deleted file mode 100644 index f7a9edb1a56..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupProperties struct { - IsDefault *bool `json:"isDefault,omitempty"` - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/p2svpngateways/version.go b/resource-manager/network/2023-05-01/p2svpngateways/version.go deleted file mode 100644 index 09a0a7ceec8..00000000000 --- a/resource-manager/network/2023-05-01/p2svpngateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/p2svpngateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/README.md b/resource-manager/network/2023-05-01/packetcaptures/README.md deleted file mode 100644 index a9579cc6ed9..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/README.md +++ /dev/null @@ -1,105 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/packetcaptures` Documentation - -The `packetcaptures` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/packetcaptures" -``` - - -### Client Initialization - -```go -client := packetcaptures.NewPacketCapturesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PacketCapturesClient.Create` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -payload := packetcaptures.PacketCapture{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.Delete` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.Get` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -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: `PacketCapturesClient.GetStatus` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.GetStatusThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.List` - -```go -ctx := context.TODO() -id := packetcaptures.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `PacketCapturesClient.Stop` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/packetcaptures/client.go b/resource-manager/network/2023-05-01/packetcaptures/client.go deleted file mode 100644 index 03aa779a5b9..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package packetcaptures - -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 PacketCapturesClient struct { - Client *resourcemanager.Client -} - -func NewPacketCapturesClientWithBaseURI(sdkApi sdkEnv.Api) (*PacketCapturesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "packetcaptures", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PacketCapturesClient: %+v", err) - } - - return &PacketCapturesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/constants.go b/resource-manager/network/2023-05-01/packetcaptures/constants.go deleted file mode 100644 index 52471a03c9e..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/constants.go +++ /dev/null @@ -1,242 +0,0 @@ -package packetcaptures - -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 PacketCaptureTargetType string - -const ( - PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" - PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" -) - -func PossibleValuesForPacketCaptureTargetType() []string { - return []string{ - string(PacketCaptureTargetTypeAzureVM), - string(PacketCaptureTargetTypeAzureVMSS), - } -} - -func (s *PacketCaptureTargetType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePacketCaptureTargetType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePacketCaptureTargetType(input string) (*PacketCaptureTargetType, error) { - vals := map[string]PacketCaptureTargetType{ - "azurevm": PacketCaptureTargetTypeAzureVM, - "azurevmss": PacketCaptureTargetTypeAzureVMSS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PacketCaptureTargetType(input) - return &out, nil -} - -type PcError string - -const ( - PcErrorAgentStopped PcError = "AgentStopped" - PcErrorCaptureFailed PcError = "CaptureFailed" - PcErrorInternalError PcError = "InternalError" - PcErrorLocalFileFailed PcError = "LocalFileFailed" - PcErrorStorageFailed PcError = "StorageFailed" -) - -func PossibleValuesForPcError() []string { - return []string{ - string(PcErrorAgentStopped), - string(PcErrorCaptureFailed), - string(PcErrorInternalError), - string(PcErrorLocalFileFailed), - string(PcErrorStorageFailed), - } -} - -func (s *PcError) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePcError(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePcError(input string) (*PcError, error) { - vals := map[string]PcError{ - "agentstopped": PcErrorAgentStopped, - "capturefailed": PcErrorCaptureFailed, - "internalerror": PcErrorInternalError, - "localfilefailed": PcErrorLocalFileFailed, - "storagefailed": PcErrorStorageFailed, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PcError(input) - return &out, nil -} - -type PcProtocol string - -const ( - PcProtocolAny PcProtocol = "Any" - PcProtocolTCP PcProtocol = "TCP" - PcProtocolUDP PcProtocol = "UDP" -) - -func PossibleValuesForPcProtocol() []string { - return []string{ - string(PcProtocolAny), - string(PcProtocolTCP), - string(PcProtocolUDP), - } -} - -func (s *PcProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePcProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePcProtocol(input string) (*PcProtocol, error) { - vals := map[string]PcProtocol{ - "any": PcProtocolAny, - "tcp": PcProtocolTCP, - "udp": PcProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PcProtocol(input) - return &out, nil -} - -type PcStatus string - -const ( - PcStatusError PcStatus = "Error" - PcStatusNotStarted PcStatus = "NotStarted" - PcStatusRunning PcStatus = "Running" - PcStatusStopped PcStatus = "Stopped" - PcStatusUnknown PcStatus = "Unknown" -) - -func PossibleValuesForPcStatus() []string { - return []string{ - string(PcStatusError), - string(PcStatusNotStarted), - string(PcStatusRunning), - string(PcStatusStopped), - string(PcStatusUnknown), - } -} - -func (s *PcStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePcStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePcStatus(input string) (*PcStatus, error) { - vals := map[string]PcStatus{ - "error": PcStatusError, - "notstarted": PcStatusNotStarted, - "running": PcStatusRunning, - "stopped": PcStatusStopped, - "unknown": PcStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PcStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher.go b/resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher.go deleted file mode 100644 index d9eafa5f099..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package packetcaptures - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher_test.go b/resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher_test.go deleted file mode 100644 index 6fc1898eef7..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package packetcaptures - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-05-01/packetcaptures/id_packetcapture.go b/resource-manager/network/2023-05-01/packetcaptures/id_packetcapture.go deleted file mode 100644 index 8b30ad1ebd6..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/id_packetcapture.go +++ /dev/null @@ -1,139 +0,0 @@ -package packetcaptures - -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(&PacketCaptureId{}) -} - -var _ resourceids.ResourceId = &PacketCaptureId{} - -// PacketCaptureId is a struct representing the Resource ID for a Packet Capture -type PacketCaptureId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string - PacketCaptureName string -} - -// NewPacketCaptureID returns a new PacketCaptureId struct -func NewPacketCaptureID(subscriptionId string, resourceGroupName string, networkWatcherName string, packetCaptureName string) PacketCaptureId { - return PacketCaptureId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - PacketCaptureName: packetCaptureName, - } -} - -// ParsePacketCaptureID parses 'input' into a PacketCaptureId -func ParsePacketCaptureID(input string) (*PacketCaptureId, error) { - parser := resourceids.NewParserFromResourceIdType(&PacketCaptureId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PacketCaptureId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePacketCaptureIDInsensitively parses 'input' case-insensitively into a PacketCaptureId -// note: this method should only be used for API response data and not user input -func ParsePacketCaptureIDInsensitively(input string) (*PacketCaptureId, error) { - parser := resourceids.NewParserFromResourceIdType(&PacketCaptureId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PacketCaptureId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PacketCaptureId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - if id.PacketCaptureName, ok = input.Parsed["packetCaptureName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "packetCaptureName", input) - } - - return nil -} - -// ValidatePacketCaptureID checks that 'input' can be parsed as a Packet Capture ID -func ValidatePacketCaptureID(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 := ParsePacketCaptureID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Packet Capture ID -func (id PacketCaptureId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s/packetCaptures/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName, id.PacketCaptureName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Packet Capture ID -func (id PacketCaptureId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - resourceids.StaticSegment("staticPacketCaptures", "packetCaptures", "packetCaptures"), - resourceids.UserSpecifiedSegment("packetCaptureName", "packetCaptureValue"), - } -} - -// String returns a human-readable description of this Packet Capture ID -func (id PacketCaptureId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - fmt.Sprintf("Packet Capture Name: %q", id.PacketCaptureName), - } - return fmt.Sprintf("Packet Capture (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/id_packetcapture_test.go b/resource-manager/network/2023-05-01/packetcaptures/id_packetcapture_test.go deleted file mode 100644 index 92939b70c2a..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/id_packetcapture_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package packetcaptures - -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 = &PacketCaptureId{} - -func TestNewPacketCaptureID(t *testing.T) { - id := NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } - - if id.PacketCaptureName != "packetCaptureValue" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCaptureName'", id.PacketCaptureName, "packetCaptureValue") - } -} - -func TestFormatPacketCaptureID(t *testing.T) { - actual := NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePacketCaptureID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PacketCaptureId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue", - Expected: &PacketCaptureId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - PacketCaptureName: "packetCaptureValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePacketCaptureID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.PacketCaptureName != v.Expected.PacketCaptureName { - t.Fatalf("Expected %q but got %q for PacketCaptureName", v.Expected.PacketCaptureName, actual.PacketCaptureName) - } - - } -} - -func TestParsePacketCaptureIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PacketCaptureId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/pAcKeTcApTuReS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue", - Expected: &PacketCaptureId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - PacketCaptureName: "packetCaptureValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/pAcKeTcApTuReS/pAcKeTcApTuReVaLuE", - Expected: &PacketCaptureId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - PacketCaptureName: "pAcKeTcApTuReVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/pAcKeTcApTuReS/pAcKeTcApTuReVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePacketCaptureIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.PacketCaptureName != v.Expected.PacketCaptureName { - t.Fatalf("Expected %q but got %q for PacketCaptureName", v.Expected.PacketCaptureName, actual.PacketCaptureName) - } - - } -} - -func TestSegmentsForPacketCaptureId(t *testing.T) { - segments := PacketCaptureId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PacketCaptureId 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/network/2023-05-01/packetcaptures/method_create.go b/resource-manager/network/2023-05-01/packetcaptures/method_create.go deleted file mode 100644 index d01c4d4092c..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/method_create.go +++ /dev/null @@ -1,74 +0,0 @@ -package packetcaptures - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PacketCaptureResult -} - -// Create ... -func (c PacketCapturesClient) Create(ctx context.Context, id PacketCaptureId, input PacketCapture) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - }, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c PacketCapturesClient) CreateThenPoll(ctx context.Context, id PacketCaptureId, input PacketCapture) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/method_delete.go b/resource-manager/network/2023-05-01/packetcaptures/method_delete.go deleted file mode 100644 index d35a3b48efa..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package packetcaptures - -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 PacketCapturesClient) Delete(ctx context.Context, id PacketCaptureId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c PacketCapturesClient) DeleteThenPoll(ctx context.Context, id PacketCaptureId) 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/network/2023-05-01/packetcaptures/method_get.go b/resource-manager/network/2023-05-01/packetcaptures/method_get.go deleted file mode 100644 index 2226c032bea..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package packetcaptures - -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 *PacketCaptureResult -} - -// Get ... -func (c PacketCapturesClient) Get(ctx context.Context, id PacketCaptureId) (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 PacketCaptureResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/method_getstatus.go b/resource-manager/network/2023-05-01/packetcaptures/method_getstatus.go deleted file mode 100644 index 20a7fc75b3c..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/method_getstatus.go +++ /dev/null @@ -1,71 +0,0 @@ -package packetcaptures - -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 GetStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PacketCaptureQueryStatusResult -} - -// GetStatus ... -func (c PacketCapturesClient) GetStatus(ctx context.Context, id PacketCaptureId) (result GetStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryStatus", 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 -} - -// GetStatusThenPoll performs GetStatus then polls until it's completed -func (c PacketCapturesClient) GetStatusThenPoll(ctx context.Context, id PacketCaptureId) error { - result, err := c.GetStatus(ctx, id) - if err != nil { - return fmt.Errorf("performing GetStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/method_list.go b/resource-manager/network/2023-05-01/packetcaptures/method_list.go deleted file mode 100644 index 49bbc661b3c..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package packetcaptures - -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 *PacketCaptureListResult -} - -// List ... -func (c PacketCapturesClient) List(ctx context.Context, id NetworkWatcherId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/packetCaptures", 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 PacketCaptureListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/method_stop.go b/resource-manager/network/2023-05-01/packetcaptures/method_stop.go deleted file mode 100644 index 31a3b050169..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package packetcaptures - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c PacketCapturesClient) Stop(ctx context.Context, id PacketCaptureId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 PacketCapturesClient) StopThenPoll(ctx context.Context, id PacketCaptureId) 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/network/2023-05-01/packetcaptures/model_packetcapture.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcapture.go deleted file mode 100644 index 592cd89a6e7..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapture.go +++ /dev/null @@ -1,8 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCapture struct { - Properties PacketCaptureParameters `json:"properties"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturefilter.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturefilter.go deleted file mode 100644 index fb301880566..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturefilter.go +++ /dev/null @@ -1,12 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureFilter struct { - LocalIPAddress *string `json:"localIPAddress,omitempty"` - LocalPort *string `json:"localPort,omitempty"` - Protocol *PcProtocol `json:"protocol,omitempty"` - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - RemotePort *string `json:"remotePort,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturelistresult.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturelistresult.go deleted file mode 100644 index 54c50c44871..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureListResult struct { - Value *[]PacketCaptureResult `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturemachinescope.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturemachinescope.go deleted file mode 100644 index 99b476671ba..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturemachinescope.go +++ /dev/null @@ -1,9 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureMachineScope struct { - Exclude *[]string `json:"exclude,omitempty"` - Include *[]string `json:"include,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureparameters.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureparameters.go deleted file mode 100644 index dd18ed71be2..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureParameters struct { - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - StorageLocation PacketCaptureStorageLocation `json:"storageLocation"` - Target string `json:"target"` - TargetType *PacketCaptureTargetType `json:"targetType,omitempty"` - TimeLimitInSeconds *int64 `json:"timeLimitInSeconds,omitempty"` - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturequerystatusresult.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturequerystatusresult.go deleted file mode 100644 index edea164feae..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturequerystatusresult.go +++ /dev/null @@ -1,31 +0,0 @@ -package packetcaptures - -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 PacketCaptureQueryStatusResult struct { - CaptureStartTime *string `json:"captureStartTime,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` - PacketCaptureStatus *PcStatus `json:"packetCaptureStatus,omitempty"` - StopReason *string `json:"stopReason,omitempty"` -} - -func (o *PacketCaptureQueryStatusResult) GetCaptureStartTimeAsTime() (*time.Time, error) { - if o.CaptureStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CaptureStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PacketCaptureQueryStatusResult) SetCaptureStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CaptureStartTime = &formatted -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresult.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresult.go deleted file mode 100644 index a2e7cd88e02..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureResult struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PacketCaptureResultProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresultproperties.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresultproperties.go deleted file mode 100644 index 61dbaf130bb..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcaptureresultproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureResultProperties struct { - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - StorageLocation PacketCaptureStorageLocation `json:"storageLocation"` - Target string `json:"target"` - TargetType *PacketCaptureTargetType `json:"targetType,omitempty"` - TimeLimitInSeconds *int64 `json:"timeLimitInSeconds,omitempty"` - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturestoragelocation.go b/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturestoragelocation.go deleted file mode 100644 index 5cbd5d6b25e..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/model_packetcapturestoragelocation.go +++ /dev/null @@ -1,10 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureStorageLocation struct { - FilePath *string `json:"filePath,omitempty"` - StorageId *string `json:"storageId,omitempty"` - StoragePath *string `json:"storagePath,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/packetcaptures/version.go b/resource-manager/network/2023-05-01/packetcaptures/version.go deleted file mode 100644 index 0110198ca4f..00000000000 --- a/resource-manager/network/2023-05-01/packetcaptures/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package packetcaptures - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/packetcaptures/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/README.md deleted file mode 100644 index 82d29f3f593..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections` Documentation - -The `peerexpressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/peerexpressroutecircuitconnections" -``` - - -### Client Initialization - -```go -client := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PeerExpressRouteCircuitConnectionsClient.Get` - -```go -ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue") - -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: `PeerExpressRouteCircuitConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -// 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/network/2023-05-01/peerexpressroutecircuitconnections/client.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/client.go deleted file mode 100644 index c0c578a280f..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package peerexpressroutecircuitconnections - -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 PeerExpressRouteCircuitConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PeerExpressRouteCircuitConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "peerexpressroutecircuitconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PeerExpressRouteCircuitConnectionsClient: %+v", err) - } - - return &PeerExpressRouteCircuitConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/constants.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/constants.go deleted file mode 100644 index eda70745480..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package peerexpressroutecircuitconnections - -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 CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection.go deleted file mode 100644 index 6bde16a10c5..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package peerexpressroutecircuitconnections - -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(&PeerConnectionId{}) -} - -var _ resourceids.ResourceId = &PeerConnectionId{} - -// PeerConnectionId is a struct representing the Resource ID for a Peer Connection -type PeerConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - PeerConnectionName string -} - -// NewPeerConnectionID returns a new PeerConnectionId struct -func NewPeerConnectionID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, peerConnectionName string) PeerConnectionId { - return PeerConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - PeerConnectionName: peerConnectionName, - } -} - -// ParsePeerConnectionID parses 'input' into a PeerConnectionId -func ParsePeerConnectionID(input string) (*PeerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeerConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeerConnectionIDInsensitively parses 'input' case-insensitively into a PeerConnectionId -// note: this method should only be used for API response data and not user input -func ParsePeerConnectionIDInsensitively(input string) (*PeerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeerConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeerConnectionId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.PeerConnectionName, ok = input.Parsed["peerConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peerConnectionName", input) - } - - return nil -} - -// ValidatePeerConnectionID checks that 'input' can be parsed as a Peer Connection ID -func ValidatePeerConnectionID(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 := ParsePeerConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peer Connection ID -func (id PeerConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/peerConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.PeerConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peer Connection ID -func (id PeerConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticPeerConnections", "peerConnections", "peerConnections"), - resourceids.UserSpecifiedSegment("peerConnectionName", "peerConnectionValue"), - } -} - -// String returns a human-readable description of this Peer Connection ID -func (id PeerConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Peer Connection Name: %q", id.PeerConnectionName), - } - return fmt.Sprintf("Peer Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection_test.go deleted file mode 100644 index df242ff6d30..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/id_peerconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package peerexpressroutecircuitconnections - -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 = &PeerConnectionId{} - -func TestNewPeerConnectionID(t *testing.T) { - id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.PeerConnectionName != "peerConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "peerConnectionValue") - } -} - -func TestFormatPeerConnectionID(t *testing.T) { - actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeerConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue", - Expected: &PeerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - PeerConnectionName: "peerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeerConnectionID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.PeerConnectionName != v.Expected.PeerConnectionName { - t.Fatalf("Expected %q but got %q for PeerConnectionName", v.Expected.PeerConnectionName, actual.PeerConnectionName) - } - - } -} - -func TestParsePeerConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/pEeRcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue", - Expected: &PeerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - PeerConnectionName: "peerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNvAlUe", - Expected: &PeerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - PeerConnectionName: "pEeRcOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeerConnectionIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.PeerConnectionName != v.Expected.PeerConnectionName { - t.Fatalf("Expected %q but got %q for PeerConnectionName", v.Expected.PeerConnectionName, actual.PeerConnectionName) - } - - } -} - -func TestSegmentsForPeerConnectionId(t *testing.T) { - segments := PeerConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeerConnectionId 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/network/2023-05-01/peerexpressroutecircuitconnections/method_get.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_get.go deleted file mode 100644 index 844c3c67e07..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package peerexpressroutecircuitconnections - -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 *PeerExpressRouteCircuitConnection -} - -// Get ... -func (c PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, id PeerConnectionId) (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 PeerExpressRouteCircuitConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_list.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_list.go deleted file mode 100644 index 58e9b3af846..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package peerexpressroutecircuitconnections - -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 *[]PeerExpressRouteCircuitConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PeerExpressRouteCircuitConnection -} - -// List ... -func (c PeerExpressRouteCircuitConnectionsClient) List(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerConnections", 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 *[]PeerExpressRouteCircuitConnection `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 PeerExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PeerExpressRouteCircuitConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PeerExpressRouteCircuitConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, predicate PeerExpressRouteCircuitConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PeerExpressRouteCircuitConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index 0ba2f68f213..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index c4a72c247d0..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_subresource.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_subresource.go deleted file mode 100644 index da8f131efb2..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/predicates.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/predicates.go deleted file mode 100644 index c0766bb2d18..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p PeerExpressRouteCircuitConnectionOperationPredicate) Matches(input PeerExpressRouteCircuitConnection) 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.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/network/2023-05-01/peerexpressroutecircuitconnections/version.go b/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/version.go deleted file mode 100644 index 66e05b10ccd..00000000000 --- a/resource-manager/network/2023-05-01/peerexpressroutecircuitconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package peerexpressroutecircuitconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/peerexpressroutecircuitconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/README.md b/resource-manager/network/2023-05-01/privatednszonegroups/README.md deleted file mode 100644 index dea40f9dd9a..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privatednszonegroups` Documentation - -The `privatednszonegroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/privatednszonegroups" -``` - - -### Client Initialization - -```go -client := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -payload := privatednszonegroups.PrivateDnsZoneGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.Delete` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.Get` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -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: `PrivateDnsZoneGroupsClient.List` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -// 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/network/2023-05-01/privatednszonegroups/client.go b/resource-manager/network/2023-05-01/privatednszonegroups/client.go deleted file mode 100644 index 99ce8b6667e..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatednszonegroups - -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 PrivateDnsZoneGroupsClient struct { - Client *resourcemanager.Client -} - -func NewPrivateDnsZoneGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateDnsZoneGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatednszonegroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateDnsZoneGroupsClient: %+v", err) - } - - return &PrivateDnsZoneGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/constants.go b/resource-manager/network/2023-05-01/privatednszonegroups/constants.go deleted file mode 100644 index a68ae3a4523..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package privatednszonegroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup.go b/resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup.go deleted file mode 100644 index 9399f9157d3..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package privatednszonegroups - -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(&PrivateDnsZoneGroupId{}) -} - -var _ resourceids.ResourceId = &PrivateDnsZoneGroupId{} - -// PrivateDnsZoneGroupId is a struct representing the Resource ID for a Private Dns Zone Group -type PrivateDnsZoneGroupId struct { - SubscriptionId string - ResourceGroupName string - PrivateEndpointName string - PrivateDnsZoneGroupName string -} - -// NewPrivateDnsZoneGroupID returns a new PrivateDnsZoneGroupId struct -func NewPrivateDnsZoneGroupID(subscriptionId string, resourceGroupName string, privateEndpointName string, privateDnsZoneGroupName string) PrivateDnsZoneGroupId { - return PrivateDnsZoneGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateEndpointName: privateEndpointName, - PrivateDnsZoneGroupName: privateDnsZoneGroupName, - } -} - -// ParsePrivateDnsZoneGroupID parses 'input' into a PrivateDnsZoneGroupId -func ParsePrivateDnsZoneGroupID(input string) (*PrivateDnsZoneGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateDnsZoneGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateDnsZoneGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateDnsZoneGroupIDInsensitively parses 'input' case-insensitively into a PrivateDnsZoneGroupId -// note: this method should only be used for API response data and not user input -func ParsePrivateDnsZoneGroupIDInsensitively(input string) (*PrivateDnsZoneGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateDnsZoneGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateDnsZoneGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateDnsZoneGroupId) 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.PrivateEndpointName, ok = input.Parsed["privateEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointName", input) - } - - if id.PrivateDnsZoneGroupName, ok = input.Parsed["privateDnsZoneGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateDnsZoneGroupName", input) - } - - return nil -} - -// ValidatePrivateDnsZoneGroupID checks that 'input' can be parsed as a Private Dns Zone Group ID -func ValidatePrivateDnsZoneGroupID(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 := ParsePrivateDnsZoneGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Dns Zone Group ID -func (id PrivateDnsZoneGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateEndpoints/%s/privateDnsZoneGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateEndpointName, id.PrivateDnsZoneGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Dns Zone Group ID -func (id PrivateDnsZoneGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateEndpoints", "privateEndpoints", "privateEndpoints"), - resourceids.UserSpecifiedSegment("privateEndpointName", "privateEndpointValue"), - resourceids.StaticSegment("staticPrivateDnsZoneGroups", "privateDnsZoneGroups", "privateDnsZoneGroups"), - resourceids.UserSpecifiedSegment("privateDnsZoneGroupName", "privateDnsZoneGroupValue"), - } -} - -// String returns a human-readable description of this Private Dns Zone Group ID -func (id PrivateDnsZoneGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Endpoint Name: %q", id.PrivateEndpointName), - fmt.Sprintf("Private Dns Zone Group Name: %q", id.PrivateDnsZoneGroupName), - } - return fmt.Sprintf("Private Dns Zone Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup_test.go b/resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup_test.go deleted file mode 100644 index f2c846d6c2f..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/id_privatednszonegroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package privatednszonegroups - -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 = &PrivateDnsZoneGroupId{} - -func TestNewPrivateDnsZoneGroupID(t *testing.T) { - id := NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - - 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.PrivateEndpointName != "privateEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointName'", id.PrivateEndpointName, "privateEndpointValue") - } - - if id.PrivateDnsZoneGroupName != "privateDnsZoneGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneGroupName'", id.PrivateDnsZoneGroupName, "privateDnsZoneGroupValue") - } -} - -func TestFormatPrivateDnsZoneGroupID(t *testing.T) { - actual := NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateDnsZoneGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateDnsZoneGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue", - Expected: &PrivateDnsZoneGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - PrivateDnsZoneGroupName: "privateDnsZoneGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateDnsZoneGroupID(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - if actual.PrivateDnsZoneGroupName != v.Expected.PrivateDnsZoneGroupName { - t.Fatalf("Expected %q but got %q for PrivateDnsZoneGroupName", v.Expected.PrivateDnsZoneGroupName, actual.PrivateDnsZoneGroupName) - } - - } -} - -func TestParsePrivateDnsZoneGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateDnsZoneGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/pRiVaTeDnSzOnEgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue", - Expected: &PrivateDnsZoneGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - PrivateDnsZoneGroupName: "privateDnsZoneGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/pRiVaTeDnSzOnEgRoUpS/pRiVaTeDnSzOnEgRoUpVaLuE", - Expected: &PrivateDnsZoneGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateEndpointName: "pRiVaTeEnDpOiNtVaLuE", - PrivateDnsZoneGroupName: "pRiVaTeDnSzOnEgRoUpVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/pRiVaTeDnSzOnEgRoUpS/pRiVaTeDnSzOnEgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateDnsZoneGroupIDInsensitively(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - if actual.PrivateDnsZoneGroupName != v.Expected.PrivateDnsZoneGroupName { - t.Fatalf("Expected %q but got %q for PrivateDnsZoneGroupName", v.Expected.PrivateDnsZoneGroupName, actual.PrivateDnsZoneGroupName) - } - - } -} - -func TestSegmentsForPrivateDnsZoneGroupId(t *testing.T) { - segments := PrivateDnsZoneGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateDnsZoneGroupId 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/network/2023-05-01/privatednszonegroups/id_privateendpoint.go b/resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint.go deleted file mode 100644 index a9f6cc5dff2..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatednszonegroups - -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(&PrivateEndpointId{}) -} - -var _ resourceids.ResourceId = &PrivateEndpointId{} - -// PrivateEndpointId is a struct representing the Resource ID for a Private Endpoint -type PrivateEndpointId struct { - SubscriptionId string - ResourceGroupName string - PrivateEndpointName string -} - -// NewPrivateEndpointID returns a new PrivateEndpointId struct -func NewPrivateEndpointID(subscriptionId string, resourceGroupName string, privateEndpointName string) PrivateEndpointId { - return PrivateEndpointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateEndpointName: privateEndpointName, - } -} - -// ParsePrivateEndpointID parses 'input' into a PrivateEndpointId -func ParsePrivateEndpointID(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateEndpointIDInsensitively parses 'input' case-insensitively into a PrivateEndpointId -// note: this method should only be used for API response data and not user input -func ParsePrivateEndpointIDInsensitively(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateEndpointId) 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.PrivateEndpointName, ok = input.Parsed["privateEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointName", input) - } - - return nil -} - -// ValidatePrivateEndpointID checks that 'input' can be parsed as a Private Endpoint ID -func ValidatePrivateEndpointID(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 := ParsePrivateEndpointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Endpoint ID -func (id PrivateEndpointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateEndpoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateEndpointName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint ID -func (id PrivateEndpointId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateEndpoints", "privateEndpoints", "privateEndpoints"), - resourceids.UserSpecifiedSegment("privateEndpointName", "privateEndpointValue"), - } -} - -// String returns a human-readable description of this Private Endpoint ID -func (id PrivateEndpointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Endpoint Name: %q", id.PrivateEndpointName), - } - return fmt.Sprintf("Private Endpoint (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint_test.go b/resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint_test.go deleted file mode 100644 index d2c81acb9f9..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/id_privateendpoint_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatednszonegroups - -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 = &PrivateEndpointId{} - -func TestNewPrivateEndpointID(t *testing.T) { - id := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - - 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.PrivateEndpointName != "privateEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointName'", id.PrivateEndpointName, "privateEndpointValue") - } -} - -func TestFormatPrivateEndpointID(t *testing.T) { - actual := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateEndpointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointID(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestParsePrivateEndpointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateEndpointName: "pRiVaTeEnDpOiNtVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointIDInsensitively(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestSegmentsForPrivateEndpointId(t *testing.T) { - segments := PrivateEndpointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateEndpointId 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/network/2023-05-01/privatednszonegroups/method_createorupdate.go b/resource-manager/network/2023-05-01/privatednszonegroups/method_createorupdate.go deleted file mode 100644 index 88dadb3a0a5..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatednszonegroups - -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 *PrivateDnsZoneGroup -} - -// CreateOrUpdate ... -func (c PrivateDnsZoneGroupsClient) CreateOrUpdate(ctx context.Context, id PrivateDnsZoneGroupId, input PrivateDnsZoneGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateDnsZoneGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateDnsZoneGroupId, input PrivateDnsZoneGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/privatednszonegroups/method_delete.go b/resource-manager/network/2023-05-01/privatednszonegroups/method_delete.go deleted file mode 100644 index cdf382f2686..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatednszonegroups - -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 PrivateDnsZoneGroupsClient) Delete(ctx context.Context, id PrivateDnsZoneGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateDnsZoneGroupsClient) DeleteThenPoll(ctx context.Context, id PrivateDnsZoneGroupId) 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/network/2023-05-01/privatednszonegroups/method_get.go b/resource-manager/network/2023-05-01/privatednszonegroups/method_get.go deleted file mode 100644 index 3c25fca99b7..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package privatednszonegroups - -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 *PrivateDnsZoneGroup -} - -// Get ... -func (c PrivateDnsZoneGroupsClient) Get(ctx context.Context, id PrivateDnsZoneGroupId) (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 PrivateDnsZoneGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/method_list.go b/resource-manager/network/2023-05-01/privatednszonegroups/method_list.go deleted file mode 100644 index 5328faa005f..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatednszonegroups - -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 *[]PrivateDnsZoneGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateDnsZoneGroup -} - -// List ... -func (c PrivateDnsZoneGroupsClient) List(ctx context.Context, id PrivateEndpointId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/privateDnsZoneGroups", 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 *[]PrivateDnsZoneGroup `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 PrivateDnsZoneGroupsClient) ListComplete(ctx context.Context, id PrivateEndpointId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateDnsZoneGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateDnsZoneGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id PrivateEndpointId, predicate PrivateDnsZoneGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateDnsZoneGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/privatednszonegroups/model_privatednszoneconfig.go b/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszoneconfig.go deleted file mode 100644 index e44ef143e5c..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszoneconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneConfig struct { - Name *string `json:"name,omitempty"` - Properties *PrivateDnsZonePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegroup.go b/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegroup.go deleted file mode 100644 index 75533fc47a5..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateDnsZoneGroupPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go b/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go deleted file mode 100644 index f892f554965..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneGroupPropertiesFormat struct { - PrivateDnsZoneConfigs *[]PrivateDnsZoneConfig `json:"privateDnsZoneConfigs,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonepropertiesformat.go b/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonepropertiesformat.go deleted file mode 100644 index 33858bfe24e..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/model_privatednszonepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZonePropertiesFormat struct { - PrivateDnsZoneId *string `json:"privateDnsZoneId,omitempty"` - RecordSets *[]RecordSet `json:"recordSets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/model_recordset.go b/resource-manager/network/2023-05-01/privatednszonegroups/model_recordset.go deleted file mode 100644 index 4a39969425d..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/model_recordset.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecordSet struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RecordSetName *string `json:"recordSetName,omitempty"` - RecordType *string `json:"recordType,omitempty"` - Ttl *int64 `json:"ttl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/predicates.go b/resource-manager/network/2023-05-01/privatednszonegroups/predicates.go deleted file mode 100644 index 4d27803d6e2..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneGroupOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p PrivateDnsZoneGroupOperationPredicate) Matches(input PrivateDnsZoneGroup) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/privatednszonegroups/version.go b/resource-manager/network/2023-05-01/privatednszonegroups/version.go deleted file mode 100644 index 467ad1191c8..00000000000 --- a/resource-manager/network/2023-05-01/privatednszonegroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatednszonegroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatednszonegroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/README.md b/resource-manager/network/2023-05-01/privateendpoints/README.md deleted file mode 100644 index db399eef9c5..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/README.md +++ /dev/null @@ -1,134 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privateendpoints` Documentation - -The `privateendpoints` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/privateendpoints" -``` - - -### Client Initialization - -```go -client := privateendpoints.NewPrivateEndpointsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesList` - -```go -ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination -items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesListByResourceGroup` - -```go -ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateEndpointsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -payload := privateendpoints.PrivateEndpoint{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointsClient.Delete` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointsClient.Get` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -read, err := client.Get(ctx, id, privateendpoints.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateEndpointsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PrivateEndpointsClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/privateendpoints/client.go b/resource-manager/network/2023-05-01/privateendpoints/client.go deleted file mode 100644 index 149437b1334..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privateendpoints - -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 PrivateEndpointsClient struct { - Client *resourcemanager.Client -} - -func NewPrivateEndpointsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateEndpointsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privateendpoints", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateEndpointsClient: %+v", err) - } - - return &PrivateEndpointsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/constants.go b/resource-manager/network/2023-05-01/privateendpoints/constants.go deleted file mode 100644 index fe61de76a0e..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privateendpoints - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/id_location.go b/resource-manager/network/2023-05-01/privateendpoints/id_location.go deleted file mode 100644 index 54b43b4b1f2..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package privateendpoints - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/privateendpoints/id_location_test.go b/resource-manager/network/2023-05-01/privateendpoints/id_location_test.go deleted file mode 100644 index b9fa098002a..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package privateendpoints - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/privateendpoints/id_privateendpoint.go b/resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint.go deleted file mode 100644 index a104325012e..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint.go +++ /dev/null @@ -1,130 +0,0 @@ -package privateendpoints - -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(&PrivateEndpointId{}) -} - -var _ resourceids.ResourceId = &PrivateEndpointId{} - -// PrivateEndpointId is a struct representing the Resource ID for a Private Endpoint -type PrivateEndpointId struct { - SubscriptionId string - ResourceGroupName string - PrivateEndpointName string -} - -// NewPrivateEndpointID returns a new PrivateEndpointId struct -func NewPrivateEndpointID(subscriptionId string, resourceGroupName string, privateEndpointName string) PrivateEndpointId { - return PrivateEndpointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateEndpointName: privateEndpointName, - } -} - -// ParsePrivateEndpointID parses 'input' into a PrivateEndpointId -func ParsePrivateEndpointID(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateEndpointIDInsensitively parses 'input' case-insensitively into a PrivateEndpointId -// note: this method should only be used for API response data and not user input -func ParsePrivateEndpointIDInsensitively(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateEndpointId) 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.PrivateEndpointName, ok = input.Parsed["privateEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointName", input) - } - - return nil -} - -// ValidatePrivateEndpointID checks that 'input' can be parsed as a Private Endpoint ID -func ValidatePrivateEndpointID(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 := ParsePrivateEndpointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Endpoint ID -func (id PrivateEndpointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateEndpoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateEndpointName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint ID -func (id PrivateEndpointId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateEndpoints", "privateEndpoints", "privateEndpoints"), - resourceids.UserSpecifiedSegment("privateEndpointName", "privateEndpointValue"), - } -} - -// String returns a human-readable description of this Private Endpoint ID -func (id PrivateEndpointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Endpoint Name: %q", id.PrivateEndpointName), - } - return fmt.Sprintf("Private Endpoint (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint_test.go b/resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint_test.go deleted file mode 100644 index 8a94615f8fc..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/id_privateendpoint_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privateendpoints - -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 = &PrivateEndpointId{} - -func TestNewPrivateEndpointID(t *testing.T) { - id := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - - 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.PrivateEndpointName != "privateEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointName'", id.PrivateEndpointName, "privateEndpointValue") - } -} - -func TestFormatPrivateEndpointID(t *testing.T) { - actual := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateEndpointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointID(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestParsePrivateEndpointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateEndpointName: "pRiVaTeEnDpOiNtVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointIDInsensitively(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestSegmentsForPrivateEndpointId(t *testing.T) { - segments := PrivateEndpointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateEndpointId 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/network/2023-05-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2023-05-01/privateendpoints/id_providerlocation.go deleted file mode 100644 index a70739b937d..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package privateendpoints - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2023-05-01/privateendpoints/id_providerlocation_test.go deleted file mode 100644 index 8fbe88bd140..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privateendpoints - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslist.go b/resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslist.go deleted file mode 100644 index d7fdaf55d21..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package privateendpoints - -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 AvailablePrivateEndpointTypesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailablePrivateEndpointType -} - -type AvailablePrivateEndpointTypesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailablePrivateEndpointType -} - -// AvailablePrivateEndpointTypesList ... -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesList(ctx context.Context, id LocationId) (result AvailablePrivateEndpointTypesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availablePrivateEndpointTypes", 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 *[]AvailablePrivateEndpointType `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailablePrivateEndpointTypesListComplete retrieves all the results into a single object -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListComplete(ctx context.Context, id LocationId) (AvailablePrivateEndpointTypesListCompleteResult, error) { - return c.AvailablePrivateEndpointTypesListCompleteMatchingPredicate(ctx, id, AvailablePrivateEndpointTypeOperationPredicate{}) -} - -// AvailablePrivateEndpointTypesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AvailablePrivateEndpointTypeOperationPredicate) (result AvailablePrivateEndpointTypesListCompleteResult, err error) { - items := make([]AvailablePrivateEndpointType, 0) - - resp, err := c.AvailablePrivateEndpointTypesList(ctx, id) - if err != nil { - 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 = AvailablePrivateEndpointTypesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go b/resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go deleted file mode 100644 index acb79f31b4e..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package privateendpoints - -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 AvailablePrivateEndpointTypesListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailablePrivateEndpointType -} - -type AvailablePrivateEndpointTypesListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailablePrivateEndpointType -} - -// AvailablePrivateEndpointTypesListByResourceGroup ... -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListByResourceGroup(ctx context.Context, id ProviderLocationId) (result AvailablePrivateEndpointTypesListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availablePrivateEndpointTypes", 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 *[]AvailablePrivateEndpointType `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailablePrivateEndpointTypesListByResourceGroupComplete retrieves all the results into a single object -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx context.Context, id ProviderLocationId) (AvailablePrivateEndpointTypesListByResourceGroupCompleteResult, error) { - return c.AvailablePrivateEndpointTypesListByResourceGroupCompleteMatchingPredicate(ctx, id, AvailablePrivateEndpointTypeOperationPredicate{}) -} - -// AvailablePrivateEndpointTypesListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AvailablePrivateEndpointTypeOperationPredicate) (result AvailablePrivateEndpointTypesListByResourceGroupCompleteResult, err error) { - items := make([]AvailablePrivateEndpointType, 0) - - resp, err := c.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id) - if err != nil { - 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 = AvailablePrivateEndpointTypesListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/method_createorupdate.go b/resource-manager/network/2023-05-01/privateendpoints/method_createorupdate.go deleted file mode 100644 index b5055a0cda4..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privateendpoints - -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 *PrivateEndpoint -} - -// CreateOrUpdate ... -func (c PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, id PrivateEndpointId, input PrivateEndpoint) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateEndpointsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateEndpointId, input PrivateEndpoint) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/privateendpoints/method_delete.go b/resource-manager/network/2023-05-01/privateendpoints/method_delete.go deleted file mode 100644 index 70f382bf8e3..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privateendpoints - -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 PrivateEndpointsClient) Delete(ctx context.Context, id PrivateEndpointId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateEndpointsClient) DeleteThenPoll(ctx context.Context, id PrivateEndpointId) 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/network/2023-05-01/privateendpoints/method_get.go b/resource-manager/network/2023-05-01/privateendpoints/method_get.go deleted file mode 100644 index 5f913d65fd2..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package privateendpoints - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpoint -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PrivateEndpointsClient) Get(ctx context.Context, id PrivateEndpointId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PrivateEndpoint - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/method_list.go b/resource-manager/network/2023-05-01/privateendpoints/method_list.go deleted file mode 100644 index 75a99d85e75..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package privateendpoints - -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 *[]PrivateEndpoint -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpoint -} - -// List ... -func (c PrivateEndpointsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateEndpoints", 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 *[]PrivateEndpoint `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 PrivateEndpointsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateEndpointOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PrivateEndpointOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateEndpoint, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/privateendpoints/method_listbysubscription.go b/resource-manager/network/2023-05-01/privateendpoints/method_listbysubscription.go deleted file mode 100644 index 77e12002881..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package privateendpoints - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateEndpoint -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpoint -} - -// ListBySubscription ... -func (c PrivateEndpointsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateEndpoints", 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 *[]PrivateEndpoint `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c PrivateEndpointsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, PrivateEndpointOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PrivateEndpointOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]PrivateEndpoint, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b8767a924d3..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index faea7af9635..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index bc45532ef99..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfiguration.go deleted file mode 100644 index d7b619385a0..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 0975b3a3c18..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygroup.go deleted file mode 100644 index b514ce65a10..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index c505be8adad..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_availableprivateendpointtype.go b/resource-manager/network/2023-05-01/privateendpoints/model_availableprivateendpointtype.go deleted file mode 100644 index c6aa8839dc1..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_availableprivateendpointtype.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailablePrivateEndpointType struct { - DisplayName *string `json:"displayName,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspool.go b/resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspool.go deleted file mode 100644 index afaee89cd0a..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 7079b861291..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index a078479b1cf..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_ddossettings.go b/resource-manager/network/2023-05-01/privateendpoints/model_ddossettings.go deleted file mode 100644 index 6253ff1e5a4..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_delegation.go b/resource-manager/network/2023-05-01/privateendpoints/model_delegation.go deleted file mode 100644 index fd6104e1e68..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_flowlog.go b/resource-manager/network/2023-05-01/privateendpoints/model_flowlog.go deleted file mode 100644 index bce1bcfe8ad..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/privateendpoints/model_flowlogformatparameters.go deleted file mode 100644 index a15c48049c6..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_flowlogpropertiesformat.go deleted file mode 100644 index 6f45378b9d1..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfiguration.go deleted file mode 100644 index 3dcb8560fec..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package privateendpoints - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 8980fc3756f..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index dde47c23fb2..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrule.go b/resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrule.go deleted file mode 100644 index 38c0ffd6728..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index b952302ddeb..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_ipconfiguration.go deleted file mode 100644 index cf18ee9415b..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofile.go deleted file mode 100644 index d493529c992..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index dabdbd7c841..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index fdfdcd1d175..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_iptag.go b/resource-manager/network/2023-05-01/privateendpoints/model_iptag.go deleted file mode 100644 index 83206500edc..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// 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/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddress.go deleted file mode 100644 index ee77fec93c3..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 9be73b64841..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_natgateway.go b/resource-manager/network/2023-05-01/privateendpoints/model_natgateway.go deleted file mode 100644 index e197bcd7ada..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package privateendpoints - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_natgatewaypropertiesformat.go deleted file mode 100644 index fc0ee1ef6da..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_natgatewaysku.go b/resource-manager/network/2023-05-01/privateendpoints/model_natgatewaysku.go deleted file mode 100644 index c0b2d583e49..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_natruleportmapping.go b/resource-manager/network/2023-05-01/privateendpoints/model_natruleportmapping.go deleted file mode 100644 index 07eeaf979f4..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterface.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterface.go deleted file mode 100644 index 9e9c7fcfa82..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacednssettings.go deleted file mode 100644 index 5182d846bf1..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfiguration.go deleted file mode 100644 index e41eb348a7b..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index ac6a234dd34..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index cacb1e17719..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacepropertiesformat.go deleted file mode 100644 index a5fd36f9266..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfiguration.go deleted file mode 100644 index ebe35c0a178..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 54e437f339f..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygroup.go deleted file mode 100644 index cb420b60990..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index b03a951faff..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpoint.go b/resource-manager/network/2023-05-01/privateendpoints/model_privateendpoint.go deleted file mode 100644 index 5e9da21fedb..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnection.go deleted file mode 100644 index 5bd8301f4f3..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/privateendpoints/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8c0662fe4e2..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfiguration.go deleted file mode 100644 index 1fbe08553f6..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 3772b023f53..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointproperties.go deleted file mode 100644 index ac88e7637f3..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkservice.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkservice.go deleted file mode 100644 index e4c8723fc8b..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnection.go deleted file mode 100644 index be10aca683d..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index da2a7ed3871..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 1d19bec0830..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 358ee0e7450..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 81634dd44b1..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceproperties.go deleted file mode 100644 index d246ec00f40..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddress.go b/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddress.go deleted file mode 100644 index eeca2133c31..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddressdnssettings.go deleted file mode 100644 index bc8acd1515a..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresspropertiesformat.go deleted file mode 100644 index bed9d0ba8d7..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresssku.go deleted file mode 100644 index 2bbd107f243..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlink.go deleted file mode 100644 index d8890442923..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlinkformat.go deleted file mode 100644 index 281da0ffc97..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_resourceset.go b/resource-manager/network/2023-05-01/privateendpoints/model_resourceset.go deleted file mode 100644 index 999b1817a30..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/privateendpoints/model_retentionpolicyparameters.go deleted file mode 100644 index b3df6ba5fd1..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_route.go b/resource-manager/network/2023-05-01/privateendpoints/model_route.go deleted file mode 100644 index 98c7a5ae476..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_routepropertiesformat.go deleted file mode 100644 index ca3956916f3..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_routetable.go b/resource-manager/network/2023-05-01/privateendpoints/model_routetable.go deleted file mode 100644 index e1f695300d8..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_routetablepropertiesformat.go deleted file mode 100644 index 4976a28f0ea..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_securityrule.go b/resource-manager/network/2023-05-01/privateendpoints/model_securityrule.go deleted file mode 100644 index ccfc50b4a7e..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_securityrulepropertiesformat.go deleted file mode 100644 index 2b19d6a628d..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlink.go deleted file mode 100644 index a88015b02e1..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 7a779312074..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 84e538e8350..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicy.go deleted file mode 100644 index ea8ff121174..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinition.go deleted file mode 100644 index cc2054776fa..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 8355dfbaae0..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index dbdcdea1442..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5b54f3ef673..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_subnet.go b/resource-manager/network/2023-05-01/privateendpoints/model_subnet.go deleted file mode 100644 index 1eee73db2bd..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_subnetpropertiesformat.go deleted file mode 100644 index bf9784055d4..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_subresource.go b/resource-manager/network/2023-05-01/privateendpoints/model_subresource.go deleted file mode 100644 index 134c4f66102..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index fc7cf55257e..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsproperties.go deleted file mode 100644 index 8a4f6042fa4..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktap.go deleted file mode 100644 index 99fe7d7fe1d..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index c7fa6565e0f..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privateendpoints/predicates.go b/resource-manager/network/2023-05-01/privateendpoints/predicates.go deleted file mode 100644 index c99098d0163..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/predicates.go +++ /dev/null @@ -1,70 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailablePrivateEndpointTypeOperationPredicate struct { - DisplayName *string - Id *string - Name *string - ResourceName *string - Type *string -} - -func (p AvailablePrivateEndpointTypeOperationPredicate) Matches(input AvailablePrivateEndpointType) bool { - - if p.DisplayName != nil && (input.DisplayName == nil || *p.DisplayName != *input.DisplayName) { - return false - } - - 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.ResourceName != nil && (input.ResourceName == nil || *p.ResourceName != *input.ResourceName) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} - -type PrivateEndpointOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PrivateEndpointOperationPredicate) Matches(input PrivateEndpoint) 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 && (input.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/network/2023-05-01/privateendpoints/version.go b/resource-manager/network/2023-05-01/privateendpoints/version.go deleted file mode 100644 index 03432b25c65..00000000000 --- a/resource-manager/network/2023-05-01/privateendpoints/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpoints/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/README.md b/resource-manager/network/2023-05-01/privatelinkservice/README.md deleted file mode 100644 index 37c72e75a67..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privatelinkservice` Documentation - -The `privatelinkservice` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/privatelinkservice" -``` - - -### Client Initialization - -```go -client := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkServiceClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatelinkservice.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -payload := privatelinkservice.PrivateLinkService{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/privatelinkservice/client.go b/resource-manager/network/2023-05-01/privatelinkservice/client.go deleted file mode 100644 index a89ea113cc4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkservice - -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 PrivateLinkServiceClient struct { - Client *resourcemanager.Client -} - -func NewPrivateLinkServiceClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkServiceClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatelinkservice", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkServiceClient: %+v", err) - } - - return &PrivateLinkServiceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/constants.go b/resource-manager/network/2023-05-01/privatelinkservice/constants.go deleted file mode 100644 index daeb4295f4c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privatelinkservice - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice.go b/resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice.go deleted file mode 100644 index 21ea63899b3..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkservice - -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(&PrivateLinkServiceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkServiceId{} - -// PrivateLinkServiceId is a struct representing the Resource ID for a Private Link Service -type PrivateLinkServiceId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkServiceName string -} - -// NewPrivateLinkServiceID returns a new PrivateLinkServiceId struct -func NewPrivateLinkServiceID(subscriptionId string, resourceGroupName string, privateLinkServiceName string) PrivateLinkServiceId { - return PrivateLinkServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkServiceName: privateLinkServiceName, - } -} - -// ParsePrivateLinkServiceID parses 'input' into a PrivateLinkServiceId -func ParsePrivateLinkServiceID(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkServiceIDInsensitively parses 'input' case-insensitively into a PrivateLinkServiceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkServiceIDInsensitively(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkServiceId) 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.PrivateLinkServiceName, ok = input.Parsed["privateLinkServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkServiceName", input) - } - - return nil -} - -// ValidatePrivateLinkServiceID checks that 'input' can be parsed as a Private Link Service ID -func ValidatePrivateLinkServiceID(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 := ParsePrivateLinkServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Service ID -func (id PrivateLinkServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateLinkServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Service ID -func (id PrivateLinkServiceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceValue"), - } -} - -// String returns a human-readable description of this Private Link Service ID -func (id PrivateLinkServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Service Name: %q", id.PrivateLinkServiceName), - } - return fmt.Sprintf("Private Link Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice_test.go b/resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice_test.go deleted file mode 100644 index 89770988ce4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/id_privatelinkservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkservice - -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 = &PrivateLinkServiceId{} - -func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - - 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.PrivateLinkServiceName != "privateLinkServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceValue") - } -} - -func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceID(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEvAlUe", - }, - }, - { - // 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.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceIDInsensitively(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestSegmentsForPrivateLinkServiceId(t *testing.T) { - segments := PrivateLinkServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkServiceId 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/network/2023-05-01/privatelinkservice/method_createorupdate.go b/resource-manager/network/2023-05-01/privatelinkservice/method_createorupdate.go deleted file mode 100644 index 6025cc20fb9..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatelinkservice - -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 *PrivateLinkService -} - -// CreateOrUpdate ... -func (c PrivateLinkServiceClient) CreateOrUpdate(ctx context.Context, id PrivateLinkServiceId, input PrivateLinkService) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateLinkServiceClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateLinkServiceId, input PrivateLinkService) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 37bf309268d..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 727bb2c29ae..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index ce6b69f5f1c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 8eb6892414c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 08c65321f9b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygroup.go deleted file mode 100644 index 65af972a908..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 7053e6085f8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspool.go b/resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspool.go deleted file mode 100644 index 4605353c0e8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index dad3a1cbb7e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 64fa8c44b23..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_ddossettings.go b/resource-manager/network/2023-05-01/privatelinkservice/model_ddossettings.go deleted file mode 100644 index 5e258a59dcf..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_delegation.go b/resource-manager/network/2023-05-01/privatelinkservice/model_delegation.go deleted file mode 100644 index 38895e795b0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_flowlog.go b/resource-manager/network/2023-05-01/privatelinkservice/model_flowlog.go deleted file mode 100644 index 368d825fd7e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/privatelinkservice/model_flowlogformatparameters.go deleted file mode 100644 index 75ef563d7b2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_flowlogpropertiesformat.go deleted file mode 100644 index 47d0ad02b7b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfiguration.go deleted file mode 100644 index b2284248cab..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservice - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index e2ab5bed55b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index b0e2ec4fe5b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrule.go b/resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrule.go deleted file mode 100644 index 68fa8ece3f2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index a54a17cf8a7..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfiguration.go deleted file mode 100644 index dd6a48d0e5b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofile.go deleted file mode 100644 index 5e226d14d4d..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 554fee929b4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 62a93ec4c44..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_iptag.go b/resource-manager/network/2023-05-01/privatelinkservice/model_iptag.go deleted file mode 100644 index 7131a53eded..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// 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/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddress.go deleted file mode 100644 index 6ce64f5f2e6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 9abe2a4572f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_natgateway.go b/resource-manager/network/2023-05-01/privatelinkservice/model_natgateway.go deleted file mode 100644 index f9980bf5e6c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package privatelinkservice - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7d3be08b309..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaysku.go b/resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaysku.go deleted file mode 100644 index a7a67521076..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_natruleportmapping.go b/resource-manager/network/2023-05-01/privatelinkservice/model_natruleportmapping.go deleted file mode 100644 index 1c0a32d9e67..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterface.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterface.go deleted file mode 100644 index 4df820c2913..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacednssettings.go deleted file mode 100644 index 16bd0705ad7..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 48b4f130f1a..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index b649c26692b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 0f1de88a39a..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 79f71ee5063..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 3e58e2268a1..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d9c267e2c48..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygroup.go deleted file mode 100644 index bc7b4758c7c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 6a30ce3d224..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpoint.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpoint.go deleted file mode 100644 index 60ed6db0b7b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnection.go deleted file mode 100644 index 6564f05bf19..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/privatelinkservice/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8cdbcae827f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfiguration.go deleted file mode 100644 index f4a1b24ff36..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 14abbc46b00..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointproperties.go deleted file mode 100644 index ca2dc587f19..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkservice.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkservice.go deleted file mode 100644 index 84ab357bba4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnection.go deleted file mode 100644 index 0ab35853be3..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index bc13ca31ec4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index b11296ec55c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 06cf43e9c19..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index e9a6be5f6ba..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceproperties.go deleted file mode 100644 index d23a2b93b7d..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddress.go b/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddress.go deleted file mode 100644 index 10ad261e57f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddressdnssettings.go deleted file mode 100644 index b2e6f22b6be..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 4597323a4ee..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresssku.go deleted file mode 100644 index 17a772dc295..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlink.go deleted file mode 100644 index 04005314e56..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlinkformat.go deleted file mode 100644 index db56f8f9a50..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_resourceset.go b/resource-manager/network/2023-05-01/privatelinkservice/model_resourceset.go deleted file mode 100644 index 8244a36994e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/privatelinkservice/model_retentionpolicyparameters.go deleted file mode 100644 index a0d81108fdc..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_route.go b/resource-manager/network/2023-05-01/privatelinkservice/model_route.go deleted file mode 100644 index 7d46047e973..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_routepropertiesformat.go deleted file mode 100644 index 55a0f3dc715..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_routetable.go b/resource-manager/network/2023-05-01/privatelinkservice/model_routetable.go deleted file mode 100644 index 11ada0b3ad6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_routetablepropertiesformat.go deleted file mode 100644 index 9231c6ea535..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_securityrule.go b/resource-manager/network/2023-05-01/privatelinkservice/model_securityrule.go deleted file mode 100644 index a6fef4ca3ef..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_securityrulepropertiesformat.go deleted file mode 100644 index 141c746c9fc..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlink.go deleted file mode 100644 index 6d4f38c281f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 6e34df786f4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_servicedelegationpropertiesformat.go deleted file mode 100644 index df4acacdfe6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicy.go deleted file mode 100644 index 164ba053a63..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinition.go deleted file mode 100644 index b85a151c4ba..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 3357b4cc130..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 8094ad8968c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 8278551c833..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_subnet.go b/resource-manager/network/2023-05-01/privatelinkservice/model_subnet.go deleted file mode 100644 index 53bbcfc93b9..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_subnetpropertiesformat.go deleted file mode 100644 index a5f3a3fa88c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_subresource.go b/resource-manager/network/2023-05-01/privatelinkservice/model_subresource.go deleted file mode 100644 index 2295e457c86..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 04a2870aab9..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsproperties.go deleted file mode 100644 index 14cea562579..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktap.go deleted file mode 100644 index 75924e524e2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 0425352fa06..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservice/version.go b/resource-manager/network/2023-05-01/privatelinkservice/version.go deleted file mode 100644 index ce0d11bfbb4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservice/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservice/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/README.md b/resource-manager/network/2023-05-01/privatelinkservices/README.md deleted file mode 100644 index ea350e56d27..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/README.md +++ /dev/null @@ -1,217 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/privatelinkservices` Documentation - -The `privatelinkservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/privatelinkservices" -``` - - -### Client Initialization - -```go -client := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility` - -```go -ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ - // ... -} - - -if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup` - -```go -ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ - // ... -} - - -if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.Delete` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.DeletePrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.Get` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkServicesClient.GetPrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkServicesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices` - -```go -ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination -items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup` - -```go -ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListPrivateEndpointConnections` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -// alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination -items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.UpdatePrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -payload := privatelinkservices.PrivateEndpointConnection{ - // ... -} - - -read, err := client.UpdatePrivateEndpointConnection(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/network/2023-05-01/privatelinkservices/client.go b/resource-manager/network/2023-05-01/privatelinkservices/client.go deleted file mode 100644 index 5bd46867c3e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkservices - -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 PrivateLinkServicesClient struct { - Client *resourcemanager.Client -} - -func NewPrivateLinkServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatelinkservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkServicesClient: %+v", err) - } - - return &PrivateLinkServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/constants.go b/resource-manager/network/2023-05-01/privatelinkservices/constants.go deleted file mode 100644 index 2205983377c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privatelinkservices - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/id_location.go b/resource-manager/network/2023-05-01/privatelinkservices/id_location.go deleted file mode 100644 index 34e4ed80520..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package privatelinkservices - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/privatelinkservices/id_location_test.go b/resource-manager/network/2023-05-01/privatelinkservices/id_location_test.go deleted file mode 100644 index e5a86e22039..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package privatelinkservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2023-05-01/privatelinkservices/id_privateendpointconnection.go deleted file mode 100644 index 3f98898492d..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_privateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package privatelinkservices - -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 - PrivateLinkServiceName string - PrivateEndpointConnectionName string -} - -// NewPrivateEndpointConnectionID returns a new PrivateEndpointConnectionId struct -func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, privateLinkServiceName string, privateEndpointConnectionName string) PrivateEndpointConnectionId { - return PrivateEndpointConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkServiceName: privateLinkServiceName, - 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.PrivateLinkServiceName, ok = input.Parsed["privateLinkServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkServiceName", 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.Network/privateLinkServices/%s/privateEndpointConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkServiceName, 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// 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("Private Link Service Name: %q", id.PrivateLinkServiceName), - 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/network/2023-05-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2023-05-01/privatelinkservices/id_privateendpointconnection_test.go deleted file mode 100644 index b5b92fb48d2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_privateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package privatelinkservices - -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", "privateLinkServiceValue", "privateEndpointConnectionValue") - - 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.PrivateLinkServiceName != "privateLinkServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue/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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - 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/network/2023-05-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice.go deleted file mode 100644 index d88a974cca5..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkservices - -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(&PrivateLinkServiceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkServiceId{} - -// PrivateLinkServiceId is a struct representing the Resource ID for a Private Link Service -type PrivateLinkServiceId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkServiceName string -} - -// NewPrivateLinkServiceID returns a new PrivateLinkServiceId struct -func NewPrivateLinkServiceID(subscriptionId string, resourceGroupName string, privateLinkServiceName string) PrivateLinkServiceId { - return PrivateLinkServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkServiceName: privateLinkServiceName, - } -} - -// ParsePrivateLinkServiceID parses 'input' into a PrivateLinkServiceId -func ParsePrivateLinkServiceID(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkServiceIDInsensitively parses 'input' case-insensitively into a PrivateLinkServiceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkServiceIDInsensitively(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkServiceId) 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.PrivateLinkServiceName, ok = input.Parsed["privateLinkServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkServiceName", input) - } - - return nil -} - -// ValidatePrivateLinkServiceID checks that 'input' can be parsed as a Private Link Service ID -func ValidatePrivateLinkServiceID(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 := ParsePrivateLinkServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Service ID -func (id PrivateLinkServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateLinkServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Service ID -func (id PrivateLinkServiceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceValue"), - } -} - -// String returns a human-readable description of this Private Link Service ID -func (id PrivateLinkServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Service Name: %q", id.PrivateLinkServiceName), - } - return fmt.Sprintf("Private Link Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice_test.go deleted file mode 100644 index 08f7741100b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_privatelinkservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkservices - -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 = &PrivateLinkServiceId{} - -func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - - 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.PrivateLinkServiceName != "privateLinkServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceValue") - } -} - -func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceID(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEvAlUe", - }, - }, - { - // 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.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceIDInsensitively(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestSegmentsForPrivateLinkServiceId(t *testing.T) { - segments := PrivateLinkServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkServiceId 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/network/2023-05-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation.go deleted file mode 100644 index c7433defeb6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkservices - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation_test.go deleted file mode 100644 index 383f542a49f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkservices - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibility.go b/resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibility.go deleted file mode 100644 index 1e8a53a5ec7..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibility.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatelinkservices - -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 CheckPrivateLinkServiceVisibilityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkServiceVisibility -} - -// CheckPrivateLinkServiceVisibility ... -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, id LocationId, input CheckPrivateLinkServiceVisibilityRequest) (result CheckPrivateLinkServiceVisibilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkPrivateLinkServiceVisibility", 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 -} - -// CheckPrivateLinkServiceVisibilityThenPoll performs CheckPrivateLinkServiceVisibility then polls until it's completed -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityThenPoll(ctx context.Context, id LocationId, input CheckPrivateLinkServiceVisibilityRequest) error { - result, err := c.CheckPrivateLinkServiceVisibility(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CheckPrivateLinkServiceVisibility: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CheckPrivateLinkServiceVisibility: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go b/resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go deleted file mode 100644 index 22023c980d0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatelinkservices - -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 CheckPrivateLinkServiceVisibilityByResourceGroupOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkServiceVisibility -} - -// CheckPrivateLinkServiceVisibilityByResourceGroup ... -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, id ProviderLocationId, input CheckPrivateLinkServiceVisibilityRequest) (result CheckPrivateLinkServiceVisibilityByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkPrivateLinkServiceVisibility", 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 -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll performs CheckPrivateLinkServiceVisibilityByResourceGroup then polls until it's completed -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx context.Context, id ProviderLocationId, input CheckPrivateLinkServiceVisibilityRequest) error { - result, err := c.CheckPrivateLinkServiceVisibilityByResourceGroup(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CheckPrivateLinkServiceVisibilityByResourceGroup: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CheckPrivateLinkServiceVisibilityByResourceGroup: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_delete.go b/resource-manager/network/2023-05-01/privatelinkservices/method_delete.go deleted file mode 100644 index d518ac5aede..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatelinkservices - -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 PrivateLinkServicesClient) Delete(ctx context.Context, id PrivateLinkServiceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateLinkServicesClient) DeleteThenPoll(ctx context.Context, id PrivateLinkServiceId) 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/network/2023-05-01/privatelinkservices/method_deleteprivateendpointconnection.go b/resource-manager/network/2023-05-01/privatelinkservices/method_deleteprivateendpointconnection.go deleted file mode 100644 index 92593766f11..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_deleteprivateendpointconnection.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatelinkservices - -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 DeletePrivateEndpointConnectionOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeletePrivateEndpointConnection ... -func (c PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx context.Context, id PrivateEndpointConnectionId) (result DeletePrivateEndpointConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// DeletePrivateEndpointConnectionThenPoll performs DeletePrivateEndpointConnection then polls until it's completed -func (c PrivateLinkServicesClient) DeletePrivateEndpointConnectionThenPoll(ctx context.Context, id PrivateEndpointConnectionId) error { - result, err := c.DeletePrivateEndpointConnection(ctx, id) - if err != nil { - return fmt.Errorf("performing DeletePrivateEndpointConnection: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeletePrivateEndpointConnection: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_get.go b/resource-manager/network/2023-05-01/privatelinkservices/method_get.go deleted file mode 100644 index cdd893b10fe..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package privatelinkservices - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkService -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PrivateLinkServicesClient) Get(ctx context.Context, id PrivateLinkServiceId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PrivateLinkService - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_getprivateendpointconnection.go b/resource-manager/network/2023-05-01/privatelinkservices/method_getprivateendpointconnection.go deleted file mode 100644 index 1467bb48568..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_getprivateendpointconnection.go +++ /dev/null @@ -1,83 +0,0 @@ -package privatelinkservices - -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 GetPrivateEndpointConnectionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -type GetPrivateEndpointConnectionOperationOptions struct { - Expand *string -} - -func DefaultGetPrivateEndpointConnectionOperationOptions() GetPrivateEndpointConnectionOperationOptions { - return GetPrivateEndpointConnectionOperationOptions{} -} - -func (o GetPrivateEndpointConnectionOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetPrivateEndpointConnectionOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetPrivateEndpointConnectionOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetPrivateEndpointConnection ... -func (c PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, id PrivateEndpointConnectionId, options GetPrivateEndpointConnectionOperationOptions) (result GetPrivateEndpointConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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/network/2023-05-01/privatelinkservices/method_list.go b/resource-manager/network/2023-05-01/privatelinkservices/method_list.go deleted file mode 100644 index e258446dbf5..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package privatelinkservices - -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 *[]PrivateLinkService -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkService -} - -// List ... -func (c PrivateLinkServicesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateLinkServices", 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 *[]PrivateLinkService `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 PrivateLinkServicesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateLinkServiceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PrivateLinkServiceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateLinkService, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go b/resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go deleted file mode 100644 index a25a114717f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkservices - -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 ListAutoApprovedPrivateLinkServicesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AutoApprovedPrivateLinkService -} - -type ListAutoApprovedPrivateLinkServicesCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutoApprovedPrivateLinkService -} - -// ListAutoApprovedPrivateLinkServices ... -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServices(ctx context.Context, id LocationId) (result ListAutoApprovedPrivateLinkServicesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/autoApprovedPrivateLinkServices", 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 *[]AutoApprovedPrivateLinkService `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAutoApprovedPrivateLinkServicesComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesComplete(ctx context.Context, id LocationId) (ListAutoApprovedPrivateLinkServicesCompleteResult, error) { - return c.ListAutoApprovedPrivateLinkServicesCompleteMatchingPredicate(ctx, id, AutoApprovedPrivateLinkServiceOperationPredicate{}) -} - -// ListAutoApprovedPrivateLinkServicesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AutoApprovedPrivateLinkServiceOperationPredicate) (result ListAutoApprovedPrivateLinkServicesCompleteResult, err error) { - items := make([]AutoApprovedPrivateLinkService, 0) - - resp, err := c.ListAutoApprovedPrivateLinkServices(ctx, id) - if err != nil { - 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 = ListAutoApprovedPrivateLinkServicesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go b/resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go deleted file mode 100644 index 9db61484b7e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkservices - -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 ListAutoApprovedPrivateLinkServicesByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AutoApprovedPrivateLinkService -} - -type ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutoApprovedPrivateLinkService -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroup ... -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx context.Context, id ProviderLocationId) (result ListAutoApprovedPrivateLinkServicesByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/autoApprovedPrivateLinkServices", 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 *[]AutoApprovedPrivateLinkService `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx context.Context, id ProviderLocationId) (ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult, error) { - return c.ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteMatchingPredicate(ctx, id, AutoApprovedPrivateLinkServiceOperationPredicate{}) -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AutoApprovedPrivateLinkServiceOperationPredicate) (result ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult, err error) { - items := make([]AutoApprovedPrivateLinkService, 0) - - resp, err := c.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id) - if err != nil { - 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 = ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_listbysubscription.go b/resource-manager/network/2023-05-01/privatelinkservices/method_listbysubscription.go deleted file mode 100644 index a8246d5321d..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package privatelinkservices - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkService -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkService -} - -// ListBySubscription ... -func (c PrivateLinkServicesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateLinkServices", 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 *[]PrivateLinkService `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, PrivateLinkServiceOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PrivateLinkServiceOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]PrivateLinkService, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_listprivateendpointconnections.go b/resource-manager/network/2023-05-01/privatelinkservices/method_listprivateendpointconnections.go deleted file mode 100644 index 1e1fc8095b0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_listprivateendpointconnections.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkservices - -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 ListPrivateEndpointConnectionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateEndpointConnection -} - -type ListPrivateEndpointConnectionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpointConnection -} - -// ListPrivateEndpointConnections ... -func (c PrivateLinkServicesClient) ListPrivateEndpointConnections(ctx context.Context, id PrivateLinkServiceId) (result ListPrivateEndpointConnectionsOperationResponse, 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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateEndpointConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListPrivateEndpointConnectionsComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, id PrivateLinkServiceId) (ListPrivateEndpointConnectionsCompleteResult, error) { - return c.ListPrivateEndpointConnectionsCompleteMatchingPredicate(ctx, id, PrivateEndpointConnectionOperationPredicate{}) -} - -// ListPrivateEndpointConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListPrivateEndpointConnectionsCompleteMatchingPredicate(ctx context.Context, id PrivateLinkServiceId, predicate PrivateEndpointConnectionOperationPredicate) (result ListPrivateEndpointConnectionsCompleteResult, err error) { - items := make([]PrivateEndpointConnection, 0) - - resp, err := c.ListPrivateEndpointConnections(ctx, id) - if err != nil { - 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 = ListPrivateEndpointConnectionsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/method_updateprivateendpointconnection.go b/resource-manager/network/2023-05-01/privatelinkservices/method_updateprivateendpointconnection.go deleted file mode 100644 index 90a383fd3a1..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/method_updateprivateendpointconnection.go +++ /dev/null @@ -1,58 +0,0 @@ -package privatelinkservices - -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 UpdatePrivateEndpointConnectionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// UpdatePrivateEndpointConnection ... -func (c PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) (result UpdatePrivateEndpointConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 PrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 6e064132ab8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 2b8b30f76cf..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 687ec802ef4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 23747316443..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index bc231fd9d60..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygroup.go deleted file mode 100644 index 102038ead97..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index b9a224260e0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_autoapprovedprivatelinkservice.go b/resource-manager/network/2023-05-01/privatelinkservices/model_autoapprovedprivatelinkservice.go deleted file mode 100644 index e8eb368b9fd..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_autoapprovedprivatelinkservice.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoApprovedPrivateLinkService struct { - PrivateLinkService *string `json:"privateLinkService,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspool.go b/resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspool.go deleted file mode 100644 index e621fc409e7..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 4fe2c6dad02..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go b/resource-manager/network/2023-05-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go deleted file mode 100644 index d338d570a52..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckPrivateLinkServiceVisibilityRequest struct { - PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 5bb831424b8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_ddossettings.go b/resource-manager/network/2023-05-01/privatelinkservices/model_ddossettings.go deleted file mode 100644 index a88f6af3346..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_delegation.go b/resource-manager/network/2023-05-01/privatelinkservices/model_delegation.go deleted file mode 100644 index 861d7dccc33..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_flowlog.go b/resource-manager/network/2023-05-01/privatelinkservices/model_flowlog.go deleted file mode 100644 index b57c99ff1b7..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/privatelinkservices/model_flowlogformatparameters.go deleted file mode 100644 index e5d4b9b0d2f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_flowlogpropertiesformat.go deleted file mode 100644 index 477b2ca2cb0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfiguration.go deleted file mode 100644 index c4908a4dc2b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservices - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 2a655d02dfc..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 57e817e63b2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrule.go b/resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrule.go deleted file mode 100644 index acd7d0aa709..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 8bf73e3faf8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfiguration.go deleted file mode 100644 index 3ad6065a48e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofile.go deleted file mode 100644 index 0b4a7cbc860..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index f1bae207cc2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 2852a27e2c3..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_iptag.go b/resource-manager/network/2023-05-01/privatelinkservices/model_iptag.go deleted file mode 100644 index a7e33392ad2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// 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/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddress.go deleted file mode 100644 index 09bc3c7f06c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index a567721ac6c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_natgateway.go b/resource-manager/network/2023-05-01/privatelinkservices/model_natgateway.go deleted file mode 100644 index 077d2bc5d5f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package privatelinkservices - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaypropertiesformat.go deleted file mode 100644 index 85150f10453..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaysku.go b/resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaysku.go deleted file mode 100644 index ceae4c33372..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_natruleportmapping.go b/resource-manager/network/2023-05-01/privatelinkservices/model_natruleportmapping.go deleted file mode 100644 index e081a336375..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterface.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterface.go deleted file mode 100644 index 6ac282778d7..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacednssettings.go deleted file mode 100644 index b7993919c62..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 766f136f852..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 4e4cefa66b4..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 82f5e6747c6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 1c2bfc6ae43..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 66b7aeeab62..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 307c8944af0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygroup.go deleted file mode 100644 index 1a2792e0f88..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 7990d29a1bb..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpoint.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpoint.go deleted file mode 100644 index d3a77eea754..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnection.go deleted file mode 100644 index bb755a70536..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/privatelinkservices/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnectionproperties.go deleted file mode 100644 index 5966a68df2a..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfiguration.go deleted file mode 100644 index 6327ca28ff1..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 5e70530aabf..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointproperties.go deleted file mode 100644 index 4d6d18b46a5..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservice.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservice.go deleted file mode 100644 index 4a672116bc2..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnection.go deleted file mode 100644 index eb5e26941fd..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index a991f868fe8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index f227e3d5e6c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index de38cfbbde6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index b1809f0d71c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceproperties.go deleted file mode 100644 index cc7c8cdc0f0..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservicevisibility.go b/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservicevisibility.go deleted file mode 100644 index 38f95ae51a1..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_privatelinkservicevisibility.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceVisibility struct { - Visible *bool `json:"visible,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddress.go b/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddress.go deleted file mode 100644 index cdcddd86935..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddressdnssettings.go deleted file mode 100644 index 268300edf0b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 2b9a811495b..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresssku.go deleted file mode 100644 index 80c5ef44ece..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlink.go deleted file mode 100644 index 68ad67e053e..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlinkformat.go deleted file mode 100644 index 57d6954d294..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_resourceset.go b/resource-manager/network/2023-05-01/privatelinkservices/model_resourceset.go deleted file mode 100644 index e923870d39f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/privatelinkservices/model_retentionpolicyparameters.go deleted file mode 100644 index 96f98884163..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_route.go b/resource-manager/network/2023-05-01/privatelinkservices/model_route.go deleted file mode 100644 index 901d0eadcc6..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_routepropertiesformat.go deleted file mode 100644 index 12088248968..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_routetable.go b/resource-manager/network/2023-05-01/privatelinkservices/model_routetable.go deleted file mode 100644 index 8afe228ccfd..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_routetablepropertiesformat.go deleted file mode 100644 index 6377cd08fd9..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_securityrule.go b/resource-manager/network/2023-05-01/privatelinkservices/model_securityrule.go deleted file mode 100644 index df53714a81c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_securityrulepropertiesformat.go deleted file mode 100644 index 52b151efed9..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlink.go deleted file mode 100644 index 5f9234cbb82..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 87f29c8ca65..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 2ad5375c2ca..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicy.go deleted file mode 100644 index c93c759f93a..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinition.go deleted file mode 100644 index d1116eb2a61..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 7f68e9513e3..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 5af6f94d80f..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 65b0e07a1a8..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_subnet.go b/resource-manager/network/2023-05-01/privatelinkservices/model_subnet.go deleted file mode 100644 index afb102ed10a..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_subnetpropertiesformat.go deleted file mode 100644 index 6112d434f77..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_subresource.go b/resource-manager/network/2023-05-01/privatelinkservices/model_subresource.go deleted file mode 100644 index b9dcdcf56bf..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index c500218a37c..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsproperties.go deleted file mode 100644 index b98eb28874d..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktap.go deleted file mode 100644 index 8dbee65a21a..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 4fb395dbc76..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/privatelinkservices/predicates.go b/resource-manager/network/2023-05-01/privatelinkservices/predicates.go deleted file mode 100644 index f7e18f9feee..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/predicates.go +++ /dev/null @@ -1,78 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoApprovedPrivateLinkServiceOperationPredicate struct { - PrivateLinkService *string -} - -func (p AutoApprovedPrivateLinkServiceOperationPredicate) Matches(input AutoApprovedPrivateLinkService) bool { - - if p.PrivateLinkService != nil && (input.PrivateLinkService == nil || *p.PrivateLinkService != *input.PrivateLinkService) { - return false - } - - return true -} - -type PrivateEndpointConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p PrivateEndpointConnectionOperationPredicate) Matches(input PrivateEndpointConnection) 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.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 PrivateLinkServiceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PrivateLinkServiceOperationPredicate) Matches(input PrivateLinkService) 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 && (input.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/network/2023-05-01/privatelinkservices/version.go b/resource-manager/network/2023-05-01/privatelinkservices/version.go deleted file mode 100644 index 8e6a9af3ece..00000000000 --- a/resource-manager/network/2023-05-01/privatelinkservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservices/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/README.md b/resource-manager/network/2023-05-01/publicipaddresses/README.md deleted file mode 100644 index c995d063b44..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/README.md +++ /dev/null @@ -1,133 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/publicipaddresses` Documentation - -The `publicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/publicipaddresses" -``` - - -### Client Initialization - -```go -client := publicipaddresses.NewPublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPAddressesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -payload := publicipaddresses.PublicIPAddress{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.DdosProtectionStatus` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPAddressesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PublicIPAddressesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPAddressesClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -payload := publicipaddresses.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/network/2023-05-01/publicipaddresses/client.go b/resource-manager/network/2023-05-01/publicipaddresses/client.go deleted file mode 100644 index 4c28c537385..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicipaddresses - -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 PublicIPAddressesClient struct { - Client *resourcemanager.Client -} - -func NewPublicIPAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*PublicIPAddressesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publicipaddresses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublicIPAddressesClient: %+v", err) - } - - return &PublicIPAddressesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/constants.go b/resource-manager/network/2023-05-01/publicipaddresses/constants.go deleted file mode 100644 index aae5236ba68..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/constants.go +++ /dev/null @@ -1,1192 +0,0 @@ -package publicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IsWorkloadProtected string - -const ( - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -func PossibleValuesForIsWorkloadProtected() []string { - return []string{ - string(IsWorkloadProtectedFalse), - string(IsWorkloadProtectedTrue), - } -} - -func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsWorkloadProtected(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { - vals := map[string]IsWorkloadProtected{ - "false": IsWorkloadProtectedFalse, - "true": IsWorkloadProtectedTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsWorkloadProtected(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/method_createorupdate.go b/resource-manager/network/2023-05-01/publicipaddresses/method_createorupdate.go deleted file mode 100644 index fca7faa2130..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package publicipaddresses - -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 *PublicIPAddress -} - -// CreateOrUpdate ... -func (c PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, id commonids.PublicIPAddressId, input PublicIPAddress) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PublicIPAddressesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.PublicIPAddressId, input PublicIPAddress) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/publicipaddresses/method_ddosprotectionstatus.go b/resource-manager/network/2023-05-01/publicipaddresses/method_ddosprotectionstatus.go deleted file mode 100644 index 29e07596f6d..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_ddosprotectionstatus.go +++ /dev/null @@ -1,72 +0,0 @@ -package publicipaddresses - -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 DdosProtectionStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPDdosProtectionStatusResult -} - -// DdosProtectionStatus ... -func (c PublicIPAddressesClient) DdosProtectionStatus(ctx context.Context, id commonids.PublicIPAddressId) (result DdosProtectionStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ddosProtectionStatus", 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 -} - -// DdosProtectionStatusThenPoll performs DdosProtectionStatus then polls until it's completed -func (c PublicIPAddressesClient) DdosProtectionStatusThenPoll(ctx context.Context, id commonids.PublicIPAddressId) error { - result, err := c.DdosProtectionStatus(ctx, id) - if err != nil { - return fmt.Errorf("performing DdosProtectionStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DdosProtectionStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/method_delete.go b/resource-manager/network/2023-05-01/publicipaddresses/method_delete.go deleted file mode 100644 index 20c57a22e75..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package publicipaddresses - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c PublicIPAddressesClient) Delete(ctx context.Context, id commonids.PublicIPAddressId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PublicIPAddressesClient) DeleteThenPoll(ctx context.Context, id commonids.PublicIPAddressId) 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/network/2023-05-01/publicipaddresses/method_get.go b/resource-manager/network/2023-05-01/publicipaddresses/method_get.go deleted file mode 100644 index c5f5e5e145e..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package publicipaddresses - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PublicIPAddressesClient) Get(ctx context.Context, id commonids.PublicIPAddressId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/method_list.go b/resource-manager/network/2023-05-01/publicipaddresses/method_list.go deleted file mode 100644 index ad31b8ef636..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipaddresses - -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 *[]PublicIPAddress -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// List ... -func (c PublicIPAddressesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPAddresses", 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 *[]PublicIPAddress `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 PublicIPAddressesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPAddressesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PublicIPAddressOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/publicipaddresses/method_listall.go b/resource-manager/network/2023-05-01/publicipaddresses/method_listall.go deleted file mode 100644 index fb51d348c10..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipaddresses - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// ListAll ... -func (c PublicIPAddressesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c PublicIPAddressesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPAddressesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PublicIPAddressOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/method_updatetags.go b/resource-manager/network/2023-05-01/publicipaddresses/method_updatetags.go deleted file mode 100644 index 55be79fcfce..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/method_updatetags.go +++ /dev/null @@ -1,59 +0,0 @@ -package publicipaddresses - -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 UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -// UpdateTags ... -func (c PublicIPAddressesClient) UpdateTags(ctx context.Context, id commonids.PublicIPAddressId, 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddress.go deleted file mode 100644 index d89d17bbae7..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 433f6b69df9..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 14750d210a4..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 33311f968a8..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 69ba272007f..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygroup.go deleted file mode 100644 index 7ab7c1cc362..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 3de744e7bae..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspool.go b/resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspool.go deleted file mode 100644 index c693d24a91b..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index b4b3a346a35..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 2bbec7ab523..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_ddossettings.go b/resource-manager/network/2023-05-01/publicipaddresses/model_ddossettings.go deleted file mode 100644 index 360538854a2..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_delegation.go b/resource-manager/network/2023-05-01/publicipaddresses/model_delegation.go deleted file mode 100644 index 1036beaaf72..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_flowlog.go b/resource-manager/network/2023-05-01/publicipaddresses/model_flowlog.go deleted file mode 100644 index 3ab56bececf..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/publicipaddresses/model_flowlogformatparameters.go deleted file mode 100644 index 28da49ecc43..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_flowlogpropertiesformat.go deleted file mode 100644 index 6690c7ec880..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfiguration.go deleted file mode 100644 index 72aec2b5437..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipaddresses - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 2d86f96cffb..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 9d2c813c821..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrule.go b/resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrule.go deleted file mode 100644 index bd6a9711828..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 320809245cf..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfiguration.go deleted file mode 100644 index 398840974cd..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofile.go deleted file mode 100644 index 1bf1de27441..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1523f28e63d..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index bb4f647f729..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_iptag.go b/resource-manager/network/2023-05-01/publicipaddresses/model_iptag.go deleted file mode 100644 index 7ea58148bb2..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// 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/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddress.go deleted file mode 100644 index e427662f2a6..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 349c22b64f5..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_natgateway.go b/resource-manager/network/2023-05-01/publicipaddresses/model_natgateway.go deleted file mode 100644 index fc10c7874b7..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package publicipaddresses - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaypropertiesformat.go deleted file mode 100644 index 3a740fb997b..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaysku.go b/resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaysku.go deleted file mode 100644 index 764ce1ec4aa..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_natruleportmapping.go b/resource-manager/network/2023-05-01/publicipaddresses/model_natruleportmapping.go deleted file mode 100644 index 8c9fe6cf53d..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterface.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterface.go deleted file mode 100644 index 5297e480153..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacednssettings.go deleted file mode 100644 index b5db798efaa..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 9840f48b636..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 7815eb1f03a..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index d4350e06603..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index b50c25d8086..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 060a9d5285a..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d229b2dfb8d..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygroup.go deleted file mode 100644 index 485cb7f8e07..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 8fef2ca403a..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpoint.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpoint.go deleted file mode 100644 index dd63348ae6f..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnection.go deleted file mode 100644 index b449098f79d..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/publicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8a20b5b22e7..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfiguration.go deleted file mode 100644 index e75d758ed00..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 42574e02e61..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointproperties.go deleted file mode 100644 index a0108e9c621..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkservice.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkservice.go deleted file mode 100644 index b4d87fc1513..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnection.go deleted file mode 100644 index 2039fef8e1a..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 37f23eb3b44..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index ee170e64109..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 8dce57f93b6..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 17839c3231f..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceproperties.go deleted file mode 100644 index 7307dfa6a24..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddress.go b/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddress.go deleted file mode 100644 index 6be86648487..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 19bd5c73bdd..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 90c1d772012..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresssku.go deleted file mode 100644 index af0178060c9..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipddosprotectionstatusresult.go b/resource-manager/network/2023-05-01/publicipaddresses/model_publicipddosprotectionstatusresult.go deleted file mode 100644 index dbf51354f05..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_publicipddosprotectionstatusresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPDdosProtectionStatusResult struct { - DdosProtectionPlanId *string `json:"ddosProtectionPlanId,omitempty"` - IsWorkloadProtected *IsWorkloadProtected `json:"isWorkloadProtected,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - PublicIPAddressId *string `json:"publicIpAddressId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlink.go deleted file mode 100644 index 8df0e65c796..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlinkformat.go deleted file mode 100644 index 912dad5e9b9..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_resourceset.go b/resource-manager/network/2023-05-01/publicipaddresses/model_resourceset.go deleted file mode 100644 index eb4ec2e13c4..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/publicipaddresses/model_retentionpolicyparameters.go deleted file mode 100644 index 57e746e6800..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_route.go b/resource-manager/network/2023-05-01/publicipaddresses/model_route.go deleted file mode 100644 index 6aaf9130e49..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_routepropertiesformat.go deleted file mode 100644 index 19e40f46ddb..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_routetable.go b/resource-manager/network/2023-05-01/publicipaddresses/model_routetable.go deleted file mode 100644 index eed83ddcb84..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_routetablepropertiesformat.go deleted file mode 100644 index f408090b5c7..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_securityrule.go b/resource-manager/network/2023-05-01/publicipaddresses/model_securityrule.go deleted file mode 100644 index 056a5506bcc..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index e076569ccb4..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlink.go deleted file mode 100644 index 80405186b49..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index e0afefd43a1..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_servicedelegationpropertiesformat.go deleted file mode 100644 index dfdf08665d4..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicy.go deleted file mode 100644 index 2937667f2df..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinition.go deleted file mode 100644 index a5c2fb10189..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 6eae5a09363..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 77840b5f2bd..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 8d53fbdcd1e..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_subnet.go b/resource-manager/network/2023-05-01/publicipaddresses/model_subnet.go deleted file mode 100644 index 4dc6901bd98..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index f96631900c6..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_subresource.go b/resource-manager/network/2023-05-01/publicipaddresses/model_subresource.go deleted file mode 100644 index f4a7d6a3248..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_tagsobject.go b/resource-manager/network/2023-05-01/publicipaddresses/model_tagsobject.go deleted file mode 100644 index 717ed6f5d3d..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// 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/network/2023-05-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index f3cbae91cdc..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsproperties.go deleted file mode 100644 index 4e34016e12e..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktap.go deleted file mode 100644 index b4791998c22..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 4f32bce3226..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipaddresses/predicates.go b/resource-manager/network/2023-05-01/publicipaddresses/predicates.go deleted file mode 100644 index 07d29ffa733..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPAddressOperationPredicate) Matches(input PublicIPAddress) 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 && (input.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/network/2023-05-01/publicipaddresses/version.go b/resource-manager/network/2023-05-01/publicipaddresses/version.go deleted file mode 100644 index 3d6cef96440..00000000000 --- a/resource-manager/network/2023-05-01/publicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/README.md b/resource-manager/network/2023-05-01/publicipprefixes/README.md deleted file mode 100644 index 866fcafbaad..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/publicipprefixes` Documentation - -The `publicipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/publicipprefixes" -``` - - -### Client Initialization - -```go -client := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -payload := publicipprefixes.PublicIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PublicIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -payload := publicipprefixes.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/network/2023-05-01/publicipprefixes/client.go b/resource-manager/network/2023-05-01/publicipprefixes/client.go deleted file mode 100644 index 7dfe8ac9af1..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicipprefixes - -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 PublicIPPrefixesClient struct { - Client *resourcemanager.Client -} - -func NewPublicIPPrefixesClientWithBaseURI(sdkApi sdkEnv.Api) (*PublicIPPrefixesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publicipprefixes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublicIPPrefixesClient: %+v", err) - } - - return &PublicIPPrefixesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/constants.go b/resource-manager/network/2023-05-01/publicipprefixes/constants.go deleted file mode 100644 index a8c1328b07b..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/constants.go +++ /dev/null @@ -1,215 +0,0 @@ -package publicipprefixes - -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 IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPPrefixSkuName string - -const ( - PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" -) - -func PossibleValuesForPublicIPPrefixSkuName() []string { - return []string{ - string(PublicIPPrefixSkuNameStandard), - } -} - -func (s *PublicIPPrefixSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPPrefixSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPPrefixSkuName(input string) (*PublicIPPrefixSkuName, error) { - vals := map[string]PublicIPPrefixSkuName{ - "standard": PublicIPPrefixSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPPrefixSkuName(input) - return &out, nil -} - -type PublicIPPrefixSkuTier string - -const ( - PublicIPPrefixSkuTierGlobal PublicIPPrefixSkuTier = "Global" - PublicIPPrefixSkuTierRegional PublicIPPrefixSkuTier = "Regional" -) - -func PossibleValuesForPublicIPPrefixSkuTier() []string { - return []string{ - string(PublicIPPrefixSkuTierGlobal), - string(PublicIPPrefixSkuTierRegional), - } -} - -func (s *PublicIPPrefixSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPPrefixSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPPrefixSkuTier(input string) (*PublicIPPrefixSkuTier, error) { - vals := map[string]PublicIPPrefixSkuTier{ - "global": PublicIPPrefixSkuTierGlobal, - "regional": PublicIPPrefixSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPPrefixSkuTier(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix.go deleted file mode 100644 index 2fe61b6d66b..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix.go +++ /dev/null @@ -1,130 +0,0 @@ -package publicipprefixes - -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(&PublicIPPrefixId{}) -} - -var _ resourceids.ResourceId = &PublicIPPrefixId{} - -// PublicIPPrefixId is a struct representing the Resource ID for a Public I P Prefix -type PublicIPPrefixId struct { - SubscriptionId string - ResourceGroupName string - PublicIPPrefixName string -} - -// NewPublicIPPrefixID returns a new PublicIPPrefixId struct -func NewPublicIPPrefixID(subscriptionId string, resourceGroupName string, publicIPPrefixName string) PublicIPPrefixId { - return PublicIPPrefixId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PublicIPPrefixName: publicIPPrefixName, - } -} - -// ParsePublicIPPrefixID parses 'input' into a PublicIPPrefixId -func ParsePublicIPPrefixID(input string) (*PublicIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicIPPrefixId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublicIPPrefixIDInsensitively parses 'input' case-insensitively into a PublicIPPrefixId -// note: this method should only be used for API response data and not user input -func ParsePublicIPPrefixIDInsensitively(input string) (*PublicIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicIPPrefixId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublicIPPrefixId) 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.PublicIPPrefixName, ok = input.Parsed["publicIPPrefixName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publicIPPrefixName", input) - } - - return nil -} - -// ValidatePublicIPPrefixID checks that 'input' can be parsed as a Public I P Prefix ID -func ValidatePublicIPPrefixID(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 := ParsePublicIPPrefixID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Public I P Prefix ID -func (id PublicIPPrefixId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPPrefixes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PublicIPPrefixName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Public I P Prefix ID -func (id PublicIPPrefixId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixValue"), - } -} - -// String returns a human-readable description of this Public I P Prefix ID -func (id PublicIPPrefixId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Public I P Prefix Name: %q", id.PublicIPPrefixName), - } - return fmt.Sprintf("Public I P Prefix (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix_test.go deleted file mode 100644 index 6ec1cd54e2b..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/id_publicipprefix_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package publicipprefixes - -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 = &PublicIPPrefixId{} - -func TestNewPublicIPPrefixID(t *testing.T) { - id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - - 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.PublicIPPrefixName != "publicIPPrefixValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIPPrefixValue") - } -} - -func TestFormatPublicIPPrefixID(t *testing.T) { - actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublicIPPrefixID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublicIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue", - Expected: &PublicIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublicIPPrefixID(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.PublicIPPrefixName != v.Expected.PublicIPPrefixName { - t.Fatalf("Expected %q but got %q for PublicIPPrefixName", v.Expected.PublicIPPrefixName, actual.PublicIPPrefixName) - } - - } -} - -func TestParsePublicIPPrefixIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublicIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pUbLiCiPpReFiXeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue", - Expected: &PublicIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pUbLiCiPpReFiXeS/pUbLiCiPpReFiXvAlUe", - Expected: &PublicIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PublicIPPrefixName: "pUbLiCiPpReFiXvAlUe", - }, - }, - { - // 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.nEtWoRk/pUbLiCiPpReFiXeS/pUbLiCiPpReFiXvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublicIPPrefixIDInsensitively(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.PublicIPPrefixName != v.Expected.PublicIPPrefixName { - t.Fatalf("Expected %q but got %q for PublicIPPrefixName", v.Expected.PublicIPPrefixName, actual.PublicIPPrefixName) - } - - } -} - -func TestSegmentsForPublicIPPrefixId(t *testing.T) { - segments := PublicIPPrefixId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublicIPPrefixId 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/network/2023-05-01/publicipprefixes/method_createorupdate.go b/resource-manager/network/2023-05-01/publicipprefixes/method_createorupdate.go deleted file mode 100644 index eb586e03d6c..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package publicipprefixes - -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 *PublicIPPrefix -} - -// CreateOrUpdate ... -func (c PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, id PublicIPPrefixId, input PublicIPPrefix) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PublicIPPrefixesClient) CreateOrUpdateThenPoll(ctx context.Context, id PublicIPPrefixId, input PublicIPPrefix) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/publicipprefixes/method_delete.go b/resource-manager/network/2023-05-01/publicipprefixes/method_delete.go deleted file mode 100644 index 4ef74511d04..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package publicipprefixes - -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 PublicIPPrefixesClient) Delete(ctx context.Context, id PublicIPPrefixId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PublicIPPrefixesClient) DeleteThenPoll(ctx context.Context, id PublicIPPrefixId) 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/network/2023-05-01/publicipprefixes/method_get.go b/resource-manager/network/2023-05-01/publicipprefixes/method_get.go deleted file mode 100644 index 099ab527016..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package publicipprefixes - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPPrefix -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PublicIPPrefixesClient) Get(ctx context.Context, id PublicIPPrefixId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/method_list.go b/resource-manager/network/2023-05-01/publicipprefixes/method_list.go deleted file mode 100644 index e54a46b7839..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipprefixes - -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 *[]PublicIPPrefix -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPPrefix -} - -// List ... -func (c PublicIPPrefixesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPPrefixes", 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 *[]PublicIPPrefix `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 PublicIPPrefixesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PublicIPPrefixOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPPrefixesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PublicIPPrefixOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PublicIPPrefix, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/publicipprefixes/method_listall.go b/resource-manager/network/2023-05-01/publicipprefixes/method_listall.go deleted file mode 100644 index eeeab7a1981..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipprefixes - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPPrefix -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPPrefix -} - -// ListAll ... -func (c PublicIPPrefixesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPPrefixes", 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 *[]PublicIPPrefix `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c PublicIPPrefixesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, PublicIPPrefixOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPPrefixesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PublicIPPrefixOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]PublicIPPrefix, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/method_updatetags.go b/resource-manager/network/2023-05-01/publicipprefixes/method_updatetags.go deleted file mode 100644 index e5257fc9717..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package publicipprefixes - -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 *PublicIPPrefix -} - -// UpdateTags ... -func (c PublicIPPrefixesClient) UpdateTags(ctx context.Context, id PublicIPPrefixId, 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 PublicIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_iptag.go b/resource-manager/network/2023-05-01/publicipprefixes/model_iptag.go deleted file mode 100644 index e1bbbc73a6e..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipprefixes - -// 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/network/2023-05-01/publicipprefixes/model_natgateway.go b/resource-manager/network/2023-05-01/publicipprefixes/model_natgateway.go deleted file mode 100644 index 170eeff6848..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package publicipprefixes - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaypropertiesformat.go deleted file mode 100644 index 5c1f46d3737..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaysku.go b/resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaysku.go deleted file mode 100644 index 465e471e903..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefix.go b/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefix.go deleted file mode 100644 index 6679bada47d..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefix.go +++ /dev/null @@ -1,22 +0,0 @@ -package publicipprefixes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPPrefix struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPPrefixSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixpropertiesformat.go b/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixpropertiesformat.go deleted file mode 100644 index 32b58a818b3..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixpropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixPropertiesFormat struct { - CustomIPPrefix *SubResource `json:"customIPPrefix,omitempty"` - IPPrefix *string `json:"ipPrefix,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAddresses *[]ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixsku.go b/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixsku.go deleted file mode 100644 index 0737b92dee1..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_publicipprefixsku.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixSku struct { - Name *PublicIPPrefixSkuName `json:"name,omitempty"` - Tier *PublicIPPrefixSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_referencedpublicipaddress.go b/resource-manager/network/2023-05-01/publicipprefixes/model_referencedpublicipaddress.go deleted file mode 100644 index 26027a800a2..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_referencedpublicipaddress.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReferencedPublicIPAddress struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_subresource.go b/resource-manager/network/2023-05-01/publicipprefixes/model_subresource.go deleted file mode 100644 index 53e3c780cbf..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/publicipprefixes/model_tagsobject.go b/resource-manager/network/2023-05-01/publicipprefixes/model_tagsobject.go deleted file mode 100644 index 6a82f86f28f..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// 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/network/2023-05-01/publicipprefixes/predicates.go b/resource-manager/network/2023-05-01/publicipprefixes/predicates.go deleted file mode 100644 index 7deb3ca2bbf..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPPrefixOperationPredicate) Matches(input PublicIPPrefix) 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 && (input.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/network/2023-05-01/publicipprefixes/version.go b/resource-manager/network/2023-05-01/publicipprefixes/version.go deleted file mode 100644 index a0a9e376b64..00000000000 --- a/resource-manager/network/2023-05-01/publicipprefixes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipprefixes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicipprefixes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/README.md b/resource-manager/network/2023-05-01/routefilterrules/README.md deleted file mode 100644 index 02a0edee41f..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routefilterrules` Documentation - -The `routefilterrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/routefilterrules" -``` - - -### Client Initialization - -```go -client := routefilterrules.NewRouteFilterRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteFilterRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -payload := routefilterrules.RouteFilterRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFilterRulesClient.Delete` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFilterRulesClient.Get` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -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: `RouteFilterRulesClient.ListByRouteFilter` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -// alternatively `client.ListByRouteFilter(ctx, id)` can be used to do batched pagination -items, err := client.ListByRouteFilterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/routefilterrules/client.go b/resource-manager/network/2023-05-01/routefilterrules/client.go deleted file mode 100644 index 018917d75d9..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routefilterrules - -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 RouteFilterRulesClient struct { - Client *resourcemanager.Client -} - -func NewRouteFilterRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*RouteFilterRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routefilterrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RouteFilterRulesClient: %+v", err) - } - - return &RouteFilterRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/constants.go b/resource-manager/network/2023-05-01/routefilterrules/constants.go deleted file mode 100644 index cf65052c645..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/constants.go +++ /dev/null @@ -1,136 +0,0 @@ -package routefilterrules - -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 Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -func PossibleValuesForAccess() []string { - return []string{ - string(AccessAllow), - string(AccessDeny), - } -} - -func (s *Access) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccess(input string) (*Access, error) { - vals := map[string]Access{ - "allow": AccessAllow, - "deny": AccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Access(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RouteFilterRuleType string - -const ( - RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" -) - -func PossibleValuesForRouteFilterRuleType() []string { - return []string{ - string(RouteFilterRuleTypeCommunity), - } -} - -func (s *RouteFilterRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteFilterRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteFilterRuleType(input string) (*RouteFilterRuleType, error) { - vals := map[string]RouteFilterRuleType{ - "community": RouteFilterRuleTypeCommunity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteFilterRuleType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/id_routefilter.go b/resource-manager/network/2023-05-01/routefilterrules/id_routefilter.go deleted file mode 100644 index fc7b97a96ea..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/id_routefilter.go +++ /dev/null @@ -1,130 +0,0 @@ -package routefilterrules - -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(&RouteFilterId{}) -} - -var _ resourceids.ResourceId = &RouteFilterId{} - -// RouteFilterId is a struct representing the Resource ID for a Route Filter -type RouteFilterId struct { - SubscriptionId string - ResourceGroupName string - RouteFilterName string -} - -// NewRouteFilterID returns a new RouteFilterId struct -func NewRouteFilterID(subscriptionId string, resourceGroupName string, routeFilterName string) RouteFilterId { - return RouteFilterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteFilterName: routeFilterName, - } -} - -// ParseRouteFilterID parses 'input' into a RouteFilterId -func ParseRouteFilterID(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteFilterIDInsensitively parses 'input' case-insensitively into a RouteFilterId -// note: this method should only be used for API response data and not user input -func ParseRouteFilterIDInsensitively(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteFilterId) 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.RouteFilterName, ok = input.Parsed["routeFilterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterName", input) - } - - return nil -} - -// ValidateRouteFilterID checks that 'input' can be parsed as a Route Filter ID -func ValidateRouteFilterID(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 := ParseRouteFilterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Filter ID -func (id RouteFilterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeFilters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteFilterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Filter ID -func (id RouteFilterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), - resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterValue"), - } -} - -// String returns a human-readable description of this Route Filter ID -func (id RouteFilterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Filter Name: %q", id.RouteFilterName), - } - return fmt.Sprintf("Route Filter (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/id_routefilter_test.go b/resource-manager/network/2023-05-01/routefilterrules/id_routefilter_test.go deleted file mode 100644 index 50f5cbaeb48..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/id_routefilter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routefilterrules - -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 = &RouteFilterId{} - -func TestNewRouteFilterID(t *testing.T) { - id := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - - 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.RouteFilterName != "routeFilterValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterValue") - } -} - -func TestFormatRouteFilterID(t *testing.T) { - actual := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteFilterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterID(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestParseRouteFilterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteFilterName: "rOuTeFiLtErVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterIDInsensitively(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestSegmentsForRouteFilterId(t *testing.T) { - segments := RouteFilterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteFilterId 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/network/2023-05-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule.go deleted file mode 100644 index ef13326b0c4..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package routefilterrules - -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(&RouteFilterRuleId{}) -} - -var _ resourceids.ResourceId = &RouteFilterRuleId{} - -// RouteFilterRuleId is a struct representing the Resource ID for a Route Filter Rule -type RouteFilterRuleId struct { - SubscriptionId string - ResourceGroupName string - RouteFilterName string - RouteFilterRuleName string -} - -// NewRouteFilterRuleID returns a new RouteFilterRuleId struct -func NewRouteFilterRuleID(subscriptionId string, resourceGroupName string, routeFilterName string, routeFilterRuleName string) RouteFilterRuleId { - return RouteFilterRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteFilterName: routeFilterName, - RouteFilterRuleName: routeFilterRuleName, - } -} - -// ParseRouteFilterRuleID parses 'input' into a RouteFilterRuleId -func ParseRouteFilterRuleID(input string) (*RouteFilterRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteFilterRuleIDInsensitively parses 'input' case-insensitively into a RouteFilterRuleId -// note: this method should only be used for API response data and not user input -func ParseRouteFilterRuleIDInsensitively(input string) (*RouteFilterRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteFilterRuleId) 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.RouteFilterName, ok = input.Parsed["routeFilterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterName", input) - } - - if id.RouteFilterRuleName, ok = input.Parsed["routeFilterRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterRuleName", input) - } - - return nil -} - -// ValidateRouteFilterRuleID checks that 'input' can be parsed as a Route Filter Rule ID -func ValidateRouteFilterRuleID(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 := ParseRouteFilterRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Filter Rule ID -func (id RouteFilterRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeFilters/%s/routeFilterRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteFilterName, id.RouteFilterRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Filter Rule ID -func (id RouteFilterRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), - resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterValue"), - resourceids.StaticSegment("staticRouteFilterRules", "routeFilterRules", "routeFilterRules"), - resourceids.UserSpecifiedSegment("routeFilterRuleName", "routeFilterRuleValue"), - } -} - -// String returns a human-readable description of this Route Filter Rule ID -func (id RouteFilterRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Filter Name: %q", id.RouteFilterName), - fmt.Sprintf("Route Filter Rule Name: %q", id.RouteFilterRuleName), - } - return fmt.Sprintf("Route Filter Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule_test.go deleted file mode 100644 index 2df370136c3..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/id_routefilterrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package routefilterrules - -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 = &RouteFilterRuleId{} - -func TestNewRouteFilterRuleID(t *testing.T) { - id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - - 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.RouteFilterName != "routeFilterValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterValue") - } - - if id.RouteFilterRuleName != "routeFilterRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "routeFilterRuleValue") - } -} - -func TestFormatRouteFilterRuleID(t *testing.T) { - actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteFilterRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue", - Expected: &RouteFilterRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - RouteFilterRuleName: "routeFilterRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterRuleID(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - if actual.RouteFilterRuleName != v.Expected.RouteFilterRuleName { - t.Fatalf("Expected %q but got %q for RouteFilterRuleName", v.Expected.RouteFilterRuleName, actual.RouteFilterRuleName) - } - - } -} - -func TestParseRouteFilterRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/rOuTeFiLtErRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue", - Expected: &RouteFilterRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - RouteFilterRuleName: "routeFilterRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeVaLuE", - Expected: &RouteFilterRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteFilterName: "rOuTeFiLtErVaLuE", - RouteFilterRuleName: "rOuTeFiLtErRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterRuleIDInsensitively(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - if actual.RouteFilterRuleName != v.Expected.RouteFilterRuleName { - t.Fatalf("Expected %q but got %q for RouteFilterRuleName", v.Expected.RouteFilterRuleName, actual.RouteFilterRuleName) - } - - } -} - -func TestSegmentsForRouteFilterRuleId(t *testing.T) { - segments := RouteFilterRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteFilterRuleId 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/network/2023-05-01/routefilterrules/method_createorupdate.go b/resource-manager/network/2023-05-01/routefilterrules/method_createorupdate.go deleted file mode 100644 index 6e1717e3fce..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routefilterrules - -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 *RouteFilterRule -} - -// CreateOrUpdate ... -func (c RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, id RouteFilterRuleId, input RouteFilterRule) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RouteFilterRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteFilterRuleId, input RouteFilterRule) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/routefilterrules/method_delete.go b/resource-manager/network/2023-05-01/routefilterrules/method_delete.go deleted file mode 100644 index bbac130984b..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routefilterrules - -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 RouteFilterRulesClient) Delete(ctx context.Context, id RouteFilterRuleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RouteFilterRulesClient) DeleteThenPoll(ctx context.Context, id RouteFilterRuleId) 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/network/2023-05-01/routefilterrules/method_get.go b/resource-manager/network/2023-05-01/routefilterrules/method_get.go deleted file mode 100644 index c28ac994637..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package routefilterrules - -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 *RouteFilterRule -} - -// Get ... -func (c RouteFilterRulesClient) Get(ctx context.Context, id RouteFilterRuleId) (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 RouteFilterRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/method_listbyroutefilter.go b/resource-manager/network/2023-05-01/routefilterrules/method_listbyroutefilter.go deleted file mode 100644 index 875f770f0f6..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/method_listbyroutefilter.go +++ /dev/null @@ -1,91 +0,0 @@ -package routefilterrules - -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 ListByRouteFilterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RouteFilterRule -} - -type ListByRouteFilterCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteFilterRule -} - -// ListByRouteFilter ... -func (c RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, id RouteFilterId) (result ListByRouteFilterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routeFilterRules", 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 *[]RouteFilterRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByRouteFilterComplete retrieves all the results into a single object -func (c RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Context, id RouteFilterId) (ListByRouteFilterCompleteResult, error) { - return c.ListByRouteFilterCompleteMatchingPredicate(ctx, id, RouteFilterRuleOperationPredicate{}) -} - -// ListByRouteFilterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteFilterRulesClient) ListByRouteFilterCompleteMatchingPredicate(ctx context.Context, id RouteFilterId, predicate RouteFilterRuleOperationPredicate) (result ListByRouteFilterCompleteResult, err error) { - items := make([]RouteFilterRule, 0) - - resp, err := c.ListByRouteFilter(ctx, id) - if err != nil { - 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 = ListByRouteFilterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/model_routefilterrule.go b/resource-manager/network/2023-05-01/routefilterrules/model_routefilterrule.go deleted file mode 100644 index d3ad4488a83..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/model_routefilterrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilterrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/model_routefilterrulepropertiesformat.go b/resource-manager/network/2023-05-01/routefilterrules/model_routefilterrulepropertiesformat.go deleted file mode 100644 index e59fbff04f1..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/model_routefilterrulepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilterrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRulePropertiesFormat struct { - Access Access `json:"access"` - Communities []string `json:"communities"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilterRuleType RouteFilterRuleType `json:"routeFilterRuleType"` -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/predicates.go b/resource-manager/network/2023-05-01/routefilterrules/predicates.go deleted file mode 100644 index 3067b052089..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package routefilterrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRuleOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string -} - -func (p RouteFilterRuleOperationPredicate) Matches(input RouteFilterRule) 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 && (input.Location == nil || *p.Location != *input.Location) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/routefilterrules/version.go b/resource-manager/network/2023-05-01/routefilterrules/version.go deleted file mode 100644 index 2025143d7f8..00000000000 --- a/resource-manager/network/2023-05-01/routefilterrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilterrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routefilterrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/routefilters/README.md b/resource-manager/network/2023-05-01/routefilters/README.md deleted file mode 100644 index 1136c630d62..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routefilters` Documentation - -The `routefilters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/routefilters" -``` - - -### Client Initialization - -```go -client := routefilters.NewRouteFiltersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteFiltersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -payload := routefilters.RouteFilter{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFiltersClient.Delete` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFiltersClient.Get` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -read, err := client.Get(ctx, id, routefilters.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RouteFiltersClient.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: `RouteFiltersClient.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: `RouteFiltersClient.UpdateTags` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -payload := routefilters.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/network/2023-05-01/routefilters/client.go b/resource-manager/network/2023-05-01/routefilters/client.go deleted file mode 100644 index e4faeb1d622..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routefilters - -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 RouteFiltersClient struct { - Client *resourcemanager.Client -} - -func NewRouteFiltersClientWithBaseURI(sdkApi sdkEnv.Api) (*RouteFiltersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routefilters", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RouteFiltersClient: %+v", err) - } - - return &RouteFiltersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/routefilters/constants.go b/resource-manager/network/2023-05-01/routefilters/constants.go deleted file mode 100644 index 47cec86d290..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/constants.go +++ /dev/null @@ -1,353 +0,0 @@ -package routefilters - -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 Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -func PossibleValuesForAccess() []string { - return []string{ - string(AccessAllow), - string(AccessDeny), - } -} - -func (s *Access) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccess(input string) (*Access, error) { - vals := map[string]Access{ - "allow": AccessAllow, - "deny": AccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Access(input) - return &out, nil -} - -type CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RouteFilterRuleType string - -const ( - RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" -) - -func PossibleValuesForRouteFilterRuleType() []string { - return []string{ - string(RouteFilterRuleTypeCommunity), - } -} - -func (s *RouteFilterRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteFilterRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteFilterRuleType(input string) (*RouteFilterRuleType, error) { - vals := map[string]RouteFilterRuleType{ - "community": RouteFilterRuleTypeCommunity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteFilterRuleType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/routefilters/id_routefilter.go b/resource-manager/network/2023-05-01/routefilters/id_routefilter.go deleted file mode 100644 index 18b55731fae..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/id_routefilter.go +++ /dev/null @@ -1,130 +0,0 @@ -package routefilters - -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(&RouteFilterId{}) -} - -var _ resourceids.ResourceId = &RouteFilterId{} - -// RouteFilterId is a struct representing the Resource ID for a Route Filter -type RouteFilterId struct { - SubscriptionId string - ResourceGroupName string - RouteFilterName string -} - -// NewRouteFilterID returns a new RouteFilterId struct -func NewRouteFilterID(subscriptionId string, resourceGroupName string, routeFilterName string) RouteFilterId { - return RouteFilterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteFilterName: routeFilterName, - } -} - -// ParseRouteFilterID parses 'input' into a RouteFilterId -func ParseRouteFilterID(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteFilterIDInsensitively parses 'input' case-insensitively into a RouteFilterId -// note: this method should only be used for API response data and not user input -func ParseRouteFilterIDInsensitively(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteFilterId) 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.RouteFilterName, ok = input.Parsed["routeFilterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterName", input) - } - - return nil -} - -// ValidateRouteFilterID checks that 'input' can be parsed as a Route Filter ID -func ValidateRouteFilterID(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 := ParseRouteFilterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Filter ID -func (id RouteFilterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeFilters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteFilterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Filter ID -func (id RouteFilterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), - resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterValue"), - } -} - -// String returns a human-readable description of this Route Filter ID -func (id RouteFilterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Filter Name: %q", id.RouteFilterName), - } - return fmt.Sprintf("Route Filter (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/routefilters/id_routefilter_test.go b/resource-manager/network/2023-05-01/routefilters/id_routefilter_test.go deleted file mode 100644 index c49325e7a59..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/id_routefilter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routefilters - -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 = &RouteFilterId{} - -func TestNewRouteFilterID(t *testing.T) { - id := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - - 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.RouteFilterName != "routeFilterValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterValue") - } -} - -func TestFormatRouteFilterID(t *testing.T) { - actual := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteFilterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterID(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestParseRouteFilterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteFilterName: "rOuTeFiLtErVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterIDInsensitively(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestSegmentsForRouteFilterId(t *testing.T) { - segments := RouteFilterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteFilterId 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/network/2023-05-01/routefilters/method_createorupdate.go b/resource-manager/network/2023-05-01/routefilters/method_createorupdate.go deleted file mode 100644 index 4881008706e..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routefilters - -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 *RouteFilter -} - -// CreateOrUpdate ... -func (c RouteFiltersClient) CreateOrUpdate(ctx context.Context, id RouteFilterId, input RouteFilter) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RouteFiltersClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteFilterId, input RouteFilter) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/routefilters/method_delete.go b/resource-manager/network/2023-05-01/routefilters/method_delete.go deleted file mode 100644 index 1a389b5108c..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routefilters - -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 RouteFiltersClient) Delete(ctx context.Context, id RouteFilterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RouteFiltersClient) DeleteThenPoll(ctx context.Context, id RouteFilterId) 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/network/2023-05-01/routefilters/method_get.go b/resource-manager/network/2023-05-01/routefilters/method_get.go deleted file mode 100644 index 55c6ee5fa8f..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package routefilters - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RouteFilter -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c RouteFiltersClient) Get(ctx context.Context, id RouteFilterId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 RouteFilter - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/routefilters/method_list.go b/resource-manager/network/2023-05-01/routefilters/method_list.go deleted file mode 100644 index 45734ccd093..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package routefilters - -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 *[]RouteFilter -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteFilter -} - -// List ... -func (c RouteFiltersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeFilters", 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 *[]RouteFilter `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 RouteFiltersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RouteFilterOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteFiltersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RouteFilterOperationPredicate) (result ListCompleteResult, err error) { - items := make([]RouteFilter, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/routefilters/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/routefilters/method_listbyresourcegroup.go deleted file mode 100644 index 4a2f6f7a328..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package routefilters - -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 *[]RouteFilter -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteFilter -} - -// ListByResourceGroup ... -func (c RouteFiltersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeFilters", 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 *[]RouteFilter `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 RouteFiltersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, RouteFilterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteFiltersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RouteFilterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]RouteFilter, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/routefilters/method_updatetags.go b/resource-manager/network/2023-05-01/routefilters/method_updatetags.go deleted file mode 100644 index 33bbd5301d9..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package routefilters - -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 *RouteFilter -} - -// UpdateTags ... -func (c RouteFiltersClient) UpdateTags(ctx context.Context, id RouteFilterId, 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 RouteFilter - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnection.go b/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnection.go deleted file mode 100644 index b4ee9836dca..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 2e9948e07f4..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeering.go b/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeering.go deleted file mode 100644 index 79ef27f6ed8..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 43de7805714..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go deleted file mode 100644 index 1f5f8e7a726..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringPropertiesFormat struct { - AzureASN *int64 `json:"azureASN,omitempty"` - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitstats.go b/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitstats.go deleted file mode 100644 index b57109bba40..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_expressrouteconnectionid.go b/resource-manager/network/2023-05-01/routefilters/model_expressrouteconnectionid.go deleted file mode 100644 index 8d033b8e0e1..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_expressrouteconnectionid.go +++ /dev/null @@ -1,8 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-05-01/routefilters/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index 036a19fa8aa..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-05-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 66f1810d2ef..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index 1cceefb8321..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index ae3652f5c1b..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_routefilter.go b/resource-manager/network/2023-05-01/routefilters/model_routefilter.go deleted file mode 100644 index 932567d03cc..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_routefilter.go +++ /dev/null @@ -1,14 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilter struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteFilterPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_routefilterpropertiesformat.go b/resource-manager/network/2023-05-01/routefilters/model_routefilterpropertiesformat.go deleted file mode 100644 index 3442c803e11..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_routefilterpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterPropertiesFormat struct { - IPv6Peerings *[]ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty"` - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]RouteFilterRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_routefilterrule.go b/resource-manager/network/2023-05-01/routefilters/model_routefilterrule.go deleted file mode 100644 index 7bce6e5cdbc..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_routefilterrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_routefilterrulepropertiesformat.go b/resource-manager/network/2023-05-01/routefilters/model_routefilterrulepropertiesformat.go deleted file mode 100644 index 70f71e0d28d..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_routefilterrulepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRulePropertiesFormat struct { - Access Access `json:"access"` - Communities []string `json:"communities"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilterRuleType RouteFilterRuleType `json:"routeFilterRuleType"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_subresource.go b/resource-manager/network/2023-05-01/routefilters/model_subresource.go deleted file mode 100644 index 18344aa65b5..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routefilters/model_tagsobject.go b/resource-manager/network/2023-05-01/routefilters/model_tagsobject.go deleted file mode 100644 index 7657d1402ea..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package routefilters - -// 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/network/2023-05-01/routefilters/predicates.go b/resource-manager/network/2023-05-01/routefilters/predicates.go deleted file mode 100644 index 333d40af18b..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p RouteFilterOperationPredicate) Matches(input RouteFilter) 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 && (input.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/network/2023-05-01/routefilters/version.go b/resource-manager/network/2023-05-01/routefilters/version.go deleted file mode 100644 index 48668410e5e..00000000000 --- a/resource-manager/network/2023-05-01/routefilters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routefilters/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/routes/README.md b/resource-manager/network/2023-05-01/routes/README.md deleted file mode 100644 index 8c25a324461..00000000000 --- a/resource-manager/network/2023-05-01/routes/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routes` Documentation - -The `routes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/routes" -``` - - -### Client Initialization - -```go -client := routes.NewRoutesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RoutesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -payload := routes.Route{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RoutesClient.Delete` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RoutesClient.Get` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -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: `RoutesClient.List` - -```go -ctx := context.TODO() -id := routes.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -// 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/network/2023-05-01/routes/client.go b/resource-manager/network/2023-05-01/routes/client.go deleted file mode 100644 index 4372f694741..00000000000 --- a/resource-manager/network/2023-05-01/routes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routes - -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 RoutesClient struct { - Client *resourcemanager.Client -} - -func NewRoutesClientWithBaseURI(sdkApi sdkEnv.Api) (*RoutesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RoutesClient: %+v", err) - } - - return &RoutesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/routes/constants.go b/resource-manager/network/2023-05-01/routes/constants.go deleted file mode 100644 index e26bed906c5..00000000000 --- a/resource-manager/network/2023-05-01/routes/constants.go +++ /dev/null @@ -1,107 +0,0 @@ -package routes - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/routes/id_route.go b/resource-manager/network/2023-05-01/routes/id_route.go deleted file mode 100644 index c9e2c02ee1f..00000000000 --- a/resource-manager/network/2023-05-01/routes/id_route.go +++ /dev/null @@ -1,139 +0,0 @@ -package routes - -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(&RouteId{}) -} - -var _ resourceids.ResourceId = &RouteId{} - -// RouteId is a struct representing the Resource ID for a Route -type RouteId struct { - SubscriptionId string - ResourceGroupName string - RouteTableName string - RouteName string -} - -// NewRouteID returns a new RouteId struct -func NewRouteID(subscriptionId string, resourceGroupName string, routeTableName string, routeName string) RouteId { - return RouteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteTableName: routeTableName, - RouteName: routeName, - } -} - -// ParseRouteID parses 'input' into a RouteId -func ParseRouteID(input string) (*RouteId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteIDInsensitively parses 'input' case-insensitively into a RouteId -// note: this method should only be used for API response data and not user input -func ParseRouteIDInsensitively(input string) (*RouteId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteId) 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.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - if id.RouteName, ok = input.Parsed["routeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeName", input) - } - - return nil -} - -// ValidateRouteID checks that 'input' can be parsed as a Route ID -func ValidateRouteID(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 := ParseRouteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route ID -func (id RouteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeTables/%s/routes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteTableName, id.RouteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route ID -func (id RouteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - resourceids.StaticSegment("staticRoutes", "routes", "routes"), - resourceids.UserSpecifiedSegment("routeName", "routeValue"), - } -} - -// String returns a human-readable description of this Route ID -func (id RouteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - fmt.Sprintf("Route Name: %q", id.RouteName), - } - return fmt.Sprintf("Route (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/routes/id_route_test.go b/resource-manager/network/2023-05-01/routes/id_route_test.go deleted file mode 100644 index 2ab68ea9f0b..00000000000 --- a/resource-manager/network/2023-05-01/routes/id_route_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package routes - -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 = &RouteId{} - -func TestNewRouteID(t *testing.T) { - id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - - 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.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } - - if id.RouteName != "routeValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteName'", id.RouteName, "routeValue") - } -} - -func TestFormatRouteID(t *testing.T) { - actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue", - Expected: &RouteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - RouteName: "routeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteID(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - if actual.RouteName != v.Expected.RouteName { - t.Fatalf("Expected %q but got %q for RouteName", v.Expected.RouteName, actual.RouteName) - } - - } -} - -func TestParseRouteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/rOuTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue", - Expected: &RouteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - RouteName: "routeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/rOuTeS/rOuTeVaLuE", - Expected: &RouteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteTableName: "rOuTeTaBlEvAlUe", - RouteName: "rOuTeVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/rOuTeS/rOuTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteIDInsensitively(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - if actual.RouteName != v.Expected.RouteName { - t.Fatalf("Expected %q but got %q for RouteName", v.Expected.RouteName, actual.RouteName) - } - - } -} - -func TestSegmentsForRouteId(t *testing.T) { - segments := RouteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteId 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/network/2023-05-01/routes/id_routetable.go b/resource-manager/network/2023-05-01/routes/id_routetable.go deleted file mode 100644 index 459719bc26c..00000000000 --- a/resource-manager/network/2023-05-01/routes/id_routetable.go +++ /dev/null @@ -1,130 +0,0 @@ -package routes - -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(&RouteTableId{}) -} - -var _ resourceids.ResourceId = &RouteTableId{} - -// RouteTableId is a struct representing the Resource ID for a Route Table -type RouteTableId struct { - SubscriptionId string - ResourceGroupName string - RouteTableName string -} - -// NewRouteTableID returns a new RouteTableId struct -func NewRouteTableID(subscriptionId string, resourceGroupName string, routeTableName string) RouteTableId { - return RouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteTableName: routeTableName, - } -} - -// ParseRouteTableID parses 'input' into a RouteTableId -func ParseRouteTableID(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteTableIDInsensitively parses 'input' case-insensitively into a RouteTableId -// note: this method should only be used for API response data and not user input -func ParseRouteTableIDInsensitively(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteTableId) 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.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateRouteTableID checks that 'input' can be parsed as a Route Table ID -func ValidateRouteTableID(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 := ParseRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Table ID -func (id RouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Table ID -func (id RouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Route Table ID -func (id RouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/routes/id_routetable_test.go b/resource-manager/network/2023-05-01/routes/id_routetable_test.go deleted file mode 100644 index 8f3218d149a..00000000000 --- a/resource-manager/network/2023-05-01/routes/id_routetable_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routes - -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 = &RouteTableId{} - -func TestNewRouteTableID(t *testing.T) { - id := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - - 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.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatRouteTableID(t *testing.T) { - actual := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableID(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableIDInsensitively(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForRouteTableId(t *testing.T) { - segments := RouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteTableId 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/network/2023-05-01/routes/method_createorupdate.go b/resource-manager/network/2023-05-01/routes/method_createorupdate.go deleted file mode 100644 index 29b466f45ef..00000000000 --- a/resource-manager/network/2023-05-01/routes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routes - -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 *Route -} - -// CreateOrUpdate ... -func (c RoutesClient) CreateOrUpdate(ctx context.Context, id RouteId, input Route) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RoutesClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteId, input Route) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/routes/method_delete.go b/resource-manager/network/2023-05-01/routes/method_delete.go deleted file mode 100644 index f6cee23c133..00000000000 --- a/resource-manager/network/2023-05-01/routes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routes - -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 RoutesClient) Delete(ctx context.Context, id RouteId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RoutesClient) DeleteThenPoll(ctx context.Context, id RouteId) 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/network/2023-05-01/routes/method_get.go b/resource-manager/network/2023-05-01/routes/method_get.go deleted file mode 100644 index 8f641d28c5b..00000000000 --- a/resource-manager/network/2023-05-01/routes/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package routes - -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 *Route -} - -// Get ... -func (c RoutesClient) Get(ctx context.Context, id RouteId) (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 Route - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/routes/method_list.go b/resource-manager/network/2023-05-01/routes/method_list.go deleted file mode 100644 index 4ccb6f3031e..00000000000 --- a/resource-manager/network/2023-05-01/routes/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package routes - -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 *[]Route -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Route -} - -// List ... -func (c RoutesClient) List(ctx context.Context, id RouteTableId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routes", 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 *[]Route `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 RoutesClient) ListComplete(ctx context.Context, id RouteTableId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RouteOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RoutesClient) ListCompleteMatchingPredicate(ctx context.Context, id RouteTableId, predicate RouteOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Route, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/routes/model_route.go b/resource-manager/network/2023-05-01/routes/model_route.go deleted file mode 100644 index 364b3bb3322..00000000000 --- a/resource-manager/network/2023-05-01/routes/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routes/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/routes/model_routepropertiesformat.go deleted file mode 100644 index 82a30d0f4e0..00000000000 --- a/resource-manager/network/2023-05-01/routes/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routes/predicates.go b/resource-manager/network/2023-05-01/routes/predicates.go deleted file mode 100644 index b0ff24a6573..00000000000 --- a/resource-manager/network/2023-05-01/routes/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package routes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RouteOperationPredicate) Matches(input Route) 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.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/network/2023-05-01/routes/version.go b/resource-manager/network/2023-05-01/routes/version.go deleted file mode 100644 index b69509bb8ad..00000000000 --- a/resource-manager/network/2023-05-01/routes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/routetables/README.md b/resource-manager/network/2023-05-01/routetables/README.md deleted file mode 100644 index f98f625e379..00000000000 --- a/resource-manager/network/2023-05-01/routetables/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/routetables` Documentation - -The `routetables` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/routetables" -``` - - -### Client Initialization - -```go -client := routetables.NewRouteTablesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteTablesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -payload := routetables.RouteTable{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteTablesClient.Delete` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteTablesClient.Get` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -read, err := client.Get(ctx, id, routetables.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RouteTablesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `RouteTablesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `RouteTablesClient.UpdateTags` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -payload := routetables.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/network/2023-05-01/routetables/client.go b/resource-manager/network/2023-05-01/routetables/client.go deleted file mode 100644 index 26c9fb104ad..00000000000 --- a/resource-manager/network/2023-05-01/routetables/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routetables - -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 RouteTablesClient struct { - Client *resourcemanager.Client -} - -func NewRouteTablesClientWithBaseURI(sdkApi sdkEnv.Api) (*RouteTablesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routetables", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RouteTablesClient: %+v", err) - } - - return &RouteTablesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/routetables/constants.go b/resource-manager/network/2023-05-01/routetables/constants.go deleted file mode 100644 index 4a244a372fb..00000000000 --- a/resource-manager/network/2023-05-01/routetables/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package routetables - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/routetables/id_routetable.go b/resource-manager/network/2023-05-01/routetables/id_routetable.go deleted file mode 100644 index 0f3c938daf7..00000000000 --- a/resource-manager/network/2023-05-01/routetables/id_routetable.go +++ /dev/null @@ -1,130 +0,0 @@ -package routetables - -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(&RouteTableId{}) -} - -var _ resourceids.ResourceId = &RouteTableId{} - -// RouteTableId is a struct representing the Resource ID for a Route Table -type RouteTableId struct { - SubscriptionId string - ResourceGroupName string - RouteTableName string -} - -// NewRouteTableID returns a new RouteTableId struct -func NewRouteTableID(subscriptionId string, resourceGroupName string, routeTableName string) RouteTableId { - return RouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteTableName: routeTableName, - } -} - -// ParseRouteTableID parses 'input' into a RouteTableId -func ParseRouteTableID(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteTableIDInsensitively parses 'input' case-insensitively into a RouteTableId -// note: this method should only be used for API response data and not user input -func ParseRouteTableIDInsensitively(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteTableId) 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.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateRouteTableID checks that 'input' can be parsed as a Route Table ID -func ValidateRouteTableID(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 := ParseRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Table ID -func (id RouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Table ID -func (id RouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Route Table ID -func (id RouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/routetables/id_routetable_test.go b/resource-manager/network/2023-05-01/routetables/id_routetable_test.go deleted file mode 100644 index daf7d653c71..00000000000 --- a/resource-manager/network/2023-05-01/routetables/id_routetable_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routetables - -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 = &RouteTableId{} - -func TestNewRouteTableID(t *testing.T) { - id := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - - 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.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatRouteTableID(t *testing.T) { - actual := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableID(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableIDInsensitively(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForRouteTableId(t *testing.T) { - segments := RouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteTableId 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/network/2023-05-01/routetables/method_createorupdate.go b/resource-manager/network/2023-05-01/routetables/method_createorupdate.go deleted file mode 100644 index 04fdd62101d..00000000000 --- a/resource-manager/network/2023-05-01/routetables/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routetables - -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 *RouteTable -} - -// CreateOrUpdate ... -func (c RouteTablesClient) CreateOrUpdate(ctx context.Context, id RouteTableId, input RouteTable) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RouteTablesClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteTableId, input RouteTable) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/routetables/method_delete.go b/resource-manager/network/2023-05-01/routetables/method_delete.go deleted file mode 100644 index 6ef6e0e531d..00000000000 --- a/resource-manager/network/2023-05-01/routetables/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routetables - -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 RouteTablesClient) Delete(ctx context.Context, id RouteTableId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RouteTablesClient) DeleteThenPoll(ctx context.Context, id RouteTableId) 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/network/2023-05-01/routetables/method_get.go b/resource-manager/network/2023-05-01/routetables/method_get.go deleted file mode 100644 index 519ddb2364a..00000000000 --- a/resource-manager/network/2023-05-01/routetables/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package routetables - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RouteTable -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c RouteTablesClient) Get(ctx context.Context, id RouteTableId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 RouteTable - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/routetables/method_list.go b/resource-manager/network/2023-05-01/routetables/method_list.go deleted file mode 100644 index 5b428479e45..00000000000 --- a/resource-manager/network/2023-05-01/routetables/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package routetables - -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 *[]RouteTable -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteTable -} - -// List ... -func (c RouteTablesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeTables", 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 *[]RouteTable `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 RouteTablesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RouteTableOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteTablesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RouteTableOperationPredicate) (result ListCompleteResult, err error) { - items := make([]RouteTable, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/routetables/method_listall.go b/resource-manager/network/2023-05-01/routetables/method_listall.go deleted file mode 100644 index 141adf9bb23..00000000000 --- a/resource-manager/network/2023-05-01/routetables/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package routetables - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RouteTable -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteTable -} - -// ListAll ... -func (c RouteTablesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeTables", 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 *[]RouteTable `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c RouteTablesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, RouteTableOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteTablesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RouteTableOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]RouteTable, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/routetables/method_updatetags.go b/resource-manager/network/2023-05-01/routetables/method_updatetags.go deleted file mode 100644 index b2db87b8208..00000000000 --- a/resource-manager/network/2023-05-01/routetables/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package routetables - -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 *RouteTable -} - -// UpdateTags ... -func (c RouteTablesClient) UpdateTags(ctx context.Context, id RouteTableId, 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 RouteTable - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 3f1666af192..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index aa535e08a6a..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 26b2afe4fb6..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 2474ea7f89e..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index b0ea966f8a5..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/routetables/model_applicationsecuritygroup.go deleted file mode 100644 index da94563b915..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index d270ac905b2..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_backendaddresspool.go b/resource-manager/network/2023-05-01/routetables/model_backendaddresspool.go deleted file mode 100644 index 90a55576b63..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 34067eb4dc7..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index d85f90834ef..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_ddossettings.go b/resource-manager/network/2023-05-01/routetables/model_ddossettings.go deleted file mode 100644 index ffd9663e361..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_delegation.go b/resource-manager/network/2023-05-01/routetables/model_delegation.go deleted file mode 100644 index 2098ca8ace8..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_flowlog.go b/resource-manager/network/2023-05-01/routetables/model_flowlog.go deleted file mode 100644 index cea97564b72..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/routetables/model_flowlogformatparameters.go deleted file mode 100644 index 46d83a48283..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_flowlogpropertiesformat.go deleted file mode 100644 index 23f3648b1da..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_frontendipconfiguration.go deleted file mode 100644 index 15308372f3a..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package routetables - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index c3ba5e8cb16..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/routetables/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index f99a910776d..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_inboundnatrule.go b/resource-manager/network/2023-05-01/routetables/model_inboundnatrule.go deleted file mode 100644 index b540b7a4ff5..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 5fa1c54256c..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_ipconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_ipconfiguration.go deleted file mode 100644 index 7f86bd442fd..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofile.go deleted file mode 100644 index 10063b56d94..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 8be23ea8407..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 33538e3da04..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_iptag.go b/resource-manager/network/2023-05-01/routetables/model_iptag.go deleted file mode 100644 index 0591a6fbb81..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// 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/network/2023-05-01/routetables/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddress.go deleted file mode 100644 index 6eb63262bd2..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index b4070586d52..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_natgateway.go b/resource-manager/network/2023-05-01/routetables/model_natgateway.go deleted file mode 100644 index cdcecbfa098..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package routetables - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_natgatewaypropertiesformat.go deleted file mode 100644 index dd643c79c79..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_natgatewaysku.go b/resource-manager/network/2023-05-01/routetables/model_natgatewaysku.go deleted file mode 100644 index 8e15e8b1250..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_natruleportmapping.go b/resource-manager/network/2023-05-01/routetables/model_natruleportmapping.go deleted file mode 100644 index 665d5f253ce..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterface.go b/resource-manager/network/2023-05-01/routetables/model_networkinterface.go deleted file mode 100644 index fac5f0869e6..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfacednssettings.go deleted file mode 100644 index 9d476ca2642..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 7db216219a1..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 60fdba4dd13..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 3f36842e1f3..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 4cc36c8f7f5..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 6f876f8ce53..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index fbd84b3af86..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/routetables/model_networksecuritygroup.go deleted file mode 100644 index 84c0fadac17..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 633f7012e04..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privateendpoint.go b/resource-manager/network/2023-05-01/routetables/model_privateendpoint.go deleted file mode 100644 index 80308b3a2a6..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/routetables/model_privateendpointconnection.go deleted file mode 100644 index 0e503458e9c..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/routetables/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/routetables/model_privateendpointconnectionproperties.go deleted file mode 100644 index f8d3eeab02b..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_privateendpointipconfiguration.go deleted file mode 100644 index de4e0254405..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/routetables/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 1ba73d98f4a..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/routetables/model_privateendpointproperties.go deleted file mode 100644 index 3d92a4a92e1..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkservice.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkservice.go deleted file mode 100644 index 29bf0cf5834..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnection.go deleted file mode 100644 index 4adf690c566..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 063a4faec37..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 3b1634cb059..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index e3ad61faa8f..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 430eebd19ae..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceproperties.go deleted file mode 100644 index 9e26fa01a75..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_publicipaddress.go b/resource-manager/network/2023-05-01/routetables/model_publicipaddress.go deleted file mode 100644 index 8248c499a22..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/routetables/model_publicipaddressdnssettings.go deleted file mode 100644 index 84b1e72e903..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_publicipaddresspropertiesformat.go deleted file mode 100644 index ba0c692ec23..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/routetables/model_publicipaddresssku.go deleted file mode 100644 index 956c758896f..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/routetables/model_resourcenavigationlink.go deleted file mode 100644 index c5d74e0472b..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/routetables/model_resourcenavigationlinkformat.go deleted file mode 100644 index eca6b593c69..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_resourceset.go b/resource-manager/network/2023-05-01/routetables/model_resourceset.go deleted file mode 100644 index 8a57a8fb40d..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/routetables/model_retentionpolicyparameters.go deleted file mode 100644 index 37bad49cdcb..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_route.go b/resource-manager/network/2023-05-01/routetables/model_route.go deleted file mode 100644 index 10c17005b28..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_routepropertiesformat.go deleted file mode 100644 index 028abe93e73..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_routetable.go b/resource-manager/network/2023-05-01/routetables/model_routetable.go deleted file mode 100644 index 1b2bb754997..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_routetablepropertiesformat.go deleted file mode 100644 index 64470e39699..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_securityrule.go b/resource-manager/network/2023-05-01/routetables/model_securityrule.go deleted file mode 100644 index ab6f4a35210..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_securityrulepropertiesformat.go deleted file mode 100644 index 636af5195f0..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/routetables/model_serviceassociationlink.go deleted file mode 100644 index 682b3659989..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 7ed4a93de00..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_servicedelegationpropertiesformat.go deleted file mode 100644 index fba1a21dc46..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicy.go deleted file mode 100644 index c941578ec3f..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 6a6135ec206..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index a9fcdcec846..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 25a22cda3fd..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_serviceendpointpropertiesformat.go deleted file mode 100644 index ffdfaa0569b..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_subnet.go b/resource-manager/network/2023-05-01/routetables/model_subnet.go deleted file mode 100644 index 949e07613d6..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_subnetpropertiesformat.go deleted file mode 100644 index 7b7eb8d21ea..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_subresource.go b/resource-manager/network/2023-05-01/routetables/model_subresource.go deleted file mode 100644 index eab315946e0..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_tagsobject.go b/resource-manager/network/2023-05-01/routetables/model_tagsobject.go deleted file mode 100644 index 61b33687ad4..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// 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/network/2023-05-01/routetables/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/routetables/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index e02ff0c097e..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/routetables/model_trafficanalyticsproperties.go deleted file mode 100644 index d88b7ea067e..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/routetables/model_virtualnetworktap.go deleted file mode 100644 index 7551bed07c8..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/routetables/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 2094070851f..00000000000 --- a/resource-manager/network/2023-05-01/routetables/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/routetables/predicates.go b/resource-manager/network/2023-05-01/routetables/predicates.go deleted file mode 100644 index e1d89b9fbd4..00000000000 --- a/resource-manager/network/2023-05-01/routetables/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTableOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p RouteTableOperationPredicate) Matches(input RouteTable) 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 && (input.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/network/2023-05-01/routetables/version.go b/resource-manager/network/2023-05-01/routetables/version.go deleted file mode 100644 index c3aa83f3617..00000000000 --- a/resource-manager/network/2023-05-01/routetables/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routetables/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/README.md b/resource-manager/network/2023-05-01/scopeconnections/README.md deleted file mode 100644 index f3d84c25123..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/scopeconnections` Documentation - -The `scopeconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/scopeconnections" -``` - - -### Client Initialization - -```go -client := scopeconnections.NewScopeConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScopeConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -payload := scopeconnections.ScopeConnection{ - // ... -} - - -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: `ScopeConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -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: `ScopeConnectionsClient.Get` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -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: `ScopeConnectionsClient.List` - -```go -ctx := context.TODO() -id := scopeconnections.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, scopeconnections.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, scopeconnections.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/scopeconnections/client.go b/resource-manager/network/2023-05-01/scopeconnections/client.go deleted file mode 100644 index aa7247e35c7..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package scopeconnections - -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 ScopeConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewScopeConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ScopeConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "scopeconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ScopeConnectionsClient: %+v", err) - } - - return &ScopeConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/constants.go b/resource-manager/network/2023-05-01/scopeconnections/constants.go deleted file mode 100644 index 24a9bb99e3a..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package scopeconnections - -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 ScopeConnectionState string - -const ( - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" - ScopeConnectionStateConnected ScopeConnectionState = "Connected" - ScopeConnectionStatePending ScopeConnectionState = "Pending" - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" -) - -func PossibleValuesForScopeConnectionState() []string { - return []string{ - string(ScopeConnectionStateConflict), - string(ScopeConnectionStateConnected), - string(ScopeConnectionStatePending), - string(ScopeConnectionStateRejected), - string(ScopeConnectionStateRevoked), - } -} - -func (s *ScopeConnectionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScopeConnectionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScopeConnectionState(input string) (*ScopeConnectionState, error) { - vals := map[string]ScopeConnectionState{ - "conflict": ScopeConnectionStateConflict, - "connected": ScopeConnectionStateConnected, - "pending": ScopeConnectionStatePending, - "rejected": ScopeConnectionStateRejected, - "revoked": ScopeConnectionStateRevoked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScopeConnectionState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/id_networkmanager.go b/resource-manager/network/2023-05-01/scopeconnections/id_networkmanager.go deleted file mode 100644 index 259fe7f2afa..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package scopeconnections - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/id_networkmanager_test.go b/resource-manager/network/2023-05-01/scopeconnections/id_networkmanager_test.go deleted file mode 100644 index 2fff6fad485..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package scopeconnections - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/scopeconnections/id_scopeconnection.go b/resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection.go deleted file mode 100644 index dd1d78f3b94..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package scopeconnections - -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(&ScopeConnectionId{}) -} - -var _ resourceids.ResourceId = &ScopeConnectionId{} - -// ScopeConnectionId is a struct representing the Resource ID for a Scope Connection -type ScopeConnectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - ScopeConnectionName string -} - -// NewScopeConnectionID returns a new ScopeConnectionId struct -func NewScopeConnectionID(subscriptionId string, resourceGroupName string, networkManagerName string, scopeConnectionName string) ScopeConnectionId { - return ScopeConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - ScopeConnectionName: scopeConnectionName, - } -} - -// ParseScopeConnectionID parses 'input' into a ScopeConnectionId -func ParseScopeConnectionID(input string) (*ScopeConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopeConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopeConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopeConnectionIDInsensitively parses 'input' case-insensitively into a ScopeConnectionId -// note: this method should only be used for API response data and not user input -func ParseScopeConnectionIDInsensitively(input string) (*ScopeConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopeConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopeConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopeConnectionId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.ScopeConnectionName, ok = input.Parsed["scopeConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scopeConnectionName", input) - } - - return nil -} - -// ValidateScopeConnectionID checks that 'input' can be parsed as a Scope Connection ID -func ValidateScopeConnectionID(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 := ParseScopeConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scope Connection ID -func (id ScopeConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/scopeConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.ScopeConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scope Connection ID -func (id ScopeConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticScopeConnections", "scopeConnections", "scopeConnections"), - resourceids.UserSpecifiedSegment("scopeConnectionName", "scopeConnectionValue"), - } -} - -// String returns a human-readable description of this Scope Connection ID -func (id ScopeConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Scope Connection Name: %q", id.ScopeConnectionName), - } - return fmt.Sprintf("Scope Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection_test.go b/resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection_test.go deleted file mode 100644 index 7beffedb1b9..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/id_scopeconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package scopeconnections - -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 = &ScopeConnectionId{} - -func TestNewScopeConnectionID(t *testing.T) { - id := NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.ScopeConnectionName != "scopeConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScopeConnectionName'", id.ScopeConnectionName, "scopeConnectionValue") - } -} - -func TestFormatScopeConnectionID(t *testing.T) { - actual := NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopeConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopeConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue", - Expected: &ScopeConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ScopeConnectionName: "scopeConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopeConnectionID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ScopeConnectionName != v.Expected.ScopeConnectionName { - t.Fatalf("Expected %q but got %q for ScopeConnectionName", v.Expected.ScopeConnectionName, actual.ScopeConnectionName) - } - - } -} - -func TestParseScopeConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopeConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sCoPeCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue", - Expected: &ScopeConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ScopeConnectionName: "scopeConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sCoPeCoNnEcTiOnS/sCoPeCoNnEcTiOnVaLuE", - Expected: &ScopeConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - ScopeConnectionName: "sCoPeCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sCoPeCoNnEcTiOnS/sCoPeCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopeConnectionIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ScopeConnectionName != v.Expected.ScopeConnectionName { - t.Fatalf("Expected %q but got %q for ScopeConnectionName", v.Expected.ScopeConnectionName, actual.ScopeConnectionName) - } - - } -} - -func TestSegmentsForScopeConnectionId(t *testing.T) { - segments := ScopeConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopeConnectionId 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/network/2023-05-01/scopeconnections/method_createorupdate.go b/resource-manager/network/2023-05-01/scopeconnections/method_createorupdate.go deleted file mode 100644 index c0784b21bd5..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package scopeconnections - -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 *ScopeConnection -} - -// CreateOrUpdate ... -func (c ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, id ScopeConnectionId, input ScopeConnection) (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 ScopeConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/method_delete.go b/resource-manager/network/2023-05-01/scopeconnections/method_delete.go deleted file mode 100644 index 0ef9f60e8f6..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package scopeconnections - -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 ScopeConnectionsClient) Delete(ctx context.Context, id ScopeConnectionId) (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/network/2023-05-01/scopeconnections/method_get.go b/resource-manager/network/2023-05-01/scopeconnections/method_get.go deleted file mode 100644 index 97616b65ce8..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package scopeconnections - -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 *ScopeConnection -} - -// Get ... -func (c ScopeConnectionsClient) Get(ctx context.Context, id ScopeConnectionId) (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 ScopeConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/method_list.go b/resource-manager/network/2023-05-01/scopeconnections/method_list.go deleted file mode 100644 index 00918fecd58..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package scopeconnections - -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 *[]ScopeConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ScopeConnection -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c ScopeConnectionsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/scopeConnections", id.ID()), - OptionsObject: options, - } - - 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 *[]ScopeConnection `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 ScopeConnectionsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, ScopeConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ScopeConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate ScopeConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ScopeConnection, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/scopeconnections/model_scopeconnection.go b/resource-manager/network/2023-05-01/scopeconnections/model_scopeconnection.go deleted file mode 100644 index ddb7dcfd3ff..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/model_scopeconnection.go +++ /dev/null @@ -1,17 +0,0 @@ -package scopeconnections - -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 ScopeConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ScopeConnectionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/model_scopeconnectionproperties.go b/resource-manager/network/2023-05-01/scopeconnections/model_scopeconnectionproperties.go deleted file mode 100644 index 0997147a2a9..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/model_scopeconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package scopeconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeConnectionProperties struct { - ConnectionState *ScopeConnectionState `json:"connectionState,omitempty"` - Description *string `json:"description,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/scopeconnections/predicates.go b/resource-manager/network/2023-05-01/scopeconnections/predicates.go deleted file mode 100644 index eda309664f4..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package scopeconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ScopeConnectionOperationPredicate) Matches(input ScopeConnection) 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.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/network/2023-05-01/scopeconnections/version.go b/resource-manager/network/2023-05-01/scopeconnections/version.go deleted file mode 100644 index a7f4da9d965..00000000000 --- a/resource-manager/network/2023-05-01/scopeconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package scopeconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/scopeconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/README.md b/resource-manager/network/2023-05-01/securityadminconfigurations/README.md deleted file mode 100644 index 4118821af9e..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securityadminconfigurations` Documentation - -The `securityadminconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/securityadminconfigurations" -``` - - -### Client Initialization - -```go -client := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityAdminConfigurationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -payload := securityadminconfigurations.SecurityAdminConfiguration{ - // ... -} - - -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: `SecurityAdminConfigurationsClient.Delete` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityAdminConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -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: `SecurityAdminConfigurationsClient.List` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, securityadminconfigurations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, securityadminconfigurations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/client.go b/resource-manager/network/2023-05-01/securityadminconfigurations/client.go deleted file mode 100644 index 7629a2dcefb..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securityadminconfigurations - -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 SecurityAdminConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewSecurityAdminConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityAdminConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securityadminconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityAdminConfigurationsClient: %+v", err) - } - - return &SecurityAdminConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/constants.go b/resource-manager/network/2023-05-01/securityadminconfigurations/constants.go deleted file mode 100644 index bfadf6115a8..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package securityadminconfigurations - -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 NetworkIntentPolicyBasedService string - -const ( - NetworkIntentPolicyBasedServiceAll NetworkIntentPolicyBasedService = "All" - NetworkIntentPolicyBasedServiceAllowRulesOnly NetworkIntentPolicyBasedService = "AllowRulesOnly" - NetworkIntentPolicyBasedServiceNone NetworkIntentPolicyBasedService = "None" -) - -func PossibleValuesForNetworkIntentPolicyBasedService() []string { - return []string{ - string(NetworkIntentPolicyBasedServiceAll), - string(NetworkIntentPolicyBasedServiceAllowRulesOnly), - string(NetworkIntentPolicyBasedServiceNone), - } -} - -func (s *NetworkIntentPolicyBasedService) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkIntentPolicyBasedService(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkIntentPolicyBasedService(input string) (*NetworkIntentPolicyBasedService, error) { - vals := map[string]NetworkIntentPolicyBasedService{ - "all": NetworkIntentPolicyBasedServiceAll, - "allowrulesonly": NetworkIntentPolicyBasedServiceAllowRulesOnly, - "none": NetworkIntentPolicyBasedServiceNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkIntentPolicyBasedService(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager.go b/resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager.go deleted file mode 100644 index cc45635d1cc..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package securityadminconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager_test.go deleted file mode 100644 index 1da0952d267..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securityadminconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration.go deleted file mode 100644 index c481f6a158b..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package securityadminconfigurations - -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(&SecurityAdminConfigurationId{}) -} - -var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} - -// SecurityAdminConfigurationId is a struct representing the Resource ID for a Security Admin Configuration -type SecurityAdminConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string -} - -// NewSecurityAdminConfigurationID returns a new SecurityAdminConfigurationId struct -func NewSecurityAdminConfigurationID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string) SecurityAdminConfigurationId { - return SecurityAdminConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - } -} - -// ParseSecurityAdminConfigurationID parses 'input' into a SecurityAdminConfigurationId -func ParseSecurityAdminConfigurationID(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityAdminConfigurationIDInsensitively parses 'input' case-insensitively into a SecurityAdminConfigurationId -// note: this method should only be used for API response data and not user input -func ParseSecurityAdminConfigurationIDInsensitively(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityAdminConfigurationId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - return nil -} - -// ValidateSecurityAdminConfigurationID checks that 'input' can be parsed as a Security Admin Configuration ID -func ValidateSecurityAdminConfigurationID(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 := ParseSecurityAdminConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Admin Configuration ID -func (id SecurityAdminConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - } -} - -// String returns a human-readable description of this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - } - return fmt.Sprintf("Security Admin Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration_test.go deleted file mode 100644 index 6bbef50dedb..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/id_securityadminconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package securityadminconfigurations - -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 = &SecurityAdminConfigurationId{} - -func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } -} - -func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityAdminConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestSegmentsForSecurityAdminConfigurationId(t *testing.T) { - segments := SecurityAdminConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityAdminConfigurationId 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/network/2023-05-01/securityadminconfigurations/method_createorupdate.go b/resource-manager/network/2023-05-01/securityadminconfigurations/method_createorupdate.go deleted file mode 100644 index e285ab5384c..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package securityadminconfigurations - -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 *SecurityAdminConfiguration -} - -// CreateOrUpdate ... -func (c SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Context, id SecurityAdminConfigurationId, input SecurityAdminConfiguration) (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 SecurityAdminConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/method_delete.go b/resource-manager/network/2023-05-01/securityadminconfigurations/method_delete.go deleted file mode 100644 index d08913b2c20..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package securityadminconfigurations - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 SecurityAdminConfigurationsClient) Delete(ctx context.Context, id SecurityAdminConfigurationId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 SecurityAdminConfigurationsClient) DeleteThenPoll(ctx context.Context, id SecurityAdminConfigurationId, 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/network/2023-05-01/securityadminconfigurations/method_get.go b/resource-manager/network/2023-05-01/securityadminconfigurations/method_get.go deleted file mode 100644 index 6046f27ef91..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securityadminconfigurations - -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 *SecurityAdminConfiguration -} - -// Get ... -func (c SecurityAdminConfigurationsClient) Get(ctx context.Context, id SecurityAdminConfigurationId) (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 SecurityAdminConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/method_list.go b/resource-manager/network/2023-05-01/securityadminconfigurations/method_list.go deleted file mode 100644 index 4eb221200d0..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package securityadminconfigurations - -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 *[]SecurityAdminConfiguration -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityAdminConfiguration -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c SecurityAdminConfigurationsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/securityAdminConfigurations", id.ID()), - OptionsObject: options, - } - - 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 *[]SecurityAdminConfiguration `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 SecurityAdminConfigurationsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, SecurityAdminConfigurationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityAdminConfigurationsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate SecurityAdminConfigurationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityAdminConfiguration, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/securityadminconfigurations/model_securityadminconfiguration.go b/resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfiguration.go deleted file mode 100644 index 004c4d46b07..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package securityadminconfigurations - -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 SecurityAdminConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityAdminConfigurationPropertiesFormat `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go deleted file mode 100644 index cf9ecff7791..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package securityadminconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAdminConfigurationPropertiesFormat struct { - ApplyOnNetworkIntentPolicyBasedServices *[]NetworkIntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securityadminconfigurations/predicates.go b/resource-manager/network/2023-05-01/securityadminconfigurations/predicates.go deleted file mode 100644 index bcc5de9a6a8..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package securityadminconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAdminConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SecurityAdminConfigurationOperationPredicate) Matches(input SecurityAdminConfiguration) 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.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/network/2023-05-01/securityadminconfigurations/version.go b/resource-manager/network/2023-05-01/securityadminconfigurations/version.go deleted file mode 100644 index fcb4511b632..00000000000 --- a/resource-manager/network/2023-05-01/securityadminconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityadminconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securityadminconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/README.md b/resource-manager/network/2023-05-01/securitypartnerproviders/README.md deleted file mode 100644 index 6eac4e5ca48..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securitypartnerproviders` Documentation - -The `securitypartnerproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/securitypartnerproviders" -``` - - -### Client Initialization - -```go -client := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityPartnerProvidersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -payload := securitypartnerproviders.SecurityPartnerProvider{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityPartnerProvidersClient.Delete` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityPartnerProvidersClient.Get` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.UpdateTags` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -payload := securitypartnerproviders.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/network/2023-05-01/securitypartnerproviders/client.go b/resource-manager/network/2023-05-01/securitypartnerproviders/client.go deleted file mode 100644 index e87ed7e5d0e..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securitypartnerproviders - -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 SecurityPartnerProvidersClient struct { - Client *resourcemanager.Client -} - -func NewSecurityPartnerProvidersClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityPartnerProvidersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securitypartnerproviders", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityPartnerProvidersClient: %+v", err) - } - - return &SecurityPartnerProvidersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/constants.go b/resource-manager/network/2023-05-01/securitypartnerproviders/constants.go deleted file mode 100644 index 2390c77210a..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/constants.go +++ /dev/null @@ -1,148 +0,0 @@ -package securitypartnerproviders - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityPartnerProviderConnectionStatus string - -const ( - SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" - SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" - SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" - SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" -) - -func PossibleValuesForSecurityPartnerProviderConnectionStatus() []string { - return []string{ - string(SecurityPartnerProviderConnectionStatusConnected), - string(SecurityPartnerProviderConnectionStatusNotConnected), - string(SecurityPartnerProviderConnectionStatusPartiallyConnected), - string(SecurityPartnerProviderConnectionStatusUnknown), - } -} - -func (s *SecurityPartnerProviderConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityPartnerProviderConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityPartnerProviderConnectionStatus(input string) (*SecurityPartnerProviderConnectionStatus, error) { - vals := map[string]SecurityPartnerProviderConnectionStatus{ - "connected": SecurityPartnerProviderConnectionStatusConnected, - "notconnected": SecurityPartnerProviderConnectionStatusNotConnected, - "partiallyconnected": SecurityPartnerProviderConnectionStatusPartiallyConnected, - "unknown": SecurityPartnerProviderConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityPartnerProviderConnectionStatus(input) - return &out, nil -} - -type SecurityProviderName string - -const ( - SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" - SecurityProviderNameIBoss SecurityProviderName = "IBoss" - SecurityProviderNameZScaler SecurityProviderName = "ZScaler" -) - -func PossibleValuesForSecurityProviderName() []string { - return []string{ - string(SecurityProviderNameCheckpoint), - string(SecurityProviderNameIBoss), - string(SecurityProviderNameZScaler), - } -} - -func (s *SecurityProviderName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityProviderName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityProviderName(input string) (*SecurityProviderName, error) { - vals := map[string]SecurityProviderName{ - "checkpoint": SecurityProviderNameCheckpoint, - "iboss": SecurityProviderNameIBoss, - "zscaler": SecurityProviderNameZScaler, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityProviderName(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider.go b/resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider.go deleted file mode 100644 index 32dd3433d4a..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider.go +++ /dev/null @@ -1,130 +0,0 @@ -package securitypartnerproviders - -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(&SecurityPartnerProviderId{}) -} - -var _ resourceids.ResourceId = &SecurityPartnerProviderId{} - -// SecurityPartnerProviderId is a struct representing the Resource ID for a Security Partner Provider -type SecurityPartnerProviderId struct { - SubscriptionId string - ResourceGroupName string - SecurityPartnerProviderName string -} - -// NewSecurityPartnerProviderID returns a new SecurityPartnerProviderId struct -func NewSecurityPartnerProviderID(subscriptionId string, resourceGroupName string, securityPartnerProviderName string) SecurityPartnerProviderId { - return SecurityPartnerProviderId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - SecurityPartnerProviderName: securityPartnerProviderName, - } -} - -// ParseSecurityPartnerProviderID parses 'input' into a SecurityPartnerProviderId -func ParseSecurityPartnerProviderID(input string) (*SecurityPartnerProviderId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityPartnerProviderId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityPartnerProviderId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityPartnerProviderIDInsensitively parses 'input' case-insensitively into a SecurityPartnerProviderId -// note: this method should only be used for API response data and not user input -func ParseSecurityPartnerProviderIDInsensitively(input string) (*SecurityPartnerProviderId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityPartnerProviderId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityPartnerProviderId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityPartnerProviderId) 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.SecurityPartnerProviderName, ok = input.Parsed["securityPartnerProviderName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityPartnerProviderName", input) - } - - return nil -} - -// ValidateSecurityPartnerProviderID checks that 'input' can be parsed as a Security Partner Provider ID -func ValidateSecurityPartnerProviderID(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 := ParseSecurityPartnerProviderID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Partner Provider ID -func (id SecurityPartnerProviderId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/securityPartnerProviders/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SecurityPartnerProviderName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Partner Provider ID -func (id SecurityPartnerProviderId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticSecurityPartnerProviders", "securityPartnerProviders", "securityPartnerProviders"), - resourceids.UserSpecifiedSegment("securityPartnerProviderName", "securityPartnerProviderValue"), - } -} - -// String returns a human-readable description of this Security Partner Provider ID -func (id SecurityPartnerProviderId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Security Partner Provider Name: %q", id.SecurityPartnerProviderName), - } - return fmt.Sprintf("Security Partner Provider (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider_test.go b/resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider_test.go deleted file mode 100644 index 6eefc130a4d..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/id_securitypartnerprovider_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securitypartnerproviders - -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 = &SecurityPartnerProviderId{} - -func TestNewSecurityPartnerProviderID(t *testing.T) { - id := NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - - 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.SecurityPartnerProviderName != "securityPartnerProviderValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityPartnerProviderName'", id.SecurityPartnerProviderName, "securityPartnerProviderValue") - } -} - -func TestFormatSecurityPartnerProviderID(t *testing.T) { - actual := NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityPartnerProviderID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityPartnerProviderId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue", - Expected: &SecurityPartnerProviderId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SecurityPartnerProviderName: "securityPartnerProviderValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityPartnerProviderID(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.SecurityPartnerProviderName != v.Expected.SecurityPartnerProviderName { - t.Fatalf("Expected %q but got %q for SecurityPartnerProviderName", v.Expected.SecurityPartnerProviderName, actual.SecurityPartnerProviderName) - } - - } -} - -func TestParseSecurityPartnerProviderIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityPartnerProviderId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sEcUrItYpArTnErPrOvIdErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue", - Expected: &SecurityPartnerProviderId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SecurityPartnerProviderName: "securityPartnerProviderValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sEcUrItYpArTnErPrOvIdErS/sEcUrItYpArTnErPrOvIdErVaLuE", - Expected: &SecurityPartnerProviderId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SecurityPartnerProviderName: "sEcUrItYpArTnErPrOvIdErVaLuE", - }, - }, - { - // 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.nEtWoRk/sEcUrItYpArTnErPrOvIdErS/sEcUrItYpArTnErPrOvIdErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityPartnerProviderIDInsensitively(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.SecurityPartnerProviderName != v.Expected.SecurityPartnerProviderName { - t.Fatalf("Expected %q but got %q for SecurityPartnerProviderName", v.Expected.SecurityPartnerProviderName, actual.SecurityPartnerProviderName) - } - - } -} - -func TestSegmentsForSecurityPartnerProviderId(t *testing.T) { - segments := SecurityPartnerProviderId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityPartnerProviderId 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/network/2023-05-01/securitypartnerproviders/method_createorupdate.go b/resource-manager/network/2023-05-01/securitypartnerproviders/method_createorupdate.go deleted file mode 100644 index 3fb82d42ab3..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package securitypartnerproviders - -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 *SecurityPartnerProvider -} - -// CreateOrUpdate ... -func (c SecurityPartnerProvidersClient) CreateOrUpdate(ctx context.Context, id SecurityPartnerProviderId, input SecurityPartnerProvider) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SecurityPartnerProvidersClient) CreateOrUpdateThenPoll(ctx context.Context, id SecurityPartnerProviderId, input SecurityPartnerProvider) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/securitypartnerproviders/method_delete.go b/resource-manager/network/2023-05-01/securitypartnerproviders/method_delete.go deleted file mode 100644 index 9494188070d..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package securitypartnerproviders - -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 SecurityPartnerProvidersClient) Delete(ctx context.Context, id SecurityPartnerProviderId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 SecurityPartnerProvidersClient) DeleteThenPoll(ctx context.Context, id SecurityPartnerProviderId) 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/network/2023-05-01/securitypartnerproviders/method_get.go b/resource-manager/network/2023-05-01/securitypartnerproviders/method_get.go deleted file mode 100644 index ca56a913bc7..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securitypartnerproviders - -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 *SecurityPartnerProvider -} - -// Get ... -func (c SecurityPartnerProvidersClient) Get(ctx context.Context, id SecurityPartnerProviderId) (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 SecurityPartnerProvider - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/method_list.go b/resource-manager/network/2023-05-01/securitypartnerproviders/method_list.go deleted file mode 100644 index 6528ea5a212..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package securitypartnerproviders - -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 *[]SecurityPartnerProvider -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityPartnerProvider -} - -// List ... -func (c SecurityPartnerProvidersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/securityPartnerProviders", 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 *[]SecurityPartnerProvider `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 SecurityPartnerProvidersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SecurityPartnerProviderOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityPartnerProvidersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SecurityPartnerProviderOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityPartnerProvider, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/securitypartnerproviders/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/securitypartnerproviders/method_listbyresourcegroup.go deleted file mode 100644 index cd19693bff6..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package securitypartnerproviders - -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 *[]SecurityPartnerProvider -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityPartnerProvider -} - -// ListByResourceGroup ... -func (c SecurityPartnerProvidersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/securityPartnerProviders", 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 *[]SecurityPartnerProvider `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 SecurityPartnerProvidersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, SecurityPartnerProviderOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityPartnerProvidersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate SecurityPartnerProviderOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]SecurityPartnerProvider, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/securitypartnerproviders/method_updatetags.go b/resource-manager/network/2023-05-01/securitypartnerproviders/method_updatetags.go deleted file mode 100644 index 7cbef507221..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package securitypartnerproviders - -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 *SecurityPartnerProvider -} - -// UpdateTags ... -func (c SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, id SecurityPartnerProviderId, 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 SecurityPartnerProvider - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerprovider.go b/resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerprovider.go deleted file mode 100644 index 059710a7ff6..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerprovider.go +++ /dev/null @@ -1,14 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityPartnerProvider struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityPartnerProviderPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go b/resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go deleted file mode 100644 index 100f4648a9e..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityPartnerProviderPropertiesFormat struct { - ConnectionStatus *SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SecurityProviderName *SecurityProviderName `json:"securityProviderName,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/model_subresource.go b/resource-manager/network/2023-05-01/securitypartnerproviders/model_subresource.go deleted file mode 100644 index 0d259c7609a..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securitypartnerproviders/model_tagsobject.go b/resource-manager/network/2023-05-01/securitypartnerproviders/model_tagsobject.go deleted file mode 100644 index 64020cc08ef..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package securitypartnerproviders - -// 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/network/2023-05-01/securitypartnerproviders/predicates.go b/resource-manager/network/2023-05-01/securitypartnerproviders/predicates.go deleted file mode 100644 index ef826d6c55f..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityPartnerProviderOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p SecurityPartnerProviderOperationPredicate) Matches(input SecurityPartnerProvider) 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 && (input.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/network/2023-05-01/securitypartnerproviders/version.go b/resource-manager/network/2023-05-01/securitypartnerproviders/version.go deleted file mode 100644 index 2077579cd8b..00000000000 --- a/resource-manager/network/2023-05-01/securitypartnerproviders/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitypartnerproviders - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securitypartnerproviders/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/securityrules/README.md b/resource-manager/network/2023-05-01/securityrules/README.md deleted file mode 100644 index 110ab2e7b69..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/README.md +++ /dev/null @@ -1,115 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/securityrules` Documentation - -The `securityrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/securityrules" -``` - - -### Client Initialization - -```go -client := securityrules.NewSecurityRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -payload := securityrules.SecurityRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityRulesClient.DefaultSecurityRulesGet` - -```go -ctx := context.TODO() -id := securityrules.NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue") - -read, err := client.DefaultSecurityRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityRulesClient.DefaultSecurityRulesList` - -```go -ctx := context.TODO() -id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -// alternatively `client.DefaultSecurityRulesList(ctx, id)` can be used to do batched pagination -items, err := client.DefaultSecurityRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `SecurityRulesClient.Delete` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityRulesClient.Get` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -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: `SecurityRulesClient.List` - -```go -ctx := context.TODO() -id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -// 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/network/2023-05-01/securityrules/client.go b/resource-manager/network/2023-05-01/securityrules/client.go deleted file mode 100644 index 1fbf9b2c78c..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securityrules - -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 SecurityRulesClient struct { - Client *resourcemanager.Client -} - -func NewSecurityRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securityrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityRulesClient: %+v", err) - } - - return &SecurityRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/securityrules/constants.go b/resource-manager/network/2023-05-01/securityrules/constants.go deleted file mode 100644 index 41396358614..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/constants.go +++ /dev/null @@ -1,192 +0,0 @@ -package securityrules - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule.go b/resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule.go deleted file mode 100644 index a09823c4a35..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package securityrules - -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(&DefaultSecurityRuleId{}) -} - -var _ resourceids.ResourceId = &DefaultSecurityRuleId{} - -// DefaultSecurityRuleId is a struct representing the Resource ID for a Default Security Rule -type DefaultSecurityRuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string - DefaultSecurityRuleName string -} - -// NewDefaultSecurityRuleID returns a new DefaultSecurityRuleId struct -func NewDefaultSecurityRuleID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) DefaultSecurityRuleId { - return DefaultSecurityRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - DefaultSecurityRuleName: defaultSecurityRuleName, - } -} - -// ParseDefaultSecurityRuleID parses 'input' into a DefaultSecurityRuleId -func ParseDefaultSecurityRuleID(input string) (*DefaultSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DefaultSecurityRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DefaultSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDefaultSecurityRuleIDInsensitively parses 'input' case-insensitively into a DefaultSecurityRuleId -// note: this method should only be used for API response data and not user input -func ParseDefaultSecurityRuleIDInsensitively(input string) (*DefaultSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DefaultSecurityRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DefaultSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DefaultSecurityRuleId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - if id.DefaultSecurityRuleName, ok = input.Parsed["defaultSecurityRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "defaultSecurityRuleName", input) - } - - return nil -} - -// ValidateDefaultSecurityRuleID checks that 'input' can be parsed as a Default Security Rule ID -func ValidateDefaultSecurityRuleID(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 := ParseDefaultSecurityRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Default Security Rule ID -func (id DefaultSecurityRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s/defaultSecurityRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName, id.DefaultSecurityRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Default Security Rule ID -func (id DefaultSecurityRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - resourceids.StaticSegment("staticDefaultSecurityRules", "defaultSecurityRules", "defaultSecurityRules"), - resourceids.UserSpecifiedSegment("defaultSecurityRuleName", "defaultSecurityRuleValue"), - } -} - -// String returns a human-readable description of this Default Security Rule ID -func (id DefaultSecurityRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - fmt.Sprintf("Default Security Rule Name: %q", id.DefaultSecurityRuleName), - } - return fmt.Sprintf("Default Security Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule_test.go b/resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule_test.go deleted file mode 100644 index 1e58fe9d867..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/id_defaultsecurityrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package securityrules - -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 = &DefaultSecurityRuleId{} - -func TestNewDefaultSecurityRuleID(t *testing.T) { - id := NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } - - if id.DefaultSecurityRuleName != "defaultSecurityRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultSecurityRuleName'", id.DefaultSecurityRuleName, "defaultSecurityRuleValue") - } -} - -func TestFormatDefaultSecurityRuleID(t *testing.T) { - actual := NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDefaultSecurityRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DefaultSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue", - Expected: &DefaultSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - DefaultSecurityRuleName: "defaultSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDefaultSecurityRuleID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.DefaultSecurityRuleName != v.Expected.DefaultSecurityRuleName { - t.Fatalf("Expected %q but got %q for DefaultSecurityRuleName", v.Expected.DefaultSecurityRuleName, actual.DefaultSecurityRuleName) - } - - } -} - -func TestParseDefaultSecurityRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DefaultSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/dEfAuLtSeCuRiTyRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue", - Expected: &DefaultSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - DefaultSecurityRuleName: "defaultSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/dEfAuLtSeCuRiTyRuLeS/dEfAuLtSeCuRiTyRuLeVaLuE", - Expected: &DefaultSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - DefaultSecurityRuleName: "dEfAuLtSeCuRiTyRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/dEfAuLtSeCuRiTyRuLeS/dEfAuLtSeCuRiTyRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDefaultSecurityRuleIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.DefaultSecurityRuleName != v.Expected.DefaultSecurityRuleName { - t.Fatalf("Expected %q but got %q for DefaultSecurityRuleName", v.Expected.DefaultSecurityRuleName, actual.DefaultSecurityRuleName) - } - - } -} - -func TestSegmentsForDefaultSecurityRuleId(t *testing.T) { - segments := DefaultSecurityRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DefaultSecurityRuleId 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/network/2023-05-01/securityrules/id_networksecuritygroup.go b/resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup.go deleted file mode 100644 index 9b818e973d9..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package securityrules - -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(&NetworkSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkSecurityGroupId{} - -// NetworkSecurityGroupId is a struct representing the Resource ID for a Network Security Group -type NetworkSecurityGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string -} - -// NewNetworkSecurityGroupID returns a new NetworkSecurityGroupId struct -func NewNetworkSecurityGroupID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string) NetworkSecurityGroupId { - return NetworkSecurityGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - } -} - -// ParseNetworkSecurityGroupID parses 'input' into a NetworkSecurityGroupId -func ParseNetworkSecurityGroupID(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkSecurityGroupIDInsensitively parses 'input' case-insensitively into a NetworkSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkSecurityGroupIDInsensitively(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkSecurityGroupId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - return nil -} - -// ValidateNetworkSecurityGroupID checks that 'input' can be parsed as a Network Security Group ID -func ValidateNetworkSecurityGroupID(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 := ParseNetworkSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Security Group ID -func (id NetworkSecurityGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Security Group ID -func (id NetworkSecurityGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Network Security Group ID -func (id NetworkSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - } - return fmt.Sprintf("Network Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup_test.go b/resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup_test.go deleted file mode 100644 index cf49b48b01f..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/id_networksecuritygroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securityrules - -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 = &NetworkSecurityGroupId{} - -func TestNewNetworkSecurityGroupID(t *testing.T) { - id := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } -} - -func TestFormatNetworkSecurityGroupID(t *testing.T) { - actual := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestParseNetworkSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestSegmentsForNetworkSecurityGroupId(t *testing.T) { - segments := NetworkSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkSecurityGroupId 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/network/2023-05-01/securityrules/id_securityrule.go b/resource-manager/network/2023-05-01/securityrules/id_securityrule.go deleted file mode 100644 index da153b38f42..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/id_securityrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package securityrules - -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(&SecurityRuleId{}) -} - -var _ resourceids.ResourceId = &SecurityRuleId{} - -// SecurityRuleId is a struct representing the Resource ID for a Security Rule -type SecurityRuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string - SecurityRuleName string -} - -// NewSecurityRuleID returns a new SecurityRuleId struct -func NewSecurityRuleID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) SecurityRuleId { - return SecurityRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - SecurityRuleName: securityRuleName, - } -} - -// ParseSecurityRuleID parses 'input' into a SecurityRuleId -func ParseSecurityRuleID(input string) (*SecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityRuleIDInsensitively parses 'input' case-insensitively into a SecurityRuleId -// note: this method should only be used for API response data and not user input -func ParseSecurityRuleIDInsensitively(input string) (*SecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityRuleId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - if id.SecurityRuleName, ok = input.Parsed["securityRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityRuleName", input) - } - - return nil -} - -// ValidateSecurityRuleID checks that 'input' can be parsed as a Security Rule ID -func ValidateSecurityRuleID(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 := ParseSecurityRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Rule ID -func (id SecurityRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s/securityRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName, id.SecurityRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Rule ID -func (id SecurityRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - resourceids.StaticSegment("staticSecurityRules", "securityRules", "securityRules"), - resourceids.UserSpecifiedSegment("securityRuleName", "securityRuleValue"), - } -} - -// String returns a human-readable description of this Security Rule ID -func (id SecurityRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - fmt.Sprintf("Security Rule Name: %q", id.SecurityRuleName), - } - return fmt.Sprintf("Security Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/securityrules/id_securityrule_test.go b/resource-manager/network/2023-05-01/securityrules/id_securityrule_test.go deleted file mode 100644 index 199b413974f..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/id_securityrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package securityrules - -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 = &SecurityRuleId{} - -func TestNewSecurityRuleID(t *testing.T) { - id := NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } - - if id.SecurityRuleName != "securityRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityRuleName'", id.SecurityRuleName, "securityRuleValue") - } -} - -func TestFormatSecurityRuleID(t *testing.T) { - actual := NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue", - Expected: &SecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - SecurityRuleName: "securityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityRuleID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.SecurityRuleName != v.Expected.SecurityRuleName { - t.Fatalf("Expected %q but got %q for SecurityRuleName", v.Expected.SecurityRuleName, actual.SecurityRuleName) - } - - } -} - -func TestParseSecurityRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/sEcUrItYrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue", - Expected: &SecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - SecurityRuleName: "securityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/sEcUrItYrUlEs/sEcUrItYrUlEvAlUe", - Expected: &SecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - SecurityRuleName: "sEcUrItYrUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/sEcUrItYrUlEs/sEcUrItYrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityRuleIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.SecurityRuleName != v.Expected.SecurityRuleName { - t.Fatalf("Expected %q but got %q for SecurityRuleName", v.Expected.SecurityRuleName, actual.SecurityRuleName) - } - - } -} - -func TestSegmentsForSecurityRuleId(t *testing.T) { - segments := SecurityRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityRuleId 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/network/2023-05-01/securityrules/method_createorupdate.go b/resource-manager/network/2023-05-01/securityrules/method_createorupdate.go deleted file mode 100644 index ca2001b1716..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package securityrules - -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 *SecurityRule -} - -// CreateOrUpdate ... -func (c SecurityRulesClient) CreateOrUpdate(ctx context.Context, id SecurityRuleId, input SecurityRule) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SecurityRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id SecurityRuleId, input SecurityRule) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/securityrules/method_defaultsecurityrulesget.go b/resource-manager/network/2023-05-01/securityrules/method_defaultsecurityrulesget.go deleted file mode 100644 index a672fd767b7..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/method_defaultsecurityrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package securityrules - -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 DefaultSecurityRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SecurityRule -} - -// DefaultSecurityRulesGet ... -func (c SecurityRulesClient) DefaultSecurityRulesGet(ctx context.Context, id DefaultSecurityRuleId) (result DefaultSecurityRulesGetOperationResponse, 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 SecurityRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/securityrules/method_defaultsecurityruleslist.go b/resource-manager/network/2023-05-01/securityrules/method_defaultsecurityruleslist.go deleted file mode 100644 index f9c732abc47..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/method_defaultsecurityruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package securityrules - -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 DefaultSecurityRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]SecurityRule -} - -type DefaultSecurityRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityRule -} - -// DefaultSecurityRulesList ... -func (c SecurityRulesClient) DefaultSecurityRulesList(ctx context.Context, id NetworkSecurityGroupId) (result DefaultSecurityRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/defaultSecurityRules", 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 *[]SecurityRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DefaultSecurityRulesListComplete retrieves all the results into a single object -func (c SecurityRulesClient) DefaultSecurityRulesListComplete(ctx context.Context, id NetworkSecurityGroupId) (DefaultSecurityRulesListCompleteResult, error) { - return c.DefaultSecurityRulesListCompleteMatchingPredicate(ctx, id, SecurityRuleOperationPredicate{}) -} - -// DefaultSecurityRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityRulesClient) DefaultSecurityRulesListCompleteMatchingPredicate(ctx context.Context, id NetworkSecurityGroupId, predicate SecurityRuleOperationPredicate) (result DefaultSecurityRulesListCompleteResult, err error) { - items := make([]SecurityRule, 0) - - resp, err := c.DefaultSecurityRulesList(ctx, id) - if err != nil { - 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 = DefaultSecurityRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/securityrules/method_delete.go b/resource-manager/network/2023-05-01/securityrules/method_delete.go deleted file mode 100644 index 769b4866b0d..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package securityrules - -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 SecurityRulesClient) Delete(ctx context.Context, id SecurityRuleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 SecurityRulesClient) DeleteThenPoll(ctx context.Context, id SecurityRuleId) 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/network/2023-05-01/securityrules/method_get.go b/resource-manager/network/2023-05-01/securityrules/method_get.go deleted file mode 100644 index effcc9d3d7b..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securityrules - -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 *SecurityRule -} - -// Get ... -func (c SecurityRulesClient) Get(ctx context.Context, id SecurityRuleId) (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 SecurityRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/securityrules/method_list.go b/resource-manager/network/2023-05-01/securityrules/method_list.go deleted file mode 100644 index 752bb965b0b..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package securityrules - -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 *[]SecurityRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityRule -} - -// List ... -func (c SecurityRulesClient) List(ctx context.Context, id NetworkSecurityGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/securityRules", 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 *[]SecurityRule `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 SecurityRulesClient) ListComplete(ctx context.Context, id NetworkSecurityGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SecurityRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkSecurityGroupId, predicate SecurityRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/securityrules/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygroup.go deleted file mode 100644 index 7a6b77fa92a..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index b73ae024539..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securityrules/model_securityrule.go b/resource-manager/network/2023-05-01/securityrules/model_securityrule.go deleted file mode 100644 index e96cb57aa16..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securityrules/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/securityrules/model_securityrulepropertiesformat.go deleted file mode 100644 index a7e44555d95..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/securityrules/predicates.go b/resource-manager/network/2023-05-01/securityrules/predicates.go deleted file mode 100644 index adf918c9ac4..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SecurityRuleOperationPredicate) Matches(input SecurityRule) 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.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/network/2023-05-01/securityrules/version.go b/resource-manager/network/2023-05-01/securityrules/version.go deleted file mode 100644 index d8011565c28..00000000000 --- a/resource-manager/network/2023-05-01/securityrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securityrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/README.md b/resource-manager/network/2023-05-01/serviceendpointpolicies/README.md deleted file mode 100644 index a37e3f76474..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/serviceendpointpolicies` Documentation - -The `serviceendpointpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/serviceendpointpolicies" -``` - - -### Client Initialization - -```go -client := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -payload := serviceendpointpolicies.ServiceEndpointPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.Get` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -read, err := client.Get(ctx, id, serviceendpointpolicies.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -payload := serviceendpointpolicies.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/network/2023-05-01/serviceendpointpolicies/client.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/client.go deleted file mode 100644 index d92547bd44b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package serviceendpointpolicies - -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 ServiceEndpointPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewServiceEndpointPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceEndpointPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "serviceendpointpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServiceEndpointPoliciesClient: %+v", err) - } - - return &ServiceEndpointPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/constants.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/constants.go deleted file mode 100644 index e18805b64d6..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package serviceendpointpolicies - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy.go deleted file mode 100644 index 4b66cdb57fe..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package serviceendpointpolicies - -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(&ServiceEndpointPolicyId{}) -} - -var _ resourceids.ResourceId = &ServiceEndpointPolicyId{} - -// ServiceEndpointPolicyId is a struct representing the Resource ID for a Service Endpoint Policy -type ServiceEndpointPolicyId struct { - SubscriptionId string - ResourceGroupName string - ServiceEndpointPolicyName string -} - -// NewServiceEndpointPolicyID returns a new ServiceEndpointPolicyId struct -func NewServiceEndpointPolicyID(subscriptionId string, resourceGroupName string, serviceEndpointPolicyName string) ServiceEndpointPolicyId { - return ServiceEndpointPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServiceEndpointPolicyName: serviceEndpointPolicyName, - } -} - -// ParseServiceEndpointPolicyID parses 'input' into a ServiceEndpointPolicyId -func ParseServiceEndpointPolicyID(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServiceEndpointPolicyIDInsensitively parses 'input' case-insensitively into a ServiceEndpointPolicyId -// note: this method should only be used for API response data and not user input -func ParseServiceEndpointPolicyIDInsensitively(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServiceEndpointPolicyId) 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.ServiceEndpointPolicyName, ok = input.Parsed["serviceEndpointPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyName", input) - } - - return nil -} - -// ValidateServiceEndpointPolicyID checks that 'input' can be parsed as a Service Endpoint Policy ID -func ValidateServiceEndpointPolicyID(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 := ParseServiceEndpointPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/serviceEndpointPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServiceEndpointPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticServiceEndpointPolicies", "serviceEndpointPolicies", "serviceEndpointPolicies"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyName", "serviceEndpointPolicyValue"), - } -} - -// String returns a human-readable description of this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Service Endpoint Policy Name: %q", id.ServiceEndpointPolicyName), - } - return fmt.Sprintf("Service Endpoint Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go deleted file mode 100644 index b5a7b3cd151..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package serviceendpointpolicies - -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 = &ServiceEndpointPolicyId{} - -func TestNewServiceEndpointPolicyID(t *testing.T) { - id := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - - 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.ServiceEndpointPolicyName != "serviceEndpointPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyName'", id.ServiceEndpointPolicyName, "serviceEndpointPolicyValue") - } -} - -func TestFormatServiceEndpointPolicyID(t *testing.T) { - actual := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServiceEndpointPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyID(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestParseServiceEndpointPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceEndpointPolicyName: "sErViCeEnDpOiNtPoLiCyVaLuE", - }, - }, - { - // 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.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyIDInsensitively(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestSegmentsForServiceEndpointPolicyId(t *testing.T) { - segments := ServiceEndpointPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServiceEndpointPolicyId 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/network/2023-05-01/serviceendpointpolicies/method_createorupdate.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/method_createorupdate.go deleted file mode 100644 index 1912253430d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package serviceendpointpolicies - -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 *ServiceEndpointPolicy -} - -// CreateOrUpdate ... -func (c ServiceEndpointPoliciesClient) CreateOrUpdate(ctx context.Context, id ServiceEndpointPolicyId, input ServiceEndpointPolicy) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ServiceEndpointPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id ServiceEndpointPolicyId, input ServiceEndpointPolicy) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/serviceendpointpolicies/method_delete.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/method_delete.go deleted file mode 100644 index fbffd77bf76..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package serviceendpointpolicies - -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 ServiceEndpointPoliciesClient) Delete(ctx context.Context, id ServiceEndpointPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ServiceEndpointPoliciesClient) DeleteThenPoll(ctx context.Context, id ServiceEndpointPolicyId) 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/network/2023-05-01/serviceendpointpolicies/method_get.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/method_get.go deleted file mode 100644 index 4b9b1c2e323..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package serviceendpointpolicies - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ServiceEndpointPolicy -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c ServiceEndpointPoliciesClient) Get(ctx context.Context, id ServiceEndpointPolicyId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 ServiceEndpointPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_list.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/method_list.go deleted file mode 100644 index ebbd2768db1..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package serviceendpointpolicies - -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 *[]ServiceEndpointPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceEndpointPolicy -} - -// List ... -func (c ServiceEndpointPoliciesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/serviceEndpointPolicies", 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 *[]ServiceEndpointPolicy `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 ServiceEndpointPoliciesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ServiceEndpointPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceEndpointPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ServiceEndpointPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ServiceEndpointPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/serviceendpointpolicies/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/method_listbyresourcegroup.go deleted file mode 100644 index 8eb93c4ac68..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package serviceendpointpolicies - -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 *[]ServiceEndpointPolicy -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceEndpointPolicy -} - -// ListByResourceGroup ... -func (c ServiceEndpointPoliciesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/serviceEndpointPolicies", 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 *[]ServiceEndpointPolicy `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 ServiceEndpointPoliciesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ServiceEndpointPolicyOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceEndpointPoliciesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ServiceEndpointPolicyOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ServiceEndpointPolicy, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/serviceendpointpolicies/method_updatetags.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/method_updatetags.go deleted file mode 100644 index 92a472479ad..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package serviceendpointpolicies - -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 *ServiceEndpointPolicy -} - -// UpdateTags ... -func (c ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, id ServiceEndpointPolicyId, 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 ServiceEndpointPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 7a1f5258bb4..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 76bca3269ac..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 1e70d427a94..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 7f6bd42e1cc..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 15556d9d646..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygroup.go deleted file mode 100644 index 6e7d684d6ab..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 2f704e37983..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspool.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspool.go deleted file mode 100644 index feb93ad5475..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 4d71c4769d0..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 9f6fb9fe6e7..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ddossettings.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ddossettings.go deleted file mode 100644 index de52c73833f..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_delegation.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_delegation.go deleted file mode 100644 index 1e9e6e93b12..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlog.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlog.go deleted file mode 100644 index a657d2ccd92..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogformatparameters.go deleted file mode 100644 index 64ce02b9b62..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogpropertiesformat.go deleted file mode 100644 index c83c10c7197..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfiguration.go deleted file mode 100644 index 3460648e174..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package serviceendpointpolicies - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 27c417be79d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 253d53dc1d3..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrule.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrule.go deleted file mode 100644 index 691567f1623..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index bcdf56e4388..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfiguration.go deleted file mode 100644 index 43160da9e2b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofile.go deleted file mode 100644 index cbb4340c474..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index a8340bcc1f3..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index b76d67b91b5..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_iptag.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_iptag.go deleted file mode 100644 index 879d6210923..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// 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/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go deleted file mode 100644 index bcd25a343d4..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 71bfae4fc90..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgateway.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgateway.go deleted file mode 100644 index 4fce3c97a62..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package serviceendpointpolicies - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go deleted file mode 100644 index 0eae8e55e8c..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaysku.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaysku.go deleted file mode 100644 index d7c06ad6950..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natruleportmapping.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natruleportmapping.go deleted file mode 100644 index af408670c2d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterface.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterface.go deleted file mode 100644 index 4576b3d0a24..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacednssettings.go deleted file mode 100644 index f2f63e673ce..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go deleted file mode 100644 index efba2a7575d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index fee33255b2f..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index c09e2754047..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go deleted file mode 100644 index bdbb3dec753..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 373ac218872..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 1a2c2bc8774..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygroup.go deleted file mode 100644 index 7babf5dcba3..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 9e417934d4e..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpoint.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpoint.go deleted file mode 100644 index b9c2640063f..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnection.go deleted file mode 100644 index 0c67a94b069..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go deleted file mode 100644 index 9468576ebfd..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfiguration.go deleted file mode 100644 index 25ab508cf68..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index b2b9cd17391..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointproperties.go deleted file mode 100644 index b74aa311c14..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkservice.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkservice.go deleted file mode 100644 index f69adbd0b19..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnection.go deleted file mode 100644 index f163cad59d9..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index e9560116ef6..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 9accc19fd8b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index e2a71cb7416..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 6cc9d81d85e..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceproperties.go deleted file mode 100644 index 972989defcd..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddress.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddress.go deleted file mode 100644 index b3722e1f191..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddressdnssettings.go deleted file mode 100644 index d28111e34e8..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go deleted file mode 100644 index fe9e93dc57e..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresssku.go deleted file mode 100644 index 5d6c2dd1535..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlink.go deleted file mode 100644 index 3a125f5d30e..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go deleted file mode 100644 index 004d9d501d7..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourceset.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourceset.go deleted file mode 100644 index 33f79b6dd7f..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_retentionpolicyparameters.go deleted file mode 100644 index 98b48093fe5..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_route.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_route.go deleted file mode 100644 index a08219146cf..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routepropertiesformat.go deleted file mode 100644 index a2d74c7e24a..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetable.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetable.go deleted file mode 100644 index fabb0fc336d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetablepropertiesformat.go deleted file mode 100644 index fbf628f66f3..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrule.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrule.go deleted file mode 100644 index 3f50e5ddac6..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrulepropertiesformat.go deleted file mode 100644 index 8d5f321605a..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlink.go deleted file mode 100644 index a22d8f42829..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 5b81f28e88b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 0903abfa70e..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicy.go deleted file mode 100644 index 796d7019b02..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 75928dae7f1..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 31efd2eb7eb..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index fdb4ecd0a7f..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 2927331856d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnet.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnet.go deleted file mode 100644 index 50005077792..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnetpropertiesformat.go deleted file mode 100644 index c865a7a529b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subresource.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subresource.go deleted file mode 100644 index 61370085ffc..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_tagsobject.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_tagsobject.go deleted file mode 100644 index 7c5d750fc90..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// 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/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index da94c72fe29..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsproperties.go deleted file mode 100644 index 58889a80476..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktap.go deleted file mode 100644 index 1d191ff67f0..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 2660ce6a382..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicies/predicates.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/predicates.go deleted file mode 100644 index ddd972a1d9d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/predicates.go +++ /dev/null @@ -1,42 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyOperationPredicate struct { - Etag *string - Id *string - Kind *string - Location *string - Name *string - Type *string -} - -func (p ServiceEndpointPolicyOperationPredicate) Matches(input ServiceEndpointPolicy) 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.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { - return false - } - - if p.Location != nil && (input.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/network/2023-05-01/serviceendpointpolicies/version.go b/resource-manager/network/2023-05-01/serviceendpointpolicies/version.go deleted file mode 100644 index 5858616b3ea..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/README.md b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/README.md deleted file mode 100644 index 67f4c243a8d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions` Documentation - -The `serviceendpointpolicydefinitions` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/serviceendpointpolicydefinitions" -``` - - -### Client Initialization - -```go -client := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -payload := serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinition{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Delete` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Get` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -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: `ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -// 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 -} -``` diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/client.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/client.go deleted file mode 100644 index c75845bd1b5..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ServiceEndpointPolicyDefinitionsClient struct { - Client *resourcemanager.Client -} - -func NewServiceEndpointPolicyDefinitionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceEndpointPolicyDefinitionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "serviceendpointpolicydefinitions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServiceEndpointPolicyDefinitionsClient: %+v", err) - } - - return &ServiceEndpointPolicyDefinitionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/constants.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/constants.go deleted file mode 100644 index 3e91dc60d4b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go deleted file mode 100644 index 2d85c659986..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package serviceendpointpolicydefinitions - -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(&ServiceEndpointPolicyId{}) -} - -var _ resourceids.ResourceId = &ServiceEndpointPolicyId{} - -// ServiceEndpointPolicyId is a struct representing the Resource ID for a Service Endpoint Policy -type ServiceEndpointPolicyId struct { - SubscriptionId string - ResourceGroupName string - ServiceEndpointPolicyName string -} - -// NewServiceEndpointPolicyID returns a new ServiceEndpointPolicyId struct -func NewServiceEndpointPolicyID(subscriptionId string, resourceGroupName string, serviceEndpointPolicyName string) ServiceEndpointPolicyId { - return ServiceEndpointPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServiceEndpointPolicyName: serviceEndpointPolicyName, - } -} - -// ParseServiceEndpointPolicyID parses 'input' into a ServiceEndpointPolicyId -func ParseServiceEndpointPolicyID(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServiceEndpointPolicyIDInsensitively parses 'input' case-insensitively into a ServiceEndpointPolicyId -// note: this method should only be used for API response data and not user input -func ParseServiceEndpointPolicyIDInsensitively(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServiceEndpointPolicyId) 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.ServiceEndpointPolicyName, ok = input.Parsed["serviceEndpointPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyName", input) - } - - return nil -} - -// ValidateServiceEndpointPolicyID checks that 'input' can be parsed as a Service Endpoint Policy ID -func ValidateServiceEndpointPolicyID(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 := ParseServiceEndpointPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/serviceEndpointPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServiceEndpointPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticServiceEndpointPolicies", "serviceEndpointPolicies", "serviceEndpointPolicies"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyName", "serviceEndpointPolicyValue"), - } -} - -// String returns a human-readable description of this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Service Endpoint Policy Name: %q", id.ServiceEndpointPolicyName), - } - return fmt.Sprintf("Service Endpoint Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go deleted file mode 100644 index a5eee5d642d..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package serviceendpointpolicydefinitions - -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 = &ServiceEndpointPolicyId{} - -func TestNewServiceEndpointPolicyID(t *testing.T) { - id := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - - 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.ServiceEndpointPolicyName != "serviceEndpointPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyName'", id.ServiceEndpointPolicyName, "serviceEndpointPolicyValue") - } -} - -func TestFormatServiceEndpointPolicyID(t *testing.T) { - actual := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServiceEndpointPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyID(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestParseServiceEndpointPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceEndpointPolicyName: "sErViCeEnDpOiNtPoLiCyVaLuE", - }, - }, - { - // 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.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyIDInsensitively(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestSegmentsForServiceEndpointPolicyId(t *testing.T) { - segments := ServiceEndpointPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServiceEndpointPolicyId 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/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go deleted file mode 100644 index edee1adbeda..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,139 +0,0 @@ -package serviceendpointpolicydefinitions - -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(&ServiceEndpointPolicyDefinitionId{}) -} - -var _ resourceids.ResourceId = &ServiceEndpointPolicyDefinitionId{} - -// ServiceEndpointPolicyDefinitionId is a struct representing the Resource ID for a Service Endpoint Policy Definition -type ServiceEndpointPolicyDefinitionId struct { - SubscriptionId string - ResourceGroupName string - ServiceEndpointPolicyName string - ServiceEndpointPolicyDefinitionName string -} - -// NewServiceEndpointPolicyDefinitionID returns a new ServiceEndpointPolicyDefinitionId struct -func NewServiceEndpointPolicyDefinitionID(subscriptionId string, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) ServiceEndpointPolicyDefinitionId { - return ServiceEndpointPolicyDefinitionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServiceEndpointPolicyName: serviceEndpointPolicyName, - ServiceEndpointPolicyDefinitionName: serviceEndpointPolicyDefinitionName, - } -} - -// ParseServiceEndpointPolicyDefinitionID parses 'input' into a ServiceEndpointPolicyDefinitionId -func ParseServiceEndpointPolicyDefinitionID(input string) (*ServiceEndpointPolicyDefinitionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyDefinitionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyDefinitionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServiceEndpointPolicyDefinitionIDInsensitively parses 'input' case-insensitively into a ServiceEndpointPolicyDefinitionId -// note: this method should only be used for API response data and not user input -func ParseServiceEndpointPolicyDefinitionIDInsensitively(input string) (*ServiceEndpointPolicyDefinitionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyDefinitionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyDefinitionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServiceEndpointPolicyDefinitionId) 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.ServiceEndpointPolicyName, ok = input.Parsed["serviceEndpointPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyName", input) - } - - if id.ServiceEndpointPolicyDefinitionName, ok = input.Parsed["serviceEndpointPolicyDefinitionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyDefinitionName", input) - } - - return nil -} - -// ValidateServiceEndpointPolicyDefinitionID checks that 'input' can be parsed as a Service Endpoint Policy Definition ID -func ValidateServiceEndpointPolicyDefinitionID(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 := ParseServiceEndpointPolicyDefinitionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Service Endpoint Policy Definition ID -func (id ServiceEndpointPolicyDefinitionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/serviceEndpointPolicies/%s/serviceEndpointPolicyDefinitions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServiceEndpointPolicyName, id.ServiceEndpointPolicyDefinitionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Service Endpoint Policy Definition ID -func (id ServiceEndpointPolicyDefinitionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticServiceEndpointPolicies", "serviceEndpointPolicies", "serviceEndpointPolicies"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyName", "serviceEndpointPolicyValue"), - resourceids.StaticSegment("staticServiceEndpointPolicyDefinitions", "serviceEndpointPolicyDefinitions", "serviceEndpointPolicyDefinitions"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyDefinitionName", "serviceEndpointPolicyDefinitionValue"), - } -} - -// String returns a human-readable description of this Service Endpoint Policy Definition ID -func (id ServiceEndpointPolicyDefinitionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Service Endpoint Policy Name: %q", id.ServiceEndpointPolicyName), - fmt.Sprintf("Service Endpoint Policy Definition Name: %q", id.ServiceEndpointPolicyDefinitionName), - } - return fmt.Sprintf("Service Endpoint Policy Definition (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go deleted file mode 100644 index 7a15d1452f0..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package serviceendpointpolicydefinitions - -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 = &ServiceEndpointPolicyDefinitionId{} - -func TestNewServiceEndpointPolicyDefinitionID(t *testing.T) { - id := NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - - 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.ServiceEndpointPolicyName != "serviceEndpointPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyName'", id.ServiceEndpointPolicyName, "serviceEndpointPolicyValue") - } - - if id.ServiceEndpointPolicyDefinitionName != "serviceEndpointPolicyDefinitionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyDefinitionName'", id.ServiceEndpointPolicyDefinitionName, "serviceEndpointPolicyDefinitionValue") - } -} - -func TestFormatServiceEndpointPolicyDefinitionID(t *testing.T) { - actual := NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServiceEndpointPolicyDefinitionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyDefinitionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue", - Expected: &ServiceEndpointPolicyDefinitionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - ServiceEndpointPolicyDefinitionName: "serviceEndpointPolicyDefinitionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyDefinitionID(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - if actual.ServiceEndpointPolicyDefinitionName != v.Expected.ServiceEndpointPolicyDefinitionName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyDefinitionName", v.Expected.ServiceEndpointPolicyDefinitionName, actual.ServiceEndpointPolicyDefinitionName) - } - - } -} - -func TestParseServiceEndpointPolicyDefinitionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyDefinitionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue", - Expected: &ServiceEndpointPolicyDefinitionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - ServiceEndpointPolicyDefinitionName: "serviceEndpointPolicyDefinitionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnS/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnVaLuE", - Expected: &ServiceEndpointPolicyDefinitionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceEndpointPolicyName: "sErViCeEnDpOiNtPoLiCyVaLuE", - ServiceEndpointPolicyDefinitionName: "sErViCeEnDpOiNtPoLiCyDeFiNiTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnS/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyDefinitionIDInsensitively(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - if actual.ServiceEndpointPolicyDefinitionName != v.Expected.ServiceEndpointPolicyDefinitionName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyDefinitionName", v.Expected.ServiceEndpointPolicyDefinitionName, actual.ServiceEndpointPolicyDefinitionName) - } - - } -} - -func TestSegmentsForServiceEndpointPolicyDefinitionId(t *testing.T) { - segments := ServiceEndpointPolicyDefinitionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServiceEndpointPolicyDefinitionId 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/network/2023-05-01/serviceendpointpolicydefinitions/method_createorupdate.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_createorupdate.go deleted file mode 100644 index e75afb9fc02..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package serviceendpointpolicydefinitions - -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 *ServiceEndpointPolicyDefinition -} - -// CreateOrUpdate ... -func (c ServiceEndpointPolicyDefinitionsClient) CreateOrUpdate(ctx context.Context, id ServiceEndpointPolicyDefinitionId, input ServiceEndpointPolicyDefinition) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ServiceEndpointPolicyDefinitionId, input ServiceEndpointPolicyDefinition) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/serviceendpointpolicydefinitions/method_delete.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_delete.go deleted file mode 100644 index 81989f95364..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ServiceEndpointPolicyDefinitionsClient) Delete(ctx context.Context, id ServiceEndpointPolicyDefinitionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ServiceEndpointPolicyDefinitionsClient) DeleteThenPoll(ctx context.Context, id ServiceEndpointPolicyDefinitionId) 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/network/2023-05-01/serviceendpointpolicydefinitions/method_get.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_get.go deleted file mode 100644 index e9e63e50232..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package serviceendpointpolicydefinitions - -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 *ServiceEndpointPolicyDefinition -} - -// Get ... -func (c ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, id ServiceEndpointPolicyDefinitionId) (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 ServiceEndpointPolicyDefinition - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go deleted file mode 100644 index c6596cffc6c..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServiceEndpointPolicyDefinition -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceEndpointPolicyDefinition -} - -// ListByResourceGroup ... -func (c ServiceEndpointPolicyDefinitionsClient) ListByResourceGroup(ctx context.Context, id ServiceEndpointPolicyId) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceEndpointPolicyDefinitions", 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 *[]ServiceEndpointPolicyDefinition `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 ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupComplete(ctx context.Context, id ServiceEndpointPolicyId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ServiceEndpointPolicyDefinitionOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ServiceEndpointPolicyId, predicate ServiceEndpointPolicyDefinitionOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ServiceEndpointPolicyDefinition, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 012ba37fe47..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicydefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index ff7d49d8a5b..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicydefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/predicates.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/predicates.go deleted file mode 100644 index a7a08fa9deb..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package serviceendpointpolicydefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ServiceEndpointPolicyDefinitionOperationPredicate) Matches(input ServiceEndpointPolicyDefinition) 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.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/network/2023-05-01/serviceendpointpolicydefinitions/version.go b/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/version.go deleted file mode 100644 index 3240c898800..00000000000 --- a/resource-manager/network/2023-05-01/serviceendpointpolicydefinitions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicydefinitions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicydefinitions/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/servicetags/README.md b/resource-manager/network/2023-05-01/servicetags/README.md deleted file mode 100644 index 5b15b038d62..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/servicetags` Documentation - -The `servicetags` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/servicetags" -``` - - -### Client Initialization - -```go -client := servicetags.NewServiceTagsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceTagsClient.ServiceTagInformationList` - -```go -ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination -items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ServiceTagsClient.ServiceTagsList` - -```go -ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.ServiceTagsList(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/network/2023-05-01/servicetags/client.go b/resource-manager/network/2023-05-01/servicetags/client.go deleted file mode 100644 index 7037716c1cf..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package servicetags - -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 ServiceTagsClient struct { - Client *resourcemanager.Client -} - -func NewServiceTagsClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceTagsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "servicetags", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServiceTagsClient: %+v", err) - } - - return &ServiceTagsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/servicetags/id_location.go b/resource-manager/network/2023-05-01/servicetags/id_location.go deleted file mode 100644 index b22b2cb34d7..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package servicetags - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/servicetags/id_location_test.go b/resource-manager/network/2023-05-01/servicetags/id_location_test.go deleted file mode 100644 index 8a0f29aebb1..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package servicetags - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/servicetags/method_servicetaginformationlist.go b/resource-manager/network/2023-05-01/servicetags/method_servicetaginformationlist.go deleted file mode 100644 index 2254cab335c..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/method_servicetaginformationlist.go +++ /dev/null @@ -1,123 +0,0 @@ -package servicetags - -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 ServiceTagInformationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServiceTagInformation -} - -type ServiceTagInformationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceTagInformation -} - -type ServiceTagInformationListOperationOptions struct { - NoAddressPrefixes *bool - TagName *string -} - -func DefaultServiceTagInformationListOperationOptions() ServiceTagInformationListOperationOptions { - return ServiceTagInformationListOperationOptions{} -} - -func (o ServiceTagInformationListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ServiceTagInformationListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ServiceTagInformationListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.NoAddressPrefixes != nil { - out.Append("noAddressPrefixes", fmt.Sprintf("%v", *o.NoAddressPrefixes)) - } - if o.TagName != nil { - out.Append("tagName", fmt.Sprintf("%v", *o.TagName)) - } - return &out -} - -// ServiceTagInformationList ... -func (c ServiceTagsClient) ServiceTagInformationList(ctx context.Context, id LocationId, options ServiceTagInformationListOperationOptions) (result ServiceTagInformationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceTagDetails", id.ID()), - OptionsObject: options, - } - - 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 *[]ServiceTagInformation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ServiceTagInformationListComplete retrieves all the results into a single object -func (c ServiceTagsClient) ServiceTagInformationListComplete(ctx context.Context, id LocationId, options ServiceTagInformationListOperationOptions) (ServiceTagInformationListCompleteResult, error) { - return c.ServiceTagInformationListCompleteMatchingPredicate(ctx, id, options, ServiceTagInformationOperationPredicate{}) -} - -// ServiceTagInformationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceTagsClient) ServiceTagInformationListCompleteMatchingPredicate(ctx context.Context, id LocationId, options ServiceTagInformationListOperationOptions, predicate ServiceTagInformationOperationPredicate) (result ServiceTagInformationListCompleteResult, err error) { - items := make([]ServiceTagInformation, 0) - - resp, err := c.ServiceTagInformationList(ctx, id, options) - if err != nil { - 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 = ServiceTagInformationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/servicetags/method_servicetagslist.go b/resource-manager/network/2023-05-01/servicetags/method_servicetagslist.go deleted file mode 100644 index f83c293d79b..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/method_servicetagslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package servicetags - -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 ServiceTagsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ServiceTagsListResult -} - -// ServiceTagsList ... -func (c ServiceTagsClient) ServiceTagsList(ctx context.Context, id LocationId) (result ServiceTagsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceTags", 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 ServiceTagsListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/servicetags/model_servicetaginformation.go b/resource-manager/network/2023-05-01/servicetags/model_servicetaginformation.go deleted file mode 100644 index 705268a5bb9..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/model_servicetaginformation.go +++ /dev/null @@ -1,11 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagInformation struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceTagInformationPropertiesFormat `json:"properties,omitempty"` - ServiceTagChangeNumber *string `json:"serviceTagChangeNumber,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/servicetags/model_servicetaginformationpropertiesformat.go b/resource-manager/network/2023-05-01/servicetags/model_servicetaginformationpropertiesformat.go deleted file mode 100644 index 0d51bfcd8b2..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/model_servicetaginformationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagInformationPropertiesFormat struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ChangeNumber *string `json:"changeNumber,omitempty"` - Region *string `json:"region,omitempty"` - State *string `json:"state,omitempty"` - SystemService *string `json:"systemService,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/servicetags/model_servicetagslistresult.go b/resource-manager/network/2023-05-01/servicetags/model_servicetagslistresult.go deleted file mode 100644 index 9cfb2fb2afb..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/model_servicetagslistresult.go +++ /dev/null @@ -1,14 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagsListResult struct { - ChangeNumber *string `json:"changeNumber,omitempty"` - Cloud *string `json:"cloud,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - NextLink *string `json:"nextLink,omitempty"` - Type *string `json:"type,omitempty"` - Values *[]ServiceTagInformation `json:"values,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/servicetags/predicates.go b/resource-manager/network/2023-05-01/servicetags/predicates.go deleted file mode 100644 index e10bffe6a4f..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagInformationOperationPredicate struct { - Id *string - Name *string - ServiceTagChangeNumber *string -} - -func (p ServiceTagInformationOperationPredicate) Matches(input ServiceTagInformation) 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.ServiceTagChangeNumber != nil && (input.ServiceTagChangeNumber == nil || *p.ServiceTagChangeNumber != *input.ServiceTagChangeNumber) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/servicetags/version.go b/resource-manager/network/2023-05-01/servicetags/version.go deleted file mode 100644 index 0ac2ce4f53e..00000000000 --- a/resource-manager/network/2023-05-01/servicetags/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package servicetags - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/servicetags/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/staticmembers/README.md b/resource-manager/network/2023-05-01/staticmembers/README.md deleted file mode 100644 index a02be9bac91..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/staticmembers` Documentation - -The `staticmembers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/staticmembers" -``` - - -### Client Initialization - -```go -client := staticmembers.NewStaticMembersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `StaticMembersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -payload := staticmembers.StaticMember{ - // ... -} - - -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: `StaticMembersClient.Delete` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -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: `StaticMembersClient.Get` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -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: `StaticMembersClient.List` - -```go -ctx := context.TODO() -id := staticmembers.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -// alternatively `client.List(ctx, id, staticmembers.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, staticmembers.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/staticmembers/client.go b/resource-manager/network/2023-05-01/staticmembers/client.go deleted file mode 100644 index 0bd2daa81d6..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package staticmembers - -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 StaticMembersClient struct { - Client *resourcemanager.Client -} - -func NewStaticMembersClientWithBaseURI(sdkApi sdkEnv.Api) (*StaticMembersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "staticmembers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating StaticMembersClient: %+v", err) - } - - return &StaticMembersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/staticmembers/constants.go b/resource-manager/network/2023-05-01/staticmembers/constants.go deleted file mode 100644 index 3ccbd94262b..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package staticmembers - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/staticmembers/id_networkgroup.go b/resource-manager/network/2023-05-01/staticmembers/id_networkgroup.go deleted file mode 100644 index cbc610731ad..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/id_networkgroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package staticmembers - -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(&NetworkGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkGroupId{} - -// NetworkGroupId is a struct representing the Resource ID for a Network Group -type NetworkGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - NetworkGroupName string -} - -// NewNetworkGroupID returns a new NetworkGroupId struct -func NewNetworkGroupID(subscriptionId string, resourceGroupName string, networkManagerName string, networkGroupName string) NetworkGroupId { - return NetworkGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - NetworkGroupName: networkGroupName, - } -} - -// ParseNetworkGroupID parses 'input' into a NetworkGroupId -func ParseNetworkGroupID(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkGroupIDInsensitively parses 'input' case-insensitively into a NetworkGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkGroupIDInsensitively(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkGroupId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.NetworkGroupName, ok = input.Parsed["networkGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkGroupName", input) - } - - return nil -} - -// ValidateNetworkGroupID checks that 'input' can be parsed as a Network Group ID -func ValidateNetworkGroupID(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 := ParseNetworkGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Group ID -func (id NetworkGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/networkGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.NetworkGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Group ID -func (id NetworkGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticNetworkGroups", "networkGroups", "networkGroups"), - resourceids.UserSpecifiedSegment("networkGroupName", "networkGroupValue"), - } -} - -// String returns a human-readable description of this Network Group ID -func (id NetworkGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Network Group Name: %q", id.NetworkGroupName), - } - return fmt.Sprintf("Network Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/staticmembers/id_networkgroup_test.go b/resource-manager/network/2023-05-01/staticmembers/id_networkgroup_test.go deleted file mode 100644 index 04360c54808..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/id_networkgroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package staticmembers - -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 = &NetworkGroupId{} - -func TestNewNetworkGroupID(t *testing.T) { - id := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.NetworkGroupName != "networkGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkGroupName'", id.NetworkGroupName, "networkGroupValue") - } -} - -func TestFormatNetworkGroupID(t *testing.T) { - actual := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestParseNetworkGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - NetworkGroupName: "nEtWoRkGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestSegmentsForNetworkGroupId(t *testing.T) { - segments := NetworkGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkGroupId 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/network/2023-05-01/staticmembers/id_staticmember.go b/resource-manager/network/2023-05-01/staticmembers/id_staticmember.go deleted file mode 100644 index e972ef7ffc2..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/id_staticmember.go +++ /dev/null @@ -1,148 +0,0 @@ -package staticmembers - -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(&StaticMemberId{}) -} - -var _ resourceids.ResourceId = &StaticMemberId{} - -// StaticMemberId is a struct representing the Resource ID for a Static Member -type StaticMemberId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - NetworkGroupName string - StaticMemberName string -} - -// NewStaticMemberID returns a new StaticMemberId struct -func NewStaticMemberID(subscriptionId string, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) StaticMemberId { - return StaticMemberId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - NetworkGroupName: networkGroupName, - StaticMemberName: staticMemberName, - } -} - -// ParseStaticMemberID parses 'input' into a StaticMemberId -func ParseStaticMemberID(input string) (*StaticMemberId, error) { - parser := resourceids.NewParserFromResourceIdType(&StaticMemberId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StaticMemberId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseStaticMemberIDInsensitively parses 'input' case-insensitively into a StaticMemberId -// note: this method should only be used for API response data and not user input -func ParseStaticMemberIDInsensitively(input string) (*StaticMemberId, error) { - parser := resourceids.NewParserFromResourceIdType(&StaticMemberId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StaticMemberId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *StaticMemberId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.NetworkGroupName, ok = input.Parsed["networkGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkGroupName", input) - } - - if id.StaticMemberName, ok = input.Parsed["staticMemberName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "staticMemberName", input) - } - - return nil -} - -// ValidateStaticMemberID checks that 'input' can be parsed as a Static Member ID -func ValidateStaticMemberID(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 := ParseStaticMemberID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Static Member ID -func (id StaticMemberId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/networkGroups/%s/staticMembers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.NetworkGroupName, id.StaticMemberName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Static Member ID -func (id StaticMemberId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticNetworkGroups", "networkGroups", "networkGroups"), - resourceids.UserSpecifiedSegment("networkGroupName", "networkGroupValue"), - resourceids.StaticSegment("staticStaticMembers", "staticMembers", "staticMembers"), - resourceids.UserSpecifiedSegment("staticMemberName", "staticMemberValue"), - } -} - -// String returns a human-readable description of this Static Member ID -func (id StaticMemberId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Network Group Name: %q", id.NetworkGroupName), - fmt.Sprintf("Static Member Name: %q", id.StaticMemberName), - } - return fmt.Sprintf("Static Member (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/staticmembers/id_staticmember_test.go b/resource-manager/network/2023-05-01/staticmembers/id_staticmember_test.go deleted file mode 100644 index 80cf1ec36f0..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/id_staticmember_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package staticmembers - -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 = &StaticMemberId{} - -func TestNewStaticMemberID(t *testing.T) { - id := NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.NetworkGroupName != "networkGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkGroupName'", id.NetworkGroupName, "networkGroupValue") - } - - if id.StaticMemberName != "staticMemberValue" { - t.Fatalf("Expected %q but got %q for Segment 'StaticMemberName'", id.StaticMemberName, "staticMemberValue") - } -} - -func TestFormatStaticMemberID(t *testing.T) { - actual := NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseStaticMemberID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StaticMemberId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue", - Expected: &StaticMemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - StaticMemberName: "staticMemberValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStaticMemberID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - if actual.StaticMemberName != v.Expected.StaticMemberName { - t.Fatalf("Expected %q but got %q for StaticMemberName", v.Expected.StaticMemberName, actual.StaticMemberName) - } - - } -} - -func TestParseStaticMemberIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StaticMemberId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/sTaTiCmEmBeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue", - Expected: &StaticMemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - StaticMemberName: "staticMemberValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/sTaTiCmEmBeRs/sTaTiCmEmBeRvAlUe", - Expected: &StaticMemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - NetworkGroupName: "nEtWoRkGrOuPvAlUe", - StaticMemberName: "sTaTiCmEmBeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/sTaTiCmEmBeRs/sTaTiCmEmBeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStaticMemberIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - if actual.StaticMemberName != v.Expected.StaticMemberName { - t.Fatalf("Expected %q but got %q for StaticMemberName", v.Expected.StaticMemberName, actual.StaticMemberName) - } - - } -} - -func TestSegmentsForStaticMemberId(t *testing.T) { - segments := StaticMemberId{}.Segments() - if len(segments) == 0 { - t.Fatalf("StaticMemberId 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/network/2023-05-01/staticmembers/method_createorupdate.go b/resource-manager/network/2023-05-01/staticmembers/method_createorupdate.go deleted file mode 100644 index 6921f0aedf3..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package staticmembers - -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 *StaticMember -} - -// CreateOrUpdate ... -func (c StaticMembersClient) CreateOrUpdate(ctx context.Context, id StaticMemberId, input StaticMember) (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 StaticMember - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/staticmembers/method_delete.go b/resource-manager/network/2023-05-01/staticmembers/method_delete.go deleted file mode 100644 index 5709eca59ec..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package staticmembers - -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 StaticMembersClient) Delete(ctx context.Context, id StaticMemberId) (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/network/2023-05-01/staticmembers/method_get.go b/resource-manager/network/2023-05-01/staticmembers/method_get.go deleted file mode 100644 index 11fc970af6a..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package staticmembers - -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 *StaticMember -} - -// Get ... -func (c StaticMembersClient) Get(ctx context.Context, id StaticMemberId) (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 StaticMember - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/staticmembers/method_list.go b/resource-manager/network/2023-05-01/staticmembers/method_list.go deleted file mode 100644 index 61864b8f9e0..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package staticmembers - -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 *[]StaticMember -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []StaticMember -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c StaticMembersClient) List(ctx context.Context, id NetworkGroupId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/staticMembers", id.ID()), - OptionsObject: options, - } - - 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 *[]StaticMember `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 StaticMembersClient) ListComplete(ctx context.Context, id NetworkGroupId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, StaticMemberOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c StaticMembersClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkGroupId, options ListOperationOptions, predicate StaticMemberOperationPredicate) (result ListCompleteResult, err error) { - items := make([]StaticMember, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-05-01/staticmembers/model_staticmember.go b/resource-manager/network/2023-05-01/staticmembers/model_staticmember.go deleted file mode 100644 index b0d518168ea..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/model_staticmember.go +++ /dev/null @@ -1,17 +0,0 @@ -package staticmembers - -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 StaticMember struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *StaticMemberProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/staticmembers/model_staticmemberproperties.go b/resource-manager/network/2023-05-01/staticmembers/model_staticmemberproperties.go deleted file mode 100644 index 513dd3e5b9b..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/model_staticmemberproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package staticmembers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticMemberProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Region *string `json:"region,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/staticmembers/predicates.go b/resource-manager/network/2023-05-01/staticmembers/predicates.go deleted file mode 100644 index 0fb08a96da7..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package staticmembers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticMemberOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p StaticMemberOperationPredicate) Matches(input StaticMember) 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.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/network/2023-05-01/staticmembers/version.go b/resource-manager/network/2023-05-01/staticmembers/version.go deleted file mode 100644 index f51e7d495c1..00000000000 --- a/resource-manager/network/2023-05-01/staticmembers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package staticmembers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/staticmembers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/subnets/README.md b/resource-manager/network/2023-05-01/subnets/README.md deleted file mode 100644 index 5f0be741ae0..00000000000 --- a/resource-manager/network/2023-05-01/subnets/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/subnets` Documentation - -The `subnets` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/subnets" -``` - - -### Client Initialization - -```go -client := subnets.NewSubnetsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SubnetsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := subnets.Subnet{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SubnetsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SubnetsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -read, err := client.Get(ctx, id, subnets.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SubnetsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// 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/network/2023-05-01/subnets/client.go b/resource-manager/network/2023-05-01/subnets/client.go deleted file mode 100644 index b1f947b47be..00000000000 --- a/resource-manager/network/2023-05-01/subnets/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package subnets - -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 SubnetsClient struct { - Client *resourcemanager.Client -} - -func NewSubnetsClientWithBaseURI(sdkApi sdkEnv.Api) (*SubnetsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "subnets", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SubnetsClient: %+v", err) - } - - return &SubnetsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/subnets/constants.go b/resource-manager/network/2023-05-01/subnets/constants.go deleted file mode 100644 index dd21353a40b..00000000000 --- a/resource-manager/network/2023-05-01/subnets/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package subnets - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/subnets/method_createorupdate.go b/resource-manager/network/2023-05-01/subnets/method_createorupdate.go deleted file mode 100644 index 2f47359f975..00000000000 --- a/resource-manager/network/2023-05-01/subnets/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package subnets - -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 *Subnet -} - -// CreateOrUpdate ... -func (c SubnetsClient) CreateOrUpdate(ctx context.Context, id commonids.SubnetId, input Subnet) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SubnetsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.SubnetId, input Subnet) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/subnets/method_delete.go b/resource-manager/network/2023-05-01/subnets/method_delete.go deleted file mode 100644 index 8be424289f0..00000000000 --- a/resource-manager/network/2023-05-01/subnets/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package subnets - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c SubnetsClient) Delete(ctx context.Context, id commonids.SubnetId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 SubnetsClient) DeleteThenPoll(ctx context.Context, id commonids.SubnetId) 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/network/2023-05-01/subnets/method_get.go b/resource-manager/network/2023-05-01/subnets/method_get.go deleted file mode 100644 index f43b6e2df8f..00000000000 --- a/resource-manager/network/2023-05-01/subnets/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package subnets - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Subnet -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c SubnetsClient) Get(ctx context.Context, id commonids.SubnetId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 Subnet - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/subnets/method_list.go b/resource-manager/network/2023-05-01/subnets/method_list.go deleted file mode 100644 index 15440075e11..00000000000 --- a/resource-manager/network/2023-05-01/subnets/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package subnets - -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 *[]Subnet -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Subnet -} - -// List ... -func (c SubnetsClient) List(ctx context.Context, id commonids.VirtualNetworkId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/subnets", 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 *[]Subnet `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 SubnetsClient) ListComplete(ctx context.Context, id commonids.VirtualNetworkId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SubnetOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SubnetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, predicate SubnetOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Subnet, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/subnets/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 3788306fb6c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 916f79f9c4c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 5cb3ab5e50f..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 2064f06b67c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index ba5d67b2ce4..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/subnets/model_applicationsecuritygroup.go deleted file mode 100644 index 2b7038a9661..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 0444d465786..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_backendaddresspool.go b/resource-manager/network/2023-05-01/subnets/model_backendaddresspool.go deleted file mode 100644 index 8549e5db3a8..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 561224fe97e..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index b8332f10ecf..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_ddossettings.go b/resource-manager/network/2023-05-01/subnets/model_ddossettings.go deleted file mode 100644 index d48851a6ba1..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_delegation.go b/resource-manager/network/2023-05-01/subnets/model_delegation.go deleted file mode 100644 index 541d9d1d34b..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_flowlog.go b/resource-manager/network/2023-05-01/subnets/model_flowlog.go deleted file mode 100644 index d350c16ef43..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/subnets/model_flowlogformatparameters.go deleted file mode 100644 index 492844afa0c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_flowlogpropertiesformat.go deleted file mode 100644 index a2a70e0c856..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_frontendipconfiguration.go deleted file mode 100644 index f24121e7c39..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package subnets - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 3c86535825a..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/subnets/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 3d2ff9b3010..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_inboundnatrule.go b/resource-manager/network/2023-05-01/subnets/model_inboundnatrule.go deleted file mode 100644 index dd23aa7a490..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index ac29e9fd37d..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_ipconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_ipconfiguration.go deleted file mode 100644 index 3e2e5516ea9..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofile.go deleted file mode 100644 index a4d5be3c038..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index bfb28994f14..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 4814acb3e8e..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_iptag.go b/resource-manager/network/2023-05-01/subnets/model_iptag.go deleted file mode 100644 index 8ccc055cb31..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// 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/network/2023-05-01/subnets/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddress.go deleted file mode 100644 index e3b148912e3..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index ee7815f178d..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_natgateway.go b/resource-manager/network/2023-05-01/subnets/model_natgateway.go deleted file mode 100644 index 9a8fad20def..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package subnets - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_natgatewaypropertiesformat.go deleted file mode 100644 index e9043897c52..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_natgatewaysku.go b/resource-manager/network/2023-05-01/subnets/model_natgatewaysku.go deleted file mode 100644 index 617e7c19ff3..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_natruleportmapping.go b/resource-manager/network/2023-05-01/subnets/model_natruleportmapping.go deleted file mode 100644 index 1e546cf811d..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterface.go b/resource-manager/network/2023-05-01/subnets/model_networkinterface.go deleted file mode 100644 index 06d849fad90..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfacednssettings.go deleted file mode 100644 index 67fcb29afe7..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfiguration.go deleted file mode 100644 index dea0691831d..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 51e7195920f..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index bc6e9588ae5..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfacepropertiesformat.go deleted file mode 100644 index dadc9421016..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 2cd16be245c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 1bc23cee100..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/subnets/model_networksecuritygroup.go deleted file mode 100644 index fa06f5f24cc..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index da7b074dbbf..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privateendpoint.go b/resource-manager/network/2023-05-01/subnets/model_privateendpoint.go deleted file mode 100644 index 4fa549c3b13..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/subnets/model_privateendpointconnection.go deleted file mode 100644 index 1e354419cca..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/subnets/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/subnets/model_privateendpointconnectionproperties.go deleted file mode 100644 index ff12b5a54fc..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_privateendpointipconfiguration.go deleted file mode 100644 index 20625cb09d3..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/subnets/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 5d90f3c61bf..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/subnets/model_privateendpointproperties.go deleted file mode 100644 index 4913ece3049..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkservice.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkservice.go deleted file mode 100644 index 34c00e7cffb..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnection.go deleted file mode 100644 index af937a19eda..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index d6ad965c136..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 4072e649f7a..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index c48e1e87c65..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index eccb8844155..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceproperties.go deleted file mode 100644 index 0f4d213769b..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_publicipaddress.go b/resource-manager/network/2023-05-01/subnets/model_publicipaddress.go deleted file mode 100644 index 9931f78d236..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/subnets/model_publicipaddressdnssettings.go deleted file mode 100644 index d002238e788..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_publicipaddresspropertiesformat.go deleted file mode 100644 index c8c5eb4251a..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/subnets/model_publicipaddresssku.go deleted file mode 100644 index 21dd8f7d664..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/subnets/model_resourcenavigationlink.go deleted file mode 100644 index fcd37a760e6..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/subnets/model_resourcenavigationlinkformat.go deleted file mode 100644 index 103426fc9c3..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_resourceset.go b/resource-manager/network/2023-05-01/subnets/model_resourceset.go deleted file mode 100644 index 5daeebab425..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/subnets/model_retentionpolicyparameters.go deleted file mode 100644 index 8ea922b85fe..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_route.go b/resource-manager/network/2023-05-01/subnets/model_route.go deleted file mode 100644 index e40ded16b00..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_routepropertiesformat.go deleted file mode 100644 index c87b62acaed..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_routetable.go b/resource-manager/network/2023-05-01/subnets/model_routetable.go deleted file mode 100644 index 6bb137b8242..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_routetablepropertiesformat.go deleted file mode 100644 index 07d88ea8a30..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_securityrule.go b/resource-manager/network/2023-05-01/subnets/model_securityrule.go deleted file mode 100644 index 70772203f7b..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_securityrulepropertiesformat.go deleted file mode 100644 index cad2dbd820c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/subnets/model_serviceassociationlink.go deleted file mode 100644 index c82eae5ac15..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index f1a92b71485..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 1680e52b8a1..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicy.go deleted file mode 100644 index 68813a7b3e8..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 8fa72c305ed..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index b7b56f401a8..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 5e0804aa438..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 7011fc209c0..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_subnet.go b/resource-manager/network/2023-05-01/subnets/model_subnet.go deleted file mode 100644 index 820673d7c16..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_subnetpropertiesformat.go deleted file mode 100644 index cf86a7a7e59..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_subresource.go b/resource-manager/network/2023-05-01/subnets/model_subresource.go deleted file mode 100644 index d986a303819..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/subnets/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index e93599e3f9c..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/subnets/model_trafficanalyticsproperties.go deleted file mode 100644 index fa6abc84aef..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/subnets/model_virtualnetworktap.go deleted file mode 100644 index f9e8be401f9..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/subnets/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index c8b60852b33..00000000000 --- a/resource-manager/network/2023-05-01/subnets/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/subnets/predicates.go b/resource-manager/network/2023-05-01/subnets/predicates.go deleted file mode 100644 index 33b8979e3cc..00000000000 --- a/resource-manager/network/2023-05-01/subnets/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SubnetOperationPredicate) Matches(input Subnet) 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.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/network/2023-05-01/subnets/version.go b/resource-manager/network/2023-05-01/subnets/version.go deleted file mode 100644 index fa91313470d..00000000000 --- a/resource-manager/network/2023-05-01/subnets/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/subnets/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/README.md b/resource-manager/network/2023-05-01/trafficanalytics/README.md deleted file mode 100644 index a0b057ca7ce..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/trafficanalytics` Documentation - -The `trafficanalytics` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/trafficanalytics" -``` - - -### Client Initialization - -```go -client := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `TrafficAnalyticsClient.NetworkWatchersGetFlowLogStatus` - -```go -ctx := context.TODO() -id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := trafficanalytics.FlowLogStatusParameters{ - // ... -} - - -if err := client.NetworkWatchersGetFlowLogStatusThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `TrafficAnalyticsClient.NetworkWatchersSetFlowLogConfiguration` - -```go -ctx := context.TODO() -id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := trafficanalytics.FlowLogInformation{ - // ... -} - - -if err := client.NetworkWatchersSetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/trafficanalytics/client.go b/resource-manager/network/2023-05-01/trafficanalytics/client.go deleted file mode 100644 index 78e1d6ab331..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package trafficanalytics - -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 TrafficAnalyticsClient struct { - Client *resourcemanager.Client -} - -func NewTrafficAnalyticsClientWithBaseURI(sdkApi sdkEnv.Api) (*TrafficAnalyticsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "trafficanalytics", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating TrafficAnalyticsClient: %+v", err) - } - - return &TrafficAnalyticsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/constants.go b/resource-manager/network/2023-05-01/trafficanalytics/constants.go deleted file mode 100644 index 54031e636e9..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/constants.go +++ /dev/null @@ -1,48 +0,0 @@ -package trafficanalytics - -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 FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher.go b/resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher.go deleted file mode 100644 index f13408f03b5..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package trafficanalytics - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher_test.go b/resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher_test.go deleted file mode 100644 index 8edd286c390..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package trafficanalytics - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-05-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go b/resource-manager/network/2023-05-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go deleted file mode 100644 index 279a26b8a48..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go +++ /dev/null @@ -1,75 +0,0 @@ -package trafficanalytics - -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 NetworkWatchersGetFlowLogStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// NetworkWatchersGetFlowLogStatus ... -func (c TrafficAnalyticsClient) NetworkWatchersGetFlowLogStatus(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) (result NetworkWatchersGetFlowLogStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryFlowLogStatus", 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 -} - -// NetworkWatchersGetFlowLogStatusThenPoll performs NetworkWatchersGetFlowLogStatus then polls until it's completed -func (c TrafficAnalyticsClient) NetworkWatchersGetFlowLogStatusThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) error { - result, err := c.NetworkWatchersGetFlowLogStatus(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkWatchersGetFlowLogStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkWatchersGetFlowLogStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go b/resource-manager/network/2023-05-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go deleted file mode 100644 index 859ca423b3c..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go +++ /dev/null @@ -1,75 +0,0 @@ -package trafficanalytics - -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 NetworkWatchersSetFlowLogConfigurationOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// NetworkWatchersSetFlowLogConfiguration ... -func (c TrafficAnalyticsClient) NetworkWatchersSetFlowLogConfiguration(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) (result NetworkWatchersSetFlowLogConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/configureFlowLog", 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 -} - -// NetworkWatchersSetFlowLogConfigurationThenPoll performs NetworkWatchersSetFlowLogConfiguration then polls until it's completed -func (c TrafficAnalyticsClient) NetworkWatchersSetFlowLogConfigurationThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) error { - result, err := c.NetworkWatchersSetFlowLogConfiguration(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkWatchersSetFlowLogConfiguration: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkWatchersSetFlowLogConfiguration: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogformatparameters.go deleted file mode 100644 index 87ffe400a44..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_flowloginformation.go b/resource-manager/network/2023-05-01/trafficanalytics/model_flowloginformation.go deleted file mode 100644 index 15a1cc0029d..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_flowloginformation.go +++ /dev/null @@ -1,10 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogInformation struct { - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Properties FlowLogProperties `json:"properties"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogproperties.go b/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogproperties.go deleted file mode 100644 index b26bd4b572a..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogProperties struct { - Enabled bool `json:"enabled"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogstatusparameters.go b/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogstatusparameters.go deleted file mode 100644 index a066e2ad70a..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_flowlogstatusparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogStatusParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/trafficanalytics/model_retentionpolicyparameters.go deleted file mode 100644 index b432d3a27f0..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 01350bb98c2..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsproperties.go deleted file mode 100644 index 94df925e175..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/trafficanalytics/version.go b/resource-manager/network/2023-05-01/trafficanalytics/version.go deleted file mode 100644 index 105f93eeaa4..00000000000 --- a/resource-manager/network/2023-05-01/trafficanalytics/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package trafficanalytics - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/trafficanalytics/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/usages/README.md b/resource-manager/network/2023-05-01/usages/README.md deleted file mode 100644 index 5990c754d2b..00000000000 --- a/resource-manager/network/2023-05-01/usages/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/usages` Documentation - -The `usages` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/usages" -``` - - -### Client Initialization - -```go -client := usages.NewUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UsagesClient.List` - -```go -ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// 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/network/2023-05-01/usages/client.go b/resource-manager/network/2023-05-01/usages/client.go deleted file mode 100644 index 772d6a5be35..00000000000 --- a/resource-manager/network/2023-05-01/usages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package usages - -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 UsagesClient struct { - Client *resourcemanager.Client -} - -func NewUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*UsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "usages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UsagesClient: %+v", err) - } - - return &UsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/usages/constants.go b/resource-manager/network/2023-05-01/usages/constants.go deleted file mode 100644 index 0d8916ba5aa..00000000000 --- a/resource-manager/network/2023-05-01/usages/constants.go +++ /dev/null @@ -1,48 +0,0 @@ -package usages - -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 UsageUnit string - -const ( - UsageUnitCount UsageUnit = "Count" -) - -func PossibleValuesForUsageUnit() []string { - return []string{ - string(UsageUnitCount), - } -} - -func (s *UsageUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUsageUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUsageUnit(input string) (*UsageUnit, error) { - vals := map[string]UsageUnit{ - "count": UsageUnitCount, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsageUnit(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/usages/id_location.go b/resource-manager/network/2023-05-01/usages/id_location.go deleted file mode 100644 index 6499c99bc79..00000000000 --- a/resource-manager/network/2023-05-01/usages/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package usages - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-05-01/usages/id_location_test.go b/resource-manager/network/2023-05-01/usages/id_location_test.go deleted file mode 100644 index 90cb643f003..00000000000 --- a/resource-manager/network/2023-05-01/usages/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package usages - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-05-01/usages/method_list.go b/resource-manager/network/2023-05-01/usages/method_list.go deleted file mode 100644 index efe2516e27a..00000000000 --- a/resource-manager/network/2023-05-01/usages/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package usages - -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 *[]Usage -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Usage -} - -// List ... -func (c UsagesClient) List(ctx context.Context, id LocationId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 *[]Usage `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 UsagesClient) ListComplete(ctx context.Context, id LocationId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UsageOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UsagesClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate UsageOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Usage, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/usages/model_usage.go b/resource-manager/network/2023-05-01/usages/model_usage.go deleted file mode 100644 index 2a734980b2c..00000000000 --- a/resource-manager/network/2023-05-01/usages/model_usage.go +++ /dev/null @@ -1,12 +0,0 @@ -package usages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Usage struct { - CurrentValue int64 `json:"currentValue"` - Id *string `json:"id,omitempty"` - Limit int64 `json:"limit"` - Name UsageName `json:"name"` - Unit UsageUnit `json:"unit"` -} diff --git a/resource-manager/network/2023-05-01/usages/model_usagename.go b/resource-manager/network/2023-05-01/usages/model_usagename.go deleted file mode 100644 index ff2d9cbdd3e..00000000000 --- a/resource-manager/network/2023-05-01/usages/model_usagename.go +++ /dev/null @@ -1,9 +0,0 @@ -package usages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UsageName struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/usages/predicates.go b/resource-manager/network/2023-05-01/usages/predicates.go deleted file mode 100644 index ad3b401c1ce..00000000000 --- a/resource-manager/network/2023-05-01/usages/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package usages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UsageOperationPredicate struct { - CurrentValue *int64 - Id *string - Limit *int64 -} - -func (p UsageOperationPredicate) Matches(input Usage) bool { - - if p.CurrentValue != nil && *p.CurrentValue != input.CurrentValue { - return false - } - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Limit != nil && *p.Limit != input.Limit { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/usages/version.go b/resource-manager/network/2023-05-01/usages/version.go deleted file mode 100644 index c3fe8121163..00000000000 --- a/resource-manager/network/2023-05-01/usages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package usages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/usages/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/vipswap/README.md b/resource-manager/network/2023-05-01/vipswap/README.md deleted file mode 100644 index e9dbfa11521..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/README.md +++ /dev/null @@ -1,69 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vipswap` Documentation - -The `vipswap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/vipswap" -``` - - -### Client Initialization - -```go -client := vipswap.NewVipSwapClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VipSwapClient.Create` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -payload := vipswap.SwapResource{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VipSwapClient.Get` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -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: `VipSwapClient.List` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -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/network/2023-05-01/vipswap/client.go b/resource-manager/network/2023-05-01/vipswap/client.go deleted file mode 100644 index 2a7d8c2afe7..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vipswap - -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 VipSwapClient struct { - Client *resourcemanager.Client -} - -func NewVipSwapClientWithBaseURI(sdkApi sdkEnv.Api) (*VipSwapClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vipswap", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VipSwapClient: %+v", err) - } - - return &VipSwapClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/vipswap/constants.go b/resource-manager/network/2023-05-01/vipswap/constants.go deleted file mode 100644 index c6cf7234532..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package vipswap - -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 SlotType string - -const ( - SlotTypeProduction SlotType = "Production" - SlotTypeStaging SlotType = "Staging" -) - -func PossibleValuesForSlotType() []string { - return []string{ - string(SlotTypeProduction), - string(SlotTypeStaging), - } -} - -func (s *SlotType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSlotType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSlotType(input string) (*SlotType, error) { - vals := map[string]SlotType{ - "production": SlotTypeProduction, - "staging": SlotTypeStaging, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SlotType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/vipswap/id_cloudservice.go b/resource-manager/network/2023-05-01/vipswap/id_cloudservice.go deleted file mode 100644 index 5801e90709d..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/id_cloudservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package vipswap - -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(&CloudServiceId{}) -} - -var _ resourceids.ResourceId = &CloudServiceId{} - -// CloudServiceId is a struct representing the Resource ID for a Cloud Service -type CloudServiceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string -} - -// NewCloudServiceID returns a new CloudServiceId struct -func NewCloudServiceID(subscriptionId string, resourceGroupName string, cloudServiceName string) CloudServiceId { - return CloudServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - } -} - -// ParseCloudServiceID parses 'input' into a CloudServiceId -func ParseCloudServiceID(input string) (*CloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&CloudServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCloudServiceIDInsensitively parses 'input' case-insensitively into a CloudServiceId -// note: this method should only be used for API response data and not user input -func ParseCloudServiceIDInsensitively(input string) (*CloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&CloudServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CloudServiceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - return nil -} - -// ValidateCloudServiceID checks that 'input' can be parsed as a Cloud Service ID -func ValidateCloudServiceID(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 := ParseCloudServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cloud Service ID -func (id CloudServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cloud Service ID -func (id CloudServiceId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - } -} - -// String returns a human-readable description of this Cloud Service ID -func (id CloudServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - } - return fmt.Sprintf("Cloud Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2023-05-01/vipswap/id_cloudservice_test.go deleted file mode 100644 index 0184ee4262a..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/id_cloudservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vipswap - -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 = &CloudServiceId{} - -func TestNewCloudServiceID(t *testing.T) { - id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } -} - -func TestFormatCloudServiceID(t *testing.T) { - actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCloudServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CloudServiceId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &CloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCloudServiceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestParseCloudServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CloudServiceId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &CloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Expected: &CloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCloudServiceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestSegmentsForCloudServiceId(t *testing.T) { - segments := CloudServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CloudServiceId 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/network/2023-05-01/vipswap/method_create.go b/resource-manager/network/2023-05-01/vipswap/method_create.go deleted file mode 100644 index c7db22cb3af..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/method_create.go +++ /dev/null @@ -1,74 +0,0 @@ -package vipswap - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Create ... -func (c VipSwapClient) Create(ctx context.Context, id CloudServiceId, input SwapResource) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/cloudServiceSlots/swap", 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 -} - -// CreateThenPoll performs Create then polls until it's completed -func (c VipSwapClient) CreateThenPoll(ctx context.Context, id CloudServiceId, input SwapResource) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/vipswap/method_get.go b/resource-manager/network/2023-05-01/vipswap/method_get.go deleted file mode 100644 index 2d61c8f37e0..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package vipswap - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SwapResource -} - -// Get ... -func (c VipSwapClient) Get(ctx context.Context, id CloudServiceId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/cloudServiceSlots/swap", 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 SwapResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/vipswap/method_list.go b/resource-manager/network/2023-05-01/vipswap/method_list.go deleted file mode 100644 index 32407cc2c5c..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package vipswap - -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 *SwapResourceListResult -} - -// List ... -func (c VipSwapClient) List(ctx context.Context, id CloudServiceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/cloudServiceSlots", 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 SwapResourceListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/vipswap/model_swapresource.go b/resource-manager/network/2023-05-01/vipswap/model_swapresource.go deleted file mode 100644 index cd135639ade..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/model_swapresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package vipswap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SwapResource struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SwapResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vipswap/model_swapresourcelistresult.go b/resource-manager/network/2023-05-01/vipswap/model_swapresourcelistresult.go deleted file mode 100644 index d4cb9490d3a..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/model_swapresourcelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package vipswap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SwapResourceListResult struct { - Value *[]SwapResource `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vipswap/model_swapresourceproperties.go b/resource-manager/network/2023-05-01/vipswap/model_swapresourceproperties.go deleted file mode 100644 index 8254763b326..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/model_swapresourceproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vipswap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SwapResourceProperties struct { - SlotType *SlotType `json:"slotType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vipswap/version.go b/resource-manager/network/2023-05-01/vipswap/version.go deleted file mode 100644 index de9158fe704..00000000000 --- a/resource-manager/network/2023-05-01/vipswap/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vipswap - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vipswap/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/README.md b/resource-manager/network/2023-05-01/virtualappliancesites/README.md deleted file mode 100644 index 98a59822244..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualappliancesites` Documentation - -The `virtualappliancesites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualappliancesites" -``` - - -### Client Initialization - -```go -client := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualApplianceSitesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -payload := virtualappliancesites.VirtualApplianceSite{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualApplianceSitesClient.Delete` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualApplianceSitesClient.Get` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -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: `VirtualApplianceSitesClient.List` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -// 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/network/2023-05-01/virtualappliancesites/client.go b/resource-manager/network/2023-05-01/virtualappliancesites/client.go deleted file mode 100644 index 415b8e6e46b..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualappliancesites - -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 VirtualApplianceSitesClient struct { - Client *resourcemanager.Client -} - -func NewVirtualApplianceSitesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualApplianceSitesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualappliancesites", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualApplianceSitesClient: %+v", err) - } - - return &VirtualApplianceSitesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/constants.go b/resource-manager/network/2023-05-01/virtualappliancesites/constants.go deleted file mode 100644 index bd413f43290..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package virtualappliancesites - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance.go b/resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance.go deleted file mode 100644 index d414a3c2d42..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualappliancesites - -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(&NetworkVirtualApplianceId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceId{} - -// NetworkVirtualApplianceId is a struct representing the Resource ID for a Network Virtual Appliance -type NetworkVirtualApplianceId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string -} - -// NewNetworkVirtualApplianceID returns a new NetworkVirtualApplianceId struct -func NewNetworkVirtualApplianceID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string) NetworkVirtualApplianceId { - return NetworkVirtualApplianceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - } -} - -// ParseNetworkVirtualApplianceID parses 'input' into a NetworkVirtualApplianceId -func ParseNetworkVirtualApplianceID(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceIDInsensitively(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceID checks that 'input' can be parsed as a Network Virtual Appliance ID -func ValidateNetworkVirtualApplianceID(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 := ParseNetworkVirtualApplianceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - } - return fmt.Sprintf("Network Virtual Appliance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance_test.go b/resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance_test.go deleted file mode 100644 index e09dcbc11c4..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/id_networkvirtualappliance_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualappliancesites - -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 = &NetworkVirtualApplianceId{} - -func TestNewNetworkVirtualApplianceID(t *testing.T) { - id := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } -} - -func TestFormatNetworkVirtualApplianceID(t *testing.T) { - actual := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestParseNetworkVirtualApplianceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceId(t *testing.T) { - segments := NetworkVirtualApplianceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceId 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/network/2023-05-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite.go deleted file mode 100644 index a0500e43c74..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualappliancesites - -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(&VirtualApplianceSiteId{}) -} - -var _ resourceids.ResourceId = &VirtualApplianceSiteId{} - -// VirtualApplianceSiteId is a struct representing the Resource ID for a Virtual Appliance Site -type VirtualApplianceSiteId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string - VirtualApplianceSiteName string -} - -// NewVirtualApplianceSiteID returns a new VirtualApplianceSiteId struct -func NewVirtualApplianceSiteID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string, virtualApplianceSiteName string) VirtualApplianceSiteId { - return VirtualApplianceSiteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - VirtualApplianceSiteName: virtualApplianceSiteName, - } -} - -// ParseVirtualApplianceSiteID parses 'input' into a VirtualApplianceSiteId -func ParseVirtualApplianceSiteID(input string) (*VirtualApplianceSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualApplianceSiteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualApplianceSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualApplianceSiteIDInsensitively parses 'input' case-insensitively into a VirtualApplianceSiteId -// note: this method should only be used for API response data and not user input -func ParseVirtualApplianceSiteIDInsensitively(input string) (*VirtualApplianceSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualApplianceSiteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualApplianceSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualApplianceSiteId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - if id.VirtualApplianceSiteName, ok = input.Parsed["virtualApplianceSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualApplianceSiteName", input) - } - - return nil -} - -// ValidateVirtualApplianceSiteID checks that 'input' can be parsed as a Virtual Appliance Site ID -func ValidateVirtualApplianceSiteID(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 := ParseVirtualApplianceSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Appliance Site ID -func (id VirtualApplianceSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s/virtualApplianceSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName, id.VirtualApplianceSiteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Appliance Site ID -func (id VirtualApplianceSiteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - resourceids.StaticSegment("staticVirtualApplianceSites", "virtualApplianceSites", "virtualApplianceSites"), - resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "virtualApplianceSiteValue"), - } -} - -// String returns a human-readable description of this Virtual Appliance Site ID -func (id VirtualApplianceSiteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - fmt.Sprintf("Virtual Appliance Site Name: %q", id.VirtualApplianceSiteName), - } - return fmt.Sprintf("Virtual Appliance Site (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite_test.go deleted file mode 100644 index d7b3754367a..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/id_virtualappliancesite_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualappliancesites - -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 = &VirtualApplianceSiteId{} - -func TestNewVirtualApplianceSiteID(t *testing.T) { - id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } - - if id.VirtualApplianceSiteName != "virtualApplianceSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "virtualApplianceSiteValue") - } -} - -func TestFormatVirtualApplianceSiteID(t *testing.T) { - actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualApplianceSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualApplianceSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue", - Expected: &VirtualApplianceSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - VirtualApplianceSiteName: "virtualApplianceSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualApplianceSiteID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.VirtualApplianceSiteName != v.Expected.VirtualApplianceSiteName { - t.Fatalf("Expected %q but got %q for VirtualApplianceSiteName", v.Expected.VirtualApplianceSiteName, actual.VirtualApplianceSiteName) - } - - } -} - -func TestParseVirtualApplianceSiteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualApplianceSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/vIrTuAlApPlIaNcEsItEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue", - Expected: &VirtualApplianceSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - VirtualApplianceSiteName: "virtualApplianceSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEvAlUe", - Expected: &VirtualApplianceSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - VirtualApplianceSiteName: "vIrTuAlApPlIaNcEsItEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualApplianceSiteIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.VirtualApplianceSiteName != v.Expected.VirtualApplianceSiteName { - t.Fatalf("Expected %q but got %q for VirtualApplianceSiteName", v.Expected.VirtualApplianceSiteName, actual.VirtualApplianceSiteName) - } - - } -} - -func TestSegmentsForVirtualApplianceSiteId(t *testing.T) { - segments := VirtualApplianceSiteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualApplianceSiteId 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/network/2023-05-01/virtualappliancesites/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualappliancesites/method_createorupdate.go deleted file mode 100644 index 2022580c6d0..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualappliancesites - -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 *VirtualApplianceSite -} - -// CreateOrUpdate ... -func (c VirtualApplianceSitesClient) CreateOrUpdate(ctx context.Context, id VirtualApplianceSiteId, input VirtualApplianceSite) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualApplianceSitesClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualApplianceSiteId, input VirtualApplianceSite) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualappliancesites/method_delete.go b/resource-manager/network/2023-05-01/virtualappliancesites/method_delete.go deleted file mode 100644 index 50e7f186f39..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualappliancesites - -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 VirtualApplianceSitesClient) Delete(ctx context.Context, id VirtualApplianceSiteId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualApplianceSitesClient) DeleteThenPoll(ctx context.Context, id VirtualApplianceSiteId) 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/network/2023-05-01/virtualappliancesites/method_get.go b/resource-manager/network/2023-05-01/virtualappliancesites/method_get.go deleted file mode 100644 index c78f7f1cf64..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualappliancesites - -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 *VirtualApplianceSite -} - -// Get ... -func (c VirtualApplianceSitesClient) Get(ctx context.Context, id VirtualApplianceSiteId) (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 VirtualApplianceSite - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/method_list.go b/resource-manager/network/2023-05-01/virtualappliancesites/method_list.go deleted file mode 100644 index f85d8acdd6c..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualappliancesites - -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 *[]VirtualApplianceSite -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualApplianceSite -} - -// List ... -func (c VirtualApplianceSitesClient) List(ctx context.Context, id NetworkVirtualApplianceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualApplianceSites", 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 *[]VirtualApplianceSite `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 VirtualApplianceSitesClient) ListComplete(ctx context.Context, id NetworkVirtualApplianceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualApplianceSiteOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualApplianceSitesClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkVirtualApplianceId, predicate VirtualApplianceSiteOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualApplianceSite, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualappliancesites/model_breakoutcategorypolicies.go b/resource-manager/network/2023-05-01/virtualappliancesites/model_breakoutcategorypolicies.go deleted file mode 100644 index 6a2b15ecb1d..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/model_breakoutcategorypolicies.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BreakOutCategoryPolicies struct { - Allow *bool `json:"allow,omitempty"` - Default *bool `json:"default,omitempty"` - Optimize *bool `json:"optimize,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/model_office365policyproperties.go b/resource-manager/network/2023-05-01/virtualappliancesites/model_office365policyproperties.go deleted file mode 100644 index b891141a5ba..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/model_office365policyproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Office365PolicyProperties struct { - BreakOutCategories *BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesite.go b/resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesite.go deleted file mode 100644 index 1b84d25c56d..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesite.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSite struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualApplianceSiteProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesiteproperties.go b/resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesiteproperties.go deleted file mode 100644 index 5d01b6ab8f8..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/model_virtualappliancesiteproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSiteProperties struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - O365Policy *Office365PolicyProperties `json:"o365Policy,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualappliancesites/predicates.go b/resource-manager/network/2023-05-01/virtualappliancesites/predicates.go deleted file mode 100644 index af31f940d24..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSiteOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualApplianceSiteOperationPredicate) Matches(input VirtualApplianceSite) 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.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/network/2023-05-01/virtualappliancesites/version.go b/resource-manager/network/2023-05-01/virtualappliancesites/version.go deleted file mode 100644 index 85822992c12..00000000000 --- a/resource-manager/network/2023-05-01/virtualappliancesites/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualappliancesites - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualappliancesites/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/README.md b/resource-manager/network/2023-05-01/virtualapplianceskus/README.md deleted file mode 100644 index 509dddd23e5..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualapplianceskus` Documentation - -The `virtualapplianceskus` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualapplianceskus" -``` - - -### Client Initialization - -```go -client := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualApplianceSkusClient.Get` - -```go -ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue") - -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: `VirtualApplianceSkusClient.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 -} -``` diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/client.go b/resource-manager/network/2023-05-01/virtualapplianceskus/client.go deleted file mode 100644 index db6e9902bb9..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualapplianceskus - -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 VirtualApplianceSkusClient struct { - Client *resourcemanager.Client -} - -func NewVirtualApplianceSkusClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualApplianceSkusClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualapplianceskus", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualApplianceSkusClient: %+v", err) - } - - return &VirtualApplianceSkusClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku.go deleted file mode 100644 index a2683ac973a..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku.go +++ /dev/null @@ -1,121 +0,0 @@ -package virtualapplianceskus - -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(&NetworkVirtualApplianceSkuId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceSkuId{} - -// NetworkVirtualApplianceSkuId is a struct representing the Resource ID for a Network Virtual Appliance Sku -type NetworkVirtualApplianceSkuId struct { - SubscriptionId string - NetworkVirtualApplianceSkuName string -} - -// NewNetworkVirtualApplianceSkuID returns a new NetworkVirtualApplianceSkuId struct -func NewNetworkVirtualApplianceSkuID(subscriptionId string, networkVirtualApplianceSkuName string) NetworkVirtualApplianceSkuId { - return NetworkVirtualApplianceSkuId{ - SubscriptionId: subscriptionId, - NetworkVirtualApplianceSkuName: networkVirtualApplianceSkuName, - } -} - -// ParseNetworkVirtualApplianceSkuID parses 'input' into a NetworkVirtualApplianceSkuId -func ParseNetworkVirtualApplianceSkuID(input string) (*NetworkVirtualApplianceSkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceSkuId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceSkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceSkuIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceSkuId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceSkuIDInsensitively(input string) (*NetworkVirtualApplianceSkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceSkuId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceSkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceSkuId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.NetworkVirtualApplianceSkuName, ok = input.Parsed["networkVirtualApplianceSkuName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceSkuName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceSkuID checks that 'input' can be parsed as a Network Virtual Appliance Sku ID -func ValidateNetworkVirtualApplianceSkuID(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 := ParseNetworkVirtualApplianceSkuID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance Sku ID -func (id NetworkVirtualApplianceSkuId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/networkVirtualApplianceSkus/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.NetworkVirtualApplianceSkuName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance Sku ID -func (id NetworkVirtualApplianceSkuId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualApplianceSkus", "networkVirtualApplianceSkus", "networkVirtualApplianceSkus"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "networkVirtualApplianceSkuValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance Sku ID -func (id NetworkVirtualApplianceSkuId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Network Virtual Appliance Sku Name: %q", id.NetworkVirtualApplianceSkuName), - } - return fmt.Sprintf("Network Virtual Appliance Sku (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go deleted file mode 100644 index 70d241ebe4c..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package virtualapplianceskus - -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 = &NetworkVirtualApplianceSkuId{} - -func TestNewNetworkVirtualApplianceSkuID(t *testing.T) { - id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue") - - 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.NetworkVirtualApplianceSkuName != "networkVirtualApplianceSkuValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "networkVirtualApplianceSkuValue") - } -} - -func TestFormatNetworkVirtualApplianceSkuID(t *testing.T) { - actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceSkuID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceSkuId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue", - Expected: &NetworkVirtualApplianceSkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceSkuID(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.NetworkVirtualApplianceSkuName != v.Expected.NetworkVirtualApplianceSkuName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceSkuName", v.Expected.NetworkVirtualApplianceSkuName, actual.NetworkVirtualApplianceSkuName) - } - - } -} - -func TestParseNetworkVirtualApplianceSkuIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceSkuId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue", - Expected: &NetworkVirtualApplianceSkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUvAlUe", - Expected: &NetworkVirtualApplianceSkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "nEtWoRkViRtUaLaPpLiAnCeSkUvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceSkuIDInsensitively(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.NetworkVirtualApplianceSkuName != v.Expected.NetworkVirtualApplianceSkuName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceSkuName", v.Expected.NetworkVirtualApplianceSkuName, actual.NetworkVirtualApplianceSkuName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceSkuId(t *testing.T) { - segments := NetworkVirtualApplianceSkuId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceSkuId 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/network/2023-05-01/virtualapplianceskus/method_get.go b/resource-manager/network/2023-05-01/virtualapplianceskus/method_get.go deleted file mode 100644 index 87cc1eef20e..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualapplianceskus - -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 *NetworkVirtualApplianceSku -} - -// Get ... -func (c VirtualApplianceSkusClient) Get(ctx context.Context, id NetworkVirtualApplianceSkuId) (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 NetworkVirtualApplianceSku - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/method_list.go b/resource-manager/network/2023-05-01/virtualapplianceskus/method_list.go deleted file mode 100644 index c5307baa366..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualapplianceskus - -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 *[]NetworkVirtualApplianceSku -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualApplianceSku -} - -// List ... -func (c VirtualApplianceSkusClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkVirtualApplianceSkus", 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 *[]NetworkVirtualApplianceSku `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 VirtualApplianceSkusClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceSkuOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualApplianceSkusClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkVirtualApplianceSkuOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkVirtualApplianceSku, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualapplianceskus/model_networkvirtualappliancesku.go b/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualappliancesku.go deleted file mode 100644 index 93719c4daa2..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualappliancesku.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSku struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkVirtualApplianceSkuPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go b/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go deleted file mode 100644 index 99b52442ed2..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSkuInstances struct { - InstanceCount *int64 `json:"instanceCount,omitempty"` - ScaleUnit *string `json:"scaleUnit,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go b/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go deleted file mode 100644 index 5df8c3c3b00..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSkuPropertiesFormat struct { - AvailableScaleUnits *[]NetworkVirtualApplianceSkuInstances `json:"availableScaleUnits,omitempty"` - AvailableVersions *[]string `json:"availableVersions,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualapplianceskus/predicates.go b/resource-manager/network/2023-05-01/virtualapplianceskus/predicates.go deleted file mode 100644 index 758bba40370..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSkuOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkVirtualApplianceSkuOperationPredicate) Matches(input NetworkVirtualApplianceSku) 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 && (input.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/network/2023-05-01/virtualapplianceskus/version.go b/resource-manager/network/2023-05-01/virtualapplianceskus/version.go deleted file mode 100644 index cae87d7d598..00000000000 --- a/resource-manager/network/2023-05-01/virtualapplianceskus/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualapplianceskus - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualapplianceskus/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/README.md deleted file mode 100644 index e11c12ed32d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/README.md +++ /dev/null @@ -1,208 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections` Documentation - -The `virtualnetworkgatewayconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualnetworkgatewayconnections" -``` - - -### Client Initialization - -```go -client := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -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: `VirtualNetworkGatewayConnectionsClient.GetIkeSas` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.GetIkeSasThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.GetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -read, err := client.GetSharedKey(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworkGatewayConnectionsClient.ResetConnection` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.ResetConnectionThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.ResetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ - // ... -} - - -if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.SetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ - // ... -} - - -if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/client.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/client.go deleted file mode 100644 index f0cf4471c90..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworkgatewayconnections - -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 VirtualNetworkGatewayConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkGatewayConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworkgatewayconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkGatewayConnectionsClient: %+v", err) - } - - return &VirtualNetworkGatewayConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/constants.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/constants.go deleted file mode 100644 index 9512f88b641..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/constants.go +++ /dev/null @@ -1,1178 +0,0 @@ -package virtualnetworkgatewayconnections - -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 AdminState string - -const ( - AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" -) - -func PossibleValuesForAdminState() []string { - return []string{ - string(AdminStateDisabled), - string(AdminStateEnabled), - } -} - -func (s *AdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminState(input string) (*AdminState, error) { - vals := map[string]AdminState{ - "disabled": AdminStateDisabled, - "enabled": AdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminState(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { - return []string{ - string(VirtualNetworkGatewayConnectionModeDefault), - string(VirtualNetworkGatewayConnectionModeInitiatorOnly), - string(VirtualNetworkGatewayConnectionModeResponderOnly), - } -} - -func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { - vals := map[string]VirtualNetworkGatewayConnectionMode{ - "default": VirtualNetworkGatewayConnectionModeDefault, - "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, - "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionMode(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { - return []string{ - string(VirtualNetworkGatewayConnectionStatusConnected), - string(VirtualNetworkGatewayConnectionStatusConnecting), - string(VirtualNetworkGatewayConnectionStatusNotConnected), - string(VirtualNetworkGatewayConnectionStatusUnknown), - } -} - -func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { - vals := map[string]VirtualNetworkGatewayConnectionStatus{ - "connected": VirtualNetworkGatewayConnectionStatusConnected, - "connecting": VirtualNetworkGatewayConnectionStatusConnecting, - "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, - "unknown": VirtualNetworkGatewayConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionStatus(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { - return []string{ - string(VirtualNetworkGatewayConnectionTypeExpressRoute), - string(VirtualNetworkGatewayConnectionTypeIPsec), - string(VirtualNetworkGatewayConnectionTypeVPNClient), - string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), - } -} - -func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { - vals := map[string]VirtualNetworkGatewayConnectionType{ - "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, - "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, - "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, - "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionType(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuName string - -const ( - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" - VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" - VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" - VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" - VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" - VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" - VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuName() []string { - return []string{ - string(VirtualNetworkGatewaySkuNameBasic), - string(VirtualNetworkGatewaySkuNameErGwOneAZ), - string(VirtualNetworkGatewaySkuNameErGwThreeAZ), - string(VirtualNetworkGatewaySkuNameErGwTwoAZ), - string(VirtualNetworkGatewaySkuNameHighPerformance), - string(VirtualNetworkGatewaySkuNameStandard), - string(VirtualNetworkGatewaySkuNameUltraPerformance), - string(VirtualNetworkGatewaySkuNameVpnGwFive), - string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuNameVpnGwFour), - string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), - string(VirtualNetworkGatewaySkuNameVpnGwOne), - string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), - string(VirtualNetworkGatewaySkuNameVpnGwThree), - string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuNameVpnGwTwo), - string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { - vals := map[string]VirtualNetworkGatewaySkuName{ - "basic": VirtualNetworkGatewaySkuNameBasic, - "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, - "standard": VirtualNetworkGatewaySkuNameStandard, - "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuName(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuTier string - -const ( - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" - VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" - VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" - VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" - VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" - VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" - VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { - return []string{ - string(VirtualNetworkGatewaySkuTierBasic), - string(VirtualNetworkGatewaySkuTierErGwOneAZ), - string(VirtualNetworkGatewaySkuTierErGwThreeAZ), - string(VirtualNetworkGatewaySkuTierErGwTwoAZ), - string(VirtualNetworkGatewaySkuTierHighPerformance), - string(VirtualNetworkGatewaySkuTierStandard), - string(VirtualNetworkGatewaySkuTierUltraPerformance), - string(VirtualNetworkGatewaySkuTierVpnGwFive), - string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuTierVpnGwFour), - string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), - string(VirtualNetworkGatewaySkuTierVpnGwOne), - string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), - string(VirtualNetworkGatewaySkuTierVpnGwThree), - string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuTierVpnGwTwo), - string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { - vals := map[string]VirtualNetworkGatewaySkuTier{ - "basic": VirtualNetworkGatewaySkuTierBasic, - "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, - "standard": VirtualNetworkGatewaySkuTierStandard, - "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuTier(input) - return &out, nil -} - -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -func PossibleValuesForVirtualNetworkGatewayType() []string { - return []string{ - string(VirtualNetworkGatewayTypeExpressRoute), - string(VirtualNetworkGatewayTypeLocalGateway), - string(VirtualNetworkGatewayTypeVpn), - } -} - -func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { - vals := map[string]VirtualNetworkGatewayType{ - "expressroute": VirtualNetworkGatewayTypeExpressRoute, - "localgateway": VirtualNetworkGatewayTypeLocalGateway, - "vpn": VirtualNetworkGatewayTypeVpn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayType(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnClientProtocol string - -const ( - VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" -) - -func PossibleValuesForVpnClientProtocol() []string { - return []string{ - string(VpnClientProtocolIkeVTwo), - string(VpnClientProtocolOpenVPN), - string(VpnClientProtocolSSTP), - } -} - -func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnClientProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { - vals := map[string]VpnClientProtocol{ - "ikev2": VpnClientProtocolIkeVTwo, - "openvpn": VpnClientProtocolOpenVPN, - "sstp": VpnClientProtocolSSTP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnClientProtocol(input) - return &out, nil -} - -type VpnGatewayGeneration string - -const ( - VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" - VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -func PossibleValuesForVpnGatewayGeneration() []string { - return []string{ - string(VpnGatewayGenerationGenerationOne), - string(VpnGatewayGenerationGenerationTwo), - string(VpnGatewayGenerationNone), - } -} - -func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { - vals := map[string]VpnGatewayGeneration{ - "generation1": VpnGatewayGenerationGenerationOne, - "generation2": VpnGatewayGenerationGenerationTwo, - "none": VpnGatewayGenerationNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayGeneration(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} - -type VpnType string - -const ( - VpnTypePolicyBased VpnType = "PolicyBased" - VpnTypeRouteBased VpnType = "RouteBased" -) - -func PossibleValuesForVpnType() []string { - return []string{ - string(VpnTypePolicyBased), - string(VpnTypeRouteBased), - } -} - -func (s *VpnType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnType(input string) (*VpnType, error) { - vals := map[string]VpnType{ - "policybased": VpnTypePolicyBased, - "routebased": VpnTypeRouteBased, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection.go deleted file mode 100644 index 23a8c6154a7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworkgatewayconnections - -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(&ConnectionId{}) -} - -var _ resourceids.ResourceId = &ConnectionId{} - -// ConnectionId is a struct representing the Resource ID for a Connection -type ConnectionId struct { - SubscriptionId string - ResourceGroupName string - ConnectionName string -} - -// NewConnectionID returns a new ConnectionId struct -func NewConnectionID(subscriptionId string, resourceGroupName string, connectionName string) ConnectionId { - return ConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ConnectionName: connectionName, - } -} - -// ParseConnectionID parses 'input' into a ConnectionId -func ParseConnectionID(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectionIDInsensitively parses 'input' case-insensitively into a ConnectionId -// note: this method should only be used for API response data and not user input -func ParseConnectionIDInsensitively(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectionId) 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.ConnectionName, ok = input.Parsed["connectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionName", input) - } - - return nil -} - -// ValidateConnectionID checks that 'input' can be parsed as a Connection ID -func ValidateConnectionID(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 := ParseConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connection ID -func (id ConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/connections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connection ID -func (id ConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), - } -} - -// String returns a human-readable description of this Connection ID -func (id ConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Connection Name: %q", id.ConnectionName), - } - return fmt.Sprintf("Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection_test.go deleted file mode 100644 index 739348c5d82..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/id_connection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworkgatewayconnections - -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 = &ConnectionId{} - -func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - - 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.ConnectionName != "connectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionValue") - } -} - -func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionID(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestParseConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "cOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionIDInsensitively(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestSegmentsForConnectionId(t *testing.T) { - segments := ConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectionId 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/network/2023-05-01/virtualnetworkgatewayconnections/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_createorupdate.go deleted file mode 100644 index 2c95ee84254..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 *VirtualNetworkGatewayConnection -} - -// CreateOrUpdate ... -func (c VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context.Context, id ConnectionId, input VirtualNetworkGatewayConnection) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ConnectionId, input VirtualNetworkGatewayConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualnetworkgatewayconnections/method_delete.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_delete.go deleted file mode 100644 index 4d46161ff40..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgatewayconnections - -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 VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, id ConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkGatewayConnectionsClient) DeleteThenPoll(ctx context.Context, id ConnectionId) 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/network/2023-05-01/virtualnetworkgatewayconnections/method_get.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_get.go deleted file mode 100644 index e00568d96cb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkgatewayconnections - -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 *VirtualNetworkGatewayConnection -} - -// Get ... -func (c VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, id ConnectionId) (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 VirtualNetworkGatewayConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getikesas.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getikesas.go deleted file mode 100644 index f146120f19e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getikesas.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgatewayconnections - -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 GetIkeSasOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// GetIkeSas ... -func (c VirtualNetworkGatewayConnectionsClient) GetIkeSas(ctx context.Context, id ConnectionId) (result GetIkeSasOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getikesas", 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 -} - -// GetIkeSasThenPoll performs GetIkeSas then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) GetIkeSasThenPoll(ctx context.Context, id ConnectionId) error { - result, err := c.GetIkeSas(ctx, id) - if err != nil { - return fmt.Errorf("performing GetIkeSas: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetIkeSas: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getsharedkey.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getsharedkey.go deleted file mode 100644 index bc9ecd13466..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_getsharedkey.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualnetworkgatewayconnections - -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 GetSharedKeyOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionSharedKey -} - -// GetSharedKey ... -func (c VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, id ConnectionId) (result GetSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/sharedkey", 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 ConnectionSharedKey - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_list.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_list.go deleted file mode 100644 index 1a38f08249a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworkgatewayconnections - -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 *[]VirtualNetworkGatewayConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGatewayConnection -} - -// List ... -func (c VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/connections", 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 *[]VirtualNetworkGatewayConnection `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 VirtualNetworkGatewayConnectionsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewayConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkGatewayConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetworkGatewayConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualnetworkgatewayconnections/method_resetconnection.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetconnection.go deleted file mode 100644 index 7898a434030..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetconnection.go +++ /dev/null @@ -1,69 +0,0 @@ -package virtualnetworkgatewayconnections - -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 ResetConnectionOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetConnection ... -func (c VirtualNetworkGatewayConnectionsClient) ResetConnection(ctx context.Context, id ConnectionId) (result ResetConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetconnection", 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 -} - -// ResetConnectionThenPoll performs ResetConnection then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) ResetConnectionThenPoll(ctx context.Context, id ConnectionId) error { - result, err := c.ResetConnection(ctx, id) - if err != nil { - return fmt.Errorf("performing ResetConnection: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetConnection: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetsharedkey.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetsharedkey.go deleted file mode 100644 index 37c842b0ba1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_resetsharedkey.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 ResetSharedKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionResetSharedKey -} - -// ResetSharedKey ... -func (c VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context.Context, id ConnectionId, input ConnectionResetSharedKey) (result ResetSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/sharedkey/reset", 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 -} - -// ResetSharedKeyThenPoll performs ResetSharedKey then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) ResetSharedKeyThenPoll(ctx context.Context, id ConnectionId, input ConnectionResetSharedKey) error { - result, err := c.ResetSharedKey(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ResetSharedKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetSharedKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_setsharedkey.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_setsharedkey.go deleted file mode 100644 index 7cce553c953..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_setsharedkey.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 SetSharedKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionSharedKey -} - -// SetSharedKey ... -func (c VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Context, id ConnectionId, input ConnectionSharedKey) (result SetSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/sharedkey", 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 -} - -// SetSharedKeyThenPoll performs SetSharedKey then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) SetSharedKeyThenPoll(ctx context.Context, id ConnectionId, input ConnectionSharedKey) error { - result, err := c.SetSharedKey(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SetSharedKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SetSharedKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_startpacketcapture.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_startpacketcapture.go deleted file mode 100644 index d0bd4f6819d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_startpacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 StartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StartPacketCapture ... -func (c VirtualNetworkGatewayConnectionsClient) StartPacketCapture(ctx context.Context, id ConnectionId, input VpnPacketCaptureStartParameters) (result StartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startPacketCapture", 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 -} - -// StartPacketCaptureThenPoll performs StartPacketCapture then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) StartPacketCaptureThenPoll(ctx context.Context, id ConnectionId, input VpnPacketCaptureStartParameters) error { - result, err := c.StartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go deleted file mode 100644 index 8741b058a40..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 StopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StopPacketCapture ... -func (c VirtualNetworkGatewayConnectionsClient) StopPacketCapture(ctx context.Context, id ConnectionId, input VpnPacketCaptureStopParameters) (result StopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stopPacketCapture", 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 -} - -// StopPacketCaptureThenPoll performs StopPacketCapture then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) StopPacketCaptureThenPoll(ctx context.Context, id ConnectionId, input VpnPacketCaptureStopParameters) error { - result, err := c.StopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_updatetags.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_updatetags.go deleted file mode 100644 index 6a0ba8aaae8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGatewayConnection -} - -// UpdateTags ... -func (c VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Context, id ConnectionId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) UpdateTagsThenPoll(ctx context.Context, id ConnectionId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/virtualnetworkgatewayconnections/model_addressspace.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_addressspace.go deleted file mode 100644 index e94b1820056..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_bgpsettings.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_bgpsettings.go deleted file mode 100644 index e03680282e6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go deleted file mode 100644 index 3e1887b9d36..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionResetSharedKey struct { - KeyLength int64 `json:"keyLength"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go deleted file mode 100644 index 069812d03a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionSharedKey struct { - Id *string `json:"id,omitempty"` - Value string `json:"value"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 7fda76a8317..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index dd6001591ee..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go deleted file mode 100644 index e36e053ac75..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go deleted file mode 100644 index 9ddafdd0d6e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties LocalNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go deleted file mode 100644 index bf0176c3023..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGatewayPropertiesFormat struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_radiusserver.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_radiusserver.go deleted file mode 100644 index ffc93e64965..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_subresource.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_subresource.go deleted file mode 100644 index 25e6382622d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tagsobject.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tagsobject.go deleted file mode 100644 index 5f1bce5d03d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// 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/network/2023-05-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go deleted file mode 100644 index 7d824402850..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go deleted file mode 100644 index 71722a9b5e7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TunnelConnectionHealth struct { - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` - Tunnel *string `json:"tunnel,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go deleted file mode 100644 index 7a95498040e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworkgatewayconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go deleted file mode 100644 index 1c546e60aa6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleBounds struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go deleted file mode 100644 index 5fd318f0446..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleConfiguration struct { - Bounds *VirtualNetworkGatewayAutoScaleBounds `json:"bounds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go deleted file mode 100644 index 05a6ea7eb90..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go deleted file mode 100644 index ef9af43f207..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go +++ /dev/null @@ -1,34 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - ConnectionMode *VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType"` - DpdTimeoutSeconds *int64 `json:"dpdTimeoutSeconds,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` - Peer *SubResource `json:"peer,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VirtualNetworkGateway1 VirtualNetworkGateway `json:"virtualNetworkGateway1"` - VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go deleted file mode 100644 index 30467eb2ed1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 863c3769296..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go deleted file mode 100644 index ff6c91b0d66..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go deleted file mode 100644 index 75185bb4a84..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRuleProperties struct { - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go deleted file mode 100644 index cd507b1d533..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayPolicyGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go deleted file mode 100644 index 632e3bda52f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go deleted file mode 100644 index 6b20992105c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupProperties struct { - IsDefault bool `json:"isDefault"` - PolicyMembers []VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VngClientConnectionConfigurations *[]SubResource `json:"vngClientConnectionConfigurations,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go deleted file mode 100644 index e35b30c9f00..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPropertiesFormat struct { - ActiveActive *bool `json:"activeActive,omitempty"` - AdminState *AdminState `json:"adminState,omitempty"` - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - AutoScaleConfiguration *VirtualNetworkGatewayAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - VpnType *VpnType `json:"vpnType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go deleted file mode 100644 index 301f66896ac..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *VirtualNetworkGatewaySkuName `json:"name,omitempty"` - Tier *VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go deleted file mode 100644 index 744d5505a17..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VngClientConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go deleted file mode 100644 index 531c18a0419..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfigurationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkGatewayPolicyGroups []SubResource `json:"virtualNetworkGatewayPolicyGroups"` - VpnClientAddressPool AddressSpace `json:"vpnClientAddressPool"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go deleted file mode 100644 index f7da3943c5a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConfiguration struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VngClientConnectionConfigurations *[]VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` - VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go deleted file mode 100644 index 7f83a9053a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go deleted file mode 100644 index 0155228d4d1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go deleted file mode 100644 index 6eb8d073f4f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VpnClientRootCertificatePropertiesFormat `json:"properties"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go deleted file mode 100644 index f5048e1ed78..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData string `json:"publicCertData"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go deleted file mode 100644 index 394cabc619d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go deleted file mode 100644 index 52273329f1d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go deleted file mode 100644 index e7481a70176..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/predicates.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/predicates.go deleted file mode 100644 index c1fe558dd66..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayConnectionOperationPredicate) Matches(input VirtualNetworkGatewayConnection) 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 && (input.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/network/2023-05-01/virtualnetworkgatewayconnections/version.go b/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/version.go deleted file mode 100644 index 13fc4fdf5d4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgatewayconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgatewayconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/README.md b/resource-manager/network/2023-05-01/virtualnetworkgateways/README.md deleted file mode 100644 index 2a5584dff96..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/README.md +++ /dev/null @@ -1,414 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworkgateways` Documentation - -The `virtualnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualnetworkgateways" -``` - - -### Client Initialization - -```go -client := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VirtualNetworkGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVpnConnections` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.P2SVpnConnectionRequest{ - // ... -} - - -if err := client.DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GenerateVpnProfile` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientParameters{ - // ... -} - - -if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Generatevpnclientpackage` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientParameters{ - // ... -} - - -if err := client.GeneratevpnclientpackageThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -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: `VirtualNetworkGatewaysClient.GetAdvertisedRoutes` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetAdvertisedRoutesThenPoll(ctx, id, virtualnetworkgateways.DefaultGetAdvertisedRoutesOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetBgpPeerStatus` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetBgpPeerStatusThenPoll(ctx, id, virtualnetworkgateways.DefaultGetBgpPeerStatusOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetLearnedRoutes` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnclientConnectionHealthThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientIPsecParameters` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnclientIPsecParametersThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworkGatewaysClient.ListConnections` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -// alternatively `client.ListConnections(ctx, id)` can be used to do batched pagination -items, err := client.ListConnectionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.ResetThenPoll(ctx, id, virtualnetworkgateways.DefaultResetOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.ResetVpnClientSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.ResetVpnClientSharedKeyThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.SetVpnclientIPsecParameters` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientIPsecParameters{ - // ... -} - - -if err := client.SetVpnclientIPsecParametersThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.SupportedVpnDevices` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -read, err := client.SupportedVpnDevices(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -payload := virtualnetworkgateways.VirtualNetworkGatewayNatRule{ - // ... -} - - -if err := client.VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesDelete` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -if err := client.VirtualNetworkGatewayNatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesGet` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -read, err := client.VirtualNetworkGatewayNatRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -// alternatively `client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx, id)` can be used to do batched pagination -items, err := client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VpnDeviceConfigurationScript` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgateways.VpnDeviceScriptParameters{ - // ... -} - - -read, err := client.VpnDeviceConfigurationScript(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/network/2023-05-01/virtualnetworkgateways/client.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/client.go deleted file mode 100644 index 32ede23bc60..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworkgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkGatewaysClient: %+v", err) - } - - return &VirtualNetworkGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/constants.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/constants.go deleted file mode 100644 index f68568a74fe..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/constants.go +++ /dev/null @@ -1,1310 +0,0 @@ -package virtualnetworkgateways - -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 AdminState string - -const ( - AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" -) - -func PossibleValuesForAdminState() []string { - return []string{ - string(AdminStateDisabled), - string(AdminStateEnabled), - } -} - -func (s *AdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminState(input string) (*AdminState, error) { - vals := map[string]AdminState{ - "disabled": AdminStateDisabled, - "enabled": AdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminState(input) - return &out, nil -} - -type AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type BgpPeerState string - -const ( - BgpPeerStateConnected BgpPeerState = "Connected" - BgpPeerStateConnecting BgpPeerState = "Connecting" - BgpPeerStateIdle BgpPeerState = "Idle" - BgpPeerStateStopped BgpPeerState = "Stopped" - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -func PossibleValuesForBgpPeerState() []string { - return []string{ - string(BgpPeerStateConnected), - string(BgpPeerStateConnecting), - string(BgpPeerStateIdle), - string(BgpPeerStateStopped), - string(BgpPeerStateUnknown), - } -} - -func (s *BgpPeerState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBgpPeerState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBgpPeerState(input string) (*BgpPeerState, error) { - vals := map[string]BgpPeerState{ - "connected": BgpPeerStateConnected, - "connecting": BgpPeerStateConnecting, - "idle": BgpPeerStateIdle, - "stopped": BgpPeerStateStopped, - "unknown": BgpPeerStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BgpPeerState(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProcessorArchitecture string - -const ( - ProcessorArchitectureAmdSixFour ProcessorArchitecture = "Amd64" - ProcessorArchitectureXEightSix ProcessorArchitecture = "X86" -) - -func PossibleValuesForProcessorArchitecture() []string { - return []string{ - string(ProcessorArchitectureAmdSixFour), - string(ProcessorArchitectureXEightSix), - } -} - -func (s *ProcessorArchitecture) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProcessorArchitecture(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProcessorArchitecture(input string) (*ProcessorArchitecture, error) { - vals := map[string]ProcessorArchitecture{ - "amd64": ProcessorArchitectureAmdSixFour, - "x86": ProcessorArchitectureXEightSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProcessorArchitecture(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { - return []string{ - string(VirtualNetworkGatewayConnectionModeDefault), - string(VirtualNetworkGatewayConnectionModeInitiatorOnly), - string(VirtualNetworkGatewayConnectionModeResponderOnly), - } -} - -func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { - vals := map[string]VirtualNetworkGatewayConnectionMode{ - "default": VirtualNetworkGatewayConnectionModeDefault, - "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, - "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionMode(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { - return []string{ - string(VirtualNetworkGatewayConnectionStatusConnected), - string(VirtualNetworkGatewayConnectionStatusConnecting), - string(VirtualNetworkGatewayConnectionStatusNotConnected), - string(VirtualNetworkGatewayConnectionStatusUnknown), - } -} - -func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { - vals := map[string]VirtualNetworkGatewayConnectionStatus{ - "connected": VirtualNetworkGatewayConnectionStatusConnected, - "connecting": VirtualNetworkGatewayConnectionStatusConnecting, - "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, - "unknown": VirtualNetworkGatewayConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionStatus(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { - return []string{ - string(VirtualNetworkGatewayConnectionTypeExpressRoute), - string(VirtualNetworkGatewayConnectionTypeIPsec), - string(VirtualNetworkGatewayConnectionTypeVPNClient), - string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), - } -} - -func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { - vals := map[string]VirtualNetworkGatewayConnectionType{ - "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, - "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, - "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, - "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionType(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuName string - -const ( - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" - VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" - VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" - VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" - VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" - VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" - VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuName() []string { - return []string{ - string(VirtualNetworkGatewaySkuNameBasic), - string(VirtualNetworkGatewaySkuNameErGwOneAZ), - string(VirtualNetworkGatewaySkuNameErGwThreeAZ), - string(VirtualNetworkGatewaySkuNameErGwTwoAZ), - string(VirtualNetworkGatewaySkuNameHighPerformance), - string(VirtualNetworkGatewaySkuNameStandard), - string(VirtualNetworkGatewaySkuNameUltraPerformance), - string(VirtualNetworkGatewaySkuNameVpnGwFive), - string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuNameVpnGwFour), - string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), - string(VirtualNetworkGatewaySkuNameVpnGwOne), - string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), - string(VirtualNetworkGatewaySkuNameVpnGwThree), - string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuNameVpnGwTwo), - string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { - vals := map[string]VirtualNetworkGatewaySkuName{ - "basic": VirtualNetworkGatewaySkuNameBasic, - "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, - "standard": VirtualNetworkGatewaySkuNameStandard, - "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuName(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuTier string - -const ( - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" - VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" - VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" - VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" - VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" - VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" - VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { - return []string{ - string(VirtualNetworkGatewaySkuTierBasic), - string(VirtualNetworkGatewaySkuTierErGwOneAZ), - string(VirtualNetworkGatewaySkuTierErGwThreeAZ), - string(VirtualNetworkGatewaySkuTierErGwTwoAZ), - string(VirtualNetworkGatewaySkuTierHighPerformance), - string(VirtualNetworkGatewaySkuTierStandard), - string(VirtualNetworkGatewaySkuTierUltraPerformance), - string(VirtualNetworkGatewaySkuTierVpnGwFive), - string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuTierVpnGwFour), - string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), - string(VirtualNetworkGatewaySkuTierVpnGwOne), - string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), - string(VirtualNetworkGatewaySkuTierVpnGwThree), - string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuTierVpnGwTwo), - string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { - vals := map[string]VirtualNetworkGatewaySkuTier{ - "basic": VirtualNetworkGatewaySkuTierBasic, - "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, - "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, - "standard": VirtualNetworkGatewaySkuTierStandard, - "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuTier(input) - return &out, nil -} - -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -func PossibleValuesForVirtualNetworkGatewayType() []string { - return []string{ - string(VirtualNetworkGatewayTypeExpressRoute), - string(VirtualNetworkGatewayTypeLocalGateway), - string(VirtualNetworkGatewayTypeVpn), - } -} - -func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { - vals := map[string]VirtualNetworkGatewayType{ - "expressroute": VirtualNetworkGatewayTypeExpressRoute, - "localgateway": VirtualNetworkGatewayTypeLocalGateway, - "vpn": VirtualNetworkGatewayTypeVpn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayType(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnClientProtocol string - -const ( - VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" -) - -func PossibleValuesForVpnClientProtocol() []string { - return []string{ - string(VpnClientProtocolIkeVTwo), - string(VpnClientProtocolOpenVPN), - string(VpnClientProtocolSSTP), - } -} - -func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnClientProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { - vals := map[string]VpnClientProtocol{ - "ikev2": VpnClientProtocolIkeVTwo, - "openvpn": VpnClientProtocolOpenVPN, - "sstp": VpnClientProtocolSSTP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnClientProtocol(input) - return &out, nil -} - -type VpnGatewayGeneration string - -const ( - VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" - VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -func PossibleValuesForVpnGatewayGeneration() []string { - return []string{ - string(VpnGatewayGenerationGenerationOne), - string(VpnGatewayGenerationGenerationTwo), - string(VpnGatewayGenerationNone), - } -} - -func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { - vals := map[string]VpnGatewayGeneration{ - "generation1": VpnGatewayGenerationGenerationOne, - "generation2": VpnGatewayGenerationGenerationTwo, - "none": VpnGatewayGenerationNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayGeneration(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} - -type VpnType string - -const ( - VpnTypePolicyBased VpnType = "PolicyBased" - VpnTypeRouteBased VpnType = "RouteBased" -) - -func PossibleValuesForVpnType() []string { - return []string{ - string(VpnTypePolicyBased), - string(VpnTypeRouteBased), - } -} - -func (s *VpnType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnType(input string) (*VpnType, error) { - vals := map[string]VpnType{ - "policybased": VpnTypePolicyBased, - "routebased": VpnTypeRouteBased, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection.go deleted file mode 100644 index fb9191036b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworkgateways - -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(&ConnectionId{}) -} - -var _ resourceids.ResourceId = &ConnectionId{} - -// ConnectionId is a struct representing the Resource ID for a Connection -type ConnectionId struct { - SubscriptionId string - ResourceGroupName string - ConnectionName string -} - -// NewConnectionID returns a new ConnectionId struct -func NewConnectionID(subscriptionId string, resourceGroupName string, connectionName string) ConnectionId { - return ConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ConnectionName: connectionName, - } -} - -// ParseConnectionID parses 'input' into a ConnectionId -func ParseConnectionID(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectionIDInsensitively parses 'input' case-insensitively into a ConnectionId -// note: this method should only be used for API response data and not user input -func ParseConnectionIDInsensitively(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectionId) 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.ConnectionName, ok = input.Parsed["connectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionName", input) - } - - return nil -} - -// ValidateConnectionID checks that 'input' can be parsed as a Connection ID -func ValidateConnectionID(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 := ParseConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connection ID -func (id ConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/connections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connection ID -func (id ConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), - } -} - -// String returns a human-readable description of this Connection ID -func (id ConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Connection Name: %q", id.ConnectionName), - } - return fmt.Sprintf("Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection_test.go deleted file mode 100644 index c9138f5b971..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_connection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworkgateways - -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 = &ConnectionId{} - -func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - - 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.ConnectionName != "connectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionValue") - } -} - -func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionID(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestParseConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "cOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionIDInsensitively(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestSegmentsForConnectionId(t *testing.T) { - segments := ConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectionId 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/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway.go deleted file mode 100644 index 4763c88cab1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworkgateways - -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(&VirtualNetworkGatewayId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkGatewayId{} - -// VirtualNetworkGatewayId is a struct representing the Resource ID for a Virtual Network Gateway -type VirtualNetworkGatewayId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkGatewayName string -} - -// NewVirtualNetworkGatewayID returns a new VirtualNetworkGatewayId struct -func NewVirtualNetworkGatewayID(subscriptionId string, resourceGroupName string, virtualNetworkGatewayName string) VirtualNetworkGatewayId { - return VirtualNetworkGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkGatewayName: virtualNetworkGatewayName, - } -} - -// ParseVirtualNetworkGatewayID parses 'input' into a VirtualNetworkGatewayId -func ParseVirtualNetworkGatewayID(input string) (*VirtualNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkGatewayIDInsensitively parses 'input' case-insensitively into a VirtualNetworkGatewayId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkGatewayIDInsensitively(input string) (*VirtualNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkGatewayId) 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.VirtualNetworkGatewayName, ok = input.Parsed["virtualNetworkGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkGatewayName", input) - } - - return nil -} - -// ValidateVirtualNetworkGatewayID checks that 'input' can be parsed as a Virtual Network Gateway ID -func ValidateVirtualNetworkGatewayID(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 := ParseVirtualNetworkGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Gateway ID -func (id VirtualNetworkGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworkGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Gateway ID -func (id VirtualNetworkGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworkGateways", "virtualNetworkGateways", "virtualNetworkGateways"), - resourceids.UserSpecifiedSegment("virtualNetworkGatewayName", "virtualNetworkGatewayValue"), - } -} - -// String returns a human-readable description of this Virtual Network Gateway ID -func (id VirtualNetworkGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Gateway Name: %q", id.VirtualNetworkGatewayName), - } - return fmt.Sprintf("Virtual Network Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go deleted file mode 100644 index 1c9b9be16ca..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworkgateways - -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 = &VirtualNetworkGatewayId{} - -func TestNewVirtualNetworkGatewayID(t *testing.T) { - id := NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - - 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.VirtualNetworkGatewayName != "virtualNetworkGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkGatewayName'", id.VirtualNetworkGatewayName, "virtualNetworkGatewayValue") - } -} - -func TestFormatVirtualNetworkGatewayID(t *testing.T) { - actual := NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Expected: &VirtualNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayID(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - } -} - -func TestParseVirtualNetworkGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Expected: &VirtualNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE", - Expected: &VirtualNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkGatewayName: "vIrTuAlNeTwOrKgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayIDInsensitively(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - } -} - -func TestSegmentsForVirtualNetworkGatewayId(t *testing.T) { - segments := VirtualNetworkGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkGatewayId 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/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go deleted file mode 100644 index 41c5df8eedd..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualnetworkgateways - -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(&VirtualNetworkGatewayNatRuleId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkGatewayNatRuleId{} - -// VirtualNetworkGatewayNatRuleId is a struct representing the Resource ID for a Virtual Network Gateway Nat Rule -type VirtualNetworkGatewayNatRuleId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkGatewayName string - NatRuleName string -} - -// NewVirtualNetworkGatewayNatRuleID returns a new VirtualNetworkGatewayNatRuleId struct -func NewVirtualNetworkGatewayNatRuleID(subscriptionId string, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string) VirtualNetworkGatewayNatRuleId { - return VirtualNetworkGatewayNatRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkGatewayName: virtualNetworkGatewayName, - NatRuleName: natRuleName, - } -} - -// ParseVirtualNetworkGatewayNatRuleID parses 'input' into a VirtualNetworkGatewayNatRuleId -func ParseVirtualNetworkGatewayNatRuleID(input string) (*VirtualNetworkGatewayNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayNatRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkGatewayNatRuleIDInsensitively parses 'input' case-insensitively into a VirtualNetworkGatewayNatRuleId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkGatewayNatRuleIDInsensitively(input string) (*VirtualNetworkGatewayNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayNatRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkGatewayNatRuleId) 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.VirtualNetworkGatewayName, ok = input.Parsed["virtualNetworkGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkGatewayName", input) - } - - if id.NatRuleName, ok = input.Parsed["natRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "natRuleName", input) - } - - return nil -} - -// ValidateVirtualNetworkGatewayNatRuleID checks that 'input' can be parsed as a Virtual Network Gateway Nat Rule ID -func ValidateVirtualNetworkGatewayNatRuleID(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 := ParseVirtualNetworkGatewayNatRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Gateway Nat Rule ID -func (id VirtualNetworkGatewayNatRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworkGateways/%s/natRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkGatewayName, id.NatRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Gateway Nat Rule ID -func (id VirtualNetworkGatewayNatRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworkGateways", "virtualNetworkGateways", "virtualNetworkGateways"), - resourceids.UserSpecifiedSegment("virtualNetworkGatewayName", "virtualNetworkGatewayValue"), - resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), - resourceids.UserSpecifiedSegment("natRuleName", "natRuleValue"), - } -} - -// String returns a human-readable description of this Virtual Network Gateway Nat Rule ID -func (id VirtualNetworkGatewayNatRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Gateway Name: %q", id.VirtualNetworkGatewayName), - fmt.Sprintf("Nat Rule Name: %q", id.NatRuleName), - } - return fmt.Sprintf("Virtual Network Gateway Nat Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go deleted file mode 100644 index ae1f73b2a85..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualnetworkgateways - -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 = &VirtualNetworkGatewayNatRuleId{} - -func TestNewVirtualNetworkGatewayNatRuleID(t *testing.T) { - id := NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - - 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.VirtualNetworkGatewayName != "virtualNetworkGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkGatewayName'", id.VirtualNetworkGatewayName, "virtualNetworkGatewayValue") - } - - if id.NatRuleName != "natRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'NatRuleName'", id.NatRuleName, "natRuleValue") - } -} - -func TestFormatVirtualNetworkGatewayNatRuleID(t *testing.T) { - actual := NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkGatewayNatRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue", - Expected: &VirtualNetworkGatewayNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayNatRuleID(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestParseVirtualNetworkGatewayNatRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/nAtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue", - Expected: &VirtualNetworkGatewayNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/nAtRuLeS/nAtRuLeVaLuE", - Expected: &VirtualNetworkGatewayNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkGatewayName: "vIrTuAlNeTwOrKgAtEwAyVaLuE", - NatRuleName: "nAtRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/nAtRuLeS/nAtRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayNatRuleIDInsensitively(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestSegmentsForVirtualNetworkGatewayNatRuleId(t *testing.T) { - segments := VirtualNetworkGatewayNatRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkGatewayNatRuleId 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/network/2023-05-01/virtualnetworkgateways/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_createorupdate.go deleted file mode 100644 index 1f22024e4a6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 *VirtualNetworkGateway -} - -// CreateOrUpdate ... -func (c VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkGatewayId, input VirtualNetworkGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworkGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VirtualNetworkGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualnetworkgateways/method_delete.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_delete.go deleted file mode 100644 index 06878f245a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewaysClient) Delete(ctx context.Context, id VirtualNetworkGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkGatewaysClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkGatewayId) 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/network/2023-05-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go deleted file mode 100644 index 6a0589d67d6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go +++ /dev/null @@ -1,74 +0,0 @@ -package virtualnetworkgateways - -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 DisconnectVirtualNetworkGatewayVpnConnectionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DisconnectVirtualNetworkGatewayVpnConnections ... -func (c VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnections(ctx context.Context, id VirtualNetworkGatewayId, input P2SVpnConnectionRequest) (result DisconnectVirtualNetworkGatewayVpnConnectionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnectVirtualNetworkGatewayVpnConnections", 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 -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll performs DisconnectVirtualNetworkGatewayVpnConnections then polls until it's completed -func (c VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input P2SVpnConnectionRequest) error { - result, err := c.DisconnectVirtualNetworkGatewayVpnConnections(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DisconnectVirtualNetworkGatewayVpnConnections: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DisconnectVirtualNetworkGatewayVpnConnections: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnclientpackage.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnclientpackage.go deleted file mode 100644 index a08869751a8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnclientpackage.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 GeneratevpnclientpackageOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// Generatevpnclientpackage ... -func (c VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) (result GeneratevpnclientpackageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatevpnclientpackage", 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 -} - -// GeneratevpnclientpackageThenPoll performs Generatevpnclientpackage then polls until it's completed -func (c VirtualNetworkGatewaysClient) GeneratevpnclientpackageThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) error { - result, err := c.Generatevpnclientpackage(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Generatevpnclientpackage: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Generatevpnclientpackage: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnprofile.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnprofile.go deleted file mode 100644 index 3b9f9f9815e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_generatevpnprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 GenerateVpnProfileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// GenerateVpnProfile ... -func (c VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) (result GenerateVpnProfileOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatevpnprofile", 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 -} - -// GenerateVpnProfileThenPoll performs GenerateVpnProfile then polls until it's completed -func (c VirtualNetworkGatewaysClient) GenerateVpnProfileThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) error { - result, err := c.GenerateVpnProfile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GenerateVpnProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GenerateVpnProfile: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_get.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_get.go deleted file mode 100644 index 0f42a04cd89..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkgateways - -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 *VirtualNetworkGateway -} - -// Get ... -func (c VirtualNetworkGatewaysClient) Get(ctx context.Context, id VirtualNetworkGatewayId) (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 VirtualNetworkGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getadvertisedroutes.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getadvertisedroutes.go deleted file mode 100644 index 81a82f3fee4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getadvertisedroutes.go +++ /dev/null @@ -1,99 +0,0 @@ -package virtualnetworkgateways - -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 GetAdvertisedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GatewayRouteListResult -} - -type GetAdvertisedRoutesOperationOptions struct { - Peer *string -} - -func DefaultGetAdvertisedRoutesOperationOptions() GetAdvertisedRoutesOperationOptions { - return GetAdvertisedRoutesOperationOptions{} -} - -func (o GetAdvertisedRoutesOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetAdvertisedRoutesOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetAdvertisedRoutesOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Peer != nil { - out.Append("peer", fmt.Sprintf("%v", *o.Peer)) - } - return &out -} - -// GetAdvertisedRoutes ... -func (c VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Context, id VirtualNetworkGatewayId, options GetAdvertisedRoutesOperationOptions) (result GetAdvertisedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getAdvertisedRoutes", id.ID()), - OptionsObject: options, - } - - 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 -} - -// GetAdvertisedRoutesThenPoll performs GetAdvertisedRoutes then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetAdvertisedRoutesThenPoll(ctx context.Context, id VirtualNetworkGatewayId, options GetAdvertisedRoutesOperationOptions) error { - result, err := c.GetAdvertisedRoutes(ctx, id, options) - if err != nil { - return fmt.Errorf("performing GetAdvertisedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetAdvertisedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getbgppeerstatus.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getbgppeerstatus.go deleted file mode 100644 index f8e0d0d0aae..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getbgppeerstatus.go +++ /dev/null @@ -1,99 +0,0 @@ -package virtualnetworkgateways - -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 GetBgpPeerStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BgpPeerStatusListResult -} - -type GetBgpPeerStatusOperationOptions struct { - Peer *string -} - -func DefaultGetBgpPeerStatusOperationOptions() GetBgpPeerStatusOperationOptions { - return GetBgpPeerStatusOperationOptions{} -} - -func (o GetBgpPeerStatusOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetBgpPeerStatusOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetBgpPeerStatusOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Peer != nil { - out.Append("peer", fmt.Sprintf("%v", *o.Peer)) - } - return &out -} - -// GetBgpPeerStatus ... -func (c VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, id VirtualNetworkGatewayId, options GetBgpPeerStatusOperationOptions) (result GetBgpPeerStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getBgpPeerStatus", id.ID()), - OptionsObject: options, - } - - 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 -} - -// GetBgpPeerStatusThenPoll performs GetBgpPeerStatus then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetBgpPeerStatusThenPoll(ctx context.Context, id VirtualNetworkGatewayId, options GetBgpPeerStatusOperationOptions) error { - result, err := c.GetBgpPeerStatus(ctx, id, options) - if err != nil { - return fmt.Errorf("performing GetBgpPeerStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetBgpPeerStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getlearnedroutes.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getlearnedroutes.go deleted file mode 100644 index 3cfd0aa16a8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getlearnedroutes.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 GetLearnedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GatewayRouteListResult -} - -// GetLearnedRoutes ... -func (c VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, id VirtualNetworkGatewayId) (result GetLearnedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getLearnedRoutes", 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 -} - -// GetLearnedRoutesThenPoll performs GetLearnedRoutes then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetLearnedRoutesThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetLearnedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing GetLearnedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetLearnedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go deleted file mode 100644 index 8b7f93d0b5c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 GetVpnclientConnectionHealthOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnClientConnectionHealthDetailListResult -} - -// GetVpnclientConnectionHealth ... -func (c VirtualNetworkGatewaysClient) GetVpnclientConnectionHealth(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnclientConnectionHealthOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getVpnClientConnectionHealth", 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 -} - -// GetVpnclientConnectionHealthThenPoll performs GetVpnclientConnectionHealth then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnclientConnectionHealth(ctx, id) - if err != nil { - return fmt.Errorf("performing GetVpnclientConnectionHealth: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnclientConnectionHealth: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go deleted file mode 100644 index 43dd02230df..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualnetworkgateways - -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 GetVpnclientIPsecParametersOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnClientIPsecParameters -} - -// GetVpnclientIPsecParameters ... -func (c VirtualNetworkGatewaysClient) GetVpnclientIPsecParameters(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnclientIPsecParametersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getvpnclientipsecparameters", 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 -} - -// GetVpnclientIPsecParametersThenPoll performs GetVpnclientIPsecParameters then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnclientIPsecParametersThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnclientIPsecParameters(ctx, id) - if err != nil { - return fmt.Errorf("performing GetVpnclientIPsecParameters: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnclientIPsecParameters: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go deleted file mode 100644 index c247730a0c5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 GetVpnProfilePackageUrlOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// GetVpnProfilePackageUrl ... -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageUrlOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getvpnprofilepackageurl", 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 -} - -// GetVpnProfilePackageUrlThenPoll performs GetVpnProfilePackageUrl then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrlThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnProfilePackageUrl(ctx, id) - if err != nil { - return fmt.Errorf("performing GetVpnProfilePackageUrl: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnProfilePackageUrl: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_list.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_list.go deleted file mode 100644 index 97a10fc1bcb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworkgateways - -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 *[]VirtualNetworkGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGateway -} - -// List ... -func (c VirtualNetworkGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworkGateways", 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 *[]VirtualNetworkGateway `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 VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetworkGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualnetworkgateways/method_listconnections.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_listconnections.go deleted file mode 100644 index d0c9c4be8be..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_listconnections.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualnetworkgateways - -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 ListConnectionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkGatewayConnectionListEntity -} - -type ListConnectionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGatewayConnectionListEntity -} - -// ListConnections ... -func (c VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, id VirtualNetworkGatewayId) (result ListConnectionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connections", 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 *[]VirtualNetworkGatewayConnectionListEntity `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListConnectionsComplete retrieves all the results into a single object -func (c VirtualNetworkGatewaysClient) ListConnectionsComplete(ctx context.Context, id VirtualNetworkGatewayId) (ListConnectionsCompleteResult, error) { - return c.ListConnectionsCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayConnectionListEntityOperationPredicate{}) -} - -// ListConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewaysClient) ListConnectionsCompleteMatchingPredicate(ctx context.Context, id VirtualNetworkGatewayId, predicate VirtualNetworkGatewayConnectionListEntityOperationPredicate) (result ListConnectionsCompleteResult, err error) { - items := make([]VirtualNetworkGatewayConnectionListEntity, 0) - - resp, err := c.ListConnections(ctx, id) - if err != nil { - 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 = ListConnectionsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_reset.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_reset.go deleted file mode 100644 index d766e3f0c62..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_reset.go +++ /dev/null @@ -1,99 +0,0 @@ -package virtualnetworkgateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGateway -} - -type ResetOperationOptions struct { - GatewayVip *string -} - -func DefaultResetOperationOptions() ResetOperationOptions { - return ResetOperationOptions{} -} - -func (o ResetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ResetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ResetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.GatewayVip != nil { - out.Append("gatewayVip", fmt.Sprintf("%v", *o.GatewayVip)) - } - return &out -} - -// Reset ... -func (c VirtualNetworkGatewaysClient) Reset(ctx context.Context, id VirtualNetworkGatewayId, options ResetOperationOptions) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", id.ID()), - OptionsObject: options, - } - - 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c VirtualNetworkGatewaysClient) ResetThenPoll(ctx context.Context, id VirtualNetworkGatewayId, options ResetOperationOptions) error { - result, err := c.Reset(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go deleted file mode 100644 index 3e10b92aa05..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualnetworkgateways - -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 ResetVpnClientSharedKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetVpnClientSharedKey ... -func (c VirtualNetworkGatewaysClient) ResetVpnClientSharedKey(ctx context.Context, id VirtualNetworkGatewayId) (result ResetVpnClientSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetvpnclientsharedkey", 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 -} - -// ResetVpnClientSharedKeyThenPoll performs ResetVpnClientSharedKey then polls until it's completed -func (c VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.ResetVpnClientSharedKey(ctx, id) - if err != nil { - return fmt.Errorf("performing ResetVpnClientSharedKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetVpnClientSharedKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go deleted file mode 100644 index c6ce6809b83..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 SetVpnclientIPsecParametersOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnClientIPsecParameters -} - -// SetVpnclientIPsecParameters ... -func (c VirtualNetworkGatewaysClient) SetVpnclientIPsecParameters(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientIPsecParameters) (result SetVpnclientIPsecParametersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/setvpnclientipsecparameters", 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 -} - -// SetVpnclientIPsecParametersThenPoll performs SetVpnclientIPsecParameters then polls until it's completed -func (c VirtualNetworkGatewaysClient) SetVpnclientIPsecParametersThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientIPsecParameters) error { - result, err := c.SetVpnclientIPsecParameters(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SetVpnclientIPsecParameters: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SetVpnclientIPsecParameters: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_startpacketcapture.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_startpacketcapture.go deleted file mode 100644 index 6aae280247b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_startpacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 StartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StartPacketCapture ... -func (c VirtualNetworkGatewaysClient) StartPacketCapture(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStartParameters) (result StartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startPacketCapture", 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 -} - -// StartPacketCaptureThenPoll performs StartPacketCapture then polls until it's completed -func (c VirtualNetworkGatewaysClient) StartPacketCaptureThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStartParameters) error { - result, err := c.StartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_stoppacketcapture.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_stoppacketcapture.go deleted file mode 100644 index b193430e431..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_stoppacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 StopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StopPacketCapture ... -func (c VirtualNetworkGatewaysClient) StopPacketCapture(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStopParameters) (result StopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stopPacketCapture", 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 -} - -// StopPacketCaptureThenPoll performs StopPacketCapture then polls until it's completed -func (c VirtualNetworkGatewaysClient) StopPacketCaptureThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStopParameters) error { - result, err := c.StopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_supportedvpndevices.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_supportedvpndevices.go deleted file mode 100644 index c7d78912ab2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_supportedvpndevices.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualnetworkgateways - -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 SupportedVpnDevicesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// SupportedVpnDevices ... -func (c VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Context, id VirtualNetworkGatewayId) (result SupportedVpnDevicesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/supportedvpndevices", 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 string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_updatetags.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_updatetags.go deleted file mode 100644 index a374667f9a3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGateway -} - -// UpdateTags ... -func (c VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, id VirtualNetworkGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c VirtualNetworkGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go deleted file mode 100644 index b68cd3bf17c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesCreateOrUpdate ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesCreateOrUpdate(ctx context.Context, id VirtualNetworkGatewayNatRuleId, input VirtualNetworkGatewayNatRule) (result VirtualNetworkGatewayNatRulesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll performs VirtualNetworkGatewayNatRulesCreateOrUpdate then polls until it's completed -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkGatewayNatRuleId, input VirtualNetworkGatewayNatRule) error { - result, err := c.VirtualNetworkGatewayNatRulesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualNetworkGatewayNatRulesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualNetworkGatewayNatRulesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go deleted file mode 100644 index 4d041050bd2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualNetworkGatewayNatRulesDelete ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesDelete(ctx context.Context, id VirtualNetworkGatewayNatRuleId) (result VirtualNetworkGatewayNatRulesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualNetworkGatewayNatRulesDeleteThenPoll performs VirtualNetworkGatewayNatRulesDelete then polls until it's completed -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesDeleteThenPoll(ctx context.Context, id VirtualNetworkGatewayNatRuleId) error { - result, err := c.VirtualNetworkGatewayNatRulesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualNetworkGatewayNatRulesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualNetworkGatewayNatRulesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go deleted file mode 100644 index 8347acb37cd..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesGet ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesGet(ctx context.Context, id VirtualNetworkGatewayNatRuleId) (result VirtualNetworkGatewayNatRulesGetOperationResponse, 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 VirtualNetworkGatewayNatRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go deleted file mode 100644 index 3ec76975ae7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkGatewayNatRule -} - -type VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx context.Context, id VirtualNetworkGatewayId) (result VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/natRules", 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 *[]VirtualNetworkGatewayNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete retrieves all the results into a single object -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete(ctx context.Context, id VirtualNetworkGatewayId) (VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult, error) { - return c.VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayNatRuleOperationPredicate{}) -} - -// VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteMatchingPredicate(ctx context.Context, id VirtualNetworkGatewayId, predicate VirtualNetworkGatewayNatRuleOperationPredicate) (result VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult, err error) { - items := make([]VirtualNetworkGatewayNatRule, 0) - - resp, err := c.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx, id) - if err != nil { - 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 = VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go deleted file mode 100644 index b2673932149..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go +++ /dev/null @@ -1,59 +0,0 @@ -package virtualnetworkgateways - -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 VpnDeviceConfigurationScriptOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnDeviceConfigurationScript ... -func (c VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx context.Context, id ConnectionId, input VpnDeviceScriptParameters) (result VpnDeviceConfigurationScriptOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/vpndeviceconfigurationscript", 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 string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_addressspace.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_addressspace.go deleted file mode 100644 index 8ec4b3f0b7d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatus.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatus.go deleted file mode 100644 index 8b54be7d7ae..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatus.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpPeerStatus struct { - Asn *int64 `json:"asn,omitempty"` - ConnectedDuration *string `json:"connectedDuration,omitempty"` - LocalAddress *string `json:"localAddress,omitempty"` - MessagesReceived *int64 `json:"messagesReceived,omitempty"` - MessagesSent *int64 `json:"messagesSent,omitempty"` - Neighbor *string `json:"neighbor,omitempty"` - RoutesReceived *int64 `json:"routesReceived,omitempty"` - State *BgpPeerState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go deleted file mode 100644 index 4affff1a309..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpPeerStatusListResult struct { - Value *[]BgpPeerStatus `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgpsettings.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgpsettings.go deleted file mode 100644 index 38b1165bfa1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 6bb7f5aa055..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroute.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroute.go deleted file mode 100644 index 038e61f22d3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroute.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayRoute struct { - AsPath *string `json:"asPath,omitempty"` - LocalAddress *string `json:"localAddress,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Origin *string `json:"origin,omitempty"` - SourcePeer *string `json:"sourcePeer,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroutelistresult.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroutelistresult.go deleted file mode 100644 index d0ab95ca8fb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_gatewayroutelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayRouteListResult struct { - Value *[]GatewayRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index bfda111f40f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipsecpolicy.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipsecpolicy.go deleted file mode 100644 index 6db4ac44425..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go deleted file mode 100644 index dafc643bcef..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionRequest struct { - VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_radiusserver.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_radiusserver.go deleted file mode 100644 index eb891246991..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_subresource.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_subresource.go deleted file mode 100644 index 5e20a09efb4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_tagsobject.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_tagsobject.go deleted file mode 100644 index 1208ffee7eb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// 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/network/2023-05-01/virtualnetworkgateways/model_trafficselectorpolicy.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_trafficselectorpolicy.go deleted file mode 100644 index 6dbeefcf439..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_tunnelconnectionhealth.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_tunnelconnectionhealth.go deleted file mode 100644 index 786b8730363..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_tunnelconnectionhealth.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TunnelConnectionHealth struct { - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` - Tunnel *string `json:"tunnel,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go deleted file mode 100644 index f9ddd43a0b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkConnectionGatewayReference struct { - Id string `json:"id"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgateway.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgateway.go deleted file mode 100644 index 0bd39843684..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgateway.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworkgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go deleted file mode 100644 index ba8082fea07..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleBounds struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go deleted file mode 100644 index c2bf005d067..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleConfiguration struct { - Bounds *VirtualNetworkGatewayAutoScaleBounds `json:"bounds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go deleted file mode 100644 index fc88052ded9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionListEntity struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go deleted file mode 100644 index ad063d3db47..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go +++ /dev/null @@ -1,30 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - ConnectionMode *VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - Peer *SubResource `json:"peer,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VirtualNetworkGateway1 VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1"` - VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go deleted file mode 100644 index b0f988e9a2c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index f4396964e0a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go deleted file mode 100644 index f8d6791d170..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go deleted file mode 100644 index 6227a89e253..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRuleProperties struct { - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go deleted file mode 100644 index ebd198d261e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayPolicyGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go deleted file mode 100644 index 466e643ddd8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go deleted file mode 100644 index ab108714ff3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupProperties struct { - IsDefault bool `json:"isDefault"` - PolicyMembers []VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VngClientConnectionConfigurations *[]SubResource `json:"vngClientConnectionConfigurations,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go deleted file mode 100644 index 3f13bf8bcf6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPropertiesFormat struct { - ActiveActive *bool `json:"activeActive,omitempty"` - AdminState *AdminState `json:"adminState,omitempty"` - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - AutoScaleConfiguration *VirtualNetworkGatewayAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - VpnType *VpnType `json:"vpnType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go deleted file mode 100644 index b96386d7651..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *VirtualNetworkGatewaySkuName `json:"name,omitempty"` - Tier *VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go deleted file mode 100644 index 44c61c02167..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VngClientConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go deleted file mode 100644 index 8bf37c29734..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfigurationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkGatewayPolicyGroups []SubResource `json:"virtualNetworkGatewayPolicyGroups"` - VpnClientAddressPool AddressSpace `json:"vpnClientAddressPool"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconfiguration.go deleted file mode 100644 index 947582e3da9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconfiguration.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConfiguration struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VngClientConnectionConfigurations *[]VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` - VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go deleted file mode 100644 index c1bd5bd01b8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealthDetail struct { - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressPacketsTransferred *int64 `json:"egressPacketsTransferred,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressPacketsTransferred *int64 `json:"ingressPacketsTransferred,omitempty"` - MaxBandwidth *int64 `json:"maxBandwidth,omitempty"` - MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - VpnConnectionDuration *int64 `json:"vpnConnectionDuration,omitempty"` - VpnConnectionId *string `json:"vpnConnectionId,omitempty"` - VpnConnectionTime *string `json:"vpnConnectionTime,omitempty"` - VpnUserName *string `json:"vpnUserName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go deleted file mode 100644 index d0c7c1a3f22..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealthDetailListResult struct { - Value *[]VpnClientConnectionHealthDetail `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientipsecparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientipsecparameters.go deleted file mode 100644 index d972e45d72e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientipsecparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientIPsecParameters struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientparameters.go deleted file mode 100644 index dbfa84e1c67..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientParameters struct { - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` - ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"` - ProcessorArchitecture *ProcessorArchitecture `json:"processorArchitecture,omitempty"` - RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go deleted file mode 100644 index 2151e3bf02b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go deleted file mode 100644 index 9a5fb25ca9b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificate.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificate.go deleted file mode 100644 index db4850a95ff..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VpnClientRootCertificatePropertiesFormat `json:"properties"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go deleted file mode 100644 index 4a44a811b2a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData string `json:"publicCertData"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpndevicescriptparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpndevicescriptparameters.go deleted file mode 100644 index 61ec4f46b54..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpndevicescriptparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnDeviceScriptParameters struct { - DeviceFamily *string `json:"deviceFamily,omitempty"` - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnnatrulemapping.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnnatrulemapping.go deleted file mode 100644 index d903f625a58..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go deleted file mode 100644 index 014f699e436..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go deleted file mode 100644 index 091426a3451..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkgateways/predicates.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/predicates.go deleted file mode 100644 index e03cad8f7b6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/predicates.go +++ /dev/null @@ -1,98 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayOperationPredicate) Matches(input VirtualNetworkGateway) 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 && (input.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 VirtualNetworkGatewayConnectionListEntityOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayConnectionListEntityOperationPredicate) Matches(input VirtualNetworkGatewayConnectionListEntity) 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 && (input.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 VirtualNetworkGatewayNatRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayNatRuleOperationPredicate) Matches(input VirtualNetworkGatewayNatRule) 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.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/network/2023-05-01/virtualnetworkgateways/version.go b/resource-manager/network/2023-05-01/virtualnetworkgateways/version.go deleted file mode 100644 index e19ea5360d3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/README.md b/resource-manager/network/2023-05-01/virtualnetworkpeerings/README.md deleted file mode 100644 index 505a12269c7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworkpeerings` Documentation - -The `virtualnetworkpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualnetworkpeerings" -``` - - -### Client Initialization - -```go -client := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -payload := virtualnetworkpeerings.VirtualNetworkPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, virtualnetworkpeerings.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -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: `VirtualNetworkPeeringsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// 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/network/2023-05-01/virtualnetworkpeerings/client.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/client.go deleted file mode 100644 index 8eb7455514c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworkpeerings - -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 VirtualNetworkPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworkpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkPeeringsClient: %+v", err) - } - - return &VirtualNetworkPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/constants.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/constants.go deleted file mode 100644 index 0cb41da70fc..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package virtualnetworkpeerings - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SyncRemoteAddressSpace string - -const ( - SyncRemoteAddressSpaceTrue SyncRemoteAddressSpace = "true" -) - -func PossibleValuesForSyncRemoteAddressSpace() []string { - return []string{ - string(SyncRemoteAddressSpaceTrue), - } -} - -func (s *SyncRemoteAddressSpace) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncRemoteAddressSpace(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncRemoteAddressSpace(input string) (*SyncRemoteAddressSpace, error) { - vals := map[string]SyncRemoteAddressSpace{ - "true": SyncRemoteAddressSpaceTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncRemoteAddressSpace(input) - return &out, nil -} - -type VirtualNetworkEncryptionEnforcement string - -const ( - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -func PossibleValuesForVirtualNetworkEncryptionEnforcement() []string { - return []string{ - string(VirtualNetworkEncryptionEnforcementAllowUnencrypted), - string(VirtualNetworkEncryptionEnforcementDropUnencrypted), - } -} - -func (s *VirtualNetworkEncryptionEnforcement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkEncryptionEnforcement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkEncryptionEnforcement(input string) (*VirtualNetworkEncryptionEnforcement, error) { - vals := map[string]VirtualNetworkEncryptionEnforcement{ - "allowunencrypted": VirtualNetworkEncryptionEnforcementAllowUnencrypted, - "dropunencrypted": VirtualNetworkEncryptionEnforcementDropUnencrypted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkEncryptionEnforcement(input) - return &out, nil -} - -type VirtualNetworkPeeringLevel string - -const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -func PossibleValuesForVirtualNetworkPeeringLevel() []string { - return []string{ - string(VirtualNetworkPeeringLevelFullyInSync), - string(VirtualNetworkPeeringLevelLocalAndRemoteNotInSync), - string(VirtualNetworkPeeringLevelLocalNotInSync), - string(VirtualNetworkPeeringLevelRemoteNotInSync), - } -} - -func (s *VirtualNetworkPeeringLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringLevel(input string) (*VirtualNetworkPeeringLevel, error) { - vals := map[string]VirtualNetworkPeeringLevel{ - "fullyinsync": VirtualNetworkPeeringLevelFullyInSync, - "localandremotenotinsync": VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, - "localnotinsync": VirtualNetworkPeeringLevelLocalNotInSync, - "remotenotinsync": VirtualNetworkPeeringLevelRemoteNotInSync, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringLevel(input) - return &out, nil -} - -type VirtualNetworkPeeringState string - -const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -func PossibleValuesForVirtualNetworkPeeringState() []string { - return []string{ - string(VirtualNetworkPeeringStateConnected), - string(VirtualNetworkPeeringStateDisconnected), - string(VirtualNetworkPeeringStateInitiated), - } -} - -func (s *VirtualNetworkPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringState(input string) (*VirtualNetworkPeeringState, error) { - vals := map[string]VirtualNetworkPeeringState{ - "connected": VirtualNetworkPeeringStateConnected, - "disconnected": VirtualNetworkPeeringStateDisconnected, - "initiated": VirtualNetworkPeeringStateInitiated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering.go deleted file mode 100644 index a72d63bb3a5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualnetworkpeerings - -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(&VirtualNetworkPeeringId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkPeeringId{} - -// VirtualNetworkPeeringId is a struct representing the Resource ID for a Virtual Network Peering -type VirtualNetworkPeeringId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkName string - VirtualNetworkPeeringName string -} - -// NewVirtualNetworkPeeringID returns a new VirtualNetworkPeeringId struct -func NewVirtualNetworkPeeringID(subscriptionId string, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) VirtualNetworkPeeringId { - return VirtualNetworkPeeringId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkName: virtualNetworkName, - VirtualNetworkPeeringName: virtualNetworkPeeringName, - } -} - -// ParseVirtualNetworkPeeringID parses 'input' into a VirtualNetworkPeeringId -func ParseVirtualNetworkPeeringID(input string) (*VirtualNetworkPeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkPeeringId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkPeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkPeeringIDInsensitively parses 'input' case-insensitively into a VirtualNetworkPeeringId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkPeeringIDInsensitively(input string) (*VirtualNetworkPeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkPeeringId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkPeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkPeeringId) 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.VirtualNetworkName, ok = input.Parsed["virtualNetworkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", input) - } - - if id.VirtualNetworkPeeringName, ok = input.Parsed["virtualNetworkPeeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkPeeringName", input) - } - - return nil -} - -// ValidateVirtualNetworkPeeringID checks that 'input' can be parsed as a Virtual Network Peering ID -func ValidateVirtualNetworkPeeringID(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 := ParseVirtualNetworkPeeringID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Peering ID -func (id VirtualNetworkPeeringId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/virtualNetworkPeerings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName, id.VirtualNetworkPeeringName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Peering ID -func (id VirtualNetworkPeeringId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), - resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkValue"), - resourceids.StaticSegment("staticVirtualNetworkPeerings", "virtualNetworkPeerings", "virtualNetworkPeerings"), - resourceids.UserSpecifiedSegment("virtualNetworkPeeringName", "virtualNetworkPeeringValue"), - } -} - -// String returns a human-readable description of this Virtual Network Peering ID -func (id VirtualNetworkPeeringId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Name: %q", id.VirtualNetworkName), - fmt.Sprintf("Virtual Network Peering Name: %q", id.VirtualNetworkPeeringName), - } - return fmt.Sprintf("Virtual Network Peering (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go deleted file mode 100644 index 9580241575f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualnetworkpeerings - -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 = &VirtualNetworkPeeringId{} - -func TestNewVirtualNetworkPeeringID(t *testing.T) { - id := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - - 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.VirtualNetworkName != "virtualNetworkValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkName'", id.VirtualNetworkName, "virtualNetworkValue") - } - - if id.VirtualNetworkPeeringName != "virtualNetworkPeeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkPeeringName'", id.VirtualNetworkPeeringName, "virtualNetworkPeeringValue") - } -} - -func TestFormatVirtualNetworkPeeringID(t *testing.T) { - actual := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkPeeringID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkPeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue", - Expected: &VirtualNetworkPeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkName: "virtualNetworkValue", - VirtualNetworkPeeringName: "virtualNetworkPeeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkPeeringID(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.VirtualNetworkName != v.Expected.VirtualNetworkName { - t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) - } - - if actual.VirtualNetworkPeeringName != v.Expected.VirtualNetworkPeeringName { - t.Fatalf("Expected %q but got %q for VirtualNetworkPeeringName", v.Expected.VirtualNetworkPeeringName, actual.VirtualNetworkPeeringName) - } - - } -} - -func TestParseVirtualNetworkPeeringIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkPeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/vIrTuAlNeTwOrKpEeRiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue", - Expected: &VirtualNetworkPeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkName: "virtualNetworkValue", - VirtualNetworkPeeringName: "virtualNetworkPeeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgVaLuE", - Expected: &VirtualNetworkPeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkName: "vIrTuAlNeTwOrKvAlUe", - VirtualNetworkPeeringName: "vIrTuAlNeTwOrKpEeRiNgVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkPeeringIDInsensitively(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.VirtualNetworkName != v.Expected.VirtualNetworkName { - t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) - } - - if actual.VirtualNetworkPeeringName != v.Expected.VirtualNetworkPeeringName { - t.Fatalf("Expected %q but got %q for VirtualNetworkPeeringName", v.Expected.VirtualNetworkPeeringName, actual.VirtualNetworkPeeringName) - } - - } -} - -func TestSegmentsForVirtualNetworkPeeringId(t *testing.T) { - segments := VirtualNetworkPeeringId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkPeeringId 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/network/2023-05-01/virtualnetworkpeerings/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_createorupdate.go deleted file mode 100644 index e7fcc91436e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_createorupdate.go +++ /dev/null @@ -1,103 +0,0 @@ -package virtualnetworkpeerings - -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 *VirtualNetworkPeering -} - -type CreateOrUpdateOperationOptions struct { - SyncRemoteAddressSpace *SyncRemoteAddressSpace -} - -func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions { - return CreateOrUpdateOperationOptions{} -} - -func (o CreateOrUpdateOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CreateOrUpdateOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CreateOrUpdateOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.SyncRemoteAddressSpace != nil { - out.Append("syncRemoteAddressSpace", fmt.Sprintf("%v", *o.SyncRemoteAddressSpace)) - } - return &out -} - -// CreateOrUpdate ... -func (c VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkPeeringId, input VirtualNetworkPeering, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 VirtualNetworkPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkPeeringId, input VirtualNetworkPeering, 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/network/2023-05-01/virtualnetworkpeerings/method_delete.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_delete.go deleted file mode 100644 index 0d0ded252a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkpeerings - -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 VirtualNetworkPeeringsClient) Delete(ctx context.Context, id VirtualNetworkPeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkPeeringsClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkPeeringId) 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/network/2023-05-01/virtualnetworkpeerings/method_get.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_get.go deleted file mode 100644 index 81671aa625e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkpeerings - -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 *VirtualNetworkPeering -} - -// Get ... -func (c VirtualNetworkPeeringsClient) Get(ctx context.Context, id VirtualNetworkPeeringId) (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 VirtualNetworkPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_list.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_list.go deleted file mode 100644 index 28614f5b07e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworkpeerings - -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 *[]VirtualNetworkPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkPeering -} - -// List ... -func (c VirtualNetworkPeeringsClient) List(ctx context.Context, id commonids.VirtualNetworkId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualNetworkPeerings", 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 *[]VirtualNetworkPeering `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 VirtualNetworkPeeringsClient) ListComplete(ctx context.Context, id commonids.VirtualNetworkId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, predicate VirtualNetworkPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetworkPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualnetworkpeerings/model_addressspace.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_addressspace.go deleted file mode 100644 index dadfe5be0b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_subresource.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_subresource.go deleted file mode 100644 index 07cc63aadbb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go deleted file mode 100644 index a1302f81779..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkBgpCommunities struct { - RegionalCommunity *string `json:"regionalCommunity,omitempty"` - VirtualNetworkCommunity string `json:"virtualNetworkCommunity"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkencryption.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkencryption.go deleted file mode 100644 index 82989ac5992..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkencryption.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkEncryption struct { - Enabled bool `json:"enabled"` - Enforcement *VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeering.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeering.go deleted file mode 100644 index 4b0c5a50abf..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go deleted file mode 100644 index c7f9534bb15..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeeringPropertiesFormat struct { - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - DoNotVerifyRemoteGateways *bool `json:"doNotVerifyRemoteGateways,omitempty"` - PeeringState *VirtualNetworkPeeringState `json:"peeringState,omitempty"` - PeeringSyncLevel *VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` - RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworkpeerings/predicates.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/predicates.go deleted file mode 100644 index a945839e0b2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualNetworkPeeringOperationPredicate) Matches(input VirtualNetworkPeering) 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.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/network/2023-05-01/virtualnetworkpeerings/version.go b/resource-manager/network/2023-05-01/virtualnetworkpeerings/version.go deleted file mode 100644 index e4ac8d260af..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworkpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/README.md b/resource-manager/network/2023-05-01/virtualnetworks/README.md deleted file mode 100644 index a644266982f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/README.md +++ /dev/null @@ -1,239 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworks` Documentation - -The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualnetworks" -``` - - -### Client Initialization - -```go -client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := virtualnetworks.VirtualNetwork{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -read, err := client.Get(ctx, id, virtualnetworks.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworksClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworksClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.ResourceNavigationLinksList` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -// alternatively `client.ResourceNavigationLinksList(ctx, id)` can be used to do batched pagination -items, err := client.ResourceNavigationLinksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.ServiceAssociationLinksList` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -// alternatively `client.ServiceAssociationLinksList(ctx, id)` can be used to do batched pagination -items, err := client.ServiceAssociationLinksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.SubnetsPrepareNetworkPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := virtualnetworks.PrepareNetworkPoliciesRequest{ - // ... -} - - -if err := client.SubnetsPrepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.SubnetsUnprepareNetworkPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := virtualnetworks.UnprepareNetworkPoliciesRequest{ - // ... -} - - -if err := client.SubnetsUnprepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := virtualnetworks.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 -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksCheckIPAddressAvailability` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -read, err := client.VirtualNetworksCheckIPAddressAvailability(ctx, id, virtualnetworks.DefaultVirtualNetworksCheckIPAddressAvailabilityOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksListDdosProtectionStatus` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// alternatively `client.VirtualNetworksListDdosProtectionStatus(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions())` can be used to do batched pagination -items, err := client.VirtualNetworksListDdosProtectionStatusComplete(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksListUsage` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// alternatively `client.VirtualNetworksListUsage(ctx, id)` can be used to do batched pagination -items, err := client.VirtualNetworksListUsageComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/virtualnetworks/constants.go b/resource-manager/network/2023-05-01/virtualnetworks/constants.go deleted file mode 100644 index 785c3650439..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/constants.go +++ /dev/null @@ -1,1324 +0,0 @@ -package virtualnetworks - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IsWorkloadProtected string - -const ( - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -func PossibleValuesForIsWorkloadProtected() []string { - return []string{ - string(IsWorkloadProtectedFalse), - string(IsWorkloadProtectedTrue), - } -} - -func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsWorkloadProtected(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { - vals := map[string]IsWorkloadProtected{ - "false": IsWorkloadProtectedFalse, - "true": IsWorkloadProtectedTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsWorkloadProtected(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkEncryptionEnforcement string - -const ( - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -func PossibleValuesForVirtualNetworkEncryptionEnforcement() []string { - return []string{ - string(VirtualNetworkEncryptionEnforcementAllowUnencrypted), - string(VirtualNetworkEncryptionEnforcementDropUnencrypted), - } -} - -func (s *VirtualNetworkEncryptionEnforcement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkEncryptionEnforcement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkEncryptionEnforcement(input string) (*VirtualNetworkEncryptionEnforcement, error) { - vals := map[string]VirtualNetworkEncryptionEnforcement{ - "allowunencrypted": VirtualNetworkEncryptionEnforcementAllowUnencrypted, - "dropunencrypted": VirtualNetworkEncryptionEnforcementDropUnencrypted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkEncryptionEnforcement(input) - return &out, nil -} - -type VirtualNetworkPeeringLevel string - -const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -func PossibleValuesForVirtualNetworkPeeringLevel() []string { - return []string{ - string(VirtualNetworkPeeringLevelFullyInSync), - string(VirtualNetworkPeeringLevelLocalAndRemoteNotInSync), - string(VirtualNetworkPeeringLevelLocalNotInSync), - string(VirtualNetworkPeeringLevelRemoteNotInSync), - } -} - -func (s *VirtualNetworkPeeringLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringLevel(input string) (*VirtualNetworkPeeringLevel, error) { - vals := map[string]VirtualNetworkPeeringLevel{ - "fullyinsync": VirtualNetworkPeeringLevelFullyInSync, - "localandremotenotinsync": VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, - "localnotinsync": VirtualNetworkPeeringLevelLocalNotInSync, - "remotenotinsync": VirtualNetworkPeeringLevelRemoteNotInSync, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringLevel(input) - return &out, nil -} - -type VirtualNetworkPeeringState string - -const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -func PossibleValuesForVirtualNetworkPeeringState() []string { - return []string{ - string(VirtualNetworkPeeringStateConnected), - string(VirtualNetworkPeeringStateDisconnected), - string(VirtualNetworkPeeringStateInitiated), - } -} - -func (s *VirtualNetworkPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringState(input string) (*VirtualNetworkPeeringState, error) { - vals := map[string]VirtualNetworkPeeringState{ - "connected": VirtualNetworkPeeringStateConnected, - "disconnected": VirtualNetworkPeeringStateDisconnected, - "initiated": VirtualNetworkPeeringStateInitiated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringState(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualnetworks/method_createorupdate.go deleted file mode 100644 index fb27efb9d4b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualnetworks - -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 *VirtualNetwork -} - -// CreateOrUpdate ... -func (c VirtualNetworksClient) CreateOrUpdate(ctx context.Context, id commonids.VirtualNetworkId, input VirtualNetwork) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworksClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualNetworkId, input VirtualNetwork) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualnetworks/method_delete.go b/resource-manager/network/2023-05-01/virtualnetworks/method_delete.go deleted file mode 100644 index 53212cd5aba..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualnetworks - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c VirtualNetworksClient) Delete(ctx context.Context, id commonids.VirtualNetworkId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworksClient) DeleteThenPoll(ctx context.Context, id commonids.VirtualNetworkId) 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/network/2023-05-01/virtualnetworks/method_get.go b/resource-manager/network/2023-05-01/virtualnetworks/method_get.go deleted file mode 100644 index e40ab49ec8e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package virtualnetworks - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetwork -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c VirtualNetworksClient) Get(ctx context.Context, id commonids.VirtualNetworkId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 VirtualNetwork - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_list.go b/resource-manager/network/2023-05-01/virtualnetworks/method_list.go deleted file mode 100644 index 692f238de2e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 *[]VirtualNetwork -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetwork -} - -// List ... -func (c VirtualNetworksClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworks", 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 *[]VirtualNetwork `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 VirtualNetworksClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetwork, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualnetworks/method_listall.go b/resource-manager/network/2023-05-01/virtualnetworks/method_listall.go deleted file mode 100644 index f66d7117c0c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetwork -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetwork -} - -// ListAll ... -func (c VirtualNetworksClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworks", 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 *[]VirtualNetwork `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c VirtualNetworksClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]VirtualNetwork, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_resourcenavigationlinkslist.go b/resource-manager/network/2023-05-01/virtualnetworks/method_resourcenavigationlinkslist.go deleted file mode 100644 index 50c441b1608..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_resourcenavigationlinkslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 ResourceNavigationLinksListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ResourceNavigationLink -} - -type ResourceNavigationLinksListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ResourceNavigationLink -} - -// ResourceNavigationLinksList ... -func (c VirtualNetworksClient) ResourceNavigationLinksList(ctx context.Context, id commonids.SubnetId) (result ResourceNavigationLinksListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/resourceNavigationLinks", 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 *[]ResourceNavigationLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ResourceNavigationLinksListComplete retrieves all the results into a single object -func (c VirtualNetworksClient) ResourceNavigationLinksListComplete(ctx context.Context, id commonids.SubnetId) (ResourceNavigationLinksListCompleteResult, error) { - return c.ResourceNavigationLinksListCompleteMatchingPredicate(ctx, id, ResourceNavigationLinkOperationPredicate{}) -} - -// ResourceNavigationLinksListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ResourceNavigationLinksListCompleteMatchingPredicate(ctx context.Context, id commonids.SubnetId, predicate ResourceNavigationLinkOperationPredicate) (result ResourceNavigationLinksListCompleteResult, err error) { - items := make([]ResourceNavigationLink, 0) - - resp, err := c.ResourceNavigationLinksList(ctx, id) - if err != nil { - 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 = ResourceNavigationLinksListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_serviceassociationlinkslist.go b/resource-manager/network/2023-05-01/virtualnetworks/method_serviceassociationlinkslist.go deleted file mode 100644 index 33ee4ced254..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_serviceassociationlinkslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 ServiceAssociationLinksListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServiceAssociationLink -} - -type ServiceAssociationLinksListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceAssociationLink -} - -// ServiceAssociationLinksList ... -func (c VirtualNetworksClient) ServiceAssociationLinksList(ctx context.Context, id commonids.SubnetId) (result ServiceAssociationLinksListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceAssociationLinks", 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 *[]ServiceAssociationLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ServiceAssociationLinksListComplete retrieves all the results into a single object -func (c VirtualNetworksClient) ServiceAssociationLinksListComplete(ctx context.Context, id commonids.SubnetId) (ServiceAssociationLinksListCompleteResult, error) { - return c.ServiceAssociationLinksListCompleteMatchingPredicate(ctx, id, ServiceAssociationLinkOperationPredicate{}) -} - -// ServiceAssociationLinksListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ServiceAssociationLinksListCompleteMatchingPredicate(ctx context.Context, id commonids.SubnetId, predicate ServiceAssociationLinkOperationPredicate) (result ServiceAssociationLinksListCompleteResult, err error) { - items := make([]ServiceAssociationLink, 0) - - resp, err := c.ServiceAssociationLinksList(ctx, id) - if err != nil { - 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 = ServiceAssociationLinksListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_subnetspreparenetworkpolicies.go b/resource-manager/network/2023-05-01/virtualnetworks/method_subnetspreparenetworkpolicies.go deleted file mode 100644 index b42b121f904..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_subnetspreparenetworkpolicies.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworks - -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 SubnetsPrepareNetworkPoliciesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SubnetsPrepareNetworkPolicies ... -func (c VirtualNetworksClient) SubnetsPrepareNetworkPolicies(ctx context.Context, id commonids.SubnetId, input PrepareNetworkPoliciesRequest) (result SubnetsPrepareNetworkPoliciesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/prepareNetworkPolicies", 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 -} - -// SubnetsPrepareNetworkPoliciesThenPoll performs SubnetsPrepareNetworkPolicies then polls until it's completed -func (c VirtualNetworksClient) SubnetsPrepareNetworkPoliciesThenPoll(ctx context.Context, id commonids.SubnetId, input PrepareNetworkPoliciesRequest) error { - result, err := c.SubnetsPrepareNetworkPolicies(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SubnetsPrepareNetworkPolicies: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SubnetsPrepareNetworkPolicies: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go b/resource-manager/network/2023-05-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go deleted file mode 100644 index 69a0e33a2c8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworks - -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 SubnetsUnprepareNetworkPoliciesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SubnetsUnprepareNetworkPolicies ... -func (c VirtualNetworksClient) SubnetsUnprepareNetworkPolicies(ctx context.Context, id commonids.SubnetId, input UnprepareNetworkPoliciesRequest) (result SubnetsUnprepareNetworkPoliciesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/unprepareNetworkPolicies", 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 -} - -// SubnetsUnprepareNetworkPoliciesThenPoll performs SubnetsUnprepareNetworkPolicies then polls until it's completed -func (c VirtualNetworksClient) SubnetsUnprepareNetworkPoliciesThenPoll(ctx context.Context, id commonids.SubnetId, input UnprepareNetworkPoliciesRequest) error { - result, err := c.SubnetsUnprepareNetworkPolicies(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SubnetsUnprepareNetworkPolicies: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SubnetsUnprepareNetworkPolicies: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_updatetags.go b/resource-manager/network/2023-05-01/virtualnetworks/method_updatetags.go deleted file mode 100644 index 8e2d6ea92a2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_updatetags.go +++ /dev/null @@ -1,59 +0,0 @@ -package virtualnetworks - -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 UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetwork -} - -// UpdateTags ... -func (c VirtualNetworksClient) UpdateTags(ctx context.Context, id commonids.VirtualNetworkId, 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 VirtualNetwork - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go b/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go deleted file mode 100644 index 85ba4d73ccd..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go +++ /dev/null @@ -1,84 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksCheckIPAddressAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPAddressAvailabilityResult -} - -type VirtualNetworksCheckIPAddressAvailabilityOperationOptions struct { - IPAddress *string -} - -func DefaultVirtualNetworksCheckIPAddressAvailabilityOperationOptions() VirtualNetworksCheckIPAddressAvailabilityOperationOptions { - return VirtualNetworksCheckIPAddressAvailabilityOperationOptions{} -} - -func (o VirtualNetworksCheckIPAddressAvailabilityOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o VirtualNetworksCheckIPAddressAvailabilityOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o VirtualNetworksCheckIPAddressAvailabilityOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPAddress != nil { - out.Append("ipAddress", fmt.Sprintf("%v", *o.IPAddress)) - } - return &out -} - -// VirtualNetworksCheckIPAddressAvailability ... -func (c VirtualNetworksClient) VirtualNetworksCheckIPAddressAvailability(ctx context.Context, id commonids.VirtualNetworkId, options VirtualNetworksCheckIPAddressAvailabilityOperationOptions) (result VirtualNetworksCheckIPAddressAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/checkIPAddressAvailability", id.ID()), - OptionsObject: options, - } - - 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 IPAddressAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go b/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go deleted file mode 100644 index c0872952086..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go +++ /dev/null @@ -1,109 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksListDdosProtectionStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPDdosProtectionStatusResult -} - -type VirtualNetworksListDdosProtectionStatusCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPDdosProtectionStatusResult -} - -type VirtualNetworksListDdosProtectionStatusOperationOptions struct { - SkipToken *string - Top *int64 -} - -func DefaultVirtualNetworksListDdosProtectionStatusOperationOptions() VirtualNetworksListDdosProtectionStatusOperationOptions { - return VirtualNetworksListDdosProtectionStatusOperationOptions{} -} - -func (o VirtualNetworksListDdosProtectionStatusOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o VirtualNetworksListDdosProtectionStatusOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o VirtualNetworksListDdosProtectionStatusOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.SkipToken != nil { - out.Append("skipToken", fmt.Sprintf("%v", *o.SkipToken)) - } - if o.Top != nil { - out.Append("top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// VirtualNetworksListDdosProtectionStatus ... -func (c VirtualNetworksClient) VirtualNetworksListDdosProtectionStatus(ctx context.Context, id commonids.VirtualNetworkId, options VirtualNetworksListDdosProtectionStatusOperationOptions) (result VirtualNetworksListDdosProtectionStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ddosProtectionStatus", id.ID()), - OptionsObject: options, - } - - 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 -} - -// VirtualNetworksListDdosProtectionStatusThenPoll performs VirtualNetworksListDdosProtectionStatus then polls until it's completed -func (c VirtualNetworksClient) VirtualNetworksListDdosProtectionStatusThenPoll(ctx context.Context, id commonids.VirtualNetworkId, options VirtualNetworksListDdosProtectionStatusOperationOptions) error { - result, err := c.VirtualNetworksListDdosProtectionStatus(ctx, id, options) - if err != nil { - return fmt.Errorf("performing VirtualNetworksListDdosProtectionStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualNetworksListDdosProtectionStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistusage.go b/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistusage.go deleted file mode 100644 index b1caad36dd4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/method_virtualnetworkslistusage.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksListUsageOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkUsage -} - -type VirtualNetworksListUsageCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkUsage -} - -// VirtualNetworksListUsage ... -func (c VirtualNetworksClient) VirtualNetworksListUsage(ctx context.Context, id commonids.VirtualNetworkId) (result VirtualNetworksListUsageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 *[]VirtualNetworkUsage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualNetworksListUsageComplete retrieves all the results into a single object -func (c VirtualNetworksClient) VirtualNetworksListUsageComplete(ctx context.Context, id commonids.VirtualNetworkId) (VirtualNetworksListUsageCompleteResult, error) { - return c.VirtualNetworksListUsageCompleteMatchingPredicate(ctx, id, VirtualNetworkUsageOperationPredicate{}) -} - -// VirtualNetworksListUsageCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) VirtualNetworksListUsageCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, predicate VirtualNetworkUsageOperationPredicate) (result VirtualNetworksListUsageCompleteResult, err error) { - items := make([]VirtualNetworkUsage, 0) - - resp, err := c.VirtualNetworksListUsage(ctx, id) - if err != nil { - 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 = VirtualNetworksListUsageCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_addressspace.go b/resource-manager/network/2023-05-01/virtualnetworks/model_addressspace.go deleted file mode 100644 index 9e0e23e9145..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 3f9607979a8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 6f399a7bf5d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 953789d1f3e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 3da3cb7d9c8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index d9d39242c2b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygroup.go deleted file mode 100644 index 8069aeaaf35..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 29a50229369..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspool.go b/resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspool.go deleted file mode 100644 index dca54b5ff44..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index b5357aa1b58..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 4608979dcd2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_ddossettings.go b/resource-manager/network/2023-05-01/virtualnetworks/model_ddossettings.go deleted file mode 100644 index 1a0ce5cf3aa..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_delegation.go b/resource-manager/network/2023-05-01/virtualnetworks/model_delegation.go deleted file mode 100644 index a8d0d243017..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_dhcpoptions.go b/resource-manager/network/2023-05-01/virtualnetworks/model_dhcpoptions.go deleted file mode 100644 index 2e389bf9503..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_dhcpoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DhcpOptions struct { - DnsServers *[]string `json:"dnsServers,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_flowlog.go b/resource-manager/network/2023-05-01/virtualnetworks/model_flowlog.go deleted file mode 100644 index b920c2a5d05..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/virtualnetworks/model_flowlogformatparameters.go deleted file mode 100644 index 62b8c967d59..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_flowlogpropertiesformat.go deleted file mode 100644 index 46ad7cc1502..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfiguration.go deleted file mode 100644 index 4b7f7549a8a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworks - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 7f51afc745f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index ef3318f49d4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrule.go b/resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrule.go deleted file mode 100644 index 20f0e56c966..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 8ca3d3cee59..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_ipaddressavailabilityresult.go b/resource-manager/network/2023-05-01/virtualnetworks/model_ipaddressavailabilityresult.go deleted file mode 100644 index 2db5fbd90fa..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_ipaddressavailabilityresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAddressAvailabilityResult struct { - Available *bool `json:"available,omitempty"` - AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` - IsPlatformReserved *bool `json:"isPlatformReserved,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfiguration.go deleted file mode 100644 index 7fc81013c87..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofile.go deleted file mode 100644 index 246a7d2784a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1c15860eaa4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 5f7e978b372..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_iptag.go b/resource-manager/network/2023-05-01/virtualnetworks/model_iptag.go deleted file mode 100644 index 5f312015c16..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// 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/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddress.go deleted file mode 100644 index f84e6394098..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 5b16669363a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_natgateway.go b/resource-manager/network/2023-05-01/virtualnetworks/model_natgateway.go deleted file mode 100644 index e2a2c9ea1aa..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworks - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaypropertiesformat.go deleted file mode 100644 index 11bdb034e9d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaysku.go b/resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaysku.go deleted file mode 100644 index 3375ec20625..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_natruleportmapping.go b/resource-manager/network/2023-05-01/virtualnetworks/model_natruleportmapping.go deleted file mode 100644 index c1f6eb9d264..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicy.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicy.go deleted file mode 100644 index 565f4c702ee..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicy.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkIntentPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicyconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicyconfiguration.go deleted file mode 100644 index 3f3080bf421..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkintentpolicyconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkIntentPolicyConfiguration struct { - NetworkIntentPolicyName *string `json:"networkIntentPolicyName,omitempty"` - SourceNetworkIntentPolicy *NetworkIntentPolicy `json:"sourceNetworkIntentPolicy,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterface.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterface.go deleted file mode 100644 index 51266c314db..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacednssettings.go deleted file mode 100644 index 35b796d58ea..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfiguration.go deleted file mode 100644 index e4fe127f68f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 0cf1411b04e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index d36857278bf..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacepropertiesformat.go deleted file mode 100644 index f38dee01e75..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 7ee2c196852..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index f37548acc09..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygroup.go deleted file mode 100644 index c6ffd2de200..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index bdaff37d6ec..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_preparenetworkpoliciesrequest.go b/resource-manager/network/2023-05-01/virtualnetworks/model_preparenetworkpoliciesrequest.go deleted file mode 100644 index af5d6a6061c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_preparenetworkpoliciesrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrepareNetworkPoliciesRequest struct { - NetworkIntentPolicyConfigurations *[]NetworkIntentPolicyConfiguration `json:"networkIntentPolicyConfigurations,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpoint.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpoint.go deleted file mode 100644 index a21e2003c7b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnection.go deleted file mode 100644 index 03c0943acbe..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/virtualnetworks/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnectionproperties.go deleted file mode 100644 index badbc227dee..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfiguration.go deleted file mode 100644 index b8c8c0e51e2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 0e1ea69495c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointproperties.go deleted file mode 100644 index c204c6f06f5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkservice.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkservice.go deleted file mode 100644 index ea60905675d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnection.go deleted file mode 100644 index 45640ebd97e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index ece1141c4d0..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 498d4f92f9a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index b637ed217b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 7c3080b30c1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceproperties.go deleted file mode 100644 index e187bf8454c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddress.go b/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddress.go deleted file mode 100644 index 5eef47c77e3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddressdnssettings.go deleted file mode 100644 index 1e10d9bb32a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresspropertiesformat.go deleted file mode 100644 index f38386b9fd0..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresssku.go deleted file mode 100644 index f080c20b33e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipddosprotectionstatusresult.go b/resource-manager/network/2023-05-01/virtualnetworks/model_publicipddosprotectionstatusresult.go deleted file mode 100644 index ca0f8cc894f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_publicipddosprotectionstatusresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPDdosProtectionStatusResult struct { - DdosProtectionPlanId *string `json:"ddosProtectionPlanId,omitempty"` - IsWorkloadProtected *IsWorkloadProtected `json:"isWorkloadProtected,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - PublicIPAddressId *string `json:"publicIpAddressId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlink.go deleted file mode 100644 index e26d27c7784..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlinkformat.go deleted file mode 100644 index 5c0bb30457e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_resourceset.go b/resource-manager/network/2023-05-01/virtualnetworks/model_resourceset.go deleted file mode 100644 index 3f176c096e6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/virtualnetworks/model_retentionpolicyparameters.go deleted file mode 100644 index b8a74239a26..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_route.go b/resource-manager/network/2023-05-01/virtualnetworks/model_route.go deleted file mode 100644 index d76eb9ceeec..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_routepropertiesformat.go deleted file mode 100644 index e52a5de8ca6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_routetable.go b/resource-manager/network/2023-05-01/virtualnetworks/model_routetable.go deleted file mode 100644 index 2e233c020e3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_routetablepropertiesformat.go deleted file mode 100644 index 69015d57403..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_securityrule.go b/resource-manager/network/2023-05-01/virtualnetworks/model_securityrule.go deleted file mode 100644 index f7ed0f51115..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_securityrulepropertiesformat.go deleted file mode 100644 index af160e60e64..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlink.go deleted file mode 100644 index 77039ca3b73..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index d6ef1f15de1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 82eb0f31d43..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicy.go deleted file mode 100644 index d50c20ce576..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 4d2ebe5ac46..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index b221dd2c319..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 00a9c1e5662..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 03a937b7d65..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_subnet.go b/resource-manager/network/2023-05-01/virtualnetworks/model_subnet.go deleted file mode 100644 index 7b3d4ff10c8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_subnetpropertiesformat.go deleted file mode 100644 index 1daa153bc29..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_subresource.go b/resource-manager/network/2023-05-01/virtualnetworks/model_subresource.go deleted file mode 100644 index ecd84dace18..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_tagsobject.go b/resource-manager/network/2023-05-01/virtualnetworks/model_tagsobject.go deleted file mode 100644 index 9ac4400ec75..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// 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/network/2023-05-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index ce47549e2b9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsproperties.go deleted file mode 100644 index 26812782cc8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go b/resource-manager/network/2023-05-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go deleted file mode 100644 index 84b1fedbc2b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UnprepareNetworkPoliciesRequest struct { - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetwork.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetwork.go deleted file mode 100644 index 01f2a07994e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetwork.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetwork struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkbgpcommunities.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkbgpcommunities.go deleted file mode 100644 index ecb655fd234..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkbgpcommunities.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkBgpCommunities struct { - RegionalCommunity *string `json:"regionalCommunity,omitempty"` - VirtualNetworkCommunity string `json:"virtualNetworkCommunity"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkencryption.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkencryption.go deleted file mode 100644 index a0d8e13fe3a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkencryption.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkEncryption struct { - Enabled bool `json:"enabled"` - Enforcement *VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeering.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeering.go deleted file mode 100644 index 85b7fe9183a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go deleted file mode 100644 index 642e0676b8f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeeringPropertiesFormat struct { - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - DoNotVerifyRemoteGateways *bool `json:"doNotVerifyRemoteGateways,omitempty"` - PeeringState *VirtualNetworkPeeringState `json:"peeringState,omitempty"` - PeeringSyncLevel *VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` - RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpropertiesformat.go deleted file mode 100644 index a6ad3b4e3a0..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPropertiesFormat struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` - EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` - EnableVMProtection *bool `json:"enableVmProtection,omitempty"` - Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlowTimeoutInMinutes *int64 `json:"flowTimeoutInMinutes,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` - VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktap.go deleted file mode 100644 index d1b3faf4100..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 4c2bb1fad6c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusage.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusage.go deleted file mode 100644 index 470dd6b34f8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusage.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkUsage struct { - CurrentValue *float64 `json:"currentValue,omitempty"` - Id *string `json:"id,omitempty"` - Limit *float64 `json:"limit,omitempty"` - Name *VirtualNetworkUsageName `json:"name,omitempty"` - Unit *string `json:"unit,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusagename.go b/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusagename.go deleted file mode 100644 index f3156ce6be8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/model_virtualnetworkusagename.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkUsageName struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/predicates.go b/resource-manager/network/2023-05-01/virtualnetworks/predicates.go deleted file mode 100644 index ae976386154..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/predicates.go +++ /dev/null @@ -1,144 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPDdosProtectionStatusResultOperationPredicate struct { - DdosProtectionPlanId *string - PublicIPAddress *string - PublicIPAddressId *string -} - -func (p PublicIPDdosProtectionStatusResultOperationPredicate) Matches(input PublicIPDdosProtectionStatusResult) bool { - - if p.DdosProtectionPlanId != nil && (input.DdosProtectionPlanId == nil || *p.DdosProtectionPlanId != *input.DdosProtectionPlanId) { - return false - } - - if p.PublicIPAddress != nil && (input.PublicIPAddress == nil || *p.PublicIPAddress != *input.PublicIPAddress) { - return false - } - - if p.PublicIPAddressId != nil && (input.PublicIPAddressId == nil || *p.PublicIPAddressId != *input.PublicIPAddressId) { - return false - } - - return true -} - -type ResourceNavigationLinkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ResourceNavigationLinkOperationPredicate) Matches(input ResourceNavigationLink) 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.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 ServiceAssociationLinkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ServiceAssociationLinkOperationPredicate) Matches(input ServiceAssociationLink) 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.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 VirtualNetworkOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkOperationPredicate) Matches(input VirtualNetwork) 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 && (input.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 VirtualNetworkUsageOperationPredicate struct { - CurrentValue *float64 - Id *string - Limit *float64 - Unit *string -} - -func (p VirtualNetworkUsageOperationPredicate) Matches(input VirtualNetworkUsage) bool { - - if p.CurrentValue != nil && (input.CurrentValue == nil || *p.CurrentValue != *input.CurrentValue) { - return false - } - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Limit != nil && (input.Limit == nil || *p.Limit != *input.Limit) { - return false - } - - if p.Unit != nil && (input.Unit == nil || *p.Unit != *input.Unit) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-05-01/virtualnetworks/version.go b/resource-manager/network/2023-05-01/virtualnetworks/version.go deleted file mode 100644 index 411c6729853..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/README.md b/resource-manager/network/2023-05-01/virtualnetworktap/README.md deleted file mode 100644 index 260c9f20a23..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworktap` Documentation - -The `virtualnetworktap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualnetworktap" -``` - - -### Client Initialization - -```go -client := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkTapClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -payload := virtualnetworktap.VirtualNetworkTap{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkTapClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkTapClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -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: `VirtualNetworkTapClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -payload := virtualnetworktap.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/network/2023-05-01/virtualnetworktap/client.go b/resource-manager/network/2023-05-01/virtualnetworktap/client.go deleted file mode 100644 index 4444f3072d8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworktap - -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 VirtualNetworkTapClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkTapClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkTapClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworktap", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkTapClient: %+v", err) - } - - return &VirtualNetworkTapClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/constants.go b/resource-manager/network/2023-05-01/virtualnetworktap/constants.go deleted file mode 100644 index fd73f5ab17a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package virtualnetworktap - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap.go deleted file mode 100644 index 5bf0638a304..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworktap - -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(&VirtualNetworkTapId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkTapId{} - -// VirtualNetworkTapId is a struct representing the Resource ID for a Virtual Network Tap -type VirtualNetworkTapId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkTapName string -} - -// NewVirtualNetworkTapID returns a new VirtualNetworkTapId struct -func NewVirtualNetworkTapID(subscriptionId string, resourceGroupName string, virtualNetworkTapName string) VirtualNetworkTapId { - return VirtualNetworkTapId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkTapName: virtualNetworkTapName, - } -} - -// ParseVirtualNetworkTapID parses 'input' into a VirtualNetworkTapId -func ParseVirtualNetworkTapID(input string) (*VirtualNetworkTapId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkTapId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkTapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkTapIDInsensitively parses 'input' case-insensitively into a VirtualNetworkTapId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkTapIDInsensitively(input string) (*VirtualNetworkTapId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkTapId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkTapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkTapId) 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.VirtualNetworkTapName, ok = input.Parsed["virtualNetworkTapName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkTapName", input) - } - - return nil -} - -// ValidateVirtualNetworkTapID checks that 'input' can be parsed as a Virtual Network Tap ID -func ValidateVirtualNetworkTapID(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 := ParseVirtualNetworkTapID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Tap ID -func (id VirtualNetworkTapId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworkTaps/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkTapName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Tap ID -func (id VirtualNetworkTapId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworkTaps", "virtualNetworkTaps", "virtualNetworkTaps"), - resourceids.UserSpecifiedSegment("virtualNetworkTapName", "virtualNetworkTapValue"), - } -} - -// String returns a human-readable description of this Virtual Network Tap ID -func (id VirtualNetworkTapId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Tap Name: %q", id.VirtualNetworkTapName), - } - return fmt.Sprintf("Virtual Network Tap (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap_test.go deleted file mode 100644 index db63499cc59..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/id_virtualnetworktap_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworktap - -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 = &VirtualNetworkTapId{} - -func TestNewVirtualNetworkTapID(t *testing.T) { - id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - - 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.VirtualNetworkTapName != "virtualNetworkTapValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "virtualNetworkTapValue") - } -} - -func TestFormatVirtualNetworkTapID(t *testing.T) { - actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkTapID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkTapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue", - Expected: &VirtualNetworkTapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "virtualNetworkTapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkTapID(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.VirtualNetworkTapName != v.Expected.VirtualNetworkTapName { - t.Fatalf("Expected %q but got %q for VirtualNetworkTapName", v.Expected.VirtualNetworkTapName, actual.VirtualNetworkTapName) - } - - } -} - -func TestParseVirtualNetworkTapIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkTapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue", - Expected: &VirtualNetworkTapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "virtualNetworkTapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApVaLuE", - Expected: &VirtualNetworkTapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkTapName: "vIrTuAlNeTwOrKtApVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkTapIDInsensitively(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.VirtualNetworkTapName != v.Expected.VirtualNetworkTapName { - t.Fatalf("Expected %q but got %q for VirtualNetworkTapName", v.Expected.VirtualNetworkTapName, actual.VirtualNetworkTapName) - } - - } -} - -func TestSegmentsForVirtualNetworkTapId(t *testing.T) { - segments := VirtualNetworkTapId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkTapId 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/network/2023-05-01/virtualnetworktap/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualnetworktap/method_createorupdate.go deleted file mode 100644 index 9e0265a1971..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworktap - -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 *VirtualNetworkTap -} - -// CreateOrUpdate ... -func (c VirtualNetworkTapClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkTapId, input VirtualNetworkTap) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworkTapClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkTapId, input VirtualNetworkTap) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualnetworktap/method_delete.go b/resource-manager/network/2023-05-01/virtualnetworktap/method_delete.go deleted file mode 100644 index 93b4ec0c489..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworktap - -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 VirtualNetworkTapClient) Delete(ctx context.Context, id VirtualNetworkTapId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkTapClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkTapId) 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/network/2023-05-01/virtualnetworktap/method_get.go b/resource-manager/network/2023-05-01/virtualnetworktap/method_get.go deleted file mode 100644 index 7d8ef7767ee..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworktap - -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 *VirtualNetworkTap -} - -// Get ... -func (c VirtualNetworkTapClient) Get(ctx context.Context, id VirtualNetworkTapId) (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 VirtualNetworkTap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/method_updatetags.go b/resource-manager/network/2023-05-01/virtualnetworktap/method_updatetags.go deleted file mode 100644 index 2079b8bdf80..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package virtualnetworktap - -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 *VirtualNetworkTap -} - -// UpdateTags ... -func (c VirtualNetworkTapClient) UpdateTags(ctx context.Context, id VirtualNetworkTapId, 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 VirtualNetworkTap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddress.go deleted file mode 100644 index db62a91aeb1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index a220744195a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index f1a5f708c1c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfiguration.go deleted file mode 100644 index e0dd6f54986..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 05e2cf6e7ff..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygroup.go deleted file mode 100644 index 89fac6f865a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index dd34d207344..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspool.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspool.go deleted file mode 100644 index 22fa8953303..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 6ac563af429..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index d263c1b8649..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_ddossettings.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_ddossettings.go deleted file mode 100644 index 934851a560f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_delegation.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_delegation.go deleted file mode 100644 index b98041c6409..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlog.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlog.go deleted file mode 100644 index ddd3757f710..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogformatparameters.go deleted file mode 100644 index 05c5660bcab..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogpropertiesformat.go deleted file mode 100644 index 64eb8ac4566..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfiguration.go deleted file mode 100644 index 8e718fbb787..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktap - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index df238cbcfd3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 3301ab1a1c7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrule.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrule.go deleted file mode 100644 index 7c4fefd00fe..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 9562bb00429..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfiguration.go deleted file mode 100644 index 072921c15aa..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofile.go deleted file mode 100644 index 319c9ec5ee9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index adf0a28fb73..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 14c8a64a2a2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_iptag.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_iptag.go deleted file mode 100644 index 85d10556d1c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// 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/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddress.go deleted file mode 100644 index bb0a0c328c1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index b16ba8335ae..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_natgateway.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_natgateway.go deleted file mode 100644 index ff0008c8a9e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworktap - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaypropertiesformat.go deleted file mode 100644 index 314c102eee6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaysku.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaysku.go deleted file mode 100644 index efd87c92e07..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_natruleportmapping.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_natruleportmapping.go deleted file mode 100644 index 9c675767782..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterface.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterface.go deleted file mode 100644 index 90bd182032d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacednssettings.go deleted file mode 100644 index 8f7f5c9ab69..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 420ea20f4d2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index e2d0d046dd7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index e8b6558e224..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 0428a2c793c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 1514177f60e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 4d5181920b1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygroup.go deleted file mode 100644 index f1f880186f1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index c0a2565b3a0..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpoint.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpoint.go deleted file mode 100644 index 18177d11a3e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnection.go deleted file mode 100644 index 3a5764483c9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/virtualnetworktap/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnectionproperties.go deleted file mode 100644 index f6119badaa5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfiguration.go deleted file mode 100644 index 35ffb6cda11..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 8e362a6d1b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointproperties.go deleted file mode 100644 index 8d42714c80d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkservice.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkservice.go deleted file mode 100644 index 42d87ebbbcb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnection.go deleted file mode 100644 index 6218ca9e0c5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index bb689f2425d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 4510ba8bea7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 7f7ebc0d7f8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 9e874822a6b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceproperties.go deleted file mode 100644 index cbafd8f4967..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddress.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddress.go deleted file mode 100644 index 5059f6b2c6b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddressdnssettings.go deleted file mode 100644 index 5e531cfaa59..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresspropertiesformat.go deleted file mode 100644 index b1b74de6b82..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresssku.go deleted file mode 100644 index c719ed93844..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlink.go deleted file mode 100644 index e1834b720d7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlinkformat.go deleted file mode 100644 index 5100c40bc8d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_resourceset.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_resourceset.go deleted file mode 100644 index fa8408e3374..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_retentionpolicyparameters.go deleted file mode 100644 index 402a95f81e1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_route.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_route.go deleted file mode 100644 index 5eb14c76d8d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_routepropertiesformat.go deleted file mode 100644 index 1e404b86207..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_routetable.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_routetable.go deleted file mode 100644 index c5bfa2aacc9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_routetablepropertiesformat.go deleted file mode 100644 index 788b58851db..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_securityrule.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_securityrule.go deleted file mode 100644 index 42a4c62093e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_securityrulepropertiesformat.go deleted file mode 100644 index 8b92ef45964..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlink.go deleted file mode 100644 index 806ced6b5e5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 9a18079edd6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 347761b277f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicy.go deleted file mode 100644 index 6ca8e2d4a35..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 05ee77e2b81..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 537a3df890d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index f2645082640..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 6da43c107d7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_subnet.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_subnet.go deleted file mode 100644 index e7d6771812b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_subnetpropertiesformat.go deleted file mode 100644 index 16b011e7508..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_subresource.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_subresource.go deleted file mode 100644 index da7e12e526b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_tagsobject.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_tagsobject.go deleted file mode 100644 index 1c98be14a33..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// 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/network/2023-05-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 89aa415edbb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsproperties.go deleted file mode 100644 index 701cc7ae154..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktap.go deleted file mode 100644 index 209659855b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 5c2f9db5892..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktap/version.go b/resource-manager/network/2023-05-01/virtualnetworktap/version.go deleted file mode 100644 index d4405792df9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktap/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktap/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/README.md b/resource-manager/network/2023-05-01/virtualnetworktaps/README.md deleted file mode 100644 index 1e66c6c1ed5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualnetworktaps` Documentation - -The `virtualnetworktaps` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualnetworktaps" -``` - - -### Client Initialization - -```go -client := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkTapsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkTapsClient.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 -} -``` diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/client.go b/resource-manager/network/2023-05-01/virtualnetworktaps/client.go deleted file mode 100644 index 33de6824de7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworktaps - -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 VirtualNetworkTapsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkTapsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkTapsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworktaps", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkTapsClient: %+v", err) - } - - return &VirtualNetworkTapsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/constants.go b/resource-manager/network/2023-05-01/virtualnetworktaps/constants.go deleted file mode 100644 index 6a84040cbb3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package virtualnetworktaps - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/method_listall.go b/resource-manager/network/2023-05-01/virtualnetworktaps/method_listall.go deleted file mode 100644 index 49ba7ccfcc1..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworktaps - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkTap -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkTap -} - -// ListAll ... -func (c VirtualNetworkTapsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworkTaps", 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 *[]VirtualNetworkTap `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c VirtualNetworkTapsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, VirtualNetworkTapOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkTapsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkTapOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]VirtualNetworkTap, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualnetworktaps/method_listbyresourcegroup.go deleted file mode 100644 index b5c64395b6c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworktaps - -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 *[]VirtualNetworkTap -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkTap -} - -// ListByResourceGroup ... -func (c VirtualNetworkTapsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworkTaps", 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 *[]VirtualNetworkTap `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 VirtualNetworkTapsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualNetworkTapOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkTapsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkTapOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]VirtualNetworkTap, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b76026be6bc..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index b8bc620ea71..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index f6179e4f0e3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 9e995dbb56d..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 0c3c2c531f3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygroup.go deleted file mode 100644 index 1c38043ef88..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 9102a6b9188..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspool.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspool.go deleted file mode 100644 index 2c478d85562..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 9afb32298d3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 36b2063994a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ddossettings.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_ddossettings.go deleted file mode 100644 index cbd6745cb8e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_delegation.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_delegation.go deleted file mode 100644 index 018e0605aee..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlog.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlog.go deleted file mode 100644 index 5a7b0a4647b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogformatparameters.go deleted file mode 100644 index 3dc25c465d0..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogpropertiesformat.go deleted file mode 100644 index 6fc887f8010..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfiguration.go deleted file mode 100644 index 35e28c95460..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktaps - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index c6949a4745a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index a2e82dba72b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrule.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrule.go deleted file mode 100644 index f84bd93f6c7..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 8200337ef35..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfiguration.go deleted file mode 100644 index fcd9033c4a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofile.go deleted file mode 100644 index 2e7b5cfe5eb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1d5ab92dcd5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 4a486230c36..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_iptag.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_iptag.go deleted file mode 100644 index c4127e59d60..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// 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/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddress.go deleted file mode 100644 index 7a8c5cb8b73..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index d3193da6576..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgateway.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgateway.go deleted file mode 100644 index b2e289b8923..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworktaps - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaypropertiesformat.go deleted file mode 100644 index 17859bcb59e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaysku.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaysku.go deleted file mode 100644 index cab72fef58e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natruleportmapping.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_natruleportmapping.go deleted file mode 100644 index 2426f4e9182..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterface.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterface.go deleted file mode 100644 index 0959f2effbd..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacednssettings.go deleted file mode 100644 index 63a0e5410a5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 3295f16b481..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 7659a03380a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index dcfd84eac61..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 9cb7ea2624a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 3d883d5678c..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index dd9ef377372..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygroup.go deleted file mode 100644 index d3ce4b39ea6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 57de91eafd3..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpoint.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpoint.go deleted file mode 100644 index b58c024b508..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnection.go deleted file mode 100644 index 3d314882781..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/virtualnetworktaps/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnectionproperties.go deleted file mode 100644 index d6ea54d1367..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfiguration.go deleted file mode 100644 index 40468e7e3ae..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 46faf7b053b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointproperties.go deleted file mode 100644 index 44ca9629906..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkservice.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkservice.go deleted file mode 100644 index 8df5b6ca8e9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnection.go deleted file mode 100644 index 3d9511e926a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 149dad152de..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 5ae16683918..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 830a49d4825..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index b3b914d17a6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceproperties.go deleted file mode 100644 index 9e5885610f5..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddress.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddress.go deleted file mode 100644 index a63d498e9b2..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddressdnssettings.go deleted file mode 100644 index a22c5ccb482..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go deleted file mode 100644 index f3a6e76f01e..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresssku.go deleted file mode 100644 index b6d56cb8fcd..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlink.go deleted file mode 100644 index b362ba5a95b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlinkformat.go deleted file mode 100644 index 83b81bd5755..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourceset.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourceset.go deleted file mode 100644 index 7e28952a0a0..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_retentionpolicyparameters.go deleted file mode 100644 index 9a09f483b36..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_route.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_route.go deleted file mode 100644 index fe09505f366..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_routepropertiesformat.go deleted file mode 100644 index 3d3840b7cfb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_routetable.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_routetable.go deleted file mode 100644 index dc456ac5330..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_routetablepropertiesformat.go deleted file mode 100644 index 29d5488b413..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrule.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrule.go deleted file mode 100644 index 2b52f93106a..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrulepropertiesformat.go deleted file mode 100644 index 549b4d495a6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlink.go deleted file mode 100644 index eff71aa8797..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 72fe6efec6b..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go deleted file mode 100644 index d130c80bc92..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicy.go deleted file mode 100644 index b164c8a3ad8..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go deleted file mode 100644 index a715beb370f..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 6283b834876..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index e39a39b0dc9..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go deleted file mode 100644 index c5085da61db..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_subnet.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_subnet.go deleted file mode 100644 index 586828d80aa..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_subnetpropertiesformat.go deleted file mode 100644 index dbb930b9867..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_subresource.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_subresource.go deleted file mode 100644 index 64ad7a5e2b6..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 5d2043fba12..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsproperties.go deleted file mode 100644 index a673cd2c104..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktap.go deleted file mode 100644 index d5bf88cf9cb..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index e75a60ff515..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualnetworktaps/predicates.go b/resource-manager/network/2023-05-01/virtualnetworktaps/predicates.go deleted file mode 100644 index 0b7fb5985f4..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkTapOperationPredicate) Matches(input VirtualNetworkTap) 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 && (input.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/network/2023-05-01/virtualnetworktaps/version.go b/resource-manager/network/2023-05-01/virtualnetworktaps/version.go deleted file mode 100644 index 485b3deb266..00000000000 --- a/resource-manager/network/2023-05-01/virtualnetworktaps/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktaps/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/README.md b/resource-manager/network/2023-05-01/virtualrouterpeerings/README.md deleted file mode 100644 index fda9d4affe3..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualrouterpeerings` Documentation - -The `virtualrouterpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualrouterpeerings" -``` - - -### Client Initialization - -```go -client := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualRouterPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -payload := virtualrouterpeerings.VirtualRouterPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRouterPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRouterPeeringsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -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: `VirtualRouterPeeringsClient.List` - -```go -ctx := context.TODO() -id := virtualrouterpeerings.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -// 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/network/2023-05-01/virtualrouterpeerings/client.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/client.go deleted file mode 100644 index 6b55e901ef5..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualrouterpeerings - -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 VirtualRouterPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualRouterPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualRouterPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualrouterpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualRouterPeeringsClient: %+v", err) - } - - return &VirtualRouterPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/constants.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/constants.go deleted file mode 100644 index 464d2b779c9..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package virtualrouterpeerings - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter.go deleted file mode 100644 index 85fff5b9af3..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualrouterpeerings - -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(&VirtualRouterId{}) -} - -var _ resourceids.ResourceId = &VirtualRouterId{} - -// VirtualRouterId is a struct representing the Resource ID for a Virtual Router -type VirtualRouterId struct { - SubscriptionId string - ResourceGroupName string - VirtualRouterName string -} - -// NewVirtualRouterID returns a new VirtualRouterId struct -func NewVirtualRouterID(subscriptionId string, resourceGroupName string, virtualRouterName string) VirtualRouterId { - return VirtualRouterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualRouterName: virtualRouterName, - } -} - -// ParseVirtualRouterID parses 'input' into a VirtualRouterId -func ParseVirtualRouterID(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualRouterIDInsensitively parses 'input' case-insensitively into a VirtualRouterId -// note: this method should only be used for API response data and not user input -func ParseVirtualRouterIDInsensitively(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualRouterId) 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.VirtualRouterName, ok = input.Parsed["virtualRouterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualRouterName", input) - } - - return nil -} - -// ValidateVirtualRouterID checks that 'input' can be parsed as a Virtual Router ID -func ValidateVirtualRouterID(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 := ParseVirtualRouterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Router ID -func (id VirtualRouterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualRouters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualRouterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Router ID -func (id VirtualRouterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualRouters", "virtualRouters", "virtualRouters"), - resourceids.UserSpecifiedSegment("virtualRouterName", "virtualRouterValue"), - } -} - -// String returns a human-readable description of this Virtual Router ID -func (id VirtualRouterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Router Name: %q", id.VirtualRouterName), - } - return fmt.Sprintf("Virtual Router (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter_test.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter_test.go deleted file mode 100644 index 43ccb8cff05..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/id_virtualrouter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualrouterpeerings - -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 = &VirtualRouterId{} - -func TestNewVirtualRouterID(t *testing.T) { - id := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - - 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.VirtualRouterName != "virtualRouterValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualRouterName'", id.VirtualRouterName, "virtualRouterValue") - } -} - -func TestFormatVirtualRouterID(t *testing.T) { - actual := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualRouterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterID(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestParseVirtualRouterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualRouterName: "vIrTuAlRoUtErVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterIDInsensitively(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestSegmentsForVirtualRouterId(t *testing.T) { - segments := VirtualRouterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualRouterId 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/network/2023-05-01/virtualrouterpeerings/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/method_createorupdate.go deleted file mode 100644 index c3c6be8f2f4..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualrouterpeerings - -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 *VirtualRouterPeering -} - -// CreateOrUpdate ... -func (c VirtualRouterPeeringsClient) CreateOrUpdate(ctx context.Context, id commonids.VirtualRouterPeeringId, input VirtualRouterPeering) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualRouterPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualRouterPeeringId, input VirtualRouterPeering) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualrouterpeerings/method_delete.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/method_delete.go deleted file mode 100644 index 0f1d37addbb..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualrouterpeerings - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c VirtualRouterPeeringsClient) Delete(ctx context.Context, id commonids.VirtualRouterPeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualRouterPeeringsClient) DeleteThenPoll(ctx context.Context, id commonids.VirtualRouterPeeringId) 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/network/2023-05-01/virtualrouterpeerings/method_get.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/method_get.go deleted file mode 100644 index 684fe0cb2fc..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualrouterpeerings - -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 *VirtualRouterPeering -} - -// Get ... -func (c VirtualRouterPeeringsClient) Get(ctx context.Context, id commonids.VirtualRouterPeeringId) (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 VirtualRouterPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/method_list.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/method_list.go deleted file mode 100644 index 0735fa6e8e6..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualrouterpeerings - -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 *[]VirtualRouterPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualRouterPeering -} - -// List ... -func (c VirtualRouterPeeringsClient) List(ctx context.Context, id VirtualRouterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerings", 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 *[]VirtualRouterPeering `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 VirtualRouterPeeringsClient) ListComplete(ctx context.Context, id VirtualRouterId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualRouterPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualRouterPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id VirtualRouterId, predicate VirtualRouterPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualRouterPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeering.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeering.go deleted file mode 100644 index 148137d1d12..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouterpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualRouterPeeringProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go deleted file mode 100644 index c205251cdff..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualrouterpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPeeringProperties struct { - PeerAsn *int64 `json:"peerAsn,omitempty"` - PeerIP *string `json:"peerIp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualrouterpeerings/predicates.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/predicates.go deleted file mode 100644 index 1e181881675..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualrouterpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualRouterPeeringOperationPredicate) Matches(input VirtualRouterPeering) 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.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/network/2023-05-01/virtualrouterpeerings/version.go b/resource-manager/network/2023-05-01/virtualrouterpeerings/version.go deleted file mode 100644 index deac0e63108..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouterpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouterpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouterpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/README.md b/resource-manager/network/2023-05-01/virtualrouters/README.md deleted file mode 100644 index 0b7daab568b..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualrouters` Documentation - -The `virtualrouters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualrouters" -``` - - -### Client Initialization - -```go -client := virtualrouters.NewVirtualRoutersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualRoutersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -payload := virtualrouters.VirtualRouter{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRoutersClient.Delete` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRoutersClient.Get` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -read, err := client.Get(ctx, id, virtualrouters.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualRoutersClient.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: `VirtualRoutersClient.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 -} -``` diff --git a/resource-manager/network/2023-05-01/virtualrouters/client.go b/resource-manager/network/2023-05-01/virtualrouters/client.go deleted file mode 100644 index 37e6baf91a8..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualrouters - -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 VirtualRoutersClient struct { - Client *resourcemanager.Client -} - -func NewVirtualRoutersClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualRoutersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualrouters", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualRoutersClient: %+v", err) - } - - return &VirtualRoutersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/constants.go b/resource-manager/network/2023-05-01/virtualrouters/constants.go deleted file mode 100644 index 1a43afab5dd..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package virtualrouters - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter.go b/resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter.go deleted file mode 100644 index 3e9ac08d3a1..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualrouters - -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(&VirtualRouterId{}) -} - -var _ resourceids.ResourceId = &VirtualRouterId{} - -// VirtualRouterId is a struct representing the Resource ID for a Virtual Router -type VirtualRouterId struct { - SubscriptionId string - ResourceGroupName string - VirtualRouterName string -} - -// NewVirtualRouterID returns a new VirtualRouterId struct -func NewVirtualRouterID(subscriptionId string, resourceGroupName string, virtualRouterName string) VirtualRouterId { - return VirtualRouterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualRouterName: virtualRouterName, - } -} - -// ParseVirtualRouterID parses 'input' into a VirtualRouterId -func ParseVirtualRouterID(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualRouterIDInsensitively parses 'input' case-insensitively into a VirtualRouterId -// note: this method should only be used for API response data and not user input -func ParseVirtualRouterIDInsensitively(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualRouterId) 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.VirtualRouterName, ok = input.Parsed["virtualRouterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualRouterName", input) - } - - return nil -} - -// ValidateVirtualRouterID checks that 'input' can be parsed as a Virtual Router ID -func ValidateVirtualRouterID(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 := ParseVirtualRouterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Router ID -func (id VirtualRouterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualRouters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualRouterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Router ID -func (id VirtualRouterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualRouters", "virtualRouters", "virtualRouters"), - resourceids.UserSpecifiedSegment("virtualRouterName", "virtualRouterValue"), - } -} - -// String returns a human-readable description of this Virtual Router ID -func (id VirtualRouterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Router Name: %q", id.VirtualRouterName), - } - return fmt.Sprintf("Virtual Router (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter_test.go b/resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter_test.go deleted file mode 100644 index eae7920cd09..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/id_virtualrouter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualrouters - -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 = &VirtualRouterId{} - -func TestNewVirtualRouterID(t *testing.T) { - id := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - - 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.VirtualRouterName != "virtualRouterValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualRouterName'", id.VirtualRouterName, "virtualRouterValue") - } -} - -func TestFormatVirtualRouterID(t *testing.T) { - actual := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualRouterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterID(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestParseVirtualRouterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualRouterName: "vIrTuAlRoUtErVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterIDInsensitively(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestSegmentsForVirtualRouterId(t *testing.T) { - segments := VirtualRouterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualRouterId 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/network/2023-05-01/virtualrouters/method_createorupdate.go b/resource-manager/network/2023-05-01/virtualrouters/method_createorupdate.go deleted file mode 100644 index a9d77afc1e5..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualrouters - -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 *VirtualRouter -} - -// CreateOrUpdate ... -func (c VirtualRoutersClient) CreateOrUpdate(ctx context.Context, id VirtualRouterId, input VirtualRouter) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualRoutersClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualRouterId, input VirtualRouter) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-05-01/virtualrouters/method_delete.go b/resource-manager/network/2023-05-01/virtualrouters/method_delete.go deleted file mode 100644 index 7dcaaf847d3..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualrouters - -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 VirtualRoutersClient) Delete(ctx context.Context, id VirtualRouterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualRoutersClient) DeleteThenPoll(ctx context.Context, id VirtualRouterId) 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/network/2023-05-01/virtualrouters/method_get.go b/resource-manager/network/2023-05-01/virtualrouters/method_get.go deleted file mode 100644 index 2e829ce071e..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package virtualrouters - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualRouter -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c VirtualRoutersClient) Get(ctx context.Context, id VirtualRouterId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 VirtualRouter - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/method_list.go b/resource-manager/network/2023-05-01/virtualrouters/method_list.go deleted file mode 100644 index cd3f11e7a64..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualrouters - -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 *[]VirtualRouter -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualRouter -} - -// List ... -func (c VirtualRoutersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualRouters", 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 *[]VirtualRouter `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 VirtualRoutersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualRouterOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualRoutersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualRouterOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualRouter, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualrouters/method_listbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualrouters/method_listbyresourcegroup.go deleted file mode 100644 index 2084bb0cc5b..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualrouters - -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 *[]VirtualRouter -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualRouter -} - -// ListByResourceGroup ... -func (c VirtualRoutersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualRouters", 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 *[]VirtualRouter `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 VirtualRoutersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualRouterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualRoutersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualRouterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]VirtualRouter, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-05-01/virtualrouters/model_subresource.go b/resource-manager/network/2023-05-01/virtualrouters/model_subresource.go deleted file mode 100644 index f9c28cc090f..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/model_virtualrouter.go b/resource-manager/network/2023-05-01/virtualrouters/model_virtualrouter.go deleted file mode 100644 index ac50af509f1..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/model_virtualrouter.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouter struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualRouterPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/model_virtualrouterpropertiesformat.go b/resource-manager/network/2023-05-01/virtualrouters/model_virtualrouterpropertiesformat.go deleted file mode 100644 index 24601ff2eb4..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/model_virtualrouterpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPropertiesFormat struct { - HostedGateway *SubResource `json:"hostedGateway,omitempty"` - HostedSubnet *SubResource `json:"hostedSubnet,omitempty"` - Peerings *[]SubResource `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - VirtualRouterIPs *[]string `json:"virtualRouterIps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualrouters/predicates.go b/resource-manager/network/2023-05-01/virtualrouters/predicates.go deleted file mode 100644 index 676ee423641..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualRouterOperationPredicate) Matches(input VirtualRouter) 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 && (input.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/network/2023-05-01/virtualrouters/version.go b/resource-manager/network/2023-05-01/virtualrouters/version.go deleted file mode 100644 index 532a6659520..00000000000 --- a/resource-manager/network/2023-05-01/virtualrouters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouters/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/README.md b/resource-manager/network/2023-05-01/virtualwans/README.md deleted file mode 100644 index 847afc83f0f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/README.md +++ /dev/null @@ -1,1406 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/virtualwans` Documentation - -The `virtualwans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/virtualwans" -``` - - -### Client Initialization - -```go -client := virtualwans.NewVirtualWANsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -payload := virtualwans.VpnServerConfigurationPolicyGroup{ - // ... -} - - -if err := client.ConfigurationPolicyGroupsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -if err := client.ConfigurationPolicyGroupsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -read, err := client.ConfigurationPolicyGroupsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsListByVpnServerConfiguration` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -// alternatively `client.ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx, id)` can be used to do batched pagination -items, err := client.ConfigurationPolicyGroupsListByVpnServerConfigurationComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.Generatevirtualwanvpnserverconfigurationvpnprofile` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.VirtualWanVpnProfileParameters{ - // ... -} - - -if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -payload := virtualwans.HubRouteTable{ - // ... -} - - -if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -read, err := client.HubRouteTablesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.HubRouteTablesList(ctx, id)` can be used to do batched pagination -items, err := client.HubRouteTablesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -payload := virtualwans.HubVirtualNetworkConnection{ - // ... -} - - -if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.HubVirtualNetworkConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.HubVirtualNetworkConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -payload := virtualwans.VpnGatewayNatRule{ - // ... -} - - -if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -read, err := client.NatRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesListByVpnGateway` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -// alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination -items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := virtualwans.P2SVpnGateway{ - // ... -} - - -if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -read, err := client.P2sVpnGatewaysGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.P2sVpnGatewaysList(ctx, id)` can be used to do batched pagination -items, err := client.P2sVpnGatewaysListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.P2sVpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.P2sVpnGatewaysListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -payload := virtualwans.RouteMap{ - // ... -} - - -if err := client.RouteMapsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -if err := client.RouteMapsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -read, err := client.RouteMapsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.RouteMapsList(ctx, id)` can be used to do batched pagination -items, err := client.RouteMapsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -payload := virtualwans.RoutingIntent{ - // ... -} - - -if err := client.RoutingIntentCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -if err := client.RoutingIntentDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentGet` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -read, err := client.RoutingIntentGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.RoutingIntentList(ctx, id)` can be used to do batched pagination -items, err := client.RoutingIntentListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.SupportedSecurityProviders` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -read, err := client.SupportedSecurityProviders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.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 -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -payload := virtualwans.BgpConnection{ - // ... -} - - -if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -read, err := client.VirtualHubBgpConnectionGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubBgpConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubBgpConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListAdvertisedRoutes` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListLearnedRoutes` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -payload := virtualwans.HubIPConfiguration{ - // ... -} - - -if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -read, err := client.VirtualHubIPConfigurationGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubIPConfigurationList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubIPConfigurationListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -payload := virtualwans.VirtualHubRouteTableV2{ - // ... -} - - -if err := client.VirtualHubRouteTableV2sCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -if err := client.VirtualHubRouteTableV2sDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -read, err := client.VirtualHubRouteTableV2sGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubRouteTableV2sList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubRouteTableV2sListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.VirtualHub{ - // ... -} - - -if err := client.VirtualHubsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -if err := client.VirtualHubsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -read, err := client.VirtualHubsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetEffectiveVirtualHubRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.EffectiveRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetInboundRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.GetInboundRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetInboundRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetOutboundRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.GetOutboundRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetOutboundRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VirtualHubsList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VirtualHubsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsUpdateTags` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.TagsObject{ - // ... -} - - -read, err := client.VirtualHubsUpdateTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.VirtualWAN{ - // ... -} - - -if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -read, err := client.VirtualWansGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VirtualWansList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualWansListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VirtualWansListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VirtualWansListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnection{ - // ... -} - - -if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsDelete` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsGet` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -read, err := client.VpnConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsListByVpnGateway` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -// alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination -items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsStartPacketCapture` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ - // ... -} - - -if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsStopPacketCapture` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ - // ... -} - - -if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := virtualwans.VpnGateway{ - // ... -} - - -if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -read, err := client.VpnGatewaysGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnGatewaysList(ctx, id)` can be used to do batched pagination -items, err := client.VpnGatewaysListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnGatewaysListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnLinkConnectionsGetIkeSas` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - -if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnLinkConnectionsListByVpnConnection` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -// alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination -items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsAssociatedWithVirtualWanList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -payload := virtualwans.VpnServerConfiguration{ - // ... -} - - -if err := client.VpnServerConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -if err := client.VpnServerConfigurationsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -read, err := client.VpnServerConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnServerConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.VpnServerConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnServerConfigurationsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnServerConfigurationsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinkConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - -read, err := client.VpnSiteLinkConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinksGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue") - -read, err := client.VpnSiteLinksGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinksListByVpnSite` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -// alternatively `client.VpnSiteLinksListByVpnSite(ctx, id)` can be used to do batched pagination -items, err := client.VpnSiteLinksListByVpnSiteComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesConfigurationDownload` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.GetVpnSitesConfigurationRequest{ - // ... -} - - -if err := client.VpnSitesConfigurationDownloadThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -payload := virtualwans.VpnSite{ - // ... -} - - -if err := client.VpnSitesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -if err := client.VpnSitesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -read, err := client.VpnSitesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnSitesList(ctx, id)` can be used to do batched pagination -items, err := client.VpnSitesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnSitesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnSitesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/virtualwans/client.go b/resource-manager/network/2023-05-01/virtualwans/client.go deleted file mode 100644 index bf0a24c960f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualwans - -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 VirtualWANsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualWANsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualWANsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualwans", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualWANsClient: %+v", err) - } - - return &VirtualWANsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/constants.go b/resource-manager/network/2023-05-01/virtualwans/constants.go deleted file mode 100644 index d26250d416b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/constants.go +++ /dev/null @@ -1,2335 +0,0 @@ -package virtualwans - -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 AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type HubBgpConnectionStatus string - -const ( - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" - HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" -) - -func PossibleValuesForHubBgpConnectionStatus() []string { - return []string{ - string(HubBgpConnectionStatusConnected), - string(HubBgpConnectionStatusConnecting), - string(HubBgpConnectionStatusNotConnected), - string(HubBgpConnectionStatusUnknown), - } -} - -func (s *HubBgpConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHubBgpConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHubBgpConnectionStatus(input string) (*HubBgpConnectionStatus, error) { - vals := map[string]HubBgpConnectionStatus{ - "connected": HubBgpConnectionStatusConnected, - "connecting": HubBgpConnectionStatusConnecting, - "notconnected": HubBgpConnectionStatusNotConnected, - "unknown": HubBgpConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HubBgpConnectionStatus(input) - return &out, nil -} - -type HubRoutingPreference string - -const ( - HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" - HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" - HubRoutingPreferenceVpnGateway HubRoutingPreference = "VpnGateway" -) - -func PossibleValuesForHubRoutingPreference() []string { - return []string{ - string(HubRoutingPreferenceASPath), - string(HubRoutingPreferenceExpressRoute), - string(HubRoutingPreferenceVpnGateway), - } -} - -func (s *HubRoutingPreference) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHubRoutingPreference(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHubRoutingPreference(input string) (*HubRoutingPreference, error) { - vals := map[string]HubRoutingPreference{ - "aspath": HubRoutingPreferenceASPath, - "expressroute": HubRoutingPreferenceExpressRoute, - "vpngateway": HubRoutingPreferenceVpnGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HubRoutingPreference(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type NextStep string - -const ( - NextStepContinue NextStep = "Continue" - NextStepTerminate NextStep = "Terminate" - NextStepUnknown NextStep = "Unknown" -) - -func PossibleValuesForNextStep() []string { - return []string{ - string(NextStepContinue), - string(NextStepTerminate), - string(NextStepUnknown), - } -} - -func (s *NextStep) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNextStep(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNextStep(input string) (*NextStep, error) { - vals := map[string]NextStep{ - "continue": NextStepContinue, - "terminate": NextStepTerminate, - "unknown": NextStepUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NextStep(input) - return &out, nil -} - -type OfficeTrafficCategory string - -const ( - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -func PossibleValuesForOfficeTrafficCategory() []string { - return []string{ - string(OfficeTrafficCategoryAll), - string(OfficeTrafficCategoryNone), - string(OfficeTrafficCategoryOptimize), - string(OfficeTrafficCategoryOptimizeAndAllow), - } -} - -func (s *OfficeTrafficCategory) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOfficeTrafficCategory(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOfficeTrafficCategory(input string) (*OfficeTrafficCategory, error) { - vals := map[string]OfficeTrafficCategory{ - "all": OfficeTrafficCategoryAll, - "none": OfficeTrafficCategoryNone, - "optimize": OfficeTrafficCategoryOptimize, - "optimizeandallow": OfficeTrafficCategoryOptimizeAndAllow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OfficeTrafficCategory(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type PreferredRoutingGateway string - -const ( - PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" - PreferredRoutingGatewayNone PreferredRoutingGateway = "None" - PreferredRoutingGatewayVpnGateway PreferredRoutingGateway = "VpnGateway" -) - -func PossibleValuesForPreferredRoutingGateway() []string { - return []string{ - string(PreferredRoutingGatewayExpressRoute), - string(PreferredRoutingGatewayNone), - string(PreferredRoutingGatewayVpnGateway), - } -} - -func (s *PreferredRoutingGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePreferredRoutingGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePreferredRoutingGateway(input string) (*PreferredRoutingGateway, error) { - vals := map[string]PreferredRoutingGateway{ - "expressroute": PreferredRoutingGatewayExpressRoute, - "none": PreferredRoutingGatewayNone, - "vpngateway": PreferredRoutingGatewayVpnGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PreferredRoutingGateway(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteMapActionType string - -const ( - RouteMapActionTypeAdd RouteMapActionType = "Add" - RouteMapActionTypeDrop RouteMapActionType = "Drop" - RouteMapActionTypeRemove RouteMapActionType = "Remove" - RouteMapActionTypeReplace RouteMapActionType = "Replace" - RouteMapActionTypeUnknown RouteMapActionType = "Unknown" -) - -func PossibleValuesForRouteMapActionType() []string { - return []string{ - string(RouteMapActionTypeAdd), - string(RouteMapActionTypeDrop), - string(RouteMapActionTypeRemove), - string(RouteMapActionTypeReplace), - string(RouteMapActionTypeUnknown), - } -} - -func (s *RouteMapActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteMapActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteMapActionType(input string) (*RouteMapActionType, error) { - vals := map[string]RouteMapActionType{ - "add": RouteMapActionTypeAdd, - "drop": RouteMapActionTypeDrop, - "remove": RouteMapActionTypeRemove, - "replace": RouteMapActionTypeReplace, - "unknown": RouteMapActionTypeUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteMapActionType(input) - return &out, nil -} - -type RouteMapMatchCondition string - -const ( - RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" - RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" - RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" - RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" - RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" -) - -func PossibleValuesForRouteMapMatchCondition() []string { - return []string{ - string(RouteMapMatchConditionContains), - string(RouteMapMatchConditionEquals), - string(RouteMapMatchConditionNotContains), - string(RouteMapMatchConditionNotEquals), - string(RouteMapMatchConditionUnknown), - } -} - -func (s *RouteMapMatchCondition) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteMapMatchCondition(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteMapMatchCondition(input string) (*RouteMapMatchCondition, error) { - vals := map[string]RouteMapMatchCondition{ - "contains": RouteMapMatchConditionContains, - "equals": RouteMapMatchConditionEquals, - "notcontains": RouteMapMatchConditionNotContains, - "notequals": RouteMapMatchConditionNotEquals, - "unknown": RouteMapMatchConditionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteMapMatchCondition(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type RoutingState string - -const ( - RoutingStateFailed RoutingState = "Failed" - RoutingStateNone RoutingState = "None" - RoutingStateProvisioned RoutingState = "Provisioned" - RoutingStateProvisioning RoutingState = "Provisioning" -) - -func PossibleValuesForRoutingState() []string { - return []string{ - string(RoutingStateFailed), - string(RoutingStateNone), - string(RoutingStateProvisioned), - string(RoutingStateProvisioning), - } -} - -func (s *RoutingState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRoutingState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRoutingState(input string) (*RoutingState, error) { - vals := map[string]RoutingState{ - "failed": RoutingStateFailed, - "none": RoutingStateNone, - "provisioned": RoutingStateProvisioned, - "provisioning": RoutingStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RoutingState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} - -type VirtualWanSecurityProviderType string - -const ( - VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" - VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" -) - -func PossibleValuesForVirtualWanSecurityProviderType() []string { - return []string{ - string(VirtualWanSecurityProviderTypeExternal), - string(VirtualWanSecurityProviderTypeNative), - } -} - -func (s *VirtualWanSecurityProviderType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualWanSecurityProviderType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualWanSecurityProviderType(input string) (*VirtualWanSecurityProviderType, error) { - vals := map[string]VirtualWanSecurityProviderType{ - "external": VirtualWanSecurityProviderTypeExternal, - "native": VirtualWanSecurityProviderTypeNative, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualWanSecurityProviderType(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnConnectionStatus string - -const ( - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -func PossibleValuesForVpnConnectionStatus() []string { - return []string{ - string(VpnConnectionStatusConnected), - string(VpnConnectionStatusConnecting), - string(VpnConnectionStatusNotConnected), - string(VpnConnectionStatusUnknown), - } -} - -func (s *VpnConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnConnectionStatus(input string) (*VpnConnectionStatus, error) { - vals := map[string]VpnConnectionStatus{ - "connected": VpnConnectionStatusConnected, - "connecting": VpnConnectionStatusConnecting, - "notconnected": VpnConnectionStatusNotConnected, - "unknown": VpnConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnConnectionStatus(input) - return &out, nil -} - -type VpnGatewayTunnelingProtocol string - -const ( - VpnGatewayTunnelingProtocolIkeVTwo VpnGatewayTunnelingProtocol = "IkeV2" - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -func PossibleValuesForVpnGatewayTunnelingProtocol() []string { - return []string{ - string(VpnGatewayTunnelingProtocolIkeVTwo), - string(VpnGatewayTunnelingProtocolOpenVPN), - } -} - -func (s *VpnGatewayTunnelingProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayTunnelingProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayTunnelingProtocol(input string) (*VpnGatewayTunnelingProtocol, error) { - vals := map[string]VpnGatewayTunnelingProtocol{ - "ikev2": VpnGatewayTunnelingProtocolIkeVTwo, - "openvpn": VpnGatewayTunnelingProtocolOpenVPN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayTunnelingProtocol(input) - return &out, nil -} - -type VpnLinkConnectionMode string - -const ( - VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" - VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" - VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVpnLinkConnectionMode() []string { - return []string{ - string(VpnLinkConnectionModeDefault), - string(VpnLinkConnectionModeInitiatorOnly), - string(VpnLinkConnectionModeResponderOnly), - } -} - -func (s *VpnLinkConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnLinkConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnLinkConnectionMode(input string) (*VpnLinkConnectionMode, error) { - vals := map[string]VpnLinkConnectionMode{ - "default": VpnLinkConnectionModeDefault, - "initiatoronly": VpnLinkConnectionModeInitiatorOnly, - "responderonly": VpnLinkConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnLinkConnectionMode(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup.go b/resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup.go deleted file mode 100644 index 7ebd0347f4d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&ConfigurationPolicyGroupId{}) -} - -var _ resourceids.ResourceId = &ConfigurationPolicyGroupId{} - -// ConfigurationPolicyGroupId is a struct representing the Resource ID for a Configuration Policy Group -type ConfigurationPolicyGroupId struct { - SubscriptionId string - ResourceGroupName string - VpnServerConfigurationName string - ConfigurationPolicyGroupName string -} - -// NewConfigurationPolicyGroupID returns a new ConfigurationPolicyGroupId struct -func NewConfigurationPolicyGroupID(subscriptionId string, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) ConfigurationPolicyGroupId { - return ConfigurationPolicyGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnServerConfigurationName: vpnServerConfigurationName, - ConfigurationPolicyGroupName: configurationPolicyGroupName, - } -} - -// ParseConfigurationPolicyGroupID parses 'input' into a ConfigurationPolicyGroupId -func ParseConfigurationPolicyGroupID(input string) (*ConfigurationPolicyGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationPolicyGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationPolicyGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConfigurationPolicyGroupIDInsensitively parses 'input' case-insensitively into a ConfigurationPolicyGroupId -// note: this method should only be used for API response data and not user input -func ParseConfigurationPolicyGroupIDInsensitively(input string) (*ConfigurationPolicyGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationPolicyGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationPolicyGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConfigurationPolicyGroupId) 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.VpnServerConfigurationName, ok = input.Parsed["vpnServerConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnServerConfigurationName", input) - } - - if id.ConfigurationPolicyGroupName, ok = input.Parsed["configurationPolicyGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "configurationPolicyGroupName", input) - } - - return nil -} - -// ValidateConfigurationPolicyGroupID checks that 'input' can be parsed as a Configuration Policy Group ID -func ValidateConfigurationPolicyGroupID(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 := ParseConfigurationPolicyGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Configuration Policy Group ID -func (id ConfigurationPolicyGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnServerConfigurations/%s/configurationPolicyGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnServerConfigurationName, id.ConfigurationPolicyGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Configuration Policy Group ID -func (id ConfigurationPolicyGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnServerConfigurations", "vpnServerConfigurations", "vpnServerConfigurations"), - resourceids.UserSpecifiedSegment("vpnServerConfigurationName", "vpnServerConfigurationValue"), - resourceids.StaticSegment("staticConfigurationPolicyGroups", "configurationPolicyGroups", "configurationPolicyGroups"), - resourceids.UserSpecifiedSegment("configurationPolicyGroupName", "configurationPolicyGroupValue"), - } -} - -// String returns a human-readable description of this Configuration Policy Group ID -func (id ConfigurationPolicyGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Server Configuration Name: %q", id.VpnServerConfigurationName), - fmt.Sprintf("Configuration Policy Group Name: %q", id.ConfigurationPolicyGroupName), - } - return fmt.Sprintf("Configuration Policy Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup_test.go b/resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup_test.go deleted file mode 100644 index c49bcdb713d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_configurationpolicygroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &ConfigurationPolicyGroupId{} - -func TestNewConfigurationPolicyGroupID(t *testing.T) { - id := NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - - 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.VpnServerConfigurationName != "vpnServerConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnServerConfigurationName'", id.VpnServerConfigurationName, "vpnServerConfigurationValue") - } - - if id.ConfigurationPolicyGroupName != "configurationPolicyGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationPolicyGroupName'", id.ConfigurationPolicyGroupName, "configurationPolicyGroupValue") - } -} - -func TestFormatConfigurationPolicyGroupID(t *testing.T) { - actual := NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConfigurationPolicyGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationPolicyGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue", - Expected: &ConfigurationPolicyGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - ConfigurationPolicyGroupName: "configurationPolicyGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationPolicyGroupID(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - if actual.ConfigurationPolicyGroupName != v.Expected.ConfigurationPolicyGroupName { - t.Fatalf("Expected %q but got %q for ConfigurationPolicyGroupName", v.Expected.ConfigurationPolicyGroupName, actual.ConfigurationPolicyGroupName) - } - - } -} - -func TestParseConfigurationPolicyGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationPolicyGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/cOnFiGuRaTiOnPoLiCyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue", - Expected: &ConfigurationPolicyGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - ConfigurationPolicyGroupName: "configurationPolicyGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/cOnFiGuRaTiOnPoLiCyGrOuPs/cOnFiGuRaTiOnPoLiCyGrOuPvAlUe", - Expected: &ConfigurationPolicyGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnServerConfigurationName: "vPnSeRvErCoNfIgUrAtIoNvAlUe", - ConfigurationPolicyGroupName: "cOnFiGuRaTiOnPoLiCyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/cOnFiGuRaTiOnPoLiCyGrOuPs/cOnFiGuRaTiOnPoLiCyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationPolicyGroupIDInsensitively(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - if actual.ConfigurationPolicyGroupName != v.Expected.ConfigurationPolicyGroupName { - t.Fatalf("Expected %q but got %q for ConfigurationPolicyGroupName", v.Expected.ConfigurationPolicyGroupName, actual.ConfigurationPolicyGroupName) - } - - } -} - -func TestSegmentsForConfigurationPolicyGroupId(t *testing.T) { - segments := ConfigurationPolicyGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConfigurationPolicyGroupId 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/network/2023-05-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2023-05-01/virtualwans/id_hubroutetable.go deleted file mode 100644 index 46e51d4c426..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_hubroutetable.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&HubRouteTableId{}) -} - -var _ resourceids.ResourceId = &HubRouteTableId{} - -// HubRouteTableId is a struct representing the Resource ID for a Hub Route Table -type HubRouteTableId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - HubRouteTableName string -} - -// NewHubRouteTableID returns a new HubRouteTableId struct -func NewHubRouteTableID(subscriptionId string, resourceGroupName string, virtualHubName string, hubRouteTableName string) HubRouteTableId { - return HubRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - HubRouteTableName: hubRouteTableName, - } -} - -// ParseHubRouteTableID parses 'input' into a HubRouteTableId -func ParseHubRouteTableID(input string) (*HubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHubRouteTableIDInsensitively parses 'input' case-insensitively into a HubRouteTableId -// note: this method should only be used for API response data and not user input -func ParseHubRouteTableIDInsensitively(input string) (*HubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HubRouteTableId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.HubRouteTableName, ok = input.Parsed["hubRouteTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hubRouteTableName", input) - } - - return nil -} - -// ValidateHubRouteTableID checks that 'input' can be parsed as a Hub Route Table ID -func ValidateHubRouteTableID(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 := ParseHubRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Hub Route Table ID -func (id HubRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/hubRouteTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.HubRouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Hub Route Table ID -func (id HubRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticHubRouteTables", "hubRouteTables", "hubRouteTables"), - resourceids.UserSpecifiedSegment("hubRouteTableName", "hubRouteTableValue"), - } -} - -// String returns a human-readable description of this Hub Route Table ID -func (id HubRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Hub Route Table Name: %q", id.HubRouteTableName), - } - return fmt.Sprintf("Hub Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2023-05-01/virtualwans/id_hubroutetable_test.go deleted file mode 100644 index 8b064838b6b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_hubroutetable_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &HubRouteTableId{} - -func TestNewHubRouteTableID(t *testing.T) { - id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.HubRouteTableName != "hubRouteTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "hubRouteTableValue") - } -} - -func TestFormatHubRouteTableID(t *testing.T) { - actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseHubRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue", - Expected: &HubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubRouteTableName: "hubRouteTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubRouteTableID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubRouteTableName != v.Expected.HubRouteTableName { - t.Fatalf("Expected %q but got %q for HubRouteTableName", v.Expected.HubRouteTableName, actual.HubRouteTableName) - } - - } -} - -func TestParseHubRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbRoUtEtAbLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue", - Expected: &HubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubRouteTableName: "hubRouteTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbRoUtEtAbLeS/hUbRoUtEtAbLeVaLuE", - Expected: &HubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - HubRouteTableName: "hUbRoUtEtAbLeVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbRoUtEtAbLeS/hUbRoUtEtAbLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubRouteTableIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubRouteTableName != v.Expected.HubRouteTableName { - t.Fatalf("Expected %q but got %q for HubRouteTableName", v.Expected.HubRouteTableName, actual.HubRouteTableName) - } - - } -} - -func TestSegmentsForHubRouteTableId(t *testing.T) { - segments := HubRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("HubRouteTableId 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/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection.go deleted file mode 100644 index 92e4c4c7d5d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&HubVirtualNetworkConnectionId{}) -} - -var _ resourceids.ResourceId = &HubVirtualNetworkConnectionId{} - -// HubVirtualNetworkConnectionId is a struct representing the Resource ID for a Hub Virtual Network Connection -type HubVirtualNetworkConnectionId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - HubVirtualNetworkConnectionName string -} - -// NewHubVirtualNetworkConnectionID returns a new HubVirtualNetworkConnectionId struct -func NewHubVirtualNetworkConnectionID(subscriptionId string, resourceGroupName string, virtualHubName string, hubVirtualNetworkConnectionName string) HubVirtualNetworkConnectionId { - return HubVirtualNetworkConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - HubVirtualNetworkConnectionName: hubVirtualNetworkConnectionName, - } -} - -// ParseHubVirtualNetworkConnectionID parses 'input' into a HubVirtualNetworkConnectionId -func ParseHubVirtualNetworkConnectionID(input string) (*HubVirtualNetworkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubVirtualNetworkConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubVirtualNetworkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHubVirtualNetworkConnectionIDInsensitively parses 'input' case-insensitively into a HubVirtualNetworkConnectionId -// note: this method should only be used for API response data and not user input -func ParseHubVirtualNetworkConnectionIDInsensitively(input string) (*HubVirtualNetworkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubVirtualNetworkConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubVirtualNetworkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HubVirtualNetworkConnectionId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.HubVirtualNetworkConnectionName, ok = input.Parsed["hubVirtualNetworkConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hubVirtualNetworkConnectionName", input) - } - - return nil -} - -// ValidateHubVirtualNetworkConnectionID checks that 'input' can be parsed as a Hub Virtual Network Connection ID -func ValidateHubVirtualNetworkConnectionID(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 := ParseHubVirtualNetworkConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Hub Virtual Network Connection ID -func (id HubVirtualNetworkConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/hubVirtualNetworkConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.HubVirtualNetworkConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Hub Virtual Network Connection ID -func (id HubVirtualNetworkConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticHubVirtualNetworkConnections", "hubVirtualNetworkConnections", "hubVirtualNetworkConnections"), - resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "hubVirtualNetworkConnectionValue"), - } -} - -// String returns a human-readable description of this Hub Virtual Network Connection ID -func (id HubVirtualNetworkConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Hub Virtual Network Connection Name: %q", id.HubVirtualNetworkConnectionName), - } - return fmt.Sprintf("Hub Virtual Network Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection_test.go deleted file mode 100644 index 96ef8d339b4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_hubvirtualnetworkconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &HubVirtualNetworkConnectionId{} - -func TestNewHubVirtualNetworkConnectionID(t *testing.T) { - id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.HubVirtualNetworkConnectionName != "hubVirtualNetworkConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "hubVirtualNetworkConnectionValue") - } -} - -func TestFormatHubVirtualNetworkConnectionID(t *testing.T) { - actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseHubVirtualNetworkConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubVirtualNetworkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue", - Expected: &HubVirtualNetworkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubVirtualNetworkConnectionID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubVirtualNetworkConnectionName != v.Expected.HubVirtualNetworkConnectionName { - t.Fatalf("Expected %q but got %q for HubVirtualNetworkConnectionName", v.Expected.HubVirtualNetworkConnectionName, actual.HubVirtualNetworkConnectionName) - } - - } -} - -func TestParseHubVirtualNetworkConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubVirtualNetworkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbViRtUaLnEtWoRkCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue", - Expected: &HubVirtualNetworkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnVaLuE", - Expected: &HubVirtualNetworkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - HubVirtualNetworkConnectionName: "hUbViRtUaLnEtWoRkCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubVirtualNetworkConnectionIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubVirtualNetworkConnectionName != v.Expected.HubVirtualNetworkConnectionName { - t.Fatalf("Expected %q but got %q for HubVirtualNetworkConnectionName", v.Expected.HubVirtualNetworkConnectionName, actual.HubVirtualNetworkConnectionName) - } - - } -} - -func TestSegmentsForHubVirtualNetworkConnectionId(t *testing.T) { - segments := HubVirtualNetworkConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("HubVirtualNetworkConnectionId 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/network/2023-05-01/virtualwans/id_natrule.go b/resource-manager/network/2023-05-01/virtualwans/id_natrule.go deleted file mode 100644 index f2dca44d7fa..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_natrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&NatRuleId{}) -} - -var _ resourceids.ResourceId = &NatRuleId{} - -// NatRuleId is a struct representing the Resource ID for a Nat Rule -type NatRuleId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string - NatRuleName string -} - -// NewNatRuleID returns a new NatRuleId struct -func NewNatRuleID(subscriptionId string, resourceGroupName string, vpnGatewayName string, natRuleName string) NatRuleId { - return NatRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - NatRuleName: natRuleName, - } -} - -// ParseNatRuleID parses 'input' into a NatRuleId -func ParseNatRuleID(input string) (*NatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNatRuleIDInsensitively parses 'input' case-insensitively into a NatRuleId -// note: this method should only be used for API response data and not user input -func ParseNatRuleIDInsensitively(input string) (*NatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NatRuleId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - if id.NatRuleName, ok = input.Parsed["natRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "natRuleName", input) - } - - return nil -} - -// ValidateNatRuleID checks that 'input' can be parsed as a Nat Rule ID -func ValidateNatRuleID(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 := ParseNatRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Nat Rule ID -func (id NatRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/natRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName, id.NatRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Nat Rule ID -func (id NatRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), - resourceids.UserSpecifiedSegment("natRuleName", "natRuleValue"), - } -} - -// String returns a human-readable description of this Nat Rule ID -func (id NatRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - fmt.Sprintf("Nat Rule Name: %q", id.NatRuleName), - } - return fmt.Sprintf("Nat Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_natrule_test.go b/resource-manager/network/2023-05-01/virtualwans/id_natrule_test.go deleted file mode 100644 index b690124379e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_natrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &NatRuleId{} - -func TestNewNatRuleID(t *testing.T) { - id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } - - if id.NatRuleName != "natRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'NatRuleName'", id.NatRuleName, "natRuleValue") - } -} - -func TestFormatNatRuleID(t *testing.T) { - actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNatRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue", - Expected: &NatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatRuleID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestParseNatRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/nAtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue", - Expected: &NatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/nAtRuLeS/nAtRuLeVaLuE", - Expected: &NatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - NatRuleName: "nAtRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/nAtRuLeS/nAtRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatRuleIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestSegmentsForNatRuleId(t *testing.T) { - segments := NatRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NatRuleId 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/network/2023-05-01/virtualwans/id_routemap.go b/resource-manager/network/2023-05-01/virtualwans/id_routemap.go deleted file mode 100644 index c95aeaafbfd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_routemap.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&RouteMapId{}) -} - -var _ resourceids.ResourceId = &RouteMapId{} - -// RouteMapId is a struct representing the Resource ID for a Route Map -type RouteMapId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - RouteMapName string -} - -// NewRouteMapID returns a new RouteMapId struct -func NewRouteMapID(subscriptionId string, resourceGroupName string, virtualHubName string, routeMapName string) RouteMapId { - return RouteMapId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - RouteMapName: routeMapName, - } -} - -// ParseRouteMapID parses 'input' into a RouteMapId -func ParseRouteMapID(input string) (*RouteMapId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteMapId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteMapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteMapIDInsensitively parses 'input' case-insensitively into a RouteMapId -// note: this method should only be used for API response data and not user input -func ParseRouteMapIDInsensitively(input string) (*RouteMapId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteMapId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteMapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteMapId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.RouteMapName, ok = input.Parsed["routeMapName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeMapName", input) - } - - return nil -} - -// ValidateRouteMapID checks that 'input' can be parsed as a Route Map ID -func ValidateRouteMapID(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 := ParseRouteMapID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Map ID -func (id RouteMapId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/routeMaps/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.RouteMapName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Map ID -func (id RouteMapId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticRouteMaps", "routeMaps", "routeMaps"), - resourceids.UserSpecifiedSegment("routeMapName", "routeMapValue"), - } -} - -// String returns a human-readable description of this Route Map ID -func (id RouteMapId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Route Map Name: %q", id.RouteMapName), - } - return fmt.Sprintf("Route Map (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_routemap_test.go b/resource-manager/network/2023-05-01/virtualwans/id_routemap_test.go deleted file mode 100644 index b0661e538c3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_routemap_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &RouteMapId{} - -func TestNewRouteMapID(t *testing.T) { - id := NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.RouteMapName != "routeMapValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteMapName'", id.RouteMapName, "routeMapValue") - } -} - -func TestFormatRouteMapID(t *testing.T) { - actual := NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteMapID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteMapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue", - Expected: &RouteMapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteMapName: "routeMapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteMapID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteMapName != v.Expected.RouteMapName { - t.Fatalf("Expected %q but got %q for RouteMapName", v.Expected.RouteMapName, actual.RouteMapName) - } - - } -} - -func TestParseRouteMapIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteMapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeMaPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue", - Expected: &RouteMapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteMapName: "routeMapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeMaPs/rOuTeMaPvAlUe", - Expected: &RouteMapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - RouteMapName: "rOuTeMaPvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeMaPs/rOuTeMaPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteMapIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteMapName != v.Expected.RouteMapName { - t.Fatalf("Expected %q but got %q for RouteMapName", v.Expected.RouteMapName, actual.RouteMapName) - } - - } -} - -func TestSegmentsForRouteMapId(t *testing.T) { - segments := RouteMapId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteMapId 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/network/2023-05-01/virtualwans/id_routingintent.go b/resource-manager/network/2023-05-01/virtualwans/id_routingintent.go deleted file mode 100644 index de16e7a3861..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_routingintent.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&RoutingIntentId{}) -} - -var _ resourceids.ResourceId = &RoutingIntentId{} - -// RoutingIntentId is a struct representing the Resource ID for a Routing Intent -type RoutingIntentId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - RoutingIntentName string -} - -// NewRoutingIntentID returns a new RoutingIntentId struct -func NewRoutingIntentID(subscriptionId string, resourceGroupName string, virtualHubName string, routingIntentName string) RoutingIntentId { - return RoutingIntentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - RoutingIntentName: routingIntentName, - } -} - -// ParseRoutingIntentID parses 'input' into a RoutingIntentId -func ParseRoutingIntentID(input string) (*RoutingIntentId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoutingIntentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoutingIntentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoutingIntentIDInsensitively parses 'input' case-insensitively into a RoutingIntentId -// note: this method should only be used for API response data and not user input -func ParseRoutingIntentIDInsensitively(input string) (*RoutingIntentId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoutingIntentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoutingIntentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoutingIntentId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.RoutingIntentName, ok = input.Parsed["routingIntentName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routingIntentName", input) - } - - return nil -} - -// ValidateRoutingIntentID checks that 'input' can be parsed as a Routing Intent ID -func ValidateRoutingIntentID(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 := ParseRoutingIntentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Routing Intent ID -func (id RoutingIntentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/routingIntent/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.RoutingIntentName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Routing Intent ID -func (id RoutingIntentId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticRoutingIntent", "routingIntent", "routingIntent"), - resourceids.UserSpecifiedSegment("routingIntentName", "routingIntentValue"), - } -} - -// String returns a human-readable description of this Routing Intent ID -func (id RoutingIntentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Routing Intent Name: %q", id.RoutingIntentName), - } - return fmt.Sprintf("Routing Intent (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_routingintent_test.go b/resource-manager/network/2023-05-01/virtualwans/id_routingintent_test.go deleted file mode 100644 index a8c7a11ca58..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_routingintent_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &RoutingIntentId{} - -func TestNewRoutingIntentID(t *testing.T) { - id := NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.RoutingIntentName != "routingIntentValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingIntentName'", id.RoutingIntentName, "routingIntentValue") - } -} - -func TestFormatRoutingIntentID(t *testing.T) { - actual := NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoutingIntentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoutingIntentId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue", - Expected: &RoutingIntentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RoutingIntentName: "routingIntentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoutingIntentID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RoutingIntentName != v.Expected.RoutingIntentName { - t.Fatalf("Expected %q but got %q for RoutingIntentName", v.Expected.RoutingIntentName, actual.RoutingIntentName) - } - - } -} - -func TestParseRoutingIntentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoutingIntentId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTiNgInTeNt", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue", - Expected: &RoutingIntentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RoutingIntentName: "routingIntentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTiNgInTeNt/rOuTiNgInTeNtVaLuE", - Expected: &RoutingIntentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - RoutingIntentName: "rOuTiNgInTeNtVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTiNgInTeNt/rOuTiNgInTeNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoutingIntentIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RoutingIntentName != v.Expected.RoutingIntentName { - t.Fatalf("Expected %q but got %q for RoutingIntentName", v.Expected.RoutingIntentName, actual.RoutingIntentName) - } - - } -} - -func TestSegmentsForRoutingIntentId(t *testing.T) { - segments := RoutingIntentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoutingIntentId 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/network/2023-05-01/virtualwans/id_virtualhub.go b/resource-manager/network/2023-05-01/virtualwans/id_virtualhub.go deleted file mode 100644 index ec4a18686e5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_virtualhub.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VirtualHubId{}) -} - -var _ resourceids.ResourceId = &VirtualHubId{} - -// VirtualHubId is a struct representing the Resource ID for a Virtual Hub -type VirtualHubId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string -} - -// NewVirtualHubID returns a new VirtualHubId struct -func NewVirtualHubID(subscriptionId string, resourceGroupName string, virtualHubName string) VirtualHubId { - return VirtualHubId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - } -} - -// ParseVirtualHubID parses 'input' into a VirtualHubId -func ParseVirtualHubID(input string) (*VirtualHubId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualHubIDInsensitively parses 'input' case-insensitively into a VirtualHubId -// note: this method should only be used for API response data and not user input -func ParseVirtualHubIDInsensitively(input string) (*VirtualHubId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualHubId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - return nil -} - -// ValidateVirtualHubID checks that 'input' can be parsed as a Virtual Hub ID -func ValidateVirtualHubID(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 := ParseVirtualHubID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Hub ID -func (id VirtualHubId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Hub ID -func (id VirtualHubId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - } -} - -// String returns a human-readable description of this Virtual Hub ID -func (id VirtualHubId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - } - return fmt.Sprintf("Virtual Hub (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_virtualhub_test.go b/resource-manager/network/2023-05-01/virtualwans/id_virtualhub_test.go deleted file mode 100644 index 2ac9a8ca472..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_virtualhub_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VirtualHubId{} - -func TestNewVirtualHubID(t *testing.T) { - id := NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } -} - -func TestFormatVirtualHubID(t *testing.T) { - actual := NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualHubID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Expected: &VirtualHubId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - } -} - -func TestParseVirtualHubIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Expected: &VirtualHubId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Expected: &VirtualHubId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - } -} - -func TestSegmentsForVirtualHubId(t *testing.T) { - segments := VirtualHubId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualHubId 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/network/2023-05-01/virtualwans/id_virtualhubroutetable.go b/resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable.go deleted file mode 100644 index b2cd55910b3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&VirtualHubRouteTableId{}) -} - -var _ resourceids.ResourceId = &VirtualHubRouteTableId{} - -// VirtualHubRouteTableId is a struct representing the Resource ID for a Virtual Hub Route Table -type VirtualHubRouteTableId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - RouteTableName string -} - -// NewVirtualHubRouteTableID returns a new VirtualHubRouteTableId struct -func NewVirtualHubRouteTableID(subscriptionId string, resourceGroupName string, virtualHubName string, routeTableName string) VirtualHubRouteTableId { - return VirtualHubRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - RouteTableName: routeTableName, - } -} - -// ParseVirtualHubRouteTableID parses 'input' into a VirtualHubRouteTableId -func ParseVirtualHubRouteTableID(input string) (*VirtualHubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualHubRouteTableIDInsensitively parses 'input' case-insensitively into a VirtualHubRouteTableId -// note: this method should only be used for API response data and not user input -func ParseVirtualHubRouteTableIDInsensitively(input string) (*VirtualHubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualHubRouteTableId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateVirtualHubRouteTableID checks that 'input' can be parsed as a Virtual Hub Route Table ID -func ValidateVirtualHubRouteTableID(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 := ParseVirtualHubRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Hub Route Table ID -func (id VirtualHubRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Hub Route Table ID -func (id VirtualHubRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Virtual Hub Route Table ID -func (id VirtualHubRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Virtual Hub Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable_test.go b/resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable_test.go deleted file mode 100644 index ea31b766b38..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_virtualhubroutetable_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &VirtualHubRouteTableId{} - -func TestNewVirtualHubRouteTableID(t *testing.T) { - id := NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatVirtualHubRouteTableID(t *testing.T) { - actual := NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualHubRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue", - Expected: &VirtualHubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubRouteTableID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseVirtualHubRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue", - Expected: &VirtualHubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &VirtualHubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubRouteTableIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForVirtualHubRouteTableId(t *testing.T) { - segments := VirtualHubRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualHubRouteTableId 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/network/2023-05-01/virtualwans/id_virtualwan.go b/resource-manager/network/2023-05-01/virtualwans/id_virtualwan.go deleted file mode 100644 index e8489bfa13e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_virtualwan.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VirtualWANId{}) -} - -var _ resourceids.ResourceId = &VirtualWANId{} - -// VirtualWANId is a struct representing the Resource ID for a Virtual W A N -type VirtualWANId struct { - SubscriptionId string - ResourceGroupName string - VirtualWanName string -} - -// NewVirtualWANID returns a new VirtualWANId struct -func NewVirtualWANID(subscriptionId string, resourceGroupName string, virtualWanName string) VirtualWANId { - return VirtualWANId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualWanName: virtualWanName, - } -} - -// ParseVirtualWANID parses 'input' into a VirtualWANId -func ParseVirtualWANID(input string) (*VirtualWANId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualWANId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualWANId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualWANIDInsensitively parses 'input' case-insensitively into a VirtualWANId -// note: this method should only be used for API response data and not user input -func ParseVirtualWANIDInsensitively(input string) (*VirtualWANId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualWANId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualWANId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualWANId) 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.VirtualWanName, ok = input.Parsed["virtualWanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualWanName", input) - } - - return nil -} - -// ValidateVirtualWANID checks that 'input' can be parsed as a Virtual W A N ID -func ValidateVirtualWANID(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 := ParseVirtualWANID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual W A N ID -func (id VirtualWANId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualWans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualWanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual W A N ID -func (id VirtualWANId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualWans", "virtualWans", "virtualWans"), - resourceids.UserSpecifiedSegment("virtualWanName", "virtualWanValue"), - } -} - -// String returns a human-readable description of this Virtual W A N ID -func (id VirtualWANId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Wan Name: %q", id.VirtualWanName), - } - return fmt.Sprintf("Virtual W A N (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2023-05-01/virtualwans/id_virtualwan_test.go deleted file mode 100644 index 7a315c1c373..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_virtualwan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VirtualWANId{} - -func TestNewVirtualWANID(t *testing.T) { - id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - - 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.VirtualWanName != "virtualWanValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWanValue") - } -} - -func TestFormatVirtualWANID(t *testing.T) { - actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualWANID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualWANId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue", - Expected: &VirtualWANId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualWANID(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.VirtualWanName != v.Expected.VirtualWanName { - t.Fatalf("Expected %q but got %q for VirtualWanName", v.Expected.VirtualWanName, actual.VirtualWanName) - } - - } -} - -func TestParseVirtualWANIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualWANId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlWaNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue", - Expected: &VirtualWANId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlWaNs/vIrTuAlWaNvAlUe", - Expected: &VirtualWANId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualWanName: "vIrTuAlWaNvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlWaNs/vIrTuAlWaNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualWANIDInsensitively(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.VirtualWanName != v.Expected.VirtualWanName { - t.Fatalf("Expected %q but got %q for VirtualWanName", v.Expected.VirtualWanName, actual.VirtualWanName) - } - - } -} - -func TestSegmentsForVirtualWANId(t *testing.T) { - segments := VirtualWANId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualWANId 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/network/2023-05-01/virtualwans/id_vpngateway.go b/resource-manager/network/2023-05-01/virtualwans/id_vpngateway.go deleted file mode 100644 index 6889f4d78bc..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpngateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VpnGatewayId{}) -} - -var _ resourceids.ResourceId = &VpnGatewayId{} - -// VpnGatewayId is a struct representing the Resource ID for a Vpn Gateway -type VpnGatewayId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string -} - -// NewVpnGatewayID returns a new VpnGatewayId struct -func NewVpnGatewayID(subscriptionId string, resourceGroupName string, vpnGatewayName string) VpnGatewayId { - return VpnGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - } -} - -// ParseVpnGatewayID parses 'input' into a VpnGatewayId -func ParseVpnGatewayID(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnGatewayIDInsensitively parses 'input' case-insensitively into a VpnGatewayId -// note: this method should only be used for API response data and not user input -func ParseVpnGatewayIDInsensitively(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnGatewayId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - return nil -} - -// ValidateVpnGatewayID checks that 'input' can be parsed as a Vpn Gateway ID -func ValidateVpnGatewayID(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 := ParseVpnGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Gateway ID -func (id VpnGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Gateway ID -func (id VpnGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - } -} - -// String returns a human-readable description of this Vpn Gateway ID -func (id VpnGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - } - return fmt.Sprintf("Vpn Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2023-05-01/virtualwans/id_vpngateway_test.go deleted file mode 100644 index 23428469e83..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpngateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VpnGatewayId{} - -func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } -} - -func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestParseVpnGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestSegmentsForVpnGatewayId(t *testing.T) { - segments := VpnGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnGatewayId 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/network/2023-05-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection.go deleted file mode 100644 index b40c9d3b7be..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package virtualwans - -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(&VpnLinkConnectionId{}) -} - -var _ resourceids.ResourceId = &VpnLinkConnectionId{} - -// VpnLinkConnectionId is a struct representing the Resource ID for a Vpn Link Connection -type VpnLinkConnectionId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string - VpnConnectionName string - VpnLinkConnectionName string -} - -// NewVpnLinkConnectionID returns a new VpnLinkConnectionId struct -func NewVpnLinkConnectionID(subscriptionId string, resourceGroupName string, vpnGatewayName string, vpnConnectionName string, vpnLinkConnectionName string) VpnLinkConnectionId { - return VpnLinkConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - VpnConnectionName: vpnConnectionName, - VpnLinkConnectionName: vpnLinkConnectionName, - } -} - -// ParseVpnLinkConnectionID parses 'input' into a VpnLinkConnectionId -func ParseVpnLinkConnectionID(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnLinkConnectionIDInsensitively parses 'input' case-insensitively into a VpnLinkConnectionId -// note: this method should only be used for API response data and not user input -func ParseVpnLinkConnectionIDInsensitively(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnLinkConnectionId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - if id.VpnConnectionName, ok = input.Parsed["vpnConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnConnectionName", input) - } - - if id.VpnLinkConnectionName, ok = input.Parsed["vpnLinkConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnLinkConnectionName", input) - } - - return nil -} - -// ValidateVpnLinkConnectionID checks that 'input' can be parsed as a Vpn Link Connection ID -func ValidateVpnLinkConnectionID(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 := ParseVpnLinkConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Link Connection ID -func (id VpnLinkConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/vpnConnections/%s/vpnLinkConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName, id.VpnConnectionName, id.VpnLinkConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Link Connection ID -func (id VpnLinkConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionValue"), - resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionValue"), - } -} - -// String returns a human-readable description of this Vpn Link Connection ID -func (id VpnLinkConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - fmt.Sprintf("Vpn Connection Name: %q", id.VpnConnectionName), - fmt.Sprintf("Vpn Link Connection Name: %q", id.VpnLinkConnectionName), - } - return fmt.Sprintf("Vpn Link Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection_test.go deleted file mode 100644 index 1f3cece41e0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnlinkconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package virtualwans - -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 = &VpnLinkConnectionId{} - -func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } - - if id.VpnConnectionName != "vpnConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionValue") - } - - if id.VpnLinkConnectionName != "vpnLinkConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionValue") - } -} - -func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnLinkConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - VpnConnectionName: "vPnCoNnEcTiOnVaLuE", - VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestSegmentsForVpnLinkConnectionId(t *testing.T) { - segments := VpnLinkConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnLinkConnectionId 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/network/2023-05-01/virtualwans/id_vpnserverconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration.go deleted file mode 100644 index 604356fc28f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VpnServerConfigurationId{}) -} - -var _ resourceids.ResourceId = &VpnServerConfigurationId{} - -// VpnServerConfigurationId is a struct representing the Resource ID for a Vpn Server Configuration -type VpnServerConfigurationId struct { - SubscriptionId string - ResourceGroupName string - VpnServerConfigurationName string -} - -// NewVpnServerConfigurationID returns a new VpnServerConfigurationId struct -func NewVpnServerConfigurationID(subscriptionId string, resourceGroupName string, vpnServerConfigurationName string) VpnServerConfigurationId { - return VpnServerConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnServerConfigurationName: vpnServerConfigurationName, - } -} - -// ParseVpnServerConfigurationID parses 'input' into a VpnServerConfigurationId -func ParseVpnServerConfigurationID(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnServerConfigurationIDInsensitively parses 'input' case-insensitively into a VpnServerConfigurationId -// note: this method should only be used for API response data and not user input -func ParseVpnServerConfigurationIDInsensitively(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnServerConfigurationId) 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.VpnServerConfigurationName, ok = input.Parsed["vpnServerConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnServerConfigurationName", input) - } - - return nil -} - -// ValidateVpnServerConfigurationID checks that 'input' can be parsed as a Vpn Server Configuration ID -func ValidateVpnServerConfigurationID(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 := ParseVpnServerConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Server Configuration ID -func (id VpnServerConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnServerConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnServerConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Server Configuration ID -func (id VpnServerConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnServerConfigurations", "vpnServerConfigurations", "vpnServerConfigurations"), - resourceids.UserSpecifiedSegment("vpnServerConfigurationName", "vpnServerConfigurationValue"), - } -} - -// String returns a human-readable description of this Vpn Server Configuration ID -func (id VpnServerConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Server Configuration Name: %q", id.VpnServerConfigurationName), - } - return fmt.Sprintf("Vpn Server Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration_test.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration_test.go deleted file mode 100644 index 6ac256477b7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnserverconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VpnServerConfigurationId{} - -func TestNewVpnServerConfigurationID(t *testing.T) { - id := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - - 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.VpnServerConfigurationName != "vpnServerConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnServerConfigurationName'", id.VpnServerConfigurationName, "vpnServerConfigurationValue") - } -} - -func TestFormatVpnServerConfigurationID(t *testing.T) { - actual := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnServerConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationID(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestParseVpnServerConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnServerConfigurationName: "vPnSeRvErCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationIDInsensitively(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestSegmentsForVpnServerConfigurationId(t *testing.T) { - segments := VpnServerConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnServerConfigurationId 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/network/2023-05-01/virtualwans/id_vpnsite.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnsite.go deleted file mode 100644 index 4e20baefd21..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnsite.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VpnSiteId{}) -} - -var _ resourceids.ResourceId = &VpnSiteId{} - -// VpnSiteId is a struct representing the Resource ID for a Vpn Site -type VpnSiteId struct { - SubscriptionId string - ResourceGroupName string - VpnSiteName string -} - -// NewVpnSiteID returns a new VpnSiteId struct -func NewVpnSiteID(subscriptionId string, resourceGroupName string, vpnSiteName string) VpnSiteId { - return VpnSiteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnSiteName: vpnSiteName, - } -} - -// ParseVpnSiteID parses 'input' into a VpnSiteId -func ParseVpnSiteID(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnSiteIDInsensitively parses 'input' case-insensitively into a VpnSiteId -// note: this method should only be used for API response data and not user input -func ParseVpnSiteIDInsensitively(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnSiteId) 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.VpnSiteName, ok = input.Parsed["vpnSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteName", input) - } - - return nil -} - -// ValidateVpnSiteID checks that 'input' can be parsed as a Vpn Site ID -func ValidateVpnSiteID(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 := ParseVpnSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Site ID -func (id VpnSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnSiteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Site ID -func (id VpnSiteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnSites", "vpnSites", "vpnSites"), - resourceids.UserSpecifiedSegment("vpnSiteName", "vpnSiteValue"), - } -} - -// String returns a human-readable description of this Vpn Site ID -func (id VpnSiteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Site Name: %q", id.VpnSiteName), - } - return fmt.Sprintf("Vpn Site (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_vpnsite_test.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnsite_test.go deleted file mode 100644 index 22ab26df887..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnsite_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VpnSiteId{} - -func TestNewVpnSiteID(t *testing.T) { - id := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - - 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.VpnSiteName != "vpnSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteName'", id.VpnSiteName, "vpnSiteValue") - } -} - -func TestFormatVpnSiteID(t *testing.T) { - actual := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteID(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestParseVpnSiteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnSiteName: "vPnSiTeVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteIDInsensitively(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestSegmentsForVpnSiteId(t *testing.T) { - segments := VpnSiteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnSiteId 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/network/2023-05-01/virtualwans/id_vpnsitelink.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink.go deleted file mode 100644 index a0b1676b210..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&VpnSiteLinkId{}) -} - -var _ resourceids.ResourceId = &VpnSiteLinkId{} - -// VpnSiteLinkId is a struct representing the Resource ID for a Vpn Site Link -type VpnSiteLinkId struct { - SubscriptionId string - ResourceGroupName string - VpnSiteName string - VpnSiteLinkName string -} - -// NewVpnSiteLinkID returns a new VpnSiteLinkId struct -func NewVpnSiteLinkID(subscriptionId string, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string) VpnSiteLinkId { - return VpnSiteLinkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnSiteName: vpnSiteName, - VpnSiteLinkName: vpnSiteLinkName, - } -} - -// ParseVpnSiteLinkID parses 'input' into a VpnSiteLinkId -func ParseVpnSiteLinkID(input string) (*VpnSiteLinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteLinkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteLinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnSiteLinkIDInsensitively parses 'input' case-insensitively into a VpnSiteLinkId -// note: this method should only be used for API response data and not user input -func ParseVpnSiteLinkIDInsensitively(input string) (*VpnSiteLinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteLinkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteLinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnSiteLinkId) 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.VpnSiteName, ok = input.Parsed["vpnSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteName", input) - } - - if id.VpnSiteLinkName, ok = input.Parsed["vpnSiteLinkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteLinkName", input) - } - - return nil -} - -// ValidateVpnSiteLinkID checks that 'input' can be parsed as a Vpn Site Link ID -func ValidateVpnSiteLinkID(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 := ParseVpnSiteLinkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Site Link ID -func (id VpnSiteLinkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnSites/%s/vpnSiteLinks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnSiteName, id.VpnSiteLinkName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Site Link ID -func (id VpnSiteLinkId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnSites", "vpnSites", "vpnSites"), - resourceids.UserSpecifiedSegment("vpnSiteName", "vpnSiteValue"), - resourceids.StaticSegment("staticVpnSiteLinks", "vpnSiteLinks", "vpnSiteLinks"), - resourceids.UserSpecifiedSegment("vpnSiteLinkName", "vpnSiteLinkValue"), - } -} - -// String returns a human-readable description of this Vpn Site Link ID -func (id VpnSiteLinkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Site Name: %q", id.VpnSiteName), - fmt.Sprintf("Vpn Site Link Name: %q", id.VpnSiteLinkName), - } - return fmt.Sprintf("Vpn Site Link (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink_test.go b/resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink_test.go deleted file mode 100644 index c774c31735b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/id_vpnsitelink_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &VpnSiteLinkId{} - -func TestNewVpnSiteLinkID(t *testing.T) { - id := NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue") - - 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.VpnSiteName != "vpnSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteName'", id.VpnSiteName, "vpnSiteValue") - } - - if id.VpnSiteLinkName != "vpnSiteLinkValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteLinkName'", id.VpnSiteLinkName, "vpnSiteLinkValue") - } -} - -func TestFormatVpnSiteLinkID(t *testing.T) { - actual := NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnSiteLinkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteLinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue", - Expected: &VpnSiteLinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - VpnSiteLinkName: "vpnSiteLinkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteLinkID(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - if actual.VpnSiteLinkName != v.Expected.VpnSiteLinkName { - t.Fatalf("Expected %q but got %q for VpnSiteLinkName", v.Expected.VpnSiteLinkName, actual.VpnSiteLinkName) - } - - } -} - -func TestParseVpnSiteLinkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteLinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/vPnSiTeLiNkS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue", - Expected: &VpnSiteLinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - VpnSiteLinkName: "vpnSiteLinkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/vPnSiTeLiNkS/vPnSiTeLiNkVaLuE", - Expected: &VpnSiteLinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnSiteName: "vPnSiTeVaLuE", - VpnSiteLinkName: "vPnSiTeLiNkVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/vPnSiTeLiNkS/vPnSiTeLiNkVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteLinkIDInsensitively(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - if actual.VpnSiteLinkName != v.Expected.VpnSiteLinkName { - t.Fatalf("Expected %q but got %q for VpnSiteLinkName", v.Expected.VpnSiteLinkName, actual.VpnSiteLinkName) - } - - } -} - -func TestSegmentsForVpnSiteLinkId(t *testing.T) { - segments := VpnSiteLinkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnSiteLinkId 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/network/2023-05-01/virtualwans/method_configurationpolicygroupscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupscreateorupdate.go deleted file mode 100644 index 391d34a222a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsCreateOrUpdate ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsCreateOrUpdate(ctx context.Context, id ConfigurationPolicyGroupId, input VpnServerConfigurationPolicyGroup) (result ConfigurationPolicyGroupsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ConfigurationPolicyGroupsCreateOrUpdateThenPoll performs ConfigurationPolicyGroupsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) ConfigurationPolicyGroupsCreateOrUpdateThenPoll(ctx context.Context, id ConfigurationPolicyGroupId, input VpnServerConfigurationPolicyGroup) error { - result, err := c.ConfigurationPolicyGroupsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ConfigurationPolicyGroupsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationPolicyGroupsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsdelete.go deleted file mode 100644 index faabc47e666..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ConfigurationPolicyGroupsDelete ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsDelete(ctx context.Context, id ConfigurationPolicyGroupId) (result ConfigurationPolicyGroupsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// ConfigurationPolicyGroupsDeleteThenPoll performs ConfigurationPolicyGroupsDelete then polls until it's completed -func (c VirtualWANsClient) ConfigurationPolicyGroupsDeleteThenPoll(ctx context.Context, id ConfigurationPolicyGroupId) error { - result, err := c.ConfigurationPolicyGroupsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing ConfigurationPolicyGroupsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationPolicyGroupsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsget.go b/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsget.go deleted file mode 100644 index 491fc15d5b2..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsGet ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsGet(ctx context.Context, id ConfigurationPolicyGroupId) (result ConfigurationPolicyGroupsGetOperationResponse, 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 VpnServerConfigurationPolicyGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go deleted file mode 100644 index ee941b39307..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsListByVpnServerConfigurationOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnServerConfigurationPolicyGroup -} - -type ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsListByVpnServerConfiguration ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx context.Context, id VpnServerConfigurationId) (result ConfigurationPolicyGroupsListByVpnServerConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/configurationPolicyGroups", 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 *[]VpnServerConfigurationPolicyGroup `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ConfigurationPolicyGroupsListByVpnServerConfigurationComplete retrieves all the results into a single object -func (c VirtualWANsClient) ConfigurationPolicyGroupsListByVpnServerConfigurationComplete(ctx context.Context, id VpnServerConfigurationId) (ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult, error) { - return c.ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteMatchingPredicate(ctx, id, VpnServerConfigurationPolicyGroupOperationPredicate{}) -} - -// ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteMatchingPredicate(ctx context.Context, id VpnServerConfigurationId, predicate VpnServerConfigurationPolicyGroupOperationPredicate) (result ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult, err error) { - items := make([]VpnServerConfigurationPolicyGroup, 0) - - resp, err := c.ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx, id) - if err != nil { - 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 = ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go b/resource-manager/network/2023-05-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go deleted file mode 100644 index aed56fdab18..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 GeneratevirtualwanvpnserverconfigurationvpnprofileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnProfileResponse -} - -// Generatevirtualwanvpnserverconfigurationvpnprofile ... -func (c VirtualWANsClient) Generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, id VirtualWANId, input VirtualWanVpnProfileParameters) (result GeneratevirtualwanvpnserverconfigurationvpnprofileOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generateVpnProfile", 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 -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll performs Generatevirtualwanvpnserverconfigurationvpnprofile then polls until it's completed -func (c VirtualWANsClient) GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx context.Context, id VirtualWANId, input VirtualWanVpnProfileParameters) error { - result, err := c.Generatevirtualwanvpnserverconfigurationvpnprofile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Generatevirtualwanvpnserverconfigurationvpnprofile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Generatevirtualwanvpnserverconfigurationvpnprofile: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablescreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablescreateorupdate.go deleted file mode 100644 index 58545e66cc2..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 HubRouteTablesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *HubRouteTable -} - -// HubRouteTablesCreateOrUpdate ... -func (c VirtualWANsClient) HubRouteTablesCreateOrUpdate(ctx context.Context, id HubRouteTableId, input HubRouteTable) (result HubRouteTablesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// HubRouteTablesCreateOrUpdateThenPoll performs HubRouteTablesCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) HubRouteTablesCreateOrUpdateThenPoll(ctx context.Context, id HubRouteTableId, input HubRouteTable) error { - result, err := c.HubRouteTablesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing HubRouteTablesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubRouteTablesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesdelete.go deleted file mode 100644 index e51f251c714..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 HubRouteTablesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// HubRouteTablesDelete ... -func (c VirtualWANsClient) HubRouteTablesDelete(ctx context.Context, id HubRouteTableId) (result HubRouteTablesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// HubRouteTablesDeleteThenPoll performs HubRouteTablesDelete then polls until it's completed -func (c VirtualWANsClient) HubRouteTablesDeleteThenPoll(ctx context.Context, id HubRouteTableId) error { - result, err := c.HubRouteTablesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing HubRouteTablesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubRouteTablesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesget.go b/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesget.go deleted file mode 100644 index 36dc9467d46..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetablesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 HubRouteTablesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HubRouteTable -} - -// HubRouteTablesGet ... -func (c VirtualWANsClient) HubRouteTablesGet(ctx context.Context, id HubRouteTableId) (result HubRouteTablesGetOperationResponse, 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 HubRouteTable - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetableslist.go b/resource-manager/network/2023-05-01/virtualwans/method_hubroutetableslist.go deleted file mode 100644 index a38e5d16297..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubroutetableslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 HubRouteTablesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HubRouteTable -} - -type HubRouteTablesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HubRouteTable -} - -// HubRouteTablesList ... -func (c VirtualWANsClient) HubRouteTablesList(ctx context.Context, id VirtualHubId) (result HubRouteTablesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/hubRouteTables", 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 *[]HubRouteTable `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// HubRouteTablesListComplete retrieves all the results into a single object -func (c VirtualWANsClient) HubRouteTablesListComplete(ctx context.Context, id VirtualHubId) (HubRouteTablesListCompleteResult, error) { - return c.HubRouteTablesListCompleteMatchingPredicate(ctx, id, HubRouteTableOperationPredicate{}) -} - -// HubRouteTablesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) HubRouteTablesListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate HubRouteTableOperationPredicate) (result HubRouteTablesListCompleteResult, err error) { - items := make([]HubRouteTable, 0) - - resp, err := c.HubRouteTablesList(ctx, id) - if err != nil { - 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 = HubRouteTablesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go deleted file mode 100644 index 4353d1898c9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsCreateOrUpdate ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsCreateOrUpdate(ctx context.Context, id HubVirtualNetworkConnectionId, input HubVirtualNetworkConnection) (result HubVirtualNetworkConnectionsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// HubVirtualNetworkConnectionsCreateOrUpdateThenPoll performs HubVirtualNetworkConnectionsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx context.Context, id HubVirtualNetworkConnectionId, input HubVirtualNetworkConnection) error { - result, err := c.HubVirtualNetworkConnectionsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing HubVirtualNetworkConnectionsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubVirtualNetworkConnectionsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go deleted file mode 100644 index d26ec8f61b8..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// HubVirtualNetworkConnectionsDelete ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsDelete(ctx context.Context, id HubVirtualNetworkConnectionId) (result HubVirtualNetworkConnectionsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// HubVirtualNetworkConnectionsDeleteThenPoll performs HubVirtualNetworkConnectionsDelete then polls until it's completed -func (c VirtualWANsClient) HubVirtualNetworkConnectionsDeleteThenPoll(ctx context.Context, id HubVirtualNetworkConnectionId) error { - result, err := c.HubVirtualNetworkConnectionsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing HubVirtualNetworkConnectionsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubVirtualNetworkConnectionsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsget.go b/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsget.go deleted file mode 100644 index 852857adc59..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsGet ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsGet(ctx context.Context, id HubVirtualNetworkConnectionId) (result HubVirtualNetworkConnectionsGetOperationResponse, 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 HubVirtualNetworkConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionslist.go b/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionslist.go deleted file mode 100644 index 03fc86d2e23..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_hubvirtualnetworkconnectionslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HubVirtualNetworkConnection -} - -type HubVirtualNetworkConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsList ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsList(ctx context.Context, id VirtualHubId) (result HubVirtualNetworkConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/hubVirtualNetworkConnections", 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 *[]HubVirtualNetworkConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// HubVirtualNetworkConnectionsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) HubVirtualNetworkConnectionsListComplete(ctx context.Context, id VirtualHubId) (HubVirtualNetworkConnectionsListCompleteResult, error) { - return c.HubVirtualNetworkConnectionsListCompleteMatchingPredicate(ctx, id, HubVirtualNetworkConnectionOperationPredicate{}) -} - -// HubVirtualNetworkConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) HubVirtualNetworkConnectionsListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate HubVirtualNetworkConnectionOperationPredicate) (result HubVirtualNetworkConnectionsListCompleteResult, err error) { - items := make([]HubVirtualNetworkConnection, 0) - - resp, err := c.HubVirtualNetworkConnectionsList(ctx, id) - if err != nil { - 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 = HubVirtualNetworkConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_natrulescreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_natrulescreateorupdate.go deleted file mode 100644 index 168ea42291c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_natrulescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 NatRulesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGatewayNatRule -} - -// NatRulesCreateOrUpdate ... -func (c VirtualWANsClient) NatRulesCreateOrUpdate(ctx context.Context, id NatRuleId, input VpnGatewayNatRule) (result NatRulesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// NatRulesCreateOrUpdateThenPoll performs NatRulesCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) NatRulesCreateOrUpdateThenPoll(ctx context.Context, id NatRuleId, input VpnGatewayNatRule) error { - result, err := c.NatRulesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NatRulesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NatRulesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_natrulesdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_natrulesdelete.go deleted file mode 100644 index 6908f8fa7a2..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_natrulesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 NatRulesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// NatRulesDelete ... -func (c VirtualWANsClient) NatRulesDelete(ctx context.Context, id NatRuleId) (result NatRulesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// NatRulesDeleteThenPoll performs NatRulesDelete then polls until it's completed -func (c VirtualWANsClient) NatRulesDeleteThenPoll(ctx context.Context, id NatRuleId) error { - result, err := c.NatRulesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing NatRulesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NatRulesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_natrulesget.go b/resource-manager/network/2023-05-01/virtualwans/method_natrulesget.go deleted file mode 100644 index 9ba7ca45bea..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_natrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 NatRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnGatewayNatRule -} - -// NatRulesGet ... -func (c VirtualWANsClient) NatRulesGet(ctx context.Context, id NatRuleId) (result NatRulesGetOperationResponse, 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 VpnGatewayNatRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_natruleslistbyvpngateway.go b/resource-manager/network/2023-05-01/virtualwans/method_natruleslistbyvpngateway.go deleted file mode 100644 index aa511c80bb3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_natruleslistbyvpngateway.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 NatRulesListByVpnGatewayOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnGatewayNatRule -} - -type NatRulesListByVpnGatewayCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnGatewayNatRule -} - -// NatRulesListByVpnGateway ... -func (c VirtualWANsClient) NatRulesListByVpnGateway(ctx context.Context, id VpnGatewayId) (result NatRulesListByVpnGatewayOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/natRules", 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 *[]VpnGatewayNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NatRulesListByVpnGatewayComplete retrieves all the results into a single object -func (c VirtualWANsClient) NatRulesListByVpnGatewayComplete(ctx context.Context, id VpnGatewayId) (NatRulesListByVpnGatewayCompleteResult, error) { - return c.NatRulesListByVpnGatewayCompleteMatchingPredicate(ctx, id, VpnGatewayNatRuleOperationPredicate{}) -} - -// NatRulesListByVpnGatewayCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) NatRulesListByVpnGatewayCompleteMatchingPredicate(ctx context.Context, id VpnGatewayId, predicate VpnGatewayNatRuleOperationPredicate) (result NatRulesListByVpnGatewayCompleteResult, err error) { - items := make([]VpnGatewayNatRule, 0) - - resp, err := c.NatRulesListByVpnGateway(ctx, id) - if err != nil { - 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 = NatRulesListByVpnGatewayCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayscreateorupdate.go deleted file mode 100644 index 664698b3088..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayscreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// P2sVpnGatewaysCreateOrUpdate ... -func (c VirtualWANsClient) P2sVpnGatewaysCreateOrUpdate(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnGateway) (result P2sVpnGatewaysCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// P2sVpnGatewaysCreateOrUpdateThenPoll performs P2sVpnGatewaysCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) P2sVpnGatewaysCreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnGateway) error { - result, err := c.P2sVpnGatewaysCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing P2sVpnGatewaysCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after P2sVpnGatewaysCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysdelete.go deleted file mode 100644 index 23ae30eaecd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysdelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// P2sVpnGatewaysDelete ... -func (c VirtualWANsClient) P2sVpnGatewaysDelete(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result P2sVpnGatewaysDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// P2sVpnGatewaysDeleteThenPoll performs P2sVpnGatewaysDelete then polls until it's completed -func (c VirtualWANsClient) P2sVpnGatewaysDeleteThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) error { - result, err := c.P2sVpnGatewaysDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing P2sVpnGatewaysDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after P2sVpnGatewaysDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysget.go b/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysget.go deleted file mode 100644 index 804013badcc..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewaysget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// P2sVpnGatewaysGet ... -func (c VirtualWANsClient) P2sVpnGatewaysGet(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result P2sVpnGatewaysGetOperationResponse, 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 P2SVpnGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslist.go b/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslist.go deleted file mode 100644 index 1f52628ac96..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]P2SVpnGateway -} - -type P2sVpnGatewaysListCompleteResult struct { - LatestHttpResponse *http.Response - Items []P2SVpnGateway -} - -// P2sVpnGatewaysList ... -func (c VirtualWANsClient) P2sVpnGatewaysList(ctx context.Context, id commonids.SubscriptionId) (result P2sVpnGatewaysListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/p2sVpnGateways", 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 *[]P2SVpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// P2sVpnGatewaysListComplete retrieves all the results into a single object -func (c VirtualWANsClient) P2sVpnGatewaysListComplete(ctx context.Context, id commonids.SubscriptionId) (P2sVpnGatewaysListCompleteResult, error) { - return c.P2sVpnGatewaysListCompleteMatchingPredicate(ctx, id, P2SVpnGatewayOperationPredicate{}) -} - -// P2sVpnGatewaysListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) P2sVpnGatewaysListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate P2SVpnGatewayOperationPredicate) (result P2sVpnGatewaysListCompleteResult, err error) { - items := make([]P2SVpnGateway, 0) - - resp, err := c.P2sVpnGatewaysList(ctx, id) - if err != nil { - 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 = P2sVpnGatewaysListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go deleted file mode 100644 index 29375db6e5c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]P2SVpnGateway -} - -type P2sVpnGatewaysListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []P2SVpnGateway -} - -// P2sVpnGatewaysListByResourceGroup ... -func (c VirtualWANsClient) P2sVpnGatewaysListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result P2sVpnGatewaysListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/p2sVpnGateways", 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 *[]P2SVpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// P2sVpnGatewaysListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) P2sVpnGatewaysListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (P2sVpnGatewaysListByResourceGroupCompleteResult, error) { - return c.P2sVpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx, id, P2SVpnGatewayOperationPredicate{}) -} - -// P2sVpnGatewaysListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) P2sVpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate P2SVpnGatewayOperationPredicate) (result P2sVpnGatewaysListByResourceGroupCompleteResult, err error) { - items := make([]P2SVpnGateway, 0) - - resp, err := c.P2sVpnGatewaysListByResourceGroup(ctx, id) - if err != nil { - 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 = P2sVpnGatewaysListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routemapscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_routemapscreateorupdate.go deleted file mode 100644 index ffcf789da29..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routemapscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 RouteMapsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *RouteMap -} - -// RouteMapsCreateOrUpdate ... -func (c VirtualWANsClient) RouteMapsCreateOrUpdate(ctx context.Context, id RouteMapId, input RouteMap) (result RouteMapsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// RouteMapsCreateOrUpdateThenPoll performs RouteMapsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) RouteMapsCreateOrUpdateThenPoll(ctx context.Context, id RouteMapId, input RouteMap) error { - result, err := c.RouteMapsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RouteMapsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RouteMapsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routemapsdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_routemapsdelete.go deleted file mode 100644 index f89977d5d94..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routemapsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 RouteMapsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RouteMapsDelete ... -func (c VirtualWANsClient) RouteMapsDelete(ctx context.Context, id RouteMapId) (result RouteMapsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// RouteMapsDeleteThenPoll performs RouteMapsDelete then polls until it's completed -func (c VirtualWANsClient) RouteMapsDeleteThenPoll(ctx context.Context, id RouteMapId) error { - result, err := c.RouteMapsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing RouteMapsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RouteMapsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routemapsget.go b/resource-manager/network/2023-05-01/virtualwans/method_routemapsget.go deleted file mode 100644 index 925002f31e7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routemapsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 RouteMapsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RouteMap -} - -// RouteMapsGet ... -func (c VirtualWANsClient) RouteMapsGet(ctx context.Context, id RouteMapId) (result RouteMapsGetOperationResponse, 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 RouteMap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routemapslist.go b/resource-manager/network/2023-05-01/virtualwans/method_routemapslist.go deleted file mode 100644 index f73baf29ab0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routemapslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 RouteMapsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RouteMap -} - -type RouteMapsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteMap -} - -// RouteMapsList ... -func (c VirtualWANsClient) RouteMapsList(ctx context.Context, id VirtualHubId) (result RouteMapsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routeMaps", 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 *[]RouteMap `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RouteMapsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) RouteMapsListComplete(ctx context.Context, id VirtualHubId) (RouteMapsListCompleteResult, error) { - return c.RouteMapsListCompleteMatchingPredicate(ctx, id, RouteMapOperationPredicate{}) -} - -// RouteMapsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) RouteMapsListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate RouteMapOperationPredicate) (result RouteMapsListCompleteResult, err error) { - items := make([]RouteMap, 0) - - resp, err := c.RouteMapsList(ctx, id) - if err != nil { - 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 = RouteMapsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routingintentcreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_routingintentcreateorupdate.go deleted file mode 100644 index 58de7662435..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routingintentcreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 RoutingIntentCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *RoutingIntent -} - -// RoutingIntentCreateOrUpdate ... -func (c VirtualWANsClient) RoutingIntentCreateOrUpdate(ctx context.Context, id RoutingIntentId, input RoutingIntent) (result RoutingIntentCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// RoutingIntentCreateOrUpdateThenPoll performs RoutingIntentCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) RoutingIntentCreateOrUpdateThenPoll(ctx context.Context, id RoutingIntentId, input RoutingIntent) error { - result, err := c.RoutingIntentCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RoutingIntentCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RoutingIntentCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routingintentdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_routingintentdelete.go deleted file mode 100644 index dd481f41454..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routingintentdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 RoutingIntentDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RoutingIntentDelete ... -func (c VirtualWANsClient) RoutingIntentDelete(ctx context.Context, id RoutingIntentId) (result RoutingIntentDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// RoutingIntentDeleteThenPoll performs RoutingIntentDelete then polls until it's completed -func (c VirtualWANsClient) RoutingIntentDeleteThenPoll(ctx context.Context, id RoutingIntentId) error { - result, err := c.RoutingIntentDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing RoutingIntentDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RoutingIntentDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routingintentget.go b/resource-manager/network/2023-05-01/virtualwans/method_routingintentget.go deleted file mode 100644 index ae61d3b41b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routingintentget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 RoutingIntentGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RoutingIntent -} - -// RoutingIntentGet ... -func (c VirtualWANsClient) RoutingIntentGet(ctx context.Context, id RoutingIntentId) (result RoutingIntentGetOperationResponse, 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 RoutingIntent - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_routingintentlist.go b/resource-manager/network/2023-05-01/virtualwans/method_routingintentlist.go deleted file mode 100644 index b8e64a01fe6..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_routingintentlist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 RoutingIntentListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RoutingIntent -} - -type RoutingIntentListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RoutingIntent -} - -// RoutingIntentList ... -func (c VirtualWANsClient) RoutingIntentList(ctx context.Context, id VirtualHubId) (result RoutingIntentListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routingIntent", 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 *[]RoutingIntent `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RoutingIntentListComplete retrieves all the results into a single object -func (c VirtualWANsClient) RoutingIntentListComplete(ctx context.Context, id VirtualHubId) (RoutingIntentListCompleteResult, error) { - return c.RoutingIntentListCompleteMatchingPredicate(ctx, id, RoutingIntentOperationPredicate{}) -} - -// RoutingIntentListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) RoutingIntentListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate RoutingIntentOperationPredicate) (result RoutingIntentListCompleteResult, err error) { - items := make([]RoutingIntent, 0) - - resp, err := c.RoutingIntentList(ctx, id) - if err != nil { - 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 = RoutingIntentListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_supportedsecurityproviders.go b/resource-manager/network/2023-05-01/virtualwans/method_supportedsecurityproviders.go deleted file mode 100644 index 616d9dd0cd4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_supportedsecurityproviders.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 SupportedSecurityProvidersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualWanSecurityProviders -} - -// SupportedSecurityProviders ... -func (c VirtualWANsClient) SupportedSecurityProviders(ctx context.Context, id VirtualWANId) (result SupportedSecurityProvidersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/supportedSecurityProviders", 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 VirtualWanSecurityProviders - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_updatetags.go b/resource-manager/network/2023-05-01/virtualwans/method_updatetags.go deleted file mode 100644 index 6115890e78c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package virtualwans - -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 *VirtualWAN -} - -// UpdateTags ... -func (c VirtualWANsClient) UpdateTags(ctx context.Context, id VirtualWANId, 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 VirtualWAN - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go deleted file mode 100644 index 3a42d5bcafd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BgpConnection -} - -// VirtualHubBgpConnectionCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubBgpConnectionCreateOrUpdate(ctx context.Context, id commonids.VirtualHubBGPConnectionId, input BgpConnection) (result VirtualHubBgpConnectionCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubBgpConnectionCreateOrUpdateThenPoll performs VirtualHubBgpConnectionCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId, input BgpConnection) error { - result, err := c.VirtualHubBgpConnectionCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectiondelete.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectiondelete.go deleted file mode 100644 index b8f353d5be6..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectiondelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubBgpConnectionDelete ... -func (c VirtualWANsClient) VirtualHubBgpConnectionDelete(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubBgpConnectionDeleteThenPoll performs VirtualHubBgpConnectionDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionDeleteThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionget.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionget.go deleted file mode 100644 index 525c6b3cabe..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BgpConnection -} - -// VirtualHubBgpConnectionGet ... -func (c VirtualWANsClient) VirtualHubBgpConnectionGet(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionGetOperationResponse, 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 BgpConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslist.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslist.go deleted file mode 100644 index 0107a51f0c7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BgpConnection -} - -type VirtualHubBgpConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BgpConnection -} - -// VirtualHubBgpConnectionsList ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsList(ctx context.Context, id VirtualHubId) (result VirtualHubBgpConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/bgpConnections", 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 *[]BgpConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubBgpConnectionsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubBgpConnectionsListComplete(ctx context.Context, id VirtualHubId) (VirtualHubBgpConnectionsListCompleteResult, error) { - return c.VirtualHubBgpConnectionsListCompleteMatchingPredicate(ctx, id, BgpConnectionOperationPredicate{}) -} - -// VirtualHubBgpConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubBgpConnectionsListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate BgpConnectionOperationPredicate) (result VirtualHubBgpConnectionsListCompleteResult, err error) { - items := make([]BgpConnection, 0) - - resp, err := c.VirtualHubBgpConnectionsList(ctx, id) - if err != nil { - 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 = VirtualHubBgpConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go deleted file mode 100644 index 6c0c2308e2b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *map[string][]PeerRoute -} - -// VirtualHubBgpConnectionsListAdvertisedRoutes ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/advertisedRoutes", 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 -} - -// VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll performs VirtualHubBgpConnectionsListAdvertisedRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionsListAdvertisedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go deleted file mode 100644 index 4c6842802ef..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListLearnedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *map[string][]PeerRoute -} - -// VirtualHubBgpConnectionsListLearnedRoutes ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListLearnedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/learnedRoutes", 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 -} - -// VirtualHubBgpConnectionsListLearnedRoutesThenPoll performs VirtualHubBgpConnectionsListLearnedRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionsListLearnedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go deleted file mode 100644 index dfb4925ba51..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *HubIPConfiguration -} - -// VirtualHubIPConfigurationCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubIPConfigurationCreateOrUpdate(ctx context.Context, id commonids.VirtualHubIPConfigurationId, input HubIPConfiguration) (result VirtualHubIPConfigurationCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubIPConfigurationCreateOrUpdateThenPoll performs VirtualHubIPConfigurationCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualHubIPConfigurationId, input HubIPConfiguration) error { - result, err := c.VirtualHubIPConfigurationCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubIPConfigurationCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubIPConfigurationCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationdelete.go deleted file mode 100644 index 36341aa33f7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationdelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubIPConfigurationDelete ... -func (c VirtualWANsClient) VirtualHubIPConfigurationDelete(ctx context.Context, id commonids.VirtualHubIPConfigurationId) (result VirtualHubIPConfigurationDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubIPConfigurationDeleteThenPoll performs VirtualHubIPConfigurationDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubIPConfigurationDeleteThenPoll(ctx context.Context, id commonids.VirtualHubIPConfigurationId) error { - result, err := c.VirtualHubIPConfigurationDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubIPConfigurationDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubIPConfigurationDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationget.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationget.go deleted file mode 100644 index ca3c9a88dd3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HubIPConfiguration -} - -// VirtualHubIPConfigurationGet ... -func (c VirtualWANsClient) VirtualHubIPConfigurationGet(ctx context.Context, id commonids.VirtualHubIPConfigurationId) (result VirtualHubIPConfigurationGetOperationResponse, 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 HubIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationlist.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationlist.go deleted file mode 100644 index 481a7847797..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubipconfigurationlist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HubIPConfiguration -} - -type VirtualHubIPConfigurationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HubIPConfiguration -} - -// VirtualHubIPConfigurationList ... -func (c VirtualWANsClient) VirtualHubIPConfigurationList(ctx context.Context, id VirtualHubId) (result VirtualHubIPConfigurationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ipConfigurations", 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 *[]HubIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubIPConfigurationListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubIPConfigurationListComplete(ctx context.Context, id VirtualHubId) (VirtualHubIPConfigurationListCompleteResult, error) { - return c.VirtualHubIPConfigurationListCompleteMatchingPredicate(ctx, id, HubIPConfigurationOperationPredicate{}) -} - -// VirtualHubIPConfigurationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubIPConfigurationListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate HubIPConfigurationOperationPredicate) (result VirtualHubIPConfigurationListCompleteResult, err error) { - items := make([]HubIPConfiguration, 0) - - resp, err := c.VirtualHubIPConfigurationList(ctx, id) - if err != nil { - 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 = VirtualHubIPConfigurationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go deleted file mode 100644 index b7e92feb6c7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2sCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sCreateOrUpdate(ctx context.Context, id VirtualHubRouteTableId, input VirtualHubRouteTableV2) (result VirtualHubRouteTableV2sCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubRouteTableV2sCreateOrUpdateThenPoll performs VirtualHubRouteTableV2sCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubRouteTableV2sCreateOrUpdateThenPoll(ctx context.Context, id VirtualHubRouteTableId, input VirtualHubRouteTableV2) error { - result, err := c.VirtualHubRouteTableV2sCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubRouteTableV2sCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubRouteTableV2sCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sdelete.go deleted file mode 100644 index 91cc7babd28..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubRouteTableV2sDelete ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sDelete(ctx context.Context, id VirtualHubRouteTableId) (result VirtualHubRouteTableV2sDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubRouteTableV2sDeleteThenPoll performs VirtualHubRouteTableV2sDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubRouteTableV2sDeleteThenPoll(ctx context.Context, id VirtualHubRouteTableId) error { - result, err := c.VirtualHubRouteTableV2sDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubRouteTableV2sDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubRouteTableV2sDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sget.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sget.go deleted file mode 100644 index 7c542fcfe68..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2sget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2sGet ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sGet(ctx context.Context, id VirtualHubRouteTableId) (result VirtualHubRouteTableV2sGetOperationResponse, 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 VirtualHubRouteTableV2 - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2slist.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2slist.go deleted file mode 100644 index b406331c09a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubroutetablev2slist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHubRouteTableV2 -} - -type VirtualHubRouteTableV2sListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2sList ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sList(ctx context.Context, id VirtualHubId) (result VirtualHubRouteTableV2sListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routeTables", 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 *[]VirtualHubRouteTableV2 `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubRouteTableV2sListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubRouteTableV2sListComplete(ctx context.Context, id VirtualHubId) (VirtualHubRouteTableV2sListCompleteResult, error) { - return c.VirtualHubRouteTableV2sListCompleteMatchingPredicate(ctx, id, VirtualHubRouteTableV2OperationPredicate{}) -} - -// VirtualHubRouteTableV2sListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubRouteTableV2sListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate VirtualHubRouteTableV2OperationPredicate) (result VirtualHubRouteTableV2sListCompleteResult, err error) { - items := make([]VirtualHubRouteTableV2, 0) - - resp, err := c.VirtualHubRouteTableV2sList(ctx, id) - if err != nil { - 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 = VirtualHubRouteTableV2sListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubscreateorupdate.go deleted file mode 100644 index 6b78901c93c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHub -} - -// VirtualHubsCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubsCreateOrUpdate(ctx context.Context, id VirtualHubId, input VirtualHub) (result VirtualHubsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubsCreateOrUpdateThenPoll performs VirtualHubsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubsCreateOrUpdateThenPoll(ctx context.Context, id VirtualHubId, input VirtualHub) error { - result, err := c.VirtualHubsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsdelete.go deleted file mode 100644 index 70eebb0a343..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VirtualHubsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubsDelete ... -func (c VirtualWANsClient) VirtualHubsDelete(ctx context.Context, id VirtualHubId) (result VirtualHubsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubsDeleteThenPoll performs VirtualHubsDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubsDeleteThenPoll(ctx context.Context, id VirtualHubId) error { - result, err := c.VirtualHubsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsget.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsget.go deleted file mode 100644 index 3f2e419720f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VirtualHubsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHub -} - -// VirtualHubsGet ... -func (c VirtualWANsClient) VirtualHubsGet(ctx context.Context, id VirtualHubId) (result VirtualHubsGetOperationResponse, 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 VirtualHub - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go deleted file mode 100644 index 1bbae403695..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubEffectiveRouteList -} - -// VirtualHubsGetEffectiveVirtualHubRoutes ... -func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutes(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) (result VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveRoutes", 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 -} - -// VirtualHubsGetEffectiveVirtualHubRoutesThenPoll performs VirtualHubsGetEffectiveVirtualHubRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) error { - result, err := c.VirtualHubsGetEffectiveVirtualHubRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetinboundroutes.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetinboundroutes.go deleted file mode 100644 index 03114d0c238..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetinboundroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetInboundRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *EffectiveRouteMapRouteList -} - -// VirtualHubsGetInboundRoutes ... -func (c VirtualWANsClient) VirtualHubsGetInboundRoutes(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) (result VirtualHubsGetInboundRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/inboundRoutes", 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 -} - -// VirtualHubsGetInboundRoutesThenPoll performs VirtualHubsGetInboundRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetInboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) error { - result, err := c.VirtualHubsGetInboundRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetInboundRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetInboundRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetoutboundroutes.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetoutboundroutes.go deleted file mode 100644 index 9a715f99613..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsgetoutboundroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetOutboundRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *EffectiveRouteMapRouteList -} - -// VirtualHubsGetOutboundRoutes ... -func (c VirtualWANsClient) VirtualHubsGetOutboundRoutes(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) (result VirtualHubsGetOutboundRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/outboundRoutes", 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 -} - -// VirtualHubsGetOutboundRoutesThenPoll performs VirtualHubsGetOutboundRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetOutboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) error { - result, err := c.VirtualHubsGetOutboundRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetOutboundRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetOutboundRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubslist.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubslist.go deleted file mode 100644 index 466d0645613..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualHubsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHub -} - -type VirtualHubsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHub -} - -// VirtualHubsList ... -func (c VirtualWANsClient) VirtualHubsList(ctx context.Context, id commonids.SubscriptionId) (result VirtualHubsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualHubs", 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 *[]VirtualHub `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubsListComplete(ctx context.Context, id commonids.SubscriptionId) (VirtualHubsListCompleteResult, error) { - return c.VirtualHubsListCompleteMatchingPredicate(ctx, id, VirtualHubOperationPredicate{}) -} - -// VirtualHubsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualHubOperationPredicate) (result VirtualHubsListCompleteResult, err error) { - items := make([]VirtualHub, 0) - - resp, err := c.VirtualHubsList(ctx, id) - if err != nil { - 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 = VirtualHubsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubslistbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubslistbyresourcegroup.go deleted file mode 100644 index d81c7aff720..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualHubsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHub -} - -type VirtualHubsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHub -} - -// VirtualHubsListByResourceGroup ... -func (c VirtualWANsClient) VirtualHubsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VirtualHubsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualHubs", 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 *[]VirtualHub `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubsListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VirtualHubsListByResourceGroupCompleteResult, error) { - return c.VirtualHubsListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualHubOperationPredicate{}) -} - -// VirtualHubsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualHubOperationPredicate) (result VirtualHubsListByResourceGroupCompleteResult, err error) { - items := make([]VirtualHub, 0) - - resp, err := c.VirtualHubsListByResourceGroup(ctx, id) - if err != nil { - 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 = VirtualHubsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsupdatetags.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsupdatetags.go deleted file mode 100644 index be5399a4515..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualhubsupdatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package virtualwans - -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 VirtualHubsUpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHub -} - -// VirtualHubsUpdateTags ... -func (c VirtualWANsClient) VirtualHubsUpdateTags(ctx context.Context, id VirtualHubId, input TagsObject) (result VirtualHubsUpdateTagsOperationResponse, 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 VirtualHub - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualwanscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualwanscreateorupdate.go deleted file mode 100644 index 310b768e4e5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualwanscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualWansCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualWAN -} - -// VirtualWansCreateOrUpdate ... -func (c VirtualWANsClient) VirtualWansCreateOrUpdate(ctx context.Context, id VirtualWANId, input VirtualWAN) (result VirtualWansCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualWansCreateOrUpdateThenPoll performs VirtualWansCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualWansCreateOrUpdateThenPoll(ctx context.Context, id VirtualWANId, input VirtualWAN) error { - result, err := c.VirtualWansCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualWansCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualWansCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualwansdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualwansdelete.go deleted file mode 100644 index 4ce708a8edd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualwansdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VirtualWansDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualWansDelete ... -func (c VirtualWANsClient) VirtualWansDelete(ctx context.Context, id VirtualWANId) (result VirtualWansDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualWansDeleteThenPoll performs VirtualWansDelete then polls until it's completed -func (c VirtualWANsClient) VirtualWansDeleteThenPoll(ctx context.Context, id VirtualWANId) error { - result, err := c.VirtualWansDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualWansDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualWansDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualwansget.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualwansget.go deleted file mode 100644 index 41dbd00d7f2..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualwansget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VirtualWansGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualWAN -} - -// VirtualWansGet ... -func (c VirtualWANsClient) VirtualWansGet(ctx context.Context, id VirtualWANId) (result VirtualWansGetOperationResponse, 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 VirtualWAN - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualwanslist.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualwanslist.go deleted file mode 100644 index 3ecd8ccded9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualwanslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualWansListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualWAN -} - -type VirtualWansListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualWAN -} - -// VirtualWansList ... -func (c VirtualWANsClient) VirtualWansList(ctx context.Context, id commonids.SubscriptionId) (result VirtualWansListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualWans", 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 *[]VirtualWAN `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualWansListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualWansListComplete(ctx context.Context, id commonids.SubscriptionId) (VirtualWansListCompleteResult, error) { - return c.VirtualWansListCompleteMatchingPredicate(ctx, id, VirtualWANOperationPredicate{}) -} - -// VirtualWansListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualWansListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualWANOperationPredicate) (result VirtualWansListCompleteResult, err error) { - items := make([]VirtualWAN, 0) - - resp, err := c.VirtualWansList(ctx, id) - if err != nil { - 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 = VirtualWansListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_virtualwanslistbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualwans/method_virtualwanslistbyresourcegroup.go deleted file mode 100644 index f904f3645d2..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_virtualwanslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualWansListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualWAN -} - -type VirtualWansListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualWAN -} - -// VirtualWansListByResourceGroup ... -func (c VirtualWANsClient) VirtualWansListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VirtualWansListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualWans", 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 *[]VirtualWAN `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualWansListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualWansListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VirtualWansListByResourceGroupCompleteResult, error) { - return c.VirtualWansListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualWANOperationPredicate{}) -} - -// VirtualWansListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualWansListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualWANOperationPredicate) (result VirtualWansListByResourceGroupCompleteResult, err error) { - items := make([]VirtualWAN, 0) - - resp, err := c.VirtualWansListByResourceGroup(ctx, id) - if err != nil { - 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 = VirtualWansListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionscreateorupdate.go deleted file mode 100644 index 58f8bec5b87..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionscreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VpnConnectionsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnConnection -} - -// VpnConnectionsCreateOrUpdate ... -func (c VirtualWANsClient) VpnConnectionsCreateOrUpdate(ctx context.Context, id commonids.VPNConnectionId, input VpnConnection) (result VpnConnectionsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnConnectionsCreateOrUpdateThenPoll performs VpnConnectionsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsCreateOrUpdateThenPoll(ctx context.Context, id commonids.VPNConnectionId, input VpnConnection) error { - result, err := c.VpnConnectionsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnConnectionsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsdelete.go deleted file mode 100644 index 12193490035..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsdelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VpnConnectionsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnConnectionsDelete ... -func (c VirtualWANsClient) VpnConnectionsDelete(ctx context.Context, id commonids.VPNConnectionId) (result VpnConnectionsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnConnectionsDeleteThenPoll performs VpnConnectionsDelete then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsDeleteThenPoll(ctx context.Context, id commonids.VPNConnectionId) error { - result, err := c.VpnConnectionsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnConnectionsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsget.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsget.go deleted file mode 100644 index 812232759b1..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 VpnConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnConnection -} - -// VpnConnectionsGet ... -func (c VirtualWANsClient) VpnConnectionsGet(ctx context.Context, id commonids.VPNConnectionId) (result VpnConnectionsGetOperationResponse, 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 VpnConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionslistbyvpngateway.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionslistbyvpngateway.go deleted file mode 100644 index 4bb86629f08..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionslistbyvpngateway.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VpnConnectionsListByVpnGatewayOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnConnection -} - -type VpnConnectionsListByVpnGatewayCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnConnection -} - -// VpnConnectionsListByVpnGateway ... -func (c VirtualWANsClient) VpnConnectionsListByVpnGateway(ctx context.Context, id VpnGatewayId) (result VpnConnectionsListByVpnGatewayOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/vpnConnections", 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 *[]VpnConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnConnectionsListByVpnGatewayComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnConnectionsListByVpnGatewayComplete(ctx context.Context, id VpnGatewayId) (VpnConnectionsListByVpnGatewayCompleteResult, error) { - return c.VpnConnectionsListByVpnGatewayCompleteMatchingPredicate(ctx, id, VpnConnectionOperationPredicate{}) -} - -// VpnConnectionsListByVpnGatewayCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnConnectionsListByVpnGatewayCompleteMatchingPredicate(ctx context.Context, id VpnGatewayId, predicate VpnConnectionOperationPredicate) (result VpnConnectionsListByVpnGatewayCompleteResult, err error) { - items := make([]VpnConnection, 0) - - resp, err := c.VpnConnectionsListByVpnGateway(ctx, id) - if err != nil { - 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 = VpnConnectionsListByVpnGatewayCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstartpacketcapture.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstartpacketcapture.go deleted file mode 100644 index 98551e48f98..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstartpacketcapture.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VpnConnectionsStartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnConnectionsStartPacketCapture ... -func (c VirtualWANsClient) VpnConnectionsStartPacketCapture(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStartParameters) (result VpnConnectionsStartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startpacketcapture", 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 -} - -// VpnConnectionsStartPacketCaptureThenPoll performs VpnConnectionsStartPacketCapture then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsStartPacketCaptureThenPoll(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStartParameters) error { - result, err := c.VpnConnectionsStartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnConnectionsStartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsStartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstoppacketcapture.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstoppacketcapture.go deleted file mode 100644 index b32b88c6969..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnconnectionsstoppacketcapture.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VpnConnectionsStopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnConnectionsStopPacketCapture ... -func (c VirtualWANsClient) VpnConnectionsStopPacketCapture(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStopParameters) (result VpnConnectionsStopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stoppacketcapture", 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 -} - -// VpnConnectionsStopPacketCaptureThenPoll performs VpnConnectionsStopPacketCapture then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsStopPacketCaptureThenPoll(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStopParameters) error { - result, err := c.VpnConnectionsStopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnConnectionsStopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsStopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayscreateorupdate.go deleted file mode 100644 index 2cabc7eba19..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VpnGatewaysCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -// VpnGatewaysCreateOrUpdate ... -func (c VirtualWANsClient) VpnGatewaysCreateOrUpdate(ctx context.Context, id VpnGatewayId, input VpnGateway) (result VpnGatewaysCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnGatewaysCreateOrUpdateThenPoll performs VpnGatewaysCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnGatewaysCreateOrUpdateThenPoll(ctx context.Context, id VpnGatewayId, input VpnGateway) error { - result, err := c.VpnGatewaysCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnGatewaysCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnGatewaysCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysdelete.go deleted file mode 100644 index 76d02ba38d5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnGatewaysDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnGatewaysDelete ... -func (c VirtualWANsClient) VpnGatewaysDelete(ctx context.Context, id VpnGatewayId) (result VpnGatewaysDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnGatewaysDeleteThenPoll performs VpnGatewaysDelete then polls until it's completed -func (c VirtualWANsClient) VpnGatewaysDeleteThenPoll(ctx context.Context, id VpnGatewayId) error { - result, err := c.VpnGatewaysDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnGatewaysDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnGatewaysDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysget.go b/resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysget.go deleted file mode 100644 index bfa13a547eb..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewaysget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnGatewaysGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -// VpnGatewaysGet ... -func (c VirtualWANsClient) VpnGatewaysGet(ctx context.Context, id VpnGatewayId) (result VpnGatewaysGetOperationResponse, 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 VpnGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslist.go b/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslist.go deleted file mode 100644 index c72c758bb9f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnGatewaysListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnGateway -} - -type VpnGatewaysListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnGateway -} - -// VpnGatewaysList ... -func (c VirtualWANsClient) VpnGatewaysList(ctx context.Context, id commonids.SubscriptionId) (result VpnGatewaysListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnGateways", 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 *[]VpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnGatewaysListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnGatewaysListComplete(ctx context.Context, id commonids.SubscriptionId) (VpnGatewaysListCompleteResult, error) { - return c.VpnGatewaysListCompleteMatchingPredicate(ctx, id, VpnGatewayOperationPredicate{}) -} - -// VpnGatewaysListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnGatewaysListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VpnGatewayOperationPredicate) (result VpnGatewaysListCompleteResult, err error) { - items := make([]VpnGateway, 0) - - resp, err := c.VpnGatewaysList(ctx, id) - if err != nil { - 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 = VpnGatewaysListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslistbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslistbyresourcegroup.go deleted file mode 100644 index 42347fe5b4c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpngatewayslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnGatewaysListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnGateway -} - -type VpnGatewaysListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnGateway -} - -// VpnGatewaysListByResourceGroup ... -func (c VirtualWANsClient) VpnGatewaysListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VpnGatewaysListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnGateways", 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 *[]VpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnGatewaysListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnGatewaysListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VpnGatewaysListByResourceGroupCompleteResult, error) { - return c.VpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx, id, VpnGatewayOperationPredicate{}) -} - -// VpnGatewaysListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VpnGatewayOperationPredicate) (result VpnGatewaysListByResourceGroupCompleteResult, err error) { - items := make([]VpnGateway, 0) - - resp, err := c.VpnGatewaysListByResourceGroup(ctx, id) - if err != nil { - 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 = VpnGatewaysListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionsgetikesas.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionsgetikesas.go deleted file mode 100644 index 5ecf6a6d2e7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionsgetikesas.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnLinkConnectionsGetIkeSasOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnLinkConnectionsGetIkeSas ... -func (c VirtualWANsClient) VpnLinkConnectionsGetIkeSas(ctx context.Context, id VpnLinkConnectionId) (result VpnLinkConnectionsGetIkeSasOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getikesas", 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 -} - -// VpnLinkConnectionsGetIkeSasThenPoll performs VpnLinkConnectionsGetIkeSas then polls until it's completed -func (c VirtualWANsClient) VpnLinkConnectionsGetIkeSasThenPoll(ctx context.Context, id VpnLinkConnectionId) error { - result, err := c.VpnLinkConnectionsGetIkeSas(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnLinkConnectionsGetIkeSas: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnLinkConnectionsGetIkeSas: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go deleted file mode 100644 index f9eb225bad2..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnLinkConnectionsListByVpnConnectionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSiteLinkConnection -} - -type VpnLinkConnectionsListByVpnConnectionCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSiteLinkConnection -} - -// VpnLinkConnectionsListByVpnConnection ... -func (c VirtualWANsClient) VpnLinkConnectionsListByVpnConnection(ctx context.Context, id commonids.VPNConnectionId) (result VpnLinkConnectionsListByVpnConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/vpnLinkConnections", 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 *[]VpnSiteLinkConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnLinkConnectionsListByVpnConnectionComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnLinkConnectionsListByVpnConnectionComplete(ctx context.Context, id commonids.VPNConnectionId) (VpnLinkConnectionsListByVpnConnectionCompleteResult, error) { - return c.VpnLinkConnectionsListByVpnConnectionCompleteMatchingPredicate(ctx, id, VpnSiteLinkConnectionOperationPredicate{}) -} - -// VpnLinkConnectionsListByVpnConnectionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnLinkConnectionsListByVpnConnectionCompleteMatchingPredicate(ctx context.Context, id commonids.VPNConnectionId, predicate VpnSiteLinkConnectionOperationPredicate) (result VpnLinkConnectionsListByVpnConnectionCompleteResult, err error) { - items := make([]VpnSiteLinkConnection, 0) - - resp, err := c.VpnLinkConnectionsListByVpnConnection(ctx, id) - if err != nil { - 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 = VpnLinkConnectionsListByVpnConnectionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go deleted file mode 100644 index 2f7ae87144e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsAssociatedWithVirtualWanListOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfigurationsResponse -} - -// VpnServerConfigurationsAssociatedWithVirtualWanList ... -func (c VirtualWANsClient) VpnServerConfigurationsAssociatedWithVirtualWanList(ctx context.Context, id VirtualWANId) (result VpnServerConfigurationsAssociatedWithVirtualWanListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/vpnServerConfigurations", 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 -} - -// VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll performs VpnServerConfigurationsAssociatedWithVirtualWanList then polls until it's completed -func (c VirtualWANsClient) VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx context.Context, id VirtualWANId) error { - result, err := c.VpnServerConfigurationsAssociatedWithVirtualWanList(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnServerConfigurationsAssociatedWithVirtualWanList: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnServerConfigurationsAssociatedWithVirtualWanList: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go deleted file mode 100644 index 256562205b9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfiguration -} - -// VpnServerConfigurationsCreateOrUpdate ... -func (c VirtualWANsClient) VpnServerConfigurationsCreateOrUpdate(ctx context.Context, id VpnServerConfigurationId, input VpnServerConfiguration) (result VpnServerConfigurationsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnServerConfigurationsCreateOrUpdateThenPoll performs VpnServerConfigurationsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnServerConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id VpnServerConfigurationId, input VpnServerConfiguration) error { - result, err := c.VpnServerConfigurationsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnServerConfigurationsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnServerConfigurationsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsdelete.go deleted file mode 100644 index 2edde34518e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnServerConfigurationsDelete ... -func (c VirtualWANsClient) VpnServerConfigurationsDelete(ctx context.Context, id VpnServerConfigurationId) (result VpnServerConfigurationsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnServerConfigurationsDeleteThenPoll performs VpnServerConfigurationsDelete then polls until it's completed -func (c VirtualWANsClient) VpnServerConfigurationsDeleteThenPoll(ctx context.Context, id VpnServerConfigurationId) error { - result, err := c.VpnServerConfigurationsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnServerConfigurationsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnServerConfigurationsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsget.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsget.go deleted file mode 100644 index e5b009a1154..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfiguration -} - -// VpnServerConfigurationsGet ... -func (c VirtualWANsClient) VpnServerConfigurationsGet(ctx context.Context, id VpnServerConfigurationId) (result VpnServerConfigurationsGetOperationResponse, 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 VpnServerConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslist.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslist.go deleted file mode 100644 index 62118191c91..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnServerConfiguration -} - -type VpnServerConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnServerConfiguration -} - -// VpnServerConfigurationsList ... -func (c VirtualWANsClient) VpnServerConfigurationsList(ctx context.Context, id commonids.SubscriptionId) (result VpnServerConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnServerConfigurations", 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 *[]VpnServerConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnServerConfigurationsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnServerConfigurationsListComplete(ctx context.Context, id commonids.SubscriptionId) (VpnServerConfigurationsListCompleteResult, error) { - return c.VpnServerConfigurationsListCompleteMatchingPredicate(ctx, id, VpnServerConfigurationOperationPredicate{}) -} - -// VpnServerConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnServerConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VpnServerConfigurationOperationPredicate) (result VpnServerConfigurationsListCompleteResult, err error) { - items := make([]VpnServerConfiguration, 0) - - resp, err := c.VpnServerConfigurationsList(ctx, id) - if err != nil { - 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 = VpnServerConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go deleted file mode 100644 index d96d591a6a9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnServerConfiguration -} - -type VpnServerConfigurationsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnServerConfiguration -} - -// VpnServerConfigurationsListByResourceGroup ... -func (c VirtualWANsClient) VpnServerConfigurationsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VpnServerConfigurationsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnServerConfigurations", 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 *[]VpnServerConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnServerConfigurationsListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnServerConfigurationsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VpnServerConfigurationsListByResourceGroupCompleteResult, error) { - return c.VpnServerConfigurationsListByResourceGroupCompleteMatchingPredicate(ctx, id, VpnServerConfigurationOperationPredicate{}) -} - -// VpnServerConfigurationsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnServerConfigurationsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VpnServerConfigurationOperationPredicate) (result VpnServerConfigurationsListByResourceGroupCompleteResult, err error) { - items := make([]VpnServerConfiguration, 0) - - resp, err := c.VpnServerConfigurationsListByResourceGroup(ctx, id) - if err != nil { - 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 = VpnServerConfigurationsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkconnectionsget.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkconnectionsget.go deleted file mode 100644 index 088e1b48de5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnSiteLinkConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnSiteLinkConnection -} - -// VpnSiteLinkConnectionsGet ... -func (c VirtualWANsClient) VpnSiteLinkConnectionsGet(ctx context.Context, id VpnLinkConnectionId) (result VpnSiteLinkConnectionsGetOperationResponse, 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 VpnSiteLinkConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinksget.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinksget.go deleted file mode 100644 index c16e84b3691..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinksget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnSiteLinksGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnSiteLink -} - -// VpnSiteLinksGet ... -func (c VirtualWANsClient) VpnSiteLinksGet(ctx context.Context, id VpnSiteLinkId) (result VpnSiteLinksGetOperationResponse, 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 VpnSiteLink - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go deleted file mode 100644 index 550e5725ad9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VpnSiteLinksListByVpnSiteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSiteLink -} - -type VpnSiteLinksListByVpnSiteCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSiteLink -} - -// VpnSiteLinksListByVpnSite ... -func (c VirtualWANsClient) VpnSiteLinksListByVpnSite(ctx context.Context, id VpnSiteId) (result VpnSiteLinksListByVpnSiteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/vpnSiteLinks", 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 *[]VpnSiteLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnSiteLinksListByVpnSiteComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnSiteLinksListByVpnSiteComplete(ctx context.Context, id VpnSiteId) (VpnSiteLinksListByVpnSiteCompleteResult, error) { - return c.VpnSiteLinksListByVpnSiteCompleteMatchingPredicate(ctx, id, VpnSiteLinkOperationPredicate{}) -} - -// VpnSiteLinksListByVpnSiteCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnSiteLinksListByVpnSiteCompleteMatchingPredicate(ctx context.Context, id VpnSiteId, predicate VpnSiteLinkOperationPredicate) (result VpnSiteLinksListByVpnSiteCompleteResult, err error) { - items := make([]VpnSiteLink, 0) - - resp, err := c.VpnSiteLinksListByVpnSite(ctx, id) - if err != nil { - 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 = VpnSiteLinksListByVpnSiteCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesconfigurationdownload.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesconfigurationdownload.go deleted file mode 100644 index a20fd02e0fc..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesconfigurationdownload.go +++ /dev/null @@ -1,74 +0,0 @@ -package virtualwans - -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 VpnSitesConfigurationDownloadOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnSitesConfigurationDownload ... -func (c VirtualWANsClient) VpnSitesConfigurationDownload(ctx context.Context, id VirtualWANId, input GetVpnSitesConfigurationRequest) (result VpnSitesConfigurationDownloadOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/vpnConfiguration", 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 -} - -// VpnSitesConfigurationDownloadThenPoll performs VpnSitesConfigurationDownload then polls until it's completed -func (c VirtualWANsClient) VpnSitesConfigurationDownloadThenPoll(ctx context.Context, id VirtualWANId, input GetVpnSitesConfigurationRequest) error { - result, err := c.VpnSitesConfigurationDownload(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnSitesConfigurationDownload: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnSitesConfigurationDownload: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitescreateorupdate.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitescreateorupdate.go deleted file mode 100644 index 2b93c69c66a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VpnSitesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnSite -} - -// VpnSitesCreateOrUpdate ... -func (c VirtualWANsClient) VpnSitesCreateOrUpdate(ctx context.Context, id VpnSiteId, input VpnSite) (result VpnSitesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnSitesCreateOrUpdateThenPoll performs VpnSitesCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnSitesCreateOrUpdateThenPoll(ctx context.Context, id VpnSiteId, input VpnSite) error { - result, err := c.VpnSitesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnSitesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnSitesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesdelete.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesdelete.go deleted file mode 100644 index f3b27d7f18a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnSitesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnSitesDelete ... -func (c VirtualWANsClient) VpnSitesDelete(ctx context.Context, id VpnSiteId) (result VpnSitesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnSitesDeleteThenPoll performs VpnSitesDelete then polls until it's completed -func (c VirtualWANsClient) VpnSitesDeleteThenPoll(ctx context.Context, id VpnSiteId) error { - result, err := c.VpnSitesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnSitesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnSitesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesget.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesget.go deleted file mode 100644 index 6494e6d6449..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsitesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnSitesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnSite -} - -// VpnSitesGet ... -func (c VirtualWANsClient) VpnSitesGet(ctx context.Context, id VpnSiteId) (result VpnSitesGetOperationResponse, 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 VpnSite - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslist.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslist.go deleted file mode 100644 index 54e583b7d9f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnSitesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSite -} - -type VpnSitesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSite -} - -// VpnSitesList ... -func (c VirtualWANsClient) VpnSitesList(ctx context.Context, id commonids.SubscriptionId) (result VpnSitesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnSites", 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 *[]VpnSite `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnSitesListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnSitesListComplete(ctx context.Context, id commonids.SubscriptionId) (VpnSitesListCompleteResult, error) { - return c.VpnSitesListCompleteMatchingPredicate(ctx, id, VpnSiteOperationPredicate{}) -} - -// VpnSitesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnSitesListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VpnSiteOperationPredicate) (result VpnSitesListCompleteResult, err error) { - items := make([]VpnSite, 0) - - resp, err := c.VpnSitesList(ctx, id) - if err != nil { - 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 = VpnSitesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslistbyresourcegroup.go b/resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslistbyresourcegroup.go deleted file mode 100644 index ed569e858d1..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/method_vpnsiteslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnSitesListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSite -} - -type VpnSitesListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSite -} - -// VpnSitesListByResourceGroup ... -func (c VirtualWANsClient) VpnSitesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VpnSitesListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnSites", 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 *[]VpnSite `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnSitesListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnSitesListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VpnSitesListByResourceGroupCompleteResult, error) { - return c.VpnSitesListByResourceGroupCompleteMatchingPredicate(ctx, id, VpnSiteOperationPredicate{}) -} - -// VpnSitesListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnSitesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VpnSiteOperationPredicate) (result VpnSitesListByResourceGroupCompleteResult, err error) { - items := make([]VpnSite, 0) - - resp, err := c.VpnSitesListByResourceGroup(ctx, id) - if err != nil { - 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 = VpnSitesListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_aadauthenticationparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_aadauthenticationparameters.go deleted file mode 100644 index b0d5e53c358..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_aadauthenticationparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AadAuthenticationParameters struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_action.go b/resource-manager/network/2023-05-01/virtualwans/model_action.go deleted file mode 100644 index e3c73ef507d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_action.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Action struct { - Parameters *[]Parameter `json:"parameters,omitempty"` - Type *RouteMapActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_addressspace.go b/resource-manager/network/2023-05-01/virtualwans/model_addressspace.go deleted file mode 100644 index e1ac53861fc..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 51a23d1c2c5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index adfa8110618..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index c308084cb90..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 184f4db35ed..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 96ab63c3c70..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygroup.go deleted file mode 100644 index 8df94828320..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 0db023773ff..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_backendaddresspool.go b/resource-manager/network/2023-05-01/virtualwans/model_backendaddresspool.go deleted file mode 100644 index 75b3239a673..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 210c422933e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_bgpconnection.go b/resource-manager/network/2023-05-01/virtualwans/model_bgpconnection.go deleted file mode 100644 index 13c77fe2225..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_bgpconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BgpConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_bgpconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_bgpconnectionproperties.go deleted file mode 100644 index 4666e421984..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_bgpconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpConnectionProperties struct { - ConnectionState *HubBgpConnectionStatus `json:"connectionState,omitempty"` - HubVirtualNetworkConnection *SubResource `json:"hubVirtualNetworkConnection,omitempty"` - PeerAsn *int64 `json:"peerAsn,omitempty"` - PeerIP *string `json:"peerIp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_bgpsettings.go b/resource-manager/network/2023-05-01/virtualwans/model_bgpsettings.go deleted file mode 100644 index 5f96d5acf14..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_criterion.go b/resource-manager/network/2023-05-01/virtualwans/model_criterion.go deleted file mode 100644 index e7249b64d4d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_criterion.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Criterion struct { - AsPath *[]string `json:"asPath,omitempty"` - Community *[]string `json:"community,omitempty"` - MatchCondition *RouteMapMatchCondition `json:"matchCondition,omitempty"` - RoutePrefix *[]string `json:"routePrefix,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 557a5a01a6d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ddossettings.go b/resource-manager/network/2023-05-01/virtualwans/model_ddossettings.go deleted file mode 100644 index 82eef09dc62..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_delegation.go b/resource-manager/network/2023-05-01/virtualwans/model_delegation.go deleted file mode 100644 index 55eeb1fff81..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_deviceproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_deviceproperties.go deleted file mode 100644 index 9c255349846..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_deviceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceProperties struct { - DeviceModel *string `json:"deviceModel,omitempty"` - DeviceVendor *string `json:"deviceVendor,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproute.go b/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproute.go deleted file mode 100644 index 3a565a687e8..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRouteMapRoute struct { - AsPath *string `json:"asPath,omitempty"` - BgpCommunities *string `json:"bgpCommunities,omitempty"` - Prefix *string `json:"prefix,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproutelist.go b/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproutelist.go deleted file mode 100644 index 326acde877b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutemaproutelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRouteMapRouteList struct { - Value *[]EffectiveRouteMapRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutesparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutesparameters.go deleted file mode 100644 index dab27997ab5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_effectiveroutesparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRoutesParameters struct { - ResourceId *string `json:"resourceId,omitempty"` - VirtualWanResourceType *string `json:"virtualWanResourceType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_flowlog.go b/resource-manager/network/2023-05-01/virtualwans/model_flowlog.go deleted file mode 100644 index da3b4f53345..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_flowlogformatparameters.go deleted file mode 100644 index 3b64c7c567a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_flowlogpropertiesformat.go deleted file mode 100644 index 61a32b4aded..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_frontendipconfiguration.go deleted file mode 100644 index b9c97d1e6a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualwans - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 62b1635a8ed..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 81c747c0a4a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/virtualwans/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 96c5d2b39e5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_getinboundroutesparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_getinboundroutesparameters.go deleted file mode 100644 index 1407618f660..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_getinboundroutesparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetInboundRoutesParameters struct { - ConnectionType *string `json:"connectionType,omitempty"` - ResourceUri *string `json:"resourceUri,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_getoutboundroutesparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_getoutboundroutesparameters.go deleted file mode 100644 index 19a89a55b10..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_getoutboundroutesparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOutboundRoutesParameters struct { - ConnectionType *string `json:"connectionType,omitempty"` - ResourceUri *string `json:"resourceUri,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2023-05-01/virtualwans/model_getvpnsitesconfigurationrequest.go deleted file mode 100644 index 0dd233101ce..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_getvpnsitesconfigurationrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetVpnSitesConfigurationRequest struct { - OutputBlobSasUrl string `json:"outputBlobSasUrl"` - VpnSites *[]string `json:"vpnSites,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_hubipconfiguration.go deleted file mode 100644 index c666224646f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *HubIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_hubipconfigurationpropertiesformat.go deleted file mode 100644 index 86c4674860b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubroute.go b/resource-manager/network/2023-05-01/virtualwans/model_hubroute.go deleted file mode 100644 index bc12eef1a4a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubroute.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubRoute struct { - DestinationType string `json:"destinationType"` - Destinations []string `json:"destinations"` - Name string `json:"name"` - NextHop string `json:"nextHop"` - NextHopType string `json:"nextHopType"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubroutetable.go b/resource-manager/network/2023-05-01/virtualwans/model_hubroutetable.go deleted file mode 100644 index 1214fb071b3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubroutetable.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubRouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *HubRouteTableProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubroutetableproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_hubroutetableproperties.go deleted file mode 100644 index 32d33bc1ec9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubroutetableproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubRouteTableProperties struct { - AssociatedConnections *[]string `json:"associatedConnections,omitempty"` - Labels *[]string `json:"labels,omitempty"` - PropagatingConnections *[]string `json:"propagatingConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Routes *[]HubRoute `json:"routes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnection.go b/resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnection.go deleted file mode 100644 index 41f20a0a732..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubVirtualNetworkConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go deleted file mode 100644 index 83313e30ed5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubVirtualNetworkConnectionProperties struct { - AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` - AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_inboundnatrule.go b/resource-manager/network/2023-05-01/virtualwans/model_inboundnatrule.go deleted file mode 100644 index eee8ea195cf..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 17b64e3d468..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_ipconfiguration.go deleted file mode 100644 index 1241b6c2c3e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index fbaabbf7c1b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofile.go deleted file mode 100644 index a710fe9c7f0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 6b808468c3d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 58c575ad69f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_ipsecpolicy.go b/resource-manager/network/2023-05-01/virtualwans/model_ipsecpolicy.go deleted file mode 100644 index 02267e6b24d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_iptag.go b/resource-manager/network/2023-05-01/virtualwans/model_iptag.go deleted file mode 100644 index de05365d519..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// 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/network/2023-05-01/virtualwans/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddress.go deleted file mode 100644 index 37820fb13bd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 3f6629b67eb..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_natgateway.go b/resource-manager/network/2023-05-01/virtualwans/model_natgateway.go deleted file mode 100644 index 7e1a4539e08..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualwans - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7f5732e1cc0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_natgatewaysku.go b/resource-manager/network/2023-05-01/virtualwans/model_natgatewaysku.go deleted file mode 100644 index 4cd49e069a9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_natruleportmapping.go b/resource-manager/network/2023-05-01/virtualwans/model_natruleportmapping.go deleted file mode 100644 index 2ce8b302da3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterface.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterface.go deleted file mode 100644 index b6b5bf73332..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacednssettings.go deleted file mode 100644 index d0dcb411a3e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 5c0d1edc7ad..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 9ed5a87eb91..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 53b62677571..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacepropertiesformat.go deleted file mode 100644 index eb6875aa05e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfiguration.go deleted file mode 100644 index d12531c2798..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 70fb9b73ddb..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/virtualwans/model_networksecuritygroup.go deleted file mode 100644 index c941605df94..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 54526eb4ea0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_o365breakoutcategorypolicies.go b/resource-manager/network/2023-05-01/virtualwans/model_o365breakoutcategorypolicies.go deleted file mode 100644 index 0a9ed71a50b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_o365breakoutcategorypolicies.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365BreakOutCategoryPolicies struct { - Allow *bool `json:"allow,omitempty"` - Default *bool `json:"default,omitempty"` - Optimize *bool `json:"optimize,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_o365policyproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_o365policyproperties.go deleted file mode 100644 index eeae991ee3f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_o365policyproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365PolicyProperties struct { - BreakOutCategories *O365BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfiguration.go deleted file mode 100644 index 08a6a452843..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfigurationproperties.go deleted file mode 100644 index a5558cf1e48..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_p2sconnectionconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfigurationProperties struct { - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_p2svpngateway.go b/resource-manager/network/2023-05-01/virtualwans/model_p2svpngateway.go deleted file mode 100644 index 25f63025e39..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_p2svpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SVpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_p2svpngatewayproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_p2svpngatewayproperties.go deleted file mode 100644 index d337b304bbd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_p2svpngatewayproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGatewayProperties struct { - CustomDnsServers *[]string `json:"customDnsServers,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_parameter.go b/resource-manager/network/2023-05-01/virtualwans/model_parameter.go deleted file mode 100644 index d1619c1138c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_parameter.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Parameter struct { - AsPath *[]string `json:"asPath,omitempty"` - Community *[]string `json:"community,omitempty"` - RoutePrefix *[]string `json:"routePrefix,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_peerroute.go b/resource-manager/network/2023-05-01/virtualwans/model_peerroute.go deleted file mode 100644 index c03bdbe8722..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_peerroute.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerRoute struct { - AsPath *string `json:"asPath,omitempty"` - LocalAddress *string `json:"localAddress,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Origin *string `json:"origin,omitempty"` - SourcePeer *string `json:"sourcePeer,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privateendpoint.go b/resource-manager/network/2023-05-01/virtualwans/model_privateendpoint.go deleted file mode 100644 index d493c3ed57a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnection.go deleted file mode 100644 index 191623acf98..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/virtualwans/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnectionproperties.go deleted file mode 100644 index f54855d1288..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfiguration.go deleted file mode 100644 index 053d067b685..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index d6794440033..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_privateendpointproperties.go deleted file mode 100644 index 3af5e8a64e0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkservice.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkservice.go deleted file mode 100644 index 79f0f888953..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnection.go deleted file mode 100644 index b584feab35a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 5875bd90e15..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index c1664caec07..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 3558cb8095c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 31251b67685..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceproperties.go deleted file mode 100644 index 286611e0560..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_propagatedroutetable.go b/resource-manager/network/2023-05-01/virtualwans/model_propagatedroutetable.go deleted file mode 100644 index af45ddbedf1..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddress.go b/resource-manager/network/2023-05-01/virtualwans/model_publicipaddress.go deleted file mode 100644 index 8bd2fa402a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/virtualwans/model_publicipaddressdnssettings.go deleted file mode 100644 index 2a95851cb0c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 48fecb8ae90..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/virtualwans/model_publicipaddresssku.go deleted file mode 100644 index 4fcf5fb0e8f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_radiusserver.go b/resource-manager/network/2023-05-01/virtualwans/model_radiusserver.go deleted file mode 100644 index 858a67625c9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlink.go deleted file mode 100644 index b0d119588a3..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlinkformat.go deleted file mode 100644 index 9443c31d227..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_resourceset.go b/resource-manager/network/2023-05-01/virtualwans/model_resourceset.go deleted file mode 100644 index f8d5a3c0775..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_retentionpolicyparameters.go deleted file mode 100644 index 57394822b9d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_route.go b/resource-manager/network/2023-05-01/virtualwans/model_route.go deleted file mode 100644 index 5ae4b7a4ff8..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routemap.go b/resource-manager/network/2023-05-01/virtualwans/model_routemap.go deleted file mode 100644 index 6c5941f5a4c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routemap.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteMap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteMapProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routemapproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_routemapproperties.go deleted file mode 100644 index a4a019429ff..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routemapproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteMapProperties struct { - AssociatedInboundConnections *[]string `json:"associatedInboundConnections,omitempty"` - AssociatedOutboundConnections *[]string `json:"associatedOutboundConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]RouteMapRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routemaprule.go b/resource-manager/network/2023-05-01/virtualwans/model_routemaprule.go deleted file mode 100644 index cdeacc9a78b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routemaprule.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteMapRule struct { - Actions *[]Action `json:"actions,omitempty"` - MatchCriteria *[]Criterion `json:"matchCriteria,omitempty"` - Name *string `json:"name,omitempty"` - NextStepIfMatched *NextStep `json:"nextStepIfMatched,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_routepropertiesformat.go deleted file mode 100644 index 51259038175..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routetable.go b/resource-manager/network/2023-05-01/virtualwans/model_routetable.go deleted file mode 100644 index 76a72a637be..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_routetablepropertiesformat.go deleted file mode 100644 index 9a5454526a4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routingconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_routingconfiguration.go deleted file mode 100644 index f4ca0018afa..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routingintent.go b/resource-manager/network/2023-05-01/virtualwans/model_routingintent.go deleted file mode 100644 index 537f1404f3d..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routingintent.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingIntent struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutingIntentProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routingintentproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_routingintentproperties.go deleted file mode 100644 index 38a3b8e4147..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routingintentproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingIntentProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingPolicies *[]RoutingPolicy `json:"routingPolicies,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_routingpolicy.go b/resource-manager/network/2023-05-01/virtualwans/model_routingpolicy.go deleted file mode 100644 index cef221dbd58..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_routingpolicy.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingPolicy struct { - Destinations []string `json:"destinations"` - Name string `json:"name"` - NextHop string `json:"nextHop"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_securityrule.go b/resource-manager/network/2023-05-01/virtualwans/model_securityrule.go deleted file mode 100644 index 72e68599476..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_securityrulepropertiesformat.go deleted file mode 100644 index 547a37a71ce..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlink.go deleted file mode 100644 index 0b2b5927b19..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 1aa80542228..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_servicedelegationpropertiesformat.go deleted file mode 100644 index aaeb340b2c7..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicy.go deleted file mode 100644 index 62b85e18cbf..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 886de873aea..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 433a85d2006..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 6c09399b151..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 115ecdfed06..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_staticroute.go b/resource-manager/network/2023-05-01/virtualwans/model_staticroute.go deleted file mode 100644 index c57fdb00cea..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_staticroutesconfig.go b/resource-manager/network/2023-05-01/virtualwans/model_staticroutesconfig.go deleted file mode 100644 index c286d119b66..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_subnet.go b/resource-manager/network/2023-05-01/virtualwans/model_subnet.go deleted file mode 100644 index ecdd88e0207..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_subnetpropertiesformat.go deleted file mode 100644 index 781adec66f6..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_subresource.go b/resource-manager/network/2023-05-01/virtualwans/model_subresource.go deleted file mode 100644 index 9c238c85dff..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_tagsobject.go b/resource-manager/network/2023-05-01/virtualwans/model_tagsobject.go deleted file mode 100644 index 1f55b0e7a00..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// 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/network/2023-05-01/virtualwans/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 1e6b8ac8e23..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsproperties.go deleted file mode 100644 index 56d6e09676b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_trafficselectorpolicy.go b/resource-manager/network/2023-05-01/virtualwans/model_trafficselectorpolicy.go deleted file mode 100644 index 09496a292fa..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhub.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhub.go deleted file mode 100644 index 732daa9aecc..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhub.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHub struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualHubProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroute.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroute.go deleted file mode 100644 index d46894da2a8..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroute.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubEffectiveRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - AsPath *string `json:"asPath,omitempty"` - NextHopType *string `json:"nextHopType,omitempty"` - NextHops *[]string `json:"nextHops,omitempty"` - RouteOrigin *string `json:"routeOrigin,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroutelist.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroutelist.go deleted file mode 100644 index 3ea5b7b15e4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubeffectiveroutelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubEffectiveRouteList struct { - Value *[]VirtualHubEffectiveRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubproperties.go deleted file mode 100644 index 9b119e8889f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubproperties.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubProperties struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - AzureFirewall *SubResource `json:"azureFirewall,omitempty"` - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - ExpressRouteGateway *SubResource `json:"expressRouteGateway,omitempty"` - HubRoutingPreference *HubRoutingPreference `json:"hubRoutingPreference,omitempty"` - IPConfigurations *[]SubResource `json:"ipConfigurations,omitempty"` - P2SVpnGateway *SubResource `json:"p2SVpnGateway,omitempty"` - PreferredRoutingGateway *PreferredRoutingGateway `json:"preferredRoutingGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteMaps *[]SubResource `json:"routeMaps,omitempty"` - RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"` - RoutingState *RoutingState `json:"routingState,omitempty"` - SecurityPartnerProvider *SubResource `json:"securityPartnerProvider,omitempty"` - SecurityProviderName *string `json:"securityProviderName,omitempty"` - Sku *string `json:"sku,omitempty"` - VirtualHubRouteTableV2s *[]VirtualHubRouteTableV2 `json:"virtualHubRouteTableV2s,omitempty"` - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - VirtualRouterAutoScaleConfiguration *VirtualRouterAutoScaleConfiguration `json:"virtualRouterAutoScaleConfiguration,omitempty"` - VirtualRouterIPs *[]string `json:"virtualRouterIps,omitempty"` - VirtualWAN *SubResource `json:"virtualWan,omitempty"` - VpnGateway *SubResource `json:"vpnGateway,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroute.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroute.go deleted file mode 100644 index 3b9b205ea1a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroute.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetable.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetable.go deleted file mode 100644 index 71ec2c0bca4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetable.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteTable struct { - Routes *[]VirtualHubRoute `json:"routes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2.go deleted file mode 100644 index 50fa84c35f5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteTableV2 struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualHubRouteTableV2Properties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2properties.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2properties.go deleted file mode 100644 index ed869d1c471..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutetablev2properties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteTableV2Properties struct { - AttachedConnections *[]string `json:"attachedConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Routes *[]VirtualHubRouteV2 `json:"routes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutev2.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutev2.go deleted file mode 100644 index a47739aa2a5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualhubroutev2.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteV2 struct { - DestinationType *string `json:"destinationType,omitempty"` - Destinations *[]string `json:"destinations,omitempty"` - NextHopType *string `json:"nextHopType,omitempty"` - NextHops *[]string `json:"nextHops,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktap.go deleted file mode 100644 index f7d80351ab5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index efca5566dad..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualrouterautoscaleconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualrouterautoscaleconfiguration.go deleted file mode 100644 index 4ce6be45420..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualrouterautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterAutoScaleConfiguration struct { - MinCapacity *int64 `json:"minCapacity,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualwan.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualwan.go deleted file mode 100644 index 45691c81b74..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualwan.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWAN struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualWanProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualwanproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualwanproperties.go deleted file mode 100644 index 65c2eb829cb..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualwanproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanProperties struct { - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` - DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"` - Office365LocalBreakoutCategory *OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *string `json:"type,omitempty"` - VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"` - VpnSites *[]SubResource `json:"vpnSites,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityprovider.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityprovider.go deleted file mode 100644 index d41346bc4a9..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityprovider.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanSecurityProvider struct { - Name *string `json:"name,omitempty"` - Type *VirtualWanSecurityProviderType `json:"type,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityproviders.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityproviders.go deleted file mode 100644 index 6e7e4ab59f8..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualwansecurityproviders.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanSecurityProviders struct { - SupportedProviders *[]VirtualWanSecurityProvider `json:"supportedProviders,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_virtualwanvpnprofileparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_virtualwanvpnprofileparameters.go deleted file mode 100644 index dd01888d247..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_virtualwanvpnprofileparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanVpnProfileParameters struct { - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` - VpnServerConfigurationResourceId *string `json:"vpnServerConfigurationResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vnetroute.go b/resource-manager/network/2023-05-01/virtualwans/model_vnetroute.go deleted file mode 100644 index cbd035f3e06..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnclientconnectionhealth.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnclientconnectionhealth.go deleted file mode 100644 index 82eefc44a41..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnclientconnectionhealth.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealth struct { - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - VpnClientConnectionsCount *int64 `json:"vpnClientConnectionsCount,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnection.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnconnection.go deleted file mode 100644 index 9d157042c70..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go deleted file mode 100644 index 97a9e565f9e..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` - LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go deleted file mode 100644 index de501375c21..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionPacketCaptureStopParameters struct { - LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionproperties.go deleted file mode 100644 index 1c238229449..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnconnectionproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - DpdTimeoutSeconds *int64 `json:"dpdTimeoutSeconds,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpngateway.go b/resource-manager/network/2023-05-01/virtualwans/model_vpngateway.go deleted file mode 100644 index 0c0f9dab77f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewayipconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_vpngatewayipconfiguration.go deleted file mode 100644 index b1060397ea0..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewayipconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayIPConfiguration struct { - Id *string `json:"id,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatrule.go b/resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatrule.go deleted file mode 100644 index 2de41b7ced6..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatruleproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatruleproperties.go deleted file mode 100644 index 1aaf7c8f90b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewaynatruleproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRuleProperties struct { - EgressVpnSiteLinkConnections *[]SubResource `json:"egressVpnSiteLinkConnections,omitempty"` - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - IngressVpnSiteLinkConnections *[]SubResource `json:"ingressVpnSiteLinkConnections,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewayproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpngatewayproperties.go deleted file mode 100644 index ab2b8b55b1b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpngatewayproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayProperties struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Connections *[]VpnConnection `json:"connections,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - NatRules *[]VpnGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnlinkbgpsettings.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnlinkbgpsettings.go deleted file mode 100644 index 72de7d65308..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnlinkbgpsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkBgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnlinkproviderproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnlinkproviderproperties.go deleted file mode 100644 index 555f8739a9b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnlinkproviderproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkProviderProperties struct { - LinkProviderName *string `json:"linkProviderName,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnnatrulemapping.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnnatrulemapping.go deleted file mode 100644 index 09a77912d9f..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnprofileresponse.go deleted file mode 100644 index a96c942841c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnprofileresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go deleted file mode 100644 index 21a75789b34..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusClientRootCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go deleted file mode 100644 index 6f67a020c6a..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusServerRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfiguration.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfiguration.go deleted file mode 100644 index debdcf03f04..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroup.go deleted file mode 100644 index e94549fb063..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go deleted file mode 100644 index f832688900b..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go deleted file mode 100644 index 93b015d4bd1..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupProperties struct { - IsDefault *bool `json:"isDefault,omitempty"` - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationproperties.go deleted file mode 100644 index 1a42b30f7aa..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationproperties.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationProperties struct { - AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - ConfigurationPolicyGroups *[]VpnServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - P2sVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationsresponse.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationsresponse.go deleted file mode 100644 index 185d5a549d4..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigurationsresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationsResponse struct { - VpnServerConfigurationResourceIds *[]string `json:"vpnServerConfigurationResourceIds,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go deleted file mode 100644 index 9582df932b5..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRevokedCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go deleted file mode 100644 index 606a8393665..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnsite.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnsite.go deleted file mode 100644 index 7c6dacaed50..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnsite.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSite struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelink.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelink.go deleted file mode 100644 index 9c72c0567fd..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnection.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnection.go deleted file mode 100644 index 88bed41fe65..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnectionproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnectionproperties.go deleted file mode 100644 index 23b24922441..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkconnectionproperties.go +++ /dev/null @@ -1,25 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnGatewayCustomBgpAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` - VpnLinkConnectionMode *VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` - VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkproperties.go deleted file mode 100644 index fa7d9002a52..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnsitelinkproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkProperties struct { - BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/model_vpnsiteproperties.go b/resource-manager/network/2023-05-01/virtualwans/model_vpnsiteproperties.go deleted file mode 100644 index da368da2045..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/model_vpnsiteproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteProperties struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - O365Policy *O365PolicyProperties `json:"o365Policy,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SiteKey *string `json:"siteKey,omitempty"` - VirtualWAN *SubResource `json:"virtualWan,omitempty"` - VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/virtualwans/predicates.go b/resource-manager/network/2023-05-01/virtualwans/predicates.go deleted file mode 100644 index ac1a0c34d1c..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/predicates.go +++ /dev/null @@ -1,528 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BgpConnectionOperationPredicate) Matches(input BgpConnection) 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.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 HubIPConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p HubIPConfigurationOperationPredicate) Matches(input HubIPConfiguration) 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.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 HubRouteTableOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p HubRouteTableOperationPredicate) Matches(input HubRouteTable) 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.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 HubVirtualNetworkConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p HubVirtualNetworkConnectionOperationPredicate) Matches(input HubVirtualNetworkConnection) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type P2SVpnGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p P2SVpnGatewayOperationPredicate) Matches(input P2SVpnGateway) 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 && (input.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 RouteMapOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RouteMapOperationPredicate) Matches(input RouteMap) 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.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 RoutingIntentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RoutingIntentOperationPredicate) Matches(input RoutingIntent) 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.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 VirtualHubOperationPredicate struct { - Etag *string - Id *string - Kind *string - Location *string - Name *string - Type *string -} - -func (p VirtualHubOperationPredicate) Matches(input VirtualHub) 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.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { - return false - } - - if p.Location != nil && (input.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 VirtualHubRouteTableV2OperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p VirtualHubRouteTableV2OperationPredicate) Matches(input VirtualHubRouteTableV2) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type VirtualWANOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualWANOperationPredicate) Matches(input VirtualWAN) 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 && (input.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 VpnConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p VpnConnectionOperationPredicate) Matches(input VpnConnection) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type VpnGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VpnGatewayOperationPredicate) Matches(input VpnGateway) 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 && (input.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 VpnGatewayNatRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnGatewayNatRuleOperationPredicate) Matches(input VpnGatewayNatRule) 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.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 VpnServerConfigurationOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VpnServerConfigurationOperationPredicate) Matches(input VpnServerConfiguration) 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 && (input.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 VpnServerConfigurationPolicyGroupOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnServerConfigurationPolicyGroupOperationPredicate) Matches(input VpnServerConfigurationPolicyGroup) 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.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 VpnSiteOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VpnSiteOperationPredicate) Matches(input VpnSite) 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 && (input.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 VpnSiteLinkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnSiteLinkOperationPredicate) Matches(input VpnSiteLink) 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.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 VpnSiteLinkConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnSiteLinkConnectionOperationPredicate) Matches(input VpnSiteLinkConnection) 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.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/network/2023-05-01/virtualwans/version.go b/resource-manager/network/2023-05-01/virtualwans/version.go deleted file mode 100644 index 4946f253875..00000000000 --- a/resource-manager/network/2023-05-01/virtualwans/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualwans/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/README.md b/resource-manager/network/2023-05-01/vmsspublicipaddresses/README.md deleted file mode 100644 index e37ff50f385..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/README.md +++ /dev/null @@ -1,71 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vmsspublicipaddresses` Documentation - -The `vmsspublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/vmsspublicipaddresses" -``` - - -### Client Initialization - -```go -client := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") - -read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses` - -```go -ctx := context.TODO() -id := vmsspublicipaddresses.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - -// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") - -// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/client.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/client.go deleted file mode 100644 index 3213cbf73fe..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vmsspublicipaddresses - -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 VMSSPublicIPAddressesClient struct { - Client *resourcemanager.Client -} - -func NewVMSSPublicIPAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*VMSSPublicIPAddressesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vmsspublicipaddresses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VMSSPublicIPAddressesClient: %+v", err) - } - - return &VMSSPublicIPAddressesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/constants.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/constants.go deleted file mode 100644 index c753c0f93e2..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package vmsspublicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset.go deleted file mode 100644 index 6907f32662f..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset.go +++ /dev/null @@ -1,130 +0,0 @@ -package vmsspublicipaddresses - -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(&VirtualMachineScaleSetId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineScaleSetId{} - -// VirtualMachineScaleSetId is a struct representing the Resource ID for a Virtual Machine Scale Set -type VirtualMachineScaleSetId struct { - SubscriptionId string - ResourceGroupName string - VirtualMachineScaleSetName string -} - -// NewVirtualMachineScaleSetID returns a new VirtualMachineScaleSetId struct -func NewVirtualMachineScaleSetID(subscriptionId string, resourceGroupName string, virtualMachineScaleSetName string) VirtualMachineScaleSetId { - return VirtualMachineScaleSetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualMachineScaleSetName: virtualMachineScaleSetName, - } -} - -// ParseVirtualMachineScaleSetID parses 'input' into a VirtualMachineScaleSetId -func ParseVirtualMachineScaleSetID(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineScaleSetIDInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineScaleSetIDInsensitively(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineScaleSetId) 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.VirtualMachineScaleSetName, ok = input.Parsed["virtualMachineScaleSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineScaleSetName", input) - } - - return nil -} - -// ValidateVirtualMachineScaleSetID checks that 'input' can be parsed as a Virtual Machine Scale Set ID -func ValidateVirtualMachineScaleSetID(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 := ParseVirtualMachineScaleSetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineScaleSetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), - } -} - -// String returns a human-readable description of this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), - } - return fmt.Sprintf("Virtual Machine Scale Set (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go deleted file mode 100644 index d4e158c8f74..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vmsspublicipaddresses - -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 = &VirtualMachineScaleSetId{} - -func TestNewVirtualMachineScaleSetID(t *testing.T) { - id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - - 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.VirtualMachineScaleSetName != "virtualMachineScaleSetValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetValue") - } -} - -func TestFormatVirtualMachineScaleSetID(t *testing.T) { - actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineScaleSetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetID(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestParseVirtualMachineScaleSetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTvAlUe", - }, - }, - { - // 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.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetIDInsensitively(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestSegmentsForVirtualMachineScaleSetId(t *testing.T) { - segments := VirtualMachineScaleSetId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineScaleSetId 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/network/2023-05-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go deleted file mode 100644 index f1a1235a8e2..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go +++ /dev/null @@ -1,84 +0,0 @@ -package vmsspublicipaddresses - -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 PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -type PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions struct { - Expand *string -} - -func DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions() PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions { - return PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions{} -} - -func (o PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress ... -func (c VMSSPublicIPAddressesClient) PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, id commonids.VirtualMachineScaleSetPublicIPAddressId, options PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) (result PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go deleted file mode 100644 index 188c41b7573..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go +++ /dev/null @@ -1,91 +0,0 @@ -package vmsspublicipaddresses - -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 PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses ... -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx context.Context, id VirtualMachineScaleSetId) (result PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete retrieves all the results into a single object -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete(ctx context.Context, id VirtualMachineScaleSetId) (PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id VirtualMachineScaleSetId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go deleted file mode 100644 index 28037a7bb0b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go +++ /dev/null @@ -1,92 +0,0 @@ -package vmsspublicipaddresses - -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 PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses ... -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId) (result PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete retrieves all the results into a single object -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId) (PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b5e5db2cc91..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index a08e1bc2b3d..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index a1c62d3aff0..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 29707ea0cc0..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 3d43bc376d7..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygroup.go deleted file mode 100644 index 3886b3a62a9..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 2f9f71ffdfe..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspool.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspool.go deleted file mode 100644 index 2d91da68e06..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index da2c343dcde..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 409dfc74f46..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ddossettings.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ddossettings.go deleted file mode 100644 index 9db9902cfa2..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_delegation.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_delegation.go deleted file mode 100644 index a81e856e7ea..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlog.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlog.go deleted file mode 100644 index b816a9fb4d8..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogformatparameters.go deleted file mode 100644 index bbe90b3e68a..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go deleted file mode 100644 index 4dc53318cc3..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfiguration.go deleted file mode 100644 index e9d4835cde7..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package vmsspublicipaddresses - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 158c303f1eb..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index a997e703d5a..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrule.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrule.go deleted file mode 100644 index 8d6d17e1ee6..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 0400f6c7e24..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfiguration.go deleted file mode 100644 index ec14aaebfb2..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofile.go deleted file mode 100644 index 04f420bc9e7..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index cc1b778ec31..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 5c56fd40bae..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_iptag.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_iptag.go deleted file mode 100644 index 0f545f4b72b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// 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/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go deleted file mode 100644 index 6c1a542cb79..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 046c6088344..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgateway.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgateway.go deleted file mode 100644 index d11b8d3920d..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package vmsspublicipaddresses - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go deleted file mode 100644 index 9b3d069fdba..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaysku.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaysku.go deleted file mode 100644 index 3b91a6c98fb..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natruleportmapping.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natruleportmapping.go deleted file mode 100644 index 09ace168bf2..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterface.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterface.go deleted file mode 100644 index e494f13e660..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacednssettings.go deleted file mode 100644 index 178cb8cc8d0..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 5e15e82902b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 5b63a7f1427..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index a34194f603c..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 67403077a5f..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 89d8808f2b8..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index dd5cb5650a9..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygroup.go deleted file mode 100644 index 390dad55504..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index fd1b9110f0b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpoint.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpoint.go deleted file mode 100644 index 9d1b5059d51..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnection.go deleted file mode 100644 index 37a23931c51..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index edd52323b43..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go deleted file mode 100644 index 7e43ad06e3b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 13d66a23bb9..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointproperties.go deleted file mode 100644 index 9d7c5581f99..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkservice.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkservice.go deleted file mode 100644 index 35696ff7af8..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go deleted file mode 100644 index 15a277940b8..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 36505cb0e91..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 87693646750..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index ffcb7babff1..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 1ac62f6b573..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go deleted file mode 100644 index 5a3793b3967..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddress.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddress.go deleted file mode 100644 index 007f38c15a0..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 5c5c8e381d5..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 04e2f5851e5..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresssku.go deleted file mode 100644 index 836d26bc7cf..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlink.go deleted file mode 100644 index 2001bb2021a..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go deleted file mode 100644 index 255ed3f4d7d..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourceset.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourceset.go deleted file mode 100644 index aa795989827..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_retentionpolicyparameters.go deleted file mode 100644 index 18486b1b930..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_route.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_route.go deleted file mode 100644 index d5542b4d6a2..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routepropertiesformat.go deleted file mode 100644 index 7306e155bd1..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetable.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetable.go deleted file mode 100644 index 0e623eb4de8..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetablepropertiesformat.go deleted file mode 100644 index 247f8d8ff0b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrule.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrule.go deleted file mode 100644 index be3c680f597..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index 45a25e92fa7..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlink.go deleted file mode 100644 index 6e209a0a72c..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 7761fb2f5e9..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 0ce0853975d..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicy.go deleted file mode 100644 index 32e2b036118..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go deleted file mode 100644 index d0368e894a0..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 970c54c6772..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index fd6dca6bdb5..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5857cb159be..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnet.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnet.go deleted file mode 100644 index fd72bf01d45..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index 5f2e9b1a613..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subresource.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subresource.go deleted file mode 100644 index c4627dc0146..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 9685e4269c8..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go deleted file mode 100644 index e18abbc1afe..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktap.go deleted file mode 100644 index 80ebd9f850d..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index cff477ca81b..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vmsspublicipaddresses/predicates.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/predicates.go deleted file mode 100644 index 3173ab41a32..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPAddressOperationPredicate) Matches(input PublicIPAddress) 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 && (input.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/network/2023-05-01/vmsspublicipaddresses/version.go b/resource-manager/network/2023-05-01/vmsspublicipaddresses/version.go deleted file mode 100644 index 3d9df8157d1..00000000000 --- a/resource-manager/network/2023-05-01/vmsspublicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vmsspublicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/vpngateways/README.md b/resource-manager/network/2023-05-01/vpngateways/README.md deleted file mode 100644 index fad5f2af92d..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpngateways` Documentation - -The `vpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/vpngateways" -``` - - -### Client Initialization - -```go -client := vpngateways.NewVpnGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-05-01/vpngateways/client.go b/resource-manager/network/2023-05-01/vpngateways/client.go deleted file mode 100644 index 5679554f1a5..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpngateways - -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 VpnGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewVpnGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpngateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnGatewaysClient: %+v", err) - } - - return &VpnGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/vpngateways/constants.go b/resource-manager/network/2023-05-01/vpngateways/constants.go deleted file mode 100644 index 2f1745c4980..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/constants.go +++ /dev/null @@ -1,657 +0,0 @@ -package vpngateways - -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 DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnConnectionStatus string - -const ( - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -func PossibleValuesForVpnConnectionStatus() []string { - return []string{ - string(VpnConnectionStatusConnected), - string(VpnConnectionStatusConnecting), - string(VpnConnectionStatusNotConnected), - string(VpnConnectionStatusUnknown), - } -} - -func (s *VpnConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnConnectionStatus(input string) (*VpnConnectionStatus, error) { - vals := map[string]VpnConnectionStatus{ - "connected": VpnConnectionStatusConnected, - "connecting": VpnConnectionStatusConnecting, - "notconnected": VpnConnectionStatusNotConnected, - "unknown": VpnConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnConnectionStatus(input) - return &out, nil -} - -type VpnLinkConnectionMode string - -const ( - VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" - VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" - VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVpnLinkConnectionMode() []string { - return []string{ - string(VpnLinkConnectionModeDefault), - string(VpnLinkConnectionModeInitiatorOnly), - string(VpnLinkConnectionModeResponderOnly), - } -} - -func (s *VpnLinkConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnLinkConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnLinkConnectionMode(input string) (*VpnLinkConnectionMode, error) { - vals := map[string]VpnLinkConnectionMode{ - "default": VpnLinkConnectionModeDefault, - "initiatoronly": VpnLinkConnectionModeInitiatorOnly, - "responderonly": VpnLinkConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnLinkConnectionMode(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/vpngateways/id_vpngateway.go b/resource-manager/network/2023-05-01/vpngateways/id_vpngateway.go deleted file mode 100644 index 4a48b9a7916..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/id_vpngateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package vpngateways - -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(&VpnGatewayId{}) -} - -var _ resourceids.ResourceId = &VpnGatewayId{} - -// VpnGatewayId is a struct representing the Resource ID for a Vpn Gateway -type VpnGatewayId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string -} - -// NewVpnGatewayID returns a new VpnGatewayId struct -func NewVpnGatewayID(subscriptionId string, resourceGroupName string, vpnGatewayName string) VpnGatewayId { - return VpnGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - } -} - -// ParseVpnGatewayID parses 'input' into a VpnGatewayId -func ParseVpnGatewayID(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnGatewayIDInsensitively parses 'input' case-insensitively into a VpnGatewayId -// note: this method should only be used for API response data and not user input -func ParseVpnGatewayIDInsensitively(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnGatewayId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - return nil -} - -// ValidateVpnGatewayID checks that 'input' can be parsed as a Vpn Gateway ID -func ValidateVpnGatewayID(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 := ParseVpnGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Gateway ID -func (id VpnGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Gateway ID -func (id VpnGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - } -} - -// String returns a human-readable description of this Vpn Gateway ID -func (id VpnGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - } - return fmt.Sprintf("Vpn Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2023-05-01/vpngateways/id_vpngateway_test.go deleted file mode 100644 index 56adaca8584..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/id_vpngateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vpngateways - -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 = &VpnGatewayId{} - -func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } -} - -func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestParseVpnGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestSegmentsForVpnGatewayId(t *testing.T) { - segments := VpnGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnGatewayId 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/network/2023-05-01/vpngateways/method_reset.go b/resource-manager/network/2023-05-01/vpngateways/method_reset.go deleted file mode 100644 index ca8defc383b..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/method_reset.go +++ /dev/null @@ -1,99 +0,0 @@ -package vpngateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -type ResetOperationOptions struct { - IPConfigurationId *string -} - -func DefaultResetOperationOptions() ResetOperationOptions { - return ResetOperationOptions{} -} - -func (o ResetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ResetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ResetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPConfigurationId != nil { - out.Append("ipConfigurationId", fmt.Sprintf("%v", *o.IPConfigurationId)) - } - return &out -} - -// Reset ... -func (c VpnGatewaysClient) Reset(ctx context.Context, id VpnGatewayId, options ResetOperationOptions) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", id.ID()), - OptionsObject: options, - } - - 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c VpnGatewaysClient) ResetThenPoll(ctx context.Context, id VpnGatewayId, options ResetOperationOptions) error { - result, err := c.Reset(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/vpngateways/method_startpacketcapture.go b/resource-manager/network/2023-05-01/vpngateways/method_startpacketcapture.go deleted file mode 100644 index 939a677ec57..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/method_startpacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package vpngateways - -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 StartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StartPacketCapture ... -func (c VpnGatewaysClient) StartPacketCapture(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStartParameters) (result StartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startpacketcapture", 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 -} - -// StartPacketCaptureThenPoll performs StartPacketCapture then polls until it's completed -func (c VpnGatewaysClient) StartPacketCaptureThenPoll(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStartParameters) error { - result, err := c.StartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/vpngateways/method_stoppacketcapture.go b/resource-manager/network/2023-05-01/vpngateways/method_stoppacketcapture.go deleted file mode 100644 index 52d225da3ca..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/method_stoppacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package vpngateways - -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 StopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StopPacketCapture ... -func (c VpnGatewaysClient) StopPacketCapture(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStopParameters) (result StopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stoppacketcapture", 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 -} - -// StopPacketCaptureThenPoll performs StopPacketCapture then polls until it's completed -func (c VpnGatewaysClient) StopPacketCaptureThenPoll(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStopParameters) error { - result, err := c.StopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/vpngateways/method_updatetags.go b/resource-manager/network/2023-05-01/vpngateways/method_updatetags.go deleted file mode 100644 index 9149232ae67..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package vpngateways - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -// UpdateTags ... -func (c VpnGatewaysClient) UpdateTags(ctx context.Context, id VpnGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c VpnGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id VpnGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-05-01/vpngateways/model_bgpsettings.go b/resource-manager/network/2023-05-01/vpngateways/model_bgpsettings.go deleted file mode 100644 index f2627d16bf7..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-05-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 6b30604f2da..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-05-01/vpngateways/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index c3e0e46c541..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_ipsecpolicy.go b/resource-manager/network/2023-05-01/vpngateways/model_ipsecpolicy.go deleted file mode 100644 index 63c4e9184df..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_propagatedroutetable.go b/resource-manager/network/2023-05-01/vpngateways/model_propagatedroutetable.go deleted file mode 100644 index e838e6e2dc7..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_routingconfiguration.go b/resource-manager/network/2023-05-01/vpngateways/model_routingconfiguration.go deleted file mode 100644 index fe2fd37804f..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_staticroute.go b/resource-manager/network/2023-05-01/vpngateways/model_staticroute.go deleted file mode 100644 index 90806109c8c..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_staticroutesconfig.go b/resource-manager/network/2023-05-01/vpngateways/model_staticroutesconfig.go deleted file mode 100644 index b973c853be2..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_subresource.go b/resource-manager/network/2023-05-01/vpngateways/model_subresource.go deleted file mode 100644 index cf0dbcdeb10..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_tagsobject.go b/resource-manager/network/2023-05-01/vpngateways/model_tagsobject.go deleted file mode 100644 index dd09a7e7f34..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// 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/network/2023-05-01/vpngateways/model_trafficselectorpolicy.go b/resource-manager/network/2023-05-01/vpngateways/model_trafficselectorpolicy.go deleted file mode 100644 index b65874d225f..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vnetroute.go b/resource-manager/network/2023-05-01/vpngateways/model_vnetroute.go deleted file mode 100644 index 31f211b1d1d..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpnconnection.go b/resource-manager/network/2023-05-01/vpngateways/model_vpnconnection.go deleted file mode 100644 index a65d73ea9e8..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpnconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpnconnectionproperties.go b/resource-manager/network/2023-05-01/vpngateways/model_vpnconnectionproperties.go deleted file mode 100644 index df2da84d685..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpnconnectionproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - DpdTimeoutSeconds *int64 `json:"dpdTimeoutSeconds,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngateway.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngateway.go deleted file mode 100644 index 8117006b3a9..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewayipconfiguration.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngatewayipconfiguration.go deleted file mode 100644 index 703d0c1d833..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewayipconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayIPConfiguration struct { - Id *string `json:"id,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatrule.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatrule.go deleted file mode 100644 index 833a44f9a3d..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatruleproperties.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatruleproperties.go deleted file mode 100644 index 240415bacef..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaynatruleproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRuleProperties struct { - EgressVpnSiteLinkConnections *[]SubResource `json:"egressVpnSiteLinkConnections,omitempty"` - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - IngressVpnSiteLinkConnections *[]SubResource `json:"ingressVpnSiteLinkConnections,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go deleted file mode 100644 index 4afb62c2a68..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go deleted file mode 100644 index ca9fe7cf71d..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewayproperties.go b/resource-manager/network/2023-05-01/vpngateways/model_vpngatewayproperties.go deleted file mode 100644 index aa5ac3cbf6c..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpngatewayproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayProperties struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Connections *[]VpnConnection `json:"connections,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - NatRules *[]VpnGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpnnatrulemapping.go b/resource-manager/network/2023-05-01/vpngateways/model_vpnnatrulemapping.go deleted file mode 100644 index 3cd7718da11..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnection.go b/resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnection.go deleted file mode 100644 index 874a627b999..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnectionproperties.go b/resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnectionproperties.go deleted file mode 100644 index fc23bd1f279..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/model_vpnsitelinkconnectionproperties.go +++ /dev/null @@ -1,25 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnGatewayCustomBgpAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` - VpnLinkConnectionMode *VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` - VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpngateways/version.go b/resource-manager/network/2023-05-01/vpngateways/version.go deleted file mode 100644 index 57baae638ce..00000000000 --- a/resource-manager/network/2023-05-01/vpngateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpngateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/vpnlinkconnections/client.go b/resource-manager/network/2023-05-01/vpnlinkconnections/client.go deleted file mode 100644 index 3fbef685129..00000000000 --- a/resource-manager/network/2023-05-01/vpnlinkconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpnlinkconnections - -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 VpnLinkConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewVpnLinkConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnLinkConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpnlinkconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnLinkConnectionsClient: %+v", err) - } - - return &VpnLinkConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection.go deleted file mode 100644 index e1dd95afd3a..00000000000 --- a/resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package vpnlinkconnections - -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(&VpnLinkConnectionId{}) -} - -var _ resourceids.ResourceId = &VpnLinkConnectionId{} - -// VpnLinkConnectionId is a struct representing the Resource ID for a Vpn Link Connection -type VpnLinkConnectionId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string - VpnConnectionName string - VpnLinkConnectionName string -} - -// NewVpnLinkConnectionID returns a new VpnLinkConnectionId struct -func NewVpnLinkConnectionID(subscriptionId string, resourceGroupName string, vpnGatewayName string, vpnConnectionName string, vpnLinkConnectionName string) VpnLinkConnectionId { - return VpnLinkConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - VpnConnectionName: vpnConnectionName, - VpnLinkConnectionName: vpnLinkConnectionName, - } -} - -// ParseVpnLinkConnectionID parses 'input' into a VpnLinkConnectionId -func ParseVpnLinkConnectionID(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnLinkConnectionIDInsensitively parses 'input' case-insensitively into a VpnLinkConnectionId -// note: this method should only be used for API response data and not user input -func ParseVpnLinkConnectionIDInsensitively(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnLinkConnectionId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - if id.VpnConnectionName, ok = input.Parsed["vpnConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnConnectionName", input) - } - - if id.VpnLinkConnectionName, ok = input.Parsed["vpnLinkConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnLinkConnectionName", input) - } - - return nil -} - -// ValidateVpnLinkConnectionID checks that 'input' can be parsed as a Vpn Link Connection ID -func ValidateVpnLinkConnectionID(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 := ParseVpnLinkConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Link Connection ID -func (id VpnLinkConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/vpnConnections/%s/vpnLinkConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName, id.VpnConnectionName, id.VpnLinkConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Link Connection ID -func (id VpnLinkConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionValue"), - resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionValue"), - } -} - -// String returns a human-readable description of this Vpn Link Connection ID -func (id VpnLinkConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - fmt.Sprintf("Vpn Connection Name: %q", id.VpnConnectionName), - fmt.Sprintf("Vpn Link Connection Name: %q", id.VpnLinkConnectionName), - } - return fmt.Sprintf("Vpn Link Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection_test.go deleted file mode 100644 index adc8d44297b..00000000000 --- a/resource-manager/network/2023-05-01/vpnlinkconnections/id_vpnlinkconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package vpnlinkconnections - -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 = &VpnLinkConnectionId{} - -func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } - - if id.VpnConnectionName != "vpnConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionValue") - } - - if id.VpnLinkConnectionName != "vpnLinkConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionValue") - } -} - -func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnLinkConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - VpnConnectionName: "vPnCoNnEcTiOnVaLuE", - VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestSegmentsForVpnLinkConnectionId(t *testing.T) { - segments := VpnLinkConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnLinkConnectionId 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/network/2023-05-01/vpnlinkconnections/method_resetconnection.go b/resource-manager/network/2023-05-01/vpnlinkconnections/method_resetconnection.go deleted file mode 100644 index 526963414ea..00000000000 --- a/resource-manager/network/2023-05-01/vpnlinkconnections/method_resetconnection.go +++ /dev/null @@ -1,69 +0,0 @@ -package vpnlinkconnections - -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 ResetConnectionOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetConnection ... -func (c VpnLinkConnectionsClient) ResetConnection(ctx context.Context, id VpnLinkConnectionId) (result ResetConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetconnection", 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 -} - -// ResetConnectionThenPoll performs ResetConnection then polls until it's completed -func (c VpnLinkConnectionsClient) ResetConnectionThenPoll(ctx context.Context, id VpnLinkConnectionId) error { - result, err := c.ResetConnection(ctx, id) - if err != nil { - return fmt.Errorf("performing ResetConnection: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetConnection: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-05-01/vpnlinkconnections/version.go b/resource-manager/network/2023-05-01/vpnlinkconnections/version.go deleted file mode 100644 index f3cf75b7346..00000000000 --- a/resource-manager/network/2023-05-01/vpnlinkconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnlinkconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnlinkconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/README.md b/resource-manager/network/2023-05-01/vpnserverconfigurations/README.md deleted file mode 100644 index 0931763e581..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpnserverconfigurations` Documentation - -The `vpnserverconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/vpnserverconfigurations" -``` - - -### Client Initialization - -```go -client := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnServerConfigurationsClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpnserverconfigurations.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -payload := vpnserverconfigurations.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/network/2023-05-01/vpnserverconfigurations/client.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/client.go deleted file mode 100644 index 6209cc6af8d..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpnserverconfigurations - -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 VpnServerConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewVpnServerConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnServerConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpnserverconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnServerConfigurationsClient: %+v", err) - } - - return &VpnServerConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/constants.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/constants.go deleted file mode 100644 index f297d6e8b17..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/constants.go +++ /dev/null @@ -1,572 +0,0 @@ -package vpnserverconfigurations - -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 DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnGatewayTunnelingProtocol string - -const ( - VpnGatewayTunnelingProtocolIkeVTwo VpnGatewayTunnelingProtocol = "IkeV2" - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -func PossibleValuesForVpnGatewayTunnelingProtocol() []string { - return []string{ - string(VpnGatewayTunnelingProtocolIkeVTwo), - string(VpnGatewayTunnelingProtocolOpenVPN), - } -} - -func (s *VpnGatewayTunnelingProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayTunnelingProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayTunnelingProtocol(input string) (*VpnGatewayTunnelingProtocol, error) { - vals := map[string]VpnGatewayTunnelingProtocol{ - "ikev2": VpnGatewayTunnelingProtocolIkeVTwo, - "openvpn": VpnGatewayTunnelingProtocolOpenVPN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayTunnelingProtocol(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration.go deleted file mode 100644 index 56b67386806..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -package vpnserverconfigurations - -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(&VpnServerConfigurationId{}) -} - -var _ resourceids.ResourceId = &VpnServerConfigurationId{} - -// VpnServerConfigurationId is a struct representing the Resource ID for a Vpn Server Configuration -type VpnServerConfigurationId struct { - SubscriptionId string - ResourceGroupName string - VpnServerConfigurationName string -} - -// NewVpnServerConfigurationID returns a new VpnServerConfigurationId struct -func NewVpnServerConfigurationID(subscriptionId string, resourceGroupName string, vpnServerConfigurationName string) VpnServerConfigurationId { - return VpnServerConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnServerConfigurationName: vpnServerConfigurationName, - } -} - -// ParseVpnServerConfigurationID parses 'input' into a VpnServerConfigurationId -func ParseVpnServerConfigurationID(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnServerConfigurationIDInsensitively parses 'input' case-insensitively into a VpnServerConfigurationId -// note: this method should only be used for API response data and not user input -func ParseVpnServerConfigurationIDInsensitively(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnServerConfigurationId) 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.VpnServerConfigurationName, ok = input.Parsed["vpnServerConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnServerConfigurationName", input) - } - - return nil -} - -// ValidateVpnServerConfigurationID checks that 'input' can be parsed as a Vpn Server Configuration ID -func ValidateVpnServerConfigurationID(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 := ParseVpnServerConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Server Configuration ID -func (id VpnServerConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnServerConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnServerConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Server Configuration ID -func (id VpnServerConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnServerConfigurations", "vpnServerConfigurations", "vpnServerConfigurations"), - resourceids.UserSpecifiedSegment("vpnServerConfigurationName", "vpnServerConfigurationValue"), - } -} - -// String returns a human-readable description of this Vpn Server Configuration ID -func (id VpnServerConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Server Configuration Name: %q", id.VpnServerConfigurationName), - } - return fmt.Sprintf("Vpn Server Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go deleted file mode 100644 index 9a0a657eea1..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vpnserverconfigurations - -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 = &VpnServerConfigurationId{} - -func TestNewVpnServerConfigurationID(t *testing.T) { - id := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - - 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.VpnServerConfigurationName != "vpnServerConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnServerConfigurationName'", id.VpnServerConfigurationName, "vpnServerConfigurationValue") - } -} - -func TestFormatVpnServerConfigurationID(t *testing.T) { - actual := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnServerConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationID(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestParseVpnServerConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnServerConfigurationName: "vPnSeRvErCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationIDInsensitively(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestSegmentsForVpnServerConfigurationId(t *testing.T) { - segments := VpnServerConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnServerConfigurationId 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/network/2023-05-01/vpnserverconfigurations/method_updatetags.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/method_updatetags.go deleted file mode 100644 index 7a675d1584d..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package vpnserverconfigurations - -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 *VpnServerConfiguration -} - -// UpdateTags ... -func (c VpnServerConfigurationsClient) UpdateTags(ctx context.Context, id VpnServerConfigurationId, 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 VpnServerConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_aadauthenticationparameters.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_aadauthenticationparameters.go deleted file mode 100644 index 8751fdb95f4..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_aadauthenticationparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AadAuthenticationParameters struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_addressspace.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_addressspace.go deleted file mode 100644 index 9a83a3bb7bf..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_ipsecpolicy.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_ipsecpolicy.go deleted file mode 100644 index 82c3d0cee04..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go deleted file mode 100644 index a5da2b6e9f5..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go deleted file mode 100644 index 5409c6397bf..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfigurationProperties struct { - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngateway.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngateway.go deleted file mode 100644 index 048301aca56..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SVpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngatewayproperties.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngatewayproperties.go deleted file mode 100644 index fcd2e68d61e..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_p2svpngatewayproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGatewayProperties struct { - CustomDnsServers *[]string `json:"customDnsServers,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_propagatedroutetable.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_propagatedroutetable.go deleted file mode 100644 index d9197431e38..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_radiusserver.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_radiusserver.go deleted file mode 100644 index 0a8e8ea7a2b..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_routingconfiguration.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_routingconfiguration.go deleted file mode 100644 index 418b0d86c12..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroute.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroute.go deleted file mode 100644 index d9a40cf7abe..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroutesconfig.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroutesconfig.go deleted file mode 100644 index 0d9a0db3cfd..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_subresource.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_subresource.go deleted file mode 100644 index b06b768283f..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_tagsobject.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_tagsobject.go deleted file mode 100644 index 73b0464bd7d..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnserverconfigurations - -// 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/network/2023-05-01/vpnserverconfigurations/model_vnetroute.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vnetroute.go deleted file mode 100644 index 26ac1388d05..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go deleted file mode 100644 index f4b6bee5adb..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealth struct { - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - VpnClientConnectionsCount *int64 `json:"vpnClientConnectionsCount,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go deleted file mode 100644 index 32cd3b0c3ce..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusClientRootCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go deleted file mode 100644 index f5a02d320d4..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusServerRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfiguration.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfiguration.go deleted file mode 100644 index 1f8b56984ce..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go deleted file mode 100644 index df7554b1ec5..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go deleted file mode 100644 index 5f72d492483..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go deleted file mode 100644 index d1f956dc56b..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupProperties struct { - IsDefault *bool `json:"isDefault,omitempty"` - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go deleted file mode 100644 index bba2bd56557..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go +++ /dev/null @@ -1,23 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationProperties struct { - AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - ConfigurationPolicyGroups *[]VpnServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - P2sVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go deleted file mode 100644 index b2e7cac735e..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRevokedCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go deleted file mode 100644 index eda4a0c8837..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnserverconfigurations/version.go b/resource-manager/network/2023-05-01/vpnserverconfigurations/version.go deleted file mode 100644 index 8b51b3bac84..00000000000 --- a/resource-manager/network/2023-05-01/vpnserverconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnserverconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/vpnsites/README.md b/resource-manager/network/2023-05-01/vpnsites/README.md deleted file mode 100644 index d873e9945bf..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/vpnsites` Documentation - -The `vpnsites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/vpnsites" -``` - - -### Client Initialization - -```go -client := vpnsites.NewVpnSitesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnSitesClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpnsites.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -payload := vpnsites.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/network/2023-05-01/vpnsites/client.go b/resource-manager/network/2023-05-01/vpnsites/client.go deleted file mode 100644 index 241eb9e94ea..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpnsites - -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 VpnSitesClient struct { - Client *resourcemanager.Client -} - -func NewVpnSitesClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnSitesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpnsites", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnSitesClient: %+v", err) - } - - return &VpnSitesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/vpnsites/constants.go b/resource-manager/network/2023-05-01/vpnsites/constants.go deleted file mode 100644 index 58eca968713..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package vpnsites - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/vpnsites/id_vpnsite.go b/resource-manager/network/2023-05-01/vpnsites/id_vpnsite.go deleted file mode 100644 index 4b42ecf0a1e..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/id_vpnsite.go +++ /dev/null @@ -1,130 +0,0 @@ -package vpnsites - -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(&VpnSiteId{}) -} - -var _ resourceids.ResourceId = &VpnSiteId{} - -// VpnSiteId is a struct representing the Resource ID for a Vpn Site -type VpnSiteId struct { - SubscriptionId string - ResourceGroupName string - VpnSiteName string -} - -// NewVpnSiteID returns a new VpnSiteId struct -func NewVpnSiteID(subscriptionId string, resourceGroupName string, vpnSiteName string) VpnSiteId { - return VpnSiteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnSiteName: vpnSiteName, - } -} - -// ParseVpnSiteID parses 'input' into a VpnSiteId -func ParseVpnSiteID(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnSiteIDInsensitively parses 'input' case-insensitively into a VpnSiteId -// note: this method should only be used for API response data and not user input -func ParseVpnSiteIDInsensitively(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnSiteId) 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.VpnSiteName, ok = input.Parsed["vpnSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteName", input) - } - - return nil -} - -// ValidateVpnSiteID checks that 'input' can be parsed as a Vpn Site ID -func ValidateVpnSiteID(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 := ParseVpnSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Site ID -func (id VpnSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnSiteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Site ID -func (id VpnSiteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnSites", "vpnSites", "vpnSites"), - resourceids.UserSpecifiedSegment("vpnSiteName", "vpnSiteValue"), - } -} - -// String returns a human-readable description of this Vpn Site ID -func (id VpnSiteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Site Name: %q", id.VpnSiteName), - } - return fmt.Sprintf("Vpn Site (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/vpnsites/id_vpnsite_test.go b/resource-manager/network/2023-05-01/vpnsites/id_vpnsite_test.go deleted file mode 100644 index 302b3a6a24a..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/id_vpnsite_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vpnsites - -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 = &VpnSiteId{} - -func TestNewVpnSiteID(t *testing.T) { - id := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - - 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.VpnSiteName != "vpnSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteName'", id.VpnSiteName, "vpnSiteValue") - } -} - -func TestFormatVpnSiteID(t *testing.T) { - actual := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteID(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestParseVpnSiteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnSiteName: "vPnSiTeVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteIDInsensitively(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestSegmentsForVpnSiteId(t *testing.T) { - segments := VpnSiteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnSiteId 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/network/2023-05-01/vpnsites/method_updatetags.go b/resource-manager/network/2023-05-01/vpnsites/method_updatetags.go deleted file mode 100644 index 08341839986..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package vpnsites - -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 *VpnSite -} - -// UpdateTags ... -func (c VpnSitesClient) UpdateTags(ctx context.Context, id VpnSiteId, 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 VpnSite - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_addressspace.go b/resource-manager/network/2023-05-01/vpnsites/model_addressspace.go deleted file mode 100644 index 14ce21bc15a..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_bgpsettings.go b/resource-manager/network/2023-05-01/vpnsites/model_bgpsettings.go deleted file mode 100644 index 09643cee4ab..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_deviceproperties.go b/resource-manager/network/2023-05-01/vpnsites/model_deviceproperties.go deleted file mode 100644 index 6b9a69dd5df..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_deviceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceProperties struct { - DeviceModel *string `json:"deviceModel,omitempty"` - DeviceVendor *string `json:"deviceVendor,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-05-01/vpnsites/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index ce931dc8949..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_o365breakoutcategorypolicies.go b/resource-manager/network/2023-05-01/vpnsites/model_o365breakoutcategorypolicies.go deleted file mode 100644 index 2d1e7f02cf9..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_o365breakoutcategorypolicies.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365BreakOutCategoryPolicies struct { - Allow *bool `json:"allow,omitempty"` - Default *bool `json:"default,omitempty"` - Optimize *bool `json:"optimize,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_o365policyproperties.go b/resource-manager/network/2023-05-01/vpnsites/model_o365policyproperties.go deleted file mode 100644 index 18b5f663387..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_o365policyproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365PolicyProperties struct { - BreakOutCategories *O365BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_subresource.go b/resource-manager/network/2023-05-01/vpnsites/model_subresource.go deleted file mode 100644 index 2b90b3f784d..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_tagsobject.go b/resource-manager/network/2023-05-01/vpnsites/model_tagsobject.go deleted file mode 100644 index c05667ddc1a..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// 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/network/2023-05-01/vpnsites/model_vpnlinkbgpsettings.go b/resource-manager/network/2023-05-01/vpnsites/model_vpnlinkbgpsettings.go deleted file mode 100644 index cae11e9a335..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_vpnlinkbgpsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkBgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_vpnlinkproviderproperties.go b/resource-manager/network/2023-05-01/vpnsites/model_vpnlinkproviderproperties.go deleted file mode 100644 index aa802b7bc05..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_vpnlinkproviderproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkProviderProperties struct { - LinkProviderName *string `json:"linkProviderName,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_vpnsite.go b/resource-manager/network/2023-05-01/vpnsites/model_vpnsite.go deleted file mode 100644 index a7ccb293a6c..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_vpnsite.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSite struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_vpnsitelink.go b/resource-manager/network/2023-05-01/vpnsites/model_vpnsitelink.go deleted file mode 100644 index 0d815e3b164..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_vpnsitelink.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_vpnsitelinkproperties.go b/resource-manager/network/2023-05-01/vpnsites/model_vpnsitelinkproperties.go deleted file mode 100644 index 3d9dedc099d..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_vpnsitelinkproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkProperties struct { - BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/model_vpnsiteproperties.go b/resource-manager/network/2023-05-01/vpnsites/model_vpnsiteproperties.go deleted file mode 100644 index b404c9ab09b..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/model_vpnsiteproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteProperties struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - O365Policy *O365PolicyProperties `json:"o365Policy,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SiteKey *string `json:"siteKey,omitempty"` - VirtualWAN *SubResource `json:"virtualWan,omitempty"` - VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/vpnsites/version.go b/resource-manager/network/2023-05-01/vpnsites/version.go deleted file mode 100644 index 263a81fd8c4..00000000000 --- a/resource-manager/network/2023-05-01/vpnsites/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnsites/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/README.md deleted file mode 100644 index ee1aa4dfb31..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/README.md +++ /dev/null @@ -1,104 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/webapplicationfirewallpolicies` Documentation - -The `webapplicationfirewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/webapplicationfirewallpolicies" -``` - - -### Client Initialization - -```go -client := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebApplicationFirewallPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ - // ... -} - - -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: `WebApplicationFirewallPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `WebApplicationFirewallPoliciesClient.Get` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -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: `WebApplicationFirewallPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `WebApplicationFirewallPoliciesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/client.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/client.go deleted file mode 100644 index ac148c53733..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package webapplicationfirewallpolicies - -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 WebApplicationFirewallPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*WebApplicationFirewallPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "webapplicationfirewallpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WebApplicationFirewallPoliciesClient: %+v", err) - } - - return &WebApplicationFirewallPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/constants.go deleted file mode 100644 index 6fefcb921c2..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/constants.go +++ /dev/null @@ -1,2842 +0,0 @@ -package webapplicationfirewallpolicies - -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 ActionType string - -const ( - ActionTypeAllow ActionType = "Allow" - ActionTypeAnomalyScoring ActionType = "AnomalyScoring" - ActionTypeBlock ActionType = "Block" - ActionTypeLog ActionType = "Log" -) - -func PossibleValuesForActionType() []string { - return []string{ - string(ActionTypeAllow), - string(ActionTypeAnomalyScoring), - string(ActionTypeBlock), - string(ActionTypeLog), - } -} - -func (s *ActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionType(input string) (*ActionType, error) { - vals := map[string]ActionType{ - "allow": ActionTypeAllow, - "anomalyscoring": ActionTypeAnomalyScoring, - "block": ActionTypeBlock, - "log": ActionTypeLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionType(input) - return &out, nil -} - -type ApplicationGatewayClientRevocationOptions string - -const ( - ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" - ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { - return []string{ - string(ApplicationGatewayClientRevocationOptionsNone), - string(ApplicationGatewayClientRevocationOptionsOCSP), - } -} - -func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayClientRevocationOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { - vals := map[string]ApplicationGatewayClientRevocationOptions{ - "none": ApplicationGatewayClientRevocationOptionsNone, - "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayClientRevocationOptions(input) - return &out, nil -} - -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { - return []string{ - string(ApplicationGatewayCookieBasedAffinityDisabled), - string(ApplicationGatewayCookieBasedAffinityEnabled), - } -} - -func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCookieBasedAffinity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { - vals := map[string]ApplicationGatewayCookieBasedAffinity{ - "disabled": ApplicationGatewayCookieBasedAffinityDisabled, - "enabled": ApplicationGatewayCookieBasedAffinityEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCookieBasedAffinity(input) - return &out, nil -} - -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" -) - -func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { - return []string{ - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), - } -} - -func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { - vals := map[string]ApplicationGatewayCustomErrorStatusCode{ - "httpstatus500": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred, - "httpstatus504": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour, - "httpstatus503": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree, - "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, - "httpstatus400": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred, - "httpstatus408": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight, - "httpstatus405": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive, - "httpstatus404": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour, - "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCustomErrorStatusCode(input) - return &out, nil -} - -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -func PossibleValuesForApplicationGatewayFirewallMode() []string { - return []string{ - string(ApplicationGatewayFirewallModeDetection), - string(ApplicationGatewayFirewallModePrevention), - } -} - -func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { - vals := map[string]ApplicationGatewayFirewallMode{ - "detection": ApplicationGatewayFirewallModeDetection, - "prevention": ApplicationGatewayFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallMode(input) - return &out, nil -} - -type ApplicationGatewayFirewallRateLimitDuration string - -const ( - ApplicationGatewayFirewallRateLimitDurationFiveMins ApplicationGatewayFirewallRateLimitDuration = "FiveMins" - ApplicationGatewayFirewallRateLimitDurationOneMin ApplicationGatewayFirewallRateLimitDuration = "OneMin" -) - -func PossibleValuesForApplicationGatewayFirewallRateLimitDuration() []string { - return []string{ - string(ApplicationGatewayFirewallRateLimitDurationFiveMins), - string(ApplicationGatewayFirewallRateLimitDurationOneMin), - } -} - -func (s *ApplicationGatewayFirewallRateLimitDuration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallRateLimitDuration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallRateLimitDuration(input string) (*ApplicationGatewayFirewallRateLimitDuration, error) { - vals := map[string]ApplicationGatewayFirewallRateLimitDuration{ - "fivemins": ApplicationGatewayFirewallRateLimitDurationFiveMins, - "onemin": ApplicationGatewayFirewallRateLimitDurationOneMin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallRateLimitDuration(input) - return &out, nil -} - -type ApplicationGatewayFirewallUserSessionVariable string - -const ( - ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" - ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" - ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" -) - -func PossibleValuesForApplicationGatewayFirewallUserSessionVariable() []string { - return []string{ - string(ApplicationGatewayFirewallUserSessionVariableClientAddr), - string(ApplicationGatewayFirewallUserSessionVariableGeoLocation), - string(ApplicationGatewayFirewallUserSessionVariableNone), - } -} - -func (s *ApplicationGatewayFirewallUserSessionVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallUserSessionVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallUserSessionVariable(input string) (*ApplicationGatewayFirewallUserSessionVariable, error) { - vals := map[string]ApplicationGatewayFirewallUserSessionVariable{ - "clientaddr": ApplicationGatewayFirewallUserSessionVariableClientAddr, - "geolocation": ApplicationGatewayFirewallUserSessionVariableGeoLocation, - "none": ApplicationGatewayFirewallUserSessionVariableNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallUserSessionVariable(input) - return &out, nil -} - -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { - return []string{ - string(ApplicationGatewayLoadDistributionAlgorithmIPHash), - string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), - string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - } -} - -func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { - vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ - "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, - "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayLoadDistributionAlgorithm(input) - return &out, nil -} - -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -func PossibleValuesForApplicationGatewayOperationalState() []string { - return []string{ - string(ApplicationGatewayOperationalStateRunning), - string(ApplicationGatewayOperationalStateStarting), - string(ApplicationGatewayOperationalStateStopped), - string(ApplicationGatewayOperationalStateStopping), - } -} - -func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayOperationalState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { - vals := map[string]ApplicationGatewayOperationalState{ - "running": ApplicationGatewayOperationalStateRunning, - "starting": ApplicationGatewayOperationalStateStarting, - "stopped": ApplicationGatewayOperationalStateStopped, - "stopping": ApplicationGatewayOperationalStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayOperationalState(input) - return &out, nil -} - -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" -) - -func PossibleValuesForApplicationGatewayProtocol() []string { - return []string{ - string(ApplicationGatewayProtocolHTTP), - string(ApplicationGatewayProtocolHTTPS), - string(ApplicationGatewayProtocolTcp), - string(ApplicationGatewayProtocolTls), - } -} - -func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { - vals := map[string]ApplicationGatewayProtocol{ - "http": ApplicationGatewayProtocolHTTP, - "https": ApplicationGatewayProtocolHTTPS, - "tcp": ApplicationGatewayProtocolTcp, - "tls": ApplicationGatewayProtocolTls, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayProtocol(input) - return &out, nil -} - -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -func PossibleValuesForApplicationGatewayRedirectType() []string { - return []string{ - string(ApplicationGatewayRedirectTypeFound), - string(ApplicationGatewayRedirectTypePermanent), - string(ApplicationGatewayRedirectTypeSeeOther), - string(ApplicationGatewayRedirectTypeTemporary), - } -} - -func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRedirectType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { - vals := map[string]ApplicationGatewayRedirectType{ - "found": ApplicationGatewayRedirectTypeFound, - "permanent": ApplicationGatewayRedirectTypePermanent, - "seeother": ApplicationGatewayRedirectTypeSeeOther, - "temporary": ApplicationGatewayRedirectTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRedirectType(input) - return &out, nil -} - -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { - return []string{ - string(ApplicationGatewayRequestRoutingRuleTypeBasic), - string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - } -} - -func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { - vals := map[string]ApplicationGatewayRequestRoutingRuleType{ - "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, - "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRequestRoutingRuleType(input) - return &out, nil -} - -type ApplicationGatewaySkuName string - -const ( - ApplicationGatewaySkuNameBasic ApplicationGatewaySkuName = "Basic" - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" -) - -func PossibleValuesForApplicationGatewaySkuName() []string { - return []string{ - string(ApplicationGatewaySkuNameBasic), - string(ApplicationGatewaySkuNameStandardLarge), - string(ApplicationGatewaySkuNameStandardMedium), - string(ApplicationGatewaySkuNameStandardSmall), - string(ApplicationGatewaySkuNameStandardVTwo), - string(ApplicationGatewaySkuNameWAFLarge), - string(ApplicationGatewaySkuNameWAFMedium), - string(ApplicationGatewaySkuNameWAFVTwo), - } -} - -func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { - vals := map[string]ApplicationGatewaySkuName{ - "basic": ApplicationGatewaySkuNameBasic, - "standard_large": ApplicationGatewaySkuNameStandardLarge, - "standard_medium": ApplicationGatewaySkuNameStandardMedium, - "standard_small": ApplicationGatewaySkuNameStandardSmall, - "standard_v2": ApplicationGatewaySkuNameStandardVTwo, - "waf_large": ApplicationGatewaySkuNameWAFLarge, - "waf_medium": ApplicationGatewaySkuNameWAFMedium, - "waf_v2": ApplicationGatewaySkuNameWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySkuName(input) - return &out, nil -} - -type ApplicationGatewaySslCipherSuite string - -const ( - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -) - -func PossibleValuesForApplicationGatewaySslCipherSuite() []string { - return []string{ - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), - } -} - -func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslCipherSuite(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { - vals := map[string]ApplicationGatewaySslCipherSuite{ - "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, - "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, - "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, - "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, - "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, - "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, - "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslCipherSuite(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyName string - -const ( - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -func PossibleValuesForApplicationGatewaySslPolicyName() []string { - return []string{ - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), - } -} - -func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { - vals := map[string]ApplicationGatewaySslPolicyName{ - "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, - "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, - "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, - "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, - "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyName(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyType string - -const ( - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" -) - -func PossibleValuesForApplicationGatewaySslPolicyType() []string { - return []string{ - string(ApplicationGatewaySslPolicyTypeCustom), - string(ApplicationGatewaySslPolicyTypeCustomVTwo), - string(ApplicationGatewaySslPolicyTypePredefined), - } -} - -func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { - vals := map[string]ApplicationGatewaySslPolicyType{ - "custom": ApplicationGatewaySslPolicyTypeCustom, - "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, - "predefined": ApplicationGatewaySslPolicyTypePredefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyType(input) - return &out, nil -} - -type ApplicationGatewaySslProtocol string - -const ( - ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" - ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" - ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" - ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" -) - -func PossibleValuesForApplicationGatewaySslProtocol() []string { - return []string{ - string(ApplicationGatewaySslProtocolTLSvOneOne), - string(ApplicationGatewaySslProtocolTLSvOneThree), - string(ApplicationGatewaySslProtocolTLSvOneTwo), - string(ApplicationGatewaySslProtocolTLSvOneZero), - } -} - -func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { - vals := map[string]ApplicationGatewaySslProtocol{ - "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, - "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, - "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, - "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslProtocol(input) - return &out, nil -} - -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTier() []string { - return []string{ - string(ApplicationGatewayTierBasic), - string(ApplicationGatewayTierStandard), - string(ApplicationGatewayTierStandardVTwo), - string(ApplicationGatewayTierWAF), - string(ApplicationGatewayTierWAFVTwo), - } -} - -func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { - vals := map[string]ApplicationGatewayTier{ - "basic": ApplicationGatewayTierBasic, - "standard": ApplicationGatewayTierStandard, - "standard_v2": ApplicationGatewayTierStandardVTwo, - "waf": ApplicationGatewayTierWAF, - "waf_v2": ApplicationGatewayTierWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTier(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type ManagedRuleEnabledState string - -const ( - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" - ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" -) - -func PossibleValuesForManagedRuleEnabledState() []string { - return []string{ - string(ManagedRuleEnabledStateDisabled), - string(ManagedRuleEnabledStateEnabled), - } -} - -func (s *ManagedRuleEnabledState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseManagedRuleEnabledState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseManagedRuleEnabledState(input string) (*ManagedRuleEnabledState, error) { - vals := map[string]ManagedRuleEnabledState{ - "disabled": ManagedRuleEnabledStateDisabled, - "enabled": ManagedRuleEnabledStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedRuleEnabledState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type OwaspCrsExclusionEntryMatchVariable string - -const ( - OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" - OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" -) - -func PossibleValuesForOwaspCrsExclusionEntryMatchVariable() []string { - return []string{ - string(OwaspCrsExclusionEntryMatchVariableRequestArgKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestArgNames), - string(OwaspCrsExclusionEntryMatchVariableRequestArgValues), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieNames), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieValues), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderValues), - } -} - -func (s *OwaspCrsExclusionEntryMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwaspCrsExclusionEntryMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwaspCrsExclusionEntryMatchVariable(input string) (*OwaspCrsExclusionEntryMatchVariable, error) { - vals := map[string]OwaspCrsExclusionEntryMatchVariable{ - "requestargkeys": OwaspCrsExclusionEntryMatchVariableRequestArgKeys, - "requestargnames": OwaspCrsExclusionEntryMatchVariableRequestArgNames, - "requestargvalues": OwaspCrsExclusionEntryMatchVariableRequestArgValues, - "requestcookiekeys": OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, - "requestcookienames": OwaspCrsExclusionEntryMatchVariableRequestCookieNames, - "requestcookievalues": OwaspCrsExclusionEntryMatchVariableRequestCookieValues, - "requestheaderkeys": OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, - "requestheadernames": OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, - "requestheadervalues": OwaspCrsExclusionEntryMatchVariableRequestHeaderValues, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwaspCrsExclusionEntryMatchVariable(input) - return &out, nil -} - -type OwaspCrsExclusionEntrySelectorMatchOperator string - -const ( - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" -) - -func PossibleValuesForOwaspCrsExclusionEntrySelectorMatchOperator() []string { - return []string{ - string(OwaspCrsExclusionEntrySelectorMatchOperatorContains), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEquals), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny), - string(OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - } -} - -func (s *OwaspCrsExclusionEntrySelectorMatchOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwaspCrsExclusionEntrySelectorMatchOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwaspCrsExclusionEntrySelectorMatchOperator(input string) (*OwaspCrsExclusionEntrySelectorMatchOperator, error) { - vals := map[string]OwaspCrsExclusionEntrySelectorMatchOperator{ - "contains": OwaspCrsExclusionEntrySelectorMatchOperatorContains, - "endswith": OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, - "equals": OwaspCrsExclusionEntrySelectorMatchOperatorEquals, - "equalsany": OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, - "startswith": OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwaspCrsExclusionEntrySelectorMatchOperator(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type ScrubbingRuleEntryMatchOperator string - -const ( - ScrubbingRuleEntryMatchOperatorEquals ScrubbingRuleEntryMatchOperator = "Equals" - ScrubbingRuleEntryMatchOperatorEqualsAny ScrubbingRuleEntryMatchOperator = "EqualsAny" -) - -func PossibleValuesForScrubbingRuleEntryMatchOperator() []string { - return []string{ - string(ScrubbingRuleEntryMatchOperatorEquals), - string(ScrubbingRuleEntryMatchOperatorEqualsAny), - } -} - -func (s *ScrubbingRuleEntryMatchOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryMatchOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryMatchOperator(input string) (*ScrubbingRuleEntryMatchOperator, error) { - vals := map[string]ScrubbingRuleEntryMatchOperator{ - "equals": ScrubbingRuleEntryMatchOperatorEquals, - "equalsany": ScrubbingRuleEntryMatchOperatorEqualsAny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryMatchOperator(input) - return &out, nil -} - -type ScrubbingRuleEntryMatchVariable string - -const ( - ScrubbingRuleEntryMatchVariableRequestArgNames ScrubbingRuleEntryMatchVariable = "RequestArgNames" - ScrubbingRuleEntryMatchVariableRequestCookieNames ScrubbingRuleEntryMatchVariable = "RequestCookieNames" - ScrubbingRuleEntryMatchVariableRequestHeaderNames ScrubbingRuleEntryMatchVariable = "RequestHeaderNames" - ScrubbingRuleEntryMatchVariableRequestIPAddress ScrubbingRuleEntryMatchVariable = "RequestIPAddress" - ScrubbingRuleEntryMatchVariableRequestJSONArgNames ScrubbingRuleEntryMatchVariable = "RequestJSONArgNames" - ScrubbingRuleEntryMatchVariableRequestPostArgNames ScrubbingRuleEntryMatchVariable = "RequestPostArgNames" -) - -func PossibleValuesForScrubbingRuleEntryMatchVariable() []string { - return []string{ - string(ScrubbingRuleEntryMatchVariableRequestArgNames), - string(ScrubbingRuleEntryMatchVariableRequestCookieNames), - string(ScrubbingRuleEntryMatchVariableRequestHeaderNames), - string(ScrubbingRuleEntryMatchVariableRequestIPAddress), - string(ScrubbingRuleEntryMatchVariableRequestJSONArgNames), - string(ScrubbingRuleEntryMatchVariableRequestPostArgNames), - } -} - -func (s *ScrubbingRuleEntryMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryMatchVariable(input string) (*ScrubbingRuleEntryMatchVariable, error) { - vals := map[string]ScrubbingRuleEntryMatchVariable{ - "requestargnames": ScrubbingRuleEntryMatchVariableRequestArgNames, - "requestcookienames": ScrubbingRuleEntryMatchVariableRequestCookieNames, - "requestheadernames": ScrubbingRuleEntryMatchVariableRequestHeaderNames, - "requestipaddress": ScrubbingRuleEntryMatchVariableRequestIPAddress, - "requestjsonargnames": ScrubbingRuleEntryMatchVariableRequestJSONArgNames, - "requestpostargnames": ScrubbingRuleEntryMatchVariableRequestPostArgNames, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryMatchVariable(input) - return &out, nil -} - -type ScrubbingRuleEntryState string - -const ( - ScrubbingRuleEntryStateDisabled ScrubbingRuleEntryState = "Disabled" - ScrubbingRuleEntryStateEnabled ScrubbingRuleEntryState = "Enabled" -) - -func PossibleValuesForScrubbingRuleEntryState() []string { - return []string{ - string(ScrubbingRuleEntryStateDisabled), - string(ScrubbingRuleEntryStateEnabled), - } -} - -func (s *ScrubbingRuleEntryState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryState(input string) (*ScrubbingRuleEntryState, error) { - vals := map[string]ScrubbingRuleEntryState{ - "disabled": ScrubbingRuleEntryStateDisabled, - "enabled": ScrubbingRuleEntryStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} - -type WebApplicationFirewallAction string - -const ( - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -func PossibleValuesForWebApplicationFirewallAction() []string { - return []string{ - string(WebApplicationFirewallActionAllow), - string(WebApplicationFirewallActionBlock), - string(WebApplicationFirewallActionLog), - } -} - -func (s *WebApplicationFirewallAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallAction(input string) (*WebApplicationFirewallAction, error) { - vals := map[string]WebApplicationFirewallAction{ - "allow": WebApplicationFirewallActionAllow, - "block": WebApplicationFirewallActionBlock, - "log": WebApplicationFirewallActionLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallAction(input) - return &out, nil -} - -type WebApplicationFirewallEnabledState string - -const ( - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallEnabledState() []string { - return []string{ - string(WebApplicationFirewallEnabledStateDisabled), - string(WebApplicationFirewallEnabledStateEnabled), - } -} - -func (s *WebApplicationFirewallEnabledState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallEnabledState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallEnabledState(input string) (*WebApplicationFirewallEnabledState, error) { - vals := map[string]WebApplicationFirewallEnabledState{ - "disabled": WebApplicationFirewallEnabledStateDisabled, - "enabled": WebApplicationFirewallEnabledStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallEnabledState(input) - return &out, nil -} - -type WebApplicationFirewallMatchVariable string - -const ( - WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" - WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" - WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" - WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - WebApplicationFirewallMatchVariableRequestUri WebApplicationFirewallMatchVariable = "RequestUri" -) - -func PossibleValuesForWebApplicationFirewallMatchVariable() []string { - return []string{ - string(WebApplicationFirewallMatchVariablePostArgs), - string(WebApplicationFirewallMatchVariableQueryString), - string(WebApplicationFirewallMatchVariableRemoteAddr), - string(WebApplicationFirewallMatchVariableRequestBody), - string(WebApplicationFirewallMatchVariableRequestCookies), - string(WebApplicationFirewallMatchVariableRequestHeaders), - string(WebApplicationFirewallMatchVariableRequestMethod), - string(WebApplicationFirewallMatchVariableRequestUri), - } -} - -func (s *WebApplicationFirewallMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallMatchVariable(input string) (*WebApplicationFirewallMatchVariable, error) { - vals := map[string]WebApplicationFirewallMatchVariable{ - "postargs": WebApplicationFirewallMatchVariablePostArgs, - "querystring": WebApplicationFirewallMatchVariableQueryString, - "remoteaddr": WebApplicationFirewallMatchVariableRemoteAddr, - "requestbody": WebApplicationFirewallMatchVariableRequestBody, - "requestcookies": WebApplicationFirewallMatchVariableRequestCookies, - "requestheaders": WebApplicationFirewallMatchVariableRequestHeaders, - "requestmethod": WebApplicationFirewallMatchVariableRequestMethod, - "requesturi": WebApplicationFirewallMatchVariableRequestUri, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallMatchVariable(input) - return &out, nil -} - -type WebApplicationFirewallMode string - -const ( - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -func PossibleValuesForWebApplicationFirewallMode() []string { - return []string{ - string(WebApplicationFirewallModeDetection), - string(WebApplicationFirewallModePrevention), - } -} - -func (s *WebApplicationFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallMode(input string) (*WebApplicationFirewallMode, error) { - vals := map[string]WebApplicationFirewallMode{ - "detection": WebApplicationFirewallModeDetection, - "prevention": WebApplicationFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallMode(input) - return &out, nil -} - -type WebApplicationFirewallOperator string - -const ( - WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -func PossibleValuesForWebApplicationFirewallOperator() []string { - return []string{ - string(WebApplicationFirewallOperatorAny), - string(WebApplicationFirewallOperatorBeginsWith), - string(WebApplicationFirewallOperatorContains), - string(WebApplicationFirewallOperatorEndsWith), - string(WebApplicationFirewallOperatorEqual), - string(WebApplicationFirewallOperatorGeoMatch), - string(WebApplicationFirewallOperatorGreaterThan), - string(WebApplicationFirewallOperatorGreaterThanOrEqual), - string(WebApplicationFirewallOperatorIPMatch), - string(WebApplicationFirewallOperatorLessThan), - string(WebApplicationFirewallOperatorLessThanOrEqual), - string(WebApplicationFirewallOperatorRegex), - } -} - -func (s *WebApplicationFirewallOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallOperator(input string) (*WebApplicationFirewallOperator, error) { - vals := map[string]WebApplicationFirewallOperator{ - "any": WebApplicationFirewallOperatorAny, - "beginswith": WebApplicationFirewallOperatorBeginsWith, - "contains": WebApplicationFirewallOperatorContains, - "endswith": WebApplicationFirewallOperatorEndsWith, - "equal": WebApplicationFirewallOperatorEqual, - "geomatch": WebApplicationFirewallOperatorGeoMatch, - "greaterthan": WebApplicationFirewallOperatorGreaterThan, - "greaterthanorequal": WebApplicationFirewallOperatorGreaterThanOrEqual, - "ipmatch": WebApplicationFirewallOperatorIPMatch, - "lessthan": WebApplicationFirewallOperatorLessThan, - "lessthanorequal": WebApplicationFirewallOperatorLessThanOrEqual, - "regex": WebApplicationFirewallOperatorRegex, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallOperator(input) - return &out, nil -} - -type WebApplicationFirewallPolicyResourceState string - -const ( - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -func PossibleValuesForWebApplicationFirewallPolicyResourceState() []string { - return []string{ - string(WebApplicationFirewallPolicyResourceStateCreating), - string(WebApplicationFirewallPolicyResourceStateDeleting), - string(WebApplicationFirewallPolicyResourceStateDisabled), - string(WebApplicationFirewallPolicyResourceStateDisabling), - string(WebApplicationFirewallPolicyResourceStateEnabled), - string(WebApplicationFirewallPolicyResourceStateEnabling), - } -} - -func (s *WebApplicationFirewallPolicyResourceState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallPolicyResourceState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallPolicyResourceState(input string) (*WebApplicationFirewallPolicyResourceState, error) { - vals := map[string]WebApplicationFirewallPolicyResourceState{ - "creating": WebApplicationFirewallPolicyResourceStateCreating, - "deleting": WebApplicationFirewallPolicyResourceStateDeleting, - "disabled": WebApplicationFirewallPolicyResourceStateDisabled, - "disabling": WebApplicationFirewallPolicyResourceStateDisabling, - "enabled": WebApplicationFirewallPolicyResourceStateEnabled, - "enabling": WebApplicationFirewallPolicyResourceStateEnabling, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallPolicyResourceState(input) - return &out, nil -} - -type WebApplicationFirewallRuleType string - -const ( - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" - WebApplicationFirewallRuleTypeRateLimitRule WebApplicationFirewallRuleType = "RateLimitRule" -) - -func PossibleValuesForWebApplicationFirewallRuleType() []string { - return []string{ - string(WebApplicationFirewallRuleTypeInvalid), - string(WebApplicationFirewallRuleTypeMatchRule), - string(WebApplicationFirewallRuleTypeRateLimitRule), - } -} - -func (s *WebApplicationFirewallRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallRuleType(input string) (*WebApplicationFirewallRuleType, error) { - vals := map[string]WebApplicationFirewallRuleType{ - "invalid": WebApplicationFirewallRuleTypeInvalid, - "matchrule": WebApplicationFirewallRuleTypeMatchRule, - "ratelimitrule": WebApplicationFirewallRuleTypeRateLimitRule, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallRuleType(input) - return &out, nil -} - -type WebApplicationFirewallScrubbingState string - -const ( - WebApplicationFirewallScrubbingStateDisabled WebApplicationFirewallScrubbingState = "Disabled" - WebApplicationFirewallScrubbingStateEnabled WebApplicationFirewallScrubbingState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallScrubbingState() []string { - return []string{ - string(WebApplicationFirewallScrubbingStateDisabled), - string(WebApplicationFirewallScrubbingStateEnabled), - } -} - -func (s *WebApplicationFirewallScrubbingState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallScrubbingState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallScrubbingState(input string) (*WebApplicationFirewallScrubbingState, error) { - vals := map[string]WebApplicationFirewallScrubbingState{ - "disabled": WebApplicationFirewallScrubbingStateDisabled, - "enabled": WebApplicationFirewallScrubbingStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallScrubbingState(input) - return &out, nil -} - -type WebApplicationFirewallState string - -const ( - WebApplicationFirewallStateDisabled WebApplicationFirewallState = "Disabled" - WebApplicationFirewallStateEnabled WebApplicationFirewallState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallState() []string { - return []string{ - string(WebApplicationFirewallStateDisabled), - string(WebApplicationFirewallStateEnabled), - } -} - -func (s *WebApplicationFirewallState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallState(input string) (*WebApplicationFirewallState, error) { - vals := map[string]WebApplicationFirewallState{ - "disabled": WebApplicationFirewallStateDisabled, - "enabled": WebApplicationFirewallStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallState(input) - return &out, nil -} - -type WebApplicationFirewallTransform string - -const ( - WebApplicationFirewallTransformHtmlEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" - WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" - WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" -) - -func PossibleValuesForWebApplicationFirewallTransform() []string { - return []string{ - string(WebApplicationFirewallTransformHtmlEntityDecode), - string(WebApplicationFirewallTransformLowercase), - string(WebApplicationFirewallTransformRemoveNulls), - string(WebApplicationFirewallTransformTrim), - string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), - } -} - -func (s *WebApplicationFirewallTransform) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallTransform(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewallTransform, error) { - vals := map[string]WebApplicationFirewallTransform{ - "htmlentitydecode": WebApplicationFirewallTransformHtmlEntityDecode, - "lowercase": WebApplicationFirewallTransformLowercase, - "removenulls": WebApplicationFirewallTransformRemoveNulls, - "trim": WebApplicationFirewallTransformTrim, - "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallTransform(input) - return &out, nil -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go deleted file mode 100644 index 9c48316d9e7..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package webapplicationfirewallpolicies - -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(&ApplicationGatewayWebApplicationFirewallPolicyId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayWebApplicationFirewallPolicyId{} - -// ApplicationGatewayWebApplicationFirewallPolicyId is a struct representing the Resource ID for a Application Gateway Web Application Firewall Policy -type ApplicationGatewayWebApplicationFirewallPolicyId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayWebApplicationFirewallPolicyName string -} - -// NewApplicationGatewayWebApplicationFirewallPolicyID returns a new ApplicationGatewayWebApplicationFirewallPolicyId struct -func NewApplicationGatewayWebApplicationFirewallPolicyID(subscriptionId string, resourceGroupName string, applicationGatewayWebApplicationFirewallPolicyName string) ApplicationGatewayWebApplicationFirewallPolicyId { - return ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayWebApplicationFirewallPolicyName: applicationGatewayWebApplicationFirewallPolicyName, - } -} - -// ParseApplicationGatewayWebApplicationFirewallPolicyID parses 'input' into a ApplicationGatewayWebApplicationFirewallPolicyId -func ParseApplicationGatewayWebApplicationFirewallPolicyID(input string) (*ApplicationGatewayWebApplicationFirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayWebApplicationFirewallPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayWebApplicationFirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayWebApplicationFirewallPolicyId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(input string) (*ApplicationGatewayWebApplicationFirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayWebApplicationFirewallPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayWebApplicationFirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayWebApplicationFirewallPolicyId) 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.ApplicationGatewayWebApplicationFirewallPolicyName, ok = input.Parsed["applicationGatewayWebApplicationFirewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayWebApplicationFirewallPolicyName", input) - } - - return nil -} - -// ValidateApplicationGatewayWebApplicationFirewallPolicyID checks that 'input' can be parsed as a Application Gateway Web Application Firewall Policy ID -func ValidateApplicationGatewayWebApplicationFirewallPolicyID(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 := ParseApplicationGatewayWebApplicationFirewallPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway Web Application Firewall Policy ID -func (id ApplicationGatewayWebApplicationFirewallPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayWebApplicationFirewallPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway Web Application Firewall Policy ID -func (id ApplicationGatewayWebApplicationFirewallPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "applicationGatewayWebApplicationFirewallPolicyValue"), - } -} - -// String returns a human-readable description of this Application Gateway Web Application Firewall Policy ID -func (id ApplicationGatewayWebApplicationFirewallPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Web Application Firewall Policy Name: %q", id.ApplicationGatewayWebApplicationFirewallPolicyName), - } - return fmt.Sprintf("Application Gateway Web Application Firewall Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go deleted file mode 100644 index 6b50388308f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package webapplicationfirewallpolicies - -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 = &ApplicationGatewayWebApplicationFirewallPolicyId{} - -func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - - 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.ApplicationGatewayWebApplicationFirewallPolicyName != "applicationGatewayWebApplicationFirewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "applicationGatewayWebApplicationFirewallPolicyValue") - } -} - -func TestFormatApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayWebApplicationFirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue", - Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayWebApplicationFirewallPolicyID(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.ApplicationGatewayWebApplicationFirewallPolicyName != v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayWebApplicationFirewallPolicyName", v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName, actual.ApplicationGatewayWebApplicationFirewallPolicyName) - } - - } -} - -func TestParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayWebApplicationFirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue", - Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYvAlUe", - Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayWebApplicationFirewallPolicyName: "aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(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.ApplicationGatewayWebApplicationFirewallPolicyName != v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayWebApplicationFirewallPolicyName", v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName, actual.ApplicationGatewayWebApplicationFirewallPolicyName) - } - - } -} - -func TestSegmentsForApplicationGatewayWebApplicationFirewallPolicyId(t *testing.T) { - segments := ApplicationGatewayWebApplicationFirewallPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayWebApplicationFirewallPolicyId 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/network/2023-05-01/webapplicationfirewallpolicies/method_createorupdate.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_createorupdate.go deleted file mode 100644 index a30ca59994f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package webapplicationfirewallpolicies - -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 *WebApplicationFirewallPolicy -} - -// CreateOrUpdate ... -func (c WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId, input WebApplicationFirewallPolicy) (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 WebApplicationFirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_delete.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_delete.go deleted file mode 100644 index c4547e95952..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package webapplicationfirewallpolicies - -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 WebApplicationFirewallPoliciesClient) Delete(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 WebApplicationFirewallPoliciesClient) DeleteThenPoll(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId) 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/network/2023-05-01/webapplicationfirewallpolicies/method_get.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_get.go deleted file mode 100644 index 03919558699..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package webapplicationfirewallpolicies - -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 *WebApplicationFirewallPolicy -} - -// Get ... -func (c WebApplicationFirewallPoliciesClient) Get(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId) (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 WebApplicationFirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_list.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_list.go deleted file mode 100644 index 505ae239c41..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package webapplicationfirewallpolicies - -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 *[]WebApplicationFirewallPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []WebApplicationFirewallPolicy -} - -// List ... -func (c WebApplicationFirewallPoliciesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", 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 *[]WebApplicationFirewallPolicy `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 WebApplicationFirewallPoliciesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WebApplicationFirewallPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebApplicationFirewallPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate WebApplicationFirewallPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]WebApplicationFirewallPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-05-01/webapplicationfirewallpolicies/method_listall.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_listall.go deleted file mode 100644 index eff3155ccef..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package webapplicationfirewallpolicies - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]WebApplicationFirewallPolicy -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []WebApplicationFirewallPolicy -} - -// ListAll ... -func (c WebApplicationFirewallPoliciesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", 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 *[]WebApplicationFirewallPolicy `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c WebApplicationFirewallPoliciesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, WebApplicationFirewallPolicyOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebApplicationFirewallPoliciesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate WebApplicationFirewallPolicyOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]WebApplicationFirewallPolicy, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgateway.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgateway.go deleted file mode 100644 index 69aa82140ea..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgateway.go +++ /dev/null @@ -1,21 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "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 ApplicationGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go deleted file mode 100644 index 74175523bc1..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go deleted file mode 100644 index 7536ffa2439..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go deleted file mode 100644 index 06e7df4e24e..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAutoscaleConfiguration struct { - MaxCapacity *int64 `json:"maxCapacity,omitempty"` - MinCapacity int64 `json:"minCapacity"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go deleted file mode 100644 index dcc624a13aa..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 0f188b359ad..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 64a4ed2e836..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go deleted file mode 100644 index 052f312d7b3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go deleted file mode 100644 index 16305b5de81..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - CookieBasedAffinity *ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - HostName *string `json:"hostName,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestTimeout *int64 `json:"requestTimeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go deleted file mode 100644 index 1bc8a5c5fe1..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go deleted file mode 100644 index 5d5f77f3c8d..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - HostName *string `json:"hostName,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go deleted file mode 100644 index 36e0f43021d..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayClientAuthConfiguration struct { - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` - VerifyClientRevocation *ApplicationGatewayClientRevocationOptions `json:"verifyClientRevocation,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go deleted file mode 100644 index 369c8494e6f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayConnectionDraining struct { - DrainTimeoutInSec int64 `json:"drainTimeoutInSec"` - Enabled bool `json:"enabled"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go deleted file mode 100644 index 82f3501791c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` - StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go deleted file mode 100644 index c88a33b735c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallDisabledRuleGroup struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]int64 `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go deleted file mode 100644 index 541e5052e8f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallExclusion struct { - MatchVariable string `json:"matchVariable"` - Selector string `json:"selector"` - SelectorMatchOperator string `json:"selectorMatchOperator"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go deleted file mode 100644 index f5f9c5bebc7..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go deleted file mode 100644 index 1b61dc71c1d..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go deleted file mode 100644 index dfcb5e52ee3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go deleted file mode 100644 index d37b168d0aa..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPortPropertiesFormat struct { - Port *int64 `json:"port,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go deleted file mode 100644 index b80dabed9a0..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayGlobalConfiguration struct { - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go deleted file mode 100644 index fbbd324adce..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHeaderConfiguration struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go deleted file mode 100644 index 0fd70bac201..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go deleted file mode 100644 index 9c4eb515f42..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - HostName *string `json:"hostName,omitempty"` - HostNames *[]string `json:"hostNames,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 6ffd65f71c2..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index e8482b21e60..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go deleted file mode 100644 index 71fe702c98e..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go deleted file mode 100644 index 3f3c35b3412..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListenerPropertiesFormat struct { - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go deleted file mode 100644 index 55e8713746c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go deleted file mode 100644 index fe721166bf2..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { - LoadDistributionAlgorithm *ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` - LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go deleted file mode 100644 index d361c4e3d97..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTarget struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go deleted file mode 100644 index 6ba821b2e82..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - WeightPerServer *int64 `json:"weightPerServer,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go deleted file mode 100644 index 992b948c558..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go deleted file mode 100644 index 5c8b00da085..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Paths *[]string `json:"paths,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index 5b45596cedc..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go deleted file mode 100644 index c6a900feb31..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go deleted file mode 100644 index 73e8756981a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go deleted file mode 100644 index 8855a67b9ce..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go deleted file mode 100644 index ce8e67a68d0..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go deleted file mode 100644 index ff68d2052d7..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go deleted file mode 100644 index 9c935a9fbba..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go deleted file mode 100644 index 20c18109ec0..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbeHealthResponseMatch struct { - Body *string `json:"body,omitempty"` - StatusCodes *[]string `json:"statusCodes,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go deleted file mode 100644 index b36845c57bf..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbePropertiesFormat struct { - Host *string `json:"host,omitempty"` - Interval *int64 `json:"interval,omitempty"` - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - MinServers *int64 `json:"minServers,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - UnhealthyThreshold *int64 `json:"unhealthyThreshold,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go deleted file mode 100644 index f4f485b405b..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ /dev/null @@ -1,43 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPropertiesFormat struct { - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - DefaultPredefinedSslPolicy *ApplicationGatewaySslPolicyName `json:"defaultPredefinedSslPolicy,omitempty"` - EnableFips *bool `json:"enableFips,omitempty"` - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go deleted file mode 100644 index 85eed147eb2..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go deleted file mode 100644 index 7808c57c7f7..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - IncludePath *bool `json:"includePath,omitempty"` - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - PathRules *[]SubResource `json:"pathRules,omitempty"` - RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` - TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` - UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go deleted file mode 100644 index 9eb6ffe9c4a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go deleted file mode 100644 index 53dc9f99474..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - HTTPListener *SubResource `json:"httpListener,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - UrlPathMap *SubResource `json:"urlPathMap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go deleted file mode 100644 index 21ce81c5a24..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRule struct { - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` - Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - Name *string `json:"name,omitempty"` - RuleSequence *int64 `json:"ruleSequence,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go deleted file mode 100644 index ed418b0d4a5..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleActionSet struct { - RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go deleted file mode 100644 index 1e70a94ea80..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleCondition struct { - IgnoreCase *bool `json:"ignoreCase,omitempty"` - Negate *bool `json:"negate,omitempty"` - Pattern *string `json:"pattern,omitempty"` - Variable *string `json:"variable,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go deleted file mode 100644 index a25c70e4a05..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go deleted file mode 100644 index 3a1e3374217..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go deleted file mode 100644 index 78053b23a9c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go deleted file mode 100644 index 05ed98ab597..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendSettings *SubResource `json:"backendSettings,omitempty"` - Listener *SubResource `json:"listener,omitempty"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go deleted file mode 100644 index 0b639c7628a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *ApplicationGatewaySkuName `json:"name,omitempty"` - Tier *ApplicationGatewayTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go deleted file mode 100644 index 328f6a90d88..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go deleted file mode 100644 index f087bfec9a8..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - Password *string `json:"password,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go deleted file mode 100644 index ae860f1460f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPolicy struct { - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - MinProtocolVersion *ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` - PolicyName *ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` - PolicyType *ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go deleted file mode 100644 index 8c1d0630c2f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go deleted file mode 100644 index b89279b0c7f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfilePropertiesFormat struct { - ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - TrustedClientCertificates *[]SubResource `json:"trustedClientCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go deleted file mode 100644 index f2fb2244e71..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedClientCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go deleted file mode 100644 index ac7454cb8f4..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { - ClientCertIssuerDN *string `json:"clientCertIssuerDN,omitempty"` - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ValidatedCertData *string `json:"validatedCertData,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go deleted file mode 100644 index 9deacd55fe8..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go deleted file mode 100644 index f79bf663f76..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go deleted file mode 100644 index 03021e43980..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlConfiguration struct { - ModifiedPath *string `json:"modifiedPath,omitempty"` - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - Reroute *bool `json:"reroute,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go deleted file mode 100644 index 57b9cac7aa3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go deleted file mode 100644 index e69ae8cbde4..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMapPropertiesFormat struct { - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go deleted file mode 100644 index 0ccb185da05..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - Enabled bool `json:"enabled"` - Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode"` - MaxRequestBodySize *int64 `json:"maxRequestBodySize,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go deleted file mode 100644 index 8dccd748428..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 2713b23e0a5..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspool.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspool.go deleted file mode 100644 index a5f3d1e0367..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index ddf54b50116..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index e9022fbeb4f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ddossettings.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ddossettings.go deleted file mode 100644 index 4f7e1e20764..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_delegation.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_delegation.go deleted file mode 100644 index 9a088e2a507..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go deleted file mode 100644 index ffa39b22711..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExclusionManagedRule struct { - RuleId string `json:"ruleId"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go deleted file mode 100644 index 29d30ef6bc1..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExclusionManagedRuleGroup struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]ExclusionManagedRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go deleted file mode 100644 index cb569797cec..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExclusionManagedRuleSet struct { - RuleGroups *[]ExclusionManagedRuleGroup `json:"ruleGroups,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlog.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlog.go deleted file mode 100644 index 36d32c9316a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go deleted file mode 100644 index 8e97873a7c3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go deleted file mode 100644 index 9e90fd9cd8a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go deleted file mode 100644 index 717217cc3a2..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 4f11b119df9..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 698c1c6a1b4..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyusersession.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyusersession.go deleted file mode 100644 index 5995831381a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyusersession.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupByUserSession struct { - GroupByVariables []GroupByVariable `json:"groupByVariables"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyvariable.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyvariable.go deleted file mode 100644 index 132602a8758..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_groupbyvariable.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupByVariable struct { - VariableName ApplicationGatewayFirewallUserSessionVariable `json:"variableName"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrule.go deleted file mode 100644 index f9908a65135..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 2ed26d6a6d0..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfiguration.go deleted file mode 100644 index ee1ee9f9ce3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go deleted file mode 100644 index 4467a251182..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 4746cb9a921..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 6455af984df..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_iptag.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_iptag.go deleted file mode 100644 index da603122799..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// 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/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go deleted file mode 100644 index 07977c08269..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index ca60fdf8735..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go deleted file mode 100644 index 2810e8e0e4d..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRuleGroupOverride struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]ManagedRuleOverride `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleoverride.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleoverride.go deleted file mode 100644 index c6f8a500e23..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleoverride.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRuleOverride struct { - Action *ActionType `json:"action,omitempty"` - RuleId string `json:"ruleId"` - State *ManagedRuleEnabledState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go deleted file mode 100644 index 720824c2670..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRulesDefinition struct { - Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"` - ManagedRuleSets []ManagedRuleSet `json:"managedRuleSets"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleset.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleset.go deleted file mode 100644 index 2bbf971c792..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_managedruleset.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRuleSet struct { - RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchcondition.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchcondition.go deleted file mode 100644 index c8d3e722c75..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchcondition.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MatchCondition struct { - MatchValues []string `json:"matchValues"` - MatchVariables []MatchVariable `json:"matchVariables"` - NegationConditon *bool `json:"negationConditon,omitempty"` - Operator WebApplicationFirewallOperator `json:"operator"` - Transforms *[]WebApplicationFirewallTransform `json:"transforms,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchvariable.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchvariable.go deleted file mode 100644 index bd0473317b2..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_matchvariable.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MatchVariable struct { - Selector *string `json:"selector,omitempty"` - VariableName WebApplicationFirewallMatchVariable `json:"variableName"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgateway.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgateway.go deleted file mode 100644 index 4a594a57232..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package webapplicationfirewallpolicies - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go deleted file mode 100644 index 30e0ed98075..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaysku.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaysku.go deleted file mode 100644 index 01f9595dd47..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natruleportmapping.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natruleportmapping.go deleted file mode 100644 index 636fb66e30f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterface.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterface.go deleted file mode 100644 index 5f43f78eff1..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go deleted file mode 100644 index 2d9f1326e9a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 80650073a43..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index ed9c49c6aa3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 244007a3148..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go deleted file mode 100644 index e24f37ad4e4..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 559fab4512d..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d28ce56ff99..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygroup.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygroup.go deleted file mode 100644 index 7edb20a30eb..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 63dfb0a3753..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go deleted file mode 100644 index 447c5ce3185..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OwaspCrsExclusionEntry struct { - ExclusionManagedRuleSets *[]ExclusionManagedRuleSet `json:"exclusionManagedRuleSets,omitempty"` - MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable"` - Selector string `json:"selector"` - SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettings.go deleted file mode 100644 index ad2543067d3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettings.go +++ /dev/null @@ -1,18 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PolicySettings struct { - CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` - CustomBlockResponseStatusCode *int64 `json:"customBlockResponseStatusCode,omitempty"` - FileUploadEnforcement *bool `json:"fileUploadEnforcement,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - LogScrubbing *PolicySettingsLogScrubbing `json:"logScrubbing,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - Mode *WebApplicationFirewallMode `json:"mode,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RequestBodyEnforcement *bool `json:"requestBodyEnforcement,omitempty"` - RequestBodyInspectLimitInKB *int64 `json:"requestBodyInspectLimitInKB,omitempty"` - State *WebApplicationFirewallEnabledState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go deleted file mode 100644 index a97418be867..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PolicySettingsLogScrubbing struct { - ScrubbingRules *[]WebApplicationFirewallScrubbingRules `json:"scrubbingRules,omitempty"` - State *WebApplicationFirewallScrubbingState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpoint.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpoint.go deleted file mode 100644 index aabcb4ef384..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnection.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnection.go deleted file mode 100644 index c66bc0045c7..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go deleted file mode 100644 index dbd38c8e4ca..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go deleted file mode 100644 index 86f24c803d3..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index f40d8cf2be4..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointproperties.go deleted file mode 100644 index 93cab138813..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkservice.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkservice.go deleted file mode 100644 index 8b8ffdc399e..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go deleted file mode 100644 index ac293dace51..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 164ef869982..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 3ea66cb9940..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 7d17f466192..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 814df952c03..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go deleted file mode 100644 index c58556d385c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddress.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddress.go deleted file mode 100644 index 6f2116661f4..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go deleted file mode 100644 index c122bbf9d00..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 76e237783ef..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresssku.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresssku.go deleted file mode 100644 index 1b8495a46b0..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go deleted file mode 100644 index 8cf0d6ae754..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go deleted file mode 100644 index cfc65feb648..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourceset.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourceset.go deleted file mode 100644 index 7bd3ff7ff53..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go deleted file mode 100644 index 700cf48fcef..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_route.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_route.go deleted file mode 100644 index 854dbcba973..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routepropertiesformat.go deleted file mode 100644 index 65879ed15ad..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetable.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetable.go deleted file mode 100644 index 73fdbc844dc..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go deleted file mode 100644 index f7082dd7d4a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrule.go deleted file mode 100644 index 9a8c2e557c7..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go deleted file mode 100644 index d40d084432c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlink.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlink.go deleted file mode 100644 index 9f75aeaec5b..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index abae149b764..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 160d9aebc9f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go deleted file mode 100644 index ae5e0fd396a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go deleted file mode 100644 index ac60c21f09b..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 34679603f3a..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index aa5effcc158..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 03e37bc11f8..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnet.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnet.go deleted file mode 100644 index 22ae6378be5..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go deleted file mode 100644 index a3dc0aaf42f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subresource.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subresource.go deleted file mode 100644 index f80e970be83..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index fd4b0e7ec17..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go deleted file mode 100644 index 872500d56bf..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktap.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktap.go deleted file mode 100644 index e2de0ca881d..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 418d09be371..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go deleted file mode 100644 index c66c1257253..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallCustomRule struct { - Action WebApplicationFirewallAction `json:"action"` - Etag *string `json:"etag,omitempty"` - GroupByUserSession *[]GroupByUserSession `json:"groupByUserSession,omitempty"` - MatchConditions []MatchCondition `json:"matchConditions"` - Name *string `json:"name,omitempty"` - Priority int64 `json:"priority"` - RateLimitDuration *ApplicationGatewayFirewallRateLimitDuration `json:"rateLimitDuration,omitempty"` - RateLimitThreshold *int64 `json:"rateLimitThreshold,omitempty"` - RuleType WebApplicationFirewallRuleType `json:"ruleType"` - State *WebApplicationFirewallState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go deleted file mode 100644 index c79f926a28c..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WebApplicationFirewallPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go deleted file mode 100644 index 0c43a36d2a8..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallPolicyPropertiesFormat struct { - ApplicationGateways *[]ApplicationGateway `json:"applicationGateways,omitempty"` - CustomRules *[]WebApplicationFirewallCustomRule `json:"customRules,omitempty"` - HTTPListeners *[]SubResource `json:"httpListeners,omitempty"` - ManagedRules ManagedRulesDefinition `json:"managedRules"` - PathBasedRules *[]SubResource `json:"pathBasedRules,omitempty"` - PolicySettings *PolicySettings `json:"policySettings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceState *WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go deleted file mode 100644 index b3d3f6dd209..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallScrubbingRules struct { - MatchVariable ScrubbingRuleEntryMatchVariable `json:"matchVariable"` - Selector *string `json:"selector,omitempty"` - SelectorMatchOperator ScrubbingRuleEntryMatchOperator `json:"selectorMatchOperator"` - State *ScrubbingRuleEntryState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/predicates.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/predicates.go deleted file mode 100644 index a7973b0a14f..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallPolicyOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p WebApplicationFirewallPolicyOperationPredicate) Matches(input WebApplicationFirewallPolicy) 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 && (input.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/network/2023-05-01/webapplicationfirewallpolicies/version.go b/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/version.go deleted file mode 100644 index 80d34105ddd..00000000000 --- a/resource-manager/network/2023-05-01/webapplicationfirewallpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webapplicationfirewallpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-05-01/webcategories/README.md b/resource-manager/network/2023-05-01/webcategories/README.md deleted file mode 100644 index eb055ef3ce2..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-05-01/webcategories` Documentation - -The `webcategories` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-05-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/network/2023-05-01/webcategories" -``` - - -### Client Initialization - -```go -client := webcategories.NewWebCategoriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebCategoriesClient.Get` - -```go -ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue") - -read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `WebCategoriesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-05-01/webcategories/client.go b/resource-manager/network/2023-05-01/webcategories/client.go deleted file mode 100644 index 075aa15b06b..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package webcategories - -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 WebCategoriesClient struct { - Client *resourcemanager.Client -} - -func NewWebCategoriesClientWithBaseURI(sdkApi sdkEnv.Api) (*WebCategoriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "webcategories", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WebCategoriesClient: %+v", err) - } - - return &WebCategoriesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-05-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2023-05-01/webcategories/id_azurewebcategory.go deleted file mode 100644 index 1417d2f6d85..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/id_azurewebcategory.go +++ /dev/null @@ -1,121 +0,0 @@ -package webcategories - -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(&AzureWebCategoryId{}) -} - -var _ resourceids.ResourceId = &AzureWebCategoryId{} - -// AzureWebCategoryId is a struct representing the Resource ID for a Azure Web Category -type AzureWebCategoryId struct { - SubscriptionId string - AzureWebCategoryName string -} - -// NewAzureWebCategoryID returns a new AzureWebCategoryId struct -func NewAzureWebCategoryID(subscriptionId string, azureWebCategoryName string) AzureWebCategoryId { - return AzureWebCategoryId{ - SubscriptionId: subscriptionId, - AzureWebCategoryName: azureWebCategoryName, - } -} - -// ParseAzureWebCategoryID parses 'input' into a AzureWebCategoryId -func ParseAzureWebCategoryID(input string) (*AzureWebCategoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureWebCategoryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureWebCategoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAzureWebCategoryIDInsensitively parses 'input' case-insensitively into a AzureWebCategoryId -// note: this method should only be used for API response data and not user input -func ParseAzureWebCategoryIDInsensitively(input string) (*AzureWebCategoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureWebCategoryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureWebCategoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AzureWebCategoryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.AzureWebCategoryName, ok = input.Parsed["azureWebCategoryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "azureWebCategoryName", input) - } - - return nil -} - -// ValidateAzureWebCategoryID checks that 'input' can be parsed as a Azure Web Category ID -func ValidateAzureWebCategoryID(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 := ParseAzureWebCategoryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Azure Web Category ID -func (id AzureWebCategoryId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/azureWebCategories/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.AzureWebCategoryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Azure Web Category ID -func (id AzureWebCategoryId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticAzureWebCategories", "azureWebCategories", "azureWebCategories"), - resourceids.UserSpecifiedSegment("azureWebCategoryName", "azureWebCategoryValue"), - } -} - -// String returns a human-readable description of this Azure Web Category ID -func (id AzureWebCategoryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Azure Web Category Name: %q", id.AzureWebCategoryName), - } - return fmt.Sprintf("Azure Web Category (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-05-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2023-05-01/webcategories/id_azurewebcategory_test.go deleted file mode 100644 index ba8e348767d..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/id_azurewebcategory_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package webcategories - -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 = &AzureWebCategoryId{} - -func TestNewAzureWebCategoryID(t *testing.T) { - id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue") - - 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.AzureWebCategoryName != "azureWebCategoryValue" { - t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "azureWebCategoryValue") - } -} - -func TestFormatAzureWebCategoryID(t *testing.T) { - actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAzureWebCategoryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureWebCategoryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue", - Expected: &AzureWebCategoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "azureWebCategoryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureWebCategoryID(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.AzureWebCategoryName != v.Expected.AzureWebCategoryName { - t.Fatalf("Expected %q but got %q for AzureWebCategoryName", v.Expected.AzureWebCategoryName, actual.AzureWebCategoryName) - } - - } -} - -func TestParseAzureWebCategoryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureWebCategoryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue", - Expected: &AzureWebCategoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "azureWebCategoryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYvAlUe", - Expected: &AzureWebCategoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "aZuReWeBcAtEgOrYvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureWebCategoryIDInsensitively(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.AzureWebCategoryName != v.Expected.AzureWebCategoryName { - t.Fatalf("Expected %q but got %q for AzureWebCategoryName", v.Expected.AzureWebCategoryName, actual.AzureWebCategoryName) - } - - } -} - -func TestSegmentsForAzureWebCategoryId(t *testing.T) { - segments := AzureWebCategoryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AzureWebCategoryId 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/network/2023-05-01/webcategories/method_get.go b/resource-manager/network/2023-05-01/webcategories/method_get.go deleted file mode 100644 index 9038c189875..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package webcategories - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AzureWebCategory -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c WebCategoriesClient) Get(ctx context.Context, id AzureWebCategoryId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 AzureWebCategory - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-05-01/webcategories/method_listbysubscription.go b/resource-manager/network/2023-05-01/webcategories/method_listbysubscription.go deleted file mode 100644 index 6437d9e3bea..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package webcategories - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AzureWebCategory -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureWebCategory -} - -// ListBySubscription ... -func (c WebCategoriesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/azureWebCategories", 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 *[]AzureWebCategory `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c WebCategoriesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, AzureWebCategoryOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebCategoriesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AzureWebCategoryOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]AzureWebCategory, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-05-01/webcategories/model_azurewebcategory.go b/resource-manager/network/2023-05-01/webcategories/model_azurewebcategory.go deleted file mode 100644 index 81fe8aa1777..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/model_azurewebcategory.go +++ /dev/null @@ -1,12 +0,0 @@ -package webcategories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWebCategory struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureWebCategoryPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webcategories/model_azurewebcategorypropertiesformat.go b/resource-manager/network/2023-05-01/webcategories/model_azurewebcategorypropertiesformat.go deleted file mode 100644 index 7e327867064..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/model_azurewebcategorypropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package webcategories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWebCategoryPropertiesFormat struct { - Group *string `json:"group,omitempty"` -} diff --git a/resource-manager/network/2023-05-01/webcategories/predicates.go b/resource-manager/network/2023-05-01/webcategories/predicates.go deleted file mode 100644 index ab82b0c92b5..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package webcategories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWebCategoryOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AzureWebCategoryOperationPredicate) Matches(input AzureWebCategory) 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.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/network/2023-05-01/webcategories/version.go b/resource-manager/network/2023-05-01/webcategories/version.go deleted file mode 100644 index 5cc31d76e7a..00000000000 --- a/resource-manager/network/2023-05-01/webcategories/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webcategories - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-05-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webcategories/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/README.md b/resource-manager/network/2023-06-01/adminrulecollections/README.md deleted file mode 100644 index dd0c6f064e7..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/adminrulecollections` Documentation - -The `adminrulecollections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/adminrulecollections" -``` - - -### Client Initialization - -```go -client := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdminRuleCollectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -payload := adminrulecollections.AdminRuleCollection{ - // ... -} - - -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: `AdminRuleCollectionsClient.Delete` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -if err := client.DeleteThenPoll(ctx, id, adminrulecollections.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AdminRuleCollectionsClient.Get` - -```go -ctx := context.TODO() -id := adminrulecollections.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -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: `AdminRuleCollectionsClient.List` - -```go -ctx := context.TODO() -id := adminrulecollections.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -// alternatively `client.List(ctx, id, adminrulecollections.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, adminrulecollections.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/adminrulecollections/client.go b/resource-manager/network/2023-06-01/adminrulecollections/client.go deleted file mode 100644 index adbf2674d97..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package adminrulecollections - -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 AdminRuleCollectionsClient struct { - Client *resourcemanager.Client -} - -func NewAdminRuleCollectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*AdminRuleCollectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "adminrulecollections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AdminRuleCollectionsClient: %+v", err) - } - - return &AdminRuleCollectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/constants.go b/resource-manager/network/2023-06-01/adminrulecollections/constants.go deleted file mode 100644 index d3e735bf0f1..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package adminrulecollections - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection.go b/resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection.go deleted file mode 100644 index 5c84e59671e..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection.go +++ /dev/null @@ -1,148 +0,0 @@ -package adminrulecollections - -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(&RuleCollectionId{}) -} - -var _ resourceids.ResourceId = &RuleCollectionId{} - -// RuleCollectionId is a struct representing the Resource ID for a Rule Collection -type RuleCollectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string - RuleCollectionName string -} - -// NewRuleCollectionID returns a new RuleCollectionId struct -func NewRuleCollectionID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string) RuleCollectionId { - return RuleCollectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - RuleCollectionName: ruleCollectionName, - } -} - -// ParseRuleCollectionID parses 'input' into a RuleCollectionId -func ParseRuleCollectionID(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleCollectionIDInsensitively parses 'input' case-insensitively into a RuleCollectionId -// note: this method should only be used for API response data and not user input -func ParseRuleCollectionIDInsensitively(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleCollectionId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - if id.RuleCollectionName, ok = input.Parsed["ruleCollectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionName", input) - } - - return nil -} - -// ValidateRuleCollectionID checks that 'input' can be parsed as a Rule Collection ID -func ValidateRuleCollectionID(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 := ParseRuleCollectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule Collection ID -func (id RuleCollectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s/ruleCollections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName, id.RuleCollectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule Collection ID -func (id RuleCollectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), - resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionValue"), - } -} - -// String returns a human-readable description of this Rule Collection ID -func (id RuleCollectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - fmt.Sprintf("Rule Collection Name: %q", id.RuleCollectionName), - } - return fmt.Sprintf("Rule Collection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection_test.go b/resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection_test.go deleted file mode 100644 index f887adb5138..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/id_rulecollection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package adminrulecollections - -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 = &RuleCollectionId{} - -func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } - - if id.RuleCollectionName != "ruleCollectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionName'", id.RuleCollectionName, "ruleCollectionValue") - } -} - -func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleCollectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestParseRuleCollectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - RuleCollectionName: "rUlEcOlLeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestSegmentsForRuleCollectionId(t *testing.T) { - segments := RuleCollectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleCollectionId 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/network/2023-06-01/adminrulecollections/id_securityadminconfiguration.go b/resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration.go deleted file mode 100644 index b8186efef3b..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package adminrulecollections - -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(&SecurityAdminConfigurationId{}) -} - -var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} - -// SecurityAdminConfigurationId is a struct representing the Resource ID for a Security Admin Configuration -type SecurityAdminConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string -} - -// NewSecurityAdminConfigurationID returns a new SecurityAdminConfigurationId struct -func NewSecurityAdminConfigurationID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string) SecurityAdminConfigurationId { - return SecurityAdminConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - } -} - -// ParseSecurityAdminConfigurationID parses 'input' into a SecurityAdminConfigurationId -func ParseSecurityAdminConfigurationID(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityAdminConfigurationIDInsensitively parses 'input' case-insensitively into a SecurityAdminConfigurationId -// note: this method should only be used for API response data and not user input -func ParseSecurityAdminConfigurationIDInsensitively(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityAdminConfigurationId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - return nil -} - -// ValidateSecurityAdminConfigurationID checks that 'input' can be parsed as a Security Admin Configuration ID -func ValidateSecurityAdminConfigurationID(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 := ParseSecurityAdminConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Admin Configuration ID -func (id SecurityAdminConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - } -} - -// String returns a human-readable description of this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - } - return fmt.Sprintf("Security Admin Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration_test.go b/resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration_test.go deleted file mode 100644 index 1dbffe93a7e..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/id_securityadminconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package adminrulecollections - -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 = &SecurityAdminConfigurationId{} - -func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } -} - -func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityAdminConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestSegmentsForSecurityAdminConfigurationId(t *testing.T) { - segments := SecurityAdminConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityAdminConfigurationId 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/network/2023-06-01/adminrulecollections/method_createorupdate.go b/resource-manager/network/2023-06-01/adminrulecollections/method_createorupdate.go deleted file mode 100644 index 67a6db6eb7b..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package adminrulecollections - -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 *AdminRuleCollection -} - -// CreateOrUpdate ... -func (c AdminRuleCollectionsClient) CreateOrUpdate(ctx context.Context, id RuleCollectionId, input AdminRuleCollection) (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 AdminRuleCollection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/method_delete.go b/resource-manager/network/2023-06-01/adminrulecollections/method_delete.go deleted file mode 100644 index 2a158c78562..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package adminrulecollections - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 AdminRuleCollectionsClient) Delete(ctx context.Context, id RuleCollectionId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 AdminRuleCollectionsClient) DeleteThenPoll(ctx context.Context, id RuleCollectionId, 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/network/2023-06-01/adminrulecollections/method_get.go b/resource-manager/network/2023-06-01/adminrulecollections/method_get.go deleted file mode 100644 index 8beb93c5eca..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package adminrulecollections - -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 *AdminRuleCollection -} - -// Get ... -func (c AdminRuleCollectionsClient) Get(ctx context.Context, id RuleCollectionId) (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 AdminRuleCollection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/method_list.go b/resource-manager/network/2023-06-01/adminrulecollections/method_list.go deleted file mode 100644 index b7d5d537d04..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package adminrulecollections - -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 *[]AdminRuleCollection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AdminRuleCollection -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c AdminRuleCollectionsClient) List(ctx context.Context, id SecurityAdminConfigurationId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ruleCollections", id.ID()), - OptionsObject: options, - } - - 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 *[]AdminRuleCollection `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 AdminRuleCollectionsClient) ListComplete(ctx context.Context, id SecurityAdminConfigurationId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, AdminRuleCollectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AdminRuleCollectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id SecurityAdminConfigurationId, options ListOperationOptions, predicate AdminRuleCollectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AdminRuleCollection, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/adminrulecollections/model_adminrulecollection.go b/resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollection.go deleted file mode 100644 index aea91d2ba70..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollection.go +++ /dev/null @@ -1,17 +0,0 @@ -package adminrulecollections - -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 AdminRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AdminRuleCollectionPropertiesFormat `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go b/resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go deleted file mode 100644 index 43e02d8ca9c..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/model_adminrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminRuleCollectionPropertiesFormat struct { - AppliesToGroups []NetworkManagerSecurityGroupItem `json:"appliesToGroups"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2023-06-01/adminrulecollections/model_networkmanagersecuritygroupitem.go deleted file mode 100644 index ce59c38f4fd..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/model_networkmanagersecuritygroupitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerSecurityGroupItem struct { - NetworkGroupId string `json:"networkGroupId"` -} diff --git a/resource-manager/network/2023-06-01/adminrulecollections/predicates.go b/resource-manager/network/2023-06-01/adminrulecollections/predicates.go deleted file mode 100644 index 67b37b95643..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package adminrulecollections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminRuleCollectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AdminRuleCollectionOperationPredicate) Matches(input AdminRuleCollection) 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.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/network/2023-06-01/adminrulecollections/version.go b/resource-manager/network/2023-06-01/adminrulecollections/version.go deleted file mode 100644 index 89ac7177782..00000000000 --- a/resource-manager/network/2023-06-01/adminrulecollections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrulecollections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/adminrulecollections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/adminrules/README.md b/resource-manager/network/2023-06-01/adminrules/README.md deleted file mode 100644 index 3d36634125c..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/adminrules` Documentation - -The `adminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/adminrules" -``` - - -### Client Initialization - -```go -client := adminrules.NewAdminRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdminRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -payload := adminrules.BaseAdminRule{ - // ... -} - - -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: `AdminRulesClient.Delete` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -if err := client.DeleteThenPoll(ctx, id, adminrules.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `AdminRulesClient.Get` - -```go -ctx := context.TODO() -id := adminrules.NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - -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: `AdminRulesClient.List` - -```go -ctx := context.TODO() -id := adminrules.NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - -// 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/network/2023-06-01/adminrules/client.go b/resource-manager/network/2023-06-01/adminrules/client.go deleted file mode 100644 index 40da5b4d0a4..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package adminrules - -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 AdminRulesClient struct { - Client *resourcemanager.Client -} - -func NewAdminRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AdminRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "adminrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AdminRulesClient: %+v", err) - } - - return &AdminRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/adminrules/constants.go b/resource-manager/network/2023-06-01/adminrules/constants.go deleted file mode 100644 index fbaa03c5543..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package adminrules - -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 AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -func PossibleValuesForAddressPrefixType() []string { - return []string{ - string(AddressPrefixTypeIPPrefix), - string(AddressPrefixTypeServiceTag), - } -} - -func (s *AddressPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAddressPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAddressPrefixType(input string) (*AddressPrefixType, error) { - vals := map[string]AddressPrefixType{ - "ipprefix": AddressPrefixTypeIPPrefix, - "servicetag": AddressPrefixTypeServiceTag, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AddressPrefixType(input) - return &out, nil -} - -type AdminRuleKind string - -const ( - AdminRuleKindCustom AdminRuleKind = "Custom" - AdminRuleKindDefault AdminRuleKind = "Default" -) - -func PossibleValuesForAdminRuleKind() []string { - return []string{ - string(AdminRuleKindCustom), - string(AdminRuleKindDefault), - } -} - -func (s *AdminRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminRuleKind(input string) (*AdminRuleKind, error) { - vals := map[string]AdminRuleKind{ - "custom": AdminRuleKindCustom, - "default": AdminRuleKindDefault, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminRuleKind(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -func PossibleValuesForSecurityConfigurationRuleAccess() []string { - return []string{ - string(SecurityConfigurationRuleAccessAllow), - string(SecurityConfigurationRuleAccessAlwaysAllow), - string(SecurityConfigurationRuleAccessDeny), - } -} - -func (s *SecurityConfigurationRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleAccess(input string) (*SecurityConfigurationRuleAccess, error) { - vals := map[string]SecurityConfigurationRuleAccess{ - "allow": SecurityConfigurationRuleAccessAllow, - "alwaysallow": SecurityConfigurationRuleAccessAlwaysAllow, - "deny": SecurityConfigurationRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleAccess(input) - return &out, nil -} - -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityConfigurationRuleDirection() []string { - return []string{ - string(SecurityConfigurationRuleDirectionInbound), - string(SecurityConfigurationRuleDirectionOutbound), - } -} - -func (s *SecurityConfigurationRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleDirection(input string) (*SecurityConfigurationRuleDirection, error) { - vals := map[string]SecurityConfigurationRuleDirection{ - "inbound": SecurityConfigurationRuleDirectionInbound, - "outbound": SecurityConfigurationRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleDirection(input) - return &out, nil -} - -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTcp SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUdp SecurityConfigurationRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityConfigurationRuleProtocol() []string { - return []string{ - string(SecurityConfigurationRuleProtocolAh), - string(SecurityConfigurationRuleProtocolAny), - string(SecurityConfigurationRuleProtocolEsp), - string(SecurityConfigurationRuleProtocolIcmp), - string(SecurityConfigurationRuleProtocolTcp), - string(SecurityConfigurationRuleProtocolUdp), - } -} - -func (s *SecurityConfigurationRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleProtocol(input string) (*SecurityConfigurationRuleProtocol, error) { - vals := map[string]SecurityConfigurationRuleProtocol{ - "ah": SecurityConfigurationRuleProtocolAh, - "any": SecurityConfigurationRuleProtocolAny, - "esp": SecurityConfigurationRuleProtocolEsp, - "icmp": SecurityConfigurationRuleProtocolIcmp, - "tcp": SecurityConfigurationRuleProtocolTcp, - "udp": SecurityConfigurationRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/adminrules/id_rule.go b/resource-manager/network/2023-06-01/adminrules/id_rule.go deleted file mode 100644 index 3b132449062..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/id_rule.go +++ /dev/null @@ -1,157 +0,0 @@ -package adminrules - -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(&RuleId{}) -} - -var _ resourceids.ResourceId = &RuleId{} - -// RuleId is a struct representing the Resource ID for a Rule -type RuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string - RuleCollectionName string - RuleName string -} - -// NewRuleID returns a new RuleId struct -func NewRuleID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string, ruleName string) RuleId { - return RuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - RuleCollectionName: ruleCollectionName, - RuleName: ruleName, - } -} - -// ParseRuleID parses 'input' into a RuleId -func ParseRuleID(input string) (*RuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleIDInsensitively parses 'input' case-insensitively into a RuleId -// note: this method should only be used for API response data and not user input -func ParseRuleIDInsensitively(input string) (*RuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - if id.RuleCollectionName, ok = input.Parsed["ruleCollectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionName", input) - } - - if id.RuleName, ok = input.Parsed["ruleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleName", input) - } - - return nil -} - -// ValidateRuleID checks that 'input' can be parsed as a Rule ID -func ValidateRuleID(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 := ParseRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule ID -func (id RuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s/ruleCollections/%s/rules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName, id.RuleCollectionName, id.RuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule ID -func (id RuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), - resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionValue"), - resourceids.StaticSegment("staticRules", "rules", "rules"), - resourceids.UserSpecifiedSegment("ruleName", "ruleValue"), - } -} - -// String returns a human-readable description of this Rule ID -func (id RuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - fmt.Sprintf("Rule Collection Name: %q", id.RuleCollectionName), - fmt.Sprintf("Rule Name: %q", id.RuleName), - } - return fmt.Sprintf("Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/adminrules/id_rule_test.go b/resource-manager/network/2023-06-01/adminrules/id_rule_test.go deleted file mode 100644 index 755182392b5..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/id_rule_test.go +++ /dev/null @@ -1,417 +0,0 @@ -package adminrules - -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 = &RuleId{} - -func TestNewRuleID(t *testing.T) { - id := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } - - if id.RuleCollectionName != "ruleCollectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionName'", id.RuleCollectionName, "ruleCollectionValue") - } - - if id.RuleName != "ruleValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleName'", id.RuleName, "ruleValue") - } -} - -func TestFormatRuleID(t *testing.T) { - actual := NewRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue", "ruleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue", - Expected: &RuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - RuleName: "ruleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - if actual.RuleName != v.Expected.RuleName { - t.Fatalf("Expected %q but got %q for RuleName", v.Expected.RuleName, actual.RuleName) - } - - } -} - -func TestParseRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/rUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue", - Expected: &RuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - RuleName: "ruleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/rules/ruleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/rUlEs/rUlEvAlUe", - Expected: &RuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - RuleCollectionName: "rUlEcOlLeCtIoNvAlUe", - RuleName: "rUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/rUlEs/rUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - if actual.RuleName != v.Expected.RuleName { - t.Fatalf("Expected %q but got %q for RuleName", v.Expected.RuleName, actual.RuleName) - } - - } -} - -func TestSegmentsForRuleId(t *testing.T) { - segments := RuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleId 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/network/2023-06-01/adminrules/id_rulecollection.go b/resource-manager/network/2023-06-01/adminrules/id_rulecollection.go deleted file mode 100644 index 6dd9dd5b0a8..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/id_rulecollection.go +++ /dev/null @@ -1,148 +0,0 @@ -package adminrules - -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(&RuleCollectionId{}) -} - -var _ resourceids.ResourceId = &RuleCollectionId{} - -// RuleCollectionId is a struct representing the Resource ID for a Rule Collection -type RuleCollectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string - RuleCollectionName string -} - -// NewRuleCollectionID returns a new RuleCollectionId struct -func NewRuleCollectionID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string, ruleCollectionName string) RuleCollectionId { - return RuleCollectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - RuleCollectionName: ruleCollectionName, - } -} - -// ParseRuleCollectionID parses 'input' into a RuleCollectionId -func ParseRuleCollectionID(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleCollectionIDInsensitively parses 'input' case-insensitively into a RuleCollectionId -// note: this method should only be used for API response data and not user input -func ParseRuleCollectionIDInsensitively(input string) (*RuleCollectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleCollectionId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - if id.RuleCollectionName, ok = input.Parsed["ruleCollectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionName", input) - } - - return nil -} - -// ValidateRuleCollectionID checks that 'input' can be parsed as a Rule Collection ID -func ValidateRuleCollectionID(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 := ParseRuleCollectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule Collection ID -func (id RuleCollectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s/ruleCollections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName, id.RuleCollectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule Collection ID -func (id RuleCollectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - resourceids.StaticSegment("staticRuleCollections", "ruleCollections", "ruleCollections"), - resourceids.UserSpecifiedSegment("ruleCollectionName", "ruleCollectionValue"), - } -} - -// String returns a human-readable description of this Rule Collection ID -func (id RuleCollectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - fmt.Sprintf("Rule Collection Name: %q", id.RuleCollectionName), - } - return fmt.Sprintf("Rule Collection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/adminrules/id_rulecollection_test.go b/resource-manager/network/2023-06-01/adminrules/id_rulecollection_test.go deleted file mode 100644 index f93da939de7..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/id_rulecollection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package adminrules - -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 = &RuleCollectionId{} - -func TestNewRuleCollectionID(t *testing.T) { - id := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } - - if id.RuleCollectionName != "ruleCollectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionName'", id.RuleCollectionName, "ruleCollectionValue") - } -} - -func TestFormatRuleCollectionID(t *testing.T) { - actual := NewRuleCollectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue", "ruleCollectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleCollectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestParseRuleCollectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - RuleCollectionName: "ruleCollectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/ruleCollections/ruleCollectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe", - Expected: &RuleCollectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - RuleCollectionName: "rUlEcOlLeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/rUlEcOlLeCtIoNs/rUlEcOlLeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - if actual.RuleCollectionName != v.Expected.RuleCollectionName { - t.Fatalf("Expected %q but got %q for RuleCollectionName", v.Expected.RuleCollectionName, actual.RuleCollectionName) - } - - } -} - -func TestSegmentsForRuleCollectionId(t *testing.T) { - segments := RuleCollectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleCollectionId 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/network/2023-06-01/adminrules/method_createorupdate.go b/resource-manager/network/2023-06-01/adminrules/method_createorupdate.go deleted file mode 100644 index d936a5666f1..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package adminrules - -import ( - "context" - "encoding/json" - "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 *BaseAdminRule -} - -// CreateOrUpdate ... -func (c AdminRulesClient) CreateOrUpdate(ctx context.Context, id RuleId, input BaseAdminRule) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalBaseAdminRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/network/2023-06-01/adminrules/method_delete.go b/resource-manager/network/2023-06-01/adminrules/method_delete.go deleted file mode 100644 index 6d7b0f948b8..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package adminrules - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 AdminRulesClient) Delete(ctx context.Context, id RuleId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 AdminRulesClient) DeleteThenPoll(ctx context.Context, id RuleId, 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/network/2023-06-01/adminrules/method_get.go b/resource-manager/network/2023-06-01/adminrules/method_get.go deleted file mode 100644 index 94337a0e139..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package adminrules - -import ( - "context" - "encoding/json" - "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 *BaseAdminRule -} - -// Get ... -func (c AdminRulesClient) Get(ctx context.Context, id RuleId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalBaseAdminRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/network/2023-06-01/adminrules/method_list.go b/resource-manager/network/2023-06-01/adminrules/method_list.go deleted file mode 100644 index 977c19ec540..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package adminrules - -import ( - "context" - "encoding/json" - "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 *[]BaseAdminRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BaseAdminRule -} - -// List ... -func (c AdminRulesClient) List(ctx context.Context, id RuleCollectionId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/rules", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]BaseAdminRule, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalBaseAdminRuleImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for BaseAdminRule (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AdminRulesClient) ListComplete(ctx context.Context, id RuleCollectionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BaseAdminRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AdminRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id RuleCollectionId, predicate BaseAdminRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]BaseAdminRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/adminrules/model_addressprefixitem.go b/resource-manager/network/2023-06-01/adminrules/model_addressprefixitem.go deleted file mode 100644 index 223aec22448..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/model_addressprefixitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressPrefixItem struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/adminrules/model_adminpropertiesformat.go b/resource-manager/network/2023-06-01/adminrules/model_adminpropertiesformat.go deleted file mode 100644 index a0e21af6c0d..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/adminrules/model_adminrule.go b/resource-manager/network/2023-06-01/adminrules/model_adminrule.go deleted file mode 100644 index 8544cf3cd71..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/model_adminrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package adminrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ BaseAdminRule = AdminRule{} - -type AdminRule struct { - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from BaseAdminRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AdminRule{} - -func (s AdminRule) MarshalJSON() ([]byte, error) { - type wrapper AdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AdminRule: %+v", err) - } - decoded["kind"] = "Custom" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/adminrules/model_baseadminrule.go b/resource-manager/network/2023-06-01/adminrules/model_baseadminrule.go deleted file mode 100644 index bbcabba727e..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/model_baseadminrule.go +++ /dev/null @@ -1,61 +0,0 @@ -package adminrules - -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 BaseAdminRule interface { -} - -// RawBaseAdminRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawBaseAdminRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalBaseAdminRuleImplementation(input []byte) (BaseAdminRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling BaseAdminRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Custom") { - var out AdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AdminRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Default") { - var out DefaultAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DefaultAdminRule: %+v", err) - } - return out, nil - } - - out := RawBaseAdminRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-06-01/adminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-06-01/adminrules/model_defaultadminpropertiesformat.go deleted file mode 100644 index a8242069c88..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/adminrules/model_defaultadminrule.go b/resource-manager/network/2023-06-01/adminrules/model_defaultadminrule.go deleted file mode 100644 index 7a93ae7edc9..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/model_defaultadminrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package adminrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ BaseAdminRule = DefaultAdminRule{} - -type DefaultAdminRule struct { - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from BaseAdminRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DefaultAdminRule{} - -func (s DefaultAdminRule) MarshalJSON() ([]byte, error) { - type wrapper DefaultAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DefaultAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DefaultAdminRule: %+v", err) - } - decoded["kind"] = "Default" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DefaultAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/adminrules/predicates.go b/resource-manager/network/2023-06-01/adminrules/predicates.go deleted file mode 100644 index f594b9ac1be..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BaseAdminRuleOperationPredicate struct { -} - -func (p BaseAdminRuleOperationPredicate) Matches(input BaseAdminRule) bool { - - return true -} diff --git a/resource-manager/network/2023-06-01/adminrules/version.go b/resource-manager/network/2023-06-01/adminrules/version.go deleted file mode 100644 index 12211909500..00000000000 --- a/resource-manager/network/2023-06-01/adminrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package adminrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/adminrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/README.md b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/README.md deleted file mode 100644 index 24b03ed3c78..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections` Documentation - -The `applicationgatewayprivateendpointconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/applicationgatewayprivateendpointconnections" -``` - - -### Client Initialization - -```go -client := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewayPrivateEndpointConnectionsClient.Get` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -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: `ApplicationGatewayPrivateEndpointConnectionsClient.List` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -// 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: `ApplicationGatewayPrivateEndpointConnectionsClient.Update` - -```go -ctx := context.TODO() -id := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - -payload := applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnection{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/client.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/client.go deleted file mode 100644 index 10a57c1c475..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 ApplicationGatewayPrivateEndpointConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewayPrivateEndpointConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgatewayprivateendpointconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewayPrivateEndpointConnectionsClient: %+v", err) - } - - return &ApplicationGatewayPrivateEndpointConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/constants.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/constants.go deleted file mode 100644 index 815302663c9..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go deleted file mode 100644 index e1cb4795761..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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(&ApplicationGatewayId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayId{} - -// ApplicationGatewayId is a struct representing the Resource ID for a Application Gateway -type ApplicationGatewayId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string -} - -// NewApplicationGatewayID returns a new ApplicationGatewayId struct -func NewApplicationGatewayID(subscriptionId string, resourceGroupName string, applicationGatewayName string) ApplicationGatewayId { - return ApplicationGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - } -} - -// ParseApplicationGatewayID parses 'input' into a ApplicationGatewayId -func ParseApplicationGatewayID(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayIDInsensitively(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - return nil -} - -// ValidateApplicationGatewayID checks that 'input' can be parsed as a Application Gateway ID -func ValidateApplicationGatewayID(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 := ParseApplicationGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway ID -func (id ApplicationGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway ID -func (id ApplicationGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - } -} - -// String returns a human-readable description of this Application Gateway ID -func (id ApplicationGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - } - return fmt.Sprintf("Application Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go deleted file mode 100644 index abc9f9e0c40..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 = &ApplicationGatewayId{} - -func TestNewApplicationGatewayID(t *testing.T) { - id := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } -} - -func TestFormatApplicationGatewayID(t *testing.T) { - actual := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestParseApplicationGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestSegmentsForApplicationGatewayId(t *testing.T) { - segments := ApplicationGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayId 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/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index aad51fee91b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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(&ApplicationGatewayPrivateEndpointConnectionId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayPrivateEndpointConnectionId{} - -// ApplicationGatewayPrivateEndpointConnectionId is a struct representing the Resource ID for a Application Gateway Private Endpoint Connection -type ApplicationGatewayPrivateEndpointConnectionId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string - PrivateEndpointConnectionName string -} - -// NewApplicationGatewayPrivateEndpointConnectionID returns a new ApplicationGatewayPrivateEndpointConnectionId struct -func NewApplicationGatewayPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, applicationGatewayName string, privateEndpointConnectionName string) ApplicationGatewayPrivateEndpointConnectionId { - return ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - PrivateEndpointConnectionName: privateEndpointConnectionName, - } -} - -// ParseApplicationGatewayPrivateEndpointConnectionID parses 'input' into a ApplicationGatewayPrivateEndpointConnectionId -func ParseApplicationGatewayPrivateEndpointConnectionID(input string) (*ApplicationGatewayPrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayPrivateEndpointConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayPrivateEndpointConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayPrivateEndpointConnectionIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayPrivateEndpointConnectionId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(input string) (*ApplicationGatewayPrivateEndpointConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayPrivateEndpointConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayPrivateEndpointConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayPrivateEndpointConnectionId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - if id.PrivateEndpointConnectionName, ok = input.Parsed["privateEndpointConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointConnectionName", input) - } - - return nil -} - -// ValidateApplicationGatewayPrivateEndpointConnectionID checks that 'input' can be parsed as a Application Gateway Private Endpoint Connection ID -func ValidateApplicationGatewayPrivateEndpointConnectionID(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 := ParseApplicationGatewayPrivateEndpointConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway Private Endpoint Connection ID -func (id ApplicationGatewayPrivateEndpointConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s/privateEndpointConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName, id.PrivateEndpointConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway Private Endpoint Connection ID -func (id ApplicationGatewayPrivateEndpointConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// String returns a human-readable description of this Application Gateway Private Endpoint Connection ID -func (id ApplicationGatewayPrivateEndpointConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - fmt.Sprintf("Private Endpoint Connection Name: %q", id.PrivateEndpointConnectionName), - } - return fmt.Sprintf("Application Gateway Private Endpoint Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go deleted file mode 100644 index 89bf57821c8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/id_applicationgatewayprivateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 = &ApplicationGatewayPrivateEndpointConnectionId{} - -func TestNewApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - id := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - actual := NewApplicationGatewayPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayPrivateEndpointConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayPrivateEndpointConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayPrivateEndpointConnectionID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - if actual.PrivateEndpointConnectionName != v.Expected.PrivateEndpointConnectionName { - t.Fatalf("Expected %q but got %q for PrivateEndpointConnectionName", v.Expected.PrivateEndpointConnectionName, actual.PrivateEndpointConnectionName) - } - - } -} - -func TestParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayPrivateEndpointConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &ApplicationGatewayPrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayPrivateEndpointConnectionIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - if actual.PrivateEndpointConnectionName != v.Expected.PrivateEndpointConnectionName { - t.Fatalf("Expected %q but got %q for PrivateEndpointConnectionName", v.Expected.PrivateEndpointConnectionName, actual.PrivateEndpointConnectionName) - } - - } -} - -func TestSegmentsForApplicationGatewayPrivateEndpointConnectionId(t *testing.T) { - segments := ApplicationGatewayPrivateEndpointConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayPrivateEndpointConnectionId 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/network/2023-06-01/applicationgatewayprivateendpointconnections/method_delete.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_delete.go deleted file mode 100644 index 8a25d1654cc..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 ApplicationGatewayPrivateEndpointConnectionsClient) Delete(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationGatewayPrivateEndpointConnectionsClient) DeleteThenPoll(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId) 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/network/2023-06-01/applicationgatewayprivateendpointconnections/method_get.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_get.go deleted file mode 100644 index f3f7a21ab28..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 *ApplicationGatewayPrivateEndpointConnection -} - -// Get ... -func (c ApplicationGatewayPrivateEndpointConnectionsClient) Get(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId) (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 ApplicationGatewayPrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_list.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_list.go deleted file mode 100644 index 3ea8f85bf3f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 *[]ApplicationGatewayPrivateEndpointConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewayPrivateEndpointConnection -} - -// List ... -func (c ApplicationGatewayPrivateEndpointConnectionsClient) List(ctx context.Context, id ApplicationGatewayId) (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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]ApplicationGatewayPrivateEndpointConnection `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 ApplicationGatewayPrivateEndpointConnectionsClient) ListComplete(ctx context.Context, id ApplicationGatewayId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationGatewayPrivateEndpointConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewayPrivateEndpointConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id ApplicationGatewayId, predicate ApplicationGatewayPrivateEndpointConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationGatewayPrivateEndpointConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/applicationgatewayprivateendpointconnections/method_update.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_update.go deleted file mode 100644 index 394f02e54dd..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayPrivateEndpointConnection -} - -// Update ... -func (c ApplicationGatewayPrivateEndpointConnectionsClient) Update(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId, input ApplicationGatewayPrivateEndpointConnection) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ApplicationGatewayPrivateEndpointConnectionsClient) UpdateThenPoll(ctx context.Context, id ApplicationGatewayPrivateEndpointConnectionId, input ApplicationGatewayPrivateEndpointConnection) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 19262bd584a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 049337217fe..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 508dc9994b4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 89d75010a65..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 5d46fc4d14d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index 899ea09f853..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go deleted file mode 100644 index 19f24417e8b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationgatewayprivateendpointconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go deleted file mode 100644 index 6cfad393dcc..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index f494b4f811b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go deleted file mode 100644 index f5906c781bd..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index d3eb3749cba..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 0e7c2876d57..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ddossettings.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ddossettings.go deleted file mode 100644 index 84bb3713a5f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_delegation.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_delegation.go deleted file mode 100644 index db8d3269de6..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlog.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlog.go deleted file mode 100644 index b3f068af815..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go deleted file mode 100644 index 0b6831f6fa6..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go deleted file mode 100644 index 922ced2b2f1..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go deleted file mode 100644 index 5d4f44391e7..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index f8184b617b0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index d1d69ce0587..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go deleted file mode 100644 index a9b0e096bd3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 30f69829656..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go deleted file mode 100644 index 38591b7aaa2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go deleted file mode 100644 index a118ebdd4e1..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 75728fa1ebe..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index b2f70477897..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_iptag.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_iptag.go deleted file mode 100644 index c1aef66c21f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go deleted file mode 100644 index 7c55794d5db..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 786682fa462..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgateway.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgateway.go deleted file mode 100644 index f7258d97962..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package applicationgatewayprivateendpointconnections - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7384cd2e1a6..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go deleted file mode 100644 index 17af8527640..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go deleted file mode 100644 index d1f6b522fcc..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterface.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterface.go deleted file mode 100644 index 27dd4a4a08a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go deleted file mode 100644 index 6b7723bb374..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 5b9d0f918bf..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index fc79de05a6f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 96eeeb31d67..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 4b7b529ab7d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 54a119f8358..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 2812f9ea959..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go deleted file mode 100644 index cb2c6128022..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 2ec03e22f7c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go deleted file mode 100644 index c59c28f78d1..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go deleted file mode 100644 index ad89494737c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go deleted file mode 100644 index f1877976742..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go deleted file mode 100644 index bd3c50f01ac..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index f3ec0dcc86e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go deleted file mode 100644 index d7be5354bcd..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go deleted file mode 100644 index 78a6c7ebba8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go deleted file mode 100644 index 5cc8a8e4dbf..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 461fb1081a9..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 6be96efd9df..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 3c19c2d4de4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index c81dae99663..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go deleted file mode 100644 index dc3f962814c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go deleted file mode 100644 index e89345d55bc..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go deleted file mode 100644 index 38e3265c5cf..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go deleted file mode 100644 index f699284c895..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go deleted file mode 100644 index b74d0311a75..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go deleted file mode 100644 index 0274f951e3c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go deleted file mode 100644 index 4182988a892..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourceset.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourceset.go deleted file mode 100644 index 075d9853046..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go deleted file mode 100644 index 2b030c17554..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_route.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_route.go deleted file mode 100644 index 939f9379822..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go deleted file mode 100644 index 4afa3c6bed4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetable.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetable.go deleted file mode 100644 index 8a1cf00052b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go deleted file mode 100644 index c3a2020ea09..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrule.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrule.go deleted file mode 100644 index e892509d682..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go deleted file mode 100644 index ad268f42e3d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go deleted file mode 100644 index 208a786f7a0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index eaf8e403c15..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go deleted file mode 100644 index a8da5cf7bca..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go deleted file mode 100644 index 0871d765423..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 9051f5afd03..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index c8f3720498a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 27a0c5e36ce..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go deleted file mode 100644 index fa1f92d606a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnet.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnet.go deleted file mode 100644 index 315bdbd9d59..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go deleted file mode 100644 index 44895bdbae8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subresource.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subresource.go deleted file mode 100644 index 7cea1d49c02..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 860948a52b3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go deleted file mode 100644 index 92e4c14749f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go deleted file mode 100644 index 7c49436256c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 131405acb48..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/predicates.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/predicates.go deleted file mode 100644 index 46757c5239b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package applicationgatewayprivateendpointconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ApplicationGatewayPrivateEndpointConnectionOperationPredicate) Matches(input ApplicationGatewayPrivateEndpointConnection) 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.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/network/2023-06-01/applicationgatewayprivateendpointconnections/version.go b/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/version.go deleted file mode 100644 index 56fa4cb9fd5..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivateendpointconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivateendpointconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/README.md b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/README.md deleted file mode 100644 index 0b2c1593724..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources` Documentation - -The `applicationgatewayprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/applicationgatewayprivatelinkresources" -``` - - -### Client Initialization - -```go -client := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayPrivateLinkResourcesClient.List` - -```go -ctx := context.TODO() -id := applicationgatewayprivatelinkresources.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -// 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/network/2023-06-01/applicationgatewayprivatelinkresources/client.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/client.go deleted file mode 100644 index 9e064641526..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewayprivatelinkresources - -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 ApplicationGatewayPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewayPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgatewayprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewayPrivateLinkResourcesClient: %+v", err) - } - - return &ApplicationGatewayPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway.go deleted file mode 100644 index f86cb06512e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationgatewayprivatelinkresources - -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(&ApplicationGatewayId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayId{} - -// ApplicationGatewayId is a struct representing the Resource ID for a Application Gateway -type ApplicationGatewayId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string -} - -// NewApplicationGatewayID returns a new ApplicationGatewayId struct -func NewApplicationGatewayID(subscriptionId string, resourceGroupName string, applicationGatewayName string) ApplicationGatewayId { - return ApplicationGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - } -} - -// ParseApplicationGatewayID parses 'input' into a ApplicationGatewayId -func ParseApplicationGatewayID(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayIDInsensitively(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - return nil -} - -// ValidateApplicationGatewayID checks that 'input' can be parsed as a Application Gateway ID -func ValidateApplicationGatewayID(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 := ParseApplicationGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway ID -func (id ApplicationGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway ID -func (id ApplicationGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - } -} - -// String returns a human-readable description of this Application Gateway ID -func (id ApplicationGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - } - return fmt.Sprintf("Application Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go deleted file mode 100644 index 5c994f79587..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/id_applicationgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationgatewayprivatelinkresources - -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 = &ApplicationGatewayId{} - -func TestNewApplicationGatewayID(t *testing.T) { - id := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } -} - -func TestFormatApplicationGatewayID(t *testing.T) { - actual := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestParseApplicationGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestSegmentsForApplicationGatewayId(t *testing.T) { - segments := ApplicationGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayId 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/network/2023-06-01/applicationgatewayprivatelinkresources/method_list.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/method_list.go deleted file mode 100644 index 9d2d22e7464..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package applicationgatewayprivatelinkresources - -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 *[]ApplicationGatewayPrivateLinkResource -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewayPrivateLinkResource -} - -// List ... -func (c ApplicationGatewayPrivateLinkResourcesClient) List(ctx context.Context, id ApplicationGatewayId) (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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]ApplicationGatewayPrivateLinkResource `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 ApplicationGatewayPrivateLinkResourcesClient) ListComplete(ctx context.Context, id ApplicationGatewayId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationGatewayPrivateLinkResourceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewayPrivateLinkResourcesClient) ListCompleteMatchingPredicate(ctx context.Context, id ApplicationGatewayId, predicate ApplicationGatewayPrivateLinkResourceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationGatewayPrivateLinkResource, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go deleted file mode 100644 index c3c4b5afa06..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresource.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go deleted file mode 100644 index 0f4b9748324..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/model_applicationgatewayprivatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewayprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/predicates.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/predicates.go deleted file mode 100644 index e93c21bb751..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package applicationgatewayprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkResourceOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ApplicationGatewayPrivateLinkResourceOperationPredicate) Matches(input ApplicationGatewayPrivateLinkResource) 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.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/network/2023-06-01/applicationgatewayprivatelinkresources/version.go b/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/version.go deleted file mode 100644 index dedf69f83c5..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewayprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewayprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/README.md b/resource-manager/network/2023-06-01/applicationgateways/README.md deleted file mode 100644 index 8e0b5f898d3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/README.md +++ /dev/null @@ -1,287 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgateways` Documentation - -The `applicationgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/applicationgateways" -``` - - -### Client Initialization - -```go -client := applicationgateways.NewApplicationGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewaysClient.BackendHealth` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.BackendHealthThenPoll(ctx, id, applicationgateways.DefaultBackendHealthOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.BackendHealthOnDemand` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.ApplicationGatewayOnDemandProbe{ - // ... -} - - -if err := client.BackendHealthOnDemandThenPoll(ctx, id, payload, applicationgateways.DefaultBackendHealthOnDemandOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.ApplicationGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Get` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -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: `ApplicationGatewaysClient.GetSslPredefinedPolicy` - -```go -ctx := context.TODO() -id := applicationgateways.NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue") - -read, err := client.GetSslPredefinedPolicy(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ApplicationGatewaysClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableRequestHeaders` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableRequestHeaders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableResponseHeaders` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableResponseHeaders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableServerVariables` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableServerVariables(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableSslOptions` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableSslOptions(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableSslPredefinedPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAvailableSslPredefinedPolicies(ctx, id)` can be used to do batched pagination -items, err := client.ListAvailableSslPredefinedPoliciesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationGatewaysClient.ListAvailableWafRuleSets` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAvailableWafRuleSets(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Start` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.Stop` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := applicationgateways.NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - -payload := applicationgateways.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/network/2023-06-01/applicationgateways/client.go b/resource-manager/network/2023-06-01/applicationgateways/client.go deleted file mode 100644 index 9608bf47106..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgateways - -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 ApplicationGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewaysClient: %+v", err) - } - - return &ApplicationGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/constants.go b/resource-manager/network/2023-06-01/applicationgateways/constants.go deleted file mode 100644 index 7fe9ed5e6fa..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/constants.go +++ /dev/null @@ -1,2119 +0,0 @@ -package applicationgateways - -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 ApplicationGatewayBackendHealthServerHealth string - -const ( - ApplicationGatewayBackendHealthServerHealthDown ApplicationGatewayBackendHealthServerHealth = "Down" - ApplicationGatewayBackendHealthServerHealthDraining ApplicationGatewayBackendHealthServerHealth = "Draining" - ApplicationGatewayBackendHealthServerHealthPartial ApplicationGatewayBackendHealthServerHealth = "Partial" - ApplicationGatewayBackendHealthServerHealthUnknown ApplicationGatewayBackendHealthServerHealth = "Unknown" - ApplicationGatewayBackendHealthServerHealthUp ApplicationGatewayBackendHealthServerHealth = "Up" -) - -func PossibleValuesForApplicationGatewayBackendHealthServerHealth() []string { - return []string{ - string(ApplicationGatewayBackendHealthServerHealthDown), - string(ApplicationGatewayBackendHealthServerHealthDraining), - string(ApplicationGatewayBackendHealthServerHealthPartial), - string(ApplicationGatewayBackendHealthServerHealthUnknown), - string(ApplicationGatewayBackendHealthServerHealthUp), - } -} - -func (s *ApplicationGatewayBackendHealthServerHealth) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayBackendHealthServerHealth(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayBackendHealthServerHealth(input string) (*ApplicationGatewayBackendHealthServerHealth, error) { - vals := map[string]ApplicationGatewayBackendHealthServerHealth{ - "down": ApplicationGatewayBackendHealthServerHealthDown, - "draining": ApplicationGatewayBackendHealthServerHealthDraining, - "partial": ApplicationGatewayBackendHealthServerHealthPartial, - "unknown": ApplicationGatewayBackendHealthServerHealthUnknown, - "up": ApplicationGatewayBackendHealthServerHealthUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayBackendHealthServerHealth(input) - return &out, nil -} - -type ApplicationGatewayClientRevocationOptions string - -const ( - ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" - ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { - return []string{ - string(ApplicationGatewayClientRevocationOptionsNone), - string(ApplicationGatewayClientRevocationOptionsOCSP), - } -} - -func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayClientRevocationOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { - vals := map[string]ApplicationGatewayClientRevocationOptions{ - "none": ApplicationGatewayClientRevocationOptionsNone, - "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayClientRevocationOptions(input) - return &out, nil -} - -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { - return []string{ - string(ApplicationGatewayCookieBasedAffinityDisabled), - string(ApplicationGatewayCookieBasedAffinityEnabled), - } -} - -func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCookieBasedAffinity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { - vals := map[string]ApplicationGatewayCookieBasedAffinity{ - "disabled": ApplicationGatewayCookieBasedAffinityDisabled, - "enabled": ApplicationGatewayCookieBasedAffinityEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCookieBasedAffinity(input) - return &out, nil -} - -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" -) - -func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { - return []string{ - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), - } -} - -func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { - vals := map[string]ApplicationGatewayCustomErrorStatusCode{ - "httpstatus500": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred, - "httpstatus504": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour, - "httpstatus503": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree, - "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, - "httpstatus400": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred, - "httpstatus408": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight, - "httpstatus405": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive, - "httpstatus404": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour, - "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCustomErrorStatusCode(input) - return &out, nil -} - -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -func PossibleValuesForApplicationGatewayFirewallMode() []string { - return []string{ - string(ApplicationGatewayFirewallModeDetection), - string(ApplicationGatewayFirewallModePrevention), - } -} - -func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { - vals := map[string]ApplicationGatewayFirewallMode{ - "detection": ApplicationGatewayFirewallModeDetection, - "prevention": ApplicationGatewayFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallMode(input) - return &out, nil -} - -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { - return []string{ - string(ApplicationGatewayLoadDistributionAlgorithmIPHash), - string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), - string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - } -} - -func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { - vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ - "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, - "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayLoadDistributionAlgorithm(input) - return &out, nil -} - -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -func PossibleValuesForApplicationGatewayOperationalState() []string { - return []string{ - string(ApplicationGatewayOperationalStateRunning), - string(ApplicationGatewayOperationalStateStarting), - string(ApplicationGatewayOperationalStateStopped), - string(ApplicationGatewayOperationalStateStopping), - } -} - -func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayOperationalState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { - vals := map[string]ApplicationGatewayOperationalState{ - "running": ApplicationGatewayOperationalStateRunning, - "starting": ApplicationGatewayOperationalStateStarting, - "stopped": ApplicationGatewayOperationalStateStopped, - "stopping": ApplicationGatewayOperationalStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayOperationalState(input) - return &out, nil -} - -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" -) - -func PossibleValuesForApplicationGatewayProtocol() []string { - return []string{ - string(ApplicationGatewayProtocolHTTP), - string(ApplicationGatewayProtocolHTTPS), - string(ApplicationGatewayProtocolTcp), - string(ApplicationGatewayProtocolTls), - } -} - -func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { - vals := map[string]ApplicationGatewayProtocol{ - "http": ApplicationGatewayProtocolHTTP, - "https": ApplicationGatewayProtocolHTTPS, - "tcp": ApplicationGatewayProtocolTcp, - "tls": ApplicationGatewayProtocolTls, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayProtocol(input) - return &out, nil -} - -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -func PossibleValuesForApplicationGatewayRedirectType() []string { - return []string{ - string(ApplicationGatewayRedirectTypeFound), - string(ApplicationGatewayRedirectTypePermanent), - string(ApplicationGatewayRedirectTypeSeeOther), - string(ApplicationGatewayRedirectTypeTemporary), - } -} - -func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRedirectType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { - vals := map[string]ApplicationGatewayRedirectType{ - "found": ApplicationGatewayRedirectTypeFound, - "permanent": ApplicationGatewayRedirectTypePermanent, - "seeother": ApplicationGatewayRedirectTypeSeeOther, - "temporary": ApplicationGatewayRedirectTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRedirectType(input) - return &out, nil -} - -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { - return []string{ - string(ApplicationGatewayRequestRoutingRuleTypeBasic), - string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - } -} - -func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { - vals := map[string]ApplicationGatewayRequestRoutingRuleType{ - "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, - "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRequestRoutingRuleType(input) - return &out, nil -} - -type ApplicationGatewaySkuName string - -const ( - ApplicationGatewaySkuNameBasic ApplicationGatewaySkuName = "Basic" - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" -) - -func PossibleValuesForApplicationGatewaySkuName() []string { - return []string{ - string(ApplicationGatewaySkuNameBasic), - string(ApplicationGatewaySkuNameStandardLarge), - string(ApplicationGatewaySkuNameStandardMedium), - string(ApplicationGatewaySkuNameStandardSmall), - string(ApplicationGatewaySkuNameStandardVTwo), - string(ApplicationGatewaySkuNameWAFLarge), - string(ApplicationGatewaySkuNameWAFMedium), - string(ApplicationGatewaySkuNameWAFVTwo), - } -} - -func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { - vals := map[string]ApplicationGatewaySkuName{ - "basic": ApplicationGatewaySkuNameBasic, - "standard_large": ApplicationGatewaySkuNameStandardLarge, - "standard_medium": ApplicationGatewaySkuNameStandardMedium, - "standard_small": ApplicationGatewaySkuNameStandardSmall, - "standard_v2": ApplicationGatewaySkuNameStandardVTwo, - "waf_large": ApplicationGatewaySkuNameWAFLarge, - "waf_medium": ApplicationGatewaySkuNameWAFMedium, - "waf_v2": ApplicationGatewaySkuNameWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySkuName(input) - return &out, nil -} - -type ApplicationGatewaySslCipherSuite string - -const ( - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -) - -func PossibleValuesForApplicationGatewaySslCipherSuite() []string { - return []string{ - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), - } -} - -func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslCipherSuite(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { - vals := map[string]ApplicationGatewaySslCipherSuite{ - "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, - "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, - "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, - "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, - "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, - "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, - "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslCipherSuite(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyName string - -const ( - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -func PossibleValuesForApplicationGatewaySslPolicyName() []string { - return []string{ - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), - } -} - -func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { - vals := map[string]ApplicationGatewaySslPolicyName{ - "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, - "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, - "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, - "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, - "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyName(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyType string - -const ( - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" -) - -func PossibleValuesForApplicationGatewaySslPolicyType() []string { - return []string{ - string(ApplicationGatewaySslPolicyTypeCustom), - string(ApplicationGatewaySslPolicyTypeCustomVTwo), - string(ApplicationGatewaySslPolicyTypePredefined), - } -} - -func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { - vals := map[string]ApplicationGatewaySslPolicyType{ - "custom": ApplicationGatewaySslPolicyTypeCustom, - "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, - "predefined": ApplicationGatewaySslPolicyTypePredefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyType(input) - return &out, nil -} - -type ApplicationGatewaySslProtocol string - -const ( - ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" - ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" - ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" - ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" -) - -func PossibleValuesForApplicationGatewaySslProtocol() []string { - return []string{ - string(ApplicationGatewaySslProtocolTLSvOneOne), - string(ApplicationGatewaySslProtocolTLSvOneThree), - string(ApplicationGatewaySslProtocolTLSvOneTwo), - string(ApplicationGatewaySslProtocolTLSvOneZero), - } -} - -func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { - vals := map[string]ApplicationGatewaySslProtocol{ - "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, - "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, - "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, - "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslProtocol(input) - return &out, nil -} - -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTier() []string { - return []string{ - string(ApplicationGatewayTierBasic), - string(ApplicationGatewayTierStandard), - string(ApplicationGatewayTierStandardVTwo), - string(ApplicationGatewayTierWAF), - string(ApplicationGatewayTierWAFVTwo), - } -} - -func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { - vals := map[string]ApplicationGatewayTier{ - "basic": ApplicationGatewayTierBasic, - "standard": ApplicationGatewayTierStandard, - "standard_v2": ApplicationGatewayTierStandardVTwo, - "waf": ApplicationGatewayTierWAF, - "waf_v2": ApplicationGatewayTierWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTier(input) - return &out, nil -} - -type ApplicationGatewayTierTypes string - -const ( - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" - ApplicationGatewayTierTypesStandardVTwo ApplicationGatewayTierTypes = "Standard_v2" - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - ApplicationGatewayTierTypesWAFVTwo ApplicationGatewayTierTypes = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTierTypes() []string { - return []string{ - string(ApplicationGatewayTierTypesStandard), - string(ApplicationGatewayTierTypesStandardVTwo), - string(ApplicationGatewayTierTypesWAF), - string(ApplicationGatewayTierTypesWAFVTwo), - } -} - -func (s *ApplicationGatewayTierTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTierTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTierTypes(input string) (*ApplicationGatewayTierTypes, error) { - vals := map[string]ApplicationGatewayTierTypes{ - "standard": ApplicationGatewayTierTypesStandard, - "standard_v2": ApplicationGatewayTierTypesStandardVTwo, - "waf": ApplicationGatewayTierTypesWAF, - "waf_v2": ApplicationGatewayTierTypesWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTierTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleActionTypes string - -const ( - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" - ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" -) - -func PossibleValuesForApplicationGatewayWafRuleActionTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleActionTypesAllow), - string(ApplicationGatewayWafRuleActionTypesAnomalyScoring), - string(ApplicationGatewayWafRuleActionTypesBlock), - string(ApplicationGatewayWafRuleActionTypesLog), - string(ApplicationGatewayWafRuleActionTypesNone), - } -} - -func (s *ApplicationGatewayWafRuleActionTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleActionTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleActionTypes(input string) (*ApplicationGatewayWafRuleActionTypes, error) { - vals := map[string]ApplicationGatewayWafRuleActionTypes{ - "allow": ApplicationGatewayWafRuleActionTypesAllow, - "anomalyscoring": ApplicationGatewayWafRuleActionTypesAnomalyScoring, - "block": ApplicationGatewayWafRuleActionTypesBlock, - "log": ApplicationGatewayWafRuleActionTypesLog, - "none": ApplicationGatewayWafRuleActionTypesNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleActionTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleStateTypes string - -const ( - ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" -) - -func PossibleValuesForApplicationGatewayWafRuleStateTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleStateTypesDisabled), - string(ApplicationGatewayWafRuleStateTypesEnabled), - } -} - -func (s *ApplicationGatewayWafRuleStateTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleStateTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleStateTypes(input string) (*ApplicationGatewayWafRuleStateTypes, error) { - vals := map[string]ApplicationGatewayWafRuleStateTypes{ - "disabled": ApplicationGatewayWafRuleStateTypesDisabled, - "enabled": ApplicationGatewayWafRuleStateTypesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleStateTypes(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway.go b/resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway.go deleted file mode 100644 index 0611edc8513..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationgateways - -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(&ApplicationGatewayId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayId{} - -// ApplicationGatewayId is a struct representing the Resource ID for a Application Gateway -type ApplicationGatewayId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayName string -} - -// NewApplicationGatewayID returns a new ApplicationGatewayId struct -func NewApplicationGatewayID(subscriptionId string, resourceGroupName string, applicationGatewayName string) ApplicationGatewayId { - return ApplicationGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayName: applicationGatewayName, - } -} - -// ParseApplicationGatewayID parses 'input' into a ApplicationGatewayId -func ParseApplicationGatewayID(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayIDInsensitively(input string) (*ApplicationGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayId) 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.ApplicationGatewayName, ok = input.Parsed["applicationGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayName", input) - } - - return nil -} - -// ValidateApplicationGatewayID checks that 'input' can be parsed as a Application Gateway ID -func ValidateApplicationGatewayID(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 := ParseApplicationGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway ID -func (id ApplicationGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway ID -func (id ApplicationGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGateways", "applicationGateways", "applicationGateways"), - resourceids.UserSpecifiedSegment("applicationGatewayName", "applicationGatewayValue"), - } -} - -// String returns a human-readable description of this Application Gateway ID -func (id ApplicationGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Name: %q", id.ApplicationGatewayName), - } - return fmt.Sprintf("Application Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway_test.go b/resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway_test.go deleted file mode 100644 index 9c3eeb06904..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/id_applicationgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationgateways - -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 = &ApplicationGatewayId{} - -func TestNewApplicationGatewayID(t *testing.T) { - id := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue") - - 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.ApplicationGatewayName != "applicationGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayName'", id.ApplicationGatewayName, "applicationGatewayValue") - } -} - -func TestFormatApplicationGatewayID(t *testing.T) { - actual := NewApplicationGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayID(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestParseApplicationGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayName: "applicationGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGateways/applicationGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe", - Expected: &ApplicationGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayName: "aPpLiCaTiOnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYs/aPpLiCaTiOnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayIDInsensitively(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.ApplicationGatewayName != v.Expected.ApplicationGatewayName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayName", v.Expected.ApplicationGatewayName, actual.ApplicationGatewayName) - } - - } -} - -func TestSegmentsForApplicationGatewayId(t *testing.T) { - segments := ApplicationGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayId 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/network/2023-06-01/applicationgateways/id_predefinedpolicy.go b/resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy.go deleted file mode 100644 index f22e541bda3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy.go +++ /dev/null @@ -1,123 +0,0 @@ -package applicationgateways - -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(&PredefinedPolicyId{}) -} - -var _ resourceids.ResourceId = &PredefinedPolicyId{} - -// PredefinedPolicyId is a struct representing the Resource ID for a Predefined Policy -type PredefinedPolicyId struct { - SubscriptionId string - PredefinedPolicyName string -} - -// NewPredefinedPolicyID returns a new PredefinedPolicyId struct -func NewPredefinedPolicyID(subscriptionId string, predefinedPolicyName string) PredefinedPolicyId { - return PredefinedPolicyId{ - SubscriptionId: subscriptionId, - PredefinedPolicyName: predefinedPolicyName, - } -} - -// ParsePredefinedPolicyID parses 'input' into a PredefinedPolicyId -func ParsePredefinedPolicyID(input string) (*PredefinedPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&PredefinedPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PredefinedPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePredefinedPolicyIDInsensitively parses 'input' case-insensitively into a PredefinedPolicyId -// note: this method should only be used for API response data and not user input -func ParsePredefinedPolicyIDInsensitively(input string) (*PredefinedPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&PredefinedPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PredefinedPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PredefinedPolicyId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.PredefinedPolicyName, ok = input.Parsed["predefinedPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "predefinedPolicyName", input) - } - - return nil -} - -// ValidatePredefinedPolicyID checks that 'input' can be parsed as a Predefined Policy ID -func ValidatePredefinedPolicyID(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 := ParsePredefinedPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Predefined Policy ID -func (id PredefinedPolicyId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.PredefinedPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Predefined Policy ID -func (id PredefinedPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGatewayAvailableSslOptions", "applicationGatewayAvailableSslOptions", "applicationGatewayAvailableSslOptions"), - resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.StaticSegment("staticPredefinedPolicies", "predefinedPolicies", "predefinedPolicies"), - resourceids.UserSpecifiedSegment("predefinedPolicyName", "predefinedPolicyValue"), - } -} - -// String returns a human-readable description of this Predefined Policy ID -func (id PredefinedPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Predefined Policy Name: %q", id.PredefinedPolicyName), - } - return fmt.Sprintf("Predefined Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy_test.go b/resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy_test.go deleted file mode 100644 index 9ecaa5d023e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/id_predefinedpolicy_test.go +++ /dev/null @@ -1,267 +0,0 @@ -package applicationgateways - -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 = &PredefinedPolicyId{} - -func TestNewPredefinedPolicyID(t *testing.T) { - id := NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue") - - 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.PredefinedPolicyName != "predefinedPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'PredefinedPolicyName'", id.PredefinedPolicyName, "predefinedPolicyValue") - } -} - -func TestFormatPredefinedPolicyID(t *testing.T) { - actual := NewPredefinedPolicyID("12345678-1234-9876-4563-123456789012", "predefinedPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePredefinedPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PredefinedPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue", - Expected: &PredefinedPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PredefinedPolicyName: "predefinedPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePredefinedPolicyID(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.PredefinedPolicyName != v.Expected.PredefinedPolicyName { - t.Fatalf("Expected %q but got %q for PredefinedPolicyName", v.Expected.PredefinedPolicyName, actual.PredefinedPolicyName) - } - - } -} - -func TestParsePredefinedPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PredefinedPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt/pReDeFiNeDpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue", - Expected: &PredefinedPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PredefinedPolicyName: "predefinedPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/predefinedPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt/pReDeFiNeDpOlIcIeS/pReDeFiNeDpOlIcYvAlUe", - Expected: &PredefinedPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PredefinedPolicyName: "pReDeFiNeDpOlIcYvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYaVaIlAbLeSsLoPtIoNs/dEfAuLt/pReDeFiNeDpOlIcIeS/pReDeFiNeDpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePredefinedPolicyIDInsensitively(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.PredefinedPolicyName != v.Expected.PredefinedPolicyName { - t.Fatalf("Expected %q but got %q for PredefinedPolicyName", v.Expected.PredefinedPolicyName, actual.PredefinedPolicyName) - } - - } -} - -func TestSegmentsForPredefinedPolicyId(t *testing.T) { - segments := PredefinedPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PredefinedPolicyId 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/network/2023-06-01/applicationgateways/method_backendhealth.go b/resource-manager/network/2023-06-01/applicationgateways/method_backendhealth.go deleted file mode 100644 index bc7254fd7d6..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_backendhealth.go +++ /dev/null @@ -1,99 +0,0 @@ -package applicationgateways - -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 BackendHealthOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayBackendHealth -} - -type BackendHealthOperationOptions struct { - Expand *string -} - -func DefaultBackendHealthOperationOptions() BackendHealthOperationOptions { - return BackendHealthOperationOptions{} -} - -func (o BackendHealthOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o BackendHealthOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o BackendHealthOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// BackendHealth ... -func (c ApplicationGatewaysClient) BackendHealth(ctx context.Context, id ApplicationGatewayId, options BackendHealthOperationOptions) (result BackendHealthOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/backendhealth", id.ID()), - OptionsObject: options, - } - - 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 -} - -// BackendHealthThenPoll performs BackendHealth then polls until it's completed -func (c ApplicationGatewaysClient) BackendHealthThenPoll(ctx context.Context, id ApplicationGatewayId, options BackendHealthOperationOptions) error { - result, err := c.BackendHealth(ctx, id, options) - if err != nil { - return fmt.Errorf("performing BackendHealth: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after BackendHealth: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_backendhealthondemand.go b/resource-manager/network/2023-06-01/applicationgateways/method_backendhealthondemand.go deleted file mode 100644 index c99e1e55de2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_backendhealthondemand.go +++ /dev/null @@ -1,103 +0,0 @@ -package applicationgateways - -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 BackendHealthOnDemandOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayBackendHealthOnDemand -} - -type BackendHealthOnDemandOperationOptions struct { - Expand *string -} - -func DefaultBackendHealthOnDemandOperationOptions() BackendHealthOnDemandOperationOptions { - return BackendHealthOnDemandOperationOptions{} -} - -func (o BackendHealthOnDemandOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o BackendHealthOnDemandOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o BackendHealthOnDemandOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// BackendHealthOnDemand ... -func (c ApplicationGatewaysClient) BackendHealthOnDemand(ctx context.Context, id ApplicationGatewayId, input ApplicationGatewayOnDemandProbe, options BackendHealthOnDemandOperationOptions) (result BackendHealthOnDemandOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getBackendHealthOnDemand", id.ID()), - OptionsObject: options, - } - - 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 -} - -// BackendHealthOnDemandThenPoll performs BackendHealthOnDemand then polls until it's completed -func (c ApplicationGatewaysClient) BackendHealthOnDemandThenPoll(ctx context.Context, id ApplicationGatewayId, input ApplicationGatewayOnDemandProbe, options BackendHealthOnDemandOperationOptions) error { - result, err := c.BackendHealthOnDemand(ctx, id, input, options) - if err != nil { - return fmt.Errorf("performing BackendHealthOnDemand: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after BackendHealthOnDemand: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_createorupdate.go b/resource-manager/network/2023-06-01/applicationgateways/method_createorupdate.go deleted file mode 100644 index 66330483b32..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package applicationgateways - -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 *ApplicationGateway -} - -// CreateOrUpdate ... -func (c ApplicationGatewaysClient) CreateOrUpdate(ctx context.Context, id ApplicationGatewayId, input ApplicationGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ApplicationGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id ApplicationGatewayId, input ApplicationGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/applicationgateways/method_delete.go b/resource-manager/network/2023-06-01/applicationgateways/method_delete.go deleted file mode 100644 index 6769fa69c24..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applicationgateways - -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 ApplicationGatewaysClient) Delete(ctx context.Context, id ApplicationGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationGatewaysClient) DeleteThenPoll(ctx context.Context, id ApplicationGatewayId) 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/network/2023-06-01/applicationgateways/method_get.go b/resource-manager/network/2023-06-01/applicationgateways/method_get.go deleted file mode 100644 index 03000d91a47..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationgateways - -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 *ApplicationGateway -} - -// Get ... -func (c ApplicationGatewaysClient) Get(ctx context.Context, id ApplicationGatewayId) (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 ApplicationGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_getsslpredefinedpolicy.go b/resource-manager/network/2023-06-01/applicationgateways/method_getsslpredefinedpolicy.go deleted file mode 100644 index 97530703e81..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_getsslpredefinedpolicy.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationgateways - -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 GetSslPredefinedPolicyOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewaySslPredefinedPolicy -} - -// GetSslPredefinedPolicy ... -func (c ApplicationGatewaysClient) GetSslPredefinedPolicy(ctx context.Context, id PredefinedPolicyId) (result GetSslPredefinedPolicyOperationResponse, 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 ApplicationGatewaySslPredefinedPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_list.go b/resource-manager/network/2023-06-01/applicationgateways/method_list.go deleted file mode 100644 index 3770e6793df..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationgateways - -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 *[]ApplicationGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGateway -} - -// List ... -func (c ApplicationGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGateways", 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 *[]ApplicationGateway `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 ApplicationGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ApplicationGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/applicationgateways/method_listall.go b/resource-manager/network/2023-06-01/applicationgateways/method_listall.go deleted file mode 100644 index 486009336b4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationgateways - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationGateway -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGateway -} - -// ListAll ... -func (c ApplicationGatewaysClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGateways", 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 *[]ApplicationGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ApplicationGatewaysClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, ApplicationGatewayOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewaysClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplicationGatewayOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]ApplicationGateway, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablerequestheaders.go b/resource-manager/network/2023-06-01/applicationgateways/method_listavailablerequestheaders.go deleted file mode 100644 index 634799c7f70..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablerequestheaders.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableRequestHeadersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]string -} - -// ListAvailableRequestHeaders ... -func (c ApplicationGatewaysClient) ListAvailableRequestHeaders(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableRequestHeadersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders", 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 []string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_listavailableresponseheaders.go b/resource-manager/network/2023-06-01/applicationgateways/method_listavailableresponseheaders.go deleted file mode 100644 index fe99c70d2e7..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listavailableresponseheaders.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableResponseHeadersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]string -} - -// ListAvailableResponseHeaders ... -func (c ApplicationGatewaysClient) ListAvailableResponseHeaders(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableResponseHeadersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders", 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 []string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_listavailableservervariables.go b/resource-manager/network/2023-06-01/applicationgateways/method_listavailableservervariables.go deleted file mode 100644 index b48bb86d765..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listavailableservervariables.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableServerVariablesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]string -} - -// ListAvailableServerVariables ... -func (c ApplicationGatewaysClient) ListAvailableServerVariables(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableServerVariablesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableServerVariables", 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 []string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablessloptions.go b/resource-manager/network/2023-06-01/applicationgateways/method_listavailablessloptions.go deleted file mode 100644 index 386a33e5e84..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablessloptions.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableSslOptionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayAvailableSslOptions -} - -// ListAvailableSslOptions ... -func (c ApplicationGatewaysClient) ListAvailableSslOptions(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableSslOptionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/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 ApplicationGatewayAvailableSslOptions - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablesslpredefinedpolicies.go b/resource-manager/network/2023-06-01/applicationgateways/method_listavailablesslpredefinedpolicies.go deleted file mode 100644 index 8eb0fca135d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablesslpredefinedpolicies.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationgateways - -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 ListAvailableSslPredefinedPoliciesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationGatewaySslPredefinedPolicy -} - -type ListAvailableSslPredefinedPoliciesCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewaySslPredefinedPolicy -} - -// ListAvailableSslPredefinedPolicies ... -func (c ApplicationGatewaysClient) ListAvailableSslPredefinedPolicies(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableSslPredefinedPoliciesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies", 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 *[]ApplicationGatewaySslPredefinedPolicy `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAvailableSslPredefinedPoliciesComplete retrieves all the results into a single object -func (c ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesComplete(ctx context.Context, id commonids.SubscriptionId) (ListAvailableSslPredefinedPoliciesCompleteResult, error) { - return c.ListAvailableSslPredefinedPoliciesCompleteMatchingPredicate(ctx, id, ApplicationGatewaySslPredefinedPolicyOperationPredicate{}) -} - -// ListAvailableSslPredefinedPoliciesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewaysClient) ListAvailableSslPredefinedPoliciesCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplicationGatewaySslPredefinedPolicyOperationPredicate) (result ListAvailableSslPredefinedPoliciesCompleteResult, err error) { - items := make([]ApplicationGatewaySslPredefinedPolicy, 0) - - resp, err := c.ListAvailableSslPredefinedPolicies(ctx, id) - if err != nil { - 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 = ListAvailableSslPredefinedPoliciesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablewafrulesets.go b/resource-manager/network/2023-06-01/applicationgateways/method_listavailablewafrulesets.go deleted file mode 100644 index 3df1a2db564..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_listavailablewafrulesets.go +++ /dev/null @@ -1,56 +0,0 @@ -package applicationgateways - -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 ListAvailableWafRuleSetsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayAvailableWafRuleSetsResult -} - -// ListAvailableWafRuleSets ... -func (c ApplicationGatewaysClient) ListAvailableWafRuleSets(ctx context.Context, id commonids.SubscriptionId) (result ListAvailableWafRuleSetsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets", 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 ApplicationGatewayAvailableWafRuleSetsResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/method_start.go b/resource-manager/network/2023-06-01/applicationgateways/method_start.go deleted file mode 100644 index 828fc60cb3c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_start.go +++ /dev/null @@ -1,70 +0,0 @@ -package applicationgateways - -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 StartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Start ... -func (c ApplicationGatewaysClient) Start(ctx context.Context, id ApplicationGatewayId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ApplicationGatewaysClient) StartThenPoll(ctx context.Context, id ApplicationGatewayId) 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/network/2023-06-01/applicationgateways/method_stop.go b/resource-manager/network/2023-06-01/applicationgateways/method_stop.go deleted file mode 100644 index 75b68cdf697..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package applicationgateways - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c ApplicationGatewaysClient) Stop(ctx context.Context, id ApplicationGatewayId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ApplicationGatewaysClient) StopThenPoll(ctx context.Context, id ApplicationGatewayId) 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/network/2023-06-01/applicationgateways/method_updatetags.go b/resource-manager/network/2023-06-01/applicationgateways/method_updatetags.go deleted file mode 100644 index d22b3615559..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package applicationgateways - -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 *ApplicationGateway -} - -// UpdateTags ... -func (c ApplicationGatewaysClient) UpdateTags(ctx context.Context, id ApplicationGatewayId, 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 ApplicationGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgateway.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgateway.go deleted file mode 100644 index 26c26a88927..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgateway.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "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 ApplicationGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go deleted file mode 100644 index 21a1fec007f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go deleted file mode 100644 index 37f5189d68a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayauthenticationcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go deleted file mode 100644 index e8f13521e07..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAutoscaleConfiguration struct { - MaxCapacity *int64 `json:"maxCapacity,omitempty"` - MinCapacity int64 `json:"minCapacity"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptions.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptions.go deleted file mode 100644 index 18677bfa9ad..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptions.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAvailableSslOptions struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayAvailableSslOptionsPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go deleted file mode 100644 index 552b956629b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablessloptionspropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAvailableSslOptionsPropertiesFormat struct { - AvailableCipherSuites *[]ApplicationGatewaySslCipherSuite `json:"availableCipherSuites,omitempty"` - AvailableProtocols *[]ApplicationGatewaySslProtocol `json:"availableProtocols,omitempty"` - DefaultPolicy *ApplicationGatewaySslPolicyName `json:"defaultPolicy,omitempty"` - PredefinedPolicies *[]SubResource `json:"predefinedPolicies,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go deleted file mode 100644 index b960a888077..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayavailablewafrulesetsresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAvailableWafRuleSetsResult struct { - Value *[]ApplicationGatewayFirewallRuleSet `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 9245b4581ff..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index e62cc5f5a6a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 92e4b6fcae0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealth.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealth.go deleted file mode 100644 index b8439220957..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealth.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealth struct { - BackendAddressPools *[]ApplicationGatewayBackendHealthPool `json:"backendAddressPools,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go deleted file mode 100644 index 00f4c87c142..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthhttpsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthHTTPSettings struct { - BackendHTTPSettings *ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettings,omitempty"` - Servers *[]ApplicationGatewayBackendHealthServer `json:"servers,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go deleted file mode 100644 index 3bf6d17e80c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthondemand.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthOnDemand struct { - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - BackendHealthHTTPSettings *ApplicationGatewayBackendHealthHTTPSettings `json:"backendHealthHttpSettings,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthpool.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthpool.go deleted file mode 100644 index b32fffdf614..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthpool.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthPool struct { - BackendAddressPool *ApplicationGatewayBackendAddressPool `json:"backendAddressPool,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHealthHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthserver.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthserver.go deleted file mode 100644 index c11aed154b2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhealthserver.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHealthServer struct { - Address *string `json:"address,omitempty"` - Health *ApplicationGatewayBackendHealthServerHealth `json:"health,omitempty"` - HealthProbeLog *string `json:"healthProbeLog,omitempty"` - IPConfiguration *NetworkInterfaceIPConfiguration `json:"ipConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go deleted file mode 100644 index 7cfbecd3506..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go deleted file mode 100644 index 68ccfd35301..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendhttpsettingspropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - CookieBasedAffinity *ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - HostName *string `json:"hostName,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestTimeout *int64 `json:"requestTimeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettings.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettings.go deleted file mode 100644 index 435626e7296..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go deleted file mode 100644 index 5d5c1275f2e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaybackendsettingspropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - HostName *string `json:"hostName,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go deleted file mode 100644 index 7be179f89f0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayclientauthconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayClientAuthConfiguration struct { - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` - VerifyClientRevocation *ApplicationGatewayClientRevocationOptions `json:"verifyClientRevocation,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayconnectiondraining.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayconnectiondraining.go deleted file mode 100644 index f40777a88f8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayconnectiondraining.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayConnectionDraining struct { - DrainTimeoutInSec int64 `json:"drainTimeoutInSec"` - Enabled bool `json:"enabled"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaycustomerror.go deleted file mode 100644 index 532de5a8e93..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaycustomerror.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` - StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go deleted file mode 100644 index 30534c50f52..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewalldisabledrulegroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallDisabledRuleGroup struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]int64 `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallexclusion.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallexclusion.go deleted file mode 100644 index 77bfe2cf65c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallexclusion.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallExclusion struct { - MatchVariable string `json:"matchVariable"` - Selector string `json:"selector"` - SelectorMatchOperator string `json:"selectorMatchOperator"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrule.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrule.go deleted file mode 100644 index c9a89bac633..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRule struct { - Action *ApplicationGatewayWafRuleActionTypes `json:"action,omitempty"` - Description *string `json:"description,omitempty"` - RuleId int64 `json:"ruleId"` - RuleIdString *string `json:"ruleIdString,omitempty"` - State *ApplicationGatewayWafRuleStateTypes `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go deleted file mode 100644 index 06c7cbffb38..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulegroup.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleGroup struct { - Description *string `json:"description,omitempty"` - RuleGroupName string `json:"ruleGroupName"` - Rules []ApplicationGatewayFirewallRule `json:"rules"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallruleset.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallruleset.go deleted file mode 100644 index 3eb74351624..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallruleset.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleSet struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFirewallRuleSetPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go deleted file mode 100644 index f0bd967c325..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfirewallrulesetpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleSetPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleGroups []ApplicationGatewayFirewallRuleGroup `json:"ruleGroups"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` - Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go deleted file mode 100644 index 16f3a44fe68..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go deleted file mode 100644 index 45f83bbaa11..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendport.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendport.go deleted file mode 100644 index 9b3c8763e01..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendport.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go deleted file mode 100644 index a9399610b8b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayfrontendportpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPortPropertiesFormat struct { - Port *int64 `json:"port,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayglobalconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayglobalconfiguration.go deleted file mode 100644 index 8f031b6ad38..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayglobalconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayGlobalConfiguration struct { - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayheaderconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayheaderconfiguration.go deleted file mode 100644 index cf7e02d4617..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayheaderconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHeaderConfiguration struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistener.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistener.go deleted file mode 100644 index 457c3af7d7b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go deleted file mode 100644 index 7d3436f6186..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayhttplistenerpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - HostName *string `json:"hostName,omitempty"` - HostNames *[]string `json:"hostNames,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 7b513c56359..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 67b2b22486e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistener.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistener.go deleted file mode 100644 index eb251dad173..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go deleted file mode 100644 index 96c7728780d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaylistenerpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListenerPropertiesFormat struct { - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - HostNames *[]string `json:"hostNames,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go deleted file mode 100644 index 9c07ad54259..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go deleted file mode 100644 index 9ae762454d0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributionpolicypropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { - LoadDistributionAlgorithm *ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` - LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go deleted file mode 100644 index 5db29bd27a5..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontarget.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTarget struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go deleted file mode 100644 index cd785c4126e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayloaddistributiontargetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - WeightPerServer *int64 `json:"weightPerServer,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayondemandprobe.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayondemandprobe.go deleted file mode 100644 index 6ee19e174e2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayondemandprobe.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayOnDemandProbe struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - Host *string `json:"host,omitempty"` - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrule.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrule.go deleted file mode 100644 index ae684eb5860..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go deleted file mode 100644 index c0586444c85..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypathrulepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Paths *[]string `json:"paths,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index 8099219aff4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go deleted file mode 100644 index 400c841d704..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivateendpointconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go deleted file mode 100644 index 1997234fb4d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go deleted file mode 100644 index b86b3f17014..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkconfigurationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go deleted file mode 100644 index ad8bfa28be7..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go deleted file mode 100644 index b2d2b2af23a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprivatelinkipconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobe.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobe.go deleted file mode 100644 index 9b27b4f7133..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobe.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go deleted file mode 100644 index 68ccf1eaaaf..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobehealthresponsematch.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbeHealthResponseMatch struct { - Body *string `json:"body,omitempty"` - StatusCodes *[]string `json:"statusCodes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go deleted file mode 100644 index dab5ee7ae23..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayprobepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbePropertiesFormat struct { - Host *string `json:"host,omitempty"` - Interval *int64 `json:"interval,omitempty"` - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - MinServers *int64 `json:"minServers,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - UnhealthyThreshold *int64 `json:"unhealthyThreshold,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypropertiesformat.go deleted file mode 100644 index 1332febd49d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaypropertiesformat.go +++ /dev/null @@ -1,43 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPropertiesFormat struct { - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - DefaultPredefinedSslPolicy *ApplicationGatewaySslPolicyName `json:"defaultPredefinedSslPolicy,omitempty"` - EnableFips *bool `json:"enableFips,omitempty"` - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfiguration.go deleted file mode 100644 index 99a2df5f0de..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go deleted file mode 100644 index 07b97214f7f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - IncludePath *bool `json:"includePath,omitempty"` - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - PathRules *[]SubResource `json:"pathRules,omitempty"` - RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` - TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` - UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrule.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrule.go deleted file mode 100644 index 8968674820d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go deleted file mode 100644 index d7ab0f3f4d9..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrequestroutingrulepropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - HTTPListener *SubResource `json:"httpListener,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - UrlPathMap *SubResource `json:"urlPathMap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterule.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterule.go deleted file mode 100644 index 6ce3b9a1f5d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterule.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRule struct { - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` - Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - Name *string `json:"name,omitempty"` - RuleSequence *int64 `json:"ruleSequence,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go deleted file mode 100644 index 02be2e1f37b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleactionset.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleActionSet struct { - RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulecondition.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulecondition.go deleted file mode 100644 index c7e6af3b85a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulecondition.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleCondition struct { - IgnoreCase *bool `json:"ignoreCase,omitempty"` - Negate *bool `json:"negate,omitempty"` - Pattern *string `json:"pattern,omitempty"` - Variable *string `json:"variable,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleset.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleset.go deleted file mode 100644 index 571e9038508..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriteruleset.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go deleted file mode 100644 index 031206c13ce..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayrewriterulesetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrule.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrule.go deleted file mode 100644 index 448709de6b4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go deleted file mode 100644 index 5be00552534..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayroutingrulepropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendSettings *SubResource `json:"backendSettings,omitempty"` - Listener *SubResource `json:"listener,omitempty"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysku.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysku.go deleted file mode 100644 index 99350cf8ec7..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *ApplicationGatewaySkuName `json:"name,omitempty"` - Tier *ApplicationGatewayTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificate.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificate.go deleted file mode 100644 index 1f589867862..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go deleted file mode 100644 index 1c92efb93bd..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslcertificatepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - Password *string `json:"password,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpolicy.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpolicy.go deleted file mode 100644 index be42ac49a18..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPolicy struct { - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - MinProtocolVersion *ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` - PolicyName *ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` - PolicyType *ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go deleted file mode 100644 index a7932dc66db..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicy.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPredefinedPolicy struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslPredefinedPolicyPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go deleted file mode 100644 index 15702750dea..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslpredefinedpolicypropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPredefinedPolicyPropertiesFormat struct { - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - MinProtocolVersion *ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofile.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofile.go deleted file mode 100644 index 609877668f8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go deleted file mode 100644 index a7c5ae2c883..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaysslprofilepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfilePropertiesFormat struct { - ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - TrustedClientCertificates *[]SubResource `json:"trustedClientCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go deleted file mode 100644 index 731b46860d7..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedClientCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go deleted file mode 100644 index 67b5d91461d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedclientcertificatepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { - ClientCertIssuerDN *string `json:"clientCertIssuerDN,omitempty"` - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ValidatedCertData *string `json:"validatedCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go deleted file mode 100644 index 12343718b35..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go deleted file mode 100644 index 7aeb8e0a84e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaytrustedrootcertificatepropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlconfiguration.go deleted file mode 100644 index 18491c35f12..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlConfiguration struct { - ModifiedPath *string `json:"modifiedPath,omitempty"` - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - Reroute *bool `json:"reroute,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmap.go deleted file mode 100644 index 5fc06877578..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmap.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go deleted file mode 100644 index ef8e7e8e02f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewayurlpathmappropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMapPropertiesFormat struct { - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go deleted file mode 100644 index 561512df449..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationgatewaywebapplicationfirewallconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - Enabled bool `json:"enabled"` - Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode"` - MaxRequestBodySize *int64 `json:"maxRequestBodySize,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygroup.go deleted file mode 100644 index 71e4f60a5a0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index c8593cff776..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspool.go b/resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspool.go deleted file mode 100644 index 1a7d2037c67..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 74aca7bc73d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 821207ea54b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_ddossettings.go b/resource-manager/network/2023-06-01/applicationgateways/model_ddossettings.go deleted file mode 100644 index afe28edd8fc..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_delegation.go b/resource-manager/network/2023-06-01/applicationgateways/model_delegation.go deleted file mode 100644 index dde48e048ee..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_flowlog.go b/resource-manager/network/2023-06-01/applicationgateways/model_flowlog.go deleted file mode 100644 index 8d1c520da14..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/applicationgateways/model_flowlogformatparameters.go deleted file mode 100644 index 79d541b9318..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_flowlogpropertiesformat.go deleted file mode 100644 index 666f7fd230f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfiguration.go deleted file mode 100644 index 6af1ef34991..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index dfcbf3e5aca..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 81f73592309..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrule.go b/resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrule.go deleted file mode 100644 index e8326d63cdd..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index e68b37342b3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_ipconfiguration.go deleted file mode 100644 index 3035f84c596..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofile.go deleted file mode 100644 index edb884d2718..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1c6df0dcda2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 5de8de82f9e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_iptag.go b/resource-manager/network/2023-06-01/applicationgateways/model_iptag.go deleted file mode 100644 index e423a8c0593..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// 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/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddress.go deleted file mode 100644 index a4bb848daa5..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index ab1822cd6b6..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_natgateway.go b/resource-manager/network/2023-06-01/applicationgateways/model_natgateway.go deleted file mode 100644 index eb51b102cad..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package applicationgateways - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_natgatewaypropertiesformat.go deleted file mode 100644 index 21ac8a2eca2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_natgatewaysku.go b/resource-manager/network/2023-06-01/applicationgateways/model_natgatewaysku.go deleted file mode 100644 index 54ee08d2498..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_natruleportmapping.go b/resource-manager/network/2023-06-01/applicationgateways/model_natruleportmapping.go deleted file mode 100644 index 1ca2ef21443..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterface.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterface.go deleted file mode 100644 index 73b1cb41a52..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacednssettings.go deleted file mode 100644 index 92961ce7d04..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 1be55bfe469..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index fed49bbe9de..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 70234aeb42f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 302d4c3283d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 8dc17186426..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 199c278ace0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygroup.go deleted file mode 100644 index 14268c44ed0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index e16fb5f6fb3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpoint.go b/resource-manager/network/2023-06-01/applicationgateways/model_privateendpoint.go deleted file mode 100644 index 4ec26559664..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnection.go deleted file mode 100644 index 72911c666f8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/applicationgateways/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnectionproperties.go deleted file mode 100644 index baec08812d8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfiguration.go deleted file mode 100644 index 7cae9c3cf71..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index f1f5adead63..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointproperties.go deleted file mode 100644 index 832b7f18a5d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkservice.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkservice.go deleted file mode 100644 index 238c6ee31c6..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnection.go deleted file mode 100644 index ee88d81eb06..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 26b1b21ad32..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 2d2970905b0..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 18d6fcdf24d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 02fc04bab97..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceproperties.go deleted file mode 100644 index eb543330122..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddress.go b/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddress.go deleted file mode 100644 index c17efae3e57..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package applicationgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddressdnssettings.go deleted file mode 100644 index 4aeba6f0581..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresspropertiesformat.go deleted file mode 100644 index d714bdf3daa..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresssku.go deleted file mode 100644 index 976ba6d175a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlink.go deleted file mode 100644 index 0aeedfe5241..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlinkformat.go deleted file mode 100644 index 540e9b96c41..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_resourceset.go b/resource-manager/network/2023-06-01/applicationgateways/model_resourceset.go deleted file mode 100644 index 05c6f87a097..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/applicationgateways/model_retentionpolicyparameters.go deleted file mode 100644 index aed6889cbab..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_route.go b/resource-manager/network/2023-06-01/applicationgateways/model_route.go deleted file mode 100644 index 8b16e63b0d4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_routepropertiesformat.go deleted file mode 100644 index e5c5f698874..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_routetable.go b/resource-manager/network/2023-06-01/applicationgateways/model_routetable.go deleted file mode 100644 index 6b3d63e8b6c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_routetablepropertiesformat.go deleted file mode 100644 index af2c694b5db..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_securityrule.go b/resource-manager/network/2023-06-01/applicationgateways/model_securityrule.go deleted file mode 100644 index ef187da7432..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_securityrulepropertiesformat.go deleted file mode 100644 index c96607c5d20..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlink.go deleted file mode 100644 index fcd770e8b43..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 74146988caf..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 508b02893d3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicy.go deleted file mode 100644 index 3c9d04af717..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 3c52f56e9ea..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 0ccd3a839f3..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index edd49bd36a4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5cae7444005..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_subnet.go b/resource-manager/network/2023-06-01/applicationgateways/model_subnet.go deleted file mode 100644 index 9bad3a3150c..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_subnetpropertiesformat.go deleted file mode 100644 index ef5a25aa181..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_subresource.go b/resource-manager/network/2023-06-01/applicationgateways/model_subresource.go deleted file mode 100644 index 5e7297f22b2..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_tagsobject.go b/resource-manager/network/2023-06-01/applicationgateways/model_tagsobject.go deleted file mode 100644 index d5962ed5647..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// 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/network/2023-06-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 65767115778..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsproperties.go deleted file mode 100644 index b9b39e7b346..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktap.go deleted file mode 100644 index 610065f3a8a..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index a7db53f1629..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/predicates.go b/resource-manager/network/2023-06-01/applicationgateways/predicates.go deleted file mode 100644 index c51e6f7b000..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/predicates.go +++ /dev/null @@ -1,55 +0,0 @@ -package applicationgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ApplicationGatewayOperationPredicate) Matches(input ApplicationGateway) 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 && (input.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 ApplicationGatewaySslPredefinedPolicyOperationPredicate struct { - Id *string - Name *string -} - -func (p ApplicationGatewaySslPredefinedPolicyOperationPredicate) Matches(input ApplicationGatewaySslPredefinedPolicy) 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 - } - - return true -} diff --git a/resource-manager/network/2023-06-01/applicationgateways/version.go b/resource-manager/network/2023-06-01/applicationgateways/version.go deleted file mode 100644 index d4ae81013b4..00000000000 --- a/resource-manager/network/2023-06-01/applicationgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/README.md b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/README.md deleted file mode 100644 index 0ebe38c4140..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests` Documentation - -The `applicationgatewaywafdynamicmanifests` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/applicationgatewaywafdynamicmanifests" -``` - - -### Client Initialization - -```go -client := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.DefaultGet` - -```go -ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.DefaultGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ApplicationGatewayWafDynamicManifestsClient.Get` - -```go -ctx := context.TODO() -id := applicationgatewaywafdynamicmanifests.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.Get(ctx, id)` can be used to do batched pagination -items, err := client.GetComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/client.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/client.go deleted file mode 100644 index 507d8e55929..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 ApplicationGatewayWafDynamicManifestsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationGatewayWafDynamicManifestsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationgatewaywafdynamicmanifests", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationGatewayWafDynamicManifestsClient: %+v", err) - } - - return &ApplicationGatewayWafDynamicManifestsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/constants.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/constants.go deleted file mode 100644 index 0d7db7ea47d..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/constants.go +++ /dev/null @@ -1,195 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 ApplicationGatewayRuleSetStatusOptions string - -const ( - ApplicationGatewayRuleSetStatusOptionsDeprecated ApplicationGatewayRuleSetStatusOptions = "Deprecated" - ApplicationGatewayRuleSetStatusOptionsGA ApplicationGatewayRuleSetStatusOptions = "GA" - ApplicationGatewayRuleSetStatusOptionsPreview ApplicationGatewayRuleSetStatusOptions = "Preview" - ApplicationGatewayRuleSetStatusOptionsSupported ApplicationGatewayRuleSetStatusOptions = "Supported" -) - -func PossibleValuesForApplicationGatewayRuleSetStatusOptions() []string { - return []string{ - string(ApplicationGatewayRuleSetStatusOptionsDeprecated), - string(ApplicationGatewayRuleSetStatusOptionsGA), - string(ApplicationGatewayRuleSetStatusOptionsPreview), - string(ApplicationGatewayRuleSetStatusOptionsSupported), - } -} - -func (s *ApplicationGatewayRuleSetStatusOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRuleSetStatusOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRuleSetStatusOptions(input string) (*ApplicationGatewayRuleSetStatusOptions, error) { - vals := map[string]ApplicationGatewayRuleSetStatusOptions{ - "deprecated": ApplicationGatewayRuleSetStatusOptionsDeprecated, - "ga": ApplicationGatewayRuleSetStatusOptionsGA, - "preview": ApplicationGatewayRuleSetStatusOptionsPreview, - "supported": ApplicationGatewayRuleSetStatusOptionsSupported, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRuleSetStatusOptions(input) - return &out, nil -} - -type ApplicationGatewayTierTypes string - -const ( - ApplicationGatewayTierTypesStandard ApplicationGatewayTierTypes = "Standard" - ApplicationGatewayTierTypesStandardVTwo ApplicationGatewayTierTypes = "Standard_v2" - ApplicationGatewayTierTypesWAF ApplicationGatewayTierTypes = "WAF" - ApplicationGatewayTierTypesWAFVTwo ApplicationGatewayTierTypes = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTierTypes() []string { - return []string{ - string(ApplicationGatewayTierTypesStandard), - string(ApplicationGatewayTierTypesStandardVTwo), - string(ApplicationGatewayTierTypesWAF), - string(ApplicationGatewayTierTypesWAFVTwo), - } -} - -func (s *ApplicationGatewayTierTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTierTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTierTypes(input string) (*ApplicationGatewayTierTypes, error) { - vals := map[string]ApplicationGatewayTierTypes{ - "standard": ApplicationGatewayTierTypesStandard, - "standard_v2": ApplicationGatewayTierTypesStandardVTwo, - "waf": ApplicationGatewayTierTypesWAF, - "waf_v2": ApplicationGatewayTierTypesWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTierTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleActionTypes string - -const ( - ApplicationGatewayWafRuleActionTypesAllow ApplicationGatewayWafRuleActionTypes = "Allow" - ApplicationGatewayWafRuleActionTypesAnomalyScoring ApplicationGatewayWafRuleActionTypes = "AnomalyScoring" - ApplicationGatewayWafRuleActionTypesBlock ApplicationGatewayWafRuleActionTypes = "Block" - ApplicationGatewayWafRuleActionTypesLog ApplicationGatewayWafRuleActionTypes = "Log" - ApplicationGatewayWafRuleActionTypesNone ApplicationGatewayWafRuleActionTypes = "None" -) - -func PossibleValuesForApplicationGatewayWafRuleActionTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleActionTypesAllow), - string(ApplicationGatewayWafRuleActionTypesAnomalyScoring), - string(ApplicationGatewayWafRuleActionTypesBlock), - string(ApplicationGatewayWafRuleActionTypesLog), - string(ApplicationGatewayWafRuleActionTypesNone), - } -} - -func (s *ApplicationGatewayWafRuleActionTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleActionTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleActionTypes(input string) (*ApplicationGatewayWafRuleActionTypes, error) { - vals := map[string]ApplicationGatewayWafRuleActionTypes{ - "allow": ApplicationGatewayWafRuleActionTypesAllow, - "anomalyscoring": ApplicationGatewayWafRuleActionTypesAnomalyScoring, - "block": ApplicationGatewayWafRuleActionTypesBlock, - "log": ApplicationGatewayWafRuleActionTypesLog, - "none": ApplicationGatewayWafRuleActionTypesNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleActionTypes(input) - return &out, nil -} - -type ApplicationGatewayWafRuleStateTypes string - -const ( - ApplicationGatewayWafRuleStateTypesDisabled ApplicationGatewayWafRuleStateTypes = "Disabled" - ApplicationGatewayWafRuleStateTypesEnabled ApplicationGatewayWafRuleStateTypes = "Enabled" -) - -func PossibleValuesForApplicationGatewayWafRuleStateTypes() []string { - return []string{ - string(ApplicationGatewayWafRuleStateTypesDisabled), - string(ApplicationGatewayWafRuleStateTypesEnabled), - } -} - -func (s *ApplicationGatewayWafRuleStateTypes) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayWafRuleStateTypes(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayWafRuleStateTypes(input string) (*ApplicationGatewayWafRuleStateTypes, error) { - vals := map[string]ApplicationGatewayWafRuleStateTypes{ - "disabled": ApplicationGatewayWafRuleStateTypesDisabled, - "enabled": ApplicationGatewayWafRuleStateTypesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayWafRuleStateTypes(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location.go deleted file mode 100644 index 03b931e4e2f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location_test.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location_test.go deleted file mode 100644 index e88af2f1854..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_defaultget.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_defaultget.go deleted file mode 100644 index 0a6682174de..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_defaultget.go +++ /dev/null @@ -1,55 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 DefaultGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ApplicationGatewayWafDynamicManifestResult -} - -// DefaultGet ... -func (c ApplicationGatewayWafDynamicManifestsClient) DefaultGet(ctx context.Context, id LocationId) (result DefaultGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/applicationGatewayWafDynamicManifests/dafault", 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 ApplicationGatewayWafDynamicManifestResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_get.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_get.go deleted file mode 100644 index 7bcff9d682b..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/method_get.go +++ /dev/null @@ -1,91 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationGatewayWafDynamicManifestResult -} - -type GetCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationGatewayWafDynamicManifestResult -} - -// Get ... -func (c ApplicationGatewayWafDynamicManifestsClient) Get(ctx context.Context, id LocationId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/applicationGatewayWafDynamicManifests", 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 *[]ApplicationGatewayWafDynamicManifestResult `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetComplete retrieves all the results into a single object -func (c ApplicationGatewayWafDynamicManifestsClient) GetComplete(ctx context.Context, id LocationId) (GetCompleteResult, error) { - return c.GetCompleteMatchingPredicate(ctx, id, ApplicationGatewayWafDynamicManifestResultOperationPredicate{}) -} - -// GetCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationGatewayWafDynamicManifestsClient) GetCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate ApplicationGatewayWafDynamicManifestResultOperationPredicate) (result GetCompleteResult, err error) { - items := make([]ApplicationGatewayWafDynamicManifestResult, 0) - - resp, err := c.Get(ctx, id) - if err != nil { - 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 = GetCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go deleted file mode 100644 index 401a87a86a8..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallmanifestruleset.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallManifestRuleSet struct { - RuleGroups []ApplicationGatewayFirewallRuleGroup `json:"ruleGroups"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` - Status *ApplicationGatewayRuleSetStatusOptions `json:"status,omitempty"` - Tiers *[]ApplicationGatewayTierTypes `json:"tiers,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go deleted file mode 100644 index 723193ddc36..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRule struct { - Action *ApplicationGatewayWafRuleActionTypes `json:"action,omitempty"` - Description *string `json:"description,omitempty"` - RuleId int64 `json:"ruleId"` - RuleIdString *string `json:"ruleIdString,omitempty"` - State *ApplicationGatewayWafRuleStateTypes `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go deleted file mode 100644 index f9aefdfc147..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewayfirewallrulegroup.go +++ /dev/null @@ -1,10 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallRuleGroup struct { - Description *string `json:"description,omitempty"` - RuleGroupName string `json:"ruleGroupName"` - Rules []ApplicationGatewayFirewallRule `json:"rules"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go deleted file mode 100644 index d68d61add58..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestpropertiesresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWafDynamicManifestPropertiesResult struct { - AvailableRuleSets *[]ApplicationGatewayFirewallManifestRuleSet `json:"availableRuleSets,omitempty"` - DefaultRuleSet *DefaultRuleSetPropertyFormat `json:"defaultRuleSet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go deleted file mode 100644 index 763ec4aad23..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_applicationgatewaywafdynamicmanifestresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWafDynamicManifestResult struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayWafDynamicManifestPropertiesResult `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go deleted file mode 100644 index b69c307217f..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/model_defaultrulesetpropertyformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultRuleSetPropertyFormat struct { - RuleSetType *string `json:"ruleSetType,omitempty"` - RuleSetVersion *string `json:"ruleSetVersion,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/predicates.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/predicates.go deleted file mode 100644 index 9714d21637e..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWafDynamicManifestResultOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ApplicationGatewayWafDynamicManifestResultOperationPredicate) Matches(input ApplicationGatewayWafDynamicManifestResult) 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/network/2023-06-01/applicationgatewaywafdynamicmanifests/version.go b/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/version.go deleted file mode 100644 index b49593de8ae..00000000000 --- a/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationgatewaywafdynamicmanifests - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationgatewaywafdynamicmanifests/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/README.md b/resource-manager/network/2023-06-01/applicationsecuritygroups/README.md deleted file mode 100644 index 73a2237ef34..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationsecuritygroups` Documentation - -The `applicationsecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/applicationsecuritygroups" -``` - - -### Client Initialization - -```go -client := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -payload := applicationsecuritygroups.ApplicationSecurityGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -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: `ApplicationSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ApplicationSecurityGroupsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ApplicationSecurityGroupsClient.UpdateTags` - -```go -ctx := context.TODO() -id := applicationsecuritygroups.NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - -payload := applicationsecuritygroups.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/network/2023-06-01/applicationsecuritygroups/client.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/client.go deleted file mode 100644 index e607d64a7d3..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package applicationsecuritygroups - -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 ApplicationSecurityGroupsClient struct { - Client *resourcemanager.Client -} - -func NewApplicationSecurityGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*ApplicationSecurityGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "applicationsecuritygroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ApplicationSecurityGroupsClient: %+v", err) - } - - return &ApplicationSecurityGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/constants.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/constants.go deleted file mode 100644 index a226eb6274e..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package applicationsecuritygroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup.go deleted file mode 100644 index a776d455c05..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package applicationsecuritygroups - -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(&ApplicationSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &ApplicationSecurityGroupId{} - -// ApplicationSecurityGroupId is a struct representing the Resource ID for a Application Security Group -type ApplicationSecurityGroupId struct { - SubscriptionId string - ResourceGroupName string - ApplicationSecurityGroupName string -} - -// NewApplicationSecurityGroupID returns a new ApplicationSecurityGroupId struct -func NewApplicationSecurityGroupID(subscriptionId string, resourceGroupName string, applicationSecurityGroupName string) ApplicationSecurityGroupId { - return ApplicationSecurityGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationSecurityGroupName: applicationSecurityGroupName, - } -} - -// ParseApplicationSecurityGroupID parses 'input' into a ApplicationSecurityGroupId -func ParseApplicationSecurityGroupID(input string) (*ApplicationSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationSecurityGroupIDInsensitively parses 'input' case-insensitively into a ApplicationSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseApplicationSecurityGroupIDInsensitively(input string) (*ApplicationSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationSecurityGroupId) 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.ApplicationSecurityGroupName, ok = input.Parsed["applicationSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationSecurityGroupName", input) - } - - return nil -} - -// ValidateApplicationSecurityGroupID checks that 'input' can be parsed as a Application Security Group ID -func ValidateApplicationSecurityGroupID(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 := ParseApplicationSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Security Group ID -func (id ApplicationSecurityGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationSecurityGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Security Group ID -func (id ApplicationSecurityGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationSecurityGroups", "applicationSecurityGroups", "applicationSecurityGroups"), - resourceids.UserSpecifiedSegment("applicationSecurityGroupName", "applicationSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Application Security Group ID -func (id ApplicationSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Security Group Name: %q", id.ApplicationSecurityGroupName), - } - return fmt.Sprintf("Application Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go deleted file mode 100644 index 88b1a241a83..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/id_applicationsecuritygroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package applicationsecuritygroups - -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 = &ApplicationSecurityGroupId{} - -func TestNewApplicationSecurityGroupID(t *testing.T) { - id := NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue") - - 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.ApplicationSecurityGroupName != "applicationSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationSecurityGroupName'", id.ApplicationSecurityGroupName, "applicationSecurityGroupValue") - } -} - -func TestFormatApplicationSecurityGroupID(t *testing.T) { - actual := NewApplicationSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue", - Expected: &ApplicationSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationSecurityGroupName: "applicationSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationSecurityGroupID(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.ApplicationSecurityGroupName != v.Expected.ApplicationSecurityGroupName { - t.Fatalf("Expected %q but got %q for ApplicationSecurityGroupName", v.Expected.ApplicationSecurityGroupName, actual.ApplicationSecurityGroupName) - } - - } -} - -func TestParseApplicationSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnSeCuRiTyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue", - Expected: &ApplicationSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationSecurityGroupName: "applicationSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationSecurityGroups/applicationSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnSeCuRiTyGrOuPs/aPpLiCaTiOnSeCuRiTyGrOuPvAlUe", - Expected: &ApplicationSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationSecurityGroupName: "aPpLiCaTiOnSeCuRiTyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnSeCuRiTyGrOuPs/aPpLiCaTiOnSeCuRiTyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationSecurityGroupIDInsensitively(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.ApplicationSecurityGroupName != v.Expected.ApplicationSecurityGroupName { - t.Fatalf("Expected %q but got %q for ApplicationSecurityGroupName", v.Expected.ApplicationSecurityGroupName, actual.ApplicationSecurityGroupName) - } - - } -} - -func TestSegmentsForApplicationSecurityGroupId(t *testing.T) { - segments := ApplicationSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationSecurityGroupId 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/network/2023-06-01/applicationsecuritygroups/method_createorupdate.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/method_createorupdate.go deleted file mode 100644 index f2b60b46a6a..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package applicationsecuritygroups - -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 *ApplicationSecurityGroup -} - -// CreateOrUpdate ... -func (c ApplicationSecurityGroupsClient) CreateOrUpdate(ctx context.Context, id ApplicationSecurityGroupId, input ApplicationSecurityGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ApplicationSecurityGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id ApplicationSecurityGroupId, input ApplicationSecurityGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/applicationsecuritygroups/method_delete.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/method_delete.go deleted file mode 100644 index 6d16cb628e3..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package applicationsecuritygroups - -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 ApplicationSecurityGroupsClient) Delete(ctx context.Context, id ApplicationSecurityGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ApplicationSecurityGroupsClient) DeleteThenPoll(ctx context.Context, id ApplicationSecurityGroupId) 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/network/2023-06-01/applicationsecuritygroups/method_get.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/method_get.go deleted file mode 100644 index 5990e4033ff..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package applicationsecuritygroups - -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 *ApplicationSecurityGroup -} - -// Get ... -func (c ApplicationSecurityGroupsClient) Get(ctx context.Context, id ApplicationSecurityGroupId) (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 ApplicationSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_list.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/method_list.go deleted file mode 100644 index c5131274b67..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationsecuritygroups - -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 *[]ApplicationSecurityGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationSecurityGroup -} - -// List ... -func (c ApplicationSecurityGroupsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationSecurityGroups", 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 *[]ApplicationSecurityGroup `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 ApplicationSecurityGroupsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ApplicationSecurityGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationSecurityGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ApplicationSecurityGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ApplicationSecurityGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/applicationsecuritygroups/method_listall.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/method_listall.go deleted file mode 100644 index 52ce737d92d..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package applicationsecuritygroups - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ApplicationSecurityGroup -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []ApplicationSecurityGroup -} - -// ListAll ... -func (c ApplicationSecurityGroupsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationSecurityGroups", 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 *[]ApplicationSecurityGroup `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ApplicationSecurityGroupsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, ApplicationSecurityGroupOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ApplicationSecurityGroupsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ApplicationSecurityGroupOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]ApplicationSecurityGroup, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_updatetags.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/method_updatetags.go deleted file mode 100644 index 0343cea5693..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package applicationsecuritygroups - -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 *ApplicationSecurityGroup -} - -// UpdateTags ... -func (c ApplicationSecurityGroupsClient) UpdateTags(ctx context.Context, id ApplicationSecurityGroupId, 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 ApplicationSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygroup.go deleted file mode 100644 index 56c89e2151e..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package applicationsecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index c54772935da..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package applicationsecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/applicationsecuritygroups/model_tagsobject.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/model_tagsobject.go deleted file mode 100644 index b945e6c9cdf..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package applicationsecuritygroups - -// 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/network/2023-06-01/applicationsecuritygroups/predicates.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/predicates.go deleted file mode 100644 index 6ea534ecd89..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package applicationsecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ApplicationSecurityGroupOperationPredicate) Matches(input ApplicationSecurityGroup) 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 && (input.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/network/2023-06-01/applicationsecuritygroups/version.go b/resource-manager/network/2023-06-01/applicationsecuritygroups/version.go deleted file mode 100644 index f49fa206f74..00000000000 --- a/resource-manager/network/2023-06-01/applicationsecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package applicationsecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/applicationsecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/README.md b/resource-manager/network/2023-06-01/availabledelegations/README.md deleted file mode 100644 index e754c1e94eb..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/availabledelegations` Documentation - -The `availabledelegations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/availabledelegations" -``` - - -### Client Initialization - -```go -client := availabledelegations.NewAvailableDelegationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AvailableDelegationsClient.AvailableDelegationsList` - -```go -ctx := context.TODO() -id := availabledelegations.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailableDelegationsList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableDelegationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AvailableDelegationsClient.AvailableResourceGroupDelegationsList` - -```go -ctx := context.TODO() -id := availabledelegations.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.AvailableResourceGroupDelegationsList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableResourceGroupDelegationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/availabledelegations/client.go b/resource-manager/network/2023-06-01/availabledelegations/client.go deleted file mode 100644 index ff6ff754bce..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package availabledelegations - -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 AvailableDelegationsClient struct { - Client *resourcemanager.Client -} - -func NewAvailableDelegationsClientWithBaseURI(sdkApi sdkEnv.Api) (*AvailableDelegationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "availabledelegations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AvailableDelegationsClient: %+v", err) - } - - return &AvailableDelegationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/id_location.go b/resource-manager/network/2023-06-01/availabledelegations/id_location.go deleted file mode 100644 index 411da010546..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package availabledelegations - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/availabledelegations/id_location_test.go b/resource-manager/network/2023-06-01/availabledelegations/id_location_test.go deleted file mode 100644 index c8a4e105cc4..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package availabledelegations - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/availabledelegations/id_providerlocation.go b/resource-manager/network/2023-06-01/availabledelegations/id_providerlocation.go deleted file mode 100644 index 18b359986fc..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package availabledelegations - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/id_providerlocation_test.go b/resource-manager/network/2023-06-01/availabledelegations/id_providerlocation_test.go deleted file mode 100644 index 71efff5776b..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package availabledelegations - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-06-01/availabledelegations/method_availabledelegationslist.go b/resource-manager/network/2023-06-01/availabledelegations/method_availabledelegationslist.go deleted file mode 100644 index 053f6f860c6..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/method_availabledelegationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package availabledelegations - -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 AvailableDelegationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailableDelegation -} - -type AvailableDelegationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableDelegation -} - -// AvailableDelegationsList ... -func (c AvailableDelegationsClient) AvailableDelegationsList(ctx context.Context, id LocationId) (result AvailableDelegationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableDelegations", 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 *[]AvailableDelegation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailableDelegationsListComplete retrieves all the results into a single object -func (c AvailableDelegationsClient) AvailableDelegationsListComplete(ctx context.Context, id LocationId) (AvailableDelegationsListCompleteResult, error) { - return c.AvailableDelegationsListCompleteMatchingPredicate(ctx, id, AvailableDelegationOperationPredicate{}) -} - -// AvailableDelegationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableDelegationsClient) AvailableDelegationsListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AvailableDelegationOperationPredicate) (result AvailableDelegationsListCompleteResult, err error) { - items := make([]AvailableDelegation, 0) - - resp, err := c.AvailableDelegationsList(ctx, id) - if err != nil { - 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 = AvailableDelegationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/method_availableresourcegroupdelegationslist.go b/resource-manager/network/2023-06-01/availabledelegations/method_availableresourcegroupdelegationslist.go deleted file mode 100644 index 48a41795beb..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/method_availableresourcegroupdelegationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package availabledelegations - -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 AvailableResourceGroupDelegationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailableDelegation -} - -type AvailableResourceGroupDelegationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableDelegation -} - -// AvailableResourceGroupDelegationsList ... -func (c AvailableDelegationsClient) AvailableResourceGroupDelegationsList(ctx context.Context, id ProviderLocationId) (result AvailableResourceGroupDelegationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableDelegations", 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 *[]AvailableDelegation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailableResourceGroupDelegationsListComplete retrieves all the results into a single object -func (c AvailableDelegationsClient) AvailableResourceGroupDelegationsListComplete(ctx context.Context, id ProviderLocationId) (AvailableResourceGroupDelegationsListCompleteResult, error) { - return c.AvailableResourceGroupDelegationsListCompleteMatchingPredicate(ctx, id, AvailableDelegationOperationPredicate{}) -} - -// AvailableResourceGroupDelegationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableDelegationsClient) AvailableResourceGroupDelegationsListCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AvailableDelegationOperationPredicate) (result AvailableResourceGroupDelegationsListCompleteResult, err error) { - items := make([]AvailableDelegation, 0) - - resp, err := c.AvailableResourceGroupDelegationsList(ctx, id) - if err != nil { - 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 = AvailableResourceGroupDelegationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/model_availabledelegation.go b/resource-manager/network/2023-06-01/availabledelegations/model_availabledelegation.go deleted file mode 100644 index 0fa5dba60d1..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/model_availabledelegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package availabledelegations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableDelegation struct { - Actions *[]string `json:"actions,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/predicates.go b/resource-manager/network/2023-06-01/availabledelegations/predicates.go deleted file mode 100644 index caf6b904077..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package availabledelegations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableDelegationOperationPredicate struct { - Id *string - Name *string - ServiceName *string - Type *string -} - -func (p AvailableDelegationOperationPredicate) Matches(input AvailableDelegation) 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.ServiceName != nil && (input.ServiceName == nil || *p.ServiceName != *input.ServiceName) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/availabledelegations/version.go b/resource-manager/network/2023-06-01/availabledelegations/version.go deleted file mode 100644 index d883241db1b..00000000000 --- a/resource-manager/network/2023-06-01/availabledelegations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package availabledelegations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/availabledelegations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/availableservicealiases/README.md b/resource-manager/network/2023-06-01/availableservicealiases/README.md deleted file mode 100644 index e1c859d215c..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/availableservicealiases` Documentation - -The `availableservicealiases` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/availableservicealiases" -``` - - -### Client Initialization - -```go -client := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AvailableServiceAliasesClient.List` - -```go -ctx := context.TODO() -id := availableservicealiases.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// 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: `AvailableServiceAliasesClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := availableservicealiases.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// 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 -} -``` diff --git a/resource-manager/network/2023-06-01/availableservicealiases/client.go b/resource-manager/network/2023-06-01/availableservicealiases/client.go deleted file mode 100644 index 383e80f6061..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package availableservicealiases - -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 AvailableServiceAliasesClient struct { - Client *resourcemanager.Client -} - -func NewAvailableServiceAliasesClientWithBaseURI(sdkApi sdkEnv.Api) (*AvailableServiceAliasesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "availableservicealiases", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AvailableServiceAliasesClient: %+v", err) - } - - return &AvailableServiceAliasesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/availableservicealiases/id_location.go b/resource-manager/network/2023-06-01/availableservicealiases/id_location.go deleted file mode 100644 index 5bff2b43759..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package availableservicealiases - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/availableservicealiases/id_location_test.go b/resource-manager/network/2023-06-01/availableservicealiases/id_location_test.go deleted file mode 100644 index d04df9ce9ca..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package availableservicealiases - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/availableservicealiases/id_providerlocation.go b/resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation.go deleted file mode 100644 index 7ec8519458c..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package availableservicealiases - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation_test.go b/resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation_test.go deleted file mode 100644 index 07702c8432c..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package availableservicealiases - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-06-01/availableservicealiases/method_list.go b/resource-manager/network/2023-06-01/availableservicealiases/method_list.go deleted file mode 100644 index d3eb8df811b..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package availableservicealiases - -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 *[]AvailableServiceAlias -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableServiceAlias -} - -// List ... -func (c AvailableServiceAliasesClient) List(ctx context.Context, id LocationId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableServiceAliases", 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 *[]AvailableServiceAlias `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 AvailableServiceAliasesClient) ListComplete(ctx context.Context, id LocationId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AvailableServiceAliasOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableServiceAliasesClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AvailableServiceAliasOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AvailableServiceAlias, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/availableservicealiases/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/availableservicealiases/method_listbyresourcegroup.go deleted file mode 100644 index 4ccf14cc451..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/method_listbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package availableservicealiases - -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 ListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailableServiceAlias -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailableServiceAlias -} - -// ListByResourceGroup ... -func (c AvailableServiceAliasesClient) ListByResourceGroup(ctx context.Context, id ProviderLocationId) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availableServiceAliases", 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 *[]AvailableServiceAlias `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 AvailableServiceAliasesClient) ListByResourceGroupComplete(ctx context.Context, id ProviderLocationId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, AvailableServiceAliasOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AvailableServiceAliasesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AvailableServiceAliasOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]AvailableServiceAlias, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/availableservicealiases/model_availableservicealias.go b/resource-manager/network/2023-06-01/availableservicealiases/model_availableservicealias.go deleted file mode 100644 index b5f6cfd263b..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/model_availableservicealias.go +++ /dev/null @@ -1,11 +0,0 @@ -package availableservicealiases - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableServiceAlias struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/availableservicealiases/predicates.go b/resource-manager/network/2023-06-01/availableservicealiases/predicates.go deleted file mode 100644 index afe2abff9ab..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package availableservicealiases - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableServiceAliasOperationPredicate struct { - Id *string - Name *string - ResourceName *string - Type *string -} - -func (p AvailableServiceAliasOperationPredicate) Matches(input AvailableServiceAlias) 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.ResourceName != nil && (input.ResourceName == nil || *p.ResourceName != *input.ResourceName) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/availableservicealiases/version.go b/resource-manager/network/2023-06-01/availableservicealiases/version.go deleted file mode 100644 index 7cec9e107ef..00000000000 --- a/resource-manager/network/2023-06-01/availableservicealiases/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package availableservicealiases - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/availableservicealiases/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/README.md b/resource-manager/network/2023-06-01/azurefirewalls/README.md deleted file mode 100644 index c57ceb2d913..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/README.md +++ /dev/null @@ -1,146 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/azurefirewalls` Documentation - -The `azurefirewalls` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/azurefirewalls" -``` - - -### Client Initialization - -```go -client := azurefirewalls.NewAzureFirewallsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AzureFirewallsClient.AzureFirewallsListLearnedPrefixes` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -if err := client.AzureFirewallsListLearnedPrefixesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.AzureFirewall{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.Delete` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.Get` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -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: `AzureFirewallsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `AzureFirewallsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AzureFirewallsClient.PacketCapture` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.FirewallPacketCaptureParameters{ - // ... -} - - -if err := client.PacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `AzureFirewallsClient.UpdateTags` - -```go -ctx := context.TODO() -id := azurefirewalls.NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - -payload := azurefirewalls.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/azurefirewalls/client.go b/resource-manager/network/2023-06-01/azurefirewalls/client.go deleted file mode 100644 index e1119aea925..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package azurefirewalls - -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 AzureFirewallsClient struct { - Client *resourcemanager.Client -} - -func NewAzureFirewallsClientWithBaseURI(sdkApi sdkEnv.Api) (*AzureFirewallsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "azurefirewalls", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AzureFirewallsClient: %+v", err) - } - - return &AzureFirewallsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/constants.go b/resource-manager/network/2023-06-01/azurefirewalls/constants.go deleted file mode 100644 index d7a3af8fb71..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/constants.go +++ /dev/null @@ -1,412 +0,0 @@ -package azurefirewalls - -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 AzureFirewallApplicationRuleProtocolType string - -const ( - AzureFirewallApplicationRuleProtocolTypeHTTP AzureFirewallApplicationRuleProtocolType = "Http" - AzureFirewallApplicationRuleProtocolTypeHTTPS AzureFirewallApplicationRuleProtocolType = "Https" - AzureFirewallApplicationRuleProtocolTypeMssql AzureFirewallApplicationRuleProtocolType = "Mssql" -) - -func PossibleValuesForAzureFirewallApplicationRuleProtocolType() []string { - return []string{ - string(AzureFirewallApplicationRuleProtocolTypeHTTP), - string(AzureFirewallApplicationRuleProtocolTypeHTTPS), - string(AzureFirewallApplicationRuleProtocolTypeMssql), - } -} - -func (s *AzureFirewallApplicationRuleProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallApplicationRuleProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallApplicationRuleProtocolType(input string) (*AzureFirewallApplicationRuleProtocolType, error) { - vals := map[string]AzureFirewallApplicationRuleProtocolType{ - "http": AzureFirewallApplicationRuleProtocolTypeHTTP, - "https": AzureFirewallApplicationRuleProtocolTypeHTTPS, - "mssql": AzureFirewallApplicationRuleProtocolTypeMssql, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallApplicationRuleProtocolType(input) - return &out, nil -} - -type AzureFirewallNatRCActionType string - -const ( - AzureFirewallNatRCActionTypeDnat AzureFirewallNatRCActionType = "Dnat" - AzureFirewallNatRCActionTypeSnat AzureFirewallNatRCActionType = "Snat" -) - -func PossibleValuesForAzureFirewallNatRCActionType() []string { - return []string{ - string(AzureFirewallNatRCActionTypeDnat), - string(AzureFirewallNatRCActionTypeSnat), - } -} - -func (s *AzureFirewallNatRCActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallNatRCActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallNatRCActionType(input string) (*AzureFirewallNatRCActionType, error) { - vals := map[string]AzureFirewallNatRCActionType{ - "dnat": AzureFirewallNatRCActionTypeDnat, - "snat": AzureFirewallNatRCActionTypeSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallNatRCActionType(input) - return &out, nil -} - -type AzureFirewallNetworkRuleProtocol string - -const ( - AzureFirewallNetworkRuleProtocolAny AzureFirewallNetworkRuleProtocol = "Any" - AzureFirewallNetworkRuleProtocolICMP AzureFirewallNetworkRuleProtocol = "ICMP" - AzureFirewallNetworkRuleProtocolTCP AzureFirewallNetworkRuleProtocol = "TCP" - AzureFirewallNetworkRuleProtocolUDP AzureFirewallNetworkRuleProtocol = "UDP" -) - -func PossibleValuesForAzureFirewallNetworkRuleProtocol() []string { - return []string{ - string(AzureFirewallNetworkRuleProtocolAny), - string(AzureFirewallNetworkRuleProtocolICMP), - string(AzureFirewallNetworkRuleProtocolTCP), - string(AzureFirewallNetworkRuleProtocolUDP), - } -} - -func (s *AzureFirewallNetworkRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallNetworkRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallNetworkRuleProtocol(input string) (*AzureFirewallNetworkRuleProtocol, error) { - vals := map[string]AzureFirewallNetworkRuleProtocol{ - "any": AzureFirewallNetworkRuleProtocolAny, - "icmp": AzureFirewallNetworkRuleProtocolICMP, - "tcp": AzureFirewallNetworkRuleProtocolTCP, - "udp": AzureFirewallNetworkRuleProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallNetworkRuleProtocol(input) - return &out, nil -} - -type AzureFirewallPacketCaptureFlagsType string - -const ( - AzureFirewallPacketCaptureFlagsTypeAck AzureFirewallPacketCaptureFlagsType = "ack" - AzureFirewallPacketCaptureFlagsTypeFin AzureFirewallPacketCaptureFlagsType = "fin" - AzureFirewallPacketCaptureFlagsTypePush AzureFirewallPacketCaptureFlagsType = "push" - AzureFirewallPacketCaptureFlagsTypeRst AzureFirewallPacketCaptureFlagsType = "rst" - AzureFirewallPacketCaptureFlagsTypeSyn AzureFirewallPacketCaptureFlagsType = "syn" - AzureFirewallPacketCaptureFlagsTypeUrg AzureFirewallPacketCaptureFlagsType = "urg" -) - -func PossibleValuesForAzureFirewallPacketCaptureFlagsType() []string { - return []string{ - string(AzureFirewallPacketCaptureFlagsTypeAck), - string(AzureFirewallPacketCaptureFlagsTypeFin), - string(AzureFirewallPacketCaptureFlagsTypePush), - string(AzureFirewallPacketCaptureFlagsTypeRst), - string(AzureFirewallPacketCaptureFlagsTypeSyn), - string(AzureFirewallPacketCaptureFlagsTypeUrg), - } -} - -func (s *AzureFirewallPacketCaptureFlagsType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallPacketCaptureFlagsType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallPacketCaptureFlagsType(input string) (*AzureFirewallPacketCaptureFlagsType, error) { - vals := map[string]AzureFirewallPacketCaptureFlagsType{ - "ack": AzureFirewallPacketCaptureFlagsTypeAck, - "fin": AzureFirewallPacketCaptureFlagsTypeFin, - "push": AzureFirewallPacketCaptureFlagsTypePush, - "rst": AzureFirewallPacketCaptureFlagsTypeRst, - "syn": AzureFirewallPacketCaptureFlagsTypeSyn, - "urg": AzureFirewallPacketCaptureFlagsTypeUrg, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallPacketCaptureFlagsType(input) - return &out, nil -} - -type AzureFirewallRCActionType string - -const ( - AzureFirewallRCActionTypeAllow AzureFirewallRCActionType = "Allow" - AzureFirewallRCActionTypeDeny AzureFirewallRCActionType = "Deny" -) - -func PossibleValuesForAzureFirewallRCActionType() []string { - return []string{ - string(AzureFirewallRCActionTypeAllow), - string(AzureFirewallRCActionTypeDeny), - } -} - -func (s *AzureFirewallRCActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallRCActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallRCActionType(input string) (*AzureFirewallRCActionType, error) { - vals := map[string]AzureFirewallRCActionType{ - "allow": AzureFirewallRCActionTypeAllow, - "deny": AzureFirewallRCActionTypeDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallRCActionType(input) - return &out, nil -} - -type AzureFirewallSkuName string - -const ( - AzureFirewallSkuNameAZFWHub AzureFirewallSkuName = "AZFW_Hub" - AzureFirewallSkuNameAZFWVNet AzureFirewallSkuName = "AZFW_VNet" -) - -func PossibleValuesForAzureFirewallSkuName() []string { - return []string{ - string(AzureFirewallSkuNameAZFWHub), - string(AzureFirewallSkuNameAZFWVNet), - } -} - -func (s *AzureFirewallSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallSkuName(input string) (*AzureFirewallSkuName, error) { - vals := map[string]AzureFirewallSkuName{ - "azfw_hub": AzureFirewallSkuNameAZFWHub, - "azfw_vnet": AzureFirewallSkuNameAZFWVNet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallSkuName(input) - return &out, nil -} - -type AzureFirewallSkuTier string - -const ( - AzureFirewallSkuTierBasic AzureFirewallSkuTier = "Basic" - AzureFirewallSkuTierPremium AzureFirewallSkuTier = "Premium" - AzureFirewallSkuTierStandard AzureFirewallSkuTier = "Standard" -) - -func PossibleValuesForAzureFirewallSkuTier() []string { - return []string{ - string(AzureFirewallSkuTierBasic), - string(AzureFirewallSkuTierPremium), - string(AzureFirewallSkuTierStandard), - } -} - -func (s *AzureFirewallSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallSkuTier(input string) (*AzureFirewallSkuTier, error) { - vals := map[string]AzureFirewallSkuTier{ - "basic": AzureFirewallSkuTierBasic, - "premium": AzureFirewallSkuTierPremium, - "standard": AzureFirewallSkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallSkuTier(input) - return &out, nil -} - -type AzureFirewallThreatIntelMode string - -const ( - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -func PossibleValuesForAzureFirewallThreatIntelMode() []string { - return []string{ - string(AzureFirewallThreatIntelModeAlert), - string(AzureFirewallThreatIntelModeDeny), - string(AzureFirewallThreatIntelModeOff), - } -} - -func (s *AzureFirewallThreatIntelMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallThreatIntelMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallThreatIntelMode(input string) (*AzureFirewallThreatIntelMode, error) { - vals := map[string]AzureFirewallThreatIntelMode{ - "alert": AzureFirewallThreatIntelModeAlert, - "deny": AzureFirewallThreatIntelModeDeny, - "off": AzureFirewallThreatIntelModeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallThreatIntelMode(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall.go b/resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall.go deleted file mode 100644 index 20ab073f448..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall.go +++ /dev/null @@ -1,130 +0,0 @@ -package azurefirewalls - -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(&AzureFirewallId{}) -} - -var _ resourceids.ResourceId = &AzureFirewallId{} - -// AzureFirewallId is a struct representing the Resource ID for a Azure Firewall -type AzureFirewallId struct { - SubscriptionId string - ResourceGroupName string - AzureFirewallName string -} - -// NewAzureFirewallID returns a new AzureFirewallId struct -func NewAzureFirewallID(subscriptionId string, resourceGroupName string, azureFirewallName string) AzureFirewallId { - return AzureFirewallId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - AzureFirewallName: azureFirewallName, - } -} - -// ParseAzureFirewallID parses 'input' into a AzureFirewallId -func ParseAzureFirewallID(input string) (*AzureFirewallId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureFirewallId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureFirewallId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAzureFirewallIDInsensitively parses 'input' case-insensitively into a AzureFirewallId -// note: this method should only be used for API response data and not user input -func ParseAzureFirewallIDInsensitively(input string) (*AzureFirewallId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureFirewallId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureFirewallId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AzureFirewallId) 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.AzureFirewallName, ok = input.Parsed["azureFirewallName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "azureFirewallName", input) - } - - return nil -} - -// ValidateAzureFirewallID checks that 'input' can be parsed as a Azure Firewall ID -func ValidateAzureFirewallID(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 := ParseAzureFirewallID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Azure Firewall ID -func (id AzureFirewallId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/azureFirewalls/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.AzureFirewallName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Azure Firewall ID -func (id AzureFirewallId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticAzureFirewalls", "azureFirewalls", "azureFirewalls"), - resourceids.UserSpecifiedSegment("azureFirewallName", "azureFirewallValue"), - } -} - -// String returns a human-readable description of this Azure Firewall ID -func (id AzureFirewallId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Azure Firewall Name: %q", id.AzureFirewallName), - } - return fmt.Sprintf("Azure Firewall (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall_test.go b/resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall_test.go deleted file mode 100644 index 9819b454d9e..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/id_azurefirewall_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package azurefirewalls - -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 = &AzureFirewallId{} - -func TestNewAzureFirewallID(t *testing.T) { - id := NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue") - - 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.AzureFirewallName != "azureFirewallValue" { - t.Fatalf("Expected %q but got %q for Segment 'AzureFirewallName'", id.AzureFirewallName, "azureFirewallValue") - } -} - -func TestFormatAzureFirewallID(t *testing.T) { - actual := NewAzureFirewallID("12345678-1234-9876-4563-123456789012", "example-resource-group", "azureFirewallValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAzureFirewallID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureFirewallId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue", - Expected: &AzureFirewallId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AzureFirewallName: "azureFirewallValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureFirewallID(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.AzureFirewallName != v.Expected.AzureFirewallName { - t.Fatalf("Expected %q but got %q for AzureFirewallName", v.Expected.AzureFirewallName, actual.AzureFirewallName) - } - - } -} - -func TestParseAzureFirewallIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureFirewallId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReFiReWaLlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue", - Expected: &AzureFirewallId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - AzureFirewallName: "azureFirewallValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/azureFirewalls/azureFirewallValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReFiReWaLlS/aZuReFiReWaLlVaLuE", - Expected: &AzureFirewallId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - AzureFirewallName: "aZuReFiReWaLlVaLuE", - }, - }, - { - // 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.nEtWoRk/aZuReFiReWaLlS/aZuReFiReWaLlVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureFirewallIDInsensitively(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.AzureFirewallName != v.Expected.AzureFirewallName { - t.Fatalf("Expected %q but got %q for AzureFirewallName", v.Expected.AzureFirewallName, actual.AzureFirewallName) - } - - } -} - -func TestSegmentsForAzureFirewallId(t *testing.T) { - segments := AzureFirewallId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AzureFirewallId 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/network/2023-06-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go b/resource-manager/network/2023-06-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go deleted file mode 100644 index 79c6c0ccfd6..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_azurefirewallslistlearnedprefixes.go +++ /dev/null @@ -1,71 +0,0 @@ -package azurefirewalls - -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 AzureFirewallsListLearnedPrefixesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *IPPrefixesList -} - -// AzureFirewallsListLearnedPrefixes ... -func (c AzureFirewallsClient) AzureFirewallsListLearnedPrefixes(ctx context.Context, id AzureFirewallId) (result AzureFirewallsListLearnedPrefixesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/learnedIPPrefixes", 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 -} - -// AzureFirewallsListLearnedPrefixesThenPoll performs AzureFirewallsListLearnedPrefixes then polls until it's completed -func (c AzureFirewallsClient) AzureFirewallsListLearnedPrefixesThenPoll(ctx context.Context, id AzureFirewallId) error { - result, err := c.AzureFirewallsListLearnedPrefixes(ctx, id) - if err != nil { - return fmt.Errorf("performing AzureFirewallsListLearnedPrefixes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after AzureFirewallsListLearnedPrefixes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/method_createorupdate.go b/resource-manager/network/2023-06-01/azurefirewalls/method_createorupdate.go deleted file mode 100644 index fdd7520026c..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package azurefirewalls - -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 *AzureFirewall -} - -// CreateOrUpdate ... -func (c AzureFirewallsClient) CreateOrUpdate(ctx context.Context, id AzureFirewallId, input AzureFirewall) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c AzureFirewallsClient) CreateOrUpdateThenPoll(ctx context.Context, id AzureFirewallId, input AzureFirewall) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/azurefirewalls/method_delete.go b/resource-manager/network/2023-06-01/azurefirewalls/method_delete.go deleted file mode 100644 index 04fddc41723..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package azurefirewalls - -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 AzureFirewallsClient) Delete(ctx context.Context, id AzureFirewallId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 AzureFirewallsClient) DeleteThenPoll(ctx context.Context, id AzureFirewallId) 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/network/2023-06-01/azurefirewalls/method_get.go b/resource-manager/network/2023-06-01/azurefirewalls/method_get.go deleted file mode 100644 index 7fa6155aa4a..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package azurefirewalls - -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 *AzureFirewall -} - -// Get ... -func (c AzureFirewallsClient) Get(ctx context.Context, id AzureFirewallId) (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 AzureFirewall - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/method_list.go b/resource-manager/network/2023-06-01/azurefirewalls/method_list.go deleted file mode 100644 index 7a6095743be..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package azurefirewalls - -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 *[]AzureFirewall -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureFirewall -} - -// List ... -func (c AzureFirewallsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/azureFirewalls", 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 *[]AzureFirewall `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 AzureFirewallsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AzureFirewallOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AzureFirewallsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate AzureFirewallOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AzureFirewall, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/azurefirewalls/method_listall.go b/resource-manager/network/2023-06-01/azurefirewalls/method_listall.go deleted file mode 100644 index 86c7935255b..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package azurefirewalls - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AzureFirewall -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureFirewall -} - -// ListAll ... -func (c AzureFirewallsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/azureFirewalls", 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 *[]AzureFirewall `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c AzureFirewallsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, AzureFirewallOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AzureFirewallsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AzureFirewallOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]AzureFirewall, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/method_packetcapture.go b/resource-manager/network/2023-06-01/azurefirewalls/method_packetcapture.go deleted file mode 100644 index a2b211da6c7..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_packetcapture.go +++ /dev/null @@ -1,73 +0,0 @@ -package azurefirewalls - -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 PacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// PacketCapture ... -func (c AzureFirewallsClient) PacketCapture(ctx context.Context, id AzureFirewallId, input FirewallPacketCaptureParameters) (result PacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/packetCapture", 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 -} - -// PacketCaptureThenPoll performs PacketCapture then polls until it's completed -func (c AzureFirewallsClient) PacketCaptureThenPoll(ctx context.Context, id AzureFirewallId, input FirewallPacketCaptureParameters) error { - result, err := c.PacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/method_updatetags.go b/resource-manager/network/2023-06-01/azurefirewalls/method_updatetags.go deleted file mode 100644 index 1d404977af9..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package azurefirewalls - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *AzureFirewall -} - -// UpdateTags ... -func (c AzureFirewallsClient) UpdateTags(ctx context.Context, id AzureFirewallId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c AzureFirewallsClient) UpdateTagsThenPoll(ctx context.Context, id AzureFirewallId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/azurefirewalls/model_azurefirewall.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewall.go deleted file mode 100644 index da4d4ccf5f7..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewall.go +++ /dev/null @@ -1,19 +0,0 @@ -package azurefirewalls - -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 AzureFirewall struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrule.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrule.go deleted file mode 100644 index c74f6235d09..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrule.go +++ /dev/null @@ -1,14 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRule struct { - Description *string `json:"description,omitempty"` - FqdnTags *[]string `json:"fqdnTags,omitempty"` - Name *string `json:"name,omitempty"` - Protocols *[]AzureFirewallApplicationRuleProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TargetFqdns *[]string `json:"targetFqdns,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go deleted file mode 100644 index 0307e6e7b33..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollection.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallApplicationRuleCollectionPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go deleted file mode 100644 index bd5d09f330d..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRuleCollectionPropertiesFormat struct { - Action *AzureFirewallRCAction `json:"action,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]AzureFirewallApplicationRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go deleted file mode 100644 index 8ea63b2ef92..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallapplicationruleprotocol.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallApplicationRuleProtocol struct { - Port *int64 `json:"port,omitempty"` - ProtocolType *AzureFirewallApplicationRuleProtocolType `json:"protocolType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfiguration.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfiguration.go deleted file mode 100644 index 3456ba0b1ad..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go deleted file mode 100644 index cca79069337..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipgroups.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipgroups.go deleted file mode 100644 index e26c8540a65..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallipgroups.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallIPGroups struct { - ChangeNumber *string `json:"changeNumber,omitempty"` - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrcaction.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrcaction.go deleted file mode 100644 index 9c9250aef39..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrcaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRCAction struct { - Type *AzureFirewallNatRCActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrule.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrule.go deleted file mode 100644 index 70c0d009eab..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRule struct { - Description *string `json:"description,omitempty"` - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Name *string `json:"name,omitempty"` - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TranslatedAddress *string `json:"translatedAddress,omitempty"` - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - TranslatedPort *string `json:"translatedPort,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollection.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollection.go deleted file mode 100644 index d06cf19e359..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollection.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallNatRuleCollectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go deleted file mode 100644 index 774ac6902bc..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnatrulecollectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNatRuleCollectionProperties struct { - Action *AzureFirewallNatRCAction `json:"action,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]AzureFirewallNatRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrule.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrule.go deleted file mode 100644 index 6833c1f7509..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrule.go +++ /dev/null @@ -1,16 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNetworkRule struct { - Description *string `json:"description,omitempty"` - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Name *string `json:"name,omitempty"` - Protocols *[]AzureFirewallNetworkRuleProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go deleted file mode 100644 index ea5f2ba0d2b..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollection.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNetworkRuleCollection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureFirewallNetworkRuleCollectionPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go deleted file mode 100644 index be71e063370..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallnetworkrulecollectionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallNetworkRuleCollectionPropertiesFormat struct { - Action *AzureFirewallRCAction `json:"action,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]AzureFirewallNetworkRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go deleted file mode 100644 index edcc08e5590..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcaptureflags.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPacketCaptureFlags struct { - Type *AzureFirewallPacketCaptureFlagsType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcapturerule.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcapturerule.go deleted file mode 100644 index 4d9921e3243..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpacketcapturerule.go +++ /dev/null @@ -1,10 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPacketCaptureRule struct { - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Destinations *[]string `json:"destinations,omitempty"` - Sources *[]string `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpropertiesformat.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpropertiesformat.go deleted file mode 100644 index 0e8c463423f..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpropertiesformat.go +++ /dev/null @@ -1,20 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPropertiesFormat struct { - AdditionalProperties *map[string]string `json:"additionalProperties,omitempty"` - ApplicationRuleCollections *[]AzureFirewallApplicationRuleCollection `json:"applicationRuleCollections,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - HubIPAddresses *HubIPAddresses `json:"hubIPAddresses,omitempty"` - IPConfigurations *[]AzureFirewallIPConfiguration `json:"ipConfigurations,omitempty"` - IPGroups *[]AzureFirewallIPGroups `json:"ipGroups,omitempty"` - ManagementIPConfiguration *AzureFirewallIPConfiguration `json:"managementIpConfiguration,omitempty"` - NatRuleCollections *[]AzureFirewallNatRuleCollection `json:"natRuleCollections,omitempty"` - NetworkRuleCollections *[]AzureFirewallNetworkRuleCollection `json:"networkRuleCollections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Sku *AzureFirewallSku `json:"sku,omitempty"` - ThreatIntelMode *AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpublicipaddress.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpublicipaddress.go deleted file mode 100644 index c5dff4f3fff..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallpublicipaddress.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallPublicIPAddress struct { - Address *string `json:"address,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallrcaction.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallrcaction.go deleted file mode 100644 index 752c166b62b..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallrcaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallRCAction struct { - Type *AzureFirewallRCActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallsku.go b/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallsku.go deleted file mode 100644 index 46f81c15dbc..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_azurefirewallsku.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallSku struct { - Name *AzureFirewallSkuName `json:"name,omitempty"` - Tier *AzureFirewallSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparameters.go b/resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparameters.go deleted file mode 100644 index 258aca5b011..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPacketCaptureParameters struct { - Id *string `json:"id,omitempty"` - Properties *FirewallPacketCaptureParametersFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go b/resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go deleted file mode 100644 index c0c639f2390..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_firewallpacketcaptureparametersformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPacketCaptureParametersFormat struct { - DurationInSeconds *int64 `json:"durationInSeconds,omitempty"` - FileName *string `json:"fileName,omitempty"` - Filters *[]AzureFirewallPacketCaptureRule `json:"filters,omitempty"` - Flags *[]AzureFirewallPacketCaptureFlags `json:"flags,omitempty"` - NumberOfPacketsToCapture *int64 `json:"numberOfPacketsToCapture,omitempty"` - Protocol *AzureFirewallNetworkRuleProtocol `json:"protocol,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_hubipaddresses.go b/resource-manager/network/2023-06-01/azurefirewalls/model_hubipaddresses.go deleted file mode 100644 index 2fa8e41de6b..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_hubipaddresses.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubIPAddresses struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PublicIPs *HubPublicIPAddresses `json:"publicIPs,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_hubpublicipaddresses.go b/resource-manager/network/2023-06-01/azurefirewalls/model_hubpublicipaddresses.go deleted file mode 100644 index 48ee3132846..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_hubpublicipaddresses.go +++ /dev/null @@ -1,9 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubPublicIPAddresses struct { - Addresses *[]AzureFirewallPublicIPAddress `json:"addresses,omitempty"` - Count *int64 `json:"count,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_ipprefixeslist.go b/resource-manager/network/2023-06-01/azurefirewalls/model_ipprefixeslist.go deleted file mode 100644 index 3d2ea0d9a9e..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_ipprefixeslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPPrefixesList struct { - IPPrefixes *[]string `json:"ipPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_subresource.go b/resource-manager/network/2023-06-01/azurefirewalls/model_subresource.go deleted file mode 100644 index 3a39f2458c4..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/azurefirewalls/model_tagsobject.go b/resource-manager/network/2023-06-01/azurefirewalls/model_tagsobject.go deleted file mode 100644 index 3b70ce55bcd..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package azurefirewalls - -// 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/network/2023-06-01/azurefirewalls/predicates.go b/resource-manager/network/2023-06-01/azurefirewalls/predicates.go deleted file mode 100644 index 68ca8da5623..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package azurefirewalls - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureFirewallOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p AzureFirewallOperationPredicate) Matches(input AzureFirewall) 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 && (input.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/network/2023-06-01/azurefirewalls/version.go b/resource-manager/network/2023-06-01/azurefirewalls/version.go deleted file mode 100644 index 6ac43e94996..00000000000 --- a/resource-manager/network/2023-06-01/azurefirewalls/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package azurefirewalls - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/azurefirewalls/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/README.md b/resource-manager/network/2023-06-01/bastionhosts/README.md deleted file mode 100644 index ef11f60d2ba..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/README.md +++ /dev/null @@ -1,234 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/bastionhosts` Documentation - -The `bastionhosts` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/bastionhosts" -``` - - -### Client Initialization - -```go -client := bastionhosts.NewBastionHostsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BastionHostsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionHost{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.Delete` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DeleteBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DeleteBastionShareableLinkByToken` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkTokenListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkByTokenThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionHostsClient.DisconnectActiveSessions` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.SessionIds{ - // ... -} - - -// alternatively `client.DisconnectActiveSessions(ctx, id, payload)` can be used to do batched pagination -items, err := client.DisconnectActiveSessionsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.Get` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -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: `BastionHostsClient.GetActiveSessions` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -// alternatively `client.GetActiveSessions(ctx, id)` can be used to do batched pagination -items, err := client.GetActiveSessionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.GetBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.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: `BastionHostsClient.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: `BastionHostsClient.PutBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionHostsClient.UpdateTags` - -```go -ctx := context.TODO() -id := bastionhosts.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionhosts.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/bastionhosts/client.go b/resource-manager/network/2023-06-01/bastionhosts/client.go deleted file mode 100644 index 95e06c7f523..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bastionhosts - -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 BastionHostsClient struct { - Client *resourcemanager.Client -} - -func NewBastionHostsClientWithBaseURI(sdkApi sdkEnv.Api) (*BastionHostsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bastionhosts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BastionHostsClient: %+v", err) - } - - return &BastionHostsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/constants.go b/resource-manager/network/2023-06-01/bastionhosts/constants.go deleted file mode 100644 index 0b0ffa8a83a..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/constants.go +++ /dev/null @@ -1,183 +0,0 @@ -package bastionhosts - -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 BastionConnectProtocol string - -const ( - BastionConnectProtocolRDP BastionConnectProtocol = "RDP" - BastionConnectProtocolSSH BastionConnectProtocol = "SSH" -) - -func PossibleValuesForBastionConnectProtocol() []string { - return []string{ - string(BastionConnectProtocolRDP), - string(BastionConnectProtocolSSH), - } -} - -func (s *BastionConnectProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBastionConnectProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBastionConnectProtocol(input string) (*BastionConnectProtocol, error) { - vals := map[string]BastionConnectProtocol{ - "rdp": BastionConnectProtocolRDP, - "ssh": BastionConnectProtocolSSH, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BastionConnectProtocol(input) - return &out, nil -} - -type BastionHostSkuName string - -const ( - BastionHostSkuNameBasic BastionHostSkuName = "Basic" - BastionHostSkuNameDeveloper BastionHostSkuName = "Developer" - BastionHostSkuNameStandard BastionHostSkuName = "Standard" -) - -func PossibleValuesForBastionHostSkuName() []string { - return []string{ - string(BastionHostSkuNameBasic), - string(BastionHostSkuNameDeveloper), - string(BastionHostSkuNameStandard), - } -} - -func (s *BastionHostSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBastionHostSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBastionHostSkuName(input string) (*BastionHostSkuName, error) { - vals := map[string]BastionHostSkuName{ - "basic": BastionHostSkuNameBasic, - "developer": BastionHostSkuNameDeveloper, - "standard": BastionHostSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BastionHostSkuName(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/id_bastionhost.go b/resource-manager/network/2023-06-01/bastionhosts/id_bastionhost.go deleted file mode 100644 index 66012e2eda5..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/id_bastionhost.go +++ /dev/null @@ -1,130 +0,0 @@ -package bastionhosts - -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(&BastionHostId{}) -} - -var _ resourceids.ResourceId = &BastionHostId{} - -// BastionHostId is a struct representing the Resource ID for a Bastion Host -type BastionHostId struct { - SubscriptionId string - ResourceGroupName string - BastionHostName string -} - -// NewBastionHostID returns a new BastionHostId struct -func NewBastionHostID(subscriptionId string, resourceGroupName string, bastionHostName string) BastionHostId { - return BastionHostId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - BastionHostName: bastionHostName, - } -} - -// ParseBastionHostID parses 'input' into a BastionHostId -func ParseBastionHostID(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBastionHostIDInsensitively parses 'input' case-insensitively into a BastionHostId -// note: this method should only be used for API response data and not user input -func ParseBastionHostIDInsensitively(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BastionHostId) 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.BastionHostName, ok = input.Parsed["bastionHostName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bastionHostName", input) - } - - return nil -} - -// ValidateBastionHostID checks that 'input' can be parsed as a Bastion Host ID -func ValidateBastionHostID(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 := ParseBastionHostID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bastion Host ID -func (id BastionHostId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/bastionHosts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.BastionHostName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bastion Host ID -func (id BastionHostId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticBastionHosts", "bastionHosts", "bastionHosts"), - resourceids.UserSpecifiedSegment("bastionHostName", "bastionHostValue"), - } -} - -// String returns a human-readable description of this Bastion Host ID -func (id BastionHostId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Bastion Host Name: %q", id.BastionHostName), - } - return fmt.Sprintf("Bastion Host (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/id_bastionhost_test.go b/resource-manager/network/2023-06-01/bastionhosts/id_bastionhost_test.go deleted file mode 100644 index 025eba0aa75..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/id_bastionhost_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bastionhosts - -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 = &BastionHostId{} - -func TestNewBastionHostID(t *testing.T) { - id := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - - 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.BastionHostName != "bastionHostValue" { - t.Fatalf("Expected %q but got %q for Segment 'BastionHostName'", id.BastionHostName, "bastionHostValue") - } -} - -func TestFormatBastionHostID(t *testing.T) { - actual := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBastionHostID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostID(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestParseBastionHostIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BastionHostName: "bAsTiOnHoStVaLuE", - }, - }, - { - // 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.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostIDInsensitively(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestSegmentsForBastionHostId(t *testing.T) { - segments := BastionHostId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BastionHostId 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/network/2023-06-01/bastionhosts/method_createorupdate.go b/resource-manager/network/2023-06-01/bastionhosts/method_createorupdate.go deleted file mode 100644 index fe735012d1f..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package bastionhosts - -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 *BastionHost -} - -// CreateOrUpdate ... -func (c BastionHostsClient) CreateOrUpdate(ctx context.Context, id BastionHostId, input BastionHost) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c BastionHostsClient) CreateOrUpdateThenPoll(ctx context.Context, id BastionHostId, input BastionHost) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/bastionhosts/method_delete.go b/resource-manager/network/2023-06-01/bastionhosts/method_delete.go deleted file mode 100644 index 5eebbeeeed3..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package bastionhosts - -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 BastionHostsClient) Delete(ctx context.Context, id BastionHostId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 BastionHostsClient) DeleteThenPoll(ctx context.Context, id BastionHostId) 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/network/2023-06-01/bastionhosts/method_deletebastionshareablelink.go b/resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelink.go deleted file mode 100644 index 24694223a11..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelink.go +++ /dev/null @@ -1,74 +0,0 @@ -package bastionhosts - -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 DeleteBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeleteBastionShareableLink ... -func (c BastionHostsClient) DeleteBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result DeleteBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/deleteShareableLinks", 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 -} - -// DeleteBastionShareableLinkThenPoll performs DeleteBastionShareableLink then polls until it's completed -func (c BastionHostsClient) DeleteBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.DeleteBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DeleteBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeleteBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelinkbytoken.go b/resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelinkbytoken.go deleted file mode 100644 index dd4a99222c9..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_deletebastionshareablelinkbytoken.go +++ /dev/null @@ -1,73 +0,0 @@ -package bastionhosts - -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 DeleteBastionShareableLinkByTokenOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeleteBastionShareableLinkByToken ... -func (c BastionHostsClient) DeleteBastionShareableLinkByToken(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) (result DeleteBastionShareableLinkByTokenOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/deleteShareableLinksByToken", 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 -} - -// DeleteBastionShareableLinkByTokenThenPoll performs DeleteBastionShareableLinkByToken then polls until it's completed -func (c BastionHostsClient) DeleteBastionShareableLinkByTokenThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) error { - result, err := c.DeleteBastionShareableLinkByToken(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DeleteBastionShareableLinkByToken: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeleteBastionShareableLinkByToken: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_disconnectactivesessions.go b/resource-manager/network/2023-06-01/bastionhosts/method_disconnectactivesessions.go deleted file mode 100644 index 3a130339543..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_disconnectactivesessions.go +++ /dev/null @@ -1,91 +0,0 @@ -package bastionhosts - -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 DisconnectActiveSessionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionSessionState -} - -type DisconnectActiveSessionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionSessionState -} - -// DisconnectActiveSessions ... -func (c BastionHostsClient) DisconnectActiveSessions(ctx context.Context, id BastionHostId, input SessionIds) (result DisconnectActiveSessionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnectActiveSessions", 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 *[]BastionSessionState `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DisconnectActiveSessionsComplete retrieves all the results into a single object -func (c BastionHostsClient) DisconnectActiveSessionsComplete(ctx context.Context, id BastionHostId, input SessionIds) (DisconnectActiveSessionsCompleteResult, error) { - return c.DisconnectActiveSessionsCompleteMatchingPredicate(ctx, id, input, BastionSessionStateOperationPredicate{}) -} - -// DisconnectActiveSessionsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) DisconnectActiveSessionsCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input SessionIds, predicate BastionSessionStateOperationPredicate) (result DisconnectActiveSessionsCompleteResult, err error) { - items := make([]BastionSessionState, 0) - - resp, err := c.DisconnectActiveSessions(ctx, id, input) - if err != nil { - 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 = DisconnectActiveSessionsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_get.go b/resource-manager/network/2023-06-01/bastionhosts/method_get.go deleted file mode 100644 index 71b1a85a45f..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bastionhosts - -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 *BastionHost -} - -// Get ... -func (c BastionHostsClient) Get(ctx context.Context, id BastionHostId) (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 BastionHost - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_getactivesessions.go b/resource-manager/network/2023-06-01/bastionhosts/method_getactivesessions.go deleted file mode 100644 index bc50f38fc50..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_getactivesessions.go +++ /dev/null @@ -1,76 +0,0 @@ -package bastionhosts - -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 GetActiveSessionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionActiveSession -} - -type GetActiveSessionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionActiveSession -} - -// GetActiveSessions ... -func (c BastionHostsClient) GetActiveSessions(ctx context.Context, id BastionHostId) (result GetActiveSessionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getActiveSessions", 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 -} - -// GetActiveSessionsThenPoll performs GetActiveSessions then polls until it's completed -func (c BastionHostsClient) GetActiveSessionsThenPoll(ctx context.Context, id BastionHostId) error { - result, err := c.GetActiveSessions(ctx, id) - if err != nil { - return fmt.Errorf("performing GetActiveSessions: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetActiveSessions: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_getbastionshareablelink.go b/resource-manager/network/2023-06-01/bastionhosts/method_getbastionshareablelink.go deleted file mode 100644 index 1d277c1e88c..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_getbastionshareablelink.go +++ /dev/null @@ -1,91 +0,0 @@ -package bastionhosts - -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 GetBastionShareableLinkOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type GetBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// GetBastionShareableLink ... -func (c BastionHostsClient) GetBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result GetBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getShareableLinks", 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 *[]BastionShareableLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetBastionShareableLinkComplete retrieves all the results into a single object -func (c BastionHostsClient) GetBastionShareableLinkComplete(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (GetBastionShareableLinkCompleteResult, error) { - return c.GetBastionShareableLinkCompleteMatchingPredicate(ctx, id, input, BastionShareableLinkOperationPredicate{}) -} - -// GetBastionShareableLinkCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) GetBastionShareableLinkCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest, predicate BastionShareableLinkOperationPredicate) (result GetBastionShareableLinkCompleteResult, err error) { - items := make([]BastionShareableLink, 0) - - resp, err := c.GetBastionShareableLink(ctx, id, input) - if err != nil { - 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 = GetBastionShareableLinkCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_list.go b/resource-manager/network/2023-06-01/bastionhosts/method_list.go deleted file mode 100644 index db4bc8f1fae..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package bastionhosts - -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 *[]BastionHost -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionHost -} - -// List ... -func (c BastionHostsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/bastionHosts", 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 *[]BastionHost `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 BastionHostsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BastionHostOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate BastionHostOperationPredicate) (result ListCompleteResult, err error) { - items := make([]BastionHost, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/bastionhosts/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/bastionhosts/method_listbyresourcegroup.go deleted file mode 100644 index 20db6e5a89f..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package bastionhosts - -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 *[]BastionHost -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionHost -} - -// ListByResourceGroup ... -func (c BastionHostsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/bastionHosts", 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 *[]BastionHost `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 BastionHostsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, BastionHostOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionHostsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate BastionHostOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]BastionHost, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/bastionhosts/method_putbastionshareablelink.go b/resource-manager/network/2023-06-01/bastionhosts/method_putbastionshareablelink.go deleted file mode 100644 index 5f6e7438551..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_putbastionshareablelink.go +++ /dev/null @@ -1,80 +0,0 @@ -package bastionhosts - -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 PutBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type PutBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// PutBastionShareableLink ... -func (c BastionHostsClient) PutBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result PutBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createShareableLinks", 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 -} - -// PutBastionShareableLinkThenPoll performs PutBastionShareableLink then polls until it's completed -func (c BastionHostsClient) PutBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.PutBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PutBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PutBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/method_updatetags.go b/resource-manager/network/2023-06-01/bastionhosts/method_updatetags.go deleted file mode 100644 index 697efefb0c8..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package bastionhosts - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BastionHost -} - -// UpdateTags ... -func (c BastionHostsClient) UpdateTags(ctx context.Context, id BastionHostId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c BastionHostsClient) UpdateTagsThenPoll(ctx context.Context, id BastionHostId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/bastionhosts/model_bastionactivesession.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionactivesession.go deleted file mode 100644 index 4f5fe8c844e..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionactivesession.go +++ /dev/null @@ -1,18 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionActiveSession struct { - Protocol *BastionConnectProtocol `json:"protocol,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` - SessionDurationInMins *float64 `json:"sessionDurationInMins,omitempty"` - SessionId *string `json:"sessionId,omitempty"` - StartTime *interface{} `json:"startTime,omitempty"` - TargetHostName *string `json:"targetHostName,omitempty"` - TargetIPAddress *string `json:"targetIpAddress,omitempty"` - TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` - TargetSubscriptionId *string `json:"targetSubscriptionId,omitempty"` - UserName *string `json:"userName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhost.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionhost.go deleted file mode 100644 index e9545c59424..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhost.go +++ /dev/null @@ -1,15 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHost struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BastionHostPropertiesFormat `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfiguration.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfiguration.go deleted file mode 100644 index efda704773c..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BastionHostIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go deleted file mode 100644 index 34d950723a1..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostipconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostIPConfigurationPropertiesFormat struct { - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress SubResource `json:"publicIPAddress"` - Subnet SubResource `json:"subnet"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformat.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformat.go deleted file mode 100644 index 32bf85022ef..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostPropertiesFormat struct { - DisableCopyPaste *bool `json:"disableCopyPaste,omitempty"` - DnsName *string `json:"dnsName,omitempty"` - EnableFileCopy *bool `json:"enableFileCopy,omitempty"` - EnableIPConnect *bool `json:"enableIpConnect,omitempty"` - EnableKerberos *bool `json:"enableKerberos,omitempty"` - EnableShareableLink *bool `json:"enableShareableLink,omitempty"` - EnableTunneling *bool `json:"enableTunneling,omitempty"` - IPConfigurations *[]BastionHostIPConfiguration `json:"ipConfigurations,omitempty"` - NetworkAcls *BastionHostPropertiesFormatNetworkAcls `json:"networkAcls,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ScaleUnits *int64 `json:"scaleUnits,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go deleted file mode 100644 index f217ff8d9ae..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionhostpropertiesformatnetworkacls.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionHostPropertiesFormatNetworkAcls struct { - IPRules *[]IPRule `json:"ipRules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionsessionstate.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionsessionstate.go deleted file mode 100644 index f60a5f77620..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionsessionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionSessionState struct { - Message *string `json:"message,omitempty"` - SessionId *string `json:"sessionId,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelink.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelink.go deleted file mode 100644 index 4da004b8f53..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLink struct { - Bsl *string `json:"bsl,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - Message *string `json:"message,omitempty"` - VM Resource `json:"vm"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinklistrequest.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinklistrequest.go deleted file mode 100644 index 925995fca64..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinklistrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkListRequest struct { - VMs *[]BastionShareableLink `json:"vms,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go b/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go deleted file mode 100644 index 0b7aa54ce71..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_bastionshareablelinktokenlistrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkTokenListRequest struct { - Tokens *[]string `json:"tokens,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_iprule.go b/resource-manager/network/2023-06-01/bastionhosts/model_iprule.go deleted file mode 100644 index a54a84aac8e..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_iprule.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPRule struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_resource.go b/resource-manager/network/2023-06-01/bastionhosts/model_resource.go deleted file mode 100644 index 17e7756ce3c..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_resource.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Resource struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_sessionids.go b/resource-manager/network/2023-06-01/bastionhosts/model_sessionids.go deleted file mode 100644 index a74e44a3ebd..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_sessionids.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SessionIds struct { - SessionIds *[]string `json:"sessionIds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_sku.go b/resource-manager/network/2023-06-01/bastionhosts/model_sku.go deleted file mode 100644 index 1a8a8749a46..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_sku.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Name *BastionHostSkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_subresource.go b/resource-manager/network/2023-06-01/bastionhosts/model_subresource.go deleted file mode 100644 index 7a0a23a149a..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/model_tagsobject.go b/resource-manager/network/2023-06-01/bastionhosts/model_tagsobject.go deleted file mode 100644 index 73566b88f0b..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionhosts - -// 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/network/2023-06-01/bastionhosts/predicates.go b/resource-manager/network/2023-06-01/bastionhosts/predicates.go deleted file mode 100644 index 3c3835a32d0..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/predicates.go +++ /dev/null @@ -1,141 +0,0 @@ -package bastionhosts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionActiveSessionOperationPredicate struct { - ResourceType *string - SessionDurationInMins *float64 - SessionId *string - StartTime *interface{} - TargetHostName *string - TargetIPAddress *string - TargetResourceGroup *string - TargetResourceId *string - TargetSubscriptionId *string - UserName *string -} - -func (p BastionActiveSessionOperationPredicate) Matches(input BastionActiveSession) bool { - - if p.ResourceType != nil && (input.ResourceType == nil || *p.ResourceType != *input.ResourceType) { - return false - } - - if p.SessionDurationInMins != nil && (input.SessionDurationInMins == nil || *p.SessionDurationInMins != *input.SessionDurationInMins) { - return false - } - - if p.SessionId != nil && (input.SessionId == nil || *p.SessionId != *input.SessionId) { - return false - } - - if p.StartTime != nil && (input.StartTime == nil || *p.StartTime != *input.StartTime) { - return false - } - - if p.TargetHostName != nil && (input.TargetHostName == nil || *p.TargetHostName != *input.TargetHostName) { - return false - } - - if p.TargetIPAddress != nil && (input.TargetIPAddress == nil || *p.TargetIPAddress != *input.TargetIPAddress) { - return false - } - - if p.TargetResourceGroup != nil && (input.TargetResourceGroup == nil || *p.TargetResourceGroup != *input.TargetResourceGroup) { - return false - } - - if p.TargetResourceId != nil && (input.TargetResourceId == nil || *p.TargetResourceId != *input.TargetResourceId) { - return false - } - - if p.TargetSubscriptionId != nil && (input.TargetSubscriptionId == nil || *p.TargetSubscriptionId != *input.TargetSubscriptionId) { - return false - } - - if p.UserName != nil && (input.UserName == nil || *p.UserName != *input.UserName) { - return false - } - - return true -} - -type BastionHostOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p BastionHostOperationPredicate) Matches(input BastionHost) 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 && (input.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 BastionSessionStateOperationPredicate struct { - Message *string - SessionId *string - State *string -} - -func (p BastionSessionStateOperationPredicate) Matches(input BastionSessionState) bool { - - if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { - return false - } - - if p.SessionId != nil && (input.SessionId == nil || *p.SessionId != *input.SessionId) { - return false - } - - if p.State != nil && (input.State == nil || *p.State != *input.State) { - return false - } - - return true -} - -type BastionShareableLinkOperationPredicate struct { - Bsl *string - CreatedAt *string - Message *string -} - -func (p BastionShareableLinkOperationPredicate) Matches(input BastionShareableLink) bool { - - if p.Bsl != nil && (input.Bsl == nil || *p.Bsl != *input.Bsl) { - return false - } - - if p.CreatedAt != nil && (input.CreatedAt == nil || *p.CreatedAt != *input.CreatedAt) { - return false - } - - if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/bastionhosts/version.go b/resource-manager/network/2023-06-01/bastionhosts/version.go deleted file mode 100644 index a445768bba6..00000000000 --- a/resource-manager/network/2023-06-01/bastionhosts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionhosts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bastionhosts/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/README.md b/resource-manager/network/2023-06-01/bastionshareablelink/README.md deleted file mode 100644 index a76fea43db2..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/README.md +++ /dev/null @@ -1,98 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/bastionshareablelink` Documentation - -The `bastionshareablelink` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/bastionshareablelink" -``` - - -### Client Initialization - -```go -client := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BastionShareableLinkClient.DeleteBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionShareableLinkClient.DeleteBastionShareableLinkByToken` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkTokenListRequest{ - // ... -} - - -if err := client.DeleteBastionShareableLinkByTokenThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `BastionShareableLinkClient.GetBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.GetBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.GetBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `BastionShareableLinkClient.PutBastionShareableLink` - -```go -ctx := context.TODO() -id := bastionshareablelink.NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - -payload := bastionshareablelink.BastionShareableLinkListRequest{ - // ... -} - - -// alternatively `client.PutBastionShareableLink(ctx, id, payload)` can be used to do batched pagination -items, err := client.PutBastionShareableLinkComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/client.go b/resource-manager/network/2023-06-01/bastionshareablelink/client.go deleted file mode 100644 index 9c49b25b52f..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bastionshareablelink - -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 BastionShareableLinkClient struct { - Client *resourcemanager.Client -} - -func NewBastionShareableLinkClientWithBaseURI(sdkApi sdkEnv.Api) (*BastionShareableLinkClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bastionshareablelink", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BastionShareableLinkClient: %+v", err) - } - - return &BastionShareableLinkClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost.go b/resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost.go deleted file mode 100644 index b2cc2bfc5be..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost.go +++ /dev/null @@ -1,130 +0,0 @@ -package bastionshareablelink - -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(&BastionHostId{}) -} - -var _ resourceids.ResourceId = &BastionHostId{} - -// BastionHostId is a struct representing the Resource ID for a Bastion Host -type BastionHostId struct { - SubscriptionId string - ResourceGroupName string - BastionHostName string -} - -// NewBastionHostID returns a new BastionHostId struct -func NewBastionHostID(subscriptionId string, resourceGroupName string, bastionHostName string) BastionHostId { - return BastionHostId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - BastionHostName: bastionHostName, - } -} - -// ParseBastionHostID parses 'input' into a BastionHostId -func ParseBastionHostID(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBastionHostIDInsensitively parses 'input' case-insensitively into a BastionHostId -// note: this method should only be used for API response data and not user input -func ParseBastionHostIDInsensitively(input string) (*BastionHostId, error) { - parser := resourceids.NewParserFromResourceIdType(&BastionHostId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BastionHostId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BastionHostId) 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.BastionHostName, ok = input.Parsed["bastionHostName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bastionHostName", input) - } - - return nil -} - -// ValidateBastionHostID checks that 'input' can be parsed as a Bastion Host ID -func ValidateBastionHostID(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 := ParseBastionHostID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bastion Host ID -func (id BastionHostId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/bastionHosts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.BastionHostName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bastion Host ID -func (id BastionHostId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticBastionHosts", "bastionHosts", "bastionHosts"), - resourceids.UserSpecifiedSegment("bastionHostName", "bastionHostValue"), - } -} - -// String returns a human-readable description of this Bastion Host ID -func (id BastionHostId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Bastion Host Name: %q", id.BastionHostName), - } - return fmt.Sprintf("Bastion Host (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost_test.go b/resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost_test.go deleted file mode 100644 index ee09527e52f..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/id_bastionhost_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bastionshareablelink - -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 = &BastionHostId{} - -func TestNewBastionHostID(t *testing.T) { - id := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue") - - 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.BastionHostName != "bastionHostValue" { - t.Fatalf("Expected %q but got %q for Segment 'BastionHostName'", id.BastionHostName, "bastionHostValue") - } -} - -func TestFormatBastionHostID(t *testing.T) { - actual := NewBastionHostID("12345678-1234-9876-4563-123456789012", "example-resource-group", "bastionHostValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBastionHostID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostID(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestParseBastionHostIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BastionHostId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - BastionHostName: "bastionHostValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/bastionHosts/bastionHostValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE", - Expected: &BastionHostId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - BastionHostName: "bAsTiOnHoStVaLuE", - }, - }, - { - // 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.nEtWoRk/bAsTiOnHoStS/bAsTiOnHoStVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBastionHostIDInsensitively(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.BastionHostName != v.Expected.BastionHostName { - t.Fatalf("Expected %q but got %q for BastionHostName", v.Expected.BastionHostName, actual.BastionHostName) - } - - } -} - -func TestSegmentsForBastionHostId(t *testing.T) { - segments := BastionHostId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BastionHostId 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/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelink.go b/resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelink.go deleted file mode 100644 index 6b46bbc5fea..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelink.go +++ /dev/null @@ -1,74 +0,0 @@ -package bastionshareablelink - -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 DeleteBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeleteBastionShareableLink ... -func (c BastionShareableLinkClient) DeleteBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result DeleteBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/deleteShareableLinks", 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 -} - -// DeleteBastionShareableLinkThenPoll performs DeleteBastionShareableLink then polls until it's completed -func (c BastionShareableLinkClient) DeleteBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.DeleteBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DeleteBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeleteBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelinkbytoken.go b/resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelinkbytoken.go deleted file mode 100644 index f2973cf1c92..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/method_deletebastionshareablelinkbytoken.go +++ /dev/null @@ -1,73 +0,0 @@ -package bastionshareablelink - -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 DeleteBastionShareableLinkByTokenOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeleteBastionShareableLinkByToken ... -func (c BastionShareableLinkClient) DeleteBastionShareableLinkByToken(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) (result DeleteBastionShareableLinkByTokenOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/deleteShareableLinksByToken", 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 -} - -// DeleteBastionShareableLinkByTokenThenPoll performs DeleteBastionShareableLinkByToken then polls until it's completed -func (c BastionShareableLinkClient) DeleteBastionShareableLinkByTokenThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkTokenListRequest) error { - result, err := c.DeleteBastionShareableLinkByToken(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DeleteBastionShareableLinkByToken: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeleteBastionShareableLinkByToken: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/method_getbastionshareablelink.go b/resource-manager/network/2023-06-01/bastionshareablelink/method_getbastionshareablelink.go deleted file mode 100644 index 689ab2d57fc..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/method_getbastionshareablelink.go +++ /dev/null @@ -1,91 +0,0 @@ -package bastionshareablelink - -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 GetBastionShareableLinkOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type GetBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// GetBastionShareableLink ... -func (c BastionShareableLinkClient) GetBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result GetBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getShareableLinks", 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 *[]BastionShareableLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetBastionShareableLinkComplete retrieves all the results into a single object -func (c BastionShareableLinkClient) GetBastionShareableLinkComplete(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (GetBastionShareableLinkCompleteResult, error) { - return c.GetBastionShareableLinkCompleteMatchingPredicate(ctx, id, input, BastionShareableLinkOperationPredicate{}) -} - -// GetBastionShareableLinkCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BastionShareableLinkClient) GetBastionShareableLinkCompleteMatchingPredicate(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest, predicate BastionShareableLinkOperationPredicate) (result GetBastionShareableLinkCompleteResult, err error) { - items := make([]BastionShareableLink, 0) - - resp, err := c.GetBastionShareableLink(ctx, id, input) - if err != nil { - 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 = GetBastionShareableLinkCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/method_putbastionshareablelink.go b/resource-manager/network/2023-06-01/bastionshareablelink/method_putbastionshareablelink.go deleted file mode 100644 index bf85b28ee63..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/method_putbastionshareablelink.go +++ /dev/null @@ -1,80 +0,0 @@ -package bastionshareablelink - -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 PutBastionShareableLinkOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]BastionShareableLink -} - -type PutBastionShareableLinkCompleteResult struct { - LatestHttpResponse *http.Response - Items []BastionShareableLink -} - -// PutBastionShareableLink ... -func (c BastionShareableLinkClient) PutBastionShareableLink(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) (result PutBastionShareableLinkOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createShareableLinks", 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 -} - -// PutBastionShareableLinkThenPoll performs PutBastionShareableLink then polls until it's completed -func (c BastionShareableLinkClient) PutBastionShareableLinkThenPoll(ctx context.Context, id BastionHostId, input BastionShareableLinkListRequest) error { - result, err := c.PutBastionShareableLink(ctx, id, input) - if err != nil { - return fmt.Errorf("performing PutBastionShareableLink: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after PutBastionShareableLink: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelink.go b/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelink.go deleted file mode 100644 index a0bc0647825..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLink struct { - Bsl *string `json:"bsl,omitempty"` - CreatedAt *string `json:"createdAt,omitempty"` - Message *string `json:"message,omitempty"` - VM Resource `json:"vm"` -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinklistrequest.go b/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinklistrequest.go deleted file mode 100644 index e41fcb083d8..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinklistrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkListRequest struct { - VMs *[]BastionShareableLink `json:"vms,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinktokenlistrequest.go b/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinktokenlistrequest.go deleted file mode 100644 index 10d868903d8..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/model_bastionshareablelinktokenlistrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkTokenListRequest struct { - Tokens *[]string `json:"tokens,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/model_resource.go b/resource-manager/network/2023-06-01/bastionshareablelink/model_resource.go deleted file mode 100644 index 31d5ef85703..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/model_resource.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Resource struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/predicates.go b/resource-manager/network/2023-06-01/bastionshareablelink/predicates.go deleted file mode 100644 index 15f07095262..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package bastionshareablelink - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BastionShareableLinkOperationPredicate struct { - Bsl *string - CreatedAt *string - Message *string -} - -func (p BastionShareableLinkOperationPredicate) Matches(input BastionShareableLink) bool { - - if p.Bsl != nil && (input.Bsl == nil || *p.Bsl != *input.Bsl) { - return false - } - - if p.CreatedAt != nil && (input.CreatedAt == nil || *p.CreatedAt != *input.CreatedAt) { - return false - } - - if p.Message != nil && (input.Message == nil || *p.Message != *input.Message) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/bastionshareablelink/version.go b/resource-manager/network/2023-06-01/bastionshareablelink/version.go deleted file mode 100644 index 6f1ccc43d97..00000000000 --- a/resource-manager/network/2023-06-01/bastionshareablelink/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bastionshareablelink - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bastionshareablelink/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/bgpservicecommunities/README.md b/resource-manager/network/2023-06-01/bgpservicecommunities/README.md deleted file mode 100644 index 8d642409290..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/bgpservicecommunities` Documentation - -The `bgpservicecommunities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/bgpservicecommunities" -``` - - -### Client Initialization - -```go -client := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BgpServiceCommunitiesClient.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 -} -``` diff --git a/resource-manager/network/2023-06-01/bgpservicecommunities/client.go b/resource-manager/network/2023-06-01/bgpservicecommunities/client.go deleted file mode 100644 index 07cf4f59649..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bgpservicecommunities - -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 BgpServiceCommunitiesClient struct { - Client *resourcemanager.Client -} - -func NewBgpServiceCommunitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*BgpServiceCommunitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bgpservicecommunities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BgpServiceCommunitiesClient: %+v", err) - } - - return &BgpServiceCommunitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/bgpservicecommunities/method_list.go b/resource-manager/network/2023-06-01/bgpservicecommunities/method_list.go deleted file mode 100644 index d15a74f2d18..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package bgpservicecommunities - -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 *[]BgpServiceCommunity -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BgpServiceCommunity -} - -// List ... -func (c BgpServiceCommunitiesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/bgpServiceCommunities", 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 *[]BgpServiceCommunity `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 BgpServiceCommunitiesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BgpServiceCommunityOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BgpServiceCommunitiesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate BgpServiceCommunityOperationPredicate) (result ListCompleteResult, err error) { - items := make([]BgpServiceCommunity, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/bgpservicecommunities/model_bgpcommunity.go b/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpcommunity.go deleted file mode 100644 index 87cd63647eb..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpcommunity.go +++ /dev/null @@ -1,13 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BGPCommunity struct { - CommunityName *string `json:"communityName,omitempty"` - CommunityPrefixes *[]string `json:"communityPrefixes,omitempty"` - CommunityValue *string `json:"communityValue,omitempty"` - IsAuthorizedToUse *bool `json:"isAuthorizedToUse,omitempty"` - ServiceGroup *string `json:"serviceGroup,omitempty"` - ServiceSupportedRegion *string `json:"serviceSupportedRegion,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunity.go b/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunity.go deleted file mode 100644 index 0fad9ca63e5..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunity.go +++ /dev/null @@ -1,13 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpServiceCommunity struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BgpServiceCommunityPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go b/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go deleted file mode 100644 index 5bf2c270ecc..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/model_bgpservicecommunitypropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpServiceCommunityPropertiesFormat struct { - BgpCommunities *[]BGPCommunity `json:"bgpCommunities,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/bgpservicecommunities/predicates.go b/resource-manager/network/2023-06-01/bgpservicecommunities/predicates.go deleted file mode 100644 index 2e90f55ae55..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bgpservicecommunities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpServiceCommunityOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p BgpServiceCommunityOperationPredicate) Matches(input BgpServiceCommunity) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/network/2023-06-01/bgpservicecommunities/version.go b/resource-manager/network/2023-06-01/bgpservicecommunities/version.go deleted file mode 100644 index cfd00254013..00000000000 --- a/resource-manager/network/2023-06-01/bgpservicecommunities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bgpservicecommunities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bgpservicecommunities/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/checkdnsavailabilities/README.md b/resource-manager/network/2023-06-01/checkdnsavailabilities/README.md deleted file mode 100644 index 8b2a1d0aac0..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/checkdnsavailabilities` Documentation - -The `checkdnsavailabilities` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/checkdnsavailabilities" -``` - - -### Client Initialization - -```go -client := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CheckDnsAvailabilitiesClient.CheckDnsNameAvailability` - -```go -ctx := context.TODO() -id := checkdnsavailabilities.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.CheckDnsNameAvailability(ctx, id, checkdnsavailabilities.DefaultCheckDnsNameAvailabilityOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/network/2023-06-01/checkdnsavailabilities/client.go b/resource-manager/network/2023-06-01/checkdnsavailabilities/client.go deleted file mode 100644 index 14eb1a4baa0..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package checkdnsavailabilities - -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 CheckDnsAvailabilitiesClient struct { - Client *resourcemanager.Client -} - -func NewCheckDnsAvailabilitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*CheckDnsAvailabilitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "checkdnsavailabilities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CheckDnsAvailabilitiesClient: %+v", err) - } - - return &CheckDnsAvailabilitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/checkdnsavailabilities/id_location.go b/resource-manager/network/2023-06-01/checkdnsavailabilities/id_location.go deleted file mode 100644 index 1adf8c560da..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package checkdnsavailabilities - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/checkdnsavailabilities/id_location_test.go b/resource-manager/network/2023-06-01/checkdnsavailabilities/id_location_test.go deleted file mode 100644 index 17ddce78457..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package checkdnsavailabilities - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/checkdnsavailabilities/method_checkdnsnameavailability.go b/resource-manager/network/2023-06-01/checkdnsavailabilities/method_checkdnsnameavailability.go deleted file mode 100644 index 7a516978d72..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/method_checkdnsnameavailability.go +++ /dev/null @@ -1,83 +0,0 @@ -package checkdnsavailabilities - -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 CheckDnsNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DnsNameAvailabilityResult -} - -type CheckDnsNameAvailabilityOperationOptions struct { - DomainNameLabel *string -} - -func DefaultCheckDnsNameAvailabilityOperationOptions() CheckDnsNameAvailabilityOperationOptions { - return CheckDnsNameAvailabilityOperationOptions{} -} - -func (o CheckDnsNameAvailabilityOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CheckDnsNameAvailabilityOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CheckDnsNameAvailabilityOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.DomainNameLabel != nil { - out.Append("domainNameLabel", fmt.Sprintf("%v", *o.DomainNameLabel)) - } - return &out -} - -// CheckDnsNameAvailability ... -func (c CheckDnsAvailabilitiesClient) CheckDnsNameAvailability(ctx context.Context, id LocationId, options CheckDnsNameAvailabilityOperationOptions) (result CheckDnsNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/checkDnsNameAvailability", id.ID()), - OptionsObject: options, - } - - 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 DnsNameAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go b/resource-manager/network/2023-06-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go deleted file mode 100644 index e12398a149f..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/model_dnsnameavailabilityresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdnsavailabilities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsNameAvailabilityResult struct { - Available *bool `json:"available,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/checkdnsavailabilities/version.go b/resource-manager/network/2023-06-01/checkdnsavailabilities/version.go deleted file mode 100644 index 82ab9bd62d1..00000000000 --- a/resource-manager/network/2023-06-01/checkdnsavailabilities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package checkdnsavailabilities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/checkdnsavailabilities/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/client.go b/resource-manager/network/2023-06-01/client.go deleted file mode 100644 index c70e2d27fae..00000000000 --- a/resource-manager/network/2023-06-01/client.go +++ /dev/null @@ -1,982 +0,0 @@ -package v2023_06_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/network/2023-06-01/adminrulecollections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/adminrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgatewayprivateendpointconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgatewayprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationgatewaywafdynamicmanifests" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/applicationsecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/availabledelegations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/availableservicealiases" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/azurefirewalls" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/bastionhosts" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/bastionshareablelink" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/bgpservicecommunities" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/checkdnsavailabilities" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/cloudservicepublicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/connectionmonitors" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/connectivityconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/customipprefixes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ddoscustompolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ddosprotectionplans" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/dscpconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/dscpconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/endpointservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitarptable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitauthorizations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitroutestable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuits" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitstats" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutegateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutelinks" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteportauthorizations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteports" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteportslocations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteproviderports" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteserviceproviders" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/firewallpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/flowlogs" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ipallocations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ipgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/loadbalancers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/localnetworkgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/natgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkgroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkinterfaces" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanageractiveconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagerconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkprofiles" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networksecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkvirtualappliances" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkwatchers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/p2svpngateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/packetcaptures" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privatednszonegroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privateendpoints" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privatelinkservice" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privatelinkservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/publicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/publicipprefixes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routefilterrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routefilters" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routes" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routetables" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/scopeconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/securityadminconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/securitypartnerproviders" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/securityrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/serviceendpointpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/servicetags" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/staticmembers" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/subnets" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/trafficanalytics" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/usages" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vipswap" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualappliancesites" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualapplianceskus" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworkgateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworkpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworks" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworktap" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworktaps" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualrouterpeerings" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualrouters" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualwans" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vmsspublicipaddresses" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpngateways" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpnlinkconnections" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpnserverconfigurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpnsites" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/webapplicationfirewallpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/webcategories" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - AdminRuleCollections *adminrulecollections.AdminRuleCollectionsClient - AdminRules *adminrules.AdminRulesClient - ApplicationGatewayPrivateEndpointConnections *applicationgatewayprivateendpointconnections.ApplicationGatewayPrivateEndpointConnectionsClient - ApplicationGatewayPrivateLinkResources *applicationgatewayprivatelinkresources.ApplicationGatewayPrivateLinkResourcesClient - ApplicationGatewayWafDynamicManifests *applicationgatewaywafdynamicmanifests.ApplicationGatewayWafDynamicManifestsClient - ApplicationGateways *applicationgateways.ApplicationGatewaysClient - ApplicationSecurityGroups *applicationsecuritygroups.ApplicationSecurityGroupsClient - AvailableDelegations *availabledelegations.AvailableDelegationsClient - AvailableServiceAliases *availableservicealiases.AvailableServiceAliasesClient - AzureFirewalls *azurefirewalls.AzureFirewallsClient - BastionHosts *bastionhosts.BastionHostsClient - BastionShareableLink *bastionshareablelink.BastionShareableLinkClient - BgpServiceCommunities *bgpservicecommunities.BgpServiceCommunitiesClient - CheckDnsAvailabilities *checkdnsavailabilities.CheckDnsAvailabilitiesClient - CloudServicePublicIPAddresses *cloudservicepublicipaddresses.CloudServicePublicIPAddressesClient - ConnectionMonitors *connectionmonitors.ConnectionMonitorsClient - ConnectivityConfigurations *connectivityconfigurations.ConnectivityConfigurationsClient - CustomIPPrefixes *customipprefixes.CustomIPPrefixesClient - DdosCustomPolicies *ddoscustompolicies.DdosCustomPoliciesClient - DdosProtectionPlans *ddosprotectionplans.DdosProtectionPlansClient - DscpConfiguration *dscpconfiguration.DscpConfigurationClient - DscpConfigurations *dscpconfigurations.DscpConfigurationsClient - EndpointServices *endpointservices.EndpointServicesClient - ExpressRouteCircuitArpTable *expressroutecircuitarptable.ExpressRouteCircuitArpTableClient - ExpressRouteCircuitAuthorizations *expressroutecircuitauthorizations.ExpressRouteCircuitAuthorizationsClient - ExpressRouteCircuitConnections *expressroutecircuitconnections.ExpressRouteCircuitConnectionsClient - ExpressRouteCircuitPeerings *expressroutecircuitpeerings.ExpressRouteCircuitPeeringsClient - ExpressRouteCircuitRoutesTable *expressroutecircuitroutestable.ExpressRouteCircuitRoutesTableClient - ExpressRouteCircuitRoutesTableSummary *expressroutecircuitroutestablesummary.ExpressRouteCircuitRoutesTableSummaryClient - ExpressRouteCircuitStats *expressroutecircuitstats.ExpressRouteCircuitStatsClient - ExpressRouteCircuits *expressroutecircuits.ExpressRouteCircuitsClient - ExpressRouteConnections *expressrouteconnections.ExpressRouteConnectionsClient - ExpressRouteCrossConnectionArpTable *expressroutecrossconnectionarptable.ExpressRouteCrossConnectionArpTableClient - ExpressRouteCrossConnectionPeerings *expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeeringsClient - ExpressRouteCrossConnectionRouteTable *expressroutecrossconnectionroutetable.ExpressRouteCrossConnectionRouteTableClient - ExpressRouteCrossConnectionRouteTableSummary *expressroutecrossconnectionroutetablesummary.ExpressRouteCrossConnectionRouteTableSummaryClient - ExpressRouteCrossConnections *expressroutecrossconnections.ExpressRouteCrossConnectionsClient - ExpressRouteGateways *expressroutegateways.ExpressRouteGatewaysClient - ExpressRouteLinks *expressroutelinks.ExpressRouteLinksClient - ExpressRoutePortAuthorizations *expressrouteportauthorizations.ExpressRoutePortAuthorizationsClient - ExpressRoutePorts *expressrouteports.ExpressRoutePortsClient - ExpressRoutePortsLocations *expressrouteportslocations.ExpressRoutePortsLocationsClient - ExpressRouteProviderPorts *expressrouteproviderports.ExpressRouteProviderPortsClient - ExpressRouteServiceProviders *expressrouteserviceproviders.ExpressRouteServiceProvidersClient - FirewallPolicies *firewallpolicies.FirewallPoliciesClient - FirewallPolicyRuleCollectionGroups *firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroupsClient - FlowLogs *flowlogs.FlowLogsClient - IPAllocations *ipallocations.IPAllocationsClient - IPGroups *ipgroups.IPGroupsClient - LoadBalancers *loadbalancers.LoadBalancersClient - LocalNetworkGateways *localnetworkgateways.LocalNetworkGatewaysClient - NatGateways *natgateways.NatGatewaysClient - NetworkGroups *networkgroups.NetworkGroupsClient - NetworkInterfaces *networkinterfaces.NetworkInterfacesClient - NetworkManagerActiveConfigurations *networkmanageractiveconfigurations.NetworkManagerActiveConfigurationsClient - NetworkManagerActiveConnectivityConfigurations *networkmanageractiveconnectivityconfigurations.NetworkManagerActiveConnectivityConfigurationsClient - NetworkManagerConnections *networkmanagerconnections.NetworkManagerConnectionsClient - NetworkManagerEffectiveConnectivityConfiguration *networkmanagereffectiveconnectivityconfiguration.NetworkManagerEffectiveConnectivityConfigurationClient - NetworkManagerEffectiveSecurityAdminRules *networkmanagereffectivesecurityadminrules.NetworkManagerEffectiveSecurityAdminRulesClient - NetworkManagers *networkmanagers.NetworkManagersClient - NetworkProfiles *networkprofiles.NetworkProfilesClient - NetworkSecurityGroups *networksecuritygroups.NetworkSecurityGroupsClient - NetworkVirtualAppliances *networkvirtualappliances.NetworkVirtualAppliancesClient - NetworkWatchers *networkwatchers.NetworkWatchersClient - P2sVpnGateways *p2svpngateways.P2sVpnGatewaysClient - PacketCaptures *packetcaptures.PacketCapturesClient - PeerExpressRouteCircuitConnections *peerexpressroutecircuitconnections.PeerExpressRouteCircuitConnectionsClient - PrivateDnsZoneGroups *privatednszonegroups.PrivateDnsZoneGroupsClient - PrivateEndpoints *privateendpoints.PrivateEndpointsClient - PrivateLinkService *privatelinkservice.PrivateLinkServiceClient - PrivateLinkServices *privatelinkservices.PrivateLinkServicesClient - PublicIPAddresses *publicipaddresses.PublicIPAddressesClient - PublicIPPrefixes *publicipprefixes.PublicIPPrefixesClient - RouteFilterRules *routefilterrules.RouteFilterRulesClient - RouteFilters *routefilters.RouteFiltersClient - RouteTables *routetables.RouteTablesClient - Routes *routes.RoutesClient - ScopeConnections *scopeconnections.ScopeConnectionsClient - SecurityAdminConfigurations *securityadminconfigurations.SecurityAdminConfigurationsClient - SecurityPartnerProviders *securitypartnerproviders.SecurityPartnerProvidersClient - SecurityRules *securityrules.SecurityRulesClient - ServiceEndpointPolicies *serviceendpointpolicies.ServiceEndpointPoliciesClient - ServiceEndpointPolicyDefinitions *serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinitionsClient - ServiceTags *servicetags.ServiceTagsClient - StaticMembers *staticmembers.StaticMembersClient - Subnets *subnets.SubnetsClient - TrafficAnalytics *trafficanalytics.TrafficAnalyticsClient - Usages *usages.UsagesClient - VMSSPublicIPAddresses *vmsspublicipaddresses.VMSSPublicIPAddressesClient - VipSwap *vipswap.VipSwapClient - VirtualApplianceSites *virtualappliancesites.VirtualApplianceSitesClient - VirtualApplianceSkus *virtualapplianceskus.VirtualApplianceSkusClient - VirtualNetworkGatewayConnections *virtualnetworkgatewayconnections.VirtualNetworkGatewayConnectionsClient - VirtualNetworkGateways *virtualnetworkgateways.VirtualNetworkGatewaysClient - VirtualNetworkPeerings *virtualnetworkpeerings.VirtualNetworkPeeringsClient - VirtualNetworkTap *virtualnetworktap.VirtualNetworkTapClient - VirtualNetworkTaps *virtualnetworktaps.VirtualNetworkTapsClient - VirtualNetworks *virtualnetworks.VirtualNetworksClient - VirtualRouterPeerings *virtualrouterpeerings.VirtualRouterPeeringsClient - VirtualRouters *virtualrouters.VirtualRoutersClient - VirtualWANs *virtualwans.VirtualWANsClient - VpnGateways *vpngateways.VpnGatewaysClient - VpnLinkConnections *vpnlinkconnections.VpnLinkConnectionsClient - VpnServerConfigurations *vpnserverconfigurations.VpnServerConfigurationsClient - VpnSites *vpnsites.VpnSitesClient - WebApplicationFirewallPolicies *webapplicationfirewallpolicies.WebApplicationFirewallPoliciesClient - WebCategories *webcategories.WebCategoriesClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - adminRuleCollectionsClient, err := adminrulecollections.NewAdminRuleCollectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdminRuleCollections client: %+v", err) - } - configureFunc(adminRuleCollectionsClient.Client) - - adminRulesClient, err := adminrules.NewAdminRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdminRules client: %+v", err) - } - configureFunc(adminRulesClient.Client) - - applicationGatewayPrivateEndpointConnectionsClient, err := applicationgatewayprivateendpointconnections.NewApplicationGatewayPrivateEndpointConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayPrivateEndpointConnections client: %+v", err) - } - configureFunc(applicationGatewayPrivateEndpointConnectionsClient.Client) - - applicationGatewayPrivateLinkResourcesClient, err := applicationgatewayprivatelinkresources.NewApplicationGatewayPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayPrivateLinkResources client: %+v", err) - } - configureFunc(applicationGatewayPrivateLinkResourcesClient.Client) - - applicationGatewayWafDynamicManifestsClient, err := applicationgatewaywafdynamicmanifests.NewApplicationGatewayWafDynamicManifestsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGatewayWafDynamicManifests client: %+v", err) - } - configureFunc(applicationGatewayWafDynamicManifestsClient.Client) - - applicationGatewaysClient, err := applicationgateways.NewApplicationGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationGateways client: %+v", err) - } - configureFunc(applicationGatewaysClient.Client) - - applicationSecurityGroupsClient, err := applicationsecuritygroups.NewApplicationSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ApplicationSecurityGroups client: %+v", err) - } - configureFunc(applicationSecurityGroupsClient.Client) - - availableDelegationsClient, err := availabledelegations.NewAvailableDelegationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AvailableDelegations client: %+v", err) - } - configureFunc(availableDelegationsClient.Client) - - availableServiceAliasesClient, err := availableservicealiases.NewAvailableServiceAliasesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AvailableServiceAliases client: %+v", err) - } - configureFunc(availableServiceAliasesClient.Client) - - azureFirewallsClient, err := azurefirewalls.NewAzureFirewallsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AzureFirewalls client: %+v", err) - } - configureFunc(azureFirewallsClient.Client) - - bastionHostsClient, err := bastionhosts.NewBastionHostsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BastionHosts client: %+v", err) - } - configureFunc(bastionHostsClient.Client) - - bastionShareableLinkClient, err := bastionshareablelink.NewBastionShareableLinkClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BastionShareableLink client: %+v", err) - } - configureFunc(bastionShareableLinkClient.Client) - - bgpServiceCommunitiesClient, err := bgpservicecommunities.NewBgpServiceCommunitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BgpServiceCommunities client: %+v", err) - } - configureFunc(bgpServiceCommunitiesClient.Client) - - checkDnsAvailabilitiesClient, err := checkdnsavailabilities.NewCheckDnsAvailabilitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CheckDnsAvailabilities client: %+v", err) - } - configureFunc(checkDnsAvailabilitiesClient.Client) - - cloudServicePublicIPAddressesClient, err := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CloudServicePublicIPAddresses client: %+v", err) - } - configureFunc(cloudServicePublicIPAddressesClient.Client) - - connectionMonitorsClient, err := connectionmonitors.NewConnectionMonitorsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConnectionMonitors client: %+v", err) - } - configureFunc(connectionMonitorsClient.Client) - - connectivityConfigurationsClient, err := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ConnectivityConfigurations client: %+v", err) - } - configureFunc(connectivityConfigurationsClient.Client) - - customIPPrefixesClient, err := customipprefixes.NewCustomIPPrefixesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CustomIPPrefixes client: %+v", err) - } - configureFunc(customIPPrefixesClient.Client) - - ddosCustomPoliciesClient, err := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DdosCustomPolicies client: %+v", err) - } - configureFunc(ddosCustomPoliciesClient.Client) - - ddosProtectionPlansClient, err := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DdosProtectionPlans client: %+v", err) - } - configureFunc(ddosProtectionPlansClient.Client) - - dscpConfigurationClient, err := dscpconfiguration.NewDscpConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DscpConfiguration client: %+v", err) - } - configureFunc(dscpConfigurationClient.Client) - - dscpConfigurationsClient, err := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DscpConfigurations client: %+v", err) - } - configureFunc(dscpConfigurationsClient.Client) - - endpointServicesClient, err := endpointservices.NewEndpointServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EndpointServices client: %+v", err) - } - configureFunc(endpointServicesClient.Client) - - expressRouteCircuitArpTableClient, err := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitArpTable client: %+v", err) - } - configureFunc(expressRouteCircuitArpTableClient.Client) - - expressRouteCircuitAuthorizationsClient, err := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitAuthorizations client: %+v", err) - } - configureFunc(expressRouteCircuitAuthorizationsClient.Client) - - expressRouteCircuitConnectionsClient, err := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitConnections client: %+v", err) - } - configureFunc(expressRouteCircuitConnectionsClient.Client) - - expressRouteCircuitPeeringsClient, err := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitPeerings client: %+v", err) - } - configureFunc(expressRouteCircuitPeeringsClient.Client) - - expressRouteCircuitRoutesTableClient, err := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTable client: %+v", err) - } - configureFunc(expressRouteCircuitRoutesTableClient.Client) - - expressRouteCircuitRoutesTableSummaryClient, err := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitRoutesTableSummary client: %+v", err) - } - configureFunc(expressRouteCircuitRoutesTableSummaryClient.Client) - - expressRouteCircuitStatsClient, err := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuitStats client: %+v", err) - } - configureFunc(expressRouteCircuitStatsClient.Client) - - expressRouteCircuitsClient, err := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCircuits client: %+v", err) - } - configureFunc(expressRouteCircuitsClient.Client) - - expressRouteConnectionsClient, err := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteConnections client: %+v", err) - } - configureFunc(expressRouteConnectionsClient.Client) - - expressRouteCrossConnectionArpTableClient, err := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionArpTable client: %+v", err) - } - configureFunc(expressRouteCrossConnectionArpTableClient.Client) - - expressRouteCrossConnectionPeeringsClient, err := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionPeerings client: %+v", err) - } - configureFunc(expressRouteCrossConnectionPeeringsClient.Client) - - expressRouteCrossConnectionRouteTableClient, err := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTable client: %+v", err) - } - configureFunc(expressRouteCrossConnectionRouteTableClient.Client) - - expressRouteCrossConnectionRouteTableSummaryClient, err := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnectionRouteTableSummary client: %+v", err) - } - configureFunc(expressRouteCrossConnectionRouteTableSummaryClient.Client) - - expressRouteCrossConnectionsClient, err := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteCrossConnections client: %+v", err) - } - configureFunc(expressRouteCrossConnectionsClient.Client) - - expressRouteGatewaysClient, err := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteGateways client: %+v", err) - } - configureFunc(expressRouteGatewaysClient.Client) - - expressRouteLinksClient, err := expressroutelinks.NewExpressRouteLinksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteLinks client: %+v", err) - } - configureFunc(expressRouteLinksClient.Client) - - expressRoutePortAuthorizationsClient, err := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePortAuthorizations client: %+v", err) - } - configureFunc(expressRoutePortAuthorizationsClient.Client) - - expressRoutePortsClient, err := expressrouteports.NewExpressRoutePortsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePorts client: %+v", err) - } - configureFunc(expressRoutePortsClient.Client) - - expressRoutePortsLocationsClient, err := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRoutePortsLocations client: %+v", err) - } - configureFunc(expressRoutePortsLocationsClient.Client) - - expressRouteProviderPortsClient, err := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteProviderPorts client: %+v", err) - } - configureFunc(expressRouteProviderPortsClient.Client) - - expressRouteServiceProvidersClient, err := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ExpressRouteServiceProviders client: %+v", err) - } - configureFunc(expressRouteServiceProvidersClient.Client) - - firewallPoliciesClient, err := firewallpolicies.NewFirewallPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallPolicies client: %+v", err) - } - configureFunc(firewallPoliciesClient.Client) - - firewallPolicyRuleCollectionGroupsClient, err := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallPolicyRuleCollectionGroups client: %+v", err) - } - configureFunc(firewallPolicyRuleCollectionGroupsClient.Client) - - flowLogsClient, err := flowlogs.NewFlowLogsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FlowLogs client: %+v", err) - } - configureFunc(flowLogsClient.Client) - - iPAllocationsClient, err := ipallocations.NewIPAllocationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IPAllocations client: %+v", err) - } - configureFunc(iPAllocationsClient.Client) - - iPGroupsClient, err := ipgroups.NewIPGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IPGroups client: %+v", err) - } - configureFunc(iPGroupsClient.Client) - - loadBalancersClient, err := loadbalancers.NewLoadBalancersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LoadBalancers client: %+v", err) - } - configureFunc(loadBalancersClient.Client) - - localNetworkGatewaysClient, err := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building LocalNetworkGateways client: %+v", err) - } - configureFunc(localNetworkGatewaysClient.Client) - - natGatewaysClient, err := natgateways.NewNatGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NatGateways client: %+v", err) - } - configureFunc(natGatewaysClient.Client) - - networkGroupsClient, err := networkgroups.NewNetworkGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkGroups client: %+v", err) - } - configureFunc(networkGroupsClient.Client) - - networkInterfacesClient, err := networkinterfaces.NewNetworkInterfacesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkInterfaces client: %+v", err) - } - configureFunc(networkInterfacesClient.Client) - - networkManagerActiveConfigurationsClient, err := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerActiveConfigurations client: %+v", err) - } - configureFunc(networkManagerActiveConfigurationsClient.Client) - - networkManagerActiveConnectivityConfigurationsClient, err := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerActiveConnectivityConfigurations client: %+v", err) - } - configureFunc(networkManagerActiveConnectivityConfigurationsClient.Client) - - networkManagerConnectionsClient, err := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerConnections client: %+v", err) - } - configureFunc(networkManagerConnectionsClient.Client) - - networkManagerEffectiveConnectivityConfigurationClient, err := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerEffectiveConnectivityConfiguration client: %+v", err) - } - configureFunc(networkManagerEffectiveConnectivityConfigurationClient.Client) - - networkManagerEffectiveSecurityAdminRulesClient, err := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagerEffectiveSecurityAdminRules client: %+v", err) - } - configureFunc(networkManagerEffectiveSecurityAdminRulesClient.Client) - - networkManagersClient, err := networkmanagers.NewNetworkManagersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkManagers client: %+v", err) - } - configureFunc(networkManagersClient.Client) - - networkProfilesClient, err := networkprofiles.NewNetworkProfilesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkProfiles client: %+v", err) - } - configureFunc(networkProfilesClient.Client) - - networkSecurityGroupsClient, err := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkSecurityGroups client: %+v", err) - } - configureFunc(networkSecurityGroupsClient.Client) - - networkVirtualAppliancesClient, err := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkVirtualAppliances client: %+v", err) - } - configureFunc(networkVirtualAppliancesClient.Client) - - networkWatchersClient, err := networkwatchers.NewNetworkWatchersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building NetworkWatchers client: %+v", err) - } - configureFunc(networkWatchersClient.Client) - - p2sVpnGatewaysClient, err := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building P2sVpnGateways client: %+v", err) - } - configureFunc(p2sVpnGatewaysClient.Client) - - packetCapturesClient, err := packetcaptures.NewPacketCapturesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PacketCaptures client: %+v", err) - } - configureFunc(packetCapturesClient.Client) - - peerExpressRouteCircuitConnectionsClient, err := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PeerExpressRouteCircuitConnections client: %+v", err) - } - configureFunc(peerExpressRouteCircuitConnectionsClient.Client) - - privateDnsZoneGroupsClient, err := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateDnsZoneGroups client: %+v", err) - } - configureFunc(privateDnsZoneGroupsClient.Client) - - privateEndpointsClient, err := privateendpoints.NewPrivateEndpointsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateEndpoints client: %+v", err) - } - configureFunc(privateEndpointsClient.Client) - - privateLinkServiceClient, err := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkService client: %+v", err) - } - configureFunc(privateLinkServiceClient.Client) - - privateLinkServicesClient, err := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PrivateLinkServices client: %+v", err) - } - configureFunc(privateLinkServicesClient.Client) - - publicIPAddressesClient, err := publicipaddresses.NewPublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicIPAddresses client: %+v", err) - } - configureFunc(publicIPAddressesClient.Client) - - publicIPPrefixesClient, err := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building PublicIPPrefixes client: %+v", err) - } - configureFunc(publicIPPrefixesClient.Client) - - routeFilterRulesClient, err := routefilterrules.NewRouteFilterRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteFilterRules client: %+v", err) - } - configureFunc(routeFilterRulesClient.Client) - - routeFiltersClient, err := routefilters.NewRouteFiltersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteFilters client: %+v", err) - } - configureFunc(routeFiltersClient.Client) - - routeTablesClient, err := routetables.NewRouteTablesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RouteTables client: %+v", err) - } - configureFunc(routeTablesClient.Client) - - routesClient, err := routes.NewRoutesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Routes client: %+v", err) - } - configureFunc(routesClient.Client) - - scopeConnectionsClient, err := scopeconnections.NewScopeConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ScopeConnections client: %+v", err) - } - configureFunc(scopeConnectionsClient.Client) - - securityAdminConfigurationsClient, err := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityAdminConfigurations client: %+v", err) - } - configureFunc(securityAdminConfigurationsClient.Client) - - securityPartnerProvidersClient, err := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityPartnerProviders client: %+v", err) - } - configureFunc(securityPartnerProvidersClient.Client) - - securityRulesClient, err := securityrules.NewSecurityRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityRules client: %+v", err) - } - configureFunc(securityRulesClient.Client) - - serviceEndpointPoliciesClient, err := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceEndpointPolicies client: %+v", err) - } - configureFunc(serviceEndpointPoliciesClient.Client) - - serviceEndpointPolicyDefinitionsClient, err := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceEndpointPolicyDefinitions client: %+v", err) - } - configureFunc(serviceEndpointPolicyDefinitionsClient.Client) - - serviceTagsClient, err := servicetags.NewServiceTagsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServiceTags client: %+v", err) - } - configureFunc(serviceTagsClient.Client) - - staticMembersClient, err := staticmembers.NewStaticMembersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building StaticMembers client: %+v", err) - } - configureFunc(staticMembersClient.Client) - - subnetsClient, err := subnets.NewSubnetsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Subnets client: %+v", err) - } - configureFunc(subnetsClient.Client) - - trafficAnalyticsClient, err := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building TrafficAnalytics client: %+v", err) - } - configureFunc(trafficAnalyticsClient.Client) - - usagesClient, err := usages.NewUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Usages client: %+v", err) - } - configureFunc(usagesClient.Client) - - vMSSPublicIPAddressesClient, err := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VMSSPublicIPAddresses client: %+v", err) - } - configureFunc(vMSSPublicIPAddressesClient.Client) - - vipSwapClient, err := vipswap.NewVipSwapClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VipSwap client: %+v", err) - } - configureFunc(vipSwapClient.Client) - - virtualApplianceSitesClient, err := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualApplianceSites client: %+v", err) - } - configureFunc(virtualApplianceSitesClient.Client) - - virtualApplianceSkusClient, err := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualApplianceSkus client: %+v", err) - } - configureFunc(virtualApplianceSkusClient.Client) - - virtualNetworkGatewayConnectionsClient, err := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkGatewayConnections client: %+v", err) - } - configureFunc(virtualNetworkGatewayConnectionsClient.Client) - - virtualNetworkGatewaysClient, err := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkGateways client: %+v", err) - } - configureFunc(virtualNetworkGatewaysClient.Client) - - virtualNetworkPeeringsClient, err := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkPeerings client: %+v", err) - } - configureFunc(virtualNetworkPeeringsClient.Client) - - virtualNetworkTapClient, err := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkTap client: %+v", err) - } - configureFunc(virtualNetworkTapClient.Client) - - virtualNetworkTapsClient, err := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworkTaps client: %+v", err) - } - configureFunc(virtualNetworkTapsClient.Client) - - virtualNetworksClient, err := virtualnetworks.NewVirtualNetworksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualNetworks client: %+v", err) - } - configureFunc(virtualNetworksClient.Client) - - virtualRouterPeeringsClient, err := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualRouterPeerings client: %+v", err) - } - configureFunc(virtualRouterPeeringsClient.Client) - - virtualRoutersClient, err := virtualrouters.NewVirtualRoutersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualRouters client: %+v", err) - } - configureFunc(virtualRoutersClient.Client) - - virtualWANsClient, err := virtualwans.NewVirtualWANsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VirtualWANs client: %+v", err) - } - configureFunc(virtualWANsClient.Client) - - vpnGatewaysClient, err := vpngateways.NewVpnGatewaysClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnGateways client: %+v", err) - } - configureFunc(vpnGatewaysClient.Client) - - vpnLinkConnectionsClient, err := vpnlinkconnections.NewVpnLinkConnectionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnLinkConnections client: %+v", err) - } - configureFunc(vpnLinkConnectionsClient.Client) - - vpnServerConfigurationsClient, err := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnServerConfigurations client: %+v", err) - } - configureFunc(vpnServerConfigurationsClient.Client) - - vpnSitesClient, err := vpnsites.NewVpnSitesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VpnSites client: %+v", err) - } - configureFunc(vpnSitesClient.Client) - - webApplicationFirewallPoliciesClient, err := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebApplicationFirewallPolicies client: %+v", err) - } - configureFunc(webApplicationFirewallPoliciesClient.Client) - - webCategoriesClient, err := webcategories.NewWebCategoriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WebCategories client: %+v", err) - } - configureFunc(webCategoriesClient.Client) - - return &Client{ - AdminRuleCollections: adminRuleCollectionsClient, - AdminRules: adminRulesClient, - ApplicationGatewayPrivateEndpointConnections: applicationGatewayPrivateEndpointConnectionsClient, - ApplicationGatewayPrivateLinkResources: applicationGatewayPrivateLinkResourcesClient, - ApplicationGatewayWafDynamicManifests: applicationGatewayWafDynamicManifestsClient, - ApplicationGateways: applicationGatewaysClient, - ApplicationSecurityGroups: applicationSecurityGroupsClient, - AvailableDelegations: availableDelegationsClient, - AvailableServiceAliases: availableServiceAliasesClient, - AzureFirewalls: azureFirewallsClient, - BastionHosts: bastionHostsClient, - BastionShareableLink: bastionShareableLinkClient, - BgpServiceCommunities: bgpServiceCommunitiesClient, - CheckDnsAvailabilities: checkDnsAvailabilitiesClient, - CloudServicePublicIPAddresses: cloudServicePublicIPAddressesClient, - ConnectionMonitors: connectionMonitorsClient, - ConnectivityConfigurations: connectivityConfigurationsClient, - CustomIPPrefixes: customIPPrefixesClient, - DdosCustomPolicies: ddosCustomPoliciesClient, - DdosProtectionPlans: ddosProtectionPlansClient, - DscpConfiguration: dscpConfigurationClient, - DscpConfigurations: dscpConfigurationsClient, - EndpointServices: endpointServicesClient, - ExpressRouteCircuitArpTable: expressRouteCircuitArpTableClient, - ExpressRouteCircuitAuthorizations: expressRouteCircuitAuthorizationsClient, - ExpressRouteCircuitConnections: expressRouteCircuitConnectionsClient, - ExpressRouteCircuitPeerings: expressRouteCircuitPeeringsClient, - ExpressRouteCircuitRoutesTable: expressRouteCircuitRoutesTableClient, - ExpressRouteCircuitRoutesTableSummary: expressRouteCircuitRoutesTableSummaryClient, - ExpressRouteCircuitStats: expressRouteCircuitStatsClient, - ExpressRouteCircuits: expressRouteCircuitsClient, - ExpressRouteConnections: expressRouteConnectionsClient, - ExpressRouteCrossConnectionArpTable: expressRouteCrossConnectionArpTableClient, - ExpressRouteCrossConnectionPeerings: expressRouteCrossConnectionPeeringsClient, - ExpressRouteCrossConnectionRouteTable: expressRouteCrossConnectionRouteTableClient, - ExpressRouteCrossConnectionRouteTableSummary: expressRouteCrossConnectionRouteTableSummaryClient, - ExpressRouteCrossConnections: expressRouteCrossConnectionsClient, - ExpressRouteGateways: expressRouteGatewaysClient, - ExpressRouteLinks: expressRouteLinksClient, - ExpressRoutePortAuthorizations: expressRoutePortAuthorizationsClient, - ExpressRoutePorts: expressRoutePortsClient, - ExpressRoutePortsLocations: expressRoutePortsLocationsClient, - ExpressRouteProviderPorts: expressRouteProviderPortsClient, - ExpressRouteServiceProviders: expressRouteServiceProvidersClient, - FirewallPolicies: firewallPoliciesClient, - FirewallPolicyRuleCollectionGroups: firewallPolicyRuleCollectionGroupsClient, - FlowLogs: flowLogsClient, - IPAllocations: iPAllocationsClient, - IPGroups: iPGroupsClient, - LoadBalancers: loadBalancersClient, - LocalNetworkGateways: localNetworkGatewaysClient, - NatGateways: natGatewaysClient, - NetworkGroups: networkGroupsClient, - NetworkInterfaces: networkInterfacesClient, - NetworkManagerActiveConfigurations: networkManagerActiveConfigurationsClient, - NetworkManagerActiveConnectivityConfigurations: networkManagerActiveConnectivityConfigurationsClient, - NetworkManagerConnections: networkManagerConnectionsClient, - NetworkManagerEffectiveConnectivityConfiguration: networkManagerEffectiveConnectivityConfigurationClient, - NetworkManagerEffectiveSecurityAdminRules: networkManagerEffectiveSecurityAdminRulesClient, - NetworkManagers: networkManagersClient, - NetworkProfiles: networkProfilesClient, - NetworkSecurityGroups: networkSecurityGroupsClient, - NetworkVirtualAppliances: networkVirtualAppliancesClient, - NetworkWatchers: networkWatchersClient, - P2sVpnGateways: p2sVpnGatewaysClient, - PacketCaptures: packetCapturesClient, - PeerExpressRouteCircuitConnections: peerExpressRouteCircuitConnectionsClient, - PrivateDnsZoneGroups: privateDnsZoneGroupsClient, - PrivateEndpoints: privateEndpointsClient, - PrivateLinkService: privateLinkServiceClient, - PrivateLinkServices: privateLinkServicesClient, - PublicIPAddresses: publicIPAddressesClient, - PublicIPPrefixes: publicIPPrefixesClient, - RouteFilterRules: routeFilterRulesClient, - RouteFilters: routeFiltersClient, - RouteTables: routeTablesClient, - Routes: routesClient, - ScopeConnections: scopeConnectionsClient, - SecurityAdminConfigurations: securityAdminConfigurationsClient, - SecurityPartnerProviders: securityPartnerProvidersClient, - SecurityRules: securityRulesClient, - ServiceEndpointPolicies: serviceEndpointPoliciesClient, - ServiceEndpointPolicyDefinitions: serviceEndpointPolicyDefinitionsClient, - ServiceTags: serviceTagsClient, - StaticMembers: staticMembersClient, - Subnets: subnetsClient, - TrafficAnalytics: trafficAnalyticsClient, - Usages: usagesClient, - VMSSPublicIPAddresses: vMSSPublicIPAddressesClient, - VipSwap: vipSwapClient, - VirtualApplianceSites: virtualApplianceSitesClient, - VirtualApplianceSkus: virtualApplianceSkusClient, - VirtualNetworkGatewayConnections: virtualNetworkGatewayConnectionsClient, - VirtualNetworkGateways: virtualNetworkGatewaysClient, - VirtualNetworkPeerings: virtualNetworkPeeringsClient, - VirtualNetworkTap: virtualNetworkTapClient, - VirtualNetworkTaps: virtualNetworkTapsClient, - VirtualNetworks: virtualNetworksClient, - VirtualRouterPeerings: virtualRouterPeeringsClient, - VirtualRouters: virtualRoutersClient, - VirtualWANs: virtualWANsClient, - VpnGateways: vpnGatewaysClient, - VpnLinkConnections: vpnLinkConnectionsClient, - VpnServerConfigurations: vpnServerConfigurationsClient, - VpnSites: vpnSitesClient, - WebApplicationFirewallPolicies: webApplicationFirewallPoliciesClient, - WebCategories: webCategoriesClient, - }, nil -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/README.md b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/README.md deleted file mode 100644 index 5e8cc3ef1c9..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/README.md +++ /dev/null @@ -1,71 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/cloudservicepublicipaddresses` Documentation - -The `cloudservicepublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/cloudservicepublicipaddresses" -``` - - -### Client Initialization - -```go -client := cloudservicepublicipaddresses.NewCloudServicePublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesGetCloudServicePublicIPAddress` - -```go -ctx := context.TODO() -id := commonids.NewCloudServicesPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") - -read, err := client.PublicIPAddressesGetCloudServicePublicIPAddress(ctx, id, cloudservicepublicipaddresses.DefaultPublicIPAddressesGetCloudServicePublicIPAddressOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServicePublicIPAddresses` - -```go -ctx := context.TODO() -id := cloudservicepublicipaddresses.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - -// alternatively `client.PublicIPAddressesListCloudServicePublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListCloudServicePublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CloudServicePublicIPAddressesClient.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses` - -```go -ctx := context.TODO() -id := commonids.NewCloudServicesIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue", "ipConfigurationValue") - -// alternatively `client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/client.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/client.go deleted file mode 100644 index 4eebc5f720f..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package cloudservicepublicipaddresses - -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 CloudServicePublicIPAddressesClient struct { - Client *resourcemanager.Client -} - -func NewCloudServicePublicIPAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*CloudServicePublicIPAddressesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "cloudservicepublicipaddresses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CloudServicePublicIPAddressesClient: %+v", err) - } - - return &CloudServicePublicIPAddressesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/constants.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/constants.go deleted file mode 100644 index 775730aae62..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package cloudservicepublicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice.go deleted file mode 100644 index 2750d8acfa0..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package cloudservicepublicipaddresses - -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(&ProviderCloudServiceId{}) -} - -var _ resourceids.ResourceId = &ProviderCloudServiceId{} - -// ProviderCloudServiceId is a struct representing the Resource ID for a Provider Cloud Service -type ProviderCloudServiceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string -} - -// NewProviderCloudServiceID returns a new ProviderCloudServiceId struct -func NewProviderCloudServiceID(subscriptionId string, resourceGroupName string, cloudServiceName string) ProviderCloudServiceId { - return ProviderCloudServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - } -} - -// ParseProviderCloudServiceID parses 'input' into a ProviderCloudServiceId -func ParseProviderCloudServiceID(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderCloudServiceIDInsensitively parses 'input' case-insensitively into a ProviderCloudServiceId -// note: this method should only be used for API response data and not user input -func ParseProviderCloudServiceIDInsensitively(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderCloudServiceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - return nil -} - -// ValidateProviderCloudServiceID checks that 'input' can be parsed as a Provider Cloud Service ID -func ValidateProviderCloudServiceID(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 := ParseProviderCloudServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Cloud Service ID -func (id ProviderCloudServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Cloud Service ID -func (id ProviderCloudServiceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - } -} - -// String returns a human-readable description of this Provider Cloud Service ID -func (id ProviderCloudServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - } - return fmt.Sprintf("Provider Cloud Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice_test.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice_test.go deleted file mode 100644 index 8e5ffd9994a..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/id_providercloudservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package cloudservicepublicipaddresses - -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 = &ProviderCloudServiceId{} - -func TestNewProviderCloudServiceID(t *testing.T) { - id := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } -} - -func TestFormatProviderCloudServiceID(t *testing.T) { - actual := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderCloudServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestParseProviderCloudServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestSegmentsForProviderCloudServiceId(t *testing.T) { - segments := ProviderCloudServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderCloudServiceId 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/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go deleted file mode 100644 index b9661797464..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddressesgetcloudservicepublicipaddress.go +++ /dev/null @@ -1,84 +0,0 @@ -package cloudservicepublicipaddresses - -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 PublicIPAddressesGetCloudServicePublicIPAddressOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -type PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions struct { - Expand *string -} - -func DefaultPublicIPAddressesGetCloudServicePublicIPAddressOperationOptions() PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions { - return PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions{} -} - -func (o PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// PublicIPAddressesGetCloudServicePublicIPAddress ... -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesGetCloudServicePublicIPAddress(ctx context.Context, id commonids.CloudServicesPublicIPAddressId, options PublicIPAddressesGetCloudServicePublicIPAddressOperationOptions) (result PublicIPAddressesGetCloudServicePublicIPAddressOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go deleted file mode 100644 index 4fb77eb453b..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudservicepublicipaddresses.go +++ /dev/null @@ -1,91 +0,0 @@ -package cloudservicepublicipaddresses - -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 PublicIPAddressesListCloudServicePublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListCloudServicePublicIPAddresses ... -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServicePublicIPAddresses(ctx context.Context, id ProviderCloudServiceId) (result PublicIPAddressesListCloudServicePublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListCloudServicePublicIPAddressesComplete retrieves all the results into a single object -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServicePublicIPAddressesComplete(ctx context.Context, id ProviderCloudServiceId) (PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListCloudServicePublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListCloudServicePublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServicePublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id ProviderCloudServiceId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListCloudServicePublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListCloudServicePublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go deleted file mode 100644 index 5482119cfa2..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/method_publicipaddresseslistcloudserviceroleinstancepublicipaddresses.go +++ /dev/null @@ -1,92 +0,0 @@ -package cloudservicepublicipaddresses - -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 PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses ... -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx context.Context, id commonids.CloudServicesIPConfigurationId) (result PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete retrieves all the results into a single object -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesComplete(ctx context.Context, id commonids.CloudServicesIPConfigurationId) (PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CloudServicePublicIPAddressesClient) PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id commonids.CloudServicesIPConfigurationId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListCloudServiceRoleInstancePublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListCloudServiceRoleInstancePublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go deleted file mode 100644 index da0843dfe84..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 0752ac86606..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index c5e25b3ac40..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 3301a914b9a..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index d142ad28f06..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go deleted file mode 100644 index db43b3a90d7..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 26c6e3c6d63..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspool.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspool.go deleted file mode 100644 index 11a0db48c3e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 8b7c7a5e9a7..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 852fda62a32..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ddossettings.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ddossettings.go deleted file mode 100644 index e76df1830ad..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_delegation.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_delegation.go deleted file mode 100644 index 37ba2738f03..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlog.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlog.go deleted file mode 100644 index b5951b65269..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go deleted file mode 100644 index 22cce73755f..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go deleted file mode 100644 index 81d0d4ee738..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go deleted file mode 100644 index 6ef8b18a318..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package cloudservicepublicipaddresses - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index d76b004d004..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 623add5b390..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrule.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrule.go deleted file mode 100644 index 2bf55038c2e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 9e9fd000882..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfiguration.go deleted file mode 100644 index 7aa8cbae351..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go deleted file mode 100644 index cae99b1bc9d..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index d32ff6abc99..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index f1c212d87d9..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_iptag.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_iptag.go deleted file mode 100644 index 9cd0c420107..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// 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/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go deleted file mode 100644 index e95c784d170..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index f2cc5fa6b36..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgateway.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgateway.go deleted file mode 100644 index d2e737891d0..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package cloudservicepublicipaddresses - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go deleted file mode 100644 index 6e1be1ad8f0..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaysku.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaysku.go deleted file mode 100644 index 0e1a31e6f56..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natruleportmapping.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natruleportmapping.go deleted file mode 100644 index 9f648ba378f..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterface.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterface.go deleted file mode 100644 index 8fa35f5b27b..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go deleted file mode 100644 index 7841bbdaa74..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 2060396975d..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 331b8b4a8b7..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index e933a3bcc7e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 32854c40bbf..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 417528f526c..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 800ba33402b..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygroup.go deleted file mode 100644 index 4a17b77a5f7..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 75b57179c0e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpoint.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpoint.go deleted file mode 100644 index 092678d20e9..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnection.go deleted file mode 100644 index 390ed6a1a9e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index a4a672bb9ea..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go deleted file mode 100644 index f4475d0d46b..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index cd3b594722d..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointproperties.go deleted file mode 100644 index b6fab9bddb7..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkservice.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkservice.go deleted file mode 100644 index 47d7bc6cfba..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go deleted file mode 100644 index c2e1ed2f2bb..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 12d313e2c8e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 9c295f72e4e..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 2293fa06105..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index f0b249690b3..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go deleted file mode 100644 index fea2fefdf6d..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddress.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddress.go deleted file mode 100644 index 0d91d1ce77a..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package cloudservicepublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 59fc873f762..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 5a1a9082ad9..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresssku.go deleted file mode 100644 index 0d24d3ce3e2..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go deleted file mode 100644 index a374b51e3ce..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go deleted file mode 100644 index bb8074b7c24..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourceset.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourceset.go deleted file mode 100644 index ea408a54b5a..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go deleted file mode 100644 index a92e570a340..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_route.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_route.go deleted file mode 100644 index ca309e6a8db..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routepropertiesformat.go deleted file mode 100644 index e981b239ff0..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetable.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetable.go deleted file mode 100644 index cfe4b1aaec3..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go deleted file mode 100644 index 14537e9f6ea..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrule.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrule.go deleted file mode 100644 index 68880b23db6..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index 3918c59b2ce..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlink.go deleted file mode 100644 index 18402efabea..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 283dae7d051..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go deleted file mode 100644 index cb30d331149..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go deleted file mode 100644 index 51af3fd8470..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 84bd144ecd4..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 723f9f28975..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index de8c74ebf8a..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 63759ece07d..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnet.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnet.go deleted file mode 100644 index 4ae7149a7a9..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index 19810c29c1f..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subresource.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subresource.go deleted file mode 100644 index ee542355418..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 6e884100df3..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go deleted file mode 100644 index e38b924bdf6..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktap.go deleted file mode 100644 index 9dc686dd12f..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index c0dae0b7388..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/predicates.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/predicates.go deleted file mode 100644 index f27f03144ee..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package cloudservicepublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPAddressOperationPredicate) Matches(input PublicIPAddress) 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 && (input.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/network/2023-06-01/cloudservicepublicipaddresses/version.go b/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/version.go deleted file mode 100644 index 04abd15bf95..00000000000 --- a/resource-manager/network/2023-06-01/cloudservicepublicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package cloudservicepublicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/cloudservicepublicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/README.md b/resource-manager/network/2023-06-01/connectionmonitors/README.md deleted file mode 100644 index b008fc5394b..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/connectionmonitors` Documentation - -The `connectionmonitors` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/connectionmonitors" -``` - - -### Client Initialization - -```go -client := connectionmonitors.NewConnectionMonitorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConnectionMonitorsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -payload := connectionmonitors.ConnectionMonitor{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, connectionmonitors.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Delete` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Get` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -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: `ConnectionMonitorsClient.List` - -```go -ctx := context.TODO() -id := connectionmonitors.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `ConnectionMonitorsClient.Query` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.QueryThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Start` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.StartThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.Stop` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectionMonitorsClient.UpdateTags` - -```go -ctx := context.TODO() -id := connectionmonitors.NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - -payload := connectionmonitors.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/network/2023-06-01/connectionmonitors/client.go b/resource-manager/network/2023-06-01/connectionmonitors/client.go deleted file mode 100644 index a8ff516ce50..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorsClient struct { - Client *resourcemanager.Client -} - -func NewConnectionMonitorsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConnectionMonitorsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "connectionmonitors", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConnectionMonitorsClient: %+v", err) - } - - return &ConnectionMonitorsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/constants.go b/resource-manager/network/2023-06-01/connectionmonitors/constants.go deleted file mode 100644 index 7747a3a8316..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/constants.go +++ /dev/null @@ -1,770 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorEndpointFilterItemType string - -const ( - ConnectionMonitorEndpointFilterItemTypeAgentAddress ConnectionMonitorEndpointFilterItemType = "AgentAddress" -) - -func PossibleValuesForConnectionMonitorEndpointFilterItemType() []string { - return []string{ - string(ConnectionMonitorEndpointFilterItemTypeAgentAddress), - } -} - -func (s *ConnectionMonitorEndpointFilterItemType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorEndpointFilterItemType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorEndpointFilterItemType(input string) (*ConnectionMonitorEndpointFilterItemType, error) { - vals := map[string]ConnectionMonitorEndpointFilterItemType{ - "agentaddress": ConnectionMonitorEndpointFilterItemTypeAgentAddress, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorEndpointFilterItemType(input) - return &out, nil -} - -type ConnectionMonitorEndpointFilterType string - -const ( - ConnectionMonitorEndpointFilterTypeInclude ConnectionMonitorEndpointFilterType = "Include" -) - -func PossibleValuesForConnectionMonitorEndpointFilterType() []string { - return []string{ - string(ConnectionMonitorEndpointFilterTypeInclude), - } -} - -func (s *ConnectionMonitorEndpointFilterType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorEndpointFilterType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorEndpointFilterType(input string) (*ConnectionMonitorEndpointFilterType, error) { - vals := map[string]ConnectionMonitorEndpointFilterType{ - "include": ConnectionMonitorEndpointFilterTypeInclude, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorEndpointFilterType(input) - return &out, nil -} - -type ConnectionMonitorSourceStatus string - -const ( - ConnectionMonitorSourceStatusActive ConnectionMonitorSourceStatus = "Active" - ConnectionMonitorSourceStatusInactive ConnectionMonitorSourceStatus = "Inactive" - ConnectionMonitorSourceStatusUnknown ConnectionMonitorSourceStatus = "Unknown" -) - -func PossibleValuesForConnectionMonitorSourceStatus() []string { - return []string{ - string(ConnectionMonitorSourceStatusActive), - string(ConnectionMonitorSourceStatusInactive), - string(ConnectionMonitorSourceStatusUnknown), - } -} - -func (s *ConnectionMonitorSourceStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorSourceStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorSourceStatus(input string) (*ConnectionMonitorSourceStatus, error) { - vals := map[string]ConnectionMonitorSourceStatus{ - "active": ConnectionMonitorSourceStatusActive, - "inactive": ConnectionMonitorSourceStatusInactive, - "unknown": ConnectionMonitorSourceStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorSourceStatus(input) - return &out, nil -} - -type ConnectionMonitorTestConfigurationProtocol string - -const ( - ConnectionMonitorTestConfigurationProtocolHTTP ConnectionMonitorTestConfigurationProtocol = "Http" - ConnectionMonitorTestConfigurationProtocolIcmp ConnectionMonitorTestConfigurationProtocol = "Icmp" - ConnectionMonitorTestConfigurationProtocolTcp ConnectionMonitorTestConfigurationProtocol = "Tcp" -) - -func PossibleValuesForConnectionMonitorTestConfigurationProtocol() []string { - return []string{ - string(ConnectionMonitorTestConfigurationProtocolHTTP), - string(ConnectionMonitorTestConfigurationProtocolIcmp), - string(ConnectionMonitorTestConfigurationProtocolTcp), - } -} - -func (s *ConnectionMonitorTestConfigurationProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorTestConfigurationProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorTestConfigurationProtocol(input string) (*ConnectionMonitorTestConfigurationProtocol, error) { - vals := map[string]ConnectionMonitorTestConfigurationProtocol{ - "http": ConnectionMonitorTestConfigurationProtocolHTTP, - "icmp": ConnectionMonitorTestConfigurationProtocolIcmp, - "tcp": ConnectionMonitorTestConfigurationProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorTestConfigurationProtocol(input) - return &out, nil -} - -type ConnectionMonitorType string - -const ( - ConnectionMonitorTypeMultiEndpoint ConnectionMonitorType = "MultiEndpoint" - ConnectionMonitorTypeSingleSourceDestination ConnectionMonitorType = "SingleSourceDestination" -) - -func PossibleValuesForConnectionMonitorType() []string { - return []string{ - string(ConnectionMonitorTypeMultiEndpoint), - string(ConnectionMonitorTypeSingleSourceDestination), - } -} - -func (s *ConnectionMonitorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionMonitorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionMonitorType(input string) (*ConnectionMonitorType, error) { - vals := map[string]ConnectionMonitorType{ - "multiendpoint": ConnectionMonitorTypeMultiEndpoint, - "singlesourcedestination": ConnectionMonitorTypeSingleSourceDestination, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionMonitorType(input) - return &out, nil -} - -type ConnectionState string - -const ( - ConnectionStateReachable ConnectionState = "Reachable" - ConnectionStateUnknown ConnectionState = "Unknown" - ConnectionStateUnreachable ConnectionState = "Unreachable" -) - -func PossibleValuesForConnectionState() []string { - return []string{ - string(ConnectionStateReachable), - string(ConnectionStateUnknown), - string(ConnectionStateUnreachable), - } -} - -func (s *ConnectionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectionState(input string) (*ConnectionState, error) { - vals := map[string]ConnectionState{ - "reachable": ConnectionStateReachable, - "unknown": ConnectionStateUnknown, - "unreachable": ConnectionStateUnreachable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectionState(input) - return &out, nil -} - -type CoverageLevel string - -const ( - CoverageLevelAboveAverage CoverageLevel = "AboveAverage" - CoverageLevelAverage CoverageLevel = "Average" - CoverageLevelBelowAverage CoverageLevel = "BelowAverage" - CoverageLevelDefault CoverageLevel = "Default" - CoverageLevelFull CoverageLevel = "Full" - CoverageLevelLow CoverageLevel = "Low" -) - -func PossibleValuesForCoverageLevel() []string { - return []string{ - string(CoverageLevelAboveAverage), - string(CoverageLevelAverage), - string(CoverageLevelBelowAverage), - string(CoverageLevelDefault), - string(CoverageLevelFull), - string(CoverageLevelLow), - } -} - -func (s *CoverageLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCoverageLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCoverageLevel(input string) (*CoverageLevel, error) { - vals := map[string]CoverageLevel{ - "aboveaverage": CoverageLevelAboveAverage, - "average": CoverageLevelAverage, - "belowaverage": CoverageLevelBelowAverage, - "default": CoverageLevelDefault, - "full": CoverageLevelFull, - "low": CoverageLevelLow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CoverageLevel(input) - return &out, nil -} - -type DestinationPortBehavior string - -const ( - DestinationPortBehaviorListenIfAvailable DestinationPortBehavior = "ListenIfAvailable" - DestinationPortBehaviorNone DestinationPortBehavior = "None" -) - -func PossibleValuesForDestinationPortBehavior() []string { - return []string{ - string(DestinationPortBehaviorListenIfAvailable), - string(DestinationPortBehaviorNone), - } -} - -func (s *DestinationPortBehavior) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDestinationPortBehavior(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDestinationPortBehavior(input string) (*DestinationPortBehavior, error) { - vals := map[string]DestinationPortBehavior{ - "listenifavailable": DestinationPortBehaviorListenIfAvailable, - "none": DestinationPortBehaviorNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DestinationPortBehavior(input) - return &out, nil -} - -type EndpointType string - -const ( - EndpointTypeAzureArcVM EndpointType = "AzureArcVM" - EndpointTypeAzureSubnet EndpointType = "AzureSubnet" - EndpointTypeAzureVM EndpointType = "AzureVM" - EndpointTypeAzureVMSS EndpointType = "AzureVMSS" - EndpointTypeAzureVNet EndpointType = "AzureVNet" - EndpointTypeExternalAddress EndpointType = "ExternalAddress" - EndpointTypeMMAWorkspaceMachine EndpointType = "MMAWorkspaceMachine" - EndpointTypeMMAWorkspaceNetwork EndpointType = "MMAWorkspaceNetwork" -) - -func PossibleValuesForEndpointType() []string { - return []string{ - string(EndpointTypeAzureArcVM), - string(EndpointTypeAzureSubnet), - string(EndpointTypeAzureVM), - string(EndpointTypeAzureVMSS), - string(EndpointTypeAzureVNet), - string(EndpointTypeExternalAddress), - string(EndpointTypeMMAWorkspaceMachine), - string(EndpointTypeMMAWorkspaceNetwork), - } -} - -func (s *EndpointType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEndpointType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEndpointType(input string) (*EndpointType, error) { - vals := map[string]EndpointType{ - "azurearcvm": EndpointTypeAzureArcVM, - "azuresubnet": EndpointTypeAzureSubnet, - "azurevm": EndpointTypeAzureVM, - "azurevmss": EndpointTypeAzureVMSS, - "azurevnet": EndpointTypeAzureVNet, - "externaladdress": EndpointTypeExternalAddress, - "mmaworkspacemachine": EndpointTypeMMAWorkspaceMachine, - "mmaworkspacenetwork": EndpointTypeMMAWorkspaceNetwork, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EndpointType(input) - return &out, nil -} - -type EvaluationState string - -const ( - EvaluationStateCompleted EvaluationState = "Completed" - EvaluationStateInProgress EvaluationState = "InProgress" - EvaluationStateNotStarted EvaluationState = "NotStarted" -) - -func PossibleValuesForEvaluationState() []string { - return []string{ - string(EvaluationStateCompleted), - string(EvaluationStateInProgress), - string(EvaluationStateNotStarted), - } -} - -func (s *EvaluationState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEvaluationState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEvaluationState(input string) (*EvaluationState, error) { - vals := map[string]EvaluationState{ - "completed": EvaluationStateCompleted, - "inprogress": EvaluationStateInProgress, - "notstarted": EvaluationStateNotStarted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EvaluationState(input) - return &out, nil -} - -type HTTPConfigurationMethod string - -const ( - HTTPConfigurationMethodGet HTTPConfigurationMethod = "Get" - HTTPConfigurationMethodPost HTTPConfigurationMethod = "Post" -) - -func PossibleValuesForHTTPConfigurationMethod() []string { - return []string{ - string(HTTPConfigurationMethodGet), - string(HTTPConfigurationMethodPost), - } -} - -func (s *HTTPConfigurationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHTTPConfigurationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHTTPConfigurationMethod(input string) (*HTTPConfigurationMethod, error) { - vals := map[string]HTTPConfigurationMethod{ - "get": HTTPConfigurationMethodGet, - "post": HTTPConfigurationMethodPost, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HTTPConfigurationMethod(input) - return &out, nil -} - -type IssueType string - -const ( - IssueTypeAgentStopped IssueType = "AgentStopped" - IssueTypeDnsResolution IssueType = "DnsResolution" - IssueTypeGuestFirewall IssueType = "GuestFirewall" - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - IssueTypePlatform IssueType = "Platform" - IssueTypePortThrottled IssueType = "PortThrottled" - IssueTypeSocketBind IssueType = "SocketBind" - IssueTypeUnknown IssueType = "Unknown" - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -func PossibleValuesForIssueType() []string { - return []string{ - string(IssueTypeAgentStopped), - string(IssueTypeDnsResolution), - string(IssueTypeGuestFirewall), - string(IssueTypeNetworkSecurityRule), - string(IssueTypePlatform), - string(IssueTypePortThrottled), - string(IssueTypeSocketBind), - string(IssueTypeUnknown), - string(IssueTypeUserDefinedRoute), - } -} - -func (s *IssueType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIssueType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIssueType(input string) (*IssueType, error) { - vals := map[string]IssueType{ - "agentstopped": IssueTypeAgentStopped, - "dnsresolution": IssueTypeDnsResolution, - "guestfirewall": IssueTypeGuestFirewall, - "networksecurityrule": IssueTypeNetworkSecurityRule, - "platform": IssueTypePlatform, - "portthrottled": IssueTypePortThrottled, - "socketbind": IssueTypeSocketBind, - "unknown": IssueTypeUnknown, - "userdefinedroute": IssueTypeUserDefinedRoute, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IssueType(input) - return &out, nil -} - -type Origin string - -const ( - OriginInbound Origin = "Inbound" - OriginLocal Origin = "Local" - OriginOutbound Origin = "Outbound" -) - -func PossibleValuesForOrigin() []string { - return []string{ - string(OriginInbound), - string(OriginLocal), - string(OriginOutbound), - } -} - -func (s *Origin) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOrigin(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOrigin(input string) (*Origin, error) { - vals := map[string]Origin{ - "inbound": OriginInbound, - "local": OriginLocal, - "outbound": OriginOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Origin(input) - return &out, nil -} - -type OutputType string - -const ( - OutputTypeWorkspace OutputType = "Workspace" -) - -func PossibleValuesForOutputType() []string { - return []string{ - string(OutputTypeWorkspace), - } -} - -func (s *OutputType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOutputType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOutputType(input string) (*OutputType, error) { - vals := map[string]OutputType{ - "workspace": OutputTypeWorkspace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OutputType(input) - return &out, nil -} - -type PreferredIPVersion string - -const ( - PreferredIPVersionIPvFour PreferredIPVersion = "IPv4" - PreferredIPVersionIPvSix PreferredIPVersion = "IPv6" -) - -func PossibleValuesForPreferredIPVersion() []string { - return []string{ - string(PreferredIPVersionIPvFour), - string(PreferredIPVersionIPvSix), - } -} - -func (s *PreferredIPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePreferredIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePreferredIPVersion(input string) (*PreferredIPVersion, error) { - vals := map[string]PreferredIPVersion{ - "ipv4": PreferredIPVersionIPvFour, - "ipv6": PreferredIPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PreferredIPVersion(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type Severity string - -const ( - SeverityError Severity = "Error" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityError), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "error": SeverityError, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor.go b/resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor.go deleted file mode 100644 index 10d851fd213..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor.go +++ /dev/null @@ -1,139 +0,0 @@ -package connectionmonitors - -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(&ConnectionMonitorId{}) -} - -var _ resourceids.ResourceId = &ConnectionMonitorId{} - -// ConnectionMonitorId is a struct representing the Resource ID for a Connection Monitor -type ConnectionMonitorId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string - ConnectionMonitorName string -} - -// NewConnectionMonitorID returns a new ConnectionMonitorId struct -func NewConnectionMonitorID(subscriptionId string, resourceGroupName string, networkWatcherName string, connectionMonitorName string) ConnectionMonitorId { - return ConnectionMonitorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - ConnectionMonitorName: connectionMonitorName, - } -} - -// ParseConnectionMonitorID parses 'input' into a ConnectionMonitorId -func ParseConnectionMonitorID(input string) (*ConnectionMonitorId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionMonitorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionMonitorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectionMonitorIDInsensitively parses 'input' case-insensitively into a ConnectionMonitorId -// note: this method should only be used for API response data and not user input -func ParseConnectionMonitorIDInsensitively(input string) (*ConnectionMonitorId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionMonitorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionMonitorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectionMonitorId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - if id.ConnectionMonitorName, ok = input.Parsed["connectionMonitorName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionMonitorName", input) - } - - return nil -} - -// ValidateConnectionMonitorID checks that 'input' can be parsed as a Connection Monitor ID -func ValidateConnectionMonitorID(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 := ParseConnectionMonitorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connection Monitor ID -func (id ConnectionMonitorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s/connectionMonitors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName, id.ConnectionMonitorName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connection Monitor ID -func (id ConnectionMonitorId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - resourceids.StaticSegment("staticConnectionMonitors", "connectionMonitors", "connectionMonitors"), - resourceids.UserSpecifiedSegment("connectionMonitorName", "connectionMonitorValue"), - } -} - -// String returns a human-readable description of this Connection Monitor ID -func (id ConnectionMonitorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - fmt.Sprintf("Connection Monitor Name: %q", id.ConnectionMonitorName), - } - return fmt.Sprintf("Connection Monitor (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor_test.go b/resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor_test.go deleted file mode 100644 index 06c34a9c63c..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/id_connectionmonitor_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package connectionmonitors - -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 = &ConnectionMonitorId{} - -func TestNewConnectionMonitorID(t *testing.T) { - id := NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } - - if id.ConnectionMonitorName != "connectionMonitorValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionMonitorName'", id.ConnectionMonitorName, "connectionMonitorValue") - } -} - -func TestFormatConnectionMonitorID(t *testing.T) { - actual := NewConnectionMonitorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "connectionMonitorValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectionMonitorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionMonitorId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue", - Expected: &ConnectionMonitorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - ConnectionMonitorName: "connectionMonitorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionMonitorID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.ConnectionMonitorName != v.Expected.ConnectionMonitorName { - t.Fatalf("Expected %q but got %q for ConnectionMonitorName", v.Expected.ConnectionMonitorName, actual.ConnectionMonitorName) - } - - } -} - -func TestParseConnectionMonitorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionMonitorId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/cOnNeCtIoNmOnItOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue", - Expected: &ConnectionMonitorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - ConnectionMonitorName: "connectionMonitorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/connectionMonitors/connectionMonitorValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/cOnNeCtIoNmOnItOrS/cOnNeCtIoNmOnItOrVaLuE", - Expected: &ConnectionMonitorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - ConnectionMonitorName: "cOnNeCtIoNmOnItOrVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/cOnNeCtIoNmOnItOrS/cOnNeCtIoNmOnItOrVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionMonitorIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.ConnectionMonitorName != v.Expected.ConnectionMonitorName { - t.Fatalf("Expected %q but got %q for ConnectionMonitorName", v.Expected.ConnectionMonitorName, actual.ConnectionMonitorName) - } - - } -} - -func TestSegmentsForConnectionMonitorId(t *testing.T) { - segments := ConnectionMonitorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectionMonitorId 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/network/2023-06-01/connectionmonitors/id_networkwatcher.go b/resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher.go deleted file mode 100644 index c112368b0b7..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package connectionmonitors - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher_test.go b/resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher_test.go deleted file mode 100644 index 05fd2d98cbd..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package connectionmonitors - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-06-01/connectionmonitors/method_createorupdate.go b/resource-manager/network/2023-06-01/connectionmonitors/method_createorupdate.go deleted file mode 100644 index b54a54e92b1..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_createorupdate.go +++ /dev/null @@ -1,103 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorResult -} - -type CreateOrUpdateOperationOptions struct { - Migrate *string -} - -func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions { - return CreateOrUpdateOperationOptions{} -} - -func (o CreateOrUpdateOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CreateOrUpdateOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CreateOrUpdateOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Migrate != nil { - out.Append("migrate", fmt.Sprintf("%v", *o.Migrate)) - } - return &out -} - -// CreateOrUpdate ... -func (c ConnectionMonitorsClient) CreateOrUpdate(ctx context.Context, id ConnectionMonitorId, input ConnectionMonitor, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 ConnectionMonitorsClient) CreateOrUpdateThenPoll(ctx context.Context, id ConnectionMonitorId, input ConnectionMonitor, 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/network/2023-06-01/connectionmonitors/method_delete.go b/resource-manager/network/2023-06-01/connectionmonitors/method_delete.go deleted file mode 100644 index a0d6aebb3f1..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorsClient) Delete(ctx context.Context, id ConnectionMonitorId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c ConnectionMonitorsClient) DeleteThenPoll(ctx context.Context, id ConnectionMonitorId) 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/network/2023-06-01/connectionmonitors/method_get.go b/resource-manager/network/2023-06-01/connectionmonitors/method_get.go deleted file mode 100644 index 883ffbdfd40..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorResult -} - -// Get ... -func (c ConnectionMonitorsClient) Get(ctx context.Context, id ConnectionMonitorId) (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 ConnectionMonitorResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/method_list.go b/resource-manager/network/2023-06-01/connectionmonitors/method_list.go deleted file mode 100644 index 40de4efcac7..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorListResult -} - -// List ... -func (c ConnectionMonitorsClient) List(ctx context.Context, id NetworkWatcherId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connectionMonitors", 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 ConnectionMonitorListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/method_query.go b/resource-manager/network/2023-06-01/connectionmonitors/method_query.go deleted file mode 100644 index ee985b11689..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_query.go +++ /dev/null @@ -1,71 +0,0 @@ -package connectionmonitors - -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 QueryOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionMonitorQueryResult -} - -// Query ... -func (c ConnectionMonitorsClient) Query(ctx context.Context, id ConnectionMonitorId) (result QueryOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/query", 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 -} - -// QueryThenPoll performs Query then polls until it's completed -func (c ConnectionMonitorsClient) QueryThenPoll(ctx context.Context, id ConnectionMonitorId) error { - result, err := c.Query(ctx, id) - if err != nil { - return fmt.Errorf("performing Query: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Query: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/method_start.go b/resource-manager/network/2023-06-01/connectionmonitors/method_start.go deleted file mode 100644 index f5f3ef3ba4e..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_start.go +++ /dev/null @@ -1,70 +0,0 @@ -package connectionmonitors - -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 StartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Start ... -func (c ConnectionMonitorsClient) Start(ctx context.Context, id ConnectionMonitorId) (result StartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ConnectionMonitorsClient) StartThenPoll(ctx context.Context, id ConnectionMonitorId) 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/network/2023-06-01/connectionmonitors/method_stop.go b/resource-manager/network/2023-06-01/connectionmonitors/method_stop.go deleted file mode 100644 index 44a5d3c56a7..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package connectionmonitors - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c ConnectionMonitorsClient) Stop(ctx context.Context, id ConnectionMonitorId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 ConnectionMonitorsClient) StopThenPoll(ctx context.Context, id ConnectionMonitorId) 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/network/2023-06-01/connectionmonitors/method_updatetags.go b/resource-manager/network/2023-06-01/connectionmonitors/method_updatetags.go deleted file mode 100644 index 04091a0b16c..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package connectionmonitors - -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 *ConnectionMonitorResult -} - -// UpdateTags ... -func (c ConnectionMonitorsClient) UpdateTags(ctx context.Context, id ConnectionMonitorId, 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 ConnectionMonitorResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitor.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitor.go deleted file mode 100644 index 0257ef7bed9..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitor.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitor struct { - Location *string `json:"location,omitempty"` - Properties ConnectionMonitorParameters `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitordestination.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitordestination.go deleted file mode 100644 index 2c1eaeadd69..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitordestination.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorDestination struct { - Address *string `json:"address,omitempty"` - Port *int64 `json:"port,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpoint.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpoint.go deleted file mode 100644 index 570c394f371..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpoint.go +++ /dev/null @@ -1,14 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpoint struct { - Address *string `json:"address,omitempty"` - CoverageLevel *CoverageLevel `json:"coverageLevel,omitempty"` - Filter *ConnectionMonitorEndpointFilter `json:"filter,omitempty"` - Name string `json:"name"` - ResourceId *string `json:"resourceId,omitempty"` - Scope *ConnectionMonitorEndpointScope `json:"scope,omitempty"` - Type *EndpointType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilter.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilter.go deleted file mode 100644 index f861681a10c..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilter.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointFilter struct { - Items *[]ConnectionMonitorEndpointFilterItem `json:"items,omitempty"` - Type *ConnectionMonitorEndpointFilterType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go deleted file mode 100644 index 49a3320062d..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointfilteritem.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointFilterItem struct { - Address *string `json:"address,omitempty"` - Type *ConnectionMonitorEndpointFilterItemType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscope.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscope.go deleted file mode 100644 index 36bb68efcaa..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscope.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointScope struct { - Exclude *[]ConnectionMonitorEndpointScopeItem `json:"exclude,omitempty"` - Include *[]ConnectionMonitorEndpointScopeItem `json:"include,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go deleted file mode 100644 index e73b5e20b3b..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorendpointscopeitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorEndpointScopeItem struct { - Address *string `json:"address,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go deleted file mode 100644 index 51af2309e94..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorhttpconfiguration.go +++ /dev/null @@ -1,13 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorHTTPConfiguration struct { - Method *HTTPConfigurationMethod `json:"method,omitempty"` - Path *string `json:"path,omitempty"` - Port *int64 `json:"port,omitempty"` - PreferHTTPS *bool `json:"preferHTTPS,omitempty"` - RequestHeaders *[]HTTPHeader `json:"requestHeaders,omitempty"` - ValidStatusCodeRanges *[]string `json:"validStatusCodeRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go deleted file mode 100644 index 6468613d1af..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoricmpconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorIcmpConfiguration struct { - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorlistresult.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorlistresult.go deleted file mode 100644 index 2e3014360ae..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorListResult struct { - Value *[]ConnectionMonitorResult `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoroutput.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoroutput.go deleted file mode 100644 index fcacc064d79..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitoroutput.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorOutput struct { - Type *OutputType `json:"type,omitempty"` - WorkspaceSettings *ConnectionMonitorWorkspaceSettings `json:"workspaceSettings,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorparameters.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorparameters.go deleted file mode 100644 index d529e518683..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorparameters.go +++ /dev/null @@ -1,16 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorParameters struct { - AutoStart *bool `json:"autoStart,omitempty"` - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - MonitoringIntervalInSeconds *int64 `json:"monitoringIntervalInSeconds,omitempty"` - Notes *string `json:"notes,omitempty"` - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - Source *ConnectionMonitorSource `json:"source,omitempty"` - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorqueryresult.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorqueryresult.go deleted file mode 100644 index 455f34530d5..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorqueryresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorQueryResult struct { - SourceStatus *ConnectionMonitorSourceStatus `json:"sourceStatus,omitempty"` - States *[]ConnectionStateSnapshot `json:"states,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresult.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresult.go deleted file mode 100644 index 439794014f7..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresult.go +++ /dev/null @@ -1,14 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorResult struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ConnectionMonitorResultProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresultproperties.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresultproperties.go deleted file mode 100644 index 0299f7f69a7..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorresultproperties.go +++ /dev/null @@ -1,38 +0,0 @@ -package connectionmonitors - -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 ConnectionMonitorResultProperties struct { - AutoStart *bool `json:"autoStart,omitempty"` - ConnectionMonitorType *ConnectionMonitorType `json:"connectionMonitorType,omitempty"` - Destination *ConnectionMonitorDestination `json:"destination,omitempty"` - Endpoints *[]ConnectionMonitorEndpoint `json:"endpoints,omitempty"` - MonitoringIntervalInSeconds *int64 `json:"monitoringIntervalInSeconds,omitempty"` - MonitoringStatus *string `json:"monitoringStatus,omitempty"` - Notes *string `json:"notes,omitempty"` - Outputs *[]ConnectionMonitorOutput `json:"outputs,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Source *ConnectionMonitorSource `json:"source,omitempty"` - StartTime *string `json:"startTime,omitempty"` - TestConfigurations *[]ConnectionMonitorTestConfiguration `json:"testConfigurations,omitempty"` - TestGroups *[]ConnectionMonitorTestGroup `json:"testGroups,omitempty"` -} - -func (o *ConnectionMonitorResultProperties) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ConnectionMonitorResultProperties) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsource.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsource.go deleted file mode 100644 index 39fa1ef2bdc..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsource.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorSource struct { - Port *int64 `json:"port,omitempty"` - ResourceId string `json:"resourceId"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go deleted file mode 100644 index 9f6ca6fac8b..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorsuccessthreshold.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorSuccessThreshold struct { - ChecksFailedPercent *int64 `json:"checksFailedPercent,omitempty"` - RoundTripTimeMs *float64 `json:"roundTripTimeMs,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortcpconfiguration.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortcpconfiguration.go deleted file mode 100644 index 99fdbf40239..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortcpconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorTcpConfiguration struct { - DestinationPortBehavior *DestinationPortBehavior `json:"destinationPortBehavior,omitempty"` - DisableTraceRoute *bool `json:"disableTraceRoute,omitempty"` - Port *int64 `json:"port,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestconfiguration.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestconfiguration.go deleted file mode 100644 index c4aa04feaba..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestconfiguration.go +++ /dev/null @@ -1,15 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorTestConfiguration struct { - HTTPConfiguration *ConnectionMonitorHTTPConfiguration `json:"httpConfiguration,omitempty"` - IcmpConfiguration *ConnectionMonitorIcmpConfiguration `json:"icmpConfiguration,omitempty"` - Name string `json:"name"` - PreferredIPVersion *PreferredIPVersion `json:"preferredIPVersion,omitempty"` - Protocol ConnectionMonitorTestConfigurationProtocol `json:"protocol"` - SuccessThreshold *ConnectionMonitorSuccessThreshold `json:"successThreshold,omitempty"` - TcpConfiguration *ConnectionMonitorTcpConfiguration `json:"tcpConfiguration,omitempty"` - TestFrequencySec *int64 `json:"testFrequencySec,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestgroup.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestgroup.go deleted file mode 100644 index 6eaa922f55a..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitortestgroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorTestGroup struct { - Destinations []string `json:"destinations"` - Disable *bool `json:"disable,omitempty"` - Name string `json:"name"` - Sources []string `json:"sources"` - TestConfigurations []string `json:"testConfigurations"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorworkspacesettings.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorworkspacesettings.go deleted file mode 100644 index ae23c31662f..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionmonitorworkspacesettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionMonitorWorkspaceSettings struct { - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionstatesnapshot.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectionstatesnapshot.go deleted file mode 100644 index 060c3bece81..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectionstatesnapshot.go +++ /dev/null @@ -1,47 +0,0 @@ -package connectionmonitors - -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 ConnectionStateSnapshot struct { - AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` - ConnectionState *ConnectionState `json:"connectionState,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EvaluationState *EvaluationState `json:"evaluationState,omitempty"` - Hops *[]ConnectivityHop `json:"hops,omitempty"` - MaxLatencyInMs *int64 `json:"maxLatencyInMs,omitempty"` - MinLatencyInMs *int64 `json:"minLatencyInMs,omitempty"` - ProbesFailed *int64 `json:"probesFailed,omitempty"` - ProbesSent *int64 `json:"probesSent,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *ConnectionStateSnapshot) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ConnectionStateSnapshot) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *ConnectionStateSnapshot) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ConnectionStateSnapshot) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectivityhop.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectivityhop.go deleted file mode 100644 index b93b627ac70..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectivityhop.go +++ /dev/null @@ -1,16 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityHop struct { - Address *string `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - Links *[]HopLink `json:"links,omitempty"` - NextHopIds *[]string `json:"nextHopIds,omitempty"` - PreviousHopIds *[]string `json:"previousHopIds,omitempty"` - PreviousLinks *[]HopLink `json:"previousLinks,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_connectivityissue.go b/resource-manager/network/2023-06-01/connectionmonitors/model_connectivityissue.go deleted file mode 100644 index ff7c6cdaf11..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_connectivityissue.go +++ /dev/null @@ -1,11 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityIssue struct { - Context *[]map[string]string `json:"context,omitempty"` - Origin *Origin `json:"origin,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Type *IssueType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_hoplink.go b/resource-manager/network/2023-06-01/connectionmonitors/model_hoplink.go deleted file mode 100644 index c2b18cd5be1..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_hoplink.go +++ /dev/null @@ -1,13 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLink struct { - Context *map[string]string `json:"context,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - LinkType *string `json:"linkType,omitempty"` - NextHopId *string `json:"nextHopId,omitempty"` - Properties *HopLinkProperties `json:"properties,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_hoplinkproperties.go b/resource-manager/network/2023-06-01/connectionmonitors/model_hoplinkproperties.go deleted file mode 100644 index d38f1875957..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_hoplinkproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLinkProperties struct { - RoundTripTimeAvg *int64 `json:"roundTripTimeAvg,omitempty"` - RoundTripTimeMax *int64 `json:"roundTripTimeMax,omitempty"` - RoundTripTimeMin *int64 `json:"roundTripTimeMin,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_httpheader.go b/resource-manager/network/2023-06-01/connectionmonitors/model_httpheader.go deleted file mode 100644 index 7cae34688aa..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_httpheader.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectionmonitors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPHeader struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectionmonitors/model_tagsobject.go b/resource-manager/network/2023-06-01/connectionmonitors/model_tagsobject.go deleted file mode 100644 index d9e7e6413ff..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package connectionmonitors - -// 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/network/2023-06-01/connectionmonitors/version.go b/resource-manager/network/2023-06-01/connectionmonitors/version.go deleted file mode 100644 index a8a3b08778b..00000000000 --- a/resource-manager/network/2023-06-01/connectionmonitors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectionmonitors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/connectionmonitors/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/README.md b/resource-manager/network/2023-06-01/connectivityconfigurations/README.md deleted file mode 100644 index 43bae25b6f4..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/connectivityconfigurations` Documentation - -The `connectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/connectivityconfigurations" -``` - - -### Client Initialization - -```go -client := connectivityconfigurations.NewConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConnectivityConfigurationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -payload := connectivityconfigurations.ConnectivityConfiguration{ - // ... -} - - -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: `ConnectivityConfigurationsClient.Delete` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, connectivityconfigurations.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `ConnectivityConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - -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: `ConnectivityConfigurationsClient.List` - -```go -ctx := context.TODO() -id := connectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, connectivityconfigurations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, connectivityconfigurations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/client.go b/resource-manager/network/2023-06-01/connectivityconfigurations/client.go deleted file mode 100644 index 7fb783f963a..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package connectivityconfigurations - -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 ConnectivityConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewConnectivityConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConnectivityConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "connectivityconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConnectivityConfigurationsClient: %+v", err) - } - - return &ConnectivityConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/constants.go b/resource-manager/network/2023-06-01/connectivityconfigurations/constants.go deleted file mode 100644 index e9642441352..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/constants.go +++ /dev/null @@ -1,262 +0,0 @@ -package connectivityconfigurations - -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 ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -func PossibleValuesForConnectivityTopology() []string { - return []string{ - string(ConnectivityTopologyHubAndSpoke), - string(ConnectivityTopologyMesh), - } -} - -func (s *ConnectivityTopology) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityTopology(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityTopology(input string) (*ConnectivityTopology, error) { - vals := map[string]ConnectivityTopology{ - "hubandspoke": ConnectivityTopologyHubAndSpoke, - "mesh": ConnectivityTopologyMesh, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityTopology(input) - return &out, nil -} - -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -func PossibleValuesForDeleteExistingPeering() []string { - return []string{ - string(DeleteExistingPeeringFalse), - string(DeleteExistingPeeringTrue), - } -} - -func (s *DeleteExistingPeering) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteExistingPeering(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteExistingPeering(input string) (*DeleteExistingPeering, error) { - vals := map[string]DeleteExistingPeering{ - "false": DeleteExistingPeeringFalse, - "true": DeleteExistingPeeringTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteExistingPeering(input) - return &out, nil -} - -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -func PossibleValuesForGroupConnectivity() []string { - return []string{ - string(GroupConnectivityDirectlyConnected), - string(GroupConnectivityNone), - } -} - -func (s *GroupConnectivity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGroupConnectivity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGroupConnectivity(input string) (*GroupConnectivity, error) { - vals := map[string]GroupConnectivity{ - "directlyconnected": GroupConnectivityDirectlyConnected, - "none": GroupConnectivityNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GroupConnectivity(input) - return &out, nil -} - -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -func PossibleValuesForIsGlobal() []string { - return []string{ - string(IsGlobalFalse), - string(IsGlobalTrue), - } -} - -func (s *IsGlobal) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsGlobal(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsGlobal(input string) (*IsGlobal, error) { - vals := map[string]IsGlobal{ - "false": IsGlobalFalse, - "true": IsGlobalTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsGlobal(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -func PossibleValuesForUseHubGateway() []string { - return []string{ - string(UseHubGatewayFalse), - string(UseHubGatewayTrue), - } -} - -func (s *UseHubGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUseHubGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUseHubGateway(input string) (*UseHubGateway, error) { - vals := map[string]UseHubGateway{ - "false": UseHubGatewayFalse, - "true": UseHubGatewayTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UseHubGateway(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration.go b/resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration.go deleted file mode 100644 index d00d054bd40..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package connectivityconfigurations - -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(&ConnectivityConfigurationId{}) -} - -var _ resourceids.ResourceId = &ConnectivityConfigurationId{} - -// ConnectivityConfigurationId is a struct representing the Resource ID for a Connectivity Configuration -type ConnectivityConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - ConnectivityConfigurationName string -} - -// NewConnectivityConfigurationID returns a new ConnectivityConfigurationId struct -func NewConnectivityConfigurationID(subscriptionId string, resourceGroupName string, networkManagerName string, connectivityConfigurationName string) ConnectivityConfigurationId { - return ConnectivityConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - ConnectivityConfigurationName: connectivityConfigurationName, - } -} - -// ParseConnectivityConfigurationID parses 'input' into a ConnectivityConfigurationId -func ParseConnectivityConfigurationID(input string) (*ConnectivityConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectivityConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectivityConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectivityConfigurationIDInsensitively parses 'input' case-insensitively into a ConnectivityConfigurationId -// note: this method should only be used for API response data and not user input -func ParseConnectivityConfigurationIDInsensitively(input string) (*ConnectivityConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectivityConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectivityConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectivityConfigurationId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.ConnectivityConfigurationName, ok = input.Parsed["connectivityConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectivityConfigurationName", input) - } - - return nil -} - -// ValidateConnectivityConfigurationID checks that 'input' can be parsed as a Connectivity Configuration ID -func ValidateConnectivityConfigurationID(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 := ParseConnectivityConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connectivity Configuration ID -func (id ConnectivityConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/connectivityConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.ConnectivityConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connectivity Configuration ID -func (id ConnectivityConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticConnectivityConfigurations", "connectivityConfigurations", "connectivityConfigurations"), - resourceids.UserSpecifiedSegment("connectivityConfigurationName", "connectivityConfigurationValue"), - } -} - -// String returns a human-readable description of this Connectivity Configuration ID -func (id ConnectivityConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Connectivity Configuration Name: %q", id.ConnectivityConfigurationName), - } - return fmt.Sprintf("Connectivity Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration_test.go b/resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration_test.go deleted file mode 100644 index 49deadd7a10..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/id_connectivityconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package connectivityconfigurations - -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 = &ConnectivityConfigurationId{} - -func TestNewConnectivityConfigurationID(t *testing.T) { - id := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.ConnectivityConfigurationName != "connectivityConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectivityConfigurationName'", id.ConnectivityConfigurationName, "connectivityConfigurationValue") - } -} - -func TestFormatConnectivityConfigurationID(t *testing.T) { - actual := NewConnectivityConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "connectivityConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectivityConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectivityConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue", - Expected: &ConnectivityConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ConnectivityConfigurationName: "connectivityConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectivityConfigurationID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ConnectivityConfigurationName != v.Expected.ConnectivityConfigurationName { - t.Fatalf("Expected %q but got %q for ConnectivityConfigurationName", v.Expected.ConnectivityConfigurationName, actual.ConnectivityConfigurationName) - } - - } -} - -func TestParseConnectivityConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectivityConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/cOnNeCtIvItYcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue", - Expected: &ConnectivityConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ConnectivityConfigurationName: "connectivityConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/connectivityConfigurations/connectivityConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnVaLuE", - Expected: &ConnectivityConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - ConnectivityConfigurationName: "cOnNeCtIvItYcOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/cOnNeCtIvItYcOnFiGuRaTiOnS/cOnNeCtIvItYcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectivityConfigurationIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ConnectivityConfigurationName != v.Expected.ConnectivityConfigurationName { - t.Fatalf("Expected %q but got %q for ConnectivityConfigurationName", v.Expected.ConnectivityConfigurationName, actual.ConnectivityConfigurationName) - } - - } -} - -func TestSegmentsForConnectivityConfigurationId(t *testing.T) { - segments := ConnectivityConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectivityConfigurationId 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/network/2023-06-01/connectivityconfigurations/id_networkmanager.go b/resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager.go deleted file mode 100644 index 1f7b8c3216b..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package connectivityconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager_test.go deleted file mode 100644 index a27bf99d861..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package connectivityconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/connectivityconfigurations/method_createorupdate.go b/resource-manager/network/2023-06-01/connectivityconfigurations/method_createorupdate.go deleted file mode 100644 index 3ad8680898d..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package connectivityconfigurations - -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 *ConnectivityConfiguration -} - -// CreateOrUpdate ... -func (c ConnectivityConfigurationsClient) CreateOrUpdate(ctx context.Context, id ConnectivityConfigurationId, input ConnectivityConfiguration) (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 ConnectivityConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/method_delete.go b/resource-manager/network/2023-06-01/connectivityconfigurations/method_delete.go deleted file mode 100644 index 39d9c109838..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package connectivityconfigurations - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 ConnectivityConfigurationsClient) Delete(ctx context.Context, id ConnectivityConfigurationId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 ConnectivityConfigurationsClient) DeleteThenPoll(ctx context.Context, id ConnectivityConfigurationId, 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/network/2023-06-01/connectivityconfigurations/method_get.go b/resource-manager/network/2023-06-01/connectivityconfigurations/method_get.go deleted file mode 100644 index d8769033b0a..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package connectivityconfigurations - -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 *ConnectivityConfiguration -} - -// Get ... -func (c ConnectivityConfigurationsClient) Get(ctx context.Context, id ConnectivityConfigurationId) (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 ConnectivityConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/method_list.go b/resource-manager/network/2023-06-01/connectivityconfigurations/method_list.go deleted file mode 100644 index 27b1f2a035f..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package connectivityconfigurations - -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 *[]ConnectivityConfiguration -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ConnectivityConfiguration -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c ConnectivityConfigurationsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connectivityConfigurations", id.ID()), - OptionsObject: options, - } - - 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 *[]ConnectivityConfiguration `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 ConnectivityConfigurationsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, ConnectivityConfigurationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ConnectivityConfigurationsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate ConnectivityConfigurationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ConnectivityConfiguration, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/connectivityconfigurations/model_connectivityconfiguration.go b/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfiguration.go deleted file mode 100644 index 7c6238540d1..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package connectivityconfigurations - -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 ConnectivityConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfigurationproperties.go deleted file mode 100644 index 643d3c116ab..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivitygroupitem.go b/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivitygroupitem.go deleted file mode 100644 index 0ac02d12f1a..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/model_connectivitygroupitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityGroupItem struct { - GroupConnectivity GroupConnectivity `json:"groupConnectivity"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - NetworkGroupId string `json:"networkGroupId"` - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/model_hub.go b/resource-manager/network/2023-06-01/connectivityconfigurations/model_hub.go deleted file mode 100644 index 5e43da03fdd..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/model_hub.go +++ /dev/null @@ -1,9 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Hub struct { - ResourceId *string `json:"resourceId,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/connectivityconfigurations/predicates.go b/resource-manager/network/2023-06-01/connectivityconfigurations/predicates.go deleted file mode 100644 index ecab73247f2..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package connectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ConnectivityConfigurationOperationPredicate) Matches(input ConnectivityConfiguration) 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.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/network/2023-06-01/connectivityconfigurations/version.go b/resource-manager/network/2023-06-01/connectivityconfigurations/version.go deleted file mode 100644 index f6d2e9d278e..00000000000 --- a/resource-manager/network/2023-06-01/connectivityconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package connectivityconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/connectivityconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/README.md b/resource-manager/network/2023-06-01/customipprefixes/README.md deleted file mode 100644 index a9482f260e3..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/customipprefixes` Documentation - -The `customipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/customipprefixes" -``` - - -### Client Initialization - -```go -client := customipprefixes.NewCustomIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CustomIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -payload := customipprefixes.CustomIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `CustomIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `CustomIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -read, err := client.Get(ctx, id, customipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `CustomIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `CustomIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `CustomIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := customipprefixes.NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - -payload := customipprefixes.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/network/2023-06-01/customipprefixes/client.go b/resource-manager/network/2023-06-01/customipprefixes/client.go deleted file mode 100644 index 1e1c6887c4a..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package customipprefixes - -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 CustomIPPrefixesClient struct { - Client *resourcemanager.Client -} - -func NewCustomIPPrefixesClientWithBaseURI(sdkApi sdkEnv.Api) (*CustomIPPrefixesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "customipprefixes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CustomIPPrefixesClient: %+v", err) - } - - return &CustomIPPrefixesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/constants.go b/resource-manager/network/2023-06-01/customipprefixes/constants.go deleted file mode 100644 index 2c9a9f7c2e2..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/constants.go +++ /dev/null @@ -1,222 +0,0 @@ -package customipprefixes - -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 CommissionedState string - -const ( - CommissionedStateCommissioned CommissionedState = "Commissioned" - CommissionedStateCommissionedNoInternetAdvertise CommissionedState = "CommissionedNoInternetAdvertise" - CommissionedStateCommissioning CommissionedState = "Commissioning" - CommissionedStateDecommissioning CommissionedState = "Decommissioning" - CommissionedStateDeprovisioned CommissionedState = "Deprovisioned" - CommissionedStateDeprovisioning CommissionedState = "Deprovisioning" - CommissionedStateProvisioned CommissionedState = "Provisioned" - CommissionedStateProvisioning CommissionedState = "Provisioning" -) - -func PossibleValuesForCommissionedState() []string { - return []string{ - string(CommissionedStateCommissioned), - string(CommissionedStateCommissionedNoInternetAdvertise), - string(CommissionedStateCommissioning), - string(CommissionedStateDecommissioning), - string(CommissionedStateDeprovisioned), - string(CommissionedStateDeprovisioning), - string(CommissionedStateProvisioned), - string(CommissionedStateProvisioning), - } -} - -func (s *CommissionedState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCommissionedState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCommissionedState(input string) (*CommissionedState, error) { - vals := map[string]CommissionedState{ - "commissioned": CommissionedStateCommissioned, - "commissionednointernetadvertise": CommissionedStateCommissionedNoInternetAdvertise, - "commissioning": CommissionedStateCommissioning, - "decommissioning": CommissionedStateDecommissioning, - "deprovisioned": CommissionedStateDeprovisioned, - "deprovisioning": CommissionedStateDeprovisioning, - "provisioned": CommissionedStateProvisioned, - "provisioning": CommissionedStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CommissionedState(input) - return &out, nil -} - -type CustomIPPrefixType string - -const ( - CustomIPPrefixTypeChild CustomIPPrefixType = "Child" - CustomIPPrefixTypeParent CustomIPPrefixType = "Parent" - CustomIPPrefixTypeSingular CustomIPPrefixType = "Singular" -) - -func PossibleValuesForCustomIPPrefixType() []string { - return []string{ - string(CustomIPPrefixTypeChild), - string(CustomIPPrefixTypeParent), - string(CustomIPPrefixTypeSingular), - } -} - -func (s *CustomIPPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCustomIPPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCustomIPPrefixType(input string) (*CustomIPPrefixType, error) { - vals := map[string]CustomIPPrefixType{ - "child": CustomIPPrefixTypeChild, - "parent": CustomIPPrefixTypeParent, - "singular": CustomIPPrefixTypeSingular, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CustomIPPrefixType(input) - return &out, nil -} - -type Geo string - -const ( - GeoAFRI Geo = "AFRI" - GeoAPAC Geo = "APAC" - GeoAQ Geo = "AQ" - GeoEURO Geo = "EURO" - GeoGLOBAL Geo = "GLOBAL" - GeoLATAM Geo = "LATAM" - GeoME Geo = "ME" - GeoNAM Geo = "NAM" - GeoOCEANIA Geo = "OCEANIA" -) - -func PossibleValuesForGeo() []string { - return []string{ - string(GeoAFRI), - string(GeoAPAC), - string(GeoAQ), - string(GeoEURO), - string(GeoGLOBAL), - string(GeoLATAM), - string(GeoME), - string(GeoNAM), - string(GeoOCEANIA), - } -} - -func (s *Geo) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGeo(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGeo(input string) (*Geo, error) { - vals := map[string]Geo{ - "afri": GeoAFRI, - "apac": GeoAPAC, - "aq": GeoAQ, - "euro": GeoEURO, - "global": GeoGLOBAL, - "latam": GeoLATAM, - "me": GeoME, - "nam": GeoNAM, - "oceania": GeoOCEANIA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Geo(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/id_customipprefix.go b/resource-manager/network/2023-06-01/customipprefixes/id_customipprefix.go deleted file mode 100644 index d4206cbdfb5..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/id_customipprefix.go +++ /dev/null @@ -1,130 +0,0 @@ -package customipprefixes - -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(&CustomIPPrefixId{}) -} - -var _ resourceids.ResourceId = &CustomIPPrefixId{} - -// CustomIPPrefixId is a struct representing the Resource ID for a Custom I P Prefix -type CustomIPPrefixId struct { - SubscriptionId string - ResourceGroupName string - CustomIPPrefixName string -} - -// NewCustomIPPrefixID returns a new CustomIPPrefixId struct -func NewCustomIPPrefixID(subscriptionId string, resourceGroupName string, customIPPrefixName string) CustomIPPrefixId { - return CustomIPPrefixId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CustomIPPrefixName: customIPPrefixName, - } -} - -// ParseCustomIPPrefixID parses 'input' into a CustomIPPrefixId -func ParseCustomIPPrefixID(input string) (*CustomIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&CustomIPPrefixId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CustomIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCustomIPPrefixIDInsensitively parses 'input' case-insensitively into a CustomIPPrefixId -// note: this method should only be used for API response data and not user input -func ParseCustomIPPrefixIDInsensitively(input string) (*CustomIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&CustomIPPrefixId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CustomIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CustomIPPrefixId) 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.CustomIPPrefixName, ok = input.Parsed["customIPPrefixName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "customIPPrefixName", input) - } - - return nil -} - -// ValidateCustomIPPrefixID checks that 'input' can be parsed as a Custom I P Prefix ID -func ValidateCustomIPPrefixID(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 := ParseCustomIPPrefixID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Custom I P Prefix ID -func (id CustomIPPrefixId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/customIPPrefixes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CustomIPPrefixName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Custom I P Prefix ID -func (id CustomIPPrefixId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticCustomIPPrefixes", "customIPPrefixes", "customIPPrefixes"), - resourceids.UserSpecifiedSegment("customIPPrefixName", "customIPPrefixValue"), - } -} - -// String returns a human-readable description of this Custom I P Prefix ID -func (id CustomIPPrefixId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Custom I P Prefix Name: %q", id.CustomIPPrefixName), - } - return fmt.Sprintf("Custom I P Prefix (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/id_customipprefix_test.go b/resource-manager/network/2023-06-01/customipprefixes/id_customipprefix_test.go deleted file mode 100644 index 7e3034445fa..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/id_customipprefix_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package customipprefixes - -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 = &CustomIPPrefixId{} - -func TestNewCustomIPPrefixID(t *testing.T) { - id := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue") - - 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.CustomIPPrefixName != "customIPPrefixValue" { - t.Fatalf("Expected %q but got %q for Segment 'CustomIPPrefixName'", id.CustomIPPrefixName, "customIPPrefixValue") - } -} - -func TestFormatCustomIPPrefixID(t *testing.T) { - actual := NewCustomIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "customIPPrefixValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCustomIPPrefixID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CustomIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue", - Expected: &CustomIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCustomIPPrefixID(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.CustomIPPrefixName != v.Expected.CustomIPPrefixName { - t.Fatalf("Expected %q but got %q for CustomIPPrefixName", v.Expected.CustomIPPrefixName, actual.CustomIPPrefixName) - } - - } -} - -func TestParseCustomIPPrefixIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CustomIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cUsToMiPpReFiXeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue", - Expected: &CustomIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CustomIPPrefixName: "customIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/customIPPrefixes/customIPPrefixValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cUsToMiPpReFiXeS/cUsToMiPpReFiXvAlUe", - Expected: &CustomIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CustomIPPrefixName: "cUsToMiPpReFiXvAlUe", - }, - }, - { - // 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.nEtWoRk/cUsToMiPpReFiXeS/cUsToMiPpReFiXvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCustomIPPrefixIDInsensitively(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.CustomIPPrefixName != v.Expected.CustomIPPrefixName { - t.Fatalf("Expected %q but got %q for CustomIPPrefixName", v.Expected.CustomIPPrefixName, actual.CustomIPPrefixName) - } - - } -} - -func TestSegmentsForCustomIPPrefixId(t *testing.T) { - segments := CustomIPPrefixId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CustomIPPrefixId 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/network/2023-06-01/customipprefixes/method_createorupdate.go b/resource-manager/network/2023-06-01/customipprefixes/method_createorupdate.go deleted file mode 100644 index 88925ffb667..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package customipprefixes - -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 *CustomIPPrefix -} - -// CreateOrUpdate ... -func (c CustomIPPrefixesClient) CreateOrUpdate(ctx context.Context, id CustomIPPrefixId, input CustomIPPrefix) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c CustomIPPrefixesClient) CreateOrUpdateThenPoll(ctx context.Context, id CustomIPPrefixId, input CustomIPPrefix) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/customipprefixes/method_delete.go b/resource-manager/network/2023-06-01/customipprefixes/method_delete.go deleted file mode 100644 index 2233d70928d..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package customipprefixes - -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 CustomIPPrefixesClient) Delete(ctx context.Context, id CustomIPPrefixId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 CustomIPPrefixesClient) DeleteThenPoll(ctx context.Context, id CustomIPPrefixId) 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/network/2023-06-01/customipprefixes/method_get.go b/resource-manager/network/2023-06-01/customipprefixes/method_get.go deleted file mode 100644 index 04442324994..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package customipprefixes - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CustomIPPrefix -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c CustomIPPrefixesClient) Get(ctx context.Context, id CustomIPPrefixId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 CustomIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/method_list.go b/resource-manager/network/2023-06-01/customipprefixes/method_list.go deleted file mode 100644 index 94c8ee791eb..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package customipprefixes - -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 *[]CustomIPPrefix -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []CustomIPPrefix -} - -// List ... -func (c CustomIPPrefixesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/customIPPrefixes", 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 *[]CustomIPPrefix `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 CustomIPPrefixesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, CustomIPPrefixOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CustomIPPrefixesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate CustomIPPrefixOperationPredicate) (result ListCompleteResult, err error) { - items := make([]CustomIPPrefix, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/customipprefixes/method_listall.go b/resource-manager/network/2023-06-01/customipprefixes/method_listall.go deleted file mode 100644 index b68a43fd89e..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package customipprefixes - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]CustomIPPrefix -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []CustomIPPrefix -} - -// ListAll ... -func (c CustomIPPrefixesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/customIPPrefixes", 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 *[]CustomIPPrefix `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c CustomIPPrefixesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, CustomIPPrefixOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CustomIPPrefixesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate CustomIPPrefixOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]CustomIPPrefix, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/method_updatetags.go b/resource-manager/network/2023-06-01/customipprefixes/method_updatetags.go deleted file mode 100644 index c61802109c3..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package customipprefixes - -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 *CustomIPPrefix -} - -// UpdateTags ... -func (c CustomIPPrefixesClient) UpdateTags(ctx context.Context, id CustomIPPrefixId, 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 CustomIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/model_customipprefix.go b/resource-manager/network/2023-06-01/customipprefixes/model_customipprefix.go deleted file mode 100644 index fc3d26ef7a4..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/model_customipprefix.go +++ /dev/null @@ -1,21 +0,0 @@ -package customipprefixes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 CustomIPPrefix struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *CustomIPPrefixPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/model_customipprefixpropertiesformat.go b/resource-manager/network/2023-06-01/customipprefixes/model_customipprefixpropertiesformat.go deleted file mode 100644 index f26a83b6b83..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/model_customipprefixpropertiesformat.go +++ /dev/null @@ -1,22 +0,0 @@ -package customipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomIPPrefixPropertiesFormat struct { - Asn *string `json:"asn,omitempty"` - AuthorizationMessage *string `json:"authorizationMessage,omitempty"` - ChildCustomIPPrefixes *[]SubResource `json:"childCustomIpPrefixes,omitempty"` - Cidr *string `json:"cidr,omitempty"` - CommissionedState *CommissionedState `json:"commissionedState,omitempty"` - CustomIPPrefixParent *SubResource `json:"customIpPrefixParent,omitempty"` - ExpressRouteAdvertise *bool `json:"expressRouteAdvertise,omitempty"` - FailedReason *string `json:"failedReason,omitempty"` - Geo *Geo `json:"geo,omitempty"` - NoInternetAdvertise *bool `json:"noInternetAdvertise,omitempty"` - PrefixType *CustomIPPrefixType `json:"prefixType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SignedMessage *string `json:"signedMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/model_subresource.go b/resource-manager/network/2023-06-01/customipprefixes/model_subresource.go deleted file mode 100644 index 2428ad08fc0..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package customipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/customipprefixes/model_tagsobject.go b/resource-manager/network/2023-06-01/customipprefixes/model_tagsobject.go deleted file mode 100644 index f1f3aea2b6e..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package customipprefixes - -// 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/network/2023-06-01/customipprefixes/predicates.go b/resource-manager/network/2023-06-01/customipprefixes/predicates.go deleted file mode 100644 index 288f9cfa042..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package customipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomIPPrefixOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p CustomIPPrefixOperationPredicate) Matches(input CustomIPPrefix) 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 && (input.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/network/2023-06-01/customipprefixes/version.go b/resource-manager/network/2023-06-01/customipprefixes/version.go deleted file mode 100644 index 1d3bb15edf4..00000000000 --- a/resource-manager/network/2023-06-01/customipprefixes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package customipprefixes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/customipprefixes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/README.md b/resource-manager/network/2023-06-01/ddoscustompolicies/README.md deleted file mode 100644 index f7225eae657..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ddoscustompolicies` Documentation - -The `ddoscustompolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/ddoscustompolicies" -``` - - -### Client Initialization - -```go -client := ddoscustompolicies.NewDdosCustomPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DdosCustomPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -payload := ddoscustompolicies.DdosCustomPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosCustomPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosCustomPoliciesClient.Get` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -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: `DdosCustomPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := ddoscustompolicies.NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - -payload := ddoscustompolicies.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/network/2023-06-01/ddoscustompolicies/client.go b/resource-manager/network/2023-06-01/ddoscustompolicies/client.go deleted file mode 100644 index e6985cefaee..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ddoscustompolicies - -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 DdosCustomPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewDdosCustomPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*DdosCustomPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ddoscustompolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DdosCustomPoliciesClient: %+v", err) - } - - return &DdosCustomPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/constants.go b/resource-manager/network/2023-06-01/ddoscustompolicies/constants.go deleted file mode 100644 index e62adb4c84b..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package ddoscustompolicies - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy.go b/resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy.go deleted file mode 100644 index 1898126aafc..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package ddoscustompolicies - -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(&DdosCustomPolicyId{}) -} - -var _ resourceids.ResourceId = &DdosCustomPolicyId{} - -// DdosCustomPolicyId is a struct representing the Resource ID for a Ddos Custom Policy -type DdosCustomPolicyId struct { - SubscriptionId string - ResourceGroupName string - DdosCustomPolicyName string -} - -// NewDdosCustomPolicyID returns a new DdosCustomPolicyId struct -func NewDdosCustomPolicyID(subscriptionId string, resourceGroupName string, ddosCustomPolicyName string) DdosCustomPolicyId { - return DdosCustomPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DdosCustomPolicyName: ddosCustomPolicyName, - } -} - -// ParseDdosCustomPolicyID parses 'input' into a DdosCustomPolicyId -func ParseDdosCustomPolicyID(input string) (*DdosCustomPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosCustomPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosCustomPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDdosCustomPolicyIDInsensitively parses 'input' case-insensitively into a DdosCustomPolicyId -// note: this method should only be used for API response data and not user input -func ParseDdosCustomPolicyIDInsensitively(input string) (*DdosCustomPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosCustomPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosCustomPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DdosCustomPolicyId) 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.DdosCustomPolicyName, ok = input.Parsed["ddosCustomPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ddosCustomPolicyName", input) - } - - return nil -} - -// ValidateDdosCustomPolicyID checks that 'input' can be parsed as a Ddos Custom Policy ID -func ValidateDdosCustomPolicyID(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 := ParseDdosCustomPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Ddos Custom Policy ID -func (id DdosCustomPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ddosCustomPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DdosCustomPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Ddos Custom Policy ID -func (id DdosCustomPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticDdosCustomPolicies", "ddosCustomPolicies", "ddosCustomPolicies"), - resourceids.UserSpecifiedSegment("ddosCustomPolicyName", "ddosCustomPolicyValue"), - } -} - -// String returns a human-readable description of this Ddos Custom Policy ID -func (id DdosCustomPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ddos Custom Policy Name: %q", id.DdosCustomPolicyName), - } - return fmt.Sprintf("Ddos Custom Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy_test.go b/resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy_test.go deleted file mode 100644 index 9e3bda7a007..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/id_ddoscustompolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ddoscustompolicies - -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 = &DdosCustomPolicyId{} - -func TestNewDdosCustomPolicyID(t *testing.T) { - id := NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue") - - 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.DdosCustomPolicyName != "ddosCustomPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'DdosCustomPolicyName'", id.DdosCustomPolicyName, "ddosCustomPolicyValue") - } -} - -func TestFormatDdosCustomPolicyID(t *testing.T) { - actual := NewDdosCustomPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosCustomPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDdosCustomPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosCustomPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue", - Expected: &DdosCustomPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosCustomPolicyName: "ddosCustomPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosCustomPolicyID(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.DdosCustomPolicyName != v.Expected.DdosCustomPolicyName { - t.Fatalf("Expected %q but got %q for DdosCustomPolicyName", v.Expected.DdosCustomPolicyName, actual.DdosCustomPolicyName) - } - - } -} - -func TestParseDdosCustomPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosCustomPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoScUsToMpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue", - Expected: &DdosCustomPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosCustomPolicyName: "ddosCustomPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosCustomPolicies/ddosCustomPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoScUsToMpOlIcIeS/dDoScUsToMpOlIcYvAlUe", - Expected: &DdosCustomPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DdosCustomPolicyName: "dDoScUsToMpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/dDoScUsToMpOlIcIeS/dDoScUsToMpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosCustomPolicyIDInsensitively(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.DdosCustomPolicyName != v.Expected.DdosCustomPolicyName { - t.Fatalf("Expected %q but got %q for DdosCustomPolicyName", v.Expected.DdosCustomPolicyName, actual.DdosCustomPolicyName) - } - - } -} - -func TestSegmentsForDdosCustomPolicyId(t *testing.T) { - segments := DdosCustomPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DdosCustomPolicyId 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/network/2023-06-01/ddoscustompolicies/method_createorupdate.go b/resource-manager/network/2023-06-01/ddoscustompolicies/method_createorupdate.go deleted file mode 100644 index ea81bb5382f..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ddoscustompolicies - -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 *DdosCustomPolicy -} - -// CreateOrUpdate ... -func (c DdosCustomPoliciesClient) CreateOrUpdate(ctx context.Context, id DdosCustomPolicyId, input DdosCustomPolicy) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DdosCustomPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id DdosCustomPolicyId, input DdosCustomPolicy) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/ddoscustompolicies/method_delete.go b/resource-manager/network/2023-06-01/ddoscustompolicies/method_delete.go deleted file mode 100644 index 78624333195..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ddoscustompolicies - -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 DdosCustomPoliciesClient) Delete(ctx context.Context, id DdosCustomPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 DdosCustomPoliciesClient) DeleteThenPoll(ctx context.Context, id DdosCustomPolicyId) 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/network/2023-06-01/ddoscustompolicies/method_get.go b/resource-manager/network/2023-06-01/ddoscustompolicies/method_get.go deleted file mode 100644 index 07a8cdf6ad0..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package ddoscustompolicies - -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 *DdosCustomPolicy -} - -// Get ... -func (c DdosCustomPoliciesClient) Get(ctx context.Context, id DdosCustomPolicyId) (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 DdosCustomPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/method_updatetags.go b/resource-manager/network/2023-06-01/ddoscustompolicies/method_updatetags.go deleted file mode 100644 index b64aa2cb519..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package ddoscustompolicies - -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 *DdosCustomPolicy -} - -// UpdateTags ... -func (c DdosCustomPoliciesClient) UpdateTags(ctx context.Context, id DdosCustomPolicyId, 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 DdosCustomPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicy.go b/resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicy.go deleted file mode 100644 index 21c20585880..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicy.go +++ /dev/null @@ -1,14 +0,0 @@ -package ddoscustompolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosCustomPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DdosCustomPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go b/resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go deleted file mode 100644 index fad59051390..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/model_ddoscustompolicypropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package ddoscustompolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosCustomPolicyPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ddoscustompolicies/model_tagsobject.go b/resource-manager/network/2023-06-01/ddoscustompolicies/model_tagsobject.go deleted file mode 100644 index 3b93ba90100..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ddoscustompolicies - -// 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/network/2023-06-01/ddoscustompolicies/version.go b/resource-manager/network/2023-06-01/ddoscustompolicies/version.go deleted file mode 100644 index b17243fe8a9..00000000000 --- a/resource-manager/network/2023-06-01/ddoscustompolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ddoscustompolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ddoscustompolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/README.md b/resource-manager/network/2023-06-01/ddosprotectionplans/README.md deleted file mode 100644 index 0ce80ed3ef5..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ddosprotectionplans` Documentation - -The `ddosprotectionplans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/ddosprotectionplans" -``` - - -### Client Initialization - -```go -client := ddosprotectionplans.NewDdosProtectionPlansClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DdosProtectionPlansClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -payload := ddosprotectionplans.DdosProtectionPlan{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosProtectionPlansClient.Delete` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DdosProtectionPlansClient.Get` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.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: `DdosProtectionPlansClient.UpdateTags` - -```go -ctx := context.TODO() -id := ddosprotectionplans.NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - -payload := ddosprotectionplans.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/network/2023-06-01/ddosprotectionplans/client.go b/resource-manager/network/2023-06-01/ddosprotectionplans/client.go deleted file mode 100644 index de83f23ea42..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ddosprotectionplans - -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 DdosProtectionPlansClient struct { - Client *resourcemanager.Client -} - -func NewDdosProtectionPlansClientWithBaseURI(sdkApi sdkEnv.Api) (*DdosProtectionPlansClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ddosprotectionplans", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DdosProtectionPlansClient: %+v", err) - } - - return &DdosProtectionPlansClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/constants.go b/resource-manager/network/2023-06-01/ddosprotectionplans/constants.go deleted file mode 100644 index ec2a63ded59..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package ddosprotectionplans - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan.go b/resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan.go deleted file mode 100644 index 1be4cad64d9..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan.go +++ /dev/null @@ -1,130 +0,0 @@ -package ddosprotectionplans - -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(&DdosProtectionPlanId{}) -} - -var _ resourceids.ResourceId = &DdosProtectionPlanId{} - -// DdosProtectionPlanId is a struct representing the Resource ID for a Ddos Protection Plan -type DdosProtectionPlanId struct { - SubscriptionId string - ResourceGroupName string - DdosProtectionPlanName string -} - -// NewDdosProtectionPlanID returns a new DdosProtectionPlanId struct -func NewDdosProtectionPlanID(subscriptionId string, resourceGroupName string, ddosProtectionPlanName string) DdosProtectionPlanId { - return DdosProtectionPlanId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DdosProtectionPlanName: ddosProtectionPlanName, - } -} - -// ParseDdosProtectionPlanID parses 'input' into a DdosProtectionPlanId -func ParseDdosProtectionPlanID(input string) (*DdosProtectionPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosProtectionPlanId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosProtectionPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDdosProtectionPlanIDInsensitively parses 'input' case-insensitively into a DdosProtectionPlanId -// note: this method should only be used for API response data and not user input -func ParseDdosProtectionPlanIDInsensitively(input string) (*DdosProtectionPlanId, error) { - parser := resourceids.NewParserFromResourceIdType(&DdosProtectionPlanId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DdosProtectionPlanId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DdosProtectionPlanId) 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.DdosProtectionPlanName, ok = input.Parsed["ddosProtectionPlanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ddosProtectionPlanName", input) - } - - return nil -} - -// ValidateDdosProtectionPlanID checks that 'input' can be parsed as a Ddos Protection Plan ID -func ValidateDdosProtectionPlanID(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 := ParseDdosProtectionPlanID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Ddos Protection Plan ID -func (id DdosProtectionPlanId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ddosProtectionPlans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DdosProtectionPlanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Ddos Protection Plan ID -func (id DdosProtectionPlanId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticDdosProtectionPlans", "ddosProtectionPlans", "ddosProtectionPlans"), - resourceids.UserSpecifiedSegment("ddosProtectionPlanName", "ddosProtectionPlanValue"), - } -} - -// String returns a human-readable description of this Ddos Protection Plan ID -func (id DdosProtectionPlanId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ddos Protection Plan Name: %q", id.DdosProtectionPlanName), - } - return fmt.Sprintf("Ddos Protection Plan (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan_test.go b/resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan_test.go deleted file mode 100644 index 27a6df418c1..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/id_ddosprotectionplan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ddosprotectionplans - -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 = &DdosProtectionPlanId{} - -func TestNewDdosProtectionPlanID(t *testing.T) { - id := NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue") - - 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.DdosProtectionPlanName != "ddosProtectionPlanValue" { - t.Fatalf("Expected %q but got %q for Segment 'DdosProtectionPlanName'", id.DdosProtectionPlanName, "ddosProtectionPlanValue") - } -} - -func TestFormatDdosProtectionPlanID(t *testing.T) { - actual := NewDdosProtectionPlanID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ddosProtectionPlanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDdosProtectionPlanID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosProtectionPlanId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue", - Expected: &DdosProtectionPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosProtectionPlanName: "ddosProtectionPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosProtectionPlanID(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.DdosProtectionPlanName != v.Expected.DdosProtectionPlanName { - t.Fatalf("Expected %q but got %q for DdosProtectionPlanName", v.Expected.DdosProtectionPlanName, actual.DdosProtectionPlanName) - } - - } -} - -func TestParseDdosProtectionPlanIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DdosProtectionPlanId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoSpRoTeCtIoNpLaNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue", - Expected: &DdosProtectionPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DdosProtectionPlanName: "ddosProtectionPlanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ddosProtectionPlans/ddosProtectionPlanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dDoSpRoTeCtIoNpLaNs/dDoSpRoTeCtIoNpLaNvAlUe", - Expected: &DdosProtectionPlanId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DdosProtectionPlanName: "dDoSpRoTeCtIoNpLaNvAlUe", - }, - }, - { - // 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.nEtWoRk/dDoSpRoTeCtIoNpLaNs/dDoSpRoTeCtIoNpLaNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDdosProtectionPlanIDInsensitively(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.DdosProtectionPlanName != v.Expected.DdosProtectionPlanName { - t.Fatalf("Expected %q but got %q for DdosProtectionPlanName", v.Expected.DdosProtectionPlanName, actual.DdosProtectionPlanName) - } - - } -} - -func TestSegmentsForDdosProtectionPlanId(t *testing.T) { - segments := DdosProtectionPlanId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DdosProtectionPlanId 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/network/2023-06-01/ddosprotectionplans/method_createorupdate.go b/resource-manager/network/2023-06-01/ddosprotectionplans/method_createorupdate.go deleted file mode 100644 index 4cd5100b040..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ddosprotectionplans - -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 *DdosProtectionPlan -} - -// CreateOrUpdate ... -func (c DdosProtectionPlansClient) CreateOrUpdate(ctx context.Context, id DdosProtectionPlanId, input DdosProtectionPlan) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DdosProtectionPlansClient) CreateOrUpdateThenPoll(ctx context.Context, id DdosProtectionPlanId, input DdosProtectionPlan) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/ddosprotectionplans/method_delete.go b/resource-manager/network/2023-06-01/ddosprotectionplans/method_delete.go deleted file mode 100644 index 43d058cf8b8..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ddosprotectionplans - -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 DdosProtectionPlansClient) Delete(ctx context.Context, id DdosProtectionPlanId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 DdosProtectionPlansClient) DeleteThenPoll(ctx context.Context, id DdosProtectionPlanId) 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/network/2023-06-01/ddosprotectionplans/method_get.go b/resource-manager/network/2023-06-01/ddosprotectionplans/method_get.go deleted file mode 100644 index 9003f8a00c3..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package ddosprotectionplans - -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 *DdosProtectionPlan -} - -// Get ... -func (c DdosProtectionPlansClient) Get(ctx context.Context, id DdosProtectionPlanId) (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 DdosProtectionPlan - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/method_list.go b/resource-manager/network/2023-06-01/ddosprotectionplans/method_list.go deleted file mode 100644 index c6116ac3b4a..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package ddosprotectionplans - -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 *[]DdosProtectionPlan -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DdosProtectionPlan -} - -// List ... -func (c DdosProtectionPlansClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ddosProtectionPlans", 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 *[]DdosProtectionPlan `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 DdosProtectionPlansClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DdosProtectionPlanOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DdosProtectionPlansClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DdosProtectionPlanOperationPredicate) (result ListCompleteResult, err error) { - items := make([]DdosProtectionPlan, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/ddosprotectionplans/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/ddosprotectionplans/method_listbyresourcegroup.go deleted file mode 100644 index ae3e8de89b1..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package ddosprotectionplans - -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 *[]DdosProtectionPlan -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []DdosProtectionPlan -} - -// ListByResourceGroup ... -func (c DdosProtectionPlansClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ddosProtectionPlans", 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 *[]DdosProtectionPlan `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 DdosProtectionPlansClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, DdosProtectionPlanOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DdosProtectionPlansClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DdosProtectionPlanOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]DdosProtectionPlan, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/ddosprotectionplans/method_updatetags.go b/resource-manager/network/2023-06-01/ddosprotectionplans/method_updatetags.go deleted file mode 100644 index 07e469082e6..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package ddosprotectionplans - -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 *DdosProtectionPlan -} - -// UpdateTags ... -func (c DdosProtectionPlansClient) UpdateTags(ctx context.Context, id DdosProtectionPlanId, 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 DdosProtectionPlan - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplan.go b/resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplan.go deleted file mode 100644 index 3313192e51b..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplan.go +++ /dev/null @@ -1,14 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosProtectionPlan struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DdosProtectionPlanPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go b/resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go deleted file mode 100644 index b1f0f51665d..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/model_ddosprotectionplanpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosProtectionPlanPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIPAddresses,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - VirtualNetworks *[]SubResource `json:"virtualNetworks,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/model_subresource.go b/resource-manager/network/2023-06-01/ddosprotectionplans/model_subresource.go deleted file mode 100644 index 066803386d8..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ddosprotectionplans/model_tagsobject.go b/resource-manager/network/2023-06-01/ddosprotectionplans/model_tagsobject.go deleted file mode 100644 index 99bf4d851b5..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ddosprotectionplans - -// 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/network/2023-06-01/ddosprotectionplans/predicates.go b/resource-manager/network/2023-06-01/ddosprotectionplans/predicates.go deleted file mode 100644 index 6ad9bbf5374..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package ddosprotectionplans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosProtectionPlanOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p DdosProtectionPlanOperationPredicate) Matches(input DdosProtectionPlan) 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 && (input.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/network/2023-06-01/ddosprotectionplans/version.go b/resource-manager/network/2023-06-01/ddosprotectionplans/version.go deleted file mode 100644 index 8ea850871ab..00000000000 --- a/resource-manager/network/2023-06-01/ddosprotectionplans/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ddosprotectionplans - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ddosprotectionplans/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/README.md b/resource-manager/network/2023-06-01/dscpconfiguration/README.md deleted file mode 100644 index d8a8e6976d0..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/README.md +++ /dev/null @@ -1,65 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/dscpconfiguration` Documentation - -The `dscpconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/dscpconfiguration" -``` - - -### Client Initialization - -```go -client := dscpconfiguration.NewDscpConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DscpConfigurationClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -payload := dscpconfiguration.DscpConfiguration{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `DscpConfigurationClient.Delete` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `DscpConfigurationClient.Get` - -```go -ctx := context.TODO() -id := dscpconfiguration.NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - -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 -} -``` diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/client.go b/resource-manager/network/2023-06-01/dscpconfiguration/client.go deleted file mode 100644 index ed6cfe7aa08..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dscpconfiguration - -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 DscpConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewDscpConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*DscpConfigurationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dscpconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DscpConfigurationClient: %+v", err) - } - - return &DscpConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/constants.go b/resource-manager/network/2023-06-01/dscpconfiguration/constants.go deleted file mode 100644 index fccfd261eb9..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/constants.go +++ /dev/null @@ -1,1213 +0,0 @@ -package dscpconfiguration - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTcp ProtocolType = "Tcp" - ProtocolTypeUdp ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeAh), - string(ProtocolTypeAll), - string(ProtocolTypeDoNotUse), - string(ProtocolTypeEsp), - string(ProtocolTypeGre), - string(ProtocolTypeIcmp), - string(ProtocolTypeTcp), - string(ProtocolTypeUdp), - string(ProtocolTypeVxlan), - } -} - -func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProtocolType(input string) (*ProtocolType, error) { - vals := map[string]ProtocolType{ - "ah": ProtocolTypeAh, - "all": ProtocolTypeAll, - "donotuse": ProtocolTypeDoNotUse, - "esp": ProtocolTypeEsp, - "gre": ProtocolTypeGre, - "icmp": ProtocolTypeIcmp, - "tcp": ProtocolTypeTcp, - "udp": ProtocolTypeUdp, - "vxlan": ProtocolTypeVxlan, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtocolType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration.go deleted file mode 100644 index 8eb56f33d98..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -package dscpconfiguration - -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(&DscpConfigurationId{}) -} - -var _ resourceids.ResourceId = &DscpConfigurationId{} - -// DscpConfigurationId is a struct representing the Resource ID for a Dscp Configuration -type DscpConfigurationId struct { - SubscriptionId string - ResourceGroupName string - DscpConfigurationName string -} - -// NewDscpConfigurationID returns a new DscpConfigurationId struct -func NewDscpConfigurationID(subscriptionId string, resourceGroupName string, dscpConfigurationName string) DscpConfigurationId { - return DscpConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - DscpConfigurationName: dscpConfigurationName, - } -} - -// ParseDscpConfigurationID parses 'input' into a DscpConfigurationId -func ParseDscpConfigurationID(input string) (*DscpConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&DscpConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DscpConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDscpConfigurationIDInsensitively parses 'input' case-insensitively into a DscpConfigurationId -// note: this method should only be used for API response data and not user input -func ParseDscpConfigurationIDInsensitively(input string) (*DscpConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&DscpConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DscpConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DscpConfigurationId) 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.DscpConfigurationName, ok = input.Parsed["dscpConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dscpConfigurationName", input) - } - - return nil -} - -// ValidateDscpConfigurationID checks that 'input' can be parsed as a Dscp Configuration ID -func ValidateDscpConfigurationID(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 := ParseDscpConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Dscp Configuration ID -func (id DscpConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/dscpConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DscpConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Dscp Configuration ID -func (id DscpConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticDscpConfigurations", "dscpConfigurations", "dscpConfigurations"), - resourceids.UserSpecifiedSegment("dscpConfigurationName", "dscpConfigurationValue"), - } -} - -// String returns a human-readable description of this Dscp Configuration ID -func (id DscpConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Dscp Configuration Name: %q", id.DscpConfigurationName), - } - return fmt.Sprintf("Dscp Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration_test.go b/resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration_test.go deleted file mode 100644 index c30eb45fbe9..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/id_dscpconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package dscpconfiguration - -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 = &DscpConfigurationId{} - -func TestNewDscpConfigurationID(t *testing.T) { - id := NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue") - - 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.DscpConfigurationName != "dscpConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'DscpConfigurationName'", id.DscpConfigurationName, "dscpConfigurationValue") - } -} - -func TestFormatDscpConfigurationID(t *testing.T) { - actual := NewDscpConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "dscpConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDscpConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DscpConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue", - Expected: &DscpConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DscpConfigurationName: "dscpConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDscpConfigurationID(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.DscpConfigurationName != v.Expected.DscpConfigurationName { - t.Fatalf("Expected %q but got %q for DscpConfigurationName", v.Expected.DscpConfigurationName, actual.DscpConfigurationName) - } - - } -} - -func TestParseDscpConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DscpConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dScPcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue", - Expected: &DscpConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - DscpConfigurationName: "dscpConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/dscpConfigurations/dscpConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/dScPcOnFiGuRaTiOnS/dScPcOnFiGuRaTiOnVaLuE", - Expected: &DscpConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - DscpConfigurationName: "dScPcOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/dScPcOnFiGuRaTiOnS/dScPcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDscpConfigurationIDInsensitively(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.DscpConfigurationName != v.Expected.DscpConfigurationName { - t.Fatalf("Expected %q but got %q for DscpConfigurationName", v.Expected.DscpConfigurationName, actual.DscpConfigurationName) - } - - } -} - -func TestSegmentsForDscpConfigurationId(t *testing.T) { - segments := DscpConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DscpConfigurationId 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/network/2023-06-01/dscpconfiguration/method_createorupdate.go b/resource-manager/network/2023-06-01/dscpconfiguration/method_createorupdate.go deleted file mode 100644 index e2262349c4f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package dscpconfiguration - -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 *DscpConfiguration -} - -// CreateOrUpdate ... -func (c DscpConfigurationClient) CreateOrUpdate(ctx context.Context, id DscpConfigurationId, input DscpConfiguration) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c DscpConfigurationClient) CreateOrUpdateThenPoll(ctx context.Context, id DscpConfigurationId, input DscpConfiguration) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/dscpconfiguration/method_delete.go b/resource-manager/network/2023-06-01/dscpconfiguration/method_delete.go deleted file mode 100644 index 85639c01f9b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package dscpconfiguration - -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 DscpConfigurationClient) Delete(ctx context.Context, id DscpConfigurationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 DscpConfigurationClient) DeleteThenPoll(ctx context.Context, id DscpConfigurationId) 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/network/2023-06-01/dscpconfiguration/method_get.go b/resource-manager/network/2023-06-01/dscpconfiguration/method_get.go deleted file mode 100644 index 1563a9b978b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package dscpconfiguration - -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 *DscpConfiguration -} - -// Get ... -func (c DscpConfigurationClient) Get(ctx context.Context, id DscpConfigurationId) (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 DscpConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 440846baae7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 663b98879ff..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 5070a712a0c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfiguration.go deleted file mode 100644 index a3ca72a1804..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 2072ac671c8..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygroup.go deleted file mode 100644 index 067b344a691..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 4a7009c2a6b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspool.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspool.go deleted file mode 100644 index fdc704e5a94..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 8bbfd2e47e3..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 2a2e974962b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_ddossettings.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_ddossettings.go deleted file mode 100644 index dca2e7cd55f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_delegation.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_delegation.go deleted file mode 100644 index 8c1fa9b43c0..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfiguration.go deleted file mode 100644 index 04e403de3a4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DscpConfigurationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go deleted file mode 100644 index 97130781ef7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_dscpconfigurationpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfigurationPropertiesFormat struct { - AssociatedNetworkInterfaces *[]NetworkInterface `json:"associatedNetworkInterfaces,omitempty"` - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - QosCollectionId *string `json:"qosCollectionId,omitempty"` - QosDefinitionCollection *[]QosDefinition `json:"qosDefinitionCollection,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlog.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlog.go deleted file mode 100644 index f4d7ea329fc..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogformatparameters.go deleted file mode 100644 index f759162156c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogpropertiesformat.go deleted file mode 100644 index 71ebfa45fde..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfiguration.go deleted file mode 100644 index e5b91931aa4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfiguration - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index cc67d340130..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index c498ae3b999..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrule.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrule.go deleted file mode 100644 index cae42b6f078..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 6ee4c243e27..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfiguration.go deleted file mode 100644 index b79aa52af20..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofile.go deleted file mode 100644 index 51858f8645f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1a288ffd425..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 1c2988eec98..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_iptag.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_iptag.go deleted file mode 100644 index f54e708d614..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// 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/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddress.go deleted file mode 100644 index cf9e4a0b97f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index f1b9e0732ac..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_natgateway.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_natgateway.go deleted file mode 100644 index bd2135c7219..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package dscpconfiguration - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaypropertiesformat.go deleted file mode 100644 index a748c883e51..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaysku.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaysku.go deleted file mode 100644 index 38065785ee7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_natruleportmapping.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_natruleportmapping.go deleted file mode 100644 index 4f0a40c3c84..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterface.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterface.go deleted file mode 100644 index 2c8dff0b372..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacednssettings.go deleted file mode 100644 index db01e0a6931..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfiguration.go deleted file mode 100644 index cbe1f2ef1bc..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 1901cc2fecb..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 235a6d0bfc4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacepropertiesformat.go deleted file mode 100644 index d01f01f77fa..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 9141e163666..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index b1504509e4c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygroup.go deleted file mode 100644 index 79ddb5537a1..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 76177bde258..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpoint.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpoint.go deleted file mode 100644 index b8b7f950b24..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnection.go deleted file mode 100644 index f374ac95239..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/dscpconfiguration/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnectionproperties.go deleted file mode 100644 index a3590daea44..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfiguration.go deleted file mode 100644 index d15e9404362..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index fbd74e39c9c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointproperties.go deleted file mode 100644 index 9bddc7a4349..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkservice.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkservice.go deleted file mode 100644 index 3f4dea0d52f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnection.go deleted file mode 100644 index ca5cf780e20..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 7fa3b795937..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 003e73140c9..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 1a98c978c4e..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 298e27cde46..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceproperties.go deleted file mode 100644 index 1852ce3fa31..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddress.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddress.go deleted file mode 100644 index d57ce42d098..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package dscpconfiguration - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddressdnssettings.go deleted file mode 100644 index 9c3cb7a4ffe..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 2745ba7952e..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresssku.go deleted file mode 100644 index 184f29e9bf9..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_qosdefinition.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_qosdefinition.go deleted file mode 100644 index ad3c5e88a17..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_qosdefinition.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosDefinition struct { - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_qosiprange.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_qosiprange.go deleted file mode 100644 index 9de17d31fd5..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_qosiprange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosIPRange struct { - EndIP *string `json:"endIP,omitempty"` - StartIP *string `json:"startIP,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_qosportrange.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_qosportrange.go deleted file mode 100644 index fec0d277115..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_qosportrange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosPortRange struct { - End *int64 `json:"end,omitempty"` - Start *int64 `json:"start,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlink.go deleted file mode 100644 index e5b6bc9921c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlinkformat.go deleted file mode 100644 index 7119a8ad8fd..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_resourceset.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_resourceset.go deleted file mode 100644 index eb8146e0601..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_retentionpolicyparameters.go deleted file mode 100644 index 73bc84cb5f0..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_route.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_route.go deleted file mode 100644 index 43d479a10b9..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_routepropertiesformat.go deleted file mode 100644 index f0ba5752c84..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_routetable.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_routetable.go deleted file mode 100644 index ffa38a33f5c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_routetablepropertiesformat.go deleted file mode 100644 index f2d7db2da04..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_securityrule.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_securityrule.go deleted file mode 100644 index 670a04f125b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_securityrulepropertiesformat.go deleted file mode 100644 index 313bad92221..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlink.go deleted file mode 100644 index 51b7b88b0b4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index e74136ad481..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_servicedelegationpropertiesformat.go deleted file mode 100644 index ee33b9b67db..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicy.go deleted file mode 100644 index a4c7c550a6c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinition.go deleted file mode 100644 index d902694b0cc..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index acf884117e3..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 94a2649c90d..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 638a6d73f52..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_subnet.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_subnet.go deleted file mode 100644 index 0c94d71385f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_subnetpropertiesformat.go deleted file mode 100644 index bce567b1018..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_subresource.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_subresource.go deleted file mode 100644 index 16bee506d8d..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 84d2f9e07a1..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsproperties.go deleted file mode 100644 index a1e61262ce4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktap.go deleted file mode 100644 index 6b0b8a746c6..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index cbbb01641bc..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfiguration/version.go b/resource-manager/network/2023-06-01/dscpconfiguration/version.go deleted file mode 100644 index e6aef703886..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/README.md b/resource-manager/network/2023-06-01/dscpconfigurations/README.md deleted file mode 100644 index 99f8f6a1399..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/dscpconfigurations` Documentation - -The `dscpconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/dscpconfigurations" -``` - - -### Client Initialization - -```go -client := dscpconfigurations.NewDscpConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DscpConfigurationsClient.DscpConfigurationList` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.DscpConfigurationList(ctx, id)` can be used to do batched pagination -items, err := client.DscpConfigurationListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `DscpConfigurationsClient.DscpConfigurationListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.DscpConfigurationListAll(ctx, id)` can be used to do batched pagination -items, err := client.DscpConfigurationListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/client.go b/resource-manager/network/2023-06-01/dscpconfigurations/client.go deleted file mode 100644 index ef38b8d0533..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dscpconfigurations - -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 DscpConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewDscpConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*DscpConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dscpconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DscpConfigurationsClient: %+v", err) - } - - return &DscpConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/constants.go b/resource-manager/network/2023-06-01/dscpconfigurations/constants.go deleted file mode 100644 index fa8c7e737d7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/constants.go +++ /dev/null @@ -1,1213 +0,0 @@ -package dscpconfigurations - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProtocolType string - -const ( - ProtocolTypeAh ProtocolType = "Ah" - ProtocolTypeAll ProtocolType = "All" - ProtocolTypeDoNotUse ProtocolType = "DoNotUse" - ProtocolTypeEsp ProtocolType = "Esp" - ProtocolTypeGre ProtocolType = "Gre" - ProtocolTypeIcmp ProtocolType = "Icmp" - ProtocolTypeTcp ProtocolType = "Tcp" - ProtocolTypeUdp ProtocolType = "Udp" - ProtocolTypeVxlan ProtocolType = "Vxlan" -) - -func PossibleValuesForProtocolType() []string { - return []string{ - string(ProtocolTypeAh), - string(ProtocolTypeAll), - string(ProtocolTypeDoNotUse), - string(ProtocolTypeEsp), - string(ProtocolTypeGre), - string(ProtocolTypeIcmp), - string(ProtocolTypeTcp), - string(ProtocolTypeUdp), - string(ProtocolTypeVxlan), - } -} - -func (s *ProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProtocolType(input string) (*ProtocolType, error) { - vals := map[string]ProtocolType{ - "ah": ProtocolTypeAh, - "all": ProtocolTypeAll, - "donotuse": ProtocolTypeDoNotUse, - "esp": ProtocolTypeEsp, - "gre": ProtocolTypeGre, - "icmp": ProtocolTypeIcmp, - "tcp": ProtocolTypeTcp, - "udp": ProtocolTypeUdp, - "vxlan": ProtocolTypeVxlan, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtocolType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlist.go b/resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlist.go deleted file mode 100644 index da4c9e46617..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlist.go +++ /dev/null @@ -1,92 +0,0 @@ -package dscpconfigurations - -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 DscpConfigurationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DscpConfiguration -} - -type DscpConfigurationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DscpConfiguration -} - -// DscpConfigurationList ... -func (c DscpConfigurationsClient) DscpConfigurationList(ctx context.Context, id commonids.ResourceGroupId) (result DscpConfigurationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/dscpConfigurations", 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 *[]DscpConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DscpConfigurationListComplete retrieves all the results into a single object -func (c DscpConfigurationsClient) DscpConfigurationListComplete(ctx context.Context, id commonids.ResourceGroupId) (DscpConfigurationListCompleteResult, error) { - return c.DscpConfigurationListCompleteMatchingPredicate(ctx, id, DscpConfigurationOperationPredicate{}) -} - -// DscpConfigurationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DscpConfigurationsClient) DscpConfigurationListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DscpConfigurationOperationPredicate) (result DscpConfigurationListCompleteResult, err error) { - items := make([]DscpConfiguration, 0) - - resp, err := c.DscpConfigurationList(ctx, id) - if err != nil { - 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 = DscpConfigurationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlistall.go b/resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlistall.go deleted file mode 100644 index d6ea5baccc3..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/method_dscpconfigurationlistall.go +++ /dev/null @@ -1,92 +0,0 @@ -package dscpconfigurations - -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 DscpConfigurationListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]DscpConfiguration -} - -type DscpConfigurationListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []DscpConfiguration -} - -// DscpConfigurationListAll ... -func (c DscpConfigurationsClient) DscpConfigurationListAll(ctx context.Context, id commonids.SubscriptionId) (result DscpConfigurationListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/dscpConfigurations", 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 *[]DscpConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DscpConfigurationListAllComplete retrieves all the results into a single object -func (c DscpConfigurationsClient) DscpConfigurationListAllComplete(ctx context.Context, id commonids.SubscriptionId) (DscpConfigurationListAllCompleteResult, error) { - return c.DscpConfigurationListAllCompleteMatchingPredicate(ctx, id, DscpConfigurationOperationPredicate{}) -} - -// DscpConfigurationListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DscpConfigurationsClient) DscpConfigurationListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DscpConfigurationOperationPredicate) (result DscpConfigurationListAllCompleteResult, err error) { - items := make([]DscpConfiguration, 0) - - resp, err := c.DscpConfigurationListAll(ctx, id) - if err != nil { - 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 = DscpConfigurationListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b7b1e084f2c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 2ee5c1c3577..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index e420a9bdc67..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 1c532c8b751..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 461f708325f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygroup.go deleted file mode 100644 index 7c885418df4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 06db97d0e6f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspool.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspool.go deleted file mode 100644 index 9063fe9528b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 9d15cc6c925..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 29791c2c31f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_ddossettings.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_ddossettings.go deleted file mode 100644 index 0a6ba1cc0f5..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_delegation.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_delegation.go deleted file mode 100644 index 3db69c6181a..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfiguration.go deleted file mode 100644 index addfd61ed3c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DscpConfigurationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go deleted file mode 100644 index 3de3861ee9e..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_dscpconfigurationpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfigurationPropertiesFormat struct { - AssociatedNetworkInterfaces *[]NetworkInterface `json:"associatedNetworkInterfaces,omitempty"` - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - QosCollectionId *string `json:"qosCollectionId,omitempty"` - QosDefinitionCollection *[]QosDefinition `json:"qosDefinitionCollection,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlog.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlog.go deleted file mode 100644 index b06c467c3bc..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogformatparameters.go deleted file mode 100644 index c2ca6492542..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogpropertiesformat.go deleted file mode 100644 index 70fecb2d852..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfiguration.go deleted file mode 100644 index 55b02b251ca..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfigurations - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 04b3e1aafc3..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index fba1a411047..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrule.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrule.go deleted file mode 100644 index b60bfcd7088..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 598cd5d43a5..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfiguration.go deleted file mode 100644 index 2532732b5b2..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofile.go deleted file mode 100644 index ce6d532c39b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index afde579aaa3..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index c5919fd2db3..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_iptag.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_iptag.go deleted file mode 100644 index f38ed9d8c65..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// 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/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddress.go deleted file mode 100644 index 7ad5779c262..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 313080c155c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_natgateway.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_natgateway.go deleted file mode 100644 index 64ee487573f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package dscpconfigurations - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaypropertiesformat.go deleted file mode 100644 index d6a3124790e..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaysku.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaysku.go deleted file mode 100644 index f13dbd3d8fa..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_natruleportmapping.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_natruleportmapping.go deleted file mode 100644 index 4f09709144d..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterface.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterface.go deleted file mode 100644 index 0b5454d16ca..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacednssettings.go deleted file mode 100644 index 11f9a45a307..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfiguration.go deleted file mode 100644 index d4cb1b886b6..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 0b175cf4025..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 483630c9a12..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 1d542c19b57..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 134cf5c3661..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index f77ecd6167d..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygroup.go deleted file mode 100644 index f9ea08d3a85..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 0cac57de47f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpoint.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpoint.go deleted file mode 100644 index 0e5fb891d8c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnection.go deleted file mode 100644 index 64a8a54e559..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/dscpconfigurations/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnectionproperties.go deleted file mode 100644 index b41f2269c5b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfiguration.go deleted file mode 100644 index cee431f3b19..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 8ffd50d3002..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointproperties.go deleted file mode 100644 index b098e9d6023..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkservice.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkservice.go deleted file mode 100644 index 60b183ef94a..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnection.go deleted file mode 100644 index 963c255ab64..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 9f2e27f4720..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 3662d04a08f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index d0932cbb597..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index b471f35042f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceproperties.go deleted file mode 100644 index 0054e8840ee..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddress.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddress.go deleted file mode 100644 index 4fc95713929..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package dscpconfigurations - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddressdnssettings.go deleted file mode 100644 index adee4abe556..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresspropertiesformat.go deleted file mode 100644 index b1758ec95ac..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresssku.go deleted file mode 100644 index a429ae17ad7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_qosdefinition.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_qosdefinition.go deleted file mode 100644 index c578549b24d..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_qosdefinition.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosDefinition struct { - DestinationIPRanges *[]QosIPRange `json:"destinationIpRanges,omitempty"` - DestinationPortRanges *[]QosPortRange `json:"destinationPortRanges,omitempty"` - Markings *[]int64 `json:"markings,omitempty"` - Protocol *ProtocolType `json:"protocol,omitempty"` - SourceIPRanges *[]QosIPRange `json:"sourceIpRanges,omitempty"` - SourcePortRanges *[]QosPortRange `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_qosiprange.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_qosiprange.go deleted file mode 100644 index a7109f45e97..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_qosiprange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosIPRange struct { - EndIP *string `json:"endIP,omitempty"` - StartIP *string `json:"startIP,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_qosportrange.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_qosportrange.go deleted file mode 100644 index 1c241e416d6..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_qosportrange.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QosPortRange struct { - End *int64 `json:"end,omitempty"` - Start *int64 `json:"start,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlink.go deleted file mode 100644 index a441a261d0b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlinkformat.go deleted file mode 100644 index 42c361f9ff9..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_resourceset.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_resourceset.go deleted file mode 100644 index 36c2929fe5c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_retentionpolicyparameters.go deleted file mode 100644 index 6cb1197a4d8..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_route.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_route.go deleted file mode 100644 index 58b9462885c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_routepropertiesformat.go deleted file mode 100644 index 57d611a55aa..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_routetable.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_routetable.go deleted file mode 100644 index 3c19f2937d7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_routetablepropertiesformat.go deleted file mode 100644 index 8d9f9c65d1c..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_securityrule.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_securityrule.go deleted file mode 100644 index eefb302d3d0..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_securityrulepropertiesformat.go deleted file mode 100644 index d43f1f5f3b1..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlink.go deleted file mode 100644 index e968a6667b0..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 3756e4aca2b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 4576bcc01d0..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicy.go deleted file mode 100644 index e1bf0604459..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 9693e4de6b7..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index c277cb3ff86..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 31009213cca..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpropertiesformat.go deleted file mode 100644 index a134bda64bd..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_subnet.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_subnet.go deleted file mode 100644 index 6c58caf5de4..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_subnetpropertiesformat.go deleted file mode 100644 index c9f490d17cd..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_subresource.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_subresource.go deleted file mode 100644 index f4f23a8234b..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index f9dd4dab77f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsproperties.go deleted file mode 100644 index 6e509b308b5..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktap.go deleted file mode 100644 index ae0f9ad6412..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index bc1c19bd39f..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/dscpconfigurations/predicates.go b/resource-manager/network/2023-06-01/dscpconfigurations/predicates.go deleted file mode 100644 index 7628df6beb6..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package dscpconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DscpConfigurationOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p DscpConfigurationOperationPredicate) Matches(input DscpConfiguration) 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 && (input.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/network/2023-06-01/dscpconfigurations/version.go b/resource-manager/network/2023-06-01/dscpconfigurations/version.go deleted file mode 100644 index 8a90a193807..00000000000 --- a/resource-manager/network/2023-06-01/dscpconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dscpconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dscpconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/endpointservices/README.md b/resource-manager/network/2023-06-01/endpointservices/README.md deleted file mode 100644 index a52df9dbc3c..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/endpointservices` Documentation - -The `endpointservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/endpointservices" -``` - - -### Client Initialization - -```go -client := endpointservices.NewEndpointServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EndpointServicesClient.AvailableEndpointServicesList` - -```go -ctx := context.TODO() -id := endpointservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailableEndpointServicesList(ctx, id)` can be used to do batched pagination -items, err := client.AvailableEndpointServicesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/endpointservices/client.go b/resource-manager/network/2023-06-01/endpointservices/client.go deleted file mode 100644 index c04faa1ffd8..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package endpointservices - -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 EndpointServicesClient struct { - Client *resourcemanager.Client -} - -func NewEndpointServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*EndpointServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "endpointservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EndpointServicesClient: %+v", err) - } - - return &EndpointServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/endpointservices/id_location.go b/resource-manager/network/2023-06-01/endpointservices/id_location.go deleted file mode 100644 index b3f9df03861..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package endpointservices - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/endpointservices/id_location_test.go b/resource-manager/network/2023-06-01/endpointservices/id_location_test.go deleted file mode 100644 index 3d471721e64..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package endpointservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/endpointservices/method_availableendpointserviceslist.go b/resource-manager/network/2023-06-01/endpointservices/method_availableendpointserviceslist.go deleted file mode 100644 index 5122506c25f..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/method_availableendpointserviceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package endpointservices - -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 AvailableEndpointServicesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]EndpointServiceResult -} - -type AvailableEndpointServicesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EndpointServiceResult -} - -// AvailableEndpointServicesList ... -func (c EndpointServicesClient) AvailableEndpointServicesList(ctx context.Context, id LocationId) (result AvailableEndpointServicesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualNetworkAvailableEndpointServices", 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 *[]EndpointServiceResult `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailableEndpointServicesListComplete retrieves all the results into a single object -func (c EndpointServicesClient) AvailableEndpointServicesListComplete(ctx context.Context, id LocationId) (AvailableEndpointServicesListCompleteResult, error) { - return c.AvailableEndpointServicesListCompleteMatchingPredicate(ctx, id, EndpointServiceResultOperationPredicate{}) -} - -// AvailableEndpointServicesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EndpointServicesClient) AvailableEndpointServicesListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate EndpointServiceResultOperationPredicate) (result AvailableEndpointServicesListCompleteResult, err error) { - items := make([]EndpointServiceResult, 0) - - resp, err := c.AvailableEndpointServicesList(ctx, id) - if err != nil { - 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 = AvailableEndpointServicesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/endpointservices/model_endpointserviceresult.go b/resource-manager/network/2023-06-01/endpointservices/model_endpointserviceresult.go deleted file mode 100644 index eae6c698d45..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/model_endpointserviceresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package endpointservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointServiceResult struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/endpointservices/predicates.go b/resource-manager/network/2023-06-01/endpointservices/predicates.go deleted file mode 100644 index 9a5ec06a288..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package endpointservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EndpointServiceResultOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EndpointServiceResultOperationPredicate) Matches(input EndpointServiceResult) 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/network/2023-06-01/endpointservices/version.go b/resource-manager/network/2023-06-01/endpointservices/version.go deleted file mode 100644 index 9433f334c9b..00000000000 --- a/resource-manager/network/2023-06-01/endpointservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package endpointservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/endpointservices/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/README.md b/resource-manager/network/2023-06-01/expressroutecircuitarptable/README.md deleted file mode 100644 index c6377a8210c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitarptable` Documentation - -The `expressroutecircuitarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitarptable" -``` - - -### Client Initialization - -```go -client := expressroutecircuitarptable.NewExpressRouteCircuitArpTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitArpTableClient.ExpressRouteCircuitsListArpTable` - -```go -ctx := context.TODO() -id := expressroutecircuitarptable.NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue") - -// alternatively `client.ExpressRouteCircuitsListArpTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListArpTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/client.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/client.go deleted file mode 100644 index a927b3e2a41..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitarptable - -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 ExpressRouteCircuitArpTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitArpTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitArpTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitarptable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitArpTableClient: %+v", err) - } - - return &ExpressRouteCircuitArpTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable.go deleted file mode 100644 index c01410283c1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitarptable - -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(&ArpTableId{}) -} - -var _ resourceids.ResourceId = &ArpTableId{} - -// ArpTableId is a struct representing the Resource ID for a Arp Table -type ArpTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - ArpTableName string -} - -// NewArpTableID returns a new ArpTableId struct -func NewArpTableID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, arpTableName string) ArpTableId { - return ArpTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - ArpTableName: arpTableName, - } -} - -// ParseArpTableID parses 'input' into a ArpTableId -func ParseArpTableID(input string) (*ArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArpTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseArpTableIDInsensitively parses 'input' case-insensitively into a ArpTableId -// note: this method should only be used for API response data and not user input -func ParseArpTableIDInsensitively(input string) (*ArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ArpTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ArpTableId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.ArpTableName, ok = input.Parsed["arpTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arpTableName", input) - } - - return nil -} - -// ValidateArpTableID checks that 'input' can be parsed as a Arp Table ID -func ValidateArpTableID(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 := ParseArpTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Arp Table ID -func (id ArpTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/arpTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.ArpTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Arp Table ID -func (id ArpTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "arpTableValue"), - } -} - -// String returns a human-readable description of this Arp Table ID -func (id ArpTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Arp Table Name: %q", id.ArpTableName), - } - return fmt.Sprintf("Arp Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable_test.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable_test.go deleted file mode 100644 index 1221091045b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/id_arptable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitarptable - -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 = &ArpTableId{} - -func TestNewArpTableID(t *testing.T) { - id := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.ArpTableName != "arpTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableValue") - } -} - -func TestFormatArpTableID(t *testing.T) { - actual := NewArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "arpTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseArpTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &ArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArpTableID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestParseArpTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &ArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe", - Expected: &ArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - ArpTableName: "aRpTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseArpTableIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestSegmentsForArpTableId(t *testing.T) { - segments := ArpTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ArpTableId 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/network/2023-06-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go deleted file mode 100644 index 6e9e9491ca8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/method_expressroutecircuitslistarptable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitarptable - -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 ExpressRouteCircuitsListArpTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitArpTable -} - -type ExpressRouteCircuitsListArpTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitArpTable -} - -// ExpressRouteCircuitsListArpTable ... -func (c ExpressRouteCircuitArpTableClient) ExpressRouteCircuitsListArpTable(ctx context.Context, id ArpTableId) (result ExpressRouteCircuitsListArpTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCircuitsListArpTableThenPoll performs ExpressRouteCircuitsListArpTable then polls until it's completed -func (c ExpressRouteCircuitArpTableClient) ExpressRouteCircuitsListArpTableThenPoll(ctx context.Context, id ArpTableId) error { - result, err := c.ExpressRouteCircuitsListArpTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCircuitsListArpTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCircuitsListArpTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go deleted file mode 100644 index 8b4183dd49f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/model_expressroutecircuitarptable.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuitarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTable struct { - Age *int64 `json:"age,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - Interface *string `json:"interface,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/predicates.go deleted file mode 100644 index 4143b82875f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTableOperationPredicate struct { - Age *int64 - IPAddress *string - Interface *string - MacAddress *string -} - -func (p ExpressRouteCircuitArpTableOperationPredicate) Matches(input ExpressRouteCircuitArpTable) bool { - - if p.Age != nil && (input.Age == nil || *p.Age != *input.Age) { - return false - } - - if p.IPAddress != nil && (input.IPAddress == nil || *p.IPAddress != *input.IPAddress) { - return false - } - - if p.Interface != nil && (input.Interface == nil || *p.Interface != *input.Interface) { - return false - } - - if p.MacAddress != nil && (input.MacAddress == nil || *p.MacAddress != *input.MacAddress) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitarptable/version.go b/resource-manager/network/2023-06-01/expressroutecircuitarptable/version.go deleted file mode 100644 index 5bb99e55bad..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitarptable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitarptable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitarptable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/README.md b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/README.md deleted file mode 100644 index d1065f5e05e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitauthorizations` Documentation - -The `expressroutecircuitauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitauthorizations" -``` - - -### Client Initialization - -```go -client := expressroutecircuitauthorizations.NewExpressRouteCircuitAuthorizationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -payload := expressroutecircuitauthorizations.ExpressRouteCircuitAuthorization{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitAuthorizationsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - -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: `ExpressRouteCircuitAuthorizationsClient.List` - -```go -ctx := context.TODO() -id := expressroutecircuitauthorizations.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -// 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/network/2023-06-01/expressroutecircuitauthorizations/client.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/client.go deleted file mode 100644 index 8060a80be1e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitauthorizations - -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 ExpressRouteCircuitAuthorizationsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitAuthorizationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitAuthorizationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitauthorizations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitAuthorizationsClient: %+v", err) - } - - return &ExpressRouteCircuitAuthorizationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/constants.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/constants.go deleted file mode 100644 index 052d235a64f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressroutecircuitauthorizations - -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 AuthorizationUseStatus string - -const ( - AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" -) - -func PossibleValuesForAuthorizationUseStatus() []string { - return []string{ - string(AuthorizationUseStatusAvailable), - string(AuthorizationUseStatusInUse), - } -} - -func (s *AuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthorizationUseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthorizationUseStatus(input string) (*AuthorizationUseStatus, error) { - vals := map[string]AuthorizationUseStatus{ - "available": AuthorizationUseStatusAvailable, - "inuse": AuthorizationUseStatusInUse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthorizationUseStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization.go deleted file mode 100644 index b659c5a5b8c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressroutecircuitauthorizations - -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(&AuthorizationId{}) -} - -var _ resourceids.ResourceId = &AuthorizationId{} - -// AuthorizationId is a struct representing the Resource ID for a Authorization -type AuthorizationId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - AuthorizationName string -} - -// NewAuthorizationID returns a new AuthorizationId struct -func NewAuthorizationID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, authorizationName string) AuthorizationId { - return AuthorizationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - AuthorizationName: authorizationName, - } -} - -// ParseAuthorizationID parses 'input' into a AuthorizationId -func ParseAuthorizationID(input string) (*AuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&AuthorizationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAuthorizationIDInsensitively parses 'input' case-insensitively into a AuthorizationId -// note: this method should only be used for API response data and not user input -func ParseAuthorizationIDInsensitively(input string) (*AuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&AuthorizationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AuthorizationId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.AuthorizationName, ok = input.Parsed["authorizationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "authorizationName", input) - } - - return nil -} - -// ValidateAuthorizationID checks that 'input' can be parsed as a Authorization ID -func ValidateAuthorizationID(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 := ParseAuthorizationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Authorization ID -func (id AuthorizationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/authorizations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.AuthorizationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Authorization ID -func (id AuthorizationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), - resourceids.UserSpecifiedSegment("authorizationName", "authorizationValue"), - } -} - -// String returns a human-readable description of this Authorization ID -func (id AuthorizationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Authorization Name: %q", id.AuthorizationName), - } - return fmt.Sprintf("Authorization (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization_test.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization_test.go deleted file mode 100644 index 1f61685e6e4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_authorization_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressroutecircuitauthorizations - -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 = &AuthorizationId{} - -func TestNewAuthorizationID(t *testing.T) { - id := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.AuthorizationName != "authorizationValue" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationName'", id.AuthorizationName, "authorizationValue") - } -} - -func TestFormatAuthorizationID(t *testing.T) { - actual := NewAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "authorizationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAuthorizationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue", - Expected: &AuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAuthorizationID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestParseAuthorizationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/aUtHoRiZaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue", - Expected: &AuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/authorizations/authorizationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE", - Expected: &AuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - AuthorizationName: "aUtHoRiZaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAuthorizationIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestSegmentsForAuthorizationId(t *testing.T) { - segments := AuthorizationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AuthorizationId 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/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit.go deleted file mode 100644 index a46fa52bf5d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuitauthorizations - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go deleted file mode 100644 index d174a2ea14b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuitauthorizations - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-06-01/expressroutecircuitauthorizations/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_createorupdate.go deleted file mode 100644 index 5fe3d709320..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecircuitauthorizations - -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 *ExpressRouteCircuitAuthorization -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitAuthorizationsClient) CreateOrUpdate(ctx context.Context, id AuthorizationId, input ExpressRouteCircuitAuthorization) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitAuthorizationsClient) CreateOrUpdateThenPoll(ctx context.Context, id AuthorizationId, input ExpressRouteCircuitAuthorization) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutecircuitauthorizations/method_delete.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_delete.go deleted file mode 100644 index b2c01bb7f11..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecircuitauthorizations - -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 ExpressRouteCircuitAuthorizationsClient) Delete(ctx context.Context, id AuthorizationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitAuthorizationsClient) DeleteThenPoll(ctx context.Context, id AuthorizationId) 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/network/2023-06-01/expressroutecircuitauthorizations/method_get.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_get.go deleted file mode 100644 index 19e783a8675..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecircuitauthorizations - -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 *ExpressRouteCircuitAuthorization -} - -// Get ... -func (c ExpressRouteCircuitAuthorizationsClient) Get(ctx context.Context, id AuthorizationId) (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 ExpressRouteCircuitAuthorization - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_list.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_list.go deleted file mode 100644 index 41207f1453f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutecircuitauthorizations - -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 *[]ExpressRouteCircuitAuthorization -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitAuthorization -} - -// List ... -func (c ExpressRouteCircuitAuthorizationsClient) List(ctx context.Context, id ExpressRouteCircuitId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/authorizations", 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 *[]ExpressRouteCircuitAuthorization `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 ExpressRouteCircuitAuthorizationsClient) ListComplete(ctx context.Context, id ExpressRouteCircuitId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitAuthorizationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitAuthorizationsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCircuitId, predicate ExpressRouteCircuitAuthorizationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuitAuthorization, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go deleted file mode 100644 index e3d3f2bdb8d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_authorizationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuitauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthorizationPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go deleted file mode 100644 index b4b084362fc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/model_expressroutecircuitauthorization.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitAuthorization struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/predicates.go deleted file mode 100644 index 3533e80a13e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitAuthorizationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitAuthorizationOperationPredicate) Matches(input ExpressRouteCircuitAuthorization) 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.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/network/2023-06-01/expressroutecircuitauthorizations/version.go b/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/version.go deleted file mode 100644 index 147f872ae83..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitauthorizations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitauthorizations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitauthorizations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/README.md b/resource-manager/network/2023-06-01/expressroutecircuitconnections/README.md deleted file mode 100644 index eb0eb9c345f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitconnections` Documentation - -The `expressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitconnections" -``` - - -### Client Initialization - -```go -client := expressroutecircuitconnections.NewExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -payload := expressroutecircuitconnections.ExpressRouteCircuitConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuitconnections.NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - -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: `ExpressRouteCircuitConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -// 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/network/2023-06-01/expressroutecircuitconnections/client.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/client.go deleted file mode 100644 index 333eff0e189..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitconnections - -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 ExpressRouteCircuitConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitConnectionsClient: %+v", err) - } - - return &ExpressRouteCircuitConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/constants.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/constants.go deleted file mode 100644 index 8bfeb3344f9..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package expressroutecircuitconnections - -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 CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection.go deleted file mode 100644 index 0e2e6d6c894..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitconnections - -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(&PeeringConnectionId{}) -} - -var _ resourceids.ResourceId = &PeeringConnectionId{} - -// PeeringConnectionId is a struct representing the Resource ID for a Peering Connection -type PeeringConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - ConnectionName string -} - -// NewPeeringConnectionID returns a new PeeringConnectionId struct -func NewPeeringConnectionID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, connectionName string) PeeringConnectionId { - return PeeringConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - ConnectionName: connectionName, - } -} - -// ParsePeeringConnectionID parses 'input' into a PeeringConnectionId -func ParsePeeringConnectionID(input string) (*PeeringConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringConnectionIDInsensitively parses 'input' case-insensitively into a PeeringConnectionId -// note: this method should only be used for API response data and not user input -func ParsePeeringConnectionIDInsensitively(input string) (*PeeringConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringConnectionId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.ConnectionName, ok = input.Parsed["connectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionName", input) - } - - return nil -} - -// ValidatePeeringConnectionID checks that 'input' can be parsed as a Peering Connection ID -func ValidatePeeringConnectionID(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 := ParsePeeringConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Connection ID -func (id PeeringConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/connections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.ConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Connection ID -func (id PeeringConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), - } -} - -// String returns a human-readable description of this Peering Connection ID -func (id PeeringConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Connection Name: %q", id.ConnectionName), - } - return fmt.Sprintf("Peering Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection_test.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection_test.go deleted file mode 100644 index 4a132672fdf..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/id_peeringconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitconnections - -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 = &PeeringConnectionId{} - -func TestNewPeeringConnectionID(t *testing.T) { - id := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.ConnectionName != "connectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionValue") - } -} - -func TestFormatPeeringConnectionID(t *testing.T) { - actual := NewPeeringConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "connectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue", - Expected: &PeeringConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringConnectionID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestParsePeeringConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/cOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue", - Expected: &PeeringConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/connections/connectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/cOnNeCtIoNs/cOnNeCtIoNvAlUe", - Expected: &PeeringConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - ConnectionName: "cOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/cOnNeCtIoNs/cOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringConnectionIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestSegmentsForPeeringConnectionId(t *testing.T) { - segments := PeeringConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringConnectionId 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/network/2023-06-01/expressroutecircuitconnections/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_createorupdate.go deleted file mode 100644 index 25bb50bd1b3..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecircuitconnections - -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 *ExpressRouteCircuitConnection -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitConnectionsClient) CreateOrUpdate(ctx context.Context, id PeeringConnectionId, input ExpressRouteCircuitConnection) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id PeeringConnectionId, input ExpressRouteCircuitConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutecircuitconnections/method_delete.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_delete.go deleted file mode 100644 index 1d813338ead..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecircuitconnections - -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 ExpressRouteCircuitConnectionsClient) Delete(ctx context.Context, id PeeringConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitConnectionsClient) DeleteThenPoll(ctx context.Context, id PeeringConnectionId) 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/network/2023-06-01/expressroutecircuitconnections/method_get.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_get.go deleted file mode 100644 index 0a4a18dd7cc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecircuitconnections - -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 *ExpressRouteCircuitConnection -} - -// Get ... -func (c ExpressRouteCircuitConnectionsClient) Get(ctx context.Context, id PeeringConnectionId) (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 ExpressRouteCircuitConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_list.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_list.go deleted file mode 100644 index a87f7d44ffe..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecircuitconnections - -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 *[]ExpressRouteCircuitConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitConnection -} - -// List ... -func (c ExpressRouteCircuitConnectionsClient) List(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connections", 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 *[]ExpressRouteCircuitConnection `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 ExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, predicate ExpressRouteCircuitConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuitConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go deleted file mode 100644 index 689bf9a8e12..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index a1bf981acf3..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index 580b8a8dcd7..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_subresource.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_subresource.go deleted file mode 100644 index d6673ed96dc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitconnections/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/predicates.go deleted file mode 100644 index 6c65b4df05d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitConnectionOperationPredicate) Matches(input ExpressRouteCircuitConnection) 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.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/network/2023-06-01/expressroutecircuitconnections/version.go b/resource-manager/network/2023-06-01/expressroutecircuitconnections/version.go deleted file mode 100644 index e856aa53cc0..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/README.md b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/README.md deleted file mode 100644 index a8f810304f5..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitpeerings` Documentation - -The `expressroutecircuitpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitpeerings" -``` - - -### Client Initialization - -```go -client := expressroutecircuitpeerings.NewExpressRouteCircuitPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -payload := expressroutecircuitpeerings.ExpressRouteCircuitPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitPeeringsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -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: `ExpressRouteCircuitPeeringsClient.List` - -```go -ctx := context.TODO() -id := expressroutecircuitpeerings.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -// 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/network/2023-06-01/expressroutecircuitpeerings/client.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/client.go deleted file mode 100644 index 63ac4daefad..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitpeerings - -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 ExpressRouteCircuitPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitPeeringsClient: %+v", err) - } - - return &ExpressRouteCircuitPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/constants.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/constants.go deleted file mode 100644 index 98d21da2c70..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/constants.go +++ /dev/null @@ -1,274 +0,0 @@ -package expressroutecircuitpeerings - -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 CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit.go deleted file mode 100644 index 51f74b9a362..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuitpeerings - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go deleted file mode 100644 index 13448a74c27..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuitpeerings - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-06-01/expressroutecircuitpeerings/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_createorupdate.go deleted file mode 100644 index a9056870582..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitpeerings - -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 *ExpressRouteCircuitPeering -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitPeeringsClient) CreateOrUpdate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, input ExpressRouteCircuitPeering) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, input ExpressRouteCircuitPeering) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutecircuitpeerings/method_delete.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_delete.go deleted file mode 100644 index 241c45fa414..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package expressroutecircuitpeerings - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c ExpressRouteCircuitPeeringsClient) Delete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitPeeringsClient) DeleteThenPoll(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) 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/network/2023-06-01/expressroutecircuitpeerings/method_get.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_get.go deleted file mode 100644 index 0937d0e96a9..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package expressroutecircuitpeerings - -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 *ExpressRouteCircuitPeering -} - -// Get ... -func (c ExpressRouteCircuitPeeringsClient) Get(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (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 ExpressRouteCircuitPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_list.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_list.go deleted file mode 100644 index fc141f435cc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutecircuitpeerings - -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 *[]ExpressRouteCircuitPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitPeering -} - -// List ... -func (c ExpressRouteCircuitPeeringsClient) List(ctx context.Context, id ExpressRouteCircuitId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerings", 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 *[]ExpressRouteCircuitPeering `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 ExpressRouteCircuitPeeringsClient) ListComplete(ctx context.Context, id ExpressRouteCircuitId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCircuitId, predicate ExpressRouteCircuitPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuitPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go deleted file mode 100644 index f0bf62174ce..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index f89ab3b51e4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go deleted file mode 100644 index 5e47a7f0266..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 67b575213fe..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go deleted file mode 100644 index a54ef389df4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitpeeringpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringPropertiesFormat struct { - AzureASN *int64 `json:"azureASN,omitempty"` - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go deleted file mode 100644 index 8239e6299db..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go deleted file mode 100644 index f06a355d7fa..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_expressrouteconnectionid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index ae00db3c45c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 93ee020eec6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index bc9218f9280..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 72eba9f327f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_subresource.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_subresource.go deleted file mode 100644 index 3143d87b0ee..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/predicates.go deleted file mode 100644 index 1e725c4e63a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecircuitpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitPeeringOperationPredicate) Matches(input ExpressRouteCircuitPeering) 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.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/network/2023-06-01/expressroutecircuitpeerings/version.go b/resource-manager/network/2023-06-01/expressroutecircuitpeerings/version.go deleted file mode 100644 index c2bbbabe84c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/README.md b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/README.md deleted file mode 100644 index d472d570ce1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitroutestable` Documentation - -The `expressroutecircuitroutestable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitroutestable" -``` - - -### Client Initialization - -```go -client := expressroutecircuitroutestable.NewExpressRouteCircuitRoutesTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitRoutesTableClient.ExpressRouteCircuitsListRoutesTable` - -```go -ctx := context.TODO() -id := expressroutecircuitroutestable.NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue") - -// alternatively `client.ExpressRouteCircuitsListRoutesTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListRoutesTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/client.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/client.go deleted file mode 100644 index 925b7f29bae..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitroutestable - -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 ExpressRouteCircuitRoutesTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitRoutesTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitRoutesTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitroutestable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitRoutesTableClient: %+v", err) - } - - return &ExpressRouteCircuitRoutesTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable.go deleted file mode 100644 index 895e343bf35..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitroutestable - -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(&PeeringRouteTableId{}) -} - -var _ resourceids.ResourceId = &PeeringRouteTableId{} - -// PeeringRouteTableId is a struct representing the Resource ID for a Peering Route Table -type PeeringRouteTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - RouteTableName string -} - -// NewPeeringRouteTableID returns a new PeeringRouteTableId struct -func NewPeeringRouteTableID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, routeTableName string) PeeringRouteTableId { - return PeeringRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - RouteTableName: routeTableName, - } -} - -// ParsePeeringRouteTableID parses 'input' into a PeeringRouteTableId -func ParsePeeringRouteTableID(input string) (*PeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringRouteTableIDInsensitively parses 'input' case-insensitively into a PeeringRouteTableId -// note: this method should only be used for API response data and not user input -func ParsePeeringRouteTableIDInsensitively(input string) (*PeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringRouteTableId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidatePeeringRouteTableID checks that 'input' can be parsed as a Peering Route Table ID -func ValidatePeeringRouteTableID(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 := ParsePeeringRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Route Table ID -func (id PeeringRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Route Table ID -func (id PeeringRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Peering Route Table ID -func (id PeeringRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Peering Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable_test.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable_test.go deleted file mode 100644 index d631d27ad1b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/id_peeringroutetable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitroutestable - -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 = &PeeringRouteTableId{} - -func TestNewPeeringRouteTableID(t *testing.T) { - id := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatPeeringRouteTableID(t *testing.T) { - actual := NewPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &PeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTableID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParsePeeringRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &PeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &PeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTableIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForPeeringRouteTableId(t *testing.T) { - segments := PeeringRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringRouteTableId 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/network/2023-06-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go deleted file mode 100644 index 0d55eeb8353..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/method_expressroutecircuitslistroutestable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitroutestable - -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 ExpressRouteCircuitsListRoutesTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitRoutesTable -} - -type ExpressRouteCircuitsListRoutesTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitRoutesTable -} - -// ExpressRouteCircuitsListRoutesTable ... -func (c ExpressRouteCircuitRoutesTableClient) ExpressRouteCircuitsListRoutesTable(ctx context.Context, id PeeringRouteTableId) (result ExpressRouteCircuitsListRoutesTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCircuitsListRoutesTableThenPoll performs ExpressRouteCircuitsListRoutesTable then polls until it's completed -func (c ExpressRouteCircuitRoutesTableClient) ExpressRouteCircuitsListRoutesTableThenPoll(ctx context.Context, id PeeringRouteTableId) error { - result, err := c.ExpressRouteCircuitsListRoutesTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCircuitsListRoutesTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCircuitsListRoutesTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go deleted file mode 100644 index d70d9310d29..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/model_expressroutecircuitroutestable.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTable struct { - LocPrf *string `json:"locPrf,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Path *string `json:"path,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/predicates.go deleted file mode 100644 index 81d29805310..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecircuitroutestable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableOperationPredicate struct { - LocPrf *string - Network *string - NextHop *string - Path *string - Weight *int64 -} - -func (p ExpressRouteCircuitRoutesTableOperationPredicate) Matches(input ExpressRouteCircuitRoutesTable) bool { - - if p.LocPrf != nil && (input.LocPrf == nil || *p.LocPrf != *input.LocPrf) { - return false - } - - if p.Network != nil && (input.Network == nil || *p.Network != *input.Network) { - return false - } - - if p.NextHop != nil && (input.NextHop == nil || *p.NextHop != *input.NextHop) { - return false - } - - if p.Path != nil && (input.Path == nil || *p.Path != *input.Path) { - return false - } - - if p.Weight != nil && (input.Weight == nil || *p.Weight != *input.Weight) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/version.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestable/version.go deleted file mode 100644 index 221a9092814..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/README.md b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/README.md deleted file mode 100644 index 1a3870ac01f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary` Documentation - -The `expressroutecircuitroutestablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitroutestablesummary" -``` - - -### Client Initialization - -```go -client := expressroutecircuitroutestablesummary.NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitRoutesTableSummaryClient.ExpressRouteCircuitsListRoutesTableSummary` - -```go -ctx := context.TODO() -id := expressroutecircuitroutestablesummary.NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue") - -// alternatively `client.ExpressRouteCircuitsListRoutesTableSummary(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCircuitsListRoutesTableSummaryComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/client.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/client.go deleted file mode 100644 index 5565926cb76..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitroutestablesummary - -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 ExpressRouteCircuitRoutesTableSummaryClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitRoutesTableSummaryClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitRoutesTableSummaryClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitroutestablesummary", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitRoutesTableSummaryClient: %+v", err) - } - - return &ExpressRouteCircuitRoutesTableSummaryClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary.go deleted file mode 100644 index 16c5b0c301a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecircuitroutestablesummary - -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(&RouteTablesSummaryId{}) -} - -var _ resourceids.ResourceId = &RouteTablesSummaryId{} - -// RouteTablesSummaryId is a struct representing the Resource ID for a Route Tables Summary -type RouteTablesSummaryId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - RouteTablesSummaryName string -} - -// NewRouteTablesSummaryID returns a new RouteTablesSummaryId struct -func NewRouteTablesSummaryID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, routeTablesSummaryName string) RouteTablesSummaryId { - return RouteTablesSummaryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - RouteTablesSummaryName: routeTablesSummaryName, - } -} - -// ParseRouteTablesSummaryID parses 'input' into a RouteTablesSummaryId -func ParseRouteTablesSummaryID(input string) (*RouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTablesSummaryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteTablesSummaryIDInsensitively parses 'input' case-insensitively into a RouteTablesSummaryId -// note: this method should only be used for API response data and not user input -func ParseRouteTablesSummaryIDInsensitively(input string) (*RouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTablesSummaryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteTablesSummaryId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTablesSummaryName, ok = input.Parsed["routeTablesSummaryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTablesSummaryName", input) - } - - return nil -} - -// ValidateRouteTablesSummaryID checks that 'input' can be parsed as a Route Tables Summary ID -func ValidateRouteTablesSummaryID(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 := ParseRouteTablesSummaryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Tables Summary ID -func (id RouteTablesSummaryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/routeTablesSummary/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.RouteTablesSummaryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Tables Summary ID -func (id RouteTablesSummaryId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryValue"), - } -} - -// String returns a human-readable description of this Route Tables Summary ID -func (id RouteTablesSummaryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Tables Summary Name: %q", id.RouteTablesSummaryName), - } - return fmt.Sprintf("Route Tables Summary (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go deleted file mode 100644 index a011758594c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/id_routetablessummary_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecircuitroutestablesummary - -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 = &RouteTablesSummaryId{} - -func TestNewRouteTablesSummaryID(t *testing.T) { - id := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTablesSummaryName != "routeTablesSummaryValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryValue") - } -} - -func TestFormatRouteTablesSummaryID(t *testing.T) { - actual := NewRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "routeTablesSummaryValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteTablesSummaryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &RouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTablesSummaryID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestParseRouteTablesSummaryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &RouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe", - Expected: &RouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTablesSummaryIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestSegmentsForRouteTablesSummaryId(t *testing.T) { - segments := RouteTablesSummaryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteTablesSummaryId 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/network/2023-06-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go deleted file mode 100644 index 200e1b6b1e8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/method_expressroutecircuitslistroutestablesummary.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecircuitroutestablesummary - -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 ExpressRouteCircuitsListRoutesTableSummaryOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitRoutesTableSummary -} - -type ExpressRouteCircuitsListRoutesTableSummaryCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitRoutesTableSummary -} - -// ExpressRouteCircuitsListRoutesTableSummary ... -func (c ExpressRouteCircuitRoutesTableSummaryClient) ExpressRouteCircuitsListRoutesTableSummary(ctx context.Context, id RouteTablesSummaryId) (result ExpressRouteCircuitsListRoutesTableSummaryOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCircuitsListRoutesTableSummaryThenPoll performs ExpressRouteCircuitsListRoutesTableSummary then polls until it's completed -func (c ExpressRouteCircuitRoutesTableSummaryClient) ExpressRouteCircuitsListRoutesTableSummaryThenPoll(ctx context.Context, id RouteTablesSummaryId) error { - result, err := c.ExpressRouteCircuitsListRoutesTableSummary(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCircuitsListRoutesTableSummary: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCircuitsListRoutesTableSummary: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go deleted file mode 100644 index 926fc450623..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/model_expressroutecircuitroutestablesummary.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableSummary struct { - As *int64 `json:"as,omitempty"` - Neighbor *string `json:"neighbor,omitempty"` - StatePfxRcd *string `json:"statePfxRcd,omitempty"` - UpDown *string `json:"upDown,omitempty"` - V *int64 `json:"v,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/predicates.go deleted file mode 100644 index 1d9991e4b00..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecircuitroutestablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableSummaryOperationPredicate struct { - As *int64 - Neighbor *string - StatePfxRcd *string - UpDown *string - V *int64 -} - -func (p ExpressRouteCircuitRoutesTableSummaryOperationPredicate) Matches(input ExpressRouteCircuitRoutesTableSummary) bool { - - if p.As != nil && (input.As == nil || *p.As != *input.As) { - return false - } - - if p.Neighbor != nil && (input.Neighbor == nil || *p.Neighbor != *input.Neighbor) { - return false - } - - if p.StatePfxRcd != nil && (input.StatePfxRcd == nil || *p.StatePfxRcd != *input.StatePfxRcd) { - return false - } - - if p.UpDown != nil && (input.UpDown == nil || *p.UpDown != *input.UpDown) { - return false - } - - if p.V != nil && (input.V == nil || *p.V != *input.V) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/version.go b/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/version.go deleted file mode 100644 index f2b4a7618d5..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitroutestablesummary/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitroutestablesummary - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitroutestablesummary/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/README.md b/resource-manager/network/2023-06-01/expressroutecircuits/README.md deleted file mode 100644 index d1982133a70..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuits` Documentation - -The `expressroutecircuits` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuits" -``` - - -### Client Initialization - -```go -client := expressroutecircuits.NewExpressRouteCircuitsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -payload := expressroutecircuits.ExpressRouteCircuit{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -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: `ExpressRouteCircuitsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `ExpressRouteCircuitsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ExpressRouteCircuitsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutecircuits.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -payload := expressroutecircuits.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/network/2023-06-01/expressroutecircuits/client.go b/resource-manager/network/2023-06-01/expressroutecircuits/client.go deleted file mode 100644 index cd12ab163e6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuits - -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 ExpressRouteCircuitsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuits", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitsClient: %+v", err) - } - - return &ExpressRouteCircuitsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/constants.go b/resource-manager/network/2023-06-01/expressroutecircuits/constants.go deleted file mode 100644 index 017902fa091..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/constants.go +++ /dev/null @@ -1,450 +0,0 @@ -package expressroutecircuits - -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 AuthorizationUseStatus string - -const ( - AuthorizationUseStatusAvailable AuthorizationUseStatus = "Available" - AuthorizationUseStatusInUse AuthorizationUseStatus = "InUse" -) - -func PossibleValuesForAuthorizationUseStatus() []string { - return []string{ - string(AuthorizationUseStatusAvailable), - string(AuthorizationUseStatusInUse), - } -} - -func (s *AuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthorizationUseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthorizationUseStatus(input string) (*AuthorizationUseStatus, error) { - vals := map[string]AuthorizationUseStatus{ - "available": AuthorizationUseStatusAvailable, - "inuse": AuthorizationUseStatusInUse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthorizationUseStatus(input) - return &out, nil -} - -type CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRouteCircuitSkuFamily string - -const ( - ExpressRouteCircuitSkuFamilyMeteredData ExpressRouteCircuitSkuFamily = "MeteredData" - ExpressRouteCircuitSkuFamilyUnlimitedData ExpressRouteCircuitSkuFamily = "UnlimitedData" -) - -func PossibleValuesForExpressRouteCircuitSkuFamily() []string { - return []string{ - string(ExpressRouteCircuitSkuFamilyMeteredData), - string(ExpressRouteCircuitSkuFamilyUnlimitedData), - } -} - -func (s *ExpressRouteCircuitSkuFamily) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitSkuFamily(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitSkuFamily(input string) (*ExpressRouteCircuitSkuFamily, error) { - vals := map[string]ExpressRouteCircuitSkuFamily{ - "metereddata": ExpressRouteCircuitSkuFamilyMeteredData, - "unlimiteddata": ExpressRouteCircuitSkuFamilyUnlimitedData, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitSkuFamily(input) - return &out, nil -} - -type ExpressRouteCircuitSkuTier string - -const ( - ExpressRouteCircuitSkuTierBasic ExpressRouteCircuitSkuTier = "Basic" - ExpressRouteCircuitSkuTierLocal ExpressRouteCircuitSkuTier = "Local" - ExpressRouteCircuitSkuTierPremium ExpressRouteCircuitSkuTier = "Premium" - ExpressRouteCircuitSkuTierStandard ExpressRouteCircuitSkuTier = "Standard" -) - -func PossibleValuesForExpressRouteCircuitSkuTier() []string { - return []string{ - string(ExpressRouteCircuitSkuTierBasic), - string(ExpressRouteCircuitSkuTierLocal), - string(ExpressRouteCircuitSkuTierPremium), - string(ExpressRouteCircuitSkuTierStandard), - } -} - -func (s *ExpressRouteCircuitSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitSkuTier(input string) (*ExpressRouteCircuitSkuTier, error) { - vals := map[string]ExpressRouteCircuitSkuTier{ - "basic": ExpressRouteCircuitSkuTierBasic, - "local": ExpressRouteCircuitSkuTierLocal, - "premium": ExpressRouteCircuitSkuTierPremium, - "standard": ExpressRouteCircuitSkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitSkuTier(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ServiceProviderProvisioningState string - -const ( - ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" - ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" -) - -func PossibleValuesForServiceProviderProvisioningState() []string { - return []string{ - string(ServiceProviderProvisioningStateDeprovisioning), - string(ServiceProviderProvisioningStateNotProvisioned), - string(ServiceProviderProvisioningStateProvisioned), - string(ServiceProviderProvisioningStateProvisioning), - } -} - -func (s *ServiceProviderProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServiceProviderProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServiceProviderProvisioningState(input string) (*ServiceProviderProvisioningState, error) { - vals := map[string]ServiceProviderProvisioningState{ - "deprovisioning": ServiceProviderProvisioningStateDeprovisioning, - "notprovisioned": ServiceProviderProvisioningStateNotProvisioned, - "provisioned": ServiceProviderProvisioningStateProvisioned, - "provisioning": ServiceProviderProvisioningStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceProviderProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit.go b/resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit.go deleted file mode 100644 index d48e8e429e7..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuits - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit_test.go b/resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit_test.go deleted file mode 100644 index f5006a32349..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuits - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-06-01/expressroutecircuits/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutecircuits/method_createorupdate.go deleted file mode 100644 index 399156eb14e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecircuits - -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 *ExpressRouteCircuit -} - -// CreateOrUpdate ... -func (c ExpressRouteCircuitsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteCircuitId, input ExpressRouteCircuit) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCircuitsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteCircuitId, input ExpressRouteCircuit) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutecircuits/method_delete.go b/resource-manager/network/2023-06-01/expressroutecircuits/method_delete.go deleted file mode 100644 index 91f8aa53bed..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecircuits - -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 ExpressRouteCircuitsClient) Delete(ctx context.Context, id ExpressRouteCircuitId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCircuitsClient) DeleteThenPoll(ctx context.Context, id ExpressRouteCircuitId) 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/network/2023-06-01/expressroutecircuits/method_get.go b/resource-manager/network/2023-06-01/expressroutecircuits/method_get.go deleted file mode 100644 index 2047441e60b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecircuits - -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 *ExpressRouteCircuit -} - -// Get ... -func (c ExpressRouteCircuitsClient) Get(ctx context.Context, id ExpressRouteCircuitId) (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 ExpressRouteCircuit - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/method_list.go b/resource-manager/network/2023-06-01/expressroutecircuits/method_list.go deleted file mode 100644 index b21064c5d1a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecircuits - -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 *[]ExpressRouteCircuit -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuit -} - -// List ... -func (c ExpressRouteCircuitsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCircuits", 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 *[]ExpressRouteCircuit `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 ExpressRouteCircuitsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRouteCircuitOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCircuit, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecircuits/method_listall.go b/resource-manager/network/2023-06-01/expressroutecircuits/method_listall.go deleted file mode 100644 index be1cf07c562..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecircuits - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuit -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuit -} - -// ListAll ... -func (c ExpressRouteCircuitsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCircuits", 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 *[]ExpressRouteCircuit `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c ExpressRouteCircuitsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, ExpressRouteCircuitOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCircuitsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteCircuitOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]ExpressRouteCircuit, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/method_updatetags.go b/resource-manager/network/2023-06-01/expressroutecircuits/method_updatetags.go deleted file mode 100644 index 8426eb683b2..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package expressroutecircuits - -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 *ExpressRouteCircuit -} - -// UpdateTags ... -func (c ExpressRouteCircuitsClient) UpdateTags(ctx context.Context, id ExpressRouteCircuitId, 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 ExpressRouteCircuit - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_authorizationpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_authorizationpropertiesformat.go deleted file mode 100644 index a539b0f44a2..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_authorizationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AuthorizationPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationUseStatus *AuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuit.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuit.go deleted file mode 100644 index a74493fcec8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuit.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuit struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPropertiesFormat `json:"properties,omitempty"` - Sku *ExpressRouteCircuitSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitauthorization.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitauthorization.go deleted file mode 100644 index 2942811a91c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitauthorization.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitAuthorization struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AuthorizationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnection.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnection.go deleted file mode 100644 index 901ef503724..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 897f772964a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeering.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeering.go deleted file mode 100644 index d7431190482..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 836b1d5e963..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go deleted file mode 100644 index 87a88e75638..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpeeringpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringPropertiesFormat struct { - AzureASN *int64 `json:"azureASN,omitempty"` - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go deleted file mode 100644 index 89faee5aa48..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitpropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPropertiesFormat struct { - AllowClassicOperations *bool `json:"allowClassicOperations,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationStatus *string `json:"authorizationStatus,omitempty"` - Authorizations *[]ExpressRouteCircuitAuthorization `json:"authorizations,omitempty"` - BandwidthInGbps *float64 `json:"bandwidthInGbps,omitempty"` - CircuitProvisioningState *string `json:"circuitProvisioningState,omitempty"` - ExpressRoutePort *SubResource `json:"expressRoutePort,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - GlobalReachEnabled *bool `json:"globalReachEnabled,omitempty"` - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceKey *string `json:"serviceKey,omitempty"` - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - ServiceProviderProperties *ExpressRouteCircuitServiceProviderProperties `json:"serviceProviderProperties,omitempty"` - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` - Stag *int64 `json:"stag,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go deleted file mode 100644 index 432cdaf5a4a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitserviceproviderproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitServiceProviderProperties struct { - BandwidthInMbps *int64 `json:"bandwidthInMbps,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - ServiceProviderName *string `json:"serviceProviderName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitsku.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitsku.go deleted file mode 100644 index 186629b51a6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitsku.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitSku struct { - Family *ExpressRouteCircuitSkuFamily `json:"family,omitempty"` - Name *string `json:"name,omitempty"` - Tier *ExpressRouteCircuitSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitstats.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitstats.go deleted file mode 100644 index ca8cd2c52bc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressrouteconnectionid.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_expressrouteconnectionid.go deleted file mode 100644 index 70b79aa3ec7..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_expressrouteconnectionid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index 49a42177273..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 02e4a94b316..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index e52a6b6f8c3..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 804baee319a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_subresource.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_subresource.go deleted file mode 100644 index daf852a98a9..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuits/model_tagsobject.go b/resource-manager/network/2023-06-01/expressroutecircuits/model_tagsobject.go deleted file mode 100644 index 585eaaba376..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecircuits - -// 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/network/2023-06-01/expressroutecircuits/predicates.go b/resource-manager/network/2023-06-01/expressroutecircuits/predicates.go deleted file mode 100644 index 3fdbc040dbf..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecircuits - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteCircuitOperationPredicate) Matches(input ExpressRouteCircuit) 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 && (input.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/network/2023-06-01/expressroutecircuits/version.go b/resource-manager/network/2023-06-01/expressroutecircuits/version.go deleted file mode 100644 index 2ab818439e4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuits/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuits - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuits/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitstats/README.md b/resource-manager/network/2023-06-01/expressroutecircuitstats/README.md deleted file mode 100644 index a4e8103eefc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecircuitstats` Documentation - -The `expressroutecircuitstats` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecircuitstats" -``` - - -### Client Initialization - -```go -client := expressroutecircuitstats.NewExpressRouteCircuitStatsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetPeeringStats` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -read, err := client.ExpressRouteCircuitsGetPeeringStats(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteCircuitStatsClient.ExpressRouteCircuitsGetStats` - -```go -ctx := context.TODO() -id := expressroutecircuitstats.NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - -read, err := client.ExpressRouteCircuitsGetStats(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/network/2023-06-01/expressroutecircuitstats/client.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/client.go deleted file mode 100644 index 43a397e1cc1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecircuitstats - -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 ExpressRouteCircuitStatsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCircuitStatsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCircuitStatsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecircuitstats", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCircuitStatsClient: %+v", err) - } - - return &ExpressRouteCircuitStatsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit.go deleted file mode 100644 index cf235dfe96f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecircuitstats - -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(&ExpressRouteCircuitId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCircuitId{} - -// ExpressRouteCircuitId is a struct representing the Resource ID for a Express Route Circuit -type ExpressRouteCircuitId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string -} - -// NewExpressRouteCircuitID returns a new ExpressRouteCircuitId struct -func NewExpressRouteCircuitID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string) ExpressRouteCircuitId { - return ExpressRouteCircuitId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - } -} - -// ParseExpressRouteCircuitID parses 'input' into a ExpressRouteCircuitId -func ParseExpressRouteCircuitID(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCircuitIDInsensitively parses 'input' case-insensitively into a ExpressRouteCircuitId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCircuitIDInsensitively(input string) (*ExpressRouteCircuitId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCircuitId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCircuitId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCircuitId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - return nil -} - -// ValidateExpressRouteCircuitID checks that 'input' can be parsed as a Express Route Circuit ID -func ValidateExpressRouteCircuitID(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 := ParseExpressRouteCircuitID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Circuit ID -func (id ExpressRouteCircuitId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Circuit ID -func (id ExpressRouteCircuitId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - } -} - -// String returns a human-readable description of this Express Route Circuit ID -func (id ExpressRouteCircuitId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - } - return fmt.Sprintf("Express Route Circuit (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit_test.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit_test.go deleted file mode 100644 index 735aeca4792..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/id_expressroutecircuit_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecircuitstats - -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 = &ExpressRouteCircuitId{} - -func TestNewExpressRouteCircuitID(t *testing.T) { - id := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } -} - -func TestFormatExpressRouteCircuitID(t *testing.T) { - actual := NewExpressRouteCircuitID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCircuitID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestParseExpressRouteCircuitIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCircuitId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Expected: &ExpressRouteCircuitId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCircuitIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - } -} - -func TestSegmentsForExpressRouteCircuitId(t *testing.T) { - segments := ExpressRouteCircuitId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCircuitId 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/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go deleted file mode 100644 index 5473e8458e6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetpeeringstats.go +++ /dev/null @@ -1,56 +0,0 @@ -package expressroutecircuitstats - -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 ExpressRouteCircuitsGetPeeringStatsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteCircuitStats -} - -// ExpressRouteCircuitsGetPeeringStats ... -func (c ExpressRouteCircuitStatsClient) ExpressRouteCircuitsGetPeeringStats(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ExpressRouteCircuitsGetPeeringStatsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/stats", 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 ExpressRouteCircuitStats - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go deleted file mode 100644 index 4bd3c09b58e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/method_expressroutecircuitsgetstats.go +++ /dev/null @@ -1,55 +0,0 @@ -package expressroutecircuitstats - -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 ExpressRouteCircuitsGetStatsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteCircuitStats -} - -// ExpressRouteCircuitsGetStats ... -func (c ExpressRouteCircuitStatsClient) ExpressRouteCircuitsGetStats(ctx context.Context, id ExpressRouteCircuitId) (result ExpressRouteCircuitsGetStatsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/stats", 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 ExpressRouteCircuitStats - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitstats/model_expressroutecircuitstats.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/model_expressroutecircuitstats.go deleted file mode 100644 index f93c0daeba8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecircuitstats - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecircuitstats/version.go b/resource-manager/network/2023-06-01/expressroutecircuitstats/version.go deleted file mode 100644 index 6fc925b9baf..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecircuitstats/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecircuitstats - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecircuitstats/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/README.md b/resource-manager/network/2023-06-01/expressrouteconnections/README.md deleted file mode 100644 index 5ade1589b45..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteconnections` Documentation - -The `expressrouteconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressrouteconnections" -``` - - -### Client Initialization - -```go -client := expressrouteconnections.NewExpressRouteConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -payload := expressrouteconnections.ExpressRouteConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - -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: `ExpressRouteConnectionsClient.List` - -```go -ctx := context.TODO() -id := expressrouteconnections.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -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/network/2023-06-01/expressrouteconnections/client.go b/resource-manager/network/2023-06-01/expressrouteconnections/client.go deleted file mode 100644 index 59b056f90da..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteconnections - -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 ExpressRouteConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteConnectionsClient: %+v", err) - } - - return &ExpressRouteConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/constants.go b/resource-manager/network/2023-06-01/expressrouteconnections/constants.go deleted file mode 100644 index 571bcb03c1e..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressrouteconnections - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection.go b/resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection.go deleted file mode 100644 index 7bba12f409b..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressrouteconnections - -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(&ExpressRouteConnectionId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteConnectionId{} - -// ExpressRouteConnectionId is a struct representing the Resource ID for a Express Route Connection -type ExpressRouteConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteGatewayName string - ExpressRouteConnectionName string -} - -// NewExpressRouteConnectionID returns a new ExpressRouteConnectionId struct -func NewExpressRouteConnectionID(subscriptionId string, resourceGroupName string, expressRouteGatewayName string, expressRouteConnectionName string) ExpressRouteConnectionId { - return ExpressRouteConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteGatewayName: expressRouteGatewayName, - ExpressRouteConnectionName: expressRouteConnectionName, - } -} - -// ParseExpressRouteConnectionID parses 'input' into a ExpressRouteConnectionId -func ParseExpressRouteConnectionID(input string) (*ExpressRouteConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteConnectionIDInsensitively parses 'input' case-insensitively into a ExpressRouteConnectionId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteConnectionIDInsensitively(input string) (*ExpressRouteConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteConnectionId) 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.ExpressRouteGatewayName, ok = input.Parsed["expressRouteGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteGatewayName", input) - } - - if id.ExpressRouteConnectionName, ok = input.Parsed["expressRouteConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteConnectionName", input) - } - - return nil -} - -// ValidateExpressRouteConnectionID checks that 'input' can be parsed as a Express Route Connection ID -func ValidateExpressRouteConnectionID(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 := ParseExpressRouteConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Connection ID -func (id ExpressRouteConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteGateways/%s/expressRouteConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteGatewayName, id.ExpressRouteConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Connection ID -func (id ExpressRouteConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), - resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayValue"), - resourceids.StaticSegment("staticExpressRouteConnections", "expressRouteConnections", "expressRouteConnections"), - resourceids.UserSpecifiedSegment("expressRouteConnectionName", "expressRouteConnectionValue"), - } -} - -// String returns a human-readable description of this Express Route Connection ID -func (id ExpressRouteConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Gateway Name: %q", id.ExpressRouteGatewayName), - fmt.Sprintf("Express Route Connection Name: %q", id.ExpressRouteConnectionName), - } - return fmt.Sprintf("Express Route Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection_test.go b/resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection_test.go deleted file mode 100644 index 1cf5c6183dc..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressrouteconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressrouteconnections - -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 = &ExpressRouteConnectionId{} - -func TestNewExpressRouteConnectionID(t *testing.T) { - id := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue") - - 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.ExpressRouteGatewayName != "expressRouteGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayValue") - } - - if id.ExpressRouteConnectionName != "expressRouteConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteConnectionName'", id.ExpressRouteConnectionName, "expressRouteConnectionValue") - } -} - -func TestFormatExpressRouteConnectionID(t *testing.T) { - actual := NewExpressRouteConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue", "expressRouteConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue", - Expected: &ExpressRouteConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - ExpressRouteConnectionName: "expressRouteConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteConnectionID(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - if actual.ExpressRouteConnectionName != v.Expected.ExpressRouteConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteConnectionName", v.Expected.ExpressRouteConnectionName, actual.ExpressRouteConnectionName) - } - - } -} - -func TestParseExpressRouteConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/eXpReSsRoUtEcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue", - Expected: &ExpressRouteConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - ExpressRouteConnectionName: "expressRouteConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/expressRouteConnections/expressRouteConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNvAlUe", - Expected: &ExpressRouteConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyVaLuE", - ExpressRouteConnectionName: "eXpReSsRoUtEcOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/eXpReSsRoUtEcOnNeCtIoNs/eXpReSsRoUtEcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteConnectionIDInsensitively(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - if actual.ExpressRouteConnectionName != v.Expected.ExpressRouteConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteConnectionName", v.Expected.ExpressRouteConnectionName, actual.ExpressRouteConnectionName) - } - - } -} - -func TestSegmentsForExpressRouteConnectionId(t *testing.T) { - segments := ExpressRouteConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteConnectionId 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/network/2023-06-01/expressrouteconnections/id_expressroutegateway.go b/resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway.go deleted file mode 100644 index 6df37b9a7d8..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressrouteconnections - -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(&ExpressRouteGatewayId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteGatewayId{} - -// ExpressRouteGatewayId is a struct representing the Resource ID for a Express Route Gateway -type ExpressRouteGatewayId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteGatewayName string -} - -// NewExpressRouteGatewayID returns a new ExpressRouteGatewayId struct -func NewExpressRouteGatewayID(subscriptionId string, resourceGroupName string, expressRouteGatewayName string) ExpressRouteGatewayId { - return ExpressRouteGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteGatewayName: expressRouteGatewayName, - } -} - -// ParseExpressRouteGatewayID parses 'input' into a ExpressRouteGatewayId -func ParseExpressRouteGatewayID(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteGatewayIDInsensitively parses 'input' case-insensitively into a ExpressRouteGatewayId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteGatewayIDInsensitively(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteGatewayId) 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.ExpressRouteGatewayName, ok = input.Parsed["expressRouteGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteGatewayName", input) - } - - return nil -} - -// ValidateExpressRouteGatewayID checks that 'input' can be parsed as a Express Route Gateway ID -func ValidateExpressRouteGatewayID(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 := ParseExpressRouteGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Gateway ID -func (id ExpressRouteGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Gateway ID -func (id ExpressRouteGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), - resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayValue"), - } -} - -// String returns a human-readable description of this Express Route Gateway ID -func (id ExpressRouteGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Gateway Name: %q", id.ExpressRouteGatewayName), - } - return fmt.Sprintf("Express Route Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway_test.go b/resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway_test.go deleted file mode 100644 index 2ba620612ce..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/id_expressroutegateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressrouteconnections - -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 = &ExpressRouteGatewayId{} - -func TestNewExpressRouteGatewayID(t *testing.T) { - id := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - - 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.ExpressRouteGatewayName != "expressRouteGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayValue") - } -} - -func TestFormatExpressRouteGatewayID(t *testing.T) { - actual := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayID(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestParseExpressRouteGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayIDInsensitively(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestSegmentsForExpressRouteGatewayId(t *testing.T) { - segments := ExpressRouteGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteGatewayId 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/network/2023-06-01/expressrouteconnections/method_createorupdate.go b/resource-manager/network/2023-06-01/expressrouteconnections/method_createorupdate.go deleted file mode 100644 index 37e7c0ceddb..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressrouteconnections - -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 *ExpressRouteConnection -} - -// CreateOrUpdate ... -func (c ExpressRouteConnectionsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteConnectionId, input ExpressRouteConnection) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteConnectionId, input ExpressRouteConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressrouteconnections/method_delete.go b/resource-manager/network/2023-06-01/expressrouteconnections/method_delete.go deleted file mode 100644 index 8f3816bde32..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressrouteconnections - -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 ExpressRouteConnectionsClient) Delete(ctx context.Context, id ExpressRouteConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteConnectionsClient) DeleteThenPoll(ctx context.Context, id ExpressRouteConnectionId) 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/network/2023-06-01/expressrouteconnections/method_get.go b/resource-manager/network/2023-06-01/expressrouteconnections/method_get.go deleted file mode 100644 index ae0992fa45d..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteconnections - -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 *ExpressRouteConnection -} - -// Get ... -func (c ExpressRouteConnectionsClient) Get(ctx context.Context, id ExpressRouteConnectionId) (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 ExpressRouteConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/method_list.go b/resource-manager/network/2023-06-01/expressrouteconnections/method_list.go deleted file mode 100644 index e9090e1dd56..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package expressrouteconnections - -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 *ExpressRouteConnectionList -} - -// List ... -func (c ExpressRouteConnectionsClient) List(ctx context.Context, id ExpressRouteGatewayId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/expressRouteConnections", 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 ExpressRouteConnectionList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressroutecircuitpeeringid.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_expressroutecircuitpeeringid.go deleted file mode 100644 index 3a30ff411e8..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressroutecircuitpeeringid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnection.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnection.go deleted file mode 100644 index 1e31fa6c860..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnection.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnection struct { - Id *string `json:"id,omitempty"` - Name string `json:"name"` - Properties *ExpressRouteConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionlist.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionlist.go deleted file mode 100644 index a16565b3cd5..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionlist.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionList struct { - Value *[]ExpressRouteConnection `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionproperties.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionproperties.go deleted file mode 100644 index 2e9dddfbc1a..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_expressrouteconnectionproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionProperties struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteCircuitPeering ExpressRouteCircuitPeeringId `json:"expressRouteCircuitPeering"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_propagatedroutetable.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_propagatedroutetable.go deleted file mode 100644 index 7279e13359c..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_routingconfiguration.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_routingconfiguration.go deleted file mode 100644 index 4e1904d9c6e..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_staticroute.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_staticroute.go deleted file mode 100644 index c1e414bbe16..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_staticroutesconfig.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_staticroutesconfig.go deleted file mode 100644 index 9ee286419ac..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_subresource.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_subresource.go deleted file mode 100644 index 5a5f53696f8..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/model_vnetroute.go b/resource-manager/network/2023-06-01/expressrouteconnections/model_vnetroute.go deleted file mode 100644 index 9e296eed5de..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteconnections/version.go b/resource-manager/network/2023-06-01/expressrouteconnections/version.go deleted file mode 100644 index baf37f207d9..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/README.md b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/README.md deleted file mode 100644 index 2586a5023d4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable` Documentation - -The `expressroutecrossconnectionarptable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecrossconnectionarptable" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionarptable.NewExpressRouteCrossConnectionArpTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionArpTableClient.ExpressRouteCrossConnectionsListArpTable` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionarptable.NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue") - -// alternatively `client.ExpressRouteCrossConnectionsListArpTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListArpTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/client.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/client.go deleted file mode 100644 index 07328f2f394..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionarptable - -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 ExpressRouteCrossConnectionArpTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionArpTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionArpTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionarptable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionArpTableClient: %+v", err) - } - - return &ExpressRouteCrossConnectionArpTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable.go deleted file mode 100644 index a90eea8a4cb..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecrossconnectionarptable - -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(&PeeringArpTableId{}) -} - -var _ resourceids.ResourceId = &PeeringArpTableId{} - -// PeeringArpTableId is a struct representing the Resource ID for a Peering Arp Table -type PeeringArpTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string - ArpTableName string -} - -// NewPeeringArpTableID returns a new PeeringArpTableId struct -func NewPeeringArpTableID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string, arpTableName string) PeeringArpTableId { - return PeeringArpTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - ArpTableName: arpTableName, - } -} - -// ParsePeeringArpTableID parses 'input' into a PeeringArpTableId -func ParsePeeringArpTableID(input string) (*PeeringArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringArpTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringArpTableIDInsensitively parses 'input' case-insensitively into a PeeringArpTableId -// note: this method should only be used for API response data and not user input -func ParsePeeringArpTableIDInsensitively(input string) (*PeeringArpTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringArpTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringArpTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringArpTableId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.ArpTableName, ok = input.Parsed["arpTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "arpTableName", input) - } - - return nil -} - -// ValidatePeeringArpTableID checks that 'input' can be parsed as a Peering Arp Table ID -func ValidatePeeringArpTableID(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 := ParsePeeringArpTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Arp Table ID -func (id PeeringArpTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s/arpTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName, id.ArpTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Arp Table ID -func (id PeeringArpTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticArpTables", "arpTables", "arpTables"), - resourceids.UserSpecifiedSegment("arpTableName", "arpTableValue"), - } -} - -// String returns a human-readable description of this Peering Arp Table ID -func (id PeeringArpTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Arp Table Name: %q", id.ArpTableName), - } - return fmt.Sprintf("Peering Arp Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go deleted file mode 100644 index 31143355e4b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/id_peeringarptable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecrossconnectionarptable - -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 = &PeeringArpTableId{} - -func TestNewPeeringArpTableID(t *testing.T) { - id := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.ArpTableName != "arpTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'ArpTableName'", id.ArpTableName, "arpTableValue") - } -} - -func TestFormatPeeringArpTableID(t *testing.T) { - actual := NewPeeringArpTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "arpTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringArpTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &PeeringArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringArpTableID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestParsePeeringArpTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringArpTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue", - Expected: &PeeringArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - ArpTableName: "arpTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/arpTables/arpTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe", - Expected: &PeeringArpTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - ArpTableName: "aRpTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/aRpTaBlEs/aRpTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringArpTableIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.ArpTableName != v.Expected.ArpTableName { - t.Fatalf("Expected %q but got %q for ArpTableName", v.Expected.ArpTableName, actual.ArpTableName) - } - - } -} - -func TestSegmentsForPeeringArpTableId(t *testing.T) { - segments := PeeringArpTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringArpTableId 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/network/2023-06-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go deleted file mode 100644 index 93cb5d74c61..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/method_expressroutecrossconnectionslistarptable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecrossconnectionarptable - -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 ExpressRouteCrossConnectionsListArpTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitArpTable -} - -type ExpressRouteCrossConnectionsListArpTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitArpTable -} - -// ExpressRouteCrossConnectionsListArpTable ... -func (c ExpressRouteCrossConnectionArpTableClient) ExpressRouteCrossConnectionsListArpTable(ctx context.Context, id PeeringArpTableId) (result ExpressRouteCrossConnectionsListArpTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCrossConnectionsListArpTableThenPoll performs ExpressRouteCrossConnectionsListArpTable then polls until it's completed -func (c ExpressRouteCrossConnectionArpTableClient) ExpressRouteCrossConnectionsListArpTableThenPoll(ctx context.Context, id PeeringArpTableId) error { - result, err := c.ExpressRouteCrossConnectionsListArpTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCrossConnectionsListArpTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCrossConnectionsListArpTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go deleted file mode 100644 index eb25fb1e02d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/model_expressroutecircuitarptable.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnectionarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTable struct { - Age *int64 `json:"age,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - Interface *string `json:"interface,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/predicates.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/predicates.go deleted file mode 100644 index 75df45b22f9..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecrossconnectionarptable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitArpTableOperationPredicate struct { - Age *int64 - IPAddress *string - Interface *string - MacAddress *string -} - -func (p ExpressRouteCircuitArpTableOperationPredicate) Matches(input ExpressRouteCircuitArpTable) bool { - - if p.Age != nil && (input.Age == nil || *p.Age != *input.Age) { - return false - } - - if p.IPAddress != nil && (input.IPAddress == nil || *p.IPAddress != *input.IPAddress) { - return false - } - - if p.Interface != nil && (input.Interface == nil || *p.Interface != *input.Interface) { - return false - } - - if p.MacAddress != nil && (input.MacAddress == nil || *p.MacAddress != *input.MacAddress) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/version.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/version.go deleted file mode 100644 index 6836956c4ee..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionarptable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionarptable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionarptable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/README.md b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/README.md deleted file mode 100644 index c72c58100e7..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings` Documentation - -The `expressroutecrossconnectionpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecrossconnectionpeerings" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -payload := expressroutecrossconnectionpeerings.ExpressRouteCrossConnectionPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionPeeringsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - -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: `ExpressRouteCrossConnectionPeeringsClient.List` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionpeerings.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -// 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/network/2023-06-01/expressroutecrossconnectionpeerings/client.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/client.go deleted file mode 100644 index 90cbc899dcb..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 ExpressRouteCrossConnectionPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionPeeringsClient: %+v", err) - } - - return &ExpressRouteCrossConnectionPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/constants.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/constants.go deleted file mode 100644 index 96dec453442..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/constants.go +++ /dev/null @@ -1,230 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go deleted file mode 100644 index 626b69cff73..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecrossconnectionpeerings - -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(&ExpressRouteCrossConnectionId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} - -// ExpressRouteCrossConnectionId is a struct representing the Resource ID for a Express Route Cross Connection -type ExpressRouteCrossConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string -} - -// NewExpressRouteCrossConnectionID returns a new ExpressRouteCrossConnectionId struct -func NewExpressRouteCrossConnectionID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string) ExpressRouteCrossConnectionId { - return ExpressRouteCrossConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - } -} - -// ParseExpressRouteCrossConnectionID parses 'input' into a ExpressRouteCrossConnectionId -func ParseExpressRouteCrossConnectionID(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCrossConnectionIDInsensitively parses 'input' case-insensitively into a ExpressRouteCrossConnectionId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCrossConnectionIDInsensitively(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCrossConnectionId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - return nil -} - -// ValidateExpressRouteCrossConnectionID checks that 'input' can be parsed as a Express Route Cross Connection ID -func ValidateExpressRouteCrossConnectionID(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 := ParseExpressRouteCrossConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - } -} - -// String returns a human-readable description of this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - } - return fmt.Sprintf("Express Route Cross Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go deleted file mode 100644 index 5314f35860d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_expressroutecrossconnection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 = &ExpressRouteCrossConnectionId{} - -func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } -} - -func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCrossConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestSegmentsForExpressRouteCrossConnectionId(t *testing.T) { - segments := ExpressRouteCrossConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCrossConnectionId 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/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering.go deleted file mode 100644 index f9e45b10c99..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressroutecrossconnectionpeerings - -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(&PeeringId{}) -} - -var _ resourceids.ResourceId = &PeeringId{} - -// PeeringId is a struct representing the Resource ID for a Peering -type PeeringId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string -} - -// NewPeeringID returns a new PeeringId struct -func NewPeeringID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string) PeeringId { - return PeeringId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - } -} - -// ParsePeeringID parses 'input' into a PeeringId -func ParsePeeringID(input string) (*PeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringIDInsensitively parses 'input' case-insensitively into a PeeringId -// note: this method should only be used for API response data and not user input -func ParsePeeringIDInsensitively(input string) (*PeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - return nil -} - -// ValidatePeeringID checks that 'input' can be parsed as a Peering ID -func ValidatePeeringID(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 := ParsePeeringID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering ID -func (id PeeringId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering ID -func (id PeeringId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - } -} - -// String returns a human-readable description of this Peering ID -func (id PeeringId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - } - return fmt.Sprintf("Peering (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering_test.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering_test.go deleted file mode 100644 index 77d161773d2..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/id_peering_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 = &PeeringId{} - -func TestNewPeeringID(t *testing.T) { - id := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } -} - -func TestFormatPeeringID(t *testing.T) { - actual := NewPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Expected: &PeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - } -} - -func TestParsePeeringIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Expected: &PeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Expected: &PeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - } -} - -func TestSegmentsForPeeringId(t *testing.T) { - segments := PeeringId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringId 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/network/2023-06-01/expressroutecrossconnectionpeerings/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_createorupdate.go deleted file mode 100644 index 4cfa59c5d29..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 *ExpressRouteCrossConnectionPeering -} - -// CreateOrUpdate ... -func (c ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdate(ctx context.Context, id PeeringId, input ExpressRouteCrossConnectionPeering) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCrossConnectionPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id PeeringId, input ExpressRouteCrossConnectionPeering) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutecrossconnectionpeerings/method_delete.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_delete.go deleted file mode 100644 index f2073ab1bd3..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 ExpressRouteCrossConnectionPeeringsClient) Delete(ctx context.Context, id PeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteCrossConnectionPeeringsClient) DeleteThenPoll(ctx context.Context, id PeeringId) 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/network/2023-06-01/expressroutecrossconnectionpeerings/method_get.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_get.go deleted file mode 100644 index b53171627d6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 *ExpressRouteCrossConnectionPeering -} - -// Get ... -func (c ExpressRouteCrossConnectionPeeringsClient) Get(ctx context.Context, id PeeringId) (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 ExpressRouteCrossConnectionPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_list.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_list.go deleted file mode 100644 index 3c542220690..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutecrossconnectionpeerings - -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 *[]ExpressRouteCrossConnectionPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnectionPeering -} - -// List ... -func (c ExpressRouteCrossConnectionPeeringsClient) List(ctx context.Context, id ExpressRouteCrossConnectionId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerings", 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 *[]ExpressRouteCrossConnectionPeering `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 ExpressRouteCrossConnectionPeeringsClient) ListComplete(ctx context.Context, id ExpressRouteCrossConnectionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCrossConnectionPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCrossConnectionPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRouteCrossConnectionId, predicate ExpressRouteCrossConnectionPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCrossConnectionPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 298b61e03ee..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go deleted file mode 100644 index 3244f828098..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeering.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go deleted file mode 100644 index 64330e5a7ea..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_expressroutecrossconnectionpeeringproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeeringProperties struct { - AzureASN *int64 `json:"azureASN,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index ec7f2c4a72c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_subresource.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_subresource.go deleted file mode 100644 index 919b934c547..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/predicates.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/predicates.go deleted file mode 100644 index abec5984ec1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutecrossconnectionpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p ExpressRouteCrossConnectionPeeringOperationPredicate) Matches(input ExpressRouteCrossConnectionPeering) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/version.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/version.go deleted file mode 100644 index d9552f338c8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/README.md b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/README.md deleted file mode 100644 index 119d84f6ea6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable` Documentation - -The `expressroutecrossconnectionroutetable` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecrossconnectionroutetable" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionRouteTableClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionRouteTableClient.ExpressRouteCrossConnectionsListRoutesTable` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionroutetable.NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue") - -// alternatively `client.ExpressRouteCrossConnectionsListRoutesTable(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListRoutesTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/client.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/client.go deleted file mode 100644 index 210d81d68a9..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionroutetable - -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 ExpressRouteCrossConnectionRouteTableClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionRouteTableClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionRouteTableClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionroutetable", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionRouteTableClient: %+v", err) - } - - return &ExpressRouteCrossConnectionRouteTableClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go deleted file mode 100644 index 9a8910626cd..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecrossconnectionroutetable - -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(&ExpressRouteCrossConnectionPeeringRouteTableId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCrossConnectionPeeringRouteTableId{} - -// ExpressRouteCrossConnectionPeeringRouteTableId is a struct representing the Resource ID for a Express Route Cross Connection Peering Route Table -type ExpressRouteCrossConnectionPeeringRouteTableId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string - RouteTableName string -} - -// NewExpressRouteCrossConnectionPeeringRouteTableID returns a new ExpressRouteCrossConnectionPeeringRouteTableId struct -func NewExpressRouteCrossConnectionPeeringRouteTableID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string, routeTableName string) ExpressRouteCrossConnectionPeeringRouteTableId { - return ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - RouteTableName: routeTableName, - } -} - -// ParseExpressRouteCrossConnectionPeeringRouteTableID parses 'input' into a ExpressRouteCrossConnectionPeeringRouteTableId -func ParseExpressRouteCrossConnectionPeeringRouteTableID(input string) (*ExpressRouteCrossConnectionPeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionPeeringRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionPeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively parses 'input' case-insensitively into a ExpressRouteCrossConnectionPeeringRouteTableId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(input string) (*ExpressRouteCrossConnectionPeeringRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionPeeringRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionPeeringRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCrossConnectionPeeringRouteTableId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateExpressRouteCrossConnectionPeeringRouteTableID checks that 'input' can be parsed as a Express Route Cross Connection Peering Route Table ID -func ValidateExpressRouteCrossConnectionPeeringRouteTableID(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 := ParseExpressRouteCrossConnectionPeeringRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Cross Connection Peering Route Table ID -func (id ExpressRouteCrossConnectionPeeringRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Cross Connection Peering Route Table ID -func (id ExpressRouteCrossConnectionPeeringRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Express Route Cross Connection Peering Route Table ID -func (id ExpressRouteCrossConnectionPeeringRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Express Route Cross Connection Peering Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go deleted file mode 100644 index 5340522791f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/id_expressroutecrossconnectionpeeringroutetable_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecrossconnectionroutetable - -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 = &ExpressRouteCrossConnectionPeeringRouteTableId{} - -func TestNewExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - id := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - actual := NewExpressRouteCrossConnectionPeeringRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCrossConnectionPeeringRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionPeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionPeeringRouteTableID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionPeeringRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue", - Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &ExpressRouteCrossConnectionPeeringRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionPeeringRouteTableIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForExpressRouteCrossConnectionPeeringRouteTableId(t *testing.T) { - segments := ExpressRouteCrossConnectionPeeringRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCrossConnectionPeeringRouteTableId 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/network/2023-06-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go deleted file mode 100644 index 75e866bbea7..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/method_expressroutecrossconnectionslistroutestable.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecrossconnectionroutetable - -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 ExpressRouteCrossConnectionsListRoutesTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCircuitRoutesTable -} - -type ExpressRouteCrossConnectionsListRoutesTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCircuitRoutesTable -} - -// ExpressRouteCrossConnectionsListRoutesTable ... -func (c ExpressRouteCrossConnectionRouteTableClient) ExpressRouteCrossConnectionsListRoutesTable(ctx context.Context, id ExpressRouteCrossConnectionPeeringRouteTableId) (result ExpressRouteCrossConnectionsListRoutesTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCrossConnectionsListRoutesTableThenPoll performs ExpressRouteCrossConnectionsListRoutesTable then polls until it's completed -func (c ExpressRouteCrossConnectionRouteTableClient) ExpressRouteCrossConnectionsListRoutesTableThenPoll(ctx context.Context, id ExpressRouteCrossConnectionPeeringRouteTableId) error { - result, err := c.ExpressRouteCrossConnectionsListRoutesTable(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCrossConnectionsListRoutesTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCrossConnectionsListRoutesTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go deleted file mode 100644 index 4861d1c6ca2..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/model_expressroutecircuitroutestable.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTable struct { - LocPrf *string `json:"locPrf,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Path *string `json:"path,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/predicates.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/predicates.go deleted file mode 100644 index 2f1a6174bb4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecrossconnectionroutetable - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitRoutesTableOperationPredicate struct { - LocPrf *string - Network *string - NextHop *string - Path *string - Weight *int64 -} - -func (p ExpressRouteCircuitRoutesTableOperationPredicate) Matches(input ExpressRouteCircuitRoutesTable) bool { - - if p.LocPrf != nil && (input.LocPrf == nil || *p.LocPrf != *input.LocPrf) { - return false - } - - if p.Network != nil && (input.Network == nil || *p.Network != *input.Network) { - return false - } - - if p.NextHop != nil && (input.NextHop == nil || *p.NextHop != *input.NextHop) { - return false - } - - if p.Path != nil && (input.Path == nil || *p.Path != *input.Path) { - return false - } - - if p.Weight != nil && (input.Weight == nil || *p.Weight != *input.Weight) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/version.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/version.go deleted file mode 100644 index f452b7b7254..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetable/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetable - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetable/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/README.md b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/README.md deleted file mode 100644 index 5d1cd0fd863..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary` Documentation - -The `expressroutecrossconnectionroutetablesummary` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecrossconnectionroutetablesummary" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnectionroutetablesummary.NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionRouteTableSummaryClient.ExpressRouteCrossConnectionsListRoutesTableSummary` - -```go -ctx := context.TODO() -id := expressroutecrossconnectionroutetablesummary.NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue") - -// alternatively `client.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id)` can be used to do batched pagination -items, err := client.ExpressRouteCrossConnectionsListRoutesTableSummaryComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/client.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/client.go deleted file mode 100644 index 5329fa515af..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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 ExpressRouteCrossConnectionRouteTableSummaryClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionRouteTableSummaryClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionRouteTableSummaryClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnectionroutetablesummary", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionRouteTableSummaryClient: %+v", err) - } - - return &ExpressRouteCrossConnectionRouteTableSummaryClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go deleted file mode 100644 index ea69383cd3a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary.go +++ /dev/null @@ -1,148 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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(&PeeringRouteTablesSummaryId{}) -} - -var _ resourceids.ResourceId = &PeeringRouteTablesSummaryId{} - -// PeeringRouteTablesSummaryId is a struct representing the Resource ID for a Peering Route Tables Summary -type PeeringRouteTablesSummaryId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string - PeeringName string - RouteTablesSummaryName string -} - -// NewPeeringRouteTablesSummaryID returns a new PeeringRouteTablesSummaryId struct -func NewPeeringRouteTablesSummaryID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string, peeringName string, routeTablesSummaryName string) PeeringRouteTablesSummaryId { - return PeeringRouteTablesSummaryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - PeeringName: peeringName, - RouteTablesSummaryName: routeTablesSummaryName, - } -} - -// ParsePeeringRouteTablesSummaryID parses 'input' into a PeeringRouteTablesSummaryId -func ParsePeeringRouteTablesSummaryID(input string) (*PeeringRouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTablesSummaryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeeringRouteTablesSummaryIDInsensitively parses 'input' case-insensitively into a PeeringRouteTablesSummaryId -// note: this method should only be used for API response data and not user input -func ParsePeeringRouteTablesSummaryIDInsensitively(input string) (*PeeringRouteTablesSummaryId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeeringRouteTablesSummaryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeeringRouteTablesSummaryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeeringRouteTablesSummaryId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.RouteTablesSummaryName, ok = input.Parsed["routeTablesSummaryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTablesSummaryName", input) - } - - return nil -} - -// ValidatePeeringRouteTablesSummaryID checks that 'input' can be parsed as a Peering Route Tables Summary ID -func ValidatePeeringRouteTablesSummaryID(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 := ParsePeeringRouteTablesSummaryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peering Route Tables Summary ID -func (id PeeringRouteTablesSummaryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s/peerings/%s/routeTablesSummary/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName, id.PeeringName, id.RouteTablesSummaryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peering Route Tables Summary ID -func (id PeeringRouteTablesSummaryId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticRouteTablesSummary", "routeTablesSummary", "routeTablesSummary"), - resourceids.UserSpecifiedSegment("routeTablesSummaryName", "routeTablesSummaryValue"), - } -} - -// String returns a human-readable description of this Peering Route Tables Summary ID -func (id PeeringRouteTablesSummaryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Route Tables Summary Name: %q", id.RouteTablesSummaryName), - } - return fmt.Sprintf("Peering Route Tables Summary (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go deleted file mode 100644 index df9578d4e3b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/id_peeringroutetablessummary_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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 = &PeeringRouteTablesSummaryId{} - -func TestNewPeeringRouteTablesSummaryID(t *testing.T) { - id := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.RouteTablesSummaryName != "routeTablesSummaryValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTablesSummaryName'", id.RouteTablesSummaryName, "routeTablesSummaryValue") - } -} - -func TestFormatPeeringRouteTablesSummaryID(t *testing.T) { - actual := NewPeeringRouteTablesSummaryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue", "peeringValue", "routeTablesSummaryValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeeringRouteTablesSummaryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &PeeringRouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTablesSummaryID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestParsePeeringRouteTablesSummaryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeeringRouteTablesSummaryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue", - Expected: &PeeringRouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - PeeringName: "peeringValue", - RouteTablesSummaryName: "routeTablesSummaryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/peerings/peeringValue/routeTablesSummary/routeTablesSummaryValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe", - Expected: &PeeringRouteTablesSummaryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - PeeringName: "pEeRiNgVaLuE", - RouteTablesSummaryName: "rOuTeTaBlEsSuMmArYvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/pEeRiNgS/pEeRiNgVaLuE/rOuTeTaBlEsSuMmArY/rOuTeTaBlEsSuMmArYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeeringRouteTablesSummaryIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.RouteTablesSummaryName != v.Expected.RouteTablesSummaryName { - t.Fatalf("Expected %q but got %q for RouteTablesSummaryName", v.Expected.RouteTablesSummaryName, actual.RouteTablesSummaryName) - } - - } -} - -func TestSegmentsForPeeringRouteTablesSummaryId(t *testing.T) { - segments := PeeringRouteTablesSummaryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeeringRouteTablesSummaryId 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/network/2023-06-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go deleted file mode 100644 index 06c63e507a1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/method_expressroutecrossconnectionslistroutestablesummary.go +++ /dev/null @@ -1,76 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -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 ExpressRouteCrossConnectionsListRoutesTableSummaryOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteCrossConnectionRoutesTableSummary -} - -type ExpressRouteCrossConnectionsListRoutesTableSummaryCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnectionRoutesTableSummary -} - -// ExpressRouteCrossConnectionsListRoutesTableSummary ... -func (c ExpressRouteCrossConnectionRouteTableSummaryClient) ExpressRouteCrossConnectionsListRoutesTableSummary(ctx context.Context, id PeeringRouteTablesSummaryId) (result ExpressRouteCrossConnectionsListRoutesTableSummaryOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - 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 -} - -// ExpressRouteCrossConnectionsListRoutesTableSummaryThenPoll performs ExpressRouteCrossConnectionsListRoutesTableSummary then polls until it's completed -func (c ExpressRouteCrossConnectionRouteTableSummaryClient) ExpressRouteCrossConnectionsListRoutesTableSummaryThenPoll(ctx context.Context, id PeeringRouteTablesSummaryId) error { - result, err := c.ExpressRouteCrossConnectionsListRoutesTableSummary(ctx, id) - if err != nil { - return fmt.Errorf("performing ExpressRouteCrossConnectionsListRoutesTableSummary: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ExpressRouteCrossConnectionsListRoutesTableSummary: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go deleted file mode 100644 index e13df051962..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/model_expressroutecrossconnectionroutestablesummary.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionRoutesTableSummary struct { - Asn *int64 `json:"asn,omitempty"` - Neighbor *string `json:"neighbor,omitempty"` - StateOrPrefixesReceived *string `json:"stateOrPrefixesReceived,omitempty"` - UpDown *string `json:"upDown,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/predicates.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/predicates.go deleted file mode 100644 index 8399718cebc..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionRoutesTableSummaryOperationPredicate struct { - Asn *int64 - Neighbor *string - StateOrPrefixesReceived *string - UpDown *string -} - -func (p ExpressRouteCrossConnectionRoutesTableSummaryOperationPredicate) Matches(input ExpressRouteCrossConnectionRoutesTableSummary) bool { - - if p.Asn != nil && (input.Asn == nil || *p.Asn != *input.Asn) { - return false - } - - if p.Neighbor != nil && (input.Neighbor == nil || *p.Neighbor != *input.Neighbor) { - return false - } - - if p.StateOrPrefixesReceived != nil && (input.StateOrPrefixesReceived == nil || *p.StateOrPrefixesReceived != *input.StateOrPrefixesReceived) { - return false - } - - if p.UpDown != nil && (input.UpDown == nil || *p.UpDown != *input.UpDown) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/version.go b/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/version.go deleted file mode 100644 index a47aa1984ab..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnectionroutetablesummary/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnectionroutetablesummary - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnectionroutetablesummary/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/README.md b/resource-manager/network/2023-06-01/expressroutecrossconnections/README.md deleted file mode 100644 index e597eb115d8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/README.md +++ /dev/null @@ -1,109 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutecrossconnections` Documentation - -The `expressroutecrossconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutecrossconnections" -``` - - -### Client Initialization - -```go -client := expressroutecrossconnections.NewExpressRouteCrossConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteCrossConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -payload := expressroutecrossconnections.ExpressRouteCrossConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteCrossConnectionsClient.Get` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.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: `ExpressRouteCrossConnectionsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutecrossconnections.NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - -payload := expressroutecrossconnections.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/network/2023-06-01/expressroutecrossconnections/client.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/client.go deleted file mode 100644 index 67aa896c58d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutecrossconnections - -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 ExpressRouteCrossConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteCrossConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteCrossConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutecrossconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteCrossConnectionsClient: %+v", err) - } - - return &ExpressRouteCrossConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/constants.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/constants.go deleted file mode 100644 index 2e9d3456d55..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package expressroutecrossconnections - -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 ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type ServiceProviderProvisioningState string - -const ( - ServiceProviderProvisioningStateDeprovisioning ServiceProviderProvisioningState = "Deprovisioning" - ServiceProviderProvisioningStateNotProvisioned ServiceProviderProvisioningState = "NotProvisioned" - ServiceProviderProvisioningStateProvisioned ServiceProviderProvisioningState = "Provisioned" - ServiceProviderProvisioningStateProvisioning ServiceProviderProvisioningState = "Provisioning" -) - -func PossibleValuesForServiceProviderProvisioningState() []string { - return []string{ - string(ServiceProviderProvisioningStateDeprovisioning), - string(ServiceProviderProvisioningStateNotProvisioned), - string(ServiceProviderProvisioningStateProvisioned), - string(ServiceProviderProvisioningStateProvisioning), - } -} - -func (s *ServiceProviderProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServiceProviderProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServiceProviderProvisioningState(input string) (*ServiceProviderProvisioningState, error) { - vals := map[string]ServiceProviderProvisioningState{ - "deprovisioning": ServiceProviderProvisioningStateDeprovisioning, - "notprovisioned": ServiceProviderProvisioningStateNotProvisioned, - "provisioned": ServiceProviderProvisioningStateProvisioned, - "provisioning": ServiceProviderProvisioningStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServiceProviderProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection.go deleted file mode 100644 index 3748db0d3a2..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutecrossconnections - -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(&ExpressRouteCrossConnectionId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteCrossConnectionId{} - -// ExpressRouteCrossConnectionId is a struct representing the Resource ID for a Express Route Cross Connection -type ExpressRouteCrossConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCrossConnectionName string -} - -// NewExpressRouteCrossConnectionID returns a new ExpressRouteCrossConnectionId struct -func NewExpressRouteCrossConnectionID(subscriptionId string, resourceGroupName string, expressRouteCrossConnectionName string) ExpressRouteCrossConnectionId { - return ExpressRouteCrossConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCrossConnectionName: expressRouteCrossConnectionName, - } -} - -// ParseExpressRouteCrossConnectionID parses 'input' into a ExpressRouteCrossConnectionId -func ParseExpressRouteCrossConnectionID(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteCrossConnectionIDInsensitively parses 'input' case-insensitively into a ExpressRouteCrossConnectionId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteCrossConnectionIDInsensitively(input string) (*ExpressRouteCrossConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteCrossConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteCrossConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteCrossConnectionId) 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.ExpressRouteCrossConnectionName, ok = input.Parsed["expressRouteCrossConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCrossConnectionName", input) - } - - return nil -} - -// ValidateExpressRouteCrossConnectionID checks that 'input' can be parsed as a Express Route Cross Connection ID -func ValidateExpressRouteCrossConnectionID(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 := ParseExpressRouteCrossConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCrossConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCrossConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCrossConnections", "expressRouteCrossConnections", "expressRouteCrossConnections"), - resourceids.UserSpecifiedSegment("expressRouteCrossConnectionName", "expressRouteCrossConnectionValue"), - } -} - -// String returns a human-readable description of this Express Route Cross Connection ID -func (id ExpressRouteCrossConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Cross Connection Name: %q", id.ExpressRouteCrossConnectionName), - } - return fmt.Sprintf("Express Route Cross Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go deleted file mode 100644 index 6fd5722f1a8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/id_expressroutecrossconnection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutecrossconnections - -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 = &ExpressRouteCrossConnectionId{} - -func TestNewExpressRouteCrossConnectionID(t *testing.T) { - id := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue") - - 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.ExpressRouteCrossConnectionName != "expressRouteCrossConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCrossConnectionName'", id.ExpressRouteCrossConnectionName, "expressRouteCrossConnectionValue") - } -} - -func TestFormatExpressRouteCrossConnectionID(t *testing.T) { - actual := NewExpressRouteCrossConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCrossConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteCrossConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionID(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestParseExpressRouteCrossConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteCrossConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCrossConnectionName: "expressRouteCrossConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCrossConnections/expressRouteCrossConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - Expected: &ExpressRouteCrossConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCrossConnectionName: "eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcRoSsCoNnEcTiOnS/eXpReSsRoUtEcRoSsCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteCrossConnectionIDInsensitively(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.ExpressRouteCrossConnectionName != v.Expected.ExpressRouteCrossConnectionName { - t.Fatalf("Expected %q but got %q for ExpressRouteCrossConnectionName", v.Expected.ExpressRouteCrossConnectionName, actual.ExpressRouteCrossConnectionName) - } - - } -} - -func TestSegmentsForExpressRouteCrossConnectionId(t *testing.T) { - segments := ExpressRouteCrossConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteCrossConnectionId 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/network/2023-06-01/expressroutecrossconnections/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/method_createorupdate.go deleted file mode 100644 index bc67ec4a5f8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/method_createorupdate.go +++ /dev/null @@ -1,74 +0,0 @@ -package expressroutecrossconnections - -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 *ExpressRouteCrossConnection -} - -// CreateOrUpdate ... -func (c ExpressRouteCrossConnectionsClient) CreateOrUpdate(ctx context.Context, id ExpressRouteCrossConnectionId, input ExpressRouteCrossConnection) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteCrossConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteCrossConnectionId, input ExpressRouteCrossConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutecrossconnections/method_get.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/method_get.go deleted file mode 100644 index 250556ca005..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutecrossconnections - -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 *ExpressRouteCrossConnection -} - -// Get ... -func (c ExpressRouteCrossConnectionsClient) Get(ctx context.Context, id ExpressRouteCrossConnectionId) (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 ExpressRouteCrossConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/method_list.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/method_list.go deleted file mode 100644 index f422a663eea..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecrossconnections - -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 *[]ExpressRouteCrossConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnection -} - -// List ... -func (c ExpressRouteCrossConnectionsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCrossConnections", 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 *[]ExpressRouteCrossConnection `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 ExpressRouteCrossConnectionsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteCrossConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCrossConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteCrossConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteCrossConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecrossconnections/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/method_listbyresourcegroup.go deleted file mode 100644 index 42ee8a98379..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressroutecrossconnections - -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 *[]ExpressRouteCrossConnection -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteCrossConnection -} - -// ListByResourceGroup ... -func (c ExpressRouteCrossConnectionsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteCrossConnections", 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 *[]ExpressRouteCrossConnection `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 ExpressRouteCrossConnectionsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ExpressRouteCrossConnectionOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteCrossConnectionsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRouteCrossConnectionOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ExpressRouteCrossConnection, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutecrossconnections/method_updatetags.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/method_updatetags.go deleted file mode 100644 index 0c627c7653a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package expressroutecrossconnections - -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 *ExpressRouteCrossConnection -} - -// UpdateTags ... -func (c ExpressRouteCrossConnectionsClient) UpdateTags(ctx context.Context, id ExpressRouteCrossConnectionId, 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 ExpressRouteCrossConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 08d50c826a9..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitreference.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitreference.go deleted file mode 100644 index cbf4167bab5..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecircuitreference.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitReference struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnection.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnection.go deleted file mode 100644 index 52da62754ff..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnection.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCrossConnectionProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go deleted file mode 100644 index e207a422215..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeering.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCrossConnectionPeeringProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go deleted file mode 100644 index 0d9a1673538..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionpeeringproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionPeeringProperties struct { - AzureASN *int64 `json:"azureASN,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go deleted file mode 100644 index 84515d8082c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_expressroutecrossconnectionproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionProperties struct { - BandwidthInMbps *int64 `json:"bandwidthInMbps,omitempty"` - ExpressRouteCircuit *ExpressRouteCircuitReference `json:"expressRouteCircuit,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - Peerings *[]ExpressRouteCrossConnectionPeering `json:"peerings,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - STag *int64 `json:"sTag,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - ServiceProviderNotes *string `json:"serviceProviderNotes,omitempty"` - ServiceProviderProvisioningState *ServiceProviderProvisioningState `json:"serviceProviderProvisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 0101ae80d9e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_subresource.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_subresource.go deleted file mode 100644 index b2922ebb4d1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_tagsobject.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/model_tagsobject.go deleted file mode 100644 index f47ce1a3f42..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutecrossconnections - -// 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/network/2023-06-01/expressroutecrossconnections/predicates.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/predicates.go deleted file mode 100644 index f3d9b3a8dff..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressroutecrossconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCrossConnectionOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteCrossConnectionOperationPredicate) Matches(input ExpressRouteCrossConnection) 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 && (input.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/network/2023-06-01/expressroutecrossconnections/version.go b/resource-manager/network/2023-06-01/expressroutecrossconnections/version.go deleted file mode 100644 index 6ce511b731e..00000000000 --- a/resource-manager/network/2023-06-01/expressroutecrossconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutecrossconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutecrossconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/README.md b/resource-manager/network/2023-06-01/expressroutegateways/README.md deleted file mode 100644 index ce7f24cb261..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/README.md +++ /dev/null @@ -1,115 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutegateways` Documentation - -The `expressroutegateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutegateways" -``` - - -### Client Initialization - -```go -client := expressroutegateways.NewExpressRouteGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -payload := expressroutegateways.ExpressRouteGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.Get` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -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: `ExpressRouteGatewaysClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.ListByResourceGroup(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListBySubscription(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressroutegateways.NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - -payload := expressroutegateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/expressroutegateways/client.go b/resource-manager/network/2023-06-01/expressroutegateways/client.go deleted file mode 100644 index a1f21a852ef..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutegateways - -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 ExpressRouteGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutegateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteGatewaysClient: %+v", err) - } - - return &ExpressRouteGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/constants.go b/resource-manager/network/2023-06-01/expressroutegateways/constants.go deleted file mode 100644 index ce8f5d5f24a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressroutegateways - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway.go b/resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway.go deleted file mode 100644 index 0e06d43d298..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutegateways - -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(&ExpressRouteGatewayId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteGatewayId{} - -// ExpressRouteGatewayId is a struct representing the Resource ID for a Express Route Gateway -type ExpressRouteGatewayId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteGatewayName string -} - -// NewExpressRouteGatewayID returns a new ExpressRouteGatewayId struct -func NewExpressRouteGatewayID(subscriptionId string, resourceGroupName string, expressRouteGatewayName string) ExpressRouteGatewayId { - return ExpressRouteGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteGatewayName: expressRouteGatewayName, - } -} - -// ParseExpressRouteGatewayID parses 'input' into a ExpressRouteGatewayId -func ParseExpressRouteGatewayID(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteGatewayIDInsensitively parses 'input' case-insensitively into a ExpressRouteGatewayId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteGatewayIDInsensitively(input string) (*ExpressRouteGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteGatewayId) 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.ExpressRouteGatewayName, ok = input.Parsed["expressRouteGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteGatewayName", input) - } - - return nil -} - -// ValidateExpressRouteGatewayID checks that 'input' can be parsed as a Express Route Gateway ID -func ValidateExpressRouteGatewayID(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 := ParseExpressRouteGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Gateway ID -func (id ExpressRouteGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Gateway ID -func (id ExpressRouteGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteGateways", "expressRouteGateways", "expressRouteGateways"), - resourceids.UserSpecifiedSegment("expressRouteGatewayName", "expressRouteGatewayValue"), - } -} - -// String returns a human-readable description of this Express Route Gateway ID -func (id ExpressRouteGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Gateway Name: %q", id.ExpressRouteGatewayName), - } - return fmt.Sprintf("Express Route Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway_test.go b/resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway_test.go deleted file mode 100644 index cdb895a55c3..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/id_expressroutegateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutegateways - -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 = &ExpressRouteGatewayId{} - -func TestNewExpressRouteGatewayID(t *testing.T) { - id := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue") - - 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.ExpressRouteGatewayName != "expressRouteGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteGatewayName'", id.ExpressRouteGatewayName, "expressRouteGatewayValue") - } -} - -func TestFormatExpressRouteGatewayID(t *testing.T) { - actual := NewExpressRouteGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayID(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestParseExpressRouteGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteGatewayName: "expressRouteGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteGateways/expressRouteGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE", - Expected: &ExpressRouteGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteGatewayName: "eXpReSsRoUtEgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEgAtEwAyS/eXpReSsRoUtEgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteGatewayIDInsensitively(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.ExpressRouteGatewayName != v.Expected.ExpressRouteGatewayName { - t.Fatalf("Expected %q but got %q for ExpressRouteGatewayName", v.Expected.ExpressRouteGatewayName, actual.ExpressRouteGatewayName) - } - - } -} - -func TestSegmentsForExpressRouteGatewayId(t *testing.T) { - segments := ExpressRouteGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteGatewayId 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/network/2023-06-01/expressroutegateways/method_createorupdate.go b/resource-manager/network/2023-06-01/expressroutegateways/method_createorupdate.go deleted file mode 100644 index b02bd6b5ebb..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutegateways - -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 *ExpressRouteGateway -} - -// CreateOrUpdate ... -func (c ExpressRouteGatewaysClient) CreateOrUpdate(ctx context.Context, id ExpressRouteGatewayId, input ExpressRouteGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRouteGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRouteGatewayId, input ExpressRouteGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressroutegateways/method_delete.go b/resource-manager/network/2023-06-01/expressroutegateways/method_delete.go deleted file mode 100644 index 200f12cef03..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressroutegateways - -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 ExpressRouteGatewaysClient) Delete(ctx context.Context, id ExpressRouteGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRouteGatewaysClient) DeleteThenPoll(ctx context.Context, id ExpressRouteGatewayId) 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/network/2023-06-01/expressroutegateways/method_get.go b/resource-manager/network/2023-06-01/expressroutegateways/method_get.go deleted file mode 100644 index 74f38c464bb..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutegateways - -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 *ExpressRouteGateway -} - -// Get ... -func (c ExpressRouteGatewaysClient) Get(ctx context.Context, id ExpressRouteGatewayId) (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 ExpressRouteGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/expressroutegateways/method_listbyresourcegroup.go deleted file mode 100644 index 4676a67757a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/method_listbyresourcegroup.go +++ /dev/null @@ -1,56 +0,0 @@ -package expressroutegateways - -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 *ExpressRouteGatewayList -} - -// ListByResourceGroup ... -func (c ExpressRouteGatewaysClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteGateways", 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 ExpressRouteGatewayList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/method_listbysubscription.go b/resource-manager/network/2023-06-01/expressroutegateways/method_listbysubscription.go deleted file mode 100644 index ba74ca537ae..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/method_listbysubscription.go +++ /dev/null @@ -1,56 +0,0 @@ -package expressroutegateways - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteGatewayList -} - -// ListBySubscription ... -func (c ExpressRouteGatewaysClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteGateways", 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 ExpressRouteGatewayList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/method_updatetags.go b/resource-manager/network/2023-06-01/expressroutegateways/method_updatetags.go deleted file mode 100644 index 26c61ce6010..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressroutegateways - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteGateway -} - -// UpdateTags ... -func (c ExpressRouteGatewaysClient) UpdateTags(ctx context.Context, id ExpressRouteGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c ExpressRouteGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id ExpressRouteGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/expressroutegateways/model_expressroutecircuitpeeringid.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutecircuitpeeringid.go deleted file mode 100644 index 832d97a1174..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutecircuitpeeringid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnection.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnection.go deleted file mode 100644 index 99219dd6cfd..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnection.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnection struct { - Id *string `json:"id,omitempty"` - Name string `json:"name"` - Properties *ExpressRouteConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnectionproperties.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnectionproperties.go deleted file mode 100644 index 931b412129f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressrouteconnectionproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionProperties struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteCircuitPeering ExpressRouteCircuitPeeringId `json:"expressRouteCircuitPeering"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegateway.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegateway.go deleted file mode 100644 index 5505ff540a8..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaylist.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaylist.go deleted file mode 100644 index 51667424380..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaylist.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayList struct { - Value *[]ExpressRouteGateway `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewayproperties.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewayproperties.go deleted file mode 100644 index 4860e7d555a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewayproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayProperties struct { - AllowNonVirtualWanTraffic *bool `json:"allowNonVirtualWanTraffic,omitempty"` - AutoScaleConfiguration *ExpressRouteGatewayPropertiesAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - ExpressRouteConnections *[]ExpressRouteConnection `json:"expressRouteConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub VirtualHubId `json:"virtualHub"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go deleted file mode 100644 index 60677f25d4c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayPropertiesAutoScaleConfiguration struct { - Bounds *ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds `json:"bounds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go b/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go deleted file mode 100644 index 65a1ccb474b..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_expressroutegatewaypropertiesautoscaleconfigurationbounds.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteGatewayPropertiesAutoScaleConfigurationBounds struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_propagatedroutetable.go b/resource-manager/network/2023-06-01/expressroutegateways/model_propagatedroutetable.go deleted file mode 100644 index 93c6f306054..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_routingconfiguration.go b/resource-manager/network/2023-06-01/expressroutegateways/model_routingconfiguration.go deleted file mode 100644 index 670d9907881..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_staticroute.go b/resource-manager/network/2023-06-01/expressroutegateways/model_staticroute.go deleted file mode 100644 index 29422baf743..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_staticroutesconfig.go b/resource-manager/network/2023-06-01/expressroutegateways/model_staticroutesconfig.go deleted file mode 100644 index d570d0ec17a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_subresource.go b/resource-manager/network/2023-06-01/expressroutegateways/model_subresource.go deleted file mode 100644 index f86e3493340..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_tagsobject.go b/resource-manager/network/2023-06-01/expressroutegateways/model_tagsobject.go deleted file mode 100644 index 706aff41cd4..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// 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/network/2023-06-01/expressroutegateways/model_virtualhubid.go b/resource-manager/network/2023-06-01/expressroutegateways/model_virtualhubid.go deleted file mode 100644 index 41cb5ff6fd1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_virtualhubid.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/model_vnetroute.go b/resource-manager/network/2023-06-01/expressroutegateways/model_vnetroute.go deleted file mode 100644 index c9586e946c6..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressroutegateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutegateways/version.go b/resource-manager/network/2023-06-01/expressroutegateways/version.go deleted file mode 100644 index 8db4bdc9df1..00000000000 --- a/resource-manager/network/2023-06-01/expressroutegateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutegateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutegateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/README.md b/resource-manager/network/2023-06-01/expressroutelinks/README.md deleted file mode 100644 index 2edcc791854..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressroutelinks` Documentation - -The `expressroutelinks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressroutelinks" -``` - - -### Client Initialization - -```go -client := expressroutelinks.NewExpressRouteLinksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteLinksClient.Get` - -```go -ctx := context.TODO() -id := expressroutelinks.NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue") - -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: `ExpressRouteLinksClient.List` - -```go -ctx := context.TODO() -id := expressroutelinks.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -// 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/network/2023-06-01/expressroutelinks/client.go b/resource-manager/network/2023-06-01/expressroutelinks/client.go deleted file mode 100644 index 42ba283bf4a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressroutelinks - -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 ExpressRouteLinksClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteLinksClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteLinksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressroutelinks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteLinksClient: %+v", err) - } - - return &ExpressRouteLinksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/constants.go b/resource-manager/network/2023-06-01/expressroutelinks/constants.go deleted file mode 100644 index bc075bf128a..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package expressroutelinks - -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 ExpressRouteLinkAdminState string - -const ( - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkAdminState() []string { - return []string{ - string(ExpressRouteLinkAdminStateDisabled), - string(ExpressRouteLinkAdminStateEnabled), - } -} - -func (s *ExpressRouteLinkAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkAdminState(input string) (*ExpressRouteLinkAdminState, error) { - vals := map[string]ExpressRouteLinkAdminState{ - "disabled": ExpressRouteLinkAdminStateDisabled, - "enabled": ExpressRouteLinkAdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkAdminState(input) - return &out, nil -} - -type ExpressRouteLinkConnectorType string - -const ( - ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" - ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" -) - -func PossibleValuesForExpressRouteLinkConnectorType() []string { - return []string{ - string(ExpressRouteLinkConnectorTypeLC), - string(ExpressRouteLinkConnectorTypeSC), - } -} - -func (s *ExpressRouteLinkConnectorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkConnectorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkConnectorType(input string) (*ExpressRouteLinkConnectorType, error) { - vals := map[string]ExpressRouteLinkConnectorType{ - "lc": ExpressRouteLinkConnectorTypeLC, - "sc": ExpressRouteLinkConnectorTypeSC, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkConnectorType(input) - return &out, nil -} - -type ExpressRouteLinkMacSecCipher string - -const ( - ExpressRouteLinkMacSecCipherGcmAesOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAes128" - ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAes256" - ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAesXpn256" -) - -func PossibleValuesForExpressRouteLinkMacSecCipher() []string { - return []string{ - string(ExpressRouteLinkMacSecCipherGcmAesOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix), - string(ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix), - } -} - -func (s *ExpressRouteLinkMacSecCipher) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecCipher(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecCipher(input string) (*ExpressRouteLinkMacSecCipher, error) { - vals := map[string]ExpressRouteLinkMacSecCipher{ - "gcmaes128": ExpressRouteLinkMacSecCipherGcmAesOneTwoEight, - "gcmaes256": ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix, - "gcmaesxpn128": ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight, - "gcmaesxpn256": ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecCipher(input) - return &out, nil -} - -type ExpressRouteLinkMacSecSciState string - -const ( - ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkMacSecSciState() []string { - return []string{ - string(ExpressRouteLinkMacSecSciStateDisabled), - string(ExpressRouteLinkMacSecSciStateEnabled), - } -} - -func (s *ExpressRouteLinkMacSecSciState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecSciState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecSciState(input string) (*ExpressRouteLinkMacSecSciState, error) { - vals := map[string]ExpressRouteLinkMacSecSciState{ - "disabled": ExpressRouteLinkMacSecSciStateDisabled, - "enabled": ExpressRouteLinkMacSecSciStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecSciState(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport.go b/resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport.go deleted file mode 100644 index fdf651cde65..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressroutelinks - -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(&ExpressRoutePortId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortId{} - -// ExpressRoutePortId is a struct representing the Resource ID for a Express Route Port -type ExpressRoutePortId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string -} - -// NewExpressRoutePortID returns a new ExpressRoutePortId struct -func NewExpressRoutePortID(subscriptionId string, resourceGroupName string, expressRoutePortName string) ExpressRoutePortId { - return ExpressRoutePortId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - } -} - -// ParseExpressRoutePortID parses 'input' into a ExpressRoutePortId -func ParseExpressRoutePortID(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortIDInsensitively(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - return nil -} - -// ValidateExpressRoutePortID checks that 'input' can be parsed as a Express Route Port ID -func ValidateExpressRoutePortID(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 := ParseExpressRoutePortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port ID -func (id ExpressRoutePortId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port ID -func (id ExpressRoutePortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - } -} - -// String returns a human-readable description of this Express Route Port ID -func (id ExpressRoutePortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - } - return fmt.Sprintf("Express Route Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport_test.go b/resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport_test.go deleted file mode 100644 index de5ddef3250..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/id_expressrouteport_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressroutelinks - -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 = &ExpressRoutePortId{} - -func TestNewExpressRoutePortID(t *testing.T) { - id := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } -} - -func TestFormatExpressRoutePortID(t *testing.T) { - actual := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestParseExpressRoutePortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestSegmentsForExpressRoutePortId(t *testing.T) { - segments := ExpressRoutePortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortId 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/network/2023-06-01/expressroutelinks/id_link.go b/resource-manager/network/2023-06-01/expressroutelinks/id_link.go deleted file mode 100644 index ff86b5a2798..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/id_link.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressroutelinks - -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(&LinkId{}) -} - -var _ resourceids.ResourceId = &LinkId{} - -// LinkId is a struct representing the Resource ID for a Link -type LinkId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string - LinkName string -} - -// NewLinkID returns a new LinkId struct -func NewLinkID(subscriptionId string, resourceGroupName string, expressRoutePortName string, linkName string) LinkId { - return LinkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - LinkName: linkName, - } -} - -// ParseLinkID parses 'input' into a LinkId -func ParseLinkID(input string) (*LinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&LinkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLinkIDInsensitively parses 'input' case-insensitively into a LinkId -// note: this method should only be used for API response data and not user input -func ParseLinkIDInsensitively(input string) (*LinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&LinkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LinkId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - if id.LinkName, ok = input.Parsed["linkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "linkName", input) - } - - return nil -} - -// ValidateLinkID checks that 'input' can be parsed as a Link ID -func ValidateLinkID(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 := ParseLinkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Link ID -func (id LinkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s/links/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName, id.LinkName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Link ID -func (id LinkId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - resourceids.StaticSegment("staticLinks", "links", "links"), - resourceids.UserSpecifiedSegment("linkName", "linkValue"), - } -} - -// String returns a human-readable description of this Link ID -func (id LinkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - fmt.Sprintf("Link Name: %q", id.LinkName), - } - return fmt.Sprintf("Link (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/id_link_test.go b/resource-manager/network/2023-06-01/expressroutelinks/id_link_test.go deleted file mode 100644 index 970951aa93c..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/id_link_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressroutelinks - -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 = &LinkId{} - -func TestNewLinkID(t *testing.T) { - id := NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } - - if id.LinkName != "linkValue" { - t.Fatalf("Expected %q but got %q for Segment 'LinkName'", id.LinkName, "linkValue") - } -} - -func TestFormatLinkID(t *testing.T) { - actual := NewLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "linkValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLinkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue", - Expected: &LinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - LinkName: "linkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLinkID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.LinkName != v.Expected.LinkName { - t.Fatalf("Expected %q but got %q for LinkName", v.Expected.LinkName, actual.LinkName) - } - - } -} - -func TestParseLinkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/lInKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue", - Expected: &LinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - LinkName: "linkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/links/linkValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/lInKs/lInKvAlUe", - Expected: &LinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - LinkName: "lInKvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/lInKs/lInKvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLinkIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.LinkName != v.Expected.LinkName { - t.Fatalf("Expected %q but got %q for LinkName", v.Expected.LinkName, actual.LinkName) - } - - } -} - -func TestSegmentsForLinkId(t *testing.T) { - segments := LinkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LinkId 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/network/2023-06-01/expressroutelinks/method_get.go b/resource-manager/network/2023-06-01/expressroutelinks/method_get.go deleted file mode 100644 index 25857a7f294..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressroutelinks - -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 *ExpressRouteLink -} - -// Get ... -func (c ExpressRouteLinksClient) Get(ctx context.Context, id LinkId) (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 ExpressRouteLink - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/method_list.go b/resource-manager/network/2023-06-01/expressroutelinks/method_list.go deleted file mode 100644 index 387950ca63d..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressroutelinks - -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 *[]ExpressRouteLink -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteLink -} - -// List ... -func (c ExpressRouteLinksClient) List(ctx context.Context, id ExpressRoutePortId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/links", 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 *[]ExpressRouteLink `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 ExpressRouteLinksClient) ListComplete(ctx context.Context, id ExpressRoutePortId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteLinkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteLinksClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRoutePortId, predicate ExpressRouteLinkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteLink, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressroutelinks/model_expressroutelink.go b/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelink.go deleted file mode 100644 index d8919f16d71..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkmacsecconfig.go b/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkmacsecconfig.go deleted file mode 100644 index 91551b3b16f..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkmacsecconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkMacSecConfig struct { - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - Cipher *ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - SciState *ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkpropertiesformat.go b/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkpropertiesformat.go deleted file mode 100644 index 6d9466ff4ff..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/model_expressroutelinkpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkPropertiesFormat struct { - AdminState *ExpressRouteLinkAdminState `json:"adminState,omitempty"` - ColoLocation *string `json:"coloLocation,omitempty"` - ConnectorType *ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` - InterfaceName *string `json:"interfaceName,omitempty"` - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` - PatchPanelId *string `json:"patchPanelId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RackId *string `json:"rackId,omitempty"` - RouterName *string `json:"routerName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/predicates.go b/resource-manager/network/2023-06-01/expressroutelinks/predicates.go deleted file mode 100644 index bd6127afc55..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package expressroutelinks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p ExpressRouteLinkOperationPredicate) Matches(input ExpressRouteLink) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/expressroutelinks/version.go b/resource-manager/network/2023-06-01/expressroutelinks/version.go deleted file mode 100644 index ae16e840a41..00000000000 --- a/resource-manager/network/2023-06-01/expressroutelinks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressroutelinks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressroutelinks/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/README.md b/resource-manager/network/2023-06-01/expressrouteportauthorizations/README.md deleted file mode 100644 index f27f373c622..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteportauthorizations` Documentation - -The `expressrouteportauthorizations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressrouteportauthorizations" -``` - - -### Client Initialization - -```go -client := expressrouteportauthorizations.NewExpressRoutePortAuthorizationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -payload := expressrouteportauthorizations.ExpressRoutePortAuthorization{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortAuthorizationsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - -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: `ExpressRoutePortAuthorizationsClient.List` - -```go -ctx := context.TODO() -id := expressrouteportauthorizations.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -// 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/network/2023-06-01/expressrouteportauthorizations/client.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/client.go deleted file mode 100644 index a6a1e906e85..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteportauthorizations - -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 ExpressRoutePortAuthorizationsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRoutePortAuthorizationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRoutePortAuthorizationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteportauthorizations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRoutePortAuthorizationsClient: %+v", err) - } - - return &ExpressRoutePortAuthorizationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/constants.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/constants.go deleted file mode 100644 index 3fbd20f1075..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package expressrouteportauthorizations - -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 ExpressRoutePortAuthorizationUseStatus string - -const ( - ExpressRoutePortAuthorizationUseStatusAvailable ExpressRoutePortAuthorizationUseStatus = "Available" - ExpressRoutePortAuthorizationUseStatusInUse ExpressRoutePortAuthorizationUseStatus = "InUse" -) - -func PossibleValuesForExpressRoutePortAuthorizationUseStatus() []string { - return []string{ - string(ExpressRoutePortAuthorizationUseStatusAvailable), - string(ExpressRoutePortAuthorizationUseStatusInUse), - } -} - -func (s *ExpressRoutePortAuthorizationUseStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePortAuthorizationUseStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePortAuthorizationUseStatus(input string) (*ExpressRoutePortAuthorizationUseStatus, error) { - vals := map[string]ExpressRoutePortAuthorizationUseStatus{ - "available": ExpressRoutePortAuthorizationUseStatusAvailable, - "inuse": ExpressRoutePortAuthorizationUseStatusInUse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePortAuthorizationUseStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport.go deleted file mode 100644 index 9fffd1964c0..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressrouteportauthorizations - -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(&ExpressRoutePortId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortId{} - -// ExpressRoutePortId is a struct representing the Resource ID for a Express Route Port -type ExpressRoutePortId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string -} - -// NewExpressRoutePortID returns a new ExpressRoutePortId struct -func NewExpressRoutePortID(subscriptionId string, resourceGroupName string, expressRoutePortName string) ExpressRoutePortId { - return ExpressRoutePortId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - } -} - -// ParseExpressRoutePortID parses 'input' into a ExpressRoutePortId -func ParseExpressRoutePortID(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortIDInsensitively(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - return nil -} - -// ValidateExpressRoutePortID checks that 'input' can be parsed as a Express Route Port ID -func ValidateExpressRoutePortID(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 := ParseExpressRoutePortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port ID -func (id ExpressRoutePortId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port ID -func (id ExpressRoutePortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - } -} - -// String returns a human-readable description of this Express Route Port ID -func (id ExpressRoutePortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - } - return fmt.Sprintf("Express Route Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport_test.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport_test.go deleted file mode 100644 index 3202d0fbe70..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteport_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressrouteportauthorizations - -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 = &ExpressRoutePortId{} - -func TestNewExpressRoutePortID(t *testing.T) { - id := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } -} - -func TestFormatExpressRoutePortID(t *testing.T) { - actual := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestParseExpressRoutePortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestSegmentsForExpressRoutePortId(t *testing.T) { - segments := ExpressRoutePortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortId 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/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization.go deleted file mode 100644 index 4042eea1718..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization.go +++ /dev/null @@ -1,139 +0,0 @@ -package expressrouteportauthorizations - -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(&ExpressRoutePortAuthorizationId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortAuthorizationId{} - -// ExpressRoutePortAuthorizationId is a struct representing the Resource ID for a Express Route Port Authorization -type ExpressRoutePortAuthorizationId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string - AuthorizationName string -} - -// NewExpressRoutePortAuthorizationID returns a new ExpressRoutePortAuthorizationId struct -func NewExpressRoutePortAuthorizationID(subscriptionId string, resourceGroupName string, expressRoutePortName string, authorizationName string) ExpressRoutePortAuthorizationId { - return ExpressRoutePortAuthorizationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - AuthorizationName: authorizationName, - } -} - -// ParseExpressRoutePortAuthorizationID parses 'input' into a ExpressRoutePortAuthorizationId -func ParseExpressRoutePortAuthorizationID(input string) (*ExpressRoutePortAuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortAuthorizationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortAuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortAuthorizationIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortAuthorizationId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortAuthorizationIDInsensitively(input string) (*ExpressRoutePortAuthorizationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortAuthorizationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortAuthorizationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortAuthorizationId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - if id.AuthorizationName, ok = input.Parsed["authorizationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "authorizationName", input) - } - - return nil -} - -// ValidateExpressRoutePortAuthorizationID checks that 'input' can be parsed as a Express Route Port Authorization ID -func ValidateExpressRoutePortAuthorizationID(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 := ParseExpressRoutePortAuthorizationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port Authorization ID -func (id ExpressRoutePortAuthorizationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s/authorizations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName, id.AuthorizationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port Authorization ID -func (id ExpressRoutePortAuthorizationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - resourceids.StaticSegment("staticAuthorizations", "authorizations", "authorizations"), - resourceids.UserSpecifiedSegment("authorizationName", "authorizationValue"), - } -} - -// String returns a human-readable description of this Express Route Port Authorization ID -func (id ExpressRoutePortAuthorizationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - fmt.Sprintf("Authorization Name: %q", id.AuthorizationName), - } - return fmt.Sprintf("Express Route Port Authorization (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go deleted file mode 100644 index 2c7b32a0618..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/id_expressrouteportauthorization_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package expressrouteportauthorizations - -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 = &ExpressRoutePortAuthorizationId{} - -func TestNewExpressRoutePortAuthorizationID(t *testing.T) { - id := NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } - - if id.AuthorizationName != "authorizationValue" { - t.Fatalf("Expected %q but got %q for Segment 'AuthorizationName'", id.AuthorizationName, "authorizationValue") - } -} - -func TestFormatExpressRoutePortAuthorizationID(t *testing.T) { - actual := NewExpressRoutePortAuthorizationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue", "authorizationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortAuthorizationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortAuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue", - Expected: &ExpressRoutePortAuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortAuthorizationID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestParseExpressRoutePortAuthorizationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortAuthorizationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/aUtHoRiZaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue", - Expected: &ExpressRoutePortAuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - AuthorizationName: "authorizationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/authorizations/authorizationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE", - Expected: &ExpressRoutePortAuthorizationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - AuthorizationName: "aUtHoRiZaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/aUtHoRiZaTiOnS/aUtHoRiZaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortAuthorizationIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - if actual.AuthorizationName != v.Expected.AuthorizationName { - t.Fatalf("Expected %q but got %q for AuthorizationName", v.Expected.AuthorizationName, actual.AuthorizationName) - } - - } -} - -func TestSegmentsForExpressRoutePortAuthorizationId(t *testing.T) { - segments := ExpressRoutePortAuthorizationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortAuthorizationId 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/network/2023-06-01/expressrouteportauthorizations/method_createorupdate.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_createorupdate.go deleted file mode 100644 index 9e08a949ed3..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressrouteportauthorizations - -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 *ExpressRoutePortAuthorization -} - -// CreateOrUpdate ... -func (c ExpressRoutePortAuthorizationsClient) CreateOrUpdate(ctx context.Context, id ExpressRoutePortAuthorizationId, input ExpressRoutePortAuthorization) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRoutePortAuthorizationsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRoutePortAuthorizationId, input ExpressRoutePortAuthorization) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressrouteportauthorizations/method_delete.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_delete.go deleted file mode 100644 index 8940670b615..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressrouteportauthorizations - -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 ExpressRoutePortAuthorizationsClient) Delete(ctx context.Context, id ExpressRoutePortAuthorizationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRoutePortAuthorizationsClient) DeleteThenPoll(ctx context.Context, id ExpressRoutePortAuthorizationId) 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/network/2023-06-01/expressrouteportauthorizations/method_get.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_get.go deleted file mode 100644 index 0dd81644eba..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteportauthorizations - -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 *ExpressRoutePortAuthorization -} - -// Get ... -func (c ExpressRoutePortAuthorizationsClient) Get(ctx context.Context, id ExpressRoutePortAuthorizationId) (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 ExpressRoutePortAuthorization - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_list.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_list.go deleted file mode 100644 index 01e0d857a47..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package expressrouteportauthorizations - -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 *[]ExpressRoutePortAuthorization -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePortAuthorization -} - -// List ... -func (c ExpressRoutePortAuthorizationsClient) List(ctx context.Context, id ExpressRoutePortId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/authorizations", 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 *[]ExpressRoutePortAuthorization `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 ExpressRoutePortAuthorizationsClient) ListComplete(ctx context.Context, id ExpressRoutePortId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRoutePortAuthorizationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortAuthorizationsClient) ListCompleteMatchingPredicate(ctx context.Context, id ExpressRoutePortId, predicate ExpressRoutePortAuthorizationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRoutePortAuthorization, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorization.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorization.go deleted file mode 100644 index aee29af0a99..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorization.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortAuthorization struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRoutePortAuthorizationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go deleted file mode 100644 index 9370c4f6323..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/model_expressrouteportauthorizationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteportauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortAuthorizationPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - AuthorizationUseStatus *ExpressRoutePortAuthorizationUseStatus `json:"authorizationUseStatus,omitempty"` - CircuitResourceUri *string `json:"circuitResourceUri,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteportauthorizations/predicates.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/predicates.go deleted file mode 100644 index d12fc29e52a..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressrouteportauthorizations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortAuthorizationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ExpressRoutePortAuthorizationOperationPredicate) Matches(input ExpressRoutePortAuthorization) 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.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/network/2023-06-01/expressrouteportauthorizations/version.go b/resource-manager/network/2023-06-01/expressrouteportauthorizations/version.go deleted file mode 100644 index e3c485454b4..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportauthorizations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportauthorizations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportauthorizations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/README.md b/resource-manager/network/2023-06-01/expressrouteports/README.md deleted file mode 100644 index 4a1aec8a8b2..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/README.md +++ /dev/null @@ -1,142 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteports` Documentation - -The `expressrouteports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressrouteports" -``` - - -### Client Initialization - -```go -client := expressrouteports.NewExpressRoutePortsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.ExpressRoutePort{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortsClient.Delete` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ExpressRoutePortsClient.GenerateLOA` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.GenerateExpressRoutePortsLOARequest{ - // ... -} - - -read, err := client.GenerateLOA(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRoutePortsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.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: `ExpressRoutePortsClient.UpdateTags` - -```go -ctx := context.TODO() -id := expressrouteports.NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - -payload := expressrouteports.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/network/2023-06-01/expressrouteports/client.go b/resource-manager/network/2023-06-01/expressrouteports/client.go deleted file mode 100644 index 7b73cfca2af..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteports - -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 ExpressRoutePortsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRoutePortsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRoutePortsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteports", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRoutePortsClient: %+v", err) - } - - return &ExpressRoutePortsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/constants.go b/resource-manager/network/2023-06-01/expressrouteports/constants.go deleted file mode 100644 index 0c08bc2c72f..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/constants.go +++ /dev/null @@ -1,309 +0,0 @@ -package expressrouteports - -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 ExpressRouteLinkAdminState string - -const ( - ExpressRouteLinkAdminStateDisabled ExpressRouteLinkAdminState = "Disabled" - ExpressRouteLinkAdminStateEnabled ExpressRouteLinkAdminState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkAdminState() []string { - return []string{ - string(ExpressRouteLinkAdminStateDisabled), - string(ExpressRouteLinkAdminStateEnabled), - } -} - -func (s *ExpressRouteLinkAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkAdminState(input string) (*ExpressRouteLinkAdminState, error) { - vals := map[string]ExpressRouteLinkAdminState{ - "disabled": ExpressRouteLinkAdminStateDisabled, - "enabled": ExpressRouteLinkAdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkAdminState(input) - return &out, nil -} - -type ExpressRouteLinkConnectorType string - -const ( - ExpressRouteLinkConnectorTypeLC ExpressRouteLinkConnectorType = "LC" - ExpressRouteLinkConnectorTypeSC ExpressRouteLinkConnectorType = "SC" -) - -func PossibleValuesForExpressRouteLinkConnectorType() []string { - return []string{ - string(ExpressRouteLinkConnectorTypeLC), - string(ExpressRouteLinkConnectorTypeSC), - } -} - -func (s *ExpressRouteLinkConnectorType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkConnectorType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkConnectorType(input string) (*ExpressRouteLinkConnectorType, error) { - vals := map[string]ExpressRouteLinkConnectorType{ - "lc": ExpressRouteLinkConnectorTypeLC, - "sc": ExpressRouteLinkConnectorTypeSC, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkConnectorType(input) - return &out, nil -} - -type ExpressRouteLinkMacSecCipher string - -const ( - ExpressRouteLinkMacSecCipherGcmAesOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAes128" - ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAes256" - ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight ExpressRouteLinkMacSecCipher = "GcmAesXpn128" - ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix ExpressRouteLinkMacSecCipher = "GcmAesXpn256" -) - -func PossibleValuesForExpressRouteLinkMacSecCipher() []string { - return []string{ - string(ExpressRouteLinkMacSecCipherGcmAesOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix), - string(ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight), - string(ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix), - } -} - -func (s *ExpressRouteLinkMacSecCipher) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecCipher(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecCipher(input string) (*ExpressRouteLinkMacSecCipher, error) { - vals := map[string]ExpressRouteLinkMacSecCipher{ - "gcmaes128": ExpressRouteLinkMacSecCipherGcmAesOneTwoEight, - "gcmaes256": ExpressRouteLinkMacSecCipherGcmAesTwoFiveSix, - "gcmaesxpn128": ExpressRouteLinkMacSecCipherGcmAesXpnOneTwoEight, - "gcmaesxpn256": ExpressRouteLinkMacSecCipherGcmAesXpnTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecCipher(input) - return &out, nil -} - -type ExpressRouteLinkMacSecSciState string - -const ( - ExpressRouteLinkMacSecSciStateDisabled ExpressRouteLinkMacSecSciState = "Disabled" - ExpressRouteLinkMacSecSciStateEnabled ExpressRouteLinkMacSecSciState = "Enabled" -) - -func PossibleValuesForExpressRouteLinkMacSecSciState() []string { - return []string{ - string(ExpressRouteLinkMacSecSciStateDisabled), - string(ExpressRouteLinkMacSecSciStateEnabled), - } -} - -func (s *ExpressRouteLinkMacSecSciState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteLinkMacSecSciState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteLinkMacSecSciState(input string) (*ExpressRouteLinkMacSecSciState, error) { - vals := map[string]ExpressRouteLinkMacSecSciState{ - "disabled": ExpressRouteLinkMacSecSciStateDisabled, - "enabled": ExpressRouteLinkMacSecSciStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteLinkMacSecSciState(input) - return &out, nil -} - -type ExpressRoutePortsBillingType string - -const ( - ExpressRoutePortsBillingTypeMeteredData ExpressRoutePortsBillingType = "MeteredData" - ExpressRoutePortsBillingTypeUnlimitedData ExpressRoutePortsBillingType = "UnlimitedData" -) - -func PossibleValuesForExpressRoutePortsBillingType() []string { - return []string{ - string(ExpressRoutePortsBillingTypeMeteredData), - string(ExpressRoutePortsBillingTypeUnlimitedData), - } -} - -func (s *ExpressRoutePortsBillingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePortsBillingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePortsBillingType(input string) (*ExpressRoutePortsBillingType, error) { - vals := map[string]ExpressRoutePortsBillingType{ - "metereddata": ExpressRoutePortsBillingTypeMeteredData, - "unlimiteddata": ExpressRoutePortsBillingTypeUnlimitedData, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePortsBillingType(input) - return &out, nil -} - -type ExpressRoutePortsEncapsulation string - -const ( - ExpressRoutePortsEncapsulationDotOneQ ExpressRoutePortsEncapsulation = "Dot1Q" - ExpressRoutePortsEncapsulationQinQ ExpressRoutePortsEncapsulation = "QinQ" -) - -func PossibleValuesForExpressRoutePortsEncapsulation() []string { - return []string{ - string(ExpressRoutePortsEncapsulationDotOneQ), - string(ExpressRoutePortsEncapsulationQinQ), - } -} - -func (s *ExpressRoutePortsEncapsulation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePortsEncapsulation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePortsEncapsulation(input string) (*ExpressRoutePortsEncapsulation, error) { - vals := map[string]ExpressRoutePortsEncapsulation{ - "dot1q": ExpressRoutePortsEncapsulationDotOneQ, - "qinq": ExpressRoutePortsEncapsulationQinQ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePortsEncapsulation(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport.go b/resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport.go deleted file mode 100644 index 6ac3a3831e8..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport.go +++ /dev/null @@ -1,130 +0,0 @@ -package expressrouteports - -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(&ExpressRoutePortId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortId{} - -// ExpressRoutePortId is a struct representing the Resource ID for a Express Route Port -type ExpressRoutePortId struct { - SubscriptionId string - ResourceGroupName string - ExpressRoutePortName string -} - -// NewExpressRoutePortID returns a new ExpressRoutePortId struct -func NewExpressRoutePortID(subscriptionId string, resourceGroupName string, expressRoutePortName string) ExpressRoutePortId { - return ExpressRoutePortId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRoutePortName: expressRoutePortName, - } -} - -// ParseExpressRoutePortID parses 'input' into a ExpressRoutePortId -func ParseExpressRoutePortID(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortIDInsensitively(input string) (*ExpressRoutePortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortId) 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.ExpressRoutePortName, ok = input.Parsed["expressRoutePortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortName", input) - } - - return nil -} - -// ValidateExpressRoutePortID checks that 'input' can be parsed as a Express Route Port ID -func ValidateExpressRoutePortID(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 := ParseExpressRoutePortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Port ID -func (id ExpressRoutePortId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRoutePorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRoutePortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Port ID -func (id ExpressRoutePortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePorts", "expressRoutePorts", "expressRoutePorts"), - resourceids.UserSpecifiedSegment("expressRoutePortName", "expressRoutePortValue"), - } -} - -// String returns a human-readable description of this Express Route Port ID -func (id ExpressRoutePortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Port Name: %q", id.ExpressRoutePortName), - } - return fmt.Sprintf("Express Route Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport_test.go b/resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport_test.go deleted file mode 100644 index ddf9459854a..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/id_expressrouteport_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package expressrouteports - -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 = &ExpressRoutePortId{} - -func TestNewExpressRoutePortID(t *testing.T) { - id := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue") - - 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.ExpressRoutePortName != "expressRoutePortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortName'", id.ExpressRoutePortName, "expressRoutePortValue") - } -} - -func TestFormatExpressRoutePortID(t *testing.T) { - actual := NewExpressRoutePortID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRoutePortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortID(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestParseExpressRoutePortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRoutePortName: "expressRoutePortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRoutePorts/expressRoutePortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe", - Expected: &ExpressRoutePortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRoutePortName: "eXpReSsRoUtEpOrTvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEpOrTs/eXpReSsRoUtEpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortIDInsensitively(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.ExpressRoutePortName != v.Expected.ExpressRoutePortName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortName", v.Expected.ExpressRoutePortName, actual.ExpressRoutePortName) - } - - } -} - -func TestSegmentsForExpressRoutePortId(t *testing.T) { - segments := ExpressRoutePortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortId 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/network/2023-06-01/expressrouteports/method_createorupdate.go b/resource-manager/network/2023-06-01/expressrouteports/method_createorupdate.go deleted file mode 100644 index 34782a4d4f3..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package expressrouteports - -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 *ExpressRoutePort -} - -// CreateOrUpdate ... -func (c ExpressRoutePortsClient) CreateOrUpdate(ctx context.Context, id ExpressRoutePortId, input ExpressRoutePort) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ExpressRoutePortsClient) CreateOrUpdateThenPoll(ctx context.Context, id ExpressRoutePortId, input ExpressRoutePort) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/expressrouteports/method_delete.go b/resource-manager/network/2023-06-01/expressrouteports/method_delete.go deleted file mode 100644 index 899e7de35bd..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package expressrouteports - -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 ExpressRoutePortsClient) Delete(ctx context.Context, id ExpressRoutePortId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ExpressRoutePortsClient) DeleteThenPoll(ctx context.Context, id ExpressRoutePortId) 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/network/2023-06-01/expressrouteports/method_generateloa.go b/resource-manager/network/2023-06-01/expressrouteports/method_generateloa.go deleted file mode 100644 index d0010451bf9..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_generateloa.go +++ /dev/null @@ -1,59 +0,0 @@ -package expressrouteports - -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 GenerateLOAOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *GenerateExpressRoutePortsLOAResult -} - -// GenerateLOA ... -func (c ExpressRoutePortsClient) GenerateLOA(ctx context.Context, id ExpressRoutePortId, input GenerateExpressRoutePortsLOARequest) (result GenerateLOAOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generateLoa", 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 GenerateExpressRoutePortsLOAResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/method_get.go b/resource-manager/network/2023-06-01/expressrouteports/method_get.go deleted file mode 100644 index 0f35b842ad6..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteports - -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 *ExpressRoutePort -} - -// Get ... -func (c ExpressRoutePortsClient) Get(ctx context.Context, id ExpressRoutePortId) (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 ExpressRoutePort - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/method_list.go b/resource-manager/network/2023-06-01/expressrouteports/method_list.go deleted file mode 100644 index 04ce9e24ba1..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteports - -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 *[]ExpressRoutePort -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePort -} - -// List ... -func (c ExpressRoutePortsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRoutePorts", 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 *[]ExpressRoutePort `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 ExpressRoutePortsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRoutePortOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRoutePortOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRoutePort, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressrouteports/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/expressrouteports/method_listbyresourcegroup.go deleted file mode 100644 index bef430c396b..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteports - -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 *[]ExpressRoutePort -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePort -} - -// ListByResourceGroup ... -func (c ExpressRoutePortsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRoutePorts", 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 *[]ExpressRoutePort `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 ExpressRoutePortsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ExpressRoutePortOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ExpressRoutePortOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ExpressRoutePort, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/expressrouteports/method_updatetags.go b/resource-manager/network/2023-06-01/expressrouteports/method_updatetags.go deleted file mode 100644 index fef0242df71..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package expressrouteports - -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 *ExpressRoutePort -} - -// UpdateTags ... -func (c ExpressRoutePortsClient) UpdateTags(ctx context.Context, id ExpressRoutePortId, 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 ExpressRoutePort - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelink.go b/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelink.go deleted file mode 100644 index 60ed59156ad..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelink.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteLinkPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkmacsecconfig.go b/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkmacsecconfig.go deleted file mode 100644 index f41c94b3401..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkmacsecconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkMacSecConfig struct { - CakSecretIdentifier *string `json:"cakSecretIdentifier,omitempty"` - Cipher *ExpressRouteLinkMacSecCipher `json:"cipher,omitempty"` - CknSecretIdentifier *string `json:"cknSecretIdentifier,omitempty"` - SciState *ExpressRouteLinkMacSecSciState `json:"sciState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkpropertiesformat.go b/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkpropertiesformat.go deleted file mode 100644 index a9fd2f6e03d..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_expressroutelinkpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteLinkPropertiesFormat struct { - AdminState *ExpressRouteLinkAdminState `json:"adminState,omitempty"` - ColoLocation *string `json:"coloLocation,omitempty"` - ConnectorType *ExpressRouteLinkConnectorType `json:"connectorType,omitempty"` - InterfaceName *string `json:"interfaceName,omitempty"` - MacSecConfig *ExpressRouteLinkMacSecConfig `json:"macSecConfig,omitempty"` - PatchPanelId *string `json:"patchPanelId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RackId *string `json:"rackId,omitempty"` - RouterName *string `json:"routerName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_expressrouteport.go b/resource-manager/network/2023-06-01/expressrouteports/model_expressrouteport.go deleted file mode 100644 index 4e2aa94784f..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_expressrouteport.go +++ /dev/null @@ -1,19 +0,0 @@ -package expressrouteports - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRoutePortPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_expressrouteportpropertiesformat.go b/resource-manager/network/2023-06-01/expressrouteports/model_expressrouteportpropertiesformat.go deleted file mode 100644 index 897d5ea08de..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_expressrouteportpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortPropertiesFormat struct { - AllocationDate *string `json:"allocationDate,omitempty"` - BandwidthInGbps *int64 `json:"bandwidthInGbps,omitempty"` - BillingType *ExpressRoutePortsBillingType `json:"billingType,omitempty"` - Circuits *[]SubResource `json:"circuits,omitempty"` - Encapsulation *ExpressRoutePortsEncapsulation `json:"encapsulation,omitempty"` - EtherType *string `json:"etherType,omitempty"` - Links *[]ExpressRouteLink `json:"links,omitempty"` - Mtu *string `json:"mtu,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - ProvisionedBandwidthInGbps *float64 `json:"provisionedBandwidthInGbps,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloarequest.go b/resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloarequest.go deleted file mode 100644 index d588660f834..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloarequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateExpressRoutePortsLOARequest struct { - CustomerName string `json:"customerName"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloaresult.go b/resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloaresult.go deleted file mode 100644 index 54defeace0f..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_generateexpressrouteportsloaresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GenerateExpressRoutePortsLOAResult struct { - EncodedContent *string `json:"encodedContent,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_subresource.go b/resource-manager/network/2023-06-01/expressrouteports/model_subresource.go deleted file mode 100644 index ef7329a3163..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteports/model_tagsobject.go b/resource-manager/network/2023-06-01/expressrouteports/model_tagsobject.go deleted file mode 100644 index d0cb6f9d317..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package expressrouteports - -// 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/network/2023-06-01/expressrouteports/predicates.go b/resource-manager/network/2023-06-01/expressrouteports/predicates.go deleted file mode 100644 index 7339fac991b..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressrouteports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRoutePortOperationPredicate) Matches(input ExpressRoutePort) 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 && (input.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/network/2023-06-01/expressrouteports/version.go b/resource-manager/network/2023-06-01/expressrouteports/version.go deleted file mode 100644 index 96d11cf45d1..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteports/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteports - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteports/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/README.md b/resource-manager/network/2023-06-01/expressrouteportslocations/README.md deleted file mode 100644 index de2c2f43247..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteportslocations` Documentation - -The `expressrouteportslocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressrouteportslocations" -``` - - -### Client Initialization - -```go -client := expressrouteportslocations.NewExpressRoutePortsLocationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRoutePortsLocationsClient.Get` - -```go -ctx := context.TODO() -id := expressrouteportslocations.NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue") - -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: `ExpressRoutePortsLocationsClient.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 -} -``` diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/client.go b/resource-manager/network/2023-06-01/expressrouteportslocations/client.go deleted file mode 100644 index 070961a7825..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteportslocations - -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 ExpressRoutePortsLocationsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRoutePortsLocationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRoutePortsLocationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteportslocations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRoutePortsLocationsClient: %+v", err) - } - - return &ExpressRoutePortsLocationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/constants.go b/resource-manager/network/2023-06-01/expressrouteportslocations/constants.go deleted file mode 100644 index 79d7bad3ae5..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package expressrouteportslocations - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation.go b/resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation.go deleted file mode 100644 index 94e09ce7a77..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation.go +++ /dev/null @@ -1,121 +0,0 @@ -package expressrouteportslocations - -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(&ExpressRoutePortsLocationId{}) -} - -var _ resourceids.ResourceId = &ExpressRoutePortsLocationId{} - -// ExpressRoutePortsLocationId is a struct representing the Resource ID for a Express Route Ports Location -type ExpressRoutePortsLocationId struct { - SubscriptionId string - ExpressRoutePortsLocationName string -} - -// NewExpressRoutePortsLocationID returns a new ExpressRoutePortsLocationId struct -func NewExpressRoutePortsLocationID(subscriptionId string, expressRoutePortsLocationName string) ExpressRoutePortsLocationId { - return ExpressRoutePortsLocationId{ - SubscriptionId: subscriptionId, - ExpressRoutePortsLocationName: expressRoutePortsLocationName, - } -} - -// ParseExpressRoutePortsLocationID parses 'input' into a ExpressRoutePortsLocationId -func ParseExpressRoutePortsLocationID(input string) (*ExpressRoutePortsLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortsLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortsLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRoutePortsLocationIDInsensitively parses 'input' case-insensitively into a ExpressRoutePortsLocationId -// note: this method should only be used for API response data and not user input -func ParseExpressRoutePortsLocationIDInsensitively(input string) (*ExpressRoutePortsLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRoutePortsLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRoutePortsLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRoutePortsLocationId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ExpressRoutePortsLocationName, ok = input.Parsed["expressRoutePortsLocationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRoutePortsLocationName", input) - } - - return nil -} - -// ValidateExpressRoutePortsLocationID checks that 'input' can be parsed as a Express Route Ports Location ID -func ValidateExpressRoutePortsLocationID(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 := ParseExpressRoutePortsLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Ports Location ID -func (id ExpressRoutePortsLocationId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/expressRoutePortsLocations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ExpressRoutePortsLocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Ports Location ID -func (id ExpressRoutePortsLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRoutePortsLocations", "expressRoutePortsLocations", "expressRoutePortsLocations"), - resourceids.UserSpecifiedSegment("expressRoutePortsLocationName", "expressRoutePortsLocationValue"), - } -} - -// String returns a human-readable description of this Express Route Ports Location ID -func (id ExpressRoutePortsLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Express Route Ports Location Name: %q", id.ExpressRoutePortsLocationName), - } - return fmt.Sprintf("Express Route Ports Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation_test.go b/resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation_test.go deleted file mode 100644 index f10f6641906..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/id_expressrouteportslocation_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package expressrouteportslocations - -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 = &ExpressRoutePortsLocationId{} - -func TestNewExpressRoutePortsLocationID(t *testing.T) { - id := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue") - - 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.ExpressRoutePortsLocationName != "expressRoutePortsLocationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRoutePortsLocationName'", id.ExpressRoutePortsLocationName, "expressRoutePortsLocationValue") - } -} - -func TestFormatExpressRoutePortsLocationID(t *testing.T) { - actual := NewExpressRoutePortsLocationID("12345678-1234-9876-4563-123456789012", "expressRoutePortsLocationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRoutePortsLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortsLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue", - Expected: &ExpressRoutePortsLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "expressRoutePortsLocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortsLocationID(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.ExpressRoutePortsLocationName != v.Expected.ExpressRoutePortsLocationName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortsLocationName", v.Expected.ExpressRoutePortsLocationName, actual.ExpressRoutePortsLocationName) - } - - } -} - -func TestParseExpressRoutePortsLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRoutePortsLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue", - Expected: &ExpressRoutePortsLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "expressRoutePortsLocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRoutePortsLocations/expressRoutePortsLocationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnVaLuE", - Expected: &ExpressRoutePortsLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRoutePortsLocationName: "eXpReSsRoUtEpOrTsLoCaTiOnVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpOrTsLoCaTiOnS/eXpReSsRoUtEpOrTsLoCaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRoutePortsLocationIDInsensitively(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.ExpressRoutePortsLocationName != v.Expected.ExpressRoutePortsLocationName { - t.Fatalf("Expected %q but got %q for ExpressRoutePortsLocationName", v.Expected.ExpressRoutePortsLocationName, actual.ExpressRoutePortsLocationName) - } - - } -} - -func TestSegmentsForExpressRoutePortsLocationId(t *testing.T) { - segments := ExpressRoutePortsLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRoutePortsLocationId 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/network/2023-06-01/expressrouteportslocations/method_get.go b/resource-manager/network/2023-06-01/expressrouteportslocations/method_get.go deleted file mode 100644 index 58048a2240a..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteportslocations - -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 *ExpressRoutePortsLocation -} - -// Get ... -func (c ExpressRoutePortsLocationsClient) Get(ctx context.Context, id ExpressRoutePortsLocationId) (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 ExpressRoutePortsLocation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/method_list.go b/resource-manager/network/2023-06-01/expressrouteportslocations/method_list.go deleted file mode 100644 index 760fa0a81bd..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteportslocations - -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 *[]ExpressRoutePortsLocation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRoutePortsLocation -} - -// List ... -func (c ExpressRoutePortsLocationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRoutePortsLocations", 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 *[]ExpressRoutePortsLocation `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 ExpressRoutePortsLocationsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRoutePortsLocationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRoutePortsLocationsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRoutePortsLocationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRoutePortsLocation, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocation.go b/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocation.go deleted file mode 100644 index 86d94dc7922..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocation.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocation struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRoutePortsLocationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go b/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go deleted file mode 100644 index 018cb977672..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationbandwidths.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocationBandwidths struct { - OfferName *string `json:"offerName,omitempty"` - ValueInGbps *int64 `json:"valueInGbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go b/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go deleted file mode 100644 index fa52c31306b..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/model_expressrouteportslocationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocationPropertiesFormat struct { - Address *string `json:"address,omitempty"` - AvailableBandwidths *[]ExpressRoutePortsLocationBandwidths `json:"availableBandwidths,omitempty"` - Contact *string `json:"contact,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteportslocations/predicates.go b/resource-manager/network/2023-06-01/expressrouteportslocations/predicates.go deleted file mode 100644 index 3b345c2e1f5..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressrouteportslocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRoutePortsLocationOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRoutePortsLocationOperationPredicate) Matches(input ExpressRoutePortsLocation) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/network/2023-06-01/expressrouteportslocations/version.go b/resource-manager/network/2023-06-01/expressrouteportslocations/version.go deleted file mode 100644 index 7fc740cc8ae..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteportslocations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteportslocations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteportslocations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/README.md b/resource-manager/network/2023-06-01/expressrouteproviderports/README.md deleted file mode 100644 index e801824394a..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteproviderports` Documentation - -The `expressrouteproviderports` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressrouteproviderports" -``` - - -### Client Initialization - -```go -client := expressrouteproviderports.NewExpressRouteProviderPortsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteProviderPortsClient.ExpressRouteProviderPort` - -```go -ctx := context.TODO() -id := expressrouteproviderports.NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue") - -read, err := client.ExpressRouteProviderPort(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ExpressRouteProviderPortsClient.LocationList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.LocationList(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions())` can be used to do batched pagination -items, err := client.LocationListComplete(ctx, id, expressrouteproviderports.DefaultLocationListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/client.go b/resource-manager/network/2023-06-01/expressrouteproviderports/client.go deleted file mode 100644 index 696d17bbfd6..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteproviderports - -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 ExpressRouteProviderPortsClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteProviderPortsClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteProviderPortsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteproviderports", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteProviderPortsClient: %+v", err) - } - - return &ExpressRouteProviderPortsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport.go b/resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport.go deleted file mode 100644 index 2e734bb82c3..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport.go +++ /dev/null @@ -1,121 +0,0 @@ -package expressrouteproviderports - -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(&ExpressRouteProviderPortId{}) -} - -var _ resourceids.ResourceId = &ExpressRouteProviderPortId{} - -// ExpressRouteProviderPortId is a struct representing the Resource ID for a Express Route Provider Port -type ExpressRouteProviderPortId struct { - SubscriptionId string - ExpressRouteProviderPortName string -} - -// NewExpressRouteProviderPortID returns a new ExpressRouteProviderPortId struct -func NewExpressRouteProviderPortID(subscriptionId string, expressRouteProviderPortName string) ExpressRouteProviderPortId { - return ExpressRouteProviderPortId{ - SubscriptionId: subscriptionId, - ExpressRouteProviderPortName: expressRouteProviderPortName, - } -} - -// ParseExpressRouteProviderPortID parses 'input' into a ExpressRouteProviderPortId -func ParseExpressRouteProviderPortID(input string) (*ExpressRouteProviderPortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteProviderPortId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteProviderPortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseExpressRouteProviderPortIDInsensitively parses 'input' case-insensitively into a ExpressRouteProviderPortId -// note: this method should only be used for API response data and not user input -func ParseExpressRouteProviderPortIDInsensitively(input string) (*ExpressRouteProviderPortId, error) { - parser := resourceids.NewParserFromResourceIdType(&ExpressRouteProviderPortId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ExpressRouteProviderPortId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ExpressRouteProviderPortId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.ExpressRouteProviderPortName, ok = input.Parsed["expressRouteProviderPortName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteProviderPortName", input) - } - - return nil -} - -// ValidateExpressRouteProviderPortID checks that 'input' can be parsed as a Express Route Provider Port ID -func ValidateExpressRouteProviderPortID(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 := ParseExpressRouteProviderPortID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Express Route Provider Port ID -func (id ExpressRouteProviderPortId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/expressRouteProviderPorts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ExpressRouteProviderPortName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Express Route Provider Port ID -func (id ExpressRouteProviderPortId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteProviderPorts", "expressRouteProviderPorts", "expressRouteProviderPorts"), - resourceids.UserSpecifiedSegment("expressRouteProviderPortName", "expressRouteProviderPortValue"), - } -} - -// String returns a human-readable description of this Express Route Provider Port ID -func (id ExpressRouteProviderPortId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Express Route Provider Port Name: %q", id.ExpressRouteProviderPortName), - } - return fmt.Sprintf("Express Route Provider Port (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport_test.go b/resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport_test.go deleted file mode 100644 index 1c4f938991d..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/id_expressrouteproviderport_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package expressrouteproviderports - -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 = &ExpressRouteProviderPortId{} - -func TestNewExpressRouteProviderPortID(t *testing.T) { - id := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue") - - 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.ExpressRouteProviderPortName != "expressRouteProviderPortValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteProviderPortName'", id.ExpressRouteProviderPortName, "expressRouteProviderPortValue") - } -} - -func TestFormatExpressRouteProviderPortID(t *testing.T) { - actual := NewExpressRouteProviderPortID("12345678-1234-9876-4563-123456789012", "expressRouteProviderPortValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseExpressRouteProviderPortID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteProviderPortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue", - Expected: &ExpressRouteProviderPortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "expressRouteProviderPortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteProviderPortID(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.ExpressRouteProviderPortName != v.Expected.ExpressRouteProviderPortName { - t.Fatalf("Expected %q but got %q for ExpressRouteProviderPortName", v.Expected.ExpressRouteProviderPortName, actual.ExpressRouteProviderPortName) - } - - } -} - -func TestParseExpressRouteProviderPortIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ExpressRouteProviderPortId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue", - Expected: &ExpressRouteProviderPortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "expressRouteProviderPortValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/expressRouteProviderPorts/expressRouteProviderPortValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTvAlUe", - Expected: &ExpressRouteProviderPortId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ExpressRouteProviderPortName: "eXpReSsRoUtEpRoViDeRpOrTvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEpRoViDeRpOrTs/eXpReSsRoUtEpRoViDeRpOrTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseExpressRouteProviderPortIDInsensitively(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.ExpressRouteProviderPortName != v.Expected.ExpressRouteProviderPortName { - t.Fatalf("Expected %q but got %q for ExpressRouteProviderPortName", v.Expected.ExpressRouteProviderPortName, actual.ExpressRouteProviderPortName) - } - - } -} - -func TestSegmentsForExpressRouteProviderPortId(t *testing.T) { - segments := ExpressRouteProviderPortId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ExpressRouteProviderPortId 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/network/2023-06-01/expressrouteproviderports/method_expressrouteproviderport.go b/resource-manager/network/2023-06-01/expressrouteproviderports/method_expressrouteproviderport.go deleted file mode 100644 index 95cb93096c7..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/method_expressrouteproviderport.go +++ /dev/null @@ -1,54 +0,0 @@ -package expressrouteproviderports - -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 ExpressRouteProviderPortOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ExpressRouteProviderPort -} - -// ExpressRouteProviderPort ... -func (c ExpressRouteProviderPortsClient) ExpressRouteProviderPort(ctx context.Context, id ExpressRouteProviderPortId) (result ExpressRouteProviderPortOperationResponse, 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 ExpressRouteProviderPort - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/method_locationlist.go b/resource-manager/network/2023-06-01/expressrouteproviderports/method_locationlist.go deleted file mode 100644 index b96fb2b5dc9..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/method_locationlist.go +++ /dev/null @@ -1,120 +0,0 @@ -package expressrouteproviderports - -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 LocationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ExpressRouteProviderPort -} - -type LocationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteProviderPort -} - -type LocationListOperationOptions struct { - Filter *string -} - -func DefaultLocationListOperationOptions() LocationListOperationOptions { - return LocationListOperationOptions{} -} - -func (o LocationListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o LocationListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o LocationListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - return &out -} - -// LocationList ... -func (c ExpressRouteProviderPortsClient) LocationList(ctx context.Context, id commonids.SubscriptionId, options LocationListOperationOptions) (result LocationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteProviderPorts", id.ID()), - OptionsObject: options, - } - - 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 *[]ExpressRouteProviderPort `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LocationListComplete retrieves all the results into a single object -func (c ExpressRouteProviderPortsClient) LocationListComplete(ctx context.Context, id commonids.SubscriptionId, options LocationListOperationOptions) (LocationListCompleteResult, error) { - return c.LocationListCompleteMatchingPredicate(ctx, id, options, ExpressRouteProviderPortOperationPredicate{}) -} - -// LocationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteProviderPortsClient) LocationListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options LocationListOperationOptions, predicate ExpressRouteProviderPortOperationPredicate) (result LocationListCompleteResult, err error) { - items := make([]ExpressRouteProviderPort, 0) - - resp, err := c.LocationList(ctx, id, options) - if err != nil { - 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 = LocationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderport.go b/resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderport.go deleted file mode 100644 index 9bb3723c40e..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderport.go +++ /dev/null @@ -1,14 +0,0 @@ -package expressrouteproviderports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteProviderPort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteProviderPortProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderportproperties.go b/resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderportproperties.go deleted file mode 100644 index d0a93ccf046..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/model_expressrouteproviderportproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package expressrouteproviderports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteProviderPortProperties struct { - OverprovisionFactor *int64 `json:"overprovisionFactor,omitempty"` - PeeringLocation *string `json:"peeringLocation,omitempty"` - PortBandwidthInMbps *int64 `json:"portBandwidthInMbps,omitempty"` - PortPairDescriptor *string `json:"portPairDescriptor,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - RemainingBandwidthInMbps *int64 `json:"remainingBandwidthInMbps,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - UsedBandwidthInMbps *int64 `json:"usedBandwidthInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteproviderports/predicates.go b/resource-manager/network/2023-06-01/expressrouteproviderports/predicates.go deleted file mode 100644 index ea48d5c374c..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package expressrouteproviderports - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteProviderPortOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteProviderPortOperationPredicate) Matches(input ExpressRouteProviderPort) 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 && (input.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/network/2023-06-01/expressrouteproviderports/version.go b/resource-manager/network/2023-06-01/expressrouteproviderports/version.go deleted file mode 100644 index b77e38292bd..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteproviderports/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteproviderports - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteproviderports/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/README.md b/resource-manager/network/2023-06-01/expressrouteserviceproviders/README.md deleted file mode 100644 index 26424f84a6e..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/README.md +++ /dev/null @@ -1,38 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/expressrouteserviceproviders` Documentation - -The `expressrouteserviceproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/expressrouteserviceproviders" -``` - - -### Client Initialization - -```go -client := expressrouteserviceproviders.NewExpressRouteServiceProvidersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ExpressRouteServiceProvidersClient.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 -} -``` diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/client.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/client.go deleted file mode 100644 index d071b668e37..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package expressrouteserviceproviders - -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 ExpressRouteServiceProvidersClient struct { - Client *resourcemanager.Client -} - -func NewExpressRouteServiceProvidersClientWithBaseURI(sdkApi sdkEnv.Api) (*ExpressRouteServiceProvidersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "expressrouteserviceproviders", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ExpressRouteServiceProvidersClient: %+v", err) - } - - return &ExpressRouteServiceProvidersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/constants.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/constants.go deleted file mode 100644 index 7e0b7b9a059..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package expressrouteserviceproviders - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/method_list.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/method_list.go deleted file mode 100644 index c53d4842f36..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package expressrouteserviceproviders - -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 *[]ExpressRouteServiceProvider -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ExpressRouteServiceProvider -} - -// List ... -func (c ExpressRouteServiceProvidersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/expressRouteServiceProviders", 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 *[]ExpressRouteServiceProvider `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 ExpressRouteServiceProvidersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ExpressRouteServiceProviderOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ExpressRouteServiceProvidersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ExpressRouteServiceProviderOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ExpressRouteServiceProvider, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go deleted file mode 100644 index 156136ef150..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceprovider.go +++ /dev/null @@ -1,13 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProvider struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteServiceProviderPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go deleted file mode 100644 index 72758b5e1d5..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderbandwidthsoffered.go +++ /dev/null @@ -1,9 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProviderBandwidthsOffered struct { - OfferName *string `json:"offerName,omitempty"` - ValueInMbps *int64 `json:"valueInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go deleted file mode 100644 index e3c3cc178f9..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/model_expressrouteserviceproviderpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProviderPropertiesFormat struct { - BandwidthsOffered *[]ExpressRouteServiceProviderBandwidthsOffered `json:"bandwidthsOffered,omitempty"` - PeeringLocations *[]string `json:"peeringLocations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/expressrouteserviceproviders/predicates.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/predicates.go deleted file mode 100644 index d2c605983d7..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package expressrouteserviceproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteServiceProviderOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ExpressRouteServiceProviderOperationPredicate) Matches(input ExpressRouteServiceProvider) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/network/2023-06-01/expressrouteserviceproviders/version.go b/resource-manager/network/2023-06-01/expressrouteserviceproviders/version.go deleted file mode 100644 index 0baf54dba47..00000000000 --- a/resource-manager/network/2023-06-01/expressrouteserviceproviders/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package expressrouteserviceproviders - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/expressrouteserviceproviders/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/README.md b/resource-manager/network/2023-06-01/firewallpolicies/README.md deleted file mode 100644 index 49d78a9a62b..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/README.md +++ /dev/null @@ -1,237 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/firewallpolicies` Documentation - -The `firewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/firewallpolicies" -``` - - -### Client Initialization - -```go -client := firewallpolicies.NewFirewallPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.FirewallPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesFilterValuesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignatureOverridesFilterValuesQuery{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesFilterValuesList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.IDPSQueryObject{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesGet` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.FirewallPolicyIdpsSignaturesOverridesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesList` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.FirewallPolicyIdpsSignaturesOverridesList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPatch` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignaturesOverrides{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesOverridesPatch(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.FirewallPolicyIdpsSignaturesOverridesPut` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.SignaturesOverrides{ - // ... -} - - -read, err := client.FirewallPolicyIdpsSignaturesOverridesPut(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.Get` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -read, err := client.Get(ctx, id, firewallpolicies.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `FirewallPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `FirewallPoliciesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `FirewallPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := firewallpolicies.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -payload := firewallpolicies.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/network/2023-06-01/firewallpolicies/client.go b/resource-manager/network/2023-06-01/firewallpolicies/client.go deleted file mode 100644 index a162ae7a1c4..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package firewallpolicies - -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 FirewallPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewFirewallPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*FirewallPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "firewallpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FirewallPoliciesClient: %+v", err) - } - - return &FirewallPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/constants.go b/resource-manager/network/2023-06-01/firewallpolicies/constants.go deleted file mode 100644 index 882af3b64b9..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/constants.go +++ /dev/null @@ -1,417 +0,0 @@ -package firewallpolicies - -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 AutoLearnPrivateRangesMode string - -const ( - AutoLearnPrivateRangesModeDisabled AutoLearnPrivateRangesMode = "Disabled" - AutoLearnPrivateRangesModeEnabled AutoLearnPrivateRangesMode = "Enabled" -) - -func PossibleValuesForAutoLearnPrivateRangesMode() []string { - return []string{ - string(AutoLearnPrivateRangesModeDisabled), - string(AutoLearnPrivateRangesModeEnabled), - } -} - -func (s *AutoLearnPrivateRangesMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutoLearnPrivateRangesMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutoLearnPrivateRangesMode(input string) (*AutoLearnPrivateRangesMode, error) { - vals := map[string]AutoLearnPrivateRangesMode{ - "disabled": AutoLearnPrivateRangesModeDisabled, - "enabled": AutoLearnPrivateRangesModeEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutoLearnPrivateRangesMode(input) - return &out, nil -} - -type AzureFirewallThreatIntelMode string - -const ( - AzureFirewallThreatIntelModeAlert AzureFirewallThreatIntelMode = "Alert" - AzureFirewallThreatIntelModeDeny AzureFirewallThreatIntelMode = "Deny" - AzureFirewallThreatIntelModeOff AzureFirewallThreatIntelMode = "Off" -) - -func PossibleValuesForAzureFirewallThreatIntelMode() []string { - return []string{ - string(AzureFirewallThreatIntelModeAlert), - string(AzureFirewallThreatIntelModeDeny), - string(AzureFirewallThreatIntelModeOff), - } -} - -func (s *AzureFirewallThreatIntelMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAzureFirewallThreatIntelMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAzureFirewallThreatIntelMode(input string) (*AzureFirewallThreatIntelMode, error) { - vals := map[string]AzureFirewallThreatIntelMode{ - "alert": AzureFirewallThreatIntelModeAlert, - "deny": AzureFirewallThreatIntelModeDeny, - "off": AzureFirewallThreatIntelModeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AzureFirewallThreatIntelMode(input) - return &out, nil -} - -type FirewallPolicyIDPSQuerySortOrder string - -const ( - FirewallPolicyIDPSQuerySortOrderAscending FirewallPolicyIDPSQuerySortOrder = "Ascending" - FirewallPolicyIDPSQuerySortOrderDescending FirewallPolicyIDPSQuerySortOrder = "Descending" -) - -func PossibleValuesForFirewallPolicyIDPSQuerySortOrder() []string { - return []string{ - string(FirewallPolicyIDPSQuerySortOrderAscending), - string(FirewallPolicyIDPSQuerySortOrderDescending), - } -} - -func (s *FirewallPolicyIDPSQuerySortOrder) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIDPSQuerySortOrder(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIDPSQuerySortOrder(input string) (*FirewallPolicyIDPSQuerySortOrder, error) { - vals := map[string]FirewallPolicyIDPSQuerySortOrder{ - "ascending": FirewallPolicyIDPSQuerySortOrderAscending, - "descending": FirewallPolicyIDPSQuerySortOrderDescending, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIDPSQuerySortOrder(input) - return &out, nil -} - -type FirewallPolicyIDPSSignatureDirection int64 - -const ( - FirewallPolicyIDPSSignatureDirectionFour FirewallPolicyIDPSSignatureDirection = 4 - FirewallPolicyIDPSSignatureDirectionOne FirewallPolicyIDPSSignatureDirection = 1 - FirewallPolicyIDPSSignatureDirectionThree FirewallPolicyIDPSSignatureDirection = 3 - FirewallPolicyIDPSSignatureDirectionTwo FirewallPolicyIDPSSignatureDirection = 2 - FirewallPolicyIDPSSignatureDirectionZero FirewallPolicyIDPSSignatureDirection = 0 -) - -func PossibleValuesForFirewallPolicyIDPSSignatureDirection() []int64 { - return []int64{ - int64(FirewallPolicyIDPSSignatureDirectionFour), - int64(FirewallPolicyIDPSSignatureDirectionOne), - int64(FirewallPolicyIDPSSignatureDirectionThree), - int64(FirewallPolicyIDPSSignatureDirectionTwo), - int64(FirewallPolicyIDPSSignatureDirectionZero), - } -} - -type FirewallPolicyIDPSSignatureMode int64 - -const ( - FirewallPolicyIDPSSignatureModeOne FirewallPolicyIDPSSignatureMode = 1 - FirewallPolicyIDPSSignatureModeTwo FirewallPolicyIDPSSignatureMode = 2 - FirewallPolicyIDPSSignatureModeZero FirewallPolicyIDPSSignatureMode = 0 -) - -func PossibleValuesForFirewallPolicyIDPSSignatureMode() []int64 { - return []int64{ - int64(FirewallPolicyIDPSSignatureModeOne), - int64(FirewallPolicyIDPSSignatureModeTwo), - int64(FirewallPolicyIDPSSignatureModeZero), - } -} - -type FirewallPolicyIDPSSignatureSeverity int64 - -const ( - FirewallPolicyIDPSSignatureSeverityOne FirewallPolicyIDPSSignatureSeverity = 1 - FirewallPolicyIDPSSignatureSeverityThree FirewallPolicyIDPSSignatureSeverity = 3 - FirewallPolicyIDPSSignatureSeverityTwo FirewallPolicyIDPSSignatureSeverity = 2 -) - -func PossibleValuesForFirewallPolicyIDPSSignatureSeverity() []int64 { - return []int64{ - int64(FirewallPolicyIDPSSignatureSeverityOne), - int64(FirewallPolicyIDPSSignatureSeverityThree), - int64(FirewallPolicyIDPSSignatureSeverityTwo), - } -} - -type FirewallPolicyIntrusionDetectionProfileType string - -const ( - FirewallPolicyIntrusionDetectionProfileTypeAdvanced FirewallPolicyIntrusionDetectionProfileType = "Advanced" - FirewallPolicyIntrusionDetectionProfileTypeBasic FirewallPolicyIntrusionDetectionProfileType = "Basic" - FirewallPolicyIntrusionDetectionProfileTypeExtended FirewallPolicyIntrusionDetectionProfileType = "Extended" - FirewallPolicyIntrusionDetectionProfileTypeStandard FirewallPolicyIntrusionDetectionProfileType = "Standard" -) - -func PossibleValuesForFirewallPolicyIntrusionDetectionProfileType() []string { - return []string{ - string(FirewallPolicyIntrusionDetectionProfileTypeAdvanced), - string(FirewallPolicyIntrusionDetectionProfileTypeBasic), - string(FirewallPolicyIntrusionDetectionProfileTypeExtended), - string(FirewallPolicyIntrusionDetectionProfileTypeStandard), - } -} - -func (s *FirewallPolicyIntrusionDetectionProfileType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIntrusionDetectionProfileType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIntrusionDetectionProfileType(input string) (*FirewallPolicyIntrusionDetectionProfileType, error) { - vals := map[string]FirewallPolicyIntrusionDetectionProfileType{ - "advanced": FirewallPolicyIntrusionDetectionProfileTypeAdvanced, - "basic": FirewallPolicyIntrusionDetectionProfileTypeBasic, - "extended": FirewallPolicyIntrusionDetectionProfileTypeExtended, - "standard": FirewallPolicyIntrusionDetectionProfileTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIntrusionDetectionProfileType(input) - return &out, nil -} - -type FirewallPolicyIntrusionDetectionProtocol string - -const ( - FirewallPolicyIntrusionDetectionProtocolANY FirewallPolicyIntrusionDetectionProtocol = "ANY" - FirewallPolicyIntrusionDetectionProtocolICMP FirewallPolicyIntrusionDetectionProtocol = "ICMP" - FirewallPolicyIntrusionDetectionProtocolTCP FirewallPolicyIntrusionDetectionProtocol = "TCP" - FirewallPolicyIntrusionDetectionProtocolUDP FirewallPolicyIntrusionDetectionProtocol = "UDP" -) - -func PossibleValuesForFirewallPolicyIntrusionDetectionProtocol() []string { - return []string{ - string(FirewallPolicyIntrusionDetectionProtocolANY), - string(FirewallPolicyIntrusionDetectionProtocolICMP), - string(FirewallPolicyIntrusionDetectionProtocolTCP), - string(FirewallPolicyIntrusionDetectionProtocolUDP), - } -} - -func (s *FirewallPolicyIntrusionDetectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIntrusionDetectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIntrusionDetectionProtocol(input string) (*FirewallPolicyIntrusionDetectionProtocol, error) { - vals := map[string]FirewallPolicyIntrusionDetectionProtocol{ - "any": FirewallPolicyIntrusionDetectionProtocolANY, - "icmp": FirewallPolicyIntrusionDetectionProtocolICMP, - "tcp": FirewallPolicyIntrusionDetectionProtocolTCP, - "udp": FirewallPolicyIntrusionDetectionProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIntrusionDetectionProtocol(input) - return &out, nil -} - -type FirewallPolicyIntrusionDetectionStateType string - -const ( - FirewallPolicyIntrusionDetectionStateTypeAlert FirewallPolicyIntrusionDetectionStateType = "Alert" - FirewallPolicyIntrusionDetectionStateTypeDeny FirewallPolicyIntrusionDetectionStateType = "Deny" - FirewallPolicyIntrusionDetectionStateTypeOff FirewallPolicyIntrusionDetectionStateType = "Off" -) - -func PossibleValuesForFirewallPolicyIntrusionDetectionStateType() []string { - return []string{ - string(FirewallPolicyIntrusionDetectionStateTypeAlert), - string(FirewallPolicyIntrusionDetectionStateTypeDeny), - string(FirewallPolicyIntrusionDetectionStateTypeOff), - } -} - -func (s *FirewallPolicyIntrusionDetectionStateType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyIntrusionDetectionStateType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyIntrusionDetectionStateType(input string) (*FirewallPolicyIntrusionDetectionStateType, error) { - vals := map[string]FirewallPolicyIntrusionDetectionStateType{ - "alert": FirewallPolicyIntrusionDetectionStateTypeAlert, - "deny": FirewallPolicyIntrusionDetectionStateTypeDeny, - "off": FirewallPolicyIntrusionDetectionStateTypeOff, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyIntrusionDetectionStateType(input) - return &out, nil -} - -type FirewallPolicySkuTier string - -const ( - FirewallPolicySkuTierBasic FirewallPolicySkuTier = "Basic" - FirewallPolicySkuTierPremium FirewallPolicySkuTier = "Premium" - FirewallPolicySkuTierStandard FirewallPolicySkuTier = "Standard" -) - -func PossibleValuesForFirewallPolicySkuTier() []string { - return []string{ - string(FirewallPolicySkuTierBasic), - string(FirewallPolicySkuTierPremium), - string(FirewallPolicySkuTierStandard), - } -} - -func (s *FirewallPolicySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicySkuTier(input string) (*FirewallPolicySkuTier, error) { - vals := map[string]FirewallPolicySkuTier{ - "basic": FirewallPolicySkuTierBasic, - "premium": FirewallPolicySkuTierPremium, - "standard": FirewallPolicySkuTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicySkuTier(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy.go b/resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy.go deleted file mode 100644 index b3ab374101c..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package firewallpolicies - -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(&FirewallPolicyId{}) -} - -var _ resourceids.ResourceId = &FirewallPolicyId{} - -// FirewallPolicyId is a struct representing the Resource ID for a Firewall Policy -type FirewallPolicyId struct { - SubscriptionId string - ResourceGroupName string - FirewallPolicyName string -} - -// NewFirewallPolicyID returns a new FirewallPolicyId struct -func NewFirewallPolicyID(subscriptionId string, resourceGroupName string, firewallPolicyName string) FirewallPolicyId { - return FirewallPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FirewallPolicyName: firewallPolicyName, - } -} - -// ParseFirewallPolicyID parses 'input' into a FirewallPolicyId -func ParseFirewallPolicyID(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFirewallPolicyIDInsensitively parses 'input' case-insensitively into a FirewallPolicyId -// note: this method should only be used for API response data and not user input -func ParseFirewallPolicyIDInsensitively(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FirewallPolicyId) 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.FirewallPolicyName, ok = input.Parsed["firewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallPolicyName", input) - } - - return nil -} - -// ValidateFirewallPolicyID checks that 'input' can be parsed as a Firewall Policy ID -func ValidateFirewallPolicyID(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 := ParseFirewallPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Firewall Policy ID -func (id FirewallPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/firewallPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FirewallPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Firewall Policy ID -func (id FirewallPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticFirewallPolicies", "firewallPolicies", "firewallPolicies"), - resourceids.UserSpecifiedSegment("firewallPolicyName", "firewallPolicyValue"), - } -} - -// String returns a human-readable description of this Firewall Policy ID -func (id FirewallPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Firewall Policy Name: %q", id.FirewallPolicyName), - } - return fmt.Sprintf("Firewall Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy_test.go b/resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy_test.go deleted file mode 100644 index ef55791e4fc..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/id_firewallpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package firewallpolicies - -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 = &FirewallPolicyId{} - -func TestNewFirewallPolicyID(t *testing.T) { - id := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - - 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.FirewallPolicyName != "firewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallPolicyName'", id.FirewallPolicyName, "firewallPolicyValue") - } -} - -func TestFormatFirewallPolicyID(t *testing.T) { - actual := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFirewallPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyID(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestParseFirewallPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FirewallPolicyName: "fIrEwAlLpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyIDInsensitively(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestSegmentsForFirewallPolicyId(t *testing.T) { - segments := FirewallPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FirewallPolicyId 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/network/2023-06-01/firewallpolicies/method_createorupdate.go b/resource-manager/network/2023-06-01/firewallpolicies/method_createorupdate.go deleted file mode 100644 index 0492bbef61e..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package firewallpolicies - -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 *FirewallPolicy -} - -// CreateOrUpdate ... -func (c FirewallPoliciesClient) CreateOrUpdate(ctx context.Context, id FirewallPolicyId, input FirewallPolicy) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FirewallPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id FirewallPolicyId, input FirewallPolicy) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/firewallpolicies/method_delete.go b/resource-manager/network/2023-06-01/firewallpolicies/method_delete.go deleted file mode 100644 index 432932fda66..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package firewallpolicies - -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 FirewallPoliciesClient) Delete(ctx context.Context, id FirewallPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 FirewallPoliciesClient) DeleteThenPoll(ctx context.Context, id FirewallPolicyId) 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/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go b/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go deleted file mode 100644 index e13bba542e4..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesfiltervalueslist.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesFilterValuesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignatureOverridesFilterValuesResponse -} - -// FirewallPolicyIdpsSignaturesFilterValuesList ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesFilterValuesList(ctx context.Context, id FirewallPolicyId, input SignatureOverridesFilterValuesQuery) (result FirewallPolicyIdpsSignaturesFilterValuesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listIdpsFilterOptions", 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 SignatureOverridesFilterValuesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go b/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go deleted file mode 100644 index 3317a5b3046..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignatureslist.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *QueryResults -} - -// FirewallPolicyIdpsSignaturesList ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesList(ctx context.Context, id FirewallPolicyId, input IDPSQueryObject) (result FirewallPolicyIdpsSignaturesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listIdpsSignatures", 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 QueryResults - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go b/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go deleted file mode 100644 index 0a494459f55..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesget.go +++ /dev/null @@ -1,55 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesGet ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesGet(ctx context.Context, id FirewallPolicyId) (result FirewallPolicyIdpsSignaturesOverridesGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/signatureOverrides/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 SignaturesOverrides - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go b/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go deleted file mode 100644 index 0fb145a6c0c..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverrideslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverridesList -} - -// FirewallPolicyIdpsSignaturesOverridesList ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesList(ctx context.Context, id FirewallPolicyId) (result FirewallPolicyIdpsSignaturesOverridesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/signatureOverrides", 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 SignaturesOverridesList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go b/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go deleted file mode 100644 index 99eb2fc1d38..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridespatch.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesPatchOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesPatch ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesPatch(ctx context.Context, id FirewallPolicyId, input SignaturesOverrides) (result FirewallPolicyIdpsSignaturesOverridesPatchOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/signatureOverrides/default", 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 SignaturesOverrides - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go b/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go deleted file mode 100644 index 2b131f1a401..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_firewallpolicyidpssignaturesoverridesput.go +++ /dev/null @@ -1,59 +0,0 @@ -package firewallpolicies - -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 FirewallPolicyIdpsSignaturesOverridesPutOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SignaturesOverrides -} - -// FirewallPolicyIdpsSignaturesOverridesPut ... -func (c FirewallPoliciesClient) FirewallPolicyIdpsSignaturesOverridesPut(ctx context.Context, id FirewallPolicyId, input SignaturesOverrides) (result FirewallPolicyIdpsSignaturesOverridesPutOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/signatureOverrides/default", 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 SignaturesOverrides - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_get.go b/resource-manager/network/2023-06-01/firewallpolicies/method_get.go deleted file mode 100644 index 6d04656e020..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package firewallpolicies - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FirewallPolicy -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c FirewallPoliciesClient) Get(ctx context.Context, id FirewallPolicyId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 FirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_list.go b/resource-manager/network/2023-06-01/firewallpolicies/method_list.go deleted file mode 100644 index 1ae7b3c4431..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package firewallpolicies - -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 *[]FirewallPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FirewallPolicy -} - -// List ... -func (c FirewallPoliciesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/firewallPolicies", 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 *[]FirewallPolicy `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 FirewallPoliciesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FirewallPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FirewallPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate FirewallPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FirewallPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/firewallpolicies/method_listall.go b/resource-manager/network/2023-06-01/firewallpolicies/method_listall.go deleted file mode 100644 index 146af1a313f..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package firewallpolicies - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FirewallPolicy -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []FirewallPolicy -} - -// ListAll ... -func (c FirewallPoliciesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/firewallPolicies", 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 *[]FirewallPolicy `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c FirewallPoliciesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, FirewallPolicyOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FirewallPoliciesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate FirewallPolicyOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]FirewallPolicy, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/method_updatetags.go b/resource-manager/network/2023-06-01/firewallpolicies/method_updatetags.go deleted file mode 100644 index 05b103ecce7..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package firewallpolicies - -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 *FirewallPolicy -} - -// UpdateTags ... -func (c FirewallPoliciesClient) UpdateTags(ctx context.Context, id FirewallPolicyId, 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 FirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_dnssettings.go b/resource-manager/network/2023-06-01/firewallpolicies/model_dnssettings.go deleted file mode 100644 index 6983f66f9dd..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_dnssettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsSettings struct { - EnableProxy *bool `json:"enableProxy,omitempty"` - RequireProxyForNetworkRules *bool `json:"requireProxyForNetworkRules,omitempty"` - Servers *[]string `json:"servers,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_explicitproxy.go b/resource-manager/network/2023-06-01/firewallpolicies/model_explicitproxy.go deleted file mode 100644 index d8af7221ddf..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_explicitproxy.go +++ /dev/null @@ -1,13 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExplicitProxy struct { - EnableExplicitProxy *bool `json:"enableExplicitProxy,omitempty"` - EnablePacFile *bool `json:"enablePacFile,omitempty"` - HTTPPort *int64 `json:"httpPort,omitempty"` - HTTPSPort *int64 `json:"httpsPort,omitempty"` - PacFile *string `json:"pacFile,omitempty"` - PacFilePort *int64 `json:"pacFilePort,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_filteritems.go b/resource-manager/network/2023-06-01/firewallpolicies/model_filteritems.go deleted file mode 100644 index 943657d23f0..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_filteritems.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FilterItems struct { - Field *string `json:"field,omitempty"` - Values *[]string `json:"values,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicy.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicy.go deleted file mode 100644 index fb85165c9d9..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicy.go +++ /dev/null @@ -1,19 +0,0 @@ -package firewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FirewallPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicycertificateauthority.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicycertificateauthority.go deleted file mode 100644 index b1d1e5fcdd8..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicycertificateauthority.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyCertificateAuthority struct { - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyinsights.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyinsights.go deleted file mode 100644 index 5af7b2e446d..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyinsights.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyInsights struct { - IsEnabled *bool `json:"isEnabled,omitempty"` - LogAnalyticsResources *FirewallPolicyLogAnalyticsResources `json:"logAnalyticsResources,omitempty"` - RetentionDays *int64 `json:"retentionDays,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetection.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetection.go deleted file mode 100644 index f51c93257c5..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetection.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetection struct { - Configuration *FirewallPolicyIntrusionDetectionConfiguration `json:"configuration,omitempty"` - Mode *FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` - Profile *FirewallPolicyIntrusionDetectionProfileType `json:"profile,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go deleted file mode 100644 index 088a6c5515f..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionbypasstrafficspecifications.go +++ /dev/null @@ -1,15 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetectionBypassTrafficSpecifications struct { - Description *string `json:"description,omitempty"` - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Name *string `json:"name,omitempty"` - Protocol *FirewallPolicyIntrusionDetectionProtocol `json:"protocol,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go deleted file mode 100644 index dce919867c0..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetectionConfiguration struct { - BypassTrafficSettings *[]FirewallPolicyIntrusionDetectionBypassTrafficSpecifications `json:"bypassTrafficSettings,omitempty"` - PrivateRanges *[]string `json:"privateRanges,omitempty"` - SignatureOverrides *[]FirewallPolicyIntrusionDetectionSignatureSpecification `json:"signatureOverrides,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go deleted file mode 100644 index 2bae7fe0f04..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyintrusiondetectionsignaturespecification.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyIntrusionDetectionSignatureSpecification struct { - Id *string `json:"id,omitempty"` - Mode *FirewallPolicyIntrusionDetectionStateType `json:"mode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go deleted file mode 100644 index 4f1280d942b..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsresources.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyLogAnalyticsResources struct { - DefaultWorkspaceId *SubResource `json:"defaultWorkspaceId,omitempty"` - Workspaces *[]FirewallPolicyLogAnalyticsWorkspace `json:"workspaces,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go deleted file mode 100644 index 4cc72aa7cbb..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicyloganalyticsworkspace.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyLogAnalyticsWorkspace struct { - Region *string `json:"region,omitempty"` - WorkspaceId *SubResource `json:"workspaceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicypropertiesformat.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicypropertiesformat.go deleted file mode 100644 index b439737323d..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicypropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyPropertiesFormat struct { - BasePolicy *SubResource `json:"basePolicy,omitempty"` - ChildPolicies *[]SubResource `json:"childPolicies,omitempty"` - DnsSettings *DnsSettings `json:"dnsSettings,omitempty"` - ExplicitProxy *ExplicitProxy `json:"explicitProxy,omitempty"` - Firewalls *[]SubResource `json:"firewalls,omitempty"` - Insights *FirewallPolicyInsights `json:"insights,omitempty"` - IntrusionDetection *FirewallPolicyIntrusionDetection `json:"intrusionDetection,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleCollectionGroups *[]SubResource `json:"ruleCollectionGroups,omitempty"` - Size *string `json:"size,omitempty"` - Sku *FirewallPolicySku `json:"sku,omitempty"` - Snat *FirewallPolicySNAT `json:"snat,omitempty"` - Sql *FirewallPolicySQL `json:"sql,omitempty"` - ThreatIntelMode *AzureFirewallThreatIntelMode `json:"threatIntelMode,omitempty"` - ThreatIntelWhitelist *FirewallPolicyThreatIntelWhitelist `json:"threatIntelWhitelist,omitempty"` - TransportSecurity *FirewallPolicyTransportSecurity `json:"transportSecurity,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysku.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysku.go deleted file mode 100644 index 6c0cef08260..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicySku struct { - Tier *FirewallPolicySkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysnat.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysnat.go deleted file mode 100644 index 33dcf12744e..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysnat.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicySNAT struct { - AutoLearnPrivateRanges *AutoLearnPrivateRangesMode `json:"autoLearnPrivateRanges,omitempty"` - PrivateRanges *[]string `json:"privateRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysql.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysql.go deleted file mode 100644 index 32e50565577..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicysql.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicySQL struct { - AllowSqlRedirect *bool `json:"allowSqlRedirect,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go deleted file mode 100644 index 376fba1c268..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicythreatintelwhitelist.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyThreatIntelWhitelist struct { - Fqdns *[]string `json:"fqdns,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicytransportsecurity.go b/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicytransportsecurity.go deleted file mode 100644 index 9fdbf9b4877..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_firewallpolicytransportsecurity.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyTransportSecurity struct { - CertificateAuthority *FirewallPolicyCertificateAuthority `json:"certificateAuthority,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_idpsqueryobject.go b/resource-manager/network/2023-06-01/firewallpolicies/model_idpsqueryobject.go deleted file mode 100644 index 3a1aca509b6..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_idpsqueryobject.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IDPSQueryObject struct { - Filters *[]FilterItems `json:"filters,omitempty"` - OrderBy *OrderBy `json:"orderBy,omitempty"` - ResultsPerPage *int64 `json:"resultsPerPage,omitempty"` - Search *string `json:"search,omitempty"` - Skip *int64 `json:"skip,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_orderby.go b/resource-manager/network/2023-06-01/firewallpolicies/model_orderby.go deleted file mode 100644 index db1d05e4478..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_orderby.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OrderBy struct { - Field *string `json:"field,omitempty"` - Order *FirewallPolicyIDPSQuerySortOrder `json:"order,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_queryresults.go b/resource-manager/network/2023-06-01/firewallpolicies/model_queryresults.go deleted file mode 100644 index 4c0591a2f83..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_queryresults.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryResults struct { - MatchingRecordsCount *int64 `json:"matchingRecordsCount,omitempty"` - Signatures *[]SingleQueryResult `json:"signatures,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go b/resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go deleted file mode 100644 index 718d141e3c0..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesquery.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignatureOverridesFilterValuesQuery struct { - FilterName *string `json:"filterName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go b/resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go deleted file mode 100644 index 4b135d882ba..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_signatureoverridesfiltervaluesresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignatureOverridesFilterValuesResponse struct { - FilterValues *[]string `json:"filterValues,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrides.go b/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrides.go deleted file mode 100644 index 2f1b84510c9..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrides.go +++ /dev/null @@ -1,11 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignaturesOverrides struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SignaturesOverridesProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrideslist.go b/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrideslist.go deleted file mode 100644 index d403a4eb590..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverrideslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignaturesOverridesList struct { - Value *[]SignaturesOverrides `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverridesproperties.go b/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverridesproperties.go deleted file mode 100644 index a93d8699c02..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_signaturesoverridesproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SignaturesOverridesProperties struct { - Signatures *map[string]string `json:"signatures,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_singlequeryresult.go b/resource-manager/network/2023-06-01/firewallpolicies/model_singlequeryresult.go deleted file mode 100644 index cbf78585e56..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_singlequeryresult.go +++ /dev/null @@ -1,18 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SingleQueryResult struct { - Description *string `json:"description,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - Direction *FirewallPolicyIDPSSignatureDirection `json:"direction,omitempty"` - Group *string `json:"group,omitempty"` - InheritedFromParentPolicy *bool `json:"inheritedFromParentPolicy,omitempty"` - LastUpdated *string `json:"lastUpdated,omitempty"` - Mode *FirewallPolicyIDPSSignatureMode `json:"mode,omitempty"` - Protocol *string `json:"protocol,omitempty"` - Severity *FirewallPolicyIDPSSignatureSeverity `json:"severity,omitempty"` - SignatureId *int64 `json:"signatureId,omitempty"` - SourcePorts *[]string `json:"sourcePorts,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_subresource.go b/resource-manager/network/2023-06-01/firewallpolicies/model_subresource.go deleted file mode 100644 index abee9f81d03..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicies/model_tagsobject.go b/resource-manager/network/2023-06-01/firewallpolicies/model_tagsobject.go deleted file mode 100644 index 22cc23110be..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicies - -// 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/network/2023-06-01/firewallpolicies/predicates.go b/resource-manager/network/2023-06-01/firewallpolicies/predicates.go deleted file mode 100644 index 2640042ba7a..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package firewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p FirewallPolicyOperationPredicate) Matches(input FirewallPolicy) 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 && (input.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/network/2023-06-01/firewallpolicies/version.go b/resource-manager/network/2023-06-01/firewallpolicies/version.go deleted file mode 100644 index 5b291175ee2..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/README.md b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/README.md deleted file mode 100644 index b7914dff385..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups` Documentation - -The `firewallpolicyrulecollectiongroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/firewallpolicyrulecollectiongroups" -``` - - -### Client Initialization - -```go -client := firewallpolicyrulecollectiongroups.NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -payload := firewallpolicyrulecollectiongroups.FirewallPolicyRuleCollectionGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Delete` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallPolicyRuleCollectionGroupsClient.Get` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - -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: `FirewallPolicyRuleCollectionGroupsClient.List` - -```go -ctx := context.TODO() -id := firewallpolicyrulecollectiongroups.NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - -// 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/network/2023-06-01/firewallpolicyrulecollectiongroups/client.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/client.go deleted file mode 100644 index ef562ceb4a0..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRuleCollectionGroupsClient struct { - Client *resourcemanager.Client -} - -func NewFirewallPolicyRuleCollectionGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*FirewallPolicyRuleCollectionGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "firewallpolicyrulecollectiongroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FirewallPolicyRuleCollectionGroupsClient: %+v", err) - } - - return &FirewallPolicyRuleCollectionGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/constants.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/constants.go deleted file mode 100644 index 73fd6902a8b..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/constants.go +++ /dev/null @@ -1,309 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyFilterRuleCollectionActionType string - -const ( - FirewallPolicyFilterRuleCollectionActionTypeAllow FirewallPolicyFilterRuleCollectionActionType = "Allow" - FirewallPolicyFilterRuleCollectionActionTypeDeny FirewallPolicyFilterRuleCollectionActionType = "Deny" -) - -func PossibleValuesForFirewallPolicyFilterRuleCollectionActionType() []string { - return []string{ - string(FirewallPolicyFilterRuleCollectionActionTypeAllow), - string(FirewallPolicyFilterRuleCollectionActionTypeDeny), - } -} - -func (s *FirewallPolicyFilterRuleCollectionActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyFilterRuleCollectionActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyFilterRuleCollectionActionType(input string) (*FirewallPolicyFilterRuleCollectionActionType, error) { - vals := map[string]FirewallPolicyFilterRuleCollectionActionType{ - "allow": FirewallPolicyFilterRuleCollectionActionTypeAllow, - "deny": FirewallPolicyFilterRuleCollectionActionTypeDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyFilterRuleCollectionActionType(input) - return &out, nil -} - -type FirewallPolicyNatRuleCollectionActionType string - -const ( - FirewallPolicyNatRuleCollectionActionTypeDNAT FirewallPolicyNatRuleCollectionActionType = "DNAT" -) - -func PossibleValuesForFirewallPolicyNatRuleCollectionActionType() []string { - return []string{ - string(FirewallPolicyNatRuleCollectionActionTypeDNAT), - } -} - -func (s *FirewallPolicyNatRuleCollectionActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyNatRuleCollectionActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyNatRuleCollectionActionType(input string) (*FirewallPolicyNatRuleCollectionActionType, error) { - vals := map[string]FirewallPolicyNatRuleCollectionActionType{ - "dnat": FirewallPolicyNatRuleCollectionActionTypeDNAT, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyNatRuleCollectionActionType(input) - return &out, nil -} - -type FirewallPolicyRuleApplicationProtocolType string - -const ( - FirewallPolicyRuleApplicationProtocolTypeHTTP FirewallPolicyRuleApplicationProtocolType = "Http" - FirewallPolicyRuleApplicationProtocolTypeHTTPS FirewallPolicyRuleApplicationProtocolType = "Https" -) - -func PossibleValuesForFirewallPolicyRuleApplicationProtocolType() []string { - return []string{ - string(FirewallPolicyRuleApplicationProtocolTypeHTTP), - string(FirewallPolicyRuleApplicationProtocolTypeHTTPS), - } -} - -func (s *FirewallPolicyRuleApplicationProtocolType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleApplicationProtocolType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleApplicationProtocolType(input string) (*FirewallPolicyRuleApplicationProtocolType, error) { - vals := map[string]FirewallPolicyRuleApplicationProtocolType{ - "http": FirewallPolicyRuleApplicationProtocolTypeHTTP, - "https": FirewallPolicyRuleApplicationProtocolTypeHTTPS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleApplicationProtocolType(input) - return &out, nil -} - -type FirewallPolicyRuleCollectionType string - -const ( - FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyFilterRuleCollection" - FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection FirewallPolicyRuleCollectionType = "FirewallPolicyNatRuleCollection" -) - -func PossibleValuesForFirewallPolicyRuleCollectionType() []string { - return []string{ - string(FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection), - string(FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection), - } -} - -func (s *FirewallPolicyRuleCollectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleCollectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleCollectionType(input string) (*FirewallPolicyRuleCollectionType, error) { - vals := map[string]FirewallPolicyRuleCollectionType{ - "firewallpolicyfilterrulecollection": FirewallPolicyRuleCollectionTypeFirewallPolicyFilterRuleCollection, - "firewallpolicynatrulecollection": FirewallPolicyRuleCollectionTypeFirewallPolicyNatRuleCollection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleCollectionType(input) - return &out, nil -} - -type FirewallPolicyRuleNetworkProtocol string - -const ( - FirewallPolicyRuleNetworkProtocolAny FirewallPolicyRuleNetworkProtocol = "Any" - FirewallPolicyRuleNetworkProtocolICMP FirewallPolicyRuleNetworkProtocol = "ICMP" - FirewallPolicyRuleNetworkProtocolTCP FirewallPolicyRuleNetworkProtocol = "TCP" - FirewallPolicyRuleNetworkProtocolUDP FirewallPolicyRuleNetworkProtocol = "UDP" -) - -func PossibleValuesForFirewallPolicyRuleNetworkProtocol() []string { - return []string{ - string(FirewallPolicyRuleNetworkProtocolAny), - string(FirewallPolicyRuleNetworkProtocolICMP), - string(FirewallPolicyRuleNetworkProtocolTCP), - string(FirewallPolicyRuleNetworkProtocolUDP), - } -} - -func (s *FirewallPolicyRuleNetworkProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleNetworkProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleNetworkProtocol(input string) (*FirewallPolicyRuleNetworkProtocol, error) { - vals := map[string]FirewallPolicyRuleNetworkProtocol{ - "any": FirewallPolicyRuleNetworkProtocolAny, - "icmp": FirewallPolicyRuleNetworkProtocolICMP, - "tcp": FirewallPolicyRuleNetworkProtocolTCP, - "udp": FirewallPolicyRuleNetworkProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleNetworkProtocol(input) - return &out, nil -} - -type FirewallPolicyRuleType string - -const ( - FirewallPolicyRuleTypeApplicationRule FirewallPolicyRuleType = "ApplicationRule" - FirewallPolicyRuleTypeNatRule FirewallPolicyRuleType = "NatRule" - FirewallPolicyRuleTypeNetworkRule FirewallPolicyRuleType = "NetworkRule" -) - -func PossibleValuesForFirewallPolicyRuleType() []string { - return []string{ - string(FirewallPolicyRuleTypeApplicationRule), - string(FirewallPolicyRuleTypeNatRule), - string(FirewallPolicyRuleTypeNetworkRule), - } -} - -func (s *FirewallPolicyRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFirewallPolicyRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFirewallPolicyRuleType(input string) (*FirewallPolicyRuleType, error) { - vals := map[string]FirewallPolicyRuleType{ - "applicationrule": FirewallPolicyRuleTypeApplicationRule, - "natrule": FirewallPolicyRuleTypeNatRule, - "networkrule": FirewallPolicyRuleTypeNetworkRule, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FirewallPolicyRuleType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go deleted file mode 100644 index 9a3d14e2193..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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(&FirewallPolicyId{}) -} - -var _ resourceids.ResourceId = &FirewallPolicyId{} - -// FirewallPolicyId is a struct representing the Resource ID for a Firewall Policy -type FirewallPolicyId struct { - SubscriptionId string - ResourceGroupName string - FirewallPolicyName string -} - -// NewFirewallPolicyID returns a new FirewallPolicyId struct -func NewFirewallPolicyID(subscriptionId string, resourceGroupName string, firewallPolicyName string) FirewallPolicyId { - return FirewallPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FirewallPolicyName: firewallPolicyName, - } -} - -// ParseFirewallPolicyID parses 'input' into a FirewallPolicyId -func ParseFirewallPolicyID(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFirewallPolicyIDInsensitively parses 'input' case-insensitively into a FirewallPolicyId -// note: this method should only be used for API response data and not user input -func ParseFirewallPolicyIDInsensitively(input string) (*FirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FirewallPolicyId) 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.FirewallPolicyName, ok = input.Parsed["firewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallPolicyName", input) - } - - return nil -} - -// ValidateFirewallPolicyID checks that 'input' can be parsed as a Firewall Policy ID -func ValidateFirewallPolicyID(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 := ParseFirewallPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Firewall Policy ID -func (id FirewallPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/firewallPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FirewallPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Firewall Policy ID -func (id FirewallPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticFirewallPolicies", "firewallPolicies", "firewallPolicies"), - resourceids.UserSpecifiedSegment("firewallPolicyName", "firewallPolicyValue"), - } -} - -// String returns a human-readable description of this Firewall Policy ID -func (id FirewallPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Firewall Policy Name: %q", id.FirewallPolicyName), - } - return fmt.Sprintf("Firewall Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go deleted file mode 100644 index d44f67c1a8e..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_firewallpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 = &FirewallPolicyId{} - -func TestNewFirewallPolicyID(t *testing.T) { - id := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue") - - 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.FirewallPolicyName != "firewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallPolicyName'", id.FirewallPolicyName, "firewallPolicyValue") - } -} - -func TestFormatFirewallPolicyID(t *testing.T) { - actual := NewFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFirewallPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyID(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestParseFirewallPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe", - Expected: &FirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FirewallPolicyName: "fIrEwAlLpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallPolicyIDInsensitively(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - } -} - -func TestSegmentsForFirewallPolicyId(t *testing.T) { - segments := FirewallPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FirewallPolicyId 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/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go deleted file mode 100644 index 5af7b6ffe79..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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(&RuleCollectionGroupId{}) -} - -var _ resourceids.ResourceId = &RuleCollectionGroupId{} - -// RuleCollectionGroupId is a struct representing the Resource ID for a Rule Collection Group -type RuleCollectionGroupId struct { - SubscriptionId string - ResourceGroupName string - FirewallPolicyName string - RuleCollectionGroupName string -} - -// NewRuleCollectionGroupID returns a new RuleCollectionGroupId struct -func NewRuleCollectionGroupID(subscriptionId string, resourceGroupName string, firewallPolicyName string, ruleCollectionGroupName string) RuleCollectionGroupId { - return RuleCollectionGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - FirewallPolicyName: firewallPolicyName, - RuleCollectionGroupName: ruleCollectionGroupName, - } -} - -// ParseRuleCollectionGroupID parses 'input' into a RuleCollectionGroupId -func ParseRuleCollectionGroupID(input string) (*RuleCollectionGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRuleCollectionGroupIDInsensitively parses 'input' case-insensitively into a RuleCollectionGroupId -// note: this method should only be used for API response data and not user input -func ParseRuleCollectionGroupIDInsensitively(input string) (*RuleCollectionGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&RuleCollectionGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RuleCollectionGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RuleCollectionGroupId) 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.FirewallPolicyName, ok = input.Parsed["firewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallPolicyName", input) - } - - if id.RuleCollectionGroupName, ok = input.Parsed["ruleCollectionGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleCollectionGroupName", input) - } - - return nil -} - -// ValidateRuleCollectionGroupID checks that 'input' can be parsed as a Rule Collection Group ID -func ValidateRuleCollectionGroupID(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 := ParseRuleCollectionGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Rule Collection Group ID -func (id RuleCollectionGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/firewallPolicies/%s/ruleCollectionGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.FirewallPolicyName, id.RuleCollectionGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Rule Collection Group ID -func (id RuleCollectionGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticFirewallPolicies", "firewallPolicies", "firewallPolicies"), - resourceids.UserSpecifiedSegment("firewallPolicyName", "firewallPolicyValue"), - resourceids.StaticSegment("staticRuleCollectionGroups", "ruleCollectionGroups", "ruleCollectionGroups"), - resourceids.UserSpecifiedSegment("ruleCollectionGroupName", "ruleCollectionGroupValue"), - } -} - -// String returns a human-readable description of this Rule Collection Group ID -func (id RuleCollectionGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Firewall Policy Name: %q", id.FirewallPolicyName), - fmt.Sprintf("Rule Collection Group Name: %q", id.RuleCollectionGroupName), - } - return fmt.Sprintf("Rule Collection Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go deleted file mode 100644 index fc951be50ba..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/id_rulecollectiongroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 = &RuleCollectionGroupId{} - -func TestNewRuleCollectionGroupID(t *testing.T) { - id := NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue") - - 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.FirewallPolicyName != "firewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallPolicyName'", id.FirewallPolicyName, "firewallPolicyValue") - } - - if id.RuleCollectionGroupName != "ruleCollectionGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleCollectionGroupName'", id.RuleCollectionGroupName, "ruleCollectionGroupValue") - } -} - -func TestFormatRuleCollectionGroupID(t *testing.T) { - actual := NewRuleCollectionGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "firewallPolicyValue", "ruleCollectionGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRuleCollectionGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue", - Expected: &RuleCollectionGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - RuleCollectionGroupName: "ruleCollectionGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionGroupID(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - if actual.RuleCollectionGroupName != v.Expected.RuleCollectionGroupName { - t.Fatalf("Expected %q but got %q for RuleCollectionGroupName", v.Expected.RuleCollectionGroupName, actual.RuleCollectionGroupName) - } - - } -} - -func TestParseRuleCollectionGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RuleCollectionGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/rUlEcOlLeCtIoNgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue", - Expected: &RuleCollectionGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - FirewallPolicyName: "firewallPolicyValue", - RuleCollectionGroupName: "ruleCollectionGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/firewallPolicies/firewallPolicyValue/ruleCollectionGroups/ruleCollectionGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/rUlEcOlLeCtIoNgRoUpS/rUlEcOlLeCtIoNgRoUpVaLuE", - Expected: &RuleCollectionGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - FirewallPolicyName: "fIrEwAlLpOlIcYvAlUe", - RuleCollectionGroupName: "rUlEcOlLeCtIoNgRoUpVaLuE", - }, - }, - { - // 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.nEtWoRk/fIrEwAlLpOlIcIeS/fIrEwAlLpOlIcYvAlUe/rUlEcOlLeCtIoNgRoUpS/rUlEcOlLeCtIoNgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRuleCollectionGroupIDInsensitively(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.FirewallPolicyName != v.Expected.FirewallPolicyName { - t.Fatalf("Expected %q but got %q for FirewallPolicyName", v.Expected.FirewallPolicyName, actual.FirewallPolicyName) - } - - if actual.RuleCollectionGroupName != v.Expected.RuleCollectionGroupName { - t.Fatalf("Expected %q but got %q for RuleCollectionGroupName", v.Expected.RuleCollectionGroupName, actual.RuleCollectionGroupName) - } - - } -} - -func TestSegmentsForRuleCollectionGroupId(t *testing.T) { - segments := RuleCollectionGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RuleCollectionGroupId 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/network/2023-06-01/firewallpolicyrulecollectiongroups/method_createorupdate.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_createorupdate.go deleted file mode 100644 index b067734262c..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 *FirewallPolicyRuleCollectionGroup -} - -// CreateOrUpdate ... -func (c FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdate(ctx context.Context, id RuleCollectionGroupId, input FirewallPolicyRuleCollectionGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FirewallPolicyRuleCollectionGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id RuleCollectionGroupId, input FirewallPolicyRuleCollectionGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/firewallpolicyrulecollectiongroups/method_delete.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_delete.go deleted file mode 100644 index 159bb061b84..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRuleCollectionGroupsClient) Delete(ctx context.Context, id RuleCollectionGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 FirewallPolicyRuleCollectionGroupsClient) DeleteThenPoll(ctx context.Context, id RuleCollectionGroupId) 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/network/2023-06-01/firewallpolicyrulecollectiongroups/method_get.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_get.go deleted file mode 100644 index 9c1602d7177..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 *FirewallPolicyRuleCollectionGroup -} - -// Get ... -func (c FirewallPolicyRuleCollectionGroupsClient) Get(ctx context.Context, id RuleCollectionGroupId) (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 FirewallPolicyRuleCollectionGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_list.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_list.go deleted file mode 100644 index d873a974633..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 *[]FirewallPolicyRuleCollectionGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FirewallPolicyRuleCollectionGroup -} - -// List ... -func (c FirewallPolicyRuleCollectionGroupsClient) List(ctx context.Context, id FirewallPolicyId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ruleCollectionGroups", 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 *[]FirewallPolicyRuleCollectionGroup `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 FirewallPolicyRuleCollectionGroupsClient) ListComplete(ctx context.Context, id FirewallPolicyId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FirewallPolicyRuleCollectionGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FirewallPolicyRuleCollectionGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id FirewallPolicyId, predicate FirewallPolicyRuleCollectionGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FirewallPolicyRuleCollectionGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/firewallpolicyrulecollectiongroups/model_applicationrule.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_applicationrule.go deleted file mode 100644 index 3e2815413ed..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_applicationrule.go +++ /dev/null @@ -1,52 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = ApplicationRule{} - -type ApplicationRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - FqdnTags *[]string `json:"fqdnTags,omitempty"` - HTTPHeadersToInsert *[]FirewallPolicyHTTPHeaderToInsert `json:"httpHeadersToInsert,omitempty"` - Protocols *[]FirewallPolicyRuleApplicationProtocol `json:"protocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TargetFqdns *[]string `json:"targetFqdns,omitempty"` - TargetUrls *[]string `json:"targetUrls,omitempty"` - TerminateTLS *bool `json:"terminateTLS,omitempty"` - WebCategories *[]string `json:"webCategories,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = ApplicationRule{} - -func (s ApplicationRule) MarshalJSON() ([]byte, error) { - type wrapper ApplicationRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ApplicationRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ApplicationRule: %+v", err) - } - decoded["ruleType"] = "ApplicationRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ApplicationRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go deleted file mode 100644 index 6e9762da492..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollection.go +++ /dev/null @@ -1,81 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRuleCollection = FirewallPolicyFilterRuleCollection{} - -type FirewallPolicyFilterRuleCollection struct { - Action *FirewallPolicyFilterRuleCollectionAction `json:"action,omitempty"` - Rules *[]FirewallPolicyRule `json:"rules,omitempty"` - - // Fields inherited from FirewallPolicyRuleCollection - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` -} - -var _ json.Marshaler = FirewallPolicyFilterRuleCollection{} - -func (s FirewallPolicyFilterRuleCollection) MarshalJSON() ([]byte, error) { - type wrapper FirewallPolicyFilterRuleCollection - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FirewallPolicyFilterRuleCollection: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyFilterRuleCollection: %+v", err) - } - decoded["ruleCollectionType"] = "FirewallPolicyFilterRuleCollection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FirewallPolicyFilterRuleCollection: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &FirewallPolicyFilterRuleCollection{} - -func (s *FirewallPolicyFilterRuleCollection) UnmarshalJSON(bytes []byte) error { - type alias FirewallPolicyFilterRuleCollection - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into FirewallPolicyFilterRuleCollection: %+v", err) - } - - s.Action = decoded.Action - s.Name = decoded.Name - s.Priority = decoded.Priority - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling FirewallPolicyFilterRuleCollection into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["rules"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Rules into list []json.RawMessage: %+v", err) - } - - output := make([]FirewallPolicyRule, 0) - for i, val := range listTemp { - impl, err := unmarshalFirewallPolicyRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Rules' for 'FirewallPolicyFilterRuleCollection': %+v", i, err) - } - output = append(output, impl) - } - s.Rules = &output - } - return nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go deleted file mode 100644 index 42d0cb7d127..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyfilterrulecollectionaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyFilterRuleCollectionAction struct { - Type *FirewallPolicyFilterRuleCollectionActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go deleted file mode 100644 index f7dd43c6089..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyhttpheadertoinsert.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyHTTPHeaderToInsert struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go deleted file mode 100644 index 114889c0540..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollection.go +++ /dev/null @@ -1,81 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRuleCollection = FirewallPolicyNatRuleCollection{} - -type FirewallPolicyNatRuleCollection struct { - Action *FirewallPolicyNatRuleCollectionAction `json:"action,omitempty"` - Rules *[]FirewallPolicyRule `json:"rules,omitempty"` - - // Fields inherited from FirewallPolicyRuleCollection - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` -} - -var _ json.Marshaler = FirewallPolicyNatRuleCollection{} - -func (s FirewallPolicyNatRuleCollection) MarshalJSON() ([]byte, error) { - type wrapper FirewallPolicyNatRuleCollection - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FirewallPolicyNatRuleCollection: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyNatRuleCollection: %+v", err) - } - decoded["ruleCollectionType"] = "FirewallPolicyNatRuleCollection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FirewallPolicyNatRuleCollection: %+v", err) - } - - return encoded, nil -} - -var _ json.Unmarshaler = &FirewallPolicyNatRuleCollection{} - -func (s *FirewallPolicyNatRuleCollection) UnmarshalJSON(bytes []byte) error { - type alias FirewallPolicyNatRuleCollection - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into FirewallPolicyNatRuleCollection: %+v", err) - } - - s.Action = decoded.Action - s.Name = decoded.Name - s.Priority = decoded.Priority - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling FirewallPolicyNatRuleCollection into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["rules"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Rules into list []json.RawMessage: %+v", err) - } - - output := make([]FirewallPolicyRule, 0) - for i, val := range listTemp { - impl, err := unmarshalFirewallPolicyRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Rules' for 'FirewallPolicyNatRuleCollection': %+v", i, err) - } - output = append(output, impl) - } - s.Rules = &output - } - return nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go deleted file mode 100644 index 0b31f5d8ffa..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicynatrulecollectionaction.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyNatRuleCollectionAction struct { - Type *FirewallPolicyNatRuleCollectionActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go deleted file mode 100644 index 5cd71ef998a..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrule.go +++ /dev/null @@ -1,69 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRule interface { -} - -// RawFirewallPolicyRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawFirewallPolicyRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalFirewallPolicyRuleImplementation(input []byte) (FirewallPolicyRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyRule into map[string]interface: %+v", err) - } - - value, ok := temp["ruleType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "ApplicationRule") { - var out ApplicationRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ApplicationRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NatRule") { - var out NatRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NatRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NetworkRule") { - var out NetworkRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NetworkRule: %+v", err) - } - return out, nil - } - - out := RawFirewallPolicyRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go deleted file mode 100644 index cc2db178d08..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyruleapplicationprotocol.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleApplicationProtocol struct { - Port *int64 `json:"port,omitempty"` - ProtocolType *FirewallPolicyRuleApplicationProtocolType `json:"protocolType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go deleted file mode 100644 index 30f1b958dc8..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollection.go +++ /dev/null @@ -1,61 +0,0 @@ -package firewallpolicyrulecollectiongroups - -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 FirewallPolicyRuleCollection interface { -} - -// RawFirewallPolicyRuleCollectionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawFirewallPolicyRuleCollectionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalFirewallPolicyRuleCollectionImplementation(input []byte) (FirewallPolicyRuleCollection, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling FirewallPolicyRuleCollection into map[string]interface: %+v", err) - } - - value, ok := temp["ruleCollectionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "FirewallPolicyFilterRuleCollection") { - var out FirewallPolicyFilterRuleCollection - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FirewallPolicyFilterRuleCollection: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "FirewallPolicyNatRuleCollection") { - var out FirewallPolicyNatRuleCollection - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FirewallPolicyNatRuleCollection: %+v", err) - } - return out, nil - } - - out := RawFirewallPolicyRuleCollectionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go deleted file mode 100644 index 3cd2b948905..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleCollectionGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FirewallPolicyRuleCollectionGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go deleted file mode 100644 index e395e7aa41f..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_firewallpolicyrulecollectiongroupproperties.go +++ /dev/null @@ -1,53 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleCollectionGroupProperties struct { - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleCollections *[]FirewallPolicyRuleCollection `json:"ruleCollections,omitempty"` - Size *string `json:"size,omitempty"` -} - -var _ json.Unmarshaler = &FirewallPolicyRuleCollectionGroupProperties{} - -func (s *FirewallPolicyRuleCollectionGroupProperties) UnmarshalJSON(bytes []byte) error { - type alias FirewallPolicyRuleCollectionGroupProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into FirewallPolicyRuleCollectionGroupProperties: %+v", err) - } - - s.Priority = decoded.Priority - s.ProvisioningState = decoded.ProvisioningState - s.Size = decoded.Size - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling FirewallPolicyRuleCollectionGroupProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["ruleCollections"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling RuleCollections into list []json.RawMessage: %+v", err) - } - - output := make([]FirewallPolicyRuleCollection, 0) - for i, val := range listTemp { - impl, err := unmarshalFirewallPolicyRuleCollectionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'RuleCollections' for 'FirewallPolicyRuleCollectionGroupProperties': %+v", i, err) - } - output = append(output, impl) - } - s.RuleCollections = &output - } - return nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_natrule.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_natrule.go deleted file mode 100644 index 5354374d68c..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_natrule.go +++ /dev/null @@ -1,50 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = NatRule{} - -type NatRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - TranslatedAddress *string `json:"translatedAddress,omitempty"` - TranslatedFqdn *string `json:"translatedFqdn,omitempty"` - TranslatedPort *string `json:"translatedPort,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = NatRule{} - -func (s NatRule) MarshalJSON() ([]byte, error) { - type wrapper NatRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NatRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NatRule: %+v", err) - } - decoded["ruleType"] = "NatRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NatRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_networkrule.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_networkrule.go deleted file mode 100644 index 7548f48a194..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/model_networkrule.go +++ /dev/null @@ -1,49 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ FirewallPolicyRule = NetworkRule{} - -type NetworkRule struct { - DestinationAddresses *[]string `json:"destinationAddresses,omitempty"` - DestinationFqdns *[]string `json:"destinationFqdns,omitempty"` - DestinationIPGroups *[]string `json:"destinationIpGroups,omitempty"` - DestinationPorts *[]string `json:"destinationPorts,omitempty"` - IPProtocols *[]FirewallPolicyRuleNetworkProtocol `json:"ipProtocols,omitempty"` - SourceAddresses *[]string `json:"sourceAddresses,omitempty"` - SourceIPGroups *[]string `json:"sourceIpGroups,omitempty"` - - // Fields inherited from FirewallPolicyRule - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} - -var _ json.Marshaler = NetworkRule{} - -func (s NetworkRule) MarshalJSON() ([]byte, error) { - type wrapper NetworkRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NetworkRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NetworkRule: %+v", err) - } - decoded["ruleType"] = "NetworkRule" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NetworkRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/predicates.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/predicates.go deleted file mode 100644 index 9762acada56..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package firewallpolicyrulecollectiongroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallPolicyRuleCollectionGroupOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p FirewallPolicyRuleCollectionGroupOperationPredicate) Matches(input FirewallPolicyRuleCollectionGroup) 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.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/network/2023-06-01/firewallpolicyrulecollectiongroups/version.go b/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/version.go deleted file mode 100644 index 983fe4d3968..00000000000 --- a/resource-manager/network/2023-06-01/firewallpolicyrulecollectiongroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallpolicyrulecollectiongroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallpolicyrulecollectiongroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/flowlogs/README.md b/resource-manager/network/2023-06-01/flowlogs/README.md deleted file mode 100644 index 50a1c31e507..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/README.md +++ /dev/null @@ -1,103 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/flowlogs` Documentation - -The `flowlogs` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/flowlogs" -``` - - -### Client Initialization - -```go -client := flowlogs.NewFlowLogsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FlowLogsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -payload := flowlogs.FlowLog{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FlowLogsClient.Delete` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FlowLogsClient.Get` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -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: `FlowLogsClient.List` - -```go -ctx := context.TODO() -id := flowlogs.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -// 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: `FlowLogsClient.UpdateTags` - -```go -ctx := context.TODO() -id := flowlogs.NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - -payload := flowlogs.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/network/2023-06-01/flowlogs/client.go b/resource-manager/network/2023-06-01/flowlogs/client.go deleted file mode 100644 index 9368055263b..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package flowlogs - -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 FlowLogsClient struct { - Client *resourcemanager.Client -} - -func NewFlowLogsClientWithBaseURI(sdkApi sdkEnv.Api) (*FlowLogsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "flowlogs", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FlowLogsClient: %+v", err) - } - - return &FlowLogsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/flowlogs/constants.go b/resource-manager/network/2023-06-01/flowlogs/constants.go deleted file mode 100644 index e5e97eea109..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/constants.go +++ /dev/null @@ -1,95 +0,0 @@ -package flowlogs - -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 FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/flowlogs/id_flowlog.go b/resource-manager/network/2023-06-01/flowlogs/id_flowlog.go deleted file mode 100644 index 65f0fddaf41..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/id_flowlog.go +++ /dev/null @@ -1,139 +0,0 @@ -package flowlogs - -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(&FlowLogId{}) -} - -var _ resourceids.ResourceId = &FlowLogId{} - -// FlowLogId is a struct representing the Resource ID for a Flow Log -type FlowLogId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string - FlowLogName string -} - -// NewFlowLogID returns a new FlowLogId struct -func NewFlowLogID(subscriptionId string, resourceGroupName string, networkWatcherName string, flowLogName string) FlowLogId { - return FlowLogId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - FlowLogName: flowLogName, - } -} - -// ParseFlowLogID parses 'input' into a FlowLogId -func ParseFlowLogID(input string) (*FlowLogId, error) { - parser := resourceids.NewParserFromResourceIdType(&FlowLogId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FlowLogId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFlowLogIDInsensitively parses 'input' case-insensitively into a FlowLogId -// note: this method should only be used for API response data and not user input -func ParseFlowLogIDInsensitively(input string) (*FlowLogId, error) { - parser := resourceids.NewParserFromResourceIdType(&FlowLogId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FlowLogId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FlowLogId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - if id.FlowLogName, ok = input.Parsed["flowLogName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "flowLogName", input) - } - - return nil -} - -// ValidateFlowLogID checks that 'input' can be parsed as a Flow Log ID -func ValidateFlowLogID(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 := ParseFlowLogID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Flow Log ID -func (id FlowLogId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s/flowLogs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName, id.FlowLogName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Flow Log ID -func (id FlowLogId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - resourceids.StaticSegment("staticFlowLogs", "flowLogs", "flowLogs"), - resourceids.UserSpecifiedSegment("flowLogName", "flowLogValue"), - } -} - -// String returns a human-readable description of this Flow Log ID -func (id FlowLogId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - fmt.Sprintf("Flow Log Name: %q", id.FlowLogName), - } - return fmt.Sprintf("Flow Log (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/flowlogs/id_flowlog_test.go b/resource-manager/network/2023-06-01/flowlogs/id_flowlog_test.go deleted file mode 100644 index b57a529ab52..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/id_flowlog_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package flowlogs - -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 = &FlowLogId{} - -func TestNewFlowLogID(t *testing.T) { - id := NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } - - if id.FlowLogName != "flowLogValue" { - t.Fatalf("Expected %q but got %q for Segment 'FlowLogName'", id.FlowLogName, "flowLogValue") - } -} - -func TestFormatFlowLogID(t *testing.T) { - actual := NewFlowLogID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "flowLogValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFlowLogID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FlowLogId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue", - Expected: &FlowLogId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - FlowLogName: "flowLogValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFlowLogID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.FlowLogName != v.Expected.FlowLogName { - t.Fatalf("Expected %q but got %q for FlowLogName", v.Expected.FlowLogName, actual.FlowLogName) - } - - } -} - -func TestParseFlowLogIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FlowLogId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/fLoWlOgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue", - Expected: &FlowLogId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - FlowLogName: "flowLogValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/flowLogs/flowLogValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/fLoWlOgS/fLoWlOgVaLuE", - Expected: &FlowLogId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - FlowLogName: "fLoWlOgVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/fLoWlOgS/fLoWlOgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFlowLogIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.FlowLogName != v.Expected.FlowLogName { - t.Fatalf("Expected %q but got %q for FlowLogName", v.Expected.FlowLogName, actual.FlowLogName) - } - - } -} - -func TestSegmentsForFlowLogId(t *testing.T) { - segments := FlowLogId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FlowLogId 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/network/2023-06-01/flowlogs/id_networkwatcher.go b/resource-manager/network/2023-06-01/flowlogs/id_networkwatcher.go deleted file mode 100644 index 480aa5be344..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package flowlogs - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/flowlogs/id_networkwatcher_test.go b/resource-manager/network/2023-06-01/flowlogs/id_networkwatcher_test.go deleted file mode 100644 index 8d877dbc644..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package flowlogs - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-06-01/flowlogs/method_createorupdate.go b/resource-manager/network/2023-06-01/flowlogs/method_createorupdate.go deleted file mode 100644 index 9469b674d32..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package flowlogs - -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 *FlowLog -} - -// CreateOrUpdate ... -func (c FlowLogsClient) CreateOrUpdate(ctx context.Context, id FlowLogId, input FlowLog) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FlowLogsClient) CreateOrUpdateThenPoll(ctx context.Context, id FlowLogId, input FlowLog) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/flowlogs/method_delete.go b/resource-manager/network/2023-06-01/flowlogs/method_delete.go deleted file mode 100644 index 1ff7776fa73..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package flowlogs - -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 FlowLogsClient) Delete(ctx context.Context, id FlowLogId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c FlowLogsClient) DeleteThenPoll(ctx context.Context, id FlowLogId) 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/network/2023-06-01/flowlogs/method_get.go b/resource-manager/network/2023-06-01/flowlogs/method_get.go deleted file mode 100644 index 91942eff6d3..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package flowlogs - -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 *FlowLog -} - -// Get ... -func (c FlowLogsClient) Get(ctx context.Context, id FlowLogId) (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 FlowLog - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/flowlogs/method_list.go b/resource-manager/network/2023-06-01/flowlogs/method_list.go deleted file mode 100644 index 56da8115500..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package flowlogs - -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 *[]FlowLog -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FlowLog -} - -// List ... -func (c FlowLogsClient) List(ctx context.Context, id NetworkWatcherId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/flowLogs", 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 *[]FlowLog `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 FlowLogsClient) ListComplete(ctx context.Context, id NetworkWatcherId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, FlowLogOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c FlowLogsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkWatcherId, predicate FlowLogOperationPredicate) (result ListCompleteResult, err error) { - items := make([]FlowLog, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/flowlogs/method_updatetags.go b/resource-manager/network/2023-06-01/flowlogs/method_updatetags.go deleted file mode 100644 index 7ef9682b564..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package flowlogs - -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 *FlowLog -} - -// UpdateTags ... -func (c FlowLogsClient) UpdateTags(ctx context.Context, id FlowLogId, 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 FlowLog - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/flowlogs/model_flowlog.go b/resource-manager/network/2023-06-01/flowlogs/model_flowlog.go deleted file mode 100644 index 6cb0c1a33b5..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/flowlogs/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/flowlogs/model_flowlogformatparameters.go deleted file mode 100644 index 16ca58e95a3..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/flowlogs/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/flowlogs/model_flowlogpropertiesformat.go deleted file mode 100644 index e08f8fc6124..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/flowlogs/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/flowlogs/model_retentionpolicyparameters.go deleted file mode 100644 index 37f07668bea..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/flowlogs/model_tagsobject.go b/resource-manager/network/2023-06-01/flowlogs/model_tagsobject.go deleted file mode 100644 index c5cd354ef29..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package flowlogs - -// 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/network/2023-06-01/flowlogs/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 5b935e5f27b..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsproperties.go deleted file mode 100644 index d6d9faede4b..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/flowlogs/predicates.go b/resource-manager/network/2023-06-01/flowlogs/predicates.go deleted file mode 100644 index 746df2611cc..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package flowlogs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p FlowLogOperationPredicate) Matches(input FlowLog) 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 && (input.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/network/2023-06-01/flowlogs/version.go b/resource-manager/network/2023-06-01/flowlogs/version.go deleted file mode 100644 index f7639dfefb5..00000000000 --- a/resource-manager/network/2023-06-01/flowlogs/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package flowlogs - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/flowlogs/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/ipallocations/README.md b/resource-manager/network/2023-06-01/ipallocations/README.md deleted file mode 100644 index b7d9289361a..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ipallocations` Documentation - -The `ipallocations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/ipallocations" -``` - - -### Client Initialization - -```go -client := ipallocations.NewIPAllocationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IPAllocationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -payload := ipallocations.IPAllocation{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPAllocationsClient.Delete` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPAllocationsClient.Get` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -read, err := client.Get(ctx, id, ipallocations.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IPAllocationsClient.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: `IPAllocationsClient.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: `IPAllocationsClient.UpdateTags` - -```go -ctx := context.TODO() -id := ipallocations.NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - -payload := ipallocations.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/network/2023-06-01/ipallocations/client.go b/resource-manager/network/2023-06-01/ipallocations/client.go deleted file mode 100644 index 0450bb3a685..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ipallocations - -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 IPAllocationsClient struct { - Client *resourcemanager.Client -} - -func NewIPAllocationsClientWithBaseURI(sdkApi sdkEnv.Api) (*IPAllocationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ipallocations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IPAllocationsClient: %+v", err) - } - - return &IPAllocationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/ipallocations/constants.go b/resource-manager/network/2023-06-01/ipallocations/constants.go deleted file mode 100644 index da0323d2ad0..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipallocations - -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 IPAllocationType string - -const ( - IPAllocationTypeHypernet IPAllocationType = "Hypernet" - IPAllocationTypeUndefined IPAllocationType = "Undefined" -) - -func PossibleValuesForIPAllocationType() []string { - return []string{ - string(IPAllocationTypeHypernet), - string(IPAllocationTypeUndefined), - } -} - -func (s *IPAllocationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationType(input string) (*IPAllocationType, error) { - vals := map[string]IPAllocationType{ - "hypernet": IPAllocationTypeHypernet, - "undefined": IPAllocationTypeUndefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationType(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/ipallocations/id_ipallocation.go b/resource-manager/network/2023-06-01/ipallocations/id_ipallocation.go deleted file mode 100644 index 1f45e0c491f..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/id_ipallocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package ipallocations - -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(&IPAllocationId{}) -} - -var _ resourceids.ResourceId = &IPAllocationId{} - -// IPAllocationId is a struct representing the Resource ID for a I P Allocation -type IPAllocationId struct { - SubscriptionId string - ResourceGroupName string - IpAllocationName string -} - -// NewIPAllocationID returns a new IPAllocationId struct -func NewIPAllocationID(subscriptionId string, resourceGroupName string, ipAllocationName string) IPAllocationId { - return IPAllocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IpAllocationName: ipAllocationName, - } -} - -// ParseIPAllocationID parses 'input' into a IPAllocationId -func ParseIPAllocationID(input string) (*IPAllocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPAllocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPAllocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIPAllocationIDInsensitively parses 'input' case-insensitively into a IPAllocationId -// note: this method should only be used for API response data and not user input -func ParseIPAllocationIDInsensitively(input string) (*IPAllocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPAllocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPAllocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IPAllocationId) 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.IpAllocationName, ok = input.Parsed["ipAllocationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ipAllocationName", input) - } - - return nil -} - -// ValidateIPAllocationID checks that 'input' can be parsed as a I P Allocation ID -func ValidateIPAllocationID(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 := ParseIPAllocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted I P Allocation ID -func (id IPAllocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ipAllocations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IpAllocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this I P Allocation ID -func (id IPAllocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticIpAllocations", "ipAllocations", "ipAllocations"), - resourceids.UserSpecifiedSegment("ipAllocationName", "ipAllocationValue"), - } -} - -// String returns a human-readable description of this I P Allocation ID -func (id IPAllocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ip Allocation Name: %q", id.IpAllocationName), - } - return fmt.Sprintf("I P Allocation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/ipallocations/id_ipallocation_test.go b/resource-manager/network/2023-06-01/ipallocations/id_ipallocation_test.go deleted file mode 100644 index 35284a7ef67..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/id_ipallocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ipallocations - -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 = &IPAllocationId{} - -func TestNewIPAllocationID(t *testing.T) { - id := NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue") - - 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.IpAllocationName != "ipAllocationValue" { - t.Fatalf("Expected %q but got %q for Segment 'IpAllocationName'", id.IpAllocationName, "ipAllocationValue") - } -} - -func TestFormatIPAllocationID(t *testing.T) { - actual := NewIPAllocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipAllocationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIPAllocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPAllocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue", - Expected: &IPAllocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpAllocationName: "ipAllocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPAllocationID(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.IpAllocationName != v.Expected.IpAllocationName { - t.Fatalf("Expected %q but got %q for IpAllocationName", v.Expected.IpAllocationName, actual.IpAllocationName) - } - - } -} - -func TestParseIPAllocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPAllocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPaLlOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue", - Expected: &IPAllocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpAllocationName: "ipAllocationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipAllocations/ipAllocationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPaLlOcAtIoNs/iPaLlOcAtIoNvAlUe", - Expected: &IPAllocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpAllocationName: "iPaLlOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/iPaLlOcAtIoNs/iPaLlOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPAllocationIDInsensitively(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.IpAllocationName != v.Expected.IpAllocationName { - t.Fatalf("Expected %q but got %q for IpAllocationName", v.Expected.IpAllocationName, actual.IpAllocationName) - } - - } -} - -func TestSegmentsForIPAllocationId(t *testing.T) { - segments := IPAllocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IPAllocationId 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/network/2023-06-01/ipallocations/method_createorupdate.go b/resource-manager/network/2023-06-01/ipallocations/method_createorupdate.go deleted file mode 100644 index 6b097aa0b1a..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ipallocations - -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 *IPAllocation -} - -// CreateOrUpdate ... -func (c IPAllocationsClient) CreateOrUpdate(ctx context.Context, id IPAllocationId, input IPAllocation) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c IPAllocationsClient) CreateOrUpdateThenPoll(ctx context.Context, id IPAllocationId, input IPAllocation) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/ipallocations/method_delete.go b/resource-manager/network/2023-06-01/ipallocations/method_delete.go deleted file mode 100644 index 2e272e0b823..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ipallocations - -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 IPAllocationsClient) Delete(ctx context.Context, id IPAllocationId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 IPAllocationsClient) DeleteThenPoll(ctx context.Context, id IPAllocationId) 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/network/2023-06-01/ipallocations/method_get.go b/resource-manager/network/2023-06-01/ipallocations/method_get.go deleted file mode 100644 index 6d8c674b8b8..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package ipallocations - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPAllocation -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c IPAllocationsClient) Get(ctx context.Context, id IPAllocationId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 IPAllocation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ipallocations/method_list.go b/resource-manager/network/2023-06-01/ipallocations/method_list.go deleted file mode 100644 index e1f24020606..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipallocations - -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 *[]IPAllocation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPAllocation -} - -// List ... -func (c IPAllocationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipAllocations", 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 *[]IPAllocation `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 IPAllocationsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, IPAllocationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPAllocationsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IPAllocationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IPAllocation, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/ipallocations/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/ipallocations/method_listbyresourcegroup.go deleted file mode 100644 index 9a7f784e207..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipallocations - -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 *[]IPAllocation -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPAllocation -} - -// ListByResourceGroup ... -func (c IPAllocationsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipAllocations", 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 *[]IPAllocation `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 IPAllocationsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, IPAllocationOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPAllocationsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IPAllocationOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]IPAllocation, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/ipallocations/method_updatetags.go b/resource-manager/network/2023-06-01/ipallocations/method_updatetags.go deleted file mode 100644 index 792fe909fcb..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package ipallocations - -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 *IPAllocation -} - -// UpdateTags ... -func (c IPAllocationsClient) UpdateTags(ctx context.Context, id IPAllocationId, 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 IPAllocation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ipallocations/model_ipallocation.go b/resource-manager/network/2023-06-01/ipallocations/model_ipallocation.go deleted file mode 100644 index d59b8140ce3..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/model_ipallocation.go +++ /dev/null @@ -1,14 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAllocation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPAllocationPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ipallocations/model_ipallocationpropertiesformat.go b/resource-manager/network/2023-06-01/ipallocations/model_ipallocationpropertiesformat.go deleted file mode 100644 index ee1eec041ee..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/model_ipallocationpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAllocationPropertiesFormat struct { - AllocationTags *map[string]string `json:"allocationTags,omitempty"` - IPamAllocationId *string `json:"ipamAllocationId,omitempty"` - Prefix *string `json:"prefix,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` - PrefixType *IPVersion `json:"prefixType,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - Type *IPAllocationType `json:"type,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ipallocations/model_subresource.go b/resource-manager/network/2023-06-01/ipallocations/model_subresource.go deleted file mode 100644 index 3d4e1d6d386..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ipallocations/model_tagsobject.go b/resource-manager/network/2023-06-01/ipallocations/model_tagsobject.go deleted file mode 100644 index e07b18f03bb..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipallocations - -// 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/network/2023-06-01/ipallocations/predicates.go b/resource-manager/network/2023-06-01/ipallocations/predicates.go deleted file mode 100644 index 5f4e136ae66..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package ipallocations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAllocationOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p IPAllocationOperationPredicate) Matches(input IPAllocation) 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 && (input.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/network/2023-06-01/ipallocations/version.go b/resource-manager/network/2023-06-01/ipallocations/version.go deleted file mode 100644 index 46092ec9b6d..00000000000 --- a/resource-manager/network/2023-06-01/ipallocations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ipallocations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ipallocations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/ipgroups/README.md b/resource-manager/network/2023-06-01/ipgroups/README.md deleted file mode 100644 index 63abe7be300..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/ipgroups` Documentation - -The `ipgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/ipgroups" -``` - - -### Client Initialization - -```go -client := ipgroups.NewIPGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IPGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -payload := ipgroups.IPGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPGroupsClient.Delete` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `IPGroupsClient.Get` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -read, err := client.Get(ctx, id, ipgroups.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IPGroupsClient.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: `IPGroupsClient.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: `IPGroupsClient.UpdateGroups` - -```go -ctx := context.TODO() -id := ipgroups.NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - -payload := ipgroups.TagsObject{ - // ... -} - - -read, err := client.UpdateGroups(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/network/2023-06-01/ipgroups/client.go b/resource-manager/network/2023-06-01/ipgroups/client.go deleted file mode 100644 index 3e21fe9f946..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package ipgroups - -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 IPGroupsClient struct { - Client *resourcemanager.Client -} - -func NewIPGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*IPGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "ipgroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IPGroupsClient: %+v", err) - } - - return &IPGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/ipgroups/constants.go b/resource-manager/network/2023-06-01/ipgroups/constants.go deleted file mode 100644 index a50092f263a..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package ipgroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/ipgroups/id_ipgroup.go b/resource-manager/network/2023-06-01/ipgroups/id_ipgroup.go deleted file mode 100644 index 7b564788b08..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/id_ipgroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package ipgroups - -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(&IPGroupId{}) -} - -var _ resourceids.ResourceId = &IPGroupId{} - -// IPGroupId is a struct representing the Resource ID for a I P Group -type IPGroupId struct { - SubscriptionId string - ResourceGroupName string - IpGroupName string -} - -// NewIPGroupID returns a new IPGroupId struct -func NewIPGroupID(subscriptionId string, resourceGroupName string, ipGroupName string) IPGroupId { - return IPGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IpGroupName: ipGroupName, - } -} - -// ParseIPGroupID parses 'input' into a IPGroupId -func ParseIPGroupID(input string) (*IPGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIPGroupIDInsensitively parses 'input' case-insensitively into a IPGroupId -// note: this method should only be used for API response data and not user input -func ParseIPGroupIDInsensitively(input string) (*IPGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&IPGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IPGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IPGroupId) 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.IpGroupName, ok = input.Parsed["ipGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ipGroupName", input) - } - - return nil -} - -// ValidateIPGroupID checks that 'input' can be parsed as a I P Group ID -func ValidateIPGroupID(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 := ParseIPGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted I P Group ID -func (id IPGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/ipGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IpGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this I P Group ID -func (id IPGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticIpGroups", "ipGroups", "ipGroups"), - resourceids.UserSpecifiedSegment("ipGroupName", "ipGroupValue"), - } -} - -// String returns a human-readable description of this I P Group ID -func (id IPGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Ip Group Name: %q", id.IpGroupName), - } - return fmt.Sprintf("I P Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/ipgroups/id_ipgroup_test.go b/resource-manager/network/2023-06-01/ipgroups/id_ipgroup_test.go deleted file mode 100644 index 22968e22020..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/id_ipgroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package ipgroups - -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 = &IPGroupId{} - -func TestNewIPGroupID(t *testing.T) { - id := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue") - - 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.IpGroupName != "ipGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'IpGroupName'", id.IpGroupName, "ipGroupValue") - } -} - -func TestFormatIPGroupID(t *testing.T) { - actual := NewIPGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "ipGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIPGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue", - Expected: &IPGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPGroupID(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.IpGroupName != v.Expected.IpGroupName { - t.Fatalf("Expected %q but got %q for IpGroupName", v.Expected.IpGroupName, actual.IpGroupName) - } - - } -} - -func TestParseIPGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IPGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue", - Expected: &IPGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IpGroupName: "ipGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/ipGroups/ipGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/iPgRoUpS/iPgRoUpVaLuE", - Expected: &IPGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IpGroupName: "iPgRoUpVaLuE", - }, - }, - { - // 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.nEtWoRk/iPgRoUpS/iPgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIPGroupIDInsensitively(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.IpGroupName != v.Expected.IpGroupName { - t.Fatalf("Expected %q but got %q for IpGroupName", v.Expected.IpGroupName, actual.IpGroupName) - } - - } -} - -func TestSegmentsForIPGroupId(t *testing.T) { - segments := IPGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IPGroupId 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/network/2023-06-01/ipgroups/method_createorupdate.go b/resource-manager/network/2023-06-01/ipgroups/method_createorupdate.go deleted file mode 100644 index fe09b1c7bf6..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package ipgroups - -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 *IPGroup -} - -// CreateOrUpdate ... -func (c IPGroupsClient) CreateOrUpdate(ctx context.Context, id IPGroupId, input IPGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c IPGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id IPGroupId, input IPGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/ipgroups/method_delete.go b/resource-manager/network/2023-06-01/ipgroups/method_delete.go deleted file mode 100644 index 1e1797dd8d3..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package ipgroups - -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 IPGroupsClient) Delete(ctx context.Context, id IPGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 IPGroupsClient) DeleteThenPoll(ctx context.Context, id IPGroupId) 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/network/2023-06-01/ipgroups/method_get.go b/resource-manager/network/2023-06-01/ipgroups/method_get.go deleted file mode 100644 index c1a0a108f8e..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package ipgroups - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPGroup -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c IPGroupsClient) Get(ctx context.Context, id IPGroupId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 IPGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ipgroups/method_list.go b/resource-manager/network/2023-06-01/ipgroups/method_list.go deleted file mode 100644 index a1edbd26600..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipgroups - -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 *[]IPGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPGroup -} - -// List ... -func (c IPGroupsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipGroups", 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 *[]IPGroup `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 IPGroupsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, IPGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate IPGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IPGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/ipgroups/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/ipgroups/method_listbyresourcegroup.go deleted file mode 100644 index 96af39068d9..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package ipgroups - -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 *[]IPGroup -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []IPGroup -} - -// ListByResourceGroup ... -func (c IPGroupsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/ipGroups", 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 *[]IPGroup `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 IPGroupsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, IPGroupOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IPGroupsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate IPGroupOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]IPGroup, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/ipgroups/method_updategroups.go b/resource-manager/network/2023-06-01/ipgroups/method_updategroups.go deleted file mode 100644 index 67a51b18e05..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/method_updategroups.go +++ /dev/null @@ -1,58 +0,0 @@ -package ipgroups - -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 UpdateGroupsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPGroup -} - -// UpdateGroups ... -func (c IPGroupsClient) UpdateGroups(ctx context.Context, id IPGroupId, input TagsObject) (result UpdateGroupsOperationResponse, 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 IPGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/ipgroups/model_ipgroup.go b/resource-manager/network/2023-06-01/ipgroups/model_ipgroup.go deleted file mode 100644 index 7f586ce2b06..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/model_ipgroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ipgroups/model_ipgrouppropertiesformat.go b/resource-manager/network/2023-06-01/ipgroups/model_ipgrouppropertiesformat.go deleted file mode 100644 index 866075a1038..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/model_ipgrouppropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPGroupPropertiesFormat struct { - FirewallPolicies *[]SubResource `json:"firewallPolicies,omitempty"` - Firewalls *[]SubResource `json:"firewalls,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ipgroups/model_subresource.go b/resource-manager/network/2023-06-01/ipgroups/model_subresource.go deleted file mode 100644 index 5e6c0552f0c..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/ipgroups/model_tagsobject.go b/resource-manager/network/2023-06-01/ipgroups/model_tagsobject.go deleted file mode 100644 index df59e42aff4..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package ipgroups - -// 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/network/2023-06-01/ipgroups/predicates.go b/resource-manager/network/2023-06-01/ipgroups/predicates.go deleted file mode 100644 index a64e98c2290..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package ipgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPGroupOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p IPGroupOperationPredicate) Matches(input IPGroup) 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 && (input.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/network/2023-06-01/ipgroups/version.go b/resource-manager/network/2023-06-01/ipgroups/version.go deleted file mode 100644 index 761223d715a..00000000000 --- a/resource-manager/network/2023-06-01/ipgroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package ipgroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/ipgroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/README.md b/resource-manager/network/2023-06-01/loadbalancers/README.md deleted file mode 100644 index 23705a4adc1..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/README.md +++ /dev/null @@ -1,449 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/loadbalancers` Documentation - -The `loadbalancers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/loadbalancers" -``` - - -### Client Initialization - -```go -client := loadbalancers.NewLoadBalancersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LoadBalancersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -payload := loadbalancers.LoadBalancer{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.Delete` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.Get` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -read, err := client.Get(ctx, id, loadbalancers.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -payload := loadbalancers.InboundNatRule{ - // ... -} - - -if err := client.InboundNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesDelete` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -if err := client.InboundNatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - -read, err := client.InboundNatRulesGet(ctx, id, loadbalancers.DefaultInboundNatRulesGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.InboundNatRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.InboundNatRulesList(ctx, id)` can be used to do batched pagination -items, err := client.InboundNatRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LoadBalancersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.ListInboundNatRulePortMappings` - -```go -ctx := context.TODO() -id := loadbalancers.NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue") - -payload := loadbalancers.QueryInboundNatRulePortMappingRequest{ - // ... -} - - -if err := client.ListInboundNatRulePortMappingsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsCreateOrUpdate` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -payload := loadbalancers.BackendAddressPool{ - // ... -} - - -if err := client.LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsDelete` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -if err := client.LoadBalancerBackendAddressPoolsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - -read, err := client.LoadBalancerBackendAddressPoolsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerBackendAddressPoolsList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerBackendAddressPoolsList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerBackendAddressPoolsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue") - -read, err := client.LoadBalancerFrontendIPConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerFrontendIPConfigurationsList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerFrontendIPConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerFrontendIPConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue") - -read, err := client.LoadBalancerLoadBalancingRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerLoadBalancingRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerLoadBalancingRulesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerLoadBalancingRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerNetworkInterfacesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerNetworkInterfacesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerNetworkInterfacesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue") - -read, err := client.LoadBalancerOutboundRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerOutboundRulesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerOutboundRulesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerOutboundRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerProbesGet` - -```go -ctx := context.TODO() -id := loadbalancers.NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue") - -read, err := client.LoadBalancerProbesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.LoadBalancerProbesList` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -// alternatively `client.LoadBalancerProbesList(ctx, id)` can be used to do batched pagination -items, err := client.LoadBalancerProbesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `LoadBalancersClient.MigrateToIPBased` - -```go -ctx := context.TODO() -id := loadbalancers.NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue") - -payload := loadbalancers.MigrateLoadBalancerToIPBasedRequest{ - // ... -} - - -read, err := client.MigrateToIPBased(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `LoadBalancersClient.SwapPublicIPAddresses` - -```go -ctx := context.TODO() -id := loadbalancers.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := loadbalancers.LoadBalancerVipSwapRequest{ - // ... -} - - -if err := client.SwapPublicIPAddressesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LoadBalancersClient.UpdateTags` - -```go -ctx := context.TODO() -id := loadbalancers.NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - -payload := loadbalancers.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/network/2023-06-01/loadbalancers/client.go b/resource-manager/network/2023-06-01/loadbalancers/client.go deleted file mode 100644 index 3d84973a709..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package loadbalancers - -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 LoadBalancersClient struct { - Client *resourcemanager.Client -} - -func NewLoadBalancersClientWithBaseURI(sdkApi sdkEnv.Api) (*LoadBalancersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "loadbalancers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LoadBalancersClient: %+v", err) - } - - return &LoadBalancersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/constants.go b/resource-manager/network/2023-06-01/loadbalancers/constants.go deleted file mode 100644 index 0e8874db62b..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/constants.go +++ /dev/null @@ -1,1368 +0,0 @@ -package loadbalancers - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" -) - -func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { - return []string{ - string(LoadBalancerOutboundRuleProtocolAll), - string(LoadBalancerOutboundRuleProtocolTcp), - string(LoadBalancerOutboundRuleProtocolUdp), - } -} - -func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerOutboundRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { - vals := map[string]LoadBalancerOutboundRuleProtocol{ - "all": LoadBalancerOutboundRuleProtocolAll, - "tcp": LoadBalancerOutboundRuleProtocolTcp, - "udp": LoadBalancerOutboundRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerOutboundRuleProtocol(input) - return &out, nil -} - -type LoadBalancerSkuName string - -const ( - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -func PossibleValuesForLoadBalancerSkuName() []string { - return []string{ - string(LoadBalancerSkuNameBasic), - string(LoadBalancerSkuNameGateway), - string(LoadBalancerSkuNameStandard), - } -} - -func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { - vals := map[string]LoadBalancerSkuName{ - "basic": LoadBalancerSkuNameBasic, - "gateway": LoadBalancerSkuNameGateway, - "standard": LoadBalancerSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuName(input) - return &out, nil -} - -type LoadBalancerSkuTier string - -const ( - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" -) - -func PossibleValuesForLoadBalancerSkuTier() []string { - return []string{ - string(LoadBalancerSkuTierGlobal), - string(LoadBalancerSkuTierRegional), - } -} - -func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { - vals := map[string]LoadBalancerSkuTier{ - "global": LoadBalancerSkuTierGlobal, - "regional": LoadBalancerSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuTier(input) - return &out, nil -} - -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -func PossibleValuesForLoadDistribution() []string { - return []string{ - string(LoadDistributionDefault), - string(LoadDistributionSourceIP), - string(LoadDistributionSourceIPProtocol), - } -} - -func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadDistribution(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadDistribution(input string) (*LoadDistribution, error) { - vals := map[string]LoadDistribution{ - "default": LoadDistributionDefault, - "sourceip": LoadDistributionSourceIP, - "sourceipprotocol": LoadDistributionSourceIPProtocol, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadDistribution(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTcp ProbeProtocol = "Tcp" -) - -func PossibleValuesForProbeProtocol() []string { - return []string{ - string(ProbeProtocolHTTP), - string(ProbeProtocolHTTPS), - string(ProbeProtocolTcp), - } -} - -func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProbeProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProbeProtocol(input string) (*ProbeProtocol, error) { - vals := map[string]ProbeProtocol{ - "http": ProbeProtocolHTTP, - "https": ProbeProtocolHTTPS, - "tcp": ProbeProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProbeProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool.go b/resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool.go deleted file mode 100644 index 57be52cf337..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&BackendAddressPoolId{}) -} - -var _ resourceids.ResourceId = &BackendAddressPoolId{} - -// BackendAddressPoolId is a struct representing the Resource ID for a Backend Address Pool -type BackendAddressPoolId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - BackendAddressPoolName string -} - -// NewBackendAddressPoolID returns a new BackendAddressPoolId struct -func NewBackendAddressPoolID(subscriptionId string, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) BackendAddressPoolId { - return BackendAddressPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - BackendAddressPoolName: backendAddressPoolName, - } -} - -// ParseBackendAddressPoolID parses 'input' into a BackendAddressPoolId -func ParseBackendAddressPoolID(input string) (*BackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&BackendAddressPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBackendAddressPoolIDInsensitively parses 'input' case-insensitively into a BackendAddressPoolId -// note: this method should only be used for API response data and not user input -func ParseBackendAddressPoolIDInsensitively(input string) (*BackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&BackendAddressPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BackendAddressPoolId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.BackendAddressPoolName, ok = input.Parsed["backendAddressPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backendAddressPoolName", input) - } - - return nil -} - -// ValidateBackendAddressPoolID checks that 'input' can be parsed as a Backend Address Pool ID -func ValidateBackendAddressPoolID(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 := ParseBackendAddressPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Backend Address Pool ID -func (id BackendAddressPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/backendAddressPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.BackendAddressPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Backend Address Pool ID -func (id BackendAddressPoolId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolValue"), - } -} - -// String returns a human-readable description of this Backend Address Pool ID -func (id BackendAddressPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Backend Address Pool Name: %q", id.BackendAddressPoolName), - } - return fmt.Sprintf("Backend Address Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool_test.go deleted file mode 100644 index f21fb27becf..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_backendaddresspool_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &BackendAddressPoolId{} - -func TestNewBackendAddressPoolID(t *testing.T) { - id := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.BackendAddressPoolName != "backendAddressPoolValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolValue") - } -} - -func TestFormatBackendAddressPoolID(t *testing.T) { - actual := NewBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue", "backendAddressPoolValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBackendAddressPoolID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BackendAddressPoolId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &BackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBackendAddressPoolID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestParseBackendAddressPoolIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BackendAddressPoolId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &BackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe", - Expected: &BackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBackendAddressPoolIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestSegmentsForBackendAddressPoolId(t *testing.T) { - segments := BackendAddressPoolId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BackendAddressPoolId 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/network/2023-06-01/loadbalancers/id_frontendipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration.go deleted file mode 100644 index dd3cba98217..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&FrontendIPConfigurationId{}) -} - -var _ resourceids.ResourceId = &FrontendIPConfigurationId{} - -// FrontendIPConfigurationId is a struct representing the Resource ID for a Frontend I P Configuration -type FrontendIPConfigurationId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - FrontendIPConfigurationName string -} - -// NewFrontendIPConfigurationID returns a new FrontendIPConfigurationId struct -func NewFrontendIPConfigurationID(subscriptionId string, resourceGroupName string, loadBalancerName string, frontendIPConfigurationName string) FrontendIPConfigurationId { - return FrontendIPConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - FrontendIPConfigurationName: frontendIPConfigurationName, - } -} - -// ParseFrontendIPConfigurationID parses 'input' into a FrontendIPConfigurationId -func ParseFrontendIPConfigurationID(input string) (*FrontendIPConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&FrontendIPConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FrontendIPConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFrontendIPConfigurationIDInsensitively parses 'input' case-insensitively into a FrontendIPConfigurationId -// note: this method should only be used for API response data and not user input -func ParseFrontendIPConfigurationIDInsensitively(input string) (*FrontendIPConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&FrontendIPConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FrontendIPConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FrontendIPConfigurationId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.FrontendIPConfigurationName, ok = input.Parsed["frontendIPConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "frontendIPConfigurationName", input) - } - - return nil -} - -// ValidateFrontendIPConfigurationID checks that 'input' can be parsed as a Frontend I P Configuration ID -func ValidateFrontendIPConfigurationID(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 := ParseFrontendIPConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Frontend I P Configuration ID -func (id FrontendIPConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/frontendIPConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.FrontendIPConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Frontend I P Configuration ID -func (id FrontendIPConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticFrontendIPConfigurations", "frontendIPConfigurations", "frontendIPConfigurations"), - resourceids.UserSpecifiedSegment("frontendIPConfigurationName", "frontendIPConfigurationValue"), - } -} - -// String returns a human-readable description of this Frontend I P Configuration ID -func (id FrontendIPConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Frontend I P Configuration Name: %q", id.FrontendIPConfigurationName), - } - return fmt.Sprintf("Frontend I P Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration_test.go deleted file mode 100644 index 06fbc5508d7..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_frontendipconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &FrontendIPConfigurationId{} - -func TestNewFrontendIPConfigurationID(t *testing.T) { - id := NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.FrontendIPConfigurationName != "frontendIPConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'FrontendIPConfigurationName'", id.FrontendIPConfigurationName, "frontendIPConfigurationValue") - } -} - -func TestFormatFrontendIPConfigurationID(t *testing.T) { - actual := NewFrontendIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "frontendIPConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFrontendIPConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FrontendIPConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue", - Expected: &FrontendIPConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - FrontendIPConfigurationName: "frontendIPConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFrontendIPConfigurationID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.FrontendIPConfigurationName != v.Expected.FrontendIPConfigurationName { - t.Fatalf("Expected %q but got %q for FrontendIPConfigurationName", v.Expected.FrontendIPConfigurationName, actual.FrontendIPConfigurationName) - } - - } -} - -func TestParseFrontendIPConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FrontendIPConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/fRoNtEnDiPcOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue", - Expected: &FrontendIPConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - FrontendIPConfigurationName: "frontendIPConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/frontendIPConfigurations/frontendIPConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/fRoNtEnDiPcOnFiGuRaTiOnS/fRoNtEnDiPcOnFiGuRaTiOnVaLuE", - Expected: &FrontendIPConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - FrontendIPConfigurationName: "fRoNtEnDiPcOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/fRoNtEnDiPcOnFiGuRaTiOnS/fRoNtEnDiPcOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFrontendIPConfigurationIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.FrontendIPConfigurationName != v.Expected.FrontendIPConfigurationName { - t.Fatalf("Expected %q but got %q for FrontendIPConfigurationName", v.Expected.FrontendIPConfigurationName, actual.FrontendIPConfigurationName) - } - - } -} - -func TestSegmentsForFrontendIPConfigurationId(t *testing.T) { - segments := FrontendIPConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FrontendIPConfigurationId 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/network/2023-06-01/loadbalancers/id_inboundnatrule.go b/resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule.go deleted file mode 100644 index a460bece352..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&InboundNatRuleId{}) -} - -var _ resourceids.ResourceId = &InboundNatRuleId{} - -// InboundNatRuleId is a struct representing the Resource ID for a Inbound Nat Rule -type InboundNatRuleId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - InboundNatRuleName string -} - -// NewInboundNatRuleID returns a new InboundNatRuleId struct -func NewInboundNatRuleID(subscriptionId string, resourceGroupName string, loadBalancerName string, inboundNatRuleName string) InboundNatRuleId { - return InboundNatRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - InboundNatRuleName: inboundNatRuleName, - } -} - -// ParseInboundNatRuleID parses 'input' into a InboundNatRuleId -func ParseInboundNatRuleID(input string) (*InboundNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundNatRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseInboundNatRuleIDInsensitively parses 'input' case-insensitively into a InboundNatRuleId -// note: this method should only be used for API response data and not user input -func ParseInboundNatRuleIDInsensitively(input string) (*InboundNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundNatRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *InboundNatRuleId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.InboundNatRuleName, ok = input.Parsed["inboundNatRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "inboundNatRuleName", input) - } - - return nil -} - -// ValidateInboundNatRuleID checks that 'input' can be parsed as a Inbound Nat Rule ID -func ValidateInboundNatRuleID(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 := ParseInboundNatRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Inbound Nat Rule ID -func (id InboundNatRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/inboundNatRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.InboundNatRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Inbound Nat Rule ID -func (id InboundNatRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticInboundNatRules", "inboundNatRules", "inboundNatRules"), - resourceids.UserSpecifiedSegment("inboundNatRuleName", "inboundNatRuleValue"), - } -} - -// String returns a human-readable description of this Inbound Nat Rule ID -func (id InboundNatRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Inbound Nat Rule Name: %q", id.InboundNatRuleName), - } - return fmt.Sprintf("Inbound Nat Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule_test.go deleted file mode 100644 index fc4882733d2..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_inboundnatrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &InboundNatRuleId{} - -func TestNewInboundNatRuleID(t *testing.T) { - id := NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.InboundNatRuleName != "inboundNatRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'InboundNatRuleName'", id.InboundNatRuleName, "inboundNatRuleValue") - } -} - -func TestFormatInboundNatRuleID(t *testing.T) { - actual := NewInboundNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "inboundNatRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseInboundNatRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue", - Expected: &InboundNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - InboundNatRuleName: "inboundNatRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundNatRuleID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.InboundNatRuleName != v.Expected.InboundNatRuleName { - t.Fatalf("Expected %q but got %q for InboundNatRuleName", v.Expected.InboundNatRuleName, actual.InboundNatRuleName) - } - - } -} - -func TestParseInboundNatRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/iNbOuNdNaTrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue", - Expected: &InboundNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - InboundNatRuleName: "inboundNatRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/inboundNatRules/inboundNatRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/iNbOuNdNaTrUlEs/iNbOuNdNaTrUlEvAlUe", - Expected: &InboundNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - InboundNatRuleName: "iNbOuNdNaTrUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/iNbOuNdNaTrUlEs/iNbOuNdNaTrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundNatRuleIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.InboundNatRuleName != v.Expected.InboundNatRuleName { - t.Fatalf("Expected %q but got %q for InboundNatRuleName", v.Expected.InboundNatRuleName, actual.InboundNatRuleName) - } - - } -} - -func TestSegmentsForInboundNatRuleId(t *testing.T) { - segments := InboundNatRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("InboundNatRuleId 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/network/2023-06-01/loadbalancers/id_loadbalancer.go b/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer.go deleted file mode 100644 index 35278257e30..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer.go +++ /dev/null @@ -1,130 +0,0 @@ -package loadbalancers - -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(&LoadBalancerId{}) -} - -var _ resourceids.ResourceId = &LoadBalancerId{} - -// LoadBalancerId is a struct representing the Resource ID for a Load Balancer -type LoadBalancerId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string -} - -// NewLoadBalancerID returns a new LoadBalancerId struct -func NewLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) LoadBalancerId { - return LoadBalancerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - } -} - -// ParseLoadBalancerID parses 'input' into a LoadBalancerId -func ParseLoadBalancerID(input string) (*LoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancerIDInsensitively parses 'input' case-insensitively into a LoadBalancerId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancerIDInsensitively(input string) (*LoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - return nil -} - -// ValidateLoadBalancerID checks that 'input' can be parsed as a Load Balancer ID -func ValidateLoadBalancerID(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 := ParseLoadBalancerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancer ID -func (id LoadBalancerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancer ID -func (id LoadBalancerId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - } -} - -// String returns a human-readable description of this Load Balancer ID -func (id LoadBalancerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - } - return fmt.Sprintf("Load Balancer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer_test.go deleted file mode 100644 index 88f22b83175..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadbalancers - -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 = &LoadBalancerId{} - -func TestNewLoadBalancerID(t *testing.T) { - id := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } -} - -func TestFormatLoadBalancerID(t *testing.T) { - actual := NewLoadBalancerID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "loadBalancerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestParseLoadBalancerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Expected: &LoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestSegmentsForLoadBalancerId(t *testing.T) { - segments := LoadBalancerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancerId 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/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool.go b/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool.go deleted file mode 100644 index d8fafa2347f..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&LoadBalancerBackendAddressPoolId{}) -} - -var _ resourceids.ResourceId = &LoadBalancerBackendAddressPoolId{} - -// LoadBalancerBackendAddressPoolId is a struct representing the Resource ID for a Load Balancer Backend Address Pool -type LoadBalancerBackendAddressPoolId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - BackendAddressPoolName string -} - -// NewLoadBalancerBackendAddressPoolID returns a new LoadBalancerBackendAddressPoolId struct -func NewLoadBalancerBackendAddressPoolID(subscriptionId string, resourceGroupName string, loadBalancerName string, backendAddressPoolName string) LoadBalancerBackendAddressPoolId { - return LoadBalancerBackendAddressPoolId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - BackendAddressPoolName: backendAddressPoolName, - } -} - -// ParseLoadBalancerBackendAddressPoolID parses 'input' into a LoadBalancerBackendAddressPoolId -func ParseLoadBalancerBackendAddressPoolID(input string) (*LoadBalancerBackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerBackendAddressPoolId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerBackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancerBackendAddressPoolIDInsensitively parses 'input' case-insensitively into a LoadBalancerBackendAddressPoolId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancerBackendAddressPoolIDInsensitively(input string) (*LoadBalancerBackendAddressPoolId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancerBackendAddressPoolId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancerBackendAddressPoolId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancerBackendAddressPoolId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.BackendAddressPoolName, ok = input.Parsed["backendAddressPoolName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backendAddressPoolName", input) - } - - return nil -} - -// ValidateLoadBalancerBackendAddressPoolID checks that 'input' can be parsed as a Load Balancer Backend Address Pool ID -func ValidateLoadBalancerBackendAddressPoolID(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 := ParseLoadBalancerBackendAddressPoolID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancer Backend Address Pool ID -func (id LoadBalancerBackendAddressPoolId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/backendAddressPools/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.BackendAddressPoolName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancer Backend Address Pool ID -func (id LoadBalancerBackendAddressPoolId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticBackendAddressPools", "backendAddressPools", "backendAddressPools"), - resourceids.UserSpecifiedSegment("backendAddressPoolName", "backendAddressPoolValue"), - } -} - -// String returns a human-readable description of this Load Balancer Backend Address Pool ID -func (id LoadBalancerBackendAddressPoolId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Backend Address Pool Name: %q", id.BackendAddressPoolName), - } - return fmt.Sprintf("Load Balancer Backend Address Pool (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go deleted file mode 100644 index d30f52580c2..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancerbackendaddresspool_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &LoadBalancerBackendAddressPoolId{} - -func TestNewLoadBalancerBackendAddressPoolID(t *testing.T) { - id := NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.BackendAddressPoolName != "backendAddressPoolValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackendAddressPoolName'", id.BackendAddressPoolName, "backendAddressPoolValue") - } -} - -func TestFormatLoadBalancerBackendAddressPoolID(t *testing.T) { - actual := NewLoadBalancerBackendAddressPoolID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "backendAddressPoolValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancerBackendAddressPoolID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerBackendAddressPoolId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &LoadBalancerBackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerBackendAddressPoolID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestParseLoadBalancerBackendAddressPoolIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancerBackendAddressPoolId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue", - Expected: &LoadBalancerBackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - BackendAddressPoolName: "backendAddressPoolValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/backendAddressPools/backendAddressPoolValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe", - Expected: &LoadBalancerBackendAddressPoolId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - BackendAddressPoolName: "bAcKeNdAdDrEsSpOoLvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/bAcKeNdAdDrEsSpOoLs/bAcKeNdAdDrEsSpOoLvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancerBackendAddressPoolIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.BackendAddressPoolName != v.Expected.BackendAddressPoolName { - t.Fatalf("Expected %q but got %q for BackendAddressPoolName", v.Expected.BackendAddressPoolName, actual.BackendAddressPoolName) - } - - } -} - -func TestSegmentsForLoadBalancerBackendAddressPoolId(t *testing.T) { - segments := LoadBalancerBackendAddressPoolId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancerBackendAddressPoolId 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/network/2023-06-01/loadbalancers/id_loadbalancingrule.go b/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule.go deleted file mode 100644 index 31e911e38af..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&LoadBalancingRuleId{}) -} - -var _ resourceids.ResourceId = &LoadBalancingRuleId{} - -// LoadBalancingRuleId is a struct representing the Resource ID for a Load Balancing Rule -type LoadBalancingRuleId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - LoadBalancingRuleName string -} - -// NewLoadBalancingRuleID returns a new LoadBalancingRuleId struct -func NewLoadBalancingRuleID(subscriptionId string, resourceGroupName string, loadBalancerName string, loadBalancingRuleName string) LoadBalancingRuleId { - return LoadBalancingRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - LoadBalancingRuleName: loadBalancingRuleName, - } -} - -// ParseLoadBalancingRuleID parses 'input' into a LoadBalancingRuleId -func ParseLoadBalancingRuleID(input string) (*LoadBalancingRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancingRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancingRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLoadBalancingRuleIDInsensitively parses 'input' case-insensitively into a LoadBalancingRuleId -// note: this method should only be used for API response data and not user input -func ParseLoadBalancingRuleIDInsensitively(input string) (*LoadBalancingRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&LoadBalancingRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LoadBalancingRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LoadBalancingRuleId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.LoadBalancingRuleName, ok = input.Parsed["loadBalancingRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancingRuleName", input) - } - - return nil -} - -// ValidateLoadBalancingRuleID checks that 'input' can be parsed as a Load Balancing Rule ID -func ValidateLoadBalancingRuleID(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 := ParseLoadBalancingRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Load Balancing Rule ID -func (id LoadBalancingRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/loadBalancingRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.LoadBalancingRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Load Balancing Rule ID -func (id LoadBalancingRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticLoadBalancingRules", "loadBalancingRules", "loadBalancingRules"), - resourceids.UserSpecifiedSegment("loadBalancingRuleName", "loadBalancingRuleValue"), - } -} - -// String returns a human-readable description of this Load Balancing Rule ID -func (id LoadBalancingRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Load Balancing Rule Name: %q", id.LoadBalancingRuleName), - } - return fmt.Sprintf("Load Balancing Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule_test.go deleted file mode 100644 index 0cedccca2be..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_loadbalancingrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &LoadBalancingRuleId{} - -func TestNewLoadBalancingRuleID(t *testing.T) { - id := NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.LoadBalancingRuleName != "loadBalancingRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancingRuleName'", id.LoadBalancingRuleName, "loadBalancingRuleValue") - } -} - -func TestFormatLoadBalancingRuleID(t *testing.T) { - actual := NewLoadBalancingRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "loadBalancingRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLoadBalancingRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancingRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue", - Expected: &LoadBalancingRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - LoadBalancingRuleName: "loadBalancingRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancingRuleID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.LoadBalancingRuleName != v.Expected.LoadBalancingRuleName { - t.Fatalf("Expected %q but got %q for LoadBalancingRuleName", v.Expected.LoadBalancingRuleName, actual.LoadBalancingRuleName) - } - - } -} - -func TestParseLoadBalancingRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LoadBalancingRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/lOaDbAlAnCiNgRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue", - Expected: &LoadBalancingRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - LoadBalancingRuleName: "loadBalancingRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/loadBalancingRules/loadBalancingRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/lOaDbAlAnCiNgRuLeS/lOaDbAlAnCiNgRuLeVaLuE", - Expected: &LoadBalancingRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - LoadBalancingRuleName: "lOaDbAlAnCiNgRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/lOaDbAlAnCiNgRuLeS/lOaDbAlAnCiNgRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLoadBalancingRuleIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.LoadBalancingRuleName != v.Expected.LoadBalancingRuleName { - t.Fatalf("Expected %q but got %q for LoadBalancingRuleName", v.Expected.LoadBalancingRuleName, actual.LoadBalancingRuleName) - } - - } -} - -func TestSegmentsForLoadBalancingRuleId(t *testing.T) { - segments := LoadBalancingRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LoadBalancingRuleId 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/network/2023-06-01/loadbalancers/id_location.go b/resource-manager/network/2023-06-01/loadbalancers/id_location.go deleted file mode 100644 index 4a38c5ea3e7..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package loadbalancers - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/loadbalancers/id_location_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_location_test.go deleted file mode 100644 index ea456af0f8a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package loadbalancers - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/loadbalancers/id_outboundrule.go b/resource-manager/network/2023-06-01/loadbalancers/id_outboundrule.go deleted file mode 100644 index 89837637300..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_outboundrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&OutboundRuleId{}) -} - -var _ resourceids.ResourceId = &OutboundRuleId{} - -// OutboundRuleId is a struct representing the Resource ID for a Outbound Rule -type OutboundRuleId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - OutboundRuleName string -} - -// NewOutboundRuleID returns a new OutboundRuleId struct -func NewOutboundRuleID(subscriptionId string, resourceGroupName string, loadBalancerName string, outboundRuleName string) OutboundRuleId { - return OutboundRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - OutboundRuleName: outboundRuleName, - } -} - -// ParseOutboundRuleID parses 'input' into a OutboundRuleId -func ParseOutboundRuleID(input string) (*OutboundRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&OutboundRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OutboundRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOutboundRuleIDInsensitively parses 'input' case-insensitively into a OutboundRuleId -// note: this method should only be used for API response data and not user input -func ParseOutboundRuleIDInsensitively(input string) (*OutboundRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&OutboundRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OutboundRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OutboundRuleId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.OutboundRuleName, ok = input.Parsed["outboundRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "outboundRuleName", input) - } - - return nil -} - -// ValidateOutboundRuleID checks that 'input' can be parsed as a Outbound Rule ID -func ValidateOutboundRuleID(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 := ParseOutboundRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Outbound Rule ID -func (id OutboundRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/outboundRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.OutboundRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Outbound Rule ID -func (id OutboundRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticOutboundRules", "outboundRules", "outboundRules"), - resourceids.UserSpecifiedSegment("outboundRuleName", "outboundRuleValue"), - } -} - -// String returns a human-readable description of this Outbound Rule ID -func (id OutboundRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Outbound Rule Name: %q", id.OutboundRuleName), - } - return fmt.Sprintf("Outbound Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_outboundrule_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_outboundrule_test.go deleted file mode 100644 index 9f2d3f6d83a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_outboundrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &OutboundRuleId{} - -func TestNewOutboundRuleID(t *testing.T) { - id := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.OutboundRuleName != "outboundRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'OutboundRuleName'", id.OutboundRuleName, "outboundRuleValue") - } -} - -func TestFormatOutboundRuleID(t *testing.T) { - actual := NewOutboundRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "outboundRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOutboundRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OutboundRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue", - Expected: &OutboundRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - OutboundRuleName: "outboundRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOutboundRuleID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.OutboundRuleName != v.Expected.OutboundRuleName { - t.Fatalf("Expected %q but got %q for OutboundRuleName", v.Expected.OutboundRuleName, actual.OutboundRuleName) - } - - } -} - -func TestParseOutboundRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OutboundRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/oUtBoUnDrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue", - Expected: &OutboundRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - OutboundRuleName: "outboundRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/outboundRules/outboundRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/oUtBoUnDrUlEs/oUtBoUnDrUlEvAlUe", - Expected: &OutboundRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - OutboundRuleName: "oUtBoUnDrUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/oUtBoUnDrUlEs/oUtBoUnDrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOutboundRuleIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.OutboundRuleName != v.Expected.OutboundRuleName { - t.Fatalf("Expected %q but got %q for OutboundRuleName", v.Expected.OutboundRuleName, actual.OutboundRuleName) - } - - } -} - -func TestSegmentsForOutboundRuleId(t *testing.T) { - segments := OutboundRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OutboundRuleId 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/network/2023-06-01/loadbalancers/id_probe.go b/resource-manager/network/2023-06-01/loadbalancers/id_probe.go deleted file mode 100644 index 46ab09a65c9..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_probe.go +++ /dev/null @@ -1,139 +0,0 @@ -package loadbalancers - -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(&ProbeId{}) -} - -var _ resourceids.ResourceId = &ProbeId{} - -// ProbeId is a struct representing the Resource ID for a Probe -type ProbeId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string - ProbeName string -} - -// NewProbeID returns a new ProbeId struct -func NewProbeID(subscriptionId string, resourceGroupName string, loadBalancerName string, probeName string) ProbeId { - return ProbeId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - ProbeName: probeName, - } -} - -// ParseProbeID parses 'input' into a ProbeId -func ParseProbeID(input string) (*ProbeId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProbeId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProbeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProbeIDInsensitively parses 'input' case-insensitively into a ProbeId -// note: this method should only be used for API response data and not user input -func ParseProbeIDInsensitively(input string) (*ProbeId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProbeId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProbeId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProbeId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - if id.ProbeName, ok = input.Parsed["probeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "probeName", input) - } - - return nil -} - -// ValidateProbeID checks that 'input' can be parsed as a Probe ID -func ValidateProbeID(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 := ParseProbeID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Probe ID -func (id ProbeId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s/probes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName, id.ProbeName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Probe ID -func (id ProbeId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - resourceids.StaticSegment("staticProbes", "probes", "probes"), - resourceids.UserSpecifiedSegment("probeName", "probeValue"), - } -} - -// String returns a human-readable description of this Probe ID -func (id ProbeId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - fmt.Sprintf("Probe Name: %q", id.ProbeName), - } - return fmt.Sprintf("Probe (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_probe_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_probe_test.go deleted file mode 100644 index 7e711899c23..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_probe_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package loadbalancers - -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 = &ProbeId{} - -func TestNewProbeID(t *testing.T) { - id := NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } - - if id.ProbeName != "probeValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProbeName'", id.ProbeName, "probeValue") - } -} - -func TestFormatProbeID(t *testing.T) { - actual := NewProbeID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue", "probeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProbeID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProbeId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue", - Expected: &ProbeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - ProbeName: "probeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProbeID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.ProbeName != v.Expected.ProbeName { - t.Fatalf("Expected %q but got %q for ProbeName", v.Expected.ProbeName, actual.ProbeName) - } - - } -} - -func TestParseProbeIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProbeId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/pRoBeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue", - Expected: &ProbeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - ProbeName: "probeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/probes/probeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/pRoBeS/pRoBeVaLuE", - Expected: &ProbeId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - ProbeName: "pRoBeVaLuE", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/pRoBeS/pRoBeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProbeIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - if actual.ProbeName != v.Expected.ProbeName { - t.Fatalf("Expected %q but got %q for ProbeName", v.Expected.ProbeName, actual.ProbeName) - } - - } -} - -func TestSegmentsForProbeId(t *testing.T) { - segments := ProbeId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProbeId 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/network/2023-06-01/loadbalancers/id_providerloadbalancer.go b/resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer.go deleted file mode 100644 index 88ab98c83ad..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer.go +++ /dev/null @@ -1,130 +0,0 @@ -package loadbalancers - -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(&ProviderLoadBalancerId{}) -} - -var _ resourceids.ResourceId = &ProviderLoadBalancerId{} - -// ProviderLoadBalancerId is a struct representing the Resource ID for a Provider Load Balancer -type ProviderLoadBalancerId struct { - SubscriptionId string - ResourceGroupName string - LoadBalancerName string -} - -// NewProviderLoadBalancerID returns a new ProviderLoadBalancerId struct -func NewProviderLoadBalancerID(subscriptionId string, resourceGroupName string, loadBalancerName string) ProviderLoadBalancerId { - return ProviderLoadBalancerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LoadBalancerName: loadBalancerName, - } -} - -// ParseProviderLoadBalancerID parses 'input' into a ProviderLoadBalancerId -func ParseProviderLoadBalancerID(input string) (*ProviderLoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLoadBalancerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLoadBalancerIDInsensitively parses 'input' case-insensitively into a ProviderLoadBalancerId -// note: this method should only be used for API response data and not user input -func ParseProviderLoadBalancerIDInsensitively(input string) (*ProviderLoadBalancerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLoadBalancerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLoadBalancerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLoadBalancerId) 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.LoadBalancerName, ok = input.Parsed["loadBalancerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "loadBalancerName", input) - } - - return nil -} - -// ValidateProviderLoadBalancerID checks that 'input' can be parsed as a Provider Load Balancer ID -func ValidateProviderLoadBalancerID(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 := ParseProviderLoadBalancerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Load Balancer ID -func (id ProviderLoadBalancerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/loadBalancers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LoadBalancerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Load Balancer ID -func (id ProviderLoadBalancerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLoadBalancers", "loadBalancers", "loadBalancers"), - resourceids.UserSpecifiedSegment("loadBalancerName", "loadBalancerValue"), - } -} - -// String returns a human-readable description of this Provider Load Balancer ID -func (id ProviderLoadBalancerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Load Balancer Name: %q", id.LoadBalancerName), - } - return fmt.Sprintf("Provider Load Balancer (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer_test.go b/resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer_test.go deleted file mode 100644 index e721a740f82..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/id_providerloadbalancer_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package loadbalancers - -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 = &ProviderLoadBalancerId{} - -func TestNewProviderLoadBalancerID(t *testing.T) { - id := NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue") - - 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.LoadBalancerName != "loadBalancerValue" { - t.Fatalf("Expected %q but got %q for Segment 'LoadBalancerName'", id.LoadBalancerName, "loadBalancerValue") - } -} - -func TestFormatProviderLoadBalancerID(t *testing.T) { - actual := NewProviderLoadBalancerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "loadBalancerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLoadBalancerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLoadBalancerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLoadBalancerID(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestParseProviderLoadBalancerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLoadBalancerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LoadBalancerName: "loadBalancerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/loadBalancers/loadBalancerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe", - Expected: &ProviderLoadBalancerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LoadBalancerName: "lOaDbAlAnCeRvAlUe", - }, - }, - { - // 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.nEtWoRk/lOaDbAlAnCeRs/lOaDbAlAnCeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLoadBalancerIDInsensitively(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.LoadBalancerName != v.Expected.LoadBalancerName { - t.Fatalf("Expected %q but got %q for LoadBalancerName", v.Expected.LoadBalancerName, actual.LoadBalancerName) - } - - } -} - -func TestSegmentsForProviderLoadBalancerId(t *testing.T) { - segments := ProviderLoadBalancerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLoadBalancerId 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/network/2023-06-01/loadbalancers/method_createorupdate.go b/resource-manager/network/2023-06-01/loadbalancers/method_createorupdate.go deleted file mode 100644 index 891038c3395..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 *LoadBalancer -} - -// CreateOrUpdate ... -func (c LoadBalancersClient) CreateOrUpdate(ctx context.Context, id ProviderLoadBalancerId, input LoadBalancer) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) CreateOrUpdateThenPoll(ctx context.Context, id ProviderLoadBalancerId, input LoadBalancer) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/loadbalancers/method_delete.go b/resource-manager/network/2023-06-01/loadbalancers/method_delete.go deleted file mode 100644 index bf7acc08d90..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 LoadBalancersClient) Delete(ctx context.Context, id ProviderLoadBalancerId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LoadBalancersClient) DeleteThenPoll(ctx context.Context, id ProviderLoadBalancerId) 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/network/2023-06-01/loadbalancers/method_get.go b/resource-manager/network/2023-06-01/loadbalancers/method_get.go deleted file mode 100644 index a183aa5c7ae..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package loadbalancers - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *LoadBalancer -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c LoadBalancersClient) Get(ctx context.Context, id ProviderLoadBalancerId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 LoadBalancer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulescreateorupdate.go b/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulescreateorupdate.go deleted file mode 100644 index e052f632164..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 InboundNatRulesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *InboundNatRule -} - -// InboundNatRulesCreateOrUpdate ... -func (c LoadBalancersClient) InboundNatRulesCreateOrUpdate(ctx context.Context, id InboundNatRuleId, input InboundNatRule) (result InboundNatRulesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// InboundNatRulesCreateOrUpdateThenPoll performs InboundNatRulesCreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) InboundNatRulesCreateOrUpdateThenPoll(ctx context.Context, id InboundNatRuleId, input InboundNatRule) error { - result, err := c.InboundNatRulesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing InboundNatRulesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InboundNatRulesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesdelete.go b/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesdelete.go deleted file mode 100644 index 2d19b62f757..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 InboundNatRulesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// InboundNatRulesDelete ... -func (c LoadBalancersClient) InboundNatRulesDelete(ctx context.Context, id InboundNatRuleId) (result InboundNatRulesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// InboundNatRulesDeleteThenPoll performs InboundNatRulesDelete then polls until it's completed -func (c LoadBalancersClient) InboundNatRulesDeleteThenPoll(ctx context.Context, id InboundNatRuleId) error { - result, err := c.InboundNatRulesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing InboundNatRulesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InboundNatRulesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesget.go b/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesget.go deleted file mode 100644 index 06666b1d382..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatrulesget.go +++ /dev/null @@ -1,83 +0,0 @@ -package loadbalancers - -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 InboundNatRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *InboundNatRule -} - -type InboundNatRulesGetOperationOptions struct { - Expand *string -} - -func DefaultInboundNatRulesGetOperationOptions() InboundNatRulesGetOperationOptions { - return InboundNatRulesGetOperationOptions{} -} - -func (o InboundNatRulesGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o InboundNatRulesGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o InboundNatRulesGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// InboundNatRulesGet ... -func (c LoadBalancersClient) InboundNatRulesGet(ctx context.Context, id InboundNatRuleId, options InboundNatRulesGetOperationOptions) (result InboundNatRulesGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 InboundNatRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatruleslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatruleslist.go deleted file mode 100644 index e4b3847d83e..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_inboundnatruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 InboundNatRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]InboundNatRule -} - -type InboundNatRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []InboundNatRule -} - -// InboundNatRulesList ... -func (c LoadBalancersClient) InboundNatRulesList(ctx context.Context, id ProviderLoadBalancerId) (result InboundNatRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/inboundNatRules", 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 *[]InboundNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// InboundNatRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) InboundNatRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (InboundNatRulesListCompleteResult, error) { - return c.InboundNatRulesListCompleteMatchingPredicate(ctx, id, InboundNatRuleOperationPredicate{}) -} - -// InboundNatRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) InboundNatRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate InboundNatRuleOperationPredicate) (result InboundNatRulesListCompleteResult, err error) { - items := make([]InboundNatRule, 0) - - resp, err := c.InboundNatRulesList(ctx, id) - if err != nil { - 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 = InboundNatRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_list.go b/resource-manager/network/2023-06-01/loadbalancers/method_list.go deleted file mode 100644 index fb130044cb5..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package loadbalancers - -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 *[]LoadBalancer -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancer -} - -// List ... -func (c LoadBalancersClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/loadBalancers", 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 *[]LoadBalancer `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 LoadBalancersClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, LoadBalancerOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LoadBalancerOperationPredicate) (result ListCompleteResult, err error) { - items := make([]LoadBalancer, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/loadbalancers/method_listall.go b/resource-manager/network/2023-06-01/loadbalancers/method_listall.go deleted file mode 100644 index 674e5b649f7..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package loadbalancers - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancer -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancer -} - -// ListAll ... -func (c LoadBalancersClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/loadBalancers", 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 *[]LoadBalancer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c LoadBalancersClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, LoadBalancerOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate LoadBalancerOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]LoadBalancer, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_listinboundnatruleportmappings.go b/resource-manager/network/2023-06-01/loadbalancers/method_listinboundnatruleportmappings.go deleted file mode 100644 index 967f42debed..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_listinboundnatruleportmappings.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 ListInboundNatRulePortMappingsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BackendAddressInboundNatRulePortMappings -} - -// ListInboundNatRulePortMappings ... -func (c LoadBalancersClient) ListInboundNatRulePortMappings(ctx context.Context, id BackendAddressPoolId, input QueryInboundNatRulePortMappingRequest) (result ListInboundNatRulePortMappingsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryInboundNatRulePortMapping", 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 -} - -// ListInboundNatRulePortMappingsThenPoll performs ListInboundNatRulePortMappings then polls until it's completed -func (c LoadBalancersClient) ListInboundNatRulePortMappingsThenPoll(ctx context.Context, id BackendAddressPoolId, input QueryInboundNatRulePortMappingRequest) error { - result, err := c.ListInboundNatRulePortMappings(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ListInboundNatRulePortMappings: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ListInboundNatRulePortMappings: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go deleted file mode 100644 index 3f34a765cbf..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsCreateOrUpdate ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsCreateOrUpdate(ctx context.Context, id LoadBalancerBackendAddressPoolId, input BackendAddressPool) (result LoadBalancerBackendAddressPoolsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll performs LoadBalancerBackendAddressPoolsCreateOrUpdate then polls until it's completed -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsCreateOrUpdateThenPoll(ctx context.Context, id LoadBalancerBackendAddressPoolId, input BackendAddressPool) error { - result, err := c.LoadBalancerBackendAddressPoolsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing LoadBalancerBackendAddressPoolsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after LoadBalancerBackendAddressPoolsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go deleted file mode 100644 index 748b8b97657..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// LoadBalancerBackendAddressPoolsDelete ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsDelete(ctx context.Context, id LoadBalancerBackendAddressPoolId) (result LoadBalancerBackendAddressPoolsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// LoadBalancerBackendAddressPoolsDeleteThenPoll performs LoadBalancerBackendAddressPoolsDelete then polls until it's completed -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsDeleteThenPoll(ctx context.Context, id LoadBalancerBackendAddressPoolId) error { - result, err := c.LoadBalancerBackendAddressPoolsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing LoadBalancerBackendAddressPoolsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after LoadBalancerBackendAddressPoolsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go deleted file mode 100644 index 96451e22451..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsGet ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsGet(ctx context.Context, id LoadBalancerBackendAddressPoolId) (result LoadBalancerBackendAddressPoolsGetOperationResponse, 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 BackendAddressPool - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go deleted file mode 100644 index 7f6204b9606..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerbackendaddresspoolslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerBackendAddressPoolsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BackendAddressPool -} - -type LoadBalancerBackendAddressPoolsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BackendAddressPool -} - -// LoadBalancerBackendAddressPoolsList ... -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerBackendAddressPoolsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/backendAddressPools", 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 *[]BackendAddressPool `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerBackendAddressPoolsListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerBackendAddressPoolsListCompleteResult, error) { - return c.LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx, id, BackendAddressPoolOperationPredicate{}) -} - -// LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerBackendAddressPoolsListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate BackendAddressPoolOperationPredicate) (result LoadBalancerBackendAddressPoolsListCompleteResult, err error) { - items := make([]BackendAddressPool, 0) - - resp, err := c.LoadBalancerBackendAddressPoolsList(ctx, id) - if err != nil { - 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 = LoadBalancerBackendAddressPoolsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go deleted file mode 100644 index eeb2cc8b0ed..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerFrontendIPConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfigurationsGet ... -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsGet(ctx context.Context, id FrontendIPConfigurationId) (result LoadBalancerFrontendIPConfigurationsGetOperationResponse, 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 FrontendIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go deleted file mode 100644 index afce18597ba..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerfrontendipconfigurationslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerFrontendIPConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]FrontendIPConfiguration -} - -type LoadBalancerFrontendIPConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []FrontendIPConfiguration -} - -// LoadBalancerFrontendIPConfigurationsList ... -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerFrontendIPConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/frontendIPConfigurations", 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 *[]FrontendIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerFrontendIPConfigurationsListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerFrontendIPConfigurationsListCompleteResult, error) { - return c.LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx, id, FrontendIPConfigurationOperationPredicate{}) -} - -// LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerFrontendIPConfigurationsListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate FrontendIPConfigurationOperationPredicate) (result LoadBalancerFrontendIPConfigurationsListCompleteResult, err error) { - items := make([]FrontendIPConfiguration, 0) - - resp, err := c.LoadBalancerFrontendIPConfigurationsList(ctx, id) - if err != nil { - 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 = LoadBalancerFrontendIPConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go deleted file mode 100644 index 265ec20a693..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerLoadBalancingRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *LoadBalancingRule -} - -// LoadBalancerLoadBalancingRulesGet ... -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesGet(ctx context.Context, id LoadBalancingRuleId) (result LoadBalancerLoadBalancingRulesGetOperationResponse, 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 LoadBalancingRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go deleted file mode 100644 index 0bc29256da8..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerloadbalancingruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerLoadBalancingRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancingRule -} - -type LoadBalancerLoadBalancingRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancingRule -} - -// LoadBalancerLoadBalancingRulesList ... -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerLoadBalancingRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/loadBalancingRules", 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 *[]LoadBalancingRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerLoadBalancingRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerLoadBalancingRulesListCompleteResult, error) { - return c.LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx, id, LoadBalancingRuleOperationPredicate{}) -} - -// LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerLoadBalancingRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate LoadBalancingRuleOperationPredicate) (result LoadBalancerLoadBalancingRulesListCompleteResult, err error) { - items := make([]LoadBalancingRule, 0) - - resp, err := c.LoadBalancerLoadBalancingRulesList(ctx, id) - if err != nil { - 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 = LoadBalancerLoadBalancingRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go deleted file mode 100644 index 90c70aa0330..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancernetworkinterfaceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerNetworkInterfacesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type LoadBalancerNetworkInterfacesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// LoadBalancerNetworkInterfacesList ... -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerNetworkInterfacesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerNetworkInterfacesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerNetworkInterfacesListCompleteResult, error) { - return c.LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// LoadBalancerNetworkInterfacesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerNetworkInterfacesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate NetworkInterfaceOperationPredicate) (result LoadBalancerNetworkInterfacesListCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.LoadBalancerNetworkInterfacesList(ctx, id) - if err != nil { - 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 = LoadBalancerNetworkInterfacesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundrulesget.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundrulesget.go deleted file mode 100644 index 5e221d46329..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerOutboundRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *OutboundRule -} - -// LoadBalancerOutboundRulesGet ... -func (c LoadBalancersClient) LoadBalancerOutboundRulesGet(ctx context.Context, id OutboundRuleId) (result LoadBalancerOutboundRulesGetOperationResponse, 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 OutboundRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundruleslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundruleslist.go deleted file mode 100644 index b0e91ba7b50..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalanceroutboundruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerOutboundRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]OutboundRule -} - -type LoadBalancerOutboundRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []OutboundRule -} - -// LoadBalancerOutboundRulesList ... -func (c LoadBalancersClient) LoadBalancerOutboundRulesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerOutboundRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/outboundRules", 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 *[]OutboundRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerOutboundRulesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerOutboundRulesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerOutboundRulesListCompleteResult, error) { - return c.LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx, id, OutboundRuleOperationPredicate{}) -} - -// LoadBalancerOutboundRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerOutboundRulesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate OutboundRuleOperationPredicate) (result LoadBalancerOutboundRulesListCompleteResult, err error) { - items := make([]OutboundRule, 0) - - resp, err := c.LoadBalancerOutboundRulesList(ctx, id) - if err != nil { - 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 = LoadBalancerOutboundRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobesget.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobesget.go deleted file mode 100644 index 2901255109e..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package loadbalancers - -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 LoadBalancerProbesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Probe -} - -// LoadBalancerProbesGet ... -func (c LoadBalancersClient) LoadBalancerProbesGet(ctx context.Context, id ProbeId) (result LoadBalancerProbesGetOperationResponse, 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 Probe - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobeslist.go b/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobeslist.go deleted file mode 100644 index c0852a82dad..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_loadbalancerprobeslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package loadbalancers - -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 LoadBalancerProbesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Probe -} - -type LoadBalancerProbesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Probe -} - -// LoadBalancerProbesList ... -func (c LoadBalancersClient) LoadBalancerProbesList(ctx context.Context, id ProviderLoadBalancerId) (result LoadBalancerProbesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/probes", 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 *[]Probe `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// LoadBalancerProbesListComplete retrieves all the results into a single object -func (c LoadBalancersClient) LoadBalancerProbesListComplete(ctx context.Context, id ProviderLoadBalancerId) (LoadBalancerProbesListCompleteResult, error) { - return c.LoadBalancerProbesListCompleteMatchingPredicate(ctx, id, ProbeOperationPredicate{}) -} - -// LoadBalancerProbesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LoadBalancersClient) LoadBalancerProbesListCompleteMatchingPredicate(ctx context.Context, id ProviderLoadBalancerId, predicate ProbeOperationPredicate) (result LoadBalancerProbesListCompleteResult, err error) { - items := make([]Probe, 0) - - resp, err := c.LoadBalancerProbesList(ctx, id) - if err != nil { - 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 = LoadBalancerProbesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_migratetoipbased.go b/resource-manager/network/2023-06-01/loadbalancers/method_migratetoipbased.go deleted file mode 100644 index 249adebb4a8..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_migratetoipbased.go +++ /dev/null @@ -1,59 +0,0 @@ -package loadbalancers - -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 MigrateToIPBasedOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MigratedPools -} - -// MigrateToIPBased ... -func (c LoadBalancersClient) MigrateToIPBased(ctx context.Context, id LoadBalancerId, input MigrateLoadBalancerToIPBasedRequest) (result MigrateToIPBasedOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/migrateToIpBased", 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 MigratedPools - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_swappublicipaddresses.go b/resource-manager/network/2023-06-01/loadbalancers/method_swappublicipaddresses.go deleted file mode 100644 index ea34d09163d..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_swappublicipaddresses.go +++ /dev/null @@ -1,74 +0,0 @@ -package loadbalancers - -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 SwapPublicIPAddressesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SwapPublicIPAddresses ... -func (c LoadBalancersClient) SwapPublicIPAddresses(ctx context.Context, id LocationId, input LoadBalancerVipSwapRequest) (result SwapPublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/setLoadBalancerFrontendPublicIpAddresses", 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 -} - -// SwapPublicIPAddressesThenPoll performs SwapPublicIPAddresses then polls until it's completed -func (c LoadBalancersClient) SwapPublicIPAddressesThenPoll(ctx context.Context, id LocationId, input LoadBalancerVipSwapRequest) error { - result, err := c.SwapPublicIPAddresses(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SwapPublicIPAddresses: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SwapPublicIPAddresses: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/method_updatetags.go b/resource-manager/network/2023-06-01/loadbalancers/method_updatetags.go deleted file mode 100644 index dd8a4561326..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package loadbalancers - -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 *LoadBalancer -} - -// UpdateTags ... -func (c LoadBalancersClient) UpdateTags(ctx context.Context, id ProviderLoadBalancerId, 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 LoadBalancer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddress.go deleted file mode 100644 index ba8ecb73101..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index ae525920084..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 339eab474ad..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 85af1e99371..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index ba22dcca046..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygroup.go deleted file mode 100644 index a39478d2c00..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 6ab25279d91..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go b/resource-manager/network/2023-06-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go deleted file mode 100644 index 4e124f8b471..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_backendaddressinboundnatruleportmappings.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressInboundNatRulePortMappings struct { - InboundNatRulePortMappings *[]InboundNatRulePortMapping `json:"inboundNatRulePortMappings,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspool.go b/resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspool.go deleted file mode 100644 index f21aa313263..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 6ce42b19e79..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index bdb38484c9a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_ddossettings.go b/resource-manager/network/2023-06-01/loadbalancers/model_ddossettings.go deleted file mode 100644 index 49f08256215..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_delegation.go b/resource-manager/network/2023-06-01/loadbalancers/model_delegation.go deleted file mode 100644 index ca1a156ae30..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_flowlog.go b/resource-manager/network/2023-06-01/loadbalancers/model_flowlog.go deleted file mode 100644 index 90210c29260..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/loadbalancers/model_flowlogformatparameters.go deleted file mode 100644 index fa0c6c067e8..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_flowlogpropertiesformat.go deleted file mode 100644 index 4c800ad5f68..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfiguration.go deleted file mode 100644 index aee3ea162e5..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package loadbalancers - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 3ec56d01ffe..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 0b58f57fe92..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpool.go b/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpool.go deleted file mode 100644 index d89dc6f5777..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpool.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpoolpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpoolpropertiesformat.go deleted file mode 100644 index df78a1ed77a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatpoolpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPoolPropertiesFormat struct { - BackendPort int64 `json:"backendPort"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPortRangeEnd int64 `json:"frontendPortRangeEnd"` - FrontendPortRangeStart int64 `json:"frontendPortRangeStart"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrule.go b/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrule.go deleted file mode 100644 index adb4dbeea97..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatruleportmapping.go b/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatruleportmapping.go deleted file mode 100644 index f2e3789517f..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatruleportmapping.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 3e2eb61ad03..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_ipconfiguration.go deleted file mode 100644 index 8d6200049ae..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofile.go deleted file mode 100644 index 96c0f6e1f83..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 42790e1043c..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 4d288c5dd29..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_iptag.go b/resource-manager/network/2023-06-01/loadbalancers/model_iptag.go deleted file mode 100644 index bf32e63b59f..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// 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/network/2023-06-01/loadbalancers/model_loadbalancer.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancer.go deleted file mode 100644 index 76572914bb6..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancer.go +++ /dev/null @@ -1,20 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancer struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - Sku *LoadBalancerSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddress.go deleted file mode 100644 index c85572e3101..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 92e1899840b..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerpropertiesformat.go deleted file mode 100644 index 7ffa00517b8..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancerpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerPropertiesFormat struct { - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - Probes *[]Probe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancersku.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancersku.go deleted file mode 100644 index 1575eae78c5..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerSku struct { - Name *LoadBalancerSkuName `json:"name,omitempty"` - Tier *LoadBalancerSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequest.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequest.go deleted file mode 100644 index 8bea43b7a0d..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerVipSwapRequest struct { - FrontendIPConfigurations *[]LoadBalancerVipSwapRequestFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go deleted file mode 100644 index fd4e68458a9..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerVipSwapRequestFrontendIPConfiguration struct { - Id *string `json:"id,omitempty"` - Properties *LoadBalancerVipSwapRequestFrontendIPConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go deleted file mode 100644 index 56e8c5d7e4e..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancervipswaprequestfrontendipconfigurationproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerVipSwapRequestFrontendIPConfigurationProperties struct { - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrule.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrule.go deleted file mode 100644 index ff651417937..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrulepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrulepropertiesformat.go deleted file mode 100644 index 4b1908352dd..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_loadbalancingrulepropertiesformat.go +++ /dev/null @@ -1,20 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort int64 `json:"frontendPort"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LoadDistribution *LoadDistribution `json:"loadDistribution,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_migratedpools.go b/resource-manager/network/2023-06-01/loadbalancers/model_migratedpools.go deleted file mode 100644 index 043a11e0729..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_migratedpools.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MigratedPools struct { - MigratedPools *[]string `json:"migratedPools,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go b/resource-manager/network/2023-06-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go deleted file mode 100644 index 7b22e45af7d..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_migrateloadbalancertoipbasedrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MigrateLoadBalancerToIPBasedRequest struct { - Pools *[]string `json:"pools,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_natgateway.go b/resource-manager/network/2023-06-01/loadbalancers/model_natgateway.go deleted file mode 100644 index 0eb10d867d8..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package loadbalancers - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_natgatewaypropertiesformat.go deleted file mode 100644 index 4903d67cdc0..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_natgatewaysku.go b/resource-manager/network/2023-06-01/loadbalancers/model_natgatewaysku.go deleted file mode 100644 index d503f4fbbfb..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_natruleportmapping.go b/resource-manager/network/2023-06-01/loadbalancers/model_natruleportmapping.go deleted file mode 100644 index d0afcac5584..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterface.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterface.go deleted file mode 100644 index 3a7fc490368..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacednssettings.go deleted file mode 100644 index 91dbc787d0a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 60978bfaf56..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 6dcb491a3d7..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index d0e35f43bfb..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 2923295fe73..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 86c1f45766f..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 60f5f46a243..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygroup.go deleted file mode 100644 index e4baa9839d3..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index a3c43420ed8..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_outboundrule.go b/resource-manager/network/2023-06-01/loadbalancers/model_outboundrule.go deleted file mode 100644 index 1dfd6977a6a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_outboundrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OutboundRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_outboundrulepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_outboundrulepropertiesformat.go deleted file mode 100644 index 3c7b13886c0..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_outboundrulepropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRulePropertiesFormat struct { - AllocatedOutboundPorts *int64 `json:"allocatedOutboundPorts,omitempty"` - BackendAddressPool SubResource `json:"backendAddressPool"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfigurations []SubResource `json:"frontendIPConfigurations"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol LoadBalancerOutboundRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpoint.go b/resource-manager/network/2023-06-01/loadbalancers/model_privateendpoint.go deleted file mode 100644 index 1b7d03d287c..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnection.go deleted file mode 100644 index 4324f758e00..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/loadbalancers/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnectionproperties.go deleted file mode 100644 index 0db98da1f3a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfiguration.go deleted file mode 100644 index 5bae49165b4..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 7b4d544edd6..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointproperties.go deleted file mode 100644 index b949c31f69e..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkservice.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkservice.go deleted file mode 100644 index 90ac8b3e5ca..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnection.go deleted file mode 100644 index 7657685128f..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 047e30a886a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index a4eb6e38f9b..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index fef899c9ed5..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 0209c2ffc37..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceproperties.go deleted file mode 100644 index f3e3d05de18..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_probe.go b/resource-manager/network/2023-06-01/loadbalancers/model_probe.go deleted file mode 100644 index 07c805bf4b6..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_probe.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Probe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_probepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_probepropertiesformat.go deleted file mode 100644 index ddc84044699..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_probepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProbePropertiesFormat struct { - IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - NumberOfProbes *int64 `json:"numberOfProbes,omitempty"` - Port int64 `json:"port"` - ProbeThreshold *int64 `json:"probeThreshold,omitempty"` - Protocol ProbeProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestPath *string `json:"requestPath,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddress.go b/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddress.go deleted file mode 100644 index bdc0de0a218..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package loadbalancers - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddressdnssettings.go deleted file mode 100644 index 270d14db8a5..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 5a73a6d016d..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresssku.go deleted file mode 100644 index b15c3f179cf..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go b/resource-manager/network/2023-06-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go deleted file mode 100644 index 537750e7e89..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_queryinboundnatruleportmappingrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryInboundNatRulePortMappingRequest struct { - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *SubResource `json:"ipConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlink.go deleted file mode 100644 index 264f22dde08..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlinkformat.go deleted file mode 100644 index 4b34d1eca84..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_resourceset.go b/resource-manager/network/2023-06-01/loadbalancers/model_resourceset.go deleted file mode 100644 index 6d37b1b6861..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/loadbalancers/model_retentionpolicyparameters.go deleted file mode 100644 index 36d6b05e540..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_route.go b/resource-manager/network/2023-06-01/loadbalancers/model_route.go deleted file mode 100644 index 60ee56ca15b..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_routepropertiesformat.go deleted file mode 100644 index dad41f27203..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_routetable.go b/resource-manager/network/2023-06-01/loadbalancers/model_routetable.go deleted file mode 100644 index e6d4f4faa3d..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_routetablepropertiesformat.go deleted file mode 100644 index 1169823e36a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_securityrule.go b/resource-manager/network/2023-06-01/loadbalancers/model_securityrule.go deleted file mode 100644 index 1bd37068862..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_securityrulepropertiesformat.go deleted file mode 100644 index 000a9d8a16f..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlink.go deleted file mode 100644 index 880f8a061c0..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 5984df7dfe6..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 18a1fb457e6..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicy.go deleted file mode 100644 index 00941b4063a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinition.go deleted file mode 100644 index b1f2f8e3300..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 0f54d85448c..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 74afcc602fc..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5610d7f722b..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_subnet.go b/resource-manager/network/2023-06-01/loadbalancers/model_subnet.go deleted file mode 100644 index 802fd17a35b..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_subnetpropertiesformat.go deleted file mode 100644 index 3745628cad5..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_subresource.go b/resource-manager/network/2023-06-01/loadbalancers/model_subresource.go deleted file mode 100644 index e288e1dcb19..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_tagsobject.go b/resource-manager/network/2023-06-01/loadbalancers/model_tagsobject.go deleted file mode 100644 index 6b83deef865..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// 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/network/2023-06-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index ecbf7509a1e..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsproperties.go deleted file mode 100644 index 2503ab90312..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktap.go deleted file mode 100644 index ca9e2389b65..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 5cac0b1e63a..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/loadbalancers/predicates.go b/resource-manager/network/2023-06-01/loadbalancers/predicates.go deleted file mode 100644 index 82f247704c6..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/predicates.go +++ /dev/null @@ -1,238 +0,0 @@ -package loadbalancers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BackendAddressPoolOperationPredicate) Matches(input BackendAddressPool) 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.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 FrontendIPConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p FrontendIPConfigurationOperationPredicate) Matches(input FrontendIPConfiguration) 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.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 InboundNatRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p InboundNatRuleOperationPredicate) Matches(input InboundNatRule) 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.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 LoadBalancerOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p LoadBalancerOperationPredicate) Matches(input LoadBalancer) 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 && (input.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 LoadBalancingRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p LoadBalancingRuleOperationPredicate) Matches(input LoadBalancingRule) 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.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 NetworkInterfaceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkInterfaceOperationPredicate) Matches(input NetworkInterface) 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 && (input.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 OutboundRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p OutboundRuleOperationPredicate) Matches(input OutboundRule) 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.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 ProbeOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ProbeOperationPredicate) Matches(input Probe) 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.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/network/2023-06-01/loadbalancers/version.go b/resource-manager/network/2023-06-01/loadbalancers/version.go deleted file mode 100644 index c503d3b4430..00000000000 --- a/resource-manager/network/2023-06-01/loadbalancers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package loadbalancers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/loadbalancers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/README.md b/resource-manager/network/2023-06-01/localnetworkgateways/README.md deleted file mode 100644 index 00ade6413c0..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/README.md +++ /dev/null @@ -1,104 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/localnetworkgateways` Documentation - -The `localnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/localnetworkgateways" -``` - - -### Client Initialization - -```go -client := localnetworkgateways.NewLocalNetworkGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `LocalNetworkGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -payload := localnetworkgateways.LocalNetworkGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `LocalNetworkGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `LocalNetworkGatewaysClient.Get` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -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: `LocalNetworkGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `LocalNetworkGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := localnetworkgateways.NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - -payload := localnetworkgateways.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/network/2023-06-01/localnetworkgateways/client.go b/resource-manager/network/2023-06-01/localnetworkgateways/client.go deleted file mode 100644 index 90a3468c9f3..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package localnetworkgateways - -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 LocalNetworkGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewLocalNetworkGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*LocalNetworkGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "localnetworkgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating LocalNetworkGatewaysClient: %+v", err) - } - - return &LocalNetworkGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/constants.go b/resource-manager/network/2023-06-01/localnetworkgateways/constants.go deleted file mode 100644 index f82efef3b1f..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package localnetworkgateways - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway.go b/resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway.go deleted file mode 100644 index b3c0d3a0339..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package localnetworkgateways - -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(&LocalNetworkGatewayId{}) -} - -var _ resourceids.ResourceId = &LocalNetworkGatewayId{} - -// LocalNetworkGatewayId is a struct representing the Resource ID for a Local Network Gateway -type LocalNetworkGatewayId struct { - SubscriptionId string - ResourceGroupName string - LocalNetworkGatewayName string -} - -// NewLocalNetworkGatewayID returns a new LocalNetworkGatewayId struct -func NewLocalNetworkGatewayID(subscriptionId string, resourceGroupName string, localNetworkGatewayName string) LocalNetworkGatewayId { - return LocalNetworkGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocalNetworkGatewayName: localNetworkGatewayName, - } -} - -// ParseLocalNetworkGatewayID parses 'input' into a LocalNetworkGatewayId -func ParseLocalNetworkGatewayID(input string) (*LocalNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocalNetworkGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocalNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLocalNetworkGatewayIDInsensitively parses 'input' case-insensitively into a LocalNetworkGatewayId -// note: this method should only be used for API response data and not user input -func ParseLocalNetworkGatewayIDInsensitively(input string) (*LocalNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocalNetworkGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocalNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LocalNetworkGatewayId) 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.LocalNetworkGatewayName, ok = input.Parsed["localNetworkGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "localNetworkGatewayName", input) - } - - return nil -} - -// ValidateLocalNetworkGatewayID checks that 'input' can be parsed as a Local Network Gateway ID -func ValidateLocalNetworkGatewayID(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 := ParseLocalNetworkGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Local Network Gateway ID -func (id LocalNetworkGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/localNetworkGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocalNetworkGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Local Network Gateway ID -func (id LocalNetworkGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocalNetworkGateways", "localNetworkGateways", "localNetworkGateways"), - resourceids.UserSpecifiedSegment("localNetworkGatewayName", "localNetworkGatewayValue"), - } -} - -// String returns a human-readable description of this Local Network Gateway ID -func (id LocalNetworkGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Local Network Gateway Name: %q", id.LocalNetworkGatewayName), - } - return fmt.Sprintf("Local Network Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway_test.go b/resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway_test.go deleted file mode 100644 index f1ee1ad0e64..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/id_localnetworkgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package localnetworkgateways - -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 = &LocalNetworkGatewayId{} - -func TestNewLocalNetworkGatewayID(t *testing.T) { - id := NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue") - - 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.LocalNetworkGatewayName != "localNetworkGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocalNetworkGatewayName'", id.LocalNetworkGatewayName, "localNetworkGatewayValue") - } -} - -func TestFormatLocalNetworkGatewayID(t *testing.T) { - actual := NewLocalNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "localNetworkGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLocalNetworkGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocalNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue", - Expected: &LocalNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocalNetworkGatewayName: "localNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocalNetworkGatewayID(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.LocalNetworkGatewayName != v.Expected.LocalNetworkGatewayName { - t.Fatalf("Expected %q but got %q for LocalNetworkGatewayName", v.Expected.LocalNetworkGatewayName, actual.LocalNetworkGatewayName) - } - - } -} - -func TestParseLocalNetworkGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocalNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAlNeTwOrKgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue", - Expected: &LocalNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocalNetworkGatewayName: "localNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/localNetworkGateways/localNetworkGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAlNeTwOrKgAtEwAyS/lOcAlNeTwOrKgAtEwAyVaLuE", - Expected: &LocalNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocalNetworkGatewayName: "lOcAlNeTwOrKgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/lOcAlNeTwOrKgAtEwAyS/lOcAlNeTwOrKgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocalNetworkGatewayIDInsensitively(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.LocalNetworkGatewayName != v.Expected.LocalNetworkGatewayName { - t.Fatalf("Expected %q but got %q for LocalNetworkGatewayName", v.Expected.LocalNetworkGatewayName, actual.LocalNetworkGatewayName) - } - - } -} - -func TestSegmentsForLocalNetworkGatewayId(t *testing.T) { - segments := LocalNetworkGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LocalNetworkGatewayId 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/network/2023-06-01/localnetworkgateways/method_createorupdate.go b/resource-manager/network/2023-06-01/localnetworkgateways/method_createorupdate.go deleted file mode 100644 index 1b41558abaa..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package localnetworkgateways - -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 *LocalNetworkGateway -} - -// CreateOrUpdate ... -func (c LocalNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, id LocalNetworkGatewayId, input LocalNetworkGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c LocalNetworkGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id LocalNetworkGatewayId, input LocalNetworkGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/localnetworkgateways/method_delete.go b/resource-manager/network/2023-06-01/localnetworkgateways/method_delete.go deleted file mode 100644 index 2b155d2b9e7..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package localnetworkgateways - -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 LocalNetworkGatewaysClient) Delete(ctx context.Context, id LocalNetworkGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 LocalNetworkGatewaysClient) DeleteThenPoll(ctx context.Context, id LocalNetworkGatewayId) 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/network/2023-06-01/localnetworkgateways/method_get.go b/resource-manager/network/2023-06-01/localnetworkgateways/method_get.go deleted file mode 100644 index 08da8072f93..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package localnetworkgateways - -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 *LocalNetworkGateway -} - -// Get ... -func (c LocalNetworkGatewaysClient) Get(ctx context.Context, id LocalNetworkGatewayId) (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 LocalNetworkGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/method_list.go b/resource-manager/network/2023-06-01/localnetworkgateways/method_list.go deleted file mode 100644 index b33751a1a6c..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package localnetworkgateways - -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 *[]LocalNetworkGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LocalNetworkGateway -} - -// List ... -func (c LocalNetworkGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/localNetworkGateways", 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 *[]LocalNetworkGateway `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 LocalNetworkGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, LocalNetworkGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c LocalNetworkGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate LocalNetworkGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]LocalNetworkGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/localnetworkgateways/method_updatetags.go b/resource-manager/network/2023-06-01/localnetworkgateways/method_updatetags.go deleted file mode 100644 index c20950665de..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package localnetworkgateways - -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 *LocalNetworkGateway -} - -// UpdateTags ... -func (c LocalNetworkGatewaysClient) UpdateTags(ctx context.Context, id LocalNetworkGatewayId, 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 LocalNetworkGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/model_addressspace.go b/resource-manager/network/2023-06-01/localnetworkgateways/model_addressspace.go deleted file mode 100644 index 232140416bf..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/model_bgpsettings.go b/resource-manager/network/2023-06-01/localnetworkgateways/model_bgpsettings.go deleted file mode 100644 index 9d3dfccb4b1..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-06-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index 4778a80b432..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgateway.go b/resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgateway.go deleted file mode 100644 index 684fe705afc..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties LocalNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go deleted file mode 100644 index fb7a91a8c71..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/model_localnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGatewayPropertiesFormat struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/localnetworkgateways/model_tagsobject.go b/resource-manager/network/2023-06-01/localnetworkgateways/model_tagsobject.go deleted file mode 100644 index 214a0886d9b..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package localnetworkgateways - -// 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/network/2023-06-01/localnetworkgateways/predicates.go b/resource-manager/network/2023-06-01/localnetworkgateways/predicates.go deleted file mode 100644 index d4e529f8a9c..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package localnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p LocalNetworkGatewayOperationPredicate) Matches(input LocalNetworkGateway) 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 && (input.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/network/2023-06-01/localnetworkgateways/version.go b/resource-manager/network/2023-06-01/localnetworkgateways/version.go deleted file mode 100644 index dca1cddc494..00000000000 --- a/resource-manager/network/2023-06-01/localnetworkgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package localnetworkgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/localnetworkgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/natgateways/README.md b/resource-manager/network/2023-06-01/natgateways/README.md deleted file mode 100644 index 5263e541e3c..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/natgateways` Documentation - -The `natgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/natgateways" -``` - - -### Client Initialization - -```go -client := natgateways.NewNatGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NatGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -payload := natgateways.NatGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NatGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NatGatewaysClient.Get` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -read, err := client.Get(ctx, id, natgateways.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NatGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NatGatewaysClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NatGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := natgateways.NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - -payload := natgateways.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/network/2023-06-01/natgateways/client.go b/resource-manager/network/2023-06-01/natgateways/client.go deleted file mode 100644 index 10d7c1f9e5f..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package natgateways - -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 NatGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewNatGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*NatGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "natgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NatGatewaysClient: %+v", err) - } - - return &NatGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/natgateways/constants.go b/resource-manager/network/2023-06-01/natgateways/constants.go deleted file mode 100644 index db752936aa3..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/constants.go +++ /dev/null @@ -1,95 +0,0 @@ -package natgateways - -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 NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/natgateways/id_natgateway.go b/resource-manager/network/2023-06-01/natgateways/id_natgateway.go deleted file mode 100644 index 95f33162e5e..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/id_natgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package natgateways - -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(&NatGatewayId{}) -} - -var _ resourceids.ResourceId = &NatGatewayId{} - -// NatGatewayId is a struct representing the Resource ID for a Nat Gateway -type NatGatewayId struct { - SubscriptionId string - ResourceGroupName string - NatGatewayName string -} - -// NewNatGatewayID returns a new NatGatewayId struct -func NewNatGatewayID(subscriptionId string, resourceGroupName string, natGatewayName string) NatGatewayId { - return NatGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NatGatewayName: natGatewayName, - } -} - -// ParseNatGatewayID parses 'input' into a NatGatewayId -func ParseNatGatewayID(input string) (*NatGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNatGatewayIDInsensitively parses 'input' case-insensitively into a NatGatewayId -// note: this method should only be used for API response data and not user input -func ParseNatGatewayIDInsensitively(input string) (*NatGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NatGatewayId) 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.NatGatewayName, ok = input.Parsed["natGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "natGatewayName", input) - } - - return nil -} - -// ValidateNatGatewayID checks that 'input' can be parsed as a Nat Gateway ID -func ValidateNatGatewayID(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 := ParseNatGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Nat Gateway ID -func (id NatGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/natGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NatGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Nat Gateway ID -func (id NatGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNatGateways", "natGateways", "natGateways"), - resourceids.UserSpecifiedSegment("natGatewayName", "natGatewayValue"), - } -} - -// String returns a human-readable description of this Nat Gateway ID -func (id NatGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Nat Gateway Name: %q", id.NatGatewayName), - } - return fmt.Sprintf("Nat Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/natgateways/id_natgateway_test.go b/resource-manager/network/2023-06-01/natgateways/id_natgateway_test.go deleted file mode 100644 index 3d502524a2f..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/id_natgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package natgateways - -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 = &NatGatewayId{} - -func TestNewNatGatewayID(t *testing.T) { - id := NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue") - - 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.NatGatewayName != "natGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'NatGatewayName'", id.NatGatewayName, "natGatewayValue") - } -} - -func TestFormatNatGatewayID(t *testing.T) { - actual := NewNatGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "natGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNatGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue", - Expected: &NatGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NatGatewayName: "natGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatGatewayID(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.NatGatewayName != v.Expected.NatGatewayName { - t.Fatalf("Expected %q but got %q for NatGatewayName", v.Expected.NatGatewayName, actual.NatGatewayName) - } - - } -} - -func TestParseNatGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nAtGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue", - Expected: &NatGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NatGatewayName: "natGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/natGateways/natGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nAtGaTeWaYs/nAtGaTeWaYvAlUe", - Expected: &NatGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NatGatewayName: "nAtGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/nAtGaTeWaYs/nAtGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatGatewayIDInsensitively(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.NatGatewayName != v.Expected.NatGatewayName { - t.Fatalf("Expected %q but got %q for NatGatewayName", v.Expected.NatGatewayName, actual.NatGatewayName) - } - - } -} - -func TestSegmentsForNatGatewayId(t *testing.T) { - segments := NatGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NatGatewayId 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/network/2023-06-01/natgateways/method_createorupdate.go b/resource-manager/network/2023-06-01/natgateways/method_createorupdate.go deleted file mode 100644 index 34a53aff5ac..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package natgateways - -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 *NatGateway -} - -// CreateOrUpdate ... -func (c NatGatewaysClient) CreateOrUpdate(ctx context.Context, id NatGatewayId, input NatGateway) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NatGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id NatGatewayId, input NatGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/natgateways/method_delete.go b/resource-manager/network/2023-06-01/natgateways/method_delete.go deleted file mode 100644 index d03d142add6..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package natgateways - -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 NatGatewaysClient) Delete(ctx context.Context, id NatGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NatGatewaysClient) DeleteThenPoll(ctx context.Context, id NatGatewayId) 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/network/2023-06-01/natgateways/method_get.go b/resource-manager/network/2023-06-01/natgateways/method_get.go deleted file mode 100644 index 43cb3094813..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package natgateways - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NatGateway -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NatGatewaysClient) Get(ctx context.Context, id NatGatewayId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NatGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/natgateways/method_list.go b/resource-manager/network/2023-06-01/natgateways/method_list.go deleted file mode 100644 index dc70e51b7f5..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package natgateways - -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 *[]NatGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NatGateway -} - -// List ... -func (c NatGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/natGateways", 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 *[]NatGateway `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 NatGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NatGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NatGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NatGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NatGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/natgateways/method_listall.go b/resource-manager/network/2023-06-01/natgateways/method_listall.go deleted file mode 100644 index 871848dafc8..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package natgateways - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NatGateway -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NatGateway -} - -// ListAll ... -func (c NatGatewaysClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/natGateways", 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 *[]NatGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NatGatewaysClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NatGatewayOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NatGatewaysClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NatGatewayOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NatGateway, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/natgateways/method_updatetags.go b/resource-manager/network/2023-06-01/natgateways/method_updatetags.go deleted file mode 100644 index b5dbabece39..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package natgateways - -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 *NatGateway -} - -// UpdateTags ... -func (c NatGatewaysClient) UpdateTags(ctx context.Context, id NatGatewayId, 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 NatGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/natgateways/model_natgateway.go b/resource-manager/network/2023-06-01/natgateways/model_natgateway.go deleted file mode 100644 index 0aabf1ead87..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package natgateways - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/natgateways/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/natgateways/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7bfde80e4d9..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/natgateways/model_natgatewaysku.go b/resource-manager/network/2023-06-01/natgateways/model_natgatewaysku.go deleted file mode 100644 index 962d747cc17..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/natgateways/model_subresource.go b/resource-manager/network/2023-06-01/natgateways/model_subresource.go deleted file mode 100644 index ea00694667d..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/natgateways/model_tagsobject.go b/resource-manager/network/2023-06-01/natgateways/model_tagsobject.go deleted file mode 100644 index c5e055c3a58..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package natgateways - -// 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/network/2023-06-01/natgateways/predicates.go b/resource-manager/network/2023-06-01/natgateways/predicates.go deleted file mode 100644 index c0e09cf2f07..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package natgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NatGatewayOperationPredicate) Matches(input NatGateway) 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 && (input.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/network/2023-06-01/natgateways/version.go b/resource-manager/network/2023-06-01/natgateways/version.go deleted file mode 100644 index c896513e5c4..00000000000 --- a/resource-manager/network/2023-06-01/natgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package natgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/natgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkgroups/README.md b/resource-manager/network/2023-06-01/networkgroups/README.md deleted file mode 100644 index 7410185b609..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkgroups` Documentation - -The `networkgroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkgroups" -``` - - -### Client Initialization - -```go -client := networkgroups.NewNetworkGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -payload := networkgroups.NetworkGroup{ - // ... -} - - -read, err := client.CreateOrUpdate(ctx, id, payload, networkgroups.DefaultCreateOrUpdateOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkGroupsClient.Delete` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -if err := client.DeleteThenPoll(ctx, id, networkgroups.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkGroupsClient.Get` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -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: `NetworkGroupsClient.List` - -```go -ctx := context.TODO() -id := networkgroups.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, networkgroups.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, networkgroups.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/networkgroups/client.go b/resource-manager/network/2023-06-01/networkgroups/client.go deleted file mode 100644 index 3cfe1e1eebf..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkgroups - -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 NetworkGroupsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkgroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkGroupsClient: %+v", err) - } - - return &NetworkGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkgroups/constants.go b/resource-manager/network/2023-06-01/networkgroups/constants.go deleted file mode 100644 index 3bc1d35bd51..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package networkgroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkgroups/id_networkgroup.go b/resource-manager/network/2023-06-01/networkgroups/id_networkgroup.go deleted file mode 100644 index e92b4d5d7c0..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/id_networkgroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkgroups - -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(&NetworkGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkGroupId{} - -// NetworkGroupId is a struct representing the Resource ID for a Network Group -type NetworkGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - NetworkGroupName string -} - -// NewNetworkGroupID returns a new NetworkGroupId struct -func NewNetworkGroupID(subscriptionId string, resourceGroupName string, networkManagerName string, networkGroupName string) NetworkGroupId { - return NetworkGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - NetworkGroupName: networkGroupName, - } -} - -// ParseNetworkGroupID parses 'input' into a NetworkGroupId -func ParseNetworkGroupID(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkGroupIDInsensitively parses 'input' case-insensitively into a NetworkGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkGroupIDInsensitively(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkGroupId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.NetworkGroupName, ok = input.Parsed["networkGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkGroupName", input) - } - - return nil -} - -// ValidateNetworkGroupID checks that 'input' can be parsed as a Network Group ID -func ValidateNetworkGroupID(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 := ParseNetworkGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Group ID -func (id NetworkGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/networkGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.NetworkGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Group ID -func (id NetworkGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticNetworkGroups", "networkGroups", "networkGroups"), - resourceids.UserSpecifiedSegment("networkGroupName", "networkGroupValue"), - } -} - -// String returns a human-readable description of this Network Group ID -func (id NetworkGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Network Group Name: %q", id.NetworkGroupName), - } - return fmt.Sprintf("Network Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkgroups/id_networkgroup_test.go b/resource-manager/network/2023-06-01/networkgroups/id_networkgroup_test.go deleted file mode 100644 index 5224081b110..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/id_networkgroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkgroups - -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 = &NetworkGroupId{} - -func TestNewNetworkGroupID(t *testing.T) { - id := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.NetworkGroupName != "networkGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkGroupName'", id.NetworkGroupName, "networkGroupValue") - } -} - -func TestFormatNetworkGroupID(t *testing.T) { - actual := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestParseNetworkGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - NetworkGroupName: "nEtWoRkGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestSegmentsForNetworkGroupId(t *testing.T) { - segments := NetworkGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkGroupId 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/network/2023-06-01/networkgroups/id_networkmanager.go b/resource-manager/network/2023-06-01/networkgroups/id_networkmanager.go deleted file mode 100644 index 58b8bb2d432..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkgroups - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkgroups/id_networkmanager_test.go b/resource-manager/network/2023-06-01/networkgroups/id_networkmanager_test.go deleted file mode 100644 index e48b7115869..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkgroups - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/networkgroups/method_createorupdate.go b/resource-manager/network/2023-06-01/networkgroups/method_createorupdate.go deleted file mode 100644 index dcb392d1ae2..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/method_createorupdate.go +++ /dev/null @@ -1,88 +0,0 @@ -package networkgroups - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkGroup -} - -type CreateOrUpdateOperationOptions struct { - IfMatch *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)) - } - 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 NetworkGroupsClient) CreateOrUpdate(ctx context.Context, id NetworkGroupId, input NetworkGroup, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 NetworkGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkgroups/method_delete.go b/resource-manager/network/2023-06-01/networkgroups/method_delete.go deleted file mode 100644 index 567e0fb203a..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package networkgroups - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 NetworkGroupsClient) Delete(ctx context.Context, id NetworkGroupId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkGroupsClient) DeleteThenPoll(ctx context.Context, id NetworkGroupId, 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/network/2023-06-01/networkgroups/method_get.go b/resource-manager/network/2023-06-01/networkgroups/method_get.go deleted file mode 100644 index 554db15d016..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkgroups - -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 *NetworkGroup -} - -// Get ... -func (c NetworkGroupsClient) Get(ctx context.Context, id NetworkGroupId) (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 NetworkGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkgroups/method_list.go b/resource-manager/network/2023-06-01/networkgroups/method_list.go deleted file mode 100644 index 84c759e9e2c..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package networkgroups - -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 *[]NetworkGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkGroup -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c NetworkGroupsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkGroups", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkGroup `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 NetworkGroupsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, NetworkGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate NetworkGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkGroup, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/networkgroups/model_networkgroup.go b/resource-manager/network/2023-06-01/networkgroups/model_networkgroup.go deleted file mode 100644 index c35ded0ac80..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/model_networkgroup.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkgroups - -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 NetworkGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkgroups/model_networkgroupproperties.go b/resource-manager/network/2023-06-01/networkgroups/model_networkgroupproperties.go deleted file mode 100644 index 69e5d9d5b22..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkgroups/predicates.go b/resource-manager/network/2023-06-01/networkgroups/predicates.go deleted file mode 100644 index 621d0d7b40a..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package networkgroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkGroupOperationPredicate) Matches(input NetworkGroup) 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.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/network/2023-06-01/networkgroups/version.go b/resource-manager/network/2023-06-01/networkgroups/version.go deleted file mode 100644 index 333dbc5e199..00000000000 --- a/resource-manager/network/2023-06-01/networkgroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkgroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkgroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/README.md b/resource-manager/network/2023-06-01/networkinterfaces/README.md deleted file mode 100644 index 800f70a3438..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/README.md +++ /dev/null @@ -1,371 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkinterfaces` Documentation - -The `networkinterfaces` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkinterfaces" -``` - - -### Client Initialization - -```go -client := networkinterfaces.NewNetworkInterfacesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkInterfacesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.NetworkInterface{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkInterfacesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -read, err := client.Get(ctx, id, networkinterfaces.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetCloudServiceNetworkInterface` - -```go -ctx := context.TODO() -id := networkinterfaces.NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue") - -read, err := client.GetCloudServiceNetworkInterface(ctx, id, networkinterfaces.DefaultGetCloudServiceNetworkInterfaceOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetEffectiveRouteTable` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.GetEffectiveRouteTable(ctx, id)` can be used to do batched pagination -items, err := client.GetEffectiveRouteTableComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetIPConfiguration` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") - -read, err := client.GetVirtualMachineScaleSetIPConfiguration(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.GetVirtualMachineScaleSetNetworkInterface` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") - -read, err := client.GetVirtualMachineScaleSetNetworkInterface(ctx, id, networkinterfaces.DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkInterfacesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListCloudServiceNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - -// alternatively `client.ListCloudServiceNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListCloudServiceNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListCloudServiceRoleInstanceNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue") - -// alternatively `client.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListEffectiveNetworkSecurityGroups` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.ListEffectiveNetworkSecurityGroups(ctx, id)` can be used to do batched pagination -items, err := client.ListEffectiveNetworkSecurityGroupsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetIPConfigurations` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue") - -// alternatively `client.ListVirtualMachineScaleSetIPConfigurations(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions())` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetIPConfigurationsComplete(ctx, id, networkinterfaces.DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - -// alternatively `client.ListVirtualMachineScaleSetNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.ListVirtualMachineScaleSetVMNetworkInterfaces` - -```go -ctx := context.TODO() -id := networkinterfaces.NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue") - -// alternatively `client.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id)` can be used to do batched pagination -items, err := client.ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsGet` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "ipConfigurationValue") - -read, err := client.NetworkInterfaceIPConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceIPConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceIPConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceIPConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceLoadBalancersList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceLoadBalancersList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceLoadBalancersListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsGet` - -```go -ctx := context.TODO() -id := networkinterfaces.NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue") - -read, err := client.NetworkInterfaceTapConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkInterfacesClient.NetworkInterfaceTapConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -// alternatively `client.NetworkInterfaceTapConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkInterfaceTapConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkInterfacesClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue") - -payload := networkinterfaces.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/network/2023-06-01/networkinterfaces/client.go b/resource-manager/network/2023-06-01/networkinterfaces/client.go deleted file mode 100644 index cd098aeccdf..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkinterfaces - -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 NetworkInterfacesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkInterfacesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkInterfacesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkinterfaces", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkInterfacesClient: %+v", err) - } - - return &NetworkInterfacesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/constants.go b/resource-manager/network/2023-06-01/networkinterfaces/constants.go deleted file mode 100644 index fc9528b4c86..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/constants.go +++ /dev/null @@ -1,1500 +0,0 @@ -package networkinterfaces - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type EffectiveRouteSource string - -const ( - EffectiveRouteSourceDefault EffectiveRouteSource = "Default" - EffectiveRouteSourceUnknown EffectiveRouteSource = "Unknown" - EffectiveRouteSourceUser EffectiveRouteSource = "User" - EffectiveRouteSourceVirtualNetworkGateway EffectiveRouteSource = "VirtualNetworkGateway" -) - -func PossibleValuesForEffectiveRouteSource() []string { - return []string{ - string(EffectiveRouteSourceDefault), - string(EffectiveRouteSourceUnknown), - string(EffectiveRouteSourceUser), - string(EffectiveRouteSourceVirtualNetworkGateway), - } -} - -func (s *EffectiveRouteSource) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveRouteSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveRouteSource(input string) (*EffectiveRouteSource, error) { - vals := map[string]EffectiveRouteSource{ - "default": EffectiveRouteSourceDefault, - "unknown": EffectiveRouteSourceUnknown, - "user": EffectiveRouteSourceUser, - "virtualnetworkgateway": EffectiveRouteSourceVirtualNetworkGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveRouteSource(input) - return &out, nil -} - -type EffectiveRouteState string - -const ( - EffectiveRouteStateActive EffectiveRouteState = "Active" - EffectiveRouteStateInvalid EffectiveRouteState = "Invalid" -) - -func PossibleValuesForEffectiveRouteState() []string { - return []string{ - string(EffectiveRouteStateActive), - string(EffectiveRouteStateInvalid), - } -} - -func (s *EffectiveRouteState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveRouteState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveRouteState(input string) (*EffectiveRouteState, error) { - vals := map[string]EffectiveRouteState{ - "active": EffectiveRouteStateActive, - "invalid": EffectiveRouteStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveRouteState(input) - return &out, nil -} - -type EffectiveSecurityRuleProtocol string - -const ( - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - EffectiveSecurityRuleProtocolTcp EffectiveSecurityRuleProtocol = "Tcp" - EffectiveSecurityRuleProtocolUdp EffectiveSecurityRuleProtocol = "Udp" -) - -func PossibleValuesForEffectiveSecurityRuleProtocol() []string { - return []string{ - string(EffectiveSecurityRuleProtocolAll), - string(EffectiveSecurityRuleProtocolTcp), - string(EffectiveSecurityRuleProtocolUdp), - } -} - -func (s *EffectiveSecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveSecurityRuleProtocol(input string) (*EffectiveSecurityRuleProtocol, error) { - vals := map[string]EffectiveSecurityRuleProtocol{ - "all": EffectiveSecurityRuleProtocolAll, - "tcp": EffectiveSecurityRuleProtocolTcp, - "udp": EffectiveSecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveSecurityRuleProtocol(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type LoadBalancerOutboundRuleProtocol string - -const ( - LoadBalancerOutboundRuleProtocolAll LoadBalancerOutboundRuleProtocol = "All" - LoadBalancerOutboundRuleProtocolTcp LoadBalancerOutboundRuleProtocol = "Tcp" - LoadBalancerOutboundRuleProtocolUdp LoadBalancerOutboundRuleProtocol = "Udp" -) - -func PossibleValuesForLoadBalancerOutboundRuleProtocol() []string { - return []string{ - string(LoadBalancerOutboundRuleProtocolAll), - string(LoadBalancerOutboundRuleProtocolTcp), - string(LoadBalancerOutboundRuleProtocolUdp), - } -} - -func (s *LoadBalancerOutboundRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerOutboundRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerOutboundRuleProtocol(input string) (*LoadBalancerOutboundRuleProtocol, error) { - vals := map[string]LoadBalancerOutboundRuleProtocol{ - "all": LoadBalancerOutboundRuleProtocolAll, - "tcp": LoadBalancerOutboundRuleProtocolTcp, - "udp": LoadBalancerOutboundRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerOutboundRuleProtocol(input) - return &out, nil -} - -type LoadBalancerSkuName string - -const ( - LoadBalancerSkuNameBasic LoadBalancerSkuName = "Basic" - LoadBalancerSkuNameGateway LoadBalancerSkuName = "Gateway" - LoadBalancerSkuNameStandard LoadBalancerSkuName = "Standard" -) - -func PossibleValuesForLoadBalancerSkuName() []string { - return []string{ - string(LoadBalancerSkuNameBasic), - string(LoadBalancerSkuNameGateway), - string(LoadBalancerSkuNameStandard), - } -} - -func (s *LoadBalancerSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuName(input string) (*LoadBalancerSkuName, error) { - vals := map[string]LoadBalancerSkuName{ - "basic": LoadBalancerSkuNameBasic, - "gateway": LoadBalancerSkuNameGateway, - "standard": LoadBalancerSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuName(input) - return &out, nil -} - -type LoadBalancerSkuTier string - -const ( - LoadBalancerSkuTierGlobal LoadBalancerSkuTier = "Global" - LoadBalancerSkuTierRegional LoadBalancerSkuTier = "Regional" -) - -func PossibleValuesForLoadBalancerSkuTier() []string { - return []string{ - string(LoadBalancerSkuTierGlobal), - string(LoadBalancerSkuTierRegional), - } -} - -func (s *LoadBalancerSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerSkuTier(input string) (*LoadBalancerSkuTier, error) { - vals := map[string]LoadBalancerSkuTier{ - "global": LoadBalancerSkuTierGlobal, - "regional": LoadBalancerSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerSkuTier(input) - return &out, nil -} - -type LoadDistribution string - -const ( - LoadDistributionDefault LoadDistribution = "Default" - LoadDistributionSourceIP LoadDistribution = "SourceIP" - LoadDistributionSourceIPProtocol LoadDistribution = "SourceIPProtocol" -) - -func PossibleValuesForLoadDistribution() []string { - return []string{ - string(LoadDistributionDefault), - string(LoadDistributionSourceIP), - string(LoadDistributionSourceIPProtocol), - } -} - -func (s *LoadDistribution) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadDistribution(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadDistribution(input string) (*LoadDistribution, error) { - vals := map[string]LoadDistribution{ - "default": LoadDistributionDefault, - "sourceip": LoadDistributionSourceIP, - "sourceipprotocol": LoadDistributionSourceIPProtocol, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadDistribution(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProbeProtocol string - -const ( - ProbeProtocolHTTP ProbeProtocol = "Http" - ProbeProtocolHTTPS ProbeProtocol = "Https" - ProbeProtocolTcp ProbeProtocol = "Tcp" -) - -func PossibleValuesForProbeProtocol() []string { - return []string{ - string(ProbeProtocolHTTP), - string(ProbeProtocolHTTPS), - string(ProbeProtocolTcp), - } -} - -func (s *ProbeProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProbeProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProbeProtocol(input string) (*ProbeProtocol, error) { - vals := map[string]ProbeProtocol{ - "http": ProbeProtocolHTTP, - "https": ProbeProtocolHTTPS, - "tcp": ProbeProtocolTcp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProbeProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice.go b/resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice.go deleted file mode 100644 index e3a9af48f96..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkinterfaces - -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(&ProviderCloudServiceId{}) -} - -var _ resourceids.ResourceId = &ProviderCloudServiceId{} - -// ProviderCloudServiceId is a struct representing the Resource ID for a Provider Cloud Service -type ProviderCloudServiceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string -} - -// NewProviderCloudServiceID returns a new ProviderCloudServiceId struct -func NewProviderCloudServiceID(subscriptionId string, resourceGroupName string, cloudServiceName string) ProviderCloudServiceId { - return ProviderCloudServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - } -} - -// ParseProviderCloudServiceID parses 'input' into a ProviderCloudServiceId -func ParseProviderCloudServiceID(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderCloudServiceIDInsensitively parses 'input' case-insensitively into a ProviderCloudServiceId -// note: this method should only be used for API response data and not user input -func ParseProviderCloudServiceIDInsensitively(input string) (*ProviderCloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderCloudServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderCloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderCloudServiceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - return nil -} - -// ValidateProviderCloudServiceID checks that 'input' can be parsed as a Provider Cloud Service ID -func ValidateProviderCloudServiceID(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 := ParseProviderCloudServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Cloud Service ID -func (id ProviderCloudServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Cloud Service ID -func (id ProviderCloudServiceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - } -} - -// String returns a human-readable description of this Provider Cloud Service ID -func (id ProviderCloudServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - } - return fmt.Sprintf("Provider Cloud Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice_test.go b/resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice_test.go deleted file mode 100644 index a29f672a8b4..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_providercloudservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkinterfaces - -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 = &ProviderCloudServiceId{} - -func TestNewProviderCloudServiceID(t *testing.T) { - id := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } -} - -func TestFormatProviderCloudServiceID(t *testing.T) { - actual := NewProviderCloudServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderCloudServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestParseProviderCloudServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderCloudServiceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Expected: &ProviderCloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderCloudServiceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestSegmentsForProviderCloudServiceId(t *testing.T) { - segments := ProviderCloudServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderCloudServiceId 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/network/2023-06-01/networkinterfaces/id_roleinstance.go b/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance.go deleted file mode 100644 index 69a75e612e0..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkinterfaces - -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(&RoleInstanceId{}) -} - -var _ resourceids.ResourceId = &RoleInstanceId{} - -// RoleInstanceId is a struct representing the Resource ID for a Role Instance -type RoleInstanceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string - RoleInstanceName string -} - -// NewRoleInstanceID returns a new RoleInstanceId struct -func NewRoleInstanceID(subscriptionId string, resourceGroupName string, cloudServiceName string, roleInstanceName string) RoleInstanceId { - return RoleInstanceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - RoleInstanceName: roleInstanceName, - } -} - -// ParseRoleInstanceID parses 'input' into a RoleInstanceId -func ParseRoleInstanceID(input string) (*RoleInstanceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoleInstanceIDInsensitively parses 'input' case-insensitively into a RoleInstanceId -// note: this method should only be used for API response data and not user input -func ParseRoleInstanceIDInsensitively(input string) (*RoleInstanceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoleInstanceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - if id.RoleInstanceName, ok = input.Parsed["roleInstanceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "roleInstanceName", input) - } - - return nil -} - -// ValidateRoleInstanceID checks that 'input' can be parsed as a Role Instance ID -func ValidateRoleInstanceID(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 := ParseRoleInstanceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Role Instance ID -func (id RoleInstanceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s/roleInstances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName, id.RoleInstanceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Role Instance ID -func (id RoleInstanceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - resourceids.StaticSegment("staticRoleInstances", "roleInstances", "roleInstances"), - resourceids.UserSpecifiedSegment("roleInstanceName", "roleInstanceValue"), - } -} - -// String returns a human-readable description of this Role Instance ID -func (id RoleInstanceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - fmt.Sprintf("Role Instance Name: %q", id.RoleInstanceName), - } - return fmt.Sprintf("Role Instance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance_test.go b/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance_test.go deleted file mode 100644 index 77f33a78522..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstance_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkinterfaces - -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 = &RoleInstanceId{} - -func TestNewRoleInstanceID(t *testing.T) { - id := NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } - - if id.RoleInstanceName != "roleInstanceValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoleInstanceName'", id.RoleInstanceName, "roleInstanceValue") - } -} - -func TestFormatRoleInstanceID(t *testing.T) { - actual := NewRoleInstanceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoleInstanceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Expected: &RoleInstanceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - } -} - -func TestParseRoleInstanceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Expected: &RoleInstanceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe", - Expected: &RoleInstanceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - RoleInstanceName: "rOlEiNsTaNcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - } -} - -func TestSegmentsForRoleInstanceId(t *testing.T) { - segments := RoleInstanceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoleInstanceId 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/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface.go b/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface.go deleted file mode 100644 index 4a96fd5d010..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface.go +++ /dev/null @@ -1,148 +0,0 @@ -package networkinterfaces - -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(&RoleInstanceNetworkInterfaceId{}) -} - -var _ resourceids.ResourceId = &RoleInstanceNetworkInterfaceId{} - -// RoleInstanceNetworkInterfaceId is a struct representing the Resource ID for a Role Instance Network Interface -type RoleInstanceNetworkInterfaceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string - RoleInstanceName string - NetworkInterfaceName string -} - -// NewRoleInstanceNetworkInterfaceID returns a new RoleInstanceNetworkInterfaceId struct -func NewRoleInstanceNetworkInterfaceID(subscriptionId string, resourceGroupName string, cloudServiceName string, roleInstanceName string, networkInterfaceName string) RoleInstanceNetworkInterfaceId { - return RoleInstanceNetworkInterfaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - RoleInstanceName: roleInstanceName, - NetworkInterfaceName: networkInterfaceName, - } -} - -// ParseRoleInstanceNetworkInterfaceID parses 'input' into a RoleInstanceNetworkInterfaceId -func ParseRoleInstanceNetworkInterfaceID(input string) (*RoleInstanceNetworkInterfaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceNetworkInterfaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceNetworkInterfaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoleInstanceNetworkInterfaceIDInsensitively parses 'input' case-insensitively into a RoleInstanceNetworkInterfaceId -// note: this method should only be used for API response data and not user input -func ParseRoleInstanceNetworkInterfaceIDInsensitively(input string) (*RoleInstanceNetworkInterfaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleInstanceNetworkInterfaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleInstanceNetworkInterfaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoleInstanceNetworkInterfaceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - if id.RoleInstanceName, ok = input.Parsed["roleInstanceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "roleInstanceName", input) - } - - if id.NetworkInterfaceName, ok = input.Parsed["networkInterfaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkInterfaceName", input) - } - - return nil -} - -// ValidateRoleInstanceNetworkInterfaceID checks that 'input' can be parsed as a Role Instance Network Interface ID -func ValidateRoleInstanceNetworkInterfaceID(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 := ParseRoleInstanceNetworkInterfaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Role Instance Network Interface ID -func (id RoleInstanceNetworkInterfaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s/roleInstances/%s/networkInterfaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName, id.RoleInstanceName, id.NetworkInterfaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Role Instance Network Interface ID -func (id RoleInstanceNetworkInterfaceId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - resourceids.StaticSegment("staticRoleInstances", "roleInstances", "roleInstances"), - resourceids.UserSpecifiedSegment("roleInstanceName", "roleInstanceValue"), - resourceids.StaticSegment("staticNetworkInterfaces", "networkInterfaces", "networkInterfaces"), - resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), - } -} - -// String returns a human-readable description of this Role Instance Network Interface ID -func (id RoleInstanceNetworkInterfaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - fmt.Sprintf("Role Instance Name: %q", id.RoleInstanceName), - fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), - } - return fmt.Sprintf("Role Instance Network Interface (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface_test.go b/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface_test.go deleted file mode 100644 index 706f13b517d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_roleinstancenetworkinterface_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package networkinterfaces - -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 = &RoleInstanceNetworkInterfaceId{} - -func TestNewRoleInstanceNetworkInterfaceID(t *testing.T) { - id := NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue") - - 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.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } - - if id.RoleInstanceName != "roleInstanceValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoleInstanceName'", id.RoleInstanceName, "roleInstanceValue") - } - - if id.NetworkInterfaceName != "networkInterfaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkInterfaceName'", id.NetworkInterfaceName, "networkInterfaceValue") - } -} - -func TestFormatRoleInstanceNetworkInterfaceID(t *testing.T) { - actual := NewRoleInstanceNetworkInterfaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "cloudServiceValue", "roleInstanceValue", "networkInterfaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoleInstanceNetworkInterfaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceNetworkInterfaceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue", - Expected: &RoleInstanceNetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - NetworkInterfaceName: "networkInterfaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceNetworkInterfaceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - if actual.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - } -} - -func TestParseRoleInstanceNetworkInterfaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleInstanceNetworkInterfaceId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/nEtWoRkInTeRfAcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue", - Expected: &RoleInstanceNetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - CloudServiceName: "cloudServiceValue", - RoleInstanceName: "roleInstanceValue", - NetworkInterfaceName: "networkInterfaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/cloudServices/cloudServiceValue/roleInstances/roleInstanceValue/networkInterfaces/networkInterfaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe", - Expected: &RoleInstanceNetworkInterfaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - RoleInstanceName: "rOlEiNsTaNcEvAlUe", - NetworkInterfaceName: "nEtWoRkInTeRfAcEvAlUe", - }, - }, - { - // 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.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/rOlEiNsTaNcEs/rOlEiNsTaNcEvAlUe/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleInstanceNetworkInterfaceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - if actual.RoleInstanceName != v.Expected.RoleInstanceName { - t.Fatalf("Expected %q but got %q for RoleInstanceName", v.Expected.RoleInstanceName, actual.RoleInstanceName) - } - - if actual.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - } -} - -func TestSegmentsForRoleInstanceNetworkInterfaceId(t *testing.T) { - segments := RoleInstanceNetworkInterfaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoleInstanceNetworkInterfaceId 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/network/2023-06-01/networkinterfaces/id_tapconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration.go deleted file mode 100644 index 0778222d9c9..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkinterfaces - -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(&TapConfigurationId{}) -} - -var _ resourceids.ResourceId = &TapConfigurationId{} - -// TapConfigurationId is a struct representing the Resource ID for a Tap Configuration -type TapConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkInterfaceName string - TapConfigurationName string -} - -// NewTapConfigurationID returns a new TapConfigurationId struct -func NewTapConfigurationID(subscriptionId string, resourceGroupName string, networkInterfaceName string, tapConfigurationName string) TapConfigurationId { - return TapConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkInterfaceName: networkInterfaceName, - TapConfigurationName: tapConfigurationName, - } -} - -// ParseTapConfigurationID parses 'input' into a TapConfigurationId -func ParseTapConfigurationID(input string) (*TapConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&TapConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TapConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseTapConfigurationIDInsensitively parses 'input' case-insensitively into a TapConfigurationId -// note: this method should only be used for API response data and not user input -func ParseTapConfigurationIDInsensitively(input string) (*TapConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&TapConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := TapConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *TapConfigurationId) 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.NetworkInterfaceName, ok = input.Parsed["networkInterfaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkInterfaceName", input) - } - - if id.TapConfigurationName, ok = input.Parsed["tapConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "tapConfigurationName", input) - } - - return nil -} - -// ValidateTapConfigurationID checks that 'input' can be parsed as a Tap Configuration ID -func ValidateTapConfigurationID(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 := ParseTapConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Tap Configuration ID -func (id TapConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkInterfaces/%s/tapConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkInterfaceName, id.TapConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Tap Configuration ID -func (id TapConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkInterfaces", "networkInterfaces", "networkInterfaces"), - resourceids.UserSpecifiedSegment("networkInterfaceName", "networkInterfaceValue"), - resourceids.StaticSegment("staticTapConfigurations", "tapConfigurations", "tapConfigurations"), - resourceids.UserSpecifiedSegment("tapConfigurationName", "tapConfigurationValue"), - } -} - -// String returns a human-readable description of this Tap Configuration ID -func (id TapConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Interface Name: %q", id.NetworkInterfaceName), - fmt.Sprintf("Tap Configuration Name: %q", id.TapConfigurationName), - } - return fmt.Sprintf("Tap Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration_test.go b/resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration_test.go deleted file mode 100644 index ee4786ae2fb..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_tapconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkinterfaces - -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 = &TapConfigurationId{} - -func TestNewTapConfigurationID(t *testing.T) { - id := NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue") - - 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.NetworkInterfaceName != "networkInterfaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkInterfaceName'", id.NetworkInterfaceName, "networkInterfaceValue") - } - - if id.TapConfigurationName != "tapConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'TapConfigurationName'", id.TapConfigurationName, "tapConfigurationValue") - } -} - -func TestFormatTapConfigurationID(t *testing.T) { - actual := NewTapConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkInterfaceValue", "tapConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseTapConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TapConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue", - Expected: &TapConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkInterfaceName: "networkInterfaceValue", - TapConfigurationName: "tapConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTapConfigurationID(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.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - if actual.TapConfigurationName != v.Expected.TapConfigurationName { - t.Fatalf("Expected %q but got %q for TapConfigurationName", v.Expected.TapConfigurationName, actual.TapConfigurationName) - } - - } -} - -func TestParseTapConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *TapConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/tApCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue", - Expected: &TapConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkInterfaceName: "networkInterfaceValue", - TapConfigurationName: "tapConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkInterfaces/networkInterfaceValue/tapConfigurations/tapConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/tApCoNfIgUrAtIoNs/tApCoNfIgUrAtIoNvAlUe", - Expected: &TapConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkInterfaceName: "nEtWoRkInTeRfAcEvAlUe", - TapConfigurationName: "tApCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkInTeRfAcEs/nEtWoRkInTeRfAcEvAlUe/tApCoNfIgUrAtIoNs/tApCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseTapConfigurationIDInsensitively(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.NetworkInterfaceName != v.Expected.NetworkInterfaceName { - t.Fatalf("Expected %q but got %q for NetworkInterfaceName", v.Expected.NetworkInterfaceName, actual.NetworkInterfaceName) - } - - if actual.TapConfigurationName != v.Expected.TapConfigurationName { - t.Fatalf("Expected %q but got %q for TapConfigurationName", v.Expected.TapConfigurationName, actual.TapConfigurationName) - } - - } -} - -func TestSegmentsForTapConfigurationId(t *testing.T) { - segments := TapConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("TapConfigurationId 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/network/2023-06-01/networkinterfaces/id_virtualmachine.go b/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine.go deleted file mode 100644 index e2f2dde8684..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkinterfaces - -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(&VirtualMachineId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineId{} - -// VirtualMachineId is a struct representing the Resource ID for a Virtual Machine -type VirtualMachineId struct { - SubscriptionId string - ResourceGroupName string - VirtualMachineScaleSetName string - VirtualMachineName string -} - -// NewVirtualMachineID returns a new VirtualMachineId struct -func NewVirtualMachineID(subscriptionId string, resourceGroupName string, virtualMachineScaleSetName string, virtualMachineName string) VirtualMachineId { - return VirtualMachineId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualMachineScaleSetName: virtualMachineScaleSetName, - VirtualMachineName: virtualMachineName, - } -} - -// ParseVirtualMachineID parses 'input' into a VirtualMachineId -func ParseVirtualMachineID(input string) (*VirtualMachineId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineIDInsensitively parses 'input' case-insensitively into a VirtualMachineId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineIDInsensitively(input string) (*VirtualMachineId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineId) 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.VirtualMachineScaleSetName, ok = input.Parsed["virtualMachineScaleSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineScaleSetName", input) - } - - if id.VirtualMachineName, ok = input.Parsed["virtualMachineName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineName", input) - } - - return nil -} - -// ValidateVirtualMachineID checks that 'input' can be parsed as a Virtual Machine ID -func ValidateVirtualMachineID(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 := ParseVirtualMachineID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine ID -func (id VirtualMachineId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s/virtualMachines/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineScaleSetName, id.VirtualMachineName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine ID -func (id VirtualMachineId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), - resourceids.StaticSegment("staticVirtualMachines", "virtualMachines", "virtualMachines"), - resourceids.UserSpecifiedSegment("virtualMachineName", "virtualMachineValue"), - } -} - -// String returns a human-readable description of this Virtual Machine ID -func (id VirtualMachineId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), - fmt.Sprintf("Virtual Machine Name: %q", id.VirtualMachineName), - } - return fmt.Sprintf("Virtual Machine (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine_test.go b/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine_test.go deleted file mode 100644 index 86c89e5742e..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachine_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkinterfaces - -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 = &VirtualMachineId{} - -func TestNewVirtualMachineID(t *testing.T) { - id := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue") - - 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.VirtualMachineScaleSetName != "virtualMachineScaleSetValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetValue") - } - - if id.VirtualMachineName != "virtualMachineValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineName'", id.VirtualMachineName, "virtualMachineValue") - } -} - -func TestFormatVirtualMachineID(t *testing.T) { - actual := NewVirtualMachineID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - VirtualMachineName: "virtualMachineValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineID(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - if actual.VirtualMachineName != v.Expected.VirtualMachineName { - t.Fatalf("Expected %q but got %q for VirtualMachineName", v.Expected.VirtualMachineName, actual.VirtualMachineName) - } - - } -} - -func TestParseVirtualMachineIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/vIrTuAlMaChInEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - VirtualMachineName: "virtualMachineValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/virtualMachines/virtualMachineValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/vIrTuAlMaChInEs/vIrTuAlMaChInEvAlUe", - Expected: &VirtualMachineId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTvAlUe", - VirtualMachineName: "vIrTuAlMaChInEvAlUe", - }, - }, - { - // 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.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/vIrTuAlMaChInEs/vIrTuAlMaChInEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineIDInsensitively(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - if actual.VirtualMachineName != v.Expected.VirtualMachineName { - t.Fatalf("Expected %q but got %q for VirtualMachineName", v.Expected.VirtualMachineName, actual.VirtualMachineName) - } - - } -} - -func TestSegmentsForVirtualMachineId(t *testing.T) { - segments := VirtualMachineId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineId 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/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset.go b/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset.go deleted file mode 100644 index e9a264c0a89..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkinterfaces - -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(&VirtualMachineScaleSetId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineScaleSetId{} - -// VirtualMachineScaleSetId is a struct representing the Resource ID for a Virtual Machine Scale Set -type VirtualMachineScaleSetId struct { - SubscriptionId string - ResourceGroupName string - VirtualMachineScaleSetName string -} - -// NewVirtualMachineScaleSetID returns a new VirtualMachineScaleSetId struct -func NewVirtualMachineScaleSetID(subscriptionId string, resourceGroupName string, virtualMachineScaleSetName string) VirtualMachineScaleSetId { - return VirtualMachineScaleSetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualMachineScaleSetName: virtualMachineScaleSetName, - } -} - -// ParseVirtualMachineScaleSetID parses 'input' into a VirtualMachineScaleSetId -func ParseVirtualMachineScaleSetID(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineScaleSetIDInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineScaleSetIDInsensitively(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineScaleSetId) 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.VirtualMachineScaleSetName, ok = input.Parsed["virtualMachineScaleSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineScaleSetName", input) - } - - return nil -} - -// ValidateVirtualMachineScaleSetID checks that 'input' can be parsed as a Virtual Machine Scale Set ID -func ValidateVirtualMachineScaleSetID(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 := ParseVirtualMachineScaleSetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineScaleSetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), - } -} - -// String returns a human-readable description of this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), - } - return fmt.Sprintf("Virtual Machine Scale Set (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset_test.go b/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset_test.go deleted file mode 100644 index 541e8675bd0..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/id_virtualmachinescaleset_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkinterfaces - -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 = &VirtualMachineScaleSetId{} - -func TestNewVirtualMachineScaleSetID(t *testing.T) { - id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - - 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.VirtualMachineScaleSetName != "virtualMachineScaleSetValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetValue") - } -} - -func TestFormatVirtualMachineScaleSetID(t *testing.T) { - actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineScaleSetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetID(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestParseVirtualMachineScaleSetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTvAlUe", - }, - }, - { - // 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.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetIDInsensitively(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestSegmentsForVirtualMachineScaleSetId(t *testing.T) { - segments := VirtualMachineScaleSetId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineScaleSetId 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/network/2023-06-01/networkinterfaces/method_createorupdate.go b/resource-manager/network/2023-06-01/networkinterfaces/method_createorupdate.go deleted file mode 100644 index 5686c1db5f0..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package networkinterfaces - -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 *NetworkInterface -} - -// CreateOrUpdate ... -func (c NetworkInterfacesClient) CreateOrUpdate(ctx context.Context, id commonids.NetworkInterfaceId, input NetworkInterface) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkInterfacesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.NetworkInterfaceId, input NetworkInterface) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/networkinterfaces/method_delete.go b/resource-manager/network/2023-06-01/networkinterfaces/method_delete.go deleted file mode 100644 index 99f476e3fa9..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package networkinterfaces - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c NetworkInterfacesClient) Delete(ctx context.Context, id commonids.NetworkInterfaceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkInterfacesClient) DeleteThenPoll(ctx context.Context, id commonids.NetworkInterfaceId) 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/network/2023-06-01/networkinterfaces/method_get.go b/resource-manager/network/2023-06-01/networkinterfaces/method_get.go deleted file mode 100644 index 14f4f1d8a0c..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package networkinterfaces - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkInterfacesClient) Get(ctx context.Context, id commonids.NetworkInterfaceId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_getcloudservicenetworkinterface.go b/resource-manager/network/2023-06-01/networkinterfaces/method_getcloudservicenetworkinterface.go deleted file mode 100644 index b828e37133d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_getcloudservicenetworkinterface.go +++ /dev/null @@ -1,83 +0,0 @@ -package networkinterfaces - -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 GetCloudServiceNetworkInterfaceOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -type GetCloudServiceNetworkInterfaceOperationOptions struct { - Expand *string -} - -func DefaultGetCloudServiceNetworkInterfaceOperationOptions() GetCloudServiceNetworkInterfaceOperationOptions { - return GetCloudServiceNetworkInterfaceOperationOptions{} -} - -func (o GetCloudServiceNetworkInterfaceOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetCloudServiceNetworkInterfaceOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetCloudServiceNetworkInterfaceOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetCloudServiceNetworkInterface ... -func (c NetworkInterfacesClient) GetCloudServiceNetworkInterface(ctx context.Context, id RoleInstanceNetworkInterfaceId, options GetCloudServiceNetworkInterfaceOperationOptions) (result GetCloudServiceNetworkInterfaceOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_geteffectiveroutetable.go b/resource-manager/network/2023-06-01/networkinterfaces/method_geteffectiveroutetable.go deleted file mode 100644 index e64977d2735..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_geteffectiveroutetable.go +++ /dev/null @@ -1,77 +0,0 @@ -package networkinterfaces - -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 GetEffectiveRouteTableOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]EffectiveRoute -} - -type GetEffectiveRouteTableCompleteResult struct { - LatestHttpResponse *http.Response - Items []EffectiveRoute -} - -// GetEffectiveRouteTable ... -func (c NetworkInterfacesClient) GetEffectiveRouteTable(ctx context.Context, id commonids.NetworkInterfaceId) (result GetEffectiveRouteTableOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveRouteTable", 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 -} - -// GetEffectiveRouteTableThenPoll performs GetEffectiveRouteTable then polls until it's completed -func (c NetworkInterfacesClient) GetEffectiveRouteTableThenPoll(ctx context.Context, id commonids.NetworkInterfaceId) error { - result, err := c.GetEffectiveRouteTable(ctx, id) - if err != nil { - return fmt.Errorf("performing GetEffectiveRouteTable: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetEffectiveRouteTable: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go deleted file mode 100644 index c30d98304ca..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetipconfiguration.go +++ /dev/null @@ -1,84 +0,0 @@ -package networkinterfaces - -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 GetVirtualMachineScaleSetIPConfigurationOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaceIPConfiguration -} - -type GetVirtualMachineScaleSetIPConfigurationOperationOptions struct { - Expand *string -} - -func DefaultGetVirtualMachineScaleSetIPConfigurationOperationOptions() GetVirtualMachineScaleSetIPConfigurationOperationOptions { - return GetVirtualMachineScaleSetIPConfigurationOperationOptions{} -} - -func (o GetVirtualMachineScaleSetIPConfigurationOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetVirtualMachineScaleSetIPConfigurationOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetVirtualMachineScaleSetIPConfigurationOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetVirtualMachineScaleSetIPConfiguration ... -func (c NetworkInterfacesClient) GetVirtualMachineScaleSetIPConfiguration(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId, options GetVirtualMachineScaleSetIPConfigurationOperationOptions) (result GetVirtualMachineScaleSetIPConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterfaceIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go b/resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go deleted file mode 100644 index 17ffc7f419c..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_getvirtualmachinescalesetnetworkinterface.go +++ /dev/null @@ -1,84 +0,0 @@ -package networkinterfaces - -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 GetVirtualMachineScaleSetNetworkInterfaceOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -type GetVirtualMachineScaleSetNetworkInterfaceOperationOptions struct { - Expand *string -} - -func DefaultGetVirtualMachineScaleSetNetworkInterfaceOperationOptions() GetVirtualMachineScaleSetNetworkInterfaceOperationOptions { - return GetVirtualMachineScaleSetNetworkInterfaceOperationOptions{} -} - -func (o GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetVirtualMachineScaleSetNetworkInterface ... -func (c NetworkInterfacesClient) GetVirtualMachineScaleSetNetworkInterface(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options GetVirtualMachineScaleSetNetworkInterfaceOperationOptions) (result GetVirtualMachineScaleSetNetworkInterfaceOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_list.go b/resource-manager/network/2023-06-01/networkinterfaces/method_list.go deleted file mode 100644 index d3196047dfa..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 *[]NetworkInterface -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// List ... -func (c NetworkInterfacesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkInterfaces", 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 *[]NetworkInterface `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 NetworkInterfacesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkInterfaceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/networkinterfaces/method_listall.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listall.go deleted file mode 100644 index b4b4d1f8064..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListAll ... -func (c NetworkInterfacesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkInterfaceOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go deleted file mode 100644 index 7f558dee830..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listcloudservicenetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListCloudServiceNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListCloudServiceNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListCloudServiceNetworkInterfaces ... -func (c NetworkInterfacesClient) ListCloudServiceNetworkInterfaces(ctx context.Context, id ProviderCloudServiceId) (result ListCloudServiceNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListCloudServiceNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListCloudServiceNetworkInterfacesComplete(ctx context.Context, id ProviderCloudServiceId) (ListCloudServiceNetworkInterfacesCompleteResult, error) { - return c.ListCloudServiceNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListCloudServiceNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCloudServiceNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id ProviderCloudServiceId, predicate NetworkInterfaceOperationPredicate) (result ListCloudServiceNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListCloudServiceNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListCloudServiceNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go deleted file mode 100644 index d09b4050535..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listcloudserviceroleinstancenetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListCloudServiceRoleInstanceNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListCloudServiceRoleInstanceNetworkInterfaces ... -func (c NetworkInterfacesClient) ListCloudServiceRoleInstanceNetworkInterfaces(ctx context.Context, id RoleInstanceId) (result ListCloudServiceRoleInstanceNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListCloudServiceRoleInstanceNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesComplete(ctx context.Context, id RoleInstanceId) (ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult, error) { - return c.ListCloudServiceRoleInstanceNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListCloudServiceRoleInstanceNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListCloudServiceRoleInstanceNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id RoleInstanceId, predicate NetworkInterfaceOperationPredicate) (result ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListCloudServiceRoleInstanceNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListCloudServiceRoleInstanceNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go deleted file mode 100644 index 50661e67194..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listeffectivenetworksecuritygroups.go +++ /dev/null @@ -1,77 +0,0 @@ -package networkinterfaces - -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 ListEffectiveNetworkSecurityGroupsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]EffectiveNetworkSecurityGroup -} - -type ListEffectiveNetworkSecurityGroupsCompleteResult struct { - LatestHttpResponse *http.Response - Items []EffectiveNetworkSecurityGroup -} - -// ListEffectiveNetworkSecurityGroups ... -func (c NetworkInterfacesClient) ListEffectiveNetworkSecurityGroups(ctx context.Context, id commonids.NetworkInterfaceId) (result ListEffectiveNetworkSecurityGroupsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveNetworkSecurityGroups", 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 -} - -// ListEffectiveNetworkSecurityGroupsThenPoll performs ListEffectiveNetworkSecurityGroups then polls until it's completed -func (c NetworkInterfacesClient) ListEffectiveNetworkSecurityGroupsThenPoll(ctx context.Context, id commonids.NetworkInterfaceId) error { - result, err := c.ListEffectiveNetworkSecurityGroups(ctx, id) - if err != nil { - return fmt.Errorf("performing ListEffectiveNetworkSecurityGroups: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ListEffectiveNetworkSecurityGroups: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go deleted file mode 100644 index f7fac31de07..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetipconfigurations.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkinterfaces - -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 ListVirtualMachineScaleSetIPConfigurationsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaceIPConfiguration -} - -type ListVirtualMachineScaleSetIPConfigurationsCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaceIPConfiguration -} - -type ListVirtualMachineScaleSetIPConfigurationsOperationOptions struct { - Expand *string -} - -func DefaultListVirtualMachineScaleSetIPConfigurationsOperationOptions() ListVirtualMachineScaleSetIPConfigurationsOperationOptions { - return ListVirtualMachineScaleSetIPConfigurationsOperationOptions{} -} - -func (o ListVirtualMachineScaleSetIPConfigurationsOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListVirtualMachineScaleSetIPConfigurationsOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListVirtualMachineScaleSetIPConfigurationsOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// ListVirtualMachineScaleSetIPConfigurations ... -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetIPConfigurations(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options ListVirtualMachineScaleSetIPConfigurationsOperationOptions) (result ListVirtualMachineScaleSetIPConfigurationsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ipConfigurations", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkInterfaceIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListVirtualMachineScaleSetIPConfigurationsComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetIPConfigurationsComplete(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options ListVirtualMachineScaleSetIPConfigurationsOperationOptions) (ListVirtualMachineScaleSetIPConfigurationsCompleteResult, error) { - return c.ListVirtualMachineScaleSetIPConfigurationsCompleteMatchingPredicate(ctx, id, options, NetworkInterfaceIPConfigurationOperationPredicate{}) -} - -// ListVirtualMachineScaleSetIPConfigurationsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetIPConfigurationsCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualMachineScaleSetNetworkInterfaceId, options ListVirtualMachineScaleSetIPConfigurationsOperationOptions, predicate NetworkInterfaceIPConfigurationOperationPredicate) (result ListVirtualMachineScaleSetIPConfigurationsCompleteResult, err error) { - items := make([]NetworkInterfaceIPConfiguration, 0) - - resp, err := c.ListVirtualMachineScaleSetIPConfigurations(ctx, id, options) - if err != nil { - 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 = ListVirtualMachineScaleSetIPConfigurationsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go deleted file mode 100644 index 0a35fbc96ef..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetnetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListVirtualMachineScaleSetNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListVirtualMachineScaleSetNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListVirtualMachineScaleSetNetworkInterfaces ... -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetNetworkInterfaces(ctx context.Context, id VirtualMachineScaleSetId) (result ListVirtualMachineScaleSetNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListVirtualMachineScaleSetNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesComplete(ctx context.Context, id VirtualMachineScaleSetId) (ListVirtualMachineScaleSetNetworkInterfacesCompleteResult, error) { - return c.ListVirtualMachineScaleSetNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListVirtualMachineScaleSetNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id VirtualMachineScaleSetId, predicate NetworkInterfaceOperationPredicate) (result ListVirtualMachineScaleSetNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListVirtualMachineScaleSetNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListVirtualMachineScaleSetNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go b/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go deleted file mode 100644 index 9abb01f1d41..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_listvirtualmachinescalesetvmnetworkinterfaces.go +++ /dev/null @@ -1,91 +0,0 @@ -package networkinterfaces - -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 ListVirtualMachineScaleSetVMNetworkInterfacesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterface -} - -type ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterface -} - -// ListVirtualMachineScaleSetVMNetworkInterfaces ... -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfaces(ctx context.Context, id VirtualMachineId) (result ListVirtualMachineScaleSetVMNetworkInterfacesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkInterfaces", 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 *[]NetworkInterface `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesComplete(ctx context.Context, id VirtualMachineId) (ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult, error) { - return c.ListVirtualMachineScaleSetVMNetworkInterfacesCompleteMatchingPredicate(ctx, id, NetworkInterfaceOperationPredicate{}) -} - -// ListVirtualMachineScaleSetVMNetworkInterfacesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) ListVirtualMachineScaleSetVMNetworkInterfacesCompleteMatchingPredicate(ctx context.Context, id VirtualMachineId, predicate NetworkInterfaceOperationPredicate) (result ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult, err error) { - items := make([]NetworkInterface, 0) - - resp, err := c.ListVirtualMachineScaleSetVMNetworkInterfaces(ctx, id) - if err != nil { - 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 = ListVirtualMachineScaleSetVMNetworkInterfacesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go b/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go deleted file mode 100644 index 90e537d0982..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationsget.go +++ /dev/null @@ -1,55 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceIPConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaceIPConfiguration -} - -// NetworkInterfaceIPConfigurationsGet ... -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsGet(ctx context.Context, id commonids.NetworkInterfaceIPConfigurationId) (result NetworkInterfaceIPConfigurationsGetOperationResponse, 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 NetworkInterfaceIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go b/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go deleted file mode 100644 index ca6507341bd..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceipconfigurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceIPConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaceIPConfiguration -} - -type NetworkInterfaceIPConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaceIPConfiguration -} - -// NetworkInterfaceIPConfigurationsList ... -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsList(ctx context.Context, id commonids.NetworkInterfaceId) (result NetworkInterfaceIPConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ipConfigurations", 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 *[]NetworkInterfaceIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkInterfaceIPConfigurationsListComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsListComplete(ctx context.Context, id commonids.NetworkInterfaceId) (NetworkInterfaceIPConfigurationsListCompleteResult, error) { - return c.NetworkInterfaceIPConfigurationsListCompleteMatchingPredicate(ctx, id, NetworkInterfaceIPConfigurationOperationPredicate{}) -} - -// NetworkInterfaceIPConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) NetworkInterfaceIPConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.NetworkInterfaceId, predicate NetworkInterfaceIPConfigurationOperationPredicate) (result NetworkInterfaceIPConfigurationsListCompleteResult, err error) { - items := make([]NetworkInterfaceIPConfiguration, 0) - - resp, err := c.NetworkInterfaceIPConfigurationsList(ctx, id) - if err != nil { - 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 = NetworkInterfaceIPConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go b/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go deleted file mode 100644 index c79ea48c03e..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfaceloadbalancerslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceLoadBalancersListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]LoadBalancer -} - -type NetworkInterfaceLoadBalancersListCompleteResult struct { - LatestHttpResponse *http.Response - Items []LoadBalancer -} - -// NetworkInterfaceLoadBalancersList ... -func (c NetworkInterfacesClient) NetworkInterfaceLoadBalancersList(ctx context.Context, id commonids.NetworkInterfaceId) (result NetworkInterfaceLoadBalancersListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/loadBalancers", 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 *[]LoadBalancer `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkInterfaceLoadBalancersListComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) NetworkInterfaceLoadBalancersListComplete(ctx context.Context, id commonids.NetworkInterfaceId) (NetworkInterfaceLoadBalancersListCompleteResult, error) { - return c.NetworkInterfaceLoadBalancersListCompleteMatchingPredicate(ctx, id, LoadBalancerOperationPredicate{}) -} - -// NetworkInterfaceLoadBalancersListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) NetworkInterfaceLoadBalancersListCompleteMatchingPredicate(ctx context.Context, id commonids.NetworkInterfaceId, predicate LoadBalancerOperationPredicate) (result NetworkInterfaceLoadBalancersListCompleteResult, err error) { - items := make([]LoadBalancer, 0) - - resp, err := c.NetworkInterfaceLoadBalancersList(ctx, id) - if err != nil { - 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 = NetworkInterfaceLoadBalancersListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go b/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go deleted file mode 100644 index 868ecfb43d5..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceTapConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterfaceTapConfiguration -} - -// NetworkInterfaceTapConfigurationsGet ... -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsGet(ctx context.Context, id TapConfigurationId) (result NetworkInterfaceTapConfigurationsGetOperationResponse, 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 NetworkInterfaceTapConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go b/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go deleted file mode 100644 index e470acc5259..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_networkinterfacetapconfigurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkinterfaces - -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 NetworkInterfaceTapConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkInterfaceTapConfiguration -} - -type NetworkInterfaceTapConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkInterfaceTapConfiguration -} - -// NetworkInterfaceTapConfigurationsList ... -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsList(ctx context.Context, id commonids.NetworkInterfaceId) (result NetworkInterfaceTapConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/tapConfigurations", 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 *[]NetworkInterfaceTapConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkInterfaceTapConfigurationsListComplete retrieves all the results into a single object -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsListComplete(ctx context.Context, id commonids.NetworkInterfaceId) (NetworkInterfaceTapConfigurationsListCompleteResult, error) { - return c.NetworkInterfaceTapConfigurationsListCompleteMatchingPredicate(ctx, id, NetworkInterfaceTapConfigurationOperationPredicate{}) -} - -// NetworkInterfaceTapConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkInterfacesClient) NetworkInterfaceTapConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.NetworkInterfaceId, predicate NetworkInterfaceTapConfigurationOperationPredicate) (result NetworkInterfaceTapConfigurationsListCompleteResult, err error) { - items := make([]NetworkInterfaceTapConfiguration, 0) - - resp, err := c.NetworkInterfaceTapConfigurationsList(ctx, id) - if err != nil { - 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 = NetworkInterfaceTapConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/method_updatetags.go b/resource-manager/network/2023-06-01/networkinterfaces/method_updatetags.go deleted file mode 100644 index ca8e31de55a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/method_updatetags.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkinterfaces - -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 UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkInterface -} - -// UpdateTags ... -func (c NetworkInterfacesClient) UpdateTags(ctx context.Context, id commonids.NetworkInterfaceId, 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 NetworkInterface - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 126f8350b09..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 15c656ad057..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 34912a8fcbd..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 3b83d83c7c9..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index dd810dfed2c..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygroup.go deleted file mode 100644 index 2948e0c794a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index aa06b33fbe1..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspool.go b/resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspool.go deleted file mode 100644 index bd329cce127..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 7c5d918e43a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index e0be4a6b6f6..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_ddossettings.go b/resource-manager/network/2023-06-01/networkinterfaces/model_ddossettings.go deleted file mode 100644 index 4902360d689..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_delegation.go b/resource-manager/network/2023-06-01/networkinterfaces/model_delegation.go deleted file mode 100644 index 5fb9effbb1b..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroup.go b/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroup.go deleted file mode 100644 index 5c66ee3a9b5..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityGroup struct { - Association *EffectiveNetworkSecurityGroupAssociation `json:"association,omitempty"` - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - NetworkSecurityGroup *SubResource `json:"networkSecurityGroup,omitempty"` - TagMap *map[string][]string `json:"tagMap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go b/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go deleted file mode 100644 index 3c6248c32c9..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecuritygroupassociation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityGroupAssociation struct { - NetworkInterface *SubResource `json:"networkInterface,omitempty"` - NetworkManager *SubResource `json:"networkManager,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecurityrule.go b/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecurityrule.go deleted file mode 100644 index 9c9dd92e515..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_effectivenetworksecurityrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityRule struct { - Access *SecurityRuleAccess `json:"access,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction *SecurityRuleDirection `json:"direction,omitempty"` - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_effectiveroute.go b/resource-manager/network/2023-06-01/networkinterfaces/model_effectiveroute.go deleted file mode 100644 index aa9dac67810..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_effectiveroute.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRoute struct { - AddressPrefix *[]string `json:"addressPrefix,omitempty"` - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *[]string `json:"nextHopIpAddress,omitempty"` - NextHopType *RouteNextHopType `json:"nextHopType,omitempty"` - Source *EffectiveRouteSource `json:"source,omitempty"` - State *EffectiveRouteState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_flowlog.go b/resource-manager/network/2023-06-01/networkinterfaces/model_flowlog.go deleted file mode 100644 index c2f71983a36..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/networkinterfaces/model_flowlogformatparameters.go deleted file mode 100644 index 43abd6c1532..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_flowlogpropertiesformat.go deleted file mode 100644 index e594a5d3819..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfiguration.go deleted file mode 100644 index 35c07477d52..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkinterfaces - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 174b1d44662..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 8562c4824fb..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpool.go b/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpool.go deleted file mode 100644 index a16659ffff0..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go deleted file mode 100644 index 4586e6ec1dc..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatpoolpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatPoolPropertiesFormat struct { - BackendPort int64 `json:"backendPort"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPortRangeEnd int64 `json:"frontendPortRangeEnd"` - FrontendPortRangeStart int64 `json:"frontendPortRangeStart"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrule.go b/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrule.go deleted file mode 100644 index a41993b3c8d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 9a882cfef22..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfiguration.go deleted file mode 100644 index c1294125f57..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofile.go deleted file mode 100644 index b5f591fbc35..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 0027cc6adbe..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 1338f55c4e1..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_iptag.go b/resource-manager/network/2023-06-01/networkinterfaces/model_iptag.go deleted file mode 100644 index c2dc282ad0e..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// 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/network/2023-06-01/networkinterfaces/model_loadbalancer.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancer.go deleted file mode 100644 index aaa7bd9d086..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancer.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancer struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancerPropertiesFormat `json:"properties,omitempty"` - Sku *LoadBalancerSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddress.go deleted file mode 100644 index 58da623122f..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 192b497dd13..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerpropertiesformat.go deleted file mode 100644 index b0c27be8bab..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancerpropertiesformat.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerPropertiesFormat struct { - BackendAddressPools *[]BackendAddressPool `json:"backendAddressPools,omitempty"` - FrontendIPConfigurations *[]FrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - InboundNatPools *[]InboundNatPool `json:"inboundNatPools,omitempty"` - InboundNatRules *[]InboundNatRule `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]LoadBalancingRule `json:"loadBalancingRules,omitempty"` - OutboundRules *[]OutboundRule `json:"outboundRules,omitempty"` - Probes *[]Probe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancersku.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancersku.go deleted file mode 100644 index e10cf68701b..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancersku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerSku struct { - Name *LoadBalancerSkuName `json:"name,omitempty"` - Tier *LoadBalancerSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrule.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrule.go deleted file mode 100644 index 5ca9aca81f1..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *LoadBalancingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go deleted file mode 100644 index 79fe798b88d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_loadbalancingrulepropertiesformat.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendAddressPools *[]SubResource `json:"backendAddressPools,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - DisableOutboundSnat *bool `json:"disableOutboundSnat,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort int64 `json:"frontendPort"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LoadDistribution *LoadDistribution `json:"loadDistribution,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol TransportProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_natgateway.go b/resource-manager/network/2023-06-01/networkinterfaces/model_natgateway.go deleted file mode 100644 index 7fe571d7a74..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkinterfaces - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaypropertiesformat.go deleted file mode 100644 index 9da53fae58a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaysku.go b/resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaysku.go deleted file mode 100644 index aff4514b5e7..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_natruleportmapping.go b/resource-manager/network/2023-06-01/networkinterfaces/model_natruleportmapping.go deleted file mode 100644 index 05068ac7e2f..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterface.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterface.go deleted file mode 100644 index 286c9562aaf..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacednssettings.go deleted file mode 100644 index af3e4e75519..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfiguration.go deleted file mode 100644 index ca861570a5d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index abcc6fdfc5b..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 1baf3488ee0..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 3fd3da2e6e6..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfiguration.go deleted file mode 100644 index e67a81616a9..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 72010ae8dac..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygroup.go deleted file mode 100644 index 05ed91fcd1a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index ce8a013b83a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_outboundrule.go b/resource-manager/network/2023-06-01/networkinterfaces/model_outboundrule.go deleted file mode 100644 index 2afc56da4cc..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_outboundrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OutboundRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_outboundrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_outboundrulepropertiesformat.go deleted file mode 100644 index 4cc4e2f5087..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_outboundrulepropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OutboundRulePropertiesFormat struct { - AllocatedOutboundPorts *int64 `json:"allocatedOutboundPorts,omitempty"` - BackendAddressPool SubResource `json:"backendAddressPool"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfigurations []SubResource `json:"frontendIPConfigurations"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol LoadBalancerOutboundRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpoint.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpoint.go deleted file mode 100644 index da5835bccba..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnection.go deleted file mode 100644 index 81a07962195..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/networkinterfaces/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnectionproperties.go deleted file mode 100644 index eb2204732ec..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfiguration.go deleted file mode 100644 index 085039e25e2..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 802747eb32e..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointproperties.go deleted file mode 100644 index ea496b7d032..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkservice.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkservice.go deleted file mode 100644 index 7dcd5f985b9..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnection.go deleted file mode 100644 index 5e32cbfab8a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 355c3d254f2..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 367b48d2fd6..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 3893fd72b02..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index e1c0b0da64c..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceproperties.go deleted file mode 100644 index 2356695f6d1..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_probe.go b/resource-manager/network/2023-06-01/networkinterfaces/model_probe.go deleted file mode 100644 index d935d63eee6..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_probe.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Probe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_probepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_probepropertiesformat.go deleted file mode 100644 index 343b46540f7..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_probepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProbePropertiesFormat struct { - IntervalInSeconds *int64 `json:"intervalInSeconds,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - NumberOfProbes *int64 `json:"numberOfProbes,omitempty"` - Port int64 `json:"port"` - ProbeThreshold *int64 `json:"probeThreshold,omitempty"` - Protocol ProbeProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestPath *string `json:"requestPath,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddress.go b/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddress.go deleted file mode 100644 index e89fe49804b..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkinterfaces - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddressdnssettings.go deleted file mode 100644 index 9a6ffc1106a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresspropertiesformat.go deleted file mode 100644 index b13efec6d42..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresssku.go deleted file mode 100644 index 4f6513789bc..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlink.go deleted file mode 100644 index 4a3f135d98d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlinkformat.go deleted file mode 100644 index aa59d57de52..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_resourceset.go b/resource-manager/network/2023-06-01/networkinterfaces/model_resourceset.go deleted file mode 100644 index 48356d239d8..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/networkinterfaces/model_retentionpolicyparameters.go deleted file mode 100644 index fe69c5c3389..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_route.go b/resource-manager/network/2023-06-01/networkinterfaces/model_route.go deleted file mode 100644 index 8dd1c1c5cbe..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_routepropertiesformat.go deleted file mode 100644 index b031c9a871e..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_routetable.go b/resource-manager/network/2023-06-01/networkinterfaces/model_routetable.go deleted file mode 100644 index 31df96e7b73..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_routetablepropertiesformat.go deleted file mode 100644 index 3c524eb8fe1..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_securityrule.go b/resource-manager/network/2023-06-01/networkinterfaces/model_securityrule.go deleted file mode 100644 index af9210ebc2f..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_securityrulepropertiesformat.go deleted file mode 100644 index 0ff4ba975dc..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlink.go deleted file mode 100644 index 88ebd302e70..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 538945df5d3..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 8444d0d495d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicy.go deleted file mode 100644 index c77c2e3460a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 6f523978f5b..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index ddd9db6fe47..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 2692b80393d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 041498d2501..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_subnet.go b/resource-manager/network/2023-06-01/networkinterfaces/model_subnet.go deleted file mode 100644 index 47a0e306b4a..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_subnetpropertiesformat.go deleted file mode 100644 index e9d9e3404ed..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_subresource.go b/resource-manager/network/2023-06-01/networkinterfaces/model_subresource.go deleted file mode 100644 index 28fa931dbee..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_tagsobject.go b/resource-manager/network/2023-06-01/networkinterfaces/model_tagsobject.go deleted file mode 100644 index 32bf2f0b066..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// 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/network/2023-06-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index bd0b0fa5fe0..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsproperties.go deleted file mode 100644 index 302f5bfcc4d..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktap.go deleted file mode 100644 index 315bcaef069..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 90ce2721f15..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkinterfaces/predicates.go b/resource-manager/network/2023-06-01/networkinterfaces/predicates.go deleted file mode 100644 index c58ed4a328b..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/predicates.go +++ /dev/null @@ -1,152 +0,0 @@ -package networkinterfaces - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityGroupOperationPredicate struct { -} - -func (p EffectiveNetworkSecurityGroupOperationPredicate) Matches(input EffectiveNetworkSecurityGroup) bool { - - return true -} - -type EffectiveRouteOperationPredicate struct { - DisableBgpRoutePropagation *bool - Name *string -} - -func (p EffectiveRouteOperationPredicate) Matches(input EffectiveRoute) bool { - - if p.DisableBgpRoutePropagation != nil && (input.DisableBgpRoutePropagation == nil || *p.DisableBgpRoutePropagation != *input.DisableBgpRoutePropagation) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type LoadBalancerOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p LoadBalancerOperationPredicate) Matches(input LoadBalancer) 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 && (input.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 NetworkInterfaceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkInterfaceOperationPredicate) Matches(input NetworkInterface) 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 && (input.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 NetworkInterfaceIPConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkInterfaceIPConfigurationOperationPredicate) Matches(input NetworkInterfaceIPConfiguration) 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.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 NetworkInterfaceTapConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkInterfaceTapConfigurationOperationPredicate) Matches(input NetworkInterfaceTapConfiguration) 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.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/network/2023-06-01/networkinterfaces/version.go b/resource-manager/network/2023-06-01/networkinterfaces/version.go deleted file mode 100644 index 336b558f3cb..00000000000 --- a/resource-manager/network/2023-06-01/networkinterfaces/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkinterfaces - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkinterfaces/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/README.md b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/README.md deleted file mode 100644 index 0d1a2a14bd1..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanageractiveconfigurations` Documentation - -The `networkmanageractiveconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkmanageractiveconfigurations" -``` - - -### Client Initialization - -```go -client := networkmanageractiveconfigurations.NewNetworkManagerActiveConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerActiveConfigurationsClient.ListActiveSecurityAdminRules` - -```go -ctx := context.TODO() -id := networkmanageractiveconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanageractiveconfigurations.ActiveConfigurationParameter{ - // ... -} - - -read, err := client.ListActiveSecurityAdminRules(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/network/2023-06-01/networkmanageractiveconfigurations/client.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/client.go deleted file mode 100644 index fd577e53f33..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanageractiveconfigurations - -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 NetworkManagerActiveConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerActiveConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerActiveConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanageractiveconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerActiveConfigurationsClient: %+v", err) - } - - return &NetworkManagerActiveConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/constants.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/constants.go deleted file mode 100644 index e4a2b230b6e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package networkmanageractiveconfigurations - -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 AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -func PossibleValuesForAddressPrefixType() []string { - return []string{ - string(AddressPrefixTypeIPPrefix), - string(AddressPrefixTypeServiceTag), - } -} - -func (s *AddressPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAddressPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAddressPrefixType(input string) (*AddressPrefixType, error) { - vals := map[string]AddressPrefixType{ - "ipprefix": AddressPrefixTypeIPPrefix, - "servicetag": AddressPrefixTypeServiceTag, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AddressPrefixType(input) - return &out, nil -} - -type EffectiveAdminRuleKind string - -const ( - EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" - EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" -) - -func PossibleValuesForEffectiveAdminRuleKind() []string { - return []string{ - string(EffectiveAdminRuleKindCustom), - string(EffectiveAdminRuleKindDefault), - } -} - -func (s *EffectiveAdminRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveAdminRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveAdminRuleKind(input string) (*EffectiveAdminRuleKind, error) { - vals := map[string]EffectiveAdminRuleKind{ - "custom": EffectiveAdminRuleKindCustom, - "default": EffectiveAdminRuleKindDefault, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveAdminRuleKind(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -func PossibleValuesForSecurityConfigurationRuleAccess() []string { - return []string{ - string(SecurityConfigurationRuleAccessAllow), - string(SecurityConfigurationRuleAccessAlwaysAllow), - string(SecurityConfigurationRuleAccessDeny), - } -} - -func (s *SecurityConfigurationRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleAccess(input string) (*SecurityConfigurationRuleAccess, error) { - vals := map[string]SecurityConfigurationRuleAccess{ - "allow": SecurityConfigurationRuleAccessAllow, - "alwaysallow": SecurityConfigurationRuleAccessAlwaysAllow, - "deny": SecurityConfigurationRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleAccess(input) - return &out, nil -} - -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityConfigurationRuleDirection() []string { - return []string{ - string(SecurityConfigurationRuleDirectionInbound), - string(SecurityConfigurationRuleDirectionOutbound), - } -} - -func (s *SecurityConfigurationRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleDirection(input string) (*SecurityConfigurationRuleDirection, error) { - vals := map[string]SecurityConfigurationRuleDirection{ - "inbound": SecurityConfigurationRuleDirectionInbound, - "outbound": SecurityConfigurationRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleDirection(input) - return &out, nil -} - -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTcp SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUdp SecurityConfigurationRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityConfigurationRuleProtocol() []string { - return []string{ - string(SecurityConfigurationRuleProtocolAh), - string(SecurityConfigurationRuleProtocolAny), - string(SecurityConfigurationRuleProtocolEsp), - string(SecurityConfigurationRuleProtocolIcmp), - string(SecurityConfigurationRuleProtocolTcp), - string(SecurityConfigurationRuleProtocolUdp), - } -} - -func (s *SecurityConfigurationRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleProtocol(input string) (*SecurityConfigurationRuleProtocol, error) { - vals := map[string]SecurityConfigurationRuleProtocol{ - "ah": SecurityConfigurationRuleProtocolAh, - "any": SecurityConfigurationRuleProtocolAny, - "esp": SecurityConfigurationRuleProtocolEsp, - "icmp": SecurityConfigurationRuleProtocolIcmp, - "tcp": SecurityConfigurationRuleProtocolTcp, - "udp": SecurityConfigurationRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager.go deleted file mode 100644 index ee0e5e5a9c8..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkmanageractiveconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager_test.go deleted file mode 100644 index e1c6ebe2617..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkmanageractiveconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go deleted file mode 100644 index 0a882c8e731..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/method_listactivesecurityadminrules.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanageractiveconfigurations - -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 ListActiveSecurityAdminRulesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ActiveSecurityAdminRulesListResult -} - -// ListActiveSecurityAdminRules ... -func (c NetworkManagerActiveConfigurationsClient) ListActiveSecurityAdminRules(ctx context.Context, id NetworkManagerId, input ActiveConfigurationParameter) (result ListActiveSecurityAdminRulesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listActiveSecurityAdminRules", 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 ActiveSecurityAdminRulesListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go deleted file mode 100644 index c19193dfd82..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activebasesecurityadminrule.go +++ /dev/null @@ -1,61 +0,0 @@ -package networkmanageractiveconfigurations - -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 ActiveBaseSecurityAdminRule interface { -} - -// RawActiveBaseSecurityAdminRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawActiveBaseSecurityAdminRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalActiveBaseSecurityAdminRuleImplementation(input []byte) (ActiveBaseSecurityAdminRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ActiveBaseSecurityAdminRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Default") { - var out ActiveDefaultSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActiveDefaultSecurityAdminRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Custom") { - var out ActiveSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActiveSecurityAdminRule: %+v", err) - } - return out, nil - } - - out := RawActiveBaseSecurityAdminRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go deleted file mode 100644 index 309a4998c1b..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activeconfigurationparameter.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveConfigurationParameter struct { - Regions *[]string `json:"regions,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go deleted file mode 100644 index 371ee82ef8c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activedefaultsecurityadminrule.go +++ /dev/null @@ -1,63 +0,0 @@ -package networkmanageractiveconfigurations - -import ( - "encoding/json" - "fmt" - "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. - -var _ ActiveBaseSecurityAdminRule = ActiveDefaultSecurityAdminRule{} - -type ActiveDefaultSecurityAdminRule struct { - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from ActiveBaseSecurityAdminRule - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - Region *string `json:"region,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -func (o *ActiveDefaultSecurityAdminRule) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveDefaultSecurityAdminRule) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} - -var _ json.Marshaler = ActiveDefaultSecurityAdminRule{} - -func (s ActiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper ActiveDefaultSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActiveDefaultSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActiveDefaultSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Default" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActiveDefaultSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go deleted file mode 100644 index 70266c6ff7c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminrule.go +++ /dev/null @@ -1,63 +0,0 @@ -package networkmanageractiveconfigurations - -import ( - "encoding/json" - "fmt" - "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. - -var _ ActiveBaseSecurityAdminRule = ActiveSecurityAdminRule{} - -type ActiveSecurityAdminRule struct { - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from ActiveBaseSecurityAdminRule - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - Region *string `json:"region,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -func (o *ActiveSecurityAdminRule) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveSecurityAdminRule) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} - -var _ json.Marshaler = ActiveSecurityAdminRule{} - -func (s ActiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper ActiveSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActiveSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActiveSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Custom" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActiveSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go deleted file mode 100644 index c9007f5e0f3..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_activesecurityadminruleslistresult.go +++ /dev/null @@ -1,49 +0,0 @@ -package networkmanageractiveconfigurations - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveSecurityAdminRulesListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]ActiveBaseSecurityAdminRule `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &ActiveSecurityAdminRulesListResult{} - -func (s *ActiveSecurityAdminRulesListResult) UnmarshalJSON(bytes []byte) error { - type alias ActiveSecurityAdminRulesListResult - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into ActiveSecurityAdminRulesListResult: %+v", err) - } - - s.SkipToken = decoded.SkipToken - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling ActiveSecurityAdminRulesListResult into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]ActiveBaseSecurityAdminRule, 0) - for i, val := range listTemp { - impl, err := unmarshalActiveBaseSecurityAdminRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'ActiveSecurityAdminRulesListResult': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_addressprefixitem.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_addressprefixitem.go deleted file mode 100644 index f82ae16f590..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_addressprefixitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressPrefixItem struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go deleted file mode 100644 index afc108f8ff4..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_configurationgroup.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_configurationgroup.go deleted file mode 100644 index be051a18f2d..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go deleted file mode 100644 index 665a643ae5e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkgroupproperties.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkgroupproperties.go deleted file mode 100644 index ed891dc195e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go deleted file mode 100644 index 6457c3d0001..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/model_networkmanagersecuritygroupitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanageractiveconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerSecurityGroupItem struct { - NetworkGroupId string `json:"networkGroupId"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/version.go b/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/version.go deleted file mode 100644 index b54907d7c8b..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanageractiveconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/README.md b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/README.md deleted file mode 100644 index 55a3a40d0b6..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations` Documentation - -The `networkmanageractiveconnectivityconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkmanageractiveconnectivityconfigurations" -``` - - -### Client Initialization - -```go -client := networkmanageractiveconnectivityconfigurations.NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerActiveConnectivityConfigurationsClient.ListActiveConnectivityConfigurations` - -```go -ctx := context.TODO() -id := networkmanageractiveconnectivityconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanageractiveconnectivityconfigurations.ActiveConfigurationParameter{ - // ... -} - - -read, err := client.ListActiveConnectivityConfigurations(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/network/2023-06-01/networkmanageractiveconnectivityconfigurations/client.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/client.go deleted file mode 100644 index 25282a2bad5..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 NetworkManagerActiveConnectivityConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerActiveConnectivityConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerActiveConnectivityConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanageractiveconnectivityconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerActiveConnectivityConfigurationsClient: %+v", err) - } - - return &NetworkManagerActiveConnectivityConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/constants.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/constants.go deleted file mode 100644 index ce9e85b744a..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/constants.go +++ /dev/null @@ -1,262 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -func PossibleValuesForConnectivityTopology() []string { - return []string{ - string(ConnectivityTopologyHubAndSpoke), - string(ConnectivityTopologyMesh), - } -} - -func (s *ConnectivityTopology) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityTopology(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityTopology(input string) (*ConnectivityTopology, error) { - vals := map[string]ConnectivityTopology{ - "hubandspoke": ConnectivityTopologyHubAndSpoke, - "mesh": ConnectivityTopologyMesh, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityTopology(input) - return &out, nil -} - -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -func PossibleValuesForDeleteExistingPeering() []string { - return []string{ - string(DeleteExistingPeeringFalse), - string(DeleteExistingPeeringTrue), - } -} - -func (s *DeleteExistingPeering) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteExistingPeering(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteExistingPeering(input string) (*DeleteExistingPeering, error) { - vals := map[string]DeleteExistingPeering{ - "false": DeleteExistingPeeringFalse, - "true": DeleteExistingPeeringTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteExistingPeering(input) - return &out, nil -} - -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -func PossibleValuesForGroupConnectivity() []string { - return []string{ - string(GroupConnectivityDirectlyConnected), - string(GroupConnectivityNone), - } -} - -func (s *GroupConnectivity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGroupConnectivity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGroupConnectivity(input string) (*GroupConnectivity, error) { - vals := map[string]GroupConnectivity{ - "directlyconnected": GroupConnectivityDirectlyConnected, - "none": GroupConnectivityNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GroupConnectivity(input) - return &out, nil -} - -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -func PossibleValuesForIsGlobal() []string { - return []string{ - string(IsGlobalFalse), - string(IsGlobalTrue), - } -} - -func (s *IsGlobal) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsGlobal(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsGlobal(input string) (*IsGlobal, error) { - vals := map[string]IsGlobal{ - "false": IsGlobalFalse, - "true": IsGlobalTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsGlobal(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -func PossibleValuesForUseHubGateway() []string { - return []string{ - string(UseHubGatewayFalse), - string(UseHubGatewayTrue), - } -} - -func (s *UseHubGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUseHubGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUseHubGateway(input string) (*UseHubGateway, error) { - vals := map[string]UseHubGateway{ - "false": UseHubGatewayFalse, - "true": UseHubGatewayTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UseHubGateway(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go deleted file mode 100644 index 4b1919fa120..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go deleted file mode 100644 index ba44a76acbb..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go deleted file mode 100644 index a4c1e51550d..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/method_listactiveconnectivityconfigurations.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 ListActiveConnectivityConfigurationsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ActiveConnectivityConfigurationsListResult -} - -// ListActiveConnectivityConfigurations ... -func (c NetworkManagerActiveConnectivityConfigurationsClient) ListActiveConnectivityConfigurations(ctx context.Context, id NetworkManagerId, input ActiveConfigurationParameter) (result ListActiveConnectivityConfigurationsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listActiveConnectivityConfigurations", 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 ActiveConnectivityConfigurationsListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go deleted file mode 100644 index 835513d64ee..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconfigurationparameter.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveConfigurationParameter struct { - Regions *[]string `json:"regions,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go deleted file mode 100644 index b836614744d..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfiguration.go +++ /dev/null @@ -1,30 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -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 ActiveConnectivityConfiguration struct { - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` - Id *string `json:"id,omitempty"` - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` - Region *string `json:"region,omitempty"` -} - -func (o *ActiveConnectivityConfiguration) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActiveConnectivityConfiguration) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go deleted file mode 100644 index 6fbfafeb4f7..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_activeconnectivityconfigurationslistresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActiveConnectivityConfigurationsListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]ActiveConnectivityConfiguration `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go deleted file mode 100644 index 2f7ac6eb77f..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go deleted file mode 100644 index 07a3c4a945c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go deleted file mode 100644 index 18571eaa75f..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_connectivitygroupitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityGroupItem struct { - GroupConnectivity GroupConnectivity `json:"groupConnectivity"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - NetworkGroupId string `json:"networkGroupId"` - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_hub.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_hub.go deleted file mode 100644 index 6d2eef46795..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_hub.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Hub struct { - ResourceId *string `json:"resourceId,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go deleted file mode 100644 index 46f87e5058e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/version.go b/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/version.go deleted file mode 100644 index 092076a4425..00000000000 --- a/resource-manager/network/2023-06-01/networkmanageractiveconnectivityconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanageractiveconnectivityconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanageractiveconnectivityconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/README.md b/resource-manager/network/2023-06-01/networkmanagerconnections/README.md deleted file mode 100644 index ed945710fb2..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/README.md +++ /dev/null @@ -1,161 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagerconnections` Documentation - -The `networkmanagerconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkmanagerconnections" -``` - - -### Client Initialization - -```go -client := networkmanagerconnections.NewNetworkManagerConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -payload := networkmanagerconnections.NetworkManagerConnection{ - // ... -} - - -read, err := client.ManagementGroupNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsDelete` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -read, err := client.ManagementGroupNetworkManagerConnectionsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsGet` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - -read, err := client.ManagementGroupNetworkManagerConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.ManagementGroupNetworkManagerConnectionsList` - -```go -ctx := context.TODO() -id := commonids.NewManagementGroupID("groupIdValue") - -// alternatively `client.ManagementGroupNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination -items, err := client.ManagementGroupNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultManagementGroupNetworkManagerConnectionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -payload := networkmanagerconnections.NetworkManagerConnection{ - // ... -} - - -read, err := client.SubscriptionNetworkManagerConnectionsCreateOrUpdate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsDelete` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -read, err := client.SubscriptionNetworkManagerConnectionsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsGet` - -```go -ctx := context.TODO() -id := networkmanagerconnections.NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - -read, err := client.SubscriptionNetworkManagerConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagerConnectionsClient.SubscriptionNetworkManagerConnectionsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.SubscriptionNetworkManagerConnectionsList(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions())` can be used to do batched pagination -items, err := client.SubscriptionNetworkManagerConnectionsListComplete(ctx, id, networkmanagerconnections.DefaultSubscriptionNetworkManagerConnectionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/client.go b/resource-manager/network/2023-06-01/networkmanagerconnections/client.go deleted file mode 100644 index 3cfa72a376e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagerconnections - -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 NetworkManagerConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagerconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerConnectionsClient: %+v", err) - } - - return &NetworkManagerConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/constants.go b/resource-manager/network/2023-06-01/networkmanagerconnections/constants.go deleted file mode 100644 index 47d6adfd207..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package networkmanagerconnections - -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 ScopeConnectionState string - -const ( - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" - ScopeConnectionStateConnected ScopeConnectionState = "Connected" - ScopeConnectionStatePending ScopeConnectionState = "Pending" - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" -) - -func PossibleValuesForScopeConnectionState() []string { - return []string{ - string(ScopeConnectionStateConflict), - string(ScopeConnectionStateConnected), - string(ScopeConnectionStatePending), - string(ScopeConnectionStateRejected), - string(ScopeConnectionStateRevoked), - } -} - -func (s *ScopeConnectionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScopeConnectionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScopeConnectionState(input string) (*ScopeConnectionState, error) { - vals := map[string]ScopeConnectionState{ - "conflict": ScopeConnectionStateConflict, - "connected": ScopeConnectionStateConnected, - "pending": ScopeConnectionStatePending, - "rejected": ScopeConnectionStateRejected, - "revoked": ScopeConnectionStateRevoked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScopeConnectionState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection.go b/resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection.go deleted file mode 100644 index 066e316e2cb..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection.go +++ /dev/null @@ -1,121 +0,0 @@ -package networkmanagerconnections - -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(&NetworkManagerConnectionId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerConnectionId{} - -// NetworkManagerConnectionId is a struct representing the Resource ID for a Network Manager Connection -type NetworkManagerConnectionId struct { - SubscriptionId string - NetworkManagerConnectionName string -} - -// NewNetworkManagerConnectionID returns a new NetworkManagerConnectionId struct -func NewNetworkManagerConnectionID(subscriptionId string, networkManagerConnectionName string) NetworkManagerConnectionId { - return NetworkManagerConnectionId{ - SubscriptionId: subscriptionId, - NetworkManagerConnectionName: networkManagerConnectionName, - } -} - -// ParseNetworkManagerConnectionID parses 'input' into a NetworkManagerConnectionId -func ParseNetworkManagerConnectionID(input string) (*NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerConnectionIDInsensitively parses 'input' case-insensitively into a NetworkManagerConnectionId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerConnectionIDInsensitively(input string) (*NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerConnectionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.NetworkManagerConnectionName, ok = input.Parsed["networkManagerConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerConnectionName", input) - } - - return nil -} - -// ValidateNetworkManagerConnectionID checks that 'input' can be parsed as a Network Manager Connection ID -func ValidateNetworkManagerConnectionID(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 := ParseNetworkManagerConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager Connection ID -func (id NetworkManagerConnectionId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/networkManagerConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.NetworkManagerConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager Connection ID -func (id NetworkManagerConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagerConnections", "networkManagerConnections", "networkManagerConnections"), - resourceids.UserSpecifiedSegment("networkManagerConnectionName", "networkManagerConnectionValue"), - } -} - -// String returns a human-readable description of this Network Manager Connection ID -func (id NetworkManagerConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Network Manager Connection Name: %q", id.NetworkManagerConnectionName), - } - return fmt.Sprintf("Network Manager Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection_test.go b/resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection_test.go deleted file mode 100644 index acb385214fd..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/id_networkmanagerconnection_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package networkmanagerconnections - -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 = &NetworkManagerConnectionId{} - -func TestNewNetworkManagerConnectionID(t *testing.T) { - id := NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue") - - 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.NetworkManagerConnectionName != "networkManagerConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerConnectionName'", id.NetworkManagerConnectionName, "networkManagerConnectionValue") - } -} - -func TestFormatNetworkManagerConnectionID(t *testing.T) { - actual := NewNetworkManagerConnectionID("12345678-1234-9876-4563-123456789012", "networkManagerConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &NetworkManagerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerConnectionID(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.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestParseNetworkManagerConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &NetworkManagerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - Expected: &NetworkManagerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkManagerConnectionName: "nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerConnectionIDInsensitively(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.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestSegmentsForNetworkManagerConnectionId(t *testing.T) { - segments := NetworkManagerConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerConnectionId 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/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection.go b/resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection.go deleted file mode 100644 index 81d73abef15..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection.go +++ /dev/null @@ -1,123 +0,0 @@ -package networkmanagerconnections - -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(&Providers2NetworkManagerConnectionId{}) -} - -var _ resourceids.ResourceId = &Providers2NetworkManagerConnectionId{} - -// Providers2NetworkManagerConnectionId is a struct representing the Resource ID for a Providers 2 Network Manager Connection -type Providers2NetworkManagerConnectionId struct { - ManagementGroupId string - NetworkManagerConnectionName string -} - -// NewProviders2NetworkManagerConnectionID returns a new Providers2NetworkManagerConnectionId struct -func NewProviders2NetworkManagerConnectionID(managementGroupId string, networkManagerConnectionName string) Providers2NetworkManagerConnectionId { - return Providers2NetworkManagerConnectionId{ - ManagementGroupId: managementGroupId, - NetworkManagerConnectionName: networkManagerConnectionName, - } -} - -// ParseProviders2NetworkManagerConnectionID parses 'input' into a Providers2NetworkManagerConnectionId -func ParseProviders2NetworkManagerConnectionID(input string) (*Providers2NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&Providers2NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := Providers2NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviders2NetworkManagerConnectionIDInsensitively parses 'input' case-insensitively into a Providers2NetworkManagerConnectionId -// note: this method should only be used for API response data and not user input -func ParseProviders2NetworkManagerConnectionIDInsensitively(input string) (*Providers2NetworkManagerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&Providers2NetworkManagerConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := Providers2NetworkManagerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *Providers2NetworkManagerConnectionId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.ManagementGroupId, ok = input.Parsed["managementGroupId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "managementGroupId", input) - } - - if id.NetworkManagerConnectionName, ok = input.Parsed["networkManagerConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerConnectionName", input) - } - - return nil -} - -// ValidateProviders2NetworkManagerConnectionID checks that 'input' can be parsed as a Providers 2 Network Manager Connection ID -func ValidateProviders2NetworkManagerConnectionID(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 := ParseProviders2NetworkManagerConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Providers 2 Network Manager Connection ID -func (id Providers2NetworkManagerConnectionId) ID() string { - fmtString := "/providers/Microsoft.Management/managementGroups/%s/providers/Microsoft.Network/networkManagerConnections/%s" - return fmt.Sprintf(fmtString, id.ManagementGroupId, id.NetworkManagerConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Providers 2 Network Manager Connection ID -func (id Providers2NetworkManagerConnectionId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftManagement", "Microsoft.Management", "Microsoft.Management"), - resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), - resourceids.UserSpecifiedSegment("managementGroupId", "managementGroupIdValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagerConnections", "networkManagerConnections", "networkManagerConnections"), - resourceids.UserSpecifiedSegment("networkManagerConnectionName", "networkManagerConnectionValue"), - } -} - -// String returns a human-readable description of this Providers 2 Network Manager Connection ID -func (id Providers2NetworkManagerConnectionId) String() string { - components := []string{ - fmt.Sprintf("Management Group: %q", id.ManagementGroupId), - fmt.Sprintf("Network Manager Connection Name: %q", id.NetworkManagerConnectionName), - } - return fmt.Sprintf("Providers 2 Network Manager Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go b/resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go deleted file mode 100644 index 0ee86660877..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/id_providers2networkmanagerconnection_test.go +++ /dev/null @@ -1,267 +0,0 @@ -package networkmanagerconnections - -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 = &Providers2NetworkManagerConnectionId{} - -func TestNewProviders2NetworkManagerConnectionID(t *testing.T) { - id := NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue") - - if id.ManagementGroupId != "managementGroupIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ManagementGroupId'", id.ManagementGroupId, "managementGroupIdValue") - } - - if id.NetworkManagerConnectionName != "networkManagerConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerConnectionName'", id.NetworkManagerConnectionName, "networkManagerConnectionValue") - } -} - -func TestFormatProviders2NetworkManagerConnectionID(t *testing.T) { - actual := NewProviders2NetworkManagerConnectionID("managementGroupIdValue", "networkManagerConnectionValue").ID() - expected := "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviders2NetworkManagerConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *Providers2NetworkManagerConnectionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &Providers2NetworkManagerConnectionId{ - ManagementGroupId: "managementGroupIdValue", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviders2NetworkManagerConnectionID(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.ManagementGroupId != v.Expected.ManagementGroupId { - t.Fatalf("Expected %q but got %q for ManagementGroupId", v.Expected.ManagementGroupId, actual.ManagementGroupId) - } - - if actual.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestParseProviders2NetworkManagerConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *Providers2NetworkManagerConnectionId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue", - Expected: &Providers2NetworkManagerConnectionId{ - ManagementGroupId: "managementGroupIdValue", - NetworkManagerConnectionName: "networkManagerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Network/networkManagerConnections/networkManagerConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - Expected: &Providers2NetworkManagerConnectionId{ - ManagementGroupId: "mAnAgEmEnTgRoUpIdVaLuE", - NetworkManagerConnectionName: "nEtWoRkMaNaGeRcOnNeCtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRcOnNeCtIoNs/nEtWoRkMaNaGeRcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviders2NetworkManagerConnectionIDInsensitively(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.ManagementGroupId != v.Expected.ManagementGroupId { - t.Fatalf("Expected %q but got %q for ManagementGroupId", v.Expected.ManagementGroupId, actual.ManagementGroupId) - } - - if actual.NetworkManagerConnectionName != v.Expected.NetworkManagerConnectionName { - t.Fatalf("Expected %q but got %q for NetworkManagerConnectionName", v.Expected.NetworkManagerConnectionName, actual.NetworkManagerConnectionName) - } - - } -} - -func TestSegmentsForProviders2NetworkManagerConnectionId(t *testing.T) { - segments := Providers2NetworkManagerConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("Providers2NetworkManagerConnectionId 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/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go deleted file mode 100644 index cddf4364027..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionscreateorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// ManagementGroupNetworkManagerConnectionsCreateOrUpdate ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsCreateOrUpdate(ctx context.Context, id Providers2NetworkManagerConnectionId, input NetworkManagerConnection) (result ManagementGroupNetworkManagerConnectionsCreateOrUpdateOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go deleted file mode 100644 index 83c0e93f95b..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// ManagementGroupNetworkManagerConnectionsDelete ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsDelete(ctx context.Context, id Providers2NetworkManagerConnectionId) (result ManagementGroupNetworkManagerConnectionsDeleteOperationResponse, 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/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go deleted file mode 100644 index 9e0447e4aea..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// ManagementGroupNetworkManagerConnectionsGet ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsGet(ctx context.Context, id Providers2NetworkManagerConnectionId) (result ManagementGroupNetworkManagerConnectionsGetOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go deleted file mode 100644 index fac033855a5..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_managementgroupnetworkmanagerconnectionslist.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagerconnections - -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 ManagementGroupNetworkManagerConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkManagerConnection -} - -type ManagementGroupNetworkManagerConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManagerConnection -} - -type ManagementGroupNetworkManagerConnectionsListOperationOptions struct { - Top *int64 -} - -func DefaultManagementGroupNetworkManagerConnectionsListOperationOptions() ManagementGroupNetworkManagerConnectionsListOperationOptions { - return ManagementGroupNetworkManagerConnectionsListOperationOptions{} -} - -func (o ManagementGroupNetworkManagerConnectionsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ManagementGroupNetworkManagerConnectionsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ManagementGroupNetworkManagerConnectionsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// ManagementGroupNetworkManagerConnectionsList ... -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsList(ctx context.Context, id commonids.ManagementGroupId, options ManagementGroupNetworkManagerConnectionsListOperationOptions) (result ManagementGroupNetworkManagerConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagerConnections", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManagerConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ManagementGroupNetworkManagerConnectionsListComplete retrieves all the results into a single object -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsListComplete(ctx context.Context, id commonids.ManagementGroupId, options ManagementGroupNetworkManagerConnectionsListOperationOptions) (ManagementGroupNetworkManagerConnectionsListCompleteResult, error) { - return c.ManagementGroupNetworkManagerConnectionsListCompleteMatchingPredicate(ctx, id, options, NetworkManagerConnectionOperationPredicate{}) -} - -// ManagementGroupNetworkManagerConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagerConnectionsClient) ManagementGroupNetworkManagerConnectionsListCompleteMatchingPredicate(ctx context.Context, id commonids.ManagementGroupId, options ManagementGroupNetworkManagerConnectionsListOperationOptions, predicate NetworkManagerConnectionOperationPredicate) (result ManagementGroupNetworkManagerConnectionsListCompleteResult, err error) { - items := make([]NetworkManagerConnection, 0) - - resp, err := c.ManagementGroupNetworkManagerConnectionsList(ctx, id, options) - if err != nil { - 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 = ManagementGroupNetworkManagerConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go deleted file mode 100644 index 4447d41cf06..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionscreateorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsCreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// SubscriptionNetworkManagerConnectionsCreateOrUpdate ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsCreateOrUpdate(ctx context.Context, id NetworkManagerConnectionId, input NetworkManagerConnection) (result SubscriptionNetworkManagerConnectionsCreateOrUpdateOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go deleted file mode 100644 index 43ebf8bb5e4..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// SubscriptionNetworkManagerConnectionsDelete ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsDelete(ctx context.Context, id NetworkManagerConnectionId) (result SubscriptionNetworkManagerConnectionsDeleteOperationResponse, 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/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go deleted file mode 100644 index 5f0b27a080c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerConnection -} - -// SubscriptionNetworkManagerConnectionsGet ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsGet(ctx context.Context, id NetworkManagerConnectionId) (result SubscriptionNetworkManagerConnectionsGetOperationResponse, 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 NetworkManagerConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go b/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go deleted file mode 100644 index ab6843bb734..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/method_subscriptionnetworkmanagerconnectionslist.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagerconnections - -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 SubscriptionNetworkManagerConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkManagerConnection -} - -type SubscriptionNetworkManagerConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManagerConnection -} - -type SubscriptionNetworkManagerConnectionsListOperationOptions struct { - Top *int64 -} - -func DefaultSubscriptionNetworkManagerConnectionsListOperationOptions() SubscriptionNetworkManagerConnectionsListOperationOptions { - return SubscriptionNetworkManagerConnectionsListOperationOptions{} -} - -func (o SubscriptionNetworkManagerConnectionsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o SubscriptionNetworkManagerConnectionsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o SubscriptionNetworkManagerConnectionsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// SubscriptionNetworkManagerConnectionsList ... -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsList(ctx context.Context, id commonids.SubscriptionId, options SubscriptionNetworkManagerConnectionsListOperationOptions) (result SubscriptionNetworkManagerConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagerConnections", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManagerConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SubscriptionNetworkManagerConnectionsListComplete retrieves all the results into a single object -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsListComplete(ctx context.Context, id commonids.SubscriptionId, options SubscriptionNetworkManagerConnectionsListOperationOptions) (SubscriptionNetworkManagerConnectionsListCompleteResult, error) { - return c.SubscriptionNetworkManagerConnectionsListCompleteMatchingPredicate(ctx, id, options, NetworkManagerConnectionOperationPredicate{}) -} - -// SubscriptionNetworkManagerConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagerConnectionsClient) SubscriptionNetworkManagerConnectionsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options SubscriptionNetworkManagerConnectionsListOperationOptions, predicate NetworkManagerConnectionOperationPredicate) (result SubscriptionNetworkManagerConnectionsListCompleteResult, err error) { - items := make([]NetworkManagerConnection, 0) - - resp, err := c.SubscriptionNetworkManagerConnectionsList(ctx, id, options) - if err != nil { - 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 = SubscriptionNetworkManagerConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnection.go b/resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnection.go deleted file mode 100644 index a7548b73699..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnection.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkmanagerconnections - -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 NetworkManagerConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkManagerConnectionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go b/resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go deleted file mode 100644 index faec43c2f30..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/model_networkmanagerconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagerconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerConnectionProperties struct { - ConnectionState *ScopeConnectionState `json:"connectionState,omitempty"` - Description *string `json:"description,omitempty"` - NetworkManagerId *string `json:"networkManagerId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagerconnections/predicates.go b/resource-manager/network/2023-06-01/networkmanagerconnections/predicates.go deleted file mode 100644 index 145b7b7261a..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package networkmanagerconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p NetworkManagerConnectionOperationPredicate) Matches(input NetworkManagerConnection) 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.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/network/2023-06-01/networkmanagerconnections/version.go b/resource-manager/network/2023-06-01/networkmanagerconnections/version.go deleted file mode 100644 index 1299e816821..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagerconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagerconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagerconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/README.md b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/README.md deleted file mode 100644 index febaa94046c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration` Documentation - -The `networkmanagereffectiveconnectivityconfiguration` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration" -``` - - -### Client Initialization - -```go -client := networkmanagereffectiveconnectivityconfiguration.NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerEffectiveConnectivityConfigurationClient.ListNetworkManagerEffectiveConnectivityConfigurations` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := networkmanagereffectiveconnectivityconfiguration.QueryRequestOptions{ - // ... -} - - -read, err := client.ListNetworkManagerEffectiveConnectivityConfigurations(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/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/client.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/client.go deleted file mode 100644 index 2f234ee82ef..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -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 NetworkManagerEffectiveConnectivityConfigurationClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerEffectiveConnectivityConfigurationClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerEffectiveConnectivityConfigurationClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagereffectiveconnectivityconfiguration", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerEffectiveConnectivityConfigurationClient: %+v", err) - } - - return &NetworkManagerEffectiveConnectivityConfigurationClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/constants.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/constants.go deleted file mode 100644 index 06b5b5629ff..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/constants.go +++ /dev/null @@ -1,262 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -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 ConnectivityTopology string - -const ( - ConnectivityTopologyHubAndSpoke ConnectivityTopology = "HubAndSpoke" - ConnectivityTopologyMesh ConnectivityTopology = "Mesh" -) - -func PossibleValuesForConnectivityTopology() []string { - return []string{ - string(ConnectivityTopologyHubAndSpoke), - string(ConnectivityTopologyMesh), - } -} - -func (s *ConnectivityTopology) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityTopology(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityTopology(input string) (*ConnectivityTopology, error) { - vals := map[string]ConnectivityTopology{ - "hubandspoke": ConnectivityTopologyHubAndSpoke, - "mesh": ConnectivityTopologyMesh, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityTopology(input) - return &out, nil -} - -type DeleteExistingPeering string - -const ( - DeleteExistingPeeringFalse DeleteExistingPeering = "False" - DeleteExistingPeeringTrue DeleteExistingPeering = "True" -) - -func PossibleValuesForDeleteExistingPeering() []string { - return []string{ - string(DeleteExistingPeeringFalse), - string(DeleteExistingPeeringTrue), - } -} - -func (s *DeleteExistingPeering) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteExistingPeering(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteExistingPeering(input string) (*DeleteExistingPeering, error) { - vals := map[string]DeleteExistingPeering{ - "false": DeleteExistingPeeringFalse, - "true": DeleteExistingPeeringTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteExistingPeering(input) - return &out, nil -} - -type GroupConnectivity string - -const ( - GroupConnectivityDirectlyConnected GroupConnectivity = "DirectlyConnected" - GroupConnectivityNone GroupConnectivity = "None" -) - -func PossibleValuesForGroupConnectivity() []string { - return []string{ - string(GroupConnectivityDirectlyConnected), - string(GroupConnectivityNone), - } -} - -func (s *GroupConnectivity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGroupConnectivity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGroupConnectivity(input string) (*GroupConnectivity, error) { - vals := map[string]GroupConnectivity{ - "directlyconnected": GroupConnectivityDirectlyConnected, - "none": GroupConnectivityNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GroupConnectivity(input) - return &out, nil -} - -type IsGlobal string - -const ( - IsGlobalFalse IsGlobal = "False" - IsGlobalTrue IsGlobal = "True" -) - -func PossibleValuesForIsGlobal() []string { - return []string{ - string(IsGlobalFalse), - string(IsGlobalTrue), - } -} - -func (s *IsGlobal) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsGlobal(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsGlobal(input string) (*IsGlobal, error) { - vals := map[string]IsGlobal{ - "false": IsGlobalFalse, - "true": IsGlobalTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsGlobal(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type UseHubGateway string - -const ( - UseHubGatewayFalse UseHubGateway = "False" - UseHubGatewayTrue UseHubGateway = "True" -) - -func PossibleValuesForUseHubGateway() []string { - return []string{ - string(UseHubGatewayFalse), - string(UseHubGatewayTrue), - } -} - -func (s *UseHubGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUseHubGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUseHubGateway(input string) (*UseHubGateway, error) { - vals := map[string]UseHubGateway{ - "false": UseHubGatewayFalse, - "true": UseHubGatewayTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UseHubGateway(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go deleted file mode 100644 index d752edf32eb..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/method_listnetworkmanagereffectiveconnectivityconfigurations.go +++ /dev/null @@ -1,60 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -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 ListNetworkManagerEffectiveConnectivityConfigurationsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerEffectiveConnectivityConfigurationListResult -} - -// ListNetworkManagerEffectiveConnectivityConfigurations ... -func (c NetworkManagerEffectiveConnectivityConfigurationClient) ListNetworkManagerEffectiveConnectivityConfigurations(ctx context.Context, id commonids.VirtualNetworkId, input QueryRequestOptions) (result ListNetworkManagerEffectiveConnectivityConfigurationsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listNetworkManagerEffectiveConnectivityConfigurations", 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 NetworkManagerEffectiveConnectivityConfigurationListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go deleted file mode 100644 index 219b2fe208e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go deleted file mode 100644 index 04f8fd3c40e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivityconfigurationproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityConfigurationProperties struct { - AppliesToGroups []ConnectivityGroupItem `json:"appliesToGroups"` - ConnectivityTopology ConnectivityTopology `json:"connectivityTopology"` - DeleteExistingPeering *DeleteExistingPeering `json:"deleteExistingPeering,omitempty"` - Description *string `json:"description,omitempty"` - Hubs *[]Hub `json:"hubs,omitempty"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go deleted file mode 100644 index d034adb388c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_connectivitygroupitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityGroupItem struct { - GroupConnectivity GroupConnectivity `json:"groupConnectivity"` - IsGlobal *IsGlobal `json:"isGlobal,omitempty"` - NetworkGroupId string `json:"networkGroupId"` - UseHubGateway *UseHubGateway `json:"useHubGateway,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go deleted file mode 100644 index ace2b882974..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_effectiveconnectivityconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveConnectivityConfiguration struct { - ConfigurationGroups *[]ConfigurationGroup `json:"configurationGroups,omitempty"` - Id *string `json:"id,omitempty"` - Properties *ConnectivityConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go deleted file mode 100644 index 5564a1b1595..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_hub.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Hub struct { - ResourceId *string `json:"resourceId,omitempty"` - ResourceType *string `json:"resourceType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go deleted file mode 100644 index ae331bfec1d..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go deleted file mode 100644 index 566b11872ea..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_networkmanagereffectiveconnectivityconfigurationlistresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerEffectiveConnectivityConfigurationListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]EffectiveConnectivityConfiguration `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go deleted file mode 100644 index b861fc62fb3..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/model_queryrequestoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryRequestOptions struct { - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/version.go b/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/version.go deleted file mode 100644 index edf604b60d2..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectiveconnectivityconfiguration/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagereffectiveconnectivityconfiguration - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectiveconnectivityconfiguration/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/README.md b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/README.md deleted file mode 100644 index a4691d6627a..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules` Documentation - -The `networkmanagereffectivesecurityadminrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkmanagereffectivesecurityadminrules" -``` - - -### Client Initialization - -```go -client := networkmanagereffectivesecurityadminrules.NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagerEffectiveSecurityAdminRulesClient.ListNetworkManagerEffectiveSecurityAdminRules` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := networkmanagereffectivesecurityadminrules.QueryRequestOptions{ - // ... -} - - -read, err := client.ListNetworkManagerEffectiveSecurityAdminRules(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/network/2023-06-01/networkmanagereffectivesecurityadminrules/client.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/client.go deleted file mode 100644 index c83126c132c..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 NetworkManagerEffectiveSecurityAdminRulesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagerEffectiveSecurityAdminRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagerEffectiveSecurityAdminRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagereffectivesecurityadminrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagerEffectiveSecurityAdminRulesClient: %+v", err) - } - - return &NetworkManagerEffectiveSecurityAdminRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/constants.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/constants.go deleted file mode 100644 index 280bd1bc97d..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/constants.go +++ /dev/null @@ -1,277 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 AddressPrefixType string - -const ( - AddressPrefixTypeIPPrefix AddressPrefixType = "IPPrefix" - AddressPrefixTypeServiceTag AddressPrefixType = "ServiceTag" -) - -func PossibleValuesForAddressPrefixType() []string { - return []string{ - string(AddressPrefixTypeIPPrefix), - string(AddressPrefixTypeServiceTag), - } -} - -func (s *AddressPrefixType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAddressPrefixType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAddressPrefixType(input string) (*AddressPrefixType, error) { - vals := map[string]AddressPrefixType{ - "ipprefix": AddressPrefixTypeIPPrefix, - "servicetag": AddressPrefixTypeServiceTag, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AddressPrefixType(input) - return &out, nil -} - -type EffectiveAdminRuleKind string - -const ( - EffectiveAdminRuleKindCustom EffectiveAdminRuleKind = "Custom" - EffectiveAdminRuleKindDefault EffectiveAdminRuleKind = "Default" -) - -func PossibleValuesForEffectiveAdminRuleKind() []string { - return []string{ - string(EffectiveAdminRuleKindCustom), - string(EffectiveAdminRuleKindDefault), - } -} - -func (s *EffectiveAdminRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveAdminRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveAdminRuleKind(input string) (*EffectiveAdminRuleKind, error) { - vals := map[string]EffectiveAdminRuleKind{ - "custom": EffectiveAdminRuleKindCustom, - "default": EffectiveAdminRuleKindDefault, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveAdminRuleKind(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityConfigurationRuleAccess string - -const ( - SecurityConfigurationRuleAccessAllow SecurityConfigurationRuleAccess = "Allow" - SecurityConfigurationRuleAccessAlwaysAllow SecurityConfigurationRuleAccess = "AlwaysAllow" - SecurityConfigurationRuleAccessDeny SecurityConfigurationRuleAccess = "Deny" -) - -func PossibleValuesForSecurityConfigurationRuleAccess() []string { - return []string{ - string(SecurityConfigurationRuleAccessAllow), - string(SecurityConfigurationRuleAccessAlwaysAllow), - string(SecurityConfigurationRuleAccessDeny), - } -} - -func (s *SecurityConfigurationRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleAccess(input string) (*SecurityConfigurationRuleAccess, error) { - vals := map[string]SecurityConfigurationRuleAccess{ - "allow": SecurityConfigurationRuleAccessAllow, - "alwaysallow": SecurityConfigurationRuleAccessAlwaysAllow, - "deny": SecurityConfigurationRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleAccess(input) - return &out, nil -} - -type SecurityConfigurationRuleDirection string - -const ( - SecurityConfigurationRuleDirectionInbound SecurityConfigurationRuleDirection = "Inbound" - SecurityConfigurationRuleDirectionOutbound SecurityConfigurationRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityConfigurationRuleDirection() []string { - return []string{ - string(SecurityConfigurationRuleDirectionInbound), - string(SecurityConfigurationRuleDirectionOutbound), - } -} - -func (s *SecurityConfigurationRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleDirection(input string) (*SecurityConfigurationRuleDirection, error) { - vals := map[string]SecurityConfigurationRuleDirection{ - "inbound": SecurityConfigurationRuleDirectionInbound, - "outbound": SecurityConfigurationRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleDirection(input) - return &out, nil -} - -type SecurityConfigurationRuleProtocol string - -const ( - SecurityConfigurationRuleProtocolAh SecurityConfigurationRuleProtocol = "Ah" - SecurityConfigurationRuleProtocolAny SecurityConfigurationRuleProtocol = "Any" - SecurityConfigurationRuleProtocolEsp SecurityConfigurationRuleProtocol = "Esp" - SecurityConfigurationRuleProtocolIcmp SecurityConfigurationRuleProtocol = "Icmp" - SecurityConfigurationRuleProtocolTcp SecurityConfigurationRuleProtocol = "Tcp" - SecurityConfigurationRuleProtocolUdp SecurityConfigurationRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityConfigurationRuleProtocol() []string { - return []string{ - string(SecurityConfigurationRuleProtocolAh), - string(SecurityConfigurationRuleProtocolAny), - string(SecurityConfigurationRuleProtocolEsp), - string(SecurityConfigurationRuleProtocolIcmp), - string(SecurityConfigurationRuleProtocolTcp), - string(SecurityConfigurationRuleProtocolUdp), - } -} - -func (s *SecurityConfigurationRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityConfigurationRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityConfigurationRuleProtocol(input string) (*SecurityConfigurationRuleProtocol, error) { - vals := map[string]SecurityConfigurationRuleProtocol{ - "ah": SecurityConfigurationRuleProtocolAh, - "any": SecurityConfigurationRuleProtocolAny, - "esp": SecurityConfigurationRuleProtocolEsp, - "icmp": SecurityConfigurationRuleProtocolIcmp, - "tcp": SecurityConfigurationRuleProtocolTcp, - "udp": SecurityConfigurationRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityConfigurationRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go deleted file mode 100644 index a69d081c810..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/method_listnetworkmanagereffectivesecurityadminrules.go +++ /dev/null @@ -1,60 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 ListNetworkManagerEffectiveSecurityAdminRulesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerEffectiveSecurityAdminRulesListResult -} - -// ListNetworkManagerEffectiveSecurityAdminRules ... -func (c NetworkManagerEffectiveSecurityAdminRulesClient) ListNetworkManagerEffectiveSecurityAdminRules(ctx context.Context, id commonids.VirtualNetworkId, input QueryRequestOptions) (result ListNetworkManagerEffectiveSecurityAdminRulesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listNetworkManagerEffectiveSecurityAdminRules", 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 NetworkManagerEffectiveSecurityAdminRulesListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go deleted file mode 100644 index 36a40aa2b75..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_addressprefixitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressPrefixItem struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixType *AddressPrefixType `json:"addressPrefixType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go deleted file mode 100644 index bc26b08e48e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_adminpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdminPropertiesFormat struct { - Access SecurityConfigurationRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction SecurityConfigurationRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityConfigurationRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go deleted file mode 100644 index bfc45b0ab70..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_configurationgroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConfigurationGroup struct { - Id *string `json:"id,omitempty"` - Properties *NetworkGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go deleted file mode 100644 index 1b0e64dbae7..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_defaultadminpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DefaultAdminPropertiesFormat struct { - Access *SecurityConfigurationRuleAccess `json:"access,omitempty"` - Description *string `json:"description,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Destinations *[]AddressPrefixItem `json:"destinations,omitempty"` - Direction *SecurityConfigurationRuleDirection `json:"direction,omitempty"` - Flag *string `json:"flag,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *SecurityConfigurationRuleProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` - Sources *[]AddressPrefixItem `json:"sources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go deleted file mode 100644 index 9ef5715f8e4..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivebasesecurityadminrule.go +++ /dev/null @@ -1,61 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -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 EffectiveBaseSecurityAdminRule interface { -} - -// RawEffectiveBaseSecurityAdminRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEffectiveBaseSecurityAdminRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEffectiveBaseSecurityAdminRuleImplementation(input []byte) (EffectiveBaseSecurityAdminRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EffectiveBaseSecurityAdminRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Default") { - var out EffectiveDefaultSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EffectiveDefaultSecurityAdminRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Custom") { - var out EffectiveSecurityAdminRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EffectiveSecurityAdminRule: %+v", err) - } - return out, nil - } - - out := RawEffectiveBaseSecurityAdminRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go deleted file mode 100644 index 17d5e7fdeb7..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivedefaultsecurityadminrule.go +++ /dev/null @@ -1,46 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EffectiveBaseSecurityAdminRule = EffectiveDefaultSecurityAdminRule{} - -type EffectiveDefaultSecurityAdminRule struct { - Properties *DefaultAdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from EffectiveBaseSecurityAdminRule - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -var _ json.Marshaler = EffectiveDefaultSecurityAdminRule{} - -func (s EffectiveDefaultSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper EffectiveDefaultSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EffectiveDefaultSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EffectiveDefaultSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Default" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EffectiveDefaultSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go deleted file mode 100644 index ae90f9154f9..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_effectivesecurityadminrule.go +++ /dev/null @@ -1,46 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EffectiveBaseSecurityAdminRule = EffectiveSecurityAdminRule{} - -type EffectiveSecurityAdminRule struct { - Properties *AdminPropertiesFormat `json:"properties,omitempty"` - - // Fields inherited from EffectiveBaseSecurityAdminRule - ConfigurationDescription *string `json:"configurationDescription,omitempty"` - Id *string `json:"id,omitempty"` - RuleCollectionAppliesToGroups *[]NetworkManagerSecurityGroupItem `json:"ruleCollectionAppliesToGroups,omitempty"` - RuleCollectionDescription *string `json:"ruleCollectionDescription,omitempty"` - RuleGroups *[]ConfigurationGroup `json:"ruleGroups,omitempty"` -} - -var _ json.Marshaler = EffectiveSecurityAdminRule{} - -func (s EffectiveSecurityAdminRule) MarshalJSON() ([]byte, error) { - type wrapper EffectiveSecurityAdminRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EffectiveSecurityAdminRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EffectiveSecurityAdminRule: %+v", err) - } - decoded["kind"] = "Custom" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EffectiveSecurityAdminRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go deleted file mode 100644 index 5890d573ff4..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkgroupproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkGroupProperties struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go deleted file mode 100644 index 941c8a93ed6..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagereffectivesecurityadminruleslistresult.go +++ /dev/null @@ -1,49 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerEffectiveSecurityAdminRulesListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]EffectiveBaseSecurityAdminRule `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &NetworkManagerEffectiveSecurityAdminRulesListResult{} - -func (s *NetworkManagerEffectiveSecurityAdminRulesListResult) UnmarshalJSON(bytes []byte) error { - type alias NetworkManagerEffectiveSecurityAdminRulesListResult - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into NetworkManagerEffectiveSecurityAdminRulesListResult: %+v", err) - } - - s.SkipToken = decoded.SkipToken - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling NetworkManagerEffectiveSecurityAdminRulesListResult into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]EffectiveBaseSecurityAdminRule, 0) - for i, val := range listTemp { - impl, err := unmarshalEffectiveBaseSecurityAdminRuleImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'NetworkManagerEffectiveSecurityAdminRulesListResult': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go deleted file mode 100644 index 47b6055e402..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_networkmanagersecuritygroupitem.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerSecurityGroupItem struct { - NetworkGroupId string `json:"networkGroupId"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go deleted file mode 100644 index 21a08175183..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/model_queryrequestoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryRequestOptions struct { - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/version.go b/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/version.go deleted file mode 100644 index 15a8a2d779f..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagereffectivesecurityadminrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagereffectivesecurityadminrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagereffectivesecurityadminrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/README.md b/resource-manager/network/2023-06-01/networkmanagers/README.md deleted file mode 100644 index 52eb86b3b87..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/README.md +++ /dev/null @@ -1,163 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkmanagers` Documentation - -The `networkmanagers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkmanagers" -``` - - -### Client Initialization - -```go -client := networkmanagers.NewNetworkManagersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkManagersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManager{ - // ... -} - - -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: `NetworkManagersClient.Delete` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -if err := client.DeleteThenPoll(ctx, id, networkmanagers.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkManagersClient.Get` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -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: `NetworkManagersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.List(ctx, id, networkmanagers.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, networkmanagers.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagersClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions())` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id, networkmanagers.DefaultListBySubscriptionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkManagersClient.NetworkManagerCommitsPost` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManagerCommit{ - // ... -} - - -if err := client.NetworkManagerCommitsPostThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkManagersClient.NetworkManagerDeploymentStatusList` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.NetworkManagerDeploymentStatusParameter{ - // ... -} - - -read, err := client.NetworkManagerDeploymentStatusList(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkManagersClient.Patch` - -```go -ctx := context.TODO() -id := networkmanagers.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -payload := networkmanagers.PatchObject{ - // ... -} - - -read, err := client.Patch(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/network/2023-06-01/networkmanagers/client.go b/resource-manager/network/2023-06-01/networkmanagers/client.go deleted file mode 100644 index b27df28e126..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkmanagers - -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 NetworkManagersClient struct { - Client *resourcemanager.Client -} - -func NewNetworkManagersClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkManagersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkmanagers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkManagersClient: %+v", err) - } - - return &NetworkManagersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/constants.go b/resource-manager/network/2023-06-01/networkmanagers/constants.go deleted file mode 100644 index 2aa86ac1963..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -package networkmanagers - -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 ConfigurationType string - -const ( - ConfigurationTypeConnectivity ConfigurationType = "Connectivity" - ConfigurationTypeSecurityAdmin ConfigurationType = "SecurityAdmin" -) - -func PossibleValuesForConfigurationType() []string { - return []string{ - string(ConfigurationTypeConnectivity), - string(ConfigurationTypeSecurityAdmin), - } -} - -func (s *ConfigurationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfigurationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfigurationType(input string) (*ConfigurationType, error) { - vals := map[string]ConfigurationType{ - "connectivity": ConfigurationTypeConnectivity, - "securityadmin": ConfigurationTypeSecurityAdmin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfigurationType(input) - return &out, nil -} - -type DeploymentStatus string - -const ( - DeploymentStatusDeployed DeploymentStatus = "Deployed" - DeploymentStatusDeploying DeploymentStatus = "Deploying" - DeploymentStatusFailed DeploymentStatus = "Failed" - DeploymentStatusNotStarted DeploymentStatus = "NotStarted" -) - -func PossibleValuesForDeploymentStatus() []string { - return []string{ - string(DeploymentStatusDeployed), - string(DeploymentStatusDeploying), - string(DeploymentStatusFailed), - string(DeploymentStatusNotStarted), - } -} - -func (s *DeploymentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeploymentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeploymentStatus(input string) (*DeploymentStatus, error) { - vals := map[string]DeploymentStatus{ - "deployed": DeploymentStatusDeployed, - "deploying": DeploymentStatusDeploying, - "failed": DeploymentStatusFailed, - "notstarted": DeploymentStatusNotStarted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeploymentStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/id_networkmanager.go b/resource-manager/network/2023-06-01/networkmanagers/id_networkmanager.go deleted file mode 100644 index 63481203294..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkmanagers - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/id_networkmanager_test.go b/resource-manager/network/2023-06-01/networkmanagers/id_networkmanager_test.go deleted file mode 100644 index 0feea61327e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkmanagers - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/networkmanagers/method_createorupdate.go b/resource-manager/network/2023-06-01/networkmanagers/method_createorupdate.go deleted file mode 100644 index 5fb5c949cd6..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagers - -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 *NetworkManager -} - -// CreateOrUpdate ... -func (c NetworkManagersClient) CreateOrUpdate(ctx context.Context, id NetworkManagerId, input NetworkManager) (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 NetworkManager - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/method_delete.go b/resource-manager/network/2023-06-01/networkmanagers/method_delete.go deleted file mode 100644 index ec825f20cb1..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package networkmanagers - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 NetworkManagersClient) Delete(ctx context.Context, id NetworkManagerId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkManagersClient) DeleteThenPoll(ctx context.Context, id NetworkManagerId, 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/network/2023-06-01/networkmanagers/method_get.go b/resource-manager/network/2023-06-01/networkmanagers/method_get.go deleted file mode 100644 index c9f3acddeae..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkmanagers - -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 *NetworkManager -} - -// Get ... -func (c NetworkManagersClient) Get(ctx context.Context, id NetworkManagerId) (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 NetworkManager - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/method_list.go b/resource-manager/network/2023-06-01/networkmanagers/method_list.go deleted file mode 100644 index bc9fb671ceb..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_list.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagers - -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 *[]NetworkManager -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManager -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c NetworkManagersClient) List(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagers", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManager `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 NetworkManagersClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, NetworkManagerOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListOperationOptions, predicate NetworkManagerOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkManager, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/networkmanagers/method_listbysubscription.go b/resource-manager/network/2023-06-01/networkmanagers/method_listbysubscription.go deleted file mode 100644 index c5d880d0198..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_listbysubscription.go +++ /dev/null @@ -1,120 +0,0 @@ -package networkmanagers - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkManager -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkManager -} - -type ListBySubscriptionOperationOptions struct { - Top *int64 -} - -func DefaultListBySubscriptionOperationOptions() ListBySubscriptionOperationOptions { - return ListBySubscriptionOperationOptions{} -} - -func (o ListBySubscriptionOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListBySubscriptionOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListBySubscriptionOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// ListBySubscription ... -func (c NetworkManagersClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkManagers", id.ID()), - OptionsObject: options, - } - - 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 *[]NetworkManager `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c NetworkManagersClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, options, NetworkManagerOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkManagersClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListBySubscriptionOperationOptions, predicate NetworkManagerOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]NetworkManager, 0) - - resp, err := c.ListBySubscription(ctx, id, options) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/method_networkmanagercommitspost.go b/resource-manager/network/2023-06-01/networkmanagers/method_networkmanagercommitspost.go deleted file mode 100644 index 6d93c0512d6..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_networkmanagercommitspost.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkmanagers - -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 NetworkManagerCommitsPostOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerCommit -} - -// NetworkManagerCommitsPost ... -func (c NetworkManagersClient) NetworkManagerCommitsPost(ctx context.Context, id NetworkManagerId, input NetworkManagerCommit) (result NetworkManagerCommitsPostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/commit", 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 -} - -// NetworkManagerCommitsPostThenPoll performs NetworkManagerCommitsPost then polls until it's completed -func (c NetworkManagersClient) NetworkManagerCommitsPostThenPoll(ctx context.Context, id NetworkManagerId, input NetworkManagerCommit) error { - result, err := c.NetworkManagerCommitsPost(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkManagerCommitsPost: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkManagerCommitsPost: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go b/resource-manager/network/2023-06-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go deleted file mode 100644 index f9a88725d0f..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_networkmanagerdeploymentstatuslist.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkmanagers - -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 NetworkManagerDeploymentStatusListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManagerDeploymentStatusListResult -} - -// NetworkManagerDeploymentStatusList ... -func (c NetworkManagersClient) NetworkManagerDeploymentStatusList(ctx context.Context, id NetworkManagerId, input NetworkManagerDeploymentStatusParameter) (result NetworkManagerDeploymentStatusListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/listDeploymentStatus", 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 NetworkManagerDeploymentStatusListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/method_patch.go b/resource-manager/network/2023-06-01/networkmanagers/method_patch.go deleted file mode 100644 index e3810b6e4b4..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/method_patch.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkmanagers - -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 PatchOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkManager -} - -// Patch ... -func (c NetworkManagersClient) Patch(ctx context.Context, id NetworkManagerId, input PatchObject) (result PatchOperationResponse, 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 NetworkManager - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_crosstenantscopes.go b/resource-manager/network/2023-06-01/networkmanagers/model_crosstenantscopes.go deleted file mode 100644 index 537d9c70d4a..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_crosstenantscopes.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossTenantScopes struct { - ManagementGroups *[]string `json:"managementGroups,omitempty"` - Subscriptions *[]string `json:"subscriptions,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanager.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanager.go deleted file mode 100644 index 8f98dec3ed2..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanager.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkmanagers - -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 NetworkManager struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkManagerProperties `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/network/2023-06-01/networkmanagers/model_networkmanagercommit.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagercommit.go deleted file mode 100644 index 8649d0c0da8..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagercommit.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerCommit struct { - CommitId *string `json:"commitId,omitempty"` - CommitType ConfigurationType `json:"commitType"` - ConfigurationIds *[]string `json:"configurationIds,omitempty"` - TargetLocations []string `json:"targetLocations"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatus.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatus.go deleted file mode 100644 index 5727d45e848..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatus.go +++ /dev/null @@ -1,31 +0,0 @@ -package networkmanagers - -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 NetworkManagerDeploymentStatus struct { - CommitTime *string `json:"commitTime,omitempty"` - ConfigurationIds *[]string `json:"configurationIds,omitempty"` - DeploymentStatus *DeploymentStatus `json:"deploymentStatus,omitempty"` - DeploymentType *ConfigurationType `json:"deploymentType,omitempty"` - ErrorMessage *string `json:"errorMessage,omitempty"` - Region *string `json:"region,omitempty"` -} - -func (o *NetworkManagerDeploymentStatus) GetCommitTimeAsTime() (*time.Time, error) { - if o.CommitTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CommitTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *NetworkManagerDeploymentStatus) SetCommitTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CommitTime = &formatted -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go deleted file mode 100644 index 26a44c297a2..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatuslistresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerDeploymentStatusListResult struct { - SkipToken *string `json:"skipToken,omitempty"` - Value *[]NetworkManagerDeploymentStatus `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go deleted file mode 100644 index 1eb70a07ac3..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerdeploymentstatusparameter.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerDeploymentStatusParameter struct { - DeploymentTypes *[]ConfigurationType `json:"deploymentTypes,omitempty"` - Regions *[]string `json:"regions,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerproperties.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerproperties.go deleted file mode 100644 index 46dc5161ee2..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerProperties struct { - Description *string `json:"description,omitempty"` - NetworkManagerScopeAccesses []ConfigurationType `json:"networkManagerScopeAccesses"` - NetworkManagerScopes NetworkManagerPropertiesNetworkManagerScopes `json:"networkManagerScopes"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go b/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go deleted file mode 100644 index 2a91fc5b601..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_networkmanagerpropertiesnetworkmanagerscopes.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerPropertiesNetworkManagerScopes struct { - CrossTenantScopes *[]CrossTenantScopes `json:"crossTenantScopes,omitempty"` - ManagementGroups *[]string `json:"managementGroups,omitempty"` - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/model_patchobject.go b/resource-manager/network/2023-06-01/networkmanagers/model_patchobject.go deleted file mode 100644 index 775ef598685..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/model_patchobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchObject struct { - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkmanagers/predicates.go b/resource-manager/network/2023-06-01/networkmanagers/predicates.go deleted file mode 100644 index 7c1597c2666..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networkmanagers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkManagerOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkManagerOperationPredicate) Matches(input NetworkManager) 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 && (input.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/network/2023-06-01/networkmanagers/version.go b/resource-manager/network/2023-06-01/networkmanagers/version.go deleted file mode 100644 index 5a495fb6f9e..00000000000 --- a/resource-manager/network/2023-06-01/networkmanagers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkmanagers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkmanagers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/README.md b/resource-manager/network/2023-06-01/networkprofiles/README.md deleted file mode 100644 index 5f38eb7a7cf..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/README.md +++ /dev/null @@ -1,125 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkprofiles` Documentation - -The `networkprofiles` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkprofiles" -``` - - -### Client Initialization - -```go -client := networkprofiles.NewNetworkProfilesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkProfilesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -payload := networkprofiles.NetworkProfile{ - // ... -} - - -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: `NetworkProfilesClient.Delete` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkProfilesClient.Get` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -read, err := client.Get(ctx, id, networkprofiles.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkProfilesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkProfilesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkProfilesClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkprofiles.NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - -payload := networkprofiles.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/network/2023-06-01/networkprofiles/client.go b/resource-manager/network/2023-06-01/networkprofiles/client.go deleted file mode 100644 index 17b4bf31068..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkprofiles - -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 NetworkProfilesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkProfilesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkProfilesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkprofiles", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkProfilesClient: %+v", err) - } - - return &NetworkProfilesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/constants.go b/resource-manager/network/2023-06-01/networkprofiles/constants.go deleted file mode 100644 index 27dbe02bb51..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package networkprofiles - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/id_networkprofile.go b/resource-manager/network/2023-06-01/networkprofiles/id_networkprofile.go deleted file mode 100644 index b1bbf9c9343..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/id_networkprofile.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkprofiles - -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(&NetworkProfileId{}) -} - -var _ resourceids.ResourceId = &NetworkProfileId{} - -// NetworkProfileId is a struct representing the Resource ID for a Network Profile -type NetworkProfileId struct { - SubscriptionId string - ResourceGroupName string - NetworkProfileName string -} - -// NewNetworkProfileID returns a new NetworkProfileId struct -func NewNetworkProfileID(subscriptionId string, resourceGroupName string, networkProfileName string) NetworkProfileId { - return NetworkProfileId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkProfileName: networkProfileName, - } -} - -// ParseNetworkProfileID parses 'input' into a NetworkProfileId -func ParseNetworkProfileID(input string) (*NetworkProfileId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkProfileId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkProfileId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkProfileIDInsensitively parses 'input' case-insensitively into a NetworkProfileId -// note: this method should only be used for API response data and not user input -func ParseNetworkProfileIDInsensitively(input string) (*NetworkProfileId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkProfileId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkProfileId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkProfileId) 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.NetworkProfileName, ok = input.Parsed["networkProfileName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkProfileName", input) - } - - return nil -} - -// ValidateNetworkProfileID checks that 'input' can be parsed as a Network Profile ID -func ValidateNetworkProfileID(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 := ParseNetworkProfileID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Profile ID -func (id NetworkProfileId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkProfiles/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkProfileName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Profile ID -func (id NetworkProfileId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkProfiles", "networkProfiles", "networkProfiles"), - resourceids.UserSpecifiedSegment("networkProfileName", "networkProfileValue"), - } -} - -// String returns a human-readable description of this Network Profile ID -func (id NetworkProfileId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Profile Name: %q", id.NetworkProfileName), - } - return fmt.Sprintf("Network Profile (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/id_networkprofile_test.go b/resource-manager/network/2023-06-01/networkprofiles/id_networkprofile_test.go deleted file mode 100644 index 934223e4aee..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/id_networkprofile_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkprofiles - -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 = &NetworkProfileId{} - -func TestNewNetworkProfileID(t *testing.T) { - id := NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue") - - 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.NetworkProfileName != "networkProfileValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkProfileName'", id.NetworkProfileName, "networkProfileValue") - } -} - -func TestFormatNetworkProfileID(t *testing.T) { - actual := NewNetworkProfileID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkProfileValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkProfileID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkProfileId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue", - Expected: &NetworkProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkProfileName: "networkProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkProfileID(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.NetworkProfileName != v.Expected.NetworkProfileName { - t.Fatalf("Expected %q but got %q for NetworkProfileName", v.Expected.NetworkProfileName, actual.NetworkProfileName) - } - - } -} - -func TestParseNetworkProfileIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkProfileId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkPrOfIlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue", - Expected: &NetworkProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkProfileName: "networkProfileValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkProfiles/networkProfileValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkPrOfIlEs/nEtWoRkPrOfIlEvAlUe", - Expected: &NetworkProfileId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkProfileName: "nEtWoRkPrOfIlEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkPrOfIlEs/nEtWoRkPrOfIlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkProfileIDInsensitively(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.NetworkProfileName != v.Expected.NetworkProfileName { - t.Fatalf("Expected %q but got %q for NetworkProfileName", v.Expected.NetworkProfileName, actual.NetworkProfileName) - } - - } -} - -func TestSegmentsForNetworkProfileId(t *testing.T) { - segments := NetworkProfileId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkProfileId 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/network/2023-06-01/networkprofiles/method_createorupdate.go b/resource-manager/network/2023-06-01/networkprofiles/method_createorupdate.go deleted file mode 100644 index 94d3a856780..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkprofiles - -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 *NetworkProfile -} - -// CreateOrUpdate ... -func (c NetworkProfilesClient) CreateOrUpdate(ctx context.Context, id NetworkProfileId, input NetworkProfile) (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 NetworkProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/method_delete.go b/resource-manager/network/2023-06-01/networkprofiles/method_delete.go deleted file mode 100644 index c5564f89c85..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package networkprofiles - -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 NetworkProfilesClient) Delete(ctx context.Context, id NetworkProfileId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkProfilesClient) DeleteThenPoll(ctx context.Context, id NetworkProfileId) 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/network/2023-06-01/networkprofiles/method_get.go b/resource-manager/network/2023-06-01/networkprofiles/method_get.go deleted file mode 100644 index 3b462d08204..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package networkprofiles - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkProfile -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkProfilesClient) Get(ctx context.Context, id NetworkProfileId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/method_list.go b/resource-manager/network/2023-06-01/networkprofiles/method_list.go deleted file mode 100644 index 61f2b02ff26..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkprofiles - -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 *[]NetworkProfile -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkProfile -} - -// List ... -func (c NetworkProfilesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkProfiles", 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 *[]NetworkProfile `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 NetworkProfilesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkProfileOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkProfilesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkProfileOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkProfile, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/networkprofiles/method_listall.go b/resource-manager/network/2023-06-01/networkprofiles/method_listall.go deleted file mode 100644 index d45f54454e4..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkprofiles - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkProfile -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkProfile -} - -// ListAll ... -func (c NetworkProfilesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkProfiles", 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 *[]NetworkProfile `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkProfilesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkProfileOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkProfilesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkProfileOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkProfile, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/method_updatetags.go b/resource-manager/network/2023-06-01/networkprofiles/method_updatetags.go deleted file mode 100644 index f0bfb2f14f7..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkprofiles - -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 *NetworkProfile -} - -// UpdateTags ... -func (c NetworkProfilesClient) UpdateTags(ctx context.Context, id NetworkProfileId, 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 NetworkProfile - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 0452928be63..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 03bee9ad4ae..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 7a1eea7761a..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 4e9c7a30701..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index b3a527e5678..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygroup.go deleted file mode 100644 index a3c9e8c4026..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 962d80f7a83..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspool.go b/resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspool.go deleted file mode 100644 index b7491b172ed..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index d1e4d94bf27..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterface.go b/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterface.go deleted file mode 100644 index 8319fdf7442..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterface.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterface struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ContainerNetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfiguration.go deleted file mode 100644 index 1d0f89e15b4..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ContainerNetworkInterfaceConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go deleted file mode 100644 index 1e85f54153a..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceconfigurationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceConfigurationPropertiesFormat struct { - ContainerNetworkInterfaces *[]SubResource `json:"containerNetworkInterfaces,omitempty"` - IPConfigurations *[]IPConfigurationProfile `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go deleted file mode 100644 index e74b8c6d59e..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ContainerNetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 07db6c62c7a..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfaceIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go deleted file mode 100644 index 1c1efc89484..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_containernetworkinterfacepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContainerNetworkInterfacePropertiesFormat struct { - Container *SubResource `json:"container,omitempty"` - ContainerNetworkInterfaceConfiguration *ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfiguration,omitempty"` - IPConfigurations *[]ContainerNetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 4860aa0e2f3..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_ddossettings.go b/resource-manager/network/2023-06-01/networkprofiles/model_ddossettings.go deleted file mode 100644 index c5dc78bcc06..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_delegation.go b/resource-manager/network/2023-06-01/networkprofiles/model_delegation.go deleted file mode 100644 index 0195b7d30c3..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_flowlog.go b/resource-manager/network/2023-06-01/networkprofiles/model_flowlog.go deleted file mode 100644 index f60e3c562cb..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/networkprofiles/model_flowlogformatparameters.go deleted file mode 100644 index b92557232ff..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_flowlogpropertiesformat.go deleted file mode 100644 index adaaab9bc0c..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfiguration.go deleted file mode 100644 index db5d6938998..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkprofiles - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 82aea183299..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index cb7a2956f0e..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrule.go b/resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrule.go deleted file mode 100644 index 6b089d6c65c..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 0a3a0779932..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_ipconfiguration.go deleted file mode 100644 index 940760b2c92..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofile.go deleted file mode 100644 index 373777029b1..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index ad8fa03c4f4..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index b90aa191e92..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_iptag.go b/resource-manager/network/2023-06-01/networkprofiles/model_iptag.go deleted file mode 100644 index 2e45e454060..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// 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/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddress.go deleted file mode 100644 index 4484795804f..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 203a8fab13e..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_natgateway.go b/resource-manager/network/2023-06-01/networkprofiles/model_natgateway.go deleted file mode 100644 index 6197c623763..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package networkprofiles - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_natgatewaypropertiesformat.go deleted file mode 100644 index 1c1b918fa25..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_natgatewaysku.go b/resource-manager/network/2023-06-01/networkprofiles/model_natgatewaysku.go deleted file mode 100644 index c3c91d290f2..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_natruleportmapping.go b/resource-manager/network/2023-06-01/networkprofiles/model_natruleportmapping.go deleted file mode 100644 index 033011c8a8b..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterface.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterface.go deleted file mode 100644 index 68e610eeff9..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacednssettings.go deleted file mode 100644 index 8451913a32f..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 139342da931..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 2456f55b927..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 2d7d8aa1bc8..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 8e4c0b29d33..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfiguration.go deleted file mode 100644 index daf580431c6..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 8a7e2121888..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkprofile.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkprofile.go deleted file mode 100644 index b11865bfdd6..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkprofile.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkProfilePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networkprofilepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_networkprofilepropertiesformat.go deleted file mode 100644 index cf66d34892c..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networkprofilepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfilePropertiesFormat struct { - ContainerNetworkInterfaceConfigurations *[]ContainerNetworkInterfaceConfiguration `json:"containerNetworkInterfaceConfigurations,omitempty"` - ContainerNetworkInterfaces *[]ContainerNetworkInterface `json:"containerNetworkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygroup.go deleted file mode 100644 index b24d89a9bdf..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 4a7e6641883..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpoint.go b/resource-manager/network/2023-06-01/networkprofiles/model_privateendpoint.go deleted file mode 100644 index 5fcc4823c22..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnection.go deleted file mode 100644 index 5ef26aa759d..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/networkprofiles/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnectionproperties.go deleted file mode 100644 index ae03a204241..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfiguration.go deleted file mode 100644 index eb56313d0fe..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index c252cc443f7..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointproperties.go deleted file mode 100644 index d63068a30ea..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkservice.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkservice.go deleted file mode 100644 index 13e1f313103..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnection.go deleted file mode 100644 index f7c7b981511..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 36ba1ab614d..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 6c4d7083fb9..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 556206b6040..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 7cdb9347d51..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceproperties.go deleted file mode 100644 index bc001bea3c0..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddress.go b/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddress.go deleted file mode 100644 index 040a0bb56e8..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkprofiles - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddressdnssettings.go deleted file mode 100644 index 3172667a9f8..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 9e8c3ce846b..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresssku.go deleted file mode 100644 index af7b63fcdc5..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlink.go deleted file mode 100644 index d8706b6bc4d..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlinkformat.go deleted file mode 100644 index b9a518cd2ae..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_resourceset.go b/resource-manager/network/2023-06-01/networkprofiles/model_resourceset.go deleted file mode 100644 index 028384b4467..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/networkprofiles/model_retentionpolicyparameters.go deleted file mode 100644 index a39da241fee..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_route.go b/resource-manager/network/2023-06-01/networkprofiles/model_route.go deleted file mode 100644 index 01d1b1aee3b..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_routepropertiesformat.go deleted file mode 100644 index a0fba15da36..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_routetable.go b/resource-manager/network/2023-06-01/networkprofiles/model_routetable.go deleted file mode 100644 index e98510e4a99..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_routetablepropertiesformat.go deleted file mode 100644 index d3d001ea19c..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_securityrule.go b/resource-manager/network/2023-06-01/networkprofiles/model_securityrule.go deleted file mode 100644 index d3a303b69a8..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_securityrulepropertiesformat.go deleted file mode 100644 index 5a6f0550760..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlink.go deleted file mode 100644 index 185baa31acb..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index a8ddcda5b29..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_servicedelegationpropertiesformat.go deleted file mode 100644 index bbe89cb1074..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicy.go deleted file mode 100644 index fc7682e49f7..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 49d3abcfdf1..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 59c9a98a4df..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index c41bd5c801b..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpropertiesformat.go deleted file mode 100644 index e791f2598de..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_subnet.go b/resource-manager/network/2023-06-01/networkprofiles/model_subnet.go deleted file mode 100644 index 92e0d90839e..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_subnetpropertiesformat.go deleted file mode 100644 index 76ce29ba181..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_subresource.go b/resource-manager/network/2023-06-01/networkprofiles/model_subresource.go deleted file mode 100644 index e7710003aae..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_tagsobject.go b/resource-manager/network/2023-06-01/networkprofiles/model_tagsobject.go deleted file mode 100644 index 4b300699106..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// 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/network/2023-06-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 43e8bd0f29a..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsproperties.go deleted file mode 100644 index 67da0952e73..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktap.go deleted file mode 100644 index 21bb960f571..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 3e8521e5beb..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkprofiles/predicates.go b/resource-manager/network/2023-06-01/networkprofiles/predicates.go deleted file mode 100644 index c8b72ff46b2..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networkprofiles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkProfileOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkProfileOperationPredicate) Matches(input NetworkProfile) 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 && (input.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/network/2023-06-01/networkprofiles/version.go b/resource-manager/network/2023-06-01/networkprofiles/version.go deleted file mode 100644 index 7f43ee8f153..00000000000 --- a/resource-manager/network/2023-06-01/networkprofiles/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkprofiles - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkprofiles/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/README.md b/resource-manager/network/2023-06-01/networksecuritygroups/README.md deleted file mode 100644 index cea73c338aa..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networksecuritygroups` Documentation - -The `networksecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networksecuritygroups" -``` - - -### Client Initialization - -```go -client := networksecuritygroups.NewNetworkSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -payload := networksecuritygroups.NetworkSecurityGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -read, err := client.Get(ctx, id, networksecuritygroups.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `NetworkSecurityGroupsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `NetworkSecurityGroupsClient.UpdateTags` - -```go -ctx := context.TODO() -id := networksecuritygroups.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -payload := networksecuritygroups.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/network/2023-06-01/networksecuritygroups/client.go b/resource-manager/network/2023-06-01/networksecuritygroups/client.go deleted file mode 100644 index a8d26110c7c..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networksecuritygroups - -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 NetworkSecurityGroupsClient struct { - Client *resourcemanager.Client -} - -func NewNetworkSecurityGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkSecurityGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networksecuritygroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkSecurityGroupsClient: %+v", err) - } - - return &NetworkSecurityGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/constants.go b/resource-manager/network/2023-06-01/networksecuritygroups/constants.go deleted file mode 100644 index 95804969bbd..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package networksecuritygroups - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup.go b/resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup.go deleted file mode 100644 index 4ab431d74a9..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package networksecuritygroups - -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(&NetworkSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkSecurityGroupId{} - -// NetworkSecurityGroupId is a struct representing the Resource ID for a Network Security Group -type NetworkSecurityGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string -} - -// NewNetworkSecurityGroupID returns a new NetworkSecurityGroupId struct -func NewNetworkSecurityGroupID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string) NetworkSecurityGroupId { - return NetworkSecurityGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - } -} - -// ParseNetworkSecurityGroupID parses 'input' into a NetworkSecurityGroupId -func ParseNetworkSecurityGroupID(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkSecurityGroupIDInsensitively parses 'input' case-insensitively into a NetworkSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkSecurityGroupIDInsensitively(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkSecurityGroupId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - return nil -} - -// ValidateNetworkSecurityGroupID checks that 'input' can be parsed as a Network Security Group ID -func ValidateNetworkSecurityGroupID(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 := ParseNetworkSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Security Group ID -func (id NetworkSecurityGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Security Group ID -func (id NetworkSecurityGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Network Security Group ID -func (id NetworkSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - } - return fmt.Sprintf("Network Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup_test.go b/resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup_test.go deleted file mode 100644 index 87524f03d0e..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/id_networksecuritygroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networksecuritygroups - -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 = &NetworkSecurityGroupId{} - -func TestNewNetworkSecurityGroupID(t *testing.T) { - id := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } -} - -func TestFormatNetworkSecurityGroupID(t *testing.T) { - actual := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestParseNetworkSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestSegmentsForNetworkSecurityGroupId(t *testing.T) { - segments := NetworkSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkSecurityGroupId 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/network/2023-06-01/networksecuritygroups/method_createorupdate.go b/resource-manager/network/2023-06-01/networksecuritygroups/method_createorupdate.go deleted file mode 100644 index cb77896aae4..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networksecuritygroups - -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 *NetworkSecurityGroup -} - -// CreateOrUpdate ... -func (c NetworkSecurityGroupsClient) CreateOrUpdate(ctx context.Context, id NetworkSecurityGroupId, input NetworkSecurityGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkSecurityGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id NetworkSecurityGroupId, input NetworkSecurityGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/networksecuritygroups/method_delete.go b/resource-manager/network/2023-06-01/networksecuritygroups/method_delete.go deleted file mode 100644 index 103ca330a5b..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package networksecuritygroups - -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 NetworkSecurityGroupsClient) Delete(ctx context.Context, id NetworkSecurityGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkSecurityGroupsClient) DeleteThenPoll(ctx context.Context, id NetworkSecurityGroupId) 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/network/2023-06-01/networksecuritygroups/method_get.go b/resource-manager/network/2023-06-01/networksecuritygroups/method_get.go deleted file mode 100644 index debc457321c..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package networksecuritygroups - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkSecurityGroup -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkSecurityGroupsClient) Get(ctx context.Context, id NetworkSecurityGroupId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/method_list.go b/resource-manager/network/2023-06-01/networksecuritygroups/method_list.go deleted file mode 100644 index 7a9e914eda9..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networksecuritygroups - -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 *[]NetworkSecurityGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkSecurityGroup -} - -// List ... -func (c NetworkSecurityGroupsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkSecurityGroups", 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 *[]NetworkSecurityGroup `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 NetworkSecurityGroupsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkSecurityGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkSecurityGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkSecurityGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkSecurityGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/networksecuritygroups/method_listall.go b/resource-manager/network/2023-06-01/networksecuritygroups/method_listall.go deleted file mode 100644 index 2701b95bac0..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package networksecuritygroups - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkSecurityGroup -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkSecurityGroup -} - -// ListAll ... -func (c NetworkSecurityGroupsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkSecurityGroups", 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 *[]NetworkSecurityGroup `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c NetworkSecurityGroupsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, NetworkSecurityGroupOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkSecurityGroupsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkSecurityGroupOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]NetworkSecurityGroup, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/method_updatetags.go b/resource-manager/network/2023-06-01/networksecuritygroups/method_updatetags.go deleted file mode 100644 index 362cad00c7d..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networksecuritygroups - -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 *NetworkSecurityGroup -} - -// UpdateTags ... -func (c NetworkSecurityGroupsClient) UpdateTags(ctx context.Context, id NetworkSecurityGroupId, 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 NetworkSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 62c1c3109c0..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 17bf1792be8..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index d96a3011a25..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfiguration.go deleted file mode 100644 index ebf65a382d3..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index e6f11b94c01..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygroup.go deleted file mode 100644 index 50a0b0f53a7..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 5443c32837a..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspool.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspool.go deleted file mode 100644 index 0a216964329..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 80cdae2e912..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index d6dd55786fc..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_ddossettings.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_ddossettings.go deleted file mode 100644 index 4b0d4e3dc9b..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_delegation.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_delegation.go deleted file mode 100644 index 42805b01ada..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlog.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlog.go deleted file mode 100644 index eee82c2d3b6..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogformatparameters.go deleted file mode 100644 index fdad354f6b8..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogpropertiesformat.go deleted file mode 100644 index bab4d923b54..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfiguration.go deleted file mode 100644 index 24b23145d47..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package networksecuritygroups - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 5322ea68f34..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index fff6be9708f..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrule.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrule.go deleted file mode 100644 index 6391fbf065c..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 725fec85751..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfiguration.go deleted file mode 100644 index b9eec53b855..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofile.go deleted file mode 100644 index 4885926d9aa..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index ec7f93c0f2b..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index ca12abb4992..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_iptag.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_iptag.go deleted file mode 100644 index 3f5348f3776..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// 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/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddress.go deleted file mode 100644 index 8c8a91a5d1f..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 1843fe9fb85..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_natgateway.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_natgateway.go deleted file mode 100644 index 8d6ecb14bc5..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package networksecuritygroups - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaypropertiesformat.go deleted file mode 100644 index 389e752880f..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaysku.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaysku.go deleted file mode 100644 index 5e842304f20..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_natruleportmapping.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_natruleportmapping.go deleted file mode 100644 index 30f812c7c78..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterface.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterface.go deleted file mode 100644 index a4a62c2d6ea..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacednssettings.go deleted file mode 100644 index f3819f01474..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 40cf733a9f0..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index caa03f6e413..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 4199a4aa864..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 95a8c67d71c..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 5e60c1bbfc4..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d110d193645..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygroup.go deleted file mode 100644 index dd84b3efc89..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 704a86496f2..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpoint.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpoint.go deleted file mode 100644 index 753cd13341b..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnection.go deleted file mode 100644 index b28eaa1a213..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/networksecuritygroups/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnectionproperties.go deleted file mode 100644 index 9649070d1a7..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfiguration.go deleted file mode 100644 index af86de8f897..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 550ef75ec1d..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointproperties.go deleted file mode 100644 index 36ad3ca4ffb..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkservice.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkservice.go deleted file mode 100644 index f880da9d89d..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnection.go deleted file mode 100644 index 3a721ae3637..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 50b8f7e352f..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 619e38d131d..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index dcbf418522b..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index abc8d2f4904..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceproperties.go deleted file mode 100644 index 5d51b182a49..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddress.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddress.go deleted file mode 100644 index 7b797b006f5..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package networksecuritygroups - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddressdnssettings.go deleted file mode 100644 index 2db9ef3f2c3..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresspropertiesformat.go deleted file mode 100644 index cac3fce28ce..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresssku.go deleted file mode 100644 index 24fe5573abd..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlink.go deleted file mode 100644 index 8d6ec604942..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlinkformat.go deleted file mode 100644 index 0bf207481cb..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_resourceset.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_resourceset.go deleted file mode 100644 index 751d06dd732..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_retentionpolicyparameters.go deleted file mode 100644 index b1e9035c2f8..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_route.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_route.go deleted file mode 100644 index 9b712ab4e81..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_routepropertiesformat.go deleted file mode 100644 index 3225a4673f2..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_routetable.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_routetable.go deleted file mode 100644 index 9aff39efe9e..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_routetablepropertiesformat.go deleted file mode 100644 index 5eee448b410..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_securityrule.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_securityrule.go deleted file mode 100644 index 1119115e9eb..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_securityrulepropertiesformat.go deleted file mode 100644 index 01270911682..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlink.go deleted file mode 100644 index 050ee6cb43f..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 81a4ac35e4a..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 089e2e1dc0c..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicy.go deleted file mode 100644 index 6ca2d4bff53..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 2a8648b7931..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index c70380704b7..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 3000410cde3..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 299fb5fdadb..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_subnet.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_subnet.go deleted file mode 100644 index 499cc289ec3..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_subnetpropertiesformat.go deleted file mode 100644 index ff8ab429e75..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_subresource.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_subresource.go deleted file mode 100644 index 8fa7fe6b59d..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_tagsobject.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_tagsobject.go deleted file mode 100644 index bb9ad0a6373..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// 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/network/2023-06-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index ddb354c4a7c..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsproperties.go deleted file mode 100644 index f74d8a12ecb..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktap.go deleted file mode 100644 index cfc1b073467..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 01620fae8c8..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networksecuritygroups/predicates.go b/resource-manager/network/2023-06-01/networksecuritygroups/predicates.go deleted file mode 100644 index b9f6d3f3df5..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networksecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkSecurityGroupOperationPredicate) Matches(input NetworkSecurityGroup) 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 && (input.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/network/2023-06-01/networksecuritygroups/version.go b/resource-manager/network/2023-06-01/networksecuritygroups/version.go deleted file mode 100644 index 5782ab3cb80..00000000000 --- a/resource-manager/network/2023-06-01/networksecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networksecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networksecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/README.md b/resource-manager/network/2023-06-01/networkvirtualappliances/README.md deleted file mode 100644 index 0a28563a885..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkvirtualappliances` Documentation - -The `networkvirtualappliances` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkvirtualappliances" -``` - - -### Client Initialization - -```go -client := networkvirtualappliances.NewNetworkVirtualAppliancesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -payload := networkvirtualappliances.NetworkVirtualAppliance{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.Delete` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.Get` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -read, err := client.Get(ctx, id, networkvirtualappliances.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.InboundSecurityRuleCreateOrUpdate` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue") - -payload := networkvirtualappliances.InboundSecurityRule{ - // ... -} - - -if err := client.InboundSecurityRuleCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.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: `NetworkVirtualAppliancesClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkvirtualappliances.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -payload := networkvirtualappliances.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/network/2023-06-01/networkvirtualappliances/client.go b/resource-manager/network/2023-06-01/networkvirtualappliances/client.go deleted file mode 100644 index cfaeae574de..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkvirtualappliances - -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 NetworkVirtualAppliancesClient struct { - Client *resourcemanager.Client -} - -func NewNetworkVirtualAppliancesClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkVirtualAppliancesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkvirtualappliances", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkVirtualAppliancesClient: %+v", err) - } - - return &NetworkVirtualAppliancesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/constants.go b/resource-manager/network/2023-06-01/networkvirtualappliances/constants.go deleted file mode 100644 index d744d8f8da2..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package networkvirtualappliances - -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 InboundSecurityRulesProtocol string - -const ( - InboundSecurityRulesProtocolTCP InboundSecurityRulesProtocol = "TCP" - InboundSecurityRulesProtocolUDP InboundSecurityRulesProtocol = "UDP" -) - -func PossibleValuesForInboundSecurityRulesProtocol() []string { - return []string{ - string(InboundSecurityRulesProtocolTCP), - string(InboundSecurityRulesProtocolUDP), - } -} - -func (s *InboundSecurityRulesProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInboundSecurityRulesProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInboundSecurityRulesProtocol(input string) (*InboundSecurityRulesProtocol, error) { - vals := map[string]InboundSecurityRulesProtocol{ - "tcp": InboundSecurityRulesProtocolTCP, - "udp": InboundSecurityRulesProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InboundSecurityRulesProtocol(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule.go b/resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule.go deleted file mode 100644 index d920466b92f..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package networkvirtualappliances - -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(&InboundSecurityRuleId{}) -} - -var _ resourceids.ResourceId = &InboundSecurityRuleId{} - -// InboundSecurityRuleId is a struct representing the Resource ID for a Inbound Security Rule -type InboundSecurityRuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string - InboundSecurityRuleName string -} - -// NewInboundSecurityRuleID returns a new InboundSecurityRuleId struct -func NewInboundSecurityRuleID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string, inboundSecurityRuleName string) InboundSecurityRuleId { - return InboundSecurityRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - InboundSecurityRuleName: inboundSecurityRuleName, - } -} - -// ParseInboundSecurityRuleID parses 'input' into a InboundSecurityRuleId -func ParseInboundSecurityRuleID(input string) (*InboundSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundSecurityRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseInboundSecurityRuleIDInsensitively parses 'input' case-insensitively into a InboundSecurityRuleId -// note: this method should only be used for API response data and not user input -func ParseInboundSecurityRuleIDInsensitively(input string) (*InboundSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&InboundSecurityRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := InboundSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *InboundSecurityRuleId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - if id.InboundSecurityRuleName, ok = input.Parsed["inboundSecurityRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "inboundSecurityRuleName", input) - } - - return nil -} - -// ValidateInboundSecurityRuleID checks that 'input' can be parsed as a Inbound Security Rule ID -func ValidateInboundSecurityRuleID(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 := ParseInboundSecurityRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Inbound Security Rule ID -func (id InboundSecurityRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s/inboundSecurityRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName, id.InboundSecurityRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Inbound Security Rule ID -func (id InboundSecurityRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - resourceids.StaticSegment("staticInboundSecurityRules", "inboundSecurityRules", "inboundSecurityRules"), - resourceids.UserSpecifiedSegment("inboundSecurityRuleName", "inboundSecurityRuleValue"), - } -} - -// String returns a human-readable description of this Inbound Security Rule ID -func (id InboundSecurityRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - fmt.Sprintf("Inbound Security Rule Name: %q", id.InboundSecurityRuleName), - } - return fmt.Sprintf("Inbound Security Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule_test.go b/resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule_test.go deleted file mode 100644 index af0ac85fdd5..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/id_inboundsecurityrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package networkvirtualappliances - -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 = &InboundSecurityRuleId{} - -func TestNewInboundSecurityRuleID(t *testing.T) { - id := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } - - if id.InboundSecurityRuleName != "inboundSecurityRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'InboundSecurityRuleName'", id.InboundSecurityRuleName, "inboundSecurityRuleValue") - } -} - -func TestFormatInboundSecurityRuleID(t *testing.T) { - actual := NewInboundSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "inboundSecurityRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseInboundSecurityRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue", - Expected: &InboundSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - InboundSecurityRuleName: "inboundSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundSecurityRuleID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.InboundSecurityRuleName != v.Expected.InboundSecurityRuleName { - t.Fatalf("Expected %q but got %q for InboundSecurityRuleName", v.Expected.InboundSecurityRuleName, actual.InboundSecurityRuleName) - } - - } -} - -func TestParseInboundSecurityRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *InboundSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/iNbOuNdSeCuRiTyRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue", - Expected: &InboundSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - InboundSecurityRuleName: "inboundSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/inboundSecurityRules/inboundSecurityRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeVaLuE", - Expected: &InboundSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - InboundSecurityRuleName: "iNbOuNdSeCuRiTyRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/iNbOuNdSeCuRiTyRuLeS/iNbOuNdSeCuRiTyRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseInboundSecurityRuleIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.InboundSecurityRuleName != v.Expected.InboundSecurityRuleName { - t.Fatalf("Expected %q but got %q for InboundSecurityRuleName", v.Expected.InboundSecurityRuleName, actual.InboundSecurityRuleName) - } - - } -} - -func TestSegmentsForInboundSecurityRuleId(t *testing.T) { - segments := InboundSecurityRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("InboundSecurityRuleId 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/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance.go b/resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance.go deleted file mode 100644 index f222e101e79..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkvirtualappliances - -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(&NetworkVirtualApplianceId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceId{} - -// NetworkVirtualApplianceId is a struct representing the Resource ID for a Network Virtual Appliance -type NetworkVirtualApplianceId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string -} - -// NewNetworkVirtualApplianceID returns a new NetworkVirtualApplianceId struct -func NewNetworkVirtualApplianceID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string) NetworkVirtualApplianceId { - return NetworkVirtualApplianceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - } -} - -// ParseNetworkVirtualApplianceID parses 'input' into a NetworkVirtualApplianceId -func ParseNetworkVirtualApplianceID(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceIDInsensitively(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceID checks that 'input' can be parsed as a Network Virtual Appliance ID -func ValidateNetworkVirtualApplianceID(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 := ParseNetworkVirtualApplianceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - } - return fmt.Sprintf("Network Virtual Appliance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance_test.go b/resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance_test.go deleted file mode 100644 index f7a054f6e8c..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/id_networkvirtualappliance_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkvirtualappliances - -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 = &NetworkVirtualApplianceId{} - -func TestNewNetworkVirtualApplianceID(t *testing.T) { - id := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } -} - -func TestFormatNetworkVirtualApplianceID(t *testing.T) { - actual := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestParseNetworkVirtualApplianceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceId(t *testing.T) { - segments := NetworkVirtualApplianceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceId 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/network/2023-06-01/networkvirtualappliances/method_createorupdate.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_createorupdate.go deleted file mode 100644 index aa9b339951d..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkvirtualappliances - -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 *NetworkVirtualAppliance -} - -// CreateOrUpdate ... -func (c NetworkVirtualAppliancesClient) CreateOrUpdate(ctx context.Context, id NetworkVirtualApplianceId, input NetworkVirtualAppliance) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c NetworkVirtualAppliancesClient) CreateOrUpdateThenPoll(ctx context.Context, id NetworkVirtualApplianceId, input NetworkVirtualAppliance) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/networkvirtualappliances/method_delete.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_delete.go deleted file mode 100644 index 9eb9b6f13ac..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package networkvirtualappliances - -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 NetworkVirtualAppliancesClient) Delete(ctx context.Context, id NetworkVirtualApplianceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 NetworkVirtualAppliancesClient) DeleteThenPoll(ctx context.Context, id NetworkVirtualApplianceId) 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/network/2023-06-01/networkvirtualappliances/method_get.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_get.go deleted file mode 100644 index ee11638f574..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package networkvirtualappliances - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkVirtualAppliance -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c NetworkVirtualAppliancesClient) Get(ctx context.Context, id NetworkVirtualApplianceId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 NetworkVirtualAppliance - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go deleted file mode 100644 index 6c268a71480..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_inboundsecurityrulecreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkvirtualappliances - -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 InboundSecurityRuleCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *InboundSecurityRule -} - -// InboundSecurityRuleCreateOrUpdate ... -func (c NetworkVirtualAppliancesClient) InboundSecurityRuleCreateOrUpdate(ctx context.Context, id InboundSecurityRuleId, input InboundSecurityRule) (result InboundSecurityRuleCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// InboundSecurityRuleCreateOrUpdateThenPoll performs InboundSecurityRuleCreateOrUpdate then polls until it's completed -func (c NetworkVirtualAppliancesClient) InboundSecurityRuleCreateOrUpdateThenPoll(ctx context.Context, id InboundSecurityRuleId, input InboundSecurityRule) error { - result, err := c.InboundSecurityRuleCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing InboundSecurityRuleCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after InboundSecurityRuleCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/method_list.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_list.go deleted file mode 100644 index d956634ada9..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkvirtualappliances - -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 *[]NetworkVirtualAppliance -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualAppliance -} - -// List ... -func (c NetworkVirtualAppliancesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkVirtualAppliances", 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 *[]NetworkVirtualAppliance `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 NetworkVirtualAppliancesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkVirtualAppliancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkVirtualApplianceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkVirtualAppliance, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/networkvirtualappliances/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_listbyresourcegroup.go deleted file mode 100644 index 90c252ee012..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package networkvirtualappliances - -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 *[]NetworkVirtualAppliance -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualAppliance -} - -// ListByResourceGroup ... -func (c NetworkVirtualAppliancesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkVirtualAppliances", 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 *[]NetworkVirtualAppliance `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 NetworkVirtualAppliancesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c NetworkVirtualAppliancesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate NetworkVirtualApplianceOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]NetworkVirtualAppliance, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/networkvirtualappliances/method_updatetags.go b/resource-manager/network/2023-06-01/networkvirtualappliances/method_updatetags.go deleted file mode 100644 index 25a5f9e94c5..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkvirtualappliances - -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 *NetworkVirtualAppliance -} - -// UpdateTags ... -func (c NetworkVirtualAppliancesClient) UpdateTags(ctx context.Context, id NetworkVirtualApplianceId, 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 NetworkVirtualAppliance - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_delegationproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_delegationproperties.go deleted file mode 100644 index cf2170e1c38..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_delegationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DelegationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrule.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrule.go deleted file mode 100644 index f921a8c6534..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundSecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundSecurityRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityruleproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityruleproperties.go deleted file mode 100644 index 11569615b5c..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityruleproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundSecurityRuleProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]InboundSecurityRules `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrules.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrules.go deleted file mode 100644 index c03db57794b..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_inboundsecurityrules.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundSecurityRules struct { - DestinationPortRange *int64 `json:"destinationPortRange,omitempty"` - Protocol *InboundSecurityRulesProtocol `json:"protocol,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_internetingresspublicipsproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_internetingresspublicipsproperties.go deleted file mode 100644 index 692265ca5f9..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_internetingresspublicipsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InternetIngressPublicIPsProperties struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliance.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliance.go deleted file mode 100644 index 03612c989df..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliance.go +++ /dev/null @@ -1,19 +0,0 @@ -package networkvirtualappliances - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualAppliance struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkVirtualAppliancePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go deleted file mode 100644 index 8d22131a05a..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_networkvirtualappliancepropertiesformat.go +++ /dev/null @@ -1,25 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualAppliancePropertiesFormat struct { - AdditionalNics *[]VirtualApplianceAdditionalNicProperties `json:"additionalNics,omitempty"` - AddressPrefix *string `json:"addressPrefix,omitempty"` - BootStrapConfigurationBlobs *[]string `json:"bootStrapConfigurationBlobs,omitempty"` - CloudInitConfiguration *string `json:"cloudInitConfiguration,omitempty"` - CloudInitConfigurationBlobs *[]string `json:"cloudInitConfigurationBlobs,omitempty"` - Delegation *DelegationProperties `json:"delegation,omitempty"` - DeploymentType *string `json:"deploymentType,omitempty"` - InboundSecurityRules *[]SubResource `json:"inboundSecurityRules,omitempty"` - InternetIngressPublicIPs *[]InternetIngressPublicIPsProperties `json:"internetIngressPublicIps,omitempty"` - NvaSku *VirtualApplianceSkuProperties `json:"nvaSku,omitempty"` - PartnerManagedResource *PartnerManagedResourceProperties `json:"partnerManagedResource,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SshPublicKey *string `json:"sshPublicKey,omitempty"` - VirtualApplianceAsn *int64 `json:"virtualApplianceAsn,omitempty"` - VirtualApplianceConnections *[]SubResource `json:"virtualApplianceConnections,omitempty"` - VirtualApplianceNics *[]VirtualApplianceNicProperties `json:"virtualApplianceNics,omitempty"` - VirtualApplianceSites *[]SubResource `json:"virtualApplianceSites,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_partnermanagedresourceproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_partnermanagedresourceproperties.go deleted file mode 100644 index e89793be377..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_partnermanagedresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PartnerManagedResourceProperties struct { - Id *string `json:"id,omitempty"` - InternalLoadBalancerId *string `json:"internalLoadBalancerId,omitempty"` - StandardLoadBalancerId *string `json:"standardLoadBalancerId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_subresource.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_subresource.go deleted file mode 100644 index 8df29cf1031..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_tagsobject.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_tagsobject.go deleted file mode 100644 index 3ad1ec8468c..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkvirtualappliances - -// 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/network/2023-06-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go deleted file mode 100644 index 7eb59c309c1..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceadditionalnicproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceAdditionalNicProperties struct { - HasPublicIP *bool `json:"hasPublicIp,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualappliancenicproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualappliancenicproperties.go deleted file mode 100644 index bfd6f5f914b..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualappliancenicproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceNicProperties struct { - InstanceName *string `json:"instanceName,omitempty"` - Name *string `json:"name,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceskuproperties.go b/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceskuproperties.go deleted file mode 100644 index b194523806f..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/model_virtualapplianceskuproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSkuProperties struct { - BundledScaleUnit *string `json:"bundledScaleUnit,omitempty"` - MarketPlaceVersion *string `json:"marketPlaceVersion,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkvirtualappliances/predicates.go b/resource-manager/network/2023-06-01/networkvirtualappliances/predicates.go deleted file mode 100644 index 676b2af6c25..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package networkvirtualappliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkVirtualApplianceOperationPredicate) Matches(input NetworkVirtualAppliance) 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 && (input.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/network/2023-06-01/networkvirtualappliances/version.go b/resource-manager/network/2023-06-01/networkvirtualappliances/version.go deleted file mode 100644 index 467484fd850..00000000000 --- a/resource-manager/network/2023-06-01/networkvirtualappliances/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkvirtualappliances - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkvirtualappliances/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/README.md b/resource-manager/network/2023-06-01/networkwatchers/README.md deleted file mode 100644 index 9d68456e798..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/README.md +++ /dev/null @@ -1,331 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/networkwatchers` Documentation - -The `networkwatchers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/networkwatchers" -``` - - -### Client Initialization - -```go -client := networkwatchers.NewNetworkWatchersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `NetworkWatchersClient.CheckConnectivity` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.ConnectivityParameters{ - // ... -} - - -if err := client.CheckConnectivityThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NetworkWatcher{ - // ... -} - - -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: `NetworkWatchersClient.Delete` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.Get` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `NetworkWatchersClient.GetAzureReachabilityReport` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.AzureReachabilityReportParameters{ - // ... -} - - -if err := client.GetAzureReachabilityReportThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetFlowLogStatus` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.FlowLogStatusParameters{ - // ... -} - - -if err := client.GetFlowLogStatusThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetNetworkConfigurationDiagnostic` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NetworkConfigurationDiagnosticParameters{ - // ... -} - - -if err := client.GetNetworkConfigurationDiagnosticThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetNextHop` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.NextHopParameters{ - // ... -} - - -if err := client.GetNextHopThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTopology` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.TopologyParameters{ - // ... -} - - -read, err := client.GetTopology(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTroubleshooting` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.TroubleshootingParameters{ - // ... -} - - -if err := client.GetTroubleshootingThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetTroubleshootingResult` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.QueryTroubleshootingParameters{ - // ... -} - - -if err := client.GetTroubleshootingResultThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.GetVMSecurityRules` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.SecurityGroupViewParameters{ - // ... -} - - -if err := client.GetVMSecurityRulesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -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: `NetworkWatchersClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -read, err := client.ListAll(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `NetworkWatchersClient.ListAvailableProviders` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.AvailableProvidersListParameters{ - // ... -} - - -if err := client.ListAvailableProvidersThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.SetFlowLogConfiguration` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.FlowLogInformation{ - // ... -} - - -if err := client.SetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `NetworkWatchersClient.UpdateTags` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.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 -} -``` - - -### Example Usage: `NetworkWatchersClient.VerifyIPFlow` - -```go -ctx := context.TODO() -id := networkwatchers.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := networkwatchers.VerificationIPFlowParameters{ - // ... -} - - -if err := client.VerifyIPFlowThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/networkwatchers/client.go b/resource-manager/network/2023-06-01/networkwatchers/client.go deleted file mode 100644 index 2068ab14817..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package networkwatchers - -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 NetworkWatchersClient struct { - Client *resourcemanager.Client -} - -func NewNetworkWatchersClientWithBaseURI(sdkApi sdkEnv.Api) (*NetworkWatchersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "networkwatchers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating NetworkWatchersClient: %+v", err) - } - - return &NetworkWatchersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/constants.go b/resource-manager/network/2023-06-01/networkwatchers/constants.go deleted file mode 100644 index 2e400cad0f7..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/constants.go +++ /dev/null @@ -1,855 +0,0 @@ -package networkwatchers - -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 Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -func PossibleValuesForAccess() []string { - return []string{ - string(AccessAllow), - string(AccessDeny), - } -} - -func (s *Access) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccess(input string) (*Access, error) { - vals := map[string]Access{ - "allow": AccessAllow, - "deny": AccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Access(input) - return &out, nil -} - -type AssociationType string - -const ( - AssociationTypeAssociated AssociationType = "Associated" - AssociationTypeContains AssociationType = "Contains" -) - -func PossibleValuesForAssociationType() []string { - return []string{ - string(AssociationTypeAssociated), - string(AssociationTypeContains), - } -} - -func (s *AssociationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAssociationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAssociationType(input string) (*AssociationType, error) { - vals := map[string]AssociationType{ - "associated": AssociationTypeAssociated, - "contains": AssociationTypeContains, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AssociationType(input) - return &out, nil -} - -type ConnectionStatus string - -const ( - ConnectionStatusConnected ConnectionStatus = "Connected" - ConnectionStatusDegraded ConnectionStatus = "Degraded" - ConnectionStatusDisconnected ConnectionStatus = "Disconnected" - ConnectionStatusUnknown ConnectionStatus = "Unknown" -) - -func PossibleValuesForConnectionStatus() []string { - return []string{ - string(ConnectionStatusConnected), - string(ConnectionStatusDegraded), - string(ConnectionStatusDisconnected), - string(ConnectionStatusUnknown), - } -} - -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{ - "connected": ConnectionStatusConnected, - "degraded": ConnectionStatusDegraded, - "disconnected": ConnectionStatusDisconnected, - "unknown": ConnectionStatusUnknown, - } - 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 Direction string - -const ( - DirectionInbound Direction = "Inbound" - DirectionOutbound Direction = "Outbound" -) - -func PossibleValuesForDirection() []string { - return []string{ - string(DirectionInbound), - string(DirectionOutbound), - } -} - -func (s *Direction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDirection(input string) (*Direction, error) { - vals := map[string]Direction{ - "inbound": DirectionInbound, - "outbound": DirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Direction(input) - return &out, nil -} - -type EffectiveSecurityRuleProtocol string - -const ( - EffectiveSecurityRuleProtocolAll EffectiveSecurityRuleProtocol = "All" - EffectiveSecurityRuleProtocolTcp EffectiveSecurityRuleProtocol = "Tcp" - EffectiveSecurityRuleProtocolUdp EffectiveSecurityRuleProtocol = "Udp" -) - -func PossibleValuesForEffectiveSecurityRuleProtocol() []string { - return []string{ - string(EffectiveSecurityRuleProtocolAll), - string(EffectiveSecurityRuleProtocolTcp), - string(EffectiveSecurityRuleProtocolUdp), - } -} - -func (s *EffectiveSecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEffectiveSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEffectiveSecurityRuleProtocol(input string) (*EffectiveSecurityRuleProtocol, error) { - vals := map[string]EffectiveSecurityRuleProtocol{ - "all": EffectiveSecurityRuleProtocolAll, - "tcp": EffectiveSecurityRuleProtocolTcp, - "udp": EffectiveSecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EffectiveSecurityRuleProtocol(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type HTTPMethod string - -const ( - HTTPMethodGet HTTPMethod = "Get" -) - -func PossibleValuesForHTTPMethod() []string { - return []string{ - string(HTTPMethodGet), - } -} - -func (s *HTTPMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHTTPMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHTTPMethod(input string) (*HTTPMethod, error) { - vals := map[string]HTTPMethod{ - "get": HTTPMethodGet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HTTPMethod(input) - return &out, nil -} - -type IPFlowProtocol string - -const ( - IPFlowProtocolTCP IPFlowProtocol = "TCP" - IPFlowProtocolUDP IPFlowProtocol = "UDP" -) - -func PossibleValuesForIPFlowProtocol() []string { - return []string{ - string(IPFlowProtocolTCP), - string(IPFlowProtocolUDP), - } -} - -func (s *IPFlowProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPFlowProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPFlowProtocol(input string) (*IPFlowProtocol, error) { - vals := map[string]IPFlowProtocol{ - "tcp": IPFlowProtocolTCP, - "udp": IPFlowProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPFlowProtocol(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IssueType string - -const ( - IssueTypeAgentStopped IssueType = "AgentStopped" - IssueTypeDnsResolution IssueType = "DnsResolution" - IssueTypeGuestFirewall IssueType = "GuestFirewall" - IssueTypeNetworkSecurityRule IssueType = "NetworkSecurityRule" - IssueTypePlatform IssueType = "Platform" - IssueTypePortThrottled IssueType = "PortThrottled" - IssueTypeSocketBind IssueType = "SocketBind" - IssueTypeUnknown IssueType = "Unknown" - IssueTypeUserDefinedRoute IssueType = "UserDefinedRoute" -) - -func PossibleValuesForIssueType() []string { - return []string{ - string(IssueTypeAgentStopped), - string(IssueTypeDnsResolution), - string(IssueTypeGuestFirewall), - string(IssueTypeNetworkSecurityRule), - string(IssueTypePlatform), - string(IssueTypePortThrottled), - string(IssueTypeSocketBind), - string(IssueTypeUnknown), - string(IssueTypeUserDefinedRoute), - } -} - -func (s *IssueType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIssueType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIssueType(input string) (*IssueType, error) { - vals := map[string]IssueType{ - "agentstopped": IssueTypeAgentStopped, - "dnsresolution": IssueTypeDnsResolution, - "guestfirewall": IssueTypeGuestFirewall, - "networksecurityrule": IssueTypeNetworkSecurityRule, - "platform": IssueTypePlatform, - "portthrottled": IssueTypePortThrottled, - "socketbind": IssueTypeSocketBind, - "unknown": IssueTypeUnknown, - "userdefinedroute": IssueTypeUserDefinedRoute, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IssueType(input) - return &out, nil -} - -type NextHopType string - -const ( - NextHopTypeHyperNetGateway NextHopType = "HyperNetGateway" - NextHopTypeInternet NextHopType = "Internet" - NextHopTypeNone NextHopType = "None" - NextHopTypeVirtualAppliance NextHopType = "VirtualAppliance" - NextHopTypeVirtualNetworkGateway NextHopType = "VirtualNetworkGateway" - NextHopTypeVnetLocal NextHopType = "VnetLocal" -) - -func PossibleValuesForNextHopType() []string { - return []string{ - string(NextHopTypeHyperNetGateway), - string(NextHopTypeInternet), - string(NextHopTypeNone), - string(NextHopTypeVirtualAppliance), - string(NextHopTypeVirtualNetworkGateway), - string(NextHopTypeVnetLocal), - } -} - -func (s *NextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNextHopType(input string) (*NextHopType, error) { - vals := map[string]NextHopType{ - "hypernetgateway": NextHopTypeHyperNetGateway, - "internet": NextHopTypeInternet, - "none": NextHopTypeNone, - "virtualappliance": NextHopTypeVirtualAppliance, - "virtualnetworkgateway": NextHopTypeVirtualNetworkGateway, - "vnetlocal": NextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NextHopType(input) - return &out, nil -} - -type Origin string - -const ( - OriginInbound Origin = "Inbound" - OriginLocal Origin = "Local" - OriginOutbound Origin = "Outbound" -) - -func PossibleValuesForOrigin() []string { - return []string{ - string(OriginInbound), - string(OriginLocal), - string(OriginOutbound), - } -} - -func (s *Origin) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOrigin(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOrigin(input string) (*Origin, error) { - vals := map[string]Origin{ - "inbound": OriginInbound, - "local": OriginLocal, - "outbound": OriginOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Origin(input) - return &out, nil -} - -type Protocol string - -const ( - ProtocolHTTP Protocol = "Http" - ProtocolHTTPS Protocol = "Https" - ProtocolIcmp Protocol = "Icmp" - ProtocolTcp Protocol = "Tcp" -) - -func PossibleValuesForProtocol() []string { - return []string{ - string(ProtocolHTTP), - string(ProtocolHTTPS), - string(ProtocolIcmp), - string(ProtocolTcp), - } -} - -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{ - "http": ProtocolHTTP, - "https": ProtocolHTTPS, - "icmp": ProtocolIcmp, - "tcp": ProtocolTcp, - } - 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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type Severity string - -const ( - SeverityError Severity = "Error" - SeverityWarning Severity = "Warning" -) - -func PossibleValuesForSeverity() []string { - return []string{ - string(SeverityError), - string(SeverityWarning), - } -} - -func (s *Severity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSeverity(input string) (*Severity, error) { - vals := map[string]Severity{ - "error": SeverityError, - "warning": SeverityWarning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Severity(input) - return &out, nil -} - -type VerbosityLevel string - -const ( - VerbosityLevelFull VerbosityLevel = "Full" - VerbosityLevelMinimum VerbosityLevel = "Minimum" - VerbosityLevelNormal VerbosityLevel = "Normal" -) - -func PossibleValuesForVerbosityLevel() []string { - return []string{ - string(VerbosityLevelFull), - string(VerbosityLevelMinimum), - string(VerbosityLevelNormal), - } -} - -func (s *VerbosityLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVerbosityLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVerbosityLevel(input string) (*VerbosityLevel, error) { - vals := map[string]VerbosityLevel{ - "full": VerbosityLevelFull, - "minimum": VerbosityLevelMinimum, - "normal": VerbosityLevelNormal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VerbosityLevel(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher.go b/resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher.go deleted file mode 100644 index b8bb1f7f4a6..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package networkwatchers - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher_test.go b/resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher_test.go deleted file mode 100644 index 7136dc10343..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package networkwatchers - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-06-01/networkwatchers/method_checkconnectivity.go b/resource-manager/network/2023-06-01/networkwatchers/method_checkconnectivity.go deleted file mode 100644 index a41a47a9dbf..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_checkconnectivity.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 CheckConnectivityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectivityInformation -} - -// CheckConnectivity ... -func (c NetworkWatchersClient) CheckConnectivity(ctx context.Context, id NetworkWatcherId, input ConnectivityParameters) (result CheckConnectivityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/connectivityCheck", 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 -} - -// CheckConnectivityThenPoll performs CheckConnectivity then polls until it's completed -func (c NetworkWatchersClient) CheckConnectivityThenPoll(ctx context.Context, id NetworkWatcherId, input ConnectivityParameters) error { - result, err := c.CheckConnectivity(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CheckConnectivity: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CheckConnectivity: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_createorupdate.go b/resource-manager/network/2023-06-01/networkwatchers/method_createorupdate.go deleted file mode 100644 index ecb006e2007..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkwatchers - -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 *NetworkWatcher -} - -// CreateOrUpdate ... -func (c NetworkWatchersClient) CreateOrUpdate(ctx context.Context, id NetworkWatcherId, input NetworkWatcher) (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 NetworkWatcher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_delete.go b/resource-manager/network/2023-06-01/networkwatchers/method_delete.go deleted file mode 100644 index 4c59058ef03..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package networkwatchers - -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 NetworkWatchersClient) Delete(ctx context.Context, id NetworkWatcherId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c NetworkWatchersClient) DeleteThenPoll(ctx context.Context, id NetworkWatcherId) 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/network/2023-06-01/networkwatchers/method_get.go b/resource-manager/network/2023-06-01/networkwatchers/method_get.go deleted file mode 100644 index 000ae087b18..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package networkwatchers - -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 *NetworkWatcher -} - -// Get ... -func (c NetworkWatchersClient) Get(ctx context.Context, id NetworkWatcherId) (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 NetworkWatcher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_getazurereachabilityreport.go b/resource-manager/network/2023-06-01/networkwatchers/method_getazurereachabilityreport.go deleted file mode 100644 index 54a23dc1c18..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_getazurereachabilityreport.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetAzureReachabilityReportOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *AzureReachabilityReport -} - -// GetAzureReachabilityReport ... -func (c NetworkWatchersClient) GetAzureReachabilityReport(ctx context.Context, id NetworkWatcherId, input AzureReachabilityReportParameters) (result GetAzureReachabilityReportOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/azureReachabilityReport", 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 -} - -// GetAzureReachabilityReportThenPoll performs GetAzureReachabilityReport then polls until it's completed -func (c NetworkWatchersClient) GetAzureReachabilityReportThenPoll(ctx context.Context, id NetworkWatcherId, input AzureReachabilityReportParameters) error { - result, err := c.GetAzureReachabilityReport(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetAzureReachabilityReport: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetAzureReachabilityReport: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_getflowlogstatus.go b/resource-manager/network/2023-06-01/networkwatchers/method_getflowlogstatus.go deleted file mode 100644 index af6f975c691..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_getflowlogstatus.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetFlowLogStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// GetFlowLogStatus ... -func (c NetworkWatchersClient) GetFlowLogStatus(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) (result GetFlowLogStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryFlowLogStatus", 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 -} - -// GetFlowLogStatusThenPoll performs GetFlowLogStatus then polls until it's completed -func (c NetworkWatchersClient) GetFlowLogStatusThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) error { - result, err := c.GetFlowLogStatus(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetFlowLogStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetFlowLogStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go b/resource-manager/network/2023-06-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go deleted file mode 100644 index de67c4ef4d4..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_getnetworkconfigurationdiagnostic.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetNetworkConfigurationDiagnosticOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NetworkConfigurationDiagnosticResponse -} - -// GetNetworkConfigurationDiagnostic ... -func (c NetworkWatchersClient) GetNetworkConfigurationDiagnostic(ctx context.Context, id NetworkWatcherId, input NetworkConfigurationDiagnosticParameters) (result GetNetworkConfigurationDiagnosticOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/networkConfigurationDiagnostic", 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 -} - -// GetNetworkConfigurationDiagnosticThenPoll performs GetNetworkConfigurationDiagnostic then polls until it's completed -func (c NetworkWatchersClient) GetNetworkConfigurationDiagnosticThenPoll(ctx context.Context, id NetworkWatcherId, input NetworkConfigurationDiagnosticParameters) error { - result, err := c.GetNetworkConfigurationDiagnostic(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetNetworkConfigurationDiagnostic: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetNetworkConfigurationDiagnostic: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_getnexthop.go b/resource-manager/network/2023-06-01/networkwatchers/method_getnexthop.go deleted file mode 100644 index 56fe43d4d11..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_getnexthop.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetNextHopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NextHopResult -} - -// GetNextHop ... -func (c NetworkWatchersClient) GetNextHop(ctx context.Context, id NetworkWatcherId, input NextHopParameters) (result GetNextHopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/nextHop", 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 -} - -// GetNextHopThenPoll performs GetNextHop then polls until it's completed -func (c NetworkWatchersClient) GetNextHopThenPoll(ctx context.Context, id NetworkWatcherId, input NextHopParameters) error { - result, err := c.GetNextHop(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetNextHop: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetNextHop: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_gettopology.go b/resource-manager/network/2023-06-01/networkwatchers/method_gettopology.go deleted file mode 100644 index 8a1c6caef60..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_gettopology.go +++ /dev/null @@ -1,59 +0,0 @@ -package networkwatchers - -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 GetTopologyOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Topology -} - -// GetTopology ... -func (c NetworkWatchersClient) GetTopology(ctx context.Context, id NetworkWatcherId, input TopologyParameters) (result GetTopologyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/topology", 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 Topology - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshooting.go b/resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshooting.go deleted file mode 100644 index 9b5522b8119..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshooting.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetTroubleshootingOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *TroubleshootingResult -} - -// GetTroubleshooting ... -func (c NetworkWatchersClient) GetTroubleshooting(ctx context.Context, id NetworkWatcherId, input TroubleshootingParameters) (result GetTroubleshootingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/troubleshoot", 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 -} - -// GetTroubleshootingThenPoll performs GetTroubleshooting then polls until it's completed -func (c NetworkWatchersClient) GetTroubleshootingThenPoll(ctx context.Context, id NetworkWatcherId, input TroubleshootingParameters) error { - result, err := c.GetTroubleshooting(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetTroubleshooting: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetTroubleshooting: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshootingresult.go b/resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshootingresult.go deleted file mode 100644 index fc9651abd21..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_gettroubleshootingresult.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetTroubleshootingResultOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *TroubleshootingResult -} - -// GetTroubleshootingResult ... -func (c NetworkWatchersClient) GetTroubleshootingResult(ctx context.Context, id NetworkWatcherId, input QueryTroubleshootingParameters) (result GetTroubleshootingResultOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryTroubleshootResult", 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 -} - -// GetTroubleshootingResultThenPoll performs GetTroubleshootingResult then polls until it's completed -func (c NetworkWatchersClient) GetTroubleshootingResultThenPoll(ctx context.Context, id NetworkWatcherId, input QueryTroubleshootingParameters) error { - result, err := c.GetTroubleshootingResult(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetTroubleshootingResult: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetTroubleshootingResult: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_getvmsecurityrules.go b/resource-manager/network/2023-06-01/networkwatchers/method_getvmsecurityrules.go deleted file mode 100644 index 1c8a917ab09..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_getvmsecurityrules.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 GetVMSecurityRulesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *SecurityGroupViewResult -} - -// GetVMSecurityRules ... -func (c NetworkWatchersClient) GetVMSecurityRules(ctx context.Context, id NetworkWatcherId, input SecurityGroupViewParameters) (result GetVMSecurityRulesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/securityGroupView", 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 -} - -// GetVMSecurityRulesThenPoll performs GetVMSecurityRules then polls until it's completed -func (c NetworkWatchersClient) GetVMSecurityRulesThenPoll(ctx context.Context, id NetworkWatcherId, input SecurityGroupViewParameters) error { - result, err := c.GetVMSecurityRules(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetVMSecurityRules: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVMSecurityRules: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_list.go b/resource-manager/network/2023-06-01/networkwatchers/method_list.go deleted file mode 100644 index 8263c7b4f93..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_list.go +++ /dev/null @@ -1,56 +0,0 @@ -package networkwatchers - -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 *NetworkWatcherListResult -} - -// List ... -func (c NetworkWatchersClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkWatchers", 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 NetworkWatcherListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_listall.go b/resource-manager/network/2023-06-01/networkwatchers/method_listall.go deleted file mode 100644 index 845a2449946..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_listall.go +++ /dev/null @@ -1,56 +0,0 @@ -package networkwatchers - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkWatcherListResult -} - -// ListAll ... -func (c NetworkWatchersClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkWatchers", 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 NetworkWatcherListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_listavailableproviders.go b/resource-manager/network/2023-06-01/networkwatchers/method_listavailableproviders.go deleted file mode 100644 index 12768222c1e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_listavailableproviders.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 ListAvailableProvidersOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *AvailableProvidersList -} - -// ListAvailableProviders ... -func (c NetworkWatchersClient) ListAvailableProviders(ctx context.Context, id NetworkWatcherId, input AvailableProvidersListParameters) (result ListAvailableProvidersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/availableProvidersList", 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 -} - -// ListAvailableProvidersThenPoll performs ListAvailableProviders then polls until it's completed -func (c NetworkWatchersClient) ListAvailableProvidersThenPoll(ctx context.Context, id NetworkWatcherId, input AvailableProvidersListParameters) error { - result, err := c.ListAvailableProviders(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ListAvailableProviders: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ListAvailableProviders: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_setflowlogconfiguration.go b/resource-manager/network/2023-06-01/networkwatchers/method_setflowlogconfiguration.go deleted file mode 100644 index 183183d38e9..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_setflowlogconfiguration.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 SetFlowLogConfigurationOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// SetFlowLogConfiguration ... -func (c NetworkWatchersClient) SetFlowLogConfiguration(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) (result SetFlowLogConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/configureFlowLog", 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 -} - -// SetFlowLogConfigurationThenPoll performs SetFlowLogConfiguration then polls until it's completed -func (c NetworkWatchersClient) SetFlowLogConfigurationThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) error { - result, err := c.SetFlowLogConfiguration(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SetFlowLogConfiguration: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SetFlowLogConfiguration: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_updatetags.go b/resource-manager/network/2023-06-01/networkwatchers/method_updatetags.go deleted file mode 100644 index 1ace78e7dc5..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package networkwatchers - -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 *NetworkWatcher -} - -// UpdateTags ... -func (c NetworkWatchersClient) UpdateTags(ctx context.Context, id NetworkWatcherId, 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 NetworkWatcher - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/method_verifyipflow.go b/resource-manager/network/2023-06-01/networkwatchers/method_verifyipflow.go deleted file mode 100644 index 1ef266cf37c..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/method_verifyipflow.go +++ /dev/null @@ -1,75 +0,0 @@ -package networkwatchers - -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 VerifyIPFlowOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VerificationIPFlowResult -} - -// VerifyIPFlow ... -func (c NetworkWatchersClient) VerifyIPFlow(ctx context.Context, id NetworkWatcherId, input VerificationIPFlowParameters) (result VerifyIPFlowOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ipFlowVerify", 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 -} - -// VerifyIPFlowThenPoll performs VerifyIPFlow then polls until it's completed -func (c NetworkWatchersClient) VerifyIPFlowThenPoll(ctx context.Context, id NetworkWatcherId, input VerificationIPFlowParameters) error { - result, err := c.VerifyIPFlow(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VerifyIPFlow: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VerifyIPFlow: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygroup.go deleted file mode 100644 index d93456b39dc..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 1edb4c6e9fd..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslist.go b/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslist.go deleted file mode 100644 index f97306f3eb4..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersList struct { - Countries []AvailableProvidersListCountry `json:"countries"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcity.go b/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcity.go deleted file mode 100644 index ad5727a8ad0..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcity.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListCity struct { - CityName *string `json:"cityName,omitempty"` - Providers *[]string `json:"providers,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcountry.go b/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcountry.go deleted file mode 100644 index 98f3996ac17..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistcountry.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListCountry struct { - CountryName *string `json:"countryName,omitempty"` - Providers *[]string `json:"providers,omitempty"` - States *[]AvailableProvidersListState `json:"states,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistparameters.go deleted file mode 100644 index e884f5cdb40..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_availableproviderslistparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListParameters struct { - AzureLocations *[]string `json:"azureLocations,omitempty"` - City *string `json:"city,omitempty"` - Country *string `json:"country,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_availableprovidersliststate.go b/resource-manager/network/2023-06-01/networkwatchers/model_availableprovidersliststate.go deleted file mode 100644 index 3504bafbcf0..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_availableprovidersliststate.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailableProvidersListState struct { - Cities *[]AvailableProvidersListCity `json:"cities,omitempty"` - Providers *[]string `json:"providers,omitempty"` - StateName *string `json:"stateName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreport.go b/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreport.go deleted file mode 100644 index e045a1522bc..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreport.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureReachabilityReport struct { - AggregationLevel string `json:"aggregationLevel"` - ProviderLocation AzureReachabilityReportLocation `json:"providerLocation"` - ReachabilityReport []AzureReachabilityReportItem `json:"reachabilityReport"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportitem.go b/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportitem.go deleted file mode 100644 index 50e7da37b25..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportitem.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureReachabilityReportItem struct { - AzureLocation *string `json:"azureLocation,omitempty"` - Latencies *[]AzureReachabilityReportLatencyInfo `json:"latencies,omitempty"` - Provider *string `json:"provider,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go b/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go deleted file mode 100644 index 6755737d707..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlatencyinfo.go +++ /dev/null @@ -1,27 +0,0 @@ -package networkwatchers - -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 AzureReachabilityReportLatencyInfo struct { - Score *int64 `json:"score,omitempty"` - TimeStamp *string `json:"timeStamp,omitempty"` -} - -func (o *AzureReachabilityReportLatencyInfo) GetTimeStampAsTime() (*time.Time, error) { - if o.TimeStamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeStamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureReachabilityReportLatencyInfo) SetTimeStampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeStamp = &formatted -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlocation.go b/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlocation.go deleted file mode 100644 index 15b7ba2a6ee..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportlocation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureReachabilityReportLocation struct { - City *string `json:"city,omitempty"` - Country string `json:"country"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportparameters.go deleted file mode 100644 index 81d91ee2074..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_azurereachabilityreportparameters.go +++ /dev/null @@ -1,36 +0,0 @@ -package networkwatchers - -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 AzureReachabilityReportParameters struct { - AzureLocations *[]string `json:"azureLocations,omitempty"` - EndTime string `json:"endTime"` - ProviderLocation AzureReachabilityReportLocation `json:"providerLocation"` - Providers *[]string `json:"providers,omitempty"` - StartTime string `json:"startTime"` -} - -func (o *AzureReachabilityReportParameters) GetEndTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureReachabilityReportParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = formatted -} - -func (o *AzureReachabilityReportParameters) GetStartTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureReachabilityReportParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = formatted -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_connectivitydestination.go b/resource-manager/network/2023-06-01/networkwatchers/model_connectivitydestination.go deleted file mode 100644 index fd92ab947d7..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_connectivitydestination.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityDestination struct { - Address *string `json:"address,omitempty"` - Port *int64 `json:"port,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityhop.go b/resource-manager/network/2023-06-01/networkwatchers/model_connectivityhop.go deleted file mode 100644 index b199aef7d99..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityhop.go +++ /dev/null @@ -1,16 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityHop struct { - Address *string `json:"address,omitempty"` - Id *string `json:"id,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - Links *[]HopLink `json:"links,omitempty"` - NextHopIds *[]string `json:"nextHopIds,omitempty"` - PreviousHopIds *[]string `json:"previousHopIds,omitempty"` - PreviousLinks *[]HopLink `json:"previousLinks,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityinformation.go b/resource-manager/network/2023-06-01/networkwatchers/model_connectivityinformation.go deleted file mode 100644 index 0ce37ca8e82..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityinformation.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityInformation struct { - AvgLatencyInMs *int64 `json:"avgLatencyInMs,omitempty"` - ConnectionStatus *ConnectionStatus `json:"connectionStatus,omitempty"` - Hops *[]ConnectivityHop `json:"hops,omitempty"` - MaxLatencyInMs *int64 `json:"maxLatencyInMs,omitempty"` - MinLatencyInMs *int64 `json:"minLatencyInMs,omitempty"` - ProbesFailed *int64 `json:"probesFailed,omitempty"` - ProbesSent *int64 `json:"probesSent,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityissue.go b/resource-manager/network/2023-06-01/networkwatchers/model_connectivityissue.go deleted file mode 100644 index ba9f23e149c..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityissue.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityIssue struct { - Context *[]map[string]string `json:"context,omitempty"` - Origin *Origin `json:"origin,omitempty"` - Severity *Severity `json:"severity,omitempty"` - Type *IssueType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_connectivityparameters.go deleted file mode 100644 index 2fd0eea7e96..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_connectivityparameters.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityParameters struct { - Destination ConnectivityDestination `json:"destination"` - PreferredIPVersion *IPVersion `json:"preferredIPVersion,omitempty"` - Protocol *Protocol `json:"protocol,omitempty"` - ProtocolConfiguration *ProtocolConfiguration `json:"protocolConfiguration,omitempty"` - Source ConnectivitySource `json:"source"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_connectivitysource.go b/resource-manager/network/2023-06-01/networkwatchers/model_connectivitysource.go deleted file mode 100644 index 471f2e79c48..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_connectivitysource.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivitySource struct { - Port *int64 `json:"port,omitempty"` - ResourceId string `json:"resourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_effectivenetworksecurityrule.go b/resource-manager/network/2023-06-01/networkwatchers/model_effectivenetworksecurityrule.go deleted file mode 100644 index 738fb4c583d..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_effectivenetworksecurityrule.go +++ /dev/null @@ -1,22 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveNetworkSecurityRule struct { - Access *SecurityRuleAccess `json:"access,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction *SecurityRuleDirection `json:"direction,omitempty"` - ExpandedDestinationAddressPrefix *[]string `json:"expandedDestinationAddressPrefix,omitempty"` - ExpandedSourceAddressPrefix *[]string `json:"expandedSourceAddressPrefix,omitempty"` - Name *string `json:"name,omitempty"` - Priority *int64 `json:"priority,omitempty"` - Protocol *EffectiveSecurityRuleProtocol `json:"protocol,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_evaluatednetworksecuritygroup.go b/resource-manager/network/2023-06-01/networkwatchers/model_evaluatednetworksecuritygroup.go deleted file mode 100644 index c471d60f7c3..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_evaluatednetworksecuritygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EvaluatedNetworkSecurityGroup struct { - AppliedTo *string `json:"appliedTo,omitempty"` - MatchedRule *MatchedRule `json:"matchedRule,omitempty"` - NetworkSecurityGroupId *string `json:"networkSecurityGroupId,omitempty"` - RulesEvaluationResult *[]NetworkSecurityRulesEvaluationResult `json:"rulesEvaluationResult,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_flowlogformatparameters.go deleted file mode 100644 index 804e14368ee..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_flowloginformation.go b/resource-manager/network/2023-06-01/networkwatchers/model_flowloginformation.go deleted file mode 100644 index e624cdf59fe..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_flowloginformation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogInformation struct { - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Properties FlowLogProperties `json:"properties"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_flowlogproperties.go b/resource-manager/network/2023-06-01/networkwatchers/model_flowlogproperties.go deleted file mode 100644 index c51e0fd967e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_flowlogproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogProperties struct { - Enabled bool `json:"enabled"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_flowlogstatusparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_flowlogstatusparameters.go deleted file mode 100644 index 7adddbce138..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_flowlogstatusparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogStatusParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_hoplink.go b/resource-manager/network/2023-06-01/networkwatchers/model_hoplink.go deleted file mode 100644 index ad0c1a88c32..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_hoplink.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLink struct { - Context *map[string]string `json:"context,omitempty"` - Issues *[]ConnectivityIssue `json:"issues,omitempty"` - LinkType *string `json:"linkType,omitempty"` - NextHopId *string `json:"nextHopId,omitempty"` - Properties *HopLinkProperties `json:"properties,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_hoplinkproperties.go b/resource-manager/network/2023-06-01/networkwatchers/model_hoplinkproperties.go deleted file mode 100644 index efce6d24581..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_hoplinkproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HopLinkProperties struct { - RoundTripTimeAvg *int64 `json:"roundTripTimeAvg,omitempty"` - RoundTripTimeMax *int64 `json:"roundTripTimeMax,omitempty"` - RoundTripTimeMin *int64 `json:"roundTripTimeMin,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_httpconfiguration.go b/resource-manager/network/2023-06-01/networkwatchers/model_httpconfiguration.go deleted file mode 100644 index e469c4b2e2a..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_httpconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPConfiguration struct { - Headers *[]HTTPHeader `json:"headers,omitempty"` - Method *HTTPMethod `json:"method,omitempty"` - ValidStatusCodes *[]int64 `json:"validStatusCodes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_httpheader.go b/resource-manager/network/2023-06-01/networkwatchers/model_httpheader.go deleted file mode 100644 index 5f0b41332f3..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_httpheader.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HTTPHeader struct { - Name *string `json:"name,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_matchedrule.go b/resource-manager/network/2023-06-01/networkwatchers/model_matchedrule.go deleted file mode 100644 index 7ccb0bf4ff1..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_matchedrule.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MatchedRule struct { - Action *string `json:"action,omitempty"` - RuleName *string `json:"ruleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go deleted file mode 100644 index 62d57417ce8..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticParameters struct { - Profiles []NetworkConfigurationDiagnosticProfile `json:"profiles"` - TargetResourceId string `json:"targetResourceId"` - VerbosityLevel *VerbosityLevel `json:"verbosityLevel,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go deleted file mode 100644 index 2591d3cb1bc..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticProfile struct { - Destination string `json:"destination"` - DestinationPort string `json:"destinationPort"` - Direction Direction `json:"direction"` - Protocol string `json:"protocol"` - Source string `json:"source"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go deleted file mode 100644 index a30c9686e57..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticResponse struct { - Results *[]NetworkConfigurationDiagnosticResult `json:"results,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresult.go deleted file mode 100644 index c0c796377f7..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkconfigurationdiagnosticresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkConfigurationDiagnosticResult struct { - NetworkSecurityGroupResult *NetworkSecurityGroupResult `json:"networkSecurityGroupResult,omitempty"` - Profile *NetworkConfigurationDiagnosticProfile `json:"profile,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkinterfaceassociation.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkinterfaceassociation.go deleted file mode 100644 index 0583e0225fd..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkinterfaceassociation.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceAssociation struct { - Id *string `json:"id,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networksecuritygroupresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_networksecuritygroupresult.go deleted file mode 100644 index 60f125dff53..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networksecuritygroupresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupResult struct { - EvaluatedNetworkSecurityGroups *[]EvaluatedNetworkSecurityGroup `json:"evaluatedNetworkSecurityGroups,omitempty"` - SecurityRuleAccessResult *SecurityRuleAccess `json:"securityRuleAccessResult,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networksecurityrulesevaluationresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_networksecurityrulesevaluationresult.go deleted file mode 100644 index c54e4c0dc86..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networksecurityrulesevaluationresult.go +++ /dev/null @@ -1,13 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityRulesEvaluationResult struct { - DestinationMatched *bool `json:"destinationMatched,omitempty"` - DestinationPortMatched *bool `json:"destinationPortMatched,omitempty"` - Name *string `json:"name,omitempty"` - ProtocolMatched *bool `json:"protocolMatched,omitempty"` - SourceMatched *bool `json:"sourceMatched,omitempty"` - SourcePortMatched *bool `json:"sourcePortMatched,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcher.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcher.go deleted file mode 100644 index 4f58f1863d8..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcher.go +++ /dev/null @@ -1,14 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkWatcher struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkWatcherPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherlistresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherlistresult.go deleted file mode 100644 index b78fc59bf86..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkWatcherListResult struct { - Value *[]NetworkWatcher `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherpropertiesformat.go b/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherpropertiesformat.go deleted file mode 100644 index d0d1c07ed9e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_networkwatcherpropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkWatcherPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_nexthopparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_nexthopparameters.go deleted file mode 100644 index b8a7b00f4f3..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_nexthopparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NextHopParameters struct { - DestinationIPAddress string `json:"destinationIPAddress"` - SourceIPAddress string `json:"sourceIPAddress"` - TargetNicResourceId *string `json:"targetNicResourceId,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_nexthopresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_nexthopresult.go deleted file mode 100644 index a8a2ba32b01..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_nexthopresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NextHopResult struct { - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType *NextHopType `json:"nextHopType,omitempty"` - RouteTableId *string `json:"routeTableId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_protocolconfiguration.go b/resource-manager/network/2023-06-01/networkwatchers/model_protocolconfiguration.go deleted file mode 100644 index e4592ed2fe5..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_protocolconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProtocolConfiguration struct { - HTTPConfiguration *HTTPConfiguration `json:"HTTPConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_querytroubleshootingparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_querytroubleshootingparameters.go deleted file mode 100644 index d6bf4abce2c..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_querytroubleshootingparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type QueryTroubleshootingParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_retentionpolicyparameters.go deleted file mode 100644 index 64b952abec0..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupnetworkinterface.go b/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupnetworkinterface.go deleted file mode 100644 index e22bcd0a9ed..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupnetworkinterface.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupNetworkInterface struct { - Id *string `json:"id,omitempty"` - SecurityRuleAssociations *SecurityRuleAssociations `json:"securityRuleAssociations,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewparameters.go deleted file mode 100644 index 9cbdf854c96..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupViewParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewresult.go deleted file mode 100644 index eff95f05919..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_securitygroupviewresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupViewResult struct { - NetworkInterfaces *[]SecurityGroupNetworkInterface `json:"networkInterfaces,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_securityrule.go b/resource-manager/network/2023-06-01/networkwatchers/model_securityrule.go deleted file mode 100644 index c1dded9fca0..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_securityruleassociations.go b/resource-manager/network/2023-06-01/networkwatchers/model_securityruleassociations.go deleted file mode 100644 index 0ce7cc68a9c..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_securityruleassociations.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRuleAssociations struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - EffectiveSecurityRules *[]EffectiveNetworkSecurityRule `json:"effectiveSecurityRules,omitempty"` - NetworkInterfaceAssociation *NetworkInterfaceAssociation `json:"networkInterfaceAssociation,omitempty"` - SubnetAssociation *SubnetAssociation `json:"subnetAssociation,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/networkwatchers/model_securityrulepropertiesformat.go deleted file mode 100644 index ae100c6915e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_subnetassociation.go b/resource-manager/network/2023-06-01/networkwatchers/model_subnetassociation.go deleted file mode 100644 index 8b89222ca9e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_subnetassociation.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetAssociation struct { - Id *string `json:"id,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_subresource.go b/resource-manager/network/2023-06-01/networkwatchers/model_subresource.go deleted file mode 100644 index b98b68a29dd..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_tagsobject.go b/resource-manager/network/2023-06-01/networkwatchers/model_tagsobject.go deleted file mode 100644 index f022d1785d9..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// 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/network/2023-06-01/networkwatchers/model_topology.go b/resource-manager/network/2023-06-01/networkwatchers/model_topology.go deleted file mode 100644 index c582a36ae6c..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_topology.go +++ /dev/null @@ -1,41 +0,0 @@ -package networkwatchers - -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 Topology struct { - CreatedDateTime *string `json:"createdDateTime,omitempty"` - Id *string `json:"id,omitempty"` - LastModified *string `json:"lastModified,omitempty"` - Resources *[]TopologyResource `json:"resources,omitempty"` -} - -func (o *Topology) GetCreatedDateTimeAsTime() (*time.Time, error) { - if o.CreatedDateTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *Topology) SetCreatedDateTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateTime = &formatted -} - -func (o *Topology) GetLastModifiedAsTime() (*time.Time, error) { - if o.LastModified == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModified, "2006-01-02T15:04:05Z07:00") -} - -func (o *Topology) SetLastModifiedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModified = &formatted -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_topologyassociation.go b/resource-manager/network/2023-06-01/networkwatchers/model_topologyassociation.go deleted file mode 100644 index 9607c85650b..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_topologyassociation.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TopologyAssociation struct { - AssociationType *AssociationType `json:"associationType,omitempty"` - Name *string `json:"name,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_topologyparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_topologyparameters.go deleted file mode 100644 index 25bc77b5345..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_topologyparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TopologyParameters struct { - TargetResourceGroupName *string `json:"targetResourceGroupName,omitempty"` - TargetSubnet *SubResource `json:"targetSubnet,omitempty"` - TargetVirtualNetwork *SubResource `json:"targetVirtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_topologyresource.go b/resource-manager/network/2023-06-01/networkwatchers/model_topologyresource.go deleted file mode 100644 index e126c541c8e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_topologyresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TopologyResource struct { - Associations *[]TopologyAssociation `json:"associations,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 63df321f46e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsproperties.go deleted file mode 100644 index 415ca1a8f5e..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingdetails.go b/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingdetails.go deleted file mode 100644 index 2bc7443b168..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingdetails.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingDetails struct { - Detail *string `json:"detail,omitempty"` - Id *string `json:"id,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` - RecommendedActions *[]TroubleshootingRecommendedActions `json:"recommendedActions,omitempty"` - Summary *string `json:"summary,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingparameters.go deleted file mode 100644 index 5ee881c84a7..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingParameters struct { - Properties TroubleshootingProperties `json:"properties"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingproperties.go b/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingproperties.go deleted file mode 100644 index 8d187050a32..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingProperties struct { - StorageId string `json:"storageId"` - StoragePath string `json:"storagePath"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingrecommendedactions.go b/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingrecommendedactions.go deleted file mode 100644 index c4e5781e659..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingrecommendedactions.go +++ /dev/null @@ -1,11 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TroubleshootingRecommendedActions struct { - ActionId *string `json:"actionId,omitempty"` - ActionText *string `json:"actionText,omitempty"` - ActionUri *string `json:"actionUri,omitempty"` - ActionUriText *string `json:"actionUriText,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingresult.go deleted file mode 100644 index 62df62353d2..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_troubleshootingresult.go +++ /dev/null @@ -1,41 +0,0 @@ -package networkwatchers - -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 TroubleshootingResult struct { - Code *string `json:"code,omitempty"` - EndTime *string `json:"endTime,omitempty"` - Results *[]TroubleshootingDetails `json:"results,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *TroubleshootingResult) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *TroubleshootingResult) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *TroubleshootingResult) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *TroubleshootingResult) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowparameters.go b/resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowparameters.go deleted file mode 100644 index 05165f3ed26..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VerificationIPFlowParameters struct { - Direction Direction `json:"direction"` - LocalIPAddress string `json:"localIPAddress"` - LocalPort string `json:"localPort"` - Protocol IPFlowProtocol `json:"protocol"` - RemoteIPAddress string `json:"remoteIPAddress"` - RemotePort string `json:"remotePort"` - TargetNicResourceId *string `json:"targetNicResourceId,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowresult.go b/resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowresult.go deleted file mode 100644 index 97318928bd8..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/model_verificationipflowresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package networkwatchers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VerificationIPFlowResult struct { - Access *Access `json:"access,omitempty"` - RuleName *string `json:"ruleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/networkwatchers/version.go b/resource-manager/network/2023-06-01/networkwatchers/version.go deleted file mode 100644 index c7d719a17b4..00000000000 --- a/resource-manager/network/2023-06-01/networkwatchers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package networkwatchers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/networkwatchers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/README.md b/resource-manager/network/2023-06-01/p2svpngateways/README.md deleted file mode 100644 index 6169d49a28f..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/README.md +++ /dev/null @@ -1,113 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/p2svpngateways` Documentation - -The `p2svpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/p2svpngateways" -``` - - -### Client Initialization - -```go -client := p2svpngateways.NewP2sVpnGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `P2sVpnGatewaysClient.DisconnectP2sVpnConnections` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnConnectionRequest{ - // ... -} - - -if err := client.DisconnectP2sVpnConnectionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GenerateVpnProfile` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnProfileParameters{ - // ... -} - - -if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealth` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.GetP2sVpnConnectionHealthThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.GetP2sVpnConnectionHealthDetailed` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.P2SVpnConnectionHealthRequest{ - // ... -} - - -if err := client.GetP2sVpnConnectionHealthDetailedThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.ResetThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `P2sVpnGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := p2svpngateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/p2svpngateways/client.go b/resource-manager/network/2023-06-01/p2svpngateways/client.go deleted file mode 100644 index 3d458041de0..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package p2svpngateways - -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 P2sVpnGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewP2sVpnGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*P2sVpnGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "p2svpngateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating P2sVpnGatewaysClient: %+v", err) - } - - return &P2sVpnGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/constants.go b/resource-manager/network/2023-06-01/p2svpngateways/constants.go deleted file mode 100644 index e0d727fd608..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/constants.go +++ /dev/null @@ -1,183 +0,0 @@ -package p2svpngateways - -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 AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/method_disconnectp2svpnconnections.go b/resource-manager/network/2023-06-01/p2svpngateways/method_disconnectp2svpnconnections.go deleted file mode 100644 index c7746ee57d0..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/method_disconnectp2svpnconnections.go +++ /dev/null @@ -1,75 +0,0 @@ -package p2svpngateways - -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 DisconnectP2sVpnConnectionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DisconnectP2sVpnConnections ... -func (c P2sVpnGatewaysClient) DisconnectP2sVpnConnections(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionRequest) (result DisconnectP2sVpnConnectionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnectP2sVpnConnections", 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 -} - -// DisconnectP2sVpnConnectionsThenPoll performs DisconnectP2sVpnConnections then polls until it's completed -func (c P2sVpnGatewaysClient) DisconnectP2sVpnConnectionsThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionRequest) error { - result, err := c.DisconnectP2sVpnConnections(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DisconnectP2sVpnConnections: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DisconnectP2sVpnConnections: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/method_generatevpnprofile.go b/resource-manager/network/2023-06-01/p2svpngateways/method_generatevpnprofile.go deleted file mode 100644 index b3c5acf03dc..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/method_generatevpnprofile.go +++ /dev/null @@ -1,76 +0,0 @@ -package p2svpngateways - -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 GenerateVpnProfileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnProfileResponse -} - -// GenerateVpnProfile ... -func (c P2sVpnGatewaysClient) GenerateVpnProfile(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnProfileParameters) (result GenerateVpnProfileOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatevpnprofile", 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 -} - -// GenerateVpnProfileThenPoll performs GenerateVpnProfile then polls until it's completed -func (c P2sVpnGatewaysClient) GenerateVpnProfileThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnProfileParameters) error { - result, err := c.GenerateVpnProfile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GenerateVpnProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GenerateVpnProfile: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealth.go b/resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealth.go deleted file mode 100644 index dab0de414a2..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealth.go +++ /dev/null @@ -1,72 +0,0 @@ -package p2svpngateways - -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 GetP2sVpnConnectionHealthOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// GetP2sVpnConnectionHealth ... -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealth(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result GetP2sVpnConnectionHealthOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getP2sVpnConnectionHealth", 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 -} - -// GetP2sVpnConnectionHealthThenPoll performs GetP2sVpnConnectionHealth then polls until it's completed -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealthThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) error { - result, err := c.GetP2sVpnConnectionHealth(ctx, id) - if err != nil { - return fmt.Errorf("performing GetP2sVpnConnectionHealth: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetP2sVpnConnectionHealth: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go b/resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go deleted file mode 100644 index d5c274634f2..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/method_getp2svpnconnectionhealthdetailed.go +++ /dev/null @@ -1,76 +0,0 @@ -package p2svpngateways - -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 GetP2sVpnConnectionHealthDetailedOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnConnectionHealth -} - -// GetP2sVpnConnectionHealthDetailed ... -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailed(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionHealthRequest) (result GetP2sVpnConnectionHealthDetailedOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getP2sVpnConnectionHealthDetailed", 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 -} - -// GetP2sVpnConnectionHealthDetailedThenPoll performs GetP2sVpnConnectionHealthDetailed then polls until it's completed -func (c P2sVpnGatewaysClient) GetP2sVpnConnectionHealthDetailedThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnConnectionHealthRequest) error { - result, err := c.GetP2sVpnConnectionHealthDetailed(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GetP2sVpnConnectionHealthDetailed: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetP2sVpnConnectionHealthDetailed: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/method_reset.go b/resource-manager/network/2023-06-01/p2svpngateways/method_reset.go deleted file mode 100644 index d00e0082c46..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/method_reset.go +++ /dev/null @@ -1,72 +0,0 @@ -package p2svpngateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// Reset ... -func (c P2sVpnGatewaysClient) Reset(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c P2sVpnGatewaysClient) ResetThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) error { - result, err := c.Reset(ctx, id) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/method_updatetags.go b/resource-manager/network/2023-06-01/p2svpngateways/method_updatetags.go deleted file mode 100644 index e1cbbdbc914..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/method_updatetags.go +++ /dev/null @@ -1,76 +0,0 @@ -package p2svpngateways - -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 *P2SVpnGateway -} - -// UpdateTags ... -func (c P2sVpnGatewaysClient) UpdateTags(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c P2sVpnGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/p2svpngateways/model_addressspace.go b/resource-manager/network/2023-06-01/p2svpngateways/model_addressspace.go deleted file mode 100644 index 7c79876f047..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfiguration.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfiguration.go deleted file mode 100644 index 278f2d7145d..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go deleted file mode 100644 index 33a16482774..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2sconnectionconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfigurationProperties struct { - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealth.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealth.go deleted file mode 100644 index 42b227bbf63..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealth.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionHealth struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go deleted file mode 100644 index d0cd806bd05..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionhealthrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionHealthRequest struct { - OutputBlobSasUrl *string `json:"outputBlobSasUrl,omitempty"` - VpnUserNamesFilter *[]string `json:"vpnUserNamesFilter,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionrequest.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionrequest.go deleted file mode 100644 index f7b746fc648..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnconnectionrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionRequest struct { - VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngateway.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngateway.go deleted file mode 100644 index 522c7458570..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SVpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngatewayproperties.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngatewayproperties.go deleted file mode 100644 index 6099821abd6..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpngatewayproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGatewayProperties struct { - CustomDnsServers *[]string `json:"customDnsServers,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnprofileparameters.go b/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnprofileparameters.go deleted file mode 100644 index 7f798f2ae40..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_p2svpnprofileparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnProfileParameters struct { - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_propagatedroutetable.go b/resource-manager/network/2023-06-01/p2svpngateways/model_propagatedroutetable.go deleted file mode 100644 index f137f52cc84..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_routingconfiguration.go b/resource-manager/network/2023-06-01/p2svpngateways/model_routingconfiguration.go deleted file mode 100644 index abe87c9515c..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_staticroute.go b/resource-manager/network/2023-06-01/p2svpngateways/model_staticroute.go deleted file mode 100644 index 0a7ee0c9c99..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_staticroutesconfig.go b/resource-manager/network/2023-06-01/p2svpngateways/model_staticroutesconfig.go deleted file mode 100644 index 063926c25d3..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_subresource.go b/resource-manager/network/2023-06-01/p2svpngateways/model_subresource.go deleted file mode 100644 index 80d7b205b99..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_tagsobject.go b/resource-manager/network/2023-06-01/p2svpngateways/model_tagsobject.go deleted file mode 100644 index f314ca6d15c..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// 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/network/2023-06-01/p2svpngateways/model_vnetroute.go b/resource-manager/network/2023-06-01/p2svpngateways/model_vnetroute.go deleted file mode 100644 index 445ec97bfa1..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnclientconnectionhealth.go b/resource-manager/network/2023-06-01/p2svpngateways/model_vpnclientconnectionhealth.go deleted file mode 100644 index fb3596341d9..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnclientconnectionhealth.go +++ /dev/null @@ -1,11 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealth struct { - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - VpnClientConnectionsCount *int64 `json:"vpnClientConnectionsCount,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnprofileresponse.go b/resource-manager/network/2023-06-01/p2svpngateways/model_vpnprofileresponse.go deleted file mode 100644 index 55f4d81d16c..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnprofileresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go deleted file mode 100644 index fe026c0a264..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go deleted file mode 100644 index cebb5053164..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go deleted file mode 100644 index f7a9edb1a56..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/model_vpnserverconfigurationpolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupProperties struct { - IsDefault *bool `json:"isDefault,omitempty"` - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/p2svpngateways/version.go b/resource-manager/network/2023-06-01/p2svpngateways/version.go deleted file mode 100644 index 75858a10e7d..00000000000 --- a/resource-manager/network/2023-06-01/p2svpngateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package p2svpngateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/p2svpngateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/README.md b/resource-manager/network/2023-06-01/packetcaptures/README.md deleted file mode 100644 index 3f7c4bd8778..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/README.md +++ /dev/null @@ -1,105 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/packetcaptures` Documentation - -The `packetcaptures` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/packetcaptures" -``` - - -### Client Initialization - -```go -client := packetcaptures.NewPacketCapturesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PacketCapturesClient.Create` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -payload := packetcaptures.PacketCapture{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.Delete` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.Get` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -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: `PacketCapturesClient.GetStatus` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.GetStatusThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PacketCapturesClient.List` - -```go -ctx := context.TODO() -id := packetcaptures.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -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: `PacketCapturesClient.Stop` - -```go -ctx := context.TODO() -id := packetcaptures.NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - -if err := client.StopThenPoll(ctx, id); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/packetcaptures/client.go b/resource-manager/network/2023-06-01/packetcaptures/client.go deleted file mode 100644 index 03aa779a5b9..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package packetcaptures - -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 PacketCapturesClient struct { - Client *resourcemanager.Client -} - -func NewPacketCapturesClientWithBaseURI(sdkApi sdkEnv.Api) (*PacketCapturesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "packetcaptures", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PacketCapturesClient: %+v", err) - } - - return &PacketCapturesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/constants.go b/resource-manager/network/2023-06-01/packetcaptures/constants.go deleted file mode 100644 index 52471a03c9e..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/constants.go +++ /dev/null @@ -1,242 +0,0 @@ -package packetcaptures - -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 PacketCaptureTargetType string - -const ( - PacketCaptureTargetTypeAzureVM PacketCaptureTargetType = "AzureVM" - PacketCaptureTargetTypeAzureVMSS PacketCaptureTargetType = "AzureVMSS" -) - -func PossibleValuesForPacketCaptureTargetType() []string { - return []string{ - string(PacketCaptureTargetTypeAzureVM), - string(PacketCaptureTargetTypeAzureVMSS), - } -} - -func (s *PacketCaptureTargetType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePacketCaptureTargetType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePacketCaptureTargetType(input string) (*PacketCaptureTargetType, error) { - vals := map[string]PacketCaptureTargetType{ - "azurevm": PacketCaptureTargetTypeAzureVM, - "azurevmss": PacketCaptureTargetTypeAzureVMSS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PacketCaptureTargetType(input) - return &out, nil -} - -type PcError string - -const ( - PcErrorAgentStopped PcError = "AgentStopped" - PcErrorCaptureFailed PcError = "CaptureFailed" - PcErrorInternalError PcError = "InternalError" - PcErrorLocalFileFailed PcError = "LocalFileFailed" - PcErrorStorageFailed PcError = "StorageFailed" -) - -func PossibleValuesForPcError() []string { - return []string{ - string(PcErrorAgentStopped), - string(PcErrorCaptureFailed), - string(PcErrorInternalError), - string(PcErrorLocalFileFailed), - string(PcErrorStorageFailed), - } -} - -func (s *PcError) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePcError(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePcError(input string) (*PcError, error) { - vals := map[string]PcError{ - "agentstopped": PcErrorAgentStopped, - "capturefailed": PcErrorCaptureFailed, - "internalerror": PcErrorInternalError, - "localfilefailed": PcErrorLocalFileFailed, - "storagefailed": PcErrorStorageFailed, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PcError(input) - return &out, nil -} - -type PcProtocol string - -const ( - PcProtocolAny PcProtocol = "Any" - PcProtocolTCP PcProtocol = "TCP" - PcProtocolUDP PcProtocol = "UDP" -) - -func PossibleValuesForPcProtocol() []string { - return []string{ - string(PcProtocolAny), - string(PcProtocolTCP), - string(PcProtocolUDP), - } -} - -func (s *PcProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePcProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePcProtocol(input string) (*PcProtocol, error) { - vals := map[string]PcProtocol{ - "any": PcProtocolAny, - "tcp": PcProtocolTCP, - "udp": PcProtocolUDP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PcProtocol(input) - return &out, nil -} - -type PcStatus string - -const ( - PcStatusError PcStatus = "Error" - PcStatusNotStarted PcStatus = "NotStarted" - PcStatusRunning PcStatus = "Running" - PcStatusStopped PcStatus = "Stopped" - PcStatusUnknown PcStatus = "Unknown" -) - -func PossibleValuesForPcStatus() []string { - return []string{ - string(PcStatusError), - string(PcStatusNotStarted), - string(PcStatusRunning), - string(PcStatusStopped), - string(PcStatusUnknown), - } -} - -func (s *PcStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePcStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePcStatus(input string) (*PcStatus, error) { - vals := map[string]PcStatus{ - "error": PcStatusError, - "notstarted": PcStatusNotStarted, - "running": PcStatusRunning, - "stopped": PcStatusStopped, - "unknown": PcStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PcStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher.go b/resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher.go deleted file mode 100644 index d9eafa5f099..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package packetcaptures - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher_test.go b/resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher_test.go deleted file mode 100644 index 6fc1898eef7..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package packetcaptures - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-06-01/packetcaptures/id_packetcapture.go b/resource-manager/network/2023-06-01/packetcaptures/id_packetcapture.go deleted file mode 100644 index 8b30ad1ebd6..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/id_packetcapture.go +++ /dev/null @@ -1,139 +0,0 @@ -package packetcaptures - -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(&PacketCaptureId{}) -} - -var _ resourceids.ResourceId = &PacketCaptureId{} - -// PacketCaptureId is a struct representing the Resource ID for a Packet Capture -type PacketCaptureId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string - PacketCaptureName string -} - -// NewPacketCaptureID returns a new PacketCaptureId struct -func NewPacketCaptureID(subscriptionId string, resourceGroupName string, networkWatcherName string, packetCaptureName string) PacketCaptureId { - return PacketCaptureId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - PacketCaptureName: packetCaptureName, - } -} - -// ParsePacketCaptureID parses 'input' into a PacketCaptureId -func ParsePacketCaptureID(input string) (*PacketCaptureId, error) { - parser := resourceids.NewParserFromResourceIdType(&PacketCaptureId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PacketCaptureId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePacketCaptureIDInsensitively parses 'input' case-insensitively into a PacketCaptureId -// note: this method should only be used for API response data and not user input -func ParsePacketCaptureIDInsensitively(input string) (*PacketCaptureId, error) { - parser := resourceids.NewParserFromResourceIdType(&PacketCaptureId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PacketCaptureId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PacketCaptureId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - if id.PacketCaptureName, ok = input.Parsed["packetCaptureName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "packetCaptureName", input) - } - - return nil -} - -// ValidatePacketCaptureID checks that 'input' can be parsed as a Packet Capture ID -func ValidatePacketCaptureID(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 := ParsePacketCaptureID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Packet Capture ID -func (id PacketCaptureId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s/packetCaptures/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName, id.PacketCaptureName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Packet Capture ID -func (id PacketCaptureId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - resourceids.StaticSegment("staticPacketCaptures", "packetCaptures", "packetCaptures"), - resourceids.UserSpecifiedSegment("packetCaptureName", "packetCaptureValue"), - } -} - -// String returns a human-readable description of this Packet Capture ID -func (id PacketCaptureId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - fmt.Sprintf("Packet Capture Name: %q", id.PacketCaptureName), - } - return fmt.Sprintf("Packet Capture (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/id_packetcapture_test.go b/resource-manager/network/2023-06-01/packetcaptures/id_packetcapture_test.go deleted file mode 100644 index 92939b70c2a..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/id_packetcapture_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package packetcaptures - -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 = &PacketCaptureId{} - -func TestNewPacketCaptureID(t *testing.T) { - id := NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } - - if id.PacketCaptureName != "packetCaptureValue" { - t.Fatalf("Expected %q but got %q for Segment 'PacketCaptureName'", id.PacketCaptureName, "packetCaptureValue") - } -} - -func TestFormatPacketCaptureID(t *testing.T) { - actual := NewPacketCaptureID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue", "packetCaptureValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePacketCaptureID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PacketCaptureId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue", - Expected: &PacketCaptureId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - PacketCaptureName: "packetCaptureValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePacketCaptureID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.PacketCaptureName != v.Expected.PacketCaptureName { - t.Fatalf("Expected %q but got %q for PacketCaptureName", v.Expected.PacketCaptureName, actual.PacketCaptureName) - } - - } -} - -func TestParsePacketCaptureIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PacketCaptureId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/pAcKeTcApTuReS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue", - Expected: &PacketCaptureId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - PacketCaptureName: "packetCaptureValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/packetCaptures/packetCaptureValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/pAcKeTcApTuReS/pAcKeTcApTuReVaLuE", - Expected: &PacketCaptureId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - PacketCaptureName: "pAcKeTcApTuReVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/pAcKeTcApTuReS/pAcKeTcApTuReVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePacketCaptureIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - if actual.PacketCaptureName != v.Expected.PacketCaptureName { - t.Fatalf("Expected %q but got %q for PacketCaptureName", v.Expected.PacketCaptureName, actual.PacketCaptureName) - } - - } -} - -func TestSegmentsForPacketCaptureId(t *testing.T) { - segments := PacketCaptureId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PacketCaptureId 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/network/2023-06-01/packetcaptures/method_create.go b/resource-manager/network/2023-06-01/packetcaptures/method_create.go deleted file mode 100644 index d01c4d4092c..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/method_create.go +++ /dev/null @@ -1,74 +0,0 @@ -package packetcaptures - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PacketCaptureResult -} - -// Create ... -func (c PacketCapturesClient) Create(ctx context.Context, id PacketCaptureId, input PacketCapture) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - }, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c PacketCapturesClient) CreateThenPoll(ctx context.Context, id PacketCaptureId, input PacketCapture) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/method_delete.go b/resource-manager/network/2023-06-01/packetcaptures/method_delete.go deleted file mode 100644 index d35a3b48efa..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/method_delete.go +++ /dev/null @@ -1,70 +0,0 @@ -package packetcaptures - -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 PacketCapturesClient) Delete(ctx context.Context, id PacketCaptureId) (result DeleteOperationResponse, 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 -} - -// DeleteThenPoll performs Delete then polls until it's completed -func (c PacketCapturesClient) DeleteThenPoll(ctx context.Context, id PacketCaptureId) 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/network/2023-06-01/packetcaptures/method_get.go b/resource-manager/network/2023-06-01/packetcaptures/method_get.go deleted file mode 100644 index 2226c032bea..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package packetcaptures - -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 *PacketCaptureResult -} - -// Get ... -func (c PacketCapturesClient) Get(ctx context.Context, id PacketCaptureId) (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 PacketCaptureResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/method_getstatus.go b/resource-manager/network/2023-06-01/packetcaptures/method_getstatus.go deleted file mode 100644 index 20a7fc75b3c..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/method_getstatus.go +++ /dev/null @@ -1,71 +0,0 @@ -package packetcaptures - -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 GetStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PacketCaptureQueryStatusResult -} - -// GetStatus ... -func (c PacketCapturesClient) GetStatus(ctx context.Context, id PacketCaptureId) (result GetStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryStatus", 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 -} - -// GetStatusThenPoll performs GetStatus then polls until it's completed -func (c PacketCapturesClient) GetStatusThenPoll(ctx context.Context, id PacketCaptureId) error { - result, err := c.GetStatus(ctx, id) - if err != nil { - return fmt.Errorf("performing GetStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/method_list.go b/resource-manager/network/2023-06-01/packetcaptures/method_list.go deleted file mode 100644 index 49bbc661b3c..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package packetcaptures - -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 *PacketCaptureListResult -} - -// List ... -func (c PacketCapturesClient) List(ctx context.Context, id NetworkWatcherId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/packetCaptures", 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 PacketCaptureListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/method_stop.go b/resource-manager/network/2023-06-01/packetcaptures/method_stop.go deleted file mode 100644 index 31a3b050169..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/method_stop.go +++ /dev/null @@ -1,70 +0,0 @@ -package packetcaptures - -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 StopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Stop ... -func (c PacketCapturesClient) Stop(ctx context.Context, id PacketCaptureId) (result StopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 PacketCapturesClient) StopThenPoll(ctx context.Context, id PacketCaptureId) 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/network/2023-06-01/packetcaptures/model_packetcapture.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcapture.go deleted file mode 100644 index 592cd89a6e7..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapture.go +++ /dev/null @@ -1,8 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCapture struct { - Properties PacketCaptureParameters `json:"properties"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturefilter.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturefilter.go deleted file mode 100644 index fb301880566..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturefilter.go +++ /dev/null @@ -1,12 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureFilter struct { - LocalIPAddress *string `json:"localIPAddress,omitempty"` - LocalPort *string `json:"localPort,omitempty"` - Protocol *PcProtocol `json:"protocol,omitempty"` - RemoteIPAddress *string `json:"remoteIPAddress,omitempty"` - RemotePort *string `json:"remotePort,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturelistresult.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturelistresult.go deleted file mode 100644 index 54c50c44871..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureListResult struct { - Value *[]PacketCaptureResult `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturemachinescope.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturemachinescope.go deleted file mode 100644 index 99b476671ba..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturemachinescope.go +++ /dev/null @@ -1,9 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureMachineScope struct { - Exclude *[]string `json:"exclude,omitempty"` - Include *[]string `json:"include,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureparameters.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureparameters.go deleted file mode 100644 index dd18ed71be2..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureParameters struct { - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - StorageLocation PacketCaptureStorageLocation `json:"storageLocation"` - Target string `json:"target"` - TargetType *PacketCaptureTargetType `json:"targetType,omitempty"` - TimeLimitInSeconds *int64 `json:"timeLimitInSeconds,omitempty"` - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturequerystatusresult.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturequerystatusresult.go deleted file mode 100644 index edea164feae..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturequerystatusresult.go +++ /dev/null @@ -1,31 +0,0 @@ -package packetcaptures - -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 PacketCaptureQueryStatusResult struct { - CaptureStartTime *string `json:"captureStartTime,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - PacketCaptureError *[]PcError `json:"packetCaptureError,omitempty"` - PacketCaptureStatus *PcStatus `json:"packetCaptureStatus,omitempty"` - StopReason *string `json:"stopReason,omitempty"` -} - -func (o *PacketCaptureQueryStatusResult) GetCaptureStartTimeAsTime() (*time.Time, error) { - if o.CaptureStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CaptureStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PacketCaptureQueryStatusResult) SetCaptureStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CaptureStartTime = &formatted -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresult.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresult.go deleted file mode 100644 index a2e7cd88e02..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureResult struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PacketCaptureResultProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresultproperties.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresultproperties.go deleted file mode 100644 index 61dbaf130bb..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcaptureresultproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureResultProperties struct { - BytesToCapturePerPacket *int64 `json:"bytesToCapturePerPacket,omitempty"` - Filters *[]PacketCaptureFilter `json:"filters,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Scope *PacketCaptureMachineScope `json:"scope,omitempty"` - StorageLocation PacketCaptureStorageLocation `json:"storageLocation"` - Target string `json:"target"` - TargetType *PacketCaptureTargetType `json:"targetType,omitempty"` - TimeLimitInSeconds *int64 `json:"timeLimitInSeconds,omitempty"` - TotalBytesPerSession *int64 `json:"totalBytesPerSession,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturestoragelocation.go b/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturestoragelocation.go deleted file mode 100644 index 5cbd5d6b25e..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/model_packetcapturestoragelocation.go +++ /dev/null @@ -1,10 +0,0 @@ -package packetcaptures - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PacketCaptureStorageLocation struct { - FilePath *string `json:"filePath,omitempty"` - StorageId *string `json:"storageId,omitempty"` - StoragePath *string `json:"storagePath,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/packetcaptures/version.go b/resource-manager/network/2023-06-01/packetcaptures/version.go deleted file mode 100644 index f3af0c455b6..00000000000 --- a/resource-manager/network/2023-06-01/packetcaptures/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package packetcaptures - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/packetcaptures/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/README.md b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/README.md deleted file mode 100644 index 062a7dd360f..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections` Documentation - -The `peerexpressroutecircuitconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/peerexpressroutecircuitconnections" -``` - - -### Client Initialization - -```go -client := peerexpressroutecircuitconnections.NewPeerExpressRouteCircuitConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PeerExpressRouteCircuitConnectionsClient.Get` - -```go -ctx := context.TODO() -id := peerexpressroutecircuitconnections.NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue") - -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: `PeerExpressRouteCircuitConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewExpressRouteCircuitPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue") - -// 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/network/2023-06-01/peerexpressroutecircuitconnections/client.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/client.go deleted file mode 100644 index c0c578a280f..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package peerexpressroutecircuitconnections - -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 PeerExpressRouteCircuitConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewPeerExpressRouteCircuitConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*PeerExpressRouteCircuitConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "peerexpressroutecircuitconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PeerExpressRouteCircuitConnectionsClient: %+v", err) - } - - return &PeerExpressRouteCircuitConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/constants.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/constants.go deleted file mode 100644 index eda70745480..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package peerexpressroutecircuitconnections - -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 CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection.go deleted file mode 100644 index 6bde16a10c5..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package peerexpressroutecircuitconnections - -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(&PeerConnectionId{}) -} - -var _ resourceids.ResourceId = &PeerConnectionId{} - -// PeerConnectionId is a struct representing the Resource ID for a Peer Connection -type PeerConnectionId struct { - SubscriptionId string - ResourceGroupName string - ExpressRouteCircuitName string - PeeringName string - PeerConnectionName string -} - -// NewPeerConnectionID returns a new PeerConnectionId struct -func NewPeerConnectionID(subscriptionId string, resourceGroupName string, expressRouteCircuitName string, peeringName string, peerConnectionName string) PeerConnectionId { - return PeerConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ExpressRouteCircuitName: expressRouteCircuitName, - PeeringName: peeringName, - PeerConnectionName: peerConnectionName, - } -} - -// ParsePeerConnectionID parses 'input' into a PeerConnectionId -func ParsePeerConnectionID(input string) (*PeerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeerConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePeerConnectionIDInsensitively parses 'input' case-insensitively into a PeerConnectionId -// note: this method should only be used for API response data and not user input -func ParsePeerConnectionIDInsensitively(input string) (*PeerConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&PeerConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PeerConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PeerConnectionId) 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.ExpressRouteCircuitName, ok = input.Parsed["expressRouteCircuitName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "expressRouteCircuitName", input) - } - - if id.PeeringName, ok = input.Parsed["peeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peeringName", input) - } - - if id.PeerConnectionName, ok = input.Parsed["peerConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "peerConnectionName", input) - } - - return nil -} - -// ValidatePeerConnectionID checks that 'input' can be parsed as a Peer Connection ID -func ValidatePeerConnectionID(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 := ParsePeerConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Peer Connection ID -func (id PeerConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/expressRouteCircuits/%s/peerings/%s/peerConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ExpressRouteCircuitName, id.PeeringName, id.PeerConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Peer Connection ID -func (id PeerConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticExpressRouteCircuits", "expressRouteCircuits", "expressRouteCircuits"), - resourceids.UserSpecifiedSegment("expressRouteCircuitName", "expressRouteCircuitValue"), - resourceids.StaticSegment("staticPeerings", "peerings", "peerings"), - resourceids.UserSpecifiedSegment("peeringName", "peeringValue"), - resourceids.StaticSegment("staticPeerConnections", "peerConnections", "peerConnections"), - resourceids.UserSpecifiedSegment("peerConnectionName", "peerConnectionValue"), - } -} - -// String returns a human-readable description of this Peer Connection ID -func (id PeerConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Express Route Circuit Name: %q", id.ExpressRouteCircuitName), - fmt.Sprintf("Peering Name: %q", id.PeeringName), - fmt.Sprintf("Peer Connection Name: %q", id.PeerConnectionName), - } - return fmt.Sprintf("Peer Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection_test.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection_test.go deleted file mode 100644 index df242ff6d30..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/id_peerconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package peerexpressroutecircuitconnections - -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 = &PeerConnectionId{} - -func TestNewPeerConnectionID(t *testing.T) { - id := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue") - - 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.ExpressRouteCircuitName != "expressRouteCircuitValue" { - t.Fatalf("Expected %q but got %q for Segment 'ExpressRouteCircuitName'", id.ExpressRouteCircuitName, "expressRouteCircuitValue") - } - - if id.PeeringName != "peeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeeringName'", id.PeeringName, "peeringValue") - } - - if id.PeerConnectionName != "peerConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PeerConnectionName'", id.PeerConnectionName, "peerConnectionValue") - } -} - -func TestFormatPeerConnectionID(t *testing.T) { - actual := NewPeerConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "expressRouteCircuitValue", "peeringValue", "peerConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePeerConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue", - Expected: &PeerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - PeerConnectionName: "peerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeerConnectionID(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.PeerConnectionName != v.Expected.PeerConnectionName { - t.Fatalf("Expected %q but got %q for PeerConnectionName", v.Expected.PeerConnectionName, actual.PeerConnectionName) - } - - } -} - -func TestParsePeerConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PeerConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/pEeRcOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue", - Expected: &PeerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ExpressRouteCircuitName: "expressRouteCircuitValue", - PeeringName: "peeringValue", - PeerConnectionName: "peerConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/expressRouteCircuits/expressRouteCircuitValue/peerings/peeringValue/peerConnections/peerConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNvAlUe", - Expected: &PeerConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ExpressRouteCircuitName: "eXpReSsRoUtEcIrCuItVaLuE", - PeeringName: "pEeRiNgVaLuE", - PeerConnectionName: "pEeRcOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/eXpReSsRoUtEcIrCuItS/eXpReSsRoUtEcIrCuItVaLuE/pEeRiNgS/pEeRiNgVaLuE/pEeRcOnNeCtIoNs/pEeRcOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePeerConnectionIDInsensitively(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.ExpressRouteCircuitName != v.Expected.ExpressRouteCircuitName { - t.Fatalf("Expected %q but got %q for ExpressRouteCircuitName", v.Expected.ExpressRouteCircuitName, actual.ExpressRouteCircuitName) - } - - if actual.PeeringName != v.Expected.PeeringName { - t.Fatalf("Expected %q but got %q for PeeringName", v.Expected.PeeringName, actual.PeeringName) - } - - if actual.PeerConnectionName != v.Expected.PeerConnectionName { - t.Fatalf("Expected %q but got %q for PeerConnectionName", v.Expected.PeerConnectionName, actual.PeerConnectionName) - } - - } -} - -func TestSegmentsForPeerConnectionId(t *testing.T) { - segments := PeerConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PeerConnectionId 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/network/2023-06-01/peerexpressroutecircuitconnections/method_get.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_get.go deleted file mode 100644 index 844c3c67e07..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package peerexpressroutecircuitconnections - -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 *PeerExpressRouteCircuitConnection -} - -// Get ... -func (c PeerExpressRouteCircuitConnectionsClient) Get(ctx context.Context, id PeerConnectionId) (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 PeerExpressRouteCircuitConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_list.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_list.go deleted file mode 100644 index 58e9b3af846..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package peerexpressroutecircuitconnections - -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 *[]PeerExpressRouteCircuitConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PeerExpressRouteCircuitConnection -} - -// List ... -func (c PeerExpressRouteCircuitConnectionsClient) List(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerConnections", 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 *[]PeerExpressRouteCircuitConnection `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 PeerExpressRouteCircuitConnectionsClient) ListComplete(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PeerExpressRouteCircuitConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PeerExpressRouteCircuitConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ExpressRouteCircuitPeeringId, predicate PeerExpressRouteCircuitConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PeerExpressRouteCircuitConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index 0ba2f68f213..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index c4a72c247d0..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_subresource.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_subresource.go deleted file mode 100644 index da8f131efb2..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/predicates.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/predicates.go deleted file mode 100644 index c0766bb2d18..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package peerexpressroutecircuitconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p PeerExpressRouteCircuitConnectionOperationPredicate) Matches(input PeerExpressRouteCircuitConnection) 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.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/network/2023-06-01/peerexpressroutecircuitconnections/version.go b/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/version.go deleted file mode 100644 index e336f8814d1..00000000000 --- a/resource-manager/network/2023-06-01/peerexpressroutecircuitconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package peerexpressroutecircuitconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/peerexpressroutecircuitconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/README.md b/resource-manager/network/2023-06-01/privatednszonegroups/README.md deleted file mode 100644 index 372d4a80257..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privatednszonegroups` Documentation - -The `privatednszonegroups` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/privatednszonegroups" -``` - - -### Client Initialization - -```go -client := privatednszonegroups.NewPrivateDnsZoneGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -payload := privatednszonegroups.PrivateDnsZoneGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.Delete` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateDnsZoneGroupsClient.Get` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - -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: `PrivateDnsZoneGroupsClient.List` - -```go -ctx := context.TODO() -id := privatednszonegroups.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -// 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/network/2023-06-01/privatednszonegroups/client.go b/resource-manager/network/2023-06-01/privatednszonegroups/client.go deleted file mode 100644 index 99ce8b6667e..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatednszonegroups - -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 PrivateDnsZoneGroupsClient struct { - Client *resourcemanager.Client -} - -func NewPrivateDnsZoneGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateDnsZoneGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatednszonegroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateDnsZoneGroupsClient: %+v", err) - } - - return &PrivateDnsZoneGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/constants.go b/resource-manager/network/2023-06-01/privatednszonegroups/constants.go deleted file mode 100644 index a68ae3a4523..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package privatednszonegroups - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup.go b/resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup.go deleted file mode 100644 index 9399f9157d3..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package privatednszonegroups - -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(&PrivateDnsZoneGroupId{}) -} - -var _ resourceids.ResourceId = &PrivateDnsZoneGroupId{} - -// PrivateDnsZoneGroupId is a struct representing the Resource ID for a Private Dns Zone Group -type PrivateDnsZoneGroupId struct { - SubscriptionId string - ResourceGroupName string - PrivateEndpointName string - PrivateDnsZoneGroupName string -} - -// NewPrivateDnsZoneGroupID returns a new PrivateDnsZoneGroupId struct -func NewPrivateDnsZoneGroupID(subscriptionId string, resourceGroupName string, privateEndpointName string, privateDnsZoneGroupName string) PrivateDnsZoneGroupId { - return PrivateDnsZoneGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateEndpointName: privateEndpointName, - PrivateDnsZoneGroupName: privateDnsZoneGroupName, - } -} - -// ParsePrivateDnsZoneGroupID parses 'input' into a PrivateDnsZoneGroupId -func ParsePrivateDnsZoneGroupID(input string) (*PrivateDnsZoneGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateDnsZoneGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateDnsZoneGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateDnsZoneGroupIDInsensitively parses 'input' case-insensitively into a PrivateDnsZoneGroupId -// note: this method should only be used for API response data and not user input -func ParsePrivateDnsZoneGroupIDInsensitively(input string) (*PrivateDnsZoneGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateDnsZoneGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateDnsZoneGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateDnsZoneGroupId) 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.PrivateEndpointName, ok = input.Parsed["privateEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointName", input) - } - - if id.PrivateDnsZoneGroupName, ok = input.Parsed["privateDnsZoneGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateDnsZoneGroupName", input) - } - - return nil -} - -// ValidatePrivateDnsZoneGroupID checks that 'input' can be parsed as a Private Dns Zone Group ID -func ValidatePrivateDnsZoneGroupID(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 := ParsePrivateDnsZoneGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Dns Zone Group ID -func (id PrivateDnsZoneGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateEndpoints/%s/privateDnsZoneGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateEndpointName, id.PrivateDnsZoneGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Dns Zone Group ID -func (id PrivateDnsZoneGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateEndpoints", "privateEndpoints", "privateEndpoints"), - resourceids.UserSpecifiedSegment("privateEndpointName", "privateEndpointValue"), - resourceids.StaticSegment("staticPrivateDnsZoneGroups", "privateDnsZoneGroups", "privateDnsZoneGroups"), - resourceids.UserSpecifiedSegment("privateDnsZoneGroupName", "privateDnsZoneGroupValue"), - } -} - -// String returns a human-readable description of this Private Dns Zone Group ID -func (id PrivateDnsZoneGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Endpoint Name: %q", id.PrivateEndpointName), - fmt.Sprintf("Private Dns Zone Group Name: %q", id.PrivateDnsZoneGroupName), - } - return fmt.Sprintf("Private Dns Zone Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup_test.go b/resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup_test.go deleted file mode 100644 index f2c846d6c2f..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/id_privatednszonegroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package privatednszonegroups - -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 = &PrivateDnsZoneGroupId{} - -func TestNewPrivateDnsZoneGroupID(t *testing.T) { - id := NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue") - - 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.PrivateEndpointName != "privateEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointName'", id.PrivateEndpointName, "privateEndpointValue") - } - - if id.PrivateDnsZoneGroupName != "privateDnsZoneGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateDnsZoneGroupName'", id.PrivateDnsZoneGroupName, "privateDnsZoneGroupValue") - } -} - -func TestFormatPrivateDnsZoneGroupID(t *testing.T) { - actual := NewPrivateDnsZoneGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue", "privateDnsZoneGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateDnsZoneGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateDnsZoneGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue", - Expected: &PrivateDnsZoneGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - PrivateDnsZoneGroupName: "privateDnsZoneGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateDnsZoneGroupID(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - if actual.PrivateDnsZoneGroupName != v.Expected.PrivateDnsZoneGroupName { - t.Fatalf("Expected %q but got %q for PrivateDnsZoneGroupName", v.Expected.PrivateDnsZoneGroupName, actual.PrivateDnsZoneGroupName) - } - - } -} - -func TestParsePrivateDnsZoneGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateDnsZoneGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/pRiVaTeDnSzOnEgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue", - Expected: &PrivateDnsZoneGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - PrivateDnsZoneGroupName: "privateDnsZoneGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/privateDnsZoneGroups/privateDnsZoneGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/pRiVaTeDnSzOnEgRoUpS/pRiVaTeDnSzOnEgRoUpVaLuE", - Expected: &PrivateDnsZoneGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateEndpointName: "pRiVaTeEnDpOiNtVaLuE", - PrivateDnsZoneGroupName: "pRiVaTeDnSzOnEgRoUpVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/pRiVaTeDnSzOnEgRoUpS/pRiVaTeDnSzOnEgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateDnsZoneGroupIDInsensitively(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - if actual.PrivateDnsZoneGroupName != v.Expected.PrivateDnsZoneGroupName { - t.Fatalf("Expected %q but got %q for PrivateDnsZoneGroupName", v.Expected.PrivateDnsZoneGroupName, actual.PrivateDnsZoneGroupName) - } - - } -} - -func TestSegmentsForPrivateDnsZoneGroupId(t *testing.T) { - segments := PrivateDnsZoneGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateDnsZoneGroupId 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/network/2023-06-01/privatednszonegroups/id_privateendpoint.go b/resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint.go deleted file mode 100644 index a9f6cc5dff2..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatednszonegroups - -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(&PrivateEndpointId{}) -} - -var _ resourceids.ResourceId = &PrivateEndpointId{} - -// PrivateEndpointId is a struct representing the Resource ID for a Private Endpoint -type PrivateEndpointId struct { - SubscriptionId string - ResourceGroupName string - PrivateEndpointName string -} - -// NewPrivateEndpointID returns a new PrivateEndpointId struct -func NewPrivateEndpointID(subscriptionId string, resourceGroupName string, privateEndpointName string) PrivateEndpointId { - return PrivateEndpointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateEndpointName: privateEndpointName, - } -} - -// ParsePrivateEndpointID parses 'input' into a PrivateEndpointId -func ParsePrivateEndpointID(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateEndpointIDInsensitively parses 'input' case-insensitively into a PrivateEndpointId -// note: this method should only be used for API response data and not user input -func ParsePrivateEndpointIDInsensitively(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateEndpointId) 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.PrivateEndpointName, ok = input.Parsed["privateEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointName", input) - } - - return nil -} - -// ValidatePrivateEndpointID checks that 'input' can be parsed as a Private Endpoint ID -func ValidatePrivateEndpointID(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 := ParsePrivateEndpointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Endpoint ID -func (id PrivateEndpointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateEndpoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateEndpointName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint ID -func (id PrivateEndpointId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateEndpoints", "privateEndpoints", "privateEndpoints"), - resourceids.UserSpecifiedSegment("privateEndpointName", "privateEndpointValue"), - } -} - -// String returns a human-readable description of this Private Endpoint ID -func (id PrivateEndpointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Endpoint Name: %q", id.PrivateEndpointName), - } - return fmt.Sprintf("Private Endpoint (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint_test.go b/resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint_test.go deleted file mode 100644 index d2c81acb9f9..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/id_privateendpoint_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatednszonegroups - -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 = &PrivateEndpointId{} - -func TestNewPrivateEndpointID(t *testing.T) { - id := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - - 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.PrivateEndpointName != "privateEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointName'", id.PrivateEndpointName, "privateEndpointValue") - } -} - -func TestFormatPrivateEndpointID(t *testing.T) { - actual := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateEndpointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointID(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestParsePrivateEndpointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateEndpointName: "pRiVaTeEnDpOiNtVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointIDInsensitively(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestSegmentsForPrivateEndpointId(t *testing.T) { - segments := PrivateEndpointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateEndpointId 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/network/2023-06-01/privatednszonegroups/method_createorupdate.go b/resource-manager/network/2023-06-01/privatednszonegroups/method_createorupdate.go deleted file mode 100644 index 88dadb3a0a5..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatednszonegroups - -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 *PrivateDnsZoneGroup -} - -// CreateOrUpdate ... -func (c PrivateDnsZoneGroupsClient) CreateOrUpdate(ctx context.Context, id PrivateDnsZoneGroupId, input PrivateDnsZoneGroup) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateDnsZoneGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateDnsZoneGroupId, input PrivateDnsZoneGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/privatednszonegroups/method_delete.go b/resource-manager/network/2023-06-01/privatednszonegroups/method_delete.go deleted file mode 100644 index cdf382f2686..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatednszonegroups - -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 PrivateDnsZoneGroupsClient) Delete(ctx context.Context, id PrivateDnsZoneGroupId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateDnsZoneGroupsClient) DeleteThenPoll(ctx context.Context, id PrivateDnsZoneGroupId) 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/network/2023-06-01/privatednszonegroups/method_get.go b/resource-manager/network/2023-06-01/privatednszonegroups/method_get.go deleted file mode 100644 index 3c25fca99b7..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package privatednszonegroups - -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 *PrivateDnsZoneGroup -} - -// Get ... -func (c PrivateDnsZoneGroupsClient) Get(ctx context.Context, id PrivateDnsZoneGroupId) (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 PrivateDnsZoneGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/method_list.go b/resource-manager/network/2023-06-01/privatednszonegroups/method_list.go deleted file mode 100644 index 5328faa005f..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatednszonegroups - -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 *[]PrivateDnsZoneGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateDnsZoneGroup -} - -// List ... -func (c PrivateDnsZoneGroupsClient) List(ctx context.Context, id PrivateEndpointId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/privateDnsZoneGroups", 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 *[]PrivateDnsZoneGroup `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 PrivateDnsZoneGroupsClient) ListComplete(ctx context.Context, id PrivateEndpointId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateDnsZoneGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateDnsZoneGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id PrivateEndpointId, predicate PrivateDnsZoneGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateDnsZoneGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/privatednszonegroups/model_privatednszoneconfig.go b/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszoneconfig.go deleted file mode 100644 index e44ef143e5c..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszoneconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneConfig struct { - Name *string `json:"name,omitempty"` - Properties *PrivateDnsZonePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegroup.go b/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegroup.go deleted file mode 100644 index 75533fc47a5..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateDnsZoneGroupPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go b/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go deleted file mode 100644 index f892f554965..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonegrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneGroupPropertiesFormat struct { - PrivateDnsZoneConfigs *[]PrivateDnsZoneConfig `json:"privateDnsZoneConfigs,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonepropertiesformat.go b/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonepropertiesformat.go deleted file mode 100644 index 33858bfe24e..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/model_privatednszonepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZonePropertiesFormat struct { - PrivateDnsZoneId *string `json:"privateDnsZoneId,omitempty"` - RecordSets *[]RecordSet `json:"recordSets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/model_recordset.go b/resource-manager/network/2023-06-01/privatednszonegroups/model_recordset.go deleted file mode 100644 index 4a39969425d..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/model_recordset.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecordSet struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RecordSetName *string `json:"recordSetName,omitempty"` - RecordType *string `json:"recordType,omitempty"` - Ttl *int64 `json:"ttl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/predicates.go b/resource-manager/network/2023-06-01/privatednszonegroups/predicates.go deleted file mode 100644 index 4d27803d6e2..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatednszonegroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateDnsZoneGroupOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p PrivateDnsZoneGroupOperationPredicate) Matches(input PrivateDnsZoneGroup) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/privatednszonegroups/version.go b/resource-manager/network/2023-06-01/privatednszonegroups/version.go deleted file mode 100644 index 0994f68644f..00000000000 --- a/resource-manager/network/2023-06-01/privatednszonegroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatednszonegroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatednszonegroups/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/README.md b/resource-manager/network/2023-06-01/privateendpoints/README.md deleted file mode 100644 index 626ecf923cc..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/README.md +++ /dev/null @@ -1,134 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privateendpoints` Documentation - -The `privateendpoints` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/privateendpoints" -``` - - -### Client Initialization - -```go -client := privateendpoints.NewPrivateEndpointsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesList` - -```go -ctx := context.TODO() -id := privateendpoints.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.AvailablePrivateEndpointTypesList(ctx, id)` can be used to do batched pagination -items, err := client.AvailablePrivateEndpointTypesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateEndpointsClient.AvailablePrivateEndpointTypesListByResourceGroup` - -```go -ctx := context.TODO() -id := privateendpoints.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateEndpointsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -payload := privateendpoints.PrivateEndpoint{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointsClient.Delete` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateEndpointsClient.Get` - -```go -ctx := context.TODO() -id := privateendpoints.NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - -read, err := client.Get(ctx, id, privateendpoints.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateEndpointsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PrivateEndpointsClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/privateendpoints/client.go b/resource-manager/network/2023-06-01/privateendpoints/client.go deleted file mode 100644 index 149437b1334..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privateendpoints - -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 PrivateEndpointsClient struct { - Client *resourcemanager.Client -} - -func NewPrivateEndpointsClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateEndpointsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privateendpoints", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateEndpointsClient: %+v", err) - } - - return &PrivateEndpointsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/constants.go b/resource-manager/network/2023-06-01/privateendpoints/constants.go deleted file mode 100644 index fe61de76a0e..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privateendpoints - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/id_location.go b/resource-manager/network/2023-06-01/privateendpoints/id_location.go deleted file mode 100644 index 54b43b4b1f2..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package privateendpoints - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/privateendpoints/id_location_test.go b/resource-manager/network/2023-06-01/privateendpoints/id_location_test.go deleted file mode 100644 index b9fa098002a..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package privateendpoints - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/privateendpoints/id_privateendpoint.go b/resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint.go deleted file mode 100644 index a104325012e..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint.go +++ /dev/null @@ -1,130 +0,0 @@ -package privateendpoints - -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(&PrivateEndpointId{}) -} - -var _ resourceids.ResourceId = &PrivateEndpointId{} - -// PrivateEndpointId is a struct representing the Resource ID for a Private Endpoint -type PrivateEndpointId struct { - SubscriptionId string - ResourceGroupName string - PrivateEndpointName string -} - -// NewPrivateEndpointID returns a new PrivateEndpointId struct -func NewPrivateEndpointID(subscriptionId string, resourceGroupName string, privateEndpointName string) PrivateEndpointId { - return PrivateEndpointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateEndpointName: privateEndpointName, - } -} - -// ParsePrivateEndpointID parses 'input' into a PrivateEndpointId -func ParsePrivateEndpointID(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateEndpointIDInsensitively parses 'input' case-insensitively into a PrivateEndpointId -// note: this method should only be used for API response data and not user input -func ParsePrivateEndpointIDInsensitively(input string) (*PrivateEndpointId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateEndpointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateEndpointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateEndpointId) 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.PrivateEndpointName, ok = input.Parsed["privateEndpointName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateEndpointName", input) - } - - return nil -} - -// ValidatePrivateEndpointID checks that 'input' can be parsed as a Private Endpoint ID -func ValidatePrivateEndpointID(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 := ParsePrivateEndpointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Endpoint ID -func (id PrivateEndpointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateEndpoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateEndpointName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Endpoint ID -func (id PrivateEndpointId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateEndpoints", "privateEndpoints", "privateEndpoints"), - resourceids.UserSpecifiedSegment("privateEndpointName", "privateEndpointValue"), - } -} - -// String returns a human-readable description of this Private Endpoint ID -func (id PrivateEndpointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Endpoint Name: %q", id.PrivateEndpointName), - } - return fmt.Sprintf("Private Endpoint (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint_test.go b/resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint_test.go deleted file mode 100644 index 8a94615f8fc..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/id_privateendpoint_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privateendpoints - -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 = &PrivateEndpointId{} - -func TestNewPrivateEndpointID(t *testing.T) { - id := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue") - - 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.PrivateEndpointName != "privateEndpointValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointName'", id.PrivateEndpointName, "privateEndpointValue") - } -} - -func TestFormatPrivateEndpointID(t *testing.T) { - actual := NewPrivateEndpointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateEndpointValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateEndpointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointID(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestParsePrivateEndpointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateEndpointId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateEndpointName: "privateEndpointValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateEndpoints/privateEndpointValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE", - Expected: &PrivateEndpointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateEndpointName: "pRiVaTeEnDpOiNtVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeEnDpOiNtS/pRiVaTeEnDpOiNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateEndpointIDInsensitively(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.PrivateEndpointName != v.Expected.PrivateEndpointName { - t.Fatalf("Expected %q but got %q for PrivateEndpointName", v.Expected.PrivateEndpointName, actual.PrivateEndpointName) - } - - } -} - -func TestSegmentsForPrivateEndpointId(t *testing.T) { - segments := PrivateEndpointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateEndpointId 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/network/2023-06-01/privateendpoints/id_providerlocation.go b/resource-manager/network/2023-06-01/privateendpoints/id_providerlocation.go deleted file mode 100644 index a70739b937d..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package privateendpoints - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/id_providerlocation_test.go b/resource-manager/network/2023-06-01/privateendpoints/id_providerlocation_test.go deleted file mode 100644 index 8fbe88bd140..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privateendpoints - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslist.go b/resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslist.go deleted file mode 100644 index d7fdaf55d21..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package privateendpoints - -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 AvailablePrivateEndpointTypesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailablePrivateEndpointType -} - -type AvailablePrivateEndpointTypesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailablePrivateEndpointType -} - -// AvailablePrivateEndpointTypesList ... -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesList(ctx context.Context, id LocationId) (result AvailablePrivateEndpointTypesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availablePrivateEndpointTypes", 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 *[]AvailablePrivateEndpointType `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailablePrivateEndpointTypesListComplete retrieves all the results into a single object -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListComplete(ctx context.Context, id LocationId) (AvailablePrivateEndpointTypesListCompleteResult, error) { - return c.AvailablePrivateEndpointTypesListCompleteMatchingPredicate(ctx, id, AvailablePrivateEndpointTypeOperationPredicate{}) -} - -// AvailablePrivateEndpointTypesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AvailablePrivateEndpointTypeOperationPredicate) (result AvailablePrivateEndpointTypesListCompleteResult, err error) { - items := make([]AvailablePrivateEndpointType, 0) - - resp, err := c.AvailablePrivateEndpointTypesList(ctx, id) - if err != nil { - 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 = AvailablePrivateEndpointTypesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go b/resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go deleted file mode 100644 index acb79f31b4e..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_availableprivateendpointtypeslistbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package privateendpoints - -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 AvailablePrivateEndpointTypesListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AvailablePrivateEndpointType -} - -type AvailablePrivateEndpointTypesListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AvailablePrivateEndpointType -} - -// AvailablePrivateEndpointTypesListByResourceGroup ... -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListByResourceGroup(ctx context.Context, id ProviderLocationId) (result AvailablePrivateEndpointTypesListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/availablePrivateEndpointTypes", 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 *[]AvailablePrivateEndpointType `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AvailablePrivateEndpointTypesListByResourceGroupComplete retrieves all the results into a single object -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListByResourceGroupComplete(ctx context.Context, id ProviderLocationId) (AvailablePrivateEndpointTypesListByResourceGroupCompleteResult, error) { - return c.AvailablePrivateEndpointTypesListByResourceGroupCompleteMatchingPredicate(ctx, id, AvailablePrivateEndpointTypeOperationPredicate{}) -} - -// AvailablePrivateEndpointTypesListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) AvailablePrivateEndpointTypesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AvailablePrivateEndpointTypeOperationPredicate) (result AvailablePrivateEndpointTypesListByResourceGroupCompleteResult, err error) { - items := make([]AvailablePrivateEndpointType, 0) - - resp, err := c.AvailablePrivateEndpointTypesListByResourceGroup(ctx, id) - if err != nil { - 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 = AvailablePrivateEndpointTypesListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/method_createorupdate.go b/resource-manager/network/2023-06-01/privateendpoints/method_createorupdate.go deleted file mode 100644 index b5055a0cda4..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privateendpoints - -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 *PrivateEndpoint -} - -// CreateOrUpdate ... -func (c PrivateEndpointsClient) CreateOrUpdate(ctx context.Context, id PrivateEndpointId, input PrivateEndpoint) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateEndpointsClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateEndpointId, input PrivateEndpoint) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/privateendpoints/method_delete.go b/resource-manager/network/2023-06-01/privateendpoints/method_delete.go deleted file mode 100644 index 70f382bf8e3..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privateendpoints - -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 PrivateEndpointsClient) Delete(ctx context.Context, id PrivateEndpointId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateEndpointsClient) DeleteThenPoll(ctx context.Context, id PrivateEndpointId) 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/network/2023-06-01/privateendpoints/method_get.go b/resource-manager/network/2023-06-01/privateendpoints/method_get.go deleted file mode 100644 index 5f913d65fd2..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package privateendpoints - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpoint -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PrivateEndpointsClient) Get(ctx context.Context, id PrivateEndpointId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PrivateEndpoint - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/method_list.go b/resource-manager/network/2023-06-01/privateendpoints/method_list.go deleted file mode 100644 index 75a99d85e75..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package privateendpoints - -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 *[]PrivateEndpoint -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpoint -} - -// List ... -func (c PrivateEndpointsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateEndpoints", 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 *[]PrivateEndpoint `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 PrivateEndpointsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateEndpointOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PrivateEndpointOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateEndpoint, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/privateendpoints/method_listbysubscription.go b/resource-manager/network/2023-06-01/privateendpoints/method_listbysubscription.go deleted file mode 100644 index 77e12002881..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package privateendpoints - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateEndpoint -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpoint -} - -// ListBySubscription ... -func (c PrivateEndpointsClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateEndpoints", 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 *[]PrivateEndpoint `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c PrivateEndpointsClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, PrivateEndpointOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateEndpointsClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PrivateEndpointOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]PrivateEndpoint, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b8767a924d3..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index faea7af9635..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index bc45532ef99..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfiguration.go deleted file mode 100644 index d7b619385a0..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 0975b3a3c18..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygroup.go deleted file mode 100644 index b514ce65a10..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index c505be8adad..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_availableprivateendpointtype.go b/resource-manager/network/2023-06-01/privateendpoints/model_availableprivateendpointtype.go deleted file mode 100644 index c6aa8839dc1..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_availableprivateendpointtype.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailablePrivateEndpointType struct { - DisplayName *string `json:"displayName,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspool.go b/resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspool.go deleted file mode 100644 index afaee89cd0a..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 7079b861291..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index a078479b1cf..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_ddossettings.go b/resource-manager/network/2023-06-01/privateendpoints/model_ddossettings.go deleted file mode 100644 index 6253ff1e5a4..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_delegation.go b/resource-manager/network/2023-06-01/privateendpoints/model_delegation.go deleted file mode 100644 index fd6104e1e68..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_flowlog.go b/resource-manager/network/2023-06-01/privateendpoints/model_flowlog.go deleted file mode 100644 index bce1bcfe8ad..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/privateendpoints/model_flowlogformatparameters.go deleted file mode 100644 index a15c48049c6..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_flowlogpropertiesformat.go deleted file mode 100644 index 6f45378b9d1..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfiguration.go deleted file mode 100644 index 3dcb8560fec..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package privateendpoints - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 8980fc3756f..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index dde47c23fb2..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrule.go b/resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrule.go deleted file mode 100644 index 38c0ffd6728..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index b952302ddeb..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_ipconfiguration.go deleted file mode 100644 index cf18ee9415b..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofile.go deleted file mode 100644 index d493529c992..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index dabdbd7c841..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index fdfdcd1d175..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_iptag.go b/resource-manager/network/2023-06-01/privateendpoints/model_iptag.go deleted file mode 100644 index 83206500edc..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// 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/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddress.go deleted file mode 100644 index ee77fec93c3..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 9be73b64841..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_natgateway.go b/resource-manager/network/2023-06-01/privateendpoints/model_natgateway.go deleted file mode 100644 index e197bcd7ada..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package privateendpoints - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_natgatewaypropertiesformat.go deleted file mode 100644 index fc0ee1ef6da..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_natgatewaysku.go b/resource-manager/network/2023-06-01/privateendpoints/model_natgatewaysku.go deleted file mode 100644 index c0b2d583e49..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_natruleportmapping.go b/resource-manager/network/2023-06-01/privateendpoints/model_natruleportmapping.go deleted file mode 100644 index 07eeaf979f4..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterface.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterface.go deleted file mode 100644 index 9e9c7fcfa82..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacednssettings.go deleted file mode 100644 index 5182d846bf1..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfiguration.go deleted file mode 100644 index e41eb348a7b..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index ac6a234dd34..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index cacb1e17719..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacepropertiesformat.go deleted file mode 100644 index a5fd36f9266..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfiguration.go deleted file mode 100644 index ebe35c0a178..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 54e437f339f..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygroup.go deleted file mode 100644 index cb420b60990..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index b03a951faff..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpoint.go b/resource-manager/network/2023-06-01/privateendpoints/model_privateendpoint.go deleted file mode 100644 index 5e9da21fedb..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnection.go deleted file mode 100644 index 5bd8301f4f3..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/privateendpoints/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8c0662fe4e2..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfiguration.go deleted file mode 100644 index 1fbe08553f6..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 3772b023f53..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointproperties.go deleted file mode 100644 index ac88e7637f3..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkservice.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkservice.go deleted file mode 100644 index e4c8723fc8b..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnection.go deleted file mode 100644 index be10aca683d..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index da2a7ed3871..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 1d19bec0830..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 358ee0e7450..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 81634dd44b1..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceproperties.go deleted file mode 100644 index d246ec00f40..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddress.go b/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddress.go deleted file mode 100644 index eeca2133c31..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package privateendpoints - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddressdnssettings.go deleted file mode 100644 index bc8acd1515a..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresspropertiesformat.go deleted file mode 100644 index bed9d0ba8d7..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresssku.go deleted file mode 100644 index 2bbd107f243..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlink.go deleted file mode 100644 index d8890442923..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlinkformat.go deleted file mode 100644 index 281da0ffc97..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_resourceset.go b/resource-manager/network/2023-06-01/privateendpoints/model_resourceset.go deleted file mode 100644 index 999b1817a30..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/privateendpoints/model_retentionpolicyparameters.go deleted file mode 100644 index b3df6ba5fd1..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_route.go b/resource-manager/network/2023-06-01/privateendpoints/model_route.go deleted file mode 100644 index 98c7a5ae476..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_routepropertiesformat.go deleted file mode 100644 index ca3956916f3..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_routetable.go b/resource-manager/network/2023-06-01/privateendpoints/model_routetable.go deleted file mode 100644 index e1f695300d8..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_routetablepropertiesformat.go deleted file mode 100644 index 4976a28f0ea..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_securityrule.go b/resource-manager/network/2023-06-01/privateendpoints/model_securityrule.go deleted file mode 100644 index ccfc50b4a7e..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_securityrulepropertiesformat.go deleted file mode 100644 index 2b19d6a628d..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlink.go deleted file mode 100644 index a88015b02e1..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 7a779312074..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 84e538e8350..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicy.go deleted file mode 100644 index ea8ff121174..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinition.go deleted file mode 100644 index cc2054776fa..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 8355dfbaae0..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index dbdcdea1442..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5b54f3ef673..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_subnet.go b/resource-manager/network/2023-06-01/privateendpoints/model_subnet.go deleted file mode 100644 index 1eee73db2bd..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_subnetpropertiesformat.go deleted file mode 100644 index bf9784055d4..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_subresource.go b/resource-manager/network/2023-06-01/privateendpoints/model_subresource.go deleted file mode 100644 index 134c4f66102..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index fc7cf55257e..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsproperties.go deleted file mode 100644 index 8a4f6042fa4..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktap.go deleted file mode 100644 index 99fe7d7fe1d..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index c7fa6565e0f..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privateendpoints/predicates.go b/resource-manager/network/2023-06-01/privateendpoints/predicates.go deleted file mode 100644 index c99098d0163..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/predicates.go +++ /dev/null @@ -1,70 +0,0 @@ -package privateendpoints - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AvailablePrivateEndpointTypeOperationPredicate struct { - DisplayName *string - Id *string - Name *string - ResourceName *string - Type *string -} - -func (p AvailablePrivateEndpointTypeOperationPredicate) Matches(input AvailablePrivateEndpointType) bool { - - if p.DisplayName != nil && (input.DisplayName == nil || *p.DisplayName != *input.DisplayName) { - return false - } - - 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.ResourceName != nil && (input.ResourceName == nil || *p.ResourceName != *input.ResourceName) { - return false - } - - if p.Type != nil && (input.Type == nil || *p.Type != *input.Type) { - return false - } - - return true -} - -type PrivateEndpointOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PrivateEndpointOperationPredicate) Matches(input PrivateEndpoint) 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 && (input.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/network/2023-06-01/privateendpoints/version.go b/resource-manager/network/2023-06-01/privateendpoints/version.go deleted file mode 100644 index 47c11ce749f..00000000000 --- a/resource-manager/network/2023-06-01/privateendpoints/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privateendpoints - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privateendpoints/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/README.md b/resource-manager/network/2023-06-01/privatelinkservice/README.md deleted file mode 100644 index d9cccc4507b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privatelinkservice` Documentation - -The `privatelinkservice` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/privatelinkservice" -``` - - -### Client Initialization - -```go -client := privatelinkservice.NewPrivateLinkServiceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkServiceClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := privatelinkservice.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -payload := privatelinkservice.PrivateLinkService{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/privatelinkservice/client.go b/resource-manager/network/2023-06-01/privatelinkservice/client.go deleted file mode 100644 index a89ea113cc4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkservice - -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 PrivateLinkServiceClient struct { - Client *resourcemanager.Client -} - -func NewPrivateLinkServiceClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkServiceClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatelinkservice", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkServiceClient: %+v", err) - } - - return &PrivateLinkServiceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/constants.go b/resource-manager/network/2023-06-01/privatelinkservice/constants.go deleted file mode 100644 index daeb4295f4c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privatelinkservice - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice.go b/resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice.go deleted file mode 100644 index 21ea63899b3..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkservice - -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(&PrivateLinkServiceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkServiceId{} - -// PrivateLinkServiceId is a struct representing the Resource ID for a Private Link Service -type PrivateLinkServiceId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkServiceName string -} - -// NewPrivateLinkServiceID returns a new PrivateLinkServiceId struct -func NewPrivateLinkServiceID(subscriptionId string, resourceGroupName string, privateLinkServiceName string) PrivateLinkServiceId { - return PrivateLinkServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkServiceName: privateLinkServiceName, - } -} - -// ParsePrivateLinkServiceID parses 'input' into a PrivateLinkServiceId -func ParsePrivateLinkServiceID(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkServiceIDInsensitively parses 'input' case-insensitively into a PrivateLinkServiceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkServiceIDInsensitively(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkServiceId) 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.PrivateLinkServiceName, ok = input.Parsed["privateLinkServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkServiceName", input) - } - - return nil -} - -// ValidatePrivateLinkServiceID checks that 'input' can be parsed as a Private Link Service ID -func ValidatePrivateLinkServiceID(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 := ParsePrivateLinkServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Service ID -func (id PrivateLinkServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateLinkServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Service ID -func (id PrivateLinkServiceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceValue"), - } -} - -// String returns a human-readable description of this Private Link Service ID -func (id PrivateLinkServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Service Name: %q", id.PrivateLinkServiceName), - } - return fmt.Sprintf("Private Link Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice_test.go b/resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice_test.go deleted file mode 100644 index 89770988ce4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/id_privatelinkservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkservice - -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 = &PrivateLinkServiceId{} - -func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - - 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.PrivateLinkServiceName != "privateLinkServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceValue") - } -} - -func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceID(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEvAlUe", - }, - }, - { - // 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.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceIDInsensitively(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestSegmentsForPrivateLinkServiceId(t *testing.T) { - segments := PrivateLinkServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkServiceId 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/network/2023-06-01/privatelinkservice/method_createorupdate.go b/resource-manager/network/2023-06-01/privatelinkservice/method_createorupdate.go deleted file mode 100644 index 6025cc20fb9..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatelinkservice - -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 *PrivateLinkService -} - -// CreateOrUpdate ... -func (c PrivateLinkServiceClient) CreateOrUpdate(ctx context.Context, id PrivateLinkServiceId, input PrivateLinkService) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PrivateLinkServiceClient) CreateOrUpdateThenPoll(ctx context.Context, id PrivateLinkServiceId, input PrivateLinkService) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 37bf309268d..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 727bb2c29ae..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index ce6b69f5f1c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 8eb6892414c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 08c65321f9b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygroup.go deleted file mode 100644 index 65af972a908..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 7053e6085f8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspool.go b/resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspool.go deleted file mode 100644 index 4605353c0e8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index dad3a1cbb7e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 64fa8c44b23..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_ddossettings.go b/resource-manager/network/2023-06-01/privatelinkservice/model_ddossettings.go deleted file mode 100644 index 5e258a59dcf..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_delegation.go b/resource-manager/network/2023-06-01/privatelinkservice/model_delegation.go deleted file mode 100644 index 38895e795b0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_flowlog.go b/resource-manager/network/2023-06-01/privatelinkservice/model_flowlog.go deleted file mode 100644 index 368d825fd7e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/privatelinkservice/model_flowlogformatparameters.go deleted file mode 100644 index 75ef563d7b2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_flowlogpropertiesformat.go deleted file mode 100644 index 47d0ad02b7b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfiguration.go deleted file mode 100644 index b2284248cab..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservice - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index e2ab5bed55b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index b0e2ec4fe5b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrule.go b/resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrule.go deleted file mode 100644 index 68fa8ece3f2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index a54a17cf8a7..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfiguration.go deleted file mode 100644 index dd6a48d0e5b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofile.go deleted file mode 100644 index 5e226d14d4d..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 554fee929b4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 62a93ec4c44..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_iptag.go b/resource-manager/network/2023-06-01/privatelinkservice/model_iptag.go deleted file mode 100644 index 7131a53eded..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// 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/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddress.go deleted file mode 100644 index 6ce64f5f2e6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 9abe2a4572f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_natgateway.go b/resource-manager/network/2023-06-01/privatelinkservice/model_natgateway.go deleted file mode 100644 index f9980bf5e6c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package privatelinkservice - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7d3be08b309..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaysku.go b/resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaysku.go deleted file mode 100644 index a7a67521076..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_natruleportmapping.go b/resource-manager/network/2023-06-01/privatelinkservice/model_natruleportmapping.go deleted file mode 100644 index 1c0a32d9e67..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterface.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterface.go deleted file mode 100644 index 4df820c2913..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacednssettings.go deleted file mode 100644 index 16bd0705ad7..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 48b4f130f1a..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index b649c26692b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 0f1de88a39a..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 79f71ee5063..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 3e58e2268a1..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d9c267e2c48..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygroup.go deleted file mode 100644 index bc7b4758c7c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 6a30ce3d224..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpoint.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpoint.go deleted file mode 100644 index 60ed6db0b7b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnection.go deleted file mode 100644 index 6564f05bf19..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/privatelinkservice/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8cdbcae827f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfiguration.go deleted file mode 100644 index f4a1b24ff36..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 14abbc46b00..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointproperties.go deleted file mode 100644 index ca2dc587f19..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkservice.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkservice.go deleted file mode 100644 index 84ab357bba4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnection.go deleted file mode 100644 index 0ab35853be3..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index bc13ca31ec4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index b11296ec55c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 06cf43e9c19..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index e9a6be5f6ba..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceproperties.go deleted file mode 100644 index d23a2b93b7d..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddress.go b/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddress.go deleted file mode 100644 index 10ad261e57f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package privatelinkservice - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddressdnssettings.go deleted file mode 100644 index b2e6f22b6be..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 4597323a4ee..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresssku.go deleted file mode 100644 index 17a772dc295..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlink.go deleted file mode 100644 index 04005314e56..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlinkformat.go deleted file mode 100644 index db56f8f9a50..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_resourceset.go b/resource-manager/network/2023-06-01/privatelinkservice/model_resourceset.go deleted file mode 100644 index 8244a36994e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/privatelinkservice/model_retentionpolicyparameters.go deleted file mode 100644 index a0d81108fdc..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_route.go b/resource-manager/network/2023-06-01/privatelinkservice/model_route.go deleted file mode 100644 index 7d46047e973..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_routepropertiesformat.go deleted file mode 100644 index 55a0f3dc715..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_routetable.go b/resource-manager/network/2023-06-01/privatelinkservice/model_routetable.go deleted file mode 100644 index 11ada0b3ad6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_routetablepropertiesformat.go deleted file mode 100644 index 9231c6ea535..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_securityrule.go b/resource-manager/network/2023-06-01/privatelinkservice/model_securityrule.go deleted file mode 100644 index a6fef4ca3ef..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_securityrulepropertiesformat.go deleted file mode 100644 index 141c746c9fc..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlink.go deleted file mode 100644 index 6d4f38c281f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 6e34df786f4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_servicedelegationpropertiesformat.go deleted file mode 100644 index df4acacdfe6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicy.go deleted file mode 100644 index 164ba053a63..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinition.go deleted file mode 100644 index b85a151c4ba..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 3357b4cc130..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 8094ad8968c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 8278551c833..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_subnet.go b/resource-manager/network/2023-06-01/privatelinkservice/model_subnet.go deleted file mode 100644 index 53bbcfc93b9..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_subnetpropertiesformat.go deleted file mode 100644 index a5f3a3fa88c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_subresource.go b/resource-manager/network/2023-06-01/privatelinkservice/model_subresource.go deleted file mode 100644 index 2295e457c86..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 04a2870aab9..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsproperties.go deleted file mode 100644 index 14cea562579..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktap.go deleted file mode 100644 index 75924e524e2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 0425352fa06..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservice - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservice/version.go b/resource-manager/network/2023-06-01/privatelinkservice/version.go deleted file mode 100644 index f9483b1d758..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservice/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservice - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservice/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/README.md b/resource-manager/network/2023-06-01/privatelinkservices/README.md deleted file mode 100644 index 725b9dee62e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/README.md +++ /dev/null @@ -1,217 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/privatelinkservices` Documentation - -The `privatelinkservices` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/privatelinkservices" -``` - - -### Client Initialization - -```go -client := privatelinkservices.NewPrivateLinkServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibility` - -```go -ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ - // ... -} - - -if err := client.CheckPrivateLinkServiceVisibilityThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.CheckPrivateLinkServiceVisibilityByResourceGroup` - -```go -ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := privatelinkservices.CheckPrivateLinkServiceVisibilityRequest{ - // ... -} - - -if err := client.CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.Delete` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.DeletePrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -if err := client.DeletePrivateEndpointConnectionThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PrivateLinkServicesClient.Get` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -read, err := client.Get(ctx, id, privatelinkservices.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkServicesClient.GetPrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -read, err := client.GetPrivateEndpointConnection(ctx, id, privatelinkservices.DefaultGetPrivateEndpointConnectionOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PrivateLinkServicesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServices` - -```go -ctx := context.TODO() -id := privatelinkservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ListAutoApprovedPrivateLinkServices(ctx, id)` can be used to do batched pagination -items, err := client.ListAutoApprovedPrivateLinkServicesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListAutoApprovedPrivateLinkServicesByResourceGroup` - -```go -ctx := context.TODO() -id := privatelinkservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.ListPrivateEndpointConnections` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - -// alternatively `client.ListPrivateEndpointConnections(ctx, id)` can be used to do batched pagination -items, err := client.ListPrivateEndpointConnectionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PrivateLinkServicesClient.UpdatePrivateEndpointConnection` - -```go -ctx := context.TODO() -id := privatelinkservices.NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue") - -payload := privatelinkservices.PrivateEndpointConnection{ - // ... -} - - -read, err := client.UpdatePrivateEndpointConnection(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/network/2023-06-01/privatelinkservices/client.go b/resource-manager/network/2023-06-01/privatelinkservices/client.go deleted file mode 100644 index 5bd46867c3e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package privatelinkservices - -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 PrivateLinkServicesClient struct { - Client *resourcemanager.Client -} - -func NewPrivateLinkServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*PrivateLinkServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "privatelinkservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PrivateLinkServicesClient: %+v", err) - } - - return &PrivateLinkServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/constants.go b/resource-manager/network/2023-06-01/privatelinkservices/constants.go deleted file mode 100644 index 2205983377c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package privatelinkservices - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/id_location.go b/resource-manager/network/2023-06-01/privatelinkservices/id_location.go deleted file mode 100644 index 34e4ed80520..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package privatelinkservices - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/privatelinkservices/id_location_test.go b/resource-manager/network/2023-06-01/privatelinkservices/id_location_test.go deleted file mode 100644 index e5a86e22039..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package privatelinkservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/privatelinkservices/id_privateendpointconnection.go b/resource-manager/network/2023-06-01/privatelinkservices/id_privateendpointconnection.go deleted file mode 100644 index 3f98898492d..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_privateendpointconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package privatelinkservices - -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 - PrivateLinkServiceName string - PrivateEndpointConnectionName string -} - -// NewPrivateEndpointConnectionID returns a new PrivateEndpointConnectionId struct -func NewPrivateEndpointConnectionID(subscriptionId string, resourceGroupName string, privateLinkServiceName string, privateEndpointConnectionName string) PrivateEndpointConnectionId { - return PrivateEndpointConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkServiceName: privateLinkServiceName, - 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.PrivateLinkServiceName, ok = input.Parsed["privateLinkServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkServiceName", 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.Network/privateLinkServices/%s/privateEndpointConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkServiceName, 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceValue"), - resourceids.StaticSegment("staticPrivateEndpointConnections", "privateEndpointConnections", "privateEndpointConnections"), - resourceids.UserSpecifiedSegment("privateEndpointConnectionName", "privateEndpointConnectionValue"), - } -} - -// 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("Private Link Service Name: %q", id.PrivateLinkServiceName), - 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/network/2023-06-01/privatelinkservices/id_privateendpointconnection_test.go b/resource-manager/network/2023-06-01/privatelinkservices/id_privateendpointconnection_test.go deleted file mode 100644 index b5b92fb48d2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_privateendpointconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package privatelinkservices - -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", "privateLinkServiceValue", "privateEndpointConnectionValue") - - 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.PrivateLinkServiceName != "privateLinkServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceValue") - } - - if id.PrivateEndpointConnectionName != "privateEndpointConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateEndpointConnectionName'", id.PrivateEndpointConnectionName, "privateEndpointConnectionValue") - } -} - -func TestFormatPrivateEndpointConnectionID(t *testing.T) { - actual := NewPrivateEndpointConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue", "privateEndpointConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue/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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - PrivateEndpointConnectionName: "privateEndpointConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/privateEndpointConnections/privateEndpointConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - Expected: &PrivateEndpointConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEvAlUe", - PrivateEndpointConnectionName: "pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/pRiVaTeEnDpOiNtCoNnEcTiOnS/pRiVaTeEnDpOiNtCoNnEcTiOnVaLuE/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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - 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/network/2023-06-01/privatelinkservices/id_privatelinkservice.go b/resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice.go deleted file mode 100644 index d88a974cca5..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkservices - -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(&PrivateLinkServiceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkServiceId{} - -// PrivateLinkServiceId is a struct representing the Resource ID for a Private Link Service -type PrivateLinkServiceId struct { - SubscriptionId string - ResourceGroupName string - PrivateLinkServiceName string -} - -// NewPrivateLinkServiceID returns a new PrivateLinkServiceId struct -func NewPrivateLinkServiceID(subscriptionId string, resourceGroupName string, privateLinkServiceName string) PrivateLinkServiceId { - return PrivateLinkServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PrivateLinkServiceName: privateLinkServiceName, - } -} - -// ParsePrivateLinkServiceID parses 'input' into a PrivateLinkServiceId -func ParsePrivateLinkServiceID(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkServiceIDInsensitively parses 'input' case-insensitively into a PrivateLinkServiceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkServiceIDInsensitively(input string) (*PrivateLinkServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkServiceId) 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.PrivateLinkServiceName, ok = input.Parsed["privateLinkServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkServiceName", input) - } - - return nil -} - -// ValidatePrivateLinkServiceID checks that 'input' can be parsed as a Private Link Service ID -func ValidatePrivateLinkServiceID(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 := ParsePrivateLinkServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Service ID -func (id PrivateLinkServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/privateLinkServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PrivateLinkServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Service ID -func (id PrivateLinkServiceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPrivateLinkServices", "privateLinkServices", "privateLinkServices"), - resourceids.UserSpecifiedSegment("privateLinkServiceName", "privateLinkServiceValue"), - } -} - -// String returns a human-readable description of this Private Link Service ID -func (id PrivateLinkServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Private Link Service Name: %q", id.PrivateLinkServiceName), - } - return fmt.Sprintf("Private Link Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice_test.go b/resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice_test.go deleted file mode 100644 index 08f7741100b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_privatelinkservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkservices - -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 = &PrivateLinkServiceId{} - -func TestNewPrivateLinkServiceID(t *testing.T) { - id := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue") - - 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.PrivateLinkServiceName != "privateLinkServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkServiceName'", id.PrivateLinkServiceName, "privateLinkServiceValue") - } -} - -func TestFormatPrivateLinkServiceID(t *testing.T) { - actual := NewPrivateLinkServiceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "privateLinkServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceID(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestParsePrivateLinkServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkServiceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PrivateLinkServiceName: "privateLinkServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/privateLinkServices/privateLinkServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe", - Expected: &PrivateLinkServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PrivateLinkServiceName: "pRiVaTeLiNkSeRvIcEvAlUe", - }, - }, - { - // 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.nEtWoRk/pRiVaTeLiNkSeRvIcEs/pRiVaTeLiNkSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkServiceIDInsensitively(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.PrivateLinkServiceName != v.Expected.PrivateLinkServiceName { - t.Fatalf("Expected %q but got %q for PrivateLinkServiceName", v.Expected.PrivateLinkServiceName, actual.PrivateLinkServiceName) - } - - } -} - -func TestSegmentsForPrivateLinkServiceId(t *testing.T) { - segments := PrivateLinkServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkServiceId 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/network/2023-06-01/privatelinkservices/id_providerlocation.go b/resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation.go deleted file mode 100644 index c7433defeb6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package privatelinkservices - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation_test.go b/resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation_test.go deleted file mode 100644 index 383f542a49f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package privatelinkservices - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibility.go b/resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibility.go deleted file mode 100644 index 1e8a53a5ec7..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibility.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatelinkservices - -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 CheckPrivateLinkServiceVisibilityOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkServiceVisibility -} - -// CheckPrivateLinkServiceVisibility ... -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibility(ctx context.Context, id LocationId, input CheckPrivateLinkServiceVisibilityRequest) (result CheckPrivateLinkServiceVisibilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkPrivateLinkServiceVisibility", 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 -} - -// CheckPrivateLinkServiceVisibilityThenPoll performs CheckPrivateLinkServiceVisibility then polls until it's completed -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityThenPoll(ctx context.Context, id LocationId, input CheckPrivateLinkServiceVisibilityRequest) error { - result, err := c.CheckPrivateLinkServiceVisibility(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CheckPrivateLinkServiceVisibility: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CheckPrivateLinkServiceVisibility: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go b/resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go deleted file mode 100644 index 22023c980d0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_checkprivatelinkservicevisibilitybyresourcegroup.go +++ /dev/null @@ -1,75 +0,0 @@ -package privatelinkservices - -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 CheckPrivateLinkServiceVisibilityByResourceGroupOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkServiceVisibility -} - -// CheckPrivateLinkServiceVisibilityByResourceGroup ... -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroup(ctx context.Context, id ProviderLocationId, input CheckPrivateLinkServiceVisibilityRequest) (result CheckPrivateLinkServiceVisibilityByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkPrivateLinkServiceVisibility", 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 -} - -// CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll performs CheckPrivateLinkServiceVisibilityByResourceGroup then polls until it's completed -func (c PrivateLinkServicesClient) CheckPrivateLinkServiceVisibilityByResourceGroupThenPoll(ctx context.Context, id ProviderLocationId, input CheckPrivateLinkServiceVisibilityRequest) error { - result, err := c.CheckPrivateLinkServiceVisibilityByResourceGroup(ctx, id, input) - if err != nil { - return fmt.Errorf("performing CheckPrivateLinkServiceVisibilityByResourceGroup: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after CheckPrivateLinkServiceVisibilityByResourceGroup: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_delete.go b/resource-manager/network/2023-06-01/privatelinkservices/method_delete.go deleted file mode 100644 index d518ac5aede..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatelinkservices - -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 PrivateLinkServicesClient) Delete(ctx context.Context, id PrivateLinkServiceId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PrivateLinkServicesClient) DeleteThenPoll(ctx context.Context, id PrivateLinkServiceId) 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/network/2023-06-01/privatelinkservices/method_deleteprivateendpointconnection.go b/resource-manager/network/2023-06-01/privatelinkservices/method_deleteprivateendpointconnection.go deleted file mode 100644 index 92593766f11..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_deleteprivateendpointconnection.go +++ /dev/null @@ -1,71 +0,0 @@ -package privatelinkservices - -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 DeletePrivateEndpointConnectionOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DeletePrivateEndpointConnection ... -func (c PrivateLinkServicesClient) DeletePrivateEndpointConnection(ctx context.Context, id PrivateEndpointConnectionId) (result DeletePrivateEndpointConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// DeletePrivateEndpointConnectionThenPoll performs DeletePrivateEndpointConnection then polls until it's completed -func (c PrivateLinkServicesClient) DeletePrivateEndpointConnectionThenPoll(ctx context.Context, id PrivateEndpointConnectionId) error { - result, err := c.DeletePrivateEndpointConnection(ctx, id) - if err != nil { - return fmt.Errorf("performing DeletePrivateEndpointConnection: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DeletePrivateEndpointConnection: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_get.go b/resource-manager/network/2023-06-01/privatelinkservices/method_get.go deleted file mode 100644 index cdd893b10fe..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package privatelinkservices - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkService -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PrivateLinkServicesClient) Get(ctx context.Context, id PrivateLinkServiceId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PrivateLinkService - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_getprivateendpointconnection.go b/resource-manager/network/2023-06-01/privatelinkservices/method_getprivateendpointconnection.go deleted file mode 100644 index 1467bb48568..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_getprivateendpointconnection.go +++ /dev/null @@ -1,83 +0,0 @@ -package privatelinkservices - -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 GetPrivateEndpointConnectionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -type GetPrivateEndpointConnectionOperationOptions struct { - Expand *string -} - -func DefaultGetPrivateEndpointConnectionOperationOptions() GetPrivateEndpointConnectionOperationOptions { - return GetPrivateEndpointConnectionOperationOptions{} -} - -func (o GetPrivateEndpointConnectionOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetPrivateEndpointConnectionOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetPrivateEndpointConnectionOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// GetPrivateEndpointConnection ... -func (c PrivateLinkServicesClient) GetPrivateEndpointConnection(ctx context.Context, id PrivateEndpointConnectionId, options GetPrivateEndpointConnectionOperationOptions) (result GetPrivateEndpointConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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/network/2023-06-01/privatelinkservices/method_list.go b/resource-manager/network/2023-06-01/privatelinkservices/method_list.go deleted file mode 100644 index e258446dbf5..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package privatelinkservices - -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 *[]PrivateLinkService -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkService -} - -// List ... -func (c PrivateLinkServicesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateLinkServices", 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 *[]PrivateLinkService `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 PrivateLinkServicesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PrivateLinkServiceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PrivateLinkServiceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PrivateLinkService, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go b/resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go deleted file mode 100644 index a25a114717f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservices.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkservices - -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 ListAutoApprovedPrivateLinkServicesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AutoApprovedPrivateLinkService -} - -type ListAutoApprovedPrivateLinkServicesCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutoApprovedPrivateLinkService -} - -// ListAutoApprovedPrivateLinkServices ... -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServices(ctx context.Context, id LocationId) (result ListAutoApprovedPrivateLinkServicesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/autoApprovedPrivateLinkServices", 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 *[]AutoApprovedPrivateLinkService `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAutoApprovedPrivateLinkServicesComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesComplete(ctx context.Context, id LocationId) (ListAutoApprovedPrivateLinkServicesCompleteResult, error) { - return c.ListAutoApprovedPrivateLinkServicesCompleteMatchingPredicate(ctx, id, AutoApprovedPrivateLinkServiceOperationPredicate{}) -} - -// ListAutoApprovedPrivateLinkServicesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate AutoApprovedPrivateLinkServiceOperationPredicate) (result ListAutoApprovedPrivateLinkServicesCompleteResult, err error) { - items := make([]AutoApprovedPrivateLinkService, 0) - - resp, err := c.ListAutoApprovedPrivateLinkServices(ctx, id) - if err != nil { - 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 = ListAutoApprovedPrivateLinkServicesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go b/resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go deleted file mode 100644 index 9db61484b7e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_listautoapprovedprivatelinkservicesbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkservices - -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 ListAutoApprovedPrivateLinkServicesByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AutoApprovedPrivateLinkService -} - -type ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutoApprovedPrivateLinkService -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroup ... -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx context.Context, id ProviderLocationId) (result ListAutoApprovedPrivateLinkServicesByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/autoApprovedPrivateLinkServices", 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 *[]AutoApprovedPrivateLinkService `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupComplete(ctx context.Context, id ProviderLocationId) (ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult, error) { - return c.ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteMatchingPredicate(ctx, id, AutoApprovedPrivateLinkServiceOperationPredicate{}) -} - -// ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, predicate AutoApprovedPrivateLinkServiceOperationPredicate) (result ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult, err error) { - items := make([]AutoApprovedPrivateLinkService, 0) - - resp, err := c.ListAutoApprovedPrivateLinkServicesByResourceGroup(ctx, id) - if err != nil { - 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 = ListAutoApprovedPrivateLinkServicesByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_listbysubscription.go b/resource-manager/network/2023-06-01/privatelinkservices/method_listbysubscription.go deleted file mode 100644 index a8246d5321d..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package privatelinkservices - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkService -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkService -} - -// ListBySubscription ... -func (c PrivateLinkServicesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/privateLinkServices", 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 *[]PrivateLinkService `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, PrivateLinkServiceOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PrivateLinkServiceOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]PrivateLinkService, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_listprivateendpointconnections.go b/resource-manager/network/2023-06-01/privatelinkservices/method_listprivateendpointconnections.go deleted file mode 100644 index 1e1fc8095b0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_listprivateendpointconnections.go +++ /dev/null @@ -1,91 +0,0 @@ -package privatelinkservices - -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 ListPrivateEndpointConnectionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateEndpointConnection -} - -type ListPrivateEndpointConnectionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateEndpointConnection -} - -// ListPrivateEndpointConnections ... -func (c PrivateLinkServicesClient) ListPrivateEndpointConnections(ctx context.Context, id PrivateLinkServiceId) (result ListPrivateEndpointConnectionsOperationResponse, 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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateEndpointConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListPrivateEndpointConnectionsComplete retrieves all the results into a single object -func (c PrivateLinkServicesClient) ListPrivateEndpointConnectionsComplete(ctx context.Context, id PrivateLinkServiceId) (ListPrivateEndpointConnectionsCompleteResult, error) { - return c.ListPrivateEndpointConnectionsCompleteMatchingPredicate(ctx, id, PrivateEndpointConnectionOperationPredicate{}) -} - -// ListPrivateEndpointConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PrivateLinkServicesClient) ListPrivateEndpointConnectionsCompleteMatchingPredicate(ctx context.Context, id PrivateLinkServiceId, predicate PrivateEndpointConnectionOperationPredicate) (result ListPrivateEndpointConnectionsCompleteResult, err error) { - items := make([]PrivateEndpointConnection, 0) - - resp, err := c.ListPrivateEndpointConnections(ctx, id) - if err != nil { - 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 = ListPrivateEndpointConnectionsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/method_updateprivateendpointconnection.go b/resource-manager/network/2023-06-01/privatelinkservices/method_updateprivateendpointconnection.go deleted file mode 100644 index 90a383fd3a1..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/method_updateprivateendpointconnection.go +++ /dev/null @@ -1,58 +0,0 @@ -package privatelinkservices - -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 UpdatePrivateEndpointConnectionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateEndpointConnection -} - -// UpdatePrivateEndpointConnection ... -func (c PrivateLinkServicesClient) UpdatePrivateEndpointConnection(ctx context.Context, id PrivateEndpointConnectionId, input PrivateEndpointConnection) (result UpdatePrivateEndpointConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 PrivateEndpointConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 6e064132ab8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 2b8b30f76cf..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 687ec802ef4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 23747316443..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index bc231fd9d60..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygroup.go deleted file mode 100644 index 102038ead97..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index b9a224260e0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_autoapprovedprivatelinkservice.go b/resource-manager/network/2023-06-01/privatelinkservices/model_autoapprovedprivatelinkservice.go deleted file mode 100644 index e8eb368b9fd..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_autoapprovedprivatelinkservice.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoApprovedPrivateLinkService struct { - PrivateLinkService *string `json:"privateLinkService,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspool.go b/resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspool.go deleted file mode 100644 index e621fc409e7..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 4fe2c6dad02..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go b/resource-manager/network/2023-06-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go deleted file mode 100644 index d338d570a52..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_checkprivatelinkservicevisibilityrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckPrivateLinkServiceVisibilityRequest struct { - PrivateLinkServiceAlias *string `json:"privateLinkServiceAlias,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 5bb831424b8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_ddossettings.go b/resource-manager/network/2023-06-01/privatelinkservices/model_ddossettings.go deleted file mode 100644 index a88f6af3346..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_delegation.go b/resource-manager/network/2023-06-01/privatelinkservices/model_delegation.go deleted file mode 100644 index 861d7dccc33..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_flowlog.go b/resource-manager/network/2023-06-01/privatelinkservices/model_flowlog.go deleted file mode 100644 index b57c99ff1b7..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/privatelinkservices/model_flowlogformatparameters.go deleted file mode 100644 index e5d4b9b0d2f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_flowlogpropertiesformat.go deleted file mode 100644 index 477b2ca2cb0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfiguration.go deleted file mode 100644 index c4908a4dc2b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservices - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 2a655d02dfc..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 57e817e63b2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrule.go b/resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrule.go deleted file mode 100644 index acd7d0aa709..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 8bf73e3faf8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfiguration.go deleted file mode 100644 index 3ad6065a48e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofile.go deleted file mode 100644 index 0b4a7cbc860..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index f1bae207cc2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 2852a27e2c3..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_iptag.go b/resource-manager/network/2023-06-01/privatelinkservices/model_iptag.go deleted file mode 100644 index a7e33392ad2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// 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/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddress.go deleted file mode 100644 index 09bc3c7f06c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index a567721ac6c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_natgateway.go b/resource-manager/network/2023-06-01/privatelinkservices/model_natgateway.go deleted file mode 100644 index 077d2bc5d5f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package privatelinkservices - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaypropertiesformat.go deleted file mode 100644 index 85150f10453..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaysku.go b/resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaysku.go deleted file mode 100644 index ceae4c33372..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_natruleportmapping.go b/resource-manager/network/2023-06-01/privatelinkservices/model_natruleportmapping.go deleted file mode 100644 index e081a336375..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterface.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterface.go deleted file mode 100644 index 6ac282778d7..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacednssettings.go deleted file mode 100644 index b7993919c62..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 766f136f852..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 4e4cefa66b4..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 82f5e6747c6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 1c2bfc6ae43..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 66b7aeeab62..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 307c8944af0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygroup.go deleted file mode 100644 index 1a2792e0f88..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 7990d29a1bb..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpoint.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpoint.go deleted file mode 100644 index d3a77eea754..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnection.go deleted file mode 100644 index bb755a70536..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/privatelinkservices/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnectionproperties.go deleted file mode 100644 index 5966a68df2a..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfiguration.go deleted file mode 100644 index 6327ca28ff1..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 5e70530aabf..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointproperties.go deleted file mode 100644 index 4d6d18b46a5..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservice.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservice.go deleted file mode 100644 index 4a672116bc2..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnection.go deleted file mode 100644 index eb5e26941fd..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index a991f868fe8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index f227e3d5e6c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index de38cfbbde6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index b1809f0d71c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceproperties.go deleted file mode 100644 index cc7c8cdc0f0..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservicevisibility.go b/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservicevisibility.go deleted file mode 100644 index 38f95ae51a1..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_privatelinkservicevisibility.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceVisibility struct { - Visible *bool `json:"visible,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddress.go b/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddress.go deleted file mode 100644 index cdcddd86935..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package privatelinkservices - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddressdnssettings.go deleted file mode 100644 index 268300edf0b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 2b9a811495b..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresssku.go deleted file mode 100644 index 80c5ef44ece..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlink.go deleted file mode 100644 index 68ad67e053e..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlinkformat.go deleted file mode 100644 index 57d6954d294..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_resourceset.go b/resource-manager/network/2023-06-01/privatelinkservices/model_resourceset.go deleted file mode 100644 index e923870d39f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/privatelinkservices/model_retentionpolicyparameters.go deleted file mode 100644 index 96f98884163..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_route.go b/resource-manager/network/2023-06-01/privatelinkservices/model_route.go deleted file mode 100644 index 901d0eadcc6..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_routepropertiesformat.go deleted file mode 100644 index 12088248968..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_routetable.go b/resource-manager/network/2023-06-01/privatelinkservices/model_routetable.go deleted file mode 100644 index 8afe228ccfd..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_routetablepropertiesformat.go deleted file mode 100644 index 6377cd08fd9..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_securityrule.go b/resource-manager/network/2023-06-01/privatelinkservices/model_securityrule.go deleted file mode 100644 index df53714a81c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_securityrulepropertiesformat.go deleted file mode 100644 index 52b151efed9..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlink.go deleted file mode 100644 index 5f9234cbb82..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 87f29c8ca65..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 2ad5375c2ca..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicy.go deleted file mode 100644 index c93c759f93a..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinition.go deleted file mode 100644 index d1116eb2a61..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 7f68e9513e3..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 5af6f94d80f..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 65b0e07a1a8..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_subnet.go b/resource-manager/network/2023-06-01/privatelinkservices/model_subnet.go deleted file mode 100644 index afb102ed10a..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_subnetpropertiesformat.go deleted file mode 100644 index 6112d434f77..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_subresource.go b/resource-manager/network/2023-06-01/privatelinkservices/model_subresource.go deleted file mode 100644 index b9dcdcf56bf..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index c500218a37c..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsproperties.go deleted file mode 100644 index b98eb28874d..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktap.go deleted file mode 100644 index 8dbee65a21a..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 4fb395dbc76..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/privatelinkservices/predicates.go b/resource-manager/network/2023-06-01/privatelinkservices/predicates.go deleted file mode 100644 index f7e18f9feee..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/predicates.go +++ /dev/null @@ -1,78 +0,0 @@ -package privatelinkservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoApprovedPrivateLinkServiceOperationPredicate struct { - PrivateLinkService *string -} - -func (p AutoApprovedPrivateLinkServiceOperationPredicate) Matches(input AutoApprovedPrivateLinkService) bool { - - if p.PrivateLinkService != nil && (input.PrivateLinkService == nil || *p.PrivateLinkService != *input.PrivateLinkService) { - return false - } - - return true -} - -type PrivateEndpointConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p PrivateEndpointConnectionOperationPredicate) Matches(input PrivateEndpointConnection) 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.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 PrivateLinkServiceOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PrivateLinkServiceOperationPredicate) Matches(input PrivateLinkService) 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 && (input.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/network/2023-06-01/privatelinkservices/version.go b/resource-manager/network/2023-06-01/privatelinkservices/version.go deleted file mode 100644 index 63acbd1ea06..00000000000 --- a/resource-manager/network/2023-06-01/privatelinkservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package privatelinkservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/privatelinkservices/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/README.md b/resource-manager/network/2023-06-01/publicipaddresses/README.md deleted file mode 100644 index 1df08c9245b..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/README.md +++ /dev/null @@ -1,133 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/publicipaddresses` Documentation - -The `publicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/publicipaddresses" -``` - - -### Client Initialization - -```go -client := publicipaddresses.NewPublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPAddressesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -payload := publicipaddresses.PublicIPAddress{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.DdosProtectionStatus` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -if err := client.DdosProtectionStatusThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPAddressesClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -read, err := client.Get(ctx, id, publicipaddresses.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPAddressesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PublicIPAddressesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPAddressesClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPAddressValue") - -payload := publicipaddresses.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/network/2023-06-01/publicipaddresses/client.go b/resource-manager/network/2023-06-01/publicipaddresses/client.go deleted file mode 100644 index 4c28c537385..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicipaddresses - -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 PublicIPAddressesClient struct { - Client *resourcemanager.Client -} - -func NewPublicIPAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*PublicIPAddressesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publicipaddresses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublicIPAddressesClient: %+v", err) - } - - return &PublicIPAddressesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/constants.go b/resource-manager/network/2023-06-01/publicipaddresses/constants.go deleted file mode 100644 index aae5236ba68..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/constants.go +++ /dev/null @@ -1,1192 +0,0 @@ -package publicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IsWorkloadProtected string - -const ( - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -func PossibleValuesForIsWorkloadProtected() []string { - return []string{ - string(IsWorkloadProtectedFalse), - string(IsWorkloadProtectedTrue), - } -} - -func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsWorkloadProtected(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { - vals := map[string]IsWorkloadProtected{ - "false": IsWorkloadProtectedFalse, - "true": IsWorkloadProtectedTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsWorkloadProtected(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/method_createorupdate.go b/resource-manager/network/2023-06-01/publicipaddresses/method_createorupdate.go deleted file mode 100644 index fca7faa2130..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package publicipaddresses - -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 *PublicIPAddress -} - -// CreateOrUpdate ... -func (c PublicIPAddressesClient) CreateOrUpdate(ctx context.Context, id commonids.PublicIPAddressId, input PublicIPAddress) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PublicIPAddressesClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.PublicIPAddressId, input PublicIPAddress) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/publicipaddresses/method_ddosprotectionstatus.go b/resource-manager/network/2023-06-01/publicipaddresses/method_ddosprotectionstatus.go deleted file mode 100644 index 29e07596f6d..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_ddosprotectionstatus.go +++ /dev/null @@ -1,72 +0,0 @@ -package publicipaddresses - -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 DdosProtectionStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPDdosProtectionStatusResult -} - -// DdosProtectionStatus ... -func (c PublicIPAddressesClient) DdosProtectionStatus(ctx context.Context, id commonids.PublicIPAddressId) (result DdosProtectionStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ddosProtectionStatus", 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 -} - -// DdosProtectionStatusThenPoll performs DdosProtectionStatus then polls until it's completed -func (c PublicIPAddressesClient) DdosProtectionStatusThenPoll(ctx context.Context, id commonids.PublicIPAddressId) error { - result, err := c.DdosProtectionStatus(ctx, id) - if err != nil { - return fmt.Errorf("performing DdosProtectionStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DdosProtectionStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/method_delete.go b/resource-manager/network/2023-06-01/publicipaddresses/method_delete.go deleted file mode 100644 index 20c57a22e75..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package publicipaddresses - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c PublicIPAddressesClient) Delete(ctx context.Context, id commonids.PublicIPAddressId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PublicIPAddressesClient) DeleteThenPoll(ctx context.Context, id commonids.PublicIPAddressId) 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/network/2023-06-01/publicipaddresses/method_get.go b/resource-manager/network/2023-06-01/publicipaddresses/method_get.go deleted file mode 100644 index c5f5e5e145e..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package publicipaddresses - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PublicIPAddressesClient) Get(ctx context.Context, id commonids.PublicIPAddressId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/method_list.go b/resource-manager/network/2023-06-01/publicipaddresses/method_list.go deleted file mode 100644 index ad31b8ef636..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipaddresses - -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 *[]PublicIPAddress -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// List ... -func (c PublicIPAddressesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPAddresses", 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 *[]PublicIPAddress `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 PublicIPAddressesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPAddressesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PublicIPAddressOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/publicipaddresses/method_listall.go b/resource-manager/network/2023-06-01/publicipaddresses/method_listall.go deleted file mode 100644 index fb51d348c10..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipaddresses - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// ListAll ... -func (c PublicIPAddressesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c PublicIPAddressesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPAddressesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PublicIPAddressOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/method_updatetags.go b/resource-manager/network/2023-06-01/publicipaddresses/method_updatetags.go deleted file mode 100644 index 55be79fcfce..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/method_updatetags.go +++ /dev/null @@ -1,59 +0,0 @@ -package publicipaddresses - -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 UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -// UpdateTags ... -func (c PublicIPAddressesClient) UpdateTags(ctx context.Context, id commonids.PublicIPAddressId, 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddress.go deleted file mode 100644 index d89d17bbae7..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 433f6b69df9..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 14750d210a4..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 33311f968a8..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 69ba272007f..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygroup.go deleted file mode 100644 index 7ab7c1cc362..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 3de744e7bae..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspool.go b/resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspool.go deleted file mode 100644 index c693d24a91b..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index b4b3a346a35..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 2bbec7ab523..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_ddossettings.go b/resource-manager/network/2023-06-01/publicipaddresses/model_ddossettings.go deleted file mode 100644 index 360538854a2..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_delegation.go b/resource-manager/network/2023-06-01/publicipaddresses/model_delegation.go deleted file mode 100644 index 1036beaaf72..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_flowlog.go b/resource-manager/network/2023-06-01/publicipaddresses/model_flowlog.go deleted file mode 100644 index 3ab56bececf..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/publicipaddresses/model_flowlogformatparameters.go deleted file mode 100644 index 28da49ecc43..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_flowlogpropertiesformat.go deleted file mode 100644 index 6690c7ec880..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfiguration.go deleted file mode 100644 index 72aec2b5437..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipaddresses - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 2d86f96cffb..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 9d2c813c821..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrule.go b/resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrule.go deleted file mode 100644 index bd6a9711828..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 320809245cf..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfiguration.go deleted file mode 100644 index 398840974cd..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofile.go deleted file mode 100644 index 1bf1de27441..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1523f28e63d..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index bb4f647f729..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_iptag.go b/resource-manager/network/2023-06-01/publicipaddresses/model_iptag.go deleted file mode 100644 index 7ea58148bb2..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// 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/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddress.go deleted file mode 100644 index e427662f2a6..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 349c22b64f5..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_natgateway.go b/resource-manager/network/2023-06-01/publicipaddresses/model_natgateway.go deleted file mode 100644 index fc10c7874b7..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package publicipaddresses - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaypropertiesformat.go deleted file mode 100644 index 3a740fb997b..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaysku.go b/resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaysku.go deleted file mode 100644 index 764ce1ec4aa..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_natruleportmapping.go b/resource-manager/network/2023-06-01/publicipaddresses/model_natruleportmapping.go deleted file mode 100644 index 8c9fe6cf53d..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterface.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterface.go deleted file mode 100644 index 5297e480153..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacednssettings.go deleted file mode 100644 index b5db798efaa..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 9840f48b636..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 7815eb1f03a..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index d4350e06603..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index b50c25d8086..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 060a9d5285a..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d229b2dfb8d..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygroup.go deleted file mode 100644 index 485cb7f8e07..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 8fef2ca403a..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpoint.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpoint.go deleted file mode 100644 index dd63348ae6f..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnection.go deleted file mode 100644 index b449098f79d..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/publicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index 8a20b5b22e7..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfiguration.go deleted file mode 100644 index e75d758ed00..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 42574e02e61..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointproperties.go deleted file mode 100644 index a0108e9c621..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkservice.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkservice.go deleted file mode 100644 index b4d87fc1513..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnection.go deleted file mode 100644 index 2039fef8e1a..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 37f23eb3b44..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index ee170e64109..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 8dce57f93b6..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 17839c3231f..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceproperties.go deleted file mode 100644 index 7307dfa6a24..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddress.go b/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddress.go deleted file mode 100644 index 6be86648487..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package publicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 19bd5c73bdd..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 90c1d772012..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresssku.go deleted file mode 100644 index af0178060c9..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipddosprotectionstatusresult.go b/resource-manager/network/2023-06-01/publicipaddresses/model_publicipddosprotectionstatusresult.go deleted file mode 100644 index dbf51354f05..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_publicipddosprotectionstatusresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPDdosProtectionStatusResult struct { - DdosProtectionPlanId *string `json:"ddosProtectionPlanId,omitempty"` - IsWorkloadProtected *IsWorkloadProtected `json:"isWorkloadProtected,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - PublicIPAddressId *string `json:"publicIpAddressId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlink.go deleted file mode 100644 index 8df0e65c796..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlinkformat.go deleted file mode 100644 index 912dad5e9b9..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_resourceset.go b/resource-manager/network/2023-06-01/publicipaddresses/model_resourceset.go deleted file mode 100644 index eb4ec2e13c4..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/publicipaddresses/model_retentionpolicyparameters.go deleted file mode 100644 index 57e746e6800..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_route.go b/resource-manager/network/2023-06-01/publicipaddresses/model_route.go deleted file mode 100644 index 6aaf9130e49..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_routepropertiesformat.go deleted file mode 100644 index 19e40f46ddb..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_routetable.go b/resource-manager/network/2023-06-01/publicipaddresses/model_routetable.go deleted file mode 100644 index eed83ddcb84..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_routetablepropertiesformat.go deleted file mode 100644 index f408090b5c7..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_securityrule.go b/resource-manager/network/2023-06-01/publicipaddresses/model_securityrule.go deleted file mode 100644 index 056a5506bcc..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index e076569ccb4..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlink.go deleted file mode 100644 index 80405186b49..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index e0afefd43a1..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_servicedelegationpropertiesformat.go deleted file mode 100644 index dfdf08665d4..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicy.go deleted file mode 100644 index 2937667f2df..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinition.go deleted file mode 100644 index a5c2fb10189..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 6eae5a09363..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 77840b5f2bd..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 8d53fbdcd1e..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_subnet.go b/resource-manager/network/2023-06-01/publicipaddresses/model_subnet.go deleted file mode 100644 index 4dc6901bd98..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index f96631900c6..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_subresource.go b/resource-manager/network/2023-06-01/publicipaddresses/model_subresource.go deleted file mode 100644 index f4a7d6a3248..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_tagsobject.go b/resource-manager/network/2023-06-01/publicipaddresses/model_tagsobject.go deleted file mode 100644 index 717ed6f5d3d..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// 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/network/2023-06-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index f3cbae91cdc..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsproperties.go deleted file mode 100644 index 4e34016e12e..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktap.go deleted file mode 100644 index b4791998c22..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 4f32bce3226..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipaddresses/predicates.go b/resource-manager/network/2023-06-01/publicipaddresses/predicates.go deleted file mode 100644 index 07d29ffa733..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package publicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPAddressOperationPredicate) Matches(input PublicIPAddress) 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 && (input.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/network/2023-06-01/publicipaddresses/version.go b/resource-manager/network/2023-06-01/publicipaddresses/version.go deleted file mode 100644 index 7e5cfdc6443..00000000000 --- a/resource-manager/network/2023-06-01/publicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/README.md b/resource-manager/network/2023-06-01/publicipprefixes/README.md deleted file mode 100644 index 58dff2e4f1c..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/publicipprefixes` Documentation - -The `publicipprefixes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/publicipprefixes" -``` - - -### Client Initialization - -```go -client := publicipprefixes.NewPublicIPPrefixesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PublicIPPrefixesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -payload := publicipprefixes.PublicIPPrefix{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Delete` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `PublicIPPrefixesClient.Get` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -read, err := client.Get(ctx, id, publicipprefixes.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PublicIPPrefixesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `PublicIPPrefixesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `PublicIPPrefixesClient.UpdateTags` - -```go -ctx := context.TODO() -id := publicipprefixes.NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - -payload := publicipprefixes.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/network/2023-06-01/publicipprefixes/client.go b/resource-manager/network/2023-06-01/publicipprefixes/client.go deleted file mode 100644 index 7dfe8ac9af1..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package publicipprefixes - -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 PublicIPPrefixesClient struct { - Client *resourcemanager.Client -} - -func NewPublicIPPrefixesClientWithBaseURI(sdkApi sdkEnv.Api) (*PublicIPPrefixesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "publicipprefixes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PublicIPPrefixesClient: %+v", err) - } - - return &PublicIPPrefixesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/constants.go b/resource-manager/network/2023-06-01/publicipprefixes/constants.go deleted file mode 100644 index a8c1328b07b..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/constants.go +++ /dev/null @@ -1,215 +0,0 @@ -package publicipprefixes - -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 IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPPrefixSkuName string - -const ( - PublicIPPrefixSkuNameStandard PublicIPPrefixSkuName = "Standard" -) - -func PossibleValuesForPublicIPPrefixSkuName() []string { - return []string{ - string(PublicIPPrefixSkuNameStandard), - } -} - -func (s *PublicIPPrefixSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPPrefixSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPPrefixSkuName(input string) (*PublicIPPrefixSkuName, error) { - vals := map[string]PublicIPPrefixSkuName{ - "standard": PublicIPPrefixSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPPrefixSkuName(input) - return &out, nil -} - -type PublicIPPrefixSkuTier string - -const ( - PublicIPPrefixSkuTierGlobal PublicIPPrefixSkuTier = "Global" - PublicIPPrefixSkuTierRegional PublicIPPrefixSkuTier = "Regional" -) - -func PossibleValuesForPublicIPPrefixSkuTier() []string { - return []string{ - string(PublicIPPrefixSkuTierGlobal), - string(PublicIPPrefixSkuTierRegional), - } -} - -func (s *PublicIPPrefixSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPPrefixSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPPrefixSkuTier(input string) (*PublicIPPrefixSkuTier, error) { - vals := map[string]PublicIPPrefixSkuTier{ - "global": PublicIPPrefixSkuTierGlobal, - "regional": PublicIPPrefixSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPPrefixSkuTier(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix.go b/resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix.go deleted file mode 100644 index 2fe61b6d66b..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix.go +++ /dev/null @@ -1,130 +0,0 @@ -package publicipprefixes - -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(&PublicIPPrefixId{}) -} - -var _ resourceids.ResourceId = &PublicIPPrefixId{} - -// PublicIPPrefixId is a struct representing the Resource ID for a Public I P Prefix -type PublicIPPrefixId struct { - SubscriptionId string - ResourceGroupName string - PublicIPPrefixName string -} - -// NewPublicIPPrefixID returns a new PublicIPPrefixId struct -func NewPublicIPPrefixID(subscriptionId string, resourceGroupName string, publicIPPrefixName string) PublicIPPrefixId { - return PublicIPPrefixId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PublicIPPrefixName: publicIPPrefixName, - } -} - -// ParsePublicIPPrefixID parses 'input' into a PublicIPPrefixId -func ParsePublicIPPrefixID(input string) (*PublicIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicIPPrefixId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePublicIPPrefixIDInsensitively parses 'input' case-insensitively into a PublicIPPrefixId -// note: this method should only be used for API response data and not user input -func ParsePublicIPPrefixIDInsensitively(input string) (*PublicIPPrefixId, error) { - parser := resourceids.NewParserFromResourceIdType(&PublicIPPrefixId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PublicIPPrefixId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PublicIPPrefixId) 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.PublicIPPrefixName, ok = input.Parsed["publicIPPrefixName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "publicIPPrefixName", input) - } - - return nil -} - -// ValidatePublicIPPrefixID checks that 'input' can be parsed as a Public I P Prefix ID -func ValidatePublicIPPrefixID(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 := ParsePublicIPPrefixID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Public I P Prefix ID -func (id PublicIPPrefixId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/publicIPPrefixes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PublicIPPrefixName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Public I P Prefix ID -func (id PublicIPPrefixId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticPublicIPPrefixes", "publicIPPrefixes", "publicIPPrefixes"), - resourceids.UserSpecifiedSegment("publicIPPrefixName", "publicIPPrefixValue"), - } -} - -// String returns a human-readable description of this Public I P Prefix ID -func (id PublicIPPrefixId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Public I P Prefix Name: %q", id.PublicIPPrefixName), - } - return fmt.Sprintf("Public I P Prefix (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix_test.go b/resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix_test.go deleted file mode 100644 index 6ec1cd54e2b..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/id_publicipprefix_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package publicipprefixes - -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 = &PublicIPPrefixId{} - -func TestNewPublicIPPrefixID(t *testing.T) { - id := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue") - - 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.PublicIPPrefixName != "publicIPPrefixValue" { - t.Fatalf("Expected %q but got %q for Segment 'PublicIPPrefixName'", id.PublicIPPrefixName, "publicIPPrefixValue") - } -} - -func TestFormatPublicIPPrefixID(t *testing.T) { - actual := NewPublicIPPrefixID("12345678-1234-9876-4563-123456789012", "example-resource-group", "publicIPPrefixValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePublicIPPrefixID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublicIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue", - Expected: &PublicIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublicIPPrefixID(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.PublicIPPrefixName != v.Expected.PublicIPPrefixName { - t.Fatalf("Expected %q but got %q for PublicIPPrefixName", v.Expected.PublicIPPrefixName, actual.PublicIPPrefixName) - } - - } -} - -func TestParsePublicIPPrefixIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PublicIPPrefixId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pUbLiCiPpReFiXeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue", - Expected: &PublicIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PublicIPPrefixName: "publicIPPrefixValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/publicIPPrefixes/publicIPPrefixValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/pUbLiCiPpReFiXeS/pUbLiCiPpReFiXvAlUe", - Expected: &PublicIPPrefixId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PublicIPPrefixName: "pUbLiCiPpReFiXvAlUe", - }, - }, - { - // 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.nEtWoRk/pUbLiCiPpReFiXeS/pUbLiCiPpReFiXvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePublicIPPrefixIDInsensitively(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.PublicIPPrefixName != v.Expected.PublicIPPrefixName { - t.Fatalf("Expected %q but got %q for PublicIPPrefixName", v.Expected.PublicIPPrefixName, actual.PublicIPPrefixName) - } - - } -} - -func TestSegmentsForPublicIPPrefixId(t *testing.T) { - segments := PublicIPPrefixId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PublicIPPrefixId 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/network/2023-06-01/publicipprefixes/method_createorupdate.go b/resource-manager/network/2023-06-01/publicipprefixes/method_createorupdate.go deleted file mode 100644 index eb586e03d6c..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package publicipprefixes - -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 *PublicIPPrefix -} - -// CreateOrUpdate ... -func (c PublicIPPrefixesClient) CreateOrUpdate(ctx context.Context, id PublicIPPrefixId, input PublicIPPrefix) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c PublicIPPrefixesClient) CreateOrUpdateThenPoll(ctx context.Context, id PublicIPPrefixId, input PublicIPPrefix) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/publicipprefixes/method_delete.go b/resource-manager/network/2023-06-01/publicipprefixes/method_delete.go deleted file mode 100644 index 4ef74511d04..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package publicipprefixes - -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 PublicIPPrefixesClient) Delete(ctx context.Context, id PublicIPPrefixId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 PublicIPPrefixesClient) DeleteThenPoll(ctx context.Context, id PublicIPPrefixId) 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/network/2023-06-01/publicipprefixes/method_get.go b/resource-manager/network/2023-06-01/publicipprefixes/method_get.go deleted file mode 100644 index 099ab527016..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package publicipprefixes - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPPrefix -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c PublicIPPrefixesClient) Get(ctx context.Context, id PublicIPPrefixId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/method_list.go b/resource-manager/network/2023-06-01/publicipprefixes/method_list.go deleted file mode 100644 index e54a46b7839..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipprefixes - -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 *[]PublicIPPrefix -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPPrefix -} - -// List ... -func (c PublicIPPrefixesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPPrefixes", 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 *[]PublicIPPrefix `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 PublicIPPrefixesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PublicIPPrefixOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPPrefixesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PublicIPPrefixOperationPredicate) (result ListCompleteResult, err error) { - items := make([]PublicIPPrefix, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/publicipprefixes/method_listall.go b/resource-manager/network/2023-06-01/publicipprefixes/method_listall.go deleted file mode 100644 index eeeab7a1981..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package publicipprefixes - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPPrefix -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPPrefix -} - -// ListAll ... -func (c PublicIPPrefixesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/publicIPPrefixes", 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 *[]PublicIPPrefix `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c PublicIPPrefixesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, PublicIPPrefixOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PublicIPPrefixesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PublicIPPrefixOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]PublicIPPrefix, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/method_updatetags.go b/resource-manager/network/2023-06-01/publicipprefixes/method_updatetags.go deleted file mode 100644 index e5257fc9717..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package publicipprefixes - -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 *PublicIPPrefix -} - -// UpdateTags ... -func (c PublicIPPrefixesClient) UpdateTags(ctx context.Context, id PublicIPPrefixId, 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 PublicIPPrefix - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_iptag.go b/resource-manager/network/2023-06-01/publicipprefixes/model_iptag.go deleted file mode 100644 index e1bbbc73a6e..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipprefixes - -// 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/network/2023-06-01/publicipprefixes/model_natgateway.go b/resource-manager/network/2023-06-01/publicipprefixes/model_natgateway.go deleted file mode 100644 index 170eeff6848..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package publicipprefixes - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaypropertiesformat.go deleted file mode 100644 index 5c1f46d3737..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaysku.go b/resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaysku.go deleted file mode 100644 index 465e471e903..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefix.go b/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefix.go deleted file mode 100644 index 6679bada47d..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefix.go +++ /dev/null @@ -1,22 +0,0 @@ -package publicipprefixes - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPPrefix struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPPrefixPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPPrefixSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixpropertiesformat.go b/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixpropertiesformat.go deleted file mode 100644 index 32b58a818b3..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixpropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixPropertiesFormat struct { - CustomIPPrefix *SubResource `json:"customIPPrefix,omitempty"` - IPPrefix *string `json:"ipPrefix,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIpConfiguration,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - PrefixLength *int64 `json:"prefixLength,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAddresses *[]ReferencedPublicIPAddress `json:"publicIPAddresses,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixsku.go b/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixsku.go deleted file mode 100644 index 0737b92dee1..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_publicipprefixsku.go +++ /dev/null @@ -1,9 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixSku struct { - Name *PublicIPPrefixSkuName `json:"name,omitempty"` - Tier *PublicIPPrefixSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_referencedpublicipaddress.go b/resource-manager/network/2023-06-01/publicipprefixes/model_referencedpublicipaddress.go deleted file mode 100644 index 26027a800a2..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_referencedpublicipaddress.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReferencedPublicIPAddress struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_subresource.go b/resource-manager/network/2023-06-01/publicipprefixes/model_subresource.go deleted file mode 100644 index 53e3c780cbf..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/publicipprefixes/model_tagsobject.go b/resource-manager/network/2023-06-01/publicipprefixes/model_tagsobject.go deleted file mode 100644 index 6a82f86f28f..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package publicipprefixes - -// 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/network/2023-06-01/publicipprefixes/predicates.go b/resource-manager/network/2023-06-01/publicipprefixes/predicates.go deleted file mode 100644 index 7deb3ca2bbf..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package publicipprefixes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPPrefixOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPPrefixOperationPredicate) Matches(input PublicIPPrefix) 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 && (input.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/network/2023-06-01/publicipprefixes/version.go b/resource-manager/network/2023-06-01/publicipprefixes/version.go deleted file mode 100644 index 86bd90bbdec..00000000000 --- a/resource-manager/network/2023-06-01/publicipprefixes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package publicipprefixes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/publicipprefixes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/README.md b/resource-manager/network/2023-06-01/routefilterrules/README.md deleted file mode 100644 index 41ef8a27038..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routefilterrules` Documentation - -The `routefilterrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/routefilterrules" -``` - - -### Client Initialization - -```go -client := routefilterrules.NewRouteFilterRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteFilterRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -payload := routefilterrules.RouteFilterRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFilterRulesClient.Delete` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFilterRulesClient.Get` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - -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: `RouteFilterRulesClient.ListByRouteFilter` - -```go -ctx := context.TODO() -id := routefilterrules.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -// alternatively `client.ListByRouteFilter(ctx, id)` can be used to do batched pagination -items, err := client.ListByRouteFilterComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/routefilterrules/client.go b/resource-manager/network/2023-06-01/routefilterrules/client.go deleted file mode 100644 index 018917d75d9..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routefilterrules - -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 RouteFilterRulesClient struct { - Client *resourcemanager.Client -} - -func NewRouteFilterRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*RouteFilterRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routefilterrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RouteFilterRulesClient: %+v", err) - } - - return &RouteFilterRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/constants.go b/resource-manager/network/2023-06-01/routefilterrules/constants.go deleted file mode 100644 index cf65052c645..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/constants.go +++ /dev/null @@ -1,136 +0,0 @@ -package routefilterrules - -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 Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -func PossibleValuesForAccess() []string { - return []string{ - string(AccessAllow), - string(AccessDeny), - } -} - -func (s *Access) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccess(input string) (*Access, error) { - vals := map[string]Access{ - "allow": AccessAllow, - "deny": AccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Access(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RouteFilterRuleType string - -const ( - RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" -) - -func PossibleValuesForRouteFilterRuleType() []string { - return []string{ - string(RouteFilterRuleTypeCommunity), - } -} - -func (s *RouteFilterRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteFilterRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteFilterRuleType(input string) (*RouteFilterRuleType, error) { - vals := map[string]RouteFilterRuleType{ - "community": RouteFilterRuleTypeCommunity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteFilterRuleType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/id_routefilter.go b/resource-manager/network/2023-06-01/routefilterrules/id_routefilter.go deleted file mode 100644 index fc7b97a96ea..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/id_routefilter.go +++ /dev/null @@ -1,130 +0,0 @@ -package routefilterrules - -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(&RouteFilterId{}) -} - -var _ resourceids.ResourceId = &RouteFilterId{} - -// RouteFilterId is a struct representing the Resource ID for a Route Filter -type RouteFilterId struct { - SubscriptionId string - ResourceGroupName string - RouteFilterName string -} - -// NewRouteFilterID returns a new RouteFilterId struct -func NewRouteFilterID(subscriptionId string, resourceGroupName string, routeFilterName string) RouteFilterId { - return RouteFilterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteFilterName: routeFilterName, - } -} - -// ParseRouteFilterID parses 'input' into a RouteFilterId -func ParseRouteFilterID(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteFilterIDInsensitively parses 'input' case-insensitively into a RouteFilterId -// note: this method should only be used for API response data and not user input -func ParseRouteFilterIDInsensitively(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteFilterId) 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.RouteFilterName, ok = input.Parsed["routeFilterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterName", input) - } - - return nil -} - -// ValidateRouteFilterID checks that 'input' can be parsed as a Route Filter ID -func ValidateRouteFilterID(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 := ParseRouteFilterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Filter ID -func (id RouteFilterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeFilters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteFilterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Filter ID -func (id RouteFilterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), - resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterValue"), - } -} - -// String returns a human-readable description of this Route Filter ID -func (id RouteFilterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Filter Name: %q", id.RouteFilterName), - } - return fmt.Sprintf("Route Filter (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/id_routefilter_test.go b/resource-manager/network/2023-06-01/routefilterrules/id_routefilter_test.go deleted file mode 100644 index 50f5cbaeb48..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/id_routefilter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routefilterrules - -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 = &RouteFilterId{} - -func TestNewRouteFilterID(t *testing.T) { - id := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - - 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.RouteFilterName != "routeFilterValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterValue") - } -} - -func TestFormatRouteFilterID(t *testing.T) { - actual := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteFilterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterID(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestParseRouteFilterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteFilterName: "rOuTeFiLtErVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterIDInsensitively(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestSegmentsForRouteFilterId(t *testing.T) { - segments := RouteFilterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteFilterId 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/network/2023-06-01/routefilterrules/id_routefilterrule.go b/resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule.go deleted file mode 100644 index ef13326b0c4..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package routefilterrules - -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(&RouteFilterRuleId{}) -} - -var _ resourceids.ResourceId = &RouteFilterRuleId{} - -// RouteFilterRuleId is a struct representing the Resource ID for a Route Filter Rule -type RouteFilterRuleId struct { - SubscriptionId string - ResourceGroupName string - RouteFilterName string - RouteFilterRuleName string -} - -// NewRouteFilterRuleID returns a new RouteFilterRuleId struct -func NewRouteFilterRuleID(subscriptionId string, resourceGroupName string, routeFilterName string, routeFilterRuleName string) RouteFilterRuleId { - return RouteFilterRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteFilterName: routeFilterName, - RouteFilterRuleName: routeFilterRuleName, - } -} - -// ParseRouteFilterRuleID parses 'input' into a RouteFilterRuleId -func ParseRouteFilterRuleID(input string) (*RouteFilterRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteFilterRuleIDInsensitively parses 'input' case-insensitively into a RouteFilterRuleId -// note: this method should only be used for API response data and not user input -func ParseRouteFilterRuleIDInsensitively(input string) (*RouteFilterRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteFilterRuleId) 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.RouteFilterName, ok = input.Parsed["routeFilterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterName", input) - } - - if id.RouteFilterRuleName, ok = input.Parsed["routeFilterRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterRuleName", input) - } - - return nil -} - -// ValidateRouteFilterRuleID checks that 'input' can be parsed as a Route Filter Rule ID -func ValidateRouteFilterRuleID(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 := ParseRouteFilterRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Filter Rule ID -func (id RouteFilterRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeFilters/%s/routeFilterRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteFilterName, id.RouteFilterRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Filter Rule ID -func (id RouteFilterRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), - resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterValue"), - resourceids.StaticSegment("staticRouteFilterRules", "routeFilterRules", "routeFilterRules"), - resourceids.UserSpecifiedSegment("routeFilterRuleName", "routeFilterRuleValue"), - } -} - -// String returns a human-readable description of this Route Filter Rule ID -func (id RouteFilterRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Filter Name: %q", id.RouteFilterName), - fmt.Sprintf("Route Filter Rule Name: %q", id.RouteFilterRuleName), - } - return fmt.Sprintf("Route Filter Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule_test.go b/resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule_test.go deleted file mode 100644 index 2df370136c3..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/id_routefilterrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package routefilterrules - -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 = &RouteFilterRuleId{} - -func TestNewRouteFilterRuleID(t *testing.T) { - id := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue") - - 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.RouteFilterName != "routeFilterValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterValue") - } - - if id.RouteFilterRuleName != "routeFilterRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterRuleName'", id.RouteFilterRuleName, "routeFilterRuleValue") - } -} - -func TestFormatRouteFilterRuleID(t *testing.T) { - actual := NewRouteFilterRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue", "routeFilterRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteFilterRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue", - Expected: &RouteFilterRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - RouteFilterRuleName: "routeFilterRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterRuleID(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - if actual.RouteFilterRuleName != v.Expected.RouteFilterRuleName { - t.Fatalf("Expected %q but got %q for RouteFilterRuleName", v.Expected.RouteFilterRuleName, actual.RouteFilterRuleName) - } - - } -} - -func TestParseRouteFilterRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/rOuTeFiLtErRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue", - Expected: &RouteFilterRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - RouteFilterRuleName: "routeFilterRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/routeFilterRules/routeFilterRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeVaLuE", - Expected: &RouteFilterRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteFilterName: "rOuTeFiLtErVaLuE", - RouteFilterRuleName: "rOuTeFiLtErRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/rOuTeFiLtErRuLeS/rOuTeFiLtErRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterRuleIDInsensitively(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - if actual.RouteFilterRuleName != v.Expected.RouteFilterRuleName { - t.Fatalf("Expected %q but got %q for RouteFilterRuleName", v.Expected.RouteFilterRuleName, actual.RouteFilterRuleName) - } - - } -} - -func TestSegmentsForRouteFilterRuleId(t *testing.T) { - segments := RouteFilterRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteFilterRuleId 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/network/2023-06-01/routefilterrules/method_createorupdate.go b/resource-manager/network/2023-06-01/routefilterrules/method_createorupdate.go deleted file mode 100644 index 6e1717e3fce..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routefilterrules - -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 *RouteFilterRule -} - -// CreateOrUpdate ... -func (c RouteFilterRulesClient) CreateOrUpdate(ctx context.Context, id RouteFilterRuleId, input RouteFilterRule) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RouteFilterRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteFilterRuleId, input RouteFilterRule) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/routefilterrules/method_delete.go b/resource-manager/network/2023-06-01/routefilterrules/method_delete.go deleted file mode 100644 index bbac130984b..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routefilterrules - -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 RouteFilterRulesClient) Delete(ctx context.Context, id RouteFilterRuleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RouteFilterRulesClient) DeleteThenPoll(ctx context.Context, id RouteFilterRuleId) 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/network/2023-06-01/routefilterrules/method_get.go b/resource-manager/network/2023-06-01/routefilterrules/method_get.go deleted file mode 100644 index c28ac994637..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package routefilterrules - -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 *RouteFilterRule -} - -// Get ... -func (c RouteFilterRulesClient) Get(ctx context.Context, id RouteFilterRuleId) (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 RouteFilterRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/method_listbyroutefilter.go b/resource-manager/network/2023-06-01/routefilterrules/method_listbyroutefilter.go deleted file mode 100644 index 875f770f0f6..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/method_listbyroutefilter.go +++ /dev/null @@ -1,91 +0,0 @@ -package routefilterrules - -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 ListByRouteFilterOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RouteFilterRule -} - -type ListByRouteFilterCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteFilterRule -} - -// ListByRouteFilter ... -func (c RouteFilterRulesClient) ListByRouteFilter(ctx context.Context, id RouteFilterId) (result ListByRouteFilterOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routeFilterRules", 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 *[]RouteFilterRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByRouteFilterComplete retrieves all the results into a single object -func (c RouteFilterRulesClient) ListByRouteFilterComplete(ctx context.Context, id RouteFilterId) (ListByRouteFilterCompleteResult, error) { - return c.ListByRouteFilterCompleteMatchingPredicate(ctx, id, RouteFilterRuleOperationPredicate{}) -} - -// ListByRouteFilterCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteFilterRulesClient) ListByRouteFilterCompleteMatchingPredicate(ctx context.Context, id RouteFilterId, predicate RouteFilterRuleOperationPredicate) (result ListByRouteFilterCompleteResult, err error) { - items := make([]RouteFilterRule, 0) - - resp, err := c.ListByRouteFilter(ctx, id) - if err != nil { - 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 = ListByRouteFilterCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/model_routefilterrule.go b/resource-manager/network/2023-06-01/routefilterrules/model_routefilterrule.go deleted file mode 100644 index d3ad4488a83..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/model_routefilterrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilterrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/model_routefilterrulepropertiesformat.go b/resource-manager/network/2023-06-01/routefilterrules/model_routefilterrulepropertiesformat.go deleted file mode 100644 index e59fbff04f1..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/model_routefilterrulepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilterrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRulePropertiesFormat struct { - Access Access `json:"access"` - Communities []string `json:"communities"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilterRuleType RouteFilterRuleType `json:"routeFilterRuleType"` -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/predicates.go b/resource-manager/network/2023-06-01/routefilterrules/predicates.go deleted file mode 100644 index 3067b052089..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package routefilterrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRuleOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string -} - -func (p RouteFilterRuleOperationPredicate) Matches(input RouteFilterRule) 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 && (input.Location == nil || *p.Location != *input.Location) { - return false - } - - if p.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/routefilterrules/version.go b/resource-manager/network/2023-06-01/routefilterrules/version.go deleted file mode 100644 index 22ee33e43ce..00000000000 --- a/resource-manager/network/2023-06-01/routefilterrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilterrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routefilterrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/routefilters/README.md b/resource-manager/network/2023-06-01/routefilters/README.md deleted file mode 100644 index 445ef75ace9..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routefilters` Documentation - -The `routefilters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/routefilters" -``` - - -### Client Initialization - -```go -client := routefilters.NewRouteFiltersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteFiltersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -payload := routefilters.RouteFilter{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFiltersClient.Delete` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteFiltersClient.Get` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -read, err := client.Get(ctx, id, routefilters.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RouteFiltersClient.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: `RouteFiltersClient.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: `RouteFiltersClient.UpdateTags` - -```go -ctx := context.TODO() -id := routefilters.NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - -payload := routefilters.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/network/2023-06-01/routefilters/client.go b/resource-manager/network/2023-06-01/routefilters/client.go deleted file mode 100644 index e4faeb1d622..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routefilters - -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 RouteFiltersClient struct { - Client *resourcemanager.Client -} - -func NewRouteFiltersClientWithBaseURI(sdkApi sdkEnv.Api) (*RouteFiltersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routefilters", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RouteFiltersClient: %+v", err) - } - - return &RouteFiltersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/routefilters/constants.go b/resource-manager/network/2023-06-01/routefilters/constants.go deleted file mode 100644 index 47cec86d290..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/constants.go +++ /dev/null @@ -1,353 +0,0 @@ -package routefilters - -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 Access string - -const ( - AccessAllow Access = "Allow" - AccessDeny Access = "Deny" -) - -func PossibleValuesForAccess() []string { - return []string{ - string(AccessAllow), - string(AccessDeny), - } -} - -func (s *Access) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAccess(input string) (*Access, error) { - vals := map[string]Access{ - "allow": AccessAllow, - "deny": AccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Access(input) - return &out, nil -} - -type CircuitConnectionStatus string - -const ( - CircuitConnectionStatusConnected CircuitConnectionStatus = "Connected" - CircuitConnectionStatusConnecting CircuitConnectionStatus = "Connecting" - CircuitConnectionStatusDisconnected CircuitConnectionStatus = "Disconnected" -) - -func PossibleValuesForCircuitConnectionStatus() []string { - return []string{ - string(CircuitConnectionStatusConnected), - string(CircuitConnectionStatusConnecting), - string(CircuitConnectionStatusDisconnected), - } -} - -func (s *CircuitConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCircuitConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCircuitConnectionStatus(input string) (*CircuitConnectionStatus, error) { - vals := map[string]CircuitConnectionStatus{ - "connected": CircuitConnectionStatusConnected, - "connecting": CircuitConnectionStatusConnecting, - "disconnected": CircuitConnectionStatusDisconnected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CircuitConnectionStatus(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringAdvertisedPublicPrefixState string - -const ( - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "Configuring" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "NotConfigured" - ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded ExpressRouteCircuitPeeringAdvertisedPublicPrefixState = "ValidationNeeded" -) - -func PossibleValuesForExpressRouteCircuitPeeringAdvertisedPublicPrefixState() []string { - return []string{ - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured), - string(ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded), - } -} - -func (s *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input string) (*ExpressRouteCircuitPeeringAdvertisedPublicPrefixState, error) { - vals := map[string]ExpressRouteCircuitPeeringAdvertisedPublicPrefixState{ - "configured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfigured, - "configuring": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateConfiguring, - "notconfigured": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateNotConfigured, - "validationneeded": ExpressRouteCircuitPeeringAdvertisedPublicPrefixStateValidationNeeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringAdvertisedPublicPrefixState(input) - return &out, nil -} - -type ExpressRouteCircuitPeeringState string - -const ( - ExpressRouteCircuitPeeringStateDisabled ExpressRouteCircuitPeeringState = "Disabled" - ExpressRouteCircuitPeeringStateEnabled ExpressRouteCircuitPeeringState = "Enabled" -) - -func PossibleValuesForExpressRouteCircuitPeeringState() []string { - return []string{ - string(ExpressRouteCircuitPeeringStateDisabled), - string(ExpressRouteCircuitPeeringStateEnabled), - } -} - -func (s *ExpressRouteCircuitPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRouteCircuitPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRouteCircuitPeeringState(input string) (*ExpressRouteCircuitPeeringState, error) { - vals := map[string]ExpressRouteCircuitPeeringState{ - "disabled": ExpressRouteCircuitPeeringStateDisabled, - "enabled": ExpressRouteCircuitPeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRouteCircuitPeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringState string - -const ( - ExpressRoutePeeringStateDisabled ExpressRoutePeeringState = "Disabled" - ExpressRoutePeeringStateEnabled ExpressRoutePeeringState = "Enabled" -) - -func PossibleValuesForExpressRoutePeeringState() []string { - return []string{ - string(ExpressRoutePeeringStateDisabled), - string(ExpressRoutePeeringStateEnabled), - } -} - -func (s *ExpressRoutePeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringState(input string) (*ExpressRoutePeeringState, error) { - vals := map[string]ExpressRoutePeeringState{ - "disabled": ExpressRoutePeeringStateDisabled, - "enabled": ExpressRoutePeeringStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringState(input) - return &out, nil -} - -type ExpressRoutePeeringType string - -const ( - ExpressRoutePeeringTypeAzurePrivatePeering ExpressRoutePeeringType = "AzurePrivatePeering" - ExpressRoutePeeringTypeAzurePublicPeering ExpressRoutePeeringType = "AzurePublicPeering" - ExpressRoutePeeringTypeMicrosoftPeering ExpressRoutePeeringType = "MicrosoftPeering" -) - -func PossibleValuesForExpressRoutePeeringType() []string { - return []string{ - string(ExpressRoutePeeringTypeAzurePrivatePeering), - string(ExpressRoutePeeringTypeAzurePublicPeering), - string(ExpressRoutePeeringTypeMicrosoftPeering), - } -} - -func (s *ExpressRoutePeeringType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExpressRoutePeeringType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExpressRoutePeeringType(input string) (*ExpressRoutePeeringType, error) { - vals := map[string]ExpressRoutePeeringType{ - "azureprivatepeering": ExpressRoutePeeringTypeAzurePrivatePeering, - "azurepublicpeering": ExpressRoutePeeringTypeAzurePublicPeering, - "microsoftpeering": ExpressRoutePeeringTypeMicrosoftPeering, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExpressRoutePeeringType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RouteFilterRuleType string - -const ( - RouteFilterRuleTypeCommunity RouteFilterRuleType = "Community" -) - -func PossibleValuesForRouteFilterRuleType() []string { - return []string{ - string(RouteFilterRuleTypeCommunity), - } -} - -func (s *RouteFilterRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteFilterRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteFilterRuleType(input string) (*RouteFilterRuleType, error) { - vals := map[string]RouteFilterRuleType{ - "community": RouteFilterRuleTypeCommunity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteFilterRuleType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/routefilters/id_routefilter.go b/resource-manager/network/2023-06-01/routefilters/id_routefilter.go deleted file mode 100644 index 18b55731fae..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/id_routefilter.go +++ /dev/null @@ -1,130 +0,0 @@ -package routefilters - -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(&RouteFilterId{}) -} - -var _ resourceids.ResourceId = &RouteFilterId{} - -// RouteFilterId is a struct representing the Resource ID for a Route Filter -type RouteFilterId struct { - SubscriptionId string - ResourceGroupName string - RouteFilterName string -} - -// NewRouteFilterID returns a new RouteFilterId struct -func NewRouteFilterID(subscriptionId string, resourceGroupName string, routeFilterName string) RouteFilterId { - return RouteFilterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteFilterName: routeFilterName, - } -} - -// ParseRouteFilterID parses 'input' into a RouteFilterId -func ParseRouteFilterID(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteFilterIDInsensitively parses 'input' case-insensitively into a RouteFilterId -// note: this method should only be used for API response data and not user input -func ParseRouteFilterIDInsensitively(input string) (*RouteFilterId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteFilterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteFilterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteFilterId) 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.RouteFilterName, ok = input.Parsed["routeFilterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeFilterName", input) - } - - return nil -} - -// ValidateRouteFilterID checks that 'input' can be parsed as a Route Filter ID -func ValidateRouteFilterID(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 := ParseRouteFilterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Filter ID -func (id RouteFilterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeFilters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteFilterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Filter ID -func (id RouteFilterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteFilters", "routeFilters", "routeFilters"), - resourceids.UserSpecifiedSegment("routeFilterName", "routeFilterValue"), - } -} - -// String returns a human-readable description of this Route Filter ID -func (id RouteFilterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Filter Name: %q", id.RouteFilterName), - } - return fmt.Sprintf("Route Filter (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/routefilters/id_routefilter_test.go b/resource-manager/network/2023-06-01/routefilters/id_routefilter_test.go deleted file mode 100644 index c49325e7a59..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/id_routefilter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routefilters - -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 = &RouteFilterId{} - -func TestNewRouteFilterID(t *testing.T) { - id := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue") - - 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.RouteFilterName != "routeFilterValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteFilterName'", id.RouteFilterName, "routeFilterValue") - } -} - -func TestFormatRouteFilterID(t *testing.T) { - actual := NewRouteFilterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeFilterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteFilterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterID(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestParseRouteFilterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteFilterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteFilterName: "routeFilterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeFilters/routeFilterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE", - Expected: &RouteFilterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteFilterName: "rOuTeFiLtErVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeFiLtErS/rOuTeFiLtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteFilterIDInsensitively(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.RouteFilterName != v.Expected.RouteFilterName { - t.Fatalf("Expected %q but got %q for RouteFilterName", v.Expected.RouteFilterName, actual.RouteFilterName) - } - - } -} - -func TestSegmentsForRouteFilterId(t *testing.T) { - segments := RouteFilterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteFilterId 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/network/2023-06-01/routefilters/method_createorupdate.go b/resource-manager/network/2023-06-01/routefilters/method_createorupdate.go deleted file mode 100644 index 4881008706e..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routefilters - -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 *RouteFilter -} - -// CreateOrUpdate ... -func (c RouteFiltersClient) CreateOrUpdate(ctx context.Context, id RouteFilterId, input RouteFilter) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RouteFiltersClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteFilterId, input RouteFilter) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/routefilters/method_delete.go b/resource-manager/network/2023-06-01/routefilters/method_delete.go deleted file mode 100644 index 1a389b5108c..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routefilters - -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 RouteFiltersClient) Delete(ctx context.Context, id RouteFilterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RouteFiltersClient) DeleteThenPoll(ctx context.Context, id RouteFilterId) 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/network/2023-06-01/routefilters/method_get.go b/resource-manager/network/2023-06-01/routefilters/method_get.go deleted file mode 100644 index 55c6ee5fa8f..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package routefilters - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RouteFilter -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c RouteFiltersClient) Get(ctx context.Context, id RouteFilterId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 RouteFilter - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/routefilters/method_list.go b/resource-manager/network/2023-06-01/routefilters/method_list.go deleted file mode 100644 index 45734ccd093..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package routefilters - -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 *[]RouteFilter -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteFilter -} - -// List ... -func (c RouteFiltersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeFilters", 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 *[]RouteFilter `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 RouteFiltersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RouteFilterOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteFiltersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RouteFilterOperationPredicate) (result ListCompleteResult, err error) { - items := make([]RouteFilter, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/routefilters/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/routefilters/method_listbyresourcegroup.go deleted file mode 100644 index 4a2f6f7a328..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package routefilters - -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 *[]RouteFilter -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteFilter -} - -// ListByResourceGroup ... -func (c RouteFiltersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeFilters", 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 *[]RouteFilter `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 RouteFiltersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, RouteFilterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteFiltersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RouteFilterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]RouteFilter, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/routefilters/method_updatetags.go b/resource-manager/network/2023-06-01/routefilters/method_updatetags.go deleted file mode 100644 index 33bbd5301d9..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package routefilters - -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 *RouteFilter -} - -// UpdateTags ... -func (c RouteFiltersClient) UpdateTags(ctx context.Context, id RouteFilterId, 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 RouteFilter - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnection.go b/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnection.go deleted file mode 100644 index b4ee9836dca..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index 2e9948e07f4..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthorizationKey *string `json:"authorizationKey,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - IPv6CircuitConnectionConfig *IPv6CircuitConnectionConfig `json:"ipv6CircuitConnectionConfig,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeering.go b/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeering.go deleted file mode 100644 index 79ef27f6ed8..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ExpressRouteCircuitPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringconfig.go deleted file mode 100644 index 43de7805714..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringConfig struct { - AdvertisedCommunities *[]string `json:"advertisedCommunities,omitempty"` - AdvertisedPublicPrefixes *[]string `json:"advertisedPublicPrefixes,omitempty"` - AdvertisedPublicPrefixesState *ExpressRouteCircuitPeeringAdvertisedPublicPrefixState `json:"advertisedPublicPrefixesState,omitempty"` - CustomerASN *int64 `json:"customerASN,omitempty"` - LegacyMode *int64 `json:"legacyMode,omitempty"` - RoutingRegistryName *string `json:"routingRegistryName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go b/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go deleted file mode 100644 index 1f5f8e7a726..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitpeeringpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitPeeringPropertiesFormat struct { - AzureASN *int64 `json:"azureASN,omitempty"` - Connections *[]ExpressRouteCircuitConnection `json:"connections,omitempty"` - ExpressRouteConnection *ExpressRouteConnectionId `json:"expressRouteConnection,omitempty"` - GatewayManagerEtag *string `json:"gatewayManagerEtag,omitempty"` - IPv6PeeringConfig *IPv6ExpressRouteCircuitPeeringConfig `json:"ipv6PeeringConfig,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PeerASN *int64 `json:"peerASN,omitempty"` - PeeredConnections *[]PeerExpressRouteCircuitConnection `json:"peeredConnections,omitempty"` - PeeringType *ExpressRoutePeeringType `json:"peeringType,omitempty"` - PrimaryAzurePort *string `json:"primaryAzurePort,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryAzurePort *string `json:"secondaryAzurePort,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - State *ExpressRoutePeeringState `json:"state,omitempty"` - Stats *ExpressRouteCircuitStats `json:"stats,omitempty"` - VlanId *int64 `json:"vlanId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitstats.go b/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitstats.go deleted file mode 100644 index b57109bba40..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressroutecircuitstats.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteCircuitStats struct { - PrimarybytesIn *int64 `json:"primarybytesIn,omitempty"` - PrimarybytesOut *int64 `json:"primarybytesOut,omitempty"` - SecondarybytesIn *int64 `json:"secondarybytesIn,omitempty"` - SecondarybytesOut *int64 `json:"secondarybytesOut,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_expressrouteconnectionid.go b/resource-manager/network/2023-06-01/routefilters/model_expressrouteconnectionid.go deleted file mode 100644 index 8d033b8e0e1..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_expressrouteconnectionid.go +++ /dev/null @@ -1,8 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpressRouteConnectionId struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_ipv6circuitconnectionconfig.go b/resource-manager/network/2023-06-01/routefilters/model_ipv6circuitconnectionconfig.go deleted file mode 100644 index 036a19fa8aa..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_ipv6circuitconnectionconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6CircuitConnectionConfig struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go b/resource-manager/network/2023-06-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go deleted file mode 100644 index 66f1810d2ef..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_ipv6expressroutecircuitpeeringconfig.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPv6ExpressRouteCircuitPeeringConfig struct { - MicrosoftPeeringConfig *ExpressRouteCircuitPeeringConfig `json:"microsoftPeeringConfig,omitempty"` - PrimaryPeerAddressPrefix *string `json:"primaryPeerAddressPrefix,omitempty"` - RouteFilter *SubResource `json:"routeFilter,omitempty"` - SecondaryPeerAddressPrefix *string `json:"secondaryPeerAddressPrefix,omitempty"` - State *ExpressRouteCircuitPeeringState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnection.go b/resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnection.go deleted file mode 100644 index 1cceefb8321..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PeerExpressRouteCircuitConnectionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go deleted file mode 100644 index ae3652f5c1b..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_peerexpressroutecircuitconnectionpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerExpressRouteCircuitConnectionPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AuthResourceGuid *string `json:"authResourceGuid,omitempty"` - CircuitConnectionStatus *CircuitConnectionStatus `json:"circuitConnectionStatus,omitempty"` - ConnectionName *string `json:"connectionName,omitempty"` - ExpressRouteCircuitPeering *SubResource `json:"expressRouteCircuitPeering,omitempty"` - PeerExpressRouteCircuitPeering *SubResource `json:"peerExpressRouteCircuitPeering,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_routefilter.go b/resource-manager/network/2023-06-01/routefilters/model_routefilter.go deleted file mode 100644 index 932567d03cc..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_routefilter.go +++ /dev/null @@ -1,14 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilter struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteFilterPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_routefilterpropertiesformat.go b/resource-manager/network/2023-06-01/routefilters/model_routefilterpropertiesformat.go deleted file mode 100644 index 3442c803e11..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_routefilterpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterPropertiesFormat struct { - IPv6Peerings *[]ExpressRouteCircuitPeering `json:"ipv6Peerings,omitempty"` - Peerings *[]ExpressRouteCircuitPeering `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]RouteFilterRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_routefilterrule.go b/resource-manager/network/2023-06-01/routefilters/model_routefilterrule.go deleted file mode 100644 index 7bce6e5cdbc..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_routefilterrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteFilterRulePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_routefilterrulepropertiesformat.go b/resource-manager/network/2023-06-01/routefilters/model_routefilterrulepropertiesformat.go deleted file mode 100644 index 70f71e0d28d..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_routefilterrulepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterRulePropertiesFormat struct { - Access Access `json:"access"` - Communities []string `json:"communities"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteFilterRuleType RouteFilterRuleType `json:"routeFilterRuleType"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_subresource.go b/resource-manager/network/2023-06-01/routefilters/model_subresource.go deleted file mode 100644 index 18344aa65b5..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routefilters/model_tagsobject.go b/resource-manager/network/2023-06-01/routefilters/model_tagsobject.go deleted file mode 100644 index 7657d1402ea..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package routefilters - -// 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/network/2023-06-01/routefilters/predicates.go b/resource-manager/network/2023-06-01/routefilters/predicates.go deleted file mode 100644 index 333d40af18b..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package routefilters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteFilterOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p RouteFilterOperationPredicate) Matches(input RouteFilter) 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 && (input.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/network/2023-06-01/routefilters/version.go b/resource-manager/network/2023-06-01/routefilters/version.go deleted file mode 100644 index c423dccb5d0..00000000000 --- a/resource-manager/network/2023-06-01/routefilters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routefilters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routefilters/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/routes/README.md b/resource-manager/network/2023-06-01/routes/README.md deleted file mode 100644 index eeb2349827c..00000000000 --- a/resource-manager/network/2023-06-01/routes/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routes` Documentation - -The `routes` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/routes" -``` - - -### Client Initialization - -```go -client := routes.NewRoutesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RoutesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -payload := routes.Route{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RoutesClient.Delete` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RoutesClient.Get` - -```go -ctx := context.TODO() -id := routes.NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - -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: `RoutesClient.List` - -```go -ctx := context.TODO() -id := routes.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -// 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/network/2023-06-01/routes/client.go b/resource-manager/network/2023-06-01/routes/client.go deleted file mode 100644 index 4372f694741..00000000000 --- a/resource-manager/network/2023-06-01/routes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routes - -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 RoutesClient struct { - Client *resourcemanager.Client -} - -func NewRoutesClientWithBaseURI(sdkApi sdkEnv.Api) (*RoutesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RoutesClient: %+v", err) - } - - return &RoutesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/routes/constants.go b/resource-manager/network/2023-06-01/routes/constants.go deleted file mode 100644 index e26bed906c5..00000000000 --- a/resource-manager/network/2023-06-01/routes/constants.go +++ /dev/null @@ -1,107 +0,0 @@ -package routes - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/routes/id_route.go b/resource-manager/network/2023-06-01/routes/id_route.go deleted file mode 100644 index c9e2c02ee1f..00000000000 --- a/resource-manager/network/2023-06-01/routes/id_route.go +++ /dev/null @@ -1,139 +0,0 @@ -package routes - -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(&RouteId{}) -} - -var _ resourceids.ResourceId = &RouteId{} - -// RouteId is a struct representing the Resource ID for a Route -type RouteId struct { - SubscriptionId string - ResourceGroupName string - RouteTableName string - RouteName string -} - -// NewRouteID returns a new RouteId struct -func NewRouteID(subscriptionId string, resourceGroupName string, routeTableName string, routeName string) RouteId { - return RouteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteTableName: routeTableName, - RouteName: routeName, - } -} - -// ParseRouteID parses 'input' into a RouteId -func ParseRouteID(input string) (*RouteId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteIDInsensitively parses 'input' case-insensitively into a RouteId -// note: this method should only be used for API response data and not user input -func ParseRouteIDInsensitively(input string) (*RouteId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteId) 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.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - if id.RouteName, ok = input.Parsed["routeName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeName", input) - } - - return nil -} - -// ValidateRouteID checks that 'input' can be parsed as a Route ID -func ValidateRouteID(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 := ParseRouteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route ID -func (id RouteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeTables/%s/routes/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteTableName, id.RouteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route ID -func (id RouteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - resourceids.StaticSegment("staticRoutes", "routes", "routes"), - resourceids.UserSpecifiedSegment("routeName", "routeValue"), - } -} - -// String returns a human-readable description of this Route ID -func (id RouteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - fmt.Sprintf("Route Name: %q", id.RouteName), - } - return fmt.Sprintf("Route (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/routes/id_route_test.go b/resource-manager/network/2023-06-01/routes/id_route_test.go deleted file mode 100644 index 2ab68ea9f0b..00000000000 --- a/resource-manager/network/2023-06-01/routes/id_route_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package routes - -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 = &RouteId{} - -func TestNewRouteID(t *testing.T) { - id := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue") - - 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.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } - - if id.RouteName != "routeValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteName'", id.RouteName, "routeValue") - } -} - -func TestFormatRouteID(t *testing.T) { - actual := NewRouteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue", "routeValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue", - Expected: &RouteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - RouteName: "routeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteID(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - if actual.RouteName != v.Expected.RouteName { - t.Fatalf("Expected %q but got %q for RouteName", v.Expected.RouteName, actual.RouteName) - } - - } -} - -func TestParseRouteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/rOuTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue", - Expected: &RouteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - RouteName: "routeValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/routes/routeValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/rOuTeS/rOuTeVaLuE", - Expected: &RouteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteTableName: "rOuTeTaBlEvAlUe", - RouteName: "rOuTeVaLuE", - }, - }, - { - // 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.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/rOuTeS/rOuTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteIDInsensitively(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - if actual.RouteName != v.Expected.RouteName { - t.Fatalf("Expected %q but got %q for RouteName", v.Expected.RouteName, actual.RouteName) - } - - } -} - -func TestSegmentsForRouteId(t *testing.T) { - segments := RouteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteId 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/network/2023-06-01/routes/id_routetable.go b/resource-manager/network/2023-06-01/routes/id_routetable.go deleted file mode 100644 index 459719bc26c..00000000000 --- a/resource-manager/network/2023-06-01/routes/id_routetable.go +++ /dev/null @@ -1,130 +0,0 @@ -package routes - -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(&RouteTableId{}) -} - -var _ resourceids.ResourceId = &RouteTableId{} - -// RouteTableId is a struct representing the Resource ID for a Route Table -type RouteTableId struct { - SubscriptionId string - ResourceGroupName string - RouteTableName string -} - -// NewRouteTableID returns a new RouteTableId struct -func NewRouteTableID(subscriptionId string, resourceGroupName string, routeTableName string) RouteTableId { - return RouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteTableName: routeTableName, - } -} - -// ParseRouteTableID parses 'input' into a RouteTableId -func ParseRouteTableID(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteTableIDInsensitively parses 'input' case-insensitively into a RouteTableId -// note: this method should only be used for API response data and not user input -func ParseRouteTableIDInsensitively(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteTableId) 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.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateRouteTableID checks that 'input' can be parsed as a Route Table ID -func ValidateRouteTableID(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 := ParseRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Table ID -func (id RouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Table ID -func (id RouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Route Table ID -func (id RouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/routes/id_routetable_test.go b/resource-manager/network/2023-06-01/routes/id_routetable_test.go deleted file mode 100644 index 8f3218d149a..00000000000 --- a/resource-manager/network/2023-06-01/routes/id_routetable_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routes - -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 = &RouteTableId{} - -func TestNewRouteTableID(t *testing.T) { - id := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - - 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.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatRouteTableID(t *testing.T) { - actual := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableID(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableIDInsensitively(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForRouteTableId(t *testing.T) { - segments := RouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteTableId 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/network/2023-06-01/routes/method_createorupdate.go b/resource-manager/network/2023-06-01/routes/method_createorupdate.go deleted file mode 100644 index 29b466f45ef..00000000000 --- a/resource-manager/network/2023-06-01/routes/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routes - -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 *Route -} - -// CreateOrUpdate ... -func (c RoutesClient) CreateOrUpdate(ctx context.Context, id RouteId, input Route) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RoutesClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteId, input Route) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/routes/method_delete.go b/resource-manager/network/2023-06-01/routes/method_delete.go deleted file mode 100644 index f6cee23c133..00000000000 --- a/resource-manager/network/2023-06-01/routes/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routes - -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 RoutesClient) Delete(ctx context.Context, id RouteId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RoutesClient) DeleteThenPoll(ctx context.Context, id RouteId) 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/network/2023-06-01/routes/method_get.go b/resource-manager/network/2023-06-01/routes/method_get.go deleted file mode 100644 index 8f641d28c5b..00000000000 --- a/resource-manager/network/2023-06-01/routes/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package routes - -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 *Route -} - -// Get ... -func (c RoutesClient) Get(ctx context.Context, id RouteId) (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 Route - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/routes/method_list.go b/resource-manager/network/2023-06-01/routes/method_list.go deleted file mode 100644 index 4ccb6f3031e..00000000000 --- a/resource-manager/network/2023-06-01/routes/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package routes - -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 *[]Route -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Route -} - -// List ... -func (c RoutesClient) List(ctx context.Context, id RouteTableId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routes", 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 *[]Route `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 RoutesClient) ListComplete(ctx context.Context, id RouteTableId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RouteOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RoutesClient) ListCompleteMatchingPredicate(ctx context.Context, id RouteTableId, predicate RouteOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Route, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/routes/model_route.go b/resource-manager/network/2023-06-01/routes/model_route.go deleted file mode 100644 index 364b3bb3322..00000000000 --- a/resource-manager/network/2023-06-01/routes/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routes/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/routes/model_routepropertiesformat.go deleted file mode 100644 index 82a30d0f4e0..00000000000 --- a/resource-manager/network/2023-06-01/routes/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routes/predicates.go b/resource-manager/network/2023-06-01/routes/predicates.go deleted file mode 100644 index b0ff24a6573..00000000000 --- a/resource-manager/network/2023-06-01/routes/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package routes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RouteOperationPredicate) Matches(input Route) 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.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/network/2023-06-01/routes/version.go b/resource-manager/network/2023-06-01/routes/version.go deleted file mode 100644 index 8344403202a..00000000000 --- a/resource-manager/network/2023-06-01/routes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routes/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/routetables/README.md b/resource-manager/network/2023-06-01/routetables/README.md deleted file mode 100644 index 566e9c7d4ef..00000000000 --- a/resource-manager/network/2023-06-01/routetables/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/routetables` Documentation - -The `routetables` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/routetables" -``` - - -### Client Initialization - -```go -client := routetables.NewRouteTablesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RouteTablesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -payload := routetables.RouteTable{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteTablesClient.Delete` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RouteTablesClient.Get` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -read, err := client.Get(ctx, id, routetables.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RouteTablesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `RouteTablesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `RouteTablesClient.UpdateTags` - -```go -ctx := context.TODO() -id := routetables.NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - -payload := routetables.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/network/2023-06-01/routetables/client.go b/resource-manager/network/2023-06-01/routetables/client.go deleted file mode 100644 index 26c9fb104ad..00000000000 --- a/resource-manager/network/2023-06-01/routetables/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package routetables - -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 RouteTablesClient struct { - Client *resourcemanager.Client -} - -func NewRouteTablesClientWithBaseURI(sdkApi sdkEnv.Api) (*RouteTablesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "routetables", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RouteTablesClient: %+v", err) - } - - return &RouteTablesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/routetables/constants.go b/resource-manager/network/2023-06-01/routetables/constants.go deleted file mode 100644 index 4a244a372fb..00000000000 --- a/resource-manager/network/2023-06-01/routetables/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package routetables - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/routetables/id_routetable.go b/resource-manager/network/2023-06-01/routetables/id_routetable.go deleted file mode 100644 index 0f3c938daf7..00000000000 --- a/resource-manager/network/2023-06-01/routetables/id_routetable.go +++ /dev/null @@ -1,130 +0,0 @@ -package routetables - -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(&RouteTableId{}) -} - -var _ resourceids.ResourceId = &RouteTableId{} - -// RouteTableId is a struct representing the Resource ID for a Route Table -type RouteTableId struct { - SubscriptionId string - ResourceGroupName string - RouteTableName string -} - -// NewRouteTableID returns a new RouteTableId struct -func NewRouteTableID(subscriptionId string, resourceGroupName string, routeTableName string) RouteTableId { - return RouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - RouteTableName: routeTableName, - } -} - -// ParseRouteTableID parses 'input' into a RouteTableId -func ParseRouteTableID(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteTableIDInsensitively parses 'input' case-insensitively into a RouteTableId -// note: this method should only be used for API response data and not user input -func ParseRouteTableIDInsensitively(input string) (*RouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteTableId) 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.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateRouteTableID checks that 'input' can be parsed as a Route Table ID -func ValidateRouteTableID(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 := ParseRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Table ID -func (id RouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Table ID -func (id RouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Route Table ID -func (id RouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/routetables/id_routetable_test.go b/resource-manager/network/2023-06-01/routetables/id_routetable_test.go deleted file mode 100644 index daf7d653c71..00000000000 --- a/resource-manager/network/2023-06-01/routetables/id_routetable_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package routetables - -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 = &RouteTableId{} - -func TestNewRouteTableID(t *testing.T) { - id := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue") - - 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.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatRouteTableID(t *testing.T) { - actual := NewRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableID(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &RouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteTableIDInsensitively(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.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForRouteTableId(t *testing.T) { - segments := RouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteTableId 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/network/2023-06-01/routetables/method_createorupdate.go b/resource-manager/network/2023-06-01/routetables/method_createorupdate.go deleted file mode 100644 index 04fdd62101d..00000000000 --- a/resource-manager/network/2023-06-01/routetables/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package routetables - -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 *RouteTable -} - -// CreateOrUpdate ... -func (c RouteTablesClient) CreateOrUpdate(ctx context.Context, id RouteTableId, input RouteTable) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c RouteTablesClient) CreateOrUpdateThenPoll(ctx context.Context, id RouteTableId, input RouteTable) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/routetables/method_delete.go b/resource-manager/network/2023-06-01/routetables/method_delete.go deleted file mode 100644 index 6ef6e0e531d..00000000000 --- a/resource-manager/network/2023-06-01/routetables/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package routetables - -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 RouteTablesClient) Delete(ctx context.Context, id RouteTableId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RouteTablesClient) DeleteThenPoll(ctx context.Context, id RouteTableId) 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/network/2023-06-01/routetables/method_get.go b/resource-manager/network/2023-06-01/routetables/method_get.go deleted file mode 100644 index 519ddb2364a..00000000000 --- a/resource-manager/network/2023-06-01/routetables/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package routetables - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RouteTable -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c RouteTablesClient) Get(ctx context.Context, id RouteTableId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 RouteTable - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/routetables/method_list.go b/resource-manager/network/2023-06-01/routetables/method_list.go deleted file mode 100644 index 5b428479e45..00000000000 --- a/resource-manager/network/2023-06-01/routetables/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package routetables - -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 *[]RouteTable -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteTable -} - -// List ... -func (c RouteTablesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeTables", 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 *[]RouteTable `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 RouteTablesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, RouteTableOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteTablesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate RouteTableOperationPredicate) (result ListCompleteResult, err error) { - items := make([]RouteTable, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/routetables/method_listall.go b/resource-manager/network/2023-06-01/routetables/method_listall.go deleted file mode 100644 index 141adf9bb23..00000000000 --- a/resource-manager/network/2023-06-01/routetables/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package routetables - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RouteTable -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteTable -} - -// ListAll ... -func (c RouteTablesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/routeTables", 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 *[]RouteTable `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c RouteTablesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, RouteTableOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RouteTablesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate RouteTableOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]RouteTable, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/routetables/method_updatetags.go b/resource-manager/network/2023-06-01/routetables/method_updatetags.go deleted file mode 100644 index b2db87b8208..00000000000 --- a/resource-manager/network/2023-06-01/routetables/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package routetables - -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 *RouteTable -} - -// UpdateTags ... -func (c RouteTablesClient) UpdateTags(ctx context.Context, id RouteTableId, 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 RouteTable - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 3f1666af192..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index aa535e08a6a..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 26b2afe4fb6..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 2474ea7f89e..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index b0ea966f8a5..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/routetables/model_applicationsecuritygroup.go deleted file mode 100644 index da94563b915..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index d270ac905b2..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_backendaddresspool.go b/resource-manager/network/2023-06-01/routetables/model_backendaddresspool.go deleted file mode 100644 index 90a55576b63..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 34067eb4dc7..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index d85f90834ef..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_ddossettings.go b/resource-manager/network/2023-06-01/routetables/model_ddossettings.go deleted file mode 100644 index ffd9663e361..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_delegation.go b/resource-manager/network/2023-06-01/routetables/model_delegation.go deleted file mode 100644 index 2098ca8ace8..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_flowlog.go b/resource-manager/network/2023-06-01/routetables/model_flowlog.go deleted file mode 100644 index cea97564b72..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/routetables/model_flowlogformatparameters.go deleted file mode 100644 index 46d83a48283..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_flowlogpropertiesformat.go deleted file mode 100644 index 23f3648b1da..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_frontendipconfiguration.go deleted file mode 100644 index 15308372f3a..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package routetables - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index c3ba5e8cb16..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/routetables/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index f99a910776d..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_inboundnatrule.go b/resource-manager/network/2023-06-01/routetables/model_inboundnatrule.go deleted file mode 100644 index b540b7a4ff5..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 5fa1c54256c..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_ipconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_ipconfiguration.go deleted file mode 100644 index 7f86bd442fd..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofile.go deleted file mode 100644 index 10063b56d94..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 8be23ea8407..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 33538e3da04..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_iptag.go b/resource-manager/network/2023-06-01/routetables/model_iptag.go deleted file mode 100644 index 0591a6fbb81..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// 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/network/2023-06-01/routetables/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddress.go deleted file mode 100644 index 6eb63262bd2..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index b4070586d52..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_natgateway.go b/resource-manager/network/2023-06-01/routetables/model_natgateway.go deleted file mode 100644 index cdcecbfa098..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package routetables - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_natgatewaypropertiesformat.go deleted file mode 100644 index dd643c79c79..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_natgatewaysku.go b/resource-manager/network/2023-06-01/routetables/model_natgatewaysku.go deleted file mode 100644 index 8e15e8b1250..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_natruleportmapping.go b/resource-manager/network/2023-06-01/routetables/model_natruleportmapping.go deleted file mode 100644 index 665d5f253ce..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterface.go b/resource-manager/network/2023-06-01/routetables/model_networkinterface.go deleted file mode 100644 index fac5f0869e6..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfacednssettings.go deleted file mode 100644 index 9d476ca2642..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 7db216219a1..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 60fdba4dd13..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 3f36842e1f3..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 4cc36c8f7f5..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 6f876f8ce53..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index fbd84b3af86..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/routetables/model_networksecuritygroup.go deleted file mode 100644 index 84c0fadac17..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 633f7012e04..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privateendpoint.go b/resource-manager/network/2023-06-01/routetables/model_privateendpoint.go deleted file mode 100644 index 80308b3a2a6..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/routetables/model_privateendpointconnection.go deleted file mode 100644 index 0e503458e9c..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/routetables/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/routetables/model_privateendpointconnectionproperties.go deleted file mode 100644 index f8d3eeab02b..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_privateendpointipconfiguration.go deleted file mode 100644 index de4e0254405..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/routetables/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 1ba73d98f4a..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/routetables/model_privateendpointproperties.go deleted file mode 100644 index 3d92a4a92e1..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkservice.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkservice.go deleted file mode 100644 index 29bf0cf5834..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnection.go deleted file mode 100644 index 4adf690c566..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 063a4faec37..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 3b1634cb059..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index e3ad61faa8f..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 430eebd19ae..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceproperties.go deleted file mode 100644 index 9e26fa01a75..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_publicipaddress.go b/resource-manager/network/2023-06-01/routetables/model_publicipaddress.go deleted file mode 100644 index 8248c499a22..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package routetables - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/routetables/model_publicipaddressdnssettings.go deleted file mode 100644 index 84b1e72e903..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_publicipaddresspropertiesformat.go deleted file mode 100644 index ba0c692ec23..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/routetables/model_publicipaddresssku.go deleted file mode 100644 index 956c758896f..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/routetables/model_resourcenavigationlink.go deleted file mode 100644 index c5d74e0472b..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/routetables/model_resourcenavigationlinkformat.go deleted file mode 100644 index eca6b593c69..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_resourceset.go b/resource-manager/network/2023-06-01/routetables/model_resourceset.go deleted file mode 100644 index 8a57a8fb40d..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/routetables/model_retentionpolicyparameters.go deleted file mode 100644 index 37bad49cdcb..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_route.go b/resource-manager/network/2023-06-01/routetables/model_route.go deleted file mode 100644 index 10c17005b28..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_routepropertiesformat.go deleted file mode 100644 index 028abe93e73..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_routetable.go b/resource-manager/network/2023-06-01/routetables/model_routetable.go deleted file mode 100644 index 1b2bb754997..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_routetablepropertiesformat.go deleted file mode 100644 index 64470e39699..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_securityrule.go b/resource-manager/network/2023-06-01/routetables/model_securityrule.go deleted file mode 100644 index ab6f4a35210..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_securityrulepropertiesformat.go deleted file mode 100644 index 636af5195f0..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/routetables/model_serviceassociationlink.go deleted file mode 100644 index 682b3659989..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 7ed4a93de00..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_servicedelegationpropertiesformat.go deleted file mode 100644 index fba1a21dc46..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicy.go deleted file mode 100644 index c941578ec3f..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 6a6135ec206..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index a9fcdcec846..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 25a22cda3fd..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_serviceendpointpropertiesformat.go deleted file mode 100644 index ffdfaa0569b..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_subnet.go b/resource-manager/network/2023-06-01/routetables/model_subnet.go deleted file mode 100644 index 949e07613d6..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_subnetpropertiesformat.go deleted file mode 100644 index 7b7eb8d21ea..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_subresource.go b/resource-manager/network/2023-06-01/routetables/model_subresource.go deleted file mode 100644 index eab315946e0..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_tagsobject.go b/resource-manager/network/2023-06-01/routetables/model_tagsobject.go deleted file mode 100644 index 61b33687ad4..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// 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/network/2023-06-01/routetables/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/routetables/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index e02ff0c097e..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/routetables/model_trafficanalyticsproperties.go deleted file mode 100644 index d88b7ea067e..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/routetables/model_virtualnetworktap.go deleted file mode 100644 index 7551bed07c8..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/routetables/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 2094070851f..00000000000 --- a/resource-manager/network/2023-06-01/routetables/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/routetables/predicates.go b/resource-manager/network/2023-06-01/routetables/predicates.go deleted file mode 100644 index e1d89b9fbd4..00000000000 --- a/resource-manager/network/2023-06-01/routetables/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package routetables - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTableOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p RouteTableOperationPredicate) Matches(input RouteTable) 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 && (input.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/network/2023-06-01/routetables/version.go b/resource-manager/network/2023-06-01/routetables/version.go deleted file mode 100644 index e9e8873b6ee..00000000000 --- a/resource-manager/network/2023-06-01/routetables/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package routetables - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/routetables/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/README.md b/resource-manager/network/2023-06-01/scopeconnections/README.md deleted file mode 100644 index b3f0c1bdddf..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/scopeconnections` Documentation - -The `scopeconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/scopeconnections" -``` - - -### Client Initialization - -```go -client := scopeconnections.NewScopeConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ScopeConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -payload := scopeconnections.ScopeConnection{ - // ... -} - - -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: `ScopeConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -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: `ScopeConnectionsClient.Get` - -```go -ctx := context.TODO() -id := scopeconnections.NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - -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: `ScopeConnectionsClient.List` - -```go -ctx := context.TODO() -id := scopeconnections.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, scopeconnections.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, scopeconnections.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/scopeconnections/client.go b/resource-manager/network/2023-06-01/scopeconnections/client.go deleted file mode 100644 index aa7247e35c7..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package scopeconnections - -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 ScopeConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewScopeConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ScopeConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "scopeconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ScopeConnectionsClient: %+v", err) - } - - return &ScopeConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/constants.go b/resource-manager/network/2023-06-01/scopeconnections/constants.go deleted file mode 100644 index 24a9bb99e3a..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package scopeconnections - -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 ScopeConnectionState string - -const ( - ScopeConnectionStateConflict ScopeConnectionState = "Conflict" - ScopeConnectionStateConnected ScopeConnectionState = "Connected" - ScopeConnectionStatePending ScopeConnectionState = "Pending" - ScopeConnectionStateRejected ScopeConnectionState = "Rejected" - ScopeConnectionStateRevoked ScopeConnectionState = "Revoked" -) - -func PossibleValuesForScopeConnectionState() []string { - return []string{ - string(ScopeConnectionStateConflict), - string(ScopeConnectionStateConnected), - string(ScopeConnectionStatePending), - string(ScopeConnectionStateRejected), - string(ScopeConnectionStateRevoked), - } -} - -func (s *ScopeConnectionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScopeConnectionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScopeConnectionState(input string) (*ScopeConnectionState, error) { - vals := map[string]ScopeConnectionState{ - "conflict": ScopeConnectionStateConflict, - "connected": ScopeConnectionStateConnected, - "pending": ScopeConnectionStatePending, - "rejected": ScopeConnectionStateRejected, - "revoked": ScopeConnectionStateRevoked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScopeConnectionState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/id_networkmanager.go b/resource-manager/network/2023-06-01/scopeconnections/id_networkmanager.go deleted file mode 100644 index 259fe7f2afa..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package scopeconnections - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/id_networkmanager_test.go b/resource-manager/network/2023-06-01/scopeconnections/id_networkmanager_test.go deleted file mode 100644 index 2fff6fad485..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package scopeconnections - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/scopeconnections/id_scopeconnection.go b/resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection.go deleted file mode 100644 index dd1d78f3b94..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package scopeconnections - -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(&ScopeConnectionId{}) -} - -var _ resourceids.ResourceId = &ScopeConnectionId{} - -// ScopeConnectionId is a struct representing the Resource ID for a Scope Connection -type ScopeConnectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - ScopeConnectionName string -} - -// NewScopeConnectionID returns a new ScopeConnectionId struct -func NewScopeConnectionID(subscriptionId string, resourceGroupName string, networkManagerName string, scopeConnectionName string) ScopeConnectionId { - return ScopeConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - ScopeConnectionName: scopeConnectionName, - } -} - -// ParseScopeConnectionID parses 'input' into a ScopeConnectionId -func ParseScopeConnectionID(input string) (*ScopeConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopeConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopeConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopeConnectionIDInsensitively parses 'input' case-insensitively into a ScopeConnectionId -// note: this method should only be used for API response data and not user input -func ParseScopeConnectionIDInsensitively(input string) (*ScopeConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopeConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopeConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopeConnectionId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.ScopeConnectionName, ok = input.Parsed["scopeConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scopeConnectionName", input) - } - - return nil -} - -// ValidateScopeConnectionID checks that 'input' can be parsed as a Scope Connection ID -func ValidateScopeConnectionID(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 := ParseScopeConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scope Connection ID -func (id ScopeConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/scopeConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.ScopeConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scope Connection ID -func (id ScopeConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticScopeConnections", "scopeConnections", "scopeConnections"), - resourceids.UserSpecifiedSegment("scopeConnectionName", "scopeConnectionValue"), - } -} - -// String returns a human-readable description of this Scope Connection ID -func (id ScopeConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Scope Connection Name: %q", id.ScopeConnectionName), - } - return fmt.Sprintf("Scope Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection_test.go b/resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection_test.go deleted file mode 100644 index 7beffedb1b9..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/id_scopeconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package scopeconnections - -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 = &ScopeConnectionId{} - -func TestNewScopeConnectionID(t *testing.T) { - id := NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.ScopeConnectionName != "scopeConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ScopeConnectionName'", id.ScopeConnectionName, "scopeConnectionValue") - } -} - -func TestFormatScopeConnectionID(t *testing.T) { - actual := NewScopeConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "scopeConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopeConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopeConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue", - Expected: &ScopeConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ScopeConnectionName: "scopeConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopeConnectionID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ScopeConnectionName != v.Expected.ScopeConnectionName { - t.Fatalf("Expected %q but got %q for ScopeConnectionName", v.Expected.ScopeConnectionName, actual.ScopeConnectionName) - } - - } -} - -func TestParseScopeConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopeConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sCoPeCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue", - Expected: &ScopeConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - ScopeConnectionName: "scopeConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/scopeConnections/scopeConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sCoPeCoNnEcTiOnS/sCoPeCoNnEcTiOnVaLuE", - Expected: &ScopeConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - ScopeConnectionName: "sCoPeCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sCoPeCoNnEcTiOnS/sCoPeCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopeConnectionIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.ScopeConnectionName != v.Expected.ScopeConnectionName { - t.Fatalf("Expected %q but got %q for ScopeConnectionName", v.Expected.ScopeConnectionName, actual.ScopeConnectionName) - } - - } -} - -func TestSegmentsForScopeConnectionId(t *testing.T) { - segments := ScopeConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopeConnectionId 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/network/2023-06-01/scopeconnections/method_createorupdate.go b/resource-manager/network/2023-06-01/scopeconnections/method_createorupdate.go deleted file mode 100644 index c0784b21bd5..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package scopeconnections - -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 *ScopeConnection -} - -// CreateOrUpdate ... -func (c ScopeConnectionsClient) CreateOrUpdate(ctx context.Context, id ScopeConnectionId, input ScopeConnection) (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 ScopeConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/method_delete.go b/resource-manager/network/2023-06-01/scopeconnections/method_delete.go deleted file mode 100644 index 0ef9f60e8f6..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package scopeconnections - -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 ScopeConnectionsClient) Delete(ctx context.Context, id ScopeConnectionId) (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/network/2023-06-01/scopeconnections/method_get.go b/resource-manager/network/2023-06-01/scopeconnections/method_get.go deleted file mode 100644 index 97616b65ce8..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package scopeconnections - -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 *ScopeConnection -} - -// Get ... -func (c ScopeConnectionsClient) Get(ctx context.Context, id ScopeConnectionId) (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 ScopeConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/method_list.go b/resource-manager/network/2023-06-01/scopeconnections/method_list.go deleted file mode 100644 index 00918fecd58..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package scopeconnections - -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 *[]ScopeConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ScopeConnection -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c ScopeConnectionsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/scopeConnections", id.ID()), - OptionsObject: options, - } - - 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 *[]ScopeConnection `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 ScopeConnectionsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, ScopeConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ScopeConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate ScopeConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ScopeConnection, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/scopeconnections/model_scopeconnection.go b/resource-manager/network/2023-06-01/scopeconnections/model_scopeconnection.go deleted file mode 100644 index ddb7dcfd3ff..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/model_scopeconnection.go +++ /dev/null @@ -1,17 +0,0 @@ -package scopeconnections - -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 ScopeConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ScopeConnectionProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/model_scopeconnectionproperties.go b/resource-manager/network/2023-06-01/scopeconnections/model_scopeconnectionproperties.go deleted file mode 100644 index 0997147a2a9..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/model_scopeconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package scopeconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeConnectionProperties struct { - ConnectionState *ScopeConnectionState `json:"connectionState,omitempty"` - Description *string `json:"description,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/scopeconnections/predicates.go b/resource-manager/network/2023-06-01/scopeconnections/predicates.go deleted file mode 100644 index eda309664f4..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package scopeconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ScopeConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ScopeConnectionOperationPredicate) Matches(input ScopeConnection) 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.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/network/2023-06-01/scopeconnections/version.go b/resource-manager/network/2023-06-01/scopeconnections/version.go deleted file mode 100644 index cea10979b02..00000000000 --- a/resource-manager/network/2023-06-01/scopeconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package scopeconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/scopeconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/README.md b/resource-manager/network/2023-06-01/securityadminconfigurations/README.md deleted file mode 100644 index fe3f683aed4..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/securityadminconfigurations` Documentation - -The `securityadminconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/securityadminconfigurations" -``` - - -### Client Initialization - -```go -client := securityadminconfigurations.NewSecurityAdminConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityAdminConfigurationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -payload := securityadminconfigurations.SecurityAdminConfiguration{ - // ... -} - - -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: `SecurityAdminConfigurationsClient.Delete` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -if err := client.DeleteThenPoll(ctx, id, securityadminconfigurations.DefaultDeleteOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityAdminConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - -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: `SecurityAdminConfigurationsClient.List` - -```go -ctx := context.TODO() -id := securityadminconfigurations.NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - -// alternatively `client.List(ctx, id, securityadminconfigurations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, securityadminconfigurations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/client.go b/resource-manager/network/2023-06-01/securityadminconfigurations/client.go deleted file mode 100644 index 7629a2dcefb..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securityadminconfigurations - -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 SecurityAdminConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewSecurityAdminConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityAdminConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securityadminconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityAdminConfigurationsClient: %+v", err) - } - - return &SecurityAdminConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/constants.go b/resource-manager/network/2023-06-01/securityadminconfigurations/constants.go deleted file mode 100644 index bfadf6115a8..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package securityadminconfigurations - -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 NetworkIntentPolicyBasedService string - -const ( - NetworkIntentPolicyBasedServiceAll NetworkIntentPolicyBasedService = "All" - NetworkIntentPolicyBasedServiceAllowRulesOnly NetworkIntentPolicyBasedService = "AllowRulesOnly" - NetworkIntentPolicyBasedServiceNone NetworkIntentPolicyBasedService = "None" -) - -func PossibleValuesForNetworkIntentPolicyBasedService() []string { - return []string{ - string(NetworkIntentPolicyBasedServiceAll), - string(NetworkIntentPolicyBasedServiceAllowRulesOnly), - string(NetworkIntentPolicyBasedServiceNone), - } -} - -func (s *NetworkIntentPolicyBasedService) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkIntentPolicyBasedService(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkIntentPolicyBasedService(input string) (*NetworkIntentPolicyBasedService, error) { - vals := map[string]NetworkIntentPolicyBasedService{ - "all": NetworkIntentPolicyBasedServiceAll, - "allowrulesonly": NetworkIntentPolicyBasedServiceAllowRulesOnly, - "none": NetworkIntentPolicyBasedServiceNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkIntentPolicyBasedService(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager.go b/resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager.go deleted file mode 100644 index cc45635d1cc..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager.go +++ /dev/null @@ -1,130 +0,0 @@ -package securityadminconfigurations - -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(&NetworkManagerId{}) -} - -var _ resourceids.ResourceId = &NetworkManagerId{} - -// NetworkManagerId is a struct representing the Resource ID for a Network Manager -type NetworkManagerId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string -} - -// NewNetworkManagerID returns a new NetworkManagerId struct -func NewNetworkManagerID(subscriptionId string, resourceGroupName string, networkManagerName string) NetworkManagerId { - return NetworkManagerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - } -} - -// ParseNetworkManagerID parses 'input' into a NetworkManagerId -func ParseNetworkManagerID(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkManagerIDInsensitively parses 'input' case-insensitively into a NetworkManagerId -// note: this method should only be used for API response data and not user input -func ParseNetworkManagerIDInsensitively(input string) (*NetworkManagerId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkManagerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkManagerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkManagerId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - return nil -} - -// ValidateNetworkManagerID checks that 'input' can be parsed as a Network Manager ID -func ValidateNetworkManagerID(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 := ParseNetworkManagerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Manager ID -func (id NetworkManagerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Manager ID -func (id NetworkManagerId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - } -} - -// String returns a human-readable description of this Network Manager ID -func (id NetworkManagerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - } - return fmt.Sprintf("Network Manager (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager_test.go b/resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager_test.go deleted file mode 100644 index 1da0952d267..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/id_networkmanager_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securityadminconfigurations - -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 = &NetworkManagerId{} - -func TestNewNetworkManagerID(t *testing.T) { - id := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } -} - -func TestFormatNetworkManagerID(t *testing.T) { - actual := NewNetworkManagerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkManagerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestParseNetworkManagerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkManagerId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Expected: &NetworkManagerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkManagerIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - } -} - -func TestSegmentsForNetworkManagerId(t *testing.T) { - segments := NetworkManagerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkManagerId 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/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration.go b/resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration.go deleted file mode 100644 index c481f6a158b..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration.go +++ /dev/null @@ -1,139 +0,0 @@ -package securityadminconfigurations - -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(&SecurityAdminConfigurationId{}) -} - -var _ resourceids.ResourceId = &SecurityAdminConfigurationId{} - -// SecurityAdminConfigurationId is a struct representing the Resource ID for a Security Admin Configuration -type SecurityAdminConfigurationId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - SecurityAdminConfigurationName string -} - -// NewSecurityAdminConfigurationID returns a new SecurityAdminConfigurationId struct -func NewSecurityAdminConfigurationID(subscriptionId string, resourceGroupName string, networkManagerName string, securityAdminConfigurationName string) SecurityAdminConfigurationId { - return SecurityAdminConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - SecurityAdminConfigurationName: securityAdminConfigurationName, - } -} - -// ParseSecurityAdminConfigurationID parses 'input' into a SecurityAdminConfigurationId -func ParseSecurityAdminConfigurationID(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityAdminConfigurationIDInsensitively parses 'input' case-insensitively into a SecurityAdminConfigurationId -// note: this method should only be used for API response data and not user input -func ParseSecurityAdminConfigurationIDInsensitively(input string) (*SecurityAdminConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityAdminConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityAdminConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityAdminConfigurationId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.SecurityAdminConfigurationName, ok = input.Parsed["securityAdminConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityAdminConfigurationName", input) - } - - return nil -} - -// ValidateSecurityAdminConfigurationID checks that 'input' can be parsed as a Security Admin Configuration ID -func ValidateSecurityAdminConfigurationID(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 := ParseSecurityAdminConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Admin Configuration ID -func (id SecurityAdminConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/securityAdminConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.SecurityAdminConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticSecurityAdminConfigurations", "securityAdminConfigurations", "securityAdminConfigurations"), - resourceids.UserSpecifiedSegment("securityAdminConfigurationName", "securityAdminConfigurationValue"), - } -} - -// String returns a human-readable description of this Security Admin Configuration ID -func (id SecurityAdminConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Security Admin Configuration Name: %q", id.SecurityAdminConfigurationName), - } - return fmt.Sprintf("Security Admin Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration_test.go b/resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration_test.go deleted file mode 100644 index 6bbef50dedb..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/id_securityadminconfiguration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package securityadminconfigurations - -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 = &SecurityAdminConfigurationId{} - -func TestNewSecurityAdminConfigurationID(t *testing.T) { - id := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.SecurityAdminConfigurationName != "securityAdminConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityAdminConfigurationName'", id.SecurityAdminConfigurationName, "securityAdminConfigurationValue") - } -} - -func TestFormatSecurityAdminConfigurationID(t *testing.T) { - actual := NewSecurityAdminConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "securityAdminConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityAdminConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestParseSecurityAdminConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityAdminConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - SecurityAdminConfigurationName: "securityAdminConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/securityAdminConfigurations/securityAdminConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - Expected: &SecurityAdminConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - SecurityAdminConfigurationName: "sEcUrItYaDmInCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/sEcUrItYaDmInCoNfIgUrAtIoNs/sEcUrItYaDmInCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityAdminConfigurationIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.SecurityAdminConfigurationName != v.Expected.SecurityAdminConfigurationName { - t.Fatalf("Expected %q but got %q for SecurityAdminConfigurationName", v.Expected.SecurityAdminConfigurationName, actual.SecurityAdminConfigurationName) - } - - } -} - -func TestSegmentsForSecurityAdminConfigurationId(t *testing.T) { - segments := SecurityAdminConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityAdminConfigurationId 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/network/2023-06-01/securityadminconfigurations/method_createorupdate.go b/resource-manager/network/2023-06-01/securityadminconfigurations/method_createorupdate.go deleted file mode 100644 index e285ab5384c..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package securityadminconfigurations - -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 *SecurityAdminConfiguration -} - -// CreateOrUpdate ... -func (c SecurityAdminConfigurationsClient) CreateOrUpdate(ctx context.Context, id SecurityAdminConfigurationId, input SecurityAdminConfiguration) (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 SecurityAdminConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/method_delete.go b/resource-manager/network/2023-06-01/securityadminconfigurations/method_delete.go deleted file mode 100644 index d08913b2c20..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/method_delete.go +++ /dev/null @@ -1,99 +0,0 @@ -package securityadminconfigurations - -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 { - Force *bool -} - -func DefaultDeleteOperationOptions() DeleteOperationOptions { - return DeleteOperationOptions{} -} - -func (o DeleteOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DeleteOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -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 SecurityAdminConfigurationsClient) Delete(ctx context.Context, id SecurityAdminConfigurationId, 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, - Path: id.ID(), - OptionsObject: options, - } - - 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 SecurityAdminConfigurationsClient) DeleteThenPoll(ctx context.Context, id SecurityAdminConfigurationId, 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/network/2023-06-01/securityadminconfigurations/method_get.go b/resource-manager/network/2023-06-01/securityadminconfigurations/method_get.go deleted file mode 100644 index 6046f27ef91..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securityadminconfigurations - -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 *SecurityAdminConfiguration -} - -// Get ... -func (c SecurityAdminConfigurationsClient) Get(ctx context.Context, id SecurityAdminConfigurationId) (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 SecurityAdminConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/method_list.go b/resource-manager/network/2023-06-01/securityadminconfigurations/method_list.go deleted file mode 100644 index 4eb221200d0..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package securityadminconfigurations - -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 *[]SecurityAdminConfiguration -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityAdminConfiguration -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c SecurityAdminConfigurationsClient) List(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/securityAdminConfigurations", id.ID()), - OptionsObject: options, - } - - 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 *[]SecurityAdminConfiguration `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 SecurityAdminConfigurationsClient) ListComplete(ctx context.Context, id NetworkManagerId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, SecurityAdminConfigurationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityAdminConfigurationsClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkManagerId, options ListOperationOptions, predicate SecurityAdminConfigurationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityAdminConfiguration, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/securityadminconfigurations/model_securityadminconfiguration.go b/resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfiguration.go deleted file mode 100644 index 004c4d46b07..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package securityadminconfigurations - -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 SecurityAdminConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityAdminConfigurationPropertiesFormat `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go deleted file mode 100644 index cf9ecff7791..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/model_securityadminconfigurationpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package securityadminconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAdminConfigurationPropertiesFormat struct { - ApplyOnNetworkIntentPolicyBasedServices *[]NetworkIntentPolicyBasedService `json:"applyOnNetworkIntentPolicyBasedServices,omitempty"` - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securityadminconfigurations/predicates.go b/resource-manager/network/2023-06-01/securityadminconfigurations/predicates.go deleted file mode 100644 index bcc5de9a6a8..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package securityadminconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAdminConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SecurityAdminConfigurationOperationPredicate) Matches(input SecurityAdminConfiguration) 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.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/network/2023-06-01/securityadminconfigurations/version.go b/resource-manager/network/2023-06-01/securityadminconfigurations/version.go deleted file mode 100644 index 67bc117f50f..00000000000 --- a/resource-manager/network/2023-06-01/securityadminconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityadminconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securityadminconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/README.md b/resource-manager/network/2023-06-01/securitypartnerproviders/README.md deleted file mode 100644 index 16b9fb360c9..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/securitypartnerproviders` Documentation - -The `securitypartnerproviders` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/securitypartnerproviders" -``` - - -### Client Initialization - -```go -client := securitypartnerproviders.NewSecurityPartnerProvidersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityPartnerProvidersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -payload := securitypartnerproviders.SecurityPartnerProvider{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityPartnerProvidersClient.Delete` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityPartnerProvidersClient.Get` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.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: `SecurityPartnerProvidersClient.UpdateTags` - -```go -ctx := context.TODO() -id := securitypartnerproviders.NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - -payload := securitypartnerproviders.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/network/2023-06-01/securitypartnerproviders/client.go b/resource-manager/network/2023-06-01/securitypartnerproviders/client.go deleted file mode 100644 index e87ed7e5d0e..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securitypartnerproviders - -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 SecurityPartnerProvidersClient struct { - Client *resourcemanager.Client -} - -func NewSecurityPartnerProvidersClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityPartnerProvidersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securitypartnerproviders", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityPartnerProvidersClient: %+v", err) - } - - return &SecurityPartnerProvidersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/constants.go b/resource-manager/network/2023-06-01/securitypartnerproviders/constants.go deleted file mode 100644 index 2390c77210a..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/constants.go +++ /dev/null @@ -1,148 +0,0 @@ -package securitypartnerproviders - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityPartnerProviderConnectionStatus string - -const ( - SecurityPartnerProviderConnectionStatusConnected SecurityPartnerProviderConnectionStatus = "Connected" - SecurityPartnerProviderConnectionStatusNotConnected SecurityPartnerProviderConnectionStatus = "NotConnected" - SecurityPartnerProviderConnectionStatusPartiallyConnected SecurityPartnerProviderConnectionStatus = "PartiallyConnected" - SecurityPartnerProviderConnectionStatusUnknown SecurityPartnerProviderConnectionStatus = "Unknown" -) - -func PossibleValuesForSecurityPartnerProviderConnectionStatus() []string { - return []string{ - string(SecurityPartnerProviderConnectionStatusConnected), - string(SecurityPartnerProviderConnectionStatusNotConnected), - string(SecurityPartnerProviderConnectionStatusPartiallyConnected), - string(SecurityPartnerProviderConnectionStatusUnknown), - } -} - -func (s *SecurityPartnerProviderConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityPartnerProviderConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityPartnerProviderConnectionStatus(input string) (*SecurityPartnerProviderConnectionStatus, error) { - vals := map[string]SecurityPartnerProviderConnectionStatus{ - "connected": SecurityPartnerProviderConnectionStatusConnected, - "notconnected": SecurityPartnerProviderConnectionStatusNotConnected, - "partiallyconnected": SecurityPartnerProviderConnectionStatusPartiallyConnected, - "unknown": SecurityPartnerProviderConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityPartnerProviderConnectionStatus(input) - return &out, nil -} - -type SecurityProviderName string - -const ( - SecurityProviderNameCheckpoint SecurityProviderName = "Checkpoint" - SecurityProviderNameIBoss SecurityProviderName = "IBoss" - SecurityProviderNameZScaler SecurityProviderName = "ZScaler" -) - -func PossibleValuesForSecurityProviderName() []string { - return []string{ - string(SecurityProviderNameCheckpoint), - string(SecurityProviderNameIBoss), - string(SecurityProviderNameZScaler), - } -} - -func (s *SecurityProviderName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityProviderName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityProviderName(input string) (*SecurityProviderName, error) { - vals := map[string]SecurityProviderName{ - "checkpoint": SecurityProviderNameCheckpoint, - "iboss": SecurityProviderNameIBoss, - "zscaler": SecurityProviderNameZScaler, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityProviderName(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider.go b/resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider.go deleted file mode 100644 index 32dd3433d4a..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider.go +++ /dev/null @@ -1,130 +0,0 @@ -package securitypartnerproviders - -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(&SecurityPartnerProviderId{}) -} - -var _ resourceids.ResourceId = &SecurityPartnerProviderId{} - -// SecurityPartnerProviderId is a struct representing the Resource ID for a Security Partner Provider -type SecurityPartnerProviderId struct { - SubscriptionId string - ResourceGroupName string - SecurityPartnerProviderName string -} - -// NewSecurityPartnerProviderID returns a new SecurityPartnerProviderId struct -func NewSecurityPartnerProviderID(subscriptionId string, resourceGroupName string, securityPartnerProviderName string) SecurityPartnerProviderId { - return SecurityPartnerProviderId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - SecurityPartnerProviderName: securityPartnerProviderName, - } -} - -// ParseSecurityPartnerProviderID parses 'input' into a SecurityPartnerProviderId -func ParseSecurityPartnerProviderID(input string) (*SecurityPartnerProviderId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityPartnerProviderId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityPartnerProviderId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityPartnerProviderIDInsensitively parses 'input' case-insensitively into a SecurityPartnerProviderId -// note: this method should only be used for API response data and not user input -func ParseSecurityPartnerProviderIDInsensitively(input string) (*SecurityPartnerProviderId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityPartnerProviderId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityPartnerProviderId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityPartnerProviderId) 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.SecurityPartnerProviderName, ok = input.Parsed["securityPartnerProviderName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityPartnerProviderName", input) - } - - return nil -} - -// ValidateSecurityPartnerProviderID checks that 'input' can be parsed as a Security Partner Provider ID -func ValidateSecurityPartnerProviderID(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 := ParseSecurityPartnerProviderID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Partner Provider ID -func (id SecurityPartnerProviderId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/securityPartnerProviders/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.SecurityPartnerProviderName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Partner Provider ID -func (id SecurityPartnerProviderId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticSecurityPartnerProviders", "securityPartnerProviders", "securityPartnerProviders"), - resourceids.UserSpecifiedSegment("securityPartnerProviderName", "securityPartnerProviderValue"), - } -} - -// String returns a human-readable description of this Security Partner Provider ID -func (id SecurityPartnerProviderId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Security Partner Provider Name: %q", id.SecurityPartnerProviderName), - } - return fmt.Sprintf("Security Partner Provider (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider_test.go b/resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider_test.go deleted file mode 100644 index 6eefc130a4d..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/id_securitypartnerprovider_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securitypartnerproviders - -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 = &SecurityPartnerProviderId{} - -func TestNewSecurityPartnerProviderID(t *testing.T) { - id := NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue") - - 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.SecurityPartnerProviderName != "securityPartnerProviderValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityPartnerProviderName'", id.SecurityPartnerProviderName, "securityPartnerProviderValue") - } -} - -func TestFormatSecurityPartnerProviderID(t *testing.T) { - actual := NewSecurityPartnerProviderID("12345678-1234-9876-4563-123456789012", "example-resource-group", "securityPartnerProviderValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityPartnerProviderID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityPartnerProviderId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue", - Expected: &SecurityPartnerProviderId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SecurityPartnerProviderName: "securityPartnerProviderValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityPartnerProviderID(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.SecurityPartnerProviderName != v.Expected.SecurityPartnerProviderName { - t.Fatalf("Expected %q but got %q for SecurityPartnerProviderName", v.Expected.SecurityPartnerProviderName, actual.SecurityPartnerProviderName) - } - - } -} - -func TestParseSecurityPartnerProviderIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityPartnerProviderId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sEcUrItYpArTnErPrOvIdErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue", - Expected: &SecurityPartnerProviderId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - SecurityPartnerProviderName: "securityPartnerProviderValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/securityPartnerProviders/securityPartnerProviderValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sEcUrItYpArTnErPrOvIdErS/sEcUrItYpArTnErPrOvIdErVaLuE", - Expected: &SecurityPartnerProviderId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - SecurityPartnerProviderName: "sEcUrItYpArTnErPrOvIdErVaLuE", - }, - }, - { - // 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.nEtWoRk/sEcUrItYpArTnErPrOvIdErS/sEcUrItYpArTnErPrOvIdErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityPartnerProviderIDInsensitively(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.SecurityPartnerProviderName != v.Expected.SecurityPartnerProviderName { - t.Fatalf("Expected %q but got %q for SecurityPartnerProviderName", v.Expected.SecurityPartnerProviderName, actual.SecurityPartnerProviderName) - } - - } -} - -func TestSegmentsForSecurityPartnerProviderId(t *testing.T) { - segments := SecurityPartnerProviderId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityPartnerProviderId 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/network/2023-06-01/securitypartnerproviders/method_createorupdate.go b/resource-manager/network/2023-06-01/securitypartnerproviders/method_createorupdate.go deleted file mode 100644 index 3fb82d42ab3..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package securitypartnerproviders - -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 *SecurityPartnerProvider -} - -// CreateOrUpdate ... -func (c SecurityPartnerProvidersClient) CreateOrUpdate(ctx context.Context, id SecurityPartnerProviderId, input SecurityPartnerProvider) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SecurityPartnerProvidersClient) CreateOrUpdateThenPoll(ctx context.Context, id SecurityPartnerProviderId, input SecurityPartnerProvider) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/securitypartnerproviders/method_delete.go b/resource-manager/network/2023-06-01/securitypartnerproviders/method_delete.go deleted file mode 100644 index 9494188070d..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package securitypartnerproviders - -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 SecurityPartnerProvidersClient) Delete(ctx context.Context, id SecurityPartnerProviderId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 SecurityPartnerProvidersClient) DeleteThenPoll(ctx context.Context, id SecurityPartnerProviderId) 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/network/2023-06-01/securitypartnerproviders/method_get.go b/resource-manager/network/2023-06-01/securitypartnerproviders/method_get.go deleted file mode 100644 index ca56a913bc7..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securitypartnerproviders - -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 *SecurityPartnerProvider -} - -// Get ... -func (c SecurityPartnerProvidersClient) Get(ctx context.Context, id SecurityPartnerProviderId) (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 SecurityPartnerProvider - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/method_list.go b/resource-manager/network/2023-06-01/securitypartnerproviders/method_list.go deleted file mode 100644 index 6528ea5a212..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package securitypartnerproviders - -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 *[]SecurityPartnerProvider -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityPartnerProvider -} - -// List ... -func (c SecurityPartnerProvidersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/securityPartnerProviders", 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 *[]SecurityPartnerProvider `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 SecurityPartnerProvidersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SecurityPartnerProviderOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityPartnerProvidersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SecurityPartnerProviderOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityPartnerProvider, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/securitypartnerproviders/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/securitypartnerproviders/method_listbyresourcegroup.go deleted file mode 100644 index cd19693bff6..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package securitypartnerproviders - -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 *[]SecurityPartnerProvider -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityPartnerProvider -} - -// ListByResourceGroup ... -func (c SecurityPartnerProvidersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/securityPartnerProviders", 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 *[]SecurityPartnerProvider `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 SecurityPartnerProvidersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, SecurityPartnerProviderOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityPartnerProvidersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate SecurityPartnerProviderOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]SecurityPartnerProvider, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/securitypartnerproviders/method_updatetags.go b/resource-manager/network/2023-06-01/securitypartnerproviders/method_updatetags.go deleted file mode 100644 index 7cbef507221..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package securitypartnerproviders - -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 *SecurityPartnerProvider -} - -// UpdateTags ... -func (c SecurityPartnerProvidersClient) UpdateTags(ctx context.Context, id SecurityPartnerProviderId, 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 SecurityPartnerProvider - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerprovider.go b/resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerprovider.go deleted file mode 100644 index 059710a7ff6..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerprovider.go +++ /dev/null @@ -1,14 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityPartnerProvider struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityPartnerProviderPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go b/resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go deleted file mode 100644 index 100f4648a9e..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/model_securitypartnerproviderpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityPartnerProviderPropertiesFormat struct { - ConnectionStatus *SecurityPartnerProviderConnectionStatus `json:"connectionStatus,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SecurityProviderName *SecurityProviderName `json:"securityProviderName,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/model_subresource.go b/resource-manager/network/2023-06-01/securitypartnerproviders/model_subresource.go deleted file mode 100644 index 0d259c7609a..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securitypartnerproviders/model_tagsobject.go b/resource-manager/network/2023-06-01/securitypartnerproviders/model_tagsobject.go deleted file mode 100644 index 64020cc08ef..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package securitypartnerproviders - -// 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/network/2023-06-01/securitypartnerproviders/predicates.go b/resource-manager/network/2023-06-01/securitypartnerproviders/predicates.go deleted file mode 100644 index ef826d6c55f..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package securitypartnerproviders - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityPartnerProviderOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p SecurityPartnerProviderOperationPredicate) Matches(input SecurityPartnerProvider) 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 && (input.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/network/2023-06-01/securitypartnerproviders/version.go b/resource-manager/network/2023-06-01/securitypartnerproviders/version.go deleted file mode 100644 index f419871150c..00000000000 --- a/resource-manager/network/2023-06-01/securitypartnerproviders/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitypartnerproviders - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securitypartnerproviders/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/securityrules/README.md b/resource-manager/network/2023-06-01/securityrules/README.md deleted file mode 100644 index e4f88012ad6..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/README.md +++ /dev/null @@ -1,115 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/securityrules` Documentation - -The `securityrules` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/securityrules" -``` - - -### Client Initialization - -```go -client := securityrules.NewSecurityRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -payload := securityrules.SecurityRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityRulesClient.DefaultSecurityRulesGet` - -```go -ctx := context.TODO() -id := securityrules.NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue") - -read, err := client.DefaultSecurityRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityRulesClient.DefaultSecurityRulesList` - -```go -ctx := context.TODO() -id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -// alternatively `client.DefaultSecurityRulesList(ctx, id)` can be used to do batched pagination -items, err := client.DefaultSecurityRulesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `SecurityRulesClient.Delete` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SecurityRulesClient.Get` - -```go -ctx := context.TODO() -id := securityrules.NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - -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: `SecurityRulesClient.List` - -```go -ctx := context.TODO() -id := securityrules.NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - -// 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/network/2023-06-01/securityrules/client.go b/resource-manager/network/2023-06-01/securityrules/client.go deleted file mode 100644 index 1fbf9b2c78c..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securityrules - -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 SecurityRulesClient struct { - Client *resourcemanager.Client -} - -func NewSecurityRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securityrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityRulesClient: %+v", err) - } - - return &SecurityRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/securityrules/constants.go b/resource-manager/network/2023-06-01/securityrules/constants.go deleted file mode 100644 index 41396358614..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/constants.go +++ /dev/null @@ -1,192 +0,0 @@ -package securityrules - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule.go b/resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule.go deleted file mode 100644 index a09823c4a35..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package securityrules - -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(&DefaultSecurityRuleId{}) -} - -var _ resourceids.ResourceId = &DefaultSecurityRuleId{} - -// DefaultSecurityRuleId is a struct representing the Resource ID for a Default Security Rule -type DefaultSecurityRuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string - DefaultSecurityRuleName string -} - -// NewDefaultSecurityRuleID returns a new DefaultSecurityRuleId struct -func NewDefaultSecurityRuleID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string, defaultSecurityRuleName string) DefaultSecurityRuleId { - return DefaultSecurityRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - DefaultSecurityRuleName: defaultSecurityRuleName, - } -} - -// ParseDefaultSecurityRuleID parses 'input' into a DefaultSecurityRuleId -func ParseDefaultSecurityRuleID(input string) (*DefaultSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DefaultSecurityRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DefaultSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDefaultSecurityRuleIDInsensitively parses 'input' case-insensitively into a DefaultSecurityRuleId -// note: this method should only be used for API response data and not user input -func ParseDefaultSecurityRuleIDInsensitively(input string) (*DefaultSecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&DefaultSecurityRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DefaultSecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DefaultSecurityRuleId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - if id.DefaultSecurityRuleName, ok = input.Parsed["defaultSecurityRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "defaultSecurityRuleName", input) - } - - return nil -} - -// ValidateDefaultSecurityRuleID checks that 'input' can be parsed as a Default Security Rule ID -func ValidateDefaultSecurityRuleID(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 := ParseDefaultSecurityRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Default Security Rule ID -func (id DefaultSecurityRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s/defaultSecurityRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName, id.DefaultSecurityRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Default Security Rule ID -func (id DefaultSecurityRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - resourceids.StaticSegment("staticDefaultSecurityRules", "defaultSecurityRules", "defaultSecurityRules"), - resourceids.UserSpecifiedSegment("defaultSecurityRuleName", "defaultSecurityRuleValue"), - } -} - -// String returns a human-readable description of this Default Security Rule ID -func (id DefaultSecurityRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - fmt.Sprintf("Default Security Rule Name: %q", id.DefaultSecurityRuleName), - } - return fmt.Sprintf("Default Security Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule_test.go b/resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule_test.go deleted file mode 100644 index 1e58fe9d867..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/id_defaultsecurityrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package securityrules - -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 = &DefaultSecurityRuleId{} - -func TestNewDefaultSecurityRuleID(t *testing.T) { - id := NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } - - if id.DefaultSecurityRuleName != "defaultSecurityRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'DefaultSecurityRuleName'", id.DefaultSecurityRuleName, "defaultSecurityRuleValue") - } -} - -func TestFormatDefaultSecurityRuleID(t *testing.T) { - actual := NewDefaultSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "defaultSecurityRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDefaultSecurityRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DefaultSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue", - Expected: &DefaultSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - DefaultSecurityRuleName: "defaultSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDefaultSecurityRuleID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.DefaultSecurityRuleName != v.Expected.DefaultSecurityRuleName { - t.Fatalf("Expected %q but got %q for DefaultSecurityRuleName", v.Expected.DefaultSecurityRuleName, actual.DefaultSecurityRuleName) - } - - } -} - -func TestParseDefaultSecurityRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DefaultSecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/dEfAuLtSeCuRiTyRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue", - Expected: &DefaultSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - DefaultSecurityRuleName: "defaultSecurityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/defaultSecurityRules/defaultSecurityRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/dEfAuLtSeCuRiTyRuLeS/dEfAuLtSeCuRiTyRuLeVaLuE", - Expected: &DefaultSecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - DefaultSecurityRuleName: "dEfAuLtSeCuRiTyRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/dEfAuLtSeCuRiTyRuLeS/dEfAuLtSeCuRiTyRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDefaultSecurityRuleIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.DefaultSecurityRuleName != v.Expected.DefaultSecurityRuleName { - t.Fatalf("Expected %q but got %q for DefaultSecurityRuleName", v.Expected.DefaultSecurityRuleName, actual.DefaultSecurityRuleName) - } - - } -} - -func TestSegmentsForDefaultSecurityRuleId(t *testing.T) { - segments := DefaultSecurityRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DefaultSecurityRuleId 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/network/2023-06-01/securityrules/id_networksecuritygroup.go b/resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup.go deleted file mode 100644 index 9b818e973d9..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup.go +++ /dev/null @@ -1,130 +0,0 @@ -package securityrules - -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(&NetworkSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkSecurityGroupId{} - -// NetworkSecurityGroupId is a struct representing the Resource ID for a Network Security Group -type NetworkSecurityGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string -} - -// NewNetworkSecurityGroupID returns a new NetworkSecurityGroupId struct -func NewNetworkSecurityGroupID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string) NetworkSecurityGroupId { - return NetworkSecurityGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - } -} - -// ParseNetworkSecurityGroupID parses 'input' into a NetworkSecurityGroupId -func ParseNetworkSecurityGroupID(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkSecurityGroupIDInsensitively parses 'input' case-insensitively into a NetworkSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkSecurityGroupIDInsensitively(input string) (*NetworkSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkSecurityGroupId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - return nil -} - -// ValidateNetworkSecurityGroupID checks that 'input' can be parsed as a Network Security Group ID -func ValidateNetworkSecurityGroupID(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 := ParseNetworkSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Security Group ID -func (id NetworkSecurityGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Security Group ID -func (id NetworkSecurityGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Network Security Group ID -func (id NetworkSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - } - return fmt.Sprintf("Network Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup_test.go b/resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup_test.go deleted file mode 100644 index cf49b48b01f..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/id_networksecuritygroup_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securityrules - -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 = &NetworkSecurityGroupId{} - -func TestNewNetworkSecurityGroupID(t *testing.T) { - id := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } -} - -func TestFormatNetworkSecurityGroupID(t *testing.T) { - actual := NewNetworkSecurityGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestParseNetworkSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkSecurityGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Expected: &NetworkSecurityGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkSecurityGroupIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - } -} - -func TestSegmentsForNetworkSecurityGroupId(t *testing.T) { - segments := NetworkSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkSecurityGroupId 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/network/2023-06-01/securityrules/id_securityrule.go b/resource-manager/network/2023-06-01/securityrules/id_securityrule.go deleted file mode 100644 index da153b38f42..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/id_securityrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package securityrules - -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(&SecurityRuleId{}) -} - -var _ resourceids.ResourceId = &SecurityRuleId{} - -// SecurityRuleId is a struct representing the Resource ID for a Security Rule -type SecurityRuleId struct { - SubscriptionId string - ResourceGroupName string - NetworkSecurityGroupName string - SecurityRuleName string -} - -// NewSecurityRuleID returns a new SecurityRuleId struct -func NewSecurityRuleID(subscriptionId string, resourceGroupName string, networkSecurityGroupName string, securityRuleName string) SecurityRuleId { - return SecurityRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkSecurityGroupName: networkSecurityGroupName, - SecurityRuleName: securityRuleName, - } -} - -// ParseSecurityRuleID parses 'input' into a SecurityRuleId -func ParseSecurityRuleID(input string) (*SecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityRuleIDInsensitively parses 'input' case-insensitively into a SecurityRuleId -// note: this method should only be used for API response data and not user input -func ParseSecurityRuleIDInsensitively(input string) (*SecurityRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityRuleId) 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.NetworkSecurityGroupName, ok = input.Parsed["networkSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkSecurityGroupName", input) - } - - if id.SecurityRuleName, ok = input.Parsed["securityRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityRuleName", input) - } - - return nil -} - -// ValidateSecurityRuleID checks that 'input' can be parsed as a Security Rule ID -func ValidateSecurityRuleID(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 := ParseSecurityRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Rule ID -func (id SecurityRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkSecurityGroups/%s/securityRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkSecurityGroupName, id.SecurityRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Rule ID -func (id SecurityRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkSecurityGroups", "networkSecurityGroups", "networkSecurityGroups"), - resourceids.UserSpecifiedSegment("networkSecurityGroupName", "networkSecurityGroupValue"), - resourceids.StaticSegment("staticSecurityRules", "securityRules", "securityRules"), - resourceids.UserSpecifiedSegment("securityRuleName", "securityRuleValue"), - } -} - -// String returns a human-readable description of this Security Rule ID -func (id SecurityRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Security Group Name: %q", id.NetworkSecurityGroupName), - fmt.Sprintf("Security Rule Name: %q", id.SecurityRuleName), - } - return fmt.Sprintf("Security Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/securityrules/id_securityrule_test.go b/resource-manager/network/2023-06-01/securityrules/id_securityrule_test.go deleted file mode 100644 index 199b413974f..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/id_securityrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package securityrules - -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 = &SecurityRuleId{} - -func TestNewSecurityRuleID(t *testing.T) { - id := NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue") - - 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.NetworkSecurityGroupName != "networkSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkSecurityGroupName'", id.NetworkSecurityGroupName, "networkSecurityGroupValue") - } - - if id.SecurityRuleName != "securityRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityRuleName'", id.SecurityRuleName, "securityRuleValue") - } -} - -func TestFormatSecurityRuleID(t *testing.T) { - actual := NewSecurityRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkSecurityGroupValue", "securityRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue", - Expected: &SecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - SecurityRuleName: "securityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityRuleID(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.SecurityRuleName != v.Expected.SecurityRuleName { - t.Fatalf("Expected %q but got %q for SecurityRuleName", v.Expected.SecurityRuleName, actual.SecurityRuleName) - } - - } -} - -func TestParseSecurityRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/sEcUrItYrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue", - Expected: &SecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkSecurityGroupName: "networkSecurityGroupValue", - SecurityRuleName: "securityRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkSecurityGroups/networkSecurityGroupValue/securityRules/securityRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/sEcUrItYrUlEs/sEcUrItYrUlEvAlUe", - Expected: &SecurityRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkSecurityGroupName: "nEtWoRkSeCuRiTyGrOuPvAlUe", - SecurityRuleName: "sEcUrItYrUlEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkSeCuRiTyGrOuPs/nEtWoRkSeCuRiTyGrOuPvAlUe/sEcUrItYrUlEs/sEcUrItYrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityRuleIDInsensitively(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.NetworkSecurityGroupName != v.Expected.NetworkSecurityGroupName { - t.Fatalf("Expected %q but got %q for NetworkSecurityGroupName", v.Expected.NetworkSecurityGroupName, actual.NetworkSecurityGroupName) - } - - if actual.SecurityRuleName != v.Expected.SecurityRuleName { - t.Fatalf("Expected %q but got %q for SecurityRuleName", v.Expected.SecurityRuleName, actual.SecurityRuleName) - } - - } -} - -func TestSegmentsForSecurityRuleId(t *testing.T) { - segments := SecurityRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityRuleId 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/network/2023-06-01/securityrules/method_createorupdate.go b/resource-manager/network/2023-06-01/securityrules/method_createorupdate.go deleted file mode 100644 index ca2001b1716..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package securityrules - -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 *SecurityRule -} - -// CreateOrUpdate ... -func (c SecurityRulesClient) CreateOrUpdate(ctx context.Context, id SecurityRuleId, input SecurityRule) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SecurityRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id SecurityRuleId, input SecurityRule) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/securityrules/method_defaultsecurityrulesget.go b/resource-manager/network/2023-06-01/securityrules/method_defaultsecurityrulesget.go deleted file mode 100644 index a672fd767b7..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/method_defaultsecurityrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package securityrules - -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 DefaultSecurityRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SecurityRule -} - -// DefaultSecurityRulesGet ... -func (c SecurityRulesClient) DefaultSecurityRulesGet(ctx context.Context, id DefaultSecurityRuleId) (result DefaultSecurityRulesGetOperationResponse, 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 SecurityRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/securityrules/method_defaultsecurityruleslist.go b/resource-manager/network/2023-06-01/securityrules/method_defaultsecurityruleslist.go deleted file mode 100644 index f9c732abc47..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/method_defaultsecurityruleslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package securityrules - -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 DefaultSecurityRulesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]SecurityRule -} - -type DefaultSecurityRulesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityRule -} - -// DefaultSecurityRulesList ... -func (c SecurityRulesClient) DefaultSecurityRulesList(ctx context.Context, id NetworkSecurityGroupId) (result DefaultSecurityRulesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/defaultSecurityRules", 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 *[]SecurityRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// DefaultSecurityRulesListComplete retrieves all the results into a single object -func (c SecurityRulesClient) DefaultSecurityRulesListComplete(ctx context.Context, id NetworkSecurityGroupId) (DefaultSecurityRulesListCompleteResult, error) { - return c.DefaultSecurityRulesListCompleteMatchingPredicate(ctx, id, SecurityRuleOperationPredicate{}) -} - -// DefaultSecurityRulesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityRulesClient) DefaultSecurityRulesListCompleteMatchingPredicate(ctx context.Context, id NetworkSecurityGroupId, predicate SecurityRuleOperationPredicate) (result DefaultSecurityRulesListCompleteResult, err error) { - items := make([]SecurityRule, 0) - - resp, err := c.DefaultSecurityRulesList(ctx, id) - if err != nil { - 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 = DefaultSecurityRulesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/securityrules/method_delete.go b/resource-manager/network/2023-06-01/securityrules/method_delete.go deleted file mode 100644 index 769b4866b0d..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package securityrules - -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 SecurityRulesClient) Delete(ctx context.Context, id SecurityRuleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 SecurityRulesClient) DeleteThenPoll(ctx context.Context, id SecurityRuleId) 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/network/2023-06-01/securityrules/method_get.go b/resource-manager/network/2023-06-01/securityrules/method_get.go deleted file mode 100644 index effcc9d3d7b..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securityrules - -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 *SecurityRule -} - -// Get ... -func (c SecurityRulesClient) Get(ctx context.Context, id SecurityRuleId) (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 SecurityRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/securityrules/method_list.go b/resource-manager/network/2023-06-01/securityrules/method_list.go deleted file mode 100644 index 752bb965b0b..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package securityrules - -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 *[]SecurityRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityRule -} - -// List ... -func (c SecurityRulesClient) List(ctx context.Context, id NetworkSecurityGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/securityRules", 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 *[]SecurityRule `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 SecurityRulesClient) ListComplete(ctx context.Context, id NetworkSecurityGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SecurityRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkSecurityGroupId, predicate SecurityRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/securityrules/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygroup.go deleted file mode 100644 index 7a6b77fa92a..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index b73ae024539..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securityrules/model_securityrule.go b/resource-manager/network/2023-06-01/securityrules/model_securityrule.go deleted file mode 100644 index e96cb57aa16..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securityrules/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/securityrules/model_securityrulepropertiesformat.go deleted file mode 100644 index a7e44555d95..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/securityrules/predicates.go b/resource-manager/network/2023-06-01/securityrules/predicates.go deleted file mode 100644 index adf918c9ac4..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package securityrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SecurityRuleOperationPredicate) Matches(input SecurityRule) 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.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/network/2023-06-01/securityrules/version.go b/resource-manager/network/2023-06-01/securityrules/version.go deleted file mode 100644 index fd469d759f2..00000000000 --- a/resource-manager/network/2023-06-01/securityrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securityrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securityrules/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/README.md b/resource-manager/network/2023-06-01/serviceendpointpolicies/README.md deleted file mode 100644 index c87293a2e72..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/serviceendpointpolicies` Documentation - -The `serviceendpointpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/serviceendpointpolicies" -``` - - -### Client Initialization - -```go -client := serviceendpointpolicies.NewServiceEndpointPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -payload := serviceendpointpolicies.ServiceEndpointPolicy{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.Get` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -read, err := client.Get(ctx, id, serviceendpointpolicies.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.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: `ServiceEndpointPoliciesClient.UpdateTags` - -```go -ctx := context.TODO() -id := serviceendpointpolicies.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -payload := serviceendpointpolicies.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/network/2023-06-01/serviceendpointpolicies/client.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/client.go deleted file mode 100644 index d92547bd44b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package serviceendpointpolicies - -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 ServiceEndpointPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewServiceEndpointPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceEndpointPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "serviceendpointpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServiceEndpointPoliciesClient: %+v", err) - } - - return &ServiceEndpointPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/constants.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/constants.go deleted file mode 100644 index e18805b64d6..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package serviceendpointpolicies - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy.go deleted file mode 100644 index 4b66cdb57fe..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package serviceendpointpolicies - -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(&ServiceEndpointPolicyId{}) -} - -var _ resourceids.ResourceId = &ServiceEndpointPolicyId{} - -// ServiceEndpointPolicyId is a struct representing the Resource ID for a Service Endpoint Policy -type ServiceEndpointPolicyId struct { - SubscriptionId string - ResourceGroupName string - ServiceEndpointPolicyName string -} - -// NewServiceEndpointPolicyID returns a new ServiceEndpointPolicyId struct -func NewServiceEndpointPolicyID(subscriptionId string, resourceGroupName string, serviceEndpointPolicyName string) ServiceEndpointPolicyId { - return ServiceEndpointPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServiceEndpointPolicyName: serviceEndpointPolicyName, - } -} - -// ParseServiceEndpointPolicyID parses 'input' into a ServiceEndpointPolicyId -func ParseServiceEndpointPolicyID(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServiceEndpointPolicyIDInsensitively parses 'input' case-insensitively into a ServiceEndpointPolicyId -// note: this method should only be used for API response data and not user input -func ParseServiceEndpointPolicyIDInsensitively(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServiceEndpointPolicyId) 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.ServiceEndpointPolicyName, ok = input.Parsed["serviceEndpointPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyName", input) - } - - return nil -} - -// ValidateServiceEndpointPolicyID checks that 'input' can be parsed as a Service Endpoint Policy ID -func ValidateServiceEndpointPolicyID(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 := ParseServiceEndpointPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/serviceEndpointPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServiceEndpointPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticServiceEndpointPolicies", "serviceEndpointPolicies", "serviceEndpointPolicies"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyName", "serviceEndpointPolicyValue"), - } -} - -// String returns a human-readable description of this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Service Endpoint Policy Name: %q", id.ServiceEndpointPolicyName), - } - return fmt.Sprintf("Service Endpoint Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go deleted file mode 100644 index b5a7b3cd151..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/id_serviceendpointpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package serviceendpointpolicies - -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 = &ServiceEndpointPolicyId{} - -func TestNewServiceEndpointPolicyID(t *testing.T) { - id := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - - 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.ServiceEndpointPolicyName != "serviceEndpointPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyName'", id.ServiceEndpointPolicyName, "serviceEndpointPolicyValue") - } -} - -func TestFormatServiceEndpointPolicyID(t *testing.T) { - actual := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServiceEndpointPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyID(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestParseServiceEndpointPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceEndpointPolicyName: "sErViCeEnDpOiNtPoLiCyVaLuE", - }, - }, - { - // 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.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyIDInsensitively(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestSegmentsForServiceEndpointPolicyId(t *testing.T) { - segments := ServiceEndpointPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServiceEndpointPolicyId 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/network/2023-06-01/serviceendpointpolicies/method_createorupdate.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/method_createorupdate.go deleted file mode 100644 index 1912253430d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package serviceendpointpolicies - -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 *ServiceEndpointPolicy -} - -// CreateOrUpdate ... -func (c ServiceEndpointPoliciesClient) CreateOrUpdate(ctx context.Context, id ServiceEndpointPolicyId, input ServiceEndpointPolicy) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ServiceEndpointPoliciesClient) CreateOrUpdateThenPoll(ctx context.Context, id ServiceEndpointPolicyId, input ServiceEndpointPolicy) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/serviceendpointpolicies/method_delete.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/method_delete.go deleted file mode 100644 index fbffd77bf76..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package serviceendpointpolicies - -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 ServiceEndpointPoliciesClient) Delete(ctx context.Context, id ServiceEndpointPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ServiceEndpointPoliciesClient) DeleteThenPoll(ctx context.Context, id ServiceEndpointPolicyId) 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/network/2023-06-01/serviceendpointpolicies/method_get.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/method_get.go deleted file mode 100644 index 4b9b1c2e323..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package serviceendpointpolicies - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ServiceEndpointPolicy -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c ServiceEndpointPoliciesClient) Get(ctx context.Context, id ServiceEndpointPolicyId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 ServiceEndpointPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_list.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/method_list.go deleted file mode 100644 index ebbd2768db1..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package serviceendpointpolicies - -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 *[]ServiceEndpointPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceEndpointPolicy -} - -// List ... -func (c ServiceEndpointPoliciesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/serviceEndpointPolicies", 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 *[]ServiceEndpointPolicy `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 ServiceEndpointPoliciesClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ServiceEndpointPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceEndpointPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ServiceEndpointPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ServiceEndpointPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/serviceendpointpolicies/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/method_listbyresourcegroup.go deleted file mode 100644 index 8eb93c4ac68..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package serviceendpointpolicies - -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 *[]ServiceEndpointPolicy -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceEndpointPolicy -} - -// ListByResourceGroup ... -func (c ServiceEndpointPoliciesClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/serviceEndpointPolicies", 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 *[]ServiceEndpointPolicy `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 ServiceEndpointPoliciesClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ServiceEndpointPolicyOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceEndpointPoliciesClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ServiceEndpointPolicyOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ServiceEndpointPolicy, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/serviceendpointpolicies/method_updatetags.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/method_updatetags.go deleted file mode 100644 index 92a472479ad..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package serviceendpointpolicies - -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 *ServiceEndpointPolicy -} - -// UpdateTags ... -func (c ServiceEndpointPoliciesClient) UpdateTags(ctx context.Context, id ServiceEndpointPolicyId, 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 ServiceEndpointPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 7a1f5258bb4..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 76bca3269ac..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 1e70d427a94..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 7f6bd42e1cc..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 15556d9d646..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygroup.go deleted file mode 100644 index 6e7d684d6ab..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 2f704e37983..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspool.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspool.go deleted file mode 100644 index feb93ad5475..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 4d71c4769d0..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 9f6fb9fe6e7..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ddossettings.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ddossettings.go deleted file mode 100644 index de52c73833f..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_delegation.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_delegation.go deleted file mode 100644 index 1e9e6e93b12..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlog.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlog.go deleted file mode 100644 index a657d2ccd92..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogformatparameters.go deleted file mode 100644 index 64ce02b9b62..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogpropertiesformat.go deleted file mode 100644 index c83c10c7197..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfiguration.go deleted file mode 100644 index 3460648e174..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package serviceendpointpolicies - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 27c417be79d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 253d53dc1d3..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrule.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrule.go deleted file mode 100644 index 691567f1623..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index bcdf56e4388..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfiguration.go deleted file mode 100644 index 43160da9e2b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofile.go deleted file mode 100644 index cbb4340c474..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index a8340bcc1f3..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index b76d67b91b5..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_iptag.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_iptag.go deleted file mode 100644 index 879d6210923..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// 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/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go deleted file mode 100644 index bcd25a343d4..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 71bfae4fc90..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgateway.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgateway.go deleted file mode 100644 index 4fce3c97a62..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package serviceendpointpolicies - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go deleted file mode 100644 index 0eae8e55e8c..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaysku.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaysku.go deleted file mode 100644 index d7c06ad6950..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natruleportmapping.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natruleportmapping.go deleted file mode 100644 index af408670c2d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterface.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterface.go deleted file mode 100644 index 4576b3d0a24..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacednssettings.go deleted file mode 100644 index f2f63e673ce..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go deleted file mode 100644 index efba2a7575d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index fee33255b2f..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index c09e2754047..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go deleted file mode 100644 index bdbb3dec753..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 373ac218872..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 1a2c2bc8774..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygroup.go deleted file mode 100644 index 7babf5dcba3..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 9e417934d4e..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpoint.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpoint.go deleted file mode 100644 index b9c2640063f..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnection.go deleted file mode 100644 index 0c67a94b069..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go deleted file mode 100644 index 9468576ebfd..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfiguration.go deleted file mode 100644 index 25ab508cf68..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index b2b9cd17391..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointproperties.go deleted file mode 100644 index b74aa311c14..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkservice.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkservice.go deleted file mode 100644 index f69adbd0b19..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnection.go deleted file mode 100644 index f163cad59d9..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index e9560116ef6..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 9accc19fd8b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index e2a71cb7416..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 6cc9d81d85e..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceproperties.go deleted file mode 100644 index 972989defcd..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddress.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddress.go deleted file mode 100644 index b3722e1f191..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package serviceendpointpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddressdnssettings.go deleted file mode 100644 index d28111e34e8..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go deleted file mode 100644 index fe9e93dc57e..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresssku.go deleted file mode 100644 index 5d6c2dd1535..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlink.go deleted file mode 100644 index 3a125f5d30e..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go deleted file mode 100644 index 004d9d501d7..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourceset.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourceset.go deleted file mode 100644 index 33f79b6dd7f..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_retentionpolicyparameters.go deleted file mode 100644 index 98b48093fe5..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_route.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_route.go deleted file mode 100644 index a08219146cf..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routepropertiesformat.go deleted file mode 100644 index a2d74c7e24a..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetable.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetable.go deleted file mode 100644 index fabb0fc336d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetablepropertiesformat.go deleted file mode 100644 index fbf628f66f3..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrule.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrule.go deleted file mode 100644 index 3f50e5ddac6..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrulepropertiesformat.go deleted file mode 100644 index 8d5f321605a..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlink.go deleted file mode 100644 index a22d8f42829..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 5b81f28e88b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 0903abfa70e..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicy.go deleted file mode 100644 index 796d7019b02..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 75928dae7f1..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 31efd2eb7eb..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index fdb4ecd0a7f..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 2927331856d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnet.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnet.go deleted file mode 100644 index 50005077792..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnetpropertiesformat.go deleted file mode 100644 index c865a7a529b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subresource.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subresource.go deleted file mode 100644 index 61370085ffc..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_tagsobject.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_tagsobject.go deleted file mode 100644 index 7c5d750fc90..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// 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/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index da94c72fe29..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsproperties.go deleted file mode 100644 index 58889a80476..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktap.go deleted file mode 100644 index 1d191ff67f0..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 2660ce6a382..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicies/predicates.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/predicates.go deleted file mode 100644 index ddd972a1d9d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/predicates.go +++ /dev/null @@ -1,42 +0,0 @@ -package serviceendpointpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyOperationPredicate struct { - Etag *string - Id *string - Kind *string - Location *string - Name *string - Type *string -} - -func (p ServiceEndpointPolicyOperationPredicate) Matches(input ServiceEndpointPolicy) 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.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { - return false - } - - if p.Location != nil && (input.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/network/2023-06-01/serviceendpointpolicies/version.go b/resource-manager/network/2023-06-01/serviceendpointpolicies/version.go deleted file mode 100644 index 8bb529ec3a5..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/README.md b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/README.md deleted file mode 100644 index fd16dc7abec..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions` Documentation - -The `serviceendpointpolicydefinitions` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/serviceendpointpolicydefinitions" -``` - - -### Client Initialization - -```go -client := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -payload := serviceendpointpolicydefinitions.ServiceEndpointPolicyDefinition{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Delete` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServiceEndpointPolicyDefinitionsClient.Get` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - -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: `ServiceEndpointPolicyDefinitionsClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := serviceendpointpolicydefinitions.NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - -// 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 -} -``` diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/client.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/client.go deleted file mode 100644 index c75845bd1b5..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ServiceEndpointPolicyDefinitionsClient struct { - Client *resourcemanager.Client -} - -func NewServiceEndpointPolicyDefinitionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceEndpointPolicyDefinitionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "serviceendpointpolicydefinitions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServiceEndpointPolicyDefinitionsClient: %+v", err) - } - - return &ServiceEndpointPolicyDefinitionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/constants.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/constants.go deleted file mode 100644 index 3e91dc60d4b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go deleted file mode 100644 index 2d85c659986..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package serviceendpointpolicydefinitions - -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(&ServiceEndpointPolicyId{}) -} - -var _ resourceids.ResourceId = &ServiceEndpointPolicyId{} - -// ServiceEndpointPolicyId is a struct representing the Resource ID for a Service Endpoint Policy -type ServiceEndpointPolicyId struct { - SubscriptionId string - ResourceGroupName string - ServiceEndpointPolicyName string -} - -// NewServiceEndpointPolicyID returns a new ServiceEndpointPolicyId struct -func NewServiceEndpointPolicyID(subscriptionId string, resourceGroupName string, serviceEndpointPolicyName string) ServiceEndpointPolicyId { - return ServiceEndpointPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServiceEndpointPolicyName: serviceEndpointPolicyName, - } -} - -// ParseServiceEndpointPolicyID parses 'input' into a ServiceEndpointPolicyId -func ParseServiceEndpointPolicyID(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServiceEndpointPolicyIDInsensitively parses 'input' case-insensitively into a ServiceEndpointPolicyId -// note: this method should only be used for API response data and not user input -func ParseServiceEndpointPolicyIDInsensitively(input string) (*ServiceEndpointPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServiceEndpointPolicyId) 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.ServiceEndpointPolicyName, ok = input.Parsed["serviceEndpointPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyName", input) - } - - return nil -} - -// ValidateServiceEndpointPolicyID checks that 'input' can be parsed as a Service Endpoint Policy ID -func ValidateServiceEndpointPolicyID(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 := ParseServiceEndpointPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/serviceEndpointPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServiceEndpointPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticServiceEndpointPolicies", "serviceEndpointPolicies", "serviceEndpointPolicies"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyName", "serviceEndpointPolicyValue"), - } -} - -// String returns a human-readable description of this Service Endpoint Policy ID -func (id ServiceEndpointPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Service Endpoint Policy Name: %q", id.ServiceEndpointPolicyName), - } - return fmt.Sprintf("Service Endpoint Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go deleted file mode 100644 index a5eee5d642d..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package serviceendpointpolicydefinitions - -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 = &ServiceEndpointPolicyId{} - -func TestNewServiceEndpointPolicyID(t *testing.T) { - id := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue") - - 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.ServiceEndpointPolicyName != "serviceEndpointPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyName'", id.ServiceEndpointPolicyName, "serviceEndpointPolicyValue") - } -} - -func TestFormatServiceEndpointPolicyID(t *testing.T) { - actual := NewServiceEndpointPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServiceEndpointPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyID(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestParseServiceEndpointPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE", - Expected: &ServiceEndpointPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceEndpointPolicyName: "sErViCeEnDpOiNtPoLiCyVaLuE", - }, - }, - { - // 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.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyIDInsensitively(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - } -} - -func TestSegmentsForServiceEndpointPolicyId(t *testing.T) { - segments := ServiceEndpointPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServiceEndpointPolicyId 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/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go deleted file mode 100644 index edee1adbeda..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,139 +0,0 @@ -package serviceendpointpolicydefinitions - -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(&ServiceEndpointPolicyDefinitionId{}) -} - -var _ resourceids.ResourceId = &ServiceEndpointPolicyDefinitionId{} - -// ServiceEndpointPolicyDefinitionId is a struct representing the Resource ID for a Service Endpoint Policy Definition -type ServiceEndpointPolicyDefinitionId struct { - SubscriptionId string - ResourceGroupName string - ServiceEndpointPolicyName string - ServiceEndpointPolicyDefinitionName string -} - -// NewServiceEndpointPolicyDefinitionID returns a new ServiceEndpointPolicyDefinitionId struct -func NewServiceEndpointPolicyDefinitionID(subscriptionId string, resourceGroupName string, serviceEndpointPolicyName string, serviceEndpointPolicyDefinitionName string) ServiceEndpointPolicyDefinitionId { - return ServiceEndpointPolicyDefinitionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServiceEndpointPolicyName: serviceEndpointPolicyName, - ServiceEndpointPolicyDefinitionName: serviceEndpointPolicyDefinitionName, - } -} - -// ParseServiceEndpointPolicyDefinitionID parses 'input' into a ServiceEndpointPolicyDefinitionId -func ParseServiceEndpointPolicyDefinitionID(input string) (*ServiceEndpointPolicyDefinitionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyDefinitionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyDefinitionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServiceEndpointPolicyDefinitionIDInsensitively parses 'input' case-insensitively into a ServiceEndpointPolicyDefinitionId -// note: this method should only be used for API response data and not user input -func ParseServiceEndpointPolicyDefinitionIDInsensitively(input string) (*ServiceEndpointPolicyDefinitionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServiceEndpointPolicyDefinitionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServiceEndpointPolicyDefinitionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServiceEndpointPolicyDefinitionId) 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.ServiceEndpointPolicyName, ok = input.Parsed["serviceEndpointPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyName", input) - } - - if id.ServiceEndpointPolicyDefinitionName, ok = input.Parsed["serviceEndpointPolicyDefinitionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serviceEndpointPolicyDefinitionName", input) - } - - return nil -} - -// ValidateServiceEndpointPolicyDefinitionID checks that 'input' can be parsed as a Service Endpoint Policy Definition ID -func ValidateServiceEndpointPolicyDefinitionID(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 := ParseServiceEndpointPolicyDefinitionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Service Endpoint Policy Definition ID -func (id ServiceEndpointPolicyDefinitionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/serviceEndpointPolicies/%s/serviceEndpointPolicyDefinitions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServiceEndpointPolicyName, id.ServiceEndpointPolicyDefinitionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Service Endpoint Policy Definition ID -func (id ServiceEndpointPolicyDefinitionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticServiceEndpointPolicies", "serviceEndpointPolicies", "serviceEndpointPolicies"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyName", "serviceEndpointPolicyValue"), - resourceids.StaticSegment("staticServiceEndpointPolicyDefinitions", "serviceEndpointPolicyDefinitions", "serviceEndpointPolicyDefinitions"), - resourceids.UserSpecifiedSegment("serviceEndpointPolicyDefinitionName", "serviceEndpointPolicyDefinitionValue"), - } -} - -// String returns a human-readable description of this Service Endpoint Policy Definition ID -func (id ServiceEndpointPolicyDefinitionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Service Endpoint Policy Name: %q", id.ServiceEndpointPolicyName), - fmt.Sprintf("Service Endpoint Policy Definition Name: %q", id.ServiceEndpointPolicyDefinitionName), - } - return fmt.Sprintf("Service Endpoint Policy Definition (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go deleted file mode 100644 index 7a15d1452f0..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/id_serviceendpointpolicydefinition_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package serviceendpointpolicydefinitions - -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 = &ServiceEndpointPolicyDefinitionId{} - -func TestNewServiceEndpointPolicyDefinitionID(t *testing.T) { - id := NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue") - - 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.ServiceEndpointPolicyName != "serviceEndpointPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyName'", id.ServiceEndpointPolicyName, "serviceEndpointPolicyValue") - } - - if id.ServiceEndpointPolicyDefinitionName != "serviceEndpointPolicyDefinitionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServiceEndpointPolicyDefinitionName'", id.ServiceEndpointPolicyDefinitionName, "serviceEndpointPolicyDefinitionValue") - } -} - -func TestFormatServiceEndpointPolicyDefinitionID(t *testing.T) { - actual := NewServiceEndpointPolicyDefinitionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serviceEndpointPolicyValue", "serviceEndpointPolicyDefinitionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServiceEndpointPolicyDefinitionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyDefinitionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue", - Expected: &ServiceEndpointPolicyDefinitionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - ServiceEndpointPolicyDefinitionName: "serviceEndpointPolicyDefinitionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyDefinitionID(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - if actual.ServiceEndpointPolicyDefinitionName != v.Expected.ServiceEndpointPolicyDefinitionName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyDefinitionName", v.Expected.ServiceEndpointPolicyDefinitionName, actual.ServiceEndpointPolicyDefinitionName) - } - - } -} - -func TestParseServiceEndpointPolicyDefinitionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServiceEndpointPolicyDefinitionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue", - Expected: &ServiceEndpointPolicyDefinitionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServiceEndpointPolicyName: "serviceEndpointPolicyValue", - ServiceEndpointPolicyDefinitionName: "serviceEndpointPolicyDefinitionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/serviceEndpointPolicies/serviceEndpointPolicyValue/serviceEndpointPolicyDefinitions/serviceEndpointPolicyDefinitionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnS/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnVaLuE", - Expected: &ServiceEndpointPolicyDefinitionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServiceEndpointPolicyName: "sErViCeEnDpOiNtPoLiCyVaLuE", - ServiceEndpointPolicyDefinitionName: "sErViCeEnDpOiNtPoLiCyDeFiNiTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/sErViCeEnDpOiNtPoLiCiEs/sErViCeEnDpOiNtPoLiCyVaLuE/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnS/sErViCeEnDpOiNtPoLiCyDeFiNiTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServiceEndpointPolicyDefinitionIDInsensitively(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.ServiceEndpointPolicyName != v.Expected.ServiceEndpointPolicyName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyName", v.Expected.ServiceEndpointPolicyName, actual.ServiceEndpointPolicyName) - } - - if actual.ServiceEndpointPolicyDefinitionName != v.Expected.ServiceEndpointPolicyDefinitionName { - t.Fatalf("Expected %q but got %q for ServiceEndpointPolicyDefinitionName", v.Expected.ServiceEndpointPolicyDefinitionName, actual.ServiceEndpointPolicyDefinitionName) - } - - } -} - -func TestSegmentsForServiceEndpointPolicyDefinitionId(t *testing.T) { - segments := ServiceEndpointPolicyDefinitionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServiceEndpointPolicyDefinitionId 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/network/2023-06-01/serviceendpointpolicydefinitions/method_createorupdate.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_createorupdate.go deleted file mode 100644 index e75afb9fc02..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package serviceendpointpolicydefinitions - -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 *ServiceEndpointPolicyDefinition -} - -// CreateOrUpdate ... -func (c ServiceEndpointPolicyDefinitionsClient) CreateOrUpdate(ctx context.Context, id ServiceEndpointPolicyDefinitionId, input ServiceEndpointPolicyDefinition) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ServiceEndpointPolicyDefinitionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ServiceEndpointPolicyDefinitionId, input ServiceEndpointPolicyDefinition) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/serviceendpointpolicydefinitions/method_delete.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_delete.go deleted file mode 100644 index 81989f95364..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ServiceEndpointPolicyDefinitionsClient) Delete(ctx context.Context, id ServiceEndpointPolicyDefinitionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ServiceEndpointPolicyDefinitionsClient) DeleteThenPoll(ctx context.Context, id ServiceEndpointPolicyDefinitionId) 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/network/2023-06-01/serviceendpointpolicydefinitions/method_get.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_get.go deleted file mode 100644 index e9e63e50232..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package serviceendpointpolicydefinitions - -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 *ServiceEndpointPolicyDefinition -} - -// Get ... -func (c ServiceEndpointPolicyDefinitionsClient) Get(ctx context.Context, id ServiceEndpointPolicyDefinitionId) (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 ServiceEndpointPolicyDefinition - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go deleted file mode 100644 index c6596cffc6c..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/method_listbyresourcegroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package serviceendpointpolicydefinitions - -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 ListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServiceEndpointPolicyDefinition -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceEndpointPolicyDefinition -} - -// ListByResourceGroup ... -func (c ServiceEndpointPolicyDefinitionsClient) ListByResourceGroup(ctx context.Context, id ServiceEndpointPolicyId) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceEndpointPolicyDefinitions", 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 *[]ServiceEndpointPolicyDefinition `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 ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupComplete(ctx context.Context, id ServiceEndpointPolicyId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ServiceEndpointPolicyDefinitionOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceEndpointPolicyDefinitionsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id ServiceEndpointPolicyId, predicate ServiceEndpointPolicyDefinitionOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ServiceEndpointPolicyDefinition, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 012ba37fe47..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicydefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index ff7d49d8a5b..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package serviceendpointpolicydefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/predicates.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/predicates.go deleted file mode 100644 index a7a08fa9deb..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package serviceendpointpolicydefinitions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ServiceEndpointPolicyDefinitionOperationPredicate) Matches(input ServiceEndpointPolicyDefinition) 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.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/network/2023-06-01/serviceendpointpolicydefinitions/version.go b/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/version.go deleted file mode 100644 index ffa440a73a4..00000000000 --- a/resource-manager/network/2023-06-01/serviceendpointpolicydefinitions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package serviceendpointpolicydefinitions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/serviceendpointpolicydefinitions/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/servicetags/README.md b/resource-manager/network/2023-06-01/servicetags/README.md deleted file mode 100644 index aff4d774640..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/servicetags` Documentation - -The `servicetags` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/servicetags" -``` - - -### Client Initialization - -```go -client := servicetags.NewServiceTagsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServiceTagsClient.ServiceTagInformationList` - -```go -ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ServiceTagInformationList(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions())` can be used to do batched pagination -items, err := client.ServiceTagInformationListComplete(ctx, id, servicetags.DefaultServiceTagInformationListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ServiceTagsClient.ServiceTagsList` - -```go -ctx := context.TODO() -id := servicetags.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.ServiceTagsList(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/network/2023-06-01/servicetags/client.go b/resource-manager/network/2023-06-01/servicetags/client.go deleted file mode 100644 index 7037716c1cf..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package servicetags - -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 ServiceTagsClient struct { - Client *resourcemanager.Client -} - -func NewServiceTagsClientWithBaseURI(sdkApi sdkEnv.Api) (*ServiceTagsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "servicetags", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServiceTagsClient: %+v", err) - } - - return &ServiceTagsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/servicetags/id_location.go b/resource-manager/network/2023-06-01/servicetags/id_location.go deleted file mode 100644 index b22b2cb34d7..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package servicetags - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/servicetags/id_location_test.go b/resource-manager/network/2023-06-01/servicetags/id_location_test.go deleted file mode 100644 index 8a0f29aebb1..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package servicetags - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/servicetags/method_servicetaginformationlist.go b/resource-manager/network/2023-06-01/servicetags/method_servicetaginformationlist.go deleted file mode 100644 index 2254cab335c..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/method_servicetaginformationlist.go +++ /dev/null @@ -1,123 +0,0 @@ -package servicetags - -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 ServiceTagInformationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServiceTagInformation -} - -type ServiceTagInformationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceTagInformation -} - -type ServiceTagInformationListOperationOptions struct { - NoAddressPrefixes *bool - TagName *string -} - -func DefaultServiceTagInformationListOperationOptions() ServiceTagInformationListOperationOptions { - return ServiceTagInformationListOperationOptions{} -} - -func (o ServiceTagInformationListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ServiceTagInformationListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ServiceTagInformationListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.NoAddressPrefixes != nil { - out.Append("noAddressPrefixes", fmt.Sprintf("%v", *o.NoAddressPrefixes)) - } - if o.TagName != nil { - out.Append("tagName", fmt.Sprintf("%v", *o.TagName)) - } - return &out -} - -// ServiceTagInformationList ... -func (c ServiceTagsClient) ServiceTagInformationList(ctx context.Context, id LocationId, options ServiceTagInformationListOperationOptions) (result ServiceTagInformationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceTagDetails", id.ID()), - OptionsObject: options, - } - - 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 *[]ServiceTagInformation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ServiceTagInformationListComplete retrieves all the results into a single object -func (c ServiceTagsClient) ServiceTagInformationListComplete(ctx context.Context, id LocationId, options ServiceTagInformationListOperationOptions) (ServiceTagInformationListCompleteResult, error) { - return c.ServiceTagInformationListCompleteMatchingPredicate(ctx, id, options, ServiceTagInformationOperationPredicate{}) -} - -// ServiceTagInformationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServiceTagsClient) ServiceTagInformationListCompleteMatchingPredicate(ctx context.Context, id LocationId, options ServiceTagInformationListOperationOptions, predicate ServiceTagInformationOperationPredicate) (result ServiceTagInformationListCompleteResult, err error) { - items := make([]ServiceTagInformation, 0) - - resp, err := c.ServiceTagInformationList(ctx, id, options) - if err != nil { - 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 = ServiceTagInformationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/servicetags/method_servicetagslist.go b/resource-manager/network/2023-06-01/servicetags/method_servicetagslist.go deleted file mode 100644 index f83c293d79b..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/method_servicetagslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package servicetags - -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 ServiceTagsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ServiceTagsListResult -} - -// ServiceTagsList ... -func (c ServiceTagsClient) ServiceTagsList(ctx context.Context, id LocationId) (result ServiceTagsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceTags", 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 ServiceTagsListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/servicetags/model_servicetaginformation.go b/resource-manager/network/2023-06-01/servicetags/model_servicetaginformation.go deleted file mode 100644 index 705268a5bb9..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/model_servicetaginformation.go +++ /dev/null @@ -1,11 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagInformation struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceTagInformationPropertiesFormat `json:"properties,omitempty"` - ServiceTagChangeNumber *string `json:"serviceTagChangeNumber,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/servicetags/model_servicetaginformationpropertiesformat.go b/resource-manager/network/2023-06-01/servicetags/model_servicetaginformationpropertiesformat.go deleted file mode 100644 index 0d51bfcd8b2..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/model_servicetaginformationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagInformationPropertiesFormat struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ChangeNumber *string `json:"changeNumber,omitempty"` - Region *string `json:"region,omitempty"` - State *string `json:"state,omitempty"` - SystemService *string `json:"systemService,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/servicetags/model_servicetagslistresult.go b/resource-manager/network/2023-06-01/servicetags/model_servicetagslistresult.go deleted file mode 100644 index 9cfb2fb2afb..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/model_servicetagslistresult.go +++ /dev/null @@ -1,14 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagsListResult struct { - ChangeNumber *string `json:"changeNumber,omitempty"` - Cloud *string `json:"cloud,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - NextLink *string `json:"nextLink,omitempty"` - Type *string `json:"type,omitempty"` - Values *[]ServiceTagInformation `json:"values,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/servicetags/predicates.go b/resource-manager/network/2023-06-01/servicetags/predicates.go deleted file mode 100644 index e10bffe6a4f..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package servicetags - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceTagInformationOperationPredicate struct { - Id *string - Name *string - ServiceTagChangeNumber *string -} - -func (p ServiceTagInformationOperationPredicate) Matches(input ServiceTagInformation) 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.ServiceTagChangeNumber != nil && (input.ServiceTagChangeNumber == nil || *p.ServiceTagChangeNumber != *input.ServiceTagChangeNumber) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/servicetags/version.go b/resource-manager/network/2023-06-01/servicetags/version.go deleted file mode 100644 index d31b06cca60..00000000000 --- a/resource-manager/network/2023-06-01/servicetags/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package servicetags - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/servicetags/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/staticmembers/README.md b/resource-manager/network/2023-06-01/staticmembers/README.md deleted file mode 100644 index b98b5db309c..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/staticmembers` Documentation - -The `staticmembers` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/staticmembers" -``` - - -### Client Initialization - -```go -client := staticmembers.NewStaticMembersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `StaticMembersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -payload := staticmembers.StaticMember{ - // ... -} - - -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: `StaticMembersClient.Delete` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -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: `StaticMembersClient.Get` - -```go -ctx := context.TODO() -id := staticmembers.NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - -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: `StaticMembersClient.List` - -```go -ctx := context.TODO() -id := staticmembers.NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - -// alternatively `client.List(ctx, id, staticmembers.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, staticmembers.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/staticmembers/client.go b/resource-manager/network/2023-06-01/staticmembers/client.go deleted file mode 100644 index 0bd2daa81d6..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package staticmembers - -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 StaticMembersClient struct { - Client *resourcemanager.Client -} - -func NewStaticMembersClientWithBaseURI(sdkApi sdkEnv.Api) (*StaticMembersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "staticmembers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating StaticMembersClient: %+v", err) - } - - return &StaticMembersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/staticmembers/constants.go b/resource-manager/network/2023-06-01/staticmembers/constants.go deleted file mode 100644 index 3ccbd94262b..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package staticmembers - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/staticmembers/id_networkgroup.go b/resource-manager/network/2023-06-01/staticmembers/id_networkgroup.go deleted file mode 100644 index cbc610731ad..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/id_networkgroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package staticmembers - -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(&NetworkGroupId{}) -} - -var _ resourceids.ResourceId = &NetworkGroupId{} - -// NetworkGroupId is a struct representing the Resource ID for a Network Group -type NetworkGroupId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - NetworkGroupName string -} - -// NewNetworkGroupID returns a new NetworkGroupId struct -func NewNetworkGroupID(subscriptionId string, resourceGroupName string, networkManagerName string, networkGroupName string) NetworkGroupId { - return NetworkGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - NetworkGroupName: networkGroupName, - } -} - -// ParseNetworkGroupID parses 'input' into a NetworkGroupId -func ParseNetworkGroupID(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkGroupIDInsensitively parses 'input' case-insensitively into a NetworkGroupId -// note: this method should only be used for API response data and not user input -func ParseNetworkGroupIDInsensitively(input string) (*NetworkGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkGroupId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.NetworkGroupName, ok = input.Parsed["networkGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkGroupName", input) - } - - return nil -} - -// ValidateNetworkGroupID checks that 'input' can be parsed as a Network Group ID -func ValidateNetworkGroupID(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 := ParseNetworkGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Group ID -func (id NetworkGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/networkGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.NetworkGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Group ID -func (id NetworkGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticNetworkGroups", "networkGroups", "networkGroups"), - resourceids.UserSpecifiedSegment("networkGroupName", "networkGroupValue"), - } -} - -// String returns a human-readable description of this Network Group ID -func (id NetworkGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Network Group Name: %q", id.NetworkGroupName), - } - return fmt.Sprintf("Network Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/staticmembers/id_networkgroup_test.go b/resource-manager/network/2023-06-01/staticmembers/id_networkgroup_test.go deleted file mode 100644 index 04360c54808..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/id_networkgroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package staticmembers - -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 = &NetworkGroupId{} - -func TestNewNetworkGroupID(t *testing.T) { - id := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.NetworkGroupName != "networkGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkGroupName'", id.NetworkGroupName, "networkGroupValue") - } -} - -func TestFormatNetworkGroupID(t *testing.T) { - actual := NewNetworkGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestParseNetworkGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe", - Expected: &NetworkGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - NetworkGroupName: "nEtWoRkGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkGroupIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - } -} - -func TestSegmentsForNetworkGroupId(t *testing.T) { - segments := NetworkGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkGroupId 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/network/2023-06-01/staticmembers/id_staticmember.go b/resource-manager/network/2023-06-01/staticmembers/id_staticmember.go deleted file mode 100644 index e972ef7ffc2..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/id_staticmember.go +++ /dev/null @@ -1,148 +0,0 @@ -package staticmembers - -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(&StaticMemberId{}) -} - -var _ resourceids.ResourceId = &StaticMemberId{} - -// StaticMemberId is a struct representing the Resource ID for a Static Member -type StaticMemberId struct { - SubscriptionId string - ResourceGroupName string - NetworkManagerName string - NetworkGroupName string - StaticMemberName string -} - -// NewStaticMemberID returns a new StaticMemberId struct -func NewStaticMemberID(subscriptionId string, resourceGroupName string, networkManagerName string, networkGroupName string, staticMemberName string) StaticMemberId { - return StaticMemberId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkManagerName: networkManagerName, - NetworkGroupName: networkGroupName, - StaticMemberName: staticMemberName, - } -} - -// ParseStaticMemberID parses 'input' into a StaticMemberId -func ParseStaticMemberID(input string) (*StaticMemberId, error) { - parser := resourceids.NewParserFromResourceIdType(&StaticMemberId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StaticMemberId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseStaticMemberIDInsensitively parses 'input' case-insensitively into a StaticMemberId -// note: this method should only be used for API response data and not user input -func ParseStaticMemberIDInsensitively(input string) (*StaticMemberId, error) { - parser := resourceids.NewParserFromResourceIdType(&StaticMemberId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := StaticMemberId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *StaticMemberId) 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.NetworkManagerName, ok = input.Parsed["networkManagerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkManagerName", input) - } - - if id.NetworkGroupName, ok = input.Parsed["networkGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkGroupName", input) - } - - if id.StaticMemberName, ok = input.Parsed["staticMemberName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "staticMemberName", input) - } - - return nil -} - -// ValidateStaticMemberID checks that 'input' can be parsed as a Static Member ID -func ValidateStaticMemberID(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 := ParseStaticMemberID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Static Member ID -func (id StaticMemberId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkManagers/%s/networkGroups/%s/staticMembers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkManagerName, id.NetworkGroupName, id.StaticMemberName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Static Member ID -func (id StaticMemberId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkManagers", "networkManagers", "networkManagers"), - resourceids.UserSpecifiedSegment("networkManagerName", "networkManagerValue"), - resourceids.StaticSegment("staticNetworkGroups", "networkGroups", "networkGroups"), - resourceids.UserSpecifiedSegment("networkGroupName", "networkGroupValue"), - resourceids.StaticSegment("staticStaticMembers", "staticMembers", "staticMembers"), - resourceids.UserSpecifiedSegment("staticMemberName", "staticMemberValue"), - } -} - -// String returns a human-readable description of this Static Member ID -func (id StaticMemberId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Manager Name: %q", id.NetworkManagerName), - fmt.Sprintf("Network Group Name: %q", id.NetworkGroupName), - fmt.Sprintf("Static Member Name: %q", id.StaticMemberName), - } - return fmt.Sprintf("Static Member (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/staticmembers/id_staticmember_test.go b/resource-manager/network/2023-06-01/staticmembers/id_staticmember_test.go deleted file mode 100644 index 80cf1ec36f0..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/id_staticmember_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package staticmembers - -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 = &StaticMemberId{} - -func TestNewStaticMemberID(t *testing.T) { - id := NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue") - - 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.NetworkManagerName != "networkManagerValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkManagerName'", id.NetworkManagerName, "networkManagerValue") - } - - if id.NetworkGroupName != "networkGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkGroupName'", id.NetworkGroupName, "networkGroupValue") - } - - if id.StaticMemberName != "staticMemberValue" { - t.Fatalf("Expected %q but got %q for Segment 'StaticMemberName'", id.StaticMemberName, "staticMemberValue") - } -} - -func TestFormatStaticMemberID(t *testing.T) { - actual := NewStaticMemberID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkManagerValue", "networkGroupValue", "staticMemberValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseStaticMemberID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StaticMemberId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue", - Expected: &StaticMemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - StaticMemberName: "staticMemberValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStaticMemberID(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - if actual.StaticMemberName != v.Expected.StaticMemberName { - t.Fatalf("Expected %q but got %q for StaticMemberName", v.Expected.StaticMemberName, actual.StaticMemberName) - } - - } -} - -func TestParseStaticMemberIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *StaticMemberId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/sTaTiCmEmBeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue", - Expected: &StaticMemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkManagerName: "networkManagerValue", - NetworkGroupName: "networkGroupValue", - StaticMemberName: "staticMemberValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkManagers/networkManagerValue/networkGroups/networkGroupValue/staticMembers/staticMemberValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/sTaTiCmEmBeRs/sTaTiCmEmBeRvAlUe", - Expected: &StaticMemberId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkManagerName: "nEtWoRkMaNaGeRvAlUe", - NetworkGroupName: "nEtWoRkGrOuPvAlUe", - StaticMemberName: "sTaTiCmEmBeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkMaNaGeRs/nEtWoRkMaNaGeRvAlUe/nEtWoRkGrOuPs/nEtWoRkGrOuPvAlUe/sTaTiCmEmBeRs/sTaTiCmEmBeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseStaticMemberIDInsensitively(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.NetworkManagerName != v.Expected.NetworkManagerName { - t.Fatalf("Expected %q but got %q for NetworkManagerName", v.Expected.NetworkManagerName, actual.NetworkManagerName) - } - - if actual.NetworkGroupName != v.Expected.NetworkGroupName { - t.Fatalf("Expected %q but got %q for NetworkGroupName", v.Expected.NetworkGroupName, actual.NetworkGroupName) - } - - if actual.StaticMemberName != v.Expected.StaticMemberName { - t.Fatalf("Expected %q but got %q for StaticMemberName", v.Expected.StaticMemberName, actual.StaticMemberName) - } - - } -} - -func TestSegmentsForStaticMemberId(t *testing.T) { - segments := StaticMemberId{}.Segments() - if len(segments) == 0 { - t.Fatalf("StaticMemberId 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/network/2023-06-01/staticmembers/method_createorupdate.go b/resource-manager/network/2023-06-01/staticmembers/method_createorupdate.go deleted file mode 100644 index 6921f0aedf3..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package staticmembers - -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 *StaticMember -} - -// CreateOrUpdate ... -func (c StaticMembersClient) CreateOrUpdate(ctx context.Context, id StaticMemberId, input StaticMember) (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 StaticMember - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/staticmembers/method_delete.go b/resource-manager/network/2023-06-01/staticmembers/method_delete.go deleted file mode 100644 index 5709eca59ec..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package staticmembers - -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 StaticMembersClient) Delete(ctx context.Context, id StaticMemberId) (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/network/2023-06-01/staticmembers/method_get.go b/resource-manager/network/2023-06-01/staticmembers/method_get.go deleted file mode 100644 index 11fc970af6a..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package staticmembers - -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 *StaticMember -} - -// Get ... -func (c StaticMembersClient) Get(ctx context.Context, id StaticMemberId) (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 StaticMember - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/staticmembers/method_list.go b/resource-manager/network/2023-06-01/staticmembers/method_list.go deleted file mode 100644 index 61864b8f9e0..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/method_list.go +++ /dev/null @@ -1,119 +0,0 @@ -package staticmembers - -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 *[]StaticMember -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []StaticMember -} - -type ListOperationOptions struct { - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c StaticMembersClient) List(ctx context.Context, id NetworkGroupId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/staticMembers", id.ID()), - OptionsObject: options, - } - - 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 *[]StaticMember `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 StaticMembersClient) ListComplete(ctx context.Context, id NetworkGroupId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, StaticMemberOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c StaticMembersClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkGroupId, options ListOperationOptions, predicate StaticMemberOperationPredicate) (result ListCompleteResult, err error) { - items := make([]StaticMember, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/network/2023-06-01/staticmembers/model_staticmember.go b/resource-manager/network/2023-06-01/staticmembers/model_staticmember.go deleted file mode 100644 index b0d518168ea..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/model_staticmember.go +++ /dev/null @@ -1,17 +0,0 @@ -package staticmembers - -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 StaticMember struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *StaticMemberProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/staticmembers/model_staticmemberproperties.go b/resource-manager/network/2023-06-01/staticmembers/model_staticmemberproperties.go deleted file mode 100644 index 513dd3e5b9b..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/model_staticmemberproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package staticmembers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticMemberProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Region *string `json:"region,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/staticmembers/predicates.go b/resource-manager/network/2023-06-01/staticmembers/predicates.go deleted file mode 100644 index 0fb08a96da7..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package staticmembers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticMemberOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p StaticMemberOperationPredicate) Matches(input StaticMember) 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.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/network/2023-06-01/staticmembers/version.go b/resource-manager/network/2023-06-01/staticmembers/version.go deleted file mode 100644 index ff5338b20f6..00000000000 --- a/resource-manager/network/2023-06-01/staticmembers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package staticmembers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/staticmembers/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/subnets/README.md b/resource-manager/network/2023-06-01/subnets/README.md deleted file mode 100644 index f7170077ab8..00000000000 --- a/resource-manager/network/2023-06-01/subnets/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/subnets` Documentation - -The `subnets` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/subnets" -``` - - -### Client Initialization - -```go -client := subnets.NewSubnetsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SubnetsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := subnets.Subnet{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `SubnetsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `SubnetsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -read, err := client.Get(ctx, id, subnets.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SubnetsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// 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/network/2023-06-01/subnets/client.go b/resource-manager/network/2023-06-01/subnets/client.go deleted file mode 100644 index b1f947b47be..00000000000 --- a/resource-manager/network/2023-06-01/subnets/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package subnets - -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 SubnetsClient struct { - Client *resourcemanager.Client -} - -func NewSubnetsClientWithBaseURI(sdkApi sdkEnv.Api) (*SubnetsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "subnets", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SubnetsClient: %+v", err) - } - - return &SubnetsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/subnets/constants.go b/resource-manager/network/2023-06-01/subnets/constants.go deleted file mode 100644 index dd21353a40b..00000000000 --- a/resource-manager/network/2023-06-01/subnets/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package subnets - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/subnets/method_createorupdate.go b/resource-manager/network/2023-06-01/subnets/method_createorupdate.go deleted file mode 100644 index 2f47359f975..00000000000 --- a/resource-manager/network/2023-06-01/subnets/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package subnets - -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 *Subnet -} - -// CreateOrUpdate ... -func (c SubnetsClient) CreateOrUpdate(ctx context.Context, id commonids.SubnetId, input Subnet) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c SubnetsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.SubnetId, input Subnet) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/subnets/method_delete.go b/resource-manager/network/2023-06-01/subnets/method_delete.go deleted file mode 100644 index 8be424289f0..00000000000 --- a/resource-manager/network/2023-06-01/subnets/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package subnets - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c SubnetsClient) Delete(ctx context.Context, id commonids.SubnetId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 SubnetsClient) DeleteThenPoll(ctx context.Context, id commonids.SubnetId) 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/network/2023-06-01/subnets/method_get.go b/resource-manager/network/2023-06-01/subnets/method_get.go deleted file mode 100644 index f43b6e2df8f..00000000000 --- a/resource-manager/network/2023-06-01/subnets/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package subnets - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Subnet -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c SubnetsClient) Get(ctx context.Context, id commonids.SubnetId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 Subnet - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/subnets/method_list.go b/resource-manager/network/2023-06-01/subnets/method_list.go deleted file mode 100644 index 15440075e11..00000000000 --- a/resource-manager/network/2023-06-01/subnets/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package subnets - -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 *[]Subnet -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Subnet -} - -// List ... -func (c SubnetsClient) List(ctx context.Context, id commonids.VirtualNetworkId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/subnets", 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 *[]Subnet `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 SubnetsClient) ListComplete(ctx context.Context, id commonids.VirtualNetworkId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SubnetOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SubnetsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, predicate SubnetOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Subnet, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/subnets/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 3788306fb6c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 916f79f9c4c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 5cb3ab5e50f..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 2064f06b67c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index ba5d67b2ce4..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/subnets/model_applicationsecuritygroup.go deleted file mode 100644 index 2b7038a9661..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 0444d465786..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_backendaddresspool.go b/resource-manager/network/2023-06-01/subnets/model_backendaddresspool.go deleted file mode 100644 index 8549e5db3a8..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 561224fe97e..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index b8332f10ecf..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_ddossettings.go b/resource-manager/network/2023-06-01/subnets/model_ddossettings.go deleted file mode 100644 index d48851a6ba1..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_delegation.go b/resource-manager/network/2023-06-01/subnets/model_delegation.go deleted file mode 100644 index 541d9d1d34b..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_flowlog.go b/resource-manager/network/2023-06-01/subnets/model_flowlog.go deleted file mode 100644 index d350c16ef43..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/subnets/model_flowlogformatparameters.go deleted file mode 100644 index 492844afa0c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_flowlogpropertiesformat.go deleted file mode 100644 index a2a70e0c856..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_frontendipconfiguration.go deleted file mode 100644 index f24121e7c39..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package subnets - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 3c86535825a..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/subnets/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 3d2ff9b3010..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_inboundnatrule.go b/resource-manager/network/2023-06-01/subnets/model_inboundnatrule.go deleted file mode 100644 index dd23aa7a490..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index ac29e9fd37d..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_ipconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_ipconfiguration.go deleted file mode 100644 index 3e2e5516ea9..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofile.go deleted file mode 100644 index a4d5be3c038..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index bfb28994f14..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 4814acb3e8e..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_iptag.go b/resource-manager/network/2023-06-01/subnets/model_iptag.go deleted file mode 100644 index 8ccc055cb31..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// 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/network/2023-06-01/subnets/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddress.go deleted file mode 100644 index e3b148912e3..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index ee7815f178d..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_natgateway.go b/resource-manager/network/2023-06-01/subnets/model_natgateway.go deleted file mode 100644 index 9a8fad20def..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package subnets - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_natgatewaypropertiesformat.go deleted file mode 100644 index e9043897c52..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_natgatewaysku.go b/resource-manager/network/2023-06-01/subnets/model_natgatewaysku.go deleted file mode 100644 index 617e7c19ff3..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_natruleportmapping.go b/resource-manager/network/2023-06-01/subnets/model_natruleportmapping.go deleted file mode 100644 index 1e546cf811d..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterface.go b/resource-manager/network/2023-06-01/subnets/model_networkinterface.go deleted file mode 100644 index 06d849fad90..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfacednssettings.go deleted file mode 100644 index 67fcb29afe7..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfiguration.go deleted file mode 100644 index dea0691831d..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 51e7195920f..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index bc6e9588ae5..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfacepropertiesformat.go deleted file mode 100644 index dadc9421016..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 2cd16be245c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 1bc23cee100..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/subnets/model_networksecuritygroup.go deleted file mode 100644 index fa06f5f24cc..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index da7b074dbbf..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privateendpoint.go b/resource-manager/network/2023-06-01/subnets/model_privateendpoint.go deleted file mode 100644 index 4fa549c3b13..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/subnets/model_privateendpointconnection.go deleted file mode 100644 index 1e354419cca..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/subnets/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/subnets/model_privateendpointconnectionproperties.go deleted file mode 100644 index ff12b5a54fc..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_privateendpointipconfiguration.go deleted file mode 100644 index 20625cb09d3..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/subnets/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 5d90f3c61bf..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/subnets/model_privateendpointproperties.go deleted file mode 100644 index 4913ece3049..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkservice.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkservice.go deleted file mode 100644 index 34c00e7cffb..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnection.go deleted file mode 100644 index af937a19eda..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index d6ad965c136..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 4072e649f7a..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index c48e1e87c65..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index eccb8844155..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceproperties.go deleted file mode 100644 index 0f4d213769b..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_publicipaddress.go b/resource-manager/network/2023-06-01/subnets/model_publicipaddress.go deleted file mode 100644 index 9931f78d236..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package subnets - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/subnets/model_publicipaddressdnssettings.go deleted file mode 100644 index d002238e788..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_publicipaddresspropertiesformat.go deleted file mode 100644 index c8c5eb4251a..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/subnets/model_publicipaddresssku.go deleted file mode 100644 index 21dd8f7d664..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/subnets/model_resourcenavigationlink.go deleted file mode 100644 index fcd37a760e6..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/subnets/model_resourcenavigationlinkformat.go deleted file mode 100644 index 103426fc9c3..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_resourceset.go b/resource-manager/network/2023-06-01/subnets/model_resourceset.go deleted file mode 100644 index 5daeebab425..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/subnets/model_retentionpolicyparameters.go deleted file mode 100644 index 8ea922b85fe..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_route.go b/resource-manager/network/2023-06-01/subnets/model_route.go deleted file mode 100644 index e40ded16b00..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_routepropertiesformat.go deleted file mode 100644 index c87b62acaed..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_routetable.go b/resource-manager/network/2023-06-01/subnets/model_routetable.go deleted file mode 100644 index 6bb137b8242..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_routetablepropertiesformat.go deleted file mode 100644 index 07d88ea8a30..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_securityrule.go b/resource-manager/network/2023-06-01/subnets/model_securityrule.go deleted file mode 100644 index 70772203f7b..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_securityrulepropertiesformat.go deleted file mode 100644 index cad2dbd820c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/subnets/model_serviceassociationlink.go deleted file mode 100644 index c82eae5ac15..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index f1a92b71485..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 1680e52b8a1..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicy.go deleted file mode 100644 index 68813a7b3e8..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 8fa72c305ed..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index b7b56f401a8..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 5e0804aa438..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 7011fc209c0..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_subnet.go b/resource-manager/network/2023-06-01/subnets/model_subnet.go deleted file mode 100644 index 820673d7c16..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_subnetpropertiesformat.go deleted file mode 100644 index cf86a7a7e59..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_subresource.go b/resource-manager/network/2023-06-01/subnets/model_subresource.go deleted file mode 100644 index d986a303819..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/subnets/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index e93599e3f9c..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/subnets/model_trafficanalyticsproperties.go deleted file mode 100644 index fa6abc84aef..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/subnets/model_virtualnetworktap.go deleted file mode 100644 index f9e8be401f9..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/subnets/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index c8b60852b33..00000000000 --- a/resource-manager/network/2023-06-01/subnets/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/subnets/predicates.go b/resource-manager/network/2023-06-01/subnets/predicates.go deleted file mode 100644 index 33b8979e3cc..00000000000 --- a/resource-manager/network/2023-06-01/subnets/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package subnets - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SubnetOperationPredicate) Matches(input Subnet) 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.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/network/2023-06-01/subnets/version.go b/resource-manager/network/2023-06-01/subnets/version.go deleted file mode 100644 index 79b4507b037..00000000000 --- a/resource-manager/network/2023-06-01/subnets/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package subnets - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/subnets/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/README.md b/resource-manager/network/2023-06-01/trafficanalytics/README.md deleted file mode 100644 index 180a26f75fa..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/trafficanalytics` Documentation - -The `trafficanalytics` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/trafficanalytics" -``` - - -### Client Initialization - -```go -client := trafficanalytics.NewTrafficAnalyticsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `TrafficAnalyticsClient.NetworkWatchersGetFlowLogStatus` - -```go -ctx := context.TODO() -id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := trafficanalytics.FlowLogStatusParameters{ - // ... -} - - -if err := client.NetworkWatchersGetFlowLogStatusThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `TrafficAnalyticsClient.NetworkWatchersSetFlowLogConfiguration` - -```go -ctx := context.TODO() -id := trafficanalytics.NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - -payload := trafficanalytics.FlowLogInformation{ - // ... -} - - -if err := client.NetworkWatchersSetFlowLogConfigurationThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/trafficanalytics/client.go b/resource-manager/network/2023-06-01/trafficanalytics/client.go deleted file mode 100644 index 78e1d6ab331..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package trafficanalytics - -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 TrafficAnalyticsClient struct { - Client *resourcemanager.Client -} - -func NewTrafficAnalyticsClientWithBaseURI(sdkApi sdkEnv.Api) (*TrafficAnalyticsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "trafficanalytics", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating TrafficAnalyticsClient: %+v", err) - } - - return &TrafficAnalyticsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/constants.go b/resource-manager/network/2023-06-01/trafficanalytics/constants.go deleted file mode 100644 index 54031e636e9..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/constants.go +++ /dev/null @@ -1,48 +0,0 @@ -package trafficanalytics - -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 FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher.go b/resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher.go deleted file mode 100644 index f13408f03b5..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher.go +++ /dev/null @@ -1,130 +0,0 @@ -package trafficanalytics - -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(&NetworkWatcherId{}) -} - -var _ resourceids.ResourceId = &NetworkWatcherId{} - -// NetworkWatcherId is a struct representing the Resource ID for a Network Watcher -type NetworkWatcherId struct { - SubscriptionId string - ResourceGroupName string - NetworkWatcherName string -} - -// NewNetworkWatcherID returns a new NetworkWatcherId struct -func NewNetworkWatcherID(subscriptionId string, resourceGroupName string, networkWatcherName string) NetworkWatcherId { - return NetworkWatcherId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkWatcherName: networkWatcherName, - } -} - -// ParseNetworkWatcherID parses 'input' into a NetworkWatcherId -func ParseNetworkWatcherID(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkWatcherIDInsensitively parses 'input' case-insensitively into a NetworkWatcherId -// note: this method should only be used for API response data and not user input -func ParseNetworkWatcherIDInsensitively(input string) (*NetworkWatcherId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkWatcherId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkWatcherId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkWatcherId) 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.NetworkWatcherName, ok = input.Parsed["networkWatcherName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkWatcherName", input) - } - - return nil -} - -// ValidateNetworkWatcherID checks that 'input' can be parsed as a Network Watcher ID -func ValidateNetworkWatcherID(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 := ParseNetworkWatcherID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Watcher ID -func (id NetworkWatcherId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkWatchers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkWatcherName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Watcher ID -func (id NetworkWatcherId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkWatchers", "networkWatchers", "networkWatchers"), - resourceids.UserSpecifiedSegment("networkWatcherName", "networkWatcherValue"), - } -} - -// String returns a human-readable description of this Network Watcher ID -func (id NetworkWatcherId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Watcher Name: %q", id.NetworkWatcherName), - } - return fmt.Sprintf("Network Watcher (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher_test.go b/resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher_test.go deleted file mode 100644 index 8edd286c390..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/id_networkwatcher_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package trafficanalytics - -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 = &NetworkWatcherId{} - -func TestNewNetworkWatcherID(t *testing.T) { - id := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue") - - 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.NetworkWatcherName != "networkWatcherValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkWatcherName'", id.NetworkWatcherName, "networkWatcherValue") - } -} - -func TestFormatNetworkWatcherID(t *testing.T) { - actual := NewNetworkWatcherID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkWatcherValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkWatcherID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherID(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestParseNetworkWatcherIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkWatcherId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkWatcherName: "networkWatcherValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkWatchers/networkWatcherValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe", - Expected: &NetworkWatcherId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkWatcherName: "nEtWoRkWaTcHeRvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkWaTcHeRs/nEtWoRkWaTcHeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkWatcherIDInsensitively(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.NetworkWatcherName != v.Expected.NetworkWatcherName { - t.Fatalf("Expected %q but got %q for NetworkWatcherName", v.Expected.NetworkWatcherName, actual.NetworkWatcherName) - } - - } -} - -func TestSegmentsForNetworkWatcherId(t *testing.T) { - segments := NetworkWatcherId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkWatcherId 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/network/2023-06-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go b/resource-manager/network/2023-06-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go deleted file mode 100644 index 279a26b8a48..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/method_networkwatchersgetflowlogstatus.go +++ /dev/null @@ -1,75 +0,0 @@ -package trafficanalytics - -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 NetworkWatchersGetFlowLogStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// NetworkWatchersGetFlowLogStatus ... -func (c TrafficAnalyticsClient) NetworkWatchersGetFlowLogStatus(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) (result NetworkWatchersGetFlowLogStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/queryFlowLogStatus", 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 -} - -// NetworkWatchersGetFlowLogStatusThenPoll performs NetworkWatchersGetFlowLogStatus then polls until it's completed -func (c TrafficAnalyticsClient) NetworkWatchersGetFlowLogStatusThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogStatusParameters) error { - result, err := c.NetworkWatchersGetFlowLogStatus(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkWatchersGetFlowLogStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkWatchersGetFlowLogStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go b/resource-manager/network/2023-06-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go deleted file mode 100644 index 859ca423b3c..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/method_networkwatcherssetflowlogconfiguration.go +++ /dev/null @@ -1,75 +0,0 @@ -package trafficanalytics - -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 NetworkWatchersSetFlowLogConfigurationOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *FlowLogInformation -} - -// NetworkWatchersSetFlowLogConfiguration ... -func (c TrafficAnalyticsClient) NetworkWatchersSetFlowLogConfiguration(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) (result NetworkWatchersSetFlowLogConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/configureFlowLog", 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 -} - -// NetworkWatchersSetFlowLogConfigurationThenPoll performs NetworkWatchersSetFlowLogConfiguration then polls until it's completed -func (c TrafficAnalyticsClient) NetworkWatchersSetFlowLogConfigurationThenPoll(ctx context.Context, id NetworkWatcherId, input FlowLogInformation) error { - result, err := c.NetworkWatchersSetFlowLogConfiguration(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkWatchersSetFlowLogConfiguration: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkWatchersSetFlowLogConfiguration: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogformatparameters.go deleted file mode 100644 index 87ffe400a44..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_flowloginformation.go b/resource-manager/network/2023-06-01/trafficanalytics/model_flowloginformation.go deleted file mode 100644 index 15a1cc0029d..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_flowloginformation.go +++ /dev/null @@ -1,10 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogInformation struct { - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Properties FlowLogProperties `json:"properties"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogproperties.go b/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogproperties.go deleted file mode 100644 index b26bd4b572a..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogProperties struct { - Enabled bool `json:"enabled"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogstatusparameters.go b/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogstatusparameters.go deleted file mode 100644 index a066e2ad70a..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_flowlogstatusparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogStatusParameters struct { - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/trafficanalytics/model_retentionpolicyparameters.go deleted file mode 100644 index b432d3a27f0..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 01350bb98c2..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsproperties.go deleted file mode 100644 index 94df925e175..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package trafficanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/trafficanalytics/version.go b/resource-manager/network/2023-06-01/trafficanalytics/version.go deleted file mode 100644 index 544cf70f72e..00000000000 --- a/resource-manager/network/2023-06-01/trafficanalytics/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package trafficanalytics - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/trafficanalytics/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/usages/README.md b/resource-manager/network/2023-06-01/usages/README.md deleted file mode 100644 index 2bb9caa7f4f..00000000000 --- a/resource-manager/network/2023-06-01/usages/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/usages` Documentation - -The `usages` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/usages" -``` - - -### Client Initialization - -```go -client := usages.NewUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `UsagesClient.List` - -```go -ctx := context.TODO() -id := usages.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// 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/network/2023-06-01/usages/client.go b/resource-manager/network/2023-06-01/usages/client.go deleted file mode 100644 index 772d6a5be35..00000000000 --- a/resource-manager/network/2023-06-01/usages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package usages - -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 UsagesClient struct { - Client *resourcemanager.Client -} - -func NewUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*UsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "usages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating UsagesClient: %+v", err) - } - - return &UsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/usages/constants.go b/resource-manager/network/2023-06-01/usages/constants.go deleted file mode 100644 index 0d8916ba5aa..00000000000 --- a/resource-manager/network/2023-06-01/usages/constants.go +++ /dev/null @@ -1,48 +0,0 @@ -package usages - -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 UsageUnit string - -const ( - UsageUnitCount UsageUnit = "Count" -) - -func PossibleValuesForUsageUnit() []string { - return []string{ - string(UsageUnitCount), - } -} - -func (s *UsageUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUsageUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUsageUnit(input string) (*UsageUnit, error) { - vals := map[string]UsageUnit{ - "count": UsageUnitCount, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsageUnit(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/usages/id_location.go b/resource-manager/network/2023-06-01/usages/id_location.go deleted file mode 100644 index 6499c99bc79..00000000000 --- a/resource-manager/network/2023-06-01/usages/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package usages - -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.Network/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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/network/2023-06-01/usages/id_location_test.go b/resource-manager/network/2023-06-01/usages/id_location_test.go deleted file mode 100644 index 90cb643f003..00000000000 --- a/resource-manager/network/2023-06-01/usages/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package usages - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue" - 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/lOcAtIoNs/lOcAtIoNvAlUe/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/network/2023-06-01/usages/method_list.go b/resource-manager/network/2023-06-01/usages/method_list.go deleted file mode 100644 index efe2516e27a..00000000000 --- a/resource-manager/network/2023-06-01/usages/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package usages - -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 *[]Usage -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Usage -} - -// List ... -func (c UsagesClient) List(ctx context.Context, id LocationId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 *[]Usage `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 UsagesClient) ListComplete(ctx context.Context, id LocationId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, UsageOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c UsagesClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, predicate UsageOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Usage, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/usages/model_usage.go b/resource-manager/network/2023-06-01/usages/model_usage.go deleted file mode 100644 index 2a734980b2c..00000000000 --- a/resource-manager/network/2023-06-01/usages/model_usage.go +++ /dev/null @@ -1,12 +0,0 @@ -package usages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Usage struct { - CurrentValue int64 `json:"currentValue"` - Id *string `json:"id,omitempty"` - Limit int64 `json:"limit"` - Name UsageName `json:"name"` - Unit UsageUnit `json:"unit"` -} diff --git a/resource-manager/network/2023-06-01/usages/model_usagename.go b/resource-manager/network/2023-06-01/usages/model_usagename.go deleted file mode 100644 index ff2d9cbdd3e..00000000000 --- a/resource-manager/network/2023-06-01/usages/model_usagename.go +++ /dev/null @@ -1,9 +0,0 @@ -package usages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UsageName struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/usages/predicates.go b/resource-manager/network/2023-06-01/usages/predicates.go deleted file mode 100644 index ad3b401c1ce..00000000000 --- a/resource-manager/network/2023-06-01/usages/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package usages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UsageOperationPredicate struct { - CurrentValue *int64 - Id *string - Limit *int64 -} - -func (p UsageOperationPredicate) Matches(input Usage) bool { - - if p.CurrentValue != nil && *p.CurrentValue != input.CurrentValue { - return false - } - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Limit != nil && *p.Limit != input.Limit { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/usages/version.go b/resource-manager/network/2023-06-01/usages/version.go deleted file mode 100644 index 5123a747ae3..00000000000 --- a/resource-manager/network/2023-06-01/usages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package usages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/usages/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/vipswap/README.md b/resource-manager/network/2023-06-01/vipswap/README.md deleted file mode 100644 index c3077086ecc..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/README.md +++ /dev/null @@ -1,69 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vipswap` Documentation - -The `vipswap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/vipswap" -``` - - -### Client Initialization - -```go -client := vipswap.NewVipSwapClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VipSwapClient.Create` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -payload := vipswap.SwapResource{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VipSwapClient.Get` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -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: `VipSwapClient.List` - -```go -ctx := context.TODO() -id := vipswap.NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - -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/network/2023-06-01/vipswap/client.go b/resource-manager/network/2023-06-01/vipswap/client.go deleted file mode 100644 index 2a7d8c2afe7..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vipswap - -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 VipSwapClient struct { - Client *resourcemanager.Client -} - -func NewVipSwapClientWithBaseURI(sdkApi sdkEnv.Api) (*VipSwapClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vipswap", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VipSwapClient: %+v", err) - } - - return &VipSwapClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/vipswap/constants.go b/resource-manager/network/2023-06-01/vipswap/constants.go deleted file mode 100644 index c6cf7234532..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package vipswap - -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 SlotType string - -const ( - SlotTypeProduction SlotType = "Production" - SlotTypeStaging SlotType = "Staging" -) - -func PossibleValuesForSlotType() []string { - return []string{ - string(SlotTypeProduction), - string(SlotTypeStaging), - } -} - -func (s *SlotType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSlotType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSlotType(input string) (*SlotType, error) { - vals := map[string]SlotType{ - "production": SlotTypeProduction, - "staging": SlotTypeStaging, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SlotType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/vipswap/id_cloudservice.go b/resource-manager/network/2023-06-01/vipswap/id_cloudservice.go deleted file mode 100644 index 5801e90709d..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/id_cloudservice.go +++ /dev/null @@ -1,130 +0,0 @@ -package vipswap - -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(&CloudServiceId{}) -} - -var _ resourceids.ResourceId = &CloudServiceId{} - -// CloudServiceId is a struct representing the Resource ID for a Cloud Service -type CloudServiceId struct { - SubscriptionId string - ResourceGroupName string - CloudServiceName string -} - -// NewCloudServiceID returns a new CloudServiceId struct -func NewCloudServiceID(subscriptionId string, resourceGroupName string, cloudServiceName string) CloudServiceId { - return CloudServiceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - CloudServiceName: cloudServiceName, - } -} - -// ParseCloudServiceID parses 'input' into a CloudServiceId -func ParseCloudServiceID(input string) (*CloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&CloudServiceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCloudServiceIDInsensitively parses 'input' case-insensitively into a CloudServiceId -// note: this method should only be used for API response data and not user input -func ParseCloudServiceIDInsensitively(input string) (*CloudServiceId, error) { - parser := resourceids.NewParserFromResourceIdType(&CloudServiceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CloudServiceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CloudServiceId) 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.CloudServiceName, ok = input.Parsed["cloudServiceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "cloudServiceName", input) - } - - return nil -} - -// ValidateCloudServiceID checks that 'input' can be parsed as a Cloud Service ID -func ValidateCloudServiceID(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 := ParseCloudServiceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Cloud Service ID -func (id CloudServiceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/cloudServices/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.CloudServiceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Cloud Service ID -func (id CloudServiceId) 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.UserSpecifiedSegment("resourceGroupName", "resourceGroupValue"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticCloudServices", "cloudServices", "cloudServices"), - resourceids.UserSpecifiedSegment("cloudServiceName", "cloudServiceValue"), - } -} - -// String returns a human-readable description of this Cloud Service ID -func (id CloudServiceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Cloud Service Name: %q", id.CloudServiceName), - } - return fmt.Sprintf("Cloud Service (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/vipswap/id_cloudservice_test.go b/resource-manager/network/2023-06-01/vipswap/id_cloudservice_test.go deleted file mode 100644 index 0184ee4262a..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/id_cloudservice_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vipswap - -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 = &CloudServiceId{} - -func TestNewCloudServiceID(t *testing.T) { - id := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue") - - 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 != "resourceGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceGroupName'", id.ResourceGroupName, "resourceGroupValue") - } - - if id.CloudServiceName != "cloudServiceValue" { - t.Fatalf("Expected %q but got %q for Segment 'CloudServiceName'", id.CloudServiceName, "cloudServiceValue") - } -} - -func TestFormatCloudServiceID(t *testing.T) { - actual := NewCloudServiceID("12345678-1234-9876-4563-123456789012", "resourceGroupValue", "cloudServiceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCloudServiceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CloudServiceId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &CloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCloudServiceID(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestParseCloudServiceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CloudServiceId - }{ - { - // 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/resourceGroupValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue", - Expected: &CloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "resourceGroupValue", - CloudServiceName: "cloudServiceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/resourceGroupValue/providers/Microsoft.Compute/cloudServices/cloudServiceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe", - Expected: &CloudServiceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "rEsOuRcEgRoUpVaLuE", - CloudServiceName: "cLoUdSeRvIcEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/rEsOuRcEgRoUpVaLuE/pRoViDeRs/mIcRoSoFt.cOmPuTe/cLoUdSeRvIcEs/cLoUdSeRvIcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCloudServiceIDInsensitively(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.CloudServiceName != v.Expected.CloudServiceName { - t.Fatalf("Expected %q but got %q for CloudServiceName", v.Expected.CloudServiceName, actual.CloudServiceName) - } - - } -} - -func TestSegmentsForCloudServiceId(t *testing.T) { - segments := CloudServiceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CloudServiceId 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/network/2023-06-01/vipswap/method_create.go b/resource-manager/network/2023-06-01/vipswap/method_create.go deleted file mode 100644 index c7db22cb3af..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/method_create.go +++ /dev/null @@ -1,74 +0,0 @@ -package vipswap - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Create ... -func (c VipSwapClient) Create(ctx context.Context, id CloudServiceId, input SwapResource) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/cloudServiceSlots/swap", 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 -} - -// CreateThenPoll performs Create then polls until it's completed -func (c VipSwapClient) CreateThenPoll(ctx context.Context, id CloudServiceId, input SwapResource) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/vipswap/method_get.go b/resource-manager/network/2023-06-01/vipswap/method_get.go deleted file mode 100644 index 2d61c8f37e0..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package vipswap - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SwapResource -} - -// Get ... -func (c VipSwapClient) Get(ctx context.Context, id CloudServiceId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/cloudServiceSlots/swap", 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 SwapResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/vipswap/method_list.go b/resource-manager/network/2023-06-01/vipswap/method_list.go deleted file mode 100644 index 32407cc2c5c..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package vipswap - -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 *SwapResourceListResult -} - -// List ... -func (c VipSwapClient) List(ctx context.Context, id CloudServiceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/cloudServiceSlots", 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 SwapResourceListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/vipswap/model_swapresource.go b/resource-manager/network/2023-06-01/vipswap/model_swapresource.go deleted file mode 100644 index cd135639ade..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/model_swapresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package vipswap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SwapResource struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SwapResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vipswap/model_swapresourcelistresult.go b/resource-manager/network/2023-06-01/vipswap/model_swapresourcelistresult.go deleted file mode 100644 index d4cb9490d3a..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/model_swapresourcelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package vipswap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SwapResourceListResult struct { - Value *[]SwapResource `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vipswap/model_swapresourceproperties.go b/resource-manager/network/2023-06-01/vipswap/model_swapresourceproperties.go deleted file mode 100644 index 8254763b326..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/model_swapresourceproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vipswap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SwapResourceProperties struct { - SlotType *SlotType `json:"slotType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vipswap/version.go b/resource-manager/network/2023-06-01/vipswap/version.go deleted file mode 100644 index 415500724be..00000000000 --- a/resource-manager/network/2023-06-01/vipswap/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vipswap - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vipswap/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/README.md b/resource-manager/network/2023-06-01/virtualappliancesites/README.md deleted file mode 100644 index 295d656f04d..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/README.md +++ /dev/null @@ -1,82 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualappliancesites` Documentation - -The `virtualappliancesites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualappliancesites" -``` - - -### Client Initialization - -```go -client := virtualappliancesites.NewVirtualApplianceSitesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualApplianceSitesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -payload := virtualappliancesites.VirtualApplianceSite{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualApplianceSitesClient.Delete` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualApplianceSitesClient.Get` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - -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: `VirtualApplianceSitesClient.List` - -```go -ctx := context.TODO() -id := virtualappliancesites.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -// 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/network/2023-06-01/virtualappliancesites/client.go b/resource-manager/network/2023-06-01/virtualappliancesites/client.go deleted file mode 100644 index 415b8e6e46b..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualappliancesites - -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 VirtualApplianceSitesClient struct { - Client *resourcemanager.Client -} - -func NewVirtualApplianceSitesClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualApplianceSitesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualappliancesites", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualApplianceSitesClient: %+v", err) - } - - return &VirtualApplianceSitesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/constants.go b/resource-manager/network/2023-06-01/virtualappliancesites/constants.go deleted file mode 100644 index bd413f43290..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package virtualappliancesites - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance.go b/resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance.go deleted file mode 100644 index d414a3c2d42..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualappliancesites - -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(&NetworkVirtualApplianceId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceId{} - -// NetworkVirtualApplianceId is a struct representing the Resource ID for a Network Virtual Appliance -type NetworkVirtualApplianceId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string -} - -// NewNetworkVirtualApplianceID returns a new NetworkVirtualApplianceId struct -func NewNetworkVirtualApplianceID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string) NetworkVirtualApplianceId { - return NetworkVirtualApplianceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - } -} - -// ParseNetworkVirtualApplianceID parses 'input' into a NetworkVirtualApplianceId -func ParseNetworkVirtualApplianceID(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceIDInsensitively(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceID checks that 'input' can be parsed as a Network Virtual Appliance ID -func ValidateNetworkVirtualApplianceID(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 := ParseNetworkVirtualApplianceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - } - return fmt.Sprintf("Network Virtual Appliance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance_test.go b/resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance_test.go deleted file mode 100644 index e09dcbc11c4..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/id_networkvirtualappliance_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualappliancesites - -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 = &NetworkVirtualApplianceId{} - -func TestNewNetworkVirtualApplianceID(t *testing.T) { - id := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } -} - -func TestFormatNetworkVirtualApplianceID(t *testing.T) { - actual := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestParseNetworkVirtualApplianceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceId(t *testing.T) { - segments := NetworkVirtualApplianceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceId 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/network/2023-06-01/virtualappliancesites/id_virtualappliancesite.go b/resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite.go deleted file mode 100644 index a0500e43c74..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualappliancesites - -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(&VirtualApplianceSiteId{}) -} - -var _ resourceids.ResourceId = &VirtualApplianceSiteId{} - -// VirtualApplianceSiteId is a struct representing the Resource ID for a Virtual Appliance Site -type VirtualApplianceSiteId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string - VirtualApplianceSiteName string -} - -// NewVirtualApplianceSiteID returns a new VirtualApplianceSiteId struct -func NewVirtualApplianceSiteID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string, virtualApplianceSiteName string) VirtualApplianceSiteId { - return VirtualApplianceSiteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - VirtualApplianceSiteName: virtualApplianceSiteName, - } -} - -// ParseVirtualApplianceSiteID parses 'input' into a VirtualApplianceSiteId -func ParseVirtualApplianceSiteID(input string) (*VirtualApplianceSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualApplianceSiteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualApplianceSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualApplianceSiteIDInsensitively parses 'input' case-insensitively into a VirtualApplianceSiteId -// note: this method should only be used for API response data and not user input -func ParseVirtualApplianceSiteIDInsensitively(input string) (*VirtualApplianceSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualApplianceSiteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualApplianceSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualApplianceSiteId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - if id.VirtualApplianceSiteName, ok = input.Parsed["virtualApplianceSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualApplianceSiteName", input) - } - - return nil -} - -// ValidateVirtualApplianceSiteID checks that 'input' can be parsed as a Virtual Appliance Site ID -func ValidateVirtualApplianceSiteID(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 := ParseVirtualApplianceSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Appliance Site ID -func (id VirtualApplianceSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s/virtualApplianceSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName, id.VirtualApplianceSiteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Appliance Site ID -func (id VirtualApplianceSiteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - resourceids.StaticSegment("staticVirtualApplianceSites", "virtualApplianceSites", "virtualApplianceSites"), - resourceids.UserSpecifiedSegment("virtualApplianceSiteName", "virtualApplianceSiteValue"), - } -} - -// String returns a human-readable description of this Virtual Appliance Site ID -func (id VirtualApplianceSiteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - fmt.Sprintf("Virtual Appliance Site Name: %q", id.VirtualApplianceSiteName), - } - return fmt.Sprintf("Virtual Appliance Site (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite_test.go b/resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite_test.go deleted file mode 100644 index d7b3754367a..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/id_virtualappliancesite_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualappliancesites - -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 = &VirtualApplianceSiteId{} - -func TestNewVirtualApplianceSiteID(t *testing.T) { - id := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } - - if id.VirtualApplianceSiteName != "virtualApplianceSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualApplianceSiteName'", id.VirtualApplianceSiteName, "virtualApplianceSiteValue") - } -} - -func TestFormatVirtualApplianceSiteID(t *testing.T) { - actual := NewVirtualApplianceSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "virtualApplianceSiteValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualApplianceSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualApplianceSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue", - Expected: &VirtualApplianceSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - VirtualApplianceSiteName: "virtualApplianceSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualApplianceSiteID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.VirtualApplianceSiteName != v.Expected.VirtualApplianceSiteName { - t.Fatalf("Expected %q but got %q for VirtualApplianceSiteName", v.Expected.VirtualApplianceSiteName, actual.VirtualApplianceSiteName) - } - - } -} - -func TestParseVirtualApplianceSiteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualApplianceSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/vIrTuAlApPlIaNcEsItEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue", - Expected: &VirtualApplianceSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - VirtualApplianceSiteName: "virtualApplianceSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/virtualApplianceSites/virtualApplianceSiteValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEvAlUe", - Expected: &VirtualApplianceSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - VirtualApplianceSiteName: "vIrTuAlApPlIaNcEsItEvAlUe", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/vIrTuAlApPlIaNcEsItEs/vIrTuAlApPlIaNcEsItEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualApplianceSiteIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.VirtualApplianceSiteName != v.Expected.VirtualApplianceSiteName { - t.Fatalf("Expected %q but got %q for VirtualApplianceSiteName", v.Expected.VirtualApplianceSiteName, actual.VirtualApplianceSiteName) - } - - } -} - -func TestSegmentsForVirtualApplianceSiteId(t *testing.T) { - segments := VirtualApplianceSiteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualApplianceSiteId 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/network/2023-06-01/virtualappliancesites/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualappliancesites/method_createorupdate.go deleted file mode 100644 index 2022580c6d0..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualappliancesites - -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 *VirtualApplianceSite -} - -// CreateOrUpdate ... -func (c VirtualApplianceSitesClient) CreateOrUpdate(ctx context.Context, id VirtualApplianceSiteId, input VirtualApplianceSite) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualApplianceSitesClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualApplianceSiteId, input VirtualApplianceSite) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualappliancesites/method_delete.go b/resource-manager/network/2023-06-01/virtualappliancesites/method_delete.go deleted file mode 100644 index 50e7f186f39..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualappliancesites - -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 VirtualApplianceSitesClient) Delete(ctx context.Context, id VirtualApplianceSiteId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualApplianceSitesClient) DeleteThenPoll(ctx context.Context, id VirtualApplianceSiteId) 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/network/2023-06-01/virtualappliancesites/method_get.go b/resource-manager/network/2023-06-01/virtualappliancesites/method_get.go deleted file mode 100644 index c78f7f1cf64..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualappliancesites - -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 *VirtualApplianceSite -} - -// Get ... -func (c VirtualApplianceSitesClient) Get(ctx context.Context, id VirtualApplianceSiteId) (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 VirtualApplianceSite - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/method_list.go b/resource-manager/network/2023-06-01/virtualappliancesites/method_list.go deleted file mode 100644 index f85d8acdd6c..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualappliancesites - -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 *[]VirtualApplianceSite -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualApplianceSite -} - -// List ... -func (c VirtualApplianceSitesClient) List(ctx context.Context, id NetworkVirtualApplianceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualApplianceSites", 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 *[]VirtualApplianceSite `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 VirtualApplianceSitesClient) ListComplete(ctx context.Context, id NetworkVirtualApplianceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualApplianceSiteOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualApplianceSitesClient) ListCompleteMatchingPredicate(ctx context.Context, id NetworkVirtualApplianceId, predicate VirtualApplianceSiteOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualApplianceSite, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualappliancesites/model_breakoutcategorypolicies.go b/resource-manager/network/2023-06-01/virtualappliancesites/model_breakoutcategorypolicies.go deleted file mode 100644 index 6a2b15ecb1d..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/model_breakoutcategorypolicies.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BreakOutCategoryPolicies struct { - Allow *bool `json:"allow,omitempty"` - Default *bool `json:"default,omitempty"` - Optimize *bool `json:"optimize,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/model_office365policyproperties.go b/resource-manager/network/2023-06-01/virtualappliancesites/model_office365policyproperties.go deleted file mode 100644 index b891141a5ba..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/model_office365policyproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Office365PolicyProperties struct { - BreakOutCategories *BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesite.go b/resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesite.go deleted file mode 100644 index 1b84d25c56d..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesite.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSite struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualApplianceSiteProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesiteproperties.go b/resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesiteproperties.go deleted file mode 100644 index 5d01b6ab8f8..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/model_virtualappliancesiteproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSiteProperties struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - O365Policy *Office365PolicyProperties `json:"o365Policy,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualappliancesites/predicates.go b/resource-manager/network/2023-06-01/virtualappliancesites/predicates.go deleted file mode 100644 index af31f940d24..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualappliancesites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualApplianceSiteOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualApplianceSiteOperationPredicate) Matches(input VirtualApplianceSite) 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.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/network/2023-06-01/virtualappliancesites/version.go b/resource-manager/network/2023-06-01/virtualappliancesites/version.go deleted file mode 100644 index e27338f6ef3..00000000000 --- a/resource-manager/network/2023-06-01/virtualappliancesites/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualappliancesites - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualappliancesites/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/README.md b/resource-manager/network/2023-06-01/virtualapplianceskus/README.md deleted file mode 100644 index 1296c30afc2..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualapplianceskus` Documentation - -The `virtualapplianceskus` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualapplianceskus" -``` - - -### Client Initialization - -```go -client := virtualapplianceskus.NewVirtualApplianceSkusClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualApplianceSkusClient.Get` - -```go -ctx := context.TODO() -id := virtualapplianceskus.NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue") - -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: `VirtualApplianceSkusClient.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 -} -``` diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/client.go b/resource-manager/network/2023-06-01/virtualapplianceskus/client.go deleted file mode 100644 index db6e9902bb9..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualapplianceskus - -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 VirtualApplianceSkusClient struct { - Client *resourcemanager.Client -} - -func NewVirtualApplianceSkusClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualApplianceSkusClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualapplianceskus", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualApplianceSkusClient: %+v", err) - } - - return &VirtualApplianceSkusClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku.go b/resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku.go deleted file mode 100644 index a2683ac973a..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku.go +++ /dev/null @@ -1,121 +0,0 @@ -package virtualapplianceskus - -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(&NetworkVirtualApplianceSkuId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceSkuId{} - -// NetworkVirtualApplianceSkuId is a struct representing the Resource ID for a Network Virtual Appliance Sku -type NetworkVirtualApplianceSkuId struct { - SubscriptionId string - NetworkVirtualApplianceSkuName string -} - -// NewNetworkVirtualApplianceSkuID returns a new NetworkVirtualApplianceSkuId struct -func NewNetworkVirtualApplianceSkuID(subscriptionId string, networkVirtualApplianceSkuName string) NetworkVirtualApplianceSkuId { - return NetworkVirtualApplianceSkuId{ - SubscriptionId: subscriptionId, - NetworkVirtualApplianceSkuName: networkVirtualApplianceSkuName, - } -} - -// ParseNetworkVirtualApplianceSkuID parses 'input' into a NetworkVirtualApplianceSkuId -func ParseNetworkVirtualApplianceSkuID(input string) (*NetworkVirtualApplianceSkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceSkuId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceSkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceSkuIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceSkuId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceSkuIDInsensitively(input string) (*NetworkVirtualApplianceSkuId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceSkuId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceSkuId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceSkuId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.NetworkVirtualApplianceSkuName, ok = input.Parsed["networkVirtualApplianceSkuName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceSkuName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceSkuID checks that 'input' can be parsed as a Network Virtual Appliance Sku ID -func ValidateNetworkVirtualApplianceSkuID(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 := ParseNetworkVirtualApplianceSkuID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance Sku ID -func (id NetworkVirtualApplianceSkuId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/networkVirtualApplianceSkus/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.NetworkVirtualApplianceSkuName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance Sku ID -func (id NetworkVirtualApplianceSkuId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualApplianceSkus", "networkVirtualApplianceSkus", "networkVirtualApplianceSkus"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceSkuName", "networkVirtualApplianceSkuValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance Sku ID -func (id NetworkVirtualApplianceSkuId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Network Virtual Appliance Sku Name: %q", id.NetworkVirtualApplianceSkuName), - } - return fmt.Sprintf("Network Virtual Appliance Sku (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go b/resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go deleted file mode 100644 index 70d241ebe4c..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/id_networkvirtualappliancesku_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package virtualapplianceskus - -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 = &NetworkVirtualApplianceSkuId{} - -func TestNewNetworkVirtualApplianceSkuID(t *testing.T) { - id := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue") - - 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.NetworkVirtualApplianceSkuName != "networkVirtualApplianceSkuValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceSkuName'", id.NetworkVirtualApplianceSkuName, "networkVirtualApplianceSkuValue") - } -} - -func TestFormatNetworkVirtualApplianceSkuID(t *testing.T) { - actual := NewNetworkVirtualApplianceSkuID("12345678-1234-9876-4563-123456789012", "networkVirtualApplianceSkuValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceSkuID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceSkuId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue", - Expected: &NetworkVirtualApplianceSkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceSkuID(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.NetworkVirtualApplianceSkuName != v.Expected.NetworkVirtualApplianceSkuName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceSkuName", v.Expected.NetworkVirtualApplianceSkuName, actual.NetworkVirtualApplianceSkuName) - } - - } -} - -func TestParseNetworkVirtualApplianceSkuIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceSkuId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue", - Expected: &NetworkVirtualApplianceSkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "networkVirtualApplianceSkuValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/networkVirtualApplianceSkus/networkVirtualApplianceSkuValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUvAlUe", - Expected: &NetworkVirtualApplianceSkuId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - NetworkVirtualApplianceSkuName: "nEtWoRkViRtUaLaPpLiAnCeSkUvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeSkUs/nEtWoRkViRtUaLaPpLiAnCeSkUvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceSkuIDInsensitively(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.NetworkVirtualApplianceSkuName != v.Expected.NetworkVirtualApplianceSkuName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceSkuName", v.Expected.NetworkVirtualApplianceSkuName, actual.NetworkVirtualApplianceSkuName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceSkuId(t *testing.T) { - segments := NetworkVirtualApplianceSkuId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceSkuId 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/network/2023-06-01/virtualapplianceskus/method_get.go b/resource-manager/network/2023-06-01/virtualapplianceskus/method_get.go deleted file mode 100644 index 87cc1eef20e..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualapplianceskus - -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 *NetworkVirtualApplianceSku -} - -// Get ... -func (c VirtualApplianceSkusClient) Get(ctx context.Context, id NetworkVirtualApplianceSkuId) (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 NetworkVirtualApplianceSku - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/method_list.go b/resource-manager/network/2023-06-01/virtualapplianceskus/method_list.go deleted file mode 100644 index c5307baa366..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualapplianceskus - -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 *[]NetworkVirtualApplianceSku -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualApplianceSku -} - -// List ... -func (c VirtualApplianceSkusClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/networkVirtualApplianceSkus", 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 *[]NetworkVirtualApplianceSku `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 VirtualApplianceSkusClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceSkuOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualApplianceSkusClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate NetworkVirtualApplianceSkuOperationPredicate) (result ListCompleteResult, err error) { - items := make([]NetworkVirtualApplianceSku, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualapplianceskus/model_networkvirtualappliancesku.go b/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualappliancesku.go deleted file mode 100644 index 93719c4daa2..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualappliancesku.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSku struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkVirtualApplianceSkuPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go b/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go deleted file mode 100644 index 99b52442ed2..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskuinstances.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSkuInstances struct { - InstanceCount *int64 `json:"instanceCount,omitempty"` - ScaleUnit *string `json:"scaleUnit,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go b/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go deleted file mode 100644 index 5df8c3c3b00..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/model_networkvirtualapplianceskupropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSkuPropertiesFormat struct { - AvailableScaleUnits *[]NetworkVirtualApplianceSkuInstances `json:"availableScaleUnits,omitempty"` - AvailableVersions *[]string `json:"availableVersions,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualapplianceskus/predicates.go b/resource-manager/network/2023-06-01/virtualapplianceskus/predicates.go deleted file mode 100644 index 758bba40370..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualapplianceskus - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceSkuOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p NetworkVirtualApplianceSkuOperationPredicate) Matches(input NetworkVirtualApplianceSku) 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 && (input.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/network/2023-06-01/virtualapplianceskus/version.go b/resource-manager/network/2023-06-01/virtualapplianceskus/version.go deleted file mode 100644 index bc8ac0bf500..00000000000 --- a/resource-manager/network/2023-06-01/virtualapplianceskus/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualapplianceskus - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualapplianceskus/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/README.md b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/README.md deleted file mode 100644 index 33c1eb003c0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/README.md +++ /dev/null @@ -1,208 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections` Documentation - -The `virtualnetworkgatewayconnections` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualnetworkgatewayconnections" -``` - - -### Client Initialization - -```go -client := virtualnetworkgatewayconnections.NewVirtualNetworkGatewayConnectionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VirtualNetworkGatewayConnection{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -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: `VirtualNetworkGatewayConnectionsClient.GetIkeSas` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.GetIkeSasThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.GetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -read, err := client.GetSharedKey(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworkGatewayConnectionsClient.ResetConnection` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -if err := client.ResetConnectionThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.ResetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.ConnectionResetSharedKey{ - // ... -} - - -if err := client.ResetSharedKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.SetSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.ConnectionSharedKey{ - // ... -} - - -if err := client.SetSharedKeyThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VpnPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.VpnPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewayConnectionsClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworkgatewayconnections.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgatewayconnections.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/client.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/client.go deleted file mode 100644 index f0cf4471c90..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworkgatewayconnections - -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 VirtualNetworkGatewayConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkGatewayConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkGatewayConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworkgatewayconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkGatewayConnectionsClient: %+v", err) - } - - return &VirtualNetworkGatewayConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/constants.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/constants.go deleted file mode 100644 index 0d5c94e9343..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/constants.go +++ /dev/null @@ -1,1184 +0,0 @@ -package virtualnetworkgatewayconnections - -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 AdminState string - -const ( - AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" -) - -func PossibleValuesForAdminState() []string { - return []string{ - string(AdminStateDisabled), - string(AdminStateEnabled), - } -} - -func (s *AdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminState(input string) (*AdminState, error) { - vals := map[string]AdminState{ - "disabled": AdminStateDisabled, - "enabled": AdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminState(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { - return []string{ - string(VirtualNetworkGatewayConnectionModeDefault), - string(VirtualNetworkGatewayConnectionModeInitiatorOnly), - string(VirtualNetworkGatewayConnectionModeResponderOnly), - } -} - -func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { - vals := map[string]VirtualNetworkGatewayConnectionMode{ - "default": VirtualNetworkGatewayConnectionModeDefault, - "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, - "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionMode(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { - return []string{ - string(VirtualNetworkGatewayConnectionStatusConnected), - string(VirtualNetworkGatewayConnectionStatusConnecting), - string(VirtualNetworkGatewayConnectionStatusNotConnected), - string(VirtualNetworkGatewayConnectionStatusUnknown), - } -} - -func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { - vals := map[string]VirtualNetworkGatewayConnectionStatus{ - "connected": VirtualNetworkGatewayConnectionStatusConnected, - "connecting": VirtualNetworkGatewayConnectionStatusConnecting, - "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, - "unknown": VirtualNetworkGatewayConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionStatus(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { - return []string{ - string(VirtualNetworkGatewayConnectionTypeExpressRoute), - string(VirtualNetworkGatewayConnectionTypeIPsec), - string(VirtualNetworkGatewayConnectionTypeVPNClient), - string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), - } -} - -func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { - vals := map[string]VirtualNetworkGatewayConnectionType{ - "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, - "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, - "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, - "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionType(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuName string - -const ( - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - VirtualNetworkGatewaySkuNameErGwScale VirtualNetworkGatewaySkuName = "ErGwScale" - VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" - VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" - VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" - VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" - VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" - VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" - VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuName() []string { - return []string{ - string(VirtualNetworkGatewaySkuNameBasic), - string(VirtualNetworkGatewaySkuNameErGwOneAZ), - string(VirtualNetworkGatewaySkuNameErGwScale), - string(VirtualNetworkGatewaySkuNameErGwThreeAZ), - string(VirtualNetworkGatewaySkuNameErGwTwoAZ), - string(VirtualNetworkGatewaySkuNameHighPerformance), - string(VirtualNetworkGatewaySkuNameStandard), - string(VirtualNetworkGatewaySkuNameUltraPerformance), - string(VirtualNetworkGatewaySkuNameVpnGwFive), - string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuNameVpnGwFour), - string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), - string(VirtualNetworkGatewaySkuNameVpnGwOne), - string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), - string(VirtualNetworkGatewaySkuNameVpnGwThree), - string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuNameVpnGwTwo), - string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { - vals := map[string]VirtualNetworkGatewaySkuName{ - "basic": VirtualNetworkGatewaySkuNameBasic, - "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, - "ergwscale": VirtualNetworkGatewaySkuNameErGwScale, - "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, - "standard": VirtualNetworkGatewaySkuNameStandard, - "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuName(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuTier string - -const ( - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - VirtualNetworkGatewaySkuTierErGwScale VirtualNetworkGatewaySkuTier = "ErGwScale" - VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" - VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" - VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" - VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" - VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" - VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" - VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { - return []string{ - string(VirtualNetworkGatewaySkuTierBasic), - string(VirtualNetworkGatewaySkuTierErGwOneAZ), - string(VirtualNetworkGatewaySkuTierErGwScale), - string(VirtualNetworkGatewaySkuTierErGwThreeAZ), - string(VirtualNetworkGatewaySkuTierErGwTwoAZ), - string(VirtualNetworkGatewaySkuTierHighPerformance), - string(VirtualNetworkGatewaySkuTierStandard), - string(VirtualNetworkGatewaySkuTierUltraPerformance), - string(VirtualNetworkGatewaySkuTierVpnGwFive), - string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuTierVpnGwFour), - string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), - string(VirtualNetworkGatewaySkuTierVpnGwOne), - string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), - string(VirtualNetworkGatewaySkuTierVpnGwThree), - string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuTierVpnGwTwo), - string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { - vals := map[string]VirtualNetworkGatewaySkuTier{ - "basic": VirtualNetworkGatewaySkuTierBasic, - "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, - "ergwscale": VirtualNetworkGatewaySkuTierErGwScale, - "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, - "standard": VirtualNetworkGatewaySkuTierStandard, - "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuTier(input) - return &out, nil -} - -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -func PossibleValuesForVirtualNetworkGatewayType() []string { - return []string{ - string(VirtualNetworkGatewayTypeExpressRoute), - string(VirtualNetworkGatewayTypeLocalGateway), - string(VirtualNetworkGatewayTypeVpn), - } -} - -func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { - vals := map[string]VirtualNetworkGatewayType{ - "expressroute": VirtualNetworkGatewayTypeExpressRoute, - "localgateway": VirtualNetworkGatewayTypeLocalGateway, - "vpn": VirtualNetworkGatewayTypeVpn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayType(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnClientProtocol string - -const ( - VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" -) - -func PossibleValuesForVpnClientProtocol() []string { - return []string{ - string(VpnClientProtocolIkeVTwo), - string(VpnClientProtocolOpenVPN), - string(VpnClientProtocolSSTP), - } -} - -func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnClientProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { - vals := map[string]VpnClientProtocol{ - "ikev2": VpnClientProtocolIkeVTwo, - "openvpn": VpnClientProtocolOpenVPN, - "sstp": VpnClientProtocolSSTP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnClientProtocol(input) - return &out, nil -} - -type VpnGatewayGeneration string - -const ( - VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" - VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -func PossibleValuesForVpnGatewayGeneration() []string { - return []string{ - string(VpnGatewayGenerationGenerationOne), - string(VpnGatewayGenerationGenerationTwo), - string(VpnGatewayGenerationNone), - } -} - -func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { - vals := map[string]VpnGatewayGeneration{ - "generation1": VpnGatewayGenerationGenerationOne, - "generation2": VpnGatewayGenerationGenerationTwo, - "none": VpnGatewayGenerationNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayGeneration(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} - -type VpnType string - -const ( - VpnTypePolicyBased VpnType = "PolicyBased" - VpnTypeRouteBased VpnType = "RouteBased" -) - -func PossibleValuesForVpnType() []string { - return []string{ - string(VpnTypePolicyBased), - string(VpnTypeRouteBased), - } -} - -func (s *VpnType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnType(input string) (*VpnType, error) { - vals := map[string]VpnType{ - "policybased": VpnTypePolicyBased, - "routebased": VpnTypeRouteBased, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection.go deleted file mode 100644 index 23a8c6154a7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworkgatewayconnections - -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(&ConnectionId{}) -} - -var _ resourceids.ResourceId = &ConnectionId{} - -// ConnectionId is a struct representing the Resource ID for a Connection -type ConnectionId struct { - SubscriptionId string - ResourceGroupName string - ConnectionName string -} - -// NewConnectionID returns a new ConnectionId struct -func NewConnectionID(subscriptionId string, resourceGroupName string, connectionName string) ConnectionId { - return ConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ConnectionName: connectionName, - } -} - -// ParseConnectionID parses 'input' into a ConnectionId -func ParseConnectionID(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectionIDInsensitively parses 'input' case-insensitively into a ConnectionId -// note: this method should only be used for API response data and not user input -func ParseConnectionIDInsensitively(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectionId) 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.ConnectionName, ok = input.Parsed["connectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionName", input) - } - - return nil -} - -// ValidateConnectionID checks that 'input' can be parsed as a Connection ID -func ValidateConnectionID(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 := ParseConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connection ID -func (id ConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/connections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connection ID -func (id ConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), - } -} - -// String returns a human-readable description of this Connection ID -func (id ConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Connection Name: %q", id.ConnectionName), - } - return fmt.Sprintf("Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection_test.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection_test.go deleted file mode 100644 index 739348c5d82..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/id_connection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworkgatewayconnections - -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 = &ConnectionId{} - -func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - - 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.ConnectionName != "connectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionValue") - } -} - -func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionID(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestParseConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "cOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionIDInsensitively(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestSegmentsForConnectionId(t *testing.T) { - segments := ConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectionId 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/network/2023-06-01/virtualnetworkgatewayconnections/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_createorupdate.go deleted file mode 100644 index 2c95ee84254..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 *VirtualNetworkGatewayConnection -} - -// CreateOrUpdate ... -func (c VirtualNetworkGatewayConnectionsClient) CreateOrUpdate(ctx context.Context, id ConnectionId, input VirtualNetworkGatewayConnection) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) CreateOrUpdateThenPoll(ctx context.Context, id ConnectionId, input VirtualNetworkGatewayConnection) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualnetworkgatewayconnections/method_delete.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_delete.go deleted file mode 100644 index 4d46161ff40..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgatewayconnections - -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 VirtualNetworkGatewayConnectionsClient) Delete(ctx context.Context, id ConnectionId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkGatewayConnectionsClient) DeleteThenPoll(ctx context.Context, id ConnectionId) 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/network/2023-06-01/virtualnetworkgatewayconnections/method_get.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_get.go deleted file mode 100644 index e00568d96cb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkgatewayconnections - -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 *VirtualNetworkGatewayConnection -} - -// Get ... -func (c VirtualNetworkGatewayConnectionsClient) Get(ctx context.Context, id ConnectionId) (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 VirtualNetworkGatewayConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getikesas.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getikesas.go deleted file mode 100644 index f146120f19e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getikesas.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgatewayconnections - -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 GetIkeSasOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// GetIkeSas ... -func (c VirtualNetworkGatewayConnectionsClient) GetIkeSas(ctx context.Context, id ConnectionId) (result GetIkeSasOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getikesas", 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 -} - -// GetIkeSasThenPoll performs GetIkeSas then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) GetIkeSasThenPoll(ctx context.Context, id ConnectionId) error { - result, err := c.GetIkeSas(ctx, id) - if err != nil { - return fmt.Errorf("performing GetIkeSas: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetIkeSas: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getsharedkey.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getsharedkey.go deleted file mode 100644 index bc9ecd13466..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_getsharedkey.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualnetworkgatewayconnections - -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 GetSharedKeyOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionSharedKey -} - -// GetSharedKey ... -func (c VirtualNetworkGatewayConnectionsClient) GetSharedKey(ctx context.Context, id ConnectionId) (result GetSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/sharedkey", 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 ConnectionSharedKey - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_list.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_list.go deleted file mode 100644 index 1a38f08249a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworkgatewayconnections - -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 *[]VirtualNetworkGatewayConnection -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGatewayConnection -} - -// List ... -func (c VirtualNetworkGatewayConnectionsClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/connections", 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 *[]VirtualNetworkGatewayConnection `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 VirtualNetworkGatewayConnectionsClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayConnectionOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewayConnectionsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkGatewayConnectionOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetworkGatewayConnection, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualnetworkgatewayconnections/method_resetconnection.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetconnection.go deleted file mode 100644 index 7898a434030..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetconnection.go +++ /dev/null @@ -1,69 +0,0 @@ -package virtualnetworkgatewayconnections - -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 ResetConnectionOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetConnection ... -func (c VirtualNetworkGatewayConnectionsClient) ResetConnection(ctx context.Context, id ConnectionId) (result ResetConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetconnection", 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 -} - -// ResetConnectionThenPoll performs ResetConnection then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) ResetConnectionThenPoll(ctx context.Context, id ConnectionId) error { - result, err := c.ResetConnection(ctx, id) - if err != nil { - return fmt.Errorf("performing ResetConnection: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetConnection: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetsharedkey.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetsharedkey.go deleted file mode 100644 index 37c842b0ba1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_resetsharedkey.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 ResetSharedKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionResetSharedKey -} - -// ResetSharedKey ... -func (c VirtualNetworkGatewayConnectionsClient) ResetSharedKey(ctx context.Context, id ConnectionId, input ConnectionResetSharedKey) (result ResetSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/sharedkey/reset", 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 -} - -// ResetSharedKeyThenPoll performs ResetSharedKey then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) ResetSharedKeyThenPoll(ctx context.Context, id ConnectionId, input ConnectionResetSharedKey) error { - result, err := c.ResetSharedKey(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ResetSharedKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetSharedKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_setsharedkey.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_setsharedkey.go deleted file mode 100644 index 7cce553c953..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_setsharedkey.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 SetSharedKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ConnectionSharedKey -} - -// SetSharedKey ... -func (c VirtualNetworkGatewayConnectionsClient) SetSharedKey(ctx context.Context, id ConnectionId, input ConnectionSharedKey) (result SetSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusCreated, - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/sharedkey", 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 -} - -// SetSharedKeyThenPoll performs SetSharedKey then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) SetSharedKeyThenPoll(ctx context.Context, id ConnectionId, input ConnectionSharedKey) error { - result, err := c.SetSharedKey(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SetSharedKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SetSharedKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_startpacketcapture.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_startpacketcapture.go deleted file mode 100644 index d0bd4f6819d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_startpacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 StartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StartPacketCapture ... -func (c VirtualNetworkGatewayConnectionsClient) StartPacketCapture(ctx context.Context, id ConnectionId, input VpnPacketCaptureStartParameters) (result StartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startPacketCapture", 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 -} - -// StartPacketCaptureThenPoll performs StartPacketCapture then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) StartPacketCaptureThenPoll(ctx context.Context, id ConnectionId, input VpnPacketCaptureStartParameters) error { - result, err := c.StartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go deleted file mode 100644 index 8741b058a40..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_stoppacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 StopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StopPacketCapture ... -func (c VirtualNetworkGatewayConnectionsClient) StopPacketCapture(ctx context.Context, id ConnectionId, input VpnPacketCaptureStopParameters) (result StopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stopPacketCapture", 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 -} - -// StopPacketCaptureThenPoll performs StopPacketCapture then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) StopPacketCaptureThenPoll(ctx context.Context, id ConnectionId, input VpnPacketCaptureStopParameters) error { - result, err := c.StopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_updatetags.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_updatetags.go deleted file mode 100644 index 6a0ba8aaae8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgatewayconnections - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGatewayConnection -} - -// UpdateTags ... -func (c VirtualNetworkGatewayConnectionsClient) UpdateTags(ctx context.Context, id ConnectionId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c VirtualNetworkGatewayConnectionsClient) UpdateTagsThenPoll(ctx context.Context, id ConnectionId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/virtualnetworkgatewayconnections/model_addressspace.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_addressspace.go deleted file mode 100644 index e94b1820056..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_bgpsettings.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_bgpsettings.go deleted file mode 100644 index e03680282e6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go deleted file mode 100644 index 3e1887b9d36..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionresetsharedkey.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionResetSharedKey struct { - KeyLength int64 `json:"keyLength"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go deleted file mode 100644 index 069812d03a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_connectionsharedkey.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectionSharedKey struct { - Id *string `json:"id,omitempty"` - Value string `json:"value"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 7fda76a8317..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index dd6001591ee..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go deleted file mode 100644 index e36e053ac75..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go deleted file mode 100644 index 9ddafdd0d6e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties LocalNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go deleted file mode 100644 index bf0176c3023..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_localnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LocalNetworkGatewayPropertiesFormat struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - GatewayIPAddress *string `json:"gatewayIpAddress,omitempty"` - LocalNetworkAddressSpace *AddressSpace `json:"localNetworkAddressSpace,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_radiusserver.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_radiusserver.go deleted file mode 100644 index ffc93e64965..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_subresource.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_subresource.go deleted file mode 100644 index 25e6382622d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tagsobject.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tagsobject.go deleted file mode 100644 index 5f1bce5d03d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// 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/network/2023-06-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go deleted file mode 100644 index 7d824402850..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go deleted file mode 100644 index 71722a9b5e7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_tunnelconnectionhealth.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TunnelConnectionHealth struct { - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` - Tunnel *string `json:"tunnel,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go deleted file mode 100644 index 7a95498040e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgateway.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworkgatewayconnections - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go deleted file mode 100644 index 1c546e60aa6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscalebounds.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleBounds struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go deleted file mode 100644 index 5fd318f0446..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleConfiguration struct { - Bounds *VirtualNetworkGatewayAutoScaleBounds `json:"bounds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go deleted file mode 100644 index 05a6ea7eb90..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnection.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayConnectionPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go deleted file mode 100644 index ef9af43f207..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayconnectionpropertiesformat.go +++ /dev/null @@ -1,34 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - ConnectionMode *VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType"` - DpdTimeoutSeconds *int64 `json:"dpdTimeoutSeconds,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - LocalNetworkGateway2 *LocalNetworkGateway `json:"localNetworkGateway2,omitempty"` - Peer *SubResource `json:"peer,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VirtualNetworkGateway1 VirtualNetworkGateway `json:"virtualNetworkGateway1"` - VirtualNetworkGateway2 *VirtualNetworkGateway `json:"virtualNetworkGateway2,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go deleted file mode 100644 index 30467eb2ed1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 863c3769296..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go deleted file mode 100644 index ff6c91b0d66..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go deleted file mode 100644 index 75185bb4a84..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaynatruleproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRuleProperties struct { - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go deleted file mode 100644 index cd507b1d533..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayPolicyGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go deleted file mode 100644 index 632e3bda52f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go deleted file mode 100644 index 6b20992105c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupProperties struct { - IsDefault bool `json:"isDefault"` - PolicyMembers []VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VngClientConnectionConfigurations *[]SubResource `json:"vngClientConnectionConfigurations,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go deleted file mode 100644 index e35b30c9f00..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPropertiesFormat struct { - ActiveActive *bool `json:"activeActive,omitempty"` - AdminState *AdminState `json:"adminState,omitempty"` - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - AutoScaleConfiguration *VirtualNetworkGatewayAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - VpnType *VpnType `json:"vpnType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go deleted file mode 100644 index 301f66896ac..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_virtualnetworkgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *VirtualNetworkGatewaySkuName `json:"name,omitempty"` - Tier *VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go deleted file mode 100644 index 744d5505a17..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VngClientConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go deleted file mode 100644 index 531c18a0419..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vngclientconnectionconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfigurationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkGatewayPolicyGroups []SubResource `json:"virtualNetworkGatewayPolicyGroups"` - VpnClientAddressPool AddressSpace `json:"vpnClientAddressPool"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go deleted file mode 100644 index f7da3943c5a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientconfiguration.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConfiguration struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VngClientConnectionConfigurations *[]VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` - VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go deleted file mode 100644 index 7f83a9053a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go deleted file mode 100644 index 0155228d4d1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrevokedcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go deleted file mode 100644 index 6eb8d073f4f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VpnClientRootCertificatePropertiesFormat `json:"properties"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go deleted file mode 100644 index f5048e1ed78..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnclientrootcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData string `json:"publicCertData"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go deleted file mode 100644 index 394cabc619d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go deleted file mode 100644 index 52273329f1d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestartparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go deleted file mode 100644 index e7481a70176..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/model_vpnpacketcapturestopparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/predicates.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/predicates.go deleted file mode 100644 index c1fe558dd66..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualnetworkgatewayconnections - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayConnectionOperationPredicate) Matches(input VirtualNetworkGatewayConnection) 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 && (input.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/network/2023-06-01/virtualnetworkgatewayconnections/version.go b/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/version.go deleted file mode 100644 index decd3d96e12..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgatewayconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgatewayconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgatewayconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/README.md b/resource-manager/network/2023-06-01/virtualnetworkgateways/README.md deleted file mode 100644 index 804ea1ce598..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/README.md +++ /dev/null @@ -1,414 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworkgateways` Documentation - -The `virtualnetworkgateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualnetworkgateways" -``` - - -### Client Initialization - -```go -client := virtualnetworkgateways.NewVirtualNetworkGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VirtualNetworkGateway{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.DisconnectVirtualNetworkGatewayVpnConnections` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.P2SVpnConnectionRequest{ - // ... -} - - -if err := client.DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GenerateVpnProfile` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientParameters{ - // ... -} - - -if err := client.GenerateVpnProfileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Generatevpnclientpackage` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientParameters{ - // ... -} - - -if err := client.GeneratevpnclientpackageThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -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: `VirtualNetworkGatewaysClient.GetAdvertisedRoutes` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetAdvertisedRoutesThenPoll(ctx, id, virtualnetworkgateways.DefaultGetAdvertisedRoutesOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetBgpPeerStatus` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetBgpPeerStatusThenPoll(ctx, id, virtualnetworkgateways.DefaultGetBgpPeerStatusOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetLearnedRoutes` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetLearnedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnProfilePackageUrl` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnProfilePackageUrlThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientConnectionHealth` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnclientConnectionHealthThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.GetVpnclientIPsecParameters` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.GetVpnclientIPsecParametersThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworkGatewaysClient.ListConnections` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -// alternatively `client.ListConnections(ctx, id)` can be used to do batched pagination -items, err := client.ListConnectionsComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.ResetThenPoll(ctx, id, virtualnetworkgateways.DefaultResetOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.ResetVpnClientSharedKey` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -if err := client.ResetVpnClientSharedKeyThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.SetVpnclientIPsecParameters` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnClientIPsecParameters{ - // ... -} - - -if err := client.SetVpnclientIPsecParametersThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.VpnPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.SupportedVpnDevices` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -read, err := client.SupportedVpnDevices(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -payload := virtualnetworkgateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -payload := virtualnetworkgateways.VirtualNetworkGatewayNatRule{ - // ... -} - - -if err := client.VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesDelete` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -if err := client.VirtualNetworkGatewayNatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesGet` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - -read, err := client.VirtualNetworkGatewayNatRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - -// alternatively `client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx, id)` can be used to do batched pagination -items, err := client.VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkGatewaysClient.VpnDeviceConfigurationScript` - -```go -ctx := context.TODO() -id := virtualnetworkgateways.NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - -payload := virtualnetworkgateways.VpnDeviceScriptParameters{ - // ... -} - - -read, err := client.VpnDeviceConfigurationScript(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/network/2023-06-01/virtualnetworkgateways/client.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/client.go deleted file mode 100644 index 32ede23bc60..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworkgateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkGatewaysClient: %+v", err) - } - - return &VirtualNetworkGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/constants.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/constants.go deleted file mode 100644 index 16875bf9048..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/constants.go +++ /dev/null @@ -1,1316 +0,0 @@ -package virtualnetworkgateways - -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 AdminState string - -const ( - AdminStateDisabled AdminState = "Disabled" - AdminStateEnabled AdminState = "Enabled" -) - -func PossibleValuesForAdminState() []string { - return []string{ - string(AdminStateDisabled), - string(AdminStateEnabled), - } -} - -func (s *AdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAdminState(input string) (*AdminState, error) { - vals := map[string]AdminState{ - "disabled": AdminStateDisabled, - "enabled": AdminStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AdminState(input) - return &out, nil -} - -type AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type BgpPeerState string - -const ( - BgpPeerStateConnected BgpPeerState = "Connected" - BgpPeerStateConnecting BgpPeerState = "Connecting" - BgpPeerStateIdle BgpPeerState = "Idle" - BgpPeerStateStopped BgpPeerState = "Stopped" - BgpPeerStateUnknown BgpPeerState = "Unknown" -) - -func PossibleValuesForBgpPeerState() []string { - return []string{ - string(BgpPeerStateConnected), - string(BgpPeerStateConnecting), - string(BgpPeerStateIdle), - string(BgpPeerStateStopped), - string(BgpPeerStateUnknown), - } -} - -func (s *BgpPeerState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBgpPeerState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBgpPeerState(input string) (*BgpPeerState, error) { - vals := map[string]BgpPeerState{ - "connected": BgpPeerStateConnected, - "connecting": BgpPeerStateConnecting, - "idle": BgpPeerStateIdle, - "stopped": BgpPeerStateStopped, - "unknown": BgpPeerStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BgpPeerState(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProcessorArchitecture string - -const ( - ProcessorArchitectureAmdSixFour ProcessorArchitecture = "Amd64" - ProcessorArchitectureXEightSix ProcessorArchitecture = "X86" -) - -func PossibleValuesForProcessorArchitecture() []string { - return []string{ - string(ProcessorArchitectureAmdSixFour), - string(ProcessorArchitectureXEightSix), - } -} - -func (s *ProcessorArchitecture) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProcessorArchitecture(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProcessorArchitecture(input string) (*ProcessorArchitecture, error) { - vals := map[string]ProcessorArchitecture{ - "amd64": ProcessorArchitectureAmdSixFour, - "x86": ProcessorArchitectureXEightSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProcessorArchitecture(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionMode string - -const ( - VirtualNetworkGatewayConnectionModeDefault VirtualNetworkGatewayConnectionMode = "Default" - VirtualNetworkGatewayConnectionModeInitiatorOnly VirtualNetworkGatewayConnectionMode = "InitiatorOnly" - VirtualNetworkGatewayConnectionModeResponderOnly VirtualNetworkGatewayConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionMode() []string { - return []string{ - string(VirtualNetworkGatewayConnectionModeDefault), - string(VirtualNetworkGatewayConnectionModeInitiatorOnly), - string(VirtualNetworkGatewayConnectionModeResponderOnly), - } -} - -func (s *VirtualNetworkGatewayConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionMode(input string) (*VirtualNetworkGatewayConnectionMode, error) { - vals := map[string]VirtualNetworkGatewayConnectionMode{ - "default": VirtualNetworkGatewayConnectionModeDefault, - "initiatoronly": VirtualNetworkGatewayConnectionModeInitiatorOnly, - "responderonly": VirtualNetworkGatewayConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionMode(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionStatus string - -const ( - VirtualNetworkGatewayConnectionStatusConnected VirtualNetworkGatewayConnectionStatus = "Connected" - VirtualNetworkGatewayConnectionStatusConnecting VirtualNetworkGatewayConnectionStatus = "Connecting" - VirtualNetworkGatewayConnectionStatusNotConnected VirtualNetworkGatewayConnectionStatus = "NotConnected" - VirtualNetworkGatewayConnectionStatusUnknown VirtualNetworkGatewayConnectionStatus = "Unknown" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionStatus() []string { - return []string{ - string(VirtualNetworkGatewayConnectionStatusConnected), - string(VirtualNetworkGatewayConnectionStatusConnecting), - string(VirtualNetworkGatewayConnectionStatusNotConnected), - string(VirtualNetworkGatewayConnectionStatusUnknown), - } -} - -func (s *VirtualNetworkGatewayConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionStatus(input string) (*VirtualNetworkGatewayConnectionStatus, error) { - vals := map[string]VirtualNetworkGatewayConnectionStatus{ - "connected": VirtualNetworkGatewayConnectionStatusConnected, - "connecting": VirtualNetworkGatewayConnectionStatusConnecting, - "notconnected": VirtualNetworkGatewayConnectionStatusNotConnected, - "unknown": VirtualNetworkGatewayConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionStatus(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionType string - -const ( - VirtualNetworkGatewayConnectionTypeExpressRoute VirtualNetworkGatewayConnectionType = "ExpressRoute" - VirtualNetworkGatewayConnectionTypeIPsec VirtualNetworkGatewayConnectionType = "IPsec" - VirtualNetworkGatewayConnectionTypeVPNClient VirtualNetworkGatewayConnectionType = "VPNClient" - VirtualNetworkGatewayConnectionTypeVnetTwoVnet VirtualNetworkGatewayConnectionType = "Vnet2Vnet" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionType() []string { - return []string{ - string(VirtualNetworkGatewayConnectionTypeExpressRoute), - string(VirtualNetworkGatewayConnectionTypeIPsec), - string(VirtualNetworkGatewayConnectionTypeVPNClient), - string(VirtualNetworkGatewayConnectionTypeVnetTwoVnet), - } -} - -func (s *VirtualNetworkGatewayConnectionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionType(input string) (*VirtualNetworkGatewayConnectionType, error) { - vals := map[string]VirtualNetworkGatewayConnectionType{ - "expressroute": VirtualNetworkGatewayConnectionTypeExpressRoute, - "ipsec": VirtualNetworkGatewayConnectionTypeIPsec, - "vpnclient": VirtualNetworkGatewayConnectionTypeVPNClient, - "vnet2vnet": VirtualNetworkGatewayConnectionTypeVnetTwoVnet, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionType(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuName string - -const ( - VirtualNetworkGatewaySkuNameBasic VirtualNetworkGatewaySkuName = "Basic" - VirtualNetworkGatewaySkuNameErGwOneAZ VirtualNetworkGatewaySkuName = "ErGw1AZ" - VirtualNetworkGatewaySkuNameErGwScale VirtualNetworkGatewaySkuName = "ErGwScale" - VirtualNetworkGatewaySkuNameErGwThreeAZ VirtualNetworkGatewaySkuName = "ErGw3AZ" - VirtualNetworkGatewaySkuNameErGwTwoAZ VirtualNetworkGatewaySkuName = "ErGw2AZ" - VirtualNetworkGatewaySkuNameHighPerformance VirtualNetworkGatewaySkuName = "HighPerformance" - VirtualNetworkGatewaySkuNameStandard VirtualNetworkGatewaySkuName = "Standard" - VirtualNetworkGatewaySkuNameUltraPerformance VirtualNetworkGatewaySkuName = "UltraPerformance" - VirtualNetworkGatewaySkuNameVpnGwFive VirtualNetworkGatewaySkuName = "VpnGw5" - VirtualNetworkGatewaySkuNameVpnGwFiveAZ VirtualNetworkGatewaySkuName = "VpnGw5AZ" - VirtualNetworkGatewaySkuNameVpnGwFour VirtualNetworkGatewaySkuName = "VpnGw4" - VirtualNetworkGatewaySkuNameVpnGwFourAZ VirtualNetworkGatewaySkuName = "VpnGw4AZ" - VirtualNetworkGatewaySkuNameVpnGwOne VirtualNetworkGatewaySkuName = "VpnGw1" - VirtualNetworkGatewaySkuNameVpnGwOneAZ VirtualNetworkGatewaySkuName = "VpnGw1AZ" - VirtualNetworkGatewaySkuNameVpnGwThree VirtualNetworkGatewaySkuName = "VpnGw3" - VirtualNetworkGatewaySkuNameVpnGwThreeAZ VirtualNetworkGatewaySkuName = "VpnGw3AZ" - VirtualNetworkGatewaySkuNameVpnGwTwo VirtualNetworkGatewaySkuName = "VpnGw2" - VirtualNetworkGatewaySkuNameVpnGwTwoAZ VirtualNetworkGatewaySkuName = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuName() []string { - return []string{ - string(VirtualNetworkGatewaySkuNameBasic), - string(VirtualNetworkGatewaySkuNameErGwOneAZ), - string(VirtualNetworkGatewaySkuNameErGwScale), - string(VirtualNetworkGatewaySkuNameErGwThreeAZ), - string(VirtualNetworkGatewaySkuNameErGwTwoAZ), - string(VirtualNetworkGatewaySkuNameHighPerformance), - string(VirtualNetworkGatewaySkuNameStandard), - string(VirtualNetworkGatewaySkuNameUltraPerformance), - string(VirtualNetworkGatewaySkuNameVpnGwFive), - string(VirtualNetworkGatewaySkuNameVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuNameVpnGwFour), - string(VirtualNetworkGatewaySkuNameVpnGwFourAZ), - string(VirtualNetworkGatewaySkuNameVpnGwOne), - string(VirtualNetworkGatewaySkuNameVpnGwOneAZ), - string(VirtualNetworkGatewaySkuNameVpnGwThree), - string(VirtualNetworkGatewaySkuNameVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuNameVpnGwTwo), - string(VirtualNetworkGatewaySkuNameVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuName(input string) (*VirtualNetworkGatewaySkuName, error) { - vals := map[string]VirtualNetworkGatewaySkuName{ - "basic": VirtualNetworkGatewaySkuNameBasic, - "ergw1az": VirtualNetworkGatewaySkuNameErGwOneAZ, - "ergwscale": VirtualNetworkGatewaySkuNameErGwScale, - "ergw3az": VirtualNetworkGatewaySkuNameErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuNameErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuNameHighPerformance, - "standard": VirtualNetworkGatewaySkuNameStandard, - "ultraperformance": VirtualNetworkGatewaySkuNameUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuNameVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuNameVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuNameVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuNameVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuNameVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuNameVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuNameVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuNameVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuNameVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuNameVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuName(input) - return &out, nil -} - -type VirtualNetworkGatewaySkuTier string - -const ( - VirtualNetworkGatewaySkuTierBasic VirtualNetworkGatewaySkuTier = "Basic" - VirtualNetworkGatewaySkuTierErGwOneAZ VirtualNetworkGatewaySkuTier = "ErGw1AZ" - VirtualNetworkGatewaySkuTierErGwScale VirtualNetworkGatewaySkuTier = "ErGwScale" - VirtualNetworkGatewaySkuTierErGwThreeAZ VirtualNetworkGatewaySkuTier = "ErGw3AZ" - VirtualNetworkGatewaySkuTierErGwTwoAZ VirtualNetworkGatewaySkuTier = "ErGw2AZ" - VirtualNetworkGatewaySkuTierHighPerformance VirtualNetworkGatewaySkuTier = "HighPerformance" - VirtualNetworkGatewaySkuTierStandard VirtualNetworkGatewaySkuTier = "Standard" - VirtualNetworkGatewaySkuTierUltraPerformance VirtualNetworkGatewaySkuTier = "UltraPerformance" - VirtualNetworkGatewaySkuTierVpnGwFive VirtualNetworkGatewaySkuTier = "VpnGw5" - VirtualNetworkGatewaySkuTierVpnGwFiveAZ VirtualNetworkGatewaySkuTier = "VpnGw5AZ" - VirtualNetworkGatewaySkuTierVpnGwFour VirtualNetworkGatewaySkuTier = "VpnGw4" - VirtualNetworkGatewaySkuTierVpnGwFourAZ VirtualNetworkGatewaySkuTier = "VpnGw4AZ" - VirtualNetworkGatewaySkuTierVpnGwOne VirtualNetworkGatewaySkuTier = "VpnGw1" - VirtualNetworkGatewaySkuTierVpnGwOneAZ VirtualNetworkGatewaySkuTier = "VpnGw1AZ" - VirtualNetworkGatewaySkuTierVpnGwThree VirtualNetworkGatewaySkuTier = "VpnGw3" - VirtualNetworkGatewaySkuTierVpnGwThreeAZ VirtualNetworkGatewaySkuTier = "VpnGw3AZ" - VirtualNetworkGatewaySkuTierVpnGwTwo VirtualNetworkGatewaySkuTier = "VpnGw2" - VirtualNetworkGatewaySkuTierVpnGwTwoAZ VirtualNetworkGatewaySkuTier = "VpnGw2AZ" -) - -func PossibleValuesForVirtualNetworkGatewaySkuTier() []string { - return []string{ - string(VirtualNetworkGatewaySkuTierBasic), - string(VirtualNetworkGatewaySkuTierErGwOneAZ), - string(VirtualNetworkGatewaySkuTierErGwScale), - string(VirtualNetworkGatewaySkuTierErGwThreeAZ), - string(VirtualNetworkGatewaySkuTierErGwTwoAZ), - string(VirtualNetworkGatewaySkuTierHighPerformance), - string(VirtualNetworkGatewaySkuTierStandard), - string(VirtualNetworkGatewaySkuTierUltraPerformance), - string(VirtualNetworkGatewaySkuTierVpnGwFive), - string(VirtualNetworkGatewaySkuTierVpnGwFiveAZ), - string(VirtualNetworkGatewaySkuTierVpnGwFour), - string(VirtualNetworkGatewaySkuTierVpnGwFourAZ), - string(VirtualNetworkGatewaySkuTierVpnGwOne), - string(VirtualNetworkGatewaySkuTierVpnGwOneAZ), - string(VirtualNetworkGatewaySkuTierVpnGwThree), - string(VirtualNetworkGatewaySkuTierVpnGwThreeAZ), - string(VirtualNetworkGatewaySkuTierVpnGwTwo), - string(VirtualNetworkGatewaySkuTierVpnGwTwoAZ), - } -} - -func (s *VirtualNetworkGatewaySkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewaySkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewaySkuTier(input string) (*VirtualNetworkGatewaySkuTier, error) { - vals := map[string]VirtualNetworkGatewaySkuTier{ - "basic": VirtualNetworkGatewaySkuTierBasic, - "ergw1az": VirtualNetworkGatewaySkuTierErGwOneAZ, - "ergwscale": VirtualNetworkGatewaySkuTierErGwScale, - "ergw3az": VirtualNetworkGatewaySkuTierErGwThreeAZ, - "ergw2az": VirtualNetworkGatewaySkuTierErGwTwoAZ, - "highperformance": VirtualNetworkGatewaySkuTierHighPerformance, - "standard": VirtualNetworkGatewaySkuTierStandard, - "ultraperformance": VirtualNetworkGatewaySkuTierUltraPerformance, - "vpngw5": VirtualNetworkGatewaySkuTierVpnGwFive, - "vpngw5az": VirtualNetworkGatewaySkuTierVpnGwFiveAZ, - "vpngw4": VirtualNetworkGatewaySkuTierVpnGwFour, - "vpngw4az": VirtualNetworkGatewaySkuTierVpnGwFourAZ, - "vpngw1": VirtualNetworkGatewaySkuTierVpnGwOne, - "vpngw1az": VirtualNetworkGatewaySkuTierVpnGwOneAZ, - "vpngw3": VirtualNetworkGatewaySkuTierVpnGwThree, - "vpngw3az": VirtualNetworkGatewaySkuTierVpnGwThreeAZ, - "vpngw2": VirtualNetworkGatewaySkuTierVpnGwTwo, - "vpngw2az": VirtualNetworkGatewaySkuTierVpnGwTwoAZ, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewaySkuTier(input) - return &out, nil -} - -type VirtualNetworkGatewayType string - -const ( - VirtualNetworkGatewayTypeExpressRoute VirtualNetworkGatewayType = "ExpressRoute" - VirtualNetworkGatewayTypeLocalGateway VirtualNetworkGatewayType = "LocalGateway" - VirtualNetworkGatewayTypeVpn VirtualNetworkGatewayType = "Vpn" -) - -func PossibleValuesForVirtualNetworkGatewayType() []string { - return []string{ - string(VirtualNetworkGatewayTypeExpressRoute), - string(VirtualNetworkGatewayTypeLocalGateway), - string(VirtualNetworkGatewayTypeVpn), - } -} - -func (s *VirtualNetworkGatewayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayType(input string) (*VirtualNetworkGatewayType, error) { - vals := map[string]VirtualNetworkGatewayType{ - "expressroute": VirtualNetworkGatewayTypeExpressRoute, - "localgateway": VirtualNetworkGatewayTypeLocalGateway, - "vpn": VirtualNetworkGatewayTypeVpn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayType(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnClientProtocol string - -const ( - VpnClientProtocolIkeVTwo VpnClientProtocol = "IkeV2" - VpnClientProtocolOpenVPN VpnClientProtocol = "OpenVPN" - VpnClientProtocolSSTP VpnClientProtocol = "SSTP" -) - -func PossibleValuesForVpnClientProtocol() []string { - return []string{ - string(VpnClientProtocolIkeVTwo), - string(VpnClientProtocolOpenVPN), - string(VpnClientProtocolSSTP), - } -} - -func (s *VpnClientProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnClientProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnClientProtocol(input string) (*VpnClientProtocol, error) { - vals := map[string]VpnClientProtocol{ - "ikev2": VpnClientProtocolIkeVTwo, - "openvpn": VpnClientProtocolOpenVPN, - "sstp": VpnClientProtocolSSTP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnClientProtocol(input) - return &out, nil -} - -type VpnGatewayGeneration string - -const ( - VpnGatewayGenerationGenerationOne VpnGatewayGeneration = "Generation1" - VpnGatewayGenerationGenerationTwo VpnGatewayGeneration = "Generation2" - VpnGatewayGenerationNone VpnGatewayGeneration = "None" -) - -func PossibleValuesForVpnGatewayGeneration() []string { - return []string{ - string(VpnGatewayGenerationGenerationOne), - string(VpnGatewayGenerationGenerationTwo), - string(VpnGatewayGenerationNone), - } -} - -func (s *VpnGatewayGeneration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayGeneration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayGeneration(input string) (*VpnGatewayGeneration, error) { - vals := map[string]VpnGatewayGeneration{ - "generation1": VpnGatewayGenerationGenerationOne, - "generation2": VpnGatewayGenerationGenerationTwo, - "none": VpnGatewayGenerationNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayGeneration(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} - -type VpnType string - -const ( - VpnTypePolicyBased VpnType = "PolicyBased" - VpnTypeRouteBased VpnType = "RouteBased" -) - -func PossibleValuesForVpnType() []string { - return []string{ - string(VpnTypePolicyBased), - string(VpnTypeRouteBased), - } -} - -func (s *VpnType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnType(input string) (*VpnType, error) { - vals := map[string]VpnType{ - "policybased": VpnTypePolicyBased, - "routebased": VpnTypeRouteBased, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection.go deleted file mode 100644 index fb9191036b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworkgateways - -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(&ConnectionId{}) -} - -var _ resourceids.ResourceId = &ConnectionId{} - -// ConnectionId is a struct representing the Resource ID for a Connection -type ConnectionId struct { - SubscriptionId string - ResourceGroupName string - ConnectionName string -} - -// NewConnectionID returns a new ConnectionId struct -func NewConnectionID(subscriptionId string, resourceGroupName string, connectionName string) ConnectionId { - return ConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ConnectionName: connectionName, - } -} - -// ParseConnectionID parses 'input' into a ConnectionId -func ParseConnectionID(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConnectionIDInsensitively parses 'input' case-insensitively into a ConnectionId -// note: this method should only be used for API response data and not user input -func ParseConnectionIDInsensitively(input string) (*ConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConnectionId) 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.ConnectionName, ok = input.Parsed["connectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "connectionName", input) - } - - return nil -} - -// ValidateConnectionID checks that 'input' can be parsed as a Connection ID -func ValidateConnectionID(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 := ParseConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Connection ID -func (id ConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/connections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Connection ID -func (id ConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticConnections", "connections", "connections"), - resourceids.UserSpecifiedSegment("connectionName", "connectionValue"), - } -} - -// String returns a human-readable description of this Connection ID -func (id ConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Connection Name: %q", id.ConnectionName), - } - return fmt.Sprintf("Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection_test.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection_test.go deleted file mode 100644 index c9138f5b971..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_connection_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworkgateways - -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 = &ConnectionId{} - -func TestNewConnectionID(t *testing.T) { - id := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue") - - 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.ConnectionName != "connectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConnectionName'", id.ConnectionName, "connectionValue") - } -} - -func TestFormatConnectionID(t *testing.T) { - actual := NewConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "connectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionID(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestParseConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ConnectionName: "connectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/connections/connectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe", - Expected: &ConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ConnectionName: "cOnNeCtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/cOnNeCtIoNs/cOnNeCtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConnectionIDInsensitively(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.ConnectionName != v.Expected.ConnectionName { - t.Fatalf("Expected %q but got %q for ConnectionName", v.Expected.ConnectionName, actual.ConnectionName) - } - - } -} - -func TestSegmentsForConnectionId(t *testing.T) { - segments := ConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConnectionId 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/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway.go deleted file mode 100644 index 4763c88cab1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworkgateways - -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(&VirtualNetworkGatewayId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkGatewayId{} - -// VirtualNetworkGatewayId is a struct representing the Resource ID for a Virtual Network Gateway -type VirtualNetworkGatewayId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkGatewayName string -} - -// NewVirtualNetworkGatewayID returns a new VirtualNetworkGatewayId struct -func NewVirtualNetworkGatewayID(subscriptionId string, resourceGroupName string, virtualNetworkGatewayName string) VirtualNetworkGatewayId { - return VirtualNetworkGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkGatewayName: virtualNetworkGatewayName, - } -} - -// ParseVirtualNetworkGatewayID parses 'input' into a VirtualNetworkGatewayId -func ParseVirtualNetworkGatewayID(input string) (*VirtualNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkGatewayIDInsensitively parses 'input' case-insensitively into a VirtualNetworkGatewayId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkGatewayIDInsensitively(input string) (*VirtualNetworkGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkGatewayId) 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.VirtualNetworkGatewayName, ok = input.Parsed["virtualNetworkGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkGatewayName", input) - } - - return nil -} - -// ValidateVirtualNetworkGatewayID checks that 'input' can be parsed as a Virtual Network Gateway ID -func ValidateVirtualNetworkGatewayID(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 := ParseVirtualNetworkGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Gateway ID -func (id VirtualNetworkGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworkGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Gateway ID -func (id VirtualNetworkGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworkGateways", "virtualNetworkGateways", "virtualNetworkGateways"), - resourceids.UserSpecifiedSegment("virtualNetworkGatewayName", "virtualNetworkGatewayValue"), - } -} - -// String returns a human-readable description of this Virtual Network Gateway ID -func (id VirtualNetworkGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Gateway Name: %q", id.VirtualNetworkGatewayName), - } - return fmt.Sprintf("Virtual Network Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go deleted file mode 100644 index 1c9b9be16ca..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworkgateways - -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 = &VirtualNetworkGatewayId{} - -func TestNewVirtualNetworkGatewayID(t *testing.T) { - id := NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue") - - 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.VirtualNetworkGatewayName != "virtualNetworkGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkGatewayName'", id.VirtualNetworkGatewayName, "virtualNetworkGatewayValue") - } -} - -func TestFormatVirtualNetworkGatewayID(t *testing.T) { - actual := NewVirtualNetworkGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Expected: &VirtualNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayID(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - } -} - -func TestParseVirtualNetworkGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Expected: &VirtualNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE", - Expected: &VirtualNetworkGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkGatewayName: "vIrTuAlNeTwOrKgAtEwAyVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayIDInsensitively(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - } -} - -func TestSegmentsForVirtualNetworkGatewayId(t *testing.T) { - segments := VirtualNetworkGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkGatewayId 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/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go deleted file mode 100644 index 41c5df8eedd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualnetworkgateways - -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(&VirtualNetworkGatewayNatRuleId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkGatewayNatRuleId{} - -// VirtualNetworkGatewayNatRuleId is a struct representing the Resource ID for a Virtual Network Gateway Nat Rule -type VirtualNetworkGatewayNatRuleId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkGatewayName string - NatRuleName string -} - -// NewVirtualNetworkGatewayNatRuleID returns a new VirtualNetworkGatewayNatRuleId struct -func NewVirtualNetworkGatewayNatRuleID(subscriptionId string, resourceGroupName string, virtualNetworkGatewayName string, natRuleName string) VirtualNetworkGatewayNatRuleId { - return VirtualNetworkGatewayNatRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkGatewayName: virtualNetworkGatewayName, - NatRuleName: natRuleName, - } -} - -// ParseVirtualNetworkGatewayNatRuleID parses 'input' into a VirtualNetworkGatewayNatRuleId -func ParseVirtualNetworkGatewayNatRuleID(input string) (*VirtualNetworkGatewayNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayNatRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkGatewayNatRuleIDInsensitively parses 'input' case-insensitively into a VirtualNetworkGatewayNatRuleId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkGatewayNatRuleIDInsensitively(input string) (*VirtualNetworkGatewayNatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkGatewayNatRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkGatewayNatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkGatewayNatRuleId) 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.VirtualNetworkGatewayName, ok = input.Parsed["virtualNetworkGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkGatewayName", input) - } - - if id.NatRuleName, ok = input.Parsed["natRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "natRuleName", input) - } - - return nil -} - -// ValidateVirtualNetworkGatewayNatRuleID checks that 'input' can be parsed as a Virtual Network Gateway Nat Rule ID -func ValidateVirtualNetworkGatewayNatRuleID(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 := ParseVirtualNetworkGatewayNatRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Gateway Nat Rule ID -func (id VirtualNetworkGatewayNatRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworkGateways/%s/natRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkGatewayName, id.NatRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Gateway Nat Rule ID -func (id VirtualNetworkGatewayNatRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworkGateways", "virtualNetworkGateways", "virtualNetworkGateways"), - resourceids.UserSpecifiedSegment("virtualNetworkGatewayName", "virtualNetworkGatewayValue"), - resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), - resourceids.UserSpecifiedSegment("natRuleName", "natRuleValue"), - } -} - -// String returns a human-readable description of this Virtual Network Gateway Nat Rule ID -func (id VirtualNetworkGatewayNatRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Gateway Name: %q", id.VirtualNetworkGatewayName), - fmt.Sprintf("Nat Rule Name: %q", id.NatRuleName), - } - return fmt.Sprintf("Virtual Network Gateway Nat Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go deleted file mode 100644 index ae1f73b2a85..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/id_virtualnetworkgatewaynatrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualnetworkgateways - -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 = &VirtualNetworkGatewayNatRuleId{} - -func TestNewVirtualNetworkGatewayNatRuleID(t *testing.T) { - id := NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue") - - 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.VirtualNetworkGatewayName != "virtualNetworkGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkGatewayName'", id.VirtualNetworkGatewayName, "virtualNetworkGatewayValue") - } - - if id.NatRuleName != "natRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'NatRuleName'", id.NatRuleName, "natRuleValue") - } -} - -func TestFormatVirtualNetworkGatewayNatRuleID(t *testing.T) { - actual := NewVirtualNetworkGatewayNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkGatewayValue", "natRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkGatewayNatRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue", - Expected: &VirtualNetworkGatewayNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayNatRuleID(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestParseVirtualNetworkGatewayNatRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkGatewayNatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/nAtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue", - Expected: &VirtualNetworkGatewayNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkGatewayName: "virtualNetworkGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkGateways/virtualNetworkGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/nAtRuLeS/nAtRuLeVaLuE", - Expected: &VirtualNetworkGatewayNatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkGatewayName: "vIrTuAlNeTwOrKgAtEwAyVaLuE", - NatRuleName: "nAtRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKgAtEwAyS/vIrTuAlNeTwOrKgAtEwAyVaLuE/nAtRuLeS/nAtRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkGatewayNatRuleIDInsensitively(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.VirtualNetworkGatewayName != v.Expected.VirtualNetworkGatewayName { - t.Fatalf("Expected %q but got %q for VirtualNetworkGatewayName", v.Expected.VirtualNetworkGatewayName, actual.VirtualNetworkGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestSegmentsForVirtualNetworkGatewayNatRuleId(t *testing.T) { - segments := VirtualNetworkGatewayNatRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkGatewayNatRuleId 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/network/2023-06-01/virtualnetworkgateways/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_createorupdate.go deleted file mode 100644 index 1f22024e4a6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 *VirtualNetworkGateway -} - -// CreateOrUpdate ... -func (c VirtualNetworkGatewaysClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkGatewayId, input VirtualNetworkGateway) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworkGatewaysClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VirtualNetworkGateway) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualnetworkgateways/method_delete.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_delete.go deleted file mode 100644 index 06878f245a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewaysClient) Delete(ctx context.Context, id VirtualNetworkGatewayId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkGatewaysClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkGatewayId) 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/network/2023-06-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go deleted file mode 100644 index 6a0589d67d6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_disconnectvirtualnetworkgatewayvpnconnections.go +++ /dev/null @@ -1,74 +0,0 @@ -package virtualnetworkgateways - -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 DisconnectVirtualNetworkGatewayVpnConnectionsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// DisconnectVirtualNetworkGatewayVpnConnections ... -func (c VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnections(ctx context.Context, id VirtualNetworkGatewayId, input P2SVpnConnectionRequest) (result DisconnectVirtualNetworkGatewayVpnConnectionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnectVirtualNetworkGatewayVpnConnections", 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 -} - -// DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll performs DisconnectVirtualNetworkGatewayVpnConnections then polls until it's completed -func (c VirtualNetworkGatewaysClient) DisconnectVirtualNetworkGatewayVpnConnectionsThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input P2SVpnConnectionRequest) error { - result, err := c.DisconnectVirtualNetworkGatewayVpnConnections(ctx, id, input) - if err != nil { - return fmt.Errorf("performing DisconnectVirtualNetworkGatewayVpnConnections: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after DisconnectVirtualNetworkGatewayVpnConnections: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnclientpackage.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnclientpackage.go deleted file mode 100644 index a08869751a8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnclientpackage.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 GeneratevpnclientpackageOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// Generatevpnclientpackage ... -func (c VirtualNetworkGatewaysClient) Generatevpnclientpackage(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) (result GeneratevpnclientpackageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatevpnclientpackage", 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 -} - -// GeneratevpnclientpackageThenPoll performs Generatevpnclientpackage then polls until it's completed -func (c VirtualNetworkGatewaysClient) GeneratevpnclientpackageThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) error { - result, err := c.Generatevpnclientpackage(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Generatevpnclientpackage: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Generatevpnclientpackage: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnprofile.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnprofile.go deleted file mode 100644 index 3b9f9f9815e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_generatevpnprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 GenerateVpnProfileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// GenerateVpnProfile ... -func (c VirtualNetworkGatewaysClient) GenerateVpnProfile(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) (result GenerateVpnProfileOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generatevpnprofile", 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 -} - -// GenerateVpnProfileThenPoll performs GenerateVpnProfile then polls until it's completed -func (c VirtualNetworkGatewaysClient) GenerateVpnProfileThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientParameters) error { - result, err := c.GenerateVpnProfile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing GenerateVpnProfile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GenerateVpnProfile: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_get.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_get.go deleted file mode 100644 index 0f42a04cd89..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkgateways - -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 *VirtualNetworkGateway -} - -// Get ... -func (c VirtualNetworkGatewaysClient) Get(ctx context.Context, id VirtualNetworkGatewayId) (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 VirtualNetworkGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getadvertisedroutes.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getadvertisedroutes.go deleted file mode 100644 index 81a82f3fee4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getadvertisedroutes.go +++ /dev/null @@ -1,99 +0,0 @@ -package virtualnetworkgateways - -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 GetAdvertisedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GatewayRouteListResult -} - -type GetAdvertisedRoutesOperationOptions struct { - Peer *string -} - -func DefaultGetAdvertisedRoutesOperationOptions() GetAdvertisedRoutesOperationOptions { - return GetAdvertisedRoutesOperationOptions{} -} - -func (o GetAdvertisedRoutesOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetAdvertisedRoutesOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetAdvertisedRoutesOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Peer != nil { - out.Append("peer", fmt.Sprintf("%v", *o.Peer)) - } - return &out -} - -// GetAdvertisedRoutes ... -func (c VirtualNetworkGatewaysClient) GetAdvertisedRoutes(ctx context.Context, id VirtualNetworkGatewayId, options GetAdvertisedRoutesOperationOptions) (result GetAdvertisedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getAdvertisedRoutes", id.ID()), - OptionsObject: options, - } - - 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 -} - -// GetAdvertisedRoutesThenPoll performs GetAdvertisedRoutes then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetAdvertisedRoutesThenPoll(ctx context.Context, id VirtualNetworkGatewayId, options GetAdvertisedRoutesOperationOptions) error { - result, err := c.GetAdvertisedRoutes(ctx, id, options) - if err != nil { - return fmt.Errorf("performing GetAdvertisedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetAdvertisedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getbgppeerstatus.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getbgppeerstatus.go deleted file mode 100644 index f8e0d0d0aae..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getbgppeerstatus.go +++ /dev/null @@ -1,99 +0,0 @@ -package virtualnetworkgateways - -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 GetBgpPeerStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BgpPeerStatusListResult -} - -type GetBgpPeerStatusOperationOptions struct { - Peer *string -} - -func DefaultGetBgpPeerStatusOperationOptions() GetBgpPeerStatusOperationOptions { - return GetBgpPeerStatusOperationOptions{} -} - -func (o GetBgpPeerStatusOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetBgpPeerStatusOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetBgpPeerStatusOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Peer != nil { - out.Append("peer", fmt.Sprintf("%v", *o.Peer)) - } - return &out -} - -// GetBgpPeerStatus ... -func (c VirtualNetworkGatewaysClient) GetBgpPeerStatus(ctx context.Context, id VirtualNetworkGatewayId, options GetBgpPeerStatusOperationOptions) (result GetBgpPeerStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getBgpPeerStatus", id.ID()), - OptionsObject: options, - } - - 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 -} - -// GetBgpPeerStatusThenPoll performs GetBgpPeerStatus then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetBgpPeerStatusThenPoll(ctx context.Context, id VirtualNetworkGatewayId, options GetBgpPeerStatusOperationOptions) error { - result, err := c.GetBgpPeerStatus(ctx, id, options) - if err != nil { - return fmt.Errorf("performing GetBgpPeerStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetBgpPeerStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getlearnedroutes.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getlearnedroutes.go deleted file mode 100644 index 3cfd0aa16a8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getlearnedroutes.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 GetLearnedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *GatewayRouteListResult -} - -// GetLearnedRoutes ... -func (c VirtualNetworkGatewaysClient) GetLearnedRoutes(ctx context.Context, id VirtualNetworkGatewayId) (result GetLearnedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getLearnedRoutes", 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 -} - -// GetLearnedRoutesThenPoll performs GetLearnedRoutes then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetLearnedRoutesThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetLearnedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing GetLearnedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetLearnedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go deleted file mode 100644 index 8b7f93d0b5c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientconnectionhealth.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 GetVpnclientConnectionHealthOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnClientConnectionHealthDetailListResult -} - -// GetVpnclientConnectionHealth ... -func (c VirtualNetworkGatewaysClient) GetVpnclientConnectionHealth(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnclientConnectionHealthOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getVpnClientConnectionHealth", 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 -} - -// GetVpnclientConnectionHealthThenPoll performs GetVpnclientConnectionHealth then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnclientConnectionHealthThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnclientConnectionHealth(ctx, id) - if err != nil { - return fmt.Errorf("performing GetVpnclientConnectionHealth: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnclientConnectionHealth: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go deleted file mode 100644 index 43dd02230df..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnclientipsecparameters.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualnetworkgateways - -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 GetVpnclientIPsecParametersOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnClientIPsecParameters -} - -// GetVpnclientIPsecParameters ... -func (c VirtualNetworkGatewaysClient) GetVpnclientIPsecParameters(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnclientIPsecParametersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getvpnclientipsecparameters", 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 -} - -// GetVpnclientIPsecParametersThenPoll performs GetVpnclientIPsecParameters then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnclientIPsecParametersThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnclientIPsecParameters(ctx, id) - if err != nil { - return fmt.Errorf("performing GetVpnclientIPsecParameters: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnclientIPsecParameters: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go deleted file mode 100644 index c247730a0c5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_getvpnprofilepackageurl.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 GetVpnProfilePackageUrlOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// GetVpnProfilePackageUrl ... -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrl(ctx context.Context, id VirtualNetworkGatewayId) (result GetVpnProfilePackageUrlOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getvpnprofilepackageurl", 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 -} - -// GetVpnProfilePackageUrlThenPoll performs GetVpnProfilePackageUrl then polls until it's completed -func (c VirtualNetworkGatewaysClient) GetVpnProfilePackageUrlThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.GetVpnProfilePackageUrl(ctx, id) - if err != nil { - return fmt.Errorf("performing GetVpnProfilePackageUrl: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after GetVpnProfilePackageUrl: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_list.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_list.go deleted file mode 100644 index 97a10fc1bcb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworkgateways - -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 *[]VirtualNetworkGateway -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGateway -} - -// List ... -func (c VirtualNetworkGatewaysClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworkGateways", 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 *[]VirtualNetworkGateway `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 VirtualNetworkGatewaysClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewaysClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkGatewayOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetworkGateway, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualnetworkgateways/method_listconnections.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_listconnections.go deleted file mode 100644 index d0c9c4be8be..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_listconnections.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualnetworkgateways - -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 ListConnectionsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkGatewayConnectionListEntity -} - -type ListConnectionsCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGatewayConnectionListEntity -} - -// ListConnections ... -func (c VirtualNetworkGatewaysClient) ListConnections(ctx context.Context, id VirtualNetworkGatewayId) (result ListConnectionsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/connections", 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 *[]VirtualNetworkGatewayConnectionListEntity `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListConnectionsComplete retrieves all the results into a single object -func (c VirtualNetworkGatewaysClient) ListConnectionsComplete(ctx context.Context, id VirtualNetworkGatewayId) (ListConnectionsCompleteResult, error) { - return c.ListConnectionsCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayConnectionListEntityOperationPredicate{}) -} - -// ListConnectionsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewaysClient) ListConnectionsCompleteMatchingPredicate(ctx context.Context, id VirtualNetworkGatewayId, predicate VirtualNetworkGatewayConnectionListEntityOperationPredicate) (result ListConnectionsCompleteResult, err error) { - items := make([]VirtualNetworkGatewayConnectionListEntity, 0) - - resp, err := c.ListConnections(ctx, id) - if err != nil { - 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 = ListConnectionsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_reset.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_reset.go deleted file mode 100644 index d766e3f0c62..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_reset.go +++ /dev/null @@ -1,99 +0,0 @@ -package virtualnetworkgateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGateway -} - -type ResetOperationOptions struct { - GatewayVip *string -} - -func DefaultResetOperationOptions() ResetOperationOptions { - return ResetOperationOptions{} -} - -func (o ResetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ResetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ResetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.GatewayVip != nil { - out.Append("gatewayVip", fmt.Sprintf("%v", *o.GatewayVip)) - } - return &out -} - -// Reset ... -func (c VirtualNetworkGatewaysClient) Reset(ctx context.Context, id VirtualNetworkGatewayId, options ResetOperationOptions) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", id.ID()), - OptionsObject: options, - } - - 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c VirtualNetworkGatewaysClient) ResetThenPoll(ctx context.Context, id VirtualNetworkGatewayId, options ResetOperationOptions) error { - result, err := c.Reset(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go deleted file mode 100644 index 3e10b92aa05..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_resetvpnclientsharedkey.go +++ /dev/null @@ -1,70 +0,0 @@ -package virtualnetworkgateways - -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 ResetVpnClientSharedKeyOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetVpnClientSharedKey ... -func (c VirtualNetworkGatewaysClient) ResetVpnClientSharedKey(ctx context.Context, id VirtualNetworkGatewayId) (result ResetVpnClientSharedKeyOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetvpnclientsharedkey", 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 -} - -// ResetVpnClientSharedKeyThenPoll performs ResetVpnClientSharedKey then polls until it's completed -func (c VirtualNetworkGatewaysClient) ResetVpnClientSharedKeyThenPoll(ctx context.Context, id VirtualNetworkGatewayId) error { - result, err := c.ResetVpnClientSharedKey(ctx, id) - if err != nil { - return fmt.Errorf("performing ResetVpnClientSharedKey: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetVpnClientSharedKey: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go deleted file mode 100644 index c6ce6809b83..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_setvpnclientipsecparameters.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 SetVpnclientIPsecParametersOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnClientIPsecParameters -} - -// SetVpnclientIPsecParameters ... -func (c VirtualNetworkGatewaysClient) SetVpnclientIPsecParameters(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientIPsecParameters) (result SetVpnclientIPsecParametersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/setvpnclientipsecparameters", 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 -} - -// SetVpnclientIPsecParametersThenPoll performs SetVpnclientIPsecParameters then polls until it's completed -func (c VirtualNetworkGatewaysClient) SetVpnclientIPsecParametersThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnClientIPsecParameters) error { - result, err := c.SetVpnclientIPsecParameters(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SetVpnclientIPsecParameters: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SetVpnclientIPsecParameters: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_startpacketcapture.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_startpacketcapture.go deleted file mode 100644 index 6aae280247b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_startpacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 StartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StartPacketCapture ... -func (c VirtualNetworkGatewaysClient) StartPacketCapture(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStartParameters) (result StartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startPacketCapture", 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 -} - -// StartPacketCaptureThenPoll performs StartPacketCapture then polls until it's completed -func (c VirtualNetworkGatewaysClient) StartPacketCaptureThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStartParameters) error { - result, err := c.StartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_stoppacketcapture.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_stoppacketcapture.go deleted file mode 100644 index b193430e431..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_stoppacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 StopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StopPacketCapture ... -func (c VirtualNetworkGatewaysClient) StopPacketCapture(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStopParameters) (result StopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stopPacketCapture", 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 -} - -// StopPacketCaptureThenPoll performs StopPacketCapture then polls until it's completed -func (c VirtualNetworkGatewaysClient) StopPacketCaptureThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input VpnPacketCaptureStopParameters) error { - result, err := c.StopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_supportedvpndevices.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_supportedvpndevices.go deleted file mode 100644 index c7d78912ab2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_supportedvpndevices.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualnetworkgateways - -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 SupportedVpnDevicesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// SupportedVpnDevices ... -func (c VirtualNetworkGatewaysClient) SupportedVpnDevices(ctx context.Context, id VirtualNetworkGatewayId) (result SupportedVpnDevicesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/supportedvpndevices", 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 string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_updatetags.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_updatetags.go deleted file mode 100644 index a374667f9a3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGateway -} - -// UpdateTags ... -func (c VirtualNetworkGatewaysClient) UpdateTags(ctx context.Context, id VirtualNetworkGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c VirtualNetworkGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id VirtualNetworkGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go deleted file mode 100644 index b68cd3bf17c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesCreateOrUpdate ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesCreateOrUpdate(ctx context.Context, id VirtualNetworkGatewayNatRuleId, input VirtualNetworkGatewayNatRule) (result VirtualNetworkGatewayNatRulesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll performs VirtualNetworkGatewayNatRulesCreateOrUpdate then polls until it's completed -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesCreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkGatewayNatRuleId, input VirtualNetworkGatewayNatRule) error { - result, err := c.VirtualNetworkGatewayNatRulesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualNetworkGatewayNatRulesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualNetworkGatewayNatRulesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go deleted file mode 100644 index 4d041050bd2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualNetworkGatewayNatRulesDelete ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesDelete(ctx context.Context, id VirtualNetworkGatewayNatRuleId) (result VirtualNetworkGatewayNatRulesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualNetworkGatewayNatRulesDeleteThenPoll performs VirtualNetworkGatewayNatRulesDelete then polls until it's completed -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesDeleteThenPoll(ctx context.Context, id VirtualNetworkGatewayNatRuleId) error { - result, err := c.VirtualNetworkGatewayNatRulesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualNetworkGatewayNatRulesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualNetworkGatewayNatRulesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go deleted file mode 100644 index 8347acb37cd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesGet ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesGet(ctx context.Context, id VirtualNetworkGatewayNatRuleId) (result VirtualNetworkGatewayNatRulesGetOperationResponse, 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 VirtualNetworkGatewayNatRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go deleted file mode 100644 index 3ec76975ae7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_virtualnetworkgatewaynatruleslistbyvirtualnetworkgateway.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualnetworkgateways - -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 VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkGatewayNatRule -} - -type VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkGatewayNatRule -} - -// VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway ... -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx context.Context, id VirtualNetworkGatewayId) (result VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/natRules", 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 *[]VirtualNetworkGatewayNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete retrieves all the results into a single object -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayComplete(ctx context.Context, id VirtualNetworkGatewayId) (VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult, error) { - return c.VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteMatchingPredicate(ctx, id, VirtualNetworkGatewayNatRuleOperationPredicate{}) -} - -// VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkGatewaysClient) VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteMatchingPredicate(ctx context.Context, id VirtualNetworkGatewayId, predicate VirtualNetworkGatewayNatRuleOperationPredicate) (result VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult, err error) { - items := make([]VirtualNetworkGatewayNatRule, 0) - - resp, err := c.VirtualNetworkGatewayNatRulesListByVirtualNetworkGateway(ctx, id) - if err != nil { - 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 = VirtualNetworkGatewayNatRulesListByVirtualNetworkGatewayCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go deleted file mode 100644 index b2673932149..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/method_vpndeviceconfigurationscript.go +++ /dev/null @@ -1,59 +0,0 @@ -package virtualnetworkgateways - -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 VpnDeviceConfigurationScriptOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnDeviceConfigurationScript ... -func (c VirtualNetworkGatewaysClient) VpnDeviceConfigurationScript(ctx context.Context, id ConnectionId, input VpnDeviceScriptParameters) (result VpnDeviceConfigurationScriptOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/vpndeviceconfigurationscript", 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 string - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_addressspace.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_addressspace.go deleted file mode 100644 index 8ec4b3f0b7d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatus.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatus.go deleted file mode 100644 index 8b54be7d7ae..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatus.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpPeerStatus struct { - Asn *int64 `json:"asn,omitempty"` - ConnectedDuration *string `json:"connectedDuration,omitempty"` - LocalAddress *string `json:"localAddress,omitempty"` - MessagesReceived *int64 `json:"messagesReceived,omitempty"` - MessagesSent *int64 `json:"messagesSent,omitempty"` - Neighbor *string `json:"neighbor,omitempty"` - RoutesReceived *int64 `json:"routesReceived,omitempty"` - State *BgpPeerState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go deleted file mode 100644 index 4affff1a309..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgppeerstatuslistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpPeerStatusListResult struct { - Value *[]BgpPeerStatus `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgpsettings.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgpsettings.go deleted file mode 100644 index 38b1165bfa1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 6bb7f5aa055..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroute.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroute.go deleted file mode 100644 index 038e61f22d3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroute.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayRoute struct { - AsPath *string `json:"asPath,omitempty"` - LocalAddress *string `json:"localAddress,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Origin *string `json:"origin,omitempty"` - SourcePeer *string `json:"sourcePeer,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroutelistresult.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroutelistresult.go deleted file mode 100644 index d0ab95ca8fb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_gatewayroutelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayRouteListResult struct { - Value *[]GatewayRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index bfda111f40f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipsecpolicy.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipsecpolicy.go deleted file mode 100644 index 6db4ac44425..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go deleted file mode 100644 index dafc643bcef..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_p2svpnconnectionrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnConnectionRequest struct { - VpnConnectionIds *[]string `json:"vpnConnectionIds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_radiusserver.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_radiusserver.go deleted file mode 100644 index eb891246991..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_subresource.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_subresource.go deleted file mode 100644 index 5e20a09efb4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_tagsobject.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_tagsobject.go deleted file mode 100644 index 1208ffee7eb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// 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/network/2023-06-01/virtualnetworkgateways/model_trafficselectorpolicy.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_trafficselectorpolicy.go deleted file mode 100644 index 6dbeefcf439..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_tunnelconnectionhealth.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_tunnelconnectionhealth.go deleted file mode 100644 index 786b8730363..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_tunnelconnectionhealth.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TunnelConnectionHealth struct { - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - LastConnectionEstablishedUtcTime *string `json:"lastConnectionEstablishedUtcTime,omitempty"` - Tunnel *string `json:"tunnel,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go deleted file mode 100644 index f9ddd43a0b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkconnectiongatewayreference.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkConnectionGatewayReference struct { - Id string `json:"id"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgateway.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgateway.go deleted file mode 100644 index 0bd39843684..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgateway.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworkgateways - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGateway struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go deleted file mode 100644 index ba8082fea07..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscalebounds.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleBounds struct { - Max *int64 `json:"max,omitempty"` - Min *int64 `json:"min,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go deleted file mode 100644 index c2bf005d067..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayAutoScaleConfiguration struct { - Bounds *VirtualNetworkGatewayAutoScaleBounds `json:"bounds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go deleted file mode 100644 index fc88052ded9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentity.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionListEntity struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties VirtualNetworkGatewayConnectionListEntityPropertiesFormat `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go deleted file mode 100644 index ad063d3db47..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayconnectionlistentitypropertiesformat.go +++ /dev/null @@ -1,30 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayConnectionListEntityPropertiesFormat struct { - AuthorizationKey *string `json:"authorizationKey,omitempty"` - ConnectionMode *VirtualNetworkGatewayConnectionMode `json:"connectionMode,omitempty"` - ConnectionProtocol *VirtualNetworkGatewayConnectionProtocol `json:"connectionProtocol,omitempty"` - ConnectionStatus *VirtualNetworkGatewayConnectionStatus `json:"connectionStatus,omitempty"` - ConnectionType VirtualNetworkGatewayConnectionType `json:"connectionType"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnablePrivateLinkFastPath *bool `json:"enablePrivateLinkFastPath,omitempty"` - ExpressRouteGatewayBypass *bool `json:"expressRouteGatewayBypass,omitempty"` - GatewayCustomBgpIPAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"gatewayCustomBgpIpAddresses,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - LocalNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"localNetworkGateway2,omitempty"` - Peer *SubResource `json:"peer,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - TunnelConnectionStatus *[]TunnelConnectionHealth `json:"tunnelConnectionStatus,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VirtualNetworkGateway1 VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway1"` - VirtualNetworkGateway2 *VirtualNetworkConnectionGatewayReference `json:"virtualNetworkGateway2,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go deleted file mode 100644 index b0f988e9a2c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index f4396964e0a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go deleted file mode 100644 index f8d6791d170..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go deleted file mode 100644 index 6227a89e253..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaynatruleproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayNatRuleProperties struct { - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go deleted file mode 100644 index ebd198d261e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkGatewayPolicyGroupProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go deleted file mode 100644 index 466e643ddd8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go deleted file mode 100644 index ab108714ff3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPolicyGroupProperties struct { - IsDefault bool `json:"isDefault"` - PolicyMembers []VirtualNetworkGatewayPolicyGroupMember `json:"policyMembers"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VngClientConnectionConfigurations *[]SubResource `json:"vngClientConnectionConfigurations,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go deleted file mode 100644 index 3f13bf8bcf6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaypropertiesformat.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayPropertiesFormat struct { - ActiveActive *bool `json:"activeActive,omitempty"` - AdminState *AdminState `json:"adminState,omitempty"` - AllowRemoteVnetTraffic *bool `json:"allowRemoteVnetTraffic,omitempty"` - AllowVirtualWanTraffic *bool `json:"allowVirtualWanTraffic,omitempty"` - AutoScaleConfiguration *VirtualNetworkGatewayAutoScaleConfiguration `json:"autoScaleConfiguration,omitempty"` - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - CustomRoutes *AddressSpace `json:"customRoutes,omitempty"` - DisableIPSecReplayProtection *bool `json:"disableIPSecReplayProtection,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - EnableDnsForwarding *bool `json:"enableDnsForwarding,omitempty"` - EnablePrivateIPAddress *bool `json:"enablePrivateIpAddress,omitempty"` - GatewayDefaultSite *SubResource `json:"gatewayDefaultSite,omitempty"` - GatewayType *VirtualNetworkGatewayType `json:"gatewayType,omitempty"` - IPConfigurations *[]VirtualNetworkGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - InboundDnsForwardingEndpoint *string `json:"inboundDnsForwardingEndpoint,omitempty"` - NatRules *[]VirtualNetworkGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Sku *VirtualNetworkGatewaySku `json:"sku,omitempty"` - VNetExtendedLocationResourceId *string `json:"vNetExtendedLocationResourceId,omitempty"` - VirtualNetworkGatewayPolicyGroups *[]VirtualNetworkGatewayPolicyGroup `json:"virtualNetworkGatewayPolicyGroups,omitempty"` - VpnClientConfiguration *VpnClientConfiguration `json:"vpnClientConfiguration,omitempty"` - VpnGatewayGeneration *VpnGatewayGeneration `json:"vpnGatewayGeneration,omitempty"` - VpnType *VpnType `json:"vpnType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go deleted file mode 100644 index b96386d7651..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_virtualnetworkgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *VirtualNetworkGatewaySkuName `json:"name,omitempty"` - Tier *VirtualNetworkGatewaySkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go deleted file mode 100644 index 44c61c02167..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VngClientConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go deleted file mode 100644 index 8bf37c29734..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vngclientconnectionconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VngClientConnectionConfigurationProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkGatewayPolicyGroups []SubResource `json:"virtualNetworkGatewayPolicyGroups"` - VpnClientAddressPool AddressSpace `json:"vpnClientAddressPool"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconfiguration.go deleted file mode 100644 index 947582e3da9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconfiguration.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConfiguration struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VngClientConnectionConfigurations *[]VngClientConnectionConfiguration `json:"vngClientConnectionConfigurations,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientProtocols *[]VpnClientProtocol `json:"vpnClientProtocols,omitempty"` - VpnClientRevokedCertificates *[]VpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go deleted file mode 100644 index c1bd5bd01b8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetail.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealthDetail struct { - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressPacketsTransferred *int64 `json:"egressPacketsTransferred,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressPacketsTransferred *int64 `json:"ingressPacketsTransferred,omitempty"` - MaxBandwidth *int64 `json:"maxBandwidth,omitempty"` - MaxPacketsPerSecond *int64 `json:"maxPacketsPerSecond,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - VpnConnectionDuration *int64 `json:"vpnConnectionDuration,omitempty"` - VpnConnectionId *string `json:"vpnConnectionId,omitempty"` - VpnConnectionTime *string `json:"vpnConnectionTime,omitempty"` - VpnUserName *string `json:"vpnUserName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go deleted file mode 100644 index d0c7c1a3f22..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientconnectionhealthdetaillistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealthDetailListResult struct { - Value *[]VpnClientConnectionHealthDetail `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientipsecparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientipsecparameters.go deleted file mode 100644 index d972e45d72e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientipsecparameters.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientIPsecParameters struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientparameters.go deleted file mode 100644 index dbfa84e1c67..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientparameters.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientParameters struct { - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` - ClientRootCertificates *[]string `json:"clientRootCertificates,omitempty"` - ProcessorArchitecture *ProcessorArchitecture `json:"processorArchitecture,omitempty"` - RadiusServerAuthCertificate *string `json:"radiusServerAuthCertificate,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go deleted file mode 100644 index 2151e3bf02b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnClientRevokedCertificatePropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go deleted file mode 100644 index 9a5fb25ca9b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrevokedcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRevokedCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificate.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificate.go deleted file mode 100644 index db4850a95ff..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificate.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties VpnClientRootCertificatePropertiesFormat `json:"properties"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go deleted file mode 100644 index 4a44a811b2a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnclientrootcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientRootCertificatePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData string `json:"publicCertData"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpndevicescriptparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpndevicescriptparameters.go deleted file mode 100644 index 61ec4f46b54..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpndevicescriptparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnDeviceScriptParameters struct { - DeviceFamily *string `json:"deviceFamily,omitempty"` - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnnatrulemapping.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnnatrulemapping.go deleted file mode 100644 index d903f625a58..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go deleted file mode 100644 index 014f699e436..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestartparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go deleted file mode 100644 index 091426a3451..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/model_vpnpacketcapturestopparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkgateways/predicates.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/predicates.go deleted file mode 100644 index e03cad8f7b6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/predicates.go +++ /dev/null @@ -1,98 +0,0 @@ -package virtualnetworkgateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayOperationPredicate) Matches(input VirtualNetworkGateway) 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 && (input.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 VirtualNetworkGatewayConnectionListEntityOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayConnectionListEntityOperationPredicate) Matches(input VirtualNetworkGatewayConnectionListEntity) 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 && (input.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 VirtualNetworkGatewayNatRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualNetworkGatewayNatRuleOperationPredicate) Matches(input VirtualNetworkGatewayNatRule) 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.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/network/2023-06-01/virtualnetworkgateways/version.go b/resource-manager/network/2023-06-01/virtualnetworkgateways/version.go deleted file mode 100644 index 022449f66fd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkgateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkgateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkgateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/README.md b/resource-manager/network/2023-06-01/virtualnetworkpeerings/README.md deleted file mode 100644 index fc60d25caf8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworkpeerings` Documentation - -The `virtualnetworkpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualnetworkpeerings" -``` - - -### Client Initialization - -```go -client := virtualnetworkpeerings.NewVirtualNetworkPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -payload := virtualnetworkpeerings.VirtualNetworkPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload, virtualnetworkpeerings.DefaultCreateOrUpdateOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkPeeringsClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworkpeerings.NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - -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: `VirtualNetworkPeeringsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// 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/network/2023-06-01/virtualnetworkpeerings/client.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/client.go deleted file mode 100644 index 8eb7455514c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworkpeerings - -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 VirtualNetworkPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworkpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkPeeringsClient: %+v", err) - } - - return &VirtualNetworkPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/constants.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/constants.go deleted file mode 100644 index 0cb41da70fc..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/constants.go +++ /dev/null @@ -1,227 +0,0 @@ -package virtualnetworkpeerings - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type SyncRemoteAddressSpace string - -const ( - SyncRemoteAddressSpaceTrue SyncRemoteAddressSpace = "true" -) - -func PossibleValuesForSyncRemoteAddressSpace() []string { - return []string{ - string(SyncRemoteAddressSpaceTrue), - } -} - -func (s *SyncRemoteAddressSpace) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncRemoteAddressSpace(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncRemoteAddressSpace(input string) (*SyncRemoteAddressSpace, error) { - vals := map[string]SyncRemoteAddressSpace{ - "true": SyncRemoteAddressSpaceTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncRemoteAddressSpace(input) - return &out, nil -} - -type VirtualNetworkEncryptionEnforcement string - -const ( - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -func PossibleValuesForVirtualNetworkEncryptionEnforcement() []string { - return []string{ - string(VirtualNetworkEncryptionEnforcementAllowUnencrypted), - string(VirtualNetworkEncryptionEnforcementDropUnencrypted), - } -} - -func (s *VirtualNetworkEncryptionEnforcement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkEncryptionEnforcement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkEncryptionEnforcement(input string) (*VirtualNetworkEncryptionEnforcement, error) { - vals := map[string]VirtualNetworkEncryptionEnforcement{ - "allowunencrypted": VirtualNetworkEncryptionEnforcementAllowUnencrypted, - "dropunencrypted": VirtualNetworkEncryptionEnforcementDropUnencrypted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkEncryptionEnforcement(input) - return &out, nil -} - -type VirtualNetworkPeeringLevel string - -const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -func PossibleValuesForVirtualNetworkPeeringLevel() []string { - return []string{ - string(VirtualNetworkPeeringLevelFullyInSync), - string(VirtualNetworkPeeringLevelLocalAndRemoteNotInSync), - string(VirtualNetworkPeeringLevelLocalNotInSync), - string(VirtualNetworkPeeringLevelRemoteNotInSync), - } -} - -func (s *VirtualNetworkPeeringLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringLevel(input string) (*VirtualNetworkPeeringLevel, error) { - vals := map[string]VirtualNetworkPeeringLevel{ - "fullyinsync": VirtualNetworkPeeringLevelFullyInSync, - "localandremotenotinsync": VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, - "localnotinsync": VirtualNetworkPeeringLevelLocalNotInSync, - "remotenotinsync": VirtualNetworkPeeringLevelRemoteNotInSync, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringLevel(input) - return &out, nil -} - -type VirtualNetworkPeeringState string - -const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -func PossibleValuesForVirtualNetworkPeeringState() []string { - return []string{ - string(VirtualNetworkPeeringStateConnected), - string(VirtualNetworkPeeringStateDisconnected), - string(VirtualNetworkPeeringStateInitiated), - } -} - -func (s *VirtualNetworkPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringState(input string) (*VirtualNetworkPeeringState, error) { - vals := map[string]VirtualNetworkPeeringState{ - "connected": VirtualNetworkPeeringStateConnected, - "disconnected": VirtualNetworkPeeringStateDisconnected, - "initiated": VirtualNetworkPeeringStateInitiated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering.go deleted file mode 100644 index a72d63bb3a5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualnetworkpeerings - -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(&VirtualNetworkPeeringId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkPeeringId{} - -// VirtualNetworkPeeringId is a struct representing the Resource ID for a Virtual Network Peering -type VirtualNetworkPeeringId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkName string - VirtualNetworkPeeringName string -} - -// NewVirtualNetworkPeeringID returns a new VirtualNetworkPeeringId struct -func NewVirtualNetworkPeeringID(subscriptionId string, resourceGroupName string, virtualNetworkName string, virtualNetworkPeeringName string) VirtualNetworkPeeringId { - return VirtualNetworkPeeringId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkName: virtualNetworkName, - VirtualNetworkPeeringName: virtualNetworkPeeringName, - } -} - -// ParseVirtualNetworkPeeringID parses 'input' into a VirtualNetworkPeeringId -func ParseVirtualNetworkPeeringID(input string) (*VirtualNetworkPeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkPeeringId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkPeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkPeeringIDInsensitively parses 'input' case-insensitively into a VirtualNetworkPeeringId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkPeeringIDInsensitively(input string) (*VirtualNetworkPeeringId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkPeeringId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkPeeringId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkPeeringId) 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.VirtualNetworkName, ok = input.Parsed["virtualNetworkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkName", input) - } - - if id.VirtualNetworkPeeringName, ok = input.Parsed["virtualNetworkPeeringName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkPeeringName", input) - } - - return nil -} - -// ValidateVirtualNetworkPeeringID checks that 'input' can be parsed as a Virtual Network Peering ID -func ValidateVirtualNetworkPeeringID(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 := ParseVirtualNetworkPeeringID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Peering ID -func (id VirtualNetworkPeeringId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworks/%s/virtualNetworkPeerings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkName, id.VirtualNetworkPeeringName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Peering ID -func (id VirtualNetworkPeeringId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworks", "virtualNetworks", "virtualNetworks"), - resourceids.UserSpecifiedSegment("virtualNetworkName", "virtualNetworkValue"), - resourceids.StaticSegment("staticVirtualNetworkPeerings", "virtualNetworkPeerings", "virtualNetworkPeerings"), - resourceids.UserSpecifiedSegment("virtualNetworkPeeringName", "virtualNetworkPeeringValue"), - } -} - -// String returns a human-readable description of this Virtual Network Peering ID -func (id VirtualNetworkPeeringId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Name: %q", id.VirtualNetworkName), - fmt.Sprintf("Virtual Network Peering Name: %q", id.VirtualNetworkPeeringName), - } - return fmt.Sprintf("Virtual Network Peering (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go deleted file mode 100644 index 9580241575f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/id_virtualnetworkpeering_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualnetworkpeerings - -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 = &VirtualNetworkPeeringId{} - -func TestNewVirtualNetworkPeeringID(t *testing.T) { - id := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue") - - 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.VirtualNetworkName != "virtualNetworkValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkName'", id.VirtualNetworkName, "virtualNetworkValue") - } - - if id.VirtualNetworkPeeringName != "virtualNetworkPeeringValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkPeeringName'", id.VirtualNetworkPeeringName, "virtualNetworkPeeringValue") - } -} - -func TestFormatVirtualNetworkPeeringID(t *testing.T) { - actual := NewVirtualNetworkPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "virtualNetworkPeeringValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkPeeringID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkPeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue", - Expected: &VirtualNetworkPeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkName: "virtualNetworkValue", - VirtualNetworkPeeringName: "virtualNetworkPeeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkPeeringID(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.VirtualNetworkName != v.Expected.VirtualNetworkName { - t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) - } - - if actual.VirtualNetworkPeeringName != v.Expected.VirtualNetworkPeeringName { - t.Fatalf("Expected %q but got %q for VirtualNetworkPeeringName", v.Expected.VirtualNetworkPeeringName, actual.VirtualNetworkPeeringName) - } - - } -} - -func TestParseVirtualNetworkPeeringIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkPeeringId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/vIrTuAlNeTwOrKpEeRiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue", - Expected: &VirtualNetworkPeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkName: "virtualNetworkValue", - VirtualNetworkPeeringName: "virtualNetworkPeeringValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworks/virtualNetworkValue/virtualNetworkPeerings/virtualNetworkPeeringValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgVaLuE", - Expected: &VirtualNetworkPeeringId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkName: "vIrTuAlNeTwOrKvAlUe", - VirtualNetworkPeeringName: "vIrTuAlNeTwOrKpEeRiNgVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKs/vIrTuAlNeTwOrKvAlUe/vIrTuAlNeTwOrKpEeRiNgS/vIrTuAlNeTwOrKpEeRiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkPeeringIDInsensitively(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.VirtualNetworkName != v.Expected.VirtualNetworkName { - t.Fatalf("Expected %q but got %q for VirtualNetworkName", v.Expected.VirtualNetworkName, actual.VirtualNetworkName) - } - - if actual.VirtualNetworkPeeringName != v.Expected.VirtualNetworkPeeringName { - t.Fatalf("Expected %q but got %q for VirtualNetworkPeeringName", v.Expected.VirtualNetworkPeeringName, actual.VirtualNetworkPeeringName) - } - - } -} - -func TestSegmentsForVirtualNetworkPeeringId(t *testing.T) { - segments := VirtualNetworkPeeringId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkPeeringId 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/network/2023-06-01/virtualnetworkpeerings/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_createorupdate.go deleted file mode 100644 index e7fcc91436e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_createorupdate.go +++ /dev/null @@ -1,103 +0,0 @@ -package virtualnetworkpeerings - -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 *VirtualNetworkPeering -} - -type CreateOrUpdateOperationOptions struct { - SyncRemoteAddressSpace *SyncRemoteAddressSpace -} - -func DefaultCreateOrUpdateOperationOptions() CreateOrUpdateOperationOptions { - return CreateOrUpdateOperationOptions{} -} - -func (o CreateOrUpdateOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o CreateOrUpdateOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o CreateOrUpdateOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.SyncRemoteAddressSpace != nil { - out.Append("syncRemoteAddressSpace", fmt.Sprintf("%v", *o.SyncRemoteAddressSpace)) - } - return &out -} - -// CreateOrUpdate ... -func (c VirtualNetworkPeeringsClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkPeeringId, input VirtualNetworkPeering, options CreateOrUpdateOperationOptions) (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(), - OptionsObject: options, - } - - 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 VirtualNetworkPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkPeeringId, input VirtualNetworkPeering, 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/network/2023-06-01/virtualnetworkpeerings/method_delete.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_delete.go deleted file mode 100644 index 0d0ded252a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworkpeerings - -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 VirtualNetworkPeeringsClient) Delete(ctx context.Context, id VirtualNetworkPeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkPeeringsClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkPeeringId) 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/network/2023-06-01/virtualnetworkpeerings/method_get.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_get.go deleted file mode 100644 index 81671aa625e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworkpeerings - -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 *VirtualNetworkPeering -} - -// Get ... -func (c VirtualNetworkPeeringsClient) Get(ctx context.Context, id VirtualNetworkPeeringId) (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 VirtualNetworkPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_list.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_list.go deleted file mode 100644 index 28614f5b07e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworkpeerings - -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 *[]VirtualNetworkPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkPeering -} - -// List ... -func (c VirtualNetworkPeeringsClient) List(ctx context.Context, id commonids.VirtualNetworkId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/virtualNetworkPeerings", 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 *[]VirtualNetworkPeering `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 VirtualNetworkPeeringsClient) ListComplete(ctx context.Context, id commonids.VirtualNetworkId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, predicate VirtualNetworkPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetworkPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualnetworkpeerings/model_addressspace.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_addressspace.go deleted file mode 100644 index dadfe5be0b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_subresource.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_subresource.go deleted file mode 100644 index 07cc63aadbb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go deleted file mode 100644 index a1302f81779..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkbgpcommunities.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkBgpCommunities struct { - RegionalCommunity *string `json:"regionalCommunity,omitempty"` - VirtualNetworkCommunity string `json:"virtualNetworkCommunity"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkencryption.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkencryption.go deleted file mode 100644 index 82989ac5992..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkencryption.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkEncryption struct { - Enabled bool `json:"enabled"` - Enforcement *VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeering.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeering.go deleted file mode 100644 index 4b0c5a50abf..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go deleted file mode 100644 index c7f9534bb15..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/model_virtualnetworkpeeringpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeeringPropertiesFormat struct { - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - DoNotVerifyRemoteGateways *bool `json:"doNotVerifyRemoteGateways,omitempty"` - PeeringState *VirtualNetworkPeeringState `json:"peeringState,omitempty"` - PeeringSyncLevel *VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` - RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworkpeerings/predicates.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/predicates.go deleted file mode 100644 index a945839e0b2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualnetworkpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualNetworkPeeringOperationPredicate) Matches(input VirtualNetworkPeering) 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.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/network/2023-06-01/virtualnetworkpeerings/version.go b/resource-manager/network/2023-06-01/virtualnetworkpeerings/version.go deleted file mode 100644 index d46e9044788..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworkpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworkpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworkpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/README.md b/resource-manager/network/2023-06-01/virtualnetworks/README.md deleted file mode 100644 index 6f5cda4e413..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/README.md +++ /dev/null @@ -1,239 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworks` Documentation - -The `virtualnetworks` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualnetworks" -``` - - -### Client Initialization - -```go -client := virtualnetworks.NewVirtualNetworksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := virtualnetworks.VirtualNetwork{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -read, err := client.Get(ctx, id, virtualnetworks.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworksClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `VirtualNetworksClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.ResourceNavigationLinksList` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -// alternatively `client.ResourceNavigationLinksList(ctx, id)` can be used to do batched pagination -items, err := client.ResourceNavigationLinksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.ServiceAssociationLinksList` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -// alternatively `client.ServiceAssociationLinksList(ctx, id)` can be used to do batched pagination -items, err := client.ServiceAssociationLinksListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.SubnetsPrepareNetworkPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := virtualnetworks.PrepareNetworkPoliciesRequest{ - // ... -} - - -if err := client.SubnetsPrepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.SubnetsUnprepareNetworkPolicies` - -```go -ctx := context.TODO() -id := commonids.NewSubnetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue", "subnetValue") - -payload := virtualnetworks.UnprepareNetworkPoliciesRequest{ - // ... -} - - -if err := client.SubnetsUnprepareNetworkPoliciesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworksClient.UpdateTags` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -payload := virtualnetworks.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 -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksCheckIPAddressAvailability` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -read, err := client.VirtualNetworksCheckIPAddressAvailability(ctx, id, virtualnetworks.DefaultVirtualNetworksCheckIPAddressAvailabilityOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksListDdosProtectionStatus` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// alternatively `client.VirtualNetworksListDdosProtectionStatus(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions())` can be used to do batched pagination -items, err := client.VirtualNetworksListDdosProtectionStatusComplete(ctx, id, virtualnetworks.DefaultVirtualNetworksListDdosProtectionStatusOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworksClient.VirtualNetworksListUsage` - -```go -ctx := context.TODO() -id := commonids.NewVirtualNetworkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkValue") - -// alternatively `client.VirtualNetworksListUsage(ctx, id)` can be used to do batched pagination -items, err := client.VirtualNetworksListUsageComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/virtualnetworks/client.go b/resource-manager/network/2023-06-01/virtualnetworks/client.go deleted file mode 100644 index 15c346279f6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworksClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworksClient: %+v", err) - } - - return &VirtualNetworksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/constants.go b/resource-manager/network/2023-06-01/virtualnetworks/constants.go deleted file mode 100644 index 785c3650439..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/constants.go +++ /dev/null @@ -1,1324 +0,0 @@ -package virtualnetworks - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IsWorkloadProtected string - -const ( - IsWorkloadProtectedFalse IsWorkloadProtected = "False" - IsWorkloadProtectedTrue IsWorkloadProtected = "True" -) - -func PossibleValuesForIsWorkloadProtected() []string { - return []string{ - string(IsWorkloadProtectedFalse), - string(IsWorkloadProtectedTrue), - } -} - -func (s *IsWorkloadProtected) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIsWorkloadProtected(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIsWorkloadProtected(input string) (*IsWorkloadProtected, error) { - vals := map[string]IsWorkloadProtected{ - "false": IsWorkloadProtectedFalse, - "true": IsWorkloadProtectedTrue, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IsWorkloadProtected(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkEncryptionEnforcement string - -const ( - VirtualNetworkEncryptionEnforcementAllowUnencrypted VirtualNetworkEncryptionEnforcement = "AllowUnencrypted" - VirtualNetworkEncryptionEnforcementDropUnencrypted VirtualNetworkEncryptionEnforcement = "DropUnencrypted" -) - -func PossibleValuesForVirtualNetworkEncryptionEnforcement() []string { - return []string{ - string(VirtualNetworkEncryptionEnforcementAllowUnencrypted), - string(VirtualNetworkEncryptionEnforcementDropUnencrypted), - } -} - -func (s *VirtualNetworkEncryptionEnforcement) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkEncryptionEnforcement(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkEncryptionEnforcement(input string) (*VirtualNetworkEncryptionEnforcement, error) { - vals := map[string]VirtualNetworkEncryptionEnforcement{ - "allowunencrypted": VirtualNetworkEncryptionEnforcementAllowUnencrypted, - "dropunencrypted": VirtualNetworkEncryptionEnforcementDropUnencrypted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkEncryptionEnforcement(input) - return &out, nil -} - -type VirtualNetworkPeeringLevel string - -const ( - VirtualNetworkPeeringLevelFullyInSync VirtualNetworkPeeringLevel = "FullyInSync" - VirtualNetworkPeeringLevelLocalAndRemoteNotInSync VirtualNetworkPeeringLevel = "LocalAndRemoteNotInSync" - VirtualNetworkPeeringLevelLocalNotInSync VirtualNetworkPeeringLevel = "LocalNotInSync" - VirtualNetworkPeeringLevelRemoteNotInSync VirtualNetworkPeeringLevel = "RemoteNotInSync" -) - -func PossibleValuesForVirtualNetworkPeeringLevel() []string { - return []string{ - string(VirtualNetworkPeeringLevelFullyInSync), - string(VirtualNetworkPeeringLevelLocalAndRemoteNotInSync), - string(VirtualNetworkPeeringLevelLocalNotInSync), - string(VirtualNetworkPeeringLevelRemoteNotInSync), - } -} - -func (s *VirtualNetworkPeeringLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringLevel(input string) (*VirtualNetworkPeeringLevel, error) { - vals := map[string]VirtualNetworkPeeringLevel{ - "fullyinsync": VirtualNetworkPeeringLevelFullyInSync, - "localandremotenotinsync": VirtualNetworkPeeringLevelLocalAndRemoteNotInSync, - "localnotinsync": VirtualNetworkPeeringLevelLocalNotInSync, - "remotenotinsync": VirtualNetworkPeeringLevelRemoteNotInSync, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringLevel(input) - return &out, nil -} - -type VirtualNetworkPeeringState string - -const ( - VirtualNetworkPeeringStateConnected VirtualNetworkPeeringState = "Connected" - VirtualNetworkPeeringStateDisconnected VirtualNetworkPeeringState = "Disconnected" - VirtualNetworkPeeringStateInitiated VirtualNetworkPeeringState = "Initiated" -) - -func PossibleValuesForVirtualNetworkPeeringState() []string { - return []string{ - string(VirtualNetworkPeeringStateConnected), - string(VirtualNetworkPeeringStateDisconnected), - string(VirtualNetworkPeeringStateInitiated), - } -} - -func (s *VirtualNetworkPeeringState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPeeringState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPeeringState(input string) (*VirtualNetworkPeeringState, error) { - vals := map[string]VirtualNetworkPeeringState{ - "connected": VirtualNetworkPeeringStateConnected, - "disconnected": VirtualNetworkPeeringStateDisconnected, - "initiated": VirtualNetworkPeeringStateInitiated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPeeringState(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualnetworks/method_createorupdate.go deleted file mode 100644 index fb27efb9d4b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualnetworks - -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 *VirtualNetwork -} - -// CreateOrUpdate ... -func (c VirtualNetworksClient) CreateOrUpdate(ctx context.Context, id commonids.VirtualNetworkId, input VirtualNetwork) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworksClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualNetworkId, input VirtualNetwork) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualnetworks/method_delete.go b/resource-manager/network/2023-06-01/virtualnetworks/method_delete.go deleted file mode 100644 index 53212cd5aba..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualnetworks - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c VirtualNetworksClient) Delete(ctx context.Context, id commonids.VirtualNetworkId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworksClient) DeleteThenPoll(ctx context.Context, id commonids.VirtualNetworkId) 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/network/2023-06-01/virtualnetworks/method_get.go b/resource-manager/network/2023-06-01/virtualnetworks/method_get.go deleted file mode 100644 index e40ab49ec8e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_get.go +++ /dev/null @@ -1,84 +0,0 @@ -package virtualnetworks - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetwork -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c VirtualNetworksClient) Get(ctx context.Context, id commonids.VirtualNetworkId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 VirtualNetwork - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_list.go b/resource-manager/network/2023-06-01/virtualnetworks/method_list.go deleted file mode 100644 index 692f238de2e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 *[]VirtualNetwork -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetwork -} - -// List ... -func (c VirtualNetworksClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworks", 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 *[]VirtualNetwork `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 VirtualNetworksClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualNetwork, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualnetworks/method_listall.go b/resource-manager/network/2023-06-01/virtualnetworks/method_listall.go deleted file mode 100644 index f66d7117c0c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetwork -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetwork -} - -// ListAll ... -func (c VirtualNetworksClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworks", 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 *[]VirtualNetwork `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c VirtualNetworksClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, VirtualNetworkOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]VirtualNetwork, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_resourcenavigationlinkslist.go b/resource-manager/network/2023-06-01/virtualnetworks/method_resourcenavigationlinkslist.go deleted file mode 100644 index 50c441b1608..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_resourcenavigationlinkslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 ResourceNavigationLinksListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ResourceNavigationLink -} - -type ResourceNavigationLinksListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ResourceNavigationLink -} - -// ResourceNavigationLinksList ... -func (c VirtualNetworksClient) ResourceNavigationLinksList(ctx context.Context, id commonids.SubnetId) (result ResourceNavigationLinksListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/resourceNavigationLinks", 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 *[]ResourceNavigationLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ResourceNavigationLinksListComplete retrieves all the results into a single object -func (c VirtualNetworksClient) ResourceNavigationLinksListComplete(ctx context.Context, id commonids.SubnetId) (ResourceNavigationLinksListCompleteResult, error) { - return c.ResourceNavigationLinksListCompleteMatchingPredicate(ctx, id, ResourceNavigationLinkOperationPredicate{}) -} - -// ResourceNavigationLinksListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ResourceNavigationLinksListCompleteMatchingPredicate(ctx context.Context, id commonids.SubnetId, predicate ResourceNavigationLinkOperationPredicate) (result ResourceNavigationLinksListCompleteResult, err error) { - items := make([]ResourceNavigationLink, 0) - - resp, err := c.ResourceNavigationLinksList(ctx, id) - if err != nil { - 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 = ResourceNavigationLinksListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_serviceassociationlinkslist.go b/resource-manager/network/2023-06-01/virtualnetworks/method_serviceassociationlinkslist.go deleted file mode 100644 index 33ee4ced254..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_serviceassociationlinkslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 ServiceAssociationLinksListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServiceAssociationLink -} - -type ServiceAssociationLinksListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServiceAssociationLink -} - -// ServiceAssociationLinksList ... -func (c VirtualNetworksClient) ServiceAssociationLinksList(ctx context.Context, id commonids.SubnetId) (result ServiceAssociationLinksListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/serviceAssociationLinks", 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 *[]ServiceAssociationLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ServiceAssociationLinksListComplete retrieves all the results into a single object -func (c VirtualNetworksClient) ServiceAssociationLinksListComplete(ctx context.Context, id commonids.SubnetId) (ServiceAssociationLinksListCompleteResult, error) { - return c.ServiceAssociationLinksListCompleteMatchingPredicate(ctx, id, ServiceAssociationLinkOperationPredicate{}) -} - -// ServiceAssociationLinksListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) ServiceAssociationLinksListCompleteMatchingPredicate(ctx context.Context, id commonids.SubnetId, predicate ServiceAssociationLinkOperationPredicate) (result ServiceAssociationLinksListCompleteResult, err error) { - items := make([]ServiceAssociationLink, 0) - - resp, err := c.ServiceAssociationLinksList(ctx, id) - if err != nil { - 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 = ServiceAssociationLinksListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_subnetspreparenetworkpolicies.go b/resource-manager/network/2023-06-01/virtualnetworks/method_subnetspreparenetworkpolicies.go deleted file mode 100644 index b42b121f904..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_subnetspreparenetworkpolicies.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworks - -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 SubnetsPrepareNetworkPoliciesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SubnetsPrepareNetworkPolicies ... -func (c VirtualNetworksClient) SubnetsPrepareNetworkPolicies(ctx context.Context, id commonids.SubnetId, input PrepareNetworkPoliciesRequest) (result SubnetsPrepareNetworkPoliciesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/prepareNetworkPolicies", 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 -} - -// SubnetsPrepareNetworkPoliciesThenPoll performs SubnetsPrepareNetworkPolicies then polls until it's completed -func (c VirtualNetworksClient) SubnetsPrepareNetworkPoliciesThenPoll(ctx context.Context, id commonids.SubnetId, input PrepareNetworkPoliciesRequest) error { - result, err := c.SubnetsPrepareNetworkPolicies(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SubnetsPrepareNetworkPolicies: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SubnetsPrepareNetworkPolicies: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go b/resource-manager/network/2023-06-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go deleted file mode 100644 index 69a0e33a2c8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_subnetsunpreparenetworkpolicies.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworks - -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 SubnetsUnprepareNetworkPoliciesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// SubnetsUnprepareNetworkPolicies ... -func (c VirtualNetworksClient) SubnetsUnprepareNetworkPolicies(ctx context.Context, id commonids.SubnetId, input UnprepareNetworkPoliciesRequest) (result SubnetsUnprepareNetworkPoliciesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/unprepareNetworkPolicies", 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 -} - -// SubnetsUnprepareNetworkPoliciesThenPoll performs SubnetsUnprepareNetworkPolicies then polls until it's completed -func (c VirtualNetworksClient) SubnetsUnprepareNetworkPoliciesThenPoll(ctx context.Context, id commonids.SubnetId, input UnprepareNetworkPoliciesRequest) error { - result, err := c.SubnetsUnprepareNetworkPolicies(ctx, id, input) - if err != nil { - return fmt.Errorf("performing SubnetsUnprepareNetworkPolicies: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after SubnetsUnprepareNetworkPolicies: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_updatetags.go b/resource-manager/network/2023-06-01/virtualnetworks/method_updatetags.go deleted file mode 100644 index 8e2d6ea92a2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_updatetags.go +++ /dev/null @@ -1,59 +0,0 @@ -package virtualnetworks - -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 UpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualNetwork -} - -// UpdateTags ... -func (c VirtualNetworksClient) UpdateTags(ctx context.Context, id commonids.VirtualNetworkId, 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 VirtualNetwork - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go b/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go deleted file mode 100644 index 85ba4d73ccd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkscheckipaddressavailability.go +++ /dev/null @@ -1,84 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksCheckIPAddressAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IPAddressAvailabilityResult -} - -type VirtualNetworksCheckIPAddressAvailabilityOperationOptions struct { - IPAddress *string -} - -func DefaultVirtualNetworksCheckIPAddressAvailabilityOperationOptions() VirtualNetworksCheckIPAddressAvailabilityOperationOptions { - return VirtualNetworksCheckIPAddressAvailabilityOperationOptions{} -} - -func (o VirtualNetworksCheckIPAddressAvailabilityOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o VirtualNetworksCheckIPAddressAvailabilityOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o VirtualNetworksCheckIPAddressAvailabilityOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPAddress != nil { - out.Append("ipAddress", fmt.Sprintf("%v", *o.IPAddress)) - } - return &out -} - -// VirtualNetworksCheckIPAddressAvailability ... -func (c VirtualNetworksClient) VirtualNetworksCheckIPAddressAvailability(ctx context.Context, id commonids.VirtualNetworkId, options VirtualNetworksCheckIPAddressAvailabilityOperationOptions) (result VirtualNetworksCheckIPAddressAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/checkIPAddressAvailability", id.ID()), - OptionsObject: options, - } - - 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 IPAddressAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go b/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go deleted file mode 100644 index c0872952086..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistddosprotectionstatus.go +++ /dev/null @@ -1,109 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksListDdosProtectionStatusOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPDdosProtectionStatusResult -} - -type VirtualNetworksListDdosProtectionStatusCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPDdosProtectionStatusResult -} - -type VirtualNetworksListDdosProtectionStatusOperationOptions struct { - SkipToken *string - Top *int64 -} - -func DefaultVirtualNetworksListDdosProtectionStatusOperationOptions() VirtualNetworksListDdosProtectionStatusOperationOptions { - return VirtualNetworksListDdosProtectionStatusOperationOptions{} -} - -func (o VirtualNetworksListDdosProtectionStatusOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o VirtualNetworksListDdosProtectionStatusOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o VirtualNetworksListDdosProtectionStatusOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.SkipToken != nil { - out.Append("skipToken", fmt.Sprintf("%v", *o.SkipToken)) - } - if o.Top != nil { - out.Append("top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// VirtualNetworksListDdosProtectionStatus ... -func (c VirtualNetworksClient) VirtualNetworksListDdosProtectionStatus(ctx context.Context, id commonids.VirtualNetworkId, options VirtualNetworksListDdosProtectionStatusOperationOptions) (result VirtualNetworksListDdosProtectionStatusOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/ddosProtectionStatus", id.ID()), - OptionsObject: options, - } - - 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 -} - -// VirtualNetworksListDdosProtectionStatusThenPoll performs VirtualNetworksListDdosProtectionStatus then polls until it's completed -func (c VirtualNetworksClient) VirtualNetworksListDdosProtectionStatusThenPoll(ctx context.Context, id commonids.VirtualNetworkId, options VirtualNetworksListDdosProtectionStatusOperationOptions) error { - result, err := c.VirtualNetworksListDdosProtectionStatus(ctx, id, options) - if err != nil { - return fmt.Errorf("performing VirtualNetworksListDdosProtectionStatus: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualNetworksListDdosProtectionStatus: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistusage.go b/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistusage.go deleted file mode 100644 index b1caad36dd4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/method_virtualnetworkslistusage.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworks - -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 VirtualNetworksListUsageOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkUsage -} - -type VirtualNetworksListUsageCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkUsage -} - -// VirtualNetworksListUsage ... -func (c VirtualNetworksClient) VirtualNetworksListUsage(ctx context.Context, id commonids.VirtualNetworkId) (result VirtualNetworksListUsageOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 *[]VirtualNetworkUsage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualNetworksListUsageComplete retrieves all the results into a single object -func (c VirtualNetworksClient) VirtualNetworksListUsageComplete(ctx context.Context, id commonids.VirtualNetworkId) (VirtualNetworksListUsageCompleteResult, error) { - return c.VirtualNetworksListUsageCompleteMatchingPredicate(ctx, id, VirtualNetworkUsageOperationPredicate{}) -} - -// VirtualNetworksListUsageCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworksClient) VirtualNetworksListUsageCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualNetworkId, predicate VirtualNetworkUsageOperationPredicate) (result VirtualNetworksListUsageCompleteResult, err error) { - items := make([]VirtualNetworkUsage, 0) - - resp, err := c.VirtualNetworksListUsage(ctx, id) - if err != nil { - 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 = VirtualNetworksListUsageCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_addressspace.go b/resource-manager/network/2023-06-01/virtualnetworks/model_addressspace.go deleted file mode 100644 index 9e0e23e9145..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 3f9607979a8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 6f399a7bf5d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 953789d1f3e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 3da3cb7d9c8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index d9d39242c2b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygroup.go deleted file mode 100644 index 8069aeaaf35..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 29a50229369..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspool.go b/resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspool.go deleted file mode 100644 index dca54b5ff44..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index b5357aa1b58..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 4608979dcd2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_ddossettings.go b/resource-manager/network/2023-06-01/virtualnetworks/model_ddossettings.go deleted file mode 100644 index 1a0ce5cf3aa..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_delegation.go b/resource-manager/network/2023-06-01/virtualnetworks/model_delegation.go deleted file mode 100644 index a8d0d243017..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_dhcpoptions.go b/resource-manager/network/2023-06-01/virtualnetworks/model_dhcpoptions.go deleted file mode 100644 index 2e389bf9503..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_dhcpoptions.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DhcpOptions struct { - DnsServers *[]string `json:"dnsServers,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_flowlog.go b/resource-manager/network/2023-06-01/virtualnetworks/model_flowlog.go deleted file mode 100644 index b920c2a5d05..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/virtualnetworks/model_flowlogformatparameters.go deleted file mode 100644 index 62b8c967d59..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_flowlogpropertiesformat.go deleted file mode 100644 index 46ad7cc1502..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfiguration.go deleted file mode 100644 index 4b7f7549a8a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworks - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 7f51afc745f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index ef3318f49d4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrule.go b/resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrule.go deleted file mode 100644 index 20f0e56c966..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 8ca3d3cee59..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_ipaddressavailabilityresult.go b/resource-manager/network/2023-06-01/virtualnetworks/model_ipaddressavailabilityresult.go deleted file mode 100644 index 2db5fbd90fa..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_ipaddressavailabilityresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPAddressAvailabilityResult struct { - Available *bool `json:"available,omitempty"` - AvailableIPAddresses *[]string `json:"availableIPAddresses,omitempty"` - IsPlatformReserved *bool `json:"isPlatformReserved,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfiguration.go deleted file mode 100644 index 7fc81013c87..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofile.go deleted file mode 100644 index 246a7d2784a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1c15860eaa4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 5f7e978b372..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_iptag.go b/resource-manager/network/2023-06-01/virtualnetworks/model_iptag.go deleted file mode 100644 index 5f312015c16..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// 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/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddress.go deleted file mode 100644 index f84e6394098..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 5b16669363a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_natgateway.go b/resource-manager/network/2023-06-01/virtualnetworks/model_natgateway.go deleted file mode 100644 index e2a2c9ea1aa..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworks - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaypropertiesformat.go deleted file mode 100644 index 11bdb034e9d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaysku.go b/resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaysku.go deleted file mode 100644 index 3375ec20625..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_natruleportmapping.go b/resource-manager/network/2023-06-01/virtualnetworks/model_natruleportmapping.go deleted file mode 100644 index c1f6eb9d264..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicy.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicy.go deleted file mode 100644 index 565f4c702ee..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicy.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkIntentPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicyconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicyconfiguration.go deleted file mode 100644 index 3f3080bf421..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkintentpolicyconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkIntentPolicyConfiguration struct { - NetworkIntentPolicyName *string `json:"networkIntentPolicyName,omitempty"` - SourceNetworkIntentPolicy *NetworkIntentPolicy `json:"sourceNetworkIntentPolicy,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterface.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterface.go deleted file mode 100644 index 51266c314db..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacednssettings.go deleted file mode 100644 index 35b796d58ea..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfiguration.go deleted file mode 100644 index e4fe127f68f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 0cf1411b04e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index d36857278bf..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacepropertiesformat.go deleted file mode 100644 index f38dee01e75..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 7ee2c196852..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index f37548acc09..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygroup.go deleted file mode 100644 index c6ffd2de200..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index bdaff37d6ec..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_preparenetworkpoliciesrequest.go b/resource-manager/network/2023-06-01/virtualnetworks/model_preparenetworkpoliciesrequest.go deleted file mode 100644 index af5d6a6061c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_preparenetworkpoliciesrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrepareNetworkPoliciesRequest struct { - NetworkIntentPolicyConfigurations *[]NetworkIntentPolicyConfiguration `json:"networkIntentPolicyConfigurations,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpoint.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpoint.go deleted file mode 100644 index a21e2003c7b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnection.go deleted file mode 100644 index 03c0943acbe..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/virtualnetworks/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnectionproperties.go deleted file mode 100644 index badbc227dee..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfiguration.go deleted file mode 100644 index b8c8c0e51e2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 0e1ea69495c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointproperties.go deleted file mode 100644 index c204c6f06f5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkservice.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkservice.go deleted file mode 100644 index ea60905675d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnection.go deleted file mode 100644 index 45640ebd97e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index ece1141c4d0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 498d4f92f9a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index b637ed217b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 7c3080b30c1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceproperties.go deleted file mode 100644 index e187bf8454c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddress.go b/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddress.go deleted file mode 100644 index 5eef47c77e3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddressdnssettings.go deleted file mode 100644 index 1e10d9bb32a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresspropertiesformat.go deleted file mode 100644 index f38386b9fd0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresssku.go deleted file mode 100644 index f080c20b33e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipddosprotectionstatusresult.go b/resource-manager/network/2023-06-01/virtualnetworks/model_publicipddosprotectionstatusresult.go deleted file mode 100644 index ca0f8cc894f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_publicipddosprotectionstatusresult.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPDdosProtectionStatusResult struct { - DdosProtectionPlanId *string `json:"ddosProtectionPlanId,omitempty"` - IsWorkloadProtected *IsWorkloadProtected `json:"isWorkloadProtected,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` - PublicIPAddressId *string `json:"publicIpAddressId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlink.go deleted file mode 100644 index e26d27c7784..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlinkformat.go deleted file mode 100644 index 5c0bb30457e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_resourceset.go b/resource-manager/network/2023-06-01/virtualnetworks/model_resourceset.go deleted file mode 100644 index 3f176c096e6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/virtualnetworks/model_retentionpolicyparameters.go deleted file mode 100644 index b8a74239a26..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_route.go b/resource-manager/network/2023-06-01/virtualnetworks/model_route.go deleted file mode 100644 index d76eb9ceeec..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_routepropertiesformat.go deleted file mode 100644 index e52a5de8ca6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_routetable.go b/resource-manager/network/2023-06-01/virtualnetworks/model_routetable.go deleted file mode 100644 index 2e233c020e3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_routetablepropertiesformat.go deleted file mode 100644 index 69015d57403..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_securityrule.go b/resource-manager/network/2023-06-01/virtualnetworks/model_securityrule.go deleted file mode 100644 index f7ed0f51115..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_securityrulepropertiesformat.go deleted file mode 100644 index af160e60e64..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlink.go deleted file mode 100644 index 77039ca3b73..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index d6ef1f15de1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 82eb0f31d43..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicy.go deleted file mode 100644 index d50c20ce576..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 4d2ebe5ac46..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index b221dd2c319..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 00a9c1e5662..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 03a937b7d65..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_subnet.go b/resource-manager/network/2023-06-01/virtualnetworks/model_subnet.go deleted file mode 100644 index 7b3d4ff10c8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_subnetpropertiesformat.go deleted file mode 100644 index 1daa153bc29..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_subresource.go b/resource-manager/network/2023-06-01/virtualnetworks/model_subresource.go deleted file mode 100644 index ecd84dace18..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_tagsobject.go b/resource-manager/network/2023-06-01/virtualnetworks/model_tagsobject.go deleted file mode 100644 index 9ac4400ec75..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// 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/network/2023-06-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index ce47549e2b9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsproperties.go deleted file mode 100644 index 26812782cc8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go b/resource-manager/network/2023-06-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go deleted file mode 100644 index 84b1fedbc2b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_unpreparenetworkpoliciesrequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UnprepareNetworkPoliciesRequest struct { - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetwork.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetwork.go deleted file mode 100644 index 01f2a07994e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetwork.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworks - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetwork struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkbgpcommunities.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkbgpcommunities.go deleted file mode 100644 index ecb655fd234..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkbgpcommunities.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkBgpCommunities struct { - RegionalCommunity *string `json:"regionalCommunity,omitempty"` - VirtualNetworkCommunity string `json:"virtualNetworkCommunity"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkencryption.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkencryption.go deleted file mode 100644 index a0d8e13fe3a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkencryption.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkEncryption struct { - Enabled bool `json:"enabled"` - Enforcement *VirtualNetworkEncryptionEnforcement `json:"enforcement,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeering.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeering.go deleted file mode 100644 index 85b7fe9183a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkPeeringPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go deleted file mode 100644 index 642e0676b8f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpeeringpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPeeringPropertiesFormat struct { - AllowForwardedTraffic *bool `json:"allowForwardedTraffic,omitempty"` - AllowGatewayTransit *bool `json:"allowGatewayTransit,omitempty"` - AllowVirtualNetworkAccess *bool `json:"allowVirtualNetworkAccess,omitempty"` - DoNotVerifyRemoteGateways *bool `json:"doNotVerifyRemoteGateways,omitempty"` - PeeringState *VirtualNetworkPeeringState `json:"peeringState,omitempty"` - PeeringSyncLevel *VirtualNetworkPeeringLevel `json:"peeringSyncLevel,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteAddressSpace *AddressSpace `json:"remoteAddressSpace,omitempty"` - RemoteBgpCommunities *VirtualNetworkBgpCommunities `json:"remoteBgpCommunities,omitempty"` - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - RemoteVirtualNetworkAddressSpace *AddressSpace `json:"remoteVirtualNetworkAddressSpace,omitempty"` - RemoteVirtualNetworkEncryption *VirtualNetworkEncryption `json:"remoteVirtualNetworkEncryption,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - UseRemoteGateways *bool `json:"useRemoteGateways,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpropertiesformat.go deleted file mode 100644 index a6ad3b4e3a0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkPropertiesFormat struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpCommunities *VirtualNetworkBgpCommunities `json:"bgpCommunities,omitempty"` - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - DhcpOptions *DhcpOptions `json:"dhcpOptions,omitempty"` - EnableDdosProtection *bool `json:"enableDdosProtection,omitempty"` - EnableVMProtection *bool `json:"enableVmProtection,omitempty"` - Encryption *VirtualNetworkEncryption `json:"encryption,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlowTimeoutInMinutes *int64 `json:"flowTimeoutInMinutes,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` - VirtualNetworkPeerings *[]VirtualNetworkPeering `json:"virtualNetworkPeerings,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktap.go deleted file mode 100644 index d1b3faf4100..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 4c2bb1fad6c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusage.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusage.go deleted file mode 100644 index 470dd6b34f8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusage.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkUsage struct { - CurrentValue *float64 `json:"currentValue,omitempty"` - Id *string `json:"id,omitempty"` - Limit *float64 `json:"limit,omitempty"` - Name *VirtualNetworkUsageName `json:"name,omitempty"` - Unit *string `json:"unit,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusagename.go b/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusagename.go deleted file mode 100644 index f3156ce6be8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/model_virtualnetworkusagename.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkUsageName struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/predicates.go b/resource-manager/network/2023-06-01/virtualnetworks/predicates.go deleted file mode 100644 index ae976386154..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/predicates.go +++ /dev/null @@ -1,144 +0,0 @@ -package virtualnetworks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPDdosProtectionStatusResultOperationPredicate struct { - DdosProtectionPlanId *string - PublicIPAddress *string - PublicIPAddressId *string -} - -func (p PublicIPDdosProtectionStatusResultOperationPredicate) Matches(input PublicIPDdosProtectionStatusResult) bool { - - if p.DdosProtectionPlanId != nil && (input.DdosProtectionPlanId == nil || *p.DdosProtectionPlanId != *input.DdosProtectionPlanId) { - return false - } - - if p.PublicIPAddress != nil && (input.PublicIPAddress == nil || *p.PublicIPAddress != *input.PublicIPAddress) { - return false - } - - if p.PublicIPAddressId != nil && (input.PublicIPAddressId == nil || *p.PublicIPAddressId != *input.PublicIPAddressId) { - return false - } - - return true -} - -type ResourceNavigationLinkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ResourceNavigationLinkOperationPredicate) Matches(input ResourceNavigationLink) 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.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 ServiceAssociationLinkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ServiceAssociationLinkOperationPredicate) Matches(input ServiceAssociationLink) 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.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 VirtualNetworkOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkOperationPredicate) Matches(input VirtualNetwork) 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 && (input.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 VirtualNetworkUsageOperationPredicate struct { - CurrentValue *float64 - Id *string - Limit *float64 - Unit *string -} - -func (p VirtualNetworkUsageOperationPredicate) Matches(input VirtualNetworkUsage) bool { - - if p.CurrentValue != nil && (input.CurrentValue == nil || *p.CurrentValue != *input.CurrentValue) { - return false - } - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Limit != nil && (input.Limit == nil || *p.Limit != *input.Limit) { - return false - } - - if p.Unit != nil && (input.Unit == nil || *p.Unit != *input.Unit) { - return false - } - - return true -} diff --git a/resource-manager/network/2023-06-01/virtualnetworks/version.go b/resource-manager/network/2023-06-01/virtualnetworks/version.go deleted file mode 100644 index 377ef677669..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworks/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/README.md b/resource-manager/network/2023-06-01/virtualnetworktap/README.md deleted file mode 100644 index 64f1761e2c5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/README.md +++ /dev/null @@ -1,86 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworktap` Documentation - -The `virtualnetworktap` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualnetworktap" -``` - - -### Client Initialization - -```go -client := virtualnetworktap.NewVirtualNetworkTapClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkTapClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -payload := virtualnetworktap.VirtualNetworkTap{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkTapClient.Delete` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualNetworkTapClient.Get` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -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: `VirtualNetworkTapClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualnetworktap.NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - -payload := virtualnetworktap.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/network/2023-06-01/virtualnetworktap/client.go b/resource-manager/network/2023-06-01/virtualnetworktap/client.go deleted file mode 100644 index 4444f3072d8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworktap - -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 VirtualNetworkTapClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkTapClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkTapClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworktap", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkTapClient: %+v", err) - } - - return &VirtualNetworkTapClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/constants.go b/resource-manager/network/2023-06-01/virtualnetworktap/constants.go deleted file mode 100644 index fd73f5ab17a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package virtualnetworktap - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap.go b/resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap.go deleted file mode 100644 index 5bf0638a304..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualnetworktap - -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(&VirtualNetworkTapId{}) -} - -var _ resourceids.ResourceId = &VirtualNetworkTapId{} - -// VirtualNetworkTapId is a struct representing the Resource ID for a Virtual Network Tap -type VirtualNetworkTapId struct { - SubscriptionId string - ResourceGroupName string - VirtualNetworkTapName string -} - -// NewVirtualNetworkTapID returns a new VirtualNetworkTapId struct -func NewVirtualNetworkTapID(subscriptionId string, resourceGroupName string, virtualNetworkTapName string) VirtualNetworkTapId { - return VirtualNetworkTapId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualNetworkTapName: virtualNetworkTapName, - } -} - -// ParseVirtualNetworkTapID parses 'input' into a VirtualNetworkTapId -func ParseVirtualNetworkTapID(input string) (*VirtualNetworkTapId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkTapId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkTapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualNetworkTapIDInsensitively parses 'input' case-insensitively into a VirtualNetworkTapId -// note: this method should only be used for API response data and not user input -func ParseVirtualNetworkTapIDInsensitively(input string) (*VirtualNetworkTapId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualNetworkTapId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualNetworkTapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualNetworkTapId) 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.VirtualNetworkTapName, ok = input.Parsed["virtualNetworkTapName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualNetworkTapName", input) - } - - return nil -} - -// ValidateVirtualNetworkTapID checks that 'input' can be parsed as a Virtual Network Tap ID -func ValidateVirtualNetworkTapID(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 := ParseVirtualNetworkTapID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Network Tap ID -func (id VirtualNetworkTapId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualNetworkTaps/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualNetworkTapName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Network Tap ID -func (id VirtualNetworkTapId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualNetworkTaps", "virtualNetworkTaps", "virtualNetworkTaps"), - resourceids.UserSpecifiedSegment("virtualNetworkTapName", "virtualNetworkTapValue"), - } -} - -// String returns a human-readable description of this Virtual Network Tap ID -func (id VirtualNetworkTapId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Network Tap Name: %q", id.VirtualNetworkTapName), - } - return fmt.Sprintf("Virtual Network Tap (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap_test.go b/resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap_test.go deleted file mode 100644 index db63499cc59..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/id_virtualnetworktap_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualnetworktap - -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 = &VirtualNetworkTapId{} - -func TestNewVirtualNetworkTapID(t *testing.T) { - id := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue") - - 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.VirtualNetworkTapName != "virtualNetworkTapValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualNetworkTapName'", id.VirtualNetworkTapName, "virtualNetworkTapValue") - } -} - -func TestFormatVirtualNetworkTapID(t *testing.T) { - actual := NewVirtualNetworkTapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualNetworkTapValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualNetworkTapID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkTapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue", - Expected: &VirtualNetworkTapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "virtualNetworkTapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkTapID(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.VirtualNetworkTapName != v.Expected.VirtualNetworkTapName { - t.Fatalf("Expected %q but got %q for VirtualNetworkTapName", v.Expected.VirtualNetworkTapName, actual.VirtualNetworkTapName) - } - - } -} - -func TestParseVirtualNetworkTapIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualNetworkTapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue", - Expected: &VirtualNetworkTapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualNetworkTapName: "virtualNetworkTapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualNetworkTaps/virtualNetworkTapValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApVaLuE", - Expected: &VirtualNetworkTapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualNetworkTapName: "vIrTuAlNeTwOrKtApVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlNeTwOrKtApS/vIrTuAlNeTwOrKtApVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualNetworkTapIDInsensitively(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.VirtualNetworkTapName != v.Expected.VirtualNetworkTapName { - t.Fatalf("Expected %q but got %q for VirtualNetworkTapName", v.Expected.VirtualNetworkTapName, actual.VirtualNetworkTapName) - } - - } -} - -func TestSegmentsForVirtualNetworkTapId(t *testing.T) { - segments := VirtualNetworkTapId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualNetworkTapId 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/network/2023-06-01/virtualnetworktap/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualnetworktap/method_createorupdate.go deleted file mode 100644 index 9e0265a1971..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualnetworktap - -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 *VirtualNetworkTap -} - -// CreateOrUpdate ... -func (c VirtualNetworkTapClient) CreateOrUpdate(ctx context.Context, id VirtualNetworkTapId, input VirtualNetworkTap) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualNetworkTapClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualNetworkTapId, input VirtualNetworkTap) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualnetworktap/method_delete.go b/resource-manager/network/2023-06-01/virtualnetworktap/method_delete.go deleted file mode 100644 index 93b4ec0c489..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualnetworktap - -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 VirtualNetworkTapClient) Delete(ctx context.Context, id VirtualNetworkTapId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualNetworkTapClient) DeleteThenPoll(ctx context.Context, id VirtualNetworkTapId) 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/network/2023-06-01/virtualnetworktap/method_get.go b/resource-manager/network/2023-06-01/virtualnetworktap/method_get.go deleted file mode 100644 index 7d8ef7767ee..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualnetworktap - -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 *VirtualNetworkTap -} - -// Get ... -func (c VirtualNetworkTapClient) Get(ctx context.Context, id VirtualNetworkTapId) (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 VirtualNetworkTap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/method_updatetags.go b/resource-manager/network/2023-06-01/virtualnetworktap/method_updatetags.go deleted file mode 100644 index 2079b8bdf80..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package virtualnetworktap - -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 *VirtualNetworkTap -} - -// UpdateTags ... -func (c VirtualNetworkTapClient) UpdateTags(ctx context.Context, id VirtualNetworkTapId, 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 VirtualNetworkTap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddress.go deleted file mode 100644 index db62a91aeb1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index a220744195a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index f1a5f708c1c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfiguration.go deleted file mode 100644 index e0dd6f54986..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 05e2cf6e7ff..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygroup.go deleted file mode 100644 index 89fac6f865a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index dd34d207344..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspool.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspool.go deleted file mode 100644 index 22fa8953303..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 6ac563af429..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index d263c1b8649..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_ddossettings.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_ddossettings.go deleted file mode 100644 index 934851a560f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_delegation.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_delegation.go deleted file mode 100644 index b98041c6409..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlog.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlog.go deleted file mode 100644 index ddd3757f710..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogformatparameters.go deleted file mode 100644 index 05c5660bcab..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogpropertiesformat.go deleted file mode 100644 index 64eb8ac4566..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfiguration.go deleted file mode 100644 index 8e718fbb787..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktap - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index df238cbcfd3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 3301ab1a1c7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrule.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrule.go deleted file mode 100644 index 7c4fefd00fe..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 9562bb00429..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfiguration.go deleted file mode 100644 index 072921c15aa..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofile.go deleted file mode 100644 index 319c9ec5ee9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index adf0a28fb73..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 14c8a64a2a2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_iptag.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_iptag.go deleted file mode 100644 index 85d10556d1c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// 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/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddress.go deleted file mode 100644 index bb0a0c328c1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index b16ba8335ae..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_natgateway.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_natgateway.go deleted file mode 100644 index ff0008c8a9e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworktap - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaypropertiesformat.go deleted file mode 100644 index 314c102eee6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaysku.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaysku.go deleted file mode 100644 index efd87c92e07..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_natruleportmapping.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_natruleportmapping.go deleted file mode 100644 index 9c675767782..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterface.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterface.go deleted file mode 100644 index 90bd182032d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacednssettings.go deleted file mode 100644 index 8f7f5c9ab69..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 420ea20f4d2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index e2d0d046dd7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index e8b6558e224..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 0428a2c793c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 1514177f60e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 4d5181920b1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygroup.go deleted file mode 100644 index f1f880186f1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index c0a2565b3a0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpoint.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpoint.go deleted file mode 100644 index 18177d11a3e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnection.go deleted file mode 100644 index 3a5764483c9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/virtualnetworktap/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnectionproperties.go deleted file mode 100644 index f6119badaa5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfiguration.go deleted file mode 100644 index 35ffb6cda11..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 8e362a6d1b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointproperties.go deleted file mode 100644 index 8d42714c80d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkservice.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkservice.go deleted file mode 100644 index 42d87ebbbcb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnection.go deleted file mode 100644 index 6218ca9e0c5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index bb689f2425d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 4510ba8bea7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 7f7ebc0d7f8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 9e874822a6b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceproperties.go deleted file mode 100644 index cbafd8f4967..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddress.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddress.go deleted file mode 100644 index 5059f6b2c6b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualnetworktap - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddressdnssettings.go deleted file mode 100644 index 5e531cfaa59..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresspropertiesformat.go deleted file mode 100644 index b1b74de6b82..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresssku.go deleted file mode 100644 index c719ed93844..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlink.go deleted file mode 100644 index e1834b720d7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlinkformat.go deleted file mode 100644 index 5100c40bc8d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_resourceset.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_resourceset.go deleted file mode 100644 index fa8408e3374..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_retentionpolicyparameters.go deleted file mode 100644 index 402a95f81e1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_route.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_route.go deleted file mode 100644 index 5eb14c76d8d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_routepropertiesformat.go deleted file mode 100644 index 1e404b86207..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_routetable.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_routetable.go deleted file mode 100644 index c5bfa2aacc9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_routetablepropertiesformat.go deleted file mode 100644 index 788b58851db..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_securityrule.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_securityrule.go deleted file mode 100644 index 42a4c62093e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_securityrulepropertiesformat.go deleted file mode 100644 index 8b92ef45964..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlink.go deleted file mode 100644 index 806ced6b5e5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 9a18079edd6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 347761b277f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicy.go deleted file mode 100644 index 6ca8e2d4a35..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 05ee77e2b81..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 537a3df890d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index f2645082640..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 6da43c107d7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_subnet.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_subnet.go deleted file mode 100644 index e7d6771812b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_subnetpropertiesformat.go deleted file mode 100644 index 16b011e7508..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_subresource.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_subresource.go deleted file mode 100644 index da7e12e526b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_tagsobject.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_tagsobject.go deleted file mode 100644 index 1c98be14a33..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// 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/network/2023-06-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 89aa415edbb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsproperties.go deleted file mode 100644 index 701cc7ae154..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktap.go deleted file mode 100644 index 209659855b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 5c2f9db5892..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktap - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktap/version.go b/resource-manager/network/2023-06-01/virtualnetworktap/version.go deleted file mode 100644 index bae1981368d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktap/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktap - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktap/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/README.md b/resource-manager/network/2023-06-01/virtualnetworktaps/README.md deleted file mode 100644 index 74ef8a6b3cf..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/README.md +++ /dev/null @@ -1,55 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualnetworktaps` Documentation - -The `virtualnetworktaps` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualnetworktaps" -``` - - -### Client Initialization - -```go -client := virtualnetworktaps.NewVirtualNetworkTapsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualNetworkTapsClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualNetworkTapsClient.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 -} -``` diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/client.go b/resource-manager/network/2023-06-01/virtualnetworktaps/client.go deleted file mode 100644 index 33de6824de7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualnetworktaps - -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 VirtualNetworkTapsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualNetworkTapsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualNetworkTapsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualnetworktaps", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualNetworkTapsClient: %+v", err) - } - - return &VirtualNetworkTapsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/constants.go b/resource-manager/network/2023-06-01/virtualnetworktaps/constants.go deleted file mode 100644 index 6a84040cbb3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package virtualnetworktaps - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/method_listall.go b/resource-manager/network/2023-06-01/virtualnetworktaps/method_listall.go deleted file mode 100644 index 49ba7ccfcc1..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworktaps - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualNetworkTap -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkTap -} - -// ListAll ... -func (c VirtualNetworkTapsClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworkTaps", 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 *[]VirtualNetworkTap `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c VirtualNetworkTapsClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, VirtualNetworkTapOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkTapsClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualNetworkTapOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]VirtualNetworkTap, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualnetworktaps/method_listbyresourcegroup.go deleted file mode 100644 index b5c64395b6c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualnetworktaps - -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 *[]VirtualNetworkTap -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualNetworkTap -} - -// ListByResourceGroup ... -func (c VirtualNetworkTapsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualNetworkTaps", 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 *[]VirtualNetworkTap `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 VirtualNetworkTapsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualNetworkTapOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualNetworkTapsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualNetworkTapOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]VirtualNetworkTap, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b76026be6bc..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index b8bc620ea71..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index f6179e4f0e3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 9e995dbb56d..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 0c3c2c531f3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygroup.go deleted file mode 100644 index 1c38043ef88..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 9102a6b9188..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspool.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspool.go deleted file mode 100644 index 2c478d85562..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 9afb32298d3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 36b2063994a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ddossettings.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_ddossettings.go deleted file mode 100644 index cbd6745cb8e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_delegation.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_delegation.go deleted file mode 100644 index 018e0605aee..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlog.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlog.go deleted file mode 100644 index 5a7b0a4647b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogformatparameters.go deleted file mode 100644 index 3dc25c465d0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogpropertiesformat.go deleted file mode 100644 index 6fc887f8010..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfiguration.go deleted file mode 100644 index 35e28c95460..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktaps - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index c6949a4745a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index a2e82dba72b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrule.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrule.go deleted file mode 100644 index f84bd93f6c7..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 8200337ef35..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfiguration.go deleted file mode 100644 index fcd9033c4a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofile.go deleted file mode 100644 index 2e7b5cfe5eb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 1d5ab92dcd5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 4a486230c36..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_iptag.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_iptag.go deleted file mode 100644 index c4127e59d60..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// 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/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddress.go deleted file mode 100644 index 7a8c5cb8b73..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index d3193da6576..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgateway.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgateway.go deleted file mode 100644 index b2e289b8923..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualnetworktaps - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaypropertiesformat.go deleted file mode 100644 index 17859bcb59e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaysku.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaysku.go deleted file mode 100644 index cab72fef58e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natruleportmapping.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_natruleportmapping.go deleted file mode 100644 index 2426f4e9182..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterface.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterface.go deleted file mode 100644 index 0959f2effbd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacednssettings.go deleted file mode 100644 index 63a0e5410a5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 3295f16b481..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 7659a03380a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index dcfd84eac61..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 9cb7ea2624a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 3d883d5678c..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index dd9ef377372..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygroup.go deleted file mode 100644 index d3ce4b39ea6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 57de91eafd3..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpoint.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpoint.go deleted file mode 100644 index b58c024b508..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnection.go deleted file mode 100644 index 3d314882781..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/virtualnetworktaps/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnectionproperties.go deleted file mode 100644 index d6ea54d1367..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfiguration.go deleted file mode 100644 index 40468e7e3ae..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 46faf7b053b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointproperties.go deleted file mode 100644 index 44ca9629906..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkservice.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkservice.go deleted file mode 100644 index 8df5b6ca8e9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnection.go deleted file mode 100644 index 3d9511e926a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 149dad152de..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 5ae16683918..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 830a49d4825..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index b3b914d17a6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceproperties.go deleted file mode 100644 index 9e5885610f5..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddress.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddress.go deleted file mode 100644 index a63d498e9b2..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualnetworktaps - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddressdnssettings.go deleted file mode 100644 index a22c5ccb482..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go deleted file mode 100644 index f3a6e76f01e..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresssku.go deleted file mode 100644 index b6d56cb8fcd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlink.go deleted file mode 100644 index b362ba5a95b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlinkformat.go deleted file mode 100644 index 83b81bd5755..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourceset.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourceset.go deleted file mode 100644 index 7e28952a0a0..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_retentionpolicyparameters.go deleted file mode 100644 index 9a09f483b36..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_route.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_route.go deleted file mode 100644 index fe09505f366..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_routepropertiesformat.go deleted file mode 100644 index 3d3840b7cfb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_routetable.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_routetable.go deleted file mode 100644 index dc456ac5330..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_routetablepropertiesformat.go deleted file mode 100644 index 29d5488b413..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrule.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrule.go deleted file mode 100644 index 2b52f93106a..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrulepropertiesformat.go deleted file mode 100644 index 549b4d495a6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlink.go deleted file mode 100644 index eff71aa8797..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 72fe6efec6b..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go deleted file mode 100644 index d130c80bc92..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicy.go deleted file mode 100644 index b164c8a3ad8..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go deleted file mode 100644 index a715beb370f..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 6283b834876..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index e39a39b0dc9..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go deleted file mode 100644 index c5085da61db..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_subnet.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_subnet.go deleted file mode 100644 index 586828d80aa..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_subnetpropertiesformat.go deleted file mode 100644 index dbb930b9867..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_subresource.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_subresource.go deleted file mode 100644 index 64ad7a5e2b6..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 5d2043fba12..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsproperties.go deleted file mode 100644 index a673cd2c104..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktap.go deleted file mode 100644 index d5bf88cf9cb..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index e75a60ff515..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualnetworktaps/predicates.go b/resource-manager/network/2023-06-01/virtualnetworktaps/predicates.go deleted file mode 100644 index 0b7fb5985f4..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualnetworktaps - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualNetworkTapOperationPredicate) Matches(input VirtualNetworkTap) 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 && (input.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/network/2023-06-01/virtualnetworktaps/version.go b/resource-manager/network/2023-06-01/virtualnetworktaps/version.go deleted file mode 100644 index 9b0027517cd..00000000000 --- a/resource-manager/network/2023-06-01/virtualnetworktaps/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualnetworktaps - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualnetworktaps/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/README.md b/resource-manager/network/2023-06-01/virtualrouterpeerings/README.md deleted file mode 100644 index 5545d6f9a92..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualrouterpeerings` Documentation - -The `virtualrouterpeerings` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualrouterpeerings" -``` - - -### Client Initialization - -```go -client := virtualrouterpeerings.NewVirtualRouterPeeringsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualRouterPeeringsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -payload := virtualrouterpeerings.VirtualRouterPeering{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRouterPeeringsClient.Delete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRouterPeeringsClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewVirtualRouterPeeringID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue", "peeringValue") - -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: `VirtualRouterPeeringsClient.List` - -```go -ctx := context.TODO() -id := virtualrouterpeerings.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -// 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/network/2023-06-01/virtualrouterpeerings/client.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/client.go deleted file mode 100644 index 6b55e901ef5..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualrouterpeerings - -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 VirtualRouterPeeringsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualRouterPeeringsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualRouterPeeringsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualrouterpeerings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualRouterPeeringsClient: %+v", err) - } - - return &VirtualRouterPeeringsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/constants.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/constants.go deleted file mode 100644 index 464d2b779c9..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package virtualrouterpeerings - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter.go deleted file mode 100644 index 85fff5b9af3..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualrouterpeerings - -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(&VirtualRouterId{}) -} - -var _ resourceids.ResourceId = &VirtualRouterId{} - -// VirtualRouterId is a struct representing the Resource ID for a Virtual Router -type VirtualRouterId struct { - SubscriptionId string - ResourceGroupName string - VirtualRouterName string -} - -// NewVirtualRouterID returns a new VirtualRouterId struct -func NewVirtualRouterID(subscriptionId string, resourceGroupName string, virtualRouterName string) VirtualRouterId { - return VirtualRouterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualRouterName: virtualRouterName, - } -} - -// ParseVirtualRouterID parses 'input' into a VirtualRouterId -func ParseVirtualRouterID(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualRouterIDInsensitively parses 'input' case-insensitively into a VirtualRouterId -// note: this method should only be used for API response data and not user input -func ParseVirtualRouterIDInsensitively(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualRouterId) 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.VirtualRouterName, ok = input.Parsed["virtualRouterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualRouterName", input) - } - - return nil -} - -// ValidateVirtualRouterID checks that 'input' can be parsed as a Virtual Router ID -func ValidateVirtualRouterID(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 := ParseVirtualRouterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Router ID -func (id VirtualRouterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualRouters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualRouterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Router ID -func (id VirtualRouterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualRouters", "virtualRouters", "virtualRouters"), - resourceids.UserSpecifiedSegment("virtualRouterName", "virtualRouterValue"), - } -} - -// String returns a human-readable description of this Virtual Router ID -func (id VirtualRouterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Router Name: %q", id.VirtualRouterName), - } - return fmt.Sprintf("Virtual Router (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter_test.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter_test.go deleted file mode 100644 index 43ccb8cff05..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/id_virtualrouter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualrouterpeerings - -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 = &VirtualRouterId{} - -func TestNewVirtualRouterID(t *testing.T) { - id := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - - 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.VirtualRouterName != "virtualRouterValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualRouterName'", id.VirtualRouterName, "virtualRouterValue") - } -} - -func TestFormatVirtualRouterID(t *testing.T) { - actual := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualRouterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterID(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestParseVirtualRouterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualRouterName: "vIrTuAlRoUtErVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterIDInsensitively(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestSegmentsForVirtualRouterId(t *testing.T) { - segments := VirtualRouterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualRouterId 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/network/2023-06-01/virtualrouterpeerings/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/method_createorupdate.go deleted file mode 100644 index c3c6be8f2f4..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualrouterpeerings - -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 *VirtualRouterPeering -} - -// CreateOrUpdate ... -func (c VirtualRouterPeeringsClient) CreateOrUpdate(ctx context.Context, id commonids.VirtualRouterPeeringId, input VirtualRouterPeering) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualRouterPeeringsClient) CreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualRouterPeeringId, input VirtualRouterPeering) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualrouterpeerings/method_delete.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/method_delete.go deleted file mode 100644 index 0f1d37addbb..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/method_delete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualrouterpeerings - -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 DeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// Delete ... -func (c VirtualRouterPeeringsClient) Delete(ctx context.Context, id commonids.VirtualRouterPeeringId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualRouterPeeringsClient) DeleteThenPoll(ctx context.Context, id commonids.VirtualRouterPeeringId) 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/network/2023-06-01/virtualrouterpeerings/method_get.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/method_get.go deleted file mode 100644 index 684fe0cb2fc..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualrouterpeerings - -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 *VirtualRouterPeering -} - -// Get ... -func (c VirtualRouterPeeringsClient) Get(ctx context.Context, id commonids.VirtualRouterPeeringId) (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 VirtualRouterPeering - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/method_list.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/method_list.go deleted file mode 100644 index 0735fa6e8e6..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualrouterpeerings - -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 *[]VirtualRouterPeering -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualRouterPeering -} - -// List ... -func (c VirtualRouterPeeringsClient) List(ctx context.Context, id VirtualRouterId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/peerings", 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 *[]VirtualRouterPeering `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 VirtualRouterPeeringsClient) ListComplete(ctx context.Context, id VirtualRouterId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualRouterPeeringOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualRouterPeeringsClient) ListCompleteMatchingPredicate(ctx context.Context, id VirtualRouterId, predicate VirtualRouterPeeringOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualRouterPeering, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeering.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeering.go deleted file mode 100644 index 148137d1d12..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeering.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouterpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPeering struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualRouterPeeringProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go deleted file mode 100644 index c205251cdff..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/model_virtualrouterpeeringproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualrouterpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPeeringProperties struct { - PeerAsn *int64 `json:"peerAsn,omitempty"` - PeerIP *string `json:"peerIp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualrouterpeerings/predicates.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/predicates.go deleted file mode 100644 index 1e181881675..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package virtualrouterpeerings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPeeringOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VirtualRouterPeeringOperationPredicate) Matches(input VirtualRouterPeering) 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.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/network/2023-06-01/virtualrouterpeerings/version.go b/resource-manager/network/2023-06-01/virtualrouterpeerings/version.go deleted file mode 100644 index 2007c42e783..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouterpeerings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouterpeerings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouterpeerings/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/README.md b/resource-manager/network/2023-06-01/virtualrouters/README.md deleted file mode 100644 index b5bb72d090e..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/README.md +++ /dev/null @@ -1,100 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualrouters` Documentation - -The `virtualrouters` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualrouters" -``` - - -### Client Initialization - -```go -client := virtualrouters.NewVirtualRoutersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualRoutersClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -payload := virtualrouters.VirtualRouter{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRoutersClient.Delete` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualRoutersClient.Get` - -```go -ctx := context.TODO() -id := virtualrouters.NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - -read, err := client.Get(ctx, id, virtualrouters.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualRoutersClient.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: `VirtualRoutersClient.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 -} -``` diff --git a/resource-manager/network/2023-06-01/virtualrouters/client.go b/resource-manager/network/2023-06-01/virtualrouters/client.go deleted file mode 100644 index 37e6baf91a8..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualrouters - -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 VirtualRoutersClient struct { - Client *resourcemanager.Client -} - -func NewVirtualRoutersClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualRoutersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualrouters", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualRoutersClient: %+v", err) - } - - return &VirtualRoutersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/constants.go b/resource-manager/network/2023-06-01/virtualrouters/constants.go deleted file mode 100644 index 1a43afab5dd..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package virtualrouters - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter.go b/resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter.go deleted file mode 100644 index 3e9ac08d3a1..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualrouters - -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(&VirtualRouterId{}) -} - -var _ resourceids.ResourceId = &VirtualRouterId{} - -// VirtualRouterId is a struct representing the Resource ID for a Virtual Router -type VirtualRouterId struct { - SubscriptionId string - ResourceGroupName string - VirtualRouterName string -} - -// NewVirtualRouterID returns a new VirtualRouterId struct -func NewVirtualRouterID(subscriptionId string, resourceGroupName string, virtualRouterName string) VirtualRouterId { - return VirtualRouterId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualRouterName: virtualRouterName, - } -} - -// ParseVirtualRouterID parses 'input' into a VirtualRouterId -func ParseVirtualRouterID(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualRouterIDInsensitively parses 'input' case-insensitively into a VirtualRouterId -// note: this method should only be used for API response data and not user input -func ParseVirtualRouterIDInsensitively(input string) (*VirtualRouterId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualRouterId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualRouterId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualRouterId) 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.VirtualRouterName, ok = input.Parsed["virtualRouterName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualRouterName", input) - } - - return nil -} - -// ValidateVirtualRouterID checks that 'input' can be parsed as a Virtual Router ID -func ValidateVirtualRouterID(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 := ParseVirtualRouterID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Router ID -func (id VirtualRouterId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualRouters/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualRouterName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Router ID -func (id VirtualRouterId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualRouters", "virtualRouters", "virtualRouters"), - resourceids.UserSpecifiedSegment("virtualRouterName", "virtualRouterValue"), - } -} - -// String returns a human-readable description of this Virtual Router ID -func (id VirtualRouterId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Router Name: %q", id.VirtualRouterName), - } - return fmt.Sprintf("Virtual Router (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter_test.go b/resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter_test.go deleted file mode 100644 index eae7920cd09..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/id_virtualrouter_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualrouters - -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 = &VirtualRouterId{} - -func TestNewVirtualRouterID(t *testing.T) { - id := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue") - - 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.VirtualRouterName != "virtualRouterValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualRouterName'", id.VirtualRouterName, "virtualRouterValue") - } -} - -func TestFormatVirtualRouterID(t *testing.T) { - actual := NewVirtualRouterID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualRouterValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualRouterID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterID(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestParseVirtualRouterIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualRouterId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualRouterName: "virtualRouterValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualRouters/virtualRouterValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE", - Expected: &VirtualRouterId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualRouterName: "vIrTuAlRoUtErVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlRoUtErS/vIrTuAlRoUtErVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualRouterIDInsensitively(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.VirtualRouterName != v.Expected.VirtualRouterName { - t.Fatalf("Expected %q but got %q for VirtualRouterName", v.Expected.VirtualRouterName, actual.VirtualRouterName) - } - - } -} - -func TestSegmentsForVirtualRouterId(t *testing.T) { - segments := VirtualRouterId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualRouterId 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/network/2023-06-01/virtualrouters/method_createorupdate.go b/resource-manager/network/2023-06-01/virtualrouters/method_createorupdate.go deleted file mode 100644 index a9d77afc1e5..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualrouters - -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 *VirtualRouter -} - -// CreateOrUpdate ... -func (c VirtualRoutersClient) CreateOrUpdate(ctx context.Context, id VirtualRouterId, input VirtualRouter) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VirtualRoutersClient) CreateOrUpdateThenPoll(ctx context.Context, id VirtualRouterId, input VirtualRouter) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/network/2023-06-01/virtualrouters/method_delete.go b/resource-manager/network/2023-06-01/virtualrouters/method_delete.go deleted file mode 100644 index 7dcaaf847d3..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualrouters - -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 VirtualRoutersClient) Delete(ctx context.Context, id VirtualRouterId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 VirtualRoutersClient) DeleteThenPoll(ctx context.Context, id VirtualRouterId) 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/network/2023-06-01/virtualrouters/method_get.go b/resource-manager/network/2023-06-01/virtualrouters/method_get.go deleted file mode 100644 index 2e829ce071e..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package virtualrouters - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualRouter -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c VirtualRoutersClient) Get(ctx context.Context, id VirtualRouterId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 VirtualRouter - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/method_list.go b/resource-manager/network/2023-06-01/virtualrouters/method_list.go deleted file mode 100644 index cd3f11e7a64..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualrouters - -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 *[]VirtualRouter -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualRouter -} - -// List ... -func (c VirtualRoutersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualRouters", 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 *[]VirtualRouter `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 VirtualRoutersClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, VirtualRouterOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualRoutersClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualRouterOperationPredicate) (result ListCompleteResult, err error) { - items := make([]VirtualRouter, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualrouters/method_listbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualrouters/method_listbyresourcegroup.go deleted file mode 100644 index 2084bb0cc5b..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualrouters - -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 *[]VirtualRouter -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualRouter -} - -// ListByResourceGroup ... -func (c VirtualRoutersClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualRouters", 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 *[]VirtualRouter `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 VirtualRoutersClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualRouterOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualRoutersClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualRouterOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]VirtualRouter, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/network/2023-06-01/virtualrouters/model_subresource.go b/resource-manager/network/2023-06-01/virtualrouters/model_subresource.go deleted file mode 100644 index f9c28cc090f..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/model_virtualrouter.go b/resource-manager/network/2023-06-01/virtualrouters/model_virtualrouter.go deleted file mode 100644 index ac50af509f1..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/model_virtualrouter.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouter struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualRouterPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/model_virtualrouterpropertiesformat.go b/resource-manager/network/2023-06-01/virtualrouters/model_virtualrouterpropertiesformat.go deleted file mode 100644 index 24601ff2eb4..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/model_virtualrouterpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterPropertiesFormat struct { - HostedGateway *SubResource `json:"hostedGateway,omitempty"` - HostedSubnet *SubResource `json:"hostedSubnet,omitempty"` - Peerings *[]SubResource `json:"peerings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - VirtualRouterIPs *[]string `json:"virtualRouterIps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualrouters/predicates.go b/resource-manager/network/2023-06-01/virtualrouters/predicates.go deleted file mode 100644 index 676ee423641..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package virtualrouters - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualRouterOperationPredicate) Matches(input VirtualRouter) 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 && (input.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/network/2023-06-01/virtualrouters/version.go b/resource-manager/network/2023-06-01/virtualrouters/version.go deleted file mode 100644 index a9854e14fd8..00000000000 --- a/resource-manager/network/2023-06-01/virtualrouters/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualrouters - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualrouters/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/README.md b/resource-manager/network/2023-06-01/virtualwans/README.md deleted file mode 100644 index 4c1af461ac5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/README.md +++ /dev/null @@ -1,1468 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/virtualwans` Documentation - -The `virtualwans` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/virtualwans" -``` - - -### Client Initialization - -```go -client := virtualwans.NewVirtualWANsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -payload := virtualwans.VpnServerConfigurationPolicyGroup{ - // ... -} - - -if err := client.ConfigurationPolicyGroupsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -if err := client.ConfigurationPolicyGroupsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - -read, err := client.ConfigurationPolicyGroupsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.ConfigurationPolicyGroupsListByVpnServerConfiguration` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -// alternatively `client.ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx, id)` can be used to do batched pagination -items, err := client.ConfigurationPolicyGroupsListByVpnServerConfigurationComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.Generatevirtualwanvpnserverconfigurationvpnprofile` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.VirtualWanVpnProfileParameters{ - // ... -} - - -if err := client.GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -payload := virtualwans.HubRouteTable{ - // ... -} - - -if err := client.HubRouteTablesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -if err := client.HubRouteTablesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - -read, err := client.HubRouteTablesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.HubRouteTablesList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.HubRouteTablesList(ctx, id)` can be used to do batched pagination -items, err := client.HubRouteTablesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -payload := virtualwans.HubVirtualNetworkConnection{ - // ... -} - - -if err := client.HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -if err := client.HubVirtualNetworkConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - -read, err := client.HubVirtualNetworkConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.HubVirtualNetworkConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.HubVirtualNetworkConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.HubVirtualNetworkConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -payload := virtualwans.VpnGatewayNatRule{ - // ... -} - - -if err := client.NatRulesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -if err := client.NatRulesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - -read, err := client.NatRulesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.NatRulesListByVpnGateway` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -// alternatively `client.NatRulesListByVpnGateway(ctx, id)` can be used to do batched pagination -items, err := client.NatRulesListByVpnGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.NetworkVirtualApplianceConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "networkVirtualApplianceConnectionValue") - -payload := virtualwans.NetworkVirtualApplianceConnection{ - // ... -} - - -if err := client.NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NetworkVirtualApplianceConnectionsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "networkVirtualApplianceConnectionValue") - -if err := client.NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.NetworkVirtualApplianceConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "networkVirtualApplianceConnectionValue") - -read, err := client.NetworkVirtualApplianceConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.NetworkVirtualApplianceConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - -// alternatively `client.NetworkVirtualApplianceConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.NetworkVirtualApplianceConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -payload := virtualwans.P2SVpnGateway{ - // ... -} - - -if err := client.P2sVpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -if err := client.P2sVpnGatewaysDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualWANP2SVPNGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "p2sVpnGatewayValue") - -read, err := client.P2sVpnGatewaysGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.P2sVpnGatewaysList(ctx, id)` can be used to do batched pagination -items, err := client.P2sVpnGatewaysListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.P2sVpnGatewaysListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.P2sVpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.P2sVpnGatewaysListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -payload := virtualwans.RouteMap{ - // ... -} - - -if err := client.RouteMapsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -if err := client.RouteMapsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - -read, err := client.RouteMapsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.RouteMapsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.RouteMapsList(ctx, id)` can be used to do batched pagination -items, err := client.RouteMapsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -payload := virtualwans.RoutingIntent{ - // ... -} - - -if err := client.RoutingIntentCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -if err := client.RoutingIntentDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentGet` - -```go -ctx := context.TODO() -id := virtualwans.NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - -read, err := client.RoutingIntentGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.RoutingIntentList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.RoutingIntentList(ctx, id)` can be used to do batched pagination -items, err := client.RoutingIntentListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.SupportedSecurityProviders` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -read, err := client.SupportedSecurityProviders(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.UpdateTags` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.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 -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -payload := virtualwans.BgpConnection{ - // ... -} - - -if err := client.VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -read, err := client.VirtualHubBgpConnectionGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubBgpConnectionsList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubBgpConnectionsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListAdvertisedRoutes` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubBgpConnectionsListLearnedRoutes` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubBGPConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "bgpConnectionValue") - -if err := client.VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -payload := virtualwans.HubIPConfiguration{ - // ... -} - - -if err := client.VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationDelete` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -if err := client.VirtualHubIPConfigurationDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationGet` - -```go -ctx := context.TODO() -id := commonids.NewVirtualHubIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "ipConfigurationValue") - -read, err := client.VirtualHubIPConfigurationGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubIPConfigurationList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubIPConfigurationList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubIPConfigurationListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -payload := virtualwans.VirtualHubRouteTableV2{ - // ... -} - - -if err := client.VirtualHubRouteTableV2sCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -if err := client.VirtualHubRouteTableV2sDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - -read, err := client.VirtualHubRouteTableV2sGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubRouteTableV2sList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -// alternatively `client.VirtualHubRouteTableV2sList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubRouteTableV2sListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.VirtualHub{ - // ... -} - - -if err := client.VirtualHubsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -if err := client.VirtualHubsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -read, err := client.VirtualHubsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetEffectiveVirtualHubRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.EffectiveRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetInboundRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.GetInboundRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetInboundRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsGetOutboundRoutes` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.GetOutboundRoutesParameters{ - // ... -} - - -if err := client.VirtualHubsGetOutboundRoutesThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VirtualHubsList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VirtualHubsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VirtualHubsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualHubsUpdateTags` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - -payload := virtualwans.TagsObject{ - // ... -} - - -read, err := client.VirtualHubsUpdateTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.VirtualWAN{ - // ... -} - - -if err := client.VirtualWansCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -if err := client.VirtualWansDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -read, err := client.VirtualWansGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VirtualWansList(ctx, id)` can be used to do batched pagination -items, err := client.VirtualWansListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VirtualWansListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VirtualWansListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VirtualWansListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsCreateOrUpdate` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnection{ - // ... -} - - -if err := client.VpnConnectionsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsDelete` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -if err := client.VpnConnectionsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsGet` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -read, err := client.VpnConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsListByVpnGateway` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -// alternatively `client.VpnConnectionsListByVpnGateway(ctx, id)` can be used to do batched pagination -items, err := client.VpnConnectionsListByVpnGatewayComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsStartPacketCapture` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnectionPacketCaptureStartParameters{ - // ... -} - - -if err := client.VpnConnectionsStartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnConnectionsStopPacketCapture` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -payload := virtualwans.VpnConnectionPacketCaptureStopParameters{ - // ... -} - - -if err := client.VpnConnectionsStopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := virtualwans.VpnGateway{ - // ... -} - - -if err := client.VpnGatewaysCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -if err := client.VpnGatewaysDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -read, err := client.VpnGatewaysGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnGatewaysList(ctx, id)` can be used to do batched pagination -items, err := client.VpnGatewaysListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnGatewaysListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnGatewaysListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnGatewaysListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnLinkConnectionsGetIkeSas` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - -if err := client.VpnLinkConnectionsGetIkeSasThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnLinkConnectionsListByVpnConnection` - -```go -ctx := context.TODO() -id := commonids.NewVPNConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue") - -// alternatively `client.VpnLinkConnectionsListByVpnConnection(ctx, id)` can be used to do batched pagination -items, err := client.VpnLinkConnectionsListByVpnConnectionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsAssociatedWithVirtualWanList` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -if err := client.VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -payload := virtualwans.VpnServerConfiguration{ - // ... -} - - -if err := client.VpnServerConfigurationsCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -if err := client.VpnServerConfigurationsDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -read, err := client.VpnServerConfigurationsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnServerConfigurationsList(ctx, id)` can be used to do batched pagination -items, err := client.VpnServerConfigurationsListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnServerConfigurationsListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnServerConfigurationsListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnServerConfigurationsListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinkConnectionsGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - -read, err := client.VpnSiteLinkConnectionsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinksGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue") - -read, err := client.VpnSiteLinksGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSiteLinksListByVpnSite` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -// alternatively `client.VpnSiteLinksListByVpnSite(ctx, id)` can be used to do batched pagination -items, err := client.VpnSiteLinksListByVpnSiteComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesConfigurationDownload` - -```go -ctx := context.TODO() -id := virtualwans.NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - -payload := virtualwans.GetVpnSitesConfigurationRequest{ - // ... -} - - -if err := client.VpnSitesConfigurationDownloadThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesCreateOrUpdate` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -payload := virtualwans.VpnSite{ - // ... -} - - -if err := client.VpnSitesCreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesDelete` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -if err := client.VpnSitesDeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesGet` - -```go -ctx := context.TODO() -id := virtualwans.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -read, err := client.VpnSitesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.VpnSitesList(ctx, id)` can be used to do batched pagination -items, err := client.VpnSitesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VirtualWANsClient.VpnSitesListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.VpnSitesListByResourceGroup(ctx, id)` can be used to do batched pagination -items, err := client.VpnSitesListByResourceGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/virtualwans/client.go b/resource-manager/network/2023-06-01/virtualwans/client.go deleted file mode 100644 index bf0a24c960f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualwans - -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 VirtualWANsClient struct { - Client *resourcemanager.Client -} - -func NewVirtualWANsClientWithBaseURI(sdkApi sdkEnv.Api) (*VirtualWANsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "virtualwans", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VirtualWANsClient: %+v", err) - } - - return &VirtualWANsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/constants.go b/resource-manager/network/2023-06-01/virtualwans/constants.go deleted file mode 100644 index d26250d416b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/constants.go +++ /dev/null @@ -1,2335 +0,0 @@ -package virtualwans - -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 AuthenticationMethod string - -const ( - AuthenticationMethodEAPMSCHAPvTwo AuthenticationMethod = "EAPMSCHAPv2" - AuthenticationMethodEAPTLS AuthenticationMethod = "EAPTLS" -) - -func PossibleValuesForAuthenticationMethod() []string { - return []string{ - string(AuthenticationMethodEAPMSCHAPvTwo), - string(AuthenticationMethodEAPTLS), - } -} - -func (s *AuthenticationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthenticationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthenticationMethod(input string) (*AuthenticationMethod, error) { - vals := map[string]AuthenticationMethod{ - "eapmschapv2": AuthenticationMethodEAPMSCHAPvTwo, - "eaptls": AuthenticationMethodEAPTLS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthenticationMethod(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type HubBgpConnectionStatus string - -const ( - HubBgpConnectionStatusConnected HubBgpConnectionStatus = "Connected" - HubBgpConnectionStatusConnecting HubBgpConnectionStatus = "Connecting" - HubBgpConnectionStatusNotConnected HubBgpConnectionStatus = "NotConnected" - HubBgpConnectionStatusUnknown HubBgpConnectionStatus = "Unknown" -) - -func PossibleValuesForHubBgpConnectionStatus() []string { - return []string{ - string(HubBgpConnectionStatusConnected), - string(HubBgpConnectionStatusConnecting), - string(HubBgpConnectionStatusNotConnected), - string(HubBgpConnectionStatusUnknown), - } -} - -func (s *HubBgpConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHubBgpConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHubBgpConnectionStatus(input string) (*HubBgpConnectionStatus, error) { - vals := map[string]HubBgpConnectionStatus{ - "connected": HubBgpConnectionStatusConnected, - "connecting": HubBgpConnectionStatusConnecting, - "notconnected": HubBgpConnectionStatusNotConnected, - "unknown": HubBgpConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HubBgpConnectionStatus(input) - return &out, nil -} - -type HubRoutingPreference string - -const ( - HubRoutingPreferenceASPath HubRoutingPreference = "ASPath" - HubRoutingPreferenceExpressRoute HubRoutingPreference = "ExpressRoute" - HubRoutingPreferenceVpnGateway HubRoutingPreference = "VpnGateway" -) - -func PossibleValuesForHubRoutingPreference() []string { - return []string{ - string(HubRoutingPreferenceASPath), - string(HubRoutingPreferenceExpressRoute), - string(HubRoutingPreferenceVpnGateway), - } -} - -func (s *HubRoutingPreference) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseHubRoutingPreference(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseHubRoutingPreference(input string) (*HubRoutingPreference, error) { - vals := map[string]HubRoutingPreference{ - "aspath": HubRoutingPreferenceASPath, - "expressroute": HubRoutingPreferenceExpressRoute, - "vpngateway": HubRoutingPreferenceVpnGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HubRoutingPreference(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type NextStep string - -const ( - NextStepContinue NextStep = "Continue" - NextStepTerminate NextStep = "Terminate" - NextStepUnknown NextStep = "Unknown" -) - -func PossibleValuesForNextStep() []string { - return []string{ - string(NextStepContinue), - string(NextStepTerminate), - string(NextStepUnknown), - } -} - -func (s *NextStep) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNextStep(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNextStep(input string) (*NextStep, error) { - vals := map[string]NextStep{ - "continue": NextStepContinue, - "terminate": NextStepTerminate, - "unknown": NextStepUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NextStep(input) - return &out, nil -} - -type OfficeTrafficCategory string - -const ( - OfficeTrafficCategoryAll OfficeTrafficCategory = "All" - OfficeTrafficCategoryNone OfficeTrafficCategory = "None" - OfficeTrafficCategoryOptimize OfficeTrafficCategory = "Optimize" - OfficeTrafficCategoryOptimizeAndAllow OfficeTrafficCategory = "OptimizeAndAllow" -) - -func PossibleValuesForOfficeTrafficCategory() []string { - return []string{ - string(OfficeTrafficCategoryAll), - string(OfficeTrafficCategoryNone), - string(OfficeTrafficCategoryOptimize), - string(OfficeTrafficCategoryOptimizeAndAllow), - } -} - -func (s *OfficeTrafficCategory) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOfficeTrafficCategory(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOfficeTrafficCategory(input string) (*OfficeTrafficCategory, error) { - vals := map[string]OfficeTrafficCategory{ - "all": OfficeTrafficCategoryAll, - "none": OfficeTrafficCategoryNone, - "optimize": OfficeTrafficCategoryOptimize, - "optimizeandallow": OfficeTrafficCategoryOptimizeAndAllow, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OfficeTrafficCategory(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type PreferredRoutingGateway string - -const ( - PreferredRoutingGatewayExpressRoute PreferredRoutingGateway = "ExpressRoute" - PreferredRoutingGatewayNone PreferredRoutingGateway = "None" - PreferredRoutingGatewayVpnGateway PreferredRoutingGateway = "VpnGateway" -) - -func PossibleValuesForPreferredRoutingGateway() []string { - return []string{ - string(PreferredRoutingGatewayExpressRoute), - string(PreferredRoutingGatewayNone), - string(PreferredRoutingGatewayVpnGateway), - } -} - -func (s *PreferredRoutingGateway) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePreferredRoutingGateway(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePreferredRoutingGateway(input string) (*PreferredRoutingGateway, error) { - vals := map[string]PreferredRoutingGateway{ - "expressroute": PreferredRoutingGatewayExpressRoute, - "none": PreferredRoutingGatewayNone, - "vpngateway": PreferredRoutingGatewayVpnGateway, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PreferredRoutingGateway(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteMapActionType string - -const ( - RouteMapActionTypeAdd RouteMapActionType = "Add" - RouteMapActionTypeDrop RouteMapActionType = "Drop" - RouteMapActionTypeRemove RouteMapActionType = "Remove" - RouteMapActionTypeReplace RouteMapActionType = "Replace" - RouteMapActionTypeUnknown RouteMapActionType = "Unknown" -) - -func PossibleValuesForRouteMapActionType() []string { - return []string{ - string(RouteMapActionTypeAdd), - string(RouteMapActionTypeDrop), - string(RouteMapActionTypeRemove), - string(RouteMapActionTypeReplace), - string(RouteMapActionTypeUnknown), - } -} - -func (s *RouteMapActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteMapActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteMapActionType(input string) (*RouteMapActionType, error) { - vals := map[string]RouteMapActionType{ - "add": RouteMapActionTypeAdd, - "drop": RouteMapActionTypeDrop, - "remove": RouteMapActionTypeRemove, - "replace": RouteMapActionTypeReplace, - "unknown": RouteMapActionTypeUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteMapActionType(input) - return &out, nil -} - -type RouteMapMatchCondition string - -const ( - RouteMapMatchConditionContains RouteMapMatchCondition = "Contains" - RouteMapMatchConditionEquals RouteMapMatchCondition = "Equals" - RouteMapMatchConditionNotContains RouteMapMatchCondition = "NotContains" - RouteMapMatchConditionNotEquals RouteMapMatchCondition = "NotEquals" - RouteMapMatchConditionUnknown RouteMapMatchCondition = "Unknown" -) - -func PossibleValuesForRouteMapMatchCondition() []string { - return []string{ - string(RouteMapMatchConditionContains), - string(RouteMapMatchConditionEquals), - string(RouteMapMatchConditionNotContains), - string(RouteMapMatchConditionNotEquals), - string(RouteMapMatchConditionUnknown), - } -} - -func (s *RouteMapMatchCondition) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteMapMatchCondition(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteMapMatchCondition(input string) (*RouteMapMatchCondition, error) { - vals := map[string]RouteMapMatchCondition{ - "contains": RouteMapMatchConditionContains, - "equals": RouteMapMatchConditionEquals, - "notcontains": RouteMapMatchConditionNotContains, - "notequals": RouteMapMatchConditionNotEquals, - "unknown": RouteMapMatchConditionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteMapMatchCondition(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type RoutingState string - -const ( - RoutingStateFailed RoutingState = "Failed" - RoutingStateNone RoutingState = "None" - RoutingStateProvisioned RoutingState = "Provisioned" - RoutingStateProvisioning RoutingState = "Provisioning" -) - -func PossibleValuesForRoutingState() []string { - return []string{ - string(RoutingStateFailed), - string(RoutingStateNone), - string(RoutingStateProvisioned), - string(RoutingStateProvisioning), - } -} - -func (s *RoutingState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRoutingState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRoutingState(input string) (*RoutingState, error) { - vals := map[string]RoutingState{ - "failed": RoutingStateFailed, - "none": RoutingStateNone, - "provisioned": RoutingStateProvisioned, - "provisioning": RoutingStateProvisioning, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RoutingState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} - -type VirtualWanSecurityProviderType string - -const ( - VirtualWanSecurityProviderTypeExternal VirtualWanSecurityProviderType = "External" - VirtualWanSecurityProviderTypeNative VirtualWanSecurityProviderType = "Native" -) - -func PossibleValuesForVirtualWanSecurityProviderType() []string { - return []string{ - string(VirtualWanSecurityProviderTypeExternal), - string(VirtualWanSecurityProviderTypeNative), - } -} - -func (s *VirtualWanSecurityProviderType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualWanSecurityProviderType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualWanSecurityProviderType(input string) (*VirtualWanSecurityProviderType, error) { - vals := map[string]VirtualWanSecurityProviderType{ - "external": VirtualWanSecurityProviderTypeExternal, - "native": VirtualWanSecurityProviderTypeNative, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualWanSecurityProviderType(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnConnectionStatus string - -const ( - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -func PossibleValuesForVpnConnectionStatus() []string { - return []string{ - string(VpnConnectionStatusConnected), - string(VpnConnectionStatusConnecting), - string(VpnConnectionStatusNotConnected), - string(VpnConnectionStatusUnknown), - } -} - -func (s *VpnConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnConnectionStatus(input string) (*VpnConnectionStatus, error) { - vals := map[string]VpnConnectionStatus{ - "connected": VpnConnectionStatusConnected, - "connecting": VpnConnectionStatusConnecting, - "notconnected": VpnConnectionStatusNotConnected, - "unknown": VpnConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnConnectionStatus(input) - return &out, nil -} - -type VpnGatewayTunnelingProtocol string - -const ( - VpnGatewayTunnelingProtocolIkeVTwo VpnGatewayTunnelingProtocol = "IkeV2" - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -func PossibleValuesForVpnGatewayTunnelingProtocol() []string { - return []string{ - string(VpnGatewayTunnelingProtocolIkeVTwo), - string(VpnGatewayTunnelingProtocolOpenVPN), - } -} - -func (s *VpnGatewayTunnelingProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayTunnelingProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayTunnelingProtocol(input string) (*VpnGatewayTunnelingProtocol, error) { - vals := map[string]VpnGatewayTunnelingProtocol{ - "ikev2": VpnGatewayTunnelingProtocolIkeVTwo, - "openvpn": VpnGatewayTunnelingProtocolOpenVPN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayTunnelingProtocol(input) - return &out, nil -} - -type VpnLinkConnectionMode string - -const ( - VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" - VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" - VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVpnLinkConnectionMode() []string { - return []string{ - string(VpnLinkConnectionModeDefault), - string(VpnLinkConnectionModeInitiatorOnly), - string(VpnLinkConnectionModeResponderOnly), - } -} - -func (s *VpnLinkConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnLinkConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnLinkConnectionMode(input string) (*VpnLinkConnectionMode, error) { - vals := map[string]VpnLinkConnectionMode{ - "default": VpnLinkConnectionModeDefault, - "initiatoronly": VpnLinkConnectionModeInitiatorOnly, - "responderonly": VpnLinkConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnLinkConnectionMode(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup.go b/resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup.go deleted file mode 100644 index 7ebd0347f4d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&ConfigurationPolicyGroupId{}) -} - -var _ resourceids.ResourceId = &ConfigurationPolicyGroupId{} - -// ConfigurationPolicyGroupId is a struct representing the Resource ID for a Configuration Policy Group -type ConfigurationPolicyGroupId struct { - SubscriptionId string - ResourceGroupName string - VpnServerConfigurationName string - ConfigurationPolicyGroupName string -} - -// NewConfigurationPolicyGroupID returns a new ConfigurationPolicyGroupId struct -func NewConfigurationPolicyGroupID(subscriptionId string, resourceGroupName string, vpnServerConfigurationName string, configurationPolicyGroupName string) ConfigurationPolicyGroupId { - return ConfigurationPolicyGroupId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnServerConfigurationName: vpnServerConfigurationName, - ConfigurationPolicyGroupName: configurationPolicyGroupName, - } -} - -// ParseConfigurationPolicyGroupID parses 'input' into a ConfigurationPolicyGroupId -func ParseConfigurationPolicyGroupID(input string) (*ConfigurationPolicyGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationPolicyGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationPolicyGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConfigurationPolicyGroupIDInsensitively parses 'input' case-insensitively into a ConfigurationPolicyGroupId -// note: this method should only be used for API response data and not user input -func ParseConfigurationPolicyGroupIDInsensitively(input string) (*ConfigurationPolicyGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationPolicyGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationPolicyGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConfigurationPolicyGroupId) 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.VpnServerConfigurationName, ok = input.Parsed["vpnServerConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnServerConfigurationName", input) - } - - if id.ConfigurationPolicyGroupName, ok = input.Parsed["configurationPolicyGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "configurationPolicyGroupName", input) - } - - return nil -} - -// ValidateConfigurationPolicyGroupID checks that 'input' can be parsed as a Configuration Policy Group ID -func ValidateConfigurationPolicyGroupID(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 := ParseConfigurationPolicyGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Configuration Policy Group ID -func (id ConfigurationPolicyGroupId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnServerConfigurations/%s/configurationPolicyGroups/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnServerConfigurationName, id.ConfigurationPolicyGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Configuration Policy Group ID -func (id ConfigurationPolicyGroupId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnServerConfigurations", "vpnServerConfigurations", "vpnServerConfigurations"), - resourceids.UserSpecifiedSegment("vpnServerConfigurationName", "vpnServerConfigurationValue"), - resourceids.StaticSegment("staticConfigurationPolicyGroups", "configurationPolicyGroups", "configurationPolicyGroups"), - resourceids.UserSpecifiedSegment("configurationPolicyGroupName", "configurationPolicyGroupValue"), - } -} - -// String returns a human-readable description of this Configuration Policy Group ID -func (id ConfigurationPolicyGroupId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Server Configuration Name: %q", id.VpnServerConfigurationName), - fmt.Sprintf("Configuration Policy Group Name: %q", id.ConfigurationPolicyGroupName), - } - return fmt.Sprintf("Configuration Policy Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup_test.go b/resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup_test.go deleted file mode 100644 index c49bcdb713d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_configurationpolicygroup_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &ConfigurationPolicyGroupId{} - -func TestNewConfigurationPolicyGroupID(t *testing.T) { - id := NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue") - - 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.VpnServerConfigurationName != "vpnServerConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnServerConfigurationName'", id.VpnServerConfigurationName, "vpnServerConfigurationValue") - } - - if id.ConfigurationPolicyGroupName != "configurationPolicyGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationPolicyGroupName'", id.ConfigurationPolicyGroupName, "configurationPolicyGroupValue") - } -} - -func TestFormatConfigurationPolicyGroupID(t *testing.T) { - actual := NewConfigurationPolicyGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue", "configurationPolicyGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConfigurationPolicyGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationPolicyGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue", - Expected: &ConfigurationPolicyGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - ConfigurationPolicyGroupName: "configurationPolicyGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationPolicyGroupID(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - if actual.ConfigurationPolicyGroupName != v.Expected.ConfigurationPolicyGroupName { - t.Fatalf("Expected %q but got %q for ConfigurationPolicyGroupName", v.Expected.ConfigurationPolicyGroupName, actual.ConfigurationPolicyGroupName) - } - - } -} - -func TestParseConfigurationPolicyGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationPolicyGroupId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/cOnFiGuRaTiOnPoLiCyGrOuPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue", - Expected: &ConfigurationPolicyGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - ConfigurationPolicyGroupName: "configurationPolicyGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/configurationPolicyGroups/configurationPolicyGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/cOnFiGuRaTiOnPoLiCyGrOuPs/cOnFiGuRaTiOnPoLiCyGrOuPvAlUe", - Expected: &ConfigurationPolicyGroupId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnServerConfigurationName: "vPnSeRvErCoNfIgUrAtIoNvAlUe", - ConfigurationPolicyGroupName: "cOnFiGuRaTiOnPoLiCyGrOuPvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/cOnFiGuRaTiOnPoLiCyGrOuPs/cOnFiGuRaTiOnPoLiCyGrOuPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationPolicyGroupIDInsensitively(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - if actual.ConfigurationPolicyGroupName != v.Expected.ConfigurationPolicyGroupName { - t.Fatalf("Expected %q but got %q for ConfigurationPolicyGroupName", v.Expected.ConfigurationPolicyGroupName, actual.ConfigurationPolicyGroupName) - } - - } -} - -func TestSegmentsForConfigurationPolicyGroupId(t *testing.T) { - segments := ConfigurationPolicyGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConfigurationPolicyGroupId 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/network/2023-06-01/virtualwans/id_hubroutetable.go b/resource-manager/network/2023-06-01/virtualwans/id_hubroutetable.go deleted file mode 100644 index 46e51d4c426..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_hubroutetable.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&HubRouteTableId{}) -} - -var _ resourceids.ResourceId = &HubRouteTableId{} - -// HubRouteTableId is a struct representing the Resource ID for a Hub Route Table -type HubRouteTableId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - HubRouteTableName string -} - -// NewHubRouteTableID returns a new HubRouteTableId struct -func NewHubRouteTableID(subscriptionId string, resourceGroupName string, virtualHubName string, hubRouteTableName string) HubRouteTableId { - return HubRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - HubRouteTableName: hubRouteTableName, - } -} - -// ParseHubRouteTableID parses 'input' into a HubRouteTableId -func ParseHubRouteTableID(input string) (*HubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHubRouteTableIDInsensitively parses 'input' case-insensitively into a HubRouteTableId -// note: this method should only be used for API response data and not user input -func ParseHubRouteTableIDInsensitively(input string) (*HubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HubRouteTableId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.HubRouteTableName, ok = input.Parsed["hubRouteTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hubRouteTableName", input) - } - - return nil -} - -// ValidateHubRouteTableID checks that 'input' can be parsed as a Hub Route Table ID -func ValidateHubRouteTableID(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 := ParseHubRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Hub Route Table ID -func (id HubRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/hubRouteTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.HubRouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Hub Route Table ID -func (id HubRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticHubRouteTables", "hubRouteTables", "hubRouteTables"), - resourceids.UserSpecifiedSegment("hubRouteTableName", "hubRouteTableValue"), - } -} - -// String returns a human-readable description of this Hub Route Table ID -func (id HubRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Hub Route Table Name: %q", id.HubRouteTableName), - } - return fmt.Sprintf("Hub Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_hubroutetable_test.go b/resource-manager/network/2023-06-01/virtualwans/id_hubroutetable_test.go deleted file mode 100644 index 8b064838b6b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_hubroutetable_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &HubRouteTableId{} - -func TestNewHubRouteTableID(t *testing.T) { - id := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.HubRouteTableName != "hubRouteTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'HubRouteTableName'", id.HubRouteTableName, "hubRouteTableValue") - } -} - -func TestFormatHubRouteTableID(t *testing.T) { - actual := NewHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubRouteTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseHubRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue", - Expected: &HubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubRouteTableName: "hubRouteTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubRouteTableID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubRouteTableName != v.Expected.HubRouteTableName { - t.Fatalf("Expected %q but got %q for HubRouteTableName", v.Expected.HubRouteTableName, actual.HubRouteTableName) - } - - } -} - -func TestParseHubRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbRoUtEtAbLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue", - Expected: &HubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubRouteTableName: "hubRouteTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubRouteTables/hubRouteTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbRoUtEtAbLeS/hUbRoUtEtAbLeVaLuE", - Expected: &HubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - HubRouteTableName: "hUbRoUtEtAbLeVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbRoUtEtAbLeS/hUbRoUtEtAbLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubRouteTableIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubRouteTableName != v.Expected.HubRouteTableName { - t.Fatalf("Expected %q but got %q for HubRouteTableName", v.Expected.HubRouteTableName, actual.HubRouteTableName) - } - - } -} - -func TestSegmentsForHubRouteTableId(t *testing.T) { - segments := HubRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("HubRouteTableId 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/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection.go b/resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection.go deleted file mode 100644 index 92e4c4c7d5d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&HubVirtualNetworkConnectionId{}) -} - -var _ resourceids.ResourceId = &HubVirtualNetworkConnectionId{} - -// HubVirtualNetworkConnectionId is a struct representing the Resource ID for a Hub Virtual Network Connection -type HubVirtualNetworkConnectionId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - HubVirtualNetworkConnectionName string -} - -// NewHubVirtualNetworkConnectionID returns a new HubVirtualNetworkConnectionId struct -func NewHubVirtualNetworkConnectionID(subscriptionId string, resourceGroupName string, virtualHubName string, hubVirtualNetworkConnectionName string) HubVirtualNetworkConnectionId { - return HubVirtualNetworkConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - HubVirtualNetworkConnectionName: hubVirtualNetworkConnectionName, - } -} - -// ParseHubVirtualNetworkConnectionID parses 'input' into a HubVirtualNetworkConnectionId -func ParseHubVirtualNetworkConnectionID(input string) (*HubVirtualNetworkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubVirtualNetworkConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubVirtualNetworkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseHubVirtualNetworkConnectionIDInsensitively parses 'input' case-insensitively into a HubVirtualNetworkConnectionId -// note: this method should only be used for API response data and not user input -func ParseHubVirtualNetworkConnectionIDInsensitively(input string) (*HubVirtualNetworkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&HubVirtualNetworkConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := HubVirtualNetworkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *HubVirtualNetworkConnectionId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.HubVirtualNetworkConnectionName, ok = input.Parsed["hubVirtualNetworkConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "hubVirtualNetworkConnectionName", input) - } - - return nil -} - -// ValidateHubVirtualNetworkConnectionID checks that 'input' can be parsed as a Hub Virtual Network Connection ID -func ValidateHubVirtualNetworkConnectionID(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 := ParseHubVirtualNetworkConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Hub Virtual Network Connection ID -func (id HubVirtualNetworkConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/hubVirtualNetworkConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.HubVirtualNetworkConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Hub Virtual Network Connection ID -func (id HubVirtualNetworkConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticHubVirtualNetworkConnections", "hubVirtualNetworkConnections", "hubVirtualNetworkConnections"), - resourceids.UserSpecifiedSegment("hubVirtualNetworkConnectionName", "hubVirtualNetworkConnectionValue"), - } -} - -// String returns a human-readable description of this Hub Virtual Network Connection ID -func (id HubVirtualNetworkConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Hub Virtual Network Connection Name: %q", id.HubVirtualNetworkConnectionName), - } - return fmt.Sprintf("Hub Virtual Network Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection_test.go b/resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection_test.go deleted file mode 100644 index 96ef8d339b4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_hubvirtualnetworkconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &HubVirtualNetworkConnectionId{} - -func TestNewHubVirtualNetworkConnectionID(t *testing.T) { - id := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.HubVirtualNetworkConnectionName != "hubVirtualNetworkConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'HubVirtualNetworkConnectionName'", id.HubVirtualNetworkConnectionName, "hubVirtualNetworkConnectionValue") - } -} - -func TestFormatHubVirtualNetworkConnectionID(t *testing.T) { - actual := NewHubVirtualNetworkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "hubVirtualNetworkConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseHubVirtualNetworkConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubVirtualNetworkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue", - Expected: &HubVirtualNetworkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubVirtualNetworkConnectionID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubVirtualNetworkConnectionName != v.Expected.HubVirtualNetworkConnectionName { - t.Fatalf("Expected %q but got %q for HubVirtualNetworkConnectionName", v.Expected.HubVirtualNetworkConnectionName, actual.HubVirtualNetworkConnectionName) - } - - } -} - -func TestParseHubVirtualNetworkConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *HubVirtualNetworkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbViRtUaLnEtWoRkCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue", - Expected: &HubVirtualNetworkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - HubVirtualNetworkConnectionName: "hubVirtualNetworkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/hubVirtualNetworkConnections/hubVirtualNetworkConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnVaLuE", - Expected: &HubVirtualNetworkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - HubVirtualNetworkConnectionName: "hUbViRtUaLnEtWoRkCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/hUbViRtUaLnEtWoRkCoNnEcTiOnS/hUbViRtUaLnEtWoRkCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseHubVirtualNetworkConnectionIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.HubVirtualNetworkConnectionName != v.Expected.HubVirtualNetworkConnectionName { - t.Fatalf("Expected %q but got %q for HubVirtualNetworkConnectionName", v.Expected.HubVirtualNetworkConnectionName, actual.HubVirtualNetworkConnectionName) - } - - } -} - -func TestSegmentsForHubVirtualNetworkConnectionId(t *testing.T) { - segments := HubVirtualNetworkConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("HubVirtualNetworkConnectionId 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/network/2023-06-01/virtualwans/id_natrule.go b/resource-manager/network/2023-06-01/virtualwans/id_natrule.go deleted file mode 100644 index f2dca44d7fa..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_natrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&NatRuleId{}) -} - -var _ resourceids.ResourceId = &NatRuleId{} - -// NatRuleId is a struct representing the Resource ID for a Nat Rule -type NatRuleId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string - NatRuleName string -} - -// NewNatRuleID returns a new NatRuleId struct -func NewNatRuleID(subscriptionId string, resourceGroupName string, vpnGatewayName string, natRuleName string) NatRuleId { - return NatRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - NatRuleName: natRuleName, - } -} - -// ParseNatRuleID parses 'input' into a NatRuleId -func ParseNatRuleID(input string) (*NatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNatRuleIDInsensitively parses 'input' case-insensitively into a NatRuleId -// note: this method should only be used for API response data and not user input -func ParseNatRuleIDInsensitively(input string) (*NatRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&NatRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NatRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NatRuleId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - if id.NatRuleName, ok = input.Parsed["natRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "natRuleName", input) - } - - return nil -} - -// ValidateNatRuleID checks that 'input' can be parsed as a Nat Rule ID -func ValidateNatRuleID(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 := ParseNatRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Nat Rule ID -func (id NatRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/natRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName, id.NatRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Nat Rule ID -func (id NatRuleId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - resourceids.StaticSegment("staticNatRules", "natRules", "natRules"), - resourceids.UserSpecifiedSegment("natRuleName", "natRuleValue"), - } -} - -// String returns a human-readable description of this Nat Rule ID -func (id NatRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - fmt.Sprintf("Nat Rule Name: %q", id.NatRuleName), - } - return fmt.Sprintf("Nat Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_natrule_test.go b/resource-manager/network/2023-06-01/virtualwans/id_natrule_test.go deleted file mode 100644 index b690124379e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_natrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &NatRuleId{} - -func TestNewNatRuleID(t *testing.T) { - id := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } - - if id.NatRuleName != "natRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'NatRuleName'", id.NatRuleName, "natRuleValue") - } -} - -func TestFormatNatRuleID(t *testing.T) { - actual := NewNatRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "natRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNatRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue", - Expected: &NatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatRuleID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestParseNatRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NatRuleId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/nAtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue", - Expected: &NatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - NatRuleName: "natRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/natRules/natRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/nAtRuLeS/nAtRuLeVaLuE", - Expected: &NatRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - NatRuleName: "nAtRuLeVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/nAtRuLeS/nAtRuLeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNatRuleIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.NatRuleName != v.Expected.NatRuleName { - t.Fatalf("Expected %q but got %q for NatRuleName", v.Expected.NatRuleName, actual.NatRuleName) - } - - } -} - -func TestSegmentsForNatRuleId(t *testing.T) { - segments := NatRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NatRuleId 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/network/2023-06-01/virtualwans/id_networkvirtualappliance.go b/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance.go deleted file mode 100644 index 2dc156a927c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&NetworkVirtualApplianceId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceId{} - -// NetworkVirtualApplianceId is a struct representing the Resource ID for a Network Virtual Appliance -type NetworkVirtualApplianceId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string -} - -// NewNetworkVirtualApplianceID returns a new NetworkVirtualApplianceId struct -func NewNetworkVirtualApplianceID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string) NetworkVirtualApplianceId { - return NetworkVirtualApplianceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - } -} - -// ParseNetworkVirtualApplianceID parses 'input' into a NetworkVirtualApplianceId -func ParseNetworkVirtualApplianceID(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceIDInsensitively(input string) (*NetworkVirtualApplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceID checks that 'input' can be parsed as a Network Virtual Appliance ID -func ValidateNetworkVirtualApplianceID(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 := ParseNetworkVirtualApplianceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance ID -func (id NetworkVirtualApplianceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - } - return fmt.Sprintf("Network Virtual Appliance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance_test.go b/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance_test.go deleted file mode 100644 index bc012720867..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualappliance_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &NetworkVirtualApplianceId{} - -func TestNewNetworkVirtualApplianceID(t *testing.T) { - id := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } -} - -func TestFormatNetworkVirtualApplianceID(t *testing.T) { - actual := NewNetworkVirtualApplianceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestParseNetworkVirtualApplianceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Expected: &NetworkVirtualApplianceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceId(t *testing.T) { - segments := NetworkVirtualApplianceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceId 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/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection.go b/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection.go deleted file mode 100644 index d39f2a000d0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&NetworkVirtualApplianceConnectionId{}) -} - -var _ resourceids.ResourceId = &NetworkVirtualApplianceConnectionId{} - -// NetworkVirtualApplianceConnectionId is a struct representing the Resource ID for a Network Virtual Appliance Connection -type NetworkVirtualApplianceConnectionId struct { - SubscriptionId string - ResourceGroupName string - NetworkVirtualApplianceName string - NetworkVirtualApplianceConnectionName string -} - -// NewNetworkVirtualApplianceConnectionID returns a new NetworkVirtualApplianceConnectionId struct -func NewNetworkVirtualApplianceConnectionID(subscriptionId string, resourceGroupName string, networkVirtualApplianceName string, networkVirtualApplianceConnectionName string) NetworkVirtualApplianceConnectionId { - return NetworkVirtualApplianceConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - NetworkVirtualApplianceName: networkVirtualApplianceName, - NetworkVirtualApplianceConnectionName: networkVirtualApplianceConnectionName, - } -} - -// ParseNetworkVirtualApplianceConnectionID parses 'input' into a NetworkVirtualApplianceConnectionId -func ParseNetworkVirtualApplianceConnectionID(input string) (*NetworkVirtualApplianceConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseNetworkVirtualApplianceConnectionIDInsensitively parses 'input' case-insensitively into a NetworkVirtualApplianceConnectionId -// note: this method should only be used for API response data and not user input -func ParseNetworkVirtualApplianceConnectionIDInsensitively(input string) (*NetworkVirtualApplianceConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&NetworkVirtualApplianceConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := NetworkVirtualApplianceConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *NetworkVirtualApplianceConnectionId) 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.NetworkVirtualApplianceName, ok = input.Parsed["networkVirtualApplianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceName", input) - } - - if id.NetworkVirtualApplianceConnectionName, ok = input.Parsed["networkVirtualApplianceConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "networkVirtualApplianceConnectionName", input) - } - - return nil -} - -// ValidateNetworkVirtualApplianceConnectionID checks that 'input' can be parsed as a Network Virtual Appliance Connection ID -func ValidateNetworkVirtualApplianceConnectionID(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 := ParseNetworkVirtualApplianceConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Network Virtual Appliance Connection ID -func (id NetworkVirtualApplianceConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/networkVirtualAppliances/%s/networkVirtualApplianceConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.NetworkVirtualApplianceName, id.NetworkVirtualApplianceConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Network Virtual Appliance Connection ID -func (id NetworkVirtualApplianceConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticNetworkVirtualAppliances", "networkVirtualAppliances", "networkVirtualAppliances"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceName", "networkVirtualApplianceValue"), - resourceids.StaticSegment("staticNetworkVirtualApplianceConnections", "networkVirtualApplianceConnections", "networkVirtualApplianceConnections"), - resourceids.UserSpecifiedSegment("networkVirtualApplianceConnectionName", "networkVirtualApplianceConnectionValue"), - } -} - -// String returns a human-readable description of this Network Virtual Appliance Connection ID -func (id NetworkVirtualApplianceConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Network Virtual Appliance Name: %q", id.NetworkVirtualApplianceName), - fmt.Sprintf("Network Virtual Appliance Connection Name: %q", id.NetworkVirtualApplianceConnectionName), - } - return fmt.Sprintf("Network Virtual Appliance Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection_test.go b/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection_test.go deleted file mode 100644 index 2064eae07fd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_networkvirtualapplianceconnection_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &NetworkVirtualApplianceConnectionId{} - -func TestNewNetworkVirtualApplianceConnectionID(t *testing.T) { - id := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "networkVirtualApplianceConnectionValue") - - 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.NetworkVirtualApplianceName != "networkVirtualApplianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceName'", id.NetworkVirtualApplianceName, "networkVirtualApplianceValue") - } - - if id.NetworkVirtualApplianceConnectionName != "networkVirtualApplianceConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'NetworkVirtualApplianceConnectionName'", id.NetworkVirtualApplianceConnectionName, "networkVirtualApplianceConnectionValue") - } -} - -func TestFormatNetworkVirtualApplianceConnectionID(t *testing.T) { - actual := NewNetworkVirtualApplianceConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "networkVirtualApplianceValue", "networkVirtualApplianceConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections/networkVirtualApplianceConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseNetworkVirtualApplianceConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections/networkVirtualApplianceConnectionValue", - Expected: &NetworkVirtualApplianceConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections/networkVirtualApplianceConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceConnectionID(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.NetworkVirtualApplianceConnectionName != v.Expected.NetworkVirtualApplianceConnectionName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceConnectionName", v.Expected.NetworkVirtualApplianceConnectionName, actual.NetworkVirtualApplianceConnectionName) - } - - } -} - -func TestParseNetworkVirtualApplianceConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *NetworkVirtualApplianceConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections/networkVirtualApplianceConnectionValue", - Expected: &NetworkVirtualApplianceConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - NetworkVirtualApplianceName: "networkVirtualApplianceValue", - NetworkVirtualApplianceConnectionName: "networkVirtualApplianceConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/networkVirtualAppliances/networkVirtualApplianceValue/networkVirtualApplianceConnections/networkVirtualApplianceConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnVaLuE", - Expected: &NetworkVirtualApplianceConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - NetworkVirtualApplianceName: "nEtWoRkViRtUaLaPpLiAnCeVaLuE", - NetworkVirtualApplianceConnectionName: "nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/nEtWoRkViRtUaLaPpLiAnCeS/nEtWoRkViRtUaLaPpLiAnCeVaLuE/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnS/nEtWoRkViRtUaLaPpLiAnCeCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseNetworkVirtualApplianceConnectionIDInsensitively(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.NetworkVirtualApplianceName != v.Expected.NetworkVirtualApplianceName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceName", v.Expected.NetworkVirtualApplianceName, actual.NetworkVirtualApplianceName) - } - - if actual.NetworkVirtualApplianceConnectionName != v.Expected.NetworkVirtualApplianceConnectionName { - t.Fatalf("Expected %q but got %q for NetworkVirtualApplianceConnectionName", v.Expected.NetworkVirtualApplianceConnectionName, actual.NetworkVirtualApplianceConnectionName) - } - - } -} - -func TestSegmentsForNetworkVirtualApplianceConnectionId(t *testing.T) { - segments := NetworkVirtualApplianceConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("NetworkVirtualApplianceConnectionId 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/network/2023-06-01/virtualwans/id_routemap.go b/resource-manager/network/2023-06-01/virtualwans/id_routemap.go deleted file mode 100644 index c95aeaafbfd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_routemap.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&RouteMapId{}) -} - -var _ resourceids.ResourceId = &RouteMapId{} - -// RouteMapId is a struct representing the Resource ID for a Route Map -type RouteMapId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - RouteMapName string -} - -// NewRouteMapID returns a new RouteMapId struct -func NewRouteMapID(subscriptionId string, resourceGroupName string, virtualHubName string, routeMapName string) RouteMapId { - return RouteMapId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - RouteMapName: routeMapName, - } -} - -// ParseRouteMapID parses 'input' into a RouteMapId -func ParseRouteMapID(input string) (*RouteMapId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteMapId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteMapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRouteMapIDInsensitively parses 'input' case-insensitively into a RouteMapId -// note: this method should only be used for API response data and not user input -func ParseRouteMapIDInsensitively(input string) (*RouteMapId, error) { - parser := resourceids.NewParserFromResourceIdType(&RouteMapId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RouteMapId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RouteMapId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.RouteMapName, ok = input.Parsed["routeMapName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeMapName", input) - } - - return nil -} - -// ValidateRouteMapID checks that 'input' can be parsed as a Route Map ID -func ValidateRouteMapID(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 := ParseRouteMapID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Route Map ID -func (id RouteMapId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/routeMaps/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.RouteMapName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Route Map ID -func (id RouteMapId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticRouteMaps", "routeMaps", "routeMaps"), - resourceids.UserSpecifiedSegment("routeMapName", "routeMapValue"), - } -} - -// String returns a human-readable description of this Route Map ID -func (id RouteMapId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Route Map Name: %q", id.RouteMapName), - } - return fmt.Sprintf("Route Map (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_routemap_test.go b/resource-manager/network/2023-06-01/virtualwans/id_routemap_test.go deleted file mode 100644 index b0661e538c3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_routemap_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &RouteMapId{} - -func TestNewRouteMapID(t *testing.T) { - id := NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.RouteMapName != "routeMapValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteMapName'", id.RouteMapName, "routeMapValue") - } -} - -func TestFormatRouteMapID(t *testing.T) { - actual := NewRouteMapID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeMapValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRouteMapID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteMapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue", - Expected: &RouteMapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteMapName: "routeMapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteMapID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteMapName != v.Expected.RouteMapName { - t.Fatalf("Expected %q but got %q for RouteMapName", v.Expected.RouteMapName, actual.RouteMapName) - } - - } -} - -func TestParseRouteMapIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RouteMapId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeMaPs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue", - Expected: &RouteMapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteMapName: "routeMapValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeMaps/routeMapValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeMaPs/rOuTeMaPvAlUe", - Expected: &RouteMapId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - RouteMapName: "rOuTeMaPvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeMaPs/rOuTeMaPvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRouteMapIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteMapName != v.Expected.RouteMapName { - t.Fatalf("Expected %q but got %q for RouteMapName", v.Expected.RouteMapName, actual.RouteMapName) - } - - } -} - -func TestSegmentsForRouteMapId(t *testing.T) { - segments := RouteMapId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RouteMapId 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/network/2023-06-01/virtualwans/id_routingintent.go b/resource-manager/network/2023-06-01/virtualwans/id_routingintent.go deleted file mode 100644 index de16e7a3861..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_routingintent.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&RoutingIntentId{}) -} - -var _ resourceids.ResourceId = &RoutingIntentId{} - -// RoutingIntentId is a struct representing the Resource ID for a Routing Intent -type RoutingIntentId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - RoutingIntentName string -} - -// NewRoutingIntentID returns a new RoutingIntentId struct -func NewRoutingIntentID(subscriptionId string, resourceGroupName string, virtualHubName string, routingIntentName string) RoutingIntentId { - return RoutingIntentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - RoutingIntentName: routingIntentName, - } -} - -// ParseRoutingIntentID parses 'input' into a RoutingIntentId -func ParseRoutingIntentID(input string) (*RoutingIntentId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoutingIntentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoutingIntentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoutingIntentIDInsensitively parses 'input' case-insensitively into a RoutingIntentId -// note: this method should only be used for API response data and not user input -func ParseRoutingIntentIDInsensitively(input string) (*RoutingIntentId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoutingIntentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoutingIntentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoutingIntentId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.RoutingIntentName, ok = input.Parsed["routingIntentName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routingIntentName", input) - } - - return nil -} - -// ValidateRoutingIntentID checks that 'input' can be parsed as a Routing Intent ID -func ValidateRoutingIntentID(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 := ParseRoutingIntentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Routing Intent ID -func (id RoutingIntentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/routingIntent/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.RoutingIntentName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Routing Intent ID -func (id RoutingIntentId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticRoutingIntent", "routingIntent", "routingIntent"), - resourceids.UserSpecifiedSegment("routingIntentName", "routingIntentValue"), - } -} - -// String returns a human-readable description of this Routing Intent ID -func (id RoutingIntentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Routing Intent Name: %q", id.RoutingIntentName), - } - return fmt.Sprintf("Routing Intent (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_routingintent_test.go b/resource-manager/network/2023-06-01/virtualwans/id_routingintent_test.go deleted file mode 100644 index a8c7a11ca58..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_routingintent_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &RoutingIntentId{} - -func TestNewRoutingIntentID(t *testing.T) { - id := NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.RoutingIntentName != "routingIntentValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoutingIntentName'", id.RoutingIntentName, "routingIntentValue") - } -} - -func TestFormatRoutingIntentID(t *testing.T) { - actual := NewRoutingIntentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routingIntentValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoutingIntentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoutingIntentId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue", - Expected: &RoutingIntentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RoutingIntentName: "routingIntentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoutingIntentID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RoutingIntentName != v.Expected.RoutingIntentName { - t.Fatalf("Expected %q but got %q for RoutingIntentName", v.Expected.RoutingIntentName, actual.RoutingIntentName) - } - - } -} - -func TestParseRoutingIntentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoutingIntentId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTiNgInTeNt", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue", - Expected: &RoutingIntentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RoutingIntentName: "routingIntentValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routingIntent/routingIntentValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTiNgInTeNt/rOuTiNgInTeNtVaLuE", - Expected: &RoutingIntentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - RoutingIntentName: "rOuTiNgInTeNtVaLuE", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTiNgInTeNt/rOuTiNgInTeNtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoutingIntentIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RoutingIntentName != v.Expected.RoutingIntentName { - t.Fatalf("Expected %q but got %q for RoutingIntentName", v.Expected.RoutingIntentName, actual.RoutingIntentName) - } - - } -} - -func TestSegmentsForRoutingIntentId(t *testing.T) { - segments := RoutingIntentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoutingIntentId 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/network/2023-06-01/virtualwans/id_virtualhub.go b/resource-manager/network/2023-06-01/virtualwans/id_virtualhub.go deleted file mode 100644 index ec4a18686e5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_virtualhub.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VirtualHubId{}) -} - -var _ resourceids.ResourceId = &VirtualHubId{} - -// VirtualHubId is a struct representing the Resource ID for a Virtual Hub -type VirtualHubId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string -} - -// NewVirtualHubID returns a new VirtualHubId struct -func NewVirtualHubID(subscriptionId string, resourceGroupName string, virtualHubName string) VirtualHubId { - return VirtualHubId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - } -} - -// ParseVirtualHubID parses 'input' into a VirtualHubId -func ParseVirtualHubID(input string) (*VirtualHubId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualHubIDInsensitively parses 'input' case-insensitively into a VirtualHubId -// note: this method should only be used for API response data and not user input -func ParseVirtualHubIDInsensitively(input string) (*VirtualHubId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualHubId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - return nil -} - -// ValidateVirtualHubID checks that 'input' can be parsed as a Virtual Hub ID -func ValidateVirtualHubID(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 := ParseVirtualHubID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Hub ID -func (id VirtualHubId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Hub ID -func (id VirtualHubId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - } -} - -// String returns a human-readable description of this Virtual Hub ID -func (id VirtualHubId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - } - return fmt.Sprintf("Virtual Hub (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_virtualhub_test.go b/resource-manager/network/2023-06-01/virtualwans/id_virtualhub_test.go deleted file mode 100644 index 2ac9a8ca472..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_virtualhub_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VirtualHubId{} - -func TestNewVirtualHubID(t *testing.T) { - id := NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } -} - -func TestFormatVirtualHubID(t *testing.T) { - actual := NewVirtualHubID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualHubID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Expected: &VirtualHubId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - } -} - -func TestParseVirtualHubIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Expected: &VirtualHubId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Expected: &VirtualHubId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - } -} - -func TestSegmentsForVirtualHubId(t *testing.T) { - segments := VirtualHubId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualHubId 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/network/2023-06-01/virtualwans/id_virtualhubroutetable.go b/resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable.go deleted file mode 100644 index b2cd55910b3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&VirtualHubRouteTableId{}) -} - -var _ resourceids.ResourceId = &VirtualHubRouteTableId{} - -// VirtualHubRouteTableId is a struct representing the Resource ID for a Virtual Hub Route Table -type VirtualHubRouteTableId struct { - SubscriptionId string - ResourceGroupName string - VirtualHubName string - RouteTableName string -} - -// NewVirtualHubRouteTableID returns a new VirtualHubRouteTableId struct -func NewVirtualHubRouteTableID(subscriptionId string, resourceGroupName string, virtualHubName string, routeTableName string) VirtualHubRouteTableId { - return VirtualHubRouteTableId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualHubName: virtualHubName, - RouteTableName: routeTableName, - } -} - -// ParseVirtualHubRouteTableID parses 'input' into a VirtualHubRouteTableId -func ParseVirtualHubRouteTableID(input string) (*VirtualHubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubRouteTableId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualHubRouteTableIDInsensitively parses 'input' case-insensitively into a VirtualHubRouteTableId -// note: this method should only be used for API response data and not user input -func ParseVirtualHubRouteTableIDInsensitively(input string) (*VirtualHubRouteTableId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualHubRouteTableId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualHubRouteTableId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualHubRouteTableId) 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.VirtualHubName, ok = input.Parsed["virtualHubName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualHubName", input) - } - - if id.RouteTableName, ok = input.Parsed["routeTableName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "routeTableName", input) - } - - return nil -} - -// ValidateVirtualHubRouteTableID checks that 'input' can be parsed as a Virtual Hub Route Table ID -func ValidateVirtualHubRouteTableID(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 := ParseVirtualHubRouteTableID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Hub Route Table ID -func (id VirtualHubRouteTableId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualHubs/%s/routeTables/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualHubName, id.RouteTableName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Hub Route Table ID -func (id VirtualHubRouteTableId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualHubs", "virtualHubs", "virtualHubs"), - resourceids.UserSpecifiedSegment("virtualHubName", "virtualHubValue"), - resourceids.StaticSegment("staticRouteTables", "routeTables", "routeTables"), - resourceids.UserSpecifiedSegment("routeTableName", "routeTableValue"), - } -} - -// String returns a human-readable description of this Virtual Hub Route Table ID -func (id VirtualHubRouteTableId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Hub Name: %q", id.VirtualHubName), - fmt.Sprintf("Route Table Name: %q", id.RouteTableName), - } - return fmt.Sprintf("Virtual Hub Route Table (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable_test.go b/resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable_test.go deleted file mode 100644 index ea31b766b38..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_virtualhubroutetable_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &VirtualHubRouteTableId{} - -func TestNewVirtualHubRouteTableID(t *testing.T) { - id := NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue") - - 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.VirtualHubName != "virtualHubValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualHubName'", id.VirtualHubName, "virtualHubValue") - } - - if id.RouteTableName != "routeTableValue" { - t.Fatalf("Expected %q but got %q for Segment 'RouteTableName'", id.RouteTableName, "routeTableValue") - } -} - -func TestFormatVirtualHubRouteTableID(t *testing.T) { - actual := NewVirtualHubRouteTableID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualHubValue", "routeTableValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualHubRouteTableID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue", - Expected: &VirtualHubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubRouteTableID(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestParseVirtualHubRouteTableIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualHubRouteTableId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeTaBlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue", - Expected: &VirtualHubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualHubName: "virtualHubValue", - RouteTableName: "routeTableValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualHubs/virtualHubValue/routeTables/routeTableValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeTaBlEs/rOuTeTaBlEvAlUe", - Expected: &VirtualHubRouteTableId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualHubName: "vIrTuAlHuBvAlUe", - RouteTableName: "rOuTeTaBlEvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlHuBs/vIrTuAlHuBvAlUe/rOuTeTaBlEs/rOuTeTaBlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualHubRouteTableIDInsensitively(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.VirtualHubName != v.Expected.VirtualHubName { - t.Fatalf("Expected %q but got %q for VirtualHubName", v.Expected.VirtualHubName, actual.VirtualHubName) - } - - if actual.RouteTableName != v.Expected.RouteTableName { - t.Fatalf("Expected %q but got %q for RouteTableName", v.Expected.RouteTableName, actual.RouteTableName) - } - - } -} - -func TestSegmentsForVirtualHubRouteTableId(t *testing.T) { - segments := VirtualHubRouteTableId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualHubRouteTableId 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/network/2023-06-01/virtualwans/id_virtualwan.go b/resource-manager/network/2023-06-01/virtualwans/id_virtualwan.go deleted file mode 100644 index e8489bfa13e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_virtualwan.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VirtualWANId{}) -} - -var _ resourceids.ResourceId = &VirtualWANId{} - -// VirtualWANId is a struct representing the Resource ID for a Virtual W A N -type VirtualWANId struct { - SubscriptionId string - ResourceGroupName string - VirtualWanName string -} - -// NewVirtualWANID returns a new VirtualWANId struct -func NewVirtualWANID(subscriptionId string, resourceGroupName string, virtualWanName string) VirtualWANId { - return VirtualWANId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualWanName: virtualWanName, - } -} - -// ParseVirtualWANID parses 'input' into a VirtualWANId -func ParseVirtualWANID(input string) (*VirtualWANId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualWANId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualWANId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualWANIDInsensitively parses 'input' case-insensitively into a VirtualWANId -// note: this method should only be used for API response data and not user input -func ParseVirtualWANIDInsensitively(input string) (*VirtualWANId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualWANId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualWANId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualWANId) 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.VirtualWanName, ok = input.Parsed["virtualWanName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualWanName", input) - } - - return nil -} - -// ValidateVirtualWANID checks that 'input' can be parsed as a Virtual W A N ID -func ValidateVirtualWANID(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 := ParseVirtualWANID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual W A N ID -func (id VirtualWANId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/virtualWans/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualWanName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual W A N ID -func (id VirtualWANId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVirtualWans", "virtualWans", "virtualWans"), - resourceids.UserSpecifiedSegment("virtualWanName", "virtualWanValue"), - } -} - -// String returns a human-readable description of this Virtual W A N ID -func (id VirtualWANId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Wan Name: %q", id.VirtualWanName), - } - return fmt.Sprintf("Virtual W A N (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_virtualwan_test.go b/resource-manager/network/2023-06-01/virtualwans/id_virtualwan_test.go deleted file mode 100644 index 7a315c1c373..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_virtualwan_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VirtualWANId{} - -func TestNewVirtualWANID(t *testing.T) { - id := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue") - - 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.VirtualWanName != "virtualWanValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualWanName'", id.VirtualWanName, "virtualWanValue") - } -} - -func TestFormatVirtualWANID(t *testing.T) { - actual := NewVirtualWANID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualWanValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualWANID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualWANId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue", - Expected: &VirtualWANId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualWANID(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.VirtualWanName != v.Expected.VirtualWanName { - t.Fatalf("Expected %q but got %q for VirtualWanName", v.Expected.VirtualWanName, actual.VirtualWanName) - } - - } -} - -func TestParseVirtualWANIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualWANId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlWaNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue", - Expected: &VirtualWANId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualWanName: "virtualWanValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/virtualWans/virtualWanValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vIrTuAlWaNs/vIrTuAlWaNvAlUe", - Expected: &VirtualWANId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualWanName: "vIrTuAlWaNvAlUe", - }, - }, - { - // 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.nEtWoRk/vIrTuAlWaNs/vIrTuAlWaNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualWANIDInsensitively(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.VirtualWanName != v.Expected.VirtualWanName { - t.Fatalf("Expected %q but got %q for VirtualWanName", v.Expected.VirtualWanName, actual.VirtualWanName) - } - - } -} - -func TestSegmentsForVirtualWANId(t *testing.T) { - segments := VirtualWANId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualWANId 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/network/2023-06-01/virtualwans/id_vpngateway.go b/resource-manager/network/2023-06-01/virtualwans/id_vpngateway.go deleted file mode 100644 index 6889f4d78bc..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpngateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VpnGatewayId{}) -} - -var _ resourceids.ResourceId = &VpnGatewayId{} - -// VpnGatewayId is a struct representing the Resource ID for a Vpn Gateway -type VpnGatewayId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string -} - -// NewVpnGatewayID returns a new VpnGatewayId struct -func NewVpnGatewayID(subscriptionId string, resourceGroupName string, vpnGatewayName string) VpnGatewayId { - return VpnGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - } -} - -// ParseVpnGatewayID parses 'input' into a VpnGatewayId -func ParseVpnGatewayID(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnGatewayIDInsensitively parses 'input' case-insensitively into a VpnGatewayId -// note: this method should only be used for API response data and not user input -func ParseVpnGatewayIDInsensitively(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnGatewayId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - return nil -} - -// ValidateVpnGatewayID checks that 'input' can be parsed as a Vpn Gateway ID -func ValidateVpnGatewayID(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 := ParseVpnGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Gateway ID -func (id VpnGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Gateway ID -func (id VpnGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - } -} - -// String returns a human-readable description of this Vpn Gateway ID -func (id VpnGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - } - return fmt.Sprintf("Vpn Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_vpngateway_test.go b/resource-manager/network/2023-06-01/virtualwans/id_vpngateway_test.go deleted file mode 100644 index 23428469e83..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpngateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VpnGatewayId{} - -func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } -} - -func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestParseVpnGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestSegmentsForVpnGatewayId(t *testing.T) { - segments := VpnGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnGatewayId 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/network/2023-06-01/virtualwans/id_vpnlinkconnection.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection.go deleted file mode 100644 index b40c9d3b7be..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package virtualwans - -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(&VpnLinkConnectionId{}) -} - -var _ resourceids.ResourceId = &VpnLinkConnectionId{} - -// VpnLinkConnectionId is a struct representing the Resource ID for a Vpn Link Connection -type VpnLinkConnectionId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string - VpnConnectionName string - VpnLinkConnectionName string -} - -// NewVpnLinkConnectionID returns a new VpnLinkConnectionId struct -func NewVpnLinkConnectionID(subscriptionId string, resourceGroupName string, vpnGatewayName string, vpnConnectionName string, vpnLinkConnectionName string) VpnLinkConnectionId { - return VpnLinkConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - VpnConnectionName: vpnConnectionName, - VpnLinkConnectionName: vpnLinkConnectionName, - } -} - -// ParseVpnLinkConnectionID parses 'input' into a VpnLinkConnectionId -func ParseVpnLinkConnectionID(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnLinkConnectionIDInsensitively parses 'input' case-insensitively into a VpnLinkConnectionId -// note: this method should only be used for API response data and not user input -func ParseVpnLinkConnectionIDInsensitively(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnLinkConnectionId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - if id.VpnConnectionName, ok = input.Parsed["vpnConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnConnectionName", input) - } - - if id.VpnLinkConnectionName, ok = input.Parsed["vpnLinkConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnLinkConnectionName", input) - } - - return nil -} - -// ValidateVpnLinkConnectionID checks that 'input' can be parsed as a Vpn Link Connection ID -func ValidateVpnLinkConnectionID(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 := ParseVpnLinkConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Link Connection ID -func (id VpnLinkConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/vpnConnections/%s/vpnLinkConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName, id.VpnConnectionName, id.VpnLinkConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Link Connection ID -func (id VpnLinkConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionValue"), - resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionValue"), - } -} - -// String returns a human-readable description of this Vpn Link Connection ID -func (id VpnLinkConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - fmt.Sprintf("Vpn Connection Name: %q", id.VpnConnectionName), - fmt.Sprintf("Vpn Link Connection Name: %q", id.VpnLinkConnectionName), - } - return fmt.Sprintf("Vpn Link Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection_test.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection_test.go deleted file mode 100644 index 1f3cece41e0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnlinkconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package virtualwans - -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 = &VpnLinkConnectionId{} - -func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } - - if id.VpnConnectionName != "vpnConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionValue") - } - - if id.VpnLinkConnectionName != "vpnLinkConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionValue") - } -} - -func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnLinkConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - VpnConnectionName: "vPnCoNnEcTiOnVaLuE", - VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestSegmentsForVpnLinkConnectionId(t *testing.T) { - segments := VpnLinkConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnLinkConnectionId 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/network/2023-06-01/virtualwans/id_vpnserverconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration.go deleted file mode 100644 index 604356fc28f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VpnServerConfigurationId{}) -} - -var _ resourceids.ResourceId = &VpnServerConfigurationId{} - -// VpnServerConfigurationId is a struct representing the Resource ID for a Vpn Server Configuration -type VpnServerConfigurationId struct { - SubscriptionId string - ResourceGroupName string - VpnServerConfigurationName string -} - -// NewVpnServerConfigurationID returns a new VpnServerConfigurationId struct -func NewVpnServerConfigurationID(subscriptionId string, resourceGroupName string, vpnServerConfigurationName string) VpnServerConfigurationId { - return VpnServerConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnServerConfigurationName: vpnServerConfigurationName, - } -} - -// ParseVpnServerConfigurationID parses 'input' into a VpnServerConfigurationId -func ParseVpnServerConfigurationID(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnServerConfigurationIDInsensitively parses 'input' case-insensitively into a VpnServerConfigurationId -// note: this method should only be used for API response data and not user input -func ParseVpnServerConfigurationIDInsensitively(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnServerConfigurationId) 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.VpnServerConfigurationName, ok = input.Parsed["vpnServerConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnServerConfigurationName", input) - } - - return nil -} - -// ValidateVpnServerConfigurationID checks that 'input' can be parsed as a Vpn Server Configuration ID -func ValidateVpnServerConfigurationID(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 := ParseVpnServerConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Server Configuration ID -func (id VpnServerConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnServerConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnServerConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Server Configuration ID -func (id VpnServerConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnServerConfigurations", "vpnServerConfigurations", "vpnServerConfigurations"), - resourceids.UserSpecifiedSegment("vpnServerConfigurationName", "vpnServerConfigurationValue"), - } -} - -// String returns a human-readable description of this Vpn Server Configuration ID -func (id VpnServerConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Server Configuration Name: %q", id.VpnServerConfigurationName), - } - return fmt.Sprintf("Vpn Server Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration_test.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration_test.go deleted file mode 100644 index 6ac256477b7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnserverconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VpnServerConfigurationId{} - -func TestNewVpnServerConfigurationID(t *testing.T) { - id := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - - 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.VpnServerConfigurationName != "vpnServerConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnServerConfigurationName'", id.VpnServerConfigurationName, "vpnServerConfigurationValue") - } -} - -func TestFormatVpnServerConfigurationID(t *testing.T) { - actual := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnServerConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationID(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestParseVpnServerConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnServerConfigurationName: "vPnSeRvErCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationIDInsensitively(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestSegmentsForVpnServerConfigurationId(t *testing.T) { - segments := VpnServerConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnServerConfigurationId 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/network/2023-06-01/virtualwans/id_vpnsite.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnsite.go deleted file mode 100644 index 4e20baefd21..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnsite.go +++ /dev/null @@ -1,130 +0,0 @@ -package virtualwans - -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(&VpnSiteId{}) -} - -var _ resourceids.ResourceId = &VpnSiteId{} - -// VpnSiteId is a struct representing the Resource ID for a Vpn Site -type VpnSiteId struct { - SubscriptionId string - ResourceGroupName string - VpnSiteName string -} - -// NewVpnSiteID returns a new VpnSiteId struct -func NewVpnSiteID(subscriptionId string, resourceGroupName string, vpnSiteName string) VpnSiteId { - return VpnSiteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnSiteName: vpnSiteName, - } -} - -// ParseVpnSiteID parses 'input' into a VpnSiteId -func ParseVpnSiteID(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnSiteIDInsensitively parses 'input' case-insensitively into a VpnSiteId -// note: this method should only be used for API response data and not user input -func ParseVpnSiteIDInsensitively(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnSiteId) 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.VpnSiteName, ok = input.Parsed["vpnSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteName", input) - } - - return nil -} - -// ValidateVpnSiteID checks that 'input' can be parsed as a Vpn Site ID -func ValidateVpnSiteID(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 := ParseVpnSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Site ID -func (id VpnSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnSiteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Site ID -func (id VpnSiteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnSites", "vpnSites", "vpnSites"), - resourceids.UserSpecifiedSegment("vpnSiteName", "vpnSiteValue"), - } -} - -// String returns a human-readable description of this Vpn Site ID -func (id VpnSiteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Site Name: %q", id.VpnSiteName), - } - return fmt.Sprintf("Vpn Site (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_vpnsite_test.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnsite_test.go deleted file mode 100644 index 22ab26df887..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnsite_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package virtualwans - -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 = &VpnSiteId{} - -func TestNewVpnSiteID(t *testing.T) { - id := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - - 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.VpnSiteName != "vpnSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteName'", id.VpnSiteName, "vpnSiteValue") - } -} - -func TestFormatVpnSiteID(t *testing.T) { - actual := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteID(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestParseVpnSiteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnSiteName: "vPnSiTeVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteIDInsensitively(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestSegmentsForVpnSiteId(t *testing.T) { - segments := VpnSiteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnSiteId 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/network/2023-06-01/virtualwans/id_vpnsitelink.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink.go deleted file mode 100644 index a0b1676b210..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink.go +++ /dev/null @@ -1,139 +0,0 @@ -package virtualwans - -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(&VpnSiteLinkId{}) -} - -var _ resourceids.ResourceId = &VpnSiteLinkId{} - -// VpnSiteLinkId is a struct representing the Resource ID for a Vpn Site Link -type VpnSiteLinkId struct { - SubscriptionId string - ResourceGroupName string - VpnSiteName string - VpnSiteLinkName string -} - -// NewVpnSiteLinkID returns a new VpnSiteLinkId struct -func NewVpnSiteLinkID(subscriptionId string, resourceGroupName string, vpnSiteName string, vpnSiteLinkName string) VpnSiteLinkId { - return VpnSiteLinkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnSiteName: vpnSiteName, - VpnSiteLinkName: vpnSiteLinkName, - } -} - -// ParseVpnSiteLinkID parses 'input' into a VpnSiteLinkId -func ParseVpnSiteLinkID(input string) (*VpnSiteLinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteLinkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteLinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnSiteLinkIDInsensitively parses 'input' case-insensitively into a VpnSiteLinkId -// note: this method should only be used for API response data and not user input -func ParseVpnSiteLinkIDInsensitively(input string) (*VpnSiteLinkId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteLinkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteLinkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnSiteLinkId) 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.VpnSiteName, ok = input.Parsed["vpnSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteName", input) - } - - if id.VpnSiteLinkName, ok = input.Parsed["vpnSiteLinkName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteLinkName", input) - } - - return nil -} - -// ValidateVpnSiteLinkID checks that 'input' can be parsed as a Vpn Site Link ID -func ValidateVpnSiteLinkID(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 := ParseVpnSiteLinkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Site Link ID -func (id VpnSiteLinkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnSites/%s/vpnSiteLinks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnSiteName, id.VpnSiteLinkName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Site Link ID -func (id VpnSiteLinkId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnSites", "vpnSites", "vpnSites"), - resourceids.UserSpecifiedSegment("vpnSiteName", "vpnSiteValue"), - resourceids.StaticSegment("staticVpnSiteLinks", "vpnSiteLinks", "vpnSiteLinks"), - resourceids.UserSpecifiedSegment("vpnSiteLinkName", "vpnSiteLinkValue"), - } -} - -// String returns a human-readable description of this Vpn Site Link ID -func (id VpnSiteLinkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Site Name: %q", id.VpnSiteName), - fmt.Sprintf("Vpn Site Link Name: %q", id.VpnSiteLinkName), - } - return fmt.Sprintf("Vpn Site Link (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink_test.go b/resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink_test.go deleted file mode 100644 index c774c31735b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/id_vpnsitelink_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package virtualwans - -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 = &VpnSiteLinkId{} - -func TestNewVpnSiteLinkID(t *testing.T) { - id := NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue") - - 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.VpnSiteName != "vpnSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteName'", id.VpnSiteName, "vpnSiteValue") - } - - if id.VpnSiteLinkName != "vpnSiteLinkValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteLinkName'", id.VpnSiteLinkName, "vpnSiteLinkValue") - } -} - -func TestFormatVpnSiteLinkID(t *testing.T) { - actual := NewVpnSiteLinkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue", "vpnSiteLinkValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnSiteLinkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteLinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue", - Expected: &VpnSiteLinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - VpnSiteLinkName: "vpnSiteLinkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteLinkID(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - if actual.VpnSiteLinkName != v.Expected.VpnSiteLinkName { - t.Fatalf("Expected %q but got %q for VpnSiteLinkName", v.Expected.VpnSiteLinkName, actual.VpnSiteLinkName) - } - - } -} - -func TestParseVpnSiteLinkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteLinkId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/vPnSiTeLiNkS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue", - Expected: &VpnSiteLinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - VpnSiteLinkName: "vpnSiteLinkValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/vpnSiteLinks/vpnSiteLinkValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/vPnSiTeLiNkS/vPnSiTeLiNkVaLuE", - Expected: &VpnSiteLinkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnSiteName: "vPnSiTeVaLuE", - VpnSiteLinkName: "vPnSiTeLiNkVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/vPnSiTeLiNkS/vPnSiTeLiNkVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteLinkIDInsensitively(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - if actual.VpnSiteLinkName != v.Expected.VpnSiteLinkName { - t.Fatalf("Expected %q but got %q for VpnSiteLinkName", v.Expected.VpnSiteLinkName, actual.VpnSiteLinkName) - } - - } -} - -func TestSegmentsForVpnSiteLinkId(t *testing.T) { - segments := VpnSiteLinkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnSiteLinkId 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/network/2023-06-01/virtualwans/method_configurationpolicygroupscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupscreateorupdate.go deleted file mode 100644 index 391d34a222a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsCreateOrUpdate ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsCreateOrUpdate(ctx context.Context, id ConfigurationPolicyGroupId, input VpnServerConfigurationPolicyGroup) (result ConfigurationPolicyGroupsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// ConfigurationPolicyGroupsCreateOrUpdateThenPoll performs ConfigurationPolicyGroupsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) ConfigurationPolicyGroupsCreateOrUpdateThenPoll(ctx context.Context, id ConfigurationPolicyGroupId, input VpnServerConfigurationPolicyGroup) error { - result, err := c.ConfigurationPolicyGroupsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing ConfigurationPolicyGroupsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationPolicyGroupsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsdelete.go deleted file mode 100644 index faabc47e666..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ConfigurationPolicyGroupsDelete ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsDelete(ctx context.Context, id ConfigurationPolicyGroupId) (result ConfigurationPolicyGroupsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// ConfigurationPolicyGroupsDeleteThenPoll performs ConfigurationPolicyGroupsDelete then polls until it's completed -func (c VirtualWANsClient) ConfigurationPolicyGroupsDeleteThenPoll(ctx context.Context, id ConfigurationPolicyGroupId) error { - result, err := c.ConfigurationPolicyGroupsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing ConfigurationPolicyGroupsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ConfigurationPolicyGroupsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsget.go b/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsget.go deleted file mode 100644 index 491fc15d5b2..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsGet ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsGet(ctx context.Context, id ConfigurationPolicyGroupId) (result ConfigurationPolicyGroupsGetOperationResponse, 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 VpnServerConfigurationPolicyGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go deleted file mode 100644 index ee941b39307..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_configurationpolicygroupslistbyvpnserverconfiguration.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 ConfigurationPolicyGroupsListByVpnServerConfigurationOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnServerConfigurationPolicyGroup -} - -type ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnServerConfigurationPolicyGroup -} - -// ConfigurationPolicyGroupsListByVpnServerConfiguration ... -func (c VirtualWANsClient) ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx context.Context, id VpnServerConfigurationId) (result ConfigurationPolicyGroupsListByVpnServerConfigurationOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/configurationPolicyGroups", 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 *[]VpnServerConfigurationPolicyGroup `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ConfigurationPolicyGroupsListByVpnServerConfigurationComplete retrieves all the results into a single object -func (c VirtualWANsClient) ConfigurationPolicyGroupsListByVpnServerConfigurationComplete(ctx context.Context, id VpnServerConfigurationId) (ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult, error) { - return c.ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteMatchingPredicate(ctx, id, VpnServerConfigurationPolicyGroupOperationPredicate{}) -} - -// ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteMatchingPredicate(ctx context.Context, id VpnServerConfigurationId, predicate VpnServerConfigurationPolicyGroupOperationPredicate) (result ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult, err error) { - items := make([]VpnServerConfigurationPolicyGroup, 0) - - resp, err := c.ConfigurationPolicyGroupsListByVpnServerConfiguration(ctx, id) - if err != nil { - 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 = ConfigurationPolicyGroupsListByVpnServerConfigurationCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go b/resource-manager/network/2023-06-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go deleted file mode 100644 index aed56fdab18..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_generatevirtualwanvpnserverconfigurationvpnprofile.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 GeneratevirtualwanvpnserverconfigurationvpnprofileOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnProfileResponse -} - -// Generatevirtualwanvpnserverconfigurationvpnprofile ... -func (c VirtualWANsClient) Generatevirtualwanvpnserverconfigurationvpnprofile(ctx context.Context, id VirtualWANId, input VirtualWanVpnProfileParameters) (result GeneratevirtualwanvpnserverconfigurationvpnprofileOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/generateVpnProfile", 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 -} - -// GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll performs Generatevirtualwanvpnserverconfigurationvpnprofile then polls until it's completed -func (c VirtualWANsClient) GeneratevirtualwanvpnserverconfigurationvpnprofileThenPoll(ctx context.Context, id VirtualWANId, input VirtualWanVpnProfileParameters) error { - result, err := c.Generatevirtualwanvpnserverconfigurationvpnprofile(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Generatevirtualwanvpnserverconfigurationvpnprofile: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Generatevirtualwanvpnserverconfigurationvpnprofile: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablescreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablescreateorupdate.go deleted file mode 100644 index 58545e66cc2..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 HubRouteTablesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *HubRouteTable -} - -// HubRouteTablesCreateOrUpdate ... -func (c VirtualWANsClient) HubRouteTablesCreateOrUpdate(ctx context.Context, id HubRouteTableId, input HubRouteTable) (result HubRouteTablesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// HubRouteTablesCreateOrUpdateThenPoll performs HubRouteTablesCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) HubRouteTablesCreateOrUpdateThenPoll(ctx context.Context, id HubRouteTableId, input HubRouteTable) error { - result, err := c.HubRouteTablesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing HubRouteTablesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubRouteTablesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesdelete.go deleted file mode 100644 index e51f251c714..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 HubRouteTablesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// HubRouteTablesDelete ... -func (c VirtualWANsClient) HubRouteTablesDelete(ctx context.Context, id HubRouteTableId) (result HubRouteTablesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// HubRouteTablesDeleteThenPoll performs HubRouteTablesDelete then polls until it's completed -func (c VirtualWANsClient) HubRouteTablesDeleteThenPoll(ctx context.Context, id HubRouteTableId) error { - result, err := c.HubRouteTablesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing HubRouteTablesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubRouteTablesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesget.go b/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesget.go deleted file mode 100644 index 36dc9467d46..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetablesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 HubRouteTablesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HubRouteTable -} - -// HubRouteTablesGet ... -func (c VirtualWANsClient) HubRouteTablesGet(ctx context.Context, id HubRouteTableId) (result HubRouteTablesGetOperationResponse, 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 HubRouteTable - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetableslist.go b/resource-manager/network/2023-06-01/virtualwans/method_hubroutetableslist.go deleted file mode 100644 index a38e5d16297..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubroutetableslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 HubRouteTablesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HubRouteTable -} - -type HubRouteTablesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HubRouteTable -} - -// HubRouteTablesList ... -func (c VirtualWANsClient) HubRouteTablesList(ctx context.Context, id VirtualHubId) (result HubRouteTablesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/hubRouteTables", 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 *[]HubRouteTable `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// HubRouteTablesListComplete retrieves all the results into a single object -func (c VirtualWANsClient) HubRouteTablesListComplete(ctx context.Context, id VirtualHubId) (HubRouteTablesListCompleteResult, error) { - return c.HubRouteTablesListCompleteMatchingPredicate(ctx, id, HubRouteTableOperationPredicate{}) -} - -// HubRouteTablesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) HubRouteTablesListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate HubRouteTableOperationPredicate) (result HubRouteTablesListCompleteResult, err error) { - items := make([]HubRouteTable, 0) - - resp, err := c.HubRouteTablesList(ctx, id) - if err != nil { - 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 = HubRouteTablesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go deleted file mode 100644 index 4353d1898c9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsCreateOrUpdate ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsCreateOrUpdate(ctx context.Context, id HubVirtualNetworkConnectionId, input HubVirtualNetworkConnection) (result HubVirtualNetworkConnectionsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// HubVirtualNetworkConnectionsCreateOrUpdateThenPoll performs HubVirtualNetworkConnectionsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) HubVirtualNetworkConnectionsCreateOrUpdateThenPoll(ctx context.Context, id HubVirtualNetworkConnectionId, input HubVirtualNetworkConnection) error { - result, err := c.HubVirtualNetworkConnectionsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing HubVirtualNetworkConnectionsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubVirtualNetworkConnectionsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go deleted file mode 100644 index d26ec8f61b8..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// HubVirtualNetworkConnectionsDelete ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsDelete(ctx context.Context, id HubVirtualNetworkConnectionId) (result HubVirtualNetworkConnectionsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// HubVirtualNetworkConnectionsDeleteThenPoll performs HubVirtualNetworkConnectionsDelete then polls until it's completed -func (c VirtualWANsClient) HubVirtualNetworkConnectionsDeleteThenPoll(ctx context.Context, id HubVirtualNetworkConnectionId) error { - result, err := c.HubVirtualNetworkConnectionsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing HubVirtualNetworkConnectionsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after HubVirtualNetworkConnectionsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsget.go b/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsget.go deleted file mode 100644 index 852857adc59..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsGet ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsGet(ctx context.Context, id HubVirtualNetworkConnectionId) (result HubVirtualNetworkConnectionsGetOperationResponse, 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 HubVirtualNetworkConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionslist.go b/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionslist.go deleted file mode 100644 index 03fc86d2e23..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_hubvirtualnetworkconnectionslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 HubVirtualNetworkConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HubVirtualNetworkConnection -} - -type HubVirtualNetworkConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HubVirtualNetworkConnection -} - -// HubVirtualNetworkConnectionsList ... -func (c VirtualWANsClient) HubVirtualNetworkConnectionsList(ctx context.Context, id VirtualHubId) (result HubVirtualNetworkConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/hubVirtualNetworkConnections", 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 *[]HubVirtualNetworkConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// HubVirtualNetworkConnectionsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) HubVirtualNetworkConnectionsListComplete(ctx context.Context, id VirtualHubId) (HubVirtualNetworkConnectionsListCompleteResult, error) { - return c.HubVirtualNetworkConnectionsListCompleteMatchingPredicate(ctx, id, HubVirtualNetworkConnectionOperationPredicate{}) -} - -// HubVirtualNetworkConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) HubVirtualNetworkConnectionsListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate HubVirtualNetworkConnectionOperationPredicate) (result HubVirtualNetworkConnectionsListCompleteResult, err error) { - items := make([]HubVirtualNetworkConnection, 0) - - resp, err := c.HubVirtualNetworkConnectionsList(ctx, id) - if err != nil { - 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 = HubVirtualNetworkConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_natrulescreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_natrulescreateorupdate.go deleted file mode 100644 index 168ea42291c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_natrulescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 NatRulesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGatewayNatRule -} - -// NatRulesCreateOrUpdate ... -func (c VirtualWANsClient) NatRulesCreateOrUpdate(ctx context.Context, id NatRuleId, input VpnGatewayNatRule) (result NatRulesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// NatRulesCreateOrUpdateThenPoll performs NatRulesCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) NatRulesCreateOrUpdateThenPoll(ctx context.Context, id NatRuleId, input VpnGatewayNatRule) error { - result, err := c.NatRulesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NatRulesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NatRulesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_natrulesdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_natrulesdelete.go deleted file mode 100644 index 6908f8fa7a2..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_natrulesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 NatRulesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// NatRulesDelete ... -func (c VirtualWANsClient) NatRulesDelete(ctx context.Context, id NatRuleId) (result NatRulesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// NatRulesDeleteThenPoll performs NatRulesDelete then polls until it's completed -func (c VirtualWANsClient) NatRulesDeleteThenPoll(ctx context.Context, id NatRuleId) error { - result, err := c.NatRulesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing NatRulesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NatRulesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_natrulesget.go b/resource-manager/network/2023-06-01/virtualwans/method_natrulesget.go deleted file mode 100644 index 9ba7ca45bea..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_natrulesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 NatRulesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnGatewayNatRule -} - -// NatRulesGet ... -func (c VirtualWANsClient) NatRulesGet(ctx context.Context, id NatRuleId) (result NatRulesGetOperationResponse, 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 VpnGatewayNatRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_natruleslistbyvpngateway.go b/resource-manager/network/2023-06-01/virtualwans/method_natruleslistbyvpngateway.go deleted file mode 100644 index aa511c80bb3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_natruleslistbyvpngateway.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 NatRulesListByVpnGatewayOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnGatewayNatRule -} - -type NatRulesListByVpnGatewayCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnGatewayNatRule -} - -// NatRulesListByVpnGateway ... -func (c VirtualWANsClient) NatRulesListByVpnGateway(ctx context.Context, id VpnGatewayId) (result NatRulesListByVpnGatewayOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/natRules", 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 *[]VpnGatewayNatRule `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NatRulesListByVpnGatewayComplete retrieves all the results into a single object -func (c VirtualWANsClient) NatRulesListByVpnGatewayComplete(ctx context.Context, id VpnGatewayId) (NatRulesListByVpnGatewayCompleteResult, error) { - return c.NatRulesListByVpnGatewayCompleteMatchingPredicate(ctx, id, VpnGatewayNatRuleOperationPredicate{}) -} - -// NatRulesListByVpnGatewayCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) NatRulesListByVpnGatewayCompleteMatchingPredicate(ctx context.Context, id VpnGatewayId, predicate VpnGatewayNatRuleOperationPredicate) (result NatRulesListByVpnGatewayCompleteResult, err error) { - items := make([]VpnGatewayNatRule, 0) - - resp, err := c.NatRulesListByVpnGateway(ctx, id) - if err != nil { - 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 = NatRulesListByVpnGatewayCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionscreateorupdate.go deleted file mode 100644 index 1bcdfbdee15..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 NetworkVirtualApplianceConnectionsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *NetworkVirtualApplianceConnection -} - -// NetworkVirtualApplianceConnectionsCreateOrUpdate ... -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsCreateOrUpdate(ctx context.Context, id NetworkVirtualApplianceConnectionId, input NetworkVirtualApplianceConnection) (result NetworkVirtualApplianceConnectionsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll performs NetworkVirtualApplianceConnectionsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsCreateOrUpdateThenPoll(ctx context.Context, id NetworkVirtualApplianceConnectionId, input NetworkVirtualApplianceConnection) error { - result, err := c.NetworkVirtualApplianceConnectionsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing NetworkVirtualApplianceConnectionsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkVirtualApplianceConnectionsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsdelete.go deleted file mode 100644 index 38492cbbb11..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 NetworkVirtualApplianceConnectionsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// NetworkVirtualApplianceConnectionsDelete ... -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsDelete(ctx context.Context, id NetworkVirtualApplianceConnectionId) (result NetworkVirtualApplianceConnectionsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// NetworkVirtualApplianceConnectionsDeleteThenPoll performs NetworkVirtualApplianceConnectionsDelete then polls until it's completed -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsDeleteThenPoll(ctx context.Context, id NetworkVirtualApplianceConnectionId) error { - result, err := c.NetworkVirtualApplianceConnectionsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing NetworkVirtualApplianceConnectionsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after NetworkVirtualApplianceConnectionsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsget.go b/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsget.go deleted file mode 100644 index ed429bdb536..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 NetworkVirtualApplianceConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NetworkVirtualApplianceConnection -} - -// NetworkVirtualApplianceConnectionsGet ... -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsGet(ctx context.Context, id NetworkVirtualApplianceConnectionId) (result NetworkVirtualApplianceConnectionsGetOperationResponse, 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 NetworkVirtualApplianceConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionslist.go b/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionslist.go deleted file mode 100644 index 60e6221c734..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_networkvirtualapplianceconnectionslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 NetworkVirtualApplianceConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]NetworkVirtualApplianceConnection -} - -type NetworkVirtualApplianceConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []NetworkVirtualApplianceConnection -} - -// NetworkVirtualApplianceConnectionsList ... -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsList(ctx context.Context, id NetworkVirtualApplianceId) (result NetworkVirtualApplianceConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/networkVirtualApplianceConnections", 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 *[]NetworkVirtualApplianceConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// NetworkVirtualApplianceConnectionsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsListComplete(ctx context.Context, id NetworkVirtualApplianceId) (NetworkVirtualApplianceConnectionsListCompleteResult, error) { - return c.NetworkVirtualApplianceConnectionsListCompleteMatchingPredicate(ctx, id, NetworkVirtualApplianceConnectionOperationPredicate{}) -} - -// NetworkVirtualApplianceConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) NetworkVirtualApplianceConnectionsListCompleteMatchingPredicate(ctx context.Context, id NetworkVirtualApplianceId, predicate NetworkVirtualApplianceConnectionOperationPredicate) (result NetworkVirtualApplianceConnectionsListCompleteResult, err error) { - items := make([]NetworkVirtualApplianceConnection, 0) - - resp, err := c.NetworkVirtualApplianceConnectionsList(ctx, id) - if err != nil { - 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 = NetworkVirtualApplianceConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayscreateorupdate.go deleted file mode 100644 index 664698b3088..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayscreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// P2sVpnGatewaysCreateOrUpdate ... -func (c VirtualWANsClient) P2sVpnGatewaysCreateOrUpdate(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnGateway) (result P2sVpnGatewaysCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// P2sVpnGatewaysCreateOrUpdateThenPoll performs P2sVpnGatewaysCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) P2sVpnGatewaysCreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId, input P2SVpnGateway) error { - result, err := c.P2sVpnGatewaysCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing P2sVpnGatewaysCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after P2sVpnGatewaysCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysdelete.go deleted file mode 100644 index 23ae30eaecd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysdelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// P2sVpnGatewaysDelete ... -func (c VirtualWANsClient) P2sVpnGatewaysDelete(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result P2sVpnGatewaysDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// P2sVpnGatewaysDeleteThenPoll performs P2sVpnGatewaysDelete then polls until it's completed -func (c VirtualWANsClient) P2sVpnGatewaysDeleteThenPoll(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) error { - result, err := c.P2sVpnGatewaysDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing P2sVpnGatewaysDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after P2sVpnGatewaysDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysget.go b/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysget.go deleted file mode 100644 index 804013badcc..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewaysget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *P2SVpnGateway -} - -// P2sVpnGatewaysGet ... -func (c VirtualWANsClient) P2sVpnGatewaysGet(ctx context.Context, id commonids.VirtualWANP2SVPNGatewayId) (result P2sVpnGatewaysGetOperationResponse, 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 P2SVpnGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslist.go b/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslist.go deleted file mode 100644 index 1f52628ac96..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]P2SVpnGateway -} - -type P2sVpnGatewaysListCompleteResult struct { - LatestHttpResponse *http.Response - Items []P2SVpnGateway -} - -// P2sVpnGatewaysList ... -func (c VirtualWANsClient) P2sVpnGatewaysList(ctx context.Context, id commonids.SubscriptionId) (result P2sVpnGatewaysListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/p2sVpnGateways", 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 *[]P2SVpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// P2sVpnGatewaysListComplete retrieves all the results into a single object -func (c VirtualWANsClient) P2sVpnGatewaysListComplete(ctx context.Context, id commonids.SubscriptionId) (P2sVpnGatewaysListCompleteResult, error) { - return c.P2sVpnGatewaysListCompleteMatchingPredicate(ctx, id, P2SVpnGatewayOperationPredicate{}) -} - -// P2sVpnGatewaysListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) P2sVpnGatewaysListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate P2SVpnGatewayOperationPredicate) (result P2sVpnGatewaysListCompleteResult, err error) { - items := make([]P2SVpnGateway, 0) - - resp, err := c.P2sVpnGatewaysList(ctx, id) - if err != nil { - 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 = P2sVpnGatewaysListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go deleted file mode 100644 index 29375db6e5c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_p2svpngatewayslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 P2sVpnGatewaysListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]P2SVpnGateway -} - -type P2sVpnGatewaysListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []P2SVpnGateway -} - -// P2sVpnGatewaysListByResourceGroup ... -func (c VirtualWANsClient) P2sVpnGatewaysListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result P2sVpnGatewaysListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/p2sVpnGateways", 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 *[]P2SVpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// P2sVpnGatewaysListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) P2sVpnGatewaysListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (P2sVpnGatewaysListByResourceGroupCompleteResult, error) { - return c.P2sVpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx, id, P2SVpnGatewayOperationPredicate{}) -} - -// P2sVpnGatewaysListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) P2sVpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate P2SVpnGatewayOperationPredicate) (result P2sVpnGatewaysListByResourceGroupCompleteResult, err error) { - items := make([]P2SVpnGateway, 0) - - resp, err := c.P2sVpnGatewaysListByResourceGroup(ctx, id) - if err != nil { - 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 = P2sVpnGatewaysListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routemapscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_routemapscreateorupdate.go deleted file mode 100644 index ffcf789da29..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routemapscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 RouteMapsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *RouteMap -} - -// RouteMapsCreateOrUpdate ... -func (c VirtualWANsClient) RouteMapsCreateOrUpdate(ctx context.Context, id RouteMapId, input RouteMap) (result RouteMapsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// RouteMapsCreateOrUpdateThenPoll performs RouteMapsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) RouteMapsCreateOrUpdateThenPoll(ctx context.Context, id RouteMapId, input RouteMap) error { - result, err := c.RouteMapsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RouteMapsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RouteMapsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routemapsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_routemapsdelete.go deleted file mode 100644 index f89977d5d94..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routemapsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 RouteMapsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RouteMapsDelete ... -func (c VirtualWANsClient) RouteMapsDelete(ctx context.Context, id RouteMapId) (result RouteMapsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// RouteMapsDeleteThenPoll performs RouteMapsDelete then polls until it's completed -func (c VirtualWANsClient) RouteMapsDeleteThenPoll(ctx context.Context, id RouteMapId) error { - result, err := c.RouteMapsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing RouteMapsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RouteMapsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routemapsget.go b/resource-manager/network/2023-06-01/virtualwans/method_routemapsget.go deleted file mode 100644 index 925002f31e7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routemapsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 RouteMapsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RouteMap -} - -// RouteMapsGet ... -func (c VirtualWANsClient) RouteMapsGet(ctx context.Context, id RouteMapId) (result RouteMapsGetOperationResponse, 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 RouteMap - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routemapslist.go b/resource-manager/network/2023-06-01/virtualwans/method_routemapslist.go deleted file mode 100644 index f73baf29ab0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routemapslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 RouteMapsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RouteMap -} - -type RouteMapsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RouteMap -} - -// RouteMapsList ... -func (c VirtualWANsClient) RouteMapsList(ctx context.Context, id VirtualHubId) (result RouteMapsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routeMaps", 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 *[]RouteMap `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RouteMapsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) RouteMapsListComplete(ctx context.Context, id VirtualHubId) (RouteMapsListCompleteResult, error) { - return c.RouteMapsListCompleteMatchingPredicate(ctx, id, RouteMapOperationPredicate{}) -} - -// RouteMapsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) RouteMapsListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate RouteMapOperationPredicate) (result RouteMapsListCompleteResult, err error) { - items := make([]RouteMap, 0) - - resp, err := c.RouteMapsList(ctx, id) - if err != nil { - 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 = RouteMapsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routingintentcreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_routingintentcreateorupdate.go deleted file mode 100644 index 58de7662435..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routingintentcreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 RoutingIntentCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *RoutingIntent -} - -// RoutingIntentCreateOrUpdate ... -func (c VirtualWANsClient) RoutingIntentCreateOrUpdate(ctx context.Context, id RoutingIntentId, input RoutingIntent) (result RoutingIntentCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// RoutingIntentCreateOrUpdateThenPoll performs RoutingIntentCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) RoutingIntentCreateOrUpdateThenPoll(ctx context.Context, id RoutingIntentId, input RoutingIntent) error { - result, err := c.RoutingIntentCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing RoutingIntentCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RoutingIntentCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routingintentdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_routingintentdelete.go deleted file mode 100644 index dd481f41454..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routingintentdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 RoutingIntentDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// RoutingIntentDelete ... -func (c VirtualWANsClient) RoutingIntentDelete(ctx context.Context, id RoutingIntentId) (result RoutingIntentDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// RoutingIntentDeleteThenPoll performs RoutingIntentDelete then polls until it's completed -func (c VirtualWANsClient) RoutingIntentDeleteThenPoll(ctx context.Context, id RoutingIntentId) error { - result, err := c.RoutingIntentDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing RoutingIntentDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after RoutingIntentDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routingintentget.go b/resource-manager/network/2023-06-01/virtualwans/method_routingintentget.go deleted file mode 100644 index ae61d3b41b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routingintentget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 RoutingIntentGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RoutingIntent -} - -// RoutingIntentGet ... -func (c VirtualWANsClient) RoutingIntentGet(ctx context.Context, id RoutingIntentId) (result RoutingIntentGetOperationResponse, 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 RoutingIntent - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_routingintentlist.go b/resource-manager/network/2023-06-01/virtualwans/method_routingintentlist.go deleted file mode 100644 index b8e64a01fe6..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_routingintentlist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 RoutingIntentListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]RoutingIntent -} - -type RoutingIntentListCompleteResult struct { - LatestHttpResponse *http.Response - Items []RoutingIntent -} - -// RoutingIntentList ... -func (c VirtualWANsClient) RoutingIntentList(ctx context.Context, id VirtualHubId) (result RoutingIntentListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routingIntent", 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 *[]RoutingIntent `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RoutingIntentListComplete retrieves all the results into a single object -func (c VirtualWANsClient) RoutingIntentListComplete(ctx context.Context, id VirtualHubId) (RoutingIntentListCompleteResult, error) { - return c.RoutingIntentListCompleteMatchingPredicate(ctx, id, RoutingIntentOperationPredicate{}) -} - -// RoutingIntentListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) RoutingIntentListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate RoutingIntentOperationPredicate) (result RoutingIntentListCompleteResult, err error) { - items := make([]RoutingIntent, 0) - - resp, err := c.RoutingIntentList(ctx, id) - if err != nil { - 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 = RoutingIntentListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_supportedsecurityproviders.go b/resource-manager/network/2023-06-01/virtualwans/method_supportedsecurityproviders.go deleted file mode 100644 index 616d9dd0cd4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_supportedsecurityproviders.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 SupportedSecurityProvidersOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualWanSecurityProviders -} - -// SupportedSecurityProviders ... -func (c VirtualWANsClient) SupportedSecurityProviders(ctx context.Context, id VirtualWANId) (result SupportedSecurityProvidersOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/supportedSecurityProviders", 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 VirtualWanSecurityProviders - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_updatetags.go b/resource-manager/network/2023-06-01/virtualwans/method_updatetags.go deleted file mode 100644 index 6115890e78c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package virtualwans - -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 *VirtualWAN -} - -// UpdateTags ... -func (c VirtualWANsClient) UpdateTags(ctx context.Context, id VirtualWANId, 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 VirtualWAN - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go deleted file mode 100644 index 3a42d5bcafd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectioncreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *BgpConnection -} - -// VirtualHubBgpConnectionCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubBgpConnectionCreateOrUpdate(ctx context.Context, id commonids.VirtualHubBGPConnectionId, input BgpConnection) (result VirtualHubBgpConnectionCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubBgpConnectionCreateOrUpdateThenPoll performs VirtualHubBgpConnectionCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionCreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId, input BgpConnection) error { - result, err := c.VirtualHubBgpConnectionCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectiondelete.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectiondelete.go deleted file mode 100644 index b8f353d5be6..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectiondelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubBgpConnectionDelete ... -func (c VirtualWANsClient) VirtualHubBgpConnectionDelete(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubBgpConnectionDeleteThenPoll performs VirtualHubBgpConnectionDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionDeleteThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionget.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionget.go deleted file mode 100644 index 525c6b3cabe..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BgpConnection -} - -// VirtualHubBgpConnectionGet ... -func (c VirtualWANsClient) VirtualHubBgpConnectionGet(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionGetOperationResponse, 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 BgpConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslist.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslist.go deleted file mode 100644 index 0107a51f0c7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]BgpConnection -} - -type VirtualHubBgpConnectionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []BgpConnection -} - -// VirtualHubBgpConnectionsList ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsList(ctx context.Context, id VirtualHubId) (result VirtualHubBgpConnectionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/bgpConnections", 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 *[]BgpConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubBgpConnectionsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubBgpConnectionsListComplete(ctx context.Context, id VirtualHubId) (VirtualHubBgpConnectionsListCompleteResult, error) { - return c.VirtualHubBgpConnectionsListCompleteMatchingPredicate(ctx, id, BgpConnectionOperationPredicate{}) -} - -// VirtualHubBgpConnectionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubBgpConnectionsListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate BgpConnectionOperationPredicate) (result VirtualHubBgpConnectionsListCompleteResult, err error) { - items := make([]BgpConnection, 0) - - resp, err := c.VirtualHubBgpConnectionsList(ctx, id) - if err != nil { - 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 = VirtualHubBgpConnectionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go deleted file mode 100644 index 6c0c2308e2b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistadvertisedroutes.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *map[string][]PeerRoute -} - -// VirtualHubBgpConnectionsListAdvertisedRoutes ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListAdvertisedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/advertisedRoutes", 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 -} - -// VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll performs VirtualHubBgpConnectionsListAdvertisedRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionsListAdvertisedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionsListAdvertisedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionsListAdvertisedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go deleted file mode 100644 index 4c6842802ef..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubbgpconnectionslistlearnedroutes.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubBgpConnectionsListLearnedRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *map[string][]PeerRoute -} - -// VirtualHubBgpConnectionsListLearnedRoutes ... -func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutes(ctx context.Context, id commonids.VirtualHubBGPConnectionId) (result VirtualHubBgpConnectionsListLearnedRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/learnedRoutes", 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 -} - -// VirtualHubBgpConnectionsListLearnedRoutesThenPoll performs VirtualHubBgpConnectionsListLearnedRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubBgpConnectionsListLearnedRoutesThenPoll(ctx context.Context, id commonids.VirtualHubBGPConnectionId) error { - result, err := c.VirtualHubBgpConnectionsListLearnedRoutes(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubBgpConnectionsListLearnedRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go deleted file mode 100644 index dfb4925ba51..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationcreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *HubIPConfiguration -} - -// VirtualHubIPConfigurationCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubIPConfigurationCreateOrUpdate(ctx context.Context, id commonids.VirtualHubIPConfigurationId, input HubIPConfiguration) (result VirtualHubIPConfigurationCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubIPConfigurationCreateOrUpdateThenPoll performs VirtualHubIPConfigurationCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubIPConfigurationCreateOrUpdateThenPoll(ctx context.Context, id commonids.VirtualHubIPConfigurationId, input HubIPConfiguration) error { - result, err := c.VirtualHubIPConfigurationCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubIPConfigurationCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubIPConfigurationCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationdelete.go deleted file mode 100644 index 36341aa33f7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationdelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubIPConfigurationDelete ... -func (c VirtualWANsClient) VirtualHubIPConfigurationDelete(ctx context.Context, id commonids.VirtualHubIPConfigurationId) (result VirtualHubIPConfigurationDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubIPConfigurationDeleteThenPoll performs VirtualHubIPConfigurationDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubIPConfigurationDeleteThenPoll(ctx context.Context, id commonids.VirtualHubIPConfigurationId) error { - result, err := c.VirtualHubIPConfigurationDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubIPConfigurationDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubIPConfigurationDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationget.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationget.go deleted file mode 100644 index ca3c9a88dd3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *HubIPConfiguration -} - -// VirtualHubIPConfigurationGet ... -func (c VirtualWANsClient) VirtualHubIPConfigurationGet(ctx context.Context, id commonids.VirtualHubIPConfigurationId) (result VirtualHubIPConfigurationGetOperationResponse, 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 HubIPConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationlist.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationlist.go deleted file mode 100644 index 481a7847797..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubipconfigurationlist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VirtualHubIPConfigurationListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]HubIPConfiguration -} - -type VirtualHubIPConfigurationListCompleteResult struct { - LatestHttpResponse *http.Response - Items []HubIPConfiguration -} - -// VirtualHubIPConfigurationList ... -func (c VirtualWANsClient) VirtualHubIPConfigurationList(ctx context.Context, id VirtualHubId) (result VirtualHubIPConfigurationListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/ipConfigurations", 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 *[]HubIPConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubIPConfigurationListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubIPConfigurationListComplete(ctx context.Context, id VirtualHubId) (VirtualHubIPConfigurationListCompleteResult, error) { - return c.VirtualHubIPConfigurationListCompleteMatchingPredicate(ctx, id, HubIPConfigurationOperationPredicate{}) -} - -// VirtualHubIPConfigurationListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubIPConfigurationListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate HubIPConfigurationOperationPredicate) (result VirtualHubIPConfigurationListCompleteResult, err error) { - items := make([]HubIPConfiguration, 0) - - resp, err := c.VirtualHubIPConfigurationList(ctx, id) - if err != nil { - 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 = VirtualHubIPConfigurationListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go deleted file mode 100644 index b7e92feb6c7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2screateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2sCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sCreateOrUpdate(ctx context.Context, id VirtualHubRouteTableId, input VirtualHubRouteTableV2) (result VirtualHubRouteTableV2sCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubRouteTableV2sCreateOrUpdateThenPoll performs VirtualHubRouteTableV2sCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubRouteTableV2sCreateOrUpdateThenPoll(ctx context.Context, id VirtualHubRouteTableId, input VirtualHubRouteTableV2) error { - result, err := c.VirtualHubRouteTableV2sCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubRouteTableV2sCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubRouteTableV2sCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sdelete.go deleted file mode 100644 index 91cc7babd28..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubRouteTableV2sDelete ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sDelete(ctx context.Context, id VirtualHubRouteTableId) (result VirtualHubRouteTableV2sDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubRouteTableV2sDeleteThenPoll performs VirtualHubRouteTableV2sDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubRouteTableV2sDeleteThenPoll(ctx context.Context, id VirtualHubRouteTableId) error { - result, err := c.VirtualHubRouteTableV2sDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubRouteTableV2sDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubRouteTableV2sDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sget.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sget.go deleted file mode 100644 index 7c542fcfe68..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2sget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2sGet ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sGet(ctx context.Context, id VirtualHubRouteTableId) (result VirtualHubRouteTableV2sGetOperationResponse, 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 VirtualHubRouteTableV2 - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2slist.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2slist.go deleted file mode 100644 index b406331c09a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubroutetablev2slist.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VirtualHubRouteTableV2sListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHubRouteTableV2 -} - -type VirtualHubRouteTableV2sListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHubRouteTableV2 -} - -// VirtualHubRouteTableV2sList ... -func (c VirtualWANsClient) VirtualHubRouteTableV2sList(ctx context.Context, id VirtualHubId) (result VirtualHubRouteTableV2sListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/routeTables", 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 *[]VirtualHubRouteTableV2 `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubRouteTableV2sListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubRouteTableV2sListComplete(ctx context.Context, id VirtualHubId) (VirtualHubRouteTableV2sListCompleteResult, error) { - return c.VirtualHubRouteTableV2sListCompleteMatchingPredicate(ctx, id, VirtualHubRouteTableV2OperationPredicate{}) -} - -// VirtualHubRouteTableV2sListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubRouteTableV2sListCompleteMatchingPredicate(ctx context.Context, id VirtualHubId, predicate VirtualHubRouteTableV2OperationPredicate) (result VirtualHubRouteTableV2sListCompleteResult, err error) { - items := make([]VirtualHubRouteTableV2, 0) - - resp, err := c.VirtualHubRouteTableV2sList(ctx, id) - if err != nil { - 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 = VirtualHubRouteTableV2sListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubscreateorupdate.go deleted file mode 100644 index 6b78901c93c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHub -} - -// VirtualHubsCreateOrUpdate ... -func (c VirtualWANsClient) VirtualHubsCreateOrUpdate(ctx context.Context, id VirtualHubId, input VirtualHub) (result VirtualHubsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualHubsCreateOrUpdateThenPoll performs VirtualHubsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualHubsCreateOrUpdateThenPoll(ctx context.Context, id VirtualHubId, input VirtualHub) error { - result, err := c.VirtualHubsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsdelete.go deleted file mode 100644 index 70eebb0a343..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VirtualHubsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualHubsDelete ... -func (c VirtualWANsClient) VirtualHubsDelete(ctx context.Context, id VirtualHubId) (result VirtualHubsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualHubsDeleteThenPoll performs VirtualHubsDelete then polls until it's completed -func (c VirtualWANsClient) VirtualHubsDeleteThenPoll(ctx context.Context, id VirtualHubId) error { - result, err := c.VirtualHubsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualHubsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsget.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsget.go deleted file mode 100644 index 3f2e419720f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VirtualHubsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHub -} - -// VirtualHubsGet ... -func (c VirtualWANsClient) VirtualHubsGet(ctx context.Context, id VirtualHubId) (result VirtualHubsGetOperationResponse, 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 VirtualHub - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go deleted file mode 100644 index 1bbae403695..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgeteffectivevirtualhubroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHubEffectiveRouteList -} - -// VirtualHubsGetEffectiveVirtualHubRoutes ... -func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutes(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) (result VirtualHubsGetEffectiveVirtualHubRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/effectiveRoutes", 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 -} - -// VirtualHubsGetEffectiveVirtualHubRoutesThenPoll performs VirtualHubsGetEffectiveVirtualHubRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetEffectiveVirtualHubRoutesThenPoll(ctx context.Context, id VirtualHubId, input EffectiveRoutesParameters) error { - result, err := c.VirtualHubsGetEffectiveVirtualHubRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetEffectiveVirtualHubRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetinboundroutes.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetinboundroutes.go deleted file mode 100644 index 03114d0c238..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetinboundroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetInboundRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *EffectiveRouteMapRouteList -} - -// VirtualHubsGetInboundRoutes ... -func (c VirtualWANsClient) VirtualHubsGetInboundRoutes(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) (result VirtualHubsGetInboundRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/inboundRoutes", 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 -} - -// VirtualHubsGetInboundRoutesThenPoll performs VirtualHubsGetInboundRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetInboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetInboundRoutesParameters) error { - result, err := c.VirtualHubsGetInboundRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetInboundRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetInboundRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetoutboundroutes.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetoutboundroutes.go deleted file mode 100644 index 9a715f99613..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsgetoutboundroutes.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualHubsGetOutboundRoutesOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *EffectiveRouteMapRouteList -} - -// VirtualHubsGetOutboundRoutes ... -func (c VirtualWANsClient) VirtualHubsGetOutboundRoutes(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) (result VirtualHubsGetOutboundRoutesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/outboundRoutes", 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 -} - -// VirtualHubsGetOutboundRoutesThenPoll performs VirtualHubsGetOutboundRoutes then polls until it's completed -func (c VirtualWANsClient) VirtualHubsGetOutboundRoutesThenPoll(ctx context.Context, id VirtualHubId, input GetOutboundRoutesParameters) error { - result, err := c.VirtualHubsGetOutboundRoutes(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualHubsGetOutboundRoutes: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualHubsGetOutboundRoutes: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubslist.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubslist.go deleted file mode 100644 index 466d0645613..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualHubsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHub -} - -type VirtualHubsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHub -} - -// VirtualHubsList ... -func (c VirtualWANsClient) VirtualHubsList(ctx context.Context, id commonids.SubscriptionId) (result VirtualHubsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualHubs", 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 *[]VirtualHub `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubsListComplete(ctx context.Context, id commonids.SubscriptionId) (VirtualHubsListCompleteResult, error) { - return c.VirtualHubsListCompleteMatchingPredicate(ctx, id, VirtualHubOperationPredicate{}) -} - -// VirtualHubsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualHubOperationPredicate) (result VirtualHubsListCompleteResult, err error) { - items := make([]VirtualHub, 0) - - resp, err := c.VirtualHubsList(ctx, id) - if err != nil { - 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 = VirtualHubsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubslistbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubslistbyresourcegroup.go deleted file mode 100644 index d81c7aff720..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualHubsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualHub -} - -type VirtualHubsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualHub -} - -// VirtualHubsListByResourceGroup ... -func (c VirtualWANsClient) VirtualHubsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VirtualHubsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualHubs", 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 *[]VirtualHub `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualHubsListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualHubsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VirtualHubsListByResourceGroupCompleteResult, error) { - return c.VirtualHubsListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualHubOperationPredicate{}) -} - -// VirtualHubsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualHubsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualHubOperationPredicate) (result VirtualHubsListByResourceGroupCompleteResult, err error) { - items := make([]VirtualHub, 0) - - resp, err := c.VirtualHubsListByResourceGroup(ctx, id) - if err != nil { - 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 = VirtualHubsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsupdatetags.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsupdatetags.go deleted file mode 100644 index be5399a4515..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualhubsupdatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package virtualwans - -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 VirtualHubsUpdateTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualHub -} - -// VirtualHubsUpdateTags ... -func (c VirtualWANsClient) VirtualHubsUpdateTags(ctx context.Context, id VirtualHubId, input TagsObject) (result VirtualHubsUpdateTagsOperationResponse, 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 VirtualHub - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualwanscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualwanscreateorupdate.go deleted file mode 100644 index 310b768e4e5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualwanscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VirtualWansCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VirtualWAN -} - -// VirtualWansCreateOrUpdate ... -func (c VirtualWANsClient) VirtualWansCreateOrUpdate(ctx context.Context, id VirtualWANId, input VirtualWAN) (result VirtualWansCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VirtualWansCreateOrUpdateThenPoll performs VirtualWansCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VirtualWansCreateOrUpdateThenPoll(ctx context.Context, id VirtualWANId, input VirtualWAN) error { - result, err := c.VirtualWansCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VirtualWansCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualWansCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualwansdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualwansdelete.go deleted file mode 100644 index 4ce708a8edd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualwansdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VirtualWansDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VirtualWansDelete ... -func (c VirtualWANsClient) VirtualWansDelete(ctx context.Context, id VirtualWANId) (result VirtualWansDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VirtualWansDeleteThenPoll performs VirtualWansDelete then polls until it's completed -func (c VirtualWANsClient) VirtualWansDeleteThenPoll(ctx context.Context, id VirtualWANId) error { - result, err := c.VirtualWansDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VirtualWansDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VirtualWansDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualwansget.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualwansget.go deleted file mode 100644 index 41dbd00d7f2..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualwansget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VirtualWansGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VirtualWAN -} - -// VirtualWansGet ... -func (c VirtualWANsClient) VirtualWansGet(ctx context.Context, id VirtualWANId) (result VirtualWansGetOperationResponse, 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 VirtualWAN - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualwanslist.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualwanslist.go deleted file mode 100644 index 3ecd8ccded9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualwanslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualWansListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualWAN -} - -type VirtualWansListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualWAN -} - -// VirtualWansList ... -func (c VirtualWANsClient) VirtualWansList(ctx context.Context, id commonids.SubscriptionId) (result VirtualWansListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualWans", 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 *[]VirtualWAN `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualWansListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualWansListComplete(ctx context.Context, id commonids.SubscriptionId) (VirtualWansListCompleteResult, error) { - return c.VirtualWansListCompleteMatchingPredicate(ctx, id, VirtualWANOperationPredicate{}) -} - -// VirtualWansListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualWansListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VirtualWANOperationPredicate) (result VirtualWansListCompleteResult, err error) { - items := make([]VirtualWAN, 0) - - resp, err := c.VirtualWansList(ctx, id) - if err != nil { - 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 = VirtualWansListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_virtualwanslistbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualwans/method_virtualwanslistbyresourcegroup.go deleted file mode 100644 index f904f3645d2..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_virtualwanslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VirtualWansListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VirtualWAN -} - -type VirtualWansListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VirtualWAN -} - -// VirtualWansListByResourceGroup ... -func (c VirtualWANsClient) VirtualWansListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VirtualWansListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/virtualWans", 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 *[]VirtualWAN `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VirtualWansListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VirtualWansListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VirtualWansListByResourceGroupCompleteResult, error) { - return c.VirtualWansListByResourceGroupCompleteMatchingPredicate(ctx, id, VirtualWANOperationPredicate{}) -} - -// VirtualWansListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VirtualWansListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VirtualWANOperationPredicate) (result VirtualWansListByResourceGroupCompleteResult, err error) { - items := make([]VirtualWAN, 0) - - resp, err := c.VirtualWansListByResourceGroup(ctx, id) - if err != nil { - 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 = VirtualWansListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionscreateorupdate.go deleted file mode 100644 index 58f8bec5b87..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionscreateorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VpnConnectionsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnConnection -} - -// VpnConnectionsCreateOrUpdate ... -func (c VirtualWANsClient) VpnConnectionsCreateOrUpdate(ctx context.Context, id commonids.VPNConnectionId, input VpnConnection) (result VpnConnectionsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnConnectionsCreateOrUpdateThenPoll performs VpnConnectionsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsCreateOrUpdateThenPoll(ctx context.Context, id commonids.VPNConnectionId, input VpnConnection) error { - result, err := c.VpnConnectionsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnConnectionsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsdelete.go deleted file mode 100644 index 12193490035..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsdelete.go +++ /dev/null @@ -1,72 +0,0 @@ -package virtualwans - -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 VpnConnectionsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnConnectionsDelete ... -func (c VirtualWANsClient) VpnConnectionsDelete(ctx context.Context, id commonids.VPNConnectionId) (result VpnConnectionsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnConnectionsDeleteThenPoll performs VpnConnectionsDelete then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsDeleteThenPoll(ctx context.Context, id commonids.VPNConnectionId) error { - result, err := c.VpnConnectionsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnConnectionsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsget.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsget.go deleted file mode 100644 index 812232759b1..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsget.go +++ /dev/null @@ -1,55 +0,0 @@ -package virtualwans - -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 VpnConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnConnection -} - -// VpnConnectionsGet ... -func (c VirtualWANsClient) VpnConnectionsGet(ctx context.Context, id commonids.VPNConnectionId) (result VpnConnectionsGetOperationResponse, 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 VpnConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionslistbyvpngateway.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionslistbyvpngateway.go deleted file mode 100644 index 4bb86629f08..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionslistbyvpngateway.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VpnConnectionsListByVpnGatewayOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnConnection -} - -type VpnConnectionsListByVpnGatewayCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnConnection -} - -// VpnConnectionsListByVpnGateway ... -func (c VirtualWANsClient) VpnConnectionsListByVpnGateway(ctx context.Context, id VpnGatewayId) (result VpnConnectionsListByVpnGatewayOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/vpnConnections", 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 *[]VpnConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnConnectionsListByVpnGatewayComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnConnectionsListByVpnGatewayComplete(ctx context.Context, id VpnGatewayId) (VpnConnectionsListByVpnGatewayCompleteResult, error) { - return c.VpnConnectionsListByVpnGatewayCompleteMatchingPredicate(ctx, id, VpnConnectionOperationPredicate{}) -} - -// VpnConnectionsListByVpnGatewayCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnConnectionsListByVpnGatewayCompleteMatchingPredicate(ctx context.Context, id VpnGatewayId, predicate VpnConnectionOperationPredicate) (result VpnConnectionsListByVpnGatewayCompleteResult, err error) { - items := make([]VpnConnection, 0) - - resp, err := c.VpnConnectionsListByVpnGateway(ctx, id) - if err != nil { - 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 = VpnConnectionsListByVpnGatewayCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstartpacketcapture.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstartpacketcapture.go deleted file mode 100644 index 98551e48f98..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstartpacketcapture.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VpnConnectionsStartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnConnectionsStartPacketCapture ... -func (c VirtualWANsClient) VpnConnectionsStartPacketCapture(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStartParameters) (result VpnConnectionsStartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startpacketcapture", 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 -} - -// VpnConnectionsStartPacketCaptureThenPoll performs VpnConnectionsStartPacketCapture then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsStartPacketCaptureThenPoll(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStartParameters) error { - result, err := c.VpnConnectionsStartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnConnectionsStartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsStartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstoppacketcapture.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstoppacketcapture.go deleted file mode 100644 index b32b88c6969..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnconnectionsstoppacketcapture.go +++ /dev/null @@ -1,76 +0,0 @@ -package virtualwans - -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 VpnConnectionsStopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnConnectionsStopPacketCapture ... -func (c VirtualWANsClient) VpnConnectionsStopPacketCapture(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStopParameters) (result VpnConnectionsStopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stoppacketcapture", 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 -} - -// VpnConnectionsStopPacketCaptureThenPoll performs VpnConnectionsStopPacketCapture then polls until it's completed -func (c VirtualWANsClient) VpnConnectionsStopPacketCaptureThenPoll(ctx context.Context, id commonids.VPNConnectionId, input VpnConnectionPacketCaptureStopParameters) error { - result, err := c.VpnConnectionsStopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnConnectionsStopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnConnectionsStopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayscreateorupdate.go deleted file mode 100644 index 2cabc7eba19..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VpnGatewaysCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -// VpnGatewaysCreateOrUpdate ... -func (c VirtualWANsClient) VpnGatewaysCreateOrUpdate(ctx context.Context, id VpnGatewayId, input VpnGateway) (result VpnGatewaysCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnGatewaysCreateOrUpdateThenPoll performs VpnGatewaysCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnGatewaysCreateOrUpdateThenPoll(ctx context.Context, id VpnGatewayId, input VpnGateway) error { - result, err := c.VpnGatewaysCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnGatewaysCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnGatewaysCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysdelete.go deleted file mode 100644 index 76d02ba38d5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnGatewaysDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnGatewaysDelete ... -func (c VirtualWANsClient) VpnGatewaysDelete(ctx context.Context, id VpnGatewayId) (result VpnGatewaysDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnGatewaysDeleteThenPoll performs VpnGatewaysDelete then polls until it's completed -func (c VirtualWANsClient) VpnGatewaysDeleteThenPoll(ctx context.Context, id VpnGatewayId) error { - result, err := c.VpnGatewaysDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnGatewaysDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnGatewaysDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysget.go b/resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysget.go deleted file mode 100644 index bfa13a547eb..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewaysget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnGatewaysGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -// VpnGatewaysGet ... -func (c VirtualWANsClient) VpnGatewaysGet(ctx context.Context, id VpnGatewayId) (result VpnGatewaysGetOperationResponse, 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 VpnGateway - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslist.go b/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslist.go deleted file mode 100644 index c72c758bb9f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnGatewaysListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnGateway -} - -type VpnGatewaysListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnGateway -} - -// VpnGatewaysList ... -func (c VirtualWANsClient) VpnGatewaysList(ctx context.Context, id commonids.SubscriptionId) (result VpnGatewaysListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnGateways", 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 *[]VpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnGatewaysListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnGatewaysListComplete(ctx context.Context, id commonids.SubscriptionId) (VpnGatewaysListCompleteResult, error) { - return c.VpnGatewaysListCompleteMatchingPredicate(ctx, id, VpnGatewayOperationPredicate{}) -} - -// VpnGatewaysListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnGatewaysListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VpnGatewayOperationPredicate) (result VpnGatewaysListCompleteResult, err error) { - items := make([]VpnGateway, 0) - - resp, err := c.VpnGatewaysList(ctx, id) - if err != nil { - 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 = VpnGatewaysListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslistbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslistbyresourcegroup.go deleted file mode 100644 index 42347fe5b4c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpngatewayslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnGatewaysListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnGateway -} - -type VpnGatewaysListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnGateway -} - -// VpnGatewaysListByResourceGroup ... -func (c VirtualWANsClient) VpnGatewaysListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VpnGatewaysListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnGateways", 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 *[]VpnGateway `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnGatewaysListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnGatewaysListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VpnGatewaysListByResourceGroupCompleteResult, error) { - return c.VpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx, id, VpnGatewayOperationPredicate{}) -} - -// VpnGatewaysListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnGatewaysListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VpnGatewayOperationPredicate) (result VpnGatewaysListByResourceGroupCompleteResult, err error) { - items := make([]VpnGateway, 0) - - resp, err := c.VpnGatewaysListByResourceGroup(ctx, id) - if err != nil { - 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 = VpnGatewaysListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionsgetikesas.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionsgetikesas.go deleted file mode 100644 index 5ecf6a6d2e7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionsgetikesas.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnLinkConnectionsGetIkeSasOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// VpnLinkConnectionsGetIkeSas ... -func (c VirtualWANsClient) VpnLinkConnectionsGetIkeSas(ctx context.Context, id VpnLinkConnectionId) (result VpnLinkConnectionsGetIkeSasOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getikesas", 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 -} - -// VpnLinkConnectionsGetIkeSasThenPoll performs VpnLinkConnectionsGetIkeSas then polls until it's completed -func (c VirtualWANsClient) VpnLinkConnectionsGetIkeSasThenPoll(ctx context.Context, id VpnLinkConnectionId) error { - result, err := c.VpnLinkConnectionsGetIkeSas(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnLinkConnectionsGetIkeSas: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnLinkConnectionsGetIkeSas: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go deleted file mode 100644 index f9eb225bad2..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnlinkconnectionslistbyvpnconnection.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnLinkConnectionsListByVpnConnectionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSiteLinkConnection -} - -type VpnLinkConnectionsListByVpnConnectionCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSiteLinkConnection -} - -// VpnLinkConnectionsListByVpnConnection ... -func (c VirtualWANsClient) VpnLinkConnectionsListByVpnConnection(ctx context.Context, id commonids.VPNConnectionId) (result VpnLinkConnectionsListByVpnConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/vpnLinkConnections", 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 *[]VpnSiteLinkConnection `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnLinkConnectionsListByVpnConnectionComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnLinkConnectionsListByVpnConnectionComplete(ctx context.Context, id commonids.VPNConnectionId) (VpnLinkConnectionsListByVpnConnectionCompleteResult, error) { - return c.VpnLinkConnectionsListByVpnConnectionCompleteMatchingPredicate(ctx, id, VpnSiteLinkConnectionOperationPredicate{}) -} - -// VpnLinkConnectionsListByVpnConnectionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnLinkConnectionsListByVpnConnectionCompleteMatchingPredicate(ctx context.Context, id commonids.VPNConnectionId, predicate VpnSiteLinkConnectionOperationPredicate) (result VpnLinkConnectionsListByVpnConnectionCompleteResult, err error) { - items := make([]VpnSiteLinkConnection, 0) - - resp, err := c.VpnLinkConnectionsListByVpnConnection(ctx, id) - if err != nil { - 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 = VpnLinkConnectionsListByVpnConnectionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go deleted file mode 100644 index 2f7ae87144e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsassociatedwithvirtualwanlist.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsAssociatedWithVirtualWanListOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfigurationsResponse -} - -// VpnServerConfigurationsAssociatedWithVirtualWanList ... -func (c VirtualWANsClient) VpnServerConfigurationsAssociatedWithVirtualWanList(ctx context.Context, id VirtualWANId) (result VpnServerConfigurationsAssociatedWithVirtualWanListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/vpnServerConfigurations", 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 -} - -// VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll performs VpnServerConfigurationsAssociatedWithVirtualWanList then polls until it's completed -func (c VirtualWANsClient) VpnServerConfigurationsAssociatedWithVirtualWanListThenPoll(ctx context.Context, id VirtualWANId) error { - result, err := c.VpnServerConfigurationsAssociatedWithVirtualWanList(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnServerConfigurationsAssociatedWithVirtualWanList: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnServerConfigurationsAssociatedWithVirtualWanList: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go deleted file mode 100644 index 256562205b9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationscreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfiguration -} - -// VpnServerConfigurationsCreateOrUpdate ... -func (c VirtualWANsClient) VpnServerConfigurationsCreateOrUpdate(ctx context.Context, id VpnServerConfigurationId, input VpnServerConfiguration) (result VpnServerConfigurationsCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnServerConfigurationsCreateOrUpdateThenPoll performs VpnServerConfigurationsCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnServerConfigurationsCreateOrUpdateThenPoll(ctx context.Context, id VpnServerConfigurationId, input VpnServerConfiguration) error { - result, err := c.VpnServerConfigurationsCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnServerConfigurationsCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnServerConfigurationsCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsdelete.go deleted file mode 100644 index 2edde34518e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnServerConfigurationsDelete ... -func (c VirtualWANsClient) VpnServerConfigurationsDelete(ctx context.Context, id VpnServerConfigurationId) (result VpnServerConfigurationsDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnServerConfigurationsDeleteThenPoll performs VpnServerConfigurationsDelete then polls until it's completed -func (c VirtualWANsClient) VpnServerConfigurationsDeleteThenPoll(ctx context.Context, id VpnServerConfigurationId) error { - result, err := c.VpnServerConfigurationsDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnServerConfigurationsDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnServerConfigurationsDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsget.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsget.go deleted file mode 100644 index e5b009a1154..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnServerConfiguration -} - -// VpnServerConfigurationsGet ... -func (c VirtualWANsClient) VpnServerConfigurationsGet(ctx context.Context, id VpnServerConfigurationId) (result VpnServerConfigurationsGetOperationResponse, 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 VpnServerConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslist.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslist.go deleted file mode 100644 index 62118191c91..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnServerConfiguration -} - -type VpnServerConfigurationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnServerConfiguration -} - -// VpnServerConfigurationsList ... -func (c VirtualWANsClient) VpnServerConfigurationsList(ctx context.Context, id commonids.SubscriptionId) (result VpnServerConfigurationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnServerConfigurations", 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 *[]VpnServerConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnServerConfigurationsListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnServerConfigurationsListComplete(ctx context.Context, id commonids.SubscriptionId) (VpnServerConfigurationsListCompleteResult, error) { - return c.VpnServerConfigurationsListCompleteMatchingPredicate(ctx, id, VpnServerConfigurationOperationPredicate{}) -} - -// VpnServerConfigurationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnServerConfigurationsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VpnServerConfigurationOperationPredicate) (result VpnServerConfigurationsListCompleteResult, err error) { - items := make([]VpnServerConfiguration, 0) - - resp, err := c.VpnServerConfigurationsList(ctx, id) - if err != nil { - 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 = VpnServerConfigurationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go deleted file mode 100644 index d96d591a6a9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnserverconfigurationslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnServerConfigurationsListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnServerConfiguration -} - -type VpnServerConfigurationsListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnServerConfiguration -} - -// VpnServerConfigurationsListByResourceGroup ... -func (c VirtualWANsClient) VpnServerConfigurationsListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VpnServerConfigurationsListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnServerConfigurations", 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 *[]VpnServerConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnServerConfigurationsListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnServerConfigurationsListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VpnServerConfigurationsListByResourceGroupCompleteResult, error) { - return c.VpnServerConfigurationsListByResourceGroupCompleteMatchingPredicate(ctx, id, VpnServerConfigurationOperationPredicate{}) -} - -// VpnServerConfigurationsListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnServerConfigurationsListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VpnServerConfigurationOperationPredicate) (result VpnServerConfigurationsListByResourceGroupCompleteResult, err error) { - items := make([]VpnServerConfiguration, 0) - - resp, err := c.VpnServerConfigurationsListByResourceGroup(ctx, id) - if err != nil { - 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 = VpnServerConfigurationsListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkconnectionsget.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkconnectionsget.go deleted file mode 100644 index 088e1b48de5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkconnectionsget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnSiteLinkConnectionsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnSiteLinkConnection -} - -// VpnSiteLinkConnectionsGet ... -func (c VirtualWANsClient) VpnSiteLinkConnectionsGet(ctx context.Context, id VpnLinkConnectionId) (result VpnSiteLinkConnectionsGetOperationResponse, 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 VpnSiteLinkConnection - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinksget.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinksget.go deleted file mode 100644 index c16e84b3691..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinksget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnSiteLinksGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnSiteLink -} - -// VpnSiteLinksGet ... -func (c VirtualWANsClient) VpnSiteLinksGet(ctx context.Context, id VpnSiteLinkId) (result VpnSiteLinksGetOperationResponse, 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 VpnSiteLink - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go deleted file mode 100644 index 550e5725ad9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitelinkslistbyvpnsite.go +++ /dev/null @@ -1,91 +0,0 @@ -package virtualwans - -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 VpnSiteLinksListByVpnSiteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSiteLink -} - -type VpnSiteLinksListByVpnSiteCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSiteLink -} - -// VpnSiteLinksListByVpnSite ... -func (c VirtualWANsClient) VpnSiteLinksListByVpnSite(ctx context.Context, id VpnSiteId) (result VpnSiteLinksListByVpnSiteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/vpnSiteLinks", 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 *[]VpnSiteLink `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnSiteLinksListByVpnSiteComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnSiteLinksListByVpnSiteComplete(ctx context.Context, id VpnSiteId) (VpnSiteLinksListByVpnSiteCompleteResult, error) { - return c.VpnSiteLinksListByVpnSiteCompleteMatchingPredicate(ctx, id, VpnSiteLinkOperationPredicate{}) -} - -// VpnSiteLinksListByVpnSiteCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnSiteLinksListByVpnSiteCompleteMatchingPredicate(ctx context.Context, id VpnSiteId, predicate VpnSiteLinkOperationPredicate) (result VpnSiteLinksListByVpnSiteCompleteResult, err error) { - items := make([]VpnSiteLink, 0) - - resp, err := c.VpnSiteLinksListByVpnSite(ctx, id) - if err != nil { - 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 = VpnSiteLinksListByVpnSiteCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesconfigurationdownload.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesconfigurationdownload.go deleted file mode 100644 index a20fd02e0fc..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesconfigurationdownload.go +++ /dev/null @@ -1,74 +0,0 @@ -package virtualwans - -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 VpnSitesConfigurationDownloadOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnSitesConfigurationDownload ... -func (c VirtualWANsClient) VpnSitesConfigurationDownload(ctx context.Context, id VirtualWANId, input GetVpnSitesConfigurationRequest) (result VpnSitesConfigurationDownloadOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/vpnConfiguration", 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 -} - -// VpnSitesConfigurationDownloadThenPoll performs VpnSitesConfigurationDownload then polls until it's completed -func (c VirtualWANsClient) VpnSitesConfigurationDownloadThenPoll(ctx context.Context, id VirtualWANId, input GetVpnSitesConfigurationRequest) error { - result, err := c.VpnSitesConfigurationDownload(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnSitesConfigurationDownload: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnSitesConfigurationDownload: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitescreateorupdate.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitescreateorupdate.go deleted file mode 100644 index 2b93c69c66a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitescreateorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package virtualwans - -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 VpnSitesCreateOrUpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnSite -} - -// VpnSitesCreateOrUpdate ... -func (c VirtualWANsClient) VpnSitesCreateOrUpdate(ctx context.Context, id VpnSiteId, input VpnSite) (result VpnSitesCreateOrUpdateOperationResponse, 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// VpnSitesCreateOrUpdateThenPoll performs VpnSitesCreateOrUpdate then polls until it's completed -func (c VirtualWANsClient) VpnSitesCreateOrUpdateThenPoll(ctx context.Context, id VpnSiteId, input VpnSite) error { - result, err := c.VpnSitesCreateOrUpdate(ctx, id, input) - if err != nil { - return fmt.Errorf("performing VpnSitesCreateOrUpdate: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnSitesCreateOrUpdate: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesdelete.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesdelete.go deleted file mode 100644 index f3b27d7f18a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesdelete.go +++ /dev/null @@ -1,71 +0,0 @@ -package virtualwans - -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 VpnSitesDeleteOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// VpnSitesDelete ... -func (c VirtualWANsClient) VpnSitesDelete(ctx context.Context, id VpnSiteId) (result VpnSitesDeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 -} - -// VpnSitesDeleteThenPoll performs VpnSitesDelete then polls until it's completed -func (c VirtualWANsClient) VpnSitesDeleteThenPoll(ctx context.Context, id VpnSiteId) error { - result, err := c.VpnSitesDelete(ctx, id) - if err != nil { - return fmt.Errorf("performing VpnSitesDelete: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after VpnSitesDelete: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesget.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesget.go deleted file mode 100644 index 6494e6d6449..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsitesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package virtualwans - -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 VpnSitesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VpnSite -} - -// VpnSitesGet ... -func (c VirtualWANsClient) VpnSitesGet(ctx context.Context, id VpnSiteId) (result VpnSitesGetOperationResponse, 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 VpnSite - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslist.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslist.go deleted file mode 100644 index 54e583b7d9f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslist.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnSitesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSite -} - -type VpnSitesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSite -} - -// VpnSitesList ... -func (c VirtualWANsClient) VpnSitesList(ctx context.Context, id commonids.SubscriptionId) (result VpnSitesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnSites", 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 *[]VpnSite `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnSitesListComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnSitesListComplete(ctx context.Context, id commonids.SubscriptionId) (VpnSitesListCompleteResult, error) { - return c.VpnSitesListCompleteMatchingPredicate(ctx, id, VpnSiteOperationPredicate{}) -} - -// VpnSitesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnSitesListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VpnSiteOperationPredicate) (result VpnSitesListCompleteResult, err error) { - items := make([]VpnSite, 0) - - resp, err := c.VpnSitesList(ctx, id) - if err != nil { - 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 = VpnSitesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslistbyresourcegroup.go b/resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslistbyresourcegroup.go deleted file mode 100644 index ed569e858d1..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/method_vpnsiteslistbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package virtualwans - -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 VpnSitesListByResourceGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]VpnSite -} - -type VpnSitesListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []VpnSite -} - -// VpnSitesListByResourceGroup ... -func (c VirtualWANsClient) VpnSitesListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result VpnSitesListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/vpnSites", 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 *[]VpnSite `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// VpnSitesListByResourceGroupComplete retrieves all the results into a single object -func (c VirtualWANsClient) VpnSitesListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (VpnSitesListByResourceGroupCompleteResult, error) { - return c.VpnSitesListByResourceGroupCompleteMatchingPredicate(ctx, id, VpnSiteOperationPredicate{}) -} - -// VpnSitesListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VirtualWANsClient) VpnSitesListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VpnSiteOperationPredicate) (result VpnSitesListByResourceGroupCompleteResult, err error) { - items := make([]VpnSite, 0) - - resp, err := c.VpnSitesListByResourceGroup(ctx, id) - if err != nil { - 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 = VpnSitesListByResourceGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_aadauthenticationparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_aadauthenticationparameters.go deleted file mode 100644 index b0d5e53c358..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_aadauthenticationparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AadAuthenticationParameters struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_action.go b/resource-manager/network/2023-06-01/virtualwans/model_action.go deleted file mode 100644 index e3c73ef507d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_action.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Action struct { - Parameters *[]Parameter `json:"parameters,omitempty"` - Type *RouteMapActionType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_addressspace.go b/resource-manager/network/2023-06-01/virtualwans/model_addressspace.go deleted file mode 100644 index e1ac53861fc..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddress.go deleted file mode 100644 index 51a23d1c2c5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index adfa8110618..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index c308084cb90..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 184f4db35ed..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 96ab63c3c70..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygroup.go deleted file mode 100644 index 8df94828320..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 0db023773ff..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_backendaddresspool.go b/resource-manager/network/2023-06-01/virtualwans/model_backendaddresspool.go deleted file mode 100644 index 75b3239a673..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index 210c422933e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_bgpconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_bgpconnection.go deleted file mode 100644 index 13c77fe2225..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_bgpconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BgpConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_bgpconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_bgpconnectionproperties.go deleted file mode 100644 index 4666e421984..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_bgpconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpConnectionProperties struct { - ConnectionState *HubBgpConnectionStatus `json:"connectionState,omitempty"` - HubVirtualNetworkConnection *SubResource `json:"hubVirtualNetworkConnection,omitempty"` - PeerAsn *int64 `json:"peerAsn,omitempty"` - PeerIP *string `json:"peerIp,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_bgpsettings.go b/resource-manager/network/2023-06-01/virtualwans/model_bgpsettings.go deleted file mode 100644 index 5f96d5acf14..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_criterion.go b/resource-manager/network/2023-06-01/virtualwans/model_criterion.go deleted file mode 100644 index e7249b64d4d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_criterion.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Criterion struct { - AsPath *[]string `json:"asPath,omitempty"` - Community *[]string `json:"community,omitempty"` - MatchCondition *RouteMapMatchCondition `json:"matchCondition,omitempty"` - RoutePrefix *[]string `json:"routePrefix,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 557a5a01a6d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ddossettings.go b/resource-manager/network/2023-06-01/virtualwans/model_ddossettings.go deleted file mode 100644 index 82eef09dc62..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_delegation.go b/resource-manager/network/2023-06-01/virtualwans/model_delegation.go deleted file mode 100644 index 55eeb1fff81..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_deviceproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_deviceproperties.go deleted file mode 100644 index 9c255349846..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_deviceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceProperties struct { - DeviceModel *string `json:"deviceModel,omitempty"` - DeviceVendor *string `json:"deviceVendor,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproute.go b/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproute.go deleted file mode 100644 index 3a565a687e8..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRouteMapRoute struct { - AsPath *string `json:"asPath,omitempty"` - BgpCommunities *string `json:"bgpCommunities,omitempty"` - Prefix *string `json:"prefix,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproutelist.go b/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproutelist.go deleted file mode 100644 index 326acde877b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutemaproutelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRouteMapRouteList struct { - Value *[]EffectiveRouteMapRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutesparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutesparameters.go deleted file mode 100644 index dab27997ab5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_effectiveroutesparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EffectiveRoutesParameters struct { - ResourceId *string `json:"resourceId,omitempty"` - VirtualWanResourceType *string `json:"virtualWanResourceType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_flowlog.go b/resource-manager/network/2023-06-01/virtualwans/model_flowlog.go deleted file mode 100644 index da3b4f53345..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_flowlogformatparameters.go deleted file mode 100644 index 3b64c7c567a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_flowlogpropertiesformat.go deleted file mode 100644 index 61a32b4aded..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_frontendipconfiguration.go deleted file mode 100644 index b9c97d1e6a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualwans - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 62b1635a8ed..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 81c747c0a4a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/virtualwans/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 96c5d2b39e5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_getinboundroutesparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_getinboundroutesparameters.go deleted file mode 100644 index 1407618f660..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_getinboundroutesparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetInboundRoutesParameters struct { - ConnectionType *string `json:"connectionType,omitempty"` - ResourceUri *string `json:"resourceUri,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_getoutboundroutesparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_getoutboundroutesparameters.go deleted file mode 100644 index 19a89a55b10..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_getoutboundroutesparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetOutboundRoutesParameters struct { - ConnectionType *string `json:"connectionType,omitempty"` - ResourceUri *string `json:"resourceUri,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_getvpnsitesconfigurationrequest.go b/resource-manager/network/2023-06-01/virtualwans/model_getvpnsitesconfigurationrequest.go deleted file mode 100644 index 0dd233101ce..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_getvpnsitesconfigurationrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetVpnSitesConfigurationRequest struct { - OutputBlobSasUrl string `json:"outputBlobSasUrl"` - VpnSites *[]string `json:"vpnSites,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_hubipconfiguration.go deleted file mode 100644 index c666224646f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *HubIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_hubipconfigurationpropertiesformat.go deleted file mode 100644 index 86c4674860b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubroute.go b/resource-manager/network/2023-06-01/virtualwans/model_hubroute.go deleted file mode 100644 index bc12eef1a4a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubroute.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubRoute struct { - DestinationType string `json:"destinationType"` - Destinations []string `json:"destinations"` - Name string `json:"name"` - NextHop string `json:"nextHop"` - NextHopType string `json:"nextHopType"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubroutetable.go b/resource-manager/network/2023-06-01/virtualwans/model_hubroutetable.go deleted file mode 100644 index 1214fb071b3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubroutetable.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubRouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *HubRouteTableProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubroutetableproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_hubroutetableproperties.go deleted file mode 100644 index 32d33bc1ec9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubroutetableproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubRouteTableProperties struct { - AssociatedConnections *[]string `json:"associatedConnections,omitempty"` - Labels *[]string `json:"labels,omitempty"` - PropagatingConnections *[]string `json:"propagatingConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Routes *[]HubRoute `json:"routes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnection.go deleted file mode 100644 index 41f20a0a732..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubVirtualNetworkConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *HubVirtualNetworkConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go deleted file mode 100644 index 83313e30ed5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_hubvirtualnetworkconnectionproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HubVirtualNetworkConnectionProperties struct { - AllowHubToRemoteVnetTransit *bool `json:"allowHubToRemoteVnetTransit,omitempty"` - AllowRemoteVnetToUseHubVnetGateways *bool `json:"allowRemoteVnetToUseHubVnetGateways,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteVirtualNetwork *SubResource `json:"remoteVirtualNetwork,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_inboundnatrule.go b/resource-manager/network/2023-06-01/virtualwans/model_inboundnatrule.go deleted file mode 100644 index eee8ea195cf..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 17b64e3d468..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_ipconfiguration.go deleted file mode 100644 index 1241b6c2c3e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index fbaabbf7c1b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofile.go deleted file mode 100644 index a710fe9c7f0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 6b808468c3d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 58c575ad69f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_ipsecpolicy.go b/resource-manager/network/2023-06-01/virtualwans/model_ipsecpolicy.go deleted file mode 100644 index 02267e6b24d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_iptag.go b/resource-manager/network/2023-06-01/virtualwans/model_iptag.go deleted file mode 100644 index de05365d519..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// 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/network/2023-06-01/virtualwans/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddress.go deleted file mode 100644 index 37820fb13bd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 3f6629b67eb..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_natgateway.go b/resource-manager/network/2023-06-01/virtualwans/model_natgateway.go deleted file mode 100644 index 7e1a4539e08..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package virtualwans - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_natgatewaypropertiesformat.go deleted file mode 100644 index 7f5732e1cc0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_natgatewaysku.go b/resource-manager/network/2023-06-01/virtualwans/model_natgatewaysku.go deleted file mode 100644 index 4cd49e069a9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_natruleportmapping.go b/resource-manager/network/2023-06-01/virtualwans/model_natruleportmapping.go deleted file mode 100644 index 2ce8b302da3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterface.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterface.go deleted file mode 100644 index b6b5bf73332..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacednssettings.go deleted file mode 100644 index d0dcb411a3e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 5c0d1edc7ad..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 9ed5a87eb91..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 53b62677571..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacepropertiesformat.go deleted file mode 100644 index eb6875aa05e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfiguration.go deleted file mode 100644 index d12531c2798..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index 70fb9b73ddb..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/virtualwans/model_networksecuritygroup.go deleted file mode 100644 index c941605df94..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 54526eb4ea0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnection.go deleted file mode 100644 index 903d78680e7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnection.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceConnection struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkVirtualApplianceConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnectionproperties.go deleted file mode 100644 index bfe5ec7a317..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_networkvirtualapplianceconnectionproperties.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkVirtualApplianceConnectionProperties struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeerAddress *[]string `json:"bgpPeerAddress,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - Name *string `json:"name,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - TunnelIdentifier *int64 `json:"tunnelIdentifier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_o365breakoutcategorypolicies.go b/resource-manager/network/2023-06-01/virtualwans/model_o365breakoutcategorypolicies.go deleted file mode 100644 index 0a9ed71a50b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_o365breakoutcategorypolicies.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365BreakOutCategoryPolicies struct { - Allow *bool `json:"allow,omitempty"` - Default *bool `json:"default,omitempty"` - Optimize *bool `json:"optimize,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_o365policyproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_o365policyproperties.go deleted file mode 100644 index eeae991ee3f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_o365policyproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365PolicyProperties struct { - BreakOutCategories *O365BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfiguration.go deleted file mode 100644 index 08a6a452843..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfigurationproperties.go deleted file mode 100644 index a5558cf1e48..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_p2sconnectionconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfigurationProperties struct { - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_p2svpngateway.go b/resource-manager/network/2023-06-01/virtualwans/model_p2svpngateway.go deleted file mode 100644 index 25f63025e39..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_p2svpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SVpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_p2svpngatewayproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_p2svpngatewayproperties.go deleted file mode 100644 index d337b304bbd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_p2svpngatewayproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGatewayProperties struct { - CustomDnsServers *[]string `json:"customDnsServers,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_parameter.go b/resource-manager/network/2023-06-01/virtualwans/model_parameter.go deleted file mode 100644 index d1619c1138c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_parameter.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Parameter struct { - AsPath *[]string `json:"asPath,omitempty"` - Community *[]string `json:"community,omitempty"` - RoutePrefix *[]string `json:"routePrefix,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_peerroute.go b/resource-manager/network/2023-06-01/virtualwans/model_peerroute.go deleted file mode 100644 index c03bdbe8722..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_peerroute.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PeerRoute struct { - AsPath *string `json:"asPath,omitempty"` - LocalAddress *string `json:"localAddress,omitempty"` - Network *string `json:"network,omitempty"` - NextHop *string `json:"nextHop,omitempty"` - Origin *string `json:"origin,omitempty"` - SourcePeer *string `json:"sourcePeer,omitempty"` - Weight *int64 `json:"weight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privateendpoint.go b/resource-manager/network/2023-06-01/virtualwans/model_privateendpoint.go deleted file mode 100644 index d493c3ed57a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnection.go deleted file mode 100644 index 191623acf98..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/virtualwans/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnectionproperties.go deleted file mode 100644 index f54855d1288..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfiguration.go deleted file mode 100644 index 053d067b685..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index d6794440033..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_privateendpointproperties.go deleted file mode 100644 index 3af5e8a64e0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkservice.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkservice.go deleted file mode 100644 index 79f0f888953..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnection.go deleted file mode 100644 index b584feab35a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 5875bd90e15..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index c1664caec07..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 3558cb8095c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 31251b67685..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceproperties.go deleted file mode 100644 index 286611e0560..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_propagatedroutetable.go b/resource-manager/network/2023-06-01/virtualwans/model_propagatedroutetable.go deleted file mode 100644 index af45ddbedf1..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddress.go b/resource-manager/network/2023-06-01/virtualwans/model_publicipaddress.go deleted file mode 100644 index 8bd2fa402a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package virtualwans - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/virtualwans/model_publicipaddressdnssettings.go deleted file mode 100644 index 2a95851cb0c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 48fecb8ae90..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/virtualwans/model_publicipaddresssku.go deleted file mode 100644 index 4fcf5fb0e8f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_radiusserver.go b/resource-manager/network/2023-06-01/virtualwans/model_radiusserver.go deleted file mode 100644 index 858a67625c9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlink.go deleted file mode 100644 index b0d119588a3..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlinkformat.go deleted file mode 100644 index 9443c31d227..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_resourceset.go b/resource-manager/network/2023-06-01/virtualwans/model_resourceset.go deleted file mode 100644 index f8d5a3c0775..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_retentionpolicyparameters.go deleted file mode 100644 index 57394822b9d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_route.go b/resource-manager/network/2023-06-01/virtualwans/model_route.go deleted file mode 100644 index 5ae4b7a4ff8..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routemap.go b/resource-manager/network/2023-06-01/virtualwans/model_routemap.go deleted file mode 100644 index 6c5941f5a4c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routemap.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteMap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteMapProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routemapproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_routemapproperties.go deleted file mode 100644 index a4a019429ff..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routemapproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteMapProperties struct { - AssociatedInboundConnections *[]string `json:"associatedInboundConnections,omitempty"` - AssociatedOutboundConnections *[]string `json:"associatedOutboundConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Rules *[]RouteMapRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routemaprule.go b/resource-manager/network/2023-06-01/virtualwans/model_routemaprule.go deleted file mode 100644 index cdeacc9a78b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routemaprule.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteMapRule struct { - Actions *[]Action `json:"actions,omitempty"` - MatchCriteria *[]Criterion `json:"matchCriteria,omitempty"` - Name *string `json:"name,omitempty"` - NextStepIfMatched *NextStep `json:"nextStepIfMatched,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_routepropertiesformat.go deleted file mode 100644 index 51259038175..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routetable.go b/resource-manager/network/2023-06-01/virtualwans/model_routetable.go deleted file mode 100644 index 76a72a637be..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_routetablepropertiesformat.go deleted file mode 100644 index 9a5454526a4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routingconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_routingconfiguration.go deleted file mode 100644 index f4ca0018afa..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routingintent.go b/resource-manager/network/2023-06-01/virtualwans/model_routingintent.go deleted file mode 100644 index 537f1404f3d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routingintent.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingIntent struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutingIntentProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routingintentproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_routingintentproperties.go deleted file mode 100644 index 38a3b8e4147..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routingintentproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingIntentProperties struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingPolicies *[]RoutingPolicy `json:"routingPolicies,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_routingpolicy.go b/resource-manager/network/2023-06-01/virtualwans/model_routingpolicy.go deleted file mode 100644 index cef221dbd58..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_routingpolicy.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingPolicy struct { - Destinations []string `json:"destinations"` - Name string `json:"name"` - NextHop string `json:"nextHop"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_securityrule.go b/resource-manager/network/2023-06-01/virtualwans/model_securityrule.go deleted file mode 100644 index 72e68599476..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_securityrulepropertiesformat.go deleted file mode 100644 index 547a37a71ce..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlink.go deleted file mode 100644 index 0b2b5927b19..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 1aa80542228..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_servicedelegationpropertiesformat.go deleted file mode 100644 index aaeb340b2c7..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicy.go deleted file mode 100644 index 62b85e18cbf..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinition.go deleted file mode 100644 index 886de873aea..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 433a85d2006..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index 6c09399b151..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 115ecdfed06..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_staticroute.go b/resource-manager/network/2023-06-01/virtualwans/model_staticroute.go deleted file mode 100644 index c57fdb00cea..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_staticroutesconfig.go b/resource-manager/network/2023-06-01/virtualwans/model_staticroutesconfig.go deleted file mode 100644 index c286d119b66..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_subnet.go b/resource-manager/network/2023-06-01/virtualwans/model_subnet.go deleted file mode 100644 index ecdd88e0207..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_subnetpropertiesformat.go deleted file mode 100644 index 781adec66f6..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_subresource.go b/resource-manager/network/2023-06-01/virtualwans/model_subresource.go deleted file mode 100644 index 9c238c85dff..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_tagsobject.go b/resource-manager/network/2023-06-01/virtualwans/model_tagsobject.go deleted file mode 100644 index 1f55b0e7a00..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// 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/network/2023-06-01/virtualwans/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 1e6b8ac8e23..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsproperties.go deleted file mode 100644 index 56d6e09676b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_trafficselectorpolicy.go b/resource-manager/network/2023-06-01/virtualwans/model_trafficselectorpolicy.go deleted file mode 100644 index 09496a292fa..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhub.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhub.go deleted file mode 100644 index 732daa9aecc..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhub.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHub struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualHubProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroute.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroute.go deleted file mode 100644 index d46894da2a8..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroute.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubEffectiveRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - AsPath *string `json:"asPath,omitempty"` - NextHopType *string `json:"nextHopType,omitempty"` - NextHops *[]string `json:"nextHops,omitempty"` - RouteOrigin *string `json:"routeOrigin,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroutelist.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroutelist.go deleted file mode 100644 index 3ea5b7b15e4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubeffectiveroutelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubEffectiveRouteList struct { - Value *[]VirtualHubEffectiveRoute `json:"value,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubproperties.go deleted file mode 100644 index 9b119e8889f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubproperties.go +++ /dev/null @@ -1,29 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubProperties struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - AzureFirewall *SubResource `json:"azureFirewall,omitempty"` - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - ExpressRouteGateway *SubResource `json:"expressRouteGateway,omitempty"` - HubRoutingPreference *HubRoutingPreference `json:"hubRoutingPreference,omitempty"` - IPConfigurations *[]SubResource `json:"ipConfigurations,omitempty"` - P2SVpnGateway *SubResource `json:"p2SVpnGateway,omitempty"` - PreferredRoutingGateway *PreferredRoutingGateway `json:"preferredRoutingGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RouteMaps *[]SubResource `json:"routeMaps,omitempty"` - RouteTable *VirtualHubRouteTable `json:"routeTable,omitempty"` - RoutingState *RoutingState `json:"routingState,omitempty"` - SecurityPartnerProvider *SubResource `json:"securityPartnerProvider,omitempty"` - SecurityProviderName *string `json:"securityProviderName,omitempty"` - Sku *string `json:"sku,omitempty"` - VirtualHubRouteTableV2s *[]VirtualHubRouteTableV2 `json:"virtualHubRouteTableV2s,omitempty"` - VirtualRouterAsn *int64 `json:"virtualRouterAsn,omitempty"` - VirtualRouterAutoScaleConfiguration *VirtualRouterAutoScaleConfiguration `json:"virtualRouterAutoScaleConfiguration,omitempty"` - VirtualRouterIPs *[]string `json:"virtualRouterIps,omitempty"` - VirtualWAN *SubResource `json:"virtualWan,omitempty"` - VpnGateway *SubResource `json:"vpnGateway,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroute.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroute.go deleted file mode 100644 index 3b9b205ea1a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroute.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetable.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetable.go deleted file mode 100644 index 71ec2c0bca4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetable.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteTable struct { - Routes *[]VirtualHubRoute `json:"routes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2.go deleted file mode 100644 index 50fa84c35f5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteTableV2 struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualHubRouteTableV2Properties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2properties.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2properties.go deleted file mode 100644 index ed869d1c471..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutetablev2properties.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteTableV2Properties struct { - AttachedConnections *[]string `json:"attachedConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Routes *[]VirtualHubRouteV2 `json:"routes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutev2.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutev2.go deleted file mode 100644 index a47739aa2a5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualhubroutev2.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualHubRouteV2 struct { - DestinationType *string `json:"destinationType,omitempty"` - Destinations *[]string `json:"destinations,omitempty"` - NextHopType *string `json:"nextHopType,omitempty"` - NextHops *[]string `json:"nextHops,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktap.go deleted file mode 100644 index f7d80351ab5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index efca5566dad..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualrouterautoscaleconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualrouterautoscaleconfiguration.go deleted file mode 100644 index 4ce6be45420..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualrouterautoscaleconfiguration.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualRouterAutoScaleConfiguration struct { - MinCapacity *int64 `json:"minCapacity,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualwan.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualwan.go deleted file mode 100644 index 45691c81b74..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualwan.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWAN struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualWanProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualwanproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualwanproperties.go deleted file mode 100644 index 65c2eb829cb..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualwanproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanProperties struct { - AllowBranchToBranchTraffic *bool `json:"allowBranchToBranchTraffic,omitempty"` - AllowVnetToVnetTraffic *bool `json:"allowVnetToVnetTraffic,omitempty"` - DisableVpnEncryption *bool `json:"disableVpnEncryption,omitempty"` - Office365LocalBreakoutCategory *OfficeTrafficCategory `json:"office365LocalBreakoutCategory,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *string `json:"type,omitempty"` - VirtualHubs *[]SubResource `json:"virtualHubs,omitempty"` - VpnSites *[]SubResource `json:"vpnSites,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityprovider.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityprovider.go deleted file mode 100644 index d41346bc4a9..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityprovider.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanSecurityProvider struct { - Name *string `json:"name,omitempty"` - Type *VirtualWanSecurityProviderType `json:"type,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityproviders.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityproviders.go deleted file mode 100644 index 6e7e4ab59f8..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualwansecurityproviders.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanSecurityProviders struct { - SupportedProviders *[]VirtualWanSecurityProvider `json:"supportedProviders,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_virtualwanvpnprofileparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_virtualwanvpnprofileparameters.go deleted file mode 100644 index dd01888d247..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_virtualwanvpnprofileparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualWanVpnProfileParameters struct { - AuthenticationMethod *AuthenticationMethod `json:"authenticationMethod,omitempty"` - VpnServerConfigurationResourceId *string `json:"vpnServerConfigurationResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vnetroute.go b/resource-manager/network/2023-06-01/virtualwans/model_vnetroute.go deleted file mode 100644 index cbd035f3e06..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnclientconnectionhealth.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnclientconnectionhealth.go deleted file mode 100644 index 82eefc44a41..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnclientconnectionhealth.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealth struct { - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - VpnClientConnectionsCount *int64 `json:"vpnClientConnectionsCount,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnconnection.go deleted file mode 100644 index 9d157042c70..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go deleted file mode 100644 index 97a9e565f9e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestartparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` - LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go deleted file mode 100644 index de501375c21..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionpacketcapturestopparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionPacketCaptureStopParameters struct { - LinkConnectionNames *[]string `json:"linkConnectionNames,omitempty"` - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionproperties.go deleted file mode 100644 index 1c238229449..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnconnectionproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - DpdTimeoutSeconds *int64 `json:"dpdTimeoutSeconds,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpngateway.go b/resource-manager/network/2023-06-01/virtualwans/model_vpngateway.go deleted file mode 100644 index 0c0f9dab77f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewayipconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_vpngatewayipconfiguration.go deleted file mode 100644 index b1060397ea0..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewayipconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayIPConfiguration struct { - Id *string `json:"id,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatrule.go b/resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatrule.go deleted file mode 100644 index 2de41b7ced6..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatruleproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatruleproperties.go deleted file mode 100644 index 1aaf7c8f90b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewaynatruleproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRuleProperties struct { - EgressVpnSiteLinkConnections *[]SubResource `json:"egressVpnSiteLinkConnections,omitempty"` - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - IngressVpnSiteLinkConnections *[]SubResource `json:"ingressVpnSiteLinkConnections,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewayproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpngatewayproperties.go deleted file mode 100644 index ab2b8b55b1b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpngatewayproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayProperties struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Connections *[]VpnConnection `json:"connections,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - NatRules *[]VpnGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnlinkbgpsettings.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnlinkbgpsettings.go deleted file mode 100644 index 72de7d65308..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnlinkbgpsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkBgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnlinkproviderproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnlinkproviderproperties.go deleted file mode 100644 index 555f8739a9b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnlinkproviderproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkProviderProperties struct { - LinkProviderName *string `json:"linkProviderName,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnnatrulemapping.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnnatrulemapping.go deleted file mode 100644 index 09a77912d9f..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnprofileresponse.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnprofileresponse.go deleted file mode 100644 index a96c942841c..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnprofileresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnProfileResponse struct { - ProfileUrl *string `json:"profileUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go deleted file mode 100644 index 21a75789b34..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusClientRootCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go deleted file mode 100644 index 6f67a020c6a..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigradiusserverrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusServerRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfiguration.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfiguration.go deleted file mode 100644 index debdcf03f04..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroup.go deleted file mode 100644 index e94549fb063..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go deleted file mode 100644 index f832688900b..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go deleted file mode 100644 index 93b015d4bd1..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationpolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupProperties struct { - IsDefault *bool `json:"isDefault,omitempty"` - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationproperties.go deleted file mode 100644 index 1a42b30f7aa..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationproperties.go +++ /dev/null @@ -1,23 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationProperties struct { - AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - ConfigurationPolicyGroups *[]VpnServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - P2sVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationsresponse.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationsresponse.go deleted file mode 100644 index 185d5a549d4..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigurationsresponse.go +++ /dev/null @@ -1,8 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationsResponse struct { - VpnServerConfigurationResourceIds *[]string `json:"vpnServerConfigurationResourceIds,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go deleted file mode 100644 index 9582df932b5..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrevokedcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRevokedCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go deleted file mode 100644 index 606a8393665..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnserverconfigvpnclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnsite.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnsite.go deleted file mode 100644 index 7c6dacaed50..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnsite.go +++ /dev/null @@ -1,14 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSite struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelink.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelink.go deleted file mode 100644 index 9c72c0567fd..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelink.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnection.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnection.go deleted file mode 100644 index 88bed41fe65..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnectionproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnectionproperties.go deleted file mode 100644 index 23b24922441..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkconnectionproperties.go +++ /dev/null @@ -1,25 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnGatewayCustomBgpAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` - VpnLinkConnectionMode *VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` - VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkproperties.go deleted file mode 100644 index fa7d9002a52..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnsitelinkproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkProperties struct { - BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/model_vpnsiteproperties.go b/resource-manager/network/2023-06-01/virtualwans/model_vpnsiteproperties.go deleted file mode 100644 index da368da2045..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/model_vpnsiteproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteProperties struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - O365Policy *O365PolicyProperties `json:"o365Policy,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SiteKey *string `json:"siteKey,omitempty"` - VirtualWAN *SubResource `json:"virtualWan,omitempty"` - VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/virtualwans/predicates.go b/resource-manager/network/2023-06-01/virtualwans/predicates.go deleted file mode 100644 index 11d37d16e7e..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/predicates.go +++ /dev/null @@ -1,546 +0,0 @@ -package virtualwans - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BgpConnectionOperationPredicate) Matches(input BgpConnection) 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.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 HubIPConfigurationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p HubIPConfigurationOperationPredicate) Matches(input HubIPConfiguration) 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.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 HubRouteTableOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p HubRouteTableOperationPredicate) Matches(input HubRouteTable) 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.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 HubVirtualNetworkConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p HubVirtualNetworkConnectionOperationPredicate) Matches(input HubVirtualNetworkConnection) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type NetworkVirtualApplianceConnectionOperationPredicate struct { - Id *string - Name *string -} - -func (p NetworkVirtualApplianceConnectionOperationPredicate) Matches(input NetworkVirtualApplianceConnection) 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 - } - - return true -} - -type P2SVpnGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p P2SVpnGatewayOperationPredicate) Matches(input P2SVpnGateway) 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 && (input.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 RouteMapOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RouteMapOperationPredicate) Matches(input RouteMap) 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.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 RoutingIntentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RoutingIntentOperationPredicate) Matches(input RoutingIntent) 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.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 VirtualHubOperationPredicate struct { - Etag *string - Id *string - Kind *string - Location *string - Name *string - Type *string -} - -func (p VirtualHubOperationPredicate) Matches(input VirtualHub) 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.Kind != nil && (input.Kind == nil || *p.Kind != *input.Kind) { - return false - } - - if p.Location != nil && (input.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 VirtualHubRouteTableV2OperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p VirtualHubRouteTableV2OperationPredicate) Matches(input VirtualHubRouteTableV2) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type VirtualWANOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VirtualWANOperationPredicate) Matches(input VirtualWAN) 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 && (input.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 VpnConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string -} - -func (p VpnConnectionOperationPredicate) Matches(input VpnConnection) 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.Name != nil && (input.Name == nil || *p.Name != *input.Name) { - return false - } - - return true -} - -type VpnGatewayOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VpnGatewayOperationPredicate) Matches(input VpnGateway) 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 && (input.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 VpnGatewayNatRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnGatewayNatRuleOperationPredicate) Matches(input VpnGatewayNatRule) 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.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 VpnServerConfigurationOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VpnServerConfigurationOperationPredicate) Matches(input VpnServerConfiguration) 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 && (input.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 VpnServerConfigurationPolicyGroupOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnServerConfigurationPolicyGroupOperationPredicate) Matches(input VpnServerConfigurationPolicyGroup) 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.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 VpnSiteOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VpnSiteOperationPredicate) Matches(input VpnSite) 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 && (input.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 VpnSiteLinkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnSiteLinkOperationPredicate) Matches(input VpnSiteLink) 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.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 VpnSiteLinkConnectionOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p VpnSiteLinkConnectionOperationPredicate) Matches(input VpnSiteLinkConnection) 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.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/network/2023-06-01/virtualwans/version.go b/resource-manager/network/2023-06-01/virtualwans/version.go deleted file mode 100644 index 59b7c9d309d..00000000000 --- a/resource-manager/network/2023-06-01/virtualwans/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package virtualwans - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/virtualwans/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/README.md b/resource-manager/network/2023-06-01/vmsspublicipaddresses/README.md deleted file mode 100644 index 678804e22b6..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/README.md +++ /dev/null @@ -1,71 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vmsspublicipaddresses` Documentation - -The `vmsspublicipaddresses` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/vmsspublicipaddresses" -``` - - -### Client Initialization - -```go -client := vmsspublicipaddresses.NewVMSSPublicIPAddressesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetPublicIPAddressID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue", "publicIPAddressValue") - -read, err := client.PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx, id, vmsspublicipaddresses.DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses` - -```go -ctx := context.TODO() -id := vmsspublicipaddresses.NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - -// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VMSSPublicIPAddressesClient.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses` - -```go -ctx := context.TODO() -id := commonids.NewVirtualMachineScaleSetIPConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue", "virtualMachineValue", "networkInterfaceValue", "ipConfigurationValue") - -// alternatively `client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id)` can be used to do batched pagination -items, err := client.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/client.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/client.go deleted file mode 100644 index 3213cbf73fe..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vmsspublicipaddresses - -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 VMSSPublicIPAddressesClient struct { - Client *resourcemanager.Client -} - -func NewVMSSPublicIPAddressesClientWithBaseURI(sdkApi sdkEnv.Api) (*VMSSPublicIPAddressesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vmsspublicipaddresses", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VMSSPublicIPAddressesClient: %+v", err) - } - - return &VMSSPublicIPAddressesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/constants.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/constants.go deleted file mode 100644 index c753c0f93e2..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/constants.go +++ /dev/null @@ -1,1151 +0,0 @@ -package vmsspublicipaddresses - -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 DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset.go deleted file mode 100644 index 6907f32662f..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset.go +++ /dev/null @@ -1,130 +0,0 @@ -package vmsspublicipaddresses - -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(&VirtualMachineScaleSetId{}) -} - -var _ resourceids.ResourceId = &VirtualMachineScaleSetId{} - -// VirtualMachineScaleSetId is a struct representing the Resource ID for a Virtual Machine Scale Set -type VirtualMachineScaleSetId struct { - SubscriptionId string - ResourceGroupName string - VirtualMachineScaleSetName string -} - -// NewVirtualMachineScaleSetID returns a new VirtualMachineScaleSetId struct -func NewVirtualMachineScaleSetID(subscriptionId string, resourceGroupName string, virtualMachineScaleSetName string) VirtualMachineScaleSetId { - return VirtualMachineScaleSetId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VirtualMachineScaleSetName: virtualMachineScaleSetName, - } -} - -// ParseVirtualMachineScaleSetID parses 'input' into a VirtualMachineScaleSetId -func ParseVirtualMachineScaleSetID(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVirtualMachineScaleSetIDInsensitively parses 'input' case-insensitively into a VirtualMachineScaleSetId -// note: this method should only be used for API response data and not user input -func ParseVirtualMachineScaleSetIDInsensitively(input string) (*VirtualMachineScaleSetId, error) { - parser := resourceids.NewParserFromResourceIdType(&VirtualMachineScaleSetId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VirtualMachineScaleSetId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VirtualMachineScaleSetId) 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.VirtualMachineScaleSetName, ok = input.Parsed["virtualMachineScaleSetName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "virtualMachineScaleSetName", input) - } - - return nil -} - -// ValidateVirtualMachineScaleSetID checks that 'input' can be parsed as a Virtual Machine Scale Set ID -func ValidateVirtualMachineScaleSetID(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 := ParseVirtualMachineScaleSetID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Compute/virtualMachineScaleSets/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VirtualMachineScaleSetName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) 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("staticMicrosoftCompute", "Microsoft.Compute", "Microsoft.Compute"), - resourceids.StaticSegment("staticVirtualMachineScaleSets", "virtualMachineScaleSets", "virtualMachineScaleSets"), - resourceids.UserSpecifiedSegment("virtualMachineScaleSetName", "virtualMachineScaleSetValue"), - } -} - -// String returns a human-readable description of this Virtual Machine Scale Set ID -func (id VirtualMachineScaleSetId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Virtual Machine Scale Set Name: %q", id.VirtualMachineScaleSetName), - } - return fmt.Sprintf("Virtual Machine Scale Set (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go deleted file mode 100644 index d4e158c8f74..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/id_virtualmachinescaleset_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vmsspublicipaddresses - -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 = &VirtualMachineScaleSetId{} - -func TestNewVirtualMachineScaleSetID(t *testing.T) { - id := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue") - - 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.VirtualMachineScaleSetName != "virtualMachineScaleSetValue" { - t.Fatalf("Expected %q but got %q for Segment 'VirtualMachineScaleSetName'", id.VirtualMachineScaleSetName, "virtualMachineScaleSetValue") - } -} - -func TestFormatVirtualMachineScaleSetID(t *testing.T) { - actual := NewVirtualMachineScaleSetID("12345678-1234-9876-4563-123456789012", "example-resource-group", "virtualMachineScaleSetValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVirtualMachineScaleSetID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetID(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestParseVirtualMachineScaleSetIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VirtualMachineScaleSetId - }{ - { - // 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.Compute", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VirtualMachineScaleSetName: "virtualMachineScaleSetValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Compute/virtualMachineScaleSets/virtualMachineScaleSetValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe", - Expected: &VirtualMachineScaleSetId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VirtualMachineScaleSetName: "vIrTuAlMaChInEsCaLeSeTvAlUe", - }, - }, - { - // 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.cOmPuTe/vIrTuAlMaChInEsCaLeSeTs/vIrTuAlMaChInEsCaLeSeTvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVirtualMachineScaleSetIDInsensitively(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.VirtualMachineScaleSetName != v.Expected.VirtualMachineScaleSetName { - t.Fatalf("Expected %q but got %q for VirtualMachineScaleSetName", v.Expected.VirtualMachineScaleSetName, actual.VirtualMachineScaleSetName) - } - - } -} - -func TestSegmentsForVirtualMachineScaleSetId(t *testing.T) { - segments := VirtualMachineScaleSetId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VirtualMachineScaleSetId 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/network/2023-06-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go deleted file mode 100644 index f1a1235a8e2..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddressesgetvirtualmachinescalesetpublicipaddress.go +++ /dev/null @@ -1,84 +0,0 @@ -package vmsspublicipaddresses - -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 PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PublicIPAddress -} - -type PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions struct { - Expand *string -} - -func DefaultPublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions() PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions { - return PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions{} -} - -func (o PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress ... -func (c VMSSPublicIPAddressesClient) PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddress(ctx context.Context, id commonids.VirtualMachineScaleSetPublicIPAddressId, options PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationOptions) (result PublicIPAddressesGetVirtualMachineScaleSetPublicIPAddressOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 PublicIPAddress - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go deleted file mode 100644 index 188c41b7573..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetpublicipaddresses.go +++ /dev/null @@ -1,91 +0,0 @@ -package vmsspublicipaddresses - -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 PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses ... -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx context.Context, id VirtualMachineScaleSetId) (result PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete retrieves all the results into a single object -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesComplete(ctx context.Context, id VirtualMachineScaleSetId) (PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id VirtualMachineScaleSetId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListVirtualMachineScaleSetPublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListVirtualMachineScaleSetPublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go deleted file mode 100644 index 28037a7bb0b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/method_publicipaddresseslistvirtualmachinescalesetvmpublicipaddresses.go +++ /dev/null @@ -1,92 +0,0 @@ -package vmsspublicipaddresses - -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 PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PublicIPAddress -} - -type PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult struct { - LatestHttpResponse *http.Response - Items []PublicIPAddress -} - -// PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses ... -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId) (result PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/publicIPAddresses", 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 *[]PublicIPAddress `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete retrieves all the results into a single object -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesComplete(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId) (PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult, error) { - return c.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteMatchingPredicate(ctx, id, PublicIPAddressOperationPredicate{}) -} - -// PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VMSSPublicIPAddressesClient) PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteMatchingPredicate(ctx context.Context, id commonids.VirtualMachineScaleSetIPConfigurationId, predicate PublicIPAddressOperationPredicate) (result PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult, err error) { - items := make([]PublicIPAddress, 0) - - resp, err := c.PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddresses(ctx, id) - if err != nil { - 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 = PublicIPAddressesListVirtualMachineScaleSetVMPublicIPAddressesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go deleted file mode 100644 index b5e5db2cc91..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index a08e1bc2b3d..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index a1c62d3aff0..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 29707ea0cc0..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index 3d43bc376d7..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygroup.go deleted file mode 100644 index 3886b3a62a9..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 2f9f71ffdfe..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspool.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspool.go deleted file mode 100644 index 2d91da68e06..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index da2c343dcde..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index 409dfc74f46..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ddossettings.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ddossettings.go deleted file mode 100644 index 9db9902cfa2..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_delegation.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_delegation.go deleted file mode 100644 index a81e856e7ea..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlog.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlog.go deleted file mode 100644 index b816a9fb4d8..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogformatparameters.go deleted file mode 100644 index bbe90b3e68a..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go deleted file mode 100644 index 4dc53318cc3..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfiguration.go deleted file mode 100644 index e9d4835cde7..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package vmsspublicipaddresses - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 158c303f1eb..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index a997e703d5a..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrule.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrule.go deleted file mode 100644 index 8d6d17e1ee6..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 0400f6c7e24..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfiguration.go deleted file mode 100644 index ec14aaebfb2..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofile.go deleted file mode 100644 index 04f420bc9e7..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index cc1b778ec31..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 5c56fd40bae..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_iptag.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_iptag.go deleted file mode 100644 index 0f545f4b72b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// 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/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go deleted file mode 100644 index 6c1a542cb79..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index 046c6088344..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgateway.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgateway.go deleted file mode 100644 index d11b8d3920d..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package vmsspublicipaddresses - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go deleted file mode 100644 index 9b3d069fdba..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaysku.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaysku.go deleted file mode 100644 index 3b91a6c98fb..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natruleportmapping.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natruleportmapping.go deleted file mode 100644 index 09ace168bf2..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterface.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterface.go deleted file mode 100644 index e494f13e660..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacednssettings.go deleted file mode 100644 index 178cb8cc8d0..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 5e15e82902b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index 5b63a7f1427..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index a34194f603c..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go deleted file mode 100644 index 67403077a5f..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 89d8808f2b8..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index dd5cb5650a9..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygroup.go deleted file mode 100644 index 390dad55504..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index fd1b9110f0b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpoint.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpoint.go deleted file mode 100644 index 9d1b5059d51..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnection.go deleted file mode 100644 index 37a23931c51..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go deleted file mode 100644 index edd52323b43..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go deleted file mode 100644 index 7e43ad06e3b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index 13d66a23bb9..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointproperties.go deleted file mode 100644 index 9d7c5581f99..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkservice.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkservice.go deleted file mode 100644 index 35696ff7af8..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go deleted file mode 100644 index 15a277940b8..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 36505cb0e91..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 87693646750..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index ffcb7babff1..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 1ac62f6b573..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go deleted file mode 100644 index 5a3793b3967..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddress.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddress.go deleted file mode 100644 index 007f38c15a0..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package vmsspublicipaddresses - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go deleted file mode 100644 index 5c5c8e381d5..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 04e2f5851e5..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresssku.go deleted file mode 100644 index 836d26bc7cf..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlink.go deleted file mode 100644 index 2001bb2021a..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go deleted file mode 100644 index 255ed3f4d7d..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourceset.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourceset.go deleted file mode 100644 index aa795989827..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_retentionpolicyparameters.go deleted file mode 100644 index 18486b1b930..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_route.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_route.go deleted file mode 100644 index d5542b4d6a2..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routepropertiesformat.go deleted file mode 100644 index 7306e155bd1..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetable.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetable.go deleted file mode 100644 index 0e623eb4de8..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetablepropertiesformat.go deleted file mode 100644 index 247f8d8ff0b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrule.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrule.go deleted file mode 100644 index be3c680f597..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go deleted file mode 100644 index 45a25e92fa7..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlink.go deleted file mode 100644 index 6e209a0a72c..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index 7761fb2f5e9..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 0ce0853975d..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicy.go deleted file mode 100644 index 32e2b036118..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go deleted file mode 100644 index d0368e894a0..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 970c54c6772..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index fd6dca6bdb5..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 5857cb159be..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnet.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnet.go deleted file mode 100644 index fd72bf01d45..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnetpropertiesformat.go deleted file mode 100644 index 5f2e9b1a613..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subresource.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subresource.go deleted file mode 100644 index c4627dc0146..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index 9685e4269c8..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go deleted file mode 100644 index e18abbc1afe..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktap.go deleted file mode 100644 index 80ebd9f850d..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index cff477ca81b..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vmsspublicipaddresses/predicates.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/predicates.go deleted file mode 100644 index 3173ab41a32..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package vmsspublicipaddresses - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p PublicIPAddressOperationPredicate) Matches(input PublicIPAddress) 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 && (input.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/network/2023-06-01/vmsspublicipaddresses/version.go b/resource-manager/network/2023-06-01/vmsspublicipaddresses/version.go deleted file mode 100644 index ce63e7c5942..00000000000 --- a/resource-manager/network/2023-06-01/vmsspublicipaddresses/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vmsspublicipaddresses - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vmsspublicipaddresses/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/vpngateways/README.md b/resource-manager/network/2023-06-01/vpngateways/README.md deleted file mode 100644 index 51ecc7dc447..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/README.md +++ /dev/null @@ -1,83 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpngateways` Documentation - -The `vpngateways` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/vpngateways" -``` - - -### Client Initialization - -```go -client := vpngateways.NewVpnGatewaysClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnGatewaysClient.Reset` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -if err := client.ResetThenPoll(ctx, id, vpngateways.DefaultResetOperationOptions()); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.StartPacketCapture` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.VpnGatewayPacketCaptureStartParameters{ - // ... -} - - -if err := client.StartPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.StopPacketCapture` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.VpnGatewayPacketCaptureStopParameters{ - // ... -} - - -if err := client.StopPacketCaptureThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VpnGatewaysClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpngateways.NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - -payload := vpngateways.TagsObject{ - // ... -} - - -if err := client.UpdateTagsThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/network/2023-06-01/vpngateways/client.go b/resource-manager/network/2023-06-01/vpngateways/client.go deleted file mode 100644 index 5679554f1a5..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpngateways - -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 VpnGatewaysClient struct { - Client *resourcemanager.Client -} - -func NewVpnGatewaysClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnGatewaysClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpngateways", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnGatewaysClient: %+v", err) - } - - return &VpnGatewaysClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/vpngateways/constants.go b/resource-manager/network/2023-06-01/vpngateways/constants.go deleted file mode 100644 index 2f1745c4980..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/constants.go +++ /dev/null @@ -1,657 +0,0 @@ -package vpngateways - -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 DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VirtualNetworkGatewayConnectionProtocol string - -const ( - VirtualNetworkGatewayConnectionProtocolIKEvOne VirtualNetworkGatewayConnectionProtocol = "IKEv1" - VirtualNetworkGatewayConnectionProtocolIKEvTwo VirtualNetworkGatewayConnectionProtocol = "IKEv2" -) - -func PossibleValuesForVirtualNetworkGatewayConnectionProtocol() []string { - return []string{ - string(VirtualNetworkGatewayConnectionProtocolIKEvOne), - string(VirtualNetworkGatewayConnectionProtocolIKEvTwo), - } -} - -func (s *VirtualNetworkGatewayConnectionProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkGatewayConnectionProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkGatewayConnectionProtocol(input string) (*VirtualNetworkGatewayConnectionProtocol, error) { - vals := map[string]VirtualNetworkGatewayConnectionProtocol{ - "ikev1": VirtualNetworkGatewayConnectionProtocolIKEvOne, - "ikev2": VirtualNetworkGatewayConnectionProtocolIKEvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkGatewayConnectionProtocol(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnConnectionStatus string - -const ( - VpnConnectionStatusConnected VpnConnectionStatus = "Connected" - VpnConnectionStatusConnecting VpnConnectionStatus = "Connecting" - VpnConnectionStatusNotConnected VpnConnectionStatus = "NotConnected" - VpnConnectionStatusUnknown VpnConnectionStatus = "Unknown" -) - -func PossibleValuesForVpnConnectionStatus() []string { - return []string{ - string(VpnConnectionStatusConnected), - string(VpnConnectionStatusConnecting), - string(VpnConnectionStatusNotConnected), - string(VpnConnectionStatusUnknown), - } -} - -func (s *VpnConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnConnectionStatus(input string) (*VpnConnectionStatus, error) { - vals := map[string]VpnConnectionStatus{ - "connected": VpnConnectionStatusConnected, - "connecting": VpnConnectionStatusConnecting, - "notconnected": VpnConnectionStatusNotConnected, - "unknown": VpnConnectionStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnConnectionStatus(input) - return &out, nil -} - -type VpnLinkConnectionMode string - -const ( - VpnLinkConnectionModeDefault VpnLinkConnectionMode = "Default" - VpnLinkConnectionModeInitiatorOnly VpnLinkConnectionMode = "InitiatorOnly" - VpnLinkConnectionModeResponderOnly VpnLinkConnectionMode = "ResponderOnly" -) - -func PossibleValuesForVpnLinkConnectionMode() []string { - return []string{ - string(VpnLinkConnectionModeDefault), - string(VpnLinkConnectionModeInitiatorOnly), - string(VpnLinkConnectionModeResponderOnly), - } -} - -func (s *VpnLinkConnectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnLinkConnectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnLinkConnectionMode(input string) (*VpnLinkConnectionMode, error) { - vals := map[string]VpnLinkConnectionMode{ - "default": VpnLinkConnectionModeDefault, - "initiatoronly": VpnLinkConnectionModeInitiatorOnly, - "responderonly": VpnLinkConnectionModeResponderOnly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnLinkConnectionMode(input) - return &out, nil -} - -type VpnNatRuleMode string - -const ( - VpnNatRuleModeEgressSnat VpnNatRuleMode = "EgressSnat" - VpnNatRuleModeIngressSnat VpnNatRuleMode = "IngressSnat" -) - -func PossibleValuesForVpnNatRuleMode() []string { - return []string{ - string(VpnNatRuleModeEgressSnat), - string(VpnNatRuleModeIngressSnat), - } -} - -func (s *VpnNatRuleMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleMode(input string) (*VpnNatRuleMode, error) { - vals := map[string]VpnNatRuleMode{ - "egresssnat": VpnNatRuleModeEgressSnat, - "ingresssnat": VpnNatRuleModeIngressSnat, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleMode(input) - return &out, nil -} - -type VpnNatRuleType string - -const ( - VpnNatRuleTypeDynamic VpnNatRuleType = "Dynamic" - VpnNatRuleTypeStatic VpnNatRuleType = "Static" -) - -func PossibleValuesForVpnNatRuleType() []string { - return []string{ - string(VpnNatRuleTypeDynamic), - string(VpnNatRuleTypeStatic), - } -} - -func (s *VpnNatRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnNatRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnNatRuleType(input string) (*VpnNatRuleType, error) { - vals := map[string]VpnNatRuleType{ - "dynamic": VpnNatRuleTypeDynamic, - "static": VpnNatRuleTypeStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnNatRuleType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/vpngateways/id_vpngateway.go b/resource-manager/network/2023-06-01/vpngateways/id_vpngateway.go deleted file mode 100644 index 4a48b9a7916..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/id_vpngateway.go +++ /dev/null @@ -1,130 +0,0 @@ -package vpngateways - -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(&VpnGatewayId{}) -} - -var _ resourceids.ResourceId = &VpnGatewayId{} - -// VpnGatewayId is a struct representing the Resource ID for a Vpn Gateway -type VpnGatewayId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string -} - -// NewVpnGatewayID returns a new VpnGatewayId struct -func NewVpnGatewayID(subscriptionId string, resourceGroupName string, vpnGatewayName string) VpnGatewayId { - return VpnGatewayId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - } -} - -// ParseVpnGatewayID parses 'input' into a VpnGatewayId -func ParseVpnGatewayID(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnGatewayIDInsensitively parses 'input' case-insensitively into a VpnGatewayId -// note: this method should only be used for API response data and not user input -func ParseVpnGatewayIDInsensitively(input string) (*VpnGatewayId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnGatewayId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnGatewayId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnGatewayId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - return nil -} - -// ValidateVpnGatewayID checks that 'input' can be parsed as a Vpn Gateway ID -func ValidateVpnGatewayID(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 := ParseVpnGatewayID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Gateway ID -func (id VpnGatewayId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Gateway ID -func (id VpnGatewayId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - } -} - -// String returns a human-readable description of this Vpn Gateway ID -func (id VpnGatewayId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - } - return fmt.Sprintf("Vpn Gateway (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/vpngateways/id_vpngateway_test.go b/resource-manager/network/2023-06-01/vpngateways/id_vpngateway_test.go deleted file mode 100644 index 56adaca8584..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/id_vpngateway_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vpngateways - -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 = &VpnGatewayId{} - -func TestNewVpnGatewayID(t *testing.T) { - id := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } -} - -func TestFormatVpnGatewayID(t *testing.T) { - actual := NewVpnGatewayID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnGatewayID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestParseVpnGatewayIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnGatewayId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Expected: &VpnGatewayId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnGatewayIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - } -} - -func TestSegmentsForVpnGatewayId(t *testing.T) { - segments := VpnGatewayId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnGatewayId 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/network/2023-06-01/vpngateways/method_reset.go b/resource-manager/network/2023-06-01/vpngateways/method_reset.go deleted file mode 100644 index ca8defc383b..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/method_reset.go +++ /dev/null @@ -1,99 +0,0 @@ -package vpngateways - -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 ResetOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -type ResetOperationOptions struct { - IPConfigurationId *string -} - -func DefaultResetOperationOptions() ResetOperationOptions { - return ResetOperationOptions{} -} - -func (o ResetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ResetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ResetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPConfigurationId != nil { - out.Append("ipConfigurationId", fmt.Sprintf("%v", *o.IPConfigurationId)) - } - return &out -} - -// Reset ... -func (c VpnGatewaysClient) Reset(ctx context.Context, id VpnGatewayId, options ResetOperationOptions) (result ResetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reset", id.ID()), - OptionsObject: options, - } - - 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 -} - -// ResetThenPoll performs Reset then polls until it's completed -func (c VpnGatewaysClient) ResetThenPoll(ctx context.Context, id VpnGatewayId, options ResetOperationOptions) error { - result, err := c.Reset(ctx, id, options) - if err != nil { - return fmt.Errorf("performing Reset: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Reset: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/vpngateways/method_startpacketcapture.go b/resource-manager/network/2023-06-01/vpngateways/method_startpacketcapture.go deleted file mode 100644 index 939a677ec57..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/method_startpacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package vpngateways - -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 StartPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StartPacketCapture ... -func (c VpnGatewaysClient) StartPacketCapture(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStartParameters) (result StartPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/startpacketcapture", 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 -} - -// StartPacketCaptureThenPoll performs StartPacketCapture then polls until it's completed -func (c VpnGatewaysClient) StartPacketCaptureThenPoll(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStartParameters) error { - result, err := c.StartPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StartPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StartPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/vpngateways/method_stoppacketcapture.go b/resource-manager/network/2023-06-01/vpngateways/method_stoppacketcapture.go deleted file mode 100644 index 52d225da3ca..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/method_stoppacketcapture.go +++ /dev/null @@ -1,75 +0,0 @@ -package vpngateways - -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 StopPacketCaptureOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *string -} - -// StopPacketCapture ... -func (c VpnGatewaysClient) StopPacketCapture(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStopParameters) (result StopPacketCaptureOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/stoppacketcapture", 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 -} - -// StopPacketCaptureThenPoll performs StopPacketCapture then polls until it's completed -func (c VpnGatewaysClient) StopPacketCaptureThenPoll(ctx context.Context, id VpnGatewayId, input VpnGatewayPacketCaptureStopParameters) error { - result, err := c.StopPacketCapture(ctx, id, input) - if err != nil { - return fmt.Errorf("performing StopPacketCapture: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after StopPacketCapture: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/vpngateways/method_updatetags.go b/resource-manager/network/2023-06-01/vpngateways/method_updatetags.go deleted file mode 100644 index 9149232ae67..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/method_updatetags.go +++ /dev/null @@ -1,75 +0,0 @@ -package vpngateways - -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 UpdateTagsOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *VpnGateway -} - -// UpdateTags ... -func (c VpnGatewaysClient) UpdateTags(ctx context.Context, id VpnGatewayId, input TagsObject) (result UpdateTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateTagsThenPoll performs UpdateTags then polls until it's completed -func (c VpnGatewaysClient) UpdateTagsThenPoll(ctx context.Context, id VpnGatewayId, input TagsObject) error { - result, err := c.UpdateTags(ctx, id, input) - 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/network/2023-06-01/vpngateways/model_bgpsettings.go b/resource-manager/network/2023-06-01/vpngateways/model_bgpsettings.go deleted file mode 100644 index f2627d16bf7..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go b/resource-manager/network/2023-06-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go deleted file mode 100644 index 6b30604f2da..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_gatewaycustombgpipaddressipconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayCustomBgpIPAddressIPConfiguration struct { - CustomBgpIPAddress string `json:"customBgpIpAddress"` - IPConfigurationId string `json:"ipConfigurationId"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-06-01/vpngateways/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index c3e0e46c541..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_ipsecpolicy.go b/resource-manager/network/2023-06-01/vpngateways/model_ipsecpolicy.go deleted file mode 100644 index 63c4e9184df..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_propagatedroutetable.go b/resource-manager/network/2023-06-01/vpngateways/model_propagatedroutetable.go deleted file mode 100644 index e838e6e2dc7..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_routingconfiguration.go b/resource-manager/network/2023-06-01/vpngateways/model_routingconfiguration.go deleted file mode 100644 index fe2fd37804f..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_staticroute.go b/resource-manager/network/2023-06-01/vpngateways/model_staticroute.go deleted file mode 100644 index 90806109c8c..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_staticroutesconfig.go b/resource-manager/network/2023-06-01/vpngateways/model_staticroutesconfig.go deleted file mode 100644 index b973c853be2..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_subresource.go b/resource-manager/network/2023-06-01/vpngateways/model_subresource.go deleted file mode 100644 index cf0dbcdeb10..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_tagsobject.go b/resource-manager/network/2023-06-01/vpngateways/model_tagsobject.go deleted file mode 100644 index dd09a7e7f34..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// 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/network/2023-06-01/vpngateways/model_trafficselectorpolicy.go b/resource-manager/network/2023-06-01/vpngateways/model_trafficselectorpolicy.go deleted file mode 100644 index b65874d225f..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_trafficselectorpolicy.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficSelectorPolicy struct { - LocalAddressRanges []string `json:"localAddressRanges"` - RemoteAddressRanges []string `json:"remoteAddressRanges"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vnetroute.go b/resource-manager/network/2023-06-01/vpngateways/model_vnetroute.go deleted file mode 100644 index 31f211b1d1d..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpnconnection.go b/resource-manager/network/2023-06-01/vpngateways/model_vpnconnection.go deleted file mode 100644 index a65d73ea9e8..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpnconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnConnectionProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpnconnectionproperties.go b/resource-manager/network/2023-06-01/vpngateways/model_vpnconnectionproperties.go deleted file mode 100644 index df2da84d685..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpnconnectionproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - DpdTimeoutSeconds *int64 `json:"dpdTimeoutSeconds,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RemoteVpnSite *SubResource `json:"remoteVpnSite,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - TrafficSelectorPolicies *[]TrafficSelectorPolicy `json:"trafficSelectorPolicies,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnLinkConnections *[]VpnSiteLinkConnection `json:"vpnLinkConnections,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngateway.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngateway.go deleted file mode 100644 index 8117006b3a9..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewayipconfiguration.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngatewayipconfiguration.go deleted file mode 100644 index 703d0c1d833..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewayipconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayIPConfiguration struct { - Id *string `json:"id,omitempty"` - PrivateIPAddress *string `json:"privateIpAddress,omitempty"` - PublicIPAddress *string `json:"publicIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatrule.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatrule.go deleted file mode 100644 index 833a44f9a3d..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnGatewayNatRuleProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatruleproperties.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatruleproperties.go deleted file mode 100644 index 240415bacef..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaynatruleproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayNatRuleProperties struct { - EgressVpnSiteLinkConnections *[]SubResource `json:"egressVpnSiteLinkConnections,omitempty"` - ExternalMappings *[]VpnNatRuleMapping `json:"externalMappings,omitempty"` - IPConfigurationId *string `json:"ipConfigurationId,omitempty"` - IngressVpnSiteLinkConnections *[]SubResource `json:"ingressVpnSiteLinkConnections,omitempty"` - InternalMappings *[]VpnNatRuleMapping `json:"internalMappings,omitempty"` - Mode *VpnNatRuleMode `json:"mode,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Type *VpnNatRuleType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go deleted file mode 100644 index 4afb62c2a68..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestartparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayPacketCaptureStartParameters struct { - FilterData *string `json:"filterData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go deleted file mode 100644 index ca9fe7cf71d..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewaypacketcapturestopparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayPacketCaptureStopParameters struct { - SasUrl *string `json:"sasUrl,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewayproperties.go b/resource-manager/network/2023-06-01/vpngateways/model_vpngatewayproperties.go deleted file mode 100644 index aa5ac3cbf6c..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpngatewayproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnGatewayProperties struct { - BgpSettings *BgpSettings `json:"bgpSettings,omitempty"` - Connections *[]VpnConnection `json:"connections,omitempty"` - EnableBgpRouteTranslationForNat *bool `json:"enableBgpRouteTranslationForNat,omitempty"` - IPConfigurations *[]VpnGatewayIPConfiguration `json:"ipConfigurations,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - NatRules *[]VpnGatewayNatRule `json:"natRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpnnatrulemapping.go b/resource-manager/network/2023-06-01/vpngateways/model_vpnnatrulemapping.go deleted file mode 100644 index 3cd7718da11..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpnnatrulemapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnNatRuleMapping struct { - AddressSpace *string `json:"addressSpace,omitempty"` - PortRange *string `json:"portRange,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnection.go b/resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnection.go deleted file mode 100644 index 874a627b999..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnectionproperties.go b/resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnectionproperties.go deleted file mode 100644 index fc23bd1f279..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/model_vpnsitelinkconnectionproperties.go +++ /dev/null @@ -1,25 +0,0 @@ -package vpngateways - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkConnectionProperties struct { - ConnectionBandwidth *int64 `json:"connectionBandwidth,omitempty"` - ConnectionStatus *VpnConnectionStatus `json:"connectionStatus,omitempty"` - EgressBytesTransferred *int64 `json:"egressBytesTransferred,omitempty"` - EgressNatRules *[]SubResource `json:"egressNatRules,omitempty"` - EnableBgp *bool `json:"enableBgp,omitempty"` - EnableRateLimiting *bool `json:"enableRateLimiting,omitempty"` - IPsecPolicies *[]IPsecPolicy `json:"ipsecPolicies,omitempty"` - IngressBytesTransferred *int64 `json:"ingressBytesTransferred,omitempty"` - IngressNatRules *[]SubResource `json:"ingressNatRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingWeight *int64 `json:"routingWeight,omitempty"` - SharedKey *string `json:"sharedKey,omitempty"` - UseLocalAzureIPAddress *bool `json:"useLocalAzureIpAddress,omitempty"` - UsePolicyBasedTrafficSelectors *bool `json:"usePolicyBasedTrafficSelectors,omitempty"` - VpnConnectionProtocolType *VirtualNetworkGatewayConnectionProtocol `json:"vpnConnectionProtocolType,omitempty"` - VpnGatewayCustomBgpAddresses *[]GatewayCustomBgpIPAddressIPConfiguration `json:"vpnGatewayCustomBgpAddresses,omitempty"` - VpnLinkConnectionMode *VpnLinkConnectionMode `json:"vpnLinkConnectionMode,omitempty"` - VpnSiteLink *SubResource `json:"vpnSiteLink,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpngateways/version.go b/resource-manager/network/2023-06-01/vpngateways/version.go deleted file mode 100644 index 5e1e0a62fc0..00000000000 --- a/resource-manager/network/2023-06-01/vpngateways/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpngateways - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpngateways/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/vpnlinkconnections/client.go b/resource-manager/network/2023-06-01/vpnlinkconnections/client.go deleted file mode 100644 index 3fbef685129..00000000000 --- a/resource-manager/network/2023-06-01/vpnlinkconnections/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpnlinkconnections - -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 VpnLinkConnectionsClient struct { - Client *resourcemanager.Client -} - -func NewVpnLinkConnectionsClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnLinkConnectionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpnlinkconnections", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnLinkConnectionsClient: %+v", err) - } - - return &VpnLinkConnectionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection.go b/resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection.go deleted file mode 100644 index e1dd95afd3a..00000000000 --- a/resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection.go +++ /dev/null @@ -1,148 +0,0 @@ -package vpnlinkconnections - -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(&VpnLinkConnectionId{}) -} - -var _ resourceids.ResourceId = &VpnLinkConnectionId{} - -// VpnLinkConnectionId is a struct representing the Resource ID for a Vpn Link Connection -type VpnLinkConnectionId struct { - SubscriptionId string - ResourceGroupName string - VpnGatewayName string - VpnConnectionName string - VpnLinkConnectionName string -} - -// NewVpnLinkConnectionID returns a new VpnLinkConnectionId struct -func NewVpnLinkConnectionID(subscriptionId string, resourceGroupName string, vpnGatewayName string, vpnConnectionName string, vpnLinkConnectionName string) VpnLinkConnectionId { - return VpnLinkConnectionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnGatewayName: vpnGatewayName, - VpnConnectionName: vpnConnectionName, - VpnLinkConnectionName: vpnLinkConnectionName, - } -} - -// ParseVpnLinkConnectionID parses 'input' into a VpnLinkConnectionId -func ParseVpnLinkConnectionID(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnLinkConnectionIDInsensitively parses 'input' case-insensitively into a VpnLinkConnectionId -// note: this method should only be used for API response data and not user input -func ParseVpnLinkConnectionIDInsensitively(input string) (*VpnLinkConnectionId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnLinkConnectionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnLinkConnectionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnLinkConnectionId) 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.VpnGatewayName, ok = input.Parsed["vpnGatewayName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnGatewayName", input) - } - - if id.VpnConnectionName, ok = input.Parsed["vpnConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnConnectionName", input) - } - - if id.VpnLinkConnectionName, ok = input.Parsed["vpnLinkConnectionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnLinkConnectionName", input) - } - - return nil -} - -// ValidateVpnLinkConnectionID checks that 'input' can be parsed as a Vpn Link Connection ID -func ValidateVpnLinkConnectionID(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 := ParseVpnLinkConnectionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Link Connection ID -func (id VpnLinkConnectionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnGateways/%s/vpnConnections/%s/vpnLinkConnections/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnGatewayName, id.VpnConnectionName, id.VpnLinkConnectionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Link Connection ID -func (id VpnLinkConnectionId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnGateways", "vpnGateways", "vpnGateways"), - resourceids.UserSpecifiedSegment("vpnGatewayName", "vpnGatewayValue"), - resourceids.StaticSegment("staticVpnConnections", "vpnConnections", "vpnConnections"), - resourceids.UserSpecifiedSegment("vpnConnectionName", "vpnConnectionValue"), - resourceids.StaticSegment("staticVpnLinkConnections", "vpnLinkConnections", "vpnLinkConnections"), - resourceids.UserSpecifiedSegment("vpnLinkConnectionName", "vpnLinkConnectionValue"), - } -} - -// String returns a human-readable description of this Vpn Link Connection ID -func (id VpnLinkConnectionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Gateway Name: %q", id.VpnGatewayName), - fmt.Sprintf("Vpn Connection Name: %q", id.VpnConnectionName), - fmt.Sprintf("Vpn Link Connection Name: %q", id.VpnLinkConnectionName), - } - return fmt.Sprintf("Vpn Link Connection (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection_test.go b/resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection_test.go deleted file mode 100644 index adc8d44297b..00000000000 --- a/resource-manager/network/2023-06-01/vpnlinkconnections/id_vpnlinkconnection_test.go +++ /dev/null @@ -1,372 +0,0 @@ -package vpnlinkconnections - -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 = &VpnLinkConnectionId{} - -func TestNewVpnLinkConnectionID(t *testing.T) { - id := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue") - - 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.VpnGatewayName != "vpnGatewayValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnGatewayName'", id.VpnGatewayName, "vpnGatewayValue") - } - - if id.VpnConnectionName != "vpnConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnConnectionName'", id.VpnConnectionName, "vpnConnectionValue") - } - - if id.VpnLinkConnectionName != "vpnLinkConnectionValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnLinkConnectionName'", id.VpnLinkConnectionName, "vpnLinkConnectionValue") - } -} - -func TestFormatVpnLinkConnectionID(t *testing.T) { - actual := NewVpnLinkConnectionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnGatewayValue", "vpnConnectionValue", "vpnLinkConnectionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnLinkConnectionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionID(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestParseVpnLinkConnectionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnLinkConnectionId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnGatewayName: "vpnGatewayValue", - VpnConnectionName: "vpnConnectionValue", - VpnLinkConnectionName: "vpnLinkConnectionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnGateways/vpnGatewayValue/vpnConnections/vpnConnectionValue/vpnLinkConnections/vpnLinkConnectionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE", - Expected: &VpnLinkConnectionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnGatewayName: "vPnGaTeWaYvAlUe", - VpnConnectionName: "vPnCoNnEcTiOnVaLuE", - VpnLinkConnectionName: "vPnLiNkCoNnEcTiOnVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnGaTeWaYs/vPnGaTeWaYvAlUe/vPnCoNnEcTiOnS/vPnCoNnEcTiOnVaLuE/vPnLiNkCoNnEcTiOnS/vPnLiNkCoNnEcTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnLinkConnectionIDInsensitively(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.VpnGatewayName != v.Expected.VpnGatewayName { - t.Fatalf("Expected %q but got %q for VpnGatewayName", v.Expected.VpnGatewayName, actual.VpnGatewayName) - } - - if actual.VpnConnectionName != v.Expected.VpnConnectionName { - t.Fatalf("Expected %q but got %q for VpnConnectionName", v.Expected.VpnConnectionName, actual.VpnConnectionName) - } - - if actual.VpnLinkConnectionName != v.Expected.VpnLinkConnectionName { - t.Fatalf("Expected %q but got %q for VpnLinkConnectionName", v.Expected.VpnLinkConnectionName, actual.VpnLinkConnectionName) - } - - } -} - -func TestSegmentsForVpnLinkConnectionId(t *testing.T) { - segments := VpnLinkConnectionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnLinkConnectionId 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/network/2023-06-01/vpnlinkconnections/method_resetconnection.go b/resource-manager/network/2023-06-01/vpnlinkconnections/method_resetconnection.go deleted file mode 100644 index 526963414ea..00000000000 --- a/resource-manager/network/2023-06-01/vpnlinkconnections/method_resetconnection.go +++ /dev/null @@ -1,69 +0,0 @@ -package vpnlinkconnections - -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 ResetConnectionOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ResetConnection ... -func (c VpnLinkConnectionsClient) ResetConnection(ctx context.Context, id VpnLinkConnectionId) (result ResetConnectionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/resetconnection", 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 -} - -// ResetConnectionThenPoll performs ResetConnection then polls until it's completed -func (c VpnLinkConnectionsClient) ResetConnectionThenPoll(ctx context.Context, id VpnLinkConnectionId) error { - result, err := c.ResetConnection(ctx, id) - if err != nil { - return fmt.Errorf("performing ResetConnection: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ResetConnection: %+v", err) - } - - return nil -} diff --git a/resource-manager/network/2023-06-01/vpnlinkconnections/version.go b/resource-manager/network/2023-06-01/vpnlinkconnections/version.go deleted file mode 100644 index 07e56c45c4d..00000000000 --- a/resource-manager/network/2023-06-01/vpnlinkconnections/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnlinkconnections - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnlinkconnections/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/README.md b/resource-manager/network/2023-06-01/vpnserverconfigurations/README.md deleted file mode 100644 index 203c18d64c8..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpnserverconfigurations` Documentation - -The `vpnserverconfigurations` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/vpnserverconfigurations" -``` - - -### Client Initialization - -```go -client := vpnserverconfigurations.NewVpnServerConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnServerConfigurationsClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpnserverconfigurations.NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - -payload := vpnserverconfigurations.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/network/2023-06-01/vpnserverconfigurations/client.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/client.go deleted file mode 100644 index 6209cc6af8d..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpnserverconfigurations - -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 VpnServerConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewVpnServerConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnServerConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpnserverconfigurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnServerConfigurationsClient: %+v", err) - } - - return &VpnServerConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/constants.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/constants.go deleted file mode 100644 index f297d6e8b17..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/constants.go +++ /dev/null @@ -1,572 +0,0 @@ -package vpnserverconfigurations - -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 DhGroup string - -const ( - DhGroupDHGroupOne DhGroup = "DHGroup1" - DhGroupDHGroupOneFour DhGroup = "DHGroup14" - DhGroupDHGroupTwo DhGroup = "DHGroup2" - DhGroupDHGroupTwoFour DhGroup = "DHGroup24" - DhGroupDHGroupTwoZeroFourEight DhGroup = "DHGroup2048" - DhGroupECPThreeEightFour DhGroup = "ECP384" - DhGroupECPTwoFiveSix DhGroup = "ECP256" - DhGroupNone DhGroup = "None" -) - -func PossibleValuesForDhGroup() []string { - return []string{ - string(DhGroupDHGroupOne), - string(DhGroupDHGroupOneFour), - string(DhGroupDHGroupTwo), - string(DhGroupDHGroupTwoFour), - string(DhGroupDHGroupTwoZeroFourEight), - string(DhGroupECPThreeEightFour), - string(DhGroupECPTwoFiveSix), - string(DhGroupNone), - } -} - -func (s *DhGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDhGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDhGroup(input string) (*DhGroup, error) { - vals := map[string]DhGroup{ - "dhgroup1": DhGroupDHGroupOne, - "dhgroup14": DhGroupDHGroupOneFour, - "dhgroup2": DhGroupDHGroupTwo, - "dhgroup24": DhGroupDHGroupTwoFour, - "dhgroup2048": DhGroupDHGroupTwoZeroFourEight, - "ecp384": DhGroupECPThreeEightFour, - "ecp256": DhGroupECPTwoFiveSix, - "none": DhGroupNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DhGroup(input) - return &out, nil -} - -type IPsecEncryption string - -const ( - IPsecEncryptionAESOneNineTwo IPsecEncryption = "AES192" - IPsecEncryptionAESOneTwoEight IPsecEncryption = "AES128" - IPsecEncryptionAESTwoFiveSix IPsecEncryption = "AES256" - IPsecEncryptionDES IPsecEncryption = "DES" - IPsecEncryptionDESThree IPsecEncryption = "DES3" - IPsecEncryptionGCMAESOneNineTwo IPsecEncryption = "GCMAES192" - IPsecEncryptionGCMAESOneTwoEight IPsecEncryption = "GCMAES128" - IPsecEncryptionGCMAESTwoFiveSix IPsecEncryption = "GCMAES256" - IPsecEncryptionNone IPsecEncryption = "None" -) - -func PossibleValuesForIPsecEncryption() []string { - return []string{ - string(IPsecEncryptionAESOneNineTwo), - string(IPsecEncryptionAESOneTwoEight), - string(IPsecEncryptionAESTwoFiveSix), - string(IPsecEncryptionDES), - string(IPsecEncryptionDESThree), - string(IPsecEncryptionGCMAESOneNineTwo), - string(IPsecEncryptionGCMAESOneTwoEight), - string(IPsecEncryptionGCMAESTwoFiveSix), - string(IPsecEncryptionNone), - } -} - -func (s *IPsecEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecEncryption(input string) (*IPsecEncryption, error) { - vals := map[string]IPsecEncryption{ - "aes192": IPsecEncryptionAESOneNineTwo, - "aes128": IPsecEncryptionAESOneTwoEight, - "aes256": IPsecEncryptionAESTwoFiveSix, - "des": IPsecEncryptionDES, - "des3": IPsecEncryptionDESThree, - "gcmaes192": IPsecEncryptionGCMAESOneNineTwo, - "gcmaes128": IPsecEncryptionGCMAESOneTwoEight, - "gcmaes256": IPsecEncryptionGCMAESTwoFiveSix, - "none": IPsecEncryptionNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecEncryption(input) - return &out, nil -} - -type IPsecIntegrity string - -const ( - IPsecIntegrityGCMAESOneNineTwo IPsecIntegrity = "GCMAES192" - IPsecIntegrityGCMAESOneTwoEight IPsecIntegrity = "GCMAES128" - IPsecIntegrityGCMAESTwoFiveSix IPsecIntegrity = "GCMAES256" - IPsecIntegrityMDFive IPsecIntegrity = "MD5" - IPsecIntegritySHAOne IPsecIntegrity = "SHA1" - IPsecIntegritySHATwoFiveSix IPsecIntegrity = "SHA256" -) - -func PossibleValuesForIPsecIntegrity() []string { - return []string{ - string(IPsecIntegrityGCMAESOneNineTwo), - string(IPsecIntegrityGCMAESOneTwoEight), - string(IPsecIntegrityGCMAESTwoFiveSix), - string(IPsecIntegrityMDFive), - string(IPsecIntegritySHAOne), - string(IPsecIntegritySHATwoFiveSix), - } -} - -func (s *IPsecIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPsecIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPsecIntegrity(input string) (*IPsecIntegrity, error) { - vals := map[string]IPsecIntegrity{ - "gcmaes192": IPsecIntegrityGCMAESOneNineTwo, - "gcmaes128": IPsecIntegrityGCMAESOneTwoEight, - "gcmaes256": IPsecIntegrityGCMAESTwoFiveSix, - "md5": IPsecIntegrityMDFive, - "sha1": IPsecIntegritySHAOne, - "sha256": IPsecIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPsecIntegrity(input) - return &out, nil -} - -type IkeEncryption string - -const ( - IkeEncryptionAESOneNineTwo IkeEncryption = "AES192" - IkeEncryptionAESOneTwoEight IkeEncryption = "AES128" - IkeEncryptionAESTwoFiveSix IkeEncryption = "AES256" - IkeEncryptionDES IkeEncryption = "DES" - IkeEncryptionDESThree IkeEncryption = "DES3" - IkeEncryptionGCMAESOneTwoEight IkeEncryption = "GCMAES128" - IkeEncryptionGCMAESTwoFiveSix IkeEncryption = "GCMAES256" -) - -func PossibleValuesForIkeEncryption() []string { - return []string{ - string(IkeEncryptionAESOneNineTwo), - string(IkeEncryptionAESOneTwoEight), - string(IkeEncryptionAESTwoFiveSix), - string(IkeEncryptionDES), - string(IkeEncryptionDESThree), - string(IkeEncryptionGCMAESOneTwoEight), - string(IkeEncryptionGCMAESTwoFiveSix), - } -} - -func (s *IkeEncryption) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeEncryption(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeEncryption(input string) (*IkeEncryption, error) { - vals := map[string]IkeEncryption{ - "aes192": IkeEncryptionAESOneNineTwo, - "aes128": IkeEncryptionAESOneTwoEight, - "aes256": IkeEncryptionAESTwoFiveSix, - "des": IkeEncryptionDES, - "des3": IkeEncryptionDESThree, - "gcmaes128": IkeEncryptionGCMAESOneTwoEight, - "gcmaes256": IkeEncryptionGCMAESTwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeEncryption(input) - return &out, nil -} - -type IkeIntegrity string - -const ( - IkeIntegrityGCMAESOneTwoEight IkeIntegrity = "GCMAES128" - IkeIntegrityGCMAESTwoFiveSix IkeIntegrity = "GCMAES256" - IkeIntegrityMDFive IkeIntegrity = "MD5" - IkeIntegritySHAOne IkeIntegrity = "SHA1" - IkeIntegritySHAThreeEightFour IkeIntegrity = "SHA384" - IkeIntegritySHATwoFiveSix IkeIntegrity = "SHA256" -) - -func PossibleValuesForIkeIntegrity() []string { - return []string{ - string(IkeIntegrityGCMAESOneTwoEight), - string(IkeIntegrityGCMAESTwoFiveSix), - string(IkeIntegrityMDFive), - string(IkeIntegritySHAOne), - string(IkeIntegritySHAThreeEightFour), - string(IkeIntegritySHATwoFiveSix), - } -} - -func (s *IkeIntegrity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIkeIntegrity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIkeIntegrity(input string) (*IkeIntegrity, error) { - vals := map[string]IkeIntegrity{ - "gcmaes128": IkeIntegrityGCMAESOneTwoEight, - "gcmaes256": IkeIntegrityGCMAESTwoFiveSix, - "md5": IkeIntegrityMDFive, - "sha1": IkeIntegritySHAOne, - "sha384": IkeIntegritySHAThreeEightFour, - "sha256": IkeIntegritySHATwoFiveSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IkeIntegrity(input) - return &out, nil -} - -type PfsGroup string - -const ( - PfsGroupECPThreeEightFour PfsGroup = "ECP384" - PfsGroupECPTwoFiveSix PfsGroup = "ECP256" - PfsGroupNone PfsGroup = "None" - PfsGroupPFSMM PfsGroup = "PFSMM" - PfsGroupPFSOne PfsGroup = "PFS1" - PfsGroupPFSOneFour PfsGroup = "PFS14" - PfsGroupPFSTwo PfsGroup = "PFS2" - PfsGroupPFSTwoFour PfsGroup = "PFS24" - PfsGroupPFSTwoZeroFourEight PfsGroup = "PFS2048" -) - -func PossibleValuesForPfsGroup() []string { - return []string{ - string(PfsGroupECPThreeEightFour), - string(PfsGroupECPTwoFiveSix), - string(PfsGroupNone), - string(PfsGroupPFSMM), - string(PfsGroupPFSOne), - string(PfsGroupPFSOneFour), - string(PfsGroupPFSTwo), - string(PfsGroupPFSTwoFour), - string(PfsGroupPFSTwoZeroFourEight), - } -} - -func (s *PfsGroup) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePfsGroup(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePfsGroup(input string) (*PfsGroup, error) { - vals := map[string]PfsGroup{ - "ecp384": PfsGroupECPThreeEightFour, - "ecp256": PfsGroupECPTwoFiveSix, - "none": PfsGroupNone, - "pfsmm": PfsGroupPFSMM, - "pfs1": PfsGroupPFSOne, - "pfs14": PfsGroupPFSOneFour, - "pfs2": PfsGroupPFSTwo, - "pfs24": PfsGroupPFSTwoFour, - "pfs2048": PfsGroupPFSTwoZeroFourEight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PfsGroup(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type VnetLocalRouteOverrideCriteria string - -const ( - VnetLocalRouteOverrideCriteriaContains VnetLocalRouteOverrideCriteria = "Contains" - VnetLocalRouteOverrideCriteriaEqual VnetLocalRouteOverrideCriteria = "Equal" -) - -func PossibleValuesForVnetLocalRouteOverrideCriteria() []string { - return []string{ - string(VnetLocalRouteOverrideCriteriaContains), - string(VnetLocalRouteOverrideCriteriaEqual), - } -} - -func (s *VnetLocalRouteOverrideCriteria) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVnetLocalRouteOverrideCriteria(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVnetLocalRouteOverrideCriteria(input string) (*VnetLocalRouteOverrideCriteria, error) { - vals := map[string]VnetLocalRouteOverrideCriteria{ - "contains": VnetLocalRouteOverrideCriteriaContains, - "equal": VnetLocalRouteOverrideCriteriaEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VnetLocalRouteOverrideCriteria(input) - return &out, nil -} - -type VpnAuthenticationType string - -const ( - VpnAuthenticationTypeAAD VpnAuthenticationType = "AAD" - VpnAuthenticationTypeCertificate VpnAuthenticationType = "Certificate" - VpnAuthenticationTypeRadius VpnAuthenticationType = "Radius" -) - -func PossibleValuesForVpnAuthenticationType() []string { - return []string{ - string(VpnAuthenticationTypeAAD), - string(VpnAuthenticationTypeCertificate), - string(VpnAuthenticationTypeRadius), - } -} - -func (s *VpnAuthenticationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnAuthenticationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnAuthenticationType(input string) (*VpnAuthenticationType, error) { - vals := map[string]VpnAuthenticationType{ - "aad": VpnAuthenticationTypeAAD, - "certificate": VpnAuthenticationTypeCertificate, - "radius": VpnAuthenticationTypeRadius, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnAuthenticationType(input) - return &out, nil -} - -type VpnGatewayTunnelingProtocol string - -const ( - VpnGatewayTunnelingProtocolIkeVTwo VpnGatewayTunnelingProtocol = "IkeV2" - VpnGatewayTunnelingProtocolOpenVPN VpnGatewayTunnelingProtocol = "OpenVPN" -) - -func PossibleValuesForVpnGatewayTunnelingProtocol() []string { - return []string{ - string(VpnGatewayTunnelingProtocolIkeVTwo), - string(VpnGatewayTunnelingProtocolOpenVPN), - } -} - -func (s *VpnGatewayTunnelingProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnGatewayTunnelingProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnGatewayTunnelingProtocol(input string) (*VpnGatewayTunnelingProtocol, error) { - vals := map[string]VpnGatewayTunnelingProtocol{ - "ikev2": VpnGatewayTunnelingProtocolIkeVTwo, - "openvpn": VpnGatewayTunnelingProtocolOpenVPN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnGatewayTunnelingProtocol(input) - return &out, nil -} - -type VpnPolicyMemberAttributeType string - -const ( - VpnPolicyMemberAttributeTypeAADGroupId VpnPolicyMemberAttributeType = "AADGroupId" - VpnPolicyMemberAttributeTypeCertificateGroupId VpnPolicyMemberAttributeType = "CertificateGroupId" - VpnPolicyMemberAttributeTypeRadiusAzureGroupId VpnPolicyMemberAttributeType = "RadiusAzureGroupId" -) - -func PossibleValuesForVpnPolicyMemberAttributeType() []string { - return []string{ - string(VpnPolicyMemberAttributeTypeAADGroupId), - string(VpnPolicyMemberAttributeTypeCertificateGroupId), - string(VpnPolicyMemberAttributeTypeRadiusAzureGroupId), - } -} - -func (s *VpnPolicyMemberAttributeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVpnPolicyMemberAttributeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVpnPolicyMemberAttributeType(input string) (*VpnPolicyMemberAttributeType, error) { - vals := map[string]VpnPolicyMemberAttributeType{ - "aadgroupid": VpnPolicyMemberAttributeTypeAADGroupId, - "certificategroupid": VpnPolicyMemberAttributeTypeCertificateGroupId, - "radiusazuregroupid": VpnPolicyMemberAttributeTypeRadiusAzureGroupId, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VpnPolicyMemberAttributeType(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration.go deleted file mode 100644 index 56b67386806..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration.go +++ /dev/null @@ -1,130 +0,0 @@ -package vpnserverconfigurations - -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(&VpnServerConfigurationId{}) -} - -var _ resourceids.ResourceId = &VpnServerConfigurationId{} - -// VpnServerConfigurationId is a struct representing the Resource ID for a Vpn Server Configuration -type VpnServerConfigurationId struct { - SubscriptionId string - ResourceGroupName string - VpnServerConfigurationName string -} - -// NewVpnServerConfigurationID returns a new VpnServerConfigurationId struct -func NewVpnServerConfigurationID(subscriptionId string, resourceGroupName string, vpnServerConfigurationName string) VpnServerConfigurationId { - return VpnServerConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnServerConfigurationName: vpnServerConfigurationName, - } -} - -// ParseVpnServerConfigurationID parses 'input' into a VpnServerConfigurationId -func ParseVpnServerConfigurationID(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnServerConfigurationIDInsensitively parses 'input' case-insensitively into a VpnServerConfigurationId -// note: this method should only be used for API response data and not user input -func ParseVpnServerConfigurationIDInsensitively(input string) (*VpnServerConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnServerConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnServerConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnServerConfigurationId) 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.VpnServerConfigurationName, ok = input.Parsed["vpnServerConfigurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnServerConfigurationName", input) - } - - return nil -} - -// ValidateVpnServerConfigurationID checks that 'input' can be parsed as a Vpn Server Configuration ID -func ValidateVpnServerConfigurationID(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 := ParseVpnServerConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Server Configuration ID -func (id VpnServerConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnServerConfigurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnServerConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Server Configuration ID -func (id VpnServerConfigurationId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnServerConfigurations", "vpnServerConfigurations", "vpnServerConfigurations"), - resourceids.UserSpecifiedSegment("vpnServerConfigurationName", "vpnServerConfigurationValue"), - } -} - -// String returns a human-readable description of this Vpn Server Configuration ID -func (id VpnServerConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Server Configuration Name: %q", id.VpnServerConfigurationName), - } - return fmt.Sprintf("Vpn Server Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go deleted file mode 100644 index 9a0a657eea1..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/id_vpnserverconfiguration_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vpnserverconfigurations - -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 = &VpnServerConfigurationId{} - -func TestNewVpnServerConfigurationID(t *testing.T) { - id := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue") - - 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.VpnServerConfigurationName != "vpnServerConfigurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnServerConfigurationName'", id.VpnServerConfigurationName, "vpnServerConfigurationValue") - } -} - -func TestFormatVpnServerConfigurationID(t *testing.T) { - actual := NewVpnServerConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnServerConfigurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnServerConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationID(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestParseVpnServerConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnServerConfigurationId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnServerConfigurationName: "vpnServerConfigurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnServerConfigurations/vpnServerConfigurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe", - Expected: &VpnServerConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnServerConfigurationName: "vPnSeRvErCoNfIgUrAtIoNvAlUe", - }, - }, - { - // 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.nEtWoRk/vPnSeRvErCoNfIgUrAtIoNs/vPnSeRvErCoNfIgUrAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnServerConfigurationIDInsensitively(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.VpnServerConfigurationName != v.Expected.VpnServerConfigurationName { - t.Fatalf("Expected %q but got %q for VpnServerConfigurationName", v.Expected.VpnServerConfigurationName, actual.VpnServerConfigurationName) - } - - } -} - -func TestSegmentsForVpnServerConfigurationId(t *testing.T) { - segments := VpnServerConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnServerConfigurationId 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/network/2023-06-01/vpnserverconfigurations/method_updatetags.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/method_updatetags.go deleted file mode 100644 index 7a675d1584d..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package vpnserverconfigurations - -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 *VpnServerConfiguration -} - -// UpdateTags ... -func (c VpnServerConfigurationsClient) UpdateTags(ctx context.Context, id VpnServerConfigurationId, 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 VpnServerConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_aadauthenticationparameters.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_aadauthenticationparameters.go deleted file mode 100644 index 8751fdb95f4..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_aadauthenticationparameters.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AadAuthenticationParameters struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadIssuer *string `json:"aadIssuer,omitempty"` - AadTenant *string `json:"aadTenant,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_addressspace.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_addressspace.go deleted file mode 100644 index 9a83a3bb7bf..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_ipsecpolicy.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_ipsecpolicy.go deleted file mode 100644 index 82c3d0cee04..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_ipsecpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPsecPolicy struct { - DhGroup DhGroup `json:"dhGroup"` - IPsecEncryption IPsecEncryption `json:"ipsecEncryption"` - IPsecIntegrity IPsecIntegrity `json:"ipsecIntegrity"` - IkeEncryption IkeEncryption `json:"ikeEncryption"` - IkeIntegrity IkeIntegrity `json:"ikeIntegrity"` - PfsGroup PfsGroup `json:"pfsGroup"` - SaDataSizeKilobytes int64 `json:"saDataSizeKilobytes"` - SaLifeTimeSeconds int64 `json:"saLifeTimeSeconds"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go deleted file mode 100644 index a5da2b6e9f5..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SConnectionConfigurationProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go deleted file mode 100644 index 5409c6397bf..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2sconnectionconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SConnectionConfigurationProperties struct { - ConfigurationPolicyGroupAssociations *[]SubResource `json:"configurationPolicyGroupAssociations,omitempty"` - EnableInternetSecurity *bool `json:"enableInternetSecurity,omitempty"` - PreviousConfigurationPolicyGroupAssociations *[]VpnServerConfigurationPolicyGroup `json:"previousConfigurationPolicyGroupAssociations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RoutingConfiguration *RoutingConfiguration `json:"routingConfiguration,omitempty"` - VpnClientAddressPool *AddressSpace `json:"vpnClientAddressPool,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngateway.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngateway.go deleted file mode 100644 index 048301aca56..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngateway.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *P2SVpnGatewayProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngatewayproperties.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngatewayproperties.go deleted file mode 100644 index fcd2e68d61e..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_p2svpngatewayproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type P2SVpnGatewayProperties struct { - CustomDnsServers *[]string `json:"customDnsServers,omitempty"` - IsRoutingPreferenceInternet *bool `json:"isRoutingPreferenceInternet,omitempty"` - P2SConnectionConfigurations *[]P2SConnectionConfiguration `json:"p2SConnectionConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualHub *SubResource `json:"virtualHub,omitempty"` - VpnClientConnectionHealth *VpnClientConnectionHealth `json:"vpnClientConnectionHealth,omitempty"` - VpnGatewayScaleUnit *int64 `json:"vpnGatewayScaleUnit,omitempty"` - VpnServerConfiguration *SubResource `json:"vpnServerConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_propagatedroutetable.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_propagatedroutetable.go deleted file mode 100644 index d9197431e38..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_propagatedroutetable.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PropagatedRouteTable struct { - Ids *[]SubResource `json:"ids,omitempty"` - Labels *[]string `json:"labels,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_radiusserver.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_radiusserver.go deleted file mode 100644 index 0a8e8ea7a2b..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_radiusserver.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RadiusServer struct { - RadiusServerAddress string `json:"radiusServerAddress"` - RadiusServerScore *int64 `json:"radiusServerScore,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_routingconfiguration.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_routingconfiguration.go deleted file mode 100644 index 418b0d86c12..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_routingconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutingConfiguration struct { - AssociatedRouteTable *SubResource `json:"associatedRouteTable,omitempty"` - InboundRouteMap *SubResource `json:"inboundRouteMap,omitempty"` - OutboundRouteMap *SubResource `json:"outboundRouteMap,omitempty"` - PropagatedRouteTables *PropagatedRouteTable `json:"propagatedRouteTables,omitempty"` - VnetRoutes *VnetRoute `json:"vnetRoutes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroute.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroute.go deleted file mode 100644 index d9a40cf7abe..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoute struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - Name *string `json:"name,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroutesconfig.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroutesconfig.go deleted file mode 100644 index 0d9a0db3cfd..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_staticroutesconfig.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StaticRoutesConfig struct { - PropagateStaticRoutes *bool `json:"propagateStaticRoutes,omitempty"` - VnetLocalRouteOverrideCriteria *VnetLocalRouteOverrideCriteria `json:"vnetLocalRouteOverrideCriteria,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_subresource.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_subresource.go deleted file mode 100644 index b06b768283f..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_tagsobject.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_tagsobject.go deleted file mode 100644 index 73b0464bd7d..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnserverconfigurations - -// 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/network/2023-06-01/vpnserverconfigurations/model_vnetroute.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vnetroute.go deleted file mode 100644 index 26ac1388d05..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vnetroute.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VnetRoute struct { - BgpConnections *[]SubResource `json:"bgpConnections,omitempty"` - StaticRoutes *[]StaticRoute `json:"staticRoutes,omitempty"` - StaticRoutesConfig *StaticRoutesConfig `json:"staticRoutesConfig,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go deleted file mode 100644 index f4b6bee5adb..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnclientconnectionhealth.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnClientConnectionHealth struct { - AllocatedIPAddresses *[]string `json:"allocatedIpAddresses,omitempty"` - TotalEgressBytesTransferred *int64 `json:"totalEgressBytesTransferred,omitempty"` - TotalIngressBytesTransferred *int64 `json:"totalIngressBytesTransferred,omitempty"` - VpnClientConnectionsCount *int64 `json:"vpnClientConnectionsCount,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go deleted file mode 100644 index 32cd3b0c3ce..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusClientRootCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go deleted file mode 100644 index f5a02d320d4..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigradiusserverrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigRadiusServerRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfiguration.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfiguration.go deleted file mode 100644 index 1f8b56984ce..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go deleted file mode 100644 index df7554b1ec5..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroup.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnServerConfigurationPolicyGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go deleted file mode 100644 index 5f72d492483..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupmember.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupMember struct { - AttributeType *VpnPolicyMemberAttributeType `json:"attributeType,omitempty"` - AttributeValue *string `json:"attributeValue,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go deleted file mode 100644 index d1f956dc56b..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationpolicygroupproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationPolicyGroupProperties struct { - IsDefault *bool `json:"isDefault,omitempty"` - P2SConnectionConfigurations *[]SubResource `json:"p2SConnectionConfigurations,omitempty"` - PolicyMembers *[]VpnServerConfigurationPolicyGroupMember `json:"policyMembers,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go deleted file mode 100644 index bba2bd56557..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigurationproperties.go +++ /dev/null @@ -1,23 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigurationProperties struct { - AadAuthenticationParameters *AadAuthenticationParameters `json:"aadAuthenticationParameters,omitempty"` - ConfigurationPolicyGroups *[]VpnServerConfigurationPolicyGroup `json:"configurationPolicyGroups,omitempty"` - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - P2sVpnGateways *[]P2SVpnGateway `json:"p2SVpnGateways,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - RadiusClientRootCertificates *[]VpnServerConfigRadiusClientRootCertificate `json:"radiusClientRootCertificates,omitempty"` - RadiusServerAddress *string `json:"radiusServerAddress,omitempty"` - RadiusServerRootCertificates *[]VpnServerConfigRadiusServerRootCertificate `json:"radiusServerRootCertificates,omitempty"` - RadiusServerSecret *string `json:"radiusServerSecret,omitempty"` - RadiusServers *[]RadiusServer `json:"radiusServers,omitempty"` - VpnAuthenticationTypes *[]VpnAuthenticationType `json:"vpnAuthenticationTypes,omitempty"` - VpnClientIPsecPolicies *[]IPsecPolicy `json:"vpnClientIpsecPolicies,omitempty"` - VpnClientRevokedCertificates *[]VpnServerConfigVpnClientRevokedCertificate `json:"vpnClientRevokedCertificates,omitempty"` - VpnClientRootCertificates *[]VpnServerConfigVpnClientRootCertificate `json:"vpnClientRootCertificates,omitempty"` - VpnProtocols *[]VpnGatewayTunnelingProtocol `json:"vpnProtocols,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go deleted file mode 100644 index b2e7cac735e..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrevokedcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRevokedCertificate struct { - Name *string `json:"name,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go deleted file mode 100644 index eda4a0c8837..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/model_vpnserverconfigvpnclientrootcertificate.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnserverconfigurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnServerConfigVpnClientRootCertificate struct { - Name *string `json:"name,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnserverconfigurations/version.go b/resource-manager/network/2023-06-01/vpnserverconfigurations/version.go deleted file mode 100644 index 61e092f49ce..00000000000 --- a/resource-manager/network/2023-06-01/vpnserverconfigurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnserverconfigurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnserverconfigurations/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/vpnsites/README.md b/resource-manager/network/2023-06-01/vpnsites/README.md deleted file mode 100644 index 61298dd3ffb..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/vpnsites` Documentation - -The `vpnsites` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/vpnsites" -``` - - -### Client Initialization - -```go -client := vpnsites.NewVpnSitesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VpnSitesClient.UpdateTags` - -```go -ctx := context.TODO() -id := vpnsites.NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - -payload := vpnsites.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/network/2023-06-01/vpnsites/client.go b/resource-manager/network/2023-06-01/vpnsites/client.go deleted file mode 100644 index 241eb9e94ea..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vpnsites - -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 VpnSitesClient struct { - Client *resourcemanager.Client -} - -func NewVpnSitesClientWithBaseURI(sdkApi sdkEnv.Api) (*VpnSitesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vpnsites", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VpnSitesClient: %+v", err) - } - - return &VpnSitesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/vpnsites/constants.go b/resource-manager/network/2023-06-01/vpnsites/constants.go deleted file mode 100644 index 58eca968713..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package vpnsites - -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 ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/vpnsites/id_vpnsite.go b/resource-manager/network/2023-06-01/vpnsites/id_vpnsite.go deleted file mode 100644 index 4b42ecf0a1e..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/id_vpnsite.go +++ /dev/null @@ -1,130 +0,0 @@ -package vpnsites - -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(&VpnSiteId{}) -} - -var _ resourceids.ResourceId = &VpnSiteId{} - -// VpnSiteId is a struct representing the Resource ID for a Vpn Site -type VpnSiteId struct { - SubscriptionId string - ResourceGroupName string - VpnSiteName string -} - -// NewVpnSiteID returns a new VpnSiteId struct -func NewVpnSiteID(subscriptionId string, resourceGroupName string, vpnSiteName string) VpnSiteId { - return VpnSiteId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VpnSiteName: vpnSiteName, - } -} - -// ParseVpnSiteID parses 'input' into a VpnSiteId -func ParseVpnSiteID(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVpnSiteIDInsensitively parses 'input' case-insensitively into a VpnSiteId -// note: this method should only be used for API response data and not user input -func ParseVpnSiteIDInsensitively(input string) (*VpnSiteId, error) { - parser := resourceids.NewParserFromResourceIdType(&VpnSiteId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VpnSiteId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VpnSiteId) 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.VpnSiteName, ok = input.Parsed["vpnSiteName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vpnSiteName", input) - } - - return nil -} - -// ValidateVpnSiteID checks that 'input' can be parsed as a Vpn Site ID -func ValidateVpnSiteID(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 := ParseVpnSiteID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vpn Site ID -func (id VpnSiteId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/vpnSites/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VpnSiteName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vpn Site ID -func (id VpnSiteId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticVpnSites", "vpnSites", "vpnSites"), - resourceids.UserSpecifiedSegment("vpnSiteName", "vpnSiteValue"), - } -} - -// String returns a human-readable description of this Vpn Site ID -func (id VpnSiteId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vpn Site Name: %q", id.VpnSiteName), - } - return fmt.Sprintf("Vpn Site (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/vpnsites/id_vpnsite_test.go b/resource-manager/network/2023-06-01/vpnsites/id_vpnsite_test.go deleted file mode 100644 index 302b3a6a24a..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/id_vpnsite_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vpnsites - -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 = &VpnSiteId{} - -func TestNewVpnSiteID(t *testing.T) { - id := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue") - - 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.VpnSiteName != "vpnSiteValue" { - t.Fatalf("Expected %q but got %q for Segment 'VpnSiteName'", id.VpnSiteName, "vpnSiteValue") - } -} - -func TestFormatVpnSiteID(t *testing.T) { - actual := NewVpnSiteID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vpnSiteValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVpnSiteID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteID(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestParseVpnSiteIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VpnSiteId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VpnSiteName: "vpnSiteValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/vpnSites/vpnSiteValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE", - Expected: &VpnSiteId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VpnSiteName: "vPnSiTeVaLuE", - }, - }, - { - // 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.nEtWoRk/vPnSiTeS/vPnSiTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVpnSiteIDInsensitively(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.VpnSiteName != v.Expected.VpnSiteName { - t.Fatalf("Expected %q but got %q for VpnSiteName", v.Expected.VpnSiteName, actual.VpnSiteName) - } - - } -} - -func TestSegmentsForVpnSiteId(t *testing.T) { - segments := VpnSiteId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VpnSiteId 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/network/2023-06-01/vpnsites/method_updatetags.go b/resource-manager/network/2023-06-01/vpnsites/method_updatetags.go deleted file mode 100644 index 08341839986..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/method_updatetags.go +++ /dev/null @@ -1,58 +0,0 @@ -package vpnsites - -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 *VpnSite -} - -// UpdateTags ... -func (c VpnSitesClient) UpdateTags(ctx context.Context, id VpnSiteId, 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 VpnSite - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_addressspace.go b/resource-manager/network/2023-06-01/vpnsites/model_addressspace.go deleted file mode 100644 index 14ce21bc15a..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_addressspace.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AddressSpace struct { - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_bgpsettings.go b/resource-manager/network/2023-06-01/vpnsites/model_bgpsettings.go deleted file mode 100644 index 09643cee4ab..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_bgpsettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` - BgpPeeringAddresses *[]IPConfigurationBgpPeeringAddress `json:"bgpPeeringAddresses,omitempty"` - PeerWeight *int64 `json:"peerWeight,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_deviceproperties.go b/resource-manager/network/2023-06-01/vpnsites/model_deviceproperties.go deleted file mode 100644 index 6b9a69dd5df..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_deviceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceProperties struct { - DeviceModel *string `json:"deviceModel,omitempty"` - DeviceVendor *string `json:"deviceVendor,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_ipconfigurationbgppeeringaddress.go b/resource-manager/network/2023-06-01/vpnsites/model_ipconfigurationbgppeeringaddress.go deleted file mode 100644 index ce931dc8949..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_ipconfigurationbgppeeringaddress.go +++ /dev/null @@ -1,11 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationBgpPeeringAddress struct { - CustomBgpIPAddresses *[]string `json:"customBgpIpAddresses,omitempty"` - DefaultBgpIPAddresses *[]string `json:"defaultBgpIpAddresses,omitempty"` - IPconfigurationId *string `json:"ipconfigurationId,omitempty"` - TunnelIPAddresses *[]string `json:"tunnelIpAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_o365breakoutcategorypolicies.go b/resource-manager/network/2023-06-01/vpnsites/model_o365breakoutcategorypolicies.go deleted file mode 100644 index 2d1e7f02cf9..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_o365breakoutcategorypolicies.go +++ /dev/null @@ -1,10 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365BreakOutCategoryPolicies struct { - Allow *bool `json:"allow,omitempty"` - Default *bool `json:"default,omitempty"` - Optimize *bool `json:"optimize,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_o365policyproperties.go b/resource-manager/network/2023-06-01/vpnsites/model_o365policyproperties.go deleted file mode 100644 index 18b5f663387..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_o365policyproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type O365PolicyProperties struct { - BreakOutCategories *O365BreakOutCategoryPolicies `json:"breakOutCategories,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_subresource.go b/resource-manager/network/2023-06-01/vpnsites/model_subresource.go deleted file mode 100644 index 2b90b3f784d..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_tagsobject.go b/resource-manager/network/2023-06-01/vpnsites/model_tagsobject.go deleted file mode 100644 index c05667ddc1a..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_tagsobject.go +++ /dev/null @@ -1,8 +0,0 @@ -package vpnsites - -// 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/network/2023-06-01/vpnsites/model_vpnlinkbgpsettings.go b/resource-manager/network/2023-06-01/vpnsites/model_vpnlinkbgpsettings.go deleted file mode 100644 index cae11e9a335..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_vpnlinkbgpsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkBgpSettings struct { - Asn *int64 `json:"asn,omitempty"` - BgpPeeringAddress *string `json:"bgpPeeringAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_vpnlinkproviderproperties.go b/resource-manager/network/2023-06-01/vpnsites/model_vpnlinkproviderproperties.go deleted file mode 100644 index aa802b7bc05..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_vpnlinkproviderproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnLinkProviderProperties struct { - LinkProviderName *string `json:"linkProviderName,omitempty"` - LinkSpeedInMbps *int64 `json:"linkSpeedInMbps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_vpnsite.go b/resource-manager/network/2023-06-01/vpnsites/model_vpnsite.go deleted file mode 100644 index a7ccb293a6c..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_vpnsite.go +++ /dev/null @@ -1,14 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSite struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_vpnsitelink.go b/resource-manager/network/2023-06-01/vpnsites/model_vpnsitelink.go deleted file mode 100644 index 0d815e3b164..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_vpnsitelink.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VpnSiteLinkProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_vpnsitelinkproperties.go b/resource-manager/network/2023-06-01/vpnsites/model_vpnsitelinkproperties.go deleted file mode 100644 index 3d9dedc099d..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_vpnsitelinkproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteLinkProperties struct { - BgpProperties *VpnLinkBgpSettings `json:"bgpProperties,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - LinkProperties *VpnLinkProviderProperties `json:"linkProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/model_vpnsiteproperties.go b/resource-manager/network/2023-06-01/vpnsites/model_vpnsiteproperties.go deleted file mode 100644 index b404c9ab09b..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/model_vpnsiteproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package vpnsites - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VpnSiteProperties struct { - AddressSpace *AddressSpace `json:"addressSpace,omitempty"` - BgpProperties *BgpSettings `json:"bgpProperties,omitempty"` - DeviceProperties *DeviceProperties `json:"deviceProperties,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IsSecuritySite *bool `json:"isSecuritySite,omitempty"` - O365Policy *O365PolicyProperties `json:"o365Policy,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SiteKey *string `json:"siteKey,omitempty"` - VirtualWAN *SubResource `json:"virtualWan,omitempty"` - VpnSiteLinks *[]VpnSiteLink `json:"vpnSiteLinks,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/vpnsites/version.go b/resource-manager/network/2023-06-01/vpnsites/version.go deleted file mode 100644 index 930097d503f..00000000000 --- a/resource-manager/network/2023-06-01/vpnsites/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vpnsites - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vpnsites/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/README.md b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/README.md deleted file mode 100644 index 3a55671191b..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/README.md +++ /dev/null @@ -1,104 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/webapplicationfirewallpolicies` Documentation - -The `webapplicationfirewallpolicies` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/webapplicationfirewallpolicies" -``` - - -### Client Initialization - -```go -client := webapplicationfirewallpolicies.NewWebApplicationFirewallPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebApplicationFirewallPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -payload := webapplicationfirewallpolicies.WebApplicationFirewallPolicy{ - // ... -} - - -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: `WebApplicationFirewallPoliciesClient.Delete` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `WebApplicationFirewallPoliciesClient.Get` - -```go -ctx := context.TODO() -id := webapplicationfirewallpolicies.NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - -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: `WebApplicationFirewallPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// 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: `WebApplicationFirewallPoliciesClient.ListAll` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListAll(ctx, id)` can be used to do batched pagination -items, err := client.ListAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/client.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/client.go deleted file mode 100644 index ac148c53733..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package webapplicationfirewallpolicies - -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 WebApplicationFirewallPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewWebApplicationFirewallPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*WebApplicationFirewallPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "webapplicationfirewallpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WebApplicationFirewallPoliciesClient: %+v", err) - } - - return &WebApplicationFirewallPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/constants.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/constants.go deleted file mode 100644 index ae63943d0b3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/constants.go +++ /dev/null @@ -1,2848 +0,0 @@ -package webapplicationfirewallpolicies - -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 ActionType string - -const ( - ActionTypeAllow ActionType = "Allow" - ActionTypeAnomalyScoring ActionType = "AnomalyScoring" - ActionTypeBlock ActionType = "Block" - ActionTypeJSChallenge ActionType = "JSChallenge" - ActionTypeLog ActionType = "Log" -) - -func PossibleValuesForActionType() []string { - return []string{ - string(ActionTypeAllow), - string(ActionTypeAnomalyScoring), - string(ActionTypeBlock), - string(ActionTypeJSChallenge), - string(ActionTypeLog), - } -} - -func (s *ActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionType(input string) (*ActionType, error) { - vals := map[string]ActionType{ - "allow": ActionTypeAllow, - "anomalyscoring": ActionTypeAnomalyScoring, - "block": ActionTypeBlock, - "jschallenge": ActionTypeJSChallenge, - "log": ActionTypeLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionType(input) - return &out, nil -} - -type ApplicationGatewayClientRevocationOptions string - -const ( - ApplicationGatewayClientRevocationOptionsNone ApplicationGatewayClientRevocationOptions = "None" - ApplicationGatewayClientRevocationOptionsOCSP ApplicationGatewayClientRevocationOptions = "OCSP" -) - -func PossibleValuesForApplicationGatewayClientRevocationOptions() []string { - return []string{ - string(ApplicationGatewayClientRevocationOptionsNone), - string(ApplicationGatewayClientRevocationOptionsOCSP), - } -} - -func (s *ApplicationGatewayClientRevocationOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayClientRevocationOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayClientRevocationOptions(input string) (*ApplicationGatewayClientRevocationOptions, error) { - vals := map[string]ApplicationGatewayClientRevocationOptions{ - "none": ApplicationGatewayClientRevocationOptionsNone, - "ocsp": ApplicationGatewayClientRevocationOptionsOCSP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayClientRevocationOptions(input) - return &out, nil -} - -type ApplicationGatewayCookieBasedAffinity string - -const ( - ApplicationGatewayCookieBasedAffinityDisabled ApplicationGatewayCookieBasedAffinity = "Disabled" - ApplicationGatewayCookieBasedAffinityEnabled ApplicationGatewayCookieBasedAffinity = "Enabled" -) - -func PossibleValuesForApplicationGatewayCookieBasedAffinity() []string { - return []string{ - string(ApplicationGatewayCookieBasedAffinityDisabled), - string(ApplicationGatewayCookieBasedAffinityEnabled), - } -} - -func (s *ApplicationGatewayCookieBasedAffinity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCookieBasedAffinity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCookieBasedAffinity(input string) (*ApplicationGatewayCookieBasedAffinity, error) { - vals := map[string]ApplicationGatewayCookieBasedAffinity{ - "disabled": ApplicationGatewayCookieBasedAffinityDisabled, - "enabled": ApplicationGatewayCookieBasedAffinityEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCookieBasedAffinity(input) - return &out, nil -} - -type ApplicationGatewayCustomErrorStatusCode string - -const ( - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus500" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus504" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus503" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo ApplicationGatewayCustomErrorStatusCode = "HttpStatus502" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred ApplicationGatewayCustomErrorStatusCode = "HttpStatus400" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight ApplicationGatewayCustomErrorStatusCode = "HttpStatus408" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive ApplicationGatewayCustomErrorStatusCode = "HttpStatus405" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour ApplicationGatewayCustomErrorStatusCode = "HttpStatus404" - ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree ApplicationGatewayCustomErrorStatusCode = "HttpStatus403" -) - -func PossibleValuesForApplicationGatewayCustomErrorStatusCode() []string { - return []string{ - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour), - string(ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree), - } -} - -func (s *ApplicationGatewayCustomErrorStatusCode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayCustomErrorStatusCode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayCustomErrorStatusCode(input string) (*ApplicationGatewayCustomErrorStatusCode, error) { - vals := map[string]ApplicationGatewayCustomErrorStatusCode{ - "httpstatus500": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveHundred, - "httpstatus504": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroFour, - "httpstatus503": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroThree, - "httpstatus502": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFiveZeroTwo, - "httpstatus400": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourHundred, - "httpstatus408": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroEight, - "httpstatus405": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFive, - "httpstatus404": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroFour, - "httpstatus403": ApplicationGatewayCustomErrorStatusCodeHTTPStatusFourZeroThree, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayCustomErrorStatusCode(input) - return &out, nil -} - -type ApplicationGatewayFirewallMode string - -const ( - ApplicationGatewayFirewallModeDetection ApplicationGatewayFirewallMode = "Detection" - ApplicationGatewayFirewallModePrevention ApplicationGatewayFirewallMode = "Prevention" -) - -func PossibleValuesForApplicationGatewayFirewallMode() []string { - return []string{ - string(ApplicationGatewayFirewallModeDetection), - string(ApplicationGatewayFirewallModePrevention), - } -} - -func (s *ApplicationGatewayFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallMode(input string) (*ApplicationGatewayFirewallMode, error) { - vals := map[string]ApplicationGatewayFirewallMode{ - "detection": ApplicationGatewayFirewallModeDetection, - "prevention": ApplicationGatewayFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallMode(input) - return &out, nil -} - -type ApplicationGatewayFirewallRateLimitDuration string - -const ( - ApplicationGatewayFirewallRateLimitDurationFiveMins ApplicationGatewayFirewallRateLimitDuration = "FiveMins" - ApplicationGatewayFirewallRateLimitDurationOneMin ApplicationGatewayFirewallRateLimitDuration = "OneMin" -) - -func PossibleValuesForApplicationGatewayFirewallRateLimitDuration() []string { - return []string{ - string(ApplicationGatewayFirewallRateLimitDurationFiveMins), - string(ApplicationGatewayFirewallRateLimitDurationOneMin), - } -} - -func (s *ApplicationGatewayFirewallRateLimitDuration) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallRateLimitDuration(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallRateLimitDuration(input string) (*ApplicationGatewayFirewallRateLimitDuration, error) { - vals := map[string]ApplicationGatewayFirewallRateLimitDuration{ - "fivemins": ApplicationGatewayFirewallRateLimitDurationFiveMins, - "onemin": ApplicationGatewayFirewallRateLimitDurationOneMin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallRateLimitDuration(input) - return &out, nil -} - -type ApplicationGatewayFirewallUserSessionVariable string - -const ( - ApplicationGatewayFirewallUserSessionVariableClientAddr ApplicationGatewayFirewallUserSessionVariable = "ClientAddr" - ApplicationGatewayFirewallUserSessionVariableGeoLocation ApplicationGatewayFirewallUserSessionVariable = "GeoLocation" - ApplicationGatewayFirewallUserSessionVariableNone ApplicationGatewayFirewallUserSessionVariable = "None" -) - -func PossibleValuesForApplicationGatewayFirewallUserSessionVariable() []string { - return []string{ - string(ApplicationGatewayFirewallUserSessionVariableClientAddr), - string(ApplicationGatewayFirewallUserSessionVariableGeoLocation), - string(ApplicationGatewayFirewallUserSessionVariableNone), - } -} - -func (s *ApplicationGatewayFirewallUserSessionVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayFirewallUserSessionVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayFirewallUserSessionVariable(input string) (*ApplicationGatewayFirewallUserSessionVariable, error) { - vals := map[string]ApplicationGatewayFirewallUserSessionVariable{ - "clientaddr": ApplicationGatewayFirewallUserSessionVariableClientAddr, - "geolocation": ApplicationGatewayFirewallUserSessionVariableGeoLocation, - "none": ApplicationGatewayFirewallUserSessionVariableNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayFirewallUserSessionVariable(input) - return &out, nil -} - -type ApplicationGatewayLoadDistributionAlgorithm string - -const ( - ApplicationGatewayLoadDistributionAlgorithmIPHash ApplicationGatewayLoadDistributionAlgorithm = "IpHash" - ApplicationGatewayLoadDistributionAlgorithmLeastConnections ApplicationGatewayLoadDistributionAlgorithm = "LeastConnections" - ApplicationGatewayLoadDistributionAlgorithmRoundRobin ApplicationGatewayLoadDistributionAlgorithm = "RoundRobin" -) - -func PossibleValuesForApplicationGatewayLoadDistributionAlgorithm() []string { - return []string{ - string(ApplicationGatewayLoadDistributionAlgorithmIPHash), - string(ApplicationGatewayLoadDistributionAlgorithmLeastConnections), - string(ApplicationGatewayLoadDistributionAlgorithmRoundRobin), - } -} - -func (s *ApplicationGatewayLoadDistributionAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayLoadDistributionAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayLoadDistributionAlgorithm(input string) (*ApplicationGatewayLoadDistributionAlgorithm, error) { - vals := map[string]ApplicationGatewayLoadDistributionAlgorithm{ - "iphash": ApplicationGatewayLoadDistributionAlgorithmIPHash, - "leastconnections": ApplicationGatewayLoadDistributionAlgorithmLeastConnections, - "roundrobin": ApplicationGatewayLoadDistributionAlgorithmRoundRobin, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayLoadDistributionAlgorithm(input) - return &out, nil -} - -type ApplicationGatewayOperationalState string - -const ( - ApplicationGatewayOperationalStateRunning ApplicationGatewayOperationalState = "Running" - ApplicationGatewayOperationalStateStarting ApplicationGatewayOperationalState = "Starting" - ApplicationGatewayOperationalStateStopped ApplicationGatewayOperationalState = "Stopped" - ApplicationGatewayOperationalStateStopping ApplicationGatewayOperationalState = "Stopping" -) - -func PossibleValuesForApplicationGatewayOperationalState() []string { - return []string{ - string(ApplicationGatewayOperationalStateRunning), - string(ApplicationGatewayOperationalStateStarting), - string(ApplicationGatewayOperationalStateStopped), - string(ApplicationGatewayOperationalStateStopping), - } -} - -func (s *ApplicationGatewayOperationalState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayOperationalState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayOperationalState(input string) (*ApplicationGatewayOperationalState, error) { - vals := map[string]ApplicationGatewayOperationalState{ - "running": ApplicationGatewayOperationalStateRunning, - "starting": ApplicationGatewayOperationalStateStarting, - "stopped": ApplicationGatewayOperationalStateStopped, - "stopping": ApplicationGatewayOperationalStateStopping, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayOperationalState(input) - return &out, nil -} - -type ApplicationGatewayProtocol string - -const ( - ApplicationGatewayProtocolHTTP ApplicationGatewayProtocol = "Http" - ApplicationGatewayProtocolHTTPS ApplicationGatewayProtocol = "Https" - ApplicationGatewayProtocolTcp ApplicationGatewayProtocol = "Tcp" - ApplicationGatewayProtocolTls ApplicationGatewayProtocol = "Tls" -) - -func PossibleValuesForApplicationGatewayProtocol() []string { - return []string{ - string(ApplicationGatewayProtocolHTTP), - string(ApplicationGatewayProtocolHTTPS), - string(ApplicationGatewayProtocolTcp), - string(ApplicationGatewayProtocolTls), - } -} - -func (s *ApplicationGatewayProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayProtocol(input string) (*ApplicationGatewayProtocol, error) { - vals := map[string]ApplicationGatewayProtocol{ - "http": ApplicationGatewayProtocolHTTP, - "https": ApplicationGatewayProtocolHTTPS, - "tcp": ApplicationGatewayProtocolTcp, - "tls": ApplicationGatewayProtocolTls, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayProtocol(input) - return &out, nil -} - -type ApplicationGatewayRedirectType string - -const ( - ApplicationGatewayRedirectTypeFound ApplicationGatewayRedirectType = "Found" - ApplicationGatewayRedirectTypePermanent ApplicationGatewayRedirectType = "Permanent" - ApplicationGatewayRedirectTypeSeeOther ApplicationGatewayRedirectType = "SeeOther" - ApplicationGatewayRedirectTypeTemporary ApplicationGatewayRedirectType = "Temporary" -) - -func PossibleValuesForApplicationGatewayRedirectType() []string { - return []string{ - string(ApplicationGatewayRedirectTypeFound), - string(ApplicationGatewayRedirectTypePermanent), - string(ApplicationGatewayRedirectTypeSeeOther), - string(ApplicationGatewayRedirectTypeTemporary), - } -} - -func (s *ApplicationGatewayRedirectType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRedirectType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRedirectType(input string) (*ApplicationGatewayRedirectType, error) { - vals := map[string]ApplicationGatewayRedirectType{ - "found": ApplicationGatewayRedirectTypeFound, - "permanent": ApplicationGatewayRedirectTypePermanent, - "seeother": ApplicationGatewayRedirectTypeSeeOther, - "temporary": ApplicationGatewayRedirectTypeTemporary, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRedirectType(input) - return &out, nil -} - -type ApplicationGatewayRequestRoutingRuleType string - -const ( - ApplicationGatewayRequestRoutingRuleTypeBasic ApplicationGatewayRequestRoutingRuleType = "Basic" - ApplicationGatewayRequestRoutingRuleTypePathBasedRouting ApplicationGatewayRequestRoutingRuleType = "PathBasedRouting" -) - -func PossibleValuesForApplicationGatewayRequestRoutingRuleType() []string { - return []string{ - string(ApplicationGatewayRequestRoutingRuleTypeBasic), - string(ApplicationGatewayRequestRoutingRuleTypePathBasedRouting), - } -} - -func (s *ApplicationGatewayRequestRoutingRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayRequestRoutingRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayRequestRoutingRuleType(input string) (*ApplicationGatewayRequestRoutingRuleType, error) { - vals := map[string]ApplicationGatewayRequestRoutingRuleType{ - "basic": ApplicationGatewayRequestRoutingRuleTypeBasic, - "pathbasedrouting": ApplicationGatewayRequestRoutingRuleTypePathBasedRouting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayRequestRoutingRuleType(input) - return &out, nil -} - -type ApplicationGatewaySkuName string - -const ( - ApplicationGatewaySkuNameBasic ApplicationGatewaySkuName = "Basic" - ApplicationGatewaySkuNameStandardLarge ApplicationGatewaySkuName = "Standard_Large" - ApplicationGatewaySkuNameStandardMedium ApplicationGatewaySkuName = "Standard_Medium" - ApplicationGatewaySkuNameStandardSmall ApplicationGatewaySkuName = "Standard_Small" - ApplicationGatewaySkuNameStandardVTwo ApplicationGatewaySkuName = "Standard_v2" - ApplicationGatewaySkuNameWAFLarge ApplicationGatewaySkuName = "WAF_Large" - ApplicationGatewaySkuNameWAFMedium ApplicationGatewaySkuName = "WAF_Medium" - ApplicationGatewaySkuNameWAFVTwo ApplicationGatewaySkuName = "WAF_v2" -) - -func PossibleValuesForApplicationGatewaySkuName() []string { - return []string{ - string(ApplicationGatewaySkuNameBasic), - string(ApplicationGatewaySkuNameStandardLarge), - string(ApplicationGatewaySkuNameStandardMedium), - string(ApplicationGatewaySkuNameStandardSmall), - string(ApplicationGatewaySkuNameStandardVTwo), - string(ApplicationGatewaySkuNameWAFLarge), - string(ApplicationGatewaySkuNameWAFMedium), - string(ApplicationGatewaySkuNameWAFVTwo), - } -} - -func (s *ApplicationGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySkuName(input string) (*ApplicationGatewaySkuName, error) { - vals := map[string]ApplicationGatewaySkuName{ - "basic": ApplicationGatewaySkuNameBasic, - "standard_large": ApplicationGatewaySkuNameStandardLarge, - "standard_medium": ApplicationGatewaySkuNameStandardMedium, - "standard_small": ApplicationGatewaySkuNameStandardSmall, - "standard_v2": ApplicationGatewaySkuNameStandardVTwo, - "waf_large": ApplicationGatewaySkuNameWAFLarge, - "waf_medium": ApplicationGatewaySkuNameWAFMedium, - "waf_v2": ApplicationGatewaySkuNameWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySkuName(input) - return &out, nil -} - -type ApplicationGatewaySslCipherSuite string - -const ( - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384" - ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_128_GCM_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_CBC_SHA256" - ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_AES_256_GCM_SHA384" - ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA ApplicationGatewaySslCipherSuite = "TLS_RSA_WITH_3DES_EDE_CBC_SHA" -) - -func PossibleValuesForApplicationGatewaySslCipherSuite() []string { - return []string{ - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour), - string(ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA), - } -} - -func (s *ApplicationGatewaySslCipherSuite) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslCipherSuite(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslCipherSuite(input string) (*ApplicationGatewaySslCipherSuite, error) { - vals := map[string]ApplicationGatewaySslCipherSuite{ - "tls_dhe_dss_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHA, - "tls_dhe_dss_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_dhe_dss_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHA, - "tls_dhe_dss_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_dhe_dss_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHEDSSWITHThreeDESEDECBCSHA, - "tls_dhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightCBCSHA, - "tls_dhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_dhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_dhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_ecdsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_ecdsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_ecdsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHEECDSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHA, - "tls_ecdhe_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_ecdhe_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHA, - "tls_ecdhe_rsa_with_aes_256_cbc_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixCBCSHAThreeEightFour, - "tls_ecdhe_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSECDHERSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_aes_128_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHA, - "tls_rsa_with_aes_128_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightCBCSHATwoFiveSix, - "tls_rsa_with_aes_128_gcm_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESOneTwoEightGCMSHATwoFiveSix, - "tls_rsa_with_aes_256_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHA, - "tls_rsa_with_aes_256_cbc_sha256": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixCBCSHATwoFiveSix, - "tls_rsa_with_aes_256_gcm_sha384": ApplicationGatewaySslCipherSuiteTLSRSAWITHAESTwoFiveSixGCMSHAThreeEightFour, - "tls_rsa_with_3des_ede_cbc_sha": ApplicationGatewaySslCipherSuiteTLSRSAWITHThreeDESEDECBCSHA, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslCipherSuite(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyName string - -const ( - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20150501" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20170401S" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101" - ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS ApplicationGatewaySslPolicyName = "AppGwSslPolicy20220101S" -) - -func PossibleValuesForApplicationGatewaySslPolicyName() []string { - return []string{ - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne), - string(ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS), - } -} - -func (s *ApplicationGatewaySslPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyName(input string) (*ApplicationGatewaySslPolicyName, error) { - vals := map[string]ApplicationGatewaySslPolicyName{ - "appgwsslpolicy20150501": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneFiveZeroFiveZeroOne, - "appgwsslpolicy20170401": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOne, - "appgwsslpolicy20170401s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroOneSevenZeroFourZeroOneS, - "appgwsslpolicy20220101": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOne, - "appgwsslpolicy20220101s": ApplicationGatewaySslPolicyNameAppGwSslPolicyTwoZeroTwoTwoZeroOneZeroOneS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyName(input) - return &out, nil -} - -type ApplicationGatewaySslPolicyType string - -const ( - ApplicationGatewaySslPolicyTypeCustom ApplicationGatewaySslPolicyType = "Custom" - ApplicationGatewaySslPolicyTypeCustomVTwo ApplicationGatewaySslPolicyType = "CustomV2" - ApplicationGatewaySslPolicyTypePredefined ApplicationGatewaySslPolicyType = "Predefined" -) - -func PossibleValuesForApplicationGatewaySslPolicyType() []string { - return []string{ - string(ApplicationGatewaySslPolicyTypeCustom), - string(ApplicationGatewaySslPolicyTypeCustomVTwo), - string(ApplicationGatewaySslPolicyTypePredefined), - } -} - -func (s *ApplicationGatewaySslPolicyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslPolicyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslPolicyType(input string) (*ApplicationGatewaySslPolicyType, error) { - vals := map[string]ApplicationGatewaySslPolicyType{ - "custom": ApplicationGatewaySslPolicyTypeCustom, - "customv2": ApplicationGatewaySslPolicyTypeCustomVTwo, - "predefined": ApplicationGatewaySslPolicyTypePredefined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslPolicyType(input) - return &out, nil -} - -type ApplicationGatewaySslProtocol string - -const ( - ApplicationGatewaySslProtocolTLSvOneOne ApplicationGatewaySslProtocol = "TLSv1_1" - ApplicationGatewaySslProtocolTLSvOneThree ApplicationGatewaySslProtocol = "TLSv1_3" - ApplicationGatewaySslProtocolTLSvOneTwo ApplicationGatewaySslProtocol = "TLSv1_2" - ApplicationGatewaySslProtocolTLSvOneZero ApplicationGatewaySslProtocol = "TLSv1_0" -) - -func PossibleValuesForApplicationGatewaySslProtocol() []string { - return []string{ - string(ApplicationGatewaySslProtocolTLSvOneOne), - string(ApplicationGatewaySslProtocolTLSvOneThree), - string(ApplicationGatewaySslProtocolTLSvOneTwo), - string(ApplicationGatewaySslProtocolTLSvOneZero), - } -} - -func (s *ApplicationGatewaySslProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewaySslProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewaySslProtocol(input string) (*ApplicationGatewaySslProtocol, error) { - vals := map[string]ApplicationGatewaySslProtocol{ - "tlsv1_1": ApplicationGatewaySslProtocolTLSvOneOne, - "tlsv1_3": ApplicationGatewaySslProtocolTLSvOneThree, - "tlsv1_2": ApplicationGatewaySslProtocolTLSvOneTwo, - "tlsv1_0": ApplicationGatewaySslProtocolTLSvOneZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewaySslProtocol(input) - return &out, nil -} - -type ApplicationGatewayTier string - -const ( - ApplicationGatewayTierBasic ApplicationGatewayTier = "Basic" - ApplicationGatewayTierStandard ApplicationGatewayTier = "Standard" - ApplicationGatewayTierStandardVTwo ApplicationGatewayTier = "Standard_v2" - ApplicationGatewayTierWAF ApplicationGatewayTier = "WAF" - ApplicationGatewayTierWAFVTwo ApplicationGatewayTier = "WAF_v2" -) - -func PossibleValuesForApplicationGatewayTier() []string { - return []string{ - string(ApplicationGatewayTierBasic), - string(ApplicationGatewayTierStandard), - string(ApplicationGatewayTierStandardVTwo), - string(ApplicationGatewayTierWAF), - string(ApplicationGatewayTierWAFVTwo), - } -} - -func (s *ApplicationGatewayTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseApplicationGatewayTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseApplicationGatewayTier(input string) (*ApplicationGatewayTier, error) { - vals := map[string]ApplicationGatewayTier{ - "basic": ApplicationGatewayTierBasic, - "standard": ApplicationGatewayTierStandard, - "standard_v2": ApplicationGatewayTierStandardVTwo, - "waf": ApplicationGatewayTierWAF, - "waf_v2": ApplicationGatewayTierWAFVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ApplicationGatewayTier(input) - return &out, nil -} - -type DdosSettingsProtectionMode string - -const ( - DdosSettingsProtectionModeDisabled DdosSettingsProtectionMode = "Disabled" - DdosSettingsProtectionModeEnabled DdosSettingsProtectionMode = "Enabled" - DdosSettingsProtectionModeVirtualNetworkInherited DdosSettingsProtectionMode = "VirtualNetworkInherited" -) - -func PossibleValuesForDdosSettingsProtectionMode() []string { - return []string{ - string(DdosSettingsProtectionModeDisabled), - string(DdosSettingsProtectionModeEnabled), - string(DdosSettingsProtectionModeVirtualNetworkInherited), - } -} - -func (s *DdosSettingsProtectionMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDdosSettingsProtectionMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDdosSettingsProtectionMode(input string) (*DdosSettingsProtectionMode, error) { - vals := map[string]DdosSettingsProtectionMode{ - "disabled": DdosSettingsProtectionModeDisabled, - "enabled": DdosSettingsProtectionModeEnabled, - "virtualnetworkinherited": DdosSettingsProtectionModeVirtualNetworkInherited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DdosSettingsProtectionMode(input) - return &out, nil -} - -type DeleteOptions string - -const ( - DeleteOptionsDelete DeleteOptions = "Delete" - DeleteOptionsDetach DeleteOptions = "Detach" -) - -func PossibleValuesForDeleteOptions() []string { - return []string{ - string(DeleteOptionsDelete), - string(DeleteOptionsDetach), - } -} - -func (s *DeleteOptions) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeleteOptions(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeleteOptions(input string) (*DeleteOptions, error) { - vals := map[string]DeleteOptions{ - "delete": DeleteOptionsDelete, - "detach": DeleteOptionsDetach, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeleteOptions(input) - return &out, nil -} - -type FlowLogFormatType string - -const ( - FlowLogFormatTypeJSON FlowLogFormatType = "JSON" -) - -func PossibleValuesForFlowLogFormatType() []string { - return []string{ - string(FlowLogFormatTypeJSON), - } -} - -func (s *FlowLogFormatType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFlowLogFormatType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFlowLogFormatType(input string) (*FlowLogFormatType, error) { - vals := map[string]FlowLogFormatType{ - "json": FlowLogFormatTypeJSON, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FlowLogFormatType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelInterfaceType string - -const ( - GatewayLoadBalancerTunnelInterfaceTypeExternal GatewayLoadBalancerTunnelInterfaceType = "External" - GatewayLoadBalancerTunnelInterfaceTypeInternal GatewayLoadBalancerTunnelInterfaceType = "Internal" - GatewayLoadBalancerTunnelInterfaceTypeNone GatewayLoadBalancerTunnelInterfaceType = "None" -) - -func PossibleValuesForGatewayLoadBalancerTunnelInterfaceType() []string { - return []string{ - string(GatewayLoadBalancerTunnelInterfaceTypeExternal), - string(GatewayLoadBalancerTunnelInterfaceTypeInternal), - string(GatewayLoadBalancerTunnelInterfaceTypeNone), - } -} - -func (s *GatewayLoadBalancerTunnelInterfaceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelInterfaceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelInterfaceType(input string) (*GatewayLoadBalancerTunnelInterfaceType, error) { - vals := map[string]GatewayLoadBalancerTunnelInterfaceType{ - "external": GatewayLoadBalancerTunnelInterfaceTypeExternal, - "internal": GatewayLoadBalancerTunnelInterfaceTypeInternal, - "none": GatewayLoadBalancerTunnelInterfaceTypeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelInterfaceType(input) - return &out, nil -} - -type GatewayLoadBalancerTunnelProtocol string - -const ( - GatewayLoadBalancerTunnelProtocolNative GatewayLoadBalancerTunnelProtocol = "Native" - GatewayLoadBalancerTunnelProtocolNone GatewayLoadBalancerTunnelProtocol = "None" - GatewayLoadBalancerTunnelProtocolVXLAN GatewayLoadBalancerTunnelProtocol = "VXLAN" -) - -func PossibleValuesForGatewayLoadBalancerTunnelProtocol() []string { - return []string{ - string(GatewayLoadBalancerTunnelProtocolNative), - string(GatewayLoadBalancerTunnelProtocolNone), - string(GatewayLoadBalancerTunnelProtocolVXLAN), - } -} - -func (s *GatewayLoadBalancerTunnelProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGatewayLoadBalancerTunnelProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGatewayLoadBalancerTunnelProtocol(input string) (*GatewayLoadBalancerTunnelProtocol, error) { - vals := map[string]GatewayLoadBalancerTunnelProtocol{ - "native": GatewayLoadBalancerTunnelProtocolNative, - "none": GatewayLoadBalancerTunnelProtocolNone, - "vxlan": GatewayLoadBalancerTunnelProtocolVXLAN, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GatewayLoadBalancerTunnelProtocol(input) - return &out, nil -} - -type IPAllocationMethod string - -const ( - IPAllocationMethodDynamic IPAllocationMethod = "Dynamic" - IPAllocationMethodStatic IPAllocationMethod = "Static" -) - -func PossibleValuesForIPAllocationMethod() []string { - return []string{ - string(IPAllocationMethodDynamic), - string(IPAllocationMethodStatic), - } -} - -func (s *IPAllocationMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPAllocationMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPAllocationMethod(input string) (*IPAllocationMethod, error) { - vals := map[string]IPAllocationMethod{ - "dynamic": IPAllocationMethodDynamic, - "static": IPAllocationMethodStatic, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPAllocationMethod(input) - return &out, nil -} - -type IPVersion string - -const ( - IPVersionIPvFour IPVersion = "IPv4" - IPVersionIPvSix IPVersion = "IPv6" -) - -func PossibleValuesForIPVersion() []string { - return []string{ - string(IPVersionIPvFour), - string(IPVersionIPvSix), - } -} - -func (s *IPVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIPVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIPVersion(input string) (*IPVersion, error) { - vals := map[string]IPVersion{ - "ipv4": IPVersionIPvFour, - "ipv6": IPVersionIPvSix, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IPVersion(input) - return &out, nil -} - -type LoadBalancerBackendAddressAdminState string - -const ( - LoadBalancerBackendAddressAdminStateDown LoadBalancerBackendAddressAdminState = "Down" - LoadBalancerBackendAddressAdminStateNone LoadBalancerBackendAddressAdminState = "None" - LoadBalancerBackendAddressAdminStateUp LoadBalancerBackendAddressAdminState = "Up" -) - -func PossibleValuesForLoadBalancerBackendAddressAdminState() []string { - return []string{ - string(LoadBalancerBackendAddressAdminStateDown), - string(LoadBalancerBackendAddressAdminStateNone), - string(LoadBalancerBackendAddressAdminStateUp), - } -} - -func (s *LoadBalancerBackendAddressAdminState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseLoadBalancerBackendAddressAdminState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseLoadBalancerBackendAddressAdminState(input string) (*LoadBalancerBackendAddressAdminState, error) { - vals := map[string]LoadBalancerBackendAddressAdminState{ - "down": LoadBalancerBackendAddressAdminStateDown, - "none": LoadBalancerBackendAddressAdminStateNone, - "up": LoadBalancerBackendAddressAdminStateUp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LoadBalancerBackendAddressAdminState(input) - return &out, nil -} - -type ManagedRuleEnabledState string - -const ( - ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" - ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" -) - -func PossibleValuesForManagedRuleEnabledState() []string { - return []string{ - string(ManagedRuleEnabledStateDisabled), - string(ManagedRuleEnabledStateEnabled), - } -} - -func (s *ManagedRuleEnabledState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseManagedRuleEnabledState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseManagedRuleEnabledState(input string) (*ManagedRuleEnabledState, error) { - vals := map[string]ManagedRuleEnabledState{ - "disabled": ManagedRuleEnabledStateDisabled, - "enabled": ManagedRuleEnabledStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ManagedRuleEnabledState(input) - return &out, nil -} - -type NatGatewaySkuName string - -const ( - NatGatewaySkuNameStandard NatGatewaySkuName = "Standard" -) - -func PossibleValuesForNatGatewaySkuName() []string { - return []string{ - string(NatGatewaySkuNameStandard), - } -} - -func (s *NatGatewaySkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNatGatewaySkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNatGatewaySkuName(input string) (*NatGatewaySkuName, error) { - vals := map[string]NatGatewaySkuName{ - "standard": NatGatewaySkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NatGatewaySkuName(input) - return &out, nil -} - -type NetworkInterfaceAuxiliaryMode string - -const ( - NetworkInterfaceAuxiliaryModeAcceleratedConnections NetworkInterfaceAuxiliaryMode = "AcceleratedConnections" - NetworkInterfaceAuxiliaryModeFloating NetworkInterfaceAuxiliaryMode = "Floating" - NetworkInterfaceAuxiliaryModeMaxConnections NetworkInterfaceAuxiliaryMode = "MaxConnections" - NetworkInterfaceAuxiliaryModeNone NetworkInterfaceAuxiliaryMode = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliaryMode() []string { - return []string{ - string(NetworkInterfaceAuxiliaryModeAcceleratedConnections), - string(NetworkInterfaceAuxiliaryModeFloating), - string(NetworkInterfaceAuxiliaryModeMaxConnections), - string(NetworkInterfaceAuxiliaryModeNone), - } -} - -func (s *NetworkInterfaceAuxiliaryMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliaryMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliaryMode(input string) (*NetworkInterfaceAuxiliaryMode, error) { - vals := map[string]NetworkInterfaceAuxiliaryMode{ - "acceleratedconnections": NetworkInterfaceAuxiliaryModeAcceleratedConnections, - "floating": NetworkInterfaceAuxiliaryModeFloating, - "maxconnections": NetworkInterfaceAuxiliaryModeMaxConnections, - "none": NetworkInterfaceAuxiliaryModeNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliaryMode(input) - return &out, nil -} - -type NetworkInterfaceAuxiliarySku string - -const ( - NetworkInterfaceAuxiliarySkuAEight NetworkInterfaceAuxiliarySku = "A8" - NetworkInterfaceAuxiliarySkuAFour NetworkInterfaceAuxiliarySku = "A4" - NetworkInterfaceAuxiliarySkuAOne NetworkInterfaceAuxiliarySku = "A1" - NetworkInterfaceAuxiliarySkuATwo NetworkInterfaceAuxiliarySku = "A2" - NetworkInterfaceAuxiliarySkuNone NetworkInterfaceAuxiliarySku = "None" -) - -func PossibleValuesForNetworkInterfaceAuxiliarySku() []string { - return []string{ - string(NetworkInterfaceAuxiliarySkuAEight), - string(NetworkInterfaceAuxiliarySkuAFour), - string(NetworkInterfaceAuxiliarySkuAOne), - string(NetworkInterfaceAuxiliarySkuATwo), - string(NetworkInterfaceAuxiliarySkuNone), - } -} - -func (s *NetworkInterfaceAuxiliarySku) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceAuxiliarySku(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceAuxiliarySku(input string) (*NetworkInterfaceAuxiliarySku, error) { - vals := map[string]NetworkInterfaceAuxiliarySku{ - "a8": NetworkInterfaceAuxiliarySkuAEight, - "a4": NetworkInterfaceAuxiliarySkuAFour, - "a1": NetworkInterfaceAuxiliarySkuAOne, - "a2": NetworkInterfaceAuxiliarySkuATwo, - "none": NetworkInterfaceAuxiliarySkuNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceAuxiliarySku(input) - return &out, nil -} - -type NetworkInterfaceMigrationPhase string - -const ( - NetworkInterfaceMigrationPhaseAbort NetworkInterfaceMigrationPhase = "Abort" - NetworkInterfaceMigrationPhaseCommit NetworkInterfaceMigrationPhase = "Commit" - NetworkInterfaceMigrationPhaseCommitted NetworkInterfaceMigrationPhase = "Committed" - NetworkInterfaceMigrationPhaseNone NetworkInterfaceMigrationPhase = "None" - NetworkInterfaceMigrationPhasePrepare NetworkInterfaceMigrationPhase = "Prepare" -) - -func PossibleValuesForNetworkInterfaceMigrationPhase() []string { - return []string{ - string(NetworkInterfaceMigrationPhaseAbort), - string(NetworkInterfaceMigrationPhaseCommit), - string(NetworkInterfaceMigrationPhaseCommitted), - string(NetworkInterfaceMigrationPhaseNone), - string(NetworkInterfaceMigrationPhasePrepare), - } -} - -func (s *NetworkInterfaceMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceMigrationPhase(input string) (*NetworkInterfaceMigrationPhase, error) { - vals := map[string]NetworkInterfaceMigrationPhase{ - "abort": NetworkInterfaceMigrationPhaseAbort, - "commit": NetworkInterfaceMigrationPhaseCommit, - "committed": NetworkInterfaceMigrationPhaseCommitted, - "none": NetworkInterfaceMigrationPhaseNone, - "prepare": NetworkInterfaceMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceMigrationPhase(input) - return &out, nil -} - -type NetworkInterfaceNicType string - -const ( - NetworkInterfaceNicTypeElastic NetworkInterfaceNicType = "Elastic" - NetworkInterfaceNicTypeStandard NetworkInterfaceNicType = "Standard" -) - -func PossibleValuesForNetworkInterfaceNicType() []string { - return []string{ - string(NetworkInterfaceNicTypeElastic), - string(NetworkInterfaceNicTypeStandard), - } -} - -func (s *NetworkInterfaceNicType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseNetworkInterfaceNicType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseNetworkInterfaceNicType(input string) (*NetworkInterfaceNicType, error) { - vals := map[string]NetworkInterfaceNicType{ - "elastic": NetworkInterfaceNicTypeElastic, - "standard": NetworkInterfaceNicTypeStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := NetworkInterfaceNicType(input) - return &out, nil -} - -type OwaspCrsExclusionEntryMatchVariable string - -const ( - OwaspCrsExclusionEntryMatchVariableRequestArgKeys OwaspCrsExclusionEntryMatchVariable = "RequestArgKeys" - OwaspCrsExclusionEntryMatchVariableRequestArgNames OwaspCrsExclusionEntryMatchVariable = "RequestArgNames" - OwaspCrsExclusionEntryMatchVariableRequestArgValues OwaspCrsExclusionEntryMatchVariable = "RequestArgValues" - OwaspCrsExclusionEntryMatchVariableRequestCookieKeys OwaspCrsExclusionEntryMatchVariable = "RequestCookieKeys" - OwaspCrsExclusionEntryMatchVariableRequestCookieNames OwaspCrsExclusionEntryMatchVariable = "RequestCookieNames" - OwaspCrsExclusionEntryMatchVariableRequestCookieValues OwaspCrsExclusionEntryMatchVariable = "RequestCookieValues" - OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys OwaspCrsExclusionEntryMatchVariable = "RequestHeaderKeys" - OwaspCrsExclusionEntryMatchVariableRequestHeaderNames OwaspCrsExclusionEntryMatchVariable = "RequestHeaderNames" - OwaspCrsExclusionEntryMatchVariableRequestHeaderValues OwaspCrsExclusionEntryMatchVariable = "RequestHeaderValues" -) - -func PossibleValuesForOwaspCrsExclusionEntryMatchVariable() []string { - return []string{ - string(OwaspCrsExclusionEntryMatchVariableRequestArgKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestArgNames), - string(OwaspCrsExclusionEntryMatchVariableRequestArgValues), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieNames), - string(OwaspCrsExclusionEntryMatchVariableRequestCookieValues), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderNames), - string(OwaspCrsExclusionEntryMatchVariableRequestHeaderValues), - } -} - -func (s *OwaspCrsExclusionEntryMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwaspCrsExclusionEntryMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwaspCrsExclusionEntryMatchVariable(input string) (*OwaspCrsExclusionEntryMatchVariable, error) { - vals := map[string]OwaspCrsExclusionEntryMatchVariable{ - "requestargkeys": OwaspCrsExclusionEntryMatchVariableRequestArgKeys, - "requestargnames": OwaspCrsExclusionEntryMatchVariableRequestArgNames, - "requestargvalues": OwaspCrsExclusionEntryMatchVariableRequestArgValues, - "requestcookiekeys": OwaspCrsExclusionEntryMatchVariableRequestCookieKeys, - "requestcookienames": OwaspCrsExclusionEntryMatchVariableRequestCookieNames, - "requestcookievalues": OwaspCrsExclusionEntryMatchVariableRequestCookieValues, - "requestheaderkeys": OwaspCrsExclusionEntryMatchVariableRequestHeaderKeys, - "requestheadernames": OwaspCrsExclusionEntryMatchVariableRequestHeaderNames, - "requestheadervalues": OwaspCrsExclusionEntryMatchVariableRequestHeaderValues, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwaspCrsExclusionEntryMatchVariable(input) - return &out, nil -} - -type OwaspCrsExclusionEntrySelectorMatchOperator string - -const ( - OwaspCrsExclusionEntrySelectorMatchOperatorContains OwaspCrsExclusionEntrySelectorMatchOperator = "Contains" - OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith OwaspCrsExclusionEntrySelectorMatchOperator = "EndsWith" - OwaspCrsExclusionEntrySelectorMatchOperatorEquals OwaspCrsExclusionEntrySelectorMatchOperator = "Equals" - OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny OwaspCrsExclusionEntrySelectorMatchOperator = "EqualsAny" - OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith OwaspCrsExclusionEntrySelectorMatchOperator = "StartsWith" -) - -func PossibleValuesForOwaspCrsExclusionEntrySelectorMatchOperator() []string { - return []string{ - string(OwaspCrsExclusionEntrySelectorMatchOperatorContains), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEquals), - string(OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny), - string(OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith), - } -} - -func (s *OwaspCrsExclusionEntrySelectorMatchOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwaspCrsExclusionEntrySelectorMatchOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwaspCrsExclusionEntrySelectorMatchOperator(input string) (*OwaspCrsExclusionEntrySelectorMatchOperator, error) { - vals := map[string]OwaspCrsExclusionEntrySelectorMatchOperator{ - "contains": OwaspCrsExclusionEntrySelectorMatchOperatorContains, - "endswith": OwaspCrsExclusionEntrySelectorMatchOperatorEndsWith, - "equals": OwaspCrsExclusionEntrySelectorMatchOperatorEquals, - "equalsany": OwaspCrsExclusionEntrySelectorMatchOperatorEqualsAny, - "startswith": OwaspCrsExclusionEntrySelectorMatchOperatorStartsWith, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwaspCrsExclusionEntrySelectorMatchOperator(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" - ProvisioningStateUpdating ProvisioningState = "Updating" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStateSucceeded), - string(ProvisioningStateUpdating), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "succeeded": ProvisioningStateSucceeded, - "updating": ProvisioningStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(input) - return &out, nil -} - -type PublicIPAddressDnsSettingsDomainNameLabelScope string - -const ( - PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "NoReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "ResourceGroupReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "SubscriptionReuse" - PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse PublicIPAddressDnsSettingsDomainNameLabelScope = "TenantReuse" -) - -func PossibleValuesForPublicIPAddressDnsSettingsDomainNameLabelScope() []string { - return []string{ - string(PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse), - string(PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse), - } -} - -func (s *PublicIPAddressDnsSettingsDomainNameLabelScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressDnsSettingsDomainNameLabelScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressDnsSettingsDomainNameLabelScope(input string) (*PublicIPAddressDnsSettingsDomainNameLabelScope, error) { - vals := map[string]PublicIPAddressDnsSettingsDomainNameLabelScope{ - "noreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeNoReuse, - "resourcegroupreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeResourceGroupReuse, - "subscriptionreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeSubscriptionReuse, - "tenantreuse": PublicIPAddressDnsSettingsDomainNameLabelScopeTenantReuse, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressDnsSettingsDomainNameLabelScope(input) - return &out, nil -} - -type PublicIPAddressMigrationPhase string - -const ( - PublicIPAddressMigrationPhaseAbort PublicIPAddressMigrationPhase = "Abort" - PublicIPAddressMigrationPhaseCommit PublicIPAddressMigrationPhase = "Commit" - PublicIPAddressMigrationPhaseCommitted PublicIPAddressMigrationPhase = "Committed" - PublicIPAddressMigrationPhaseNone PublicIPAddressMigrationPhase = "None" - PublicIPAddressMigrationPhasePrepare PublicIPAddressMigrationPhase = "Prepare" -) - -func PossibleValuesForPublicIPAddressMigrationPhase() []string { - return []string{ - string(PublicIPAddressMigrationPhaseAbort), - string(PublicIPAddressMigrationPhaseCommit), - string(PublicIPAddressMigrationPhaseCommitted), - string(PublicIPAddressMigrationPhaseNone), - string(PublicIPAddressMigrationPhasePrepare), - } -} - -func (s *PublicIPAddressMigrationPhase) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressMigrationPhase(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressMigrationPhase(input string) (*PublicIPAddressMigrationPhase, error) { - vals := map[string]PublicIPAddressMigrationPhase{ - "abort": PublicIPAddressMigrationPhaseAbort, - "commit": PublicIPAddressMigrationPhaseCommit, - "committed": PublicIPAddressMigrationPhaseCommitted, - "none": PublicIPAddressMigrationPhaseNone, - "prepare": PublicIPAddressMigrationPhasePrepare, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressMigrationPhase(input) - return &out, nil -} - -type PublicIPAddressSkuName string - -const ( - PublicIPAddressSkuNameBasic PublicIPAddressSkuName = "Basic" - PublicIPAddressSkuNameStandard PublicIPAddressSkuName = "Standard" -) - -func PossibleValuesForPublicIPAddressSkuName() []string { - return []string{ - string(PublicIPAddressSkuNameBasic), - string(PublicIPAddressSkuNameStandard), - } -} - -func (s *PublicIPAddressSkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuName(input string) (*PublicIPAddressSkuName, error) { - vals := map[string]PublicIPAddressSkuName{ - "basic": PublicIPAddressSkuNameBasic, - "standard": PublicIPAddressSkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuName(input) - return &out, nil -} - -type PublicIPAddressSkuTier string - -const ( - PublicIPAddressSkuTierGlobal PublicIPAddressSkuTier = "Global" - PublicIPAddressSkuTierRegional PublicIPAddressSkuTier = "Regional" -) - -func PossibleValuesForPublicIPAddressSkuTier() []string { - return []string{ - string(PublicIPAddressSkuTierGlobal), - string(PublicIPAddressSkuTierRegional), - } -} - -func (s *PublicIPAddressSkuTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePublicIPAddressSkuTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePublicIPAddressSkuTier(input string) (*PublicIPAddressSkuTier, error) { - vals := map[string]PublicIPAddressSkuTier{ - "global": PublicIPAddressSkuTierGlobal, - "regional": PublicIPAddressSkuTierRegional, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PublicIPAddressSkuTier(input) - return &out, nil -} - -type RouteNextHopType string - -const ( - RouteNextHopTypeInternet RouteNextHopType = "Internet" - RouteNextHopTypeNone RouteNextHopType = "None" - RouteNextHopTypeVirtualAppliance RouteNextHopType = "VirtualAppliance" - RouteNextHopTypeVirtualNetworkGateway RouteNextHopType = "VirtualNetworkGateway" - RouteNextHopTypeVnetLocal RouteNextHopType = "VnetLocal" -) - -func PossibleValuesForRouteNextHopType() []string { - return []string{ - string(RouteNextHopTypeInternet), - string(RouteNextHopTypeNone), - string(RouteNextHopTypeVirtualAppliance), - string(RouteNextHopTypeVirtualNetworkGateway), - string(RouteNextHopTypeVnetLocal), - } -} - -func (s *RouteNextHopType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRouteNextHopType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRouteNextHopType(input string) (*RouteNextHopType, error) { - vals := map[string]RouteNextHopType{ - "internet": RouteNextHopTypeInternet, - "none": RouteNextHopTypeNone, - "virtualappliance": RouteNextHopTypeVirtualAppliance, - "virtualnetworkgateway": RouteNextHopTypeVirtualNetworkGateway, - "vnetlocal": RouteNextHopTypeVnetLocal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RouteNextHopType(input) - return &out, nil -} - -type ScrubbingRuleEntryMatchOperator string - -const ( - ScrubbingRuleEntryMatchOperatorEquals ScrubbingRuleEntryMatchOperator = "Equals" - ScrubbingRuleEntryMatchOperatorEqualsAny ScrubbingRuleEntryMatchOperator = "EqualsAny" -) - -func PossibleValuesForScrubbingRuleEntryMatchOperator() []string { - return []string{ - string(ScrubbingRuleEntryMatchOperatorEquals), - string(ScrubbingRuleEntryMatchOperatorEqualsAny), - } -} - -func (s *ScrubbingRuleEntryMatchOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryMatchOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryMatchOperator(input string) (*ScrubbingRuleEntryMatchOperator, error) { - vals := map[string]ScrubbingRuleEntryMatchOperator{ - "equals": ScrubbingRuleEntryMatchOperatorEquals, - "equalsany": ScrubbingRuleEntryMatchOperatorEqualsAny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryMatchOperator(input) - return &out, nil -} - -type ScrubbingRuleEntryMatchVariable string - -const ( - ScrubbingRuleEntryMatchVariableRequestArgNames ScrubbingRuleEntryMatchVariable = "RequestArgNames" - ScrubbingRuleEntryMatchVariableRequestCookieNames ScrubbingRuleEntryMatchVariable = "RequestCookieNames" - ScrubbingRuleEntryMatchVariableRequestHeaderNames ScrubbingRuleEntryMatchVariable = "RequestHeaderNames" - ScrubbingRuleEntryMatchVariableRequestIPAddress ScrubbingRuleEntryMatchVariable = "RequestIPAddress" - ScrubbingRuleEntryMatchVariableRequestJSONArgNames ScrubbingRuleEntryMatchVariable = "RequestJSONArgNames" - ScrubbingRuleEntryMatchVariableRequestPostArgNames ScrubbingRuleEntryMatchVariable = "RequestPostArgNames" -) - -func PossibleValuesForScrubbingRuleEntryMatchVariable() []string { - return []string{ - string(ScrubbingRuleEntryMatchVariableRequestArgNames), - string(ScrubbingRuleEntryMatchVariableRequestCookieNames), - string(ScrubbingRuleEntryMatchVariableRequestHeaderNames), - string(ScrubbingRuleEntryMatchVariableRequestIPAddress), - string(ScrubbingRuleEntryMatchVariableRequestJSONArgNames), - string(ScrubbingRuleEntryMatchVariableRequestPostArgNames), - } -} - -func (s *ScrubbingRuleEntryMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryMatchVariable(input string) (*ScrubbingRuleEntryMatchVariable, error) { - vals := map[string]ScrubbingRuleEntryMatchVariable{ - "requestargnames": ScrubbingRuleEntryMatchVariableRequestArgNames, - "requestcookienames": ScrubbingRuleEntryMatchVariableRequestCookieNames, - "requestheadernames": ScrubbingRuleEntryMatchVariableRequestHeaderNames, - "requestipaddress": ScrubbingRuleEntryMatchVariableRequestIPAddress, - "requestjsonargnames": ScrubbingRuleEntryMatchVariableRequestJSONArgNames, - "requestpostargnames": ScrubbingRuleEntryMatchVariableRequestPostArgNames, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryMatchVariable(input) - return &out, nil -} - -type ScrubbingRuleEntryState string - -const ( - ScrubbingRuleEntryStateDisabled ScrubbingRuleEntryState = "Disabled" - ScrubbingRuleEntryStateEnabled ScrubbingRuleEntryState = "Enabled" -) - -func PossibleValuesForScrubbingRuleEntryState() []string { - return []string{ - string(ScrubbingRuleEntryStateDisabled), - string(ScrubbingRuleEntryStateEnabled), - } -} - -func (s *ScrubbingRuleEntryState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseScrubbingRuleEntryState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseScrubbingRuleEntryState(input string) (*ScrubbingRuleEntryState, error) { - vals := map[string]ScrubbingRuleEntryState{ - "disabled": ScrubbingRuleEntryStateDisabled, - "enabled": ScrubbingRuleEntryStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ScrubbingRuleEntryState(input) - return &out, nil -} - -type SecurityRuleAccess string - -const ( - SecurityRuleAccessAllow SecurityRuleAccess = "Allow" - SecurityRuleAccessDeny SecurityRuleAccess = "Deny" -) - -func PossibleValuesForSecurityRuleAccess() []string { - return []string{ - string(SecurityRuleAccessAllow), - string(SecurityRuleAccessDeny), - } -} - -func (s *SecurityRuleAccess) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleAccess(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleAccess(input string) (*SecurityRuleAccess, error) { - vals := map[string]SecurityRuleAccess{ - "allow": SecurityRuleAccessAllow, - "deny": SecurityRuleAccessDeny, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleAccess(input) - return &out, nil -} - -type SecurityRuleDirection string - -const ( - SecurityRuleDirectionInbound SecurityRuleDirection = "Inbound" - SecurityRuleDirectionOutbound SecurityRuleDirection = "Outbound" -) - -func PossibleValuesForSecurityRuleDirection() []string { - return []string{ - string(SecurityRuleDirectionInbound), - string(SecurityRuleDirectionOutbound), - } -} - -func (s *SecurityRuleDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleDirection(input string) (*SecurityRuleDirection, error) { - vals := map[string]SecurityRuleDirection{ - "inbound": SecurityRuleDirectionInbound, - "outbound": SecurityRuleDirectionOutbound, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleDirection(input) - return &out, nil -} - -type SecurityRuleProtocol string - -const ( - SecurityRuleProtocolAh SecurityRuleProtocol = "Ah" - SecurityRuleProtocolAny SecurityRuleProtocol = "*" - SecurityRuleProtocolEsp SecurityRuleProtocol = "Esp" - SecurityRuleProtocolIcmp SecurityRuleProtocol = "Icmp" - SecurityRuleProtocolTcp SecurityRuleProtocol = "Tcp" - SecurityRuleProtocolUdp SecurityRuleProtocol = "Udp" -) - -func PossibleValuesForSecurityRuleProtocol() []string { - return []string{ - string(SecurityRuleProtocolAh), - string(SecurityRuleProtocolAny), - string(SecurityRuleProtocolEsp), - string(SecurityRuleProtocolIcmp), - string(SecurityRuleProtocolTcp), - string(SecurityRuleProtocolUdp), - } -} - -func (s *SecurityRuleProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityRuleProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityRuleProtocol(input string) (*SecurityRuleProtocol, error) { - vals := map[string]SecurityRuleProtocol{ - "ah": SecurityRuleProtocolAh, - "*": SecurityRuleProtocolAny, - "esp": SecurityRuleProtocolEsp, - "icmp": SecurityRuleProtocolIcmp, - "tcp": SecurityRuleProtocolTcp, - "udp": SecurityRuleProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityRuleProtocol(input) - return &out, nil -} - -type SyncMode string - -const ( - SyncModeAutomatic SyncMode = "Automatic" - SyncModeManual SyncMode = "Manual" -) - -func PossibleValuesForSyncMode() []string { - return []string{ - string(SyncModeAutomatic), - string(SyncModeManual), - } -} - -func (s *SyncMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSyncMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSyncMode(input string) (*SyncMode, error) { - vals := map[string]SyncMode{ - "automatic": SyncModeAutomatic, - "manual": SyncModeManual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SyncMode(input) - return &out, nil -} - -type TransportProtocol string - -const ( - TransportProtocolAll TransportProtocol = "All" - TransportProtocolTcp TransportProtocol = "Tcp" - TransportProtocolUdp TransportProtocol = "Udp" -) - -func PossibleValuesForTransportProtocol() []string { - return []string{ - string(TransportProtocolAll), - string(TransportProtocolTcp), - string(TransportProtocolUdp), - } -} - -func (s *TransportProtocol) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTransportProtocol(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTransportProtocol(input string) (*TransportProtocol, error) { - vals := map[string]TransportProtocol{ - "all": TransportProtocolAll, - "tcp": TransportProtocolTcp, - "udp": TransportProtocolUdp, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TransportProtocol(input) - return &out, nil -} - -type VirtualNetworkPrivateEndpointNetworkPolicies string - -const ( - VirtualNetworkPrivateEndpointNetworkPoliciesDisabled VirtualNetworkPrivateEndpointNetworkPolicies = "Disabled" - VirtualNetworkPrivateEndpointNetworkPoliciesEnabled VirtualNetworkPrivateEndpointNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateEndpointNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateEndpointNetworkPoliciesDisabled), - string(VirtualNetworkPrivateEndpointNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateEndpointNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateEndpointNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateEndpointNetworkPolicies(input string) (*VirtualNetworkPrivateEndpointNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateEndpointNetworkPolicies{ - "disabled": VirtualNetworkPrivateEndpointNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateEndpointNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateEndpointNetworkPolicies(input) - return &out, nil -} - -type VirtualNetworkPrivateLinkServiceNetworkPolicies string - -const ( - VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Disabled" - VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled VirtualNetworkPrivateLinkServiceNetworkPolicies = "Enabled" -) - -func PossibleValuesForVirtualNetworkPrivateLinkServiceNetworkPolicies() []string { - return []string{ - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled), - string(VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled), - } -} - -func (s *VirtualNetworkPrivateLinkServiceNetworkPolicies) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVirtualNetworkPrivateLinkServiceNetworkPolicies(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVirtualNetworkPrivateLinkServiceNetworkPolicies(input string) (*VirtualNetworkPrivateLinkServiceNetworkPolicies, error) { - vals := map[string]VirtualNetworkPrivateLinkServiceNetworkPolicies{ - "disabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesDisabled, - "enabled": VirtualNetworkPrivateLinkServiceNetworkPoliciesEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VirtualNetworkPrivateLinkServiceNetworkPolicies(input) - return &out, nil -} - -type WebApplicationFirewallAction string - -const ( - WebApplicationFirewallActionAllow WebApplicationFirewallAction = "Allow" - WebApplicationFirewallActionBlock WebApplicationFirewallAction = "Block" - WebApplicationFirewallActionJSChallenge WebApplicationFirewallAction = "JSChallenge" - WebApplicationFirewallActionLog WebApplicationFirewallAction = "Log" -) - -func PossibleValuesForWebApplicationFirewallAction() []string { - return []string{ - string(WebApplicationFirewallActionAllow), - string(WebApplicationFirewallActionBlock), - string(WebApplicationFirewallActionJSChallenge), - string(WebApplicationFirewallActionLog), - } -} - -func (s *WebApplicationFirewallAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallAction(input string) (*WebApplicationFirewallAction, error) { - vals := map[string]WebApplicationFirewallAction{ - "allow": WebApplicationFirewallActionAllow, - "block": WebApplicationFirewallActionBlock, - "jschallenge": WebApplicationFirewallActionJSChallenge, - "log": WebApplicationFirewallActionLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallAction(input) - return &out, nil -} - -type WebApplicationFirewallEnabledState string - -const ( - WebApplicationFirewallEnabledStateDisabled WebApplicationFirewallEnabledState = "Disabled" - WebApplicationFirewallEnabledStateEnabled WebApplicationFirewallEnabledState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallEnabledState() []string { - return []string{ - string(WebApplicationFirewallEnabledStateDisabled), - string(WebApplicationFirewallEnabledStateEnabled), - } -} - -func (s *WebApplicationFirewallEnabledState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallEnabledState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallEnabledState(input string) (*WebApplicationFirewallEnabledState, error) { - vals := map[string]WebApplicationFirewallEnabledState{ - "disabled": WebApplicationFirewallEnabledStateDisabled, - "enabled": WebApplicationFirewallEnabledStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallEnabledState(input) - return &out, nil -} - -type WebApplicationFirewallMatchVariable string - -const ( - WebApplicationFirewallMatchVariablePostArgs WebApplicationFirewallMatchVariable = "PostArgs" - WebApplicationFirewallMatchVariableQueryString WebApplicationFirewallMatchVariable = "QueryString" - WebApplicationFirewallMatchVariableRemoteAddr WebApplicationFirewallMatchVariable = "RemoteAddr" - WebApplicationFirewallMatchVariableRequestBody WebApplicationFirewallMatchVariable = "RequestBody" - WebApplicationFirewallMatchVariableRequestCookies WebApplicationFirewallMatchVariable = "RequestCookies" - WebApplicationFirewallMatchVariableRequestHeaders WebApplicationFirewallMatchVariable = "RequestHeaders" - WebApplicationFirewallMatchVariableRequestMethod WebApplicationFirewallMatchVariable = "RequestMethod" - WebApplicationFirewallMatchVariableRequestUri WebApplicationFirewallMatchVariable = "RequestUri" -) - -func PossibleValuesForWebApplicationFirewallMatchVariable() []string { - return []string{ - string(WebApplicationFirewallMatchVariablePostArgs), - string(WebApplicationFirewallMatchVariableQueryString), - string(WebApplicationFirewallMatchVariableRemoteAddr), - string(WebApplicationFirewallMatchVariableRequestBody), - string(WebApplicationFirewallMatchVariableRequestCookies), - string(WebApplicationFirewallMatchVariableRequestHeaders), - string(WebApplicationFirewallMatchVariableRequestMethod), - string(WebApplicationFirewallMatchVariableRequestUri), - } -} - -func (s *WebApplicationFirewallMatchVariable) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallMatchVariable(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallMatchVariable(input string) (*WebApplicationFirewallMatchVariable, error) { - vals := map[string]WebApplicationFirewallMatchVariable{ - "postargs": WebApplicationFirewallMatchVariablePostArgs, - "querystring": WebApplicationFirewallMatchVariableQueryString, - "remoteaddr": WebApplicationFirewallMatchVariableRemoteAddr, - "requestbody": WebApplicationFirewallMatchVariableRequestBody, - "requestcookies": WebApplicationFirewallMatchVariableRequestCookies, - "requestheaders": WebApplicationFirewallMatchVariableRequestHeaders, - "requestmethod": WebApplicationFirewallMatchVariableRequestMethod, - "requesturi": WebApplicationFirewallMatchVariableRequestUri, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallMatchVariable(input) - return &out, nil -} - -type WebApplicationFirewallMode string - -const ( - WebApplicationFirewallModeDetection WebApplicationFirewallMode = "Detection" - WebApplicationFirewallModePrevention WebApplicationFirewallMode = "Prevention" -) - -func PossibleValuesForWebApplicationFirewallMode() []string { - return []string{ - string(WebApplicationFirewallModeDetection), - string(WebApplicationFirewallModePrevention), - } -} - -func (s *WebApplicationFirewallMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallMode(input string) (*WebApplicationFirewallMode, error) { - vals := map[string]WebApplicationFirewallMode{ - "detection": WebApplicationFirewallModeDetection, - "prevention": WebApplicationFirewallModePrevention, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallMode(input) - return &out, nil -} - -type WebApplicationFirewallOperator string - -const ( - WebApplicationFirewallOperatorAny WebApplicationFirewallOperator = "Any" - WebApplicationFirewallOperatorBeginsWith WebApplicationFirewallOperator = "BeginsWith" - WebApplicationFirewallOperatorContains WebApplicationFirewallOperator = "Contains" - WebApplicationFirewallOperatorEndsWith WebApplicationFirewallOperator = "EndsWith" - WebApplicationFirewallOperatorEqual WebApplicationFirewallOperator = "Equal" - WebApplicationFirewallOperatorGeoMatch WebApplicationFirewallOperator = "GeoMatch" - WebApplicationFirewallOperatorGreaterThan WebApplicationFirewallOperator = "GreaterThan" - WebApplicationFirewallOperatorGreaterThanOrEqual WebApplicationFirewallOperator = "GreaterThanOrEqual" - WebApplicationFirewallOperatorIPMatch WebApplicationFirewallOperator = "IPMatch" - WebApplicationFirewallOperatorLessThan WebApplicationFirewallOperator = "LessThan" - WebApplicationFirewallOperatorLessThanOrEqual WebApplicationFirewallOperator = "LessThanOrEqual" - WebApplicationFirewallOperatorRegex WebApplicationFirewallOperator = "Regex" -) - -func PossibleValuesForWebApplicationFirewallOperator() []string { - return []string{ - string(WebApplicationFirewallOperatorAny), - string(WebApplicationFirewallOperatorBeginsWith), - string(WebApplicationFirewallOperatorContains), - string(WebApplicationFirewallOperatorEndsWith), - string(WebApplicationFirewallOperatorEqual), - string(WebApplicationFirewallOperatorGeoMatch), - string(WebApplicationFirewallOperatorGreaterThan), - string(WebApplicationFirewallOperatorGreaterThanOrEqual), - string(WebApplicationFirewallOperatorIPMatch), - string(WebApplicationFirewallOperatorLessThan), - string(WebApplicationFirewallOperatorLessThanOrEqual), - string(WebApplicationFirewallOperatorRegex), - } -} - -func (s *WebApplicationFirewallOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallOperator(input string) (*WebApplicationFirewallOperator, error) { - vals := map[string]WebApplicationFirewallOperator{ - "any": WebApplicationFirewallOperatorAny, - "beginswith": WebApplicationFirewallOperatorBeginsWith, - "contains": WebApplicationFirewallOperatorContains, - "endswith": WebApplicationFirewallOperatorEndsWith, - "equal": WebApplicationFirewallOperatorEqual, - "geomatch": WebApplicationFirewallOperatorGeoMatch, - "greaterthan": WebApplicationFirewallOperatorGreaterThan, - "greaterthanorequal": WebApplicationFirewallOperatorGreaterThanOrEqual, - "ipmatch": WebApplicationFirewallOperatorIPMatch, - "lessthan": WebApplicationFirewallOperatorLessThan, - "lessthanorequal": WebApplicationFirewallOperatorLessThanOrEqual, - "regex": WebApplicationFirewallOperatorRegex, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallOperator(input) - return &out, nil -} - -type WebApplicationFirewallPolicyResourceState string - -const ( - WebApplicationFirewallPolicyResourceStateCreating WebApplicationFirewallPolicyResourceState = "Creating" - WebApplicationFirewallPolicyResourceStateDeleting WebApplicationFirewallPolicyResourceState = "Deleting" - WebApplicationFirewallPolicyResourceStateDisabled WebApplicationFirewallPolicyResourceState = "Disabled" - WebApplicationFirewallPolicyResourceStateDisabling WebApplicationFirewallPolicyResourceState = "Disabling" - WebApplicationFirewallPolicyResourceStateEnabled WebApplicationFirewallPolicyResourceState = "Enabled" - WebApplicationFirewallPolicyResourceStateEnabling WebApplicationFirewallPolicyResourceState = "Enabling" -) - -func PossibleValuesForWebApplicationFirewallPolicyResourceState() []string { - return []string{ - string(WebApplicationFirewallPolicyResourceStateCreating), - string(WebApplicationFirewallPolicyResourceStateDeleting), - string(WebApplicationFirewallPolicyResourceStateDisabled), - string(WebApplicationFirewallPolicyResourceStateDisabling), - string(WebApplicationFirewallPolicyResourceStateEnabled), - string(WebApplicationFirewallPolicyResourceStateEnabling), - } -} - -func (s *WebApplicationFirewallPolicyResourceState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallPolicyResourceState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallPolicyResourceState(input string) (*WebApplicationFirewallPolicyResourceState, error) { - vals := map[string]WebApplicationFirewallPolicyResourceState{ - "creating": WebApplicationFirewallPolicyResourceStateCreating, - "deleting": WebApplicationFirewallPolicyResourceStateDeleting, - "disabled": WebApplicationFirewallPolicyResourceStateDisabled, - "disabling": WebApplicationFirewallPolicyResourceStateDisabling, - "enabled": WebApplicationFirewallPolicyResourceStateEnabled, - "enabling": WebApplicationFirewallPolicyResourceStateEnabling, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallPolicyResourceState(input) - return &out, nil -} - -type WebApplicationFirewallRuleType string - -const ( - WebApplicationFirewallRuleTypeInvalid WebApplicationFirewallRuleType = "Invalid" - WebApplicationFirewallRuleTypeMatchRule WebApplicationFirewallRuleType = "MatchRule" - WebApplicationFirewallRuleTypeRateLimitRule WebApplicationFirewallRuleType = "RateLimitRule" -) - -func PossibleValuesForWebApplicationFirewallRuleType() []string { - return []string{ - string(WebApplicationFirewallRuleTypeInvalid), - string(WebApplicationFirewallRuleTypeMatchRule), - string(WebApplicationFirewallRuleTypeRateLimitRule), - } -} - -func (s *WebApplicationFirewallRuleType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallRuleType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallRuleType(input string) (*WebApplicationFirewallRuleType, error) { - vals := map[string]WebApplicationFirewallRuleType{ - "invalid": WebApplicationFirewallRuleTypeInvalid, - "matchrule": WebApplicationFirewallRuleTypeMatchRule, - "ratelimitrule": WebApplicationFirewallRuleTypeRateLimitRule, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallRuleType(input) - return &out, nil -} - -type WebApplicationFirewallScrubbingState string - -const ( - WebApplicationFirewallScrubbingStateDisabled WebApplicationFirewallScrubbingState = "Disabled" - WebApplicationFirewallScrubbingStateEnabled WebApplicationFirewallScrubbingState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallScrubbingState() []string { - return []string{ - string(WebApplicationFirewallScrubbingStateDisabled), - string(WebApplicationFirewallScrubbingStateEnabled), - } -} - -func (s *WebApplicationFirewallScrubbingState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallScrubbingState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallScrubbingState(input string) (*WebApplicationFirewallScrubbingState, error) { - vals := map[string]WebApplicationFirewallScrubbingState{ - "disabled": WebApplicationFirewallScrubbingStateDisabled, - "enabled": WebApplicationFirewallScrubbingStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallScrubbingState(input) - return &out, nil -} - -type WebApplicationFirewallState string - -const ( - WebApplicationFirewallStateDisabled WebApplicationFirewallState = "Disabled" - WebApplicationFirewallStateEnabled WebApplicationFirewallState = "Enabled" -) - -func PossibleValuesForWebApplicationFirewallState() []string { - return []string{ - string(WebApplicationFirewallStateDisabled), - string(WebApplicationFirewallStateEnabled), - } -} - -func (s *WebApplicationFirewallState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallState(input string) (*WebApplicationFirewallState, error) { - vals := map[string]WebApplicationFirewallState{ - "disabled": WebApplicationFirewallStateDisabled, - "enabled": WebApplicationFirewallStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallState(input) - return &out, nil -} - -type WebApplicationFirewallTransform string - -const ( - WebApplicationFirewallTransformHtmlEntityDecode WebApplicationFirewallTransform = "HtmlEntityDecode" - WebApplicationFirewallTransformLowercase WebApplicationFirewallTransform = "Lowercase" - WebApplicationFirewallTransformRemoveNulls WebApplicationFirewallTransform = "RemoveNulls" - WebApplicationFirewallTransformTrim WebApplicationFirewallTransform = "Trim" - WebApplicationFirewallTransformUppercase WebApplicationFirewallTransform = "Uppercase" - WebApplicationFirewallTransformUrlDecode WebApplicationFirewallTransform = "UrlDecode" - WebApplicationFirewallTransformUrlEncode WebApplicationFirewallTransform = "UrlEncode" -) - -func PossibleValuesForWebApplicationFirewallTransform() []string { - return []string{ - string(WebApplicationFirewallTransformHtmlEntityDecode), - string(WebApplicationFirewallTransformLowercase), - string(WebApplicationFirewallTransformRemoveNulls), - string(WebApplicationFirewallTransformTrim), - string(WebApplicationFirewallTransformUppercase), - string(WebApplicationFirewallTransformUrlDecode), - string(WebApplicationFirewallTransformUrlEncode), - } -} - -func (s *WebApplicationFirewallTransform) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseWebApplicationFirewallTransform(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseWebApplicationFirewallTransform(input string) (*WebApplicationFirewallTransform, error) { - vals := map[string]WebApplicationFirewallTransform{ - "htmlentitydecode": WebApplicationFirewallTransformHtmlEntityDecode, - "lowercase": WebApplicationFirewallTransformLowercase, - "removenulls": WebApplicationFirewallTransformRemoveNulls, - "trim": WebApplicationFirewallTransformTrim, - "uppercase": WebApplicationFirewallTransformUppercase, - "urldecode": WebApplicationFirewallTransformUrlDecode, - "urlencode": WebApplicationFirewallTransformUrlEncode, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WebApplicationFirewallTransform(input) - return &out, nil -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go deleted file mode 100644 index 9c48316d9e7..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy.go +++ /dev/null @@ -1,130 +0,0 @@ -package webapplicationfirewallpolicies - -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(&ApplicationGatewayWebApplicationFirewallPolicyId{}) -} - -var _ resourceids.ResourceId = &ApplicationGatewayWebApplicationFirewallPolicyId{} - -// ApplicationGatewayWebApplicationFirewallPolicyId is a struct representing the Resource ID for a Application Gateway Web Application Firewall Policy -type ApplicationGatewayWebApplicationFirewallPolicyId struct { - SubscriptionId string - ResourceGroupName string - ApplicationGatewayWebApplicationFirewallPolicyName string -} - -// NewApplicationGatewayWebApplicationFirewallPolicyID returns a new ApplicationGatewayWebApplicationFirewallPolicyId struct -func NewApplicationGatewayWebApplicationFirewallPolicyID(subscriptionId string, resourceGroupName string, applicationGatewayWebApplicationFirewallPolicyName string) ApplicationGatewayWebApplicationFirewallPolicyId { - return ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ApplicationGatewayWebApplicationFirewallPolicyName: applicationGatewayWebApplicationFirewallPolicyName, - } -} - -// ParseApplicationGatewayWebApplicationFirewallPolicyID parses 'input' into a ApplicationGatewayWebApplicationFirewallPolicyId -func ParseApplicationGatewayWebApplicationFirewallPolicyID(input string) (*ApplicationGatewayWebApplicationFirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayWebApplicationFirewallPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayWebApplicationFirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively parses 'input' case-insensitively into a ApplicationGatewayWebApplicationFirewallPolicyId -// note: this method should only be used for API response data and not user input -func ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(input string) (*ApplicationGatewayWebApplicationFirewallPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ApplicationGatewayWebApplicationFirewallPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ApplicationGatewayWebApplicationFirewallPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ApplicationGatewayWebApplicationFirewallPolicyId) 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.ApplicationGatewayWebApplicationFirewallPolicyName, ok = input.Parsed["applicationGatewayWebApplicationFirewallPolicyName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "applicationGatewayWebApplicationFirewallPolicyName", input) - } - - return nil -} - -// ValidateApplicationGatewayWebApplicationFirewallPolicyID checks that 'input' can be parsed as a Application Gateway Web Application Firewall Policy ID -func ValidateApplicationGatewayWebApplicationFirewallPolicyID(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 := ParseApplicationGatewayWebApplicationFirewallPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Application Gateway Web Application Firewall Policy ID -func (id ApplicationGatewayWebApplicationFirewallPolicyId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ApplicationGatewayWebApplicationFirewallPolicyName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Application Gateway Web Application Firewall Policy ID -func (id ApplicationGatewayWebApplicationFirewallPolicyId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticApplicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies", "applicationGatewayWebApplicationFirewallPolicies"), - resourceids.UserSpecifiedSegment("applicationGatewayWebApplicationFirewallPolicyName", "applicationGatewayWebApplicationFirewallPolicyValue"), - } -} - -// String returns a human-readable description of this Application Gateway Web Application Firewall Policy ID -func (id ApplicationGatewayWebApplicationFirewallPolicyId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Application Gateway Web Application Firewall Policy Name: %q", id.ApplicationGatewayWebApplicationFirewallPolicyName), - } - return fmt.Sprintf("Application Gateway Web Application Firewall Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go deleted file mode 100644 index 6b50388308f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/id_applicationgatewaywebapplicationfirewallpolicy_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package webapplicationfirewallpolicies - -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 = &ApplicationGatewayWebApplicationFirewallPolicyId{} - -func TestNewApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - id := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue") - - 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.ApplicationGatewayWebApplicationFirewallPolicyName != "applicationGatewayWebApplicationFirewallPolicyValue" { - t.Fatalf("Expected %q but got %q for Segment 'ApplicationGatewayWebApplicationFirewallPolicyName'", id.ApplicationGatewayWebApplicationFirewallPolicyName, "applicationGatewayWebApplicationFirewallPolicyValue") - } -} - -func TestFormatApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - actual := NewApplicationGatewayWebApplicationFirewallPolicyID("12345678-1234-9876-4563-123456789012", "example-resource-group", "applicationGatewayWebApplicationFirewallPolicyValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseApplicationGatewayWebApplicationFirewallPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayWebApplicationFirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue", - Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayWebApplicationFirewallPolicyID(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.ApplicationGatewayWebApplicationFirewallPolicyName != v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayWebApplicationFirewallPolicyName", v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName, actual.ApplicationGatewayWebApplicationFirewallPolicyName) - } - - } -} - -func TestParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ApplicationGatewayWebApplicationFirewallPolicyId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue", - Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ApplicationGatewayWebApplicationFirewallPolicyName: "applicationGatewayWebApplicationFirewallPolicyValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies/applicationGatewayWebApplicationFirewallPolicyValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYvAlUe", - Expected: &ApplicationGatewayWebApplicationFirewallPolicyId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ApplicationGatewayWebApplicationFirewallPolicyName: "aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYvAlUe", - }, - }, - { - // 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.nEtWoRk/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcIeS/aPpLiCaTiOnGaTeWaYwEbApPlIcAtIoNfIrEwAlLpOlIcYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseApplicationGatewayWebApplicationFirewallPolicyIDInsensitively(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.ApplicationGatewayWebApplicationFirewallPolicyName != v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName { - t.Fatalf("Expected %q but got %q for ApplicationGatewayWebApplicationFirewallPolicyName", v.Expected.ApplicationGatewayWebApplicationFirewallPolicyName, actual.ApplicationGatewayWebApplicationFirewallPolicyName) - } - - } -} - -func TestSegmentsForApplicationGatewayWebApplicationFirewallPolicyId(t *testing.T) { - segments := ApplicationGatewayWebApplicationFirewallPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ApplicationGatewayWebApplicationFirewallPolicyId 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/network/2023-06-01/webapplicationfirewallpolicies/method_createorupdate.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_createorupdate.go deleted file mode 100644 index a30ca59994f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package webapplicationfirewallpolicies - -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 *WebApplicationFirewallPolicy -} - -// CreateOrUpdate ... -func (c WebApplicationFirewallPoliciesClient) CreateOrUpdate(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId, input WebApplicationFirewallPolicy) (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 WebApplicationFirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_delete.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_delete.go deleted file mode 100644 index c4547e95952..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package webapplicationfirewallpolicies - -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 WebApplicationFirewallPoliciesClient) Delete(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 WebApplicationFirewallPoliciesClient) DeleteThenPoll(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId) 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/network/2023-06-01/webapplicationfirewallpolicies/method_get.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_get.go deleted file mode 100644 index 03919558699..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package webapplicationfirewallpolicies - -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 *WebApplicationFirewallPolicy -} - -// Get ... -func (c WebApplicationFirewallPoliciesClient) Get(ctx context.Context, id ApplicationGatewayWebApplicationFirewallPolicyId) (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 WebApplicationFirewallPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_list.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_list.go deleted file mode 100644 index 505ae239c41..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package webapplicationfirewallpolicies - -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 *[]WebApplicationFirewallPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []WebApplicationFirewallPolicy -} - -// List ... -func (c WebApplicationFirewallPoliciesClient) List(ctx context.Context, id commonids.ResourceGroupId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", 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 *[]WebApplicationFirewallPolicy `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 WebApplicationFirewallPoliciesClient) ListComplete(ctx context.Context, id commonids.ResourceGroupId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WebApplicationFirewallPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebApplicationFirewallPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate WebApplicationFirewallPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]WebApplicationFirewallPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/network/2023-06-01/webapplicationfirewallpolicies/method_listall.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_listall.go deleted file mode 100644 index eff3155ccef..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/method_listall.go +++ /dev/null @@ -1,92 +0,0 @@ -package webapplicationfirewallpolicies - -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 ListAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]WebApplicationFirewallPolicy -} - -type ListAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []WebApplicationFirewallPolicy -} - -// ListAll ... -func (c WebApplicationFirewallPoliciesClient) ListAll(ctx context.Context, id commonids.SubscriptionId) (result ListAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/applicationGatewayWebApplicationFirewallPolicies", 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 *[]WebApplicationFirewallPolicy `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListAllComplete retrieves all the results into a single object -func (c WebApplicationFirewallPoliciesClient) ListAllComplete(ctx context.Context, id commonids.SubscriptionId) (ListAllCompleteResult, error) { - return c.ListAllCompleteMatchingPredicate(ctx, id, WebApplicationFirewallPolicyOperationPredicate{}) -} - -// ListAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebApplicationFirewallPoliciesClient) ListAllCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate WebApplicationFirewallPolicyOperationPredicate) (result ListAllCompleteResult, err error) { - items := make([]WebApplicationFirewallPolicy, 0) - - resp, err := c.ListAll(ctx, id) - if err != nil { - 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 = ListAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgateway.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgateway.go deleted file mode 100644 index 69aa82140ea..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgateway.go +++ /dev/null @@ -1,21 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" - "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 ApplicationGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go deleted file mode 100644 index 74175523bc1..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayAuthenticationCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go deleted file mode 100644 index 7536ffa2439..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayauthenticationcertificatepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAuthenticationCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go deleted file mode 100644 index 06e7df4e24e..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayautoscaleconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayAutoscaleConfiguration struct { - MaxCapacity *int64 `json:"maxCapacity,omitempty"` - MinCapacity int64 `json:"minCapacity"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go deleted file mode 100644 index dcc624a13aa..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddress struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go deleted file mode 100644 index 0f188b359ad..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go deleted file mode 100644 index 64a4ed2e836..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendAddressPoolPropertiesFormat struct { - BackendAddresses *[]ApplicationGatewayBackendAddress `json:"backendAddresses,omitempty"` - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go deleted file mode 100644 index 052f312d7b3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendHTTPSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go deleted file mode 100644 index 16305b5de81..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendhttpsettingspropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendHTTPSettingsPropertiesFormat struct { - AffinityCookieName *string `json:"affinityCookieName,omitempty"` - AuthenticationCertificates *[]SubResource `json:"authenticationCertificates,omitempty"` - ConnectionDraining *ApplicationGatewayConnectionDraining `json:"connectionDraining,omitempty"` - CookieBasedAffinity *ApplicationGatewayCookieBasedAffinity `json:"cookieBasedAffinity,omitempty"` - HostName *string `json:"hostName,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - ProbeEnabled *bool `json:"probeEnabled,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestTimeout *int64 `json:"requestTimeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go deleted file mode 100644 index 1bc8a5c5fe1..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettings struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayBackendSettingsPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go deleted file mode 100644 index 5d5f77f3c8d..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaybackendsettingspropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayBackendSettingsPropertiesFormat struct { - HostName *string `json:"hostName,omitempty"` - PickHostNameFromBackendAddress *bool `json:"pickHostNameFromBackendAddress,omitempty"` - Port *int64 `json:"port,omitempty"` - Probe *SubResource `json:"probe,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - TrustedRootCertificates *[]SubResource `json:"trustedRootCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go deleted file mode 100644 index 36e0f43021d..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayclientauthconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayClientAuthConfiguration struct { - VerifyClientCertIssuerDN *bool `json:"verifyClientCertIssuerDN,omitempty"` - VerifyClientRevocation *ApplicationGatewayClientRevocationOptions `json:"verifyClientRevocation,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go deleted file mode 100644 index 369c8494e6f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayconnectiondraining.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayConnectionDraining struct { - DrainTimeoutInSec int64 `json:"drainTimeoutInSec"` - Enabled bool `json:"enabled"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go deleted file mode 100644 index 82f3501791c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaycustomerror.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayCustomError struct { - CustomErrorPageUrl *string `json:"customErrorPageUrl,omitempty"` - StatusCode *ApplicationGatewayCustomErrorStatusCode `json:"statusCode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go deleted file mode 100644 index c88a33b735c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewalldisabledrulegroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallDisabledRuleGroup struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]int64 `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go deleted file mode 100644 index 541e5052e8f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfirewallexclusion.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFirewallExclusion struct { - MatchVariable string `json:"matchVariable"` - Selector string `json:"selector"` - SelectorMatchOperator string `json:"selectorMatchOperator"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go deleted file mode 100644 index f5f9c5bebc7..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go deleted file mode 100644 index 1b61dc71c1d..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendIPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConfiguration *SubResource `json:"privateLinkConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *SubResource `json:"publicIPAddress,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go deleted file mode 100644 index dfcb5e52ee3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendport.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPort struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayFrontendPortPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go deleted file mode 100644 index d37b168d0aa..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayfrontendportpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayFrontendPortPropertiesFormat struct { - Port *int64 `json:"port,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go deleted file mode 100644 index b80dabed9a0..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayglobalconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayGlobalConfiguration struct { - EnableRequestBuffering *bool `json:"enableRequestBuffering,omitempty"` - EnableResponseBuffering *bool `json:"enableResponseBuffering,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go deleted file mode 100644 index fbbd324adce..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayheaderconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHeaderConfiguration struct { - HeaderName *string `json:"headerName,omitempty"` - HeaderValue *string `json:"headerValue,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go deleted file mode 100644 index 0fd70bac201..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayHTTPListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go deleted file mode 100644 index 9c4eb515f42..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayhttplistenerpropertiesformat.go +++ /dev/null @@ -1,18 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayHTTPListenerPropertiesFormat struct { - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - HostName *string `json:"hostName,omitempty"` - HostNames *[]string `json:"hostNames,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequireServerNameIndication *bool `json:"requireServerNameIndication,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go deleted file mode 100644 index 6ffd65f71c2..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go deleted file mode 100644 index e8482b21e60..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayipconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayIPConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go deleted file mode 100644 index 71fe702c98e..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistener.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListener struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayListenerPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go deleted file mode 100644 index ceffb59e3b1..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaylistenerpropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayListenerPropertiesFormat struct { - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *SubResource `json:"frontendPort,omitempty"` - HostNames *[]string `json:"hostNames,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslCertificate *SubResource `json:"sslCertificate,omitempty"` - SslProfile *SubResource `json:"sslProfile,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go deleted file mode 100644 index 55e8713746c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionPolicyPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go deleted file mode 100644 index fe721166bf2..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributionpolicypropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionPolicyPropertiesFormat struct { - LoadDistributionAlgorithm *ApplicationGatewayLoadDistributionAlgorithm `json:"loadDistributionAlgorithm,omitempty"` - LoadDistributionTargets *[]ApplicationGatewayLoadDistributionTarget `json:"loadDistributionTargets,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go deleted file mode 100644 index d361c4e3d97..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontarget.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTarget struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayLoadDistributionTargetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go deleted file mode 100644 index 6ba821b2e82..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayloaddistributiontargetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayLoadDistributionTargetPropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - WeightPerServer *int64 `json:"weightPerServer,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go deleted file mode 100644 index 992b948c558..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPathRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go deleted file mode 100644 index 5c8b00da085..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypathrulepropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPathRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Paths *[]string `json:"paths,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go deleted file mode 100644 index 5b45596cedc..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateEndpointConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go deleted file mode 100644 index c6a900feb31..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivateendpointconnectionproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateEndpointConnectionProperties struct { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go deleted file mode 100644 index 73e8756981a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go deleted file mode 100644 index 8855a67b9ce..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkconfigurationproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkConfigurationProperties struct { - IPConfigurations *[]ApplicationGatewayPrivateLinkIPConfiguration `json:"ipConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go deleted file mode 100644 index ce8e67a68d0..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayPrivateLinkIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go deleted file mode 100644 index ff68d2052d7..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprivatelinkipconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPrivateLinkIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go deleted file mode 100644 index 9c935a9fbba..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobe.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbe struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayProbePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go deleted file mode 100644 index 20c18109ec0..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobehealthresponsematch.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbeHealthResponseMatch struct { - Body *string `json:"body,omitempty"` - StatusCodes *[]string `json:"statusCodes,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go deleted file mode 100644 index b36845c57bf..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayprobepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayProbePropertiesFormat struct { - Host *string `json:"host,omitempty"` - Interval *int64 `json:"interval,omitempty"` - Match *ApplicationGatewayProbeHealthResponseMatch `json:"match,omitempty"` - MinServers *int64 `json:"minServers,omitempty"` - Path *string `json:"path,omitempty"` - PickHostNameFromBackendHTTPSettings *bool `json:"pickHostNameFromBackendHttpSettings,omitempty"` - PickHostNameFromBackendSettings *bool `json:"pickHostNameFromBackendSettings,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *ApplicationGatewayProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Timeout *int64 `json:"timeout,omitempty"` - UnhealthyThreshold *int64 `json:"unhealthyThreshold,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go deleted file mode 100644 index f4f485b405b..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaypropertiesformat.go +++ /dev/null @@ -1,43 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayPropertiesFormat struct { - AuthenticationCertificates *[]ApplicationGatewayAuthenticationCertificate `json:"authenticationCertificates,omitempty"` - AutoscaleConfiguration *ApplicationGatewayAutoscaleConfiguration `json:"autoscaleConfiguration,omitempty"` - BackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"backendAddressPools,omitempty"` - BackendHTTPSettingsCollection *[]ApplicationGatewayBackendHTTPSettings `json:"backendHttpSettingsCollection,omitempty"` - BackendSettingsCollection *[]ApplicationGatewayBackendSettings `json:"backendSettingsCollection,omitempty"` - CustomErrorConfigurations *[]ApplicationGatewayCustomError `json:"customErrorConfigurations,omitempty"` - DefaultPredefinedSslPolicy *ApplicationGatewaySslPolicyName `json:"defaultPredefinedSslPolicy,omitempty"` - EnableFips *bool `json:"enableFips,omitempty"` - EnableHTTP2 *bool `json:"enableHttp2,omitempty"` - FirewallPolicy *SubResource `json:"firewallPolicy,omitempty"` - ForceFirewallPolicyAssociation *bool `json:"forceFirewallPolicyAssociation,omitempty"` - FrontendIPConfigurations *[]ApplicationGatewayFrontendIPConfiguration `json:"frontendIPConfigurations,omitempty"` - FrontendPorts *[]ApplicationGatewayFrontendPort `json:"frontendPorts,omitempty"` - GatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"gatewayIPConfigurations,omitempty"` - GlobalConfiguration *ApplicationGatewayGlobalConfiguration `json:"globalConfiguration,omitempty"` - HTTPListeners *[]ApplicationGatewayHTTPListener `json:"httpListeners,omitempty"` - Listeners *[]ApplicationGatewayListener `json:"listeners,omitempty"` - LoadDistributionPolicies *[]ApplicationGatewayLoadDistributionPolicy `json:"loadDistributionPolicies,omitempty"` - OperationalState *ApplicationGatewayOperationalState `json:"operationalState,omitempty"` - PrivateEndpointConnections *[]ApplicationGatewayPrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - PrivateLinkConfigurations *[]ApplicationGatewayPrivateLinkConfiguration `json:"privateLinkConfigurations,omitempty"` - Probes *[]ApplicationGatewayProbe `json:"probes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfigurations *[]ApplicationGatewayRedirectConfiguration `json:"redirectConfigurations,omitempty"` - RequestRoutingRules *[]ApplicationGatewayRequestRoutingRule `json:"requestRoutingRules,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - RewriteRuleSets *[]ApplicationGatewayRewriteRuleSet `json:"rewriteRuleSets,omitempty"` - RoutingRules *[]ApplicationGatewayRoutingRule `json:"routingRules,omitempty"` - Sku *ApplicationGatewaySku `json:"sku,omitempty"` - SslCertificates *[]ApplicationGatewaySslCertificate `json:"sslCertificates,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - SslProfiles *[]ApplicationGatewaySslProfile `json:"sslProfiles,omitempty"` - TrustedClientCertificates *[]ApplicationGatewayTrustedClientCertificate `json:"trustedClientCertificates,omitempty"` - TrustedRootCertificates *[]ApplicationGatewayTrustedRootCertificate `json:"trustedRootCertificates,omitempty"` - UrlPathMaps *[]ApplicationGatewayUrlPathMap `json:"urlPathMaps,omitempty"` - WebApplicationFirewallConfiguration *ApplicationGatewayWebApplicationFirewallConfiguration `json:"webApplicationFirewallConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go deleted file mode 100644 index 85eed147eb2..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRedirectConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go deleted file mode 100644 index 7808c57c7f7..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayredirectconfigurationpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRedirectConfigurationPropertiesFormat struct { - IncludePath *bool `json:"includePath,omitempty"` - IncludeQueryString *bool `json:"includeQueryString,omitempty"` - PathRules *[]SubResource `json:"pathRules,omitempty"` - RedirectType *ApplicationGatewayRedirectType `json:"redirectType,omitempty"` - RequestRoutingRules *[]SubResource `json:"requestRoutingRules,omitempty"` - TargetListener *SubResource `json:"targetListener,omitempty"` - TargetUrl *string `json:"targetUrl,omitempty"` - UrlPathMaps *[]SubResource `json:"urlPathMaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go deleted file mode 100644 index 9eb6ffe9c4a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRequestRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go deleted file mode 100644 index 53dc9f99474..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrequestroutingrulepropertiesformat.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRequestRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendHTTPSettings *SubResource `json:"backendHttpSettings,omitempty"` - HTTPListener *SubResource `json:"httpListener,omitempty"` - LoadDistributionPolicy *SubResource `json:"loadDistributionPolicy,omitempty"` - Priority *int64 `json:"priority,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RedirectConfiguration *SubResource `json:"redirectConfiguration,omitempty"` - RewriteRuleSet *SubResource `json:"rewriteRuleSet,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` - UrlPathMap *SubResource `json:"urlPathMap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go deleted file mode 100644 index 21ce81c5a24..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterule.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRule struct { - ActionSet *ApplicationGatewayRewriteRuleActionSet `json:"actionSet,omitempty"` - Conditions *[]ApplicationGatewayRewriteRuleCondition `json:"conditions,omitempty"` - Name *string `json:"name,omitempty"` - RuleSequence *int64 `json:"ruleSequence,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go deleted file mode 100644 index ed418b0d4a5..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleactionset.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleActionSet struct { - RequestHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"requestHeaderConfigurations,omitempty"` - ResponseHeaderConfigurations *[]ApplicationGatewayHeaderConfiguration `json:"responseHeaderConfigurations,omitempty"` - UrlConfiguration *ApplicationGatewayUrlConfiguration `json:"urlConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go deleted file mode 100644 index 1e70a94ea80..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulecondition.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleCondition struct { - IgnoreCase *bool `json:"ignoreCase,omitempty"` - Negate *bool `json:"negate,omitempty"` - Pattern *string `json:"pattern,omitempty"` - Variable *string `json:"variable,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go deleted file mode 100644 index a25c70e4a05..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriteruleset.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRewriteRuleSetPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go deleted file mode 100644 index 3a1e3374217..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayrewriterulesetpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRewriteRuleSetPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RewriteRules *[]ApplicationGatewayRewriteRule `json:"rewriteRules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go deleted file mode 100644 index 78053b23a9c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayRoutingRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go deleted file mode 100644 index 05ed98ab597..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayroutingrulepropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayRoutingRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendSettings *SubResource `json:"backendSettings,omitempty"` - Listener *SubResource `json:"listener,omitempty"` - Priority int64 `json:"priority"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RuleType *ApplicationGatewayRequestRoutingRuleType `json:"ruleType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go deleted file mode 100644 index 0b639c7628a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysku.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySku struct { - Capacity *int64 `json:"capacity,omitempty"` - Name *ApplicationGatewaySkuName `json:"name,omitempty"` - Tier *ApplicationGatewayTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go deleted file mode 100644 index 328f6a90d88..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go deleted file mode 100644 index f087bfec9a8..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslcertificatepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - Password *string `json:"password,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicCertData *string `json:"publicCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go deleted file mode 100644 index ae860f1460f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslpolicy.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslPolicy struct { - CipherSuites *[]ApplicationGatewaySslCipherSuite `json:"cipherSuites,omitempty"` - DisabledSslProtocols *[]ApplicationGatewaySslProtocol `json:"disabledSslProtocols,omitempty"` - MinProtocolVersion *ApplicationGatewaySslProtocol `json:"minProtocolVersion,omitempty"` - PolicyName *ApplicationGatewaySslPolicyName `json:"policyName,omitempty"` - PolicyType *ApplicationGatewaySslPolicyType `json:"policyType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go deleted file mode 100644 index 8c1d0630c2f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewaySslProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go deleted file mode 100644 index b89279b0c7f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaysslprofilepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewaySslProfilePropertiesFormat struct { - ClientAuthConfiguration *ApplicationGatewayClientAuthConfiguration `json:"clientAuthConfiguration,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SslPolicy *ApplicationGatewaySslPolicy `json:"sslPolicy,omitempty"` - TrustedClientCertificates *[]SubResource `json:"trustedClientCertificates,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go deleted file mode 100644 index f2fb2244e71..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedClientCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go deleted file mode 100644 index ac7454cb8f4..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedclientcertificatepropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedClientCertificatePropertiesFormat struct { - ClientCertIssuerDN *string `json:"clientCertIssuerDN,omitempty"` - Data *string `json:"data,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ValidatedCertData *string `json:"validatedCertData,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go deleted file mode 100644 index 9deacd55fe8..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificate.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificate struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayTrustedRootCertificatePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go deleted file mode 100644 index f79bf663f76..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaytrustedrootcertificatepropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayTrustedRootCertificatePropertiesFormat struct { - Data *string `json:"data,omitempty"` - KeyVaultSecretId *string `json:"keyVaultSecretId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go deleted file mode 100644 index 03021e43980..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlconfiguration.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlConfiguration struct { - ModifiedPath *string `json:"modifiedPath,omitempty"` - ModifiedQueryString *string `json:"modifiedQueryString,omitempty"` - Reroute *bool `json:"reroute,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go deleted file mode 100644 index 57b9cac7aa3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmap.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationGatewayUrlPathMapPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go deleted file mode 100644 index e69ae8cbde4..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewayurlpathmappropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayUrlPathMapPropertiesFormat struct { - DefaultBackendAddressPool *SubResource `json:"defaultBackendAddressPool,omitempty"` - DefaultBackendHTTPSettings *SubResource `json:"defaultBackendHttpSettings,omitempty"` - DefaultLoadDistributionPolicy *SubResource `json:"defaultLoadDistributionPolicy,omitempty"` - DefaultRedirectConfiguration *SubResource `json:"defaultRedirectConfiguration,omitempty"` - DefaultRewriteRuleSet *SubResource `json:"defaultRewriteRuleSet,omitempty"` - PathRules *[]ApplicationGatewayPathRule `json:"pathRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go deleted file mode 100644 index 0ccb185da05..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationgatewaywebapplicationfirewallconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationGatewayWebApplicationFirewallConfiguration struct { - DisabledRuleGroups *[]ApplicationGatewayFirewallDisabledRuleGroup `json:"disabledRuleGroups,omitempty"` - Enabled bool `json:"enabled"` - Exclusions *[]ApplicationGatewayFirewallExclusion `json:"exclusions,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - FirewallMode ApplicationGatewayFirewallMode `json:"firewallMode"` - MaxRequestBodySize *int64 `json:"maxRequestBodySize,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go deleted file mode 100644 index 8dccd748428..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ApplicationSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go deleted file mode 100644 index 2713b23e0a5..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_applicationsecuritygrouppropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApplicationSecurityGroupPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspool.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspool.go deleted file mode 100644 index a5f3d1e0367..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspool.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPool struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackendAddressPoolPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go deleted file mode 100644 index ddf54b50116..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_backendaddresspoolpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackendAddressPoolPropertiesFormat struct { - BackendIPConfigurations *[]NetworkInterfaceIPConfiguration `json:"backendIPConfigurations,omitempty"` - DrainPeriodInSeconds *int64 `json:"drainPeriodInSeconds,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancerBackendAddresses *[]LoadBalancerBackendAddress `json:"loadBalancerBackendAddresses,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - Location *string `json:"location,omitempty"` - OutboundRule *SubResource `json:"outboundRule,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SyncMode *SyncMode `json:"syncMode,omitempty"` - TunnelInterfaces *[]GatewayLoadBalancerTunnelInterface `json:"tunnelInterfaces,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go deleted file mode 100644 index e9022fbeb4f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_customdnsconfigpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomDnsConfigPropertiesFormat struct { - Fqdn *string `json:"fqdn,omitempty"` - IPAddresses *[]string `json:"ipAddresses,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ddossettings.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ddossettings.go deleted file mode 100644 index 4f7e1e20764..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ddossettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DdosSettings struct { - DdosProtectionPlan *SubResource `json:"ddosProtectionPlan,omitempty"` - ProtectionMode *DdosSettingsProtectionMode `json:"protectionMode,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_delegation.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_delegation.go deleted file mode 100644 index 9a088e2a507..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_delegation.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Delegation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceDelegationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go deleted file mode 100644 index ffa39b22711..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrule.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExclusionManagedRule struct { - RuleId string `json:"ruleId"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go deleted file mode 100644 index 29d30ef6bc1..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedrulegroup.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExclusionManagedRuleGroup struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]ExclusionManagedRule `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go deleted file mode 100644 index cb569797cec..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_exclusionmanagedruleset.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExclusionManagedRuleSet struct { - RuleGroups *[]ExclusionManagedRuleGroup `json:"ruleGroups,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlog.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlog.go deleted file mode 100644 index 36d32c9316a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlog.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLog struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FlowLogPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go deleted file mode 100644 index 8e97873a7c3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogformatparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogFormatParameters struct { - Type *FlowLogFormatType `json:"type,omitempty"` - Version *int64 `json:"version,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go deleted file mode 100644 index 9e90fd9cd8a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_flowlogpropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FlowLogPropertiesFormat struct { - Enabled *bool `json:"enabled,omitempty"` - FlowAnalyticsConfiguration *TrafficAnalyticsProperties `json:"flowAnalyticsConfiguration,omitempty"` - Format *FlowLogFormatParameters `json:"format,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RetentionPolicy *RetentionPolicyParameters `json:"retentionPolicy,omitempty"` - StorageId string `json:"storageId"` - TargetResourceGuid *string `json:"targetResourceGuid,omitempty"` - TargetResourceId string `json:"targetResourceId"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go deleted file mode 100644 index 717217cc3a2..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfiguration.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -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 FrontendIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *FrontendIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go deleted file mode 100644 index 4f11b119df9..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_frontendipconfigurationpropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FrontendIPConfigurationPropertiesFormat struct { - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - InboundNatPools *[]SubResource `json:"inboundNatPools,omitempty"` - InboundNatRules *[]SubResource `json:"inboundNatRules,omitempty"` - LoadBalancingRules *[]SubResource `json:"loadBalancingRules,omitempty"` - OutboundRules *[]SubResource `json:"outboundRules,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go deleted file mode 100644 index 698c1c6a1b4..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_gatewayloadbalancertunnelinterface.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GatewayLoadBalancerTunnelInterface struct { - Identifier *int64 `json:"identifier,omitempty"` - Port *int64 `json:"port,omitempty"` - Protocol *GatewayLoadBalancerTunnelProtocol `json:"protocol,omitempty"` - Type *GatewayLoadBalancerTunnelInterfaceType `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyusersession.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyusersession.go deleted file mode 100644 index 5995831381a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyusersession.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupByUserSession struct { - GroupByVariables []GroupByVariable `json:"groupByVariables"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyvariable.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyvariable.go deleted file mode 100644 index 132602a8758..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_groupbyvariable.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupByVariable struct { - VariableName ApplicationGatewayFirewallUserSessionVariable `json:"variableName"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrule.go deleted file mode 100644 index f9908a65135..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InboundNatRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go deleted file mode 100644 index 2ed26d6a6d0..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_inboundnatrulepropertiesformat.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InboundNatRulePropertiesFormat struct { - BackendAddressPool *SubResource `json:"backendAddressPool,omitempty"` - BackendIPConfiguration *NetworkInterfaceIPConfiguration `json:"backendIPConfiguration,omitempty"` - BackendPort *int64 `json:"backendPort,omitempty"` - EnableFloatingIP *bool `json:"enableFloatingIP,omitempty"` - EnableTcpReset *bool `json:"enableTcpReset,omitempty"` - FrontendIPConfiguration *SubResource `json:"frontendIPConfiguration,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - FrontendPortRangeEnd *int64 `json:"frontendPortRangeEnd,omitempty"` - FrontendPortRangeStart *int64 `json:"frontendPortRangeStart,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - Protocol *TransportProtocol `json:"protocol,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfiguration.go deleted file mode 100644 index ee1ee9f9ce3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go deleted file mode 100644 index 4467a251182..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofile.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfile struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IPConfigurationProfilePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go deleted file mode 100644 index 4746cb9a921..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationprofilepropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationProfilePropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go deleted file mode 100644 index 6455af984df..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_ipconfigurationpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPConfigurationPropertiesFormat struct { - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_iptag.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_iptag.go deleted file mode 100644 index da603122799..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_iptag.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// 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/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go deleted file mode 100644 index 07977c08269..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddress.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddress struct { - Name *string `json:"name,omitempty"` - Properties *LoadBalancerBackendAddressPropertiesFormat `json:"properties,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go deleted file mode 100644 index ca60fdf8735..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_loadbalancerbackendaddresspropertiesformat.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LoadBalancerBackendAddressPropertiesFormat struct { - AdminState *LoadBalancerBackendAddressAdminState `json:"adminState,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - InboundNatRulesPortMapping *[]NatRulePortMapping `json:"inboundNatRulesPortMapping,omitempty"` - LoadBalancerFrontendIPConfiguration *SubResource `json:"loadBalancerFrontendIPConfiguration,omitempty"` - NetworkInterfaceIPConfiguration *SubResource `json:"networkInterfaceIPConfiguration,omitempty"` - Subnet *SubResource `json:"subnet,omitempty"` - VirtualNetwork *SubResource `json:"virtualNetwork,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go deleted file mode 100644 index 2810e8e0e4d..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulegroupoverride.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRuleGroupOverride struct { - RuleGroupName string `json:"ruleGroupName"` - Rules *[]ManagedRuleOverride `json:"rules,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleoverride.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleoverride.go deleted file mode 100644 index c6f8a500e23..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleoverride.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRuleOverride struct { - Action *ActionType `json:"action,omitempty"` - RuleId string `json:"ruleId"` - State *ManagedRuleEnabledState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go deleted file mode 100644 index 720824c2670..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedrulesdefinition.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRulesDefinition struct { - Exclusions *[]OwaspCrsExclusionEntry `json:"exclusions,omitempty"` - ManagedRuleSets []ManagedRuleSet `json:"managedRuleSets"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleset.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleset.go deleted file mode 100644 index 2bbf971c792..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_managedruleset.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManagedRuleSet struct { - RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` - RuleSetType string `json:"ruleSetType"` - RuleSetVersion string `json:"ruleSetVersion"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchcondition.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchcondition.go deleted file mode 100644 index c8d3e722c75..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchcondition.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MatchCondition struct { - MatchValues []string `json:"matchValues"` - MatchVariables []MatchVariable `json:"matchVariables"` - NegationConditon *bool `json:"negationConditon,omitempty"` - Operator WebApplicationFirewallOperator `json:"operator"` - Transforms *[]WebApplicationFirewallTransform `json:"transforms,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchvariable.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchvariable.go deleted file mode 100644 index bd0473317b2..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_matchvariable.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MatchVariable struct { - Selector *string `json:"selector,omitempty"` - VariableName WebApplicationFirewallMatchVariable `json:"variableName"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgateway.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgateway.go deleted file mode 100644 index 4a594a57232..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgateway.go +++ /dev/null @@ -1,20 +0,0 @@ -package webapplicationfirewallpolicies - -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 NatGateway struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NatGatewayPropertiesFormat `json:"properties,omitempty"` - Sku *NatGatewaySku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go deleted file mode 100644 index 30e0ed98075..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewayPropertiesFormat struct { - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddresses *[]SubResource `json:"publicIpAddresses,omitempty"` - PublicIPPrefixes *[]SubResource `json:"publicIpPrefixes,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Subnets *[]SubResource `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaysku.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaysku.go deleted file mode 100644 index 01f9595dd47..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natgatewaysku.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatGatewaySku struct { - Name *NatGatewaySkuName `json:"name,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natruleportmapping.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natruleportmapping.go deleted file mode 100644 index 636fb66e30f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_natruleportmapping.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NatRulePortMapping struct { - BackendPort *int64 `json:"backendPort,omitempty"` - FrontendPort *int64 `json:"frontendPort,omitempty"` - InboundNatRuleName *string `json:"inboundNatRuleName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterface.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterface.go deleted file mode 100644 index 5f43f78eff1..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterface.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterface struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfacePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go deleted file mode 100644 index 2d9f1326e9a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacednssettings.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceDnsSettings struct { - AppliedDnsServers *[]string `json:"appliedDnsServers,omitempty"` - DnsServers *[]string `json:"dnsServers,omitempty"` - InternalDnsNameLabel *string `json:"internalDnsNameLabel,omitempty"` - InternalDomainNameSuffix *string `json:"internalDomainNameSuffix,omitempty"` - InternalFqdn *string `json:"internalFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go deleted file mode 100644 index 80650073a43..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceIPConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go deleted file mode 100644 index ed9c49c6aa3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationprivatelinkconnectionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties struct { - Fqdns *[]string `json:"fqdns,omitempty"` - GroupId *string `json:"groupId,omitempty"` - RequiredMemberName *string `json:"requiredMemberName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go deleted file mode 100644 index 244007a3148..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfaceipconfigurationpropertiesformat.go +++ /dev/null @@ -1,21 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceIPConfigurationPropertiesFormat struct { - ApplicationGatewayBackendAddressPools *[]ApplicationGatewayBackendAddressPool `json:"applicationGatewayBackendAddressPools,omitempty"` - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - GatewayLoadBalancer *SubResource `json:"gatewayLoadBalancer,omitempty"` - LoadBalancerBackendAddressPools *[]BackendAddressPool `json:"loadBalancerBackendAddressPools,omitempty"` - LoadBalancerInboundNatRules *[]InboundNatRule `json:"loadBalancerInboundNatRules,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - PrivateLinkConnectionProperties *NetworkInterfaceIPConfigurationPrivateLinkConnectionProperties `json:"privateLinkConnectionProperties,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddress *PublicIPAddress `json:"publicIPAddress,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` - VirtualNetworkTaps *[]VirtualNetworkTap `json:"virtualNetworkTaps,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go deleted file mode 100644 index e24f37ad4e4..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacepropertiesformat.go +++ /dev/null @@ -1,29 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfacePropertiesFormat struct { - AuxiliaryMode *NetworkInterfaceAuxiliaryMode `json:"auxiliaryMode,omitempty"` - AuxiliarySku *NetworkInterfaceAuxiliarySku `json:"auxiliarySku,omitempty"` - DisableTcpStateTracking *bool `json:"disableTcpStateTracking,omitempty"` - DnsSettings *NetworkInterfaceDnsSettings `json:"dnsSettings,omitempty"` - DscpConfiguration *SubResource `json:"dscpConfiguration,omitempty"` - EnableAcceleratedNetworking *bool `json:"enableAcceleratedNetworking,omitempty"` - EnableIPForwarding *bool `json:"enableIPForwarding,omitempty"` - HostedWorkloads *[]string `json:"hostedWorkloads,omitempty"` - IPConfigurations *[]NetworkInterfaceIPConfiguration `json:"ipConfigurations,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - MigrationPhase *NetworkInterfaceMigrationPhase `json:"migrationPhase,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - NicType *NetworkInterfaceNicType `json:"nicType,omitempty"` - Primary *bool `json:"primary,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkService *PrivateLinkService `json:"privateLinkService,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - TapConfigurations *[]NetworkInterfaceTapConfiguration `json:"tapConfigurations,omitempty"` - VirtualMachine *SubResource `json:"virtualMachine,omitempty"` - VnetEncryptionSupported *bool `json:"vnetEncryptionSupported,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go deleted file mode 100644 index 559fab4512d..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkInterfaceTapConfigurationPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go deleted file mode 100644 index d28ce56ff99..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networkinterfacetapconfigurationpropertiesformat.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkInterfaceTapConfigurationPropertiesFormat struct { - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - VirtualNetworkTap *VirtualNetworkTap `json:"virtualNetworkTap,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygroup.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygroup.go deleted file mode 100644 index 7edb20a30eb..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygroup.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroup struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *NetworkSecurityGroupPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go deleted file mode 100644 index 63dfb0a3753..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_networksecuritygrouppropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NetworkSecurityGroupPropertiesFormat struct { - DefaultSecurityRules *[]SecurityRule `json:"defaultSecurityRules,omitempty"` - FlowLogs *[]FlowLog `json:"flowLogs,omitempty"` - FlushConnection *bool `json:"flushConnection,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - SecurityRules *[]SecurityRule `json:"securityRules,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go deleted file mode 100644 index 447c5ce3185..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_owaspcrsexclusionentry.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OwaspCrsExclusionEntry struct { - ExclusionManagedRuleSets *[]ExclusionManagedRuleSet `json:"exclusionManagedRuleSets,omitempty"` - MatchVariable OwaspCrsExclusionEntryMatchVariable `json:"matchVariable"` - Selector string `json:"selector"` - SelectorMatchOperator OwaspCrsExclusionEntrySelectorMatchOperator `json:"selectorMatchOperator"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettings.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettings.go deleted file mode 100644 index ad2543067d3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettings.go +++ /dev/null @@ -1,18 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PolicySettings struct { - CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` - CustomBlockResponseStatusCode *int64 `json:"customBlockResponseStatusCode,omitempty"` - FileUploadEnforcement *bool `json:"fileUploadEnforcement,omitempty"` - FileUploadLimitInMb *int64 `json:"fileUploadLimitInMb,omitempty"` - LogScrubbing *PolicySettingsLogScrubbing `json:"logScrubbing,omitempty"` - MaxRequestBodySizeInKb *int64 `json:"maxRequestBodySizeInKb,omitempty"` - Mode *WebApplicationFirewallMode `json:"mode,omitempty"` - RequestBodyCheck *bool `json:"requestBodyCheck,omitempty"` - RequestBodyEnforcement *bool `json:"requestBodyEnforcement,omitempty"` - RequestBodyInspectLimitInKB *int64 `json:"requestBodyInspectLimitInKB,omitempty"` - State *WebApplicationFirewallEnabledState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go deleted file mode 100644 index a97418be867..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_policysettingslogscrubbing.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PolicySettingsLogScrubbing struct { - ScrubbingRules *[]WebApplicationFirewallScrubbingRules `json:"scrubbingRules,omitempty"` - State *WebApplicationFirewallScrubbingState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpoint.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpoint.go deleted file mode 100644 index aabcb4ef384..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpoint.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// 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 { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnection.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnection.go deleted file mode 100644 index c66bc0045c7..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - Etag *string `json:"etag,omitempty"` - 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/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go deleted file mode 100644 index dbd38c8e4ca..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - LinkIdentifier *string `json:"linkIdentifier,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateEndpointLocation *string `json:"privateEndpointLocation,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go deleted file mode 100644 index 86f24c803d3..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go deleted file mode 100644 index f40d8cf2be4..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointipconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointIPConfigurationProperties struct { - GroupId *string `json:"groupId,omitempty"` - MemberName *string `json:"memberName,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointproperties.go deleted file mode 100644 index 93cab138813..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privateendpointproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointProperties struct { - ApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"applicationSecurityGroups,omitempty"` - CustomDnsConfigs *[]CustomDnsConfigPropertiesFormat `json:"customDnsConfigs,omitempty"` - CustomNetworkInterfaceName *string `json:"customNetworkInterfaceName,omitempty"` - IPConfigurations *[]PrivateEndpointIPConfiguration `json:"ipConfigurations,omitempty"` - ManualPrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateLinkServiceConnections *[]PrivateLinkServiceConnection `json:"privateLinkServiceConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkservice.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkservice.go deleted file mode 100644 index 8b8ffdc399e..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkservice.go +++ /dev/null @@ -1,19 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkService struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go deleted file mode 100644 index ac293dace51..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnection.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnection struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceConnectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go deleted file mode 100644 index 164ef869982..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceConnectionProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - PrivateLinkServiceId *string `json:"privateLinkServiceId,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - RequestMessage *string `json:"requestMessage,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index 3ea66cb9940..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *string `json:"status,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go deleted file mode 100644 index 7d17f466192..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfiguration.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfiguration struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkServiceIPConfigurationProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go deleted file mode 100644 index 814df952c03..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceipconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceIPConfigurationProperties struct { - Primary *bool `json:"primary,omitempty"` - PrivateIPAddress *string `json:"privateIPAddress,omitempty"` - PrivateIPAddressVersion *IPVersion `json:"privateIPAddressVersion,omitempty"` - PrivateIPAllocationMethod *IPAllocationMethod `json:"privateIPAllocationMethod,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Subnet *Subnet `json:"subnet,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go deleted file mode 100644 index c58556d385c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_privatelinkserviceproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkServiceProperties struct { - Alias *string `json:"alias,omitempty"` - AutoApproval *ResourceSet `json:"autoApproval,omitempty"` - EnableProxyProtocol *bool `json:"enableProxyProtocol,omitempty"` - Fqdns *[]string `json:"fqdns,omitempty"` - IPConfigurations *[]PrivateLinkServiceIPConfiguration `json:"ipConfigurations,omitempty"` - LoadBalancerFrontendIPConfigurations *[]FrontendIPConfiguration `json:"loadBalancerFrontendIpConfigurations,omitempty"` - NetworkInterfaces *[]NetworkInterface `json:"networkInterfaces,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Visibility *ResourceSet `json:"visibility,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddress.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddress.go deleted file mode 100644 index 6f2116661f4..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddress.go +++ /dev/null @@ -1,22 +0,0 @@ -package webapplicationfirewallpolicies - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/edgezones" - "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 PublicIPAddress struct { - Etag *string `json:"etag,omitempty"` - ExtendedLocation *edgezones.Model `json:"extendedLocation,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PublicIPAddressPropertiesFormat `json:"properties,omitempty"` - Sku *PublicIPAddressSku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go deleted file mode 100644 index c122bbf9d00..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddressdnssettings.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressDnsSettings struct { - DomainNameLabel *string `json:"domainNameLabel,omitempty"` - DomainNameLabelScope *PublicIPAddressDnsSettingsDomainNameLabelScope `json:"domainNameLabelScope,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - ReverseFqdn *string `json:"reverseFqdn,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go deleted file mode 100644 index 76e237783ef..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresspropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressPropertiesFormat struct { - DdosSettings *DdosSettings `json:"ddosSettings,omitempty"` - DeleteOption *DeleteOptions `json:"deleteOption,omitempty"` - DnsSettings *PublicIPAddressDnsSettings `json:"dnsSettings,omitempty"` - IPAddress *string `json:"ipAddress,omitempty"` - IPConfiguration *IPConfiguration `json:"ipConfiguration,omitempty"` - IPTags *[]IPTag `json:"ipTags,omitempty"` - IdleTimeoutInMinutes *int64 `json:"idleTimeoutInMinutes,omitempty"` - LinkedPublicIPAddress *PublicIPAddress `json:"linkedPublicIPAddress,omitempty"` - MigrationPhase *PublicIPAddressMigrationPhase `json:"migrationPhase,omitempty"` - NatGateway *NatGateway `json:"natGateway,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - PublicIPAddressVersion *IPVersion `json:"publicIPAddressVersion,omitempty"` - PublicIPAllocationMethod *IPAllocationMethod `json:"publicIPAllocationMethod,omitempty"` - PublicIPPrefix *SubResource `json:"publicIPPrefix,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServicePublicIPAddress *PublicIPAddress `json:"servicePublicIPAddress,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresssku.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresssku.go deleted file mode 100644 index 1b8495a46b0..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_publicipaddresssku.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PublicIPAddressSku struct { - Name *PublicIPAddressSkuName `json:"name,omitempty"` - Tier *PublicIPAddressSkuTier `json:"tier,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go deleted file mode 100644 index 8cf0d6ae754..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ResourceNavigationLinkFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go deleted file mode 100644 index cfc65feb648..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourcenavigationlinkformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceNavigationLinkFormat struct { - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourceset.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourceset.go deleted file mode 100644 index 7bd3ff7ff53..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_resourceset.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceSet struct { - Subscriptions *[]string `json:"subscriptions,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go deleted file mode 100644 index 700cf48fcef..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_retentionpolicyparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RetentionPolicyParameters struct { - Days *int64 `json:"days,omitempty"` - Enabled *bool `json:"enabled,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_route.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_route.go deleted file mode 100644 index 854dbcba973..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_route.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Route struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoutePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routepropertiesformat.go deleted file mode 100644 index 65879ed15ad..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoutePropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - HasBgpOverride *bool `json:"hasBgpOverride,omitempty"` - NextHopIPAddress *string `json:"nextHopIpAddress,omitempty"` - NextHopType RouteNextHopType `json:"nextHopType"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetable.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetable.go deleted file mode 100644 index 73fdbc844dc..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetable.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTable struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RouteTablePropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go deleted file mode 100644 index f7082dd7d4a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_routetablepropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RouteTablePropertiesFormat struct { - DisableBgpRoutePropagation *bool `json:"disableBgpRoutePropagation,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - Routes *[]Route `json:"routes,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrule.go deleted file mode 100644 index 9a8c2e557c7..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrule.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityRulePropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go deleted file mode 100644 index d40d084432c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_securityrulepropertiesformat.go +++ /dev/null @@ -1,23 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityRulePropertiesFormat struct { - Access SecurityRuleAccess `json:"access"` - Description *string `json:"description,omitempty"` - DestinationAddressPrefix *string `json:"destinationAddressPrefix,omitempty"` - DestinationAddressPrefixes *[]string `json:"destinationAddressPrefixes,omitempty"` - DestinationApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"destinationApplicationSecurityGroups,omitempty"` - DestinationPortRange *string `json:"destinationPortRange,omitempty"` - DestinationPortRanges *[]string `json:"destinationPortRanges,omitempty"` - Direction SecurityRuleDirection `json:"direction"` - Priority int64 `json:"priority"` - Protocol SecurityRuleProtocol `json:"protocol"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - SourceAddressPrefix *string `json:"sourceAddressPrefix,omitempty"` - SourceAddressPrefixes *[]string `json:"sourceAddressPrefixes,omitempty"` - SourceApplicationSecurityGroups *[]ApplicationSecurityGroup `json:"sourceApplicationSecurityGroups,omitempty"` - SourcePortRange *string `json:"sourcePortRange,omitempty"` - SourcePortRanges *[]string `json:"sourcePortRanges,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlink.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlink.go deleted file mode 100644 index 9f75aeaec5b..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlink.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLink struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceAssociationLinkPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go deleted file mode 100644 index abae149b764..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceassociationlinkpropertiesformat.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceAssociationLinkPropertiesFormat struct { - AllowDelete *bool `json:"allowDelete,omitempty"` - Link *string `json:"link,omitempty"` - LinkedResourceType *string `json:"linkedResourceType,omitempty"` - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go deleted file mode 100644 index 160d9aebc9f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_servicedelegationpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceDelegationPropertiesFormat struct { - Actions *[]string `json:"actions,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ServiceName *string `json:"serviceName,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go deleted file mode 100644 index ae5e0fd396a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicy.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Kind *string `json:"kind,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go deleted file mode 100644 index ac60c21f09b..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinition.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinition struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServiceEndpointPolicyDefinitionPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go deleted file mode 100644 index 34679603f3a..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicydefinitionpropertiesformat.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyDefinitionPropertiesFormat struct { - Description *string `json:"description,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` - ServiceResources *[]string `json:"serviceResources,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go deleted file mode 100644 index aa5effcc158..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpolicypropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPolicyPropertiesFormat struct { - ContextualServiceEndpointPolicies *[]string `json:"contextualServiceEndpointPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` - ServiceAlias *string `json:"serviceAlias,omitempty"` - ServiceEndpointPolicyDefinitions *[]ServiceEndpointPolicyDefinition `json:"serviceEndpointPolicyDefinitions,omitempty"` - Subnets *[]Subnet `json:"subnets,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go deleted file mode 100644 index 03e37bc11f8..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_serviceendpointpropertiesformat.go +++ /dev/null @@ -1,10 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServiceEndpointPropertiesFormat struct { - Locations *[]string `json:"locations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Service *string `json:"service,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnet.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnet.go deleted file mode 100644 index 22ae6378be5..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnet.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Subnet struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SubnetPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go deleted file mode 100644 index a3dc0aaf42f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subnetpropertiesformat.go +++ /dev/null @@ -1,27 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubnetPropertiesFormat struct { - AddressPrefix *string `json:"addressPrefix,omitempty"` - AddressPrefixes *[]string `json:"addressPrefixes,omitempty"` - ApplicationGatewayIPConfigurations *[]ApplicationGatewayIPConfiguration `json:"applicationGatewayIPConfigurations,omitempty"` - DefaultOutboundAccess *bool `json:"defaultOutboundAccess,omitempty"` - Delegations *[]Delegation `json:"delegations,omitempty"` - IPAllocations *[]SubResource `json:"ipAllocations,omitempty"` - IPConfigurationProfiles *[]IPConfigurationProfile `json:"ipConfigurationProfiles,omitempty"` - IPConfigurations *[]IPConfiguration `json:"ipConfigurations,omitempty"` - NatGateway *SubResource `json:"natGateway,omitempty"` - NetworkSecurityGroup *NetworkSecurityGroup `json:"networkSecurityGroup,omitempty"` - PrivateEndpointNetworkPolicies *VirtualNetworkPrivateEndpointNetworkPolicies `json:"privateEndpointNetworkPolicies,omitempty"` - PrivateEndpoints *[]PrivateEndpoint `json:"privateEndpoints,omitempty"` - PrivateLinkServiceNetworkPolicies *VirtualNetworkPrivateLinkServiceNetworkPolicies `json:"privateLinkServiceNetworkPolicies,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - Purpose *string `json:"purpose,omitempty"` - ResourceNavigationLinks *[]ResourceNavigationLink `json:"resourceNavigationLinks,omitempty"` - RouteTable *RouteTable `json:"routeTable,omitempty"` - ServiceAssociationLinks *[]ServiceAssociationLink `json:"serviceAssociationLinks,omitempty"` - ServiceEndpointPolicies *[]ServiceEndpointPolicy `json:"serviceEndpointPolicies,omitempty"` - ServiceEndpoints *[]ServiceEndpointPropertiesFormat `json:"serviceEndpoints,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subresource.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subresource.go deleted file mode 100644 index f80e970be83..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_subresource.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SubResource struct { - Id *string `json:"id,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go deleted file mode 100644 index fd4b0e7ec17..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsconfigurationproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsConfigurationProperties struct { - Enabled *bool `json:"enabled,omitempty"` - TrafficAnalyticsInterval *int64 `json:"trafficAnalyticsInterval,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` - WorkspaceRegion *string `json:"workspaceRegion,omitempty"` - WorkspaceResourceId *string `json:"workspaceResourceId,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go deleted file mode 100644 index 872500d56bf..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_trafficanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TrafficAnalyticsProperties struct { - NetworkWatcherFlowAnalyticsConfiguration *TrafficAnalyticsConfigurationProperties `json:"networkWatcherFlowAnalyticsConfiguration,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktap.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktap.go deleted file mode 100644 index e2de0ca881d..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktap.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTap struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VirtualNetworkTapPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go deleted file mode 100644 index 418d09be371..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_virtualnetworktappropertiesformat.go +++ /dev/null @@ -1,13 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VirtualNetworkTapPropertiesFormat struct { - DestinationLoadBalancerFrontEndIPConfiguration *FrontendIPConfiguration `json:"destinationLoadBalancerFrontEndIPConfiguration,omitempty"` - DestinationNetworkInterfaceIPConfiguration *NetworkInterfaceIPConfiguration `json:"destinationNetworkInterfaceIPConfiguration,omitempty"` - DestinationPort *int64 `json:"destinationPort,omitempty"` - NetworkInterfaceTapConfigurations *[]NetworkInterfaceTapConfiguration `json:"networkInterfaceTapConfigurations,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceGuid *string `json:"resourceGuid,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go deleted file mode 100644 index c66c1257253..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallcustomrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallCustomRule struct { - Action WebApplicationFirewallAction `json:"action"` - Etag *string `json:"etag,omitempty"` - GroupByUserSession *[]GroupByUserSession `json:"groupByUserSession,omitempty"` - MatchConditions []MatchCondition `json:"matchConditions"` - Name *string `json:"name,omitempty"` - Priority int64 `json:"priority"` - RateLimitDuration *ApplicationGatewayFirewallRateLimitDuration `json:"rateLimitDuration,omitempty"` - RateLimitThreshold *int64 `json:"rateLimitThreshold,omitempty"` - RuleType WebApplicationFirewallRuleType `json:"ruleType"` - State *WebApplicationFirewallState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go deleted file mode 100644 index c79f926a28c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicy.go +++ /dev/null @@ -1,14 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallPolicy struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WebApplicationFirewallPolicyPropertiesFormat `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go deleted file mode 100644 index 0c43a36d2a8..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallpolicypropertiesformat.go +++ /dev/null @@ -1,15 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallPolicyPropertiesFormat struct { - ApplicationGateways *[]ApplicationGateway `json:"applicationGateways,omitempty"` - CustomRules *[]WebApplicationFirewallCustomRule `json:"customRules,omitempty"` - HTTPListeners *[]SubResource `json:"httpListeners,omitempty"` - ManagedRules ManagedRulesDefinition `json:"managedRules"` - PathBasedRules *[]SubResource `json:"pathBasedRules,omitempty"` - PolicySettings *PolicySettings `json:"policySettings,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` - ResourceState *WebApplicationFirewallPolicyResourceState `json:"resourceState,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go deleted file mode 100644 index b3d3f6dd209..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/model_webapplicationfirewallscrubbingrules.go +++ /dev/null @@ -1,11 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallScrubbingRules struct { - MatchVariable ScrubbingRuleEntryMatchVariable `json:"matchVariable"` - Selector *string `json:"selector,omitempty"` - SelectorMatchOperator ScrubbingRuleEntryMatchOperator `json:"selectorMatchOperator"` - State *ScrubbingRuleEntryState `json:"state,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/predicates.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/predicates.go deleted file mode 100644 index a7973b0a14f..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package webapplicationfirewallpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WebApplicationFirewallPolicyOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p WebApplicationFirewallPolicyOperationPredicate) Matches(input WebApplicationFirewallPolicy) 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 && (input.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/network/2023-06-01/webapplicationfirewallpolicies/version.go b/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/version.go deleted file mode 100644 index d10058bc91c..00000000000 --- a/resource-manager/network/2023-06-01/webapplicationfirewallpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webapplicationfirewallpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webapplicationfirewallpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/network/2023-06-01/webcategories/README.md b/resource-manager/network/2023-06-01/webcategories/README.md deleted file mode 100644 index 0f74ffd88d8..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/network/2023-06-01/webcategories` Documentation - -The `webcategories` SDK allows for interaction with the Azure Resource Manager Service `network` (API Version `2023-06-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/network/2023-06-01/webcategories" -``` - - -### Client Initialization - -```go -client := webcategories.NewWebCategoriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WebCategoriesClient.Get` - -```go -ctx := context.TODO() -id := webcategories.NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue") - -read, err := client.Get(ctx, id, webcategories.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `WebCategoriesClient.ListBySubscription` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscription(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/network/2023-06-01/webcategories/client.go b/resource-manager/network/2023-06-01/webcategories/client.go deleted file mode 100644 index 075aa15b06b..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package webcategories - -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 WebCategoriesClient struct { - Client *resourcemanager.Client -} - -func NewWebCategoriesClientWithBaseURI(sdkApi sdkEnv.Api) (*WebCategoriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "webcategories", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WebCategoriesClient: %+v", err) - } - - return &WebCategoriesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/network/2023-06-01/webcategories/id_azurewebcategory.go b/resource-manager/network/2023-06-01/webcategories/id_azurewebcategory.go deleted file mode 100644 index 1417d2f6d85..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/id_azurewebcategory.go +++ /dev/null @@ -1,121 +0,0 @@ -package webcategories - -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(&AzureWebCategoryId{}) -} - -var _ resourceids.ResourceId = &AzureWebCategoryId{} - -// AzureWebCategoryId is a struct representing the Resource ID for a Azure Web Category -type AzureWebCategoryId struct { - SubscriptionId string - AzureWebCategoryName string -} - -// NewAzureWebCategoryID returns a new AzureWebCategoryId struct -func NewAzureWebCategoryID(subscriptionId string, azureWebCategoryName string) AzureWebCategoryId { - return AzureWebCategoryId{ - SubscriptionId: subscriptionId, - AzureWebCategoryName: azureWebCategoryName, - } -} - -// ParseAzureWebCategoryID parses 'input' into a AzureWebCategoryId -func ParseAzureWebCategoryID(input string) (*AzureWebCategoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureWebCategoryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureWebCategoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAzureWebCategoryIDInsensitively parses 'input' case-insensitively into a AzureWebCategoryId -// note: this method should only be used for API response data and not user input -func ParseAzureWebCategoryIDInsensitively(input string) (*AzureWebCategoryId, error) { - parser := resourceids.NewParserFromResourceIdType(&AzureWebCategoryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AzureWebCategoryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AzureWebCategoryId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.AzureWebCategoryName, ok = input.Parsed["azureWebCategoryName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "azureWebCategoryName", input) - } - - return nil -} - -// ValidateAzureWebCategoryID checks that 'input' can be parsed as a Azure Web Category ID -func ValidateAzureWebCategoryID(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 := ParseAzureWebCategoryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Azure Web Category ID -func (id AzureWebCategoryId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Network/azureWebCategories/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.AzureWebCategoryName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Azure Web Category ID -func (id AzureWebCategoryId) 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("staticMicrosoftNetwork", "Microsoft.Network", "Microsoft.Network"), - resourceids.StaticSegment("staticAzureWebCategories", "azureWebCategories", "azureWebCategories"), - resourceids.UserSpecifiedSegment("azureWebCategoryName", "azureWebCategoryValue"), - } -} - -// String returns a human-readable description of this Azure Web Category ID -func (id AzureWebCategoryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Azure Web Category Name: %q", id.AzureWebCategoryName), - } - return fmt.Sprintf("Azure Web Category (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/network/2023-06-01/webcategories/id_azurewebcategory_test.go b/resource-manager/network/2023-06-01/webcategories/id_azurewebcategory_test.go deleted file mode 100644 index ba8e348767d..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/id_azurewebcategory_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package webcategories - -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 = &AzureWebCategoryId{} - -func TestNewAzureWebCategoryID(t *testing.T) { - id := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue") - - 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.AzureWebCategoryName != "azureWebCategoryValue" { - t.Fatalf("Expected %q but got %q for Segment 'AzureWebCategoryName'", id.AzureWebCategoryName, "azureWebCategoryValue") - } -} - -func TestFormatAzureWebCategoryID(t *testing.T) { - actual := NewAzureWebCategoryID("12345678-1234-9876-4563-123456789012", "azureWebCategoryValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAzureWebCategoryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureWebCategoryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue", - Expected: &AzureWebCategoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "azureWebCategoryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureWebCategoryID(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.AzureWebCategoryName != v.Expected.AzureWebCategoryName { - t.Fatalf("Expected %q but got %q for AzureWebCategoryName", v.Expected.AzureWebCategoryName, actual.AzureWebCategoryName) - } - - } -} - -func TestParseAzureWebCategoryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AzureWebCategoryId - }{ - { - // 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.Network", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue", - Expected: &AzureWebCategoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "azureWebCategoryValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Network/azureWebCategories/azureWebCategoryValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYvAlUe", - Expected: &AzureWebCategoryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AzureWebCategoryName: "aZuReWeBcAtEgOrYvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.nEtWoRk/aZuReWeBcAtEgOrIeS/aZuReWeBcAtEgOrYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAzureWebCategoryIDInsensitively(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.AzureWebCategoryName != v.Expected.AzureWebCategoryName { - t.Fatalf("Expected %q but got %q for AzureWebCategoryName", v.Expected.AzureWebCategoryName, actual.AzureWebCategoryName) - } - - } -} - -func TestSegmentsForAzureWebCategoryId(t *testing.T) { - segments := AzureWebCategoryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AzureWebCategoryId 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/network/2023-06-01/webcategories/method_get.go b/resource-manager/network/2023-06-01/webcategories/method_get.go deleted file mode 100644 index 9038c189875..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/method_get.go +++ /dev/null @@ -1,83 +0,0 @@ -package webcategories - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AzureWebCategory -} - -type GetOperationOptions struct { - Expand *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o GetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o GetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - return &out -} - -// Get ... -func (c WebCategoriesClient) Get(ctx context.Context, id AzureWebCategoryId, options GetOperationOptions) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: id.ID(), - OptionsObject: options, - } - - 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 AzureWebCategory - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/network/2023-06-01/webcategories/method_listbysubscription.go b/resource-manager/network/2023-06-01/webcategories/method_listbysubscription.go deleted file mode 100644 index 6437d9e3bea..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/method_listbysubscription.go +++ /dev/null @@ -1,92 +0,0 @@ -package webcategories - -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 ListBySubscriptionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]AzureWebCategory -} - -type ListBySubscriptionCompleteResult struct { - LatestHttpResponse *http.Response - Items []AzureWebCategory -} - -// ListBySubscription ... -func (c WebCategoriesClient) ListBySubscription(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Network/azureWebCategories", 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 *[]AzureWebCategory `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionComplete retrieves all the results into a single object -func (c WebCategoriesClient) ListBySubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionCompleteResult, error) { - return c.ListBySubscriptionCompleteMatchingPredicate(ctx, id, AzureWebCategoryOperationPredicate{}) -} - -// ListBySubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WebCategoriesClient) ListBySubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AzureWebCategoryOperationPredicate) (result ListBySubscriptionCompleteResult, err error) { - items := make([]AzureWebCategory, 0) - - resp, err := c.ListBySubscription(ctx, id) - if err != nil { - 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 = ListBySubscriptionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/network/2023-06-01/webcategories/model_azurewebcategory.go b/resource-manager/network/2023-06-01/webcategories/model_azurewebcategory.go deleted file mode 100644 index 81fe8aa1777..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/model_azurewebcategory.go +++ /dev/null @@ -1,12 +0,0 @@ -package webcategories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWebCategory struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AzureWebCategoryPropertiesFormat `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webcategories/model_azurewebcategorypropertiesformat.go b/resource-manager/network/2023-06-01/webcategories/model_azurewebcategorypropertiesformat.go deleted file mode 100644 index 7e327867064..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/model_azurewebcategorypropertiesformat.go +++ /dev/null @@ -1,8 +0,0 @@ -package webcategories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWebCategoryPropertiesFormat struct { - Group *string `json:"group,omitempty"` -} diff --git a/resource-manager/network/2023-06-01/webcategories/predicates.go b/resource-manager/network/2023-06-01/webcategories/predicates.go deleted file mode 100644 index ab82b0c92b5..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package webcategories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWebCategoryOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AzureWebCategoryOperationPredicate) Matches(input AzureWebCategory) 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.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/network/2023-06-01/webcategories/version.go b/resource-manager/network/2023-06-01/webcategories/version.go deleted file mode 100644 index b4f147427e7..00000000000 --- a/resource-manager/network/2023-06-01/webcategories/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package webcategories - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/webcategories/%s", defaultApiVersion) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/client.go deleted file mode 100644 index 0b16390dc09..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/client.go +++ /dev/null @@ -1,73 +0,0 @@ -package v2020_10_05_privatepreview - -// 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/postgresqlhsc/2020-10-05-privatepreview/configurations" - "github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles" - "github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations" - "github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Configurations *configurations.ConfigurationsClient - FirewallRules *firewallrules.FirewallRulesClient - Roles *roles.RolesClient - ServerGroupOperations *servergroupoperations.ServerGroupOperationsClient - ServerGroups *servergroups.ServerGroupsClient - Servers *servers.ServersClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - configurationsClient, err := configurations.NewConfigurationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Configurations client: %+v", err) - } - configureFunc(configurationsClient.Client) - - firewallRulesClient, err := firewallrules.NewFirewallRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building FirewallRules client: %+v", err) - } - configureFunc(firewallRulesClient.Client) - - rolesClient, err := roles.NewRolesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Roles client: %+v", err) - } - configureFunc(rolesClient.Client) - - serverGroupOperationsClient, err := servergroupoperations.NewServerGroupOperationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServerGroupOperations client: %+v", err) - } - configureFunc(serverGroupOperationsClient.Client) - - serverGroupsClient, err := servergroups.NewServerGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ServerGroups client: %+v", err) - } - configureFunc(serverGroupsClient.Client) - - serversClient, err := servers.NewServersClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Servers client: %+v", err) - } - configureFunc(serversClient.Client) - - return &Client{ - Configurations: configurationsClient, - FirewallRules: firewallRulesClient, - Roles: rolesClient, - ServerGroupOperations: serverGroupOperationsClient, - ServerGroups: serverGroupsClient, - Servers: serversClient, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/README.md b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/README.md deleted file mode 100644 index 934ce987af6..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/README.md +++ /dev/null @@ -1,87 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations` Documentation - -The `configurations` SDK allows for interaction with the Azure Resource Manager Service `postgresqlhsc` (API Version `2020-10-05-privatepreview`). - -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/postgresqlhsc/2020-10-05-privatepreview/configurations" -``` - - -### Client Initialization - -```go -client := configurations.NewConfigurationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ConfigurationsClient.Get` - -```go -ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "configurationValue") - -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: `ConfigurationsClient.ListByServer` - -```go -ctx := context.TODO() -id := configurations.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "serverValue") - -// alternatively `client.ListByServer(ctx, id)` can be used to do batched pagination -items, err := client.ListByServerComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ConfigurationsClient.ListByServerGroup` - -```go -ctx := context.TODO() -id := configurations.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -// alternatively `client.ListByServerGroup(ctx, id)` can be used to do batched pagination -items, err := client.ListByServerGroupComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ConfigurationsClient.Update` - -```go -ctx := context.TODO() -id := configurations.NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "configurationValue") - -payload := configurations.ServerGroupConfiguration{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/client.go deleted file mode 100644 index 3ced22d176b..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package configurations - -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 ConfigurationsClient struct { - Client *resourcemanager.Client -} - -func NewConfigurationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ConfigurationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "configurations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ConfigurationsClient: %+v", err) - } - - return &ConfigurationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/constants.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/constants.go deleted file mode 100644 index 929b072b593..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/constants.go +++ /dev/null @@ -1,98 +0,0 @@ -package configurations - -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 ConfigurationDataType string - -const ( - ConfigurationDataTypeBoolean ConfigurationDataType = "Boolean" - ConfigurationDataTypeEnumeration ConfigurationDataType = "Enumeration" - ConfigurationDataTypeInteger ConfigurationDataType = "Integer" - ConfigurationDataTypeNumeric ConfigurationDataType = "Numeric" -) - -func PossibleValuesForConfigurationDataType() []string { - return []string{ - string(ConfigurationDataTypeBoolean), - string(ConfigurationDataTypeEnumeration), - string(ConfigurationDataTypeInteger), - string(ConfigurationDataTypeNumeric), - } -} - -func (s *ConfigurationDataType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfigurationDataType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfigurationDataType(input string) (*ConfigurationDataType, error) { - vals := map[string]ConfigurationDataType{ - "boolean": ConfigurationDataTypeBoolean, - "enumeration": ConfigurationDataTypeEnumeration, - "integer": ConfigurationDataTypeInteger, - "numeric": ConfigurationDataTypeNumeric, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfigurationDataType(input) - return &out, nil -} - -type ServerRole string - -const ( - ServerRoleCoordinator ServerRole = "Coordinator" - ServerRoleWorker ServerRole = "Worker" -) - -func PossibleValuesForServerRole() []string { - return []string{ - string(ServerRoleCoordinator), - string(ServerRoleWorker), - } -} - -func (s *ServerRole) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerRole(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerRole(input string) (*ServerRole, error) { - vals := map[string]ServerRole{ - "coordinator": ServerRoleCoordinator, - "worker": ServerRoleWorker, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerRole(input) - return &out, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration.go deleted file mode 100644 index 2844d82efbc..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration.go +++ /dev/null @@ -1,139 +0,0 @@ -package configurations - -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(&ConfigurationId{}) -} - -var _ resourceids.ResourceId = &ConfigurationId{} - -// ConfigurationId is a struct representing the Resource ID for a Configuration -type ConfigurationId struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string - ConfigurationName string -} - -// NewConfigurationID returns a new ConfigurationId struct -func NewConfigurationID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string, configurationName string) ConfigurationId { - return ConfigurationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - ConfigurationName: configurationName, - } -} - -// ParseConfigurationID parses 'input' into a ConfigurationId -func ParseConfigurationID(input string) (*ConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseConfigurationIDInsensitively parses 'input' case-insensitively into a ConfigurationId -// note: this method should only be used for API response data and not user input -func ParseConfigurationIDInsensitively(input string) (*ConfigurationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ConfigurationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ConfigurationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ConfigurationId) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - if id.ConfigurationName, ok = input.Parsed["configurationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "configurationName", input) - } - - return nil -} - -// ValidateConfigurationID checks that 'input' can be parsed as a Configuration ID -func ValidateConfigurationID(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 := ParseConfigurationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Configuration ID -func (id ConfigurationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s/configurations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name, id.ConfigurationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Configuration ID -func (id ConfigurationId) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - resourceids.StaticSegment("staticConfigurations", "configurations", "configurations"), - resourceids.UserSpecifiedSegment("configurationName", "configurationValue"), - } -} - -// String returns a human-readable description of this Configuration ID -func (id ConfigurationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - fmt.Sprintf("Configuration Name: %q", id.ConfigurationName), - } - return fmt.Sprintf("Configuration (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration_test.go deleted file mode 100644 index be6f2f490a4..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_configuration_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package configurations - -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 = &ConfigurationId{} - -func TestNewConfigurationID(t *testing.T) { - id := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "configurationValue") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } - - if id.ConfigurationName != "configurationValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConfigurationName'", id.ConfigurationName, "configurationValue") - } -} - -func TestFormatConfigurationID(t *testing.T) { - actual := NewConfigurationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "configurationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations/configurationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseConfigurationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations/configurationValue", - Expected: &ConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - ConfigurationName: "configurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations/configurationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.ConfigurationName != v.Expected.ConfigurationName { - t.Fatalf("Expected %q but got %q for ConfigurationName", v.Expected.ConfigurationName, actual.ConfigurationName) - } - - } -} - -func TestParseConfigurationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ConfigurationId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/cOnFiGuRaTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations/configurationValue", - Expected: &ConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - ConfigurationName: "configurationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/configurations/configurationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnVaLuE", - Expected: &ConfigurationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - ConfigurationName: "cOnFiGuRaTiOnVaLuE", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/cOnFiGuRaTiOnS/cOnFiGuRaTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseConfigurationIDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.ConfigurationName != v.Expected.ConfigurationName { - t.Fatalf("Expected %q but got %q for ConfigurationName", v.Expected.ConfigurationName, actual.ConfigurationName) - } - - } -} - -func TestSegmentsForConfigurationId(t *testing.T) { - segments := ConfigurationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ConfigurationId 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/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server.go deleted file mode 100644 index 9eeaf59920b..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server.go +++ /dev/null @@ -1,139 +0,0 @@ -package configurations - -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(&ServerId{}) -} - -var _ resourceids.ResourceId = &ServerId{} - -// ServerId is a struct representing the Resource ID for a Server -type ServerId struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string - ServerName string -} - -// NewServerID returns a new ServerId struct -func NewServerID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string, serverName string) ServerId { - return ServerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - ServerName: serverName, - } -} - -// ParseServerID parses 'input' into a ServerId -func ParseServerID(input string) (*ServerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId -// note: this method should only be used for API response data and not user input -func ParseServerIDInsensitively(input string) (*ServerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerId) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - if id.ServerName, ok = input.Parsed["serverName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverName", input) - } - - return nil -} - -// ValidateServerID checks that 'input' can be parsed as a Server ID -func ValidateServerID(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 := ParseServerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server ID -func (id ServerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s/servers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name, id.ServerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server ID -func (id ServerId) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - resourceids.StaticSegment("staticServers", "servers", "servers"), - resourceids.UserSpecifiedSegment("serverName", "serverValue"), - } -} - -// String returns a human-readable description of this Server ID -func (id ServerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - fmt.Sprintf("Server Name: %q", id.ServerName), - } - return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server_test.go deleted file mode 100644 index 0314db70ee6..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_server_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package configurations - -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 = &ServerId{} - -func TestNewServerID(t *testing.T) { - id := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "serverValue") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } - - if id.ServerName != "serverValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverValue") - } -} - -func TestFormatServerID(t *testing.T) { - actual := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "serverValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - ServerName: "serverValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - - } -} - -func TestParseServerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/sErVeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - ServerName: "serverValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/sErVeRs/sErVeRvAlUe", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - ServerName: "sErVeRvAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/sErVeRs/sErVeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerIDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - - } -} - -func TestSegmentsForServerId(t *testing.T) { - segments := ServerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerId 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/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2.go deleted file mode 100644 index cdb0334a55a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2.go +++ /dev/null @@ -1,130 +0,0 @@ -package configurations - -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(&ServerGroupsv2Id{}) -} - -var _ resourceids.ResourceId = &ServerGroupsv2Id{} - -// ServerGroupsv2Id is a struct representing the Resource ID for a Server Groupsv 2 -type ServerGroupsv2Id struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string -} - -// NewServerGroupsv2ID returns a new ServerGroupsv2Id struct -func NewServerGroupsv2ID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string) ServerGroupsv2Id { - return ServerGroupsv2Id{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - } -} - -// ParseServerGroupsv2ID parses 'input' into a ServerGroupsv2Id -func ParseServerGroupsv2ID(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerGroupsv2IDInsensitively parses 'input' case-insensitively into a ServerGroupsv2Id -// note: this method should only be used for API response data and not user input -func ParseServerGroupsv2IDInsensitively(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerGroupsv2Id) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - return nil -} - -// ValidateServerGroupsv2ID checks that 'input' can be parsed as a Server Groupsv 2 ID -func ValidateServerGroupsv2ID(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 := ParseServerGroupsv2ID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server Groupsv 2 ID -func (id ServerGroupsv2Id) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server Groupsv 2 ID -func (id ServerGroupsv2Id) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - } -} - -// String returns a human-readable description of this Server Groupsv 2 ID -func (id ServerGroupsv2Id) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - } - return fmt.Sprintf("Server Groupsv 2 (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2_test.go deleted file mode 100644 index 60923c031e9..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/id_servergroupsv2_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package configurations - -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 = &ServerGroupsv2Id{} - -func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } -} - -func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerGroupsv2ID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2ID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestParseServerGroupsv2IDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2IDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestSegmentsForServerGroupsv2Id(t *testing.T) { - segments := ServerGroupsv2Id{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerGroupsv2Id 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/postgresqlhsc/2020-10-05-privatepreview/configurations/method_get.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_get.go deleted file mode 100644 index 6fd51f37c41..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package configurations - -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 *ServerGroupConfiguration -} - -// Get ... -func (c ConfigurationsClient) Get(ctx context.Context, id ConfigurationId) (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 ServerGroupConfiguration - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyserver.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyserver.go deleted file mode 100644 index f245526b2ed..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyserver.go +++ /dev/null @@ -1,91 +0,0 @@ -package configurations - -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 ListByServerOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServerConfiguration -} - -type ListByServerCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServerConfiguration -} - -// ListByServer ... -func (c ConfigurationsClient) ListByServer(ctx context.Context, id ServerId) (result ListByServerOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/configurations", 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 *[]ServerConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByServerComplete retrieves all the results into a single object -func (c ConfigurationsClient) ListByServerComplete(ctx context.Context, id ServerId) (ListByServerCompleteResult, error) { - return c.ListByServerCompleteMatchingPredicate(ctx, id, ServerConfigurationOperationPredicate{}) -} - -// ListByServerCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ConfigurationsClient) ListByServerCompleteMatchingPredicate(ctx context.Context, id ServerId, predicate ServerConfigurationOperationPredicate) (result ListByServerCompleteResult, err error) { - items := make([]ServerConfiguration, 0) - - resp, err := c.ListByServer(ctx, id) - if err != nil { - 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 = ListByServerCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyservergroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyservergroup.go deleted file mode 100644 index 80aa3e3b970..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_listbyservergroup.go +++ /dev/null @@ -1,91 +0,0 @@ -package configurations - -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 ListByServerGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ServerGroupConfiguration -} - -type ListByServerGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServerGroupConfiguration -} - -// ListByServerGroup ... -func (c ConfigurationsClient) ListByServerGroup(ctx context.Context, id ServerGroupsv2Id) (result ListByServerGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/configurations", 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 *[]ServerGroupConfiguration `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByServerGroupComplete retrieves all the results into a single object -func (c ConfigurationsClient) ListByServerGroupComplete(ctx context.Context, id ServerGroupsv2Id) (ListByServerGroupCompleteResult, error) { - return c.ListByServerGroupCompleteMatchingPredicate(ctx, id, ServerGroupConfigurationOperationPredicate{}) -} - -// ListByServerGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ConfigurationsClient) ListByServerGroupCompleteMatchingPredicate(ctx context.Context, id ServerGroupsv2Id, predicate ServerGroupConfigurationOperationPredicate) (result ListByServerGroupCompleteResult, err error) { - items := make([]ServerGroupConfiguration, 0) - - resp, err := c.ListByServerGroup(ctx, id) - if err != nil { - 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 = ListByServerGroupCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_update.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_update.go deleted file mode 100644 index 13968ef637c..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package configurations - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ServerGroupConfiguration -} - -// Update ... -func (c ConfigurationsClient) Update(ctx context.Context, id ConfigurationId, input ServerGroupConfiguration) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ConfigurationsClient) UpdateThenPoll(ctx context.Context, id ConfigurationId, input ServerGroupConfiguration) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfiguration.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfiguration.go deleted file mode 100644 index 4090b20487a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -package configurations - -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 ServerConfiguration struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServerConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfigurationproperties.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfigurationproperties.go deleted file mode 100644 index 86bf042f762..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverconfigurationproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package configurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerConfigurationProperties struct { - AllowedValues *string `json:"allowedValues,omitempty"` - DataType *ConfigurationDataType `json:"dataType,omitempty"` - DefaultValue *string `json:"defaultValue,omitempty"` - Description *string `json:"description,omitempty"` - Source *string `json:"source,omitempty"` - Value string `json:"value"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfiguration.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfiguration.go deleted file mode 100644 index 930b6e8ada4..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfiguration.go +++ /dev/null @@ -1,16 +0,0 @@ -package configurations - -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 ServerGroupConfiguration struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServerGroupConfigurationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfigurationproperties.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfigurationproperties.go deleted file mode 100644 index 0a7790c90d7..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_servergroupconfigurationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package configurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupConfigurationProperties struct { - AllowedValues *string `json:"allowedValues,omitempty"` - DataType *ConfigurationDataType `json:"dataType,omitempty"` - Description *string `json:"description,omitempty"` - ServerRoleGroupConfigurations []ServerRoleGroupConfiguration `json:"serverRoleGroupConfigurations"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverrolegroupconfiguration.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverrolegroupconfiguration.go deleted file mode 100644 index e39a4e72d69..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/model_serverrolegroupconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package configurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerRoleGroupConfiguration struct { - DefaultValue *string `json:"defaultValue,omitempty"` - Role ServerRole `json:"role"` - Source *string `json:"source,omitempty"` - Value string `json:"value"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/predicates.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/predicates.go deleted file mode 100644 index 09b85ed4cb7..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/predicates.go +++ /dev/null @@ -1,50 +0,0 @@ -package configurations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ServerConfigurationOperationPredicate) Matches(input ServerConfiguration) 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 ServerGroupConfigurationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ServerGroupConfigurationOperationPredicate) Matches(input ServerGroupConfiguration) 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/postgresqlhsc/2020-10-05-privatepreview/configurations/version.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/version.go deleted file mode 100644 index b95a52194e6..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/configurations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package configurations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2020-10-05-privatepreview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/configurations/%s", defaultApiVersion) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/README.md b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/README.md deleted file mode 100644 index 84cdc385ec5..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/README.md +++ /dev/null @@ -1,81 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules` Documentation - -The `firewallrules` SDK allows for interaction with the Azure Resource Manager Service `postgresqlhsc` (API Version `2020-10-05-privatepreview`). - -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/postgresqlhsc/2020-10-05-privatepreview/firewallrules" -``` - - -### Client Initialization - -```go -client := firewallrules.NewFirewallRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `FirewallRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "firewallRuleValue") - -payload := firewallrules.FirewallRule{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallRulesClient.Delete` - -```go -ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "firewallRuleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `FirewallRulesClient.Get` - -```go -ctx := context.TODO() -id := firewallrules.NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "firewallRuleValue") - -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: `FirewallRulesClient.ListByServerGroup` - -```go -ctx := context.TODO() -id := firewallrules.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -read, err := client.ListByServerGroup(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/postgresqlhsc/2020-10-05-privatepreview/firewallrules/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/client.go deleted file mode 100644 index ca183214bd2..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package firewallrules - -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 FirewallRulesClient struct { - Client *resourcemanager.Client -} - -func NewFirewallRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*FirewallRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "firewallrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating FirewallRulesClient: %+v", err) - } - - return &FirewallRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule.go deleted file mode 100644 index b3f6d82bed0..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule.go +++ /dev/null @@ -1,139 +0,0 @@ -package firewallrules - -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(&FirewallRuleId{}) -} - -var _ resourceids.ResourceId = &FirewallRuleId{} - -// FirewallRuleId is a struct representing the Resource ID for a Firewall Rule -type FirewallRuleId struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string - FirewallRuleName string -} - -// NewFirewallRuleID returns a new FirewallRuleId struct -func NewFirewallRuleID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string, firewallRuleName string) FirewallRuleId { - return FirewallRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - FirewallRuleName: firewallRuleName, - } -} - -// ParseFirewallRuleID parses 'input' into a FirewallRuleId -func ParseFirewallRuleID(input string) (*FirewallRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseFirewallRuleIDInsensitively parses 'input' case-insensitively into a FirewallRuleId -// note: this method should only be used for API response data and not user input -func ParseFirewallRuleIDInsensitively(input string) (*FirewallRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&FirewallRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := FirewallRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *FirewallRuleId) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - if id.FirewallRuleName, ok = input.Parsed["firewallRuleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "firewallRuleName", input) - } - - return nil -} - -// ValidateFirewallRuleID checks that 'input' can be parsed as a Firewall Rule ID -func ValidateFirewallRuleID(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 := ParseFirewallRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Firewall Rule ID -func (id FirewallRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s/firewallRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name, id.FirewallRuleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Firewall Rule ID -func (id FirewallRuleId) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - resourceids.StaticSegment("staticFirewallRules", "firewallRules", "firewallRules"), - resourceids.UserSpecifiedSegment("firewallRuleName", "firewallRuleValue"), - } -} - -// String returns a human-readable description of this Firewall Rule ID -func (id FirewallRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - fmt.Sprintf("Firewall Rule Name: %q", id.FirewallRuleName), - } - return fmt.Sprintf("Firewall Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule_test.go deleted file mode 100644 index 35de30c3944..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_firewallrule_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package firewallrules - -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 = &FirewallRuleId{} - -func TestNewFirewallRuleID(t *testing.T) { - id := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "firewallRuleValue") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } - - if id.FirewallRuleName != "firewallRuleValue" { - t.Fatalf("Expected %q but got %q for Segment 'FirewallRuleName'", id.FirewallRuleName, "firewallRuleValue") - } -} - -func TestFormatFirewallRuleID(t *testing.T) { - actual := NewFirewallRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "firewallRuleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules/firewallRuleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseFirewallRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallRuleId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules/firewallRuleValue", - Expected: &FirewallRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - FirewallRuleName: "firewallRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules/firewallRuleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallRuleID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.FirewallRuleName != v.Expected.FirewallRuleName { - t.Fatalf("Expected %q but got %q for FirewallRuleName", v.Expected.FirewallRuleName, actual.FirewallRuleName) - } - - } -} - -func TestParseFirewallRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *FirewallRuleId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/fIrEwAlLrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules/firewallRuleValue", - Expected: &FirewallRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - FirewallRuleName: "firewallRuleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/firewallRules/firewallRuleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/fIrEwAlLrUlEs/fIrEwAlLrUlEvAlUe", - Expected: &FirewallRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - FirewallRuleName: "fIrEwAlLrUlEvAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/fIrEwAlLrUlEs/fIrEwAlLrUlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseFirewallRuleIDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.FirewallRuleName != v.Expected.FirewallRuleName { - t.Fatalf("Expected %q but got %q for FirewallRuleName", v.Expected.FirewallRuleName, actual.FirewallRuleName) - } - - } -} - -func TestSegmentsForFirewallRuleId(t *testing.T) { - segments := FirewallRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("FirewallRuleId 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/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2.go deleted file mode 100644 index b9a83123248..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2.go +++ /dev/null @@ -1,130 +0,0 @@ -package firewallrules - -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(&ServerGroupsv2Id{}) -} - -var _ resourceids.ResourceId = &ServerGroupsv2Id{} - -// ServerGroupsv2Id is a struct representing the Resource ID for a Server Groupsv 2 -type ServerGroupsv2Id struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string -} - -// NewServerGroupsv2ID returns a new ServerGroupsv2Id struct -func NewServerGroupsv2ID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string) ServerGroupsv2Id { - return ServerGroupsv2Id{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - } -} - -// ParseServerGroupsv2ID parses 'input' into a ServerGroupsv2Id -func ParseServerGroupsv2ID(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerGroupsv2IDInsensitively parses 'input' case-insensitively into a ServerGroupsv2Id -// note: this method should only be used for API response data and not user input -func ParseServerGroupsv2IDInsensitively(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerGroupsv2Id) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - return nil -} - -// ValidateServerGroupsv2ID checks that 'input' can be parsed as a Server Groupsv 2 ID -func ValidateServerGroupsv2ID(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 := ParseServerGroupsv2ID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server Groupsv 2 ID -func (id ServerGroupsv2Id) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server Groupsv 2 ID -func (id ServerGroupsv2Id) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - } -} - -// String returns a human-readable description of this Server Groupsv 2 ID -func (id ServerGroupsv2Id) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - } - return fmt.Sprintf("Server Groupsv 2 (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2_test.go deleted file mode 100644 index 2179be442e1..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/id_servergroupsv2_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package firewallrules - -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 = &ServerGroupsv2Id{} - -func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } -} - -func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerGroupsv2ID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2ID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestParseServerGroupsv2IDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2IDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestSegmentsForServerGroupsv2Id(t *testing.T) { - segments := ServerGroupsv2Id{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerGroupsv2Id 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/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_createorupdate.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_createorupdate.go deleted file mode 100644 index 8a5fca1cd9f..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package firewallrules - -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 *FirewallRule -} - -// CreateOrUpdate ... -func (c FirewallRulesClient) CreateOrUpdate(ctx context.Context, id FirewallRuleId, input FirewallRule) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c FirewallRulesClient) CreateOrUpdateThenPoll(ctx context.Context, id FirewallRuleId, input FirewallRule) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_delete.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_delete.go deleted file mode 100644 index 44b95e975c0..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package firewallrules - -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 FirewallRulesClient) Delete(ctx context.Context, id FirewallRuleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 FirewallRulesClient) DeleteThenPoll(ctx context.Context, id FirewallRuleId) 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/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_get.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_get.go deleted file mode 100644 index 37bca7c40d8..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package firewallrules - -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 *FirewallRule -} - -// Get ... -func (c FirewallRulesClient) Get(ctx context.Context, id FirewallRuleId) (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 FirewallRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_listbyservergroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_listbyservergroup.go deleted file mode 100644 index 9a24c8b1770..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/method_listbyservergroup.go +++ /dev/null @@ -1,55 +0,0 @@ -package firewallrules - -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 ListByServerGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *FirewallRuleListResult -} - -// ListByServerGroup ... -func (c FirewallRulesClient) ListByServerGroup(ctx context.Context, id ServerGroupsv2Id) (result ListByServerGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/firewallRules", 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 FirewallRuleListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrule.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrule.go deleted file mode 100644 index e6c4db6725d..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrule.go +++ /dev/null @@ -1,16 +0,0 @@ -package firewallrules - -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 FirewallRule struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties FirewallRuleProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrulelistresult.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrulelistresult.go deleted file mode 100644 index c01e91fae56..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallrulelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package firewallrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallRuleListResult struct { - Value *[]FirewallRule `json:"value,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallruleproperties.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallruleproperties.go deleted file mode 100644 index fca4e1c3684..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/model_firewallruleproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package firewallrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FirewallRuleProperties struct { - EndIPAddress string `json:"endIpAddress"` - StartIPAddress string `json:"startIpAddress"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/version.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/version.go deleted file mode 100644 index 8c6d6193150..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/firewallrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package firewallrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2020-10-05-privatepreview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/firewallrules/%s", defaultApiVersion) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/README.md b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/README.md deleted file mode 100644 index 3a3de3bb98d..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/README.md +++ /dev/null @@ -1,65 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles` Documentation - -The `roles` SDK allows for interaction with the Azure Resource Manager Service `postgresqlhsc` (API Version `2020-10-05-privatepreview`). - -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/postgresqlhsc/2020-10-05-privatepreview/roles" -``` - - -### Client Initialization - -```go -client := roles.NewRolesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RolesClient.Create` - -```go -ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "roleValue") - -payload := roles.Role{ - // ... -} - - -if err := client.CreateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `RolesClient.Delete` - -```go -ctx := context.TODO() -id := roles.NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "roleValue") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `RolesClient.ListByServerGroup` - -```go -ctx := context.TODO() -id := roles.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -read, err := client.ListByServerGroup(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/postgresqlhsc/2020-10-05-privatepreview/roles/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/client.go deleted file mode 100644 index eddcb107e5b..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package roles - -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 RolesClient struct { - Client *resourcemanager.Client -} - -func NewRolesClientWithBaseURI(sdkApi sdkEnv.Api) (*RolesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "roles", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RolesClient: %+v", err) - } - - return &RolesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role.go deleted file mode 100644 index 80c5f615cb0..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role.go +++ /dev/null @@ -1,139 +0,0 @@ -package roles - -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(&RoleId{}) -} - -var _ resourceids.ResourceId = &RoleId{} - -// RoleId is a struct representing the Resource ID for a Role -type RoleId struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string - RoleName string -} - -// NewRoleID returns a new RoleId struct -func NewRoleID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string, roleName string) RoleId { - return RoleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - RoleName: roleName, - } -} - -// ParseRoleID parses 'input' into a RoleId -func ParseRoleID(input string) (*RoleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRoleIDInsensitively parses 'input' case-insensitively into a RoleId -// note: this method should only be used for API response data and not user input -func ParseRoleIDInsensitively(input string) (*RoleId, error) { - parser := resourceids.NewParserFromResourceIdType(&RoleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RoleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RoleId) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - if id.RoleName, ok = input.Parsed["roleName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "roleName", input) - } - - return nil -} - -// ValidateRoleID checks that 'input' can be parsed as a Role ID -func ValidateRoleID(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 := ParseRoleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Role ID -func (id RoleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s/roles/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name, id.RoleName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Role ID -func (id RoleId) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - resourceids.StaticSegment("staticRoles", "roles", "roles"), - resourceids.UserSpecifiedSegment("roleName", "roleValue"), - } -} - -// String returns a human-readable description of this Role ID -func (id RoleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - fmt.Sprintf("Role Name: %q", id.RoleName), - } - return fmt.Sprintf("Role (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role_test.go deleted file mode 100644 index f6863a5fcda..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_role_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package roles - -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 = &RoleId{} - -func TestNewRoleID(t *testing.T) { - id := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "roleValue") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } - - if id.RoleName != "roleValue" { - t.Fatalf("Expected %q but got %q for Segment 'RoleName'", id.RoleName, "roleValue") - } -} - -func TestFormatRoleID(t *testing.T) { - actual := NewRoleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "roleValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles/roleValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRoleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles/roleValue", - Expected: &RoleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - RoleName: "roleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles/roleValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.RoleName != v.Expected.RoleName { - t.Fatalf("Expected %q but got %q for RoleName", v.Expected.RoleName, actual.RoleName) - } - - } -} - -func TestParseRoleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RoleId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/rOlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles/roleValue", - Expected: &RoleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - RoleName: "roleValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/roles/roleValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/rOlEs/rOlEvAlUe", - Expected: &RoleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - RoleName: "rOlEvAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/rOlEs/rOlEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRoleIDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.RoleName != v.Expected.RoleName { - t.Fatalf("Expected %q but got %q for RoleName", v.Expected.RoleName, actual.RoleName) - } - - } -} - -func TestSegmentsForRoleId(t *testing.T) { - segments := RoleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RoleId 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/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2.go deleted file mode 100644 index 017258c2b4a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2.go +++ /dev/null @@ -1,130 +0,0 @@ -package roles - -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(&ServerGroupsv2Id{}) -} - -var _ resourceids.ResourceId = &ServerGroupsv2Id{} - -// ServerGroupsv2Id is a struct representing the Resource ID for a Server Groupsv 2 -type ServerGroupsv2Id struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string -} - -// NewServerGroupsv2ID returns a new ServerGroupsv2Id struct -func NewServerGroupsv2ID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string) ServerGroupsv2Id { - return ServerGroupsv2Id{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - } -} - -// ParseServerGroupsv2ID parses 'input' into a ServerGroupsv2Id -func ParseServerGroupsv2ID(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerGroupsv2IDInsensitively parses 'input' case-insensitively into a ServerGroupsv2Id -// note: this method should only be used for API response data and not user input -func ParseServerGroupsv2IDInsensitively(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerGroupsv2Id) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - return nil -} - -// ValidateServerGroupsv2ID checks that 'input' can be parsed as a Server Groupsv 2 ID -func ValidateServerGroupsv2ID(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 := ParseServerGroupsv2ID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server Groupsv 2 ID -func (id ServerGroupsv2Id) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server Groupsv 2 ID -func (id ServerGroupsv2Id) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - } -} - -// String returns a human-readable description of this Server Groupsv 2 ID -func (id ServerGroupsv2Id) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - } - return fmt.Sprintf("Server Groupsv 2 (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2_test.go deleted file mode 100644 index 251536c526c..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/id_servergroupsv2_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package roles - -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 = &ServerGroupsv2Id{} - -func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } -} - -func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerGroupsv2ID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2ID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestParseServerGroupsv2IDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2IDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestSegmentsForServerGroupsv2Id(t *testing.T) { - segments := ServerGroupsv2Id{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerGroupsv2Id 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/postgresqlhsc/2020-10-05-privatepreview/roles/method_create.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_create.go deleted file mode 100644 index 80189e31225..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_create.go +++ /dev/null @@ -1,76 +0,0 @@ -package roles - -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 CreateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Role -} - -// Create ... -func (c RolesClient) Create(ctx context.Context, id RoleId, input Role) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateThenPoll performs Create then polls until it's completed -func (c RolesClient) CreateThenPoll(ctx context.Context, id RoleId, input Role) error { - result, err := c.Create(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Create: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Create: %+v", err) - } - - return nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_delete.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_delete.go deleted file mode 100644 index d23658fd5e7..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package roles - -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 RolesClient) Delete(ctx context.Context, id RoleId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 RolesClient) DeleteThenPoll(ctx context.Context, id RoleId) 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/postgresqlhsc/2020-10-05-privatepreview/roles/method_listbyservergroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_listbyservergroup.go deleted file mode 100644 index 13aa40d801a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/method_listbyservergroup.go +++ /dev/null @@ -1,55 +0,0 @@ -package roles - -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 ListByServerGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *RoleListResult -} - -// ListByServerGroup ... -func (c RolesClient) ListByServerGroup(ctx context.Context, id ServerGroupsv2Id) (result ListByServerGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/roles", 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 RoleListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_role.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_role.go deleted file mode 100644 index 366952b6a60..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_role.go +++ /dev/null @@ -1,16 +0,0 @@ -package roles - -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 Role struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RoleProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_rolelistresult.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_rolelistresult.go deleted file mode 100644 index e65f2ca256a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_rolelistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package roles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoleListResult struct { - Value *[]Role `json:"value,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_roleproperties.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_roleproperties.go deleted file mode 100644 index c9375067b48..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/model_roleproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package roles - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RoleProperties struct { - Password string `json:"password"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/version.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/version.go deleted file mode 100644 index 734cfbc3af0..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/roles/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package roles - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2020-10-05-privatepreview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/roles/%s", defaultApiVersion) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/client.go deleted file mode 100644 index bb1ded3000b..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package servergroupoperations - -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 ServerGroupOperationsClient struct { - Client *resourcemanager.Client -} - -func NewServerGroupOperationsClientWithBaseURI(sdkApi sdkEnv.Api) (*ServerGroupOperationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "servergroupoperations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServerGroupOperationsClient: %+v", err) - } - - return &ServerGroupOperationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2.go deleted file mode 100644 index 7205db1861f..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2.go +++ /dev/null @@ -1,130 +0,0 @@ -package servergroupoperations - -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(&ServerGroupsv2Id{}) -} - -var _ resourceids.ResourceId = &ServerGroupsv2Id{} - -// ServerGroupsv2Id is a struct representing the Resource ID for a Server Groupsv 2 -type ServerGroupsv2Id struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string -} - -// NewServerGroupsv2ID returns a new ServerGroupsv2Id struct -func NewServerGroupsv2ID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string) ServerGroupsv2Id { - return ServerGroupsv2Id{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - } -} - -// ParseServerGroupsv2ID parses 'input' into a ServerGroupsv2Id -func ParseServerGroupsv2ID(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerGroupsv2IDInsensitively parses 'input' case-insensitively into a ServerGroupsv2Id -// note: this method should only be used for API response data and not user input -func ParseServerGroupsv2IDInsensitively(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerGroupsv2Id) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - return nil -} - -// ValidateServerGroupsv2ID checks that 'input' can be parsed as a Server Groupsv 2 ID -func ValidateServerGroupsv2ID(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 := ParseServerGroupsv2ID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server Groupsv 2 ID -func (id ServerGroupsv2Id) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server Groupsv 2 ID -func (id ServerGroupsv2Id) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - } -} - -// String returns a human-readable description of this Server Groupsv 2 ID -func (id ServerGroupsv2Id) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - } - return fmt.Sprintf("Server Groupsv 2 (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2_test.go deleted file mode 100644 index 86862681e3f..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/id_servergroupsv2_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package servergroupoperations - -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 = &ServerGroupsv2Id{} - -func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } -} - -func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerGroupsv2ID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2ID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestParseServerGroupsv2IDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2IDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestSegmentsForServerGroupsv2Id(t *testing.T) { - segments := ServerGroupsv2Id{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerGroupsv2Id 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/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsrestart.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsrestart.go deleted file mode 100644 index cce87e38488..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsrestart.go +++ /dev/null @@ -1,70 +0,0 @@ -package servergroupoperations - -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 ServerGroupsRestartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ServerGroupsRestart ... -func (c ServerGroupOperationsClient) ServerGroupsRestart(ctx context.Context, id ServerGroupsv2Id) (result ServerGroupsRestartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/restart", 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 -} - -// ServerGroupsRestartThenPoll performs ServerGroupsRestart then polls until it's completed -func (c ServerGroupOperationsClient) ServerGroupsRestartThenPoll(ctx context.Context, id ServerGroupsv2Id) error { - result, err := c.ServerGroupsRestart(ctx, id) - if err != nil { - return fmt.Errorf("performing ServerGroupsRestart: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ServerGroupsRestart: %+v", err) - } - - return nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstart.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstart.go deleted file mode 100644 index 69dbf3a137e..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstart.go +++ /dev/null @@ -1,70 +0,0 @@ -package servergroupoperations - -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 ServerGroupsStartOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ServerGroupsStart ... -func (c ServerGroupOperationsClient) ServerGroupsStart(ctx context.Context, id ServerGroupsv2Id) (result ServerGroupsStartOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 -} - -// ServerGroupsStartThenPoll performs ServerGroupsStart then polls until it's completed -func (c ServerGroupOperationsClient) ServerGroupsStartThenPoll(ctx context.Context, id ServerGroupsv2Id) error { - result, err := c.ServerGroupsStart(ctx, id) - if err != nil { - return fmt.Errorf("performing ServerGroupsStart: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ServerGroupsStart: %+v", err) - } - - return nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstop.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstop.go deleted file mode 100644 index 1a0d001b342..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/method_servergroupsstop.go +++ /dev/null @@ -1,70 +0,0 @@ -package servergroupoperations - -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 ServerGroupsStopOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData -} - -// ServerGroupsStop ... -func (c ServerGroupOperationsClient) ServerGroupsStop(ctx context.Context, id ServerGroupsv2Id) (result ServerGroupsStopOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - http.StatusOK, - }, - 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 -} - -// ServerGroupsStopThenPoll performs ServerGroupsStop then polls until it's completed -func (c ServerGroupOperationsClient) ServerGroupsStopThenPoll(ctx context.Context, id ServerGroupsv2Id) error { - result, err := c.ServerGroupsStop(ctx, id) - if err != nil { - return fmt.Errorf("performing ServerGroupsStop: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after ServerGroupsStop: %+v", err) - } - - return nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/version.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/version.go deleted file mode 100644 index 3d1286c90ab..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroupoperations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package servergroupoperations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2020-10-05-privatepreview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/servergroupoperations/%s", defaultApiVersion) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/README.md b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/README.md deleted file mode 100644 index 31aa4008742..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/README.md +++ /dev/null @@ -1,138 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups` Documentation - -The `servergroups` SDK allows for interaction with the Azure Resource Manager Service `postgresqlhsc` (API Version `2020-10-05-privatepreview`). - -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/postgresqlhsc/2020-10-05-privatepreview/servergroups" -``` - - -### Client Initialization - -```go -client := servergroups.NewServerGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServerGroupsClient.CheckNameAvailability` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -payload := servergroups.NameAvailabilityRequest{ - // ... -} - - -read, err := client.CheckNameAvailability(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ServerGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := servergroups.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -payload := servergroups.ServerGroup{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServerGroupsClient.Delete` - -```go -ctx := context.TODO() -id := servergroups.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -if err := client.DeleteThenPoll(ctx, id); err != nil { - // handle the error -} -``` - - -### Example Usage: `ServerGroupsClient.Get` - -```go -ctx := context.TODO() -id := servergroups.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -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: `ServerGroupsClient.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: `ServerGroupsClient.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: `ServerGroupsClient.Update` - -```go -ctx := context.TODO() -id := servergroups.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -payload := servergroups.ServerGroupForUpdate{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/client.go deleted file mode 100644 index b254f0ae021..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package servergroups - -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 ServerGroupsClient struct { - Client *resourcemanager.Client -} - -func NewServerGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*ServerGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "servergroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServerGroupsClient: %+v", err) - } - - return &ServerGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/constants.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/constants.go deleted file mode 100644 index d3a70072091..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/constants.go +++ /dev/null @@ -1,371 +0,0 @@ -package servergroups - -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 CheckNameAvailabilityResourceType string - -const ( - CheckNameAvailabilityResourceTypeMicrosoftPointDBforPostgreSQLServerGroupsvTwo CheckNameAvailabilityResourceType = "Microsoft.DBforPostgreSQL/serverGroupsv2" -) - -func PossibleValuesForCheckNameAvailabilityResourceType() []string { - return []string{ - string(CheckNameAvailabilityResourceTypeMicrosoftPointDBforPostgreSQLServerGroupsvTwo), - } -} - -func (s *CheckNameAvailabilityResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCheckNameAvailabilityResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCheckNameAvailabilityResourceType(input string) (*CheckNameAvailabilityResourceType, error) { - vals := map[string]CheckNameAvailabilityResourceType{ - "microsoft.dbforpostgresql/servergroupsv2": CheckNameAvailabilityResourceTypeMicrosoftPointDBforPostgreSQLServerGroupsvTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CheckNameAvailabilityResourceType(input) - return &out, nil -} - -type CitusVersion string - -const ( - CitusVersionEightPointThree CitusVersion = "8.3" - CitusVersionNinePointFive CitusVersion = "9.5" - CitusVersionNinePointFour CitusVersion = "9.4" - CitusVersionNinePointOne CitusVersion = "9.1" - CitusVersionNinePointThree CitusVersion = "9.3" - CitusVersionNinePointTwo CitusVersion = "9.2" - CitusVersionNinePointZero CitusVersion = "9.0" -) - -func PossibleValuesForCitusVersion() []string { - return []string{ - string(CitusVersionEightPointThree), - string(CitusVersionNinePointFive), - string(CitusVersionNinePointFour), - string(CitusVersionNinePointOne), - string(CitusVersionNinePointThree), - string(CitusVersionNinePointTwo), - string(CitusVersionNinePointZero), - } -} - -func (s *CitusVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCitusVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCitusVersion(input string) (*CitusVersion, error) { - vals := map[string]CitusVersion{ - "8.3": CitusVersionEightPointThree, - "9.5": CitusVersionNinePointFive, - "9.4": CitusVersionNinePointFour, - "9.1": CitusVersionNinePointOne, - "9.3": CitusVersionNinePointThree, - "9.2": CitusVersionNinePointTwo, - "9.0": CitusVersionNinePointZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CitusVersion(input) - return &out, nil -} - -type CreateMode string - -const ( - CreateModeDefault CreateMode = "Default" - CreateModePointInTimeRestore CreateMode = "PointInTimeRestore" - CreateModeReadReplica CreateMode = "ReadReplica" -) - -func PossibleValuesForCreateMode() []string { - return []string{ - string(CreateModeDefault), - string(CreateModePointInTimeRestore), - string(CreateModeReadReplica), - } -} - -func (s *CreateMode) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCreateMode(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCreateMode(input string) (*CreateMode, error) { - vals := map[string]CreateMode{ - "default": CreateModeDefault, - "pointintimerestore": CreateModePointInTimeRestore, - "readreplica": CreateModeReadReplica, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreateMode(input) - return &out, nil -} - -type PostgreSQLVersion string - -const ( - PostgreSQLVersionOneOne PostgreSQLVersion = "11" - PostgreSQLVersionOneTwo PostgreSQLVersion = "12" -) - -func PossibleValuesForPostgreSQLVersion() []string { - return []string{ - string(PostgreSQLVersionOneOne), - string(PostgreSQLVersionOneTwo), - } -} - -func (s *PostgreSQLVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePostgreSQLVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePostgreSQLVersion(input string) (*PostgreSQLVersion, error) { - vals := map[string]PostgreSQLVersion{ - "11": PostgreSQLVersionOneOne, - "12": PostgreSQLVersionOneTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PostgreSQLVersion(input) - return &out, nil -} - -type ResourceProviderType string - -const ( - ResourceProviderTypeMarlin ResourceProviderType = "Marlin" - ResourceProviderTypeMeru ResourceProviderType = "Meru" -) - -func PossibleValuesForResourceProviderType() []string { - return []string{ - string(ResourceProviderTypeMarlin), - string(ResourceProviderTypeMeru), - } -} - -func (s *ResourceProviderType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceProviderType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceProviderType(input string) (*ResourceProviderType, error) { - vals := map[string]ResourceProviderType{ - "marlin": ResourceProviderTypeMarlin, - "meru": ResourceProviderTypeMeru, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceProviderType(input) - return &out, nil -} - -type ServerEdition string - -const ( - ServerEditionGeneralPurpose ServerEdition = "GeneralPurpose" - ServerEditionMemoryOptimized ServerEdition = "MemoryOptimized" -) - -func PossibleValuesForServerEdition() []string { - return []string{ - string(ServerEditionGeneralPurpose), - string(ServerEditionMemoryOptimized), - } -} - -func (s *ServerEdition) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerEdition(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerEdition(input string) (*ServerEdition, error) { - vals := map[string]ServerEdition{ - "generalpurpose": ServerEditionGeneralPurpose, - "memoryoptimized": ServerEditionMemoryOptimized, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerEdition(input) - return &out, nil -} - -type ServerRole string - -const ( - ServerRoleCoordinator ServerRole = "Coordinator" - ServerRoleWorker ServerRole = "Worker" -) - -func PossibleValuesForServerRole() []string { - return []string{ - string(ServerRoleCoordinator), - string(ServerRoleWorker), - } -} - -func (s *ServerRole) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerRole(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerRole(input string) (*ServerRole, error) { - vals := map[string]ServerRole{ - "coordinator": ServerRoleCoordinator, - "worker": ServerRoleWorker, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerRole(input) - return &out, nil -} - -type ServerState string - -const ( - ServerStateDisabled ServerState = "Disabled" - ServerStateDropping ServerState = "Dropping" - ServerStateProvisioning ServerState = "Provisioning" - ServerStateReady ServerState = "Ready" - ServerStateStarting ServerState = "Starting" - ServerStateStopped ServerState = "Stopped" - ServerStateStopping ServerState = "Stopping" - ServerStateUpdating ServerState = "Updating" -) - -func PossibleValuesForServerState() []string { - return []string{ - string(ServerStateDisabled), - string(ServerStateDropping), - string(ServerStateProvisioning), - string(ServerStateReady), - string(ServerStateStarting), - string(ServerStateStopped), - string(ServerStateStopping), - string(ServerStateUpdating), - } -} - -func (s *ServerState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerState(input string) (*ServerState, error) { - vals := map[string]ServerState{ - "disabled": ServerStateDisabled, - "dropping": ServerStateDropping, - "provisioning": ServerStateProvisioning, - "ready": ServerStateReady, - "starting": ServerStateStarting, - "stopped": ServerStateStopped, - "stopping": ServerStateStopping, - "updating": ServerStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerState(input) - return &out, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2.go deleted file mode 100644 index 7ceb8cefa9a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2.go +++ /dev/null @@ -1,130 +0,0 @@ -package servergroups - -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(&ServerGroupsv2Id{}) -} - -var _ resourceids.ResourceId = &ServerGroupsv2Id{} - -// ServerGroupsv2Id is a struct representing the Resource ID for a Server Groupsv 2 -type ServerGroupsv2Id struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string -} - -// NewServerGroupsv2ID returns a new ServerGroupsv2Id struct -func NewServerGroupsv2ID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string) ServerGroupsv2Id { - return ServerGroupsv2Id{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - } -} - -// ParseServerGroupsv2ID parses 'input' into a ServerGroupsv2Id -func ParseServerGroupsv2ID(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerGroupsv2IDInsensitively parses 'input' case-insensitively into a ServerGroupsv2Id -// note: this method should only be used for API response data and not user input -func ParseServerGroupsv2IDInsensitively(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerGroupsv2Id) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - return nil -} - -// ValidateServerGroupsv2ID checks that 'input' can be parsed as a Server Groupsv 2 ID -func ValidateServerGroupsv2ID(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 := ParseServerGroupsv2ID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server Groupsv 2 ID -func (id ServerGroupsv2Id) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server Groupsv 2 ID -func (id ServerGroupsv2Id) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - } -} - -// String returns a human-readable description of this Server Groupsv 2 ID -func (id ServerGroupsv2Id) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - } - return fmt.Sprintf("Server Groupsv 2 (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2_test.go deleted file mode 100644 index 501300a312e..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/id_servergroupsv2_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package servergroups - -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 = &ServerGroupsv2Id{} - -func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } -} - -func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerGroupsv2ID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2ID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestParseServerGroupsv2IDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2IDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestSegmentsForServerGroupsv2Id(t *testing.T) { - segments := ServerGroupsv2Id{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerGroupsv2Id 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/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_checknameavailability.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_checknameavailability.go deleted file mode 100644 index 78b706aca4b..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_checknameavailability.go +++ /dev/null @@ -1,60 +0,0 @@ -package servergroups - -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 CheckNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *NameAvailability -} - -// CheckNameAvailability ... -func (c ServerGroupsClient) CheckNameAvailability(ctx context.Context, id commonids.SubscriptionId, input NameAvailabilityRequest) (result CheckNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.DBforPostgreSQL/checkNameAvailability", 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 NameAvailability - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_createorupdate.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_createorupdate.go deleted file mode 100644 index 083864cfbf8..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_createorupdate.go +++ /dev/null @@ -1,76 +0,0 @@ -package servergroups - -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 *ServerGroup -} - -// CreateOrUpdate ... -func (c ServerGroupsClient) CreateOrUpdate(ctx context.Context, id ServerGroupsv2Id, input ServerGroup) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c ServerGroupsClient) CreateOrUpdateThenPoll(ctx context.Context, id ServerGroupsv2Id, input ServerGroup) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_delete.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_delete.go deleted file mode 100644 index 4e5985152d0..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_delete.go +++ /dev/null @@ -1,71 +0,0 @@ -package servergroups - -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 ServerGroupsClient) Delete(ctx context.Context, id ServerGroupsv2Id) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 ServerGroupsClient) DeleteThenPoll(ctx context.Context, id ServerGroupsv2Id) 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/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_get.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_get.go deleted file mode 100644 index f69eb2d9819..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package servergroups - -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 *ServerGroup -} - -// Get ... -func (c ServerGroupsClient) Get(ctx context.Context, id ServerGroupsv2Id) (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 ServerGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_list.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_list.go deleted file mode 100644 index 4632d70efa7..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package servergroups - -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 *[]ServerGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServerGroup -} - -// List ... -func (c ServerGroupsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", 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 *[]ServerGroup `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 ServerGroupsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ServerGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServerGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate ServerGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]ServerGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_listbyresourcegroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_listbyresourcegroup.go deleted file mode 100644 index 13cdb7c47b1..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package servergroups - -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 *[]ServerGroup -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []ServerGroup -} - -// ListByResourceGroup ... -func (c ServerGroupsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", 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 *[]ServerGroup `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 ServerGroupsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, ServerGroupOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ServerGroupsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate ServerGroupOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]ServerGroup, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_update.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_update.go deleted file mode 100644 index 95ed10c33dd..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package servergroups - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *ServerGroup -} - -// Update ... -func (c ServerGroupsClient) Update(ctx context.Context, id ServerGroupsv2Id, input ServerGroupForUpdate) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c ServerGroupsClient) UpdateThenPoll(ctx context.Context, id ServerGroupsv2Id, input ServerGroupForUpdate) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_maintenancewindow.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_maintenancewindow.go deleted file mode 100644 index f77872039d5..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_maintenancewindow.go +++ /dev/null @@ -1,11 +0,0 @@ -package servergroups - -// 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 { - CustomWindow *string `json:"customWindow,omitempty"` - DayOfWeek *int64 `json:"dayOfWeek,omitempty"` - StartHour *int64 `json:"startHour,omitempty"` - StartMinute *int64 `json:"startMinute,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailability.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailability.go deleted file mode 100644 index 7a92b0e33f5..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailability.go +++ /dev/null @@ -1,11 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameAvailability struct { - Message *string `json:"message,omitempty"` - Name *string `json:"name,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailabilityrequest.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailabilityrequest.go deleted file mode 100644 index 40ef494c298..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_nameavailabilityrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameAvailabilityRequest struct { - Name string `json:"name"` - Type CheckNameAvailabilityResourceType `json:"type"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroup.go deleted file mode 100644 index 8ab5af1668a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroup.go +++ /dev/null @@ -1,18 +0,0 @@ -package servergroups - -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 ServerGroup struct { - Id *string `json:"id,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *ServerGroupProperties `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/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupforupdate.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupforupdate.go deleted file mode 100644 index 7d396673acc..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupforupdate.go +++ /dev/null @@ -1,10 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupForUpdate struct { - Location *string `json:"location,omitempty"` - Properties *ServerGroupPropertiesForUpdate `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupproperties.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupproperties.go deleted file mode 100644 index a9edc06801f..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergroupproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package servergroups - -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 ServerGroupProperties struct { - AdministratorLogin *string `json:"administratorLogin,omitempty"` - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - AvailabilityZone *string `json:"availabilityZone,omitempty"` - BackupRetentionDays *int64 `json:"backupRetentionDays,omitempty"` - CitusVersion *CitusVersion `json:"citusVersion,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DelegatedSubnetArguments *ServerGroupPropertiesDelegatedSubnetArguments `json:"delegatedSubnetArguments,omitempty"` - EarliestRestoreTime *string `json:"earliestRestoreTime,omitempty"` - EnableMx *bool `json:"enableMx,omitempty"` - EnableShardsOnCoordinator *bool `json:"enableShardsOnCoordinator,omitempty"` - EnableZfs *bool `json:"enableZfs,omitempty"` - MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` - PointInTimeUTC *string `json:"pointInTimeUTC,omitempty"` - PostgresqlVersion *PostgreSQLVersion `json:"postgresqlVersion,omitempty"` - PrivateDnsZoneArguments *ServerGroupPropertiesPrivateDnsZoneArguments `json:"privateDnsZoneArguments,omitempty"` - ReadReplicas *[]string `json:"readReplicas,omitempty"` - ResourceProviderType *ResourceProviderType `json:"resourceProviderType,omitempty"` - ServerRoleGroups *[]ServerRoleGroup `json:"serverRoleGroups,omitempty"` - SourceLocation *string `json:"sourceLocation,omitempty"` - SourceResourceGroupName *string `json:"sourceResourceGroupName,omitempty"` - SourceServerGroup *string `json:"sourceServerGroup,omitempty"` - SourceServerGroupName *string `json:"sourceServerGroupName,omitempty"` - SourceSubscriptionId *string `json:"sourceSubscriptionId,omitempty"` - StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"` - State *ServerState `json:"state,omitempty"` -} - -func (o *ServerGroupProperties) GetEarliestRestoreTimeAsTime() (*time.Time, error) { - if o.EarliestRestoreTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EarliestRestoreTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *ServerGroupProperties) SetEarliestRestoreTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EarliestRestoreTime = &formatted -} - -func (o *ServerGroupProperties) GetPointInTimeUTCAsTime() (*time.Time, error) { - if o.PointInTimeUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.PointInTimeUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ServerGroupProperties) SetPointInTimeUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.PointInTimeUTC = &formatted -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesdelegatedsubnetarguments.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesdelegatedsubnetarguments.go deleted file mode 100644 index 74885835fc6..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesdelegatedsubnetarguments.go +++ /dev/null @@ -1,8 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupPropertiesDelegatedSubnetArguments struct { - SubnetArmResourceId *string `json:"subnetArmResourceId,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesforupdate.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesforupdate.go deleted file mode 100644 index ac18e290ecc..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesforupdate.go +++ /dev/null @@ -1,16 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupPropertiesForUpdate struct { - AdministratorLoginPassword *string `json:"administratorLoginPassword,omitempty"` - AvailabilityZone *string `json:"availabilityZone,omitempty"` - BackupRetentionDays *int64 `json:"backupRetentionDays,omitempty"` - CitusVersion *CitusVersion `json:"citusVersion,omitempty"` - EnableShardsOnCoordinator *bool `json:"enableShardsOnCoordinator,omitempty"` - MaintenanceWindow *MaintenanceWindow `json:"maintenanceWindow,omitempty"` - PostgresqlVersion *PostgreSQLVersion `json:"postgresqlVersion,omitempty"` - ServerRoleGroups *[]ServerRoleGroup `json:"serverRoleGroups,omitempty"` - StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesprivatednszonearguments.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesprivatednszonearguments.go deleted file mode 100644 index 330b39d2d10..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servergrouppropertiesprivatednszonearguments.go +++ /dev/null @@ -1,8 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupPropertiesPrivateDnsZoneArguments struct { - PrivateDnsZoneArmResourceId *string `json:"privateDnsZoneArmResourceId,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servernameitem.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servernameitem.go deleted file mode 100644 index 3be67477977..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_servernameitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerNameItem struct { - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_serverrolegroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_serverrolegroup.go deleted file mode 100644 index 18772ed9d55..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/model_serverrolegroup.go +++ /dev/null @@ -1,16 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerRoleGroup struct { - EnableHa *bool `json:"enableHa,omitempty"` - EnablePublicIP *bool `json:"enablePublicIp,omitempty"` - Name *string `json:"name,omitempty"` - Role *ServerRole `json:"role,omitempty"` - ServerCount *int64 `json:"serverCount,omitempty"` - ServerEdition *ServerEdition `json:"serverEdition,omitempty"` - ServerNames *[]ServerNameItem `json:"serverNames,omitempty"` - StorageQuotaInMb *int64 `json:"storageQuotaInMb,omitempty"` - VCores *int64 `json:"vCores,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/predicates.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/predicates.go deleted file mode 100644 index f25a7708385..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package servergroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p ServerGroupOperationPredicate) Matches(input ServerGroup) 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/postgresqlhsc/2020-10-05-privatepreview/servergroups/version.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/version.go deleted file mode 100644 index 87d6632d09b..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servergroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package servergroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2020-10-05-privatepreview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/servergroups/%s", defaultApiVersion) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/README.md b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/README.md deleted file mode 100644 index 2f735acf2e9..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/README.md +++ /dev/null @@ -1,52 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers` Documentation - -The `servers` SDK allows for interaction with the Azure Resource Manager Service `postgresqlhsc` (API Version `2020-10-05-privatepreview`). - -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/postgresqlhsc/2020-10-05-privatepreview/servers" -``` - - -### Client Initialization - -```go -client := servers.NewServersClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ServersClient.Get` - -```go -ctx := context.TODO() -id := servers.NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "serverValue") - -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: `ServersClient.ListByServerGroup` - -```go -ctx := context.TODO() -id := servers.NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - -read, err := client.ListByServerGroup(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/postgresqlhsc/2020-10-05-privatepreview/servers/client.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/client.go deleted file mode 100644 index 64c1b8daeb3..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package servers - -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 ServersClient struct { - Client *resourcemanager.Client -} - -func NewServersClientWithBaseURI(sdkApi sdkEnv.Api) (*ServersClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "servers", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ServersClient: %+v", err) - } - - return &ServersClient{ - Client: client, - }, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/constants.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/constants.go deleted file mode 100644 index e305ddf65c6..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/constants.go +++ /dev/null @@ -1,304 +0,0 @@ -package servers - -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 CitusVersion string - -const ( - CitusVersionEightPointThree CitusVersion = "8.3" - CitusVersionNinePointFive CitusVersion = "9.5" - CitusVersionNinePointFour CitusVersion = "9.4" - CitusVersionNinePointOne CitusVersion = "9.1" - CitusVersionNinePointThree CitusVersion = "9.3" - CitusVersionNinePointTwo CitusVersion = "9.2" - CitusVersionNinePointZero CitusVersion = "9.0" -) - -func PossibleValuesForCitusVersion() []string { - return []string{ - string(CitusVersionEightPointThree), - string(CitusVersionNinePointFive), - string(CitusVersionNinePointFour), - string(CitusVersionNinePointOne), - string(CitusVersionNinePointThree), - string(CitusVersionNinePointTwo), - string(CitusVersionNinePointZero), - } -} - -func (s *CitusVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCitusVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCitusVersion(input string) (*CitusVersion, error) { - vals := map[string]CitusVersion{ - "8.3": CitusVersionEightPointThree, - "9.5": CitusVersionNinePointFive, - "9.4": CitusVersionNinePointFour, - "9.1": CitusVersionNinePointOne, - "9.3": CitusVersionNinePointThree, - "9.2": CitusVersionNinePointTwo, - "9.0": CitusVersionNinePointZero, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CitusVersion(input) - return &out, nil -} - -type PostgreSQLVersion string - -const ( - PostgreSQLVersionOneOne PostgreSQLVersion = "11" - PostgreSQLVersionOneTwo PostgreSQLVersion = "12" -) - -func PossibleValuesForPostgreSQLVersion() []string { - return []string{ - string(PostgreSQLVersionOneOne), - string(PostgreSQLVersionOneTwo), - } -} - -func (s *PostgreSQLVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePostgreSQLVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePostgreSQLVersion(input string) (*PostgreSQLVersion, error) { - vals := map[string]PostgreSQLVersion{ - "11": PostgreSQLVersionOneOne, - "12": PostgreSQLVersionOneTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PostgreSQLVersion(input) - return &out, nil -} - -type ServerEdition string - -const ( - ServerEditionGeneralPurpose ServerEdition = "GeneralPurpose" - ServerEditionMemoryOptimized ServerEdition = "MemoryOptimized" -) - -func PossibleValuesForServerEdition() []string { - return []string{ - string(ServerEditionGeneralPurpose), - string(ServerEditionMemoryOptimized), - } -} - -func (s *ServerEdition) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerEdition(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerEdition(input string) (*ServerEdition, error) { - vals := map[string]ServerEdition{ - "generalpurpose": ServerEditionGeneralPurpose, - "memoryoptimized": ServerEditionMemoryOptimized, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerEdition(input) - return &out, nil -} - -type ServerHaState string - -const ( - ServerHaStateCreatingStandby ServerHaState = "CreatingStandby" - ServerHaStateFailingOver ServerHaState = "FailingOver" - ServerHaStateHealthy ServerHaState = "Healthy" - ServerHaStateNotEnabled ServerHaState = "NotEnabled" - ServerHaStateNotSync ServerHaState = "NotSync" - ServerHaStateRemovingStandby ServerHaState = "RemovingStandby" - ServerHaStateReplicatingData ServerHaState = "ReplicatingData" -) - -func PossibleValuesForServerHaState() []string { - return []string{ - string(ServerHaStateCreatingStandby), - string(ServerHaStateFailingOver), - string(ServerHaStateHealthy), - string(ServerHaStateNotEnabled), - string(ServerHaStateNotSync), - string(ServerHaStateRemovingStandby), - string(ServerHaStateReplicatingData), - } -} - -func (s *ServerHaState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerHaState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerHaState(input string) (*ServerHaState, error) { - vals := map[string]ServerHaState{ - "creatingstandby": ServerHaStateCreatingStandby, - "failingover": ServerHaStateFailingOver, - "healthy": ServerHaStateHealthy, - "notenabled": ServerHaStateNotEnabled, - "notsync": ServerHaStateNotSync, - "removingstandby": ServerHaStateRemovingStandby, - "replicatingdata": ServerHaStateReplicatingData, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerHaState(input) - return &out, nil -} - -type ServerRole string - -const ( - ServerRoleCoordinator ServerRole = "Coordinator" - ServerRoleWorker ServerRole = "Worker" -) - -func PossibleValuesForServerRole() []string { - return []string{ - string(ServerRoleCoordinator), - string(ServerRoleWorker), - } -} - -func (s *ServerRole) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerRole(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerRole(input string) (*ServerRole, error) { - vals := map[string]ServerRole{ - "coordinator": ServerRoleCoordinator, - "worker": ServerRoleWorker, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerRole(input) - return &out, nil -} - -type ServerState string - -const ( - ServerStateDisabled ServerState = "Disabled" - ServerStateDropping ServerState = "Dropping" - ServerStateProvisioning ServerState = "Provisioning" - ServerStateReady ServerState = "Ready" - ServerStateStarting ServerState = "Starting" - ServerStateStopped ServerState = "Stopped" - ServerStateStopping ServerState = "Stopping" - ServerStateUpdating ServerState = "Updating" -) - -func PossibleValuesForServerState() []string { - return []string{ - string(ServerStateDisabled), - string(ServerStateDropping), - string(ServerStateProvisioning), - string(ServerStateReady), - string(ServerStateStarting), - string(ServerStateStopped), - string(ServerStateStopping), - string(ServerStateUpdating), - } -} - -func (s *ServerState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseServerState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseServerState(input string) (*ServerState, error) { - vals := map[string]ServerState{ - "disabled": ServerStateDisabled, - "dropping": ServerStateDropping, - "provisioning": ServerStateProvisioning, - "ready": ServerStateReady, - "starting": ServerStateStarting, - "stopped": ServerStateStopped, - "stopping": ServerStateStopping, - "updating": ServerStateUpdating, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ServerState(input) - return &out, nil -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server.go deleted file mode 100644 index af75f444e0a..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server.go +++ /dev/null @@ -1,139 +0,0 @@ -package servers - -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(&ServerId{}) -} - -var _ resourceids.ResourceId = &ServerId{} - -// ServerId is a struct representing the Resource ID for a Server -type ServerId struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string - ServerName string -} - -// NewServerID returns a new ServerId struct -func NewServerID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string, serverName string) ServerId { - return ServerId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - ServerName: serverName, - } -} - -// ParseServerID parses 'input' into a ServerId -func ParseServerID(input string) (*ServerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerIDInsensitively parses 'input' case-insensitively into a ServerId -// note: this method should only be used for API response data and not user input -func ParseServerIDInsensitively(input string) (*ServerId, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerId) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - if id.ServerName, ok = input.Parsed["serverName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverName", input) - } - - return nil -} - -// ValidateServerID checks that 'input' can be parsed as a Server ID -func ValidateServerID(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 := ParseServerID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server ID -func (id ServerId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s/servers/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name, id.ServerName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server ID -func (id ServerId) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - resourceids.StaticSegment("staticServers", "servers", "servers"), - resourceids.UserSpecifiedSegment("serverName", "serverValue"), - } -} - -// String returns a human-readable description of this Server ID -func (id ServerId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - fmt.Sprintf("Server Name: %q", id.ServerName), - } - return fmt.Sprintf("Server (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server_test.go deleted file mode 100644 index 8fe8904c4d4..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_server_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package servers - -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 = &ServerId{} - -func TestNewServerID(t *testing.T) { - id := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "serverValue") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } - - if id.ServerName != "serverValue" { - t.Fatalf("Expected %q but got %q for Segment 'ServerName'", id.ServerName, "serverValue") - } -} - -func TestFormatServerID(t *testing.T) { - actual := NewServerID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value", "serverValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - ServerName: "serverValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - - } -} - -func TestParseServerIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerId - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/sErVeRs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - ServerName: "serverValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/servers/serverValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/sErVeRs/sErVeRvAlUe", - Expected: &ServerId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - ServerName: "sErVeRvAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/sErVeRs/sErVeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerIDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - if actual.ServerName != v.Expected.ServerName { - t.Fatalf("Expected %q but got %q for ServerName", v.Expected.ServerName, actual.ServerName) - } - - } -} - -func TestSegmentsForServerId(t *testing.T) { - segments := ServerId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerId 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/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2.go deleted file mode 100644 index d8c475b2831..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2.go +++ /dev/null @@ -1,130 +0,0 @@ -package servers - -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(&ServerGroupsv2Id{}) -} - -var _ resourceids.ResourceId = &ServerGroupsv2Id{} - -// ServerGroupsv2Id is a struct representing the Resource ID for a Server Groupsv 2 -type ServerGroupsv2Id struct { - SubscriptionId string - ResourceGroupName string - ServerGroupsv2Name string -} - -// NewServerGroupsv2ID returns a new ServerGroupsv2Id struct -func NewServerGroupsv2ID(subscriptionId string, resourceGroupName string, serverGroupsv2Name string) ServerGroupsv2Id { - return ServerGroupsv2Id{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - ServerGroupsv2Name: serverGroupsv2Name, - } -} - -// ParseServerGroupsv2ID parses 'input' into a ServerGroupsv2Id -func ParseServerGroupsv2ID(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseServerGroupsv2IDInsensitively parses 'input' case-insensitively into a ServerGroupsv2Id -// note: this method should only be used for API response data and not user input -func ParseServerGroupsv2IDInsensitively(input string) (*ServerGroupsv2Id, error) { - parser := resourceids.NewParserFromResourceIdType(&ServerGroupsv2Id{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ServerGroupsv2Id{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ServerGroupsv2Id) 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.ServerGroupsv2Name, ok = input.Parsed["serverGroupsv2Name"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "serverGroupsv2Name", input) - } - - return nil -} - -// ValidateServerGroupsv2ID checks that 'input' can be parsed as a Server Groupsv 2 ID -func ValidateServerGroupsv2ID(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 := ParseServerGroupsv2ID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Server Groupsv 2 ID -func (id ServerGroupsv2Id) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.ServerGroupsv2Name) -} - -// Segments returns a slice of Resource ID Segments which comprise this Server Groupsv 2 ID -func (id ServerGroupsv2Id) 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("staticMicrosoftDBforPostgreSQL", "Microsoft.DBforPostgreSQL", "Microsoft.DBforPostgreSQL"), - resourceids.StaticSegment("staticServerGroupsv2", "serverGroupsv2", "serverGroupsv2"), - resourceids.UserSpecifiedSegment("serverGroupsv2Name", "serverGroupsv2Value"), - } -} - -// String returns a human-readable description of this Server Groupsv 2 ID -func (id ServerGroupsv2Id) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Server Groupsv 2 Name: %q", id.ServerGroupsv2Name), - } - return fmt.Sprintf("Server Groupsv 2 (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2_test.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2_test.go deleted file mode 100644 index d0bcad13d62..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/id_servergroupsv2_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package servers - -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 = &ServerGroupsv2Id{} - -func TestNewServerGroupsv2ID(t *testing.T) { - id := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value") - - 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.ServerGroupsv2Name != "serverGroupsv2Value" { - t.Fatalf("Expected %q but got %q for Segment 'ServerGroupsv2Name'", id.ServerGroupsv2Name, "serverGroupsv2Value") - } -} - -func TestFormatServerGroupsv2ID(t *testing.T) { - actual := NewServerGroupsv2ID("12345678-1234-9876-4563-123456789012", "example-resource-group", "serverGroupsv2Value").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseServerGroupsv2ID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2ID(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestParseServerGroupsv2IDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ServerGroupsv2Id - }{ - { - // 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.DBforPostgreSQL", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - ServerGroupsv2Name: "serverGroupsv2Value", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.DBforPostgreSQL/serverGroupsv2/serverGroupsv2Value/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe", - Expected: &ServerGroupsv2Id{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - ServerGroupsv2Name: "sErVeRgRoUpSv2vAlUe", - }, - }, - { - // 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.dBfOrPoStGrEsQl/sErVeRgRoUpSv2/sErVeRgRoUpSv2vAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseServerGroupsv2IDInsensitively(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.ServerGroupsv2Name != v.Expected.ServerGroupsv2Name { - t.Fatalf("Expected %q but got %q for ServerGroupsv2Name", v.Expected.ServerGroupsv2Name, actual.ServerGroupsv2Name) - } - - } -} - -func TestSegmentsForServerGroupsv2Id(t *testing.T) { - segments := ServerGroupsv2Id{}.Segments() - if len(segments) == 0 { - t.Fatalf("ServerGroupsv2Id 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/postgresqlhsc/2020-10-05-privatepreview/servers/method_get.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_get.go deleted file mode 100644 index 98fcc0b9443..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package servers - -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 *ServerGroupServer -} - -// Get ... -func (c ServersClient) Get(ctx context.Context, id ServerId) (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 ServerGroupServer - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_listbyservergroup.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_listbyservergroup.go deleted file mode 100644 index 3f3919f15d7..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/method_listbyservergroup.go +++ /dev/null @@ -1,55 +0,0 @@ -package servers - -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 ListByServerGroupOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ServerGroupServerListResult -} - -// ListByServerGroup ... -func (c ServersClient) ListByServerGroup(ctx context.Context, id ServerGroupsv2Id) (result ListByServerGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/servers", 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 ServerGroupServerListResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserver.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserver.go deleted file mode 100644 index abb0c9a1515..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserver.go +++ /dev/null @@ -1,16 +0,0 @@ -package servers - -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 ServerGroupServer struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ServerGroupServerProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverlistresult.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverlistresult.go deleted file mode 100644 index f7d65f04355..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverlistresult.go +++ /dev/null @@ -1,8 +0,0 @@ -package servers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupServerListResult struct { - Value *[]ServerGroupServer `json:"value,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverproperties.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverproperties.go deleted file mode 100644 index b6c69df6e95..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/model_servergroupserverproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package servers - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ServerGroupServerProperties struct { - AdministratorLogin *string `json:"administratorLogin,omitempty"` - AvailabilityZone *string `json:"availabilityZone,omitempty"` - CitusVersion *CitusVersion `json:"citusVersion,omitempty"` - EnableHa *bool `json:"enableHa,omitempty"` - EnablePublicIP *bool `json:"enablePublicIp,omitempty"` - FullyQualifiedDomainName *string `json:"fullyQualifiedDomainName,omitempty"` - HaState *ServerHaState `json:"haState,omitempty"` - PostgresqlVersion *PostgreSQLVersion `json:"postgresqlVersion,omitempty"` - Role *ServerRole `json:"role,omitempty"` - ServerEdition *ServerEdition `json:"serverEdition,omitempty"` - StandbyAvailabilityZone *string `json:"standbyAvailabilityZone,omitempty"` - State *ServerState `json:"state,omitempty"` - StorageQuotaInMb *int64 `json:"storageQuotaInMb,omitempty"` - VCores *int64 `json:"vCores,omitempty"` -} diff --git a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/version.go b/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/version.go deleted file mode 100644 index 5b1f8666aac..00000000000 --- a/resource-manager/postgresqlhsc/2020-10-05-privatepreview/servers/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package servers - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2020-10-05-privatepreview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/servers/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/client.go b/resource-manager/recoveryservices/2023-02-01/client.go deleted file mode 100644 index 53a5548491d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_02_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/recoveryservices/2023-02-01/getprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/recoveryservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/registeredidentities" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/replicationusages" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaultcertificates" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaults" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaultusages" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - GetPrivateLinkResources *getprivatelinkresources.GetPrivateLinkResourcesClient - ListPrivateLinkResources *listprivatelinkresources.ListPrivateLinkResourcesClient - RecoveryServices *recoveryservices.RecoveryServicesClient - RegisteredIdentities *registeredidentities.RegisteredIdentitiesClient - ReplicationUsages *replicationusages.ReplicationUsagesClient - VaultCertificates *vaultcertificates.VaultCertificatesClient - VaultExtendedInfo *vaultextendedinfo.VaultExtendedInfoClient - VaultUsages *vaultusages.VaultUsagesClient - Vaults *vaults.VaultsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - getPrivateLinkResourcesClient, err := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building GetPrivateLinkResources client: %+v", err) - } - configureFunc(getPrivateLinkResourcesClient.Client) - - listPrivateLinkResourcesClient, err := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ListPrivateLinkResources client: %+v", err) - } - configureFunc(listPrivateLinkResourcesClient.Client) - - recoveryServicesClient, err := recoveryservices.NewRecoveryServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RecoveryServices client: %+v", err) - } - configureFunc(recoveryServicesClient.Client) - - registeredIdentitiesClient, err := registeredidentities.NewRegisteredIdentitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RegisteredIdentities client: %+v", err) - } - configureFunc(registeredIdentitiesClient.Client) - - replicationUsagesClient, err := replicationusages.NewReplicationUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ReplicationUsages client: %+v", err) - } - configureFunc(replicationUsagesClient.Client) - - vaultCertificatesClient, err := vaultcertificates.NewVaultCertificatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultCertificates client: %+v", err) - } - configureFunc(vaultCertificatesClient.Client) - - vaultExtendedInfoClient, err := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultExtendedInfo client: %+v", err) - } - configureFunc(vaultExtendedInfoClient.Client) - - vaultUsagesClient, err := vaultusages.NewVaultUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultUsages client: %+v", err) - } - configureFunc(vaultUsagesClient.Client) - - vaultsClient, err := vaults.NewVaultsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Vaults client: %+v", err) - } - configureFunc(vaultsClient.Client) - - return &Client{ - GetPrivateLinkResources: getPrivateLinkResourcesClient, - ListPrivateLinkResources: listPrivateLinkResourcesClient, - RecoveryServices: recoveryServicesClient, - RegisteredIdentities: registeredIdentitiesClient, - ReplicationUsages: replicationUsagesClient, - VaultCertificates: vaultCertificatesClient, - VaultExtendedInfo: vaultExtendedInfoClient, - VaultUsages: vaultUsagesClient, - Vaults: vaultsClient, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/README.md deleted file mode 100644 index f81d978df3d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources` Documentation - -The `getprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/getprivatelinkresources" -``` - - -### Client Initialization - -```go -client := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `GetPrivateLinkResourcesClient.PrivateLinkResourcesGet` - -```go -ctx := context.TODO() -id := getprivatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - -read, err := client.PrivateLinkResourcesGet(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/recoveryservices/2023-02-01/getprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/client.go deleted file mode 100644 index 2c788db4e51..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package getprivatelinkresources - -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 GetPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*GetPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "getprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating GetPrivateLinkResourcesClient: %+v", err) - } - - return &GetPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource.go deleted file mode 100644 index 70ee568e5d3..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package getprivatelinkresources - -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(&PrivateLinkResourceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkResourceId{} - -// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource -type PrivateLinkResourceId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - PrivateLinkResourceName string -} - -// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct -func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, vaultName string, privateLinkResourceName string) PrivateLinkResourceId { - return PrivateLinkResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - PrivateLinkResourceName: privateLinkResourceName, - } -} - -// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId -func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkResourceId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) - } - - return nil -} - -// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID -func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Resource ID -func (id PrivateLinkResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/privateLinkResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.PrivateLinkResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID -func (id PrivateLinkResourceId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), - } -} - -// String returns a human-readable description of this Private Link Resource ID -func (id PrivateLinkResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), - } - return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource_test.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource_test.go deleted file mode 100644 index 7ee1c858da1..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/id_privatelinkresource_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package getprivatelinkresources - -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 = &PrivateLinkResourceId{} - -func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.PrivateLinkResourceName != "privateLinkResourceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceValue") - } -} - -func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkResourceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestSegmentsForPrivateLinkResourceId(t *testing.T) { - segments := PrivateLinkResourceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkResourceId 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/recoveryservices/2023-02-01/getprivatelinkresources/method_privatelinkresourcesget.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/method_privatelinkresourcesget.go deleted file mode 100644 index 8074fb34792..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/method_privatelinkresourcesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package getprivatelinkresources - -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 PrivateLinkResourcesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkResource -} - -// PrivateLinkResourcesGet ... -func (c GetPrivateLinkResourcesClient) PrivateLinkResourcesGet(ctx context.Context, id PrivateLinkResourceId) (result PrivateLinkResourcesGetOperationResponse, 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 PrivateLinkResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 36e56a45b5e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package getprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index 92b1276283a..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package getprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/version.go deleted file mode 100644 index 5ddb5b9df92..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/getprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package getprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/getprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/README.md deleted file mode 100644 index 80d54b345ec..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources` Documentation - -The `listprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/listprivatelinkresources" -``` - - -### Client Initialization - -```go -client := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ListPrivateLinkResourcesClient.PrivateLinkResourcesList` - -```go -ctx := context.TODO() -id := listprivatelinkresources.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -// alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination -items, err := client.PrivateLinkResourcesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/client.go deleted file mode 100644 index d68ed338ccc..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package listprivatelinkresources - -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 ListPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewListPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ListPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "listprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ListPrivateLinkResourcesClient: %+v", err) - } - - return &ListPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault.go deleted file mode 100644 index 332d5bf97d5..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package listprivatelinkresources - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault_test.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault_test.go deleted file mode 100644 index 79099dc74de..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package listprivatelinkresources - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-02-01/listprivatelinkresources/method_privatelinkresourceslist.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/method_privatelinkresourceslist.go deleted file mode 100644 index 994db6cbef7..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/method_privatelinkresourceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package listprivatelinkresources - -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 PrivateLinkResourcesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkResource -} - -type PrivateLinkResourcesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkResource -} - -// PrivateLinkResourcesList ... -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesList(ctx context.Context, id VaultId) (result PrivateLinkResourcesListOperationResponse, 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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateLinkResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PrivateLinkResourcesListComplete retrieves all the results into a single object -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListComplete(ctx context.Context, id VaultId) (PrivateLinkResourcesListCompleteResult, error) { - return c.PrivateLinkResourcesListCompleteMatchingPredicate(ctx, id, PrivateLinkResourceOperationPredicate{}) -} - -// PrivateLinkResourcesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListCompleteMatchingPredicate(ctx context.Context, id VaultId, predicate PrivateLinkResourceOperationPredicate) (result PrivateLinkResourcesListCompleteResult, err error) { - items := make([]PrivateLinkResource, 0) - - resp, err := c.PrivateLinkResourcesList(ctx, id) - if err != nil { - 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 = PrivateLinkResourcesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 43ad3ab77fa..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package listprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index b1ff4a935fd..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/predicates.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/predicates.go deleted file mode 100644 index 5eb0bb91e57..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PrivateLinkResourceOperationPredicate) Matches(input PrivateLinkResource) 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/recoveryservices/2023-02-01/listprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/version.go deleted file mode 100644 index f295380ef11..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/listprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package listprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/listprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/README.md b/resource-manager/recoveryservices/2023-02-01/recoveryservices/README.md deleted file mode 100644 index db1e67ff294..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/README.md +++ /dev/null @@ -1,62 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/recoveryservices` Documentation - -The `recoveryservices` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/recoveryservices" -``` - - -### Client Initialization - -```go -client := recoveryservices.NewRecoveryServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RecoveryServicesClient.Capabilities` - -```go -ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := recoveryservices.ResourceCapabilities{ - // ... -} - - -read, err := client.Capabilities(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RecoveryServicesClient.CheckNameAvailability` - -```go -ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := recoveryservices.CheckNameAvailabilityParameters{ - // ... -} - - -read, err := client.CheckNameAvailability(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/recoveryservices/2023-02-01/recoveryservices/client.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/client.go deleted file mode 100644 index 518088771ea..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package recoveryservices - -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 RecoveryServicesClient struct { - Client *resourcemanager.Client -} - -func NewRecoveryServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*RecoveryServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "recoveryservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RecoveryServicesClient: %+v", err) - } - - return &RecoveryServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/constants.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/constants.go deleted file mode 100644 index 920bcd8e566..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package recoveryservices - -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 VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location.go deleted file mode 100644 index 1fd49c9d992..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package recoveryservices - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservices/2023-02-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location_test.go deleted file mode 100644 index 3c75d278a94..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package recoveryservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservices/2023-02-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation.go deleted file mode 100644 index 33d3548750d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package recoveryservices - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation_test.go deleted file mode 100644 index 28405ec9bd8..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package recoveryservices - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/recoveryservices/2023-02-01/recoveryservices/method_capabilities.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/method_capabilities.go deleted file mode 100644 index 5864d60faeb..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/method_capabilities.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CapabilitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CapabilitiesResponse -} - -// Capabilities ... -func (c RecoveryServicesClient) Capabilities(ctx context.Context, id LocationId, input ResourceCapabilities) (result CapabilitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/capabilities", 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 CapabilitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/method_checknameavailability.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/method_checknameavailability.go deleted file mode 100644 index 3512794c701..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/method_checknameavailability.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CheckNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CheckNameAvailabilityResult -} - -// CheckNameAvailability ... -func (c RecoveryServicesClient) CheckNameAvailability(ctx context.Context, id ProviderLocationId, input CheckNameAvailabilityParameters) (result CheckNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkNameAvailability", 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 CheckNameAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesproperties.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesproperties.go deleted file mode 100644 index 3698ddb8850..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesProperties struct { - DnsZones *[]DNSZone `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponse.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponse.go deleted file mode 100644 index 47e4997660f..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponse struct { - Properties *CapabilitiesResponseProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponseproperties.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponseproperties.go deleted file mode 100644 index 8c1bfbcac8d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_capabilitiesresponseproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponseProperties struct { - DnsZones *[]DNSZoneResponse `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityparameters.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityparameters.go deleted file mode 100644 index e6c5aff2402..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityParameters struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityresult.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityresult.go deleted file mode 100644 index d2840ec335e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_checknameavailabilityresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityResult struct { - Message *string `json:"message,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason *string `json:"reason,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszone.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszone.go deleted file mode 100644 index 34952cfbd7e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszone.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZone struct { - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszoneresponse.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszoneresponse.go deleted file mode 100644 index 4aabe0bd6d4..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_dnszoneresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZoneResponse struct { - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_resourcecapabilities.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_resourcecapabilities.go deleted file mode 100644 index 16d3a668058..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/model_resourcecapabilities.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceCapabilities struct { - Properties *CapabilitiesProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/recoveryservices/version.go b/resource-manager/recoveryservices/2023-02-01/recoveryservices/version.go deleted file mode 100644 index 50cddcb47fb..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/recoveryservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoveryservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/recoveryservices/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/registeredidentities/client.go b/resource-manager/recoveryservices/2023-02-01/registeredidentities/client.go deleted file mode 100644 index 36b4015e582..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/registeredidentities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient struct { - Client *resourcemanager.Client -} - -func NewRegisteredIdentitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*RegisteredIdentitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "registeredidentities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RegisteredIdentitiesClient: %+v", err) - } - - return &RegisteredIdentitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity.go deleted file mode 100644 index 147a6d0d6e3..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity.go +++ /dev/null @@ -1,139 +0,0 @@ -package registeredidentities - -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(&RegisteredIdentityId{}) -} - -var _ resourceids.ResourceId = &RegisteredIdentityId{} - -// RegisteredIdentityId is a struct representing the Resource ID for a Registered Identity -type RegisteredIdentityId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - RegisteredIdentityName string -} - -// NewRegisteredIdentityID returns a new RegisteredIdentityId struct -func NewRegisteredIdentityID(subscriptionId string, resourceGroupName string, vaultName string, registeredIdentityName string) RegisteredIdentityId { - return RegisteredIdentityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - RegisteredIdentityName: registeredIdentityName, - } -} - -// ParseRegisteredIdentityID parses 'input' into a RegisteredIdentityId -func ParseRegisteredIdentityID(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegisteredIdentityIDInsensitively parses 'input' case-insensitively into a RegisteredIdentityId -// note: this method should only be used for API response data and not user input -func ParseRegisteredIdentityIDInsensitively(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegisteredIdentityId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.RegisteredIdentityName, ok = input.Parsed["registeredIdentityName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registeredIdentityName", input) - } - - return nil -} - -// ValidateRegisteredIdentityID checks that 'input' can be parsed as a Registered Identity ID -func ValidateRegisteredIdentityID(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 := ParseRegisteredIdentityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registered Identity ID -func (id RegisteredIdentityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/registeredIdentities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.RegisteredIdentityName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registered Identity ID -func (id RegisteredIdentityId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityValue"), - } -} - -// String returns a human-readable description of this Registered Identity ID -func (id RegisteredIdentityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Registered Identity Name: %q", id.RegisteredIdentityName), - } - return fmt.Sprintf("Registered Identity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity_test.go deleted file mode 100644 index 6857bb4f14e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/registeredidentities/id_registeredidentity_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package registeredidentities - -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 = &RegisteredIdentityId{} - -func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.RegisteredIdentityName != "registeredIdentityValue" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityValue") - } -} - -func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRegisteredIdentityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - RegisteredIdentityName: "rEgIsTeReDiDeNtItYvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestSegmentsForRegisteredIdentityId(t *testing.T) { - segments := RegisteredIdentityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RegisteredIdentityId 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/recoveryservices/2023-02-01/registeredidentities/method_delete.go b/resource-manager/recoveryservices/2023-02-01/registeredidentities/method_delete.go deleted file mode 100644 index 16a5301af92..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/registeredidentities/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient) Delete(ctx context.Context, id RegisteredIdentityId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/registeredidentities/version.go b/resource-manager/recoveryservices/2023-02-01/registeredidentities/version.go deleted file mode 100644 index 757521f7851..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/registeredidentities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package registeredidentities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/registeredidentities/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/README.md b/resource-manager/recoveryservices/2023-02-01/replicationusages/README.md deleted file mode 100644 index c4f0f9f881d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/replicationusages` Documentation - -The `replicationusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/replicationusages" -``` - - -### Client Initialization - -```go -client := replicationusages.NewReplicationUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ReplicationUsagesClient.List` - -```go -ctx := context.TODO() -id := replicationusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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/recoveryservices/2023-02-01/replicationusages/client.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/client.go deleted file mode 100644 index 40ebde8ba63..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package replicationusages - -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 ReplicationUsagesClient struct { - Client *resourcemanager.Client -} - -func NewReplicationUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "replicationusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ReplicationUsagesClient: %+v", err) - } - - return &ReplicationUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault.go deleted file mode 100644 index 338b117c7be..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package replicationusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault_test.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault_test.go deleted file mode 100644 index 679ad2eacfb..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package replicationusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-02-01/replicationusages/method_list.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/method_list.go deleted file mode 100644 index 67aa893023e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package replicationusages - -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 *ReplicationUsageList -} - -// List ... -func (c ReplicationUsagesClient) List(ctx context.Context, id VaultId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/replicationUsages", 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 ReplicationUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_jobssummary.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/model_jobssummary.go deleted file mode 100644 index b4e8997b7d2..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_jobssummary.go +++ /dev/null @@ -1,10 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobsSummary struct { - FailedJobs *int64 `json:"failedJobs,omitempty"` - InProgressJobs *int64 `json:"inProgressJobs,omitempty"` - SuspendedJobs *int64 `json:"suspendedJobs,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_monitoringsummary.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/model_monitoringsummary.go deleted file mode 100644 index fbf4ba89507..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_monitoringsummary.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSummary struct { - DeprecatedProviderCount *int64 `json:"deprecatedProviderCount,omitempty"` - EventsCount *int64 `json:"eventsCount,omitempty"` - SupportedProviderCount *int64 `json:"supportedProviderCount,omitempty"` - UnHealthyProviderCount *int64 `json:"unHealthyProviderCount,omitempty"` - UnHealthyVMCount *int64 `json:"unHealthyVmCount,omitempty"` - UnsupportedProviderCount *int64 `json:"unsupportedProviderCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusage.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusage.go deleted file mode 100644 index 0842f810533..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusage.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsage struct { - JobsSummary *JobsSummary `json:"jobsSummary,omitempty"` - MonitoringSummary *MonitoringSummary `json:"monitoringSummary,omitempty"` - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - RecoveryPlanCount *int64 `json:"recoveryPlanCount,omitempty"` - RecoveryServicesProviderAuthType *int64 `json:"recoveryServicesProviderAuthType,omitempty"` - RegisteredServersCount *int64 `json:"registeredServersCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusagelist.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusagelist.go deleted file mode 100644 index 11300c459d2..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/model_replicationusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsageList struct { - Value *[]ReplicationUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/replicationusages/version.go b/resource-manager/recoveryservices/2023-02-01/replicationusages/version.go deleted file mode 100644 index 384bba41329..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/replicationusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package replicationusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/replicationusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/README.md b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/README.md deleted file mode 100644 index 5b7a0df2eb8..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaultcertificates` Documentation - -The `vaultcertificates` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/vaultcertificates" -``` - - -### Client Initialization - -```go -client := vaultcertificates.NewVaultCertificatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultCertificatesClient.Create` - -```go -ctx := context.TODO() -id := vaultcertificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - -payload := vaultcertificates.CertificateRequest{ - // ... -} - - -read, err := client.Create(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/recoveryservices/2023-02-01/vaultcertificates/client.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/client.go deleted file mode 100644 index f25a5998dcc..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultcertificates - -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 VaultCertificatesClient struct { - Client *resourcemanager.Client -} - -func NewVaultCertificatesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultCertificatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultcertificates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultCertificatesClient: %+v", err) - } - - return &VaultCertificatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/constants.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/constants.go deleted file mode 100644 index 66072e83ada..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package vaultcertificates - -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 AuthType string - -const ( - AuthTypeAAD AuthType = "AAD" - AuthTypeACS AuthType = "ACS" - AuthTypeAccessControlService AuthType = "AccessControlService" - AuthTypeAzureActiveDirectory AuthType = "AzureActiveDirectory" - AuthTypeInvalid AuthType = "Invalid" -) - -func PossibleValuesForAuthType() []string { - return []string{ - string(AuthTypeAAD), - string(AuthTypeACS), - string(AuthTypeAccessControlService), - string(AuthTypeAzureActiveDirectory), - string(AuthTypeInvalid), - } -} - -func (s *AuthType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthType(input string) (*AuthType, error) { - vals := map[string]AuthType{ - "aad": AuthTypeAAD, - "acs": AuthTypeACS, - "accesscontrolservice": AuthTypeAccessControlService, - "azureactivedirectory": AuthTypeAzureActiveDirectory, - "invalid": AuthTypeInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate.go deleted file mode 100644 index 1a998266e49..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate.go +++ /dev/null @@ -1,139 +0,0 @@ -package vaultcertificates - -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(&CertificateId{}) -} - -var _ resourceids.ResourceId = &CertificateId{} - -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - CertificateName string -} - -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, vaultName string, certificateName string) CertificateId { - return CertificateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - CertificateName: certificateName, - } -} - -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId -// note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CertificateId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.CertificateName, ok = input.Parsed["certificateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "certificateName", input) - } - - return nil -} - -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(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 := ParseCertificateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/certificates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.CertificateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "certificateValue"), - } -} - -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Certificate Name: %q", id.CertificateName), - } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate_test.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate_test.go deleted file mode 100644 index 2e113a065ed..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/id_certificate_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package vaultcertificates - -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 = &CertificateId{} - -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.CertificateName != "certificateValue" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateValue") - } -} - -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCertificateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestParseCertificateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - CertificateName: "cErTiFiCaTeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CertificateId 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/recoveryservices/2023-02-01/vaultcertificates/method_create.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/method_create.go deleted file mode 100644 index 1be290d4f6b..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaultcertificates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultCertificateResponse -} - -// Create ... -func (c VaultCertificatesClient) Create(ctx context.Context, id CertificateId, input CertificateRequest) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 VaultCertificateResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_certificaterequest.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_certificaterequest.go deleted file mode 100644 index 64984a9fb6e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_certificaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CertificateRequest struct { - Properties *RawCertificateData `json:"properties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_rawcertificatedata.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_rawcertificatedata.go deleted file mode 100644 index 2b6657d3813..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_rawcertificatedata.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RawCertificateData struct { - AuthType *AuthType `json:"authType,omitempty"` - Certificate *string `json:"certificate,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandaaddetails.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandaaddetails.go deleted file mode 100644 index 59f9a303924..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandaaddetails.go +++ /dev/null @@ -1,82 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAadDetails{} - -type ResourceCertificateAndAadDetails struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadAuthority string `json:"aadAuthority"` - AadTenantId string `json:"aadTenantId"` - AzureManagementEndpointAudience string `json:"azureManagementEndpointAudience"` - ServicePrincipalClientId string `json:"servicePrincipalClientId"` - ServicePrincipalObjectId string `json:"servicePrincipalObjectId"` - ServiceResourceId *string `json:"serviceResourceId,omitempty"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAadDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAadDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAadDetails{} - -func (s ResourceCertificateAndAadDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAadDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAadDetails: %+v", err) - } - decoded["authType"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandacsdetails.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandacsdetails.go deleted file mode 100644 index f0a2484e123..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificateandacsdetails.go +++ /dev/null @@ -1,78 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAcsDetails{} - -type ResourceCertificateAndAcsDetails struct { - GlobalAcsHostName string `json:"globalAcsHostName"` - GlobalAcsNamespace string `json:"globalAcsNamespace"` - GlobalAcsRPRealm string `json:"globalAcsRPRealm"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAcsDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAcsDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAcsDetails{} - -func (s ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAcsDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAcsDetails: %+v", err) - } - decoded["authType"] = "AccessControlService" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificatedetails.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificatedetails.go deleted file mode 100644 index 4057ff8ccdd..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_resourcecertificatedetails.go +++ /dev/null @@ -1,61 +0,0 @@ -package vaultcertificates - -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 ResourceCertificateDetails interface { -} - -// RawResourceCertificateDetailsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawResourceCertificateDetailsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalResourceCertificateDetailsImplementation(input []byte) (ResourceCertificateDetails, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateDetails into map[string]interface: %+v", err) - } - - value, ok := temp["authType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out ResourceCertificateAndAadDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAadDetails: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AccessControlService") { - var out ResourceCertificateAndAcsDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAcsDetails: %+v", err) - } - return out, nil - } - - out := RawResourceCertificateDetailsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_vaultcertificateresponse.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_vaultcertificateresponse.go deleted file mode 100644 index f5f8f52cf03..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/model_vaultcertificateresponse.go +++ /dev/null @@ -1,44 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultCertificateResponse struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ResourceCertificateDetails `json:"properties"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &VaultCertificateResponse{} - -func (s *VaultCertificateResponse) UnmarshalJSON(bytes []byte) error { - type alias VaultCertificateResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into VaultCertificateResponse: %+v", err) - } - - s.Id = decoded.Id - s.Name = decoded.Name - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling VaultCertificateResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalResourceCertificateDetailsImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'VaultCertificateResponse': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/version.go b/resource-manager/recoveryservices/2023-02-01/vaultcertificates/version.go deleted file mode 100644 index c277d821219..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultcertificates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultcertificates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultcertificates/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/README.md b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/README.md deleted file mode 100644 index 9be1b964dc3..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/README.md +++ /dev/null @@ -1,78 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo` Documentation - -The `vaultextendedinfo` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/vaultextendedinfo" -``` - - -### Client Initialization - -```go -client := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultExtendedInfoClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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: `VaultExtendedInfoClient.Get` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultExtendedInfoClient.Update` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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/recoveryservices/2023-02-01/vaultextendedinfo/client.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/client.go deleted file mode 100644 index d977cd83af4..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultextendedinfo - -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 VaultExtendedInfoClient struct { - Client *resourcemanager.Client -} - -func NewVaultExtendedInfoClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultExtendedInfoClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultextendedinfo", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultExtendedInfoClient: %+v", err) - } - - return &VaultExtendedInfoClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault.go deleted file mode 100644 index 383129a1d1e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultextendedinfo - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault_test.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault_test.go deleted file mode 100644 index cd8a330cad3..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultextendedinfo - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-02-01/vaultextendedinfo/method_createorupdate.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_createorupdate.go deleted file mode 100644 index 46299e1c76a..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// CreateOrUpdate ... -func (c VaultExtendedInfoClient) CreateOrUpdate(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_get.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_get.go deleted file mode 100644 index 63222675990..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultextendedinfo - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Get ... -func (c VaultExtendedInfoClient) Get(ctx context.Context, id VaultId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_update.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_update.go deleted file mode 100644 index 74d9926995b..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/method_update.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Update ... -func (c VaultExtendedInfoClient) Update(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinfo.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinfo.go deleted file mode 100644 index a1514fbe948..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfo struct { - Algorithm *string `json:"algorithm,omitempty"` - EncryptionKey *string `json:"encryptionKey,omitempty"` - EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` - IntegrityKey *string `json:"integrityKey,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinforesource.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinforesource.go deleted file mode 100644 index ee148aba996..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/model_vaultextendedinforesource.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfoResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultExtendedInfo `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/version.go b/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/version.go deleted file mode 100644 index f33460e7682..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultextendedinfo/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultextendedinfo/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/README.md b/resource-manager/recoveryservices/2023-02-01/vaults/README.md deleted file mode 100644 index 7212c8bb520..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaults` Documentation - -The `vaults` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/vaults" -``` - - -### Client Initialization - -```go -client := vaults.NewVaultsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.Vault{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VaultsClient.Delete` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.Get` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.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: `VaultsClient.ListBySubscriptionId` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscriptionId(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionIdComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VaultsClient.Update` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.PatchVault{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/client.go b/resource-manager/recoveryservices/2023-02-01/vaults/client.go deleted file mode 100644 index 1ddc5db936e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaults - -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 VaultsClient struct { - Client *resourcemanager.Client -} - -func NewVaultsClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaults", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultsClient: %+v", err) - } - - return &VaultsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/constants.go b/resource-manager/recoveryservices/2023-02-01/vaults/constants.go deleted file mode 100644 index dc6b20bffa9..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/constants.go +++ /dev/null @@ -1,723 +0,0 @@ -package vaults - -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 AlertsState string - -const ( - AlertsStateDisabled AlertsState = "Disabled" - AlertsStateEnabled AlertsState = "Enabled" -) - -func PossibleValuesForAlertsState() []string { - return []string{ - string(AlertsStateDisabled), - string(AlertsStateEnabled), - } -} - -func (s *AlertsState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertsState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertsState(input string) (*AlertsState, error) { - vals := map[string]AlertsState{ - "disabled": AlertsStateDisabled, - "enabled": AlertsStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertsState(input) - return &out, nil -} - -type BackupStorageVersion string - -const ( - BackupStorageVersionUnassigned BackupStorageVersion = "Unassigned" - BackupStorageVersionVOne BackupStorageVersion = "V1" - BackupStorageVersionVTwo BackupStorageVersion = "V2" -) - -func PossibleValuesForBackupStorageVersion() []string { - return []string{ - string(BackupStorageVersionUnassigned), - string(BackupStorageVersionVOne), - string(BackupStorageVersionVTwo), - } -} - -func (s *BackupStorageVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBackupStorageVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBackupStorageVersion(input string) (*BackupStorageVersion, error) { - vals := map[string]BackupStorageVersion{ - "unassigned": BackupStorageVersionUnassigned, - "v1": BackupStorageVersionVOne, - "v2": BackupStorageVersionVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupStorageVersion(input) - return &out, nil -} - -type CrossRegionRestore string - -const ( - CrossRegionRestoreDisabled CrossRegionRestore = "Disabled" - CrossRegionRestoreEnabled CrossRegionRestore = "Enabled" -) - -func PossibleValuesForCrossRegionRestore() []string { - return []string{ - string(CrossRegionRestoreDisabled), - string(CrossRegionRestoreEnabled), - } -} - -func (s *CrossRegionRestore) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossRegionRestore(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossRegionRestore(input string) (*CrossRegionRestore, error) { - vals := map[string]CrossRegionRestore{ - "disabled": CrossRegionRestoreDisabled, - "enabled": CrossRegionRestoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossRegionRestore(input) - return &out, nil -} - -type CrossSubscriptionRestoreState string - -const ( - CrossSubscriptionRestoreStateDisabled CrossSubscriptionRestoreState = "Disabled" - CrossSubscriptionRestoreStateEnabled CrossSubscriptionRestoreState = "Enabled" - CrossSubscriptionRestoreStatePermanentlyDisabled CrossSubscriptionRestoreState = "PermanentlyDisabled" -) - -func PossibleValuesForCrossSubscriptionRestoreState() []string { - return []string{ - string(CrossSubscriptionRestoreStateDisabled), - string(CrossSubscriptionRestoreStateEnabled), - string(CrossSubscriptionRestoreStatePermanentlyDisabled), - } -} - -func (s *CrossSubscriptionRestoreState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossSubscriptionRestoreState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossSubscriptionRestoreState(input string) (*CrossSubscriptionRestoreState, error) { - vals := map[string]CrossSubscriptionRestoreState{ - "disabled": CrossSubscriptionRestoreStateDisabled, - "enabled": CrossSubscriptionRestoreStateEnabled, - "permanentlydisabled": CrossSubscriptionRestoreStatePermanentlyDisabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossSubscriptionRestoreState(input) - return &out, nil -} - -type ImmutabilityState string - -const ( - ImmutabilityStateDisabled ImmutabilityState = "Disabled" - ImmutabilityStateLocked ImmutabilityState = "Locked" - ImmutabilityStateUnlocked ImmutabilityState = "Unlocked" -) - -func PossibleValuesForImmutabilityState() []string { - return []string{ - string(ImmutabilityStateDisabled), - string(ImmutabilityStateLocked), - string(ImmutabilityStateUnlocked), - } -} - -func (s *ImmutabilityState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImmutabilityState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImmutabilityState(input string) (*ImmutabilityState, error) { - vals := map[string]ImmutabilityState{ - "disabled": ImmutabilityStateDisabled, - "locked": ImmutabilityStateLocked, - "unlocked": ImmutabilityStateUnlocked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImmutabilityState(input) - return &out, nil -} - -type InfrastructureEncryptionState string - -const ( - InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled" - InfrastructureEncryptionStateEnabled InfrastructureEncryptionState = "Enabled" -) - -func PossibleValuesForInfrastructureEncryptionState() []string { - return []string{ - string(InfrastructureEncryptionStateDisabled), - string(InfrastructureEncryptionStateEnabled), - } -} - -func (s *InfrastructureEncryptionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInfrastructureEncryptionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInfrastructureEncryptionState(input string) (*InfrastructureEncryptionState, error) { - vals := map[string]InfrastructureEncryptionState{ - "disabled": InfrastructureEncryptionStateDisabled, - "enabled": InfrastructureEncryptionStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InfrastructureEncryptionState(input) - return &out, nil -} - -type PrivateEndpointConnectionStatus string - -const ( - PrivateEndpointConnectionStatusApproved PrivateEndpointConnectionStatus = "Approved" - PrivateEndpointConnectionStatusDisconnected PrivateEndpointConnectionStatus = "Disconnected" - PrivateEndpointConnectionStatusPending PrivateEndpointConnectionStatus = "Pending" - PrivateEndpointConnectionStatusRejected PrivateEndpointConnectionStatus = "Rejected" -) - -func PossibleValuesForPrivateEndpointConnectionStatus() []string { - return []string{ - string(PrivateEndpointConnectionStatusApproved), - string(PrivateEndpointConnectionStatusDisconnected), - string(PrivateEndpointConnectionStatusPending), - string(PrivateEndpointConnectionStatusRejected), - } -} - -func (s *PrivateEndpointConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateEndpointConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateEndpointConnectionStatus(input string) (*PrivateEndpointConnectionStatus, error) { - vals := map[string]PrivateEndpointConnectionStatus{ - "approved": PrivateEndpointConnectionStatusApproved, - "disconnected": PrivateEndpointConnectionStatusDisconnected, - "pending": PrivateEndpointConnectionStatusPending, - "rejected": PrivateEndpointConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateEndpointConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStatePending ProvisioningState = "Pending" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStatePending), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "pending": ProvisioningStatePending, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(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 ResourceMoveState string - -const ( - ResourceMoveStateCommitFailed ResourceMoveState = "CommitFailed" - ResourceMoveStateCommitTimedout ResourceMoveState = "CommitTimedout" - ResourceMoveStateCriticalFailure ResourceMoveState = "CriticalFailure" - ResourceMoveStateFailure ResourceMoveState = "Failure" - ResourceMoveStateInProgress ResourceMoveState = "InProgress" - ResourceMoveStateMoveSucceeded ResourceMoveState = "MoveSucceeded" - ResourceMoveStatePartialSuccess ResourceMoveState = "PartialSuccess" - ResourceMoveStatePrepareFailed ResourceMoveState = "PrepareFailed" - ResourceMoveStatePrepareTimedout ResourceMoveState = "PrepareTimedout" - ResourceMoveStateUnknown ResourceMoveState = "Unknown" -) - -func PossibleValuesForResourceMoveState() []string { - return []string{ - string(ResourceMoveStateCommitFailed), - string(ResourceMoveStateCommitTimedout), - string(ResourceMoveStateCriticalFailure), - string(ResourceMoveStateFailure), - string(ResourceMoveStateInProgress), - string(ResourceMoveStateMoveSucceeded), - string(ResourceMoveStatePartialSuccess), - string(ResourceMoveStatePrepareFailed), - string(ResourceMoveStatePrepareTimedout), - string(ResourceMoveStateUnknown), - } -} - -func (s *ResourceMoveState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceMoveState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceMoveState(input string) (*ResourceMoveState, error) { - vals := map[string]ResourceMoveState{ - "commitfailed": ResourceMoveStateCommitFailed, - "committimedout": ResourceMoveStateCommitTimedout, - "criticalfailure": ResourceMoveStateCriticalFailure, - "failure": ResourceMoveStateFailure, - "inprogress": ResourceMoveStateInProgress, - "movesucceeded": ResourceMoveStateMoveSucceeded, - "partialsuccess": ResourceMoveStatePartialSuccess, - "preparefailed": ResourceMoveStatePrepareFailed, - "preparetimedout": ResourceMoveStatePrepareTimedout, - "unknown": ResourceMoveStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceMoveState(input) - return &out, nil -} - -type SkuName string - -const ( - SkuNameRSZero SkuName = "RS0" - SkuNameStandard SkuName = "Standard" -) - -func PossibleValuesForSkuName() []string { - return []string{ - string(SkuNameRSZero), - string(SkuNameStandard), - } -} - -func (s *SkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuName(input string) (*SkuName, error) { - vals := map[string]SkuName{ - "rs0": SkuNameRSZero, - "standard": SkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuName(input) - return &out, nil -} - -type StandardTierStorageRedundancy string - -const ( - StandardTierStorageRedundancyGeoRedundant StandardTierStorageRedundancy = "GeoRedundant" - StandardTierStorageRedundancyLocallyRedundant StandardTierStorageRedundancy = "LocallyRedundant" - StandardTierStorageRedundancyZoneRedundant StandardTierStorageRedundancy = "ZoneRedundant" -) - -func PossibleValuesForStandardTierStorageRedundancy() []string { - return []string{ - string(StandardTierStorageRedundancyGeoRedundant), - string(StandardTierStorageRedundancyLocallyRedundant), - string(StandardTierStorageRedundancyZoneRedundant), - } -} - -func (s *StandardTierStorageRedundancy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStandardTierStorageRedundancy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStandardTierStorageRedundancy(input string) (*StandardTierStorageRedundancy, error) { - vals := map[string]StandardTierStorageRedundancy{ - "georedundant": StandardTierStorageRedundancyGeoRedundant, - "locallyredundant": StandardTierStorageRedundancyLocallyRedundant, - "zoneredundant": StandardTierStorageRedundancyZoneRedundant, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StandardTierStorageRedundancy(input) - return &out, nil -} - -type TriggerType string - -const ( - TriggerTypeForcedUpgrade TriggerType = "ForcedUpgrade" - TriggerTypeUserTriggered TriggerType = "UserTriggered" -) - -func PossibleValuesForTriggerType() []string { - return []string{ - string(TriggerTypeForcedUpgrade), - string(TriggerTypeUserTriggered), - } -} - -func (s *TriggerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerType(input string) (*TriggerType, error) { - vals := map[string]TriggerType{ - "forcedupgrade": TriggerTypeForcedUpgrade, - "usertriggered": TriggerTypeUserTriggered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerType(input) - return &out, nil -} - -type VaultPrivateEndpointState string - -const ( - VaultPrivateEndpointStateEnabled VaultPrivateEndpointState = "Enabled" - VaultPrivateEndpointStateNone VaultPrivateEndpointState = "None" -) - -func PossibleValuesForVaultPrivateEndpointState() []string { - return []string{ - string(VaultPrivateEndpointStateEnabled), - string(VaultPrivateEndpointStateNone), - } -} - -func (s *VaultPrivateEndpointState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultPrivateEndpointState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultPrivateEndpointState(input string) (*VaultPrivateEndpointState, error) { - vals := map[string]VaultPrivateEndpointState{ - "enabled": VaultPrivateEndpointStateEnabled, - "none": VaultPrivateEndpointStateNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultPrivateEndpointState(input) - return &out, nil -} - -type VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} - -type VaultUpgradeState string - -const ( - VaultUpgradeStateFailed VaultUpgradeState = "Failed" - VaultUpgradeStateInProgress VaultUpgradeState = "InProgress" - VaultUpgradeStateUnknown VaultUpgradeState = "Unknown" - VaultUpgradeStateUpgraded VaultUpgradeState = "Upgraded" -) - -func PossibleValuesForVaultUpgradeState() []string { - return []string{ - string(VaultUpgradeStateFailed), - string(VaultUpgradeStateInProgress), - string(VaultUpgradeStateUnknown), - string(VaultUpgradeStateUpgraded), - } -} - -func (s *VaultUpgradeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultUpgradeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultUpgradeState(input string) (*VaultUpgradeState, error) { - vals := map[string]VaultUpgradeState{ - "failed": VaultUpgradeStateFailed, - "inprogress": VaultUpgradeStateInProgress, - "unknown": VaultUpgradeStateUnknown, - "upgraded": VaultUpgradeStateUpgraded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultUpgradeState(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/id_vault.go b/resource-manager/recoveryservices/2023-02-01/vaults/id_vault.go deleted file mode 100644 index 1cb6def7087..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaults - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/id_vault_test.go b/resource-manager/recoveryservices/2023-02-01/vaults/id_vault_test.go deleted file mode 100644 index d99d7310acc..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaults - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-02-01/vaults/method_createorupdate.go b/resource-manager/recoveryservices/2023-02-01/vaults/method_createorupdate.go deleted file mode 100644 index 93fd5e76cbb..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 *Vault -} - -// CreateOrUpdate ... -func (c VaultsClient) CreateOrUpdate(ctx context.Context, id VaultId, input Vault) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VaultsClient) CreateOrUpdateThenPoll(ctx context.Context, id VaultId, input Vault) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/recoveryservices/2023-02-01/vaults/method_delete.go b/resource-manager/recoveryservices/2023-02-01/vaults/method_delete.go deleted file mode 100644 index 70e0ba8dd2b..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package vaults - -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 VaultsClient) Delete(ctx context.Context, id VaultId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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/recoveryservices/2023-02-01/vaults/method_get.go b/resource-manager/recoveryservices/2023-02-01/vaults/method_get.go deleted file mode 100644 index 181926c5390..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package vaults - -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 *Vault -} - -// Get ... -func (c VaultsClient) Get(ctx context.Context, id VaultId) (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 Vault - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/method_listbyresourcegroup.go b/resource-manager/recoveryservices/2023-02-01/vaults/method_listbyresourcegroup.go deleted file mode 100644 index 09ba434e931..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 *[]Vault -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListByResourceGroup ... -func (c VaultsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `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 VaultsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VaultOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/recoveryservices/2023-02-01/vaults/method_listbysubscriptionid.go b/resource-manager/recoveryservices/2023-02-01/vaults/method_listbysubscriptionid.go deleted file mode 100644 index e1f63694b10..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/method_listbysubscriptionid.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 ListBySubscriptionIdOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Vault -} - -type ListBySubscriptionIdCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListBySubscriptionId ... -func (c VaultsClient) ListBySubscriptionId(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionIdOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionIdComplete retrieves all the results into a single object -func (c VaultsClient) ListBySubscriptionIdComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionIdCompleteResult, error) { - return c.ListBySubscriptionIdCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListBySubscriptionIdCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListBySubscriptionIdCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VaultOperationPredicate) (result ListBySubscriptionIdCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListBySubscriptionId(ctx, id) - if err != nil { - 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 = ListBySubscriptionIdCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/method_update.go b/resource-manager/recoveryservices/2023-02-01/vaults/method_update.go deleted file mode 100644 index fd0c9f3e6da..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Vault -} - -// Update ... -func (c VaultsClient) Update(ctx context.Context, id VaultId, input PatchVault) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VaultsClient) UpdateThenPoll(ctx context.Context, id VaultId, input PatchVault) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_azuremonitoralertsettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_azuremonitoralertsettings.go deleted file mode 100644 index c41bfcca517..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_azuremonitoralertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorAlertSettings struct { - AlertsForAllJobFailures *AlertsState `json:"alertsForAllJobFailures,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_classicalertsettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_classicalertsettings.go deleted file mode 100644 index f82f4c55b31..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_classicalertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClassicAlertSettings struct { - AlertsForCriticalOperations *AlertsState `json:"alertsForCriticalOperations,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkekidentity.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkekidentity.go deleted file mode 100644 index 1e5e7be3d2d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkekidentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKekIdentity struct { - UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkeyvaultproperties.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkeyvaultproperties.go deleted file mode 100644 index c53f530b9f5..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_cmkkeyvaultproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKeyVaultProperties struct { - KeyUri *string `json:"keyUri,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_crosssubscriptionrestoresettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_crosssubscriptionrestoresettings.go deleted file mode 100644 index 4a4fecb8bdd..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_crosssubscriptionrestoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossSubscriptionRestoreSettings struct { - CrossSubscriptionRestoreState *CrossSubscriptionRestoreState `json:"crossSubscriptionRestoreState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_immutabilitysettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_immutabilitysettings.go deleted file mode 100644 index f52ae97a4c3..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_immutabilitysettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImmutabilitySettings struct { - State *ImmutabilityState `json:"state,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_monitoringsettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_monitoringsettings.go deleted file mode 100644 index 391ede46ae2..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_monitoringsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSettings struct { - AzureMonitorAlertSettings *AzureMonitorAlertSettings `json:"azureMonitorAlertSettings,omitempty"` - ClassicAlertSettings *ClassicAlertSettings `json:"classicAlertSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_patchvault.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_patchvault.go deleted file mode 100644 index 5ffc9615bc5..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_patchvault.go +++ /dev/null @@ -1,20 +0,0 @@ -package vaults - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchVault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpoint.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpoint.go deleted file mode 100644 index 64ce35a3d98..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// 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/recoveryservices/2023-02-01/vaults/model_privateendpointconnection.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnection.go deleted file mode 100644 index 687aefc111c..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaults - -// 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 { - GroupIds *[]VaultSubResourceType `json:"groupIds,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnectionvaultproperties.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnectionvaultproperties.go deleted file mode 100644 index 5758db1bfa3..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_privateendpointconnectionvaultproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionVaultProperties struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointConnection `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_privatelinkserviceconnectionstate.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index b07724e0e27..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *PrivateEndpointConnectionStatus `json:"status,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_restoresettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_restoresettings.go deleted file mode 100644 index b5126dbe263..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_restoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreSettings struct { - CrossSubscriptionRestoreSettings *CrossSubscriptionRestoreSettings `json:"crossSubscriptionRestoreSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_securitysettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_securitysettings.go deleted file mode 100644 index 1174404fe34..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_securitysettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecuritySettings struct { - ImmutabilitySettings *ImmutabilitySettings `json:"immutabilitySettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_sku.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_sku.go deleted file mode 100644 index d89e1340ee6..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *string `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name SkuName `json:"name"` - Size *string `json:"size,omitempty"` - Tier *string `json:"tier,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_upgradedetails.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_upgradedetails.go deleted file mode 100644 index f5e021983ab..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_upgradedetails.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaults - -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 UpgradeDetails struct { - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Message *string `json:"message,omitempty"` - OperationId *string `json:"operationId,omitempty"` - PreviousResourceId *string `json:"previousResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *VaultUpgradeState `json:"status,omitempty"` - TriggerType *TriggerType `json:"triggerType,omitempty"` - UpgradedResourceId *string `json:"upgradedResourceId,omitempty"` -} - -func (o *UpgradeDetails) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetLastUpdatedTimeUtcAsTime() (*time.Time, error) { - if o.LastUpdatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetLastUpdatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_vault.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_vault.go deleted file mode 100644 index dc5d7d049c1..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_vault.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -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 Vault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `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/recoveryservices/2023-02-01/vaults/model_vaultproperties.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultproperties.go deleted file mode 100644 index 5775803ba2c..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultProperties struct { - BackupStorageVersion *BackupStorageVersion `json:"backupStorageVersion,omitempty"` - Encryption *VaultPropertiesEncryption `json:"encryption,omitempty"` - MonitoringSettings *MonitoringSettings `json:"monitoringSettings,omitempty"` - MoveDetails *VaultPropertiesMoveDetails `json:"moveDetails,omitempty"` - MoveState *ResourceMoveState `json:"moveState,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnectionVaultProperties `json:"privateEndpointConnections,omitempty"` - PrivateEndpointStateForBackup *VaultPrivateEndpointState `json:"privateEndpointStateForBackup,omitempty"` - PrivateEndpointStateForSiteRecovery *VaultPrivateEndpointState `json:"privateEndpointStateForSiteRecovery,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - RedundancySettings *VaultPropertiesRedundancySettings `json:"redundancySettings,omitempty"` - RestoreSettings *RestoreSettings `json:"restoreSettings,omitempty"` - SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"` - UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesencryption.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesencryption.go deleted file mode 100644 index 05c6effec1d..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesencryption.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesEncryption struct { - InfrastructureEncryption *InfrastructureEncryptionState `json:"infrastructureEncryption,omitempty"` - KekIdentity *CmkKekIdentity `json:"kekIdentity,omitempty"` - KeyVaultProperties *CmkKeyVaultProperties `json:"keyVaultProperties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesmovedetails.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesmovedetails.go deleted file mode 100644 index b65be5a0669..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesmovedetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package vaults - -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 VaultPropertiesMoveDetails struct { - CompletionTimeUtc *string `json:"completionTimeUtc,omitempty"` - OperationId *string `json:"operationId,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` -} - -func (o *VaultPropertiesMoveDetails) GetCompletionTimeUtcAsTime() (*time.Time, error) { - if o.CompletionTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CompletionTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetCompletionTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CompletionTimeUtc = &formatted -} - -func (o *VaultPropertiesMoveDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesredundancysettings.go b/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesredundancysettings.go deleted file mode 100644 index 2d1174f221f..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/model_vaultpropertiesredundancysettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesRedundancySettings struct { - CrossRegionRestore *CrossRegionRestore `json:"crossRegionRestore,omitempty"` - StandardTierStorageRedundancy *StandardTierStorageRedundancy `json:"standardTierStorageRedundancy,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/predicates.go b/resource-manager/recoveryservices/2023-02-01/vaults/predicates.go deleted file mode 100644 index 1039a9afe4e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VaultOperationPredicate) Matches(input Vault) 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 -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaults/version.go b/resource-manager/recoveryservices/2023-02-01/vaults/version.go deleted file mode 100644 index 02e0543ff4f..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaults/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaults/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/README.md b/resource-manager/recoveryservices/2023-02-01/vaultusages/README.md deleted file mode 100644 index 6725c5d2b8e..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-02-01/vaultusages` Documentation - -The `vaultusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-02-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/recoveryservices/2023-02-01/vaultusages" -``` - - -### Client Initialization - -```go -client := vaultusages.NewVaultUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultUsagesClient.UsagesListByVaults` - -```go -ctx := context.TODO() -id := vaultusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -read, err := client.UsagesListByVaults(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/recoveryservices/2023-02-01/vaultusages/client.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/client.go deleted file mode 100644 index 625eba65044..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultusages - -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 VaultUsagesClient struct { - Client *resourcemanager.Client -} - -func NewVaultUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultUsagesClient: %+v", err) - } - - return &VaultUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/constants.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/constants.go deleted file mode 100644 index 333eba1e6c6..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package vaultusages - -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 UsagesUnit string - -const ( - UsagesUnitBytes UsagesUnit = "Bytes" - UsagesUnitBytesPerSecond UsagesUnit = "BytesPerSecond" - UsagesUnitCount UsagesUnit = "Count" - UsagesUnitCountPerSecond UsagesUnit = "CountPerSecond" - UsagesUnitPercent UsagesUnit = "Percent" - UsagesUnitSeconds UsagesUnit = "Seconds" -) - -func PossibleValuesForUsagesUnit() []string { - return []string{ - string(UsagesUnitBytes), - string(UsagesUnitBytesPerSecond), - string(UsagesUnitCount), - string(UsagesUnitCountPerSecond), - string(UsagesUnitPercent), - string(UsagesUnitSeconds), - } -} - -func (s *UsagesUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUsagesUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUsagesUnit(input string) (*UsagesUnit, error) { - vals := map[string]UsagesUnit{ - "bytes": UsagesUnitBytes, - "bytespersecond": UsagesUnitBytesPerSecond, - "count": UsagesUnitCount, - "countpersecond": UsagesUnitCountPerSecond, - "percent": UsagesUnitPercent, - "seconds": UsagesUnitSeconds, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsagesUnit(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault.go deleted file mode 100644 index b455e8760a5..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault_test.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault_test.go deleted file mode 100644 index 9ef11c18ec0..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-02-01/vaultusages/method_usageslistbyvaults.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/method_usageslistbyvaults.go deleted file mode 100644 index 258a5d0bb75..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/method_usageslistbyvaults.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultusages - -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 UsagesListByVaultsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultUsageList -} - -// UsagesListByVaults ... -func (c VaultUsagesClient) UsagesListByVaults(ctx context.Context, id VaultId) (result UsagesListByVaultsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 VaultUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/model_nameinfo.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/model_nameinfo.go deleted file mode 100644 index 974668c26f9..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/model_nameinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameInfo struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusage.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusage.go deleted file mode 100644 index 6b7bc2b68d8..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusage.go +++ /dev/null @@ -1,31 +0,0 @@ -package vaultusages - -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 VaultUsage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *NameInfo `json:"name,omitempty"` - NextResetTime *string `json:"nextResetTime,omitempty"` - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - Unit *UsagesUnit `json:"unit,omitempty"` -} - -func (o *VaultUsage) GetNextResetTimeAsTime() (*time.Time, error) { - if o.NextResetTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.NextResetTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultUsage) SetNextResetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.NextResetTime = &formatted -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusagelist.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusagelist.go deleted file mode 100644 index aa529e6fcbf..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/model_vaultusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultUsageList struct { - Value *[]VaultUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-02-01/vaultusages/version.go b/resource-manager/recoveryservices/2023-02-01/vaultusages/version.go deleted file mode 100644 index 59e93a92066..00000000000 --- a/resource-manager/recoveryservices/2023-02-01/vaultusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-02-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/client.go b/resource-manager/recoveryservices/2023-04-01/client.go deleted file mode 100644 index c4f653d2bde..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_04_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/recoveryservices/2023-04-01/getprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/recoveryservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/registeredidentities" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/replicationusages" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaultcertificates" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaults" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaultusages" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - GetPrivateLinkResources *getprivatelinkresources.GetPrivateLinkResourcesClient - ListPrivateLinkResources *listprivatelinkresources.ListPrivateLinkResourcesClient - RecoveryServices *recoveryservices.RecoveryServicesClient - RegisteredIdentities *registeredidentities.RegisteredIdentitiesClient - ReplicationUsages *replicationusages.ReplicationUsagesClient - VaultCertificates *vaultcertificates.VaultCertificatesClient - VaultExtendedInfo *vaultextendedinfo.VaultExtendedInfoClient - VaultUsages *vaultusages.VaultUsagesClient - Vaults *vaults.VaultsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - getPrivateLinkResourcesClient, err := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building GetPrivateLinkResources client: %+v", err) - } - configureFunc(getPrivateLinkResourcesClient.Client) - - listPrivateLinkResourcesClient, err := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ListPrivateLinkResources client: %+v", err) - } - configureFunc(listPrivateLinkResourcesClient.Client) - - recoveryServicesClient, err := recoveryservices.NewRecoveryServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RecoveryServices client: %+v", err) - } - configureFunc(recoveryServicesClient.Client) - - registeredIdentitiesClient, err := registeredidentities.NewRegisteredIdentitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RegisteredIdentities client: %+v", err) - } - configureFunc(registeredIdentitiesClient.Client) - - replicationUsagesClient, err := replicationusages.NewReplicationUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ReplicationUsages client: %+v", err) - } - configureFunc(replicationUsagesClient.Client) - - vaultCertificatesClient, err := vaultcertificates.NewVaultCertificatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultCertificates client: %+v", err) - } - configureFunc(vaultCertificatesClient.Client) - - vaultExtendedInfoClient, err := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultExtendedInfo client: %+v", err) - } - configureFunc(vaultExtendedInfoClient.Client) - - vaultUsagesClient, err := vaultusages.NewVaultUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultUsages client: %+v", err) - } - configureFunc(vaultUsagesClient.Client) - - vaultsClient, err := vaults.NewVaultsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Vaults client: %+v", err) - } - configureFunc(vaultsClient.Client) - - return &Client{ - GetPrivateLinkResources: getPrivateLinkResourcesClient, - ListPrivateLinkResources: listPrivateLinkResourcesClient, - RecoveryServices: recoveryServicesClient, - RegisteredIdentities: registeredIdentitiesClient, - ReplicationUsages: replicationUsagesClient, - VaultCertificates: vaultCertificatesClient, - VaultExtendedInfo: vaultExtendedInfoClient, - VaultUsages: vaultUsagesClient, - Vaults: vaultsClient, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/README.md deleted file mode 100644 index 6b198e1ce20..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources` Documentation - -The `getprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/getprivatelinkresources" -``` - - -### Client Initialization - -```go -client := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `GetPrivateLinkResourcesClient.PrivateLinkResourcesGet` - -```go -ctx := context.TODO() -id := getprivatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - -read, err := client.PrivateLinkResourcesGet(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/recoveryservices/2023-04-01/getprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/client.go deleted file mode 100644 index 2c788db4e51..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package getprivatelinkresources - -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 GetPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*GetPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "getprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating GetPrivateLinkResourcesClient: %+v", err) - } - - return &GetPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource.go deleted file mode 100644 index 70ee568e5d3..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package getprivatelinkresources - -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(&PrivateLinkResourceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkResourceId{} - -// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource -type PrivateLinkResourceId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - PrivateLinkResourceName string -} - -// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct -func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, vaultName string, privateLinkResourceName string) PrivateLinkResourceId { - return PrivateLinkResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - PrivateLinkResourceName: privateLinkResourceName, - } -} - -// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId -func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkResourceId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) - } - - return nil -} - -// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID -func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Resource ID -func (id PrivateLinkResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/privateLinkResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.PrivateLinkResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID -func (id PrivateLinkResourceId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), - } -} - -// String returns a human-readable description of this Private Link Resource ID -func (id PrivateLinkResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), - } - return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource_test.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource_test.go deleted file mode 100644 index 7ee1c858da1..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/id_privatelinkresource_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package getprivatelinkresources - -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 = &PrivateLinkResourceId{} - -func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.PrivateLinkResourceName != "privateLinkResourceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceValue") - } -} - -func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkResourceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestSegmentsForPrivateLinkResourceId(t *testing.T) { - segments := PrivateLinkResourceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkResourceId 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/recoveryservices/2023-04-01/getprivatelinkresources/method_privatelinkresourcesget.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/method_privatelinkresourcesget.go deleted file mode 100644 index 8074fb34792..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/method_privatelinkresourcesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package getprivatelinkresources - -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 PrivateLinkResourcesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkResource -} - -// PrivateLinkResourcesGet ... -func (c GetPrivateLinkResourcesClient) PrivateLinkResourcesGet(ctx context.Context, id PrivateLinkResourceId) (result PrivateLinkResourcesGetOperationResponse, 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 PrivateLinkResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 36e56a45b5e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package getprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index 92b1276283a..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package getprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/version.go deleted file mode 100644 index be07339eb1f..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/getprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package getprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/getprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/README.md deleted file mode 100644 index 95206b51f3d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources` Documentation - -The `listprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/listprivatelinkresources" -``` - - -### Client Initialization - -```go -client := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ListPrivateLinkResourcesClient.PrivateLinkResourcesList` - -```go -ctx := context.TODO() -id := listprivatelinkresources.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -// alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination -items, err := client.PrivateLinkResourcesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/client.go deleted file mode 100644 index d68ed338ccc..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package listprivatelinkresources - -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 ListPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewListPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ListPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "listprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ListPrivateLinkResourcesClient: %+v", err) - } - - return &ListPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault.go deleted file mode 100644 index 332d5bf97d5..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package listprivatelinkresources - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault_test.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault_test.go deleted file mode 100644 index 79099dc74de..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package listprivatelinkresources - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-04-01/listprivatelinkresources/method_privatelinkresourceslist.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/method_privatelinkresourceslist.go deleted file mode 100644 index 994db6cbef7..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/method_privatelinkresourceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package listprivatelinkresources - -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 PrivateLinkResourcesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkResource -} - -type PrivateLinkResourcesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkResource -} - -// PrivateLinkResourcesList ... -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesList(ctx context.Context, id VaultId) (result PrivateLinkResourcesListOperationResponse, 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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateLinkResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PrivateLinkResourcesListComplete retrieves all the results into a single object -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListComplete(ctx context.Context, id VaultId) (PrivateLinkResourcesListCompleteResult, error) { - return c.PrivateLinkResourcesListCompleteMatchingPredicate(ctx, id, PrivateLinkResourceOperationPredicate{}) -} - -// PrivateLinkResourcesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListCompleteMatchingPredicate(ctx context.Context, id VaultId, predicate PrivateLinkResourceOperationPredicate) (result PrivateLinkResourcesListCompleteResult, err error) { - items := make([]PrivateLinkResource, 0) - - resp, err := c.PrivateLinkResourcesList(ctx, id) - if err != nil { - 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 = PrivateLinkResourcesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 43ad3ab77fa..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package listprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index b1ff4a935fd..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/predicates.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/predicates.go deleted file mode 100644 index 5eb0bb91e57..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PrivateLinkResourceOperationPredicate) Matches(input PrivateLinkResource) 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/recoveryservices/2023-04-01/listprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/version.go deleted file mode 100644 index 34a1850e9cd..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/listprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package listprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/listprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/README.md b/resource-manager/recoveryservices/2023-04-01/recoveryservices/README.md deleted file mode 100644 index 734bc3a536a..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/README.md +++ /dev/null @@ -1,62 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/recoveryservices` Documentation - -The `recoveryservices` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/recoveryservices" -``` - - -### Client Initialization - -```go -client := recoveryservices.NewRecoveryServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RecoveryServicesClient.Capabilities` - -```go -ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := recoveryservices.ResourceCapabilities{ - // ... -} - - -read, err := client.Capabilities(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RecoveryServicesClient.CheckNameAvailability` - -```go -ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := recoveryservices.CheckNameAvailabilityParameters{ - // ... -} - - -read, err := client.CheckNameAvailability(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/recoveryservices/2023-04-01/recoveryservices/client.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/client.go deleted file mode 100644 index 518088771ea..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package recoveryservices - -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 RecoveryServicesClient struct { - Client *resourcemanager.Client -} - -func NewRecoveryServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*RecoveryServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "recoveryservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RecoveryServicesClient: %+v", err) - } - - return &RecoveryServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/constants.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/constants.go deleted file mode 100644 index 920bcd8e566..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package recoveryservices - -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 VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location.go deleted file mode 100644 index 1fd49c9d992..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package recoveryservices - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservices/2023-04-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location_test.go deleted file mode 100644 index 3c75d278a94..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package recoveryservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservices/2023-04-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation.go deleted file mode 100644 index 33d3548750d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package recoveryservices - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation_test.go deleted file mode 100644 index 28405ec9bd8..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package recoveryservices - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/recoveryservices/2023-04-01/recoveryservices/method_capabilities.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/method_capabilities.go deleted file mode 100644 index 5864d60faeb..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/method_capabilities.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CapabilitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CapabilitiesResponse -} - -// Capabilities ... -func (c RecoveryServicesClient) Capabilities(ctx context.Context, id LocationId, input ResourceCapabilities) (result CapabilitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/capabilities", 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 CapabilitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/method_checknameavailability.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/method_checknameavailability.go deleted file mode 100644 index 3512794c701..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/method_checknameavailability.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CheckNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CheckNameAvailabilityResult -} - -// CheckNameAvailability ... -func (c RecoveryServicesClient) CheckNameAvailability(ctx context.Context, id ProviderLocationId, input CheckNameAvailabilityParameters) (result CheckNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkNameAvailability", 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 CheckNameAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesproperties.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesproperties.go deleted file mode 100644 index 3698ddb8850..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesProperties struct { - DnsZones *[]DNSZone `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponse.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponse.go deleted file mode 100644 index 47e4997660f..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponse struct { - Properties *CapabilitiesResponseProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponseproperties.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponseproperties.go deleted file mode 100644 index 8c1bfbcac8d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_capabilitiesresponseproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponseProperties struct { - DnsZones *[]DNSZoneResponse `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityparameters.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityparameters.go deleted file mode 100644 index e6c5aff2402..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityParameters struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityresult.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityresult.go deleted file mode 100644 index d2840ec335e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_checknameavailabilityresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityResult struct { - Message *string `json:"message,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason *string `json:"reason,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszone.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszone.go deleted file mode 100644 index 34952cfbd7e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszone.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZone struct { - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszoneresponse.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszoneresponse.go deleted file mode 100644 index 4aabe0bd6d4..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_dnszoneresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZoneResponse struct { - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_resourcecapabilities.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_resourcecapabilities.go deleted file mode 100644 index 16d3a668058..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/model_resourcecapabilities.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceCapabilities struct { - Properties *CapabilitiesProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/recoveryservices/version.go b/resource-manager/recoveryservices/2023-04-01/recoveryservices/version.go deleted file mode 100644 index 205ddbfd0e4..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/recoveryservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoveryservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/recoveryservices/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/registeredidentities/client.go b/resource-manager/recoveryservices/2023-04-01/registeredidentities/client.go deleted file mode 100644 index 36b4015e582..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/registeredidentities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient struct { - Client *resourcemanager.Client -} - -func NewRegisteredIdentitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*RegisteredIdentitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "registeredidentities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RegisteredIdentitiesClient: %+v", err) - } - - return &RegisteredIdentitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity.go deleted file mode 100644 index 147a6d0d6e3..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity.go +++ /dev/null @@ -1,139 +0,0 @@ -package registeredidentities - -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(&RegisteredIdentityId{}) -} - -var _ resourceids.ResourceId = &RegisteredIdentityId{} - -// RegisteredIdentityId is a struct representing the Resource ID for a Registered Identity -type RegisteredIdentityId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - RegisteredIdentityName string -} - -// NewRegisteredIdentityID returns a new RegisteredIdentityId struct -func NewRegisteredIdentityID(subscriptionId string, resourceGroupName string, vaultName string, registeredIdentityName string) RegisteredIdentityId { - return RegisteredIdentityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - RegisteredIdentityName: registeredIdentityName, - } -} - -// ParseRegisteredIdentityID parses 'input' into a RegisteredIdentityId -func ParseRegisteredIdentityID(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegisteredIdentityIDInsensitively parses 'input' case-insensitively into a RegisteredIdentityId -// note: this method should only be used for API response data and not user input -func ParseRegisteredIdentityIDInsensitively(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegisteredIdentityId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.RegisteredIdentityName, ok = input.Parsed["registeredIdentityName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registeredIdentityName", input) - } - - return nil -} - -// ValidateRegisteredIdentityID checks that 'input' can be parsed as a Registered Identity ID -func ValidateRegisteredIdentityID(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 := ParseRegisteredIdentityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registered Identity ID -func (id RegisteredIdentityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/registeredIdentities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.RegisteredIdentityName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registered Identity ID -func (id RegisteredIdentityId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityValue"), - } -} - -// String returns a human-readable description of this Registered Identity ID -func (id RegisteredIdentityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Registered Identity Name: %q", id.RegisteredIdentityName), - } - return fmt.Sprintf("Registered Identity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity_test.go deleted file mode 100644 index 6857bb4f14e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/registeredidentities/id_registeredidentity_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package registeredidentities - -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 = &RegisteredIdentityId{} - -func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.RegisteredIdentityName != "registeredIdentityValue" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityValue") - } -} - -func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRegisteredIdentityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - RegisteredIdentityName: "rEgIsTeReDiDeNtItYvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestSegmentsForRegisteredIdentityId(t *testing.T) { - segments := RegisteredIdentityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RegisteredIdentityId 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/recoveryservices/2023-04-01/registeredidentities/method_delete.go b/resource-manager/recoveryservices/2023-04-01/registeredidentities/method_delete.go deleted file mode 100644 index 16a5301af92..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/registeredidentities/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient) Delete(ctx context.Context, id RegisteredIdentityId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/registeredidentities/version.go b/resource-manager/recoveryservices/2023-04-01/registeredidentities/version.go deleted file mode 100644 index b544c629c20..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/registeredidentities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package registeredidentities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/registeredidentities/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/README.md b/resource-manager/recoveryservices/2023-04-01/replicationusages/README.md deleted file mode 100644 index 5966efa2df9..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/replicationusages` Documentation - -The `replicationusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/replicationusages" -``` - - -### Client Initialization - -```go -client := replicationusages.NewReplicationUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ReplicationUsagesClient.List` - -```go -ctx := context.TODO() -id := replicationusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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/recoveryservices/2023-04-01/replicationusages/client.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/client.go deleted file mode 100644 index 40ebde8ba63..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package replicationusages - -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 ReplicationUsagesClient struct { - Client *resourcemanager.Client -} - -func NewReplicationUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "replicationusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ReplicationUsagesClient: %+v", err) - } - - return &ReplicationUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault.go deleted file mode 100644 index 338b117c7be..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package replicationusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault_test.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault_test.go deleted file mode 100644 index 679ad2eacfb..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package replicationusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-04-01/replicationusages/method_list.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/method_list.go deleted file mode 100644 index 67aa893023e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package replicationusages - -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 *ReplicationUsageList -} - -// List ... -func (c ReplicationUsagesClient) List(ctx context.Context, id VaultId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/replicationUsages", 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 ReplicationUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_jobssummary.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/model_jobssummary.go deleted file mode 100644 index b4e8997b7d2..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_jobssummary.go +++ /dev/null @@ -1,10 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobsSummary struct { - FailedJobs *int64 `json:"failedJobs,omitempty"` - InProgressJobs *int64 `json:"inProgressJobs,omitempty"` - SuspendedJobs *int64 `json:"suspendedJobs,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_monitoringsummary.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/model_monitoringsummary.go deleted file mode 100644 index fbf4ba89507..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_monitoringsummary.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSummary struct { - DeprecatedProviderCount *int64 `json:"deprecatedProviderCount,omitempty"` - EventsCount *int64 `json:"eventsCount,omitempty"` - SupportedProviderCount *int64 `json:"supportedProviderCount,omitempty"` - UnHealthyProviderCount *int64 `json:"unHealthyProviderCount,omitempty"` - UnHealthyVMCount *int64 `json:"unHealthyVmCount,omitempty"` - UnsupportedProviderCount *int64 `json:"unsupportedProviderCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusage.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusage.go deleted file mode 100644 index 0842f810533..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusage.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsage struct { - JobsSummary *JobsSummary `json:"jobsSummary,omitempty"` - MonitoringSummary *MonitoringSummary `json:"monitoringSummary,omitempty"` - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - RecoveryPlanCount *int64 `json:"recoveryPlanCount,omitempty"` - RecoveryServicesProviderAuthType *int64 `json:"recoveryServicesProviderAuthType,omitempty"` - RegisteredServersCount *int64 `json:"registeredServersCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusagelist.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusagelist.go deleted file mode 100644 index 11300c459d2..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/model_replicationusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsageList struct { - Value *[]ReplicationUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/replicationusages/version.go b/resource-manager/recoveryservices/2023-04-01/replicationusages/version.go deleted file mode 100644 index d5897cc47c7..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/replicationusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package replicationusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/replicationusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/README.md b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/README.md deleted file mode 100644 index 46f7d9ec68b..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaultcertificates` Documentation - -The `vaultcertificates` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/vaultcertificates" -``` - - -### Client Initialization - -```go -client := vaultcertificates.NewVaultCertificatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultCertificatesClient.Create` - -```go -ctx := context.TODO() -id := vaultcertificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - -payload := vaultcertificates.CertificateRequest{ - // ... -} - - -read, err := client.Create(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/recoveryservices/2023-04-01/vaultcertificates/client.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/client.go deleted file mode 100644 index f25a5998dcc..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultcertificates - -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 VaultCertificatesClient struct { - Client *resourcemanager.Client -} - -func NewVaultCertificatesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultCertificatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultcertificates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultCertificatesClient: %+v", err) - } - - return &VaultCertificatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/constants.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/constants.go deleted file mode 100644 index 66072e83ada..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package vaultcertificates - -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 AuthType string - -const ( - AuthTypeAAD AuthType = "AAD" - AuthTypeACS AuthType = "ACS" - AuthTypeAccessControlService AuthType = "AccessControlService" - AuthTypeAzureActiveDirectory AuthType = "AzureActiveDirectory" - AuthTypeInvalid AuthType = "Invalid" -) - -func PossibleValuesForAuthType() []string { - return []string{ - string(AuthTypeAAD), - string(AuthTypeACS), - string(AuthTypeAccessControlService), - string(AuthTypeAzureActiveDirectory), - string(AuthTypeInvalid), - } -} - -func (s *AuthType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthType(input string) (*AuthType, error) { - vals := map[string]AuthType{ - "aad": AuthTypeAAD, - "acs": AuthTypeACS, - "accesscontrolservice": AuthTypeAccessControlService, - "azureactivedirectory": AuthTypeAzureActiveDirectory, - "invalid": AuthTypeInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate.go deleted file mode 100644 index 1a998266e49..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate.go +++ /dev/null @@ -1,139 +0,0 @@ -package vaultcertificates - -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(&CertificateId{}) -} - -var _ resourceids.ResourceId = &CertificateId{} - -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - CertificateName string -} - -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, vaultName string, certificateName string) CertificateId { - return CertificateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - CertificateName: certificateName, - } -} - -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId -// note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CertificateId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.CertificateName, ok = input.Parsed["certificateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "certificateName", input) - } - - return nil -} - -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(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 := ParseCertificateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/certificates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.CertificateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "certificateValue"), - } -} - -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Certificate Name: %q", id.CertificateName), - } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate_test.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate_test.go deleted file mode 100644 index 2e113a065ed..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/id_certificate_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package vaultcertificates - -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 = &CertificateId{} - -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.CertificateName != "certificateValue" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateValue") - } -} - -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCertificateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestParseCertificateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - CertificateName: "cErTiFiCaTeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CertificateId 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/recoveryservices/2023-04-01/vaultcertificates/method_create.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/method_create.go deleted file mode 100644 index 1be290d4f6b..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaultcertificates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultCertificateResponse -} - -// Create ... -func (c VaultCertificatesClient) Create(ctx context.Context, id CertificateId, input CertificateRequest) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 VaultCertificateResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_certificaterequest.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_certificaterequest.go deleted file mode 100644 index 64984a9fb6e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_certificaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CertificateRequest struct { - Properties *RawCertificateData `json:"properties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_rawcertificatedata.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_rawcertificatedata.go deleted file mode 100644 index 2b6657d3813..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_rawcertificatedata.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RawCertificateData struct { - AuthType *AuthType `json:"authType,omitempty"` - Certificate *string `json:"certificate,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandaaddetails.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandaaddetails.go deleted file mode 100644 index 59f9a303924..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandaaddetails.go +++ /dev/null @@ -1,82 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAadDetails{} - -type ResourceCertificateAndAadDetails struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadAuthority string `json:"aadAuthority"` - AadTenantId string `json:"aadTenantId"` - AzureManagementEndpointAudience string `json:"azureManagementEndpointAudience"` - ServicePrincipalClientId string `json:"servicePrincipalClientId"` - ServicePrincipalObjectId string `json:"servicePrincipalObjectId"` - ServiceResourceId *string `json:"serviceResourceId,omitempty"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAadDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAadDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAadDetails{} - -func (s ResourceCertificateAndAadDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAadDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAadDetails: %+v", err) - } - decoded["authType"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandacsdetails.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandacsdetails.go deleted file mode 100644 index f0a2484e123..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificateandacsdetails.go +++ /dev/null @@ -1,78 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAcsDetails{} - -type ResourceCertificateAndAcsDetails struct { - GlobalAcsHostName string `json:"globalAcsHostName"` - GlobalAcsNamespace string `json:"globalAcsNamespace"` - GlobalAcsRPRealm string `json:"globalAcsRPRealm"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAcsDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAcsDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAcsDetails{} - -func (s ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAcsDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAcsDetails: %+v", err) - } - decoded["authType"] = "AccessControlService" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificatedetails.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificatedetails.go deleted file mode 100644 index 4057ff8ccdd..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_resourcecertificatedetails.go +++ /dev/null @@ -1,61 +0,0 @@ -package vaultcertificates - -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 ResourceCertificateDetails interface { -} - -// RawResourceCertificateDetailsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawResourceCertificateDetailsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalResourceCertificateDetailsImplementation(input []byte) (ResourceCertificateDetails, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateDetails into map[string]interface: %+v", err) - } - - value, ok := temp["authType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out ResourceCertificateAndAadDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAadDetails: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AccessControlService") { - var out ResourceCertificateAndAcsDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAcsDetails: %+v", err) - } - return out, nil - } - - out := RawResourceCertificateDetailsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_vaultcertificateresponse.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_vaultcertificateresponse.go deleted file mode 100644 index f5f8f52cf03..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/model_vaultcertificateresponse.go +++ /dev/null @@ -1,44 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultCertificateResponse struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ResourceCertificateDetails `json:"properties"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &VaultCertificateResponse{} - -func (s *VaultCertificateResponse) UnmarshalJSON(bytes []byte) error { - type alias VaultCertificateResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into VaultCertificateResponse: %+v", err) - } - - s.Id = decoded.Id - s.Name = decoded.Name - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling VaultCertificateResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalResourceCertificateDetailsImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'VaultCertificateResponse': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/version.go b/resource-manager/recoveryservices/2023-04-01/vaultcertificates/version.go deleted file mode 100644 index e739d013ae2..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultcertificates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultcertificates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultcertificates/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/README.md b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/README.md deleted file mode 100644 index 0082d5b713c..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/README.md +++ /dev/null @@ -1,78 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo` Documentation - -The `vaultextendedinfo` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/vaultextendedinfo" -``` - - -### Client Initialization - -```go -client := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultExtendedInfoClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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: `VaultExtendedInfoClient.Get` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultExtendedInfoClient.Update` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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/recoveryservices/2023-04-01/vaultextendedinfo/client.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/client.go deleted file mode 100644 index d977cd83af4..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultextendedinfo - -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 VaultExtendedInfoClient struct { - Client *resourcemanager.Client -} - -func NewVaultExtendedInfoClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultExtendedInfoClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultextendedinfo", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultExtendedInfoClient: %+v", err) - } - - return &VaultExtendedInfoClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault.go deleted file mode 100644 index 383129a1d1e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultextendedinfo - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault_test.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault_test.go deleted file mode 100644 index cd8a330cad3..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultextendedinfo - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-04-01/vaultextendedinfo/method_createorupdate.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_createorupdate.go deleted file mode 100644 index 46299e1c76a..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// CreateOrUpdate ... -func (c VaultExtendedInfoClient) CreateOrUpdate(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_get.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_get.go deleted file mode 100644 index 63222675990..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultextendedinfo - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Get ... -func (c VaultExtendedInfoClient) Get(ctx context.Context, id VaultId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_update.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_update.go deleted file mode 100644 index 74d9926995b..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/method_update.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Update ... -func (c VaultExtendedInfoClient) Update(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinfo.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinfo.go deleted file mode 100644 index a1514fbe948..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfo struct { - Algorithm *string `json:"algorithm,omitempty"` - EncryptionKey *string `json:"encryptionKey,omitempty"` - EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` - IntegrityKey *string `json:"integrityKey,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinforesource.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinforesource.go deleted file mode 100644 index ee148aba996..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/model_vaultextendedinforesource.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfoResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultExtendedInfo `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/version.go b/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/version.go deleted file mode 100644 index 1972813269d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultextendedinfo/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultextendedinfo/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/README.md b/resource-manager/recoveryservices/2023-04-01/vaults/README.md deleted file mode 100644 index dbe5e1f5d58..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaults` Documentation - -The `vaults` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/vaults" -``` - - -### Client Initialization - -```go -client := vaults.NewVaultsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.Vault{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VaultsClient.Delete` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.Get` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.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: `VaultsClient.ListBySubscriptionId` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscriptionId(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionIdComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VaultsClient.Update` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.PatchVault{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/client.go b/resource-manager/recoveryservices/2023-04-01/vaults/client.go deleted file mode 100644 index 1ddc5db936e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaults - -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 VaultsClient struct { - Client *resourcemanager.Client -} - -func NewVaultsClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaults", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultsClient: %+v", err) - } - - return &VaultsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/constants.go b/resource-manager/recoveryservices/2023-04-01/vaults/constants.go deleted file mode 100644 index 2f824292610..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/constants.go +++ /dev/null @@ -1,861 +0,0 @@ -package vaults - -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 AlertsState string - -const ( - AlertsStateDisabled AlertsState = "Disabled" - AlertsStateEnabled AlertsState = "Enabled" -) - -func PossibleValuesForAlertsState() []string { - return []string{ - string(AlertsStateDisabled), - string(AlertsStateEnabled), - } -} - -func (s *AlertsState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertsState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertsState(input string) (*AlertsState, error) { - vals := map[string]AlertsState{ - "disabled": AlertsStateDisabled, - "enabled": AlertsStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertsState(input) - return &out, nil -} - -type BackupStorageVersion string - -const ( - BackupStorageVersionUnassigned BackupStorageVersion = "Unassigned" - BackupStorageVersionVOne BackupStorageVersion = "V1" - BackupStorageVersionVTwo BackupStorageVersion = "V2" -) - -func PossibleValuesForBackupStorageVersion() []string { - return []string{ - string(BackupStorageVersionUnassigned), - string(BackupStorageVersionVOne), - string(BackupStorageVersionVTwo), - } -} - -func (s *BackupStorageVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBackupStorageVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBackupStorageVersion(input string) (*BackupStorageVersion, error) { - vals := map[string]BackupStorageVersion{ - "unassigned": BackupStorageVersionUnassigned, - "v1": BackupStorageVersionVOne, - "v2": BackupStorageVersionVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupStorageVersion(input) - return &out, nil -} - -type CrossRegionRestore string - -const ( - CrossRegionRestoreDisabled CrossRegionRestore = "Disabled" - CrossRegionRestoreEnabled CrossRegionRestore = "Enabled" -) - -func PossibleValuesForCrossRegionRestore() []string { - return []string{ - string(CrossRegionRestoreDisabled), - string(CrossRegionRestoreEnabled), - } -} - -func (s *CrossRegionRestore) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossRegionRestore(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossRegionRestore(input string) (*CrossRegionRestore, error) { - vals := map[string]CrossRegionRestore{ - "disabled": CrossRegionRestoreDisabled, - "enabled": CrossRegionRestoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossRegionRestore(input) - return &out, nil -} - -type CrossSubscriptionRestoreState string - -const ( - CrossSubscriptionRestoreStateDisabled CrossSubscriptionRestoreState = "Disabled" - CrossSubscriptionRestoreStateEnabled CrossSubscriptionRestoreState = "Enabled" - CrossSubscriptionRestoreStatePermanentlyDisabled CrossSubscriptionRestoreState = "PermanentlyDisabled" -) - -func PossibleValuesForCrossSubscriptionRestoreState() []string { - return []string{ - string(CrossSubscriptionRestoreStateDisabled), - string(CrossSubscriptionRestoreStateEnabled), - string(CrossSubscriptionRestoreStatePermanentlyDisabled), - } -} - -func (s *CrossSubscriptionRestoreState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossSubscriptionRestoreState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossSubscriptionRestoreState(input string) (*CrossSubscriptionRestoreState, error) { - vals := map[string]CrossSubscriptionRestoreState{ - "disabled": CrossSubscriptionRestoreStateDisabled, - "enabled": CrossSubscriptionRestoreStateEnabled, - "permanentlydisabled": CrossSubscriptionRestoreStatePermanentlyDisabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossSubscriptionRestoreState(input) - return &out, nil -} - -type ImmutabilityState string - -const ( - ImmutabilityStateDisabled ImmutabilityState = "Disabled" - ImmutabilityStateLocked ImmutabilityState = "Locked" - ImmutabilityStateUnlocked ImmutabilityState = "Unlocked" -) - -func PossibleValuesForImmutabilityState() []string { - return []string{ - string(ImmutabilityStateDisabled), - string(ImmutabilityStateLocked), - string(ImmutabilityStateUnlocked), - } -} - -func (s *ImmutabilityState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImmutabilityState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImmutabilityState(input string) (*ImmutabilityState, error) { - vals := map[string]ImmutabilityState{ - "disabled": ImmutabilityStateDisabled, - "locked": ImmutabilityStateLocked, - "unlocked": ImmutabilityStateUnlocked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImmutabilityState(input) - return &out, nil -} - -type InfrastructureEncryptionState string - -const ( - InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled" - InfrastructureEncryptionStateEnabled InfrastructureEncryptionState = "Enabled" -) - -func PossibleValuesForInfrastructureEncryptionState() []string { - return []string{ - string(InfrastructureEncryptionStateDisabled), - string(InfrastructureEncryptionStateEnabled), - } -} - -func (s *InfrastructureEncryptionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInfrastructureEncryptionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInfrastructureEncryptionState(input string) (*InfrastructureEncryptionState, error) { - vals := map[string]InfrastructureEncryptionState{ - "disabled": InfrastructureEncryptionStateDisabled, - "enabled": InfrastructureEncryptionStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InfrastructureEncryptionState(input) - return &out, nil -} - -type MultiUserAuthorization string - -const ( - MultiUserAuthorizationDisabled MultiUserAuthorization = "Disabled" - MultiUserAuthorizationEnabled MultiUserAuthorization = "Enabled" - MultiUserAuthorizationInvalid MultiUserAuthorization = "Invalid" -) - -func PossibleValuesForMultiUserAuthorization() []string { - return []string{ - string(MultiUserAuthorizationDisabled), - string(MultiUserAuthorizationEnabled), - string(MultiUserAuthorizationInvalid), - } -} - -func (s *MultiUserAuthorization) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMultiUserAuthorization(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMultiUserAuthorization(input string) (*MultiUserAuthorization, error) { - vals := map[string]MultiUserAuthorization{ - "disabled": MultiUserAuthorizationDisabled, - "enabled": MultiUserAuthorizationEnabled, - "invalid": MultiUserAuthorizationInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MultiUserAuthorization(input) - return &out, nil -} - -type PrivateEndpointConnectionStatus string - -const ( - PrivateEndpointConnectionStatusApproved PrivateEndpointConnectionStatus = "Approved" - PrivateEndpointConnectionStatusDisconnected PrivateEndpointConnectionStatus = "Disconnected" - PrivateEndpointConnectionStatusPending PrivateEndpointConnectionStatus = "Pending" - PrivateEndpointConnectionStatusRejected PrivateEndpointConnectionStatus = "Rejected" -) - -func PossibleValuesForPrivateEndpointConnectionStatus() []string { - return []string{ - string(PrivateEndpointConnectionStatusApproved), - string(PrivateEndpointConnectionStatusDisconnected), - string(PrivateEndpointConnectionStatusPending), - string(PrivateEndpointConnectionStatusRejected), - } -} - -func (s *PrivateEndpointConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateEndpointConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateEndpointConnectionStatus(input string) (*PrivateEndpointConnectionStatus, error) { - vals := map[string]PrivateEndpointConnectionStatus{ - "approved": PrivateEndpointConnectionStatusApproved, - "disconnected": PrivateEndpointConnectionStatusDisconnected, - "pending": PrivateEndpointConnectionStatusPending, - "rejected": PrivateEndpointConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateEndpointConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStatePending ProvisioningState = "Pending" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStatePending), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "pending": ProvisioningStatePending, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(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 ResourceMoveState string - -const ( - ResourceMoveStateCommitFailed ResourceMoveState = "CommitFailed" - ResourceMoveStateCommitTimedout ResourceMoveState = "CommitTimedout" - ResourceMoveStateCriticalFailure ResourceMoveState = "CriticalFailure" - ResourceMoveStateFailure ResourceMoveState = "Failure" - ResourceMoveStateInProgress ResourceMoveState = "InProgress" - ResourceMoveStateMoveSucceeded ResourceMoveState = "MoveSucceeded" - ResourceMoveStatePartialSuccess ResourceMoveState = "PartialSuccess" - ResourceMoveStatePrepareFailed ResourceMoveState = "PrepareFailed" - ResourceMoveStatePrepareTimedout ResourceMoveState = "PrepareTimedout" - ResourceMoveStateUnknown ResourceMoveState = "Unknown" -) - -func PossibleValuesForResourceMoveState() []string { - return []string{ - string(ResourceMoveStateCommitFailed), - string(ResourceMoveStateCommitTimedout), - string(ResourceMoveStateCriticalFailure), - string(ResourceMoveStateFailure), - string(ResourceMoveStateInProgress), - string(ResourceMoveStateMoveSucceeded), - string(ResourceMoveStatePartialSuccess), - string(ResourceMoveStatePrepareFailed), - string(ResourceMoveStatePrepareTimedout), - string(ResourceMoveStateUnknown), - } -} - -func (s *ResourceMoveState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceMoveState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceMoveState(input string) (*ResourceMoveState, error) { - vals := map[string]ResourceMoveState{ - "commitfailed": ResourceMoveStateCommitFailed, - "committimedout": ResourceMoveStateCommitTimedout, - "criticalfailure": ResourceMoveStateCriticalFailure, - "failure": ResourceMoveStateFailure, - "inprogress": ResourceMoveStateInProgress, - "movesucceeded": ResourceMoveStateMoveSucceeded, - "partialsuccess": ResourceMoveStatePartialSuccess, - "preparefailed": ResourceMoveStatePrepareFailed, - "preparetimedout": ResourceMoveStatePrepareTimedout, - "unknown": ResourceMoveStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceMoveState(input) - return &out, nil -} - -type SecureScoreLevel string - -const ( - SecureScoreLevelAdequate SecureScoreLevel = "Adequate" - SecureScoreLevelMaximum SecureScoreLevel = "Maximum" - SecureScoreLevelMinimum SecureScoreLevel = "Minimum" - SecureScoreLevelNone SecureScoreLevel = "None" -) - -func PossibleValuesForSecureScoreLevel() []string { - return []string{ - string(SecureScoreLevelAdequate), - string(SecureScoreLevelMaximum), - string(SecureScoreLevelMinimum), - string(SecureScoreLevelNone), - } -} - -func (s *SecureScoreLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecureScoreLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecureScoreLevel(input string) (*SecureScoreLevel, error) { - vals := map[string]SecureScoreLevel{ - "adequate": SecureScoreLevelAdequate, - "maximum": SecureScoreLevelMaximum, - "minimum": SecureScoreLevelMinimum, - "none": SecureScoreLevelNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecureScoreLevel(input) - return &out, nil -} - -type SkuName string - -const ( - SkuNameRSZero SkuName = "RS0" - SkuNameStandard SkuName = "Standard" -) - -func PossibleValuesForSkuName() []string { - return []string{ - string(SkuNameRSZero), - string(SkuNameStandard), - } -} - -func (s *SkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuName(input string) (*SkuName, error) { - vals := map[string]SkuName{ - "rs0": SkuNameRSZero, - "standard": SkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuName(input) - return &out, nil -} - -type SoftDeleteState string - -const ( - SoftDeleteStateAlwaysON SoftDeleteState = "AlwaysON" - SoftDeleteStateDisabled SoftDeleteState = "Disabled" - SoftDeleteStateEnabled SoftDeleteState = "Enabled" - SoftDeleteStateInvalid SoftDeleteState = "Invalid" -) - -func PossibleValuesForSoftDeleteState() []string { - return []string{ - string(SoftDeleteStateAlwaysON), - string(SoftDeleteStateDisabled), - string(SoftDeleteStateEnabled), - string(SoftDeleteStateInvalid), - } -} - -func (s *SoftDeleteState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftDeleteState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftDeleteState(input string) (*SoftDeleteState, error) { - vals := map[string]SoftDeleteState{ - "alwayson": SoftDeleteStateAlwaysON, - "disabled": SoftDeleteStateDisabled, - "enabled": SoftDeleteStateEnabled, - "invalid": SoftDeleteStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftDeleteState(input) - return &out, nil -} - -type StandardTierStorageRedundancy string - -const ( - StandardTierStorageRedundancyGeoRedundant StandardTierStorageRedundancy = "GeoRedundant" - StandardTierStorageRedundancyLocallyRedundant StandardTierStorageRedundancy = "LocallyRedundant" - StandardTierStorageRedundancyZoneRedundant StandardTierStorageRedundancy = "ZoneRedundant" -) - -func PossibleValuesForStandardTierStorageRedundancy() []string { - return []string{ - string(StandardTierStorageRedundancyGeoRedundant), - string(StandardTierStorageRedundancyLocallyRedundant), - string(StandardTierStorageRedundancyZoneRedundant), - } -} - -func (s *StandardTierStorageRedundancy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStandardTierStorageRedundancy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStandardTierStorageRedundancy(input string) (*StandardTierStorageRedundancy, error) { - vals := map[string]StandardTierStorageRedundancy{ - "georedundant": StandardTierStorageRedundancyGeoRedundant, - "locallyredundant": StandardTierStorageRedundancyLocallyRedundant, - "zoneredundant": StandardTierStorageRedundancyZoneRedundant, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StandardTierStorageRedundancy(input) - return &out, nil -} - -type TriggerType string - -const ( - TriggerTypeForcedUpgrade TriggerType = "ForcedUpgrade" - TriggerTypeUserTriggered TriggerType = "UserTriggered" -) - -func PossibleValuesForTriggerType() []string { - return []string{ - string(TriggerTypeForcedUpgrade), - string(TriggerTypeUserTriggered), - } -} - -func (s *TriggerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerType(input string) (*TriggerType, error) { - vals := map[string]TriggerType{ - "forcedupgrade": TriggerTypeForcedUpgrade, - "usertriggered": TriggerTypeUserTriggered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerType(input) - return &out, nil -} - -type VaultPrivateEndpointState string - -const ( - VaultPrivateEndpointStateEnabled VaultPrivateEndpointState = "Enabled" - VaultPrivateEndpointStateNone VaultPrivateEndpointState = "None" -) - -func PossibleValuesForVaultPrivateEndpointState() []string { - return []string{ - string(VaultPrivateEndpointStateEnabled), - string(VaultPrivateEndpointStateNone), - } -} - -func (s *VaultPrivateEndpointState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultPrivateEndpointState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultPrivateEndpointState(input string) (*VaultPrivateEndpointState, error) { - vals := map[string]VaultPrivateEndpointState{ - "enabled": VaultPrivateEndpointStateEnabled, - "none": VaultPrivateEndpointStateNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultPrivateEndpointState(input) - return &out, nil -} - -type VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} - -type VaultUpgradeState string - -const ( - VaultUpgradeStateFailed VaultUpgradeState = "Failed" - VaultUpgradeStateInProgress VaultUpgradeState = "InProgress" - VaultUpgradeStateUnknown VaultUpgradeState = "Unknown" - VaultUpgradeStateUpgraded VaultUpgradeState = "Upgraded" -) - -func PossibleValuesForVaultUpgradeState() []string { - return []string{ - string(VaultUpgradeStateFailed), - string(VaultUpgradeStateInProgress), - string(VaultUpgradeStateUnknown), - string(VaultUpgradeStateUpgraded), - } -} - -func (s *VaultUpgradeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultUpgradeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultUpgradeState(input string) (*VaultUpgradeState, error) { - vals := map[string]VaultUpgradeState{ - "failed": VaultUpgradeStateFailed, - "inprogress": VaultUpgradeStateInProgress, - "unknown": VaultUpgradeStateUnknown, - "upgraded": VaultUpgradeStateUpgraded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultUpgradeState(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/id_vault.go b/resource-manager/recoveryservices/2023-04-01/vaults/id_vault.go deleted file mode 100644 index 1cb6def7087..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaults - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/id_vault_test.go b/resource-manager/recoveryservices/2023-04-01/vaults/id_vault_test.go deleted file mode 100644 index d99d7310acc..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaults - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-04-01/vaults/method_createorupdate.go b/resource-manager/recoveryservices/2023-04-01/vaults/method_createorupdate.go deleted file mode 100644 index 93fd5e76cbb..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 *Vault -} - -// CreateOrUpdate ... -func (c VaultsClient) CreateOrUpdate(ctx context.Context, id VaultId, input Vault) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VaultsClient) CreateOrUpdateThenPoll(ctx context.Context, id VaultId, input Vault) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/recoveryservices/2023-04-01/vaults/method_delete.go b/resource-manager/recoveryservices/2023-04-01/vaults/method_delete.go deleted file mode 100644 index 70e0ba8dd2b..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package vaults - -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 VaultsClient) Delete(ctx context.Context, id VaultId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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/recoveryservices/2023-04-01/vaults/method_get.go b/resource-manager/recoveryservices/2023-04-01/vaults/method_get.go deleted file mode 100644 index 181926c5390..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package vaults - -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 *Vault -} - -// Get ... -func (c VaultsClient) Get(ctx context.Context, id VaultId) (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 Vault - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/method_listbyresourcegroup.go b/resource-manager/recoveryservices/2023-04-01/vaults/method_listbyresourcegroup.go deleted file mode 100644 index 09ba434e931..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 *[]Vault -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListByResourceGroup ... -func (c VaultsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `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 VaultsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VaultOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/recoveryservices/2023-04-01/vaults/method_listbysubscriptionid.go b/resource-manager/recoveryservices/2023-04-01/vaults/method_listbysubscriptionid.go deleted file mode 100644 index e1f63694b10..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/method_listbysubscriptionid.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 ListBySubscriptionIdOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Vault -} - -type ListBySubscriptionIdCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListBySubscriptionId ... -func (c VaultsClient) ListBySubscriptionId(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionIdOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionIdComplete retrieves all the results into a single object -func (c VaultsClient) ListBySubscriptionIdComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionIdCompleteResult, error) { - return c.ListBySubscriptionIdCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListBySubscriptionIdCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListBySubscriptionIdCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VaultOperationPredicate) (result ListBySubscriptionIdCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListBySubscriptionId(ctx, id) - if err != nil { - 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 = ListBySubscriptionIdCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/method_update.go b/resource-manager/recoveryservices/2023-04-01/vaults/method_update.go deleted file mode 100644 index fd0c9f3e6da..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Vault -} - -// Update ... -func (c VaultsClient) Update(ctx context.Context, id VaultId, input PatchVault) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VaultsClient) UpdateThenPoll(ctx context.Context, id VaultId, input PatchVault) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_azuremonitoralertsettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_azuremonitoralertsettings.go deleted file mode 100644 index c41bfcca517..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_azuremonitoralertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorAlertSettings struct { - AlertsForAllJobFailures *AlertsState `json:"alertsForAllJobFailures,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_classicalertsettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_classicalertsettings.go deleted file mode 100644 index f82f4c55b31..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_classicalertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClassicAlertSettings struct { - AlertsForCriticalOperations *AlertsState `json:"alertsForCriticalOperations,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkekidentity.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkekidentity.go deleted file mode 100644 index 1e5e7be3d2d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkekidentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKekIdentity struct { - UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkeyvaultproperties.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkeyvaultproperties.go deleted file mode 100644 index c53f530b9f5..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_cmkkeyvaultproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKeyVaultProperties struct { - KeyUri *string `json:"keyUri,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_crosssubscriptionrestoresettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_crosssubscriptionrestoresettings.go deleted file mode 100644 index 4a4fecb8bdd..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_crosssubscriptionrestoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossSubscriptionRestoreSettings struct { - CrossSubscriptionRestoreState *CrossSubscriptionRestoreState `json:"crossSubscriptionRestoreState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_immutabilitysettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_immutabilitysettings.go deleted file mode 100644 index f52ae97a4c3..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_immutabilitysettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImmutabilitySettings struct { - State *ImmutabilityState `json:"state,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_monitoringsettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_monitoringsettings.go deleted file mode 100644 index 391ede46ae2..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_monitoringsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSettings struct { - AzureMonitorAlertSettings *AzureMonitorAlertSettings `json:"azureMonitorAlertSettings,omitempty"` - ClassicAlertSettings *ClassicAlertSettings `json:"classicAlertSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_patchvault.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_patchvault.go deleted file mode 100644 index 5ffc9615bc5..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_patchvault.go +++ /dev/null @@ -1,20 +0,0 @@ -package vaults - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchVault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpoint.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpoint.go deleted file mode 100644 index 64ce35a3d98..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// 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/recoveryservices/2023-04-01/vaults/model_privateendpointconnection.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnection.go deleted file mode 100644 index 687aefc111c..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaults - -// 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 { - GroupIds *[]VaultSubResourceType `json:"groupIds,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnectionvaultproperties.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnectionvaultproperties.go deleted file mode 100644 index 5758db1bfa3..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_privateendpointconnectionvaultproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionVaultProperties struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointConnection `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_privatelinkserviceconnectionstate.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index b07724e0e27..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *PrivateEndpointConnectionStatus `json:"status,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_restoresettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_restoresettings.go deleted file mode 100644 index b5126dbe263..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_restoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreSettings struct { - CrossSubscriptionRestoreSettings *CrossSubscriptionRestoreSettings `json:"crossSubscriptionRestoreSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_securitysettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_securitysettings.go deleted file mode 100644 index b5c9821e944..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_securitysettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecuritySettings struct { - ImmutabilitySettings *ImmutabilitySettings `json:"immutabilitySettings,omitempty"` - MultiUserAuthorization *MultiUserAuthorization `json:"multiUserAuthorization,omitempty"` - SoftDeleteSettings *SoftDeleteSettings `json:"softDeleteSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_sku.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_sku.go deleted file mode 100644 index d89e1340ee6..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *string `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name SkuName `json:"name"` - Size *string `json:"size,omitempty"` - Tier *string `json:"tier,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_softdeletesettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_softdeletesettings.go deleted file mode 100644 index 64f405a917d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_softdeletesettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftDeleteSettings struct { - SoftDeleteRetentionPeriodInDays *int64 `json:"softDeleteRetentionPeriodInDays,omitempty"` - SoftDeleteState *SoftDeleteState `json:"softDeleteState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_upgradedetails.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_upgradedetails.go deleted file mode 100644 index f5e021983ab..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_upgradedetails.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaults - -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 UpgradeDetails struct { - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Message *string `json:"message,omitempty"` - OperationId *string `json:"operationId,omitempty"` - PreviousResourceId *string `json:"previousResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *VaultUpgradeState `json:"status,omitempty"` - TriggerType *TriggerType `json:"triggerType,omitempty"` - UpgradedResourceId *string `json:"upgradedResourceId,omitempty"` -} - -func (o *UpgradeDetails) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetLastUpdatedTimeUtcAsTime() (*time.Time, error) { - if o.LastUpdatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetLastUpdatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_vault.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_vault.go deleted file mode 100644 index dc5d7d049c1..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_vault.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -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 Vault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `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/recoveryservices/2023-04-01/vaults/model_vaultproperties.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultproperties.go deleted file mode 100644 index 01dae5e76f8..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultProperties struct { - BackupStorageVersion *BackupStorageVersion `json:"backupStorageVersion,omitempty"` - Encryption *VaultPropertiesEncryption `json:"encryption,omitempty"` - MonitoringSettings *MonitoringSettings `json:"monitoringSettings,omitempty"` - MoveDetails *VaultPropertiesMoveDetails `json:"moveDetails,omitempty"` - MoveState *ResourceMoveState `json:"moveState,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnectionVaultProperties `json:"privateEndpointConnections,omitempty"` - PrivateEndpointStateForBackup *VaultPrivateEndpointState `json:"privateEndpointStateForBackup,omitempty"` - PrivateEndpointStateForSiteRecovery *VaultPrivateEndpointState `json:"privateEndpointStateForSiteRecovery,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - RedundancySettings *VaultPropertiesRedundancySettings `json:"redundancySettings,omitempty"` - RestoreSettings *RestoreSettings `json:"restoreSettings,omitempty"` - SecureScore *SecureScoreLevel `json:"secureScore,omitempty"` - SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"` - UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesencryption.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesencryption.go deleted file mode 100644 index 05c6effec1d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesencryption.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesEncryption struct { - InfrastructureEncryption *InfrastructureEncryptionState `json:"infrastructureEncryption,omitempty"` - KekIdentity *CmkKekIdentity `json:"kekIdentity,omitempty"` - KeyVaultProperties *CmkKeyVaultProperties `json:"keyVaultProperties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesmovedetails.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesmovedetails.go deleted file mode 100644 index b65be5a0669..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesmovedetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package vaults - -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 VaultPropertiesMoveDetails struct { - CompletionTimeUtc *string `json:"completionTimeUtc,omitempty"` - OperationId *string `json:"operationId,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` -} - -func (o *VaultPropertiesMoveDetails) GetCompletionTimeUtcAsTime() (*time.Time, error) { - if o.CompletionTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CompletionTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetCompletionTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CompletionTimeUtc = &formatted -} - -func (o *VaultPropertiesMoveDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesredundancysettings.go b/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesredundancysettings.go deleted file mode 100644 index 2d1174f221f..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/model_vaultpropertiesredundancysettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesRedundancySettings struct { - CrossRegionRestore *CrossRegionRestore `json:"crossRegionRestore,omitempty"` - StandardTierStorageRedundancy *StandardTierStorageRedundancy `json:"standardTierStorageRedundancy,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/predicates.go b/resource-manager/recoveryservices/2023-04-01/vaults/predicates.go deleted file mode 100644 index 1039a9afe4e..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VaultOperationPredicate) Matches(input Vault) 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 -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaults/version.go b/resource-manager/recoveryservices/2023-04-01/vaults/version.go deleted file mode 100644 index a83d09775a3..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaults/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaults/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/README.md b/resource-manager/recoveryservices/2023-04-01/vaultusages/README.md deleted file mode 100644 index 8499dbc943d..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-04-01/vaultusages` Documentation - -The `vaultusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-04-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/recoveryservices/2023-04-01/vaultusages" -``` - - -### Client Initialization - -```go -client := vaultusages.NewVaultUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultUsagesClient.UsagesListByVaults` - -```go -ctx := context.TODO() -id := vaultusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -read, err := client.UsagesListByVaults(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/recoveryservices/2023-04-01/vaultusages/client.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/client.go deleted file mode 100644 index 625eba65044..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultusages - -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 VaultUsagesClient struct { - Client *resourcemanager.Client -} - -func NewVaultUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultUsagesClient: %+v", err) - } - - return &VaultUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/constants.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/constants.go deleted file mode 100644 index 333eba1e6c6..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package vaultusages - -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 UsagesUnit string - -const ( - UsagesUnitBytes UsagesUnit = "Bytes" - UsagesUnitBytesPerSecond UsagesUnit = "BytesPerSecond" - UsagesUnitCount UsagesUnit = "Count" - UsagesUnitCountPerSecond UsagesUnit = "CountPerSecond" - UsagesUnitPercent UsagesUnit = "Percent" - UsagesUnitSeconds UsagesUnit = "Seconds" -) - -func PossibleValuesForUsagesUnit() []string { - return []string{ - string(UsagesUnitBytes), - string(UsagesUnitBytesPerSecond), - string(UsagesUnitCount), - string(UsagesUnitCountPerSecond), - string(UsagesUnitPercent), - string(UsagesUnitSeconds), - } -} - -func (s *UsagesUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUsagesUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUsagesUnit(input string) (*UsagesUnit, error) { - vals := map[string]UsagesUnit{ - "bytes": UsagesUnitBytes, - "bytespersecond": UsagesUnitBytesPerSecond, - "count": UsagesUnitCount, - "countpersecond": UsagesUnitCountPerSecond, - "percent": UsagesUnitPercent, - "seconds": UsagesUnitSeconds, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsagesUnit(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault.go deleted file mode 100644 index b455e8760a5..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault_test.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault_test.go deleted file mode 100644 index 9ef11c18ec0..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-04-01/vaultusages/method_usageslistbyvaults.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/method_usageslistbyvaults.go deleted file mode 100644 index 258a5d0bb75..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/method_usageslistbyvaults.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultusages - -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 UsagesListByVaultsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultUsageList -} - -// UsagesListByVaults ... -func (c VaultUsagesClient) UsagesListByVaults(ctx context.Context, id VaultId) (result UsagesListByVaultsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 VaultUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/model_nameinfo.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/model_nameinfo.go deleted file mode 100644 index 974668c26f9..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/model_nameinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameInfo struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusage.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusage.go deleted file mode 100644 index 6b7bc2b68d8..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusage.go +++ /dev/null @@ -1,31 +0,0 @@ -package vaultusages - -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 VaultUsage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *NameInfo `json:"name,omitempty"` - NextResetTime *string `json:"nextResetTime,omitempty"` - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - Unit *UsagesUnit `json:"unit,omitempty"` -} - -func (o *VaultUsage) GetNextResetTimeAsTime() (*time.Time, error) { - if o.NextResetTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.NextResetTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultUsage) SetNextResetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.NextResetTime = &formatted -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusagelist.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusagelist.go deleted file mode 100644 index aa529e6fcbf..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/model_vaultusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultUsageList struct { - Value *[]VaultUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-04-01/vaultusages/version.go b/resource-manager/recoveryservices/2023-04-01/vaultusages/version.go deleted file mode 100644 index 21400b0be46..00000000000 --- a/resource-manager/recoveryservices/2023-04-01/vaultusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-04-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/client.go b/resource-manager/recoveryservices/2023-06-01/client.go deleted file mode 100644 index ed9a6371a25..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_06_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/recoveryservices/2023-06-01/getprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/recoveryservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/registeredidentities" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/replicationusages" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaultcertificates" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaults" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaultusages" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - GetPrivateLinkResources *getprivatelinkresources.GetPrivateLinkResourcesClient - ListPrivateLinkResources *listprivatelinkresources.ListPrivateLinkResourcesClient - RecoveryServices *recoveryservices.RecoveryServicesClient - RegisteredIdentities *registeredidentities.RegisteredIdentitiesClient - ReplicationUsages *replicationusages.ReplicationUsagesClient - VaultCertificates *vaultcertificates.VaultCertificatesClient - VaultExtendedInfo *vaultextendedinfo.VaultExtendedInfoClient - VaultUsages *vaultusages.VaultUsagesClient - Vaults *vaults.VaultsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - getPrivateLinkResourcesClient, err := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building GetPrivateLinkResources client: %+v", err) - } - configureFunc(getPrivateLinkResourcesClient.Client) - - listPrivateLinkResourcesClient, err := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ListPrivateLinkResources client: %+v", err) - } - configureFunc(listPrivateLinkResourcesClient.Client) - - recoveryServicesClient, err := recoveryservices.NewRecoveryServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RecoveryServices client: %+v", err) - } - configureFunc(recoveryServicesClient.Client) - - registeredIdentitiesClient, err := registeredidentities.NewRegisteredIdentitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RegisteredIdentities client: %+v", err) - } - configureFunc(registeredIdentitiesClient.Client) - - replicationUsagesClient, err := replicationusages.NewReplicationUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ReplicationUsages client: %+v", err) - } - configureFunc(replicationUsagesClient.Client) - - vaultCertificatesClient, err := vaultcertificates.NewVaultCertificatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultCertificates client: %+v", err) - } - configureFunc(vaultCertificatesClient.Client) - - vaultExtendedInfoClient, err := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultExtendedInfo client: %+v", err) - } - configureFunc(vaultExtendedInfoClient.Client) - - vaultUsagesClient, err := vaultusages.NewVaultUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultUsages client: %+v", err) - } - configureFunc(vaultUsagesClient.Client) - - vaultsClient, err := vaults.NewVaultsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Vaults client: %+v", err) - } - configureFunc(vaultsClient.Client) - - return &Client{ - GetPrivateLinkResources: getPrivateLinkResourcesClient, - ListPrivateLinkResources: listPrivateLinkResourcesClient, - RecoveryServices: recoveryServicesClient, - RegisteredIdentities: registeredIdentitiesClient, - ReplicationUsages: replicationUsagesClient, - VaultCertificates: vaultCertificatesClient, - VaultExtendedInfo: vaultExtendedInfoClient, - VaultUsages: vaultUsagesClient, - Vaults: vaultsClient, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/README.md deleted file mode 100644 index 1b2e38ce13f..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources` Documentation - -The `getprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/getprivatelinkresources" -``` - - -### Client Initialization - -```go -client := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `GetPrivateLinkResourcesClient.PrivateLinkResourcesGet` - -```go -ctx := context.TODO() -id := getprivatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - -read, err := client.PrivateLinkResourcesGet(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/recoveryservices/2023-06-01/getprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/client.go deleted file mode 100644 index 2c788db4e51..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package getprivatelinkresources - -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 GetPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*GetPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "getprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating GetPrivateLinkResourcesClient: %+v", err) - } - - return &GetPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource.go deleted file mode 100644 index 70ee568e5d3..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package getprivatelinkresources - -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(&PrivateLinkResourceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkResourceId{} - -// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource -type PrivateLinkResourceId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - PrivateLinkResourceName string -} - -// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct -func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, vaultName string, privateLinkResourceName string) PrivateLinkResourceId { - return PrivateLinkResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - PrivateLinkResourceName: privateLinkResourceName, - } -} - -// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId -func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkResourceId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) - } - - return nil -} - -// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID -func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Resource ID -func (id PrivateLinkResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/privateLinkResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.PrivateLinkResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID -func (id PrivateLinkResourceId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), - } -} - -// String returns a human-readable description of this Private Link Resource ID -func (id PrivateLinkResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), - } - return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource_test.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource_test.go deleted file mode 100644 index 7ee1c858da1..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/id_privatelinkresource_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package getprivatelinkresources - -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 = &PrivateLinkResourceId{} - -func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.PrivateLinkResourceName != "privateLinkResourceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceValue") - } -} - -func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkResourceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestSegmentsForPrivateLinkResourceId(t *testing.T) { - segments := PrivateLinkResourceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkResourceId 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/recoveryservices/2023-06-01/getprivatelinkresources/method_privatelinkresourcesget.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/method_privatelinkresourcesget.go deleted file mode 100644 index 8074fb34792..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/method_privatelinkresourcesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package getprivatelinkresources - -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 PrivateLinkResourcesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkResource -} - -// PrivateLinkResourcesGet ... -func (c GetPrivateLinkResourcesClient) PrivateLinkResourcesGet(ctx context.Context, id PrivateLinkResourceId) (result PrivateLinkResourcesGetOperationResponse, 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 PrivateLinkResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 36e56a45b5e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package getprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index 92b1276283a..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package getprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/version.go deleted file mode 100644 index 282989e280b..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/getprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package getprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/getprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/README.md deleted file mode 100644 index ac5c00033e1..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources` Documentation - -The `listprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/listprivatelinkresources" -``` - - -### Client Initialization - -```go -client := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ListPrivateLinkResourcesClient.PrivateLinkResourcesList` - -```go -ctx := context.TODO() -id := listprivatelinkresources.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -// alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination -items, err := client.PrivateLinkResourcesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/client.go deleted file mode 100644 index d68ed338ccc..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package listprivatelinkresources - -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 ListPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewListPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ListPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "listprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ListPrivateLinkResourcesClient: %+v", err) - } - - return &ListPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault.go deleted file mode 100644 index 332d5bf97d5..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package listprivatelinkresources - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault_test.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault_test.go deleted file mode 100644 index 79099dc74de..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package listprivatelinkresources - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-06-01/listprivatelinkresources/method_privatelinkresourceslist.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/method_privatelinkresourceslist.go deleted file mode 100644 index 994db6cbef7..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/method_privatelinkresourceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package listprivatelinkresources - -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 PrivateLinkResourcesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkResource -} - -type PrivateLinkResourcesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkResource -} - -// PrivateLinkResourcesList ... -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesList(ctx context.Context, id VaultId) (result PrivateLinkResourcesListOperationResponse, 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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateLinkResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PrivateLinkResourcesListComplete retrieves all the results into a single object -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListComplete(ctx context.Context, id VaultId) (PrivateLinkResourcesListCompleteResult, error) { - return c.PrivateLinkResourcesListCompleteMatchingPredicate(ctx, id, PrivateLinkResourceOperationPredicate{}) -} - -// PrivateLinkResourcesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListCompleteMatchingPredicate(ctx context.Context, id VaultId, predicate PrivateLinkResourceOperationPredicate) (result PrivateLinkResourcesListCompleteResult, err error) { - items := make([]PrivateLinkResource, 0) - - resp, err := c.PrivateLinkResourcesList(ctx, id) - if err != nil { - 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 = PrivateLinkResourcesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 43ad3ab77fa..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package listprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index b1ff4a935fd..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/predicates.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/predicates.go deleted file mode 100644 index 5eb0bb91e57..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PrivateLinkResourceOperationPredicate) Matches(input PrivateLinkResource) 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/recoveryservices/2023-06-01/listprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/version.go deleted file mode 100644 index 8e10e690998..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/listprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package listprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/listprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/README.md b/resource-manager/recoveryservices/2023-06-01/recoveryservices/README.md deleted file mode 100644 index 289431eccd8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/README.md +++ /dev/null @@ -1,62 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/recoveryservices` Documentation - -The `recoveryservices` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/recoveryservices" -``` - - -### Client Initialization - -```go -client := recoveryservices.NewRecoveryServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RecoveryServicesClient.Capabilities` - -```go -ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := recoveryservices.ResourceCapabilities{ - // ... -} - - -read, err := client.Capabilities(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RecoveryServicesClient.CheckNameAvailability` - -```go -ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := recoveryservices.CheckNameAvailabilityParameters{ - // ... -} - - -read, err := client.CheckNameAvailability(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/recoveryservices/2023-06-01/recoveryservices/client.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/client.go deleted file mode 100644 index 518088771ea..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package recoveryservices - -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 RecoveryServicesClient struct { - Client *resourcemanager.Client -} - -func NewRecoveryServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*RecoveryServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "recoveryservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RecoveryServicesClient: %+v", err) - } - - return &RecoveryServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/constants.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/constants.go deleted file mode 100644 index 920bcd8e566..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package recoveryservices - -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 VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location.go deleted file mode 100644 index 1fd49c9d992..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package recoveryservices - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservices/2023-06-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location_test.go deleted file mode 100644 index 3c75d278a94..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package recoveryservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservices/2023-06-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation.go deleted file mode 100644 index 33d3548750d..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package recoveryservices - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation_test.go deleted file mode 100644 index 28405ec9bd8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package recoveryservices - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/recoveryservices/2023-06-01/recoveryservices/method_capabilities.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/method_capabilities.go deleted file mode 100644 index 5864d60faeb..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/method_capabilities.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CapabilitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CapabilitiesResponse -} - -// Capabilities ... -func (c RecoveryServicesClient) Capabilities(ctx context.Context, id LocationId, input ResourceCapabilities) (result CapabilitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/capabilities", 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 CapabilitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/method_checknameavailability.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/method_checknameavailability.go deleted file mode 100644 index 3512794c701..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/method_checknameavailability.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CheckNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CheckNameAvailabilityResult -} - -// CheckNameAvailability ... -func (c RecoveryServicesClient) CheckNameAvailability(ctx context.Context, id ProviderLocationId, input CheckNameAvailabilityParameters) (result CheckNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkNameAvailability", 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 CheckNameAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesproperties.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesproperties.go deleted file mode 100644 index 3698ddb8850..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesProperties struct { - DnsZones *[]DNSZone `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponse.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponse.go deleted file mode 100644 index 47e4997660f..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponse struct { - Properties *CapabilitiesResponseProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponseproperties.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponseproperties.go deleted file mode 100644 index 8c1bfbcac8d..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_capabilitiesresponseproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponseProperties struct { - DnsZones *[]DNSZoneResponse `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityparameters.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityparameters.go deleted file mode 100644 index e6c5aff2402..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityParameters struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityresult.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityresult.go deleted file mode 100644 index d2840ec335e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_checknameavailabilityresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityResult struct { - Message *string `json:"message,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason *string `json:"reason,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszone.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszone.go deleted file mode 100644 index 34952cfbd7e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszone.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZone struct { - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszoneresponse.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszoneresponse.go deleted file mode 100644 index 4aabe0bd6d4..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_dnszoneresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZoneResponse struct { - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_resourcecapabilities.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_resourcecapabilities.go deleted file mode 100644 index 16d3a668058..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/model_resourcecapabilities.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceCapabilities struct { - Properties *CapabilitiesProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/recoveryservices/version.go b/resource-manager/recoveryservices/2023-06-01/recoveryservices/version.go deleted file mode 100644 index 37dce0c1be8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/recoveryservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoveryservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/recoveryservices/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/registeredidentities/client.go b/resource-manager/recoveryservices/2023-06-01/registeredidentities/client.go deleted file mode 100644 index 36b4015e582..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/registeredidentities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient struct { - Client *resourcemanager.Client -} - -func NewRegisteredIdentitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*RegisteredIdentitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "registeredidentities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RegisteredIdentitiesClient: %+v", err) - } - - return &RegisteredIdentitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity.go deleted file mode 100644 index 147a6d0d6e3..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity.go +++ /dev/null @@ -1,139 +0,0 @@ -package registeredidentities - -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(&RegisteredIdentityId{}) -} - -var _ resourceids.ResourceId = &RegisteredIdentityId{} - -// RegisteredIdentityId is a struct representing the Resource ID for a Registered Identity -type RegisteredIdentityId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - RegisteredIdentityName string -} - -// NewRegisteredIdentityID returns a new RegisteredIdentityId struct -func NewRegisteredIdentityID(subscriptionId string, resourceGroupName string, vaultName string, registeredIdentityName string) RegisteredIdentityId { - return RegisteredIdentityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - RegisteredIdentityName: registeredIdentityName, - } -} - -// ParseRegisteredIdentityID parses 'input' into a RegisteredIdentityId -func ParseRegisteredIdentityID(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegisteredIdentityIDInsensitively parses 'input' case-insensitively into a RegisteredIdentityId -// note: this method should only be used for API response data and not user input -func ParseRegisteredIdentityIDInsensitively(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegisteredIdentityId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.RegisteredIdentityName, ok = input.Parsed["registeredIdentityName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registeredIdentityName", input) - } - - return nil -} - -// ValidateRegisteredIdentityID checks that 'input' can be parsed as a Registered Identity ID -func ValidateRegisteredIdentityID(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 := ParseRegisteredIdentityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registered Identity ID -func (id RegisteredIdentityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/registeredIdentities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.RegisteredIdentityName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registered Identity ID -func (id RegisteredIdentityId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityValue"), - } -} - -// String returns a human-readable description of this Registered Identity ID -func (id RegisteredIdentityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Registered Identity Name: %q", id.RegisteredIdentityName), - } - return fmt.Sprintf("Registered Identity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity_test.go deleted file mode 100644 index 6857bb4f14e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/registeredidentities/id_registeredidentity_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package registeredidentities - -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 = &RegisteredIdentityId{} - -func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.RegisteredIdentityName != "registeredIdentityValue" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityValue") - } -} - -func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRegisteredIdentityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - RegisteredIdentityName: "rEgIsTeReDiDeNtItYvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestSegmentsForRegisteredIdentityId(t *testing.T) { - segments := RegisteredIdentityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RegisteredIdentityId 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/recoveryservices/2023-06-01/registeredidentities/method_delete.go b/resource-manager/recoveryservices/2023-06-01/registeredidentities/method_delete.go deleted file mode 100644 index 16a5301af92..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/registeredidentities/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient) Delete(ctx context.Context, id RegisteredIdentityId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/registeredidentities/version.go b/resource-manager/recoveryservices/2023-06-01/registeredidentities/version.go deleted file mode 100644 index bcf349f3fa5..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/registeredidentities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package registeredidentities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/registeredidentities/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/README.md b/resource-manager/recoveryservices/2023-06-01/replicationusages/README.md deleted file mode 100644 index 2a33c817ac2..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/replicationusages` Documentation - -The `replicationusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/replicationusages" -``` - - -### Client Initialization - -```go -client := replicationusages.NewReplicationUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ReplicationUsagesClient.List` - -```go -ctx := context.TODO() -id := replicationusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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/recoveryservices/2023-06-01/replicationusages/client.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/client.go deleted file mode 100644 index 40ebde8ba63..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package replicationusages - -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 ReplicationUsagesClient struct { - Client *resourcemanager.Client -} - -func NewReplicationUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "replicationusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ReplicationUsagesClient: %+v", err) - } - - return &ReplicationUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault.go deleted file mode 100644 index 338b117c7be..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package replicationusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault_test.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault_test.go deleted file mode 100644 index 679ad2eacfb..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package replicationusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-06-01/replicationusages/method_list.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/method_list.go deleted file mode 100644 index 67aa893023e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package replicationusages - -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 *ReplicationUsageList -} - -// List ... -func (c ReplicationUsagesClient) List(ctx context.Context, id VaultId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/replicationUsages", 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 ReplicationUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_jobssummary.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/model_jobssummary.go deleted file mode 100644 index b4e8997b7d2..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_jobssummary.go +++ /dev/null @@ -1,10 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobsSummary struct { - FailedJobs *int64 `json:"failedJobs,omitempty"` - InProgressJobs *int64 `json:"inProgressJobs,omitempty"` - SuspendedJobs *int64 `json:"suspendedJobs,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_monitoringsummary.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/model_monitoringsummary.go deleted file mode 100644 index fbf4ba89507..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_monitoringsummary.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSummary struct { - DeprecatedProviderCount *int64 `json:"deprecatedProviderCount,omitempty"` - EventsCount *int64 `json:"eventsCount,omitempty"` - SupportedProviderCount *int64 `json:"supportedProviderCount,omitempty"` - UnHealthyProviderCount *int64 `json:"unHealthyProviderCount,omitempty"` - UnHealthyVMCount *int64 `json:"unHealthyVmCount,omitempty"` - UnsupportedProviderCount *int64 `json:"unsupportedProviderCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusage.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusage.go deleted file mode 100644 index 0842f810533..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusage.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsage struct { - JobsSummary *JobsSummary `json:"jobsSummary,omitempty"` - MonitoringSummary *MonitoringSummary `json:"monitoringSummary,omitempty"` - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - RecoveryPlanCount *int64 `json:"recoveryPlanCount,omitempty"` - RecoveryServicesProviderAuthType *int64 `json:"recoveryServicesProviderAuthType,omitempty"` - RegisteredServersCount *int64 `json:"registeredServersCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusagelist.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusagelist.go deleted file mode 100644 index 11300c459d2..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/model_replicationusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsageList struct { - Value *[]ReplicationUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/replicationusages/version.go b/resource-manager/recoveryservices/2023-06-01/replicationusages/version.go deleted file mode 100644 index 5fcb6d3adb1..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/replicationusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package replicationusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/replicationusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/README.md b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/README.md deleted file mode 100644 index f7d89e155c8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaultcertificates` Documentation - -The `vaultcertificates` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/vaultcertificates" -``` - - -### Client Initialization - -```go -client := vaultcertificates.NewVaultCertificatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultCertificatesClient.Create` - -```go -ctx := context.TODO() -id := vaultcertificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - -payload := vaultcertificates.CertificateRequest{ - // ... -} - - -read, err := client.Create(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/recoveryservices/2023-06-01/vaultcertificates/client.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/client.go deleted file mode 100644 index f25a5998dcc..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultcertificates - -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 VaultCertificatesClient struct { - Client *resourcemanager.Client -} - -func NewVaultCertificatesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultCertificatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultcertificates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultCertificatesClient: %+v", err) - } - - return &VaultCertificatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/constants.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/constants.go deleted file mode 100644 index 66072e83ada..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package vaultcertificates - -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 AuthType string - -const ( - AuthTypeAAD AuthType = "AAD" - AuthTypeACS AuthType = "ACS" - AuthTypeAccessControlService AuthType = "AccessControlService" - AuthTypeAzureActiveDirectory AuthType = "AzureActiveDirectory" - AuthTypeInvalid AuthType = "Invalid" -) - -func PossibleValuesForAuthType() []string { - return []string{ - string(AuthTypeAAD), - string(AuthTypeACS), - string(AuthTypeAccessControlService), - string(AuthTypeAzureActiveDirectory), - string(AuthTypeInvalid), - } -} - -func (s *AuthType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthType(input string) (*AuthType, error) { - vals := map[string]AuthType{ - "aad": AuthTypeAAD, - "acs": AuthTypeACS, - "accesscontrolservice": AuthTypeAccessControlService, - "azureactivedirectory": AuthTypeAzureActiveDirectory, - "invalid": AuthTypeInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate.go deleted file mode 100644 index 1a998266e49..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate.go +++ /dev/null @@ -1,139 +0,0 @@ -package vaultcertificates - -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(&CertificateId{}) -} - -var _ resourceids.ResourceId = &CertificateId{} - -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - CertificateName string -} - -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, vaultName string, certificateName string) CertificateId { - return CertificateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - CertificateName: certificateName, - } -} - -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId -// note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CertificateId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.CertificateName, ok = input.Parsed["certificateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "certificateName", input) - } - - return nil -} - -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(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 := ParseCertificateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/certificates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.CertificateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "certificateValue"), - } -} - -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Certificate Name: %q", id.CertificateName), - } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate_test.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate_test.go deleted file mode 100644 index 2e113a065ed..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/id_certificate_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package vaultcertificates - -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 = &CertificateId{} - -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.CertificateName != "certificateValue" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateValue") - } -} - -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCertificateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestParseCertificateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - CertificateName: "cErTiFiCaTeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CertificateId 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/recoveryservices/2023-06-01/vaultcertificates/method_create.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/method_create.go deleted file mode 100644 index 1be290d4f6b..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaultcertificates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultCertificateResponse -} - -// Create ... -func (c VaultCertificatesClient) Create(ctx context.Context, id CertificateId, input CertificateRequest) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 VaultCertificateResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_certificaterequest.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_certificaterequest.go deleted file mode 100644 index 64984a9fb6e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_certificaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CertificateRequest struct { - Properties *RawCertificateData `json:"properties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_rawcertificatedata.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_rawcertificatedata.go deleted file mode 100644 index 2b6657d3813..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_rawcertificatedata.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RawCertificateData struct { - AuthType *AuthType `json:"authType,omitempty"` - Certificate *string `json:"certificate,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandaaddetails.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandaaddetails.go deleted file mode 100644 index 59f9a303924..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandaaddetails.go +++ /dev/null @@ -1,82 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAadDetails{} - -type ResourceCertificateAndAadDetails struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadAuthority string `json:"aadAuthority"` - AadTenantId string `json:"aadTenantId"` - AzureManagementEndpointAudience string `json:"azureManagementEndpointAudience"` - ServicePrincipalClientId string `json:"servicePrincipalClientId"` - ServicePrincipalObjectId string `json:"servicePrincipalObjectId"` - ServiceResourceId *string `json:"serviceResourceId,omitempty"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAadDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAadDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAadDetails{} - -func (s ResourceCertificateAndAadDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAadDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAadDetails: %+v", err) - } - decoded["authType"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandacsdetails.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandacsdetails.go deleted file mode 100644 index f0a2484e123..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificateandacsdetails.go +++ /dev/null @@ -1,78 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAcsDetails{} - -type ResourceCertificateAndAcsDetails struct { - GlobalAcsHostName string `json:"globalAcsHostName"` - GlobalAcsNamespace string `json:"globalAcsNamespace"` - GlobalAcsRPRealm string `json:"globalAcsRPRealm"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAcsDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAcsDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAcsDetails{} - -func (s ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAcsDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAcsDetails: %+v", err) - } - decoded["authType"] = "AccessControlService" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificatedetails.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificatedetails.go deleted file mode 100644 index 4057ff8ccdd..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_resourcecertificatedetails.go +++ /dev/null @@ -1,61 +0,0 @@ -package vaultcertificates - -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 ResourceCertificateDetails interface { -} - -// RawResourceCertificateDetailsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawResourceCertificateDetailsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalResourceCertificateDetailsImplementation(input []byte) (ResourceCertificateDetails, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateDetails into map[string]interface: %+v", err) - } - - value, ok := temp["authType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out ResourceCertificateAndAadDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAadDetails: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AccessControlService") { - var out ResourceCertificateAndAcsDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAcsDetails: %+v", err) - } - return out, nil - } - - out := RawResourceCertificateDetailsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_vaultcertificateresponse.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_vaultcertificateresponse.go deleted file mode 100644 index f5f8f52cf03..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/model_vaultcertificateresponse.go +++ /dev/null @@ -1,44 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultCertificateResponse struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ResourceCertificateDetails `json:"properties"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &VaultCertificateResponse{} - -func (s *VaultCertificateResponse) UnmarshalJSON(bytes []byte) error { - type alias VaultCertificateResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into VaultCertificateResponse: %+v", err) - } - - s.Id = decoded.Id - s.Name = decoded.Name - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling VaultCertificateResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalResourceCertificateDetailsImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'VaultCertificateResponse': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/version.go b/resource-manager/recoveryservices/2023-06-01/vaultcertificates/version.go deleted file mode 100644 index 6e3ccd4cc4f..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultcertificates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultcertificates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultcertificates/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/README.md b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/README.md deleted file mode 100644 index 64f07a49c9a..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/README.md +++ /dev/null @@ -1,78 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo` Documentation - -The `vaultextendedinfo` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/vaultextendedinfo" -``` - - -### Client Initialization - -```go -client := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultExtendedInfoClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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: `VaultExtendedInfoClient.Get` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultExtendedInfoClient.Update` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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/recoveryservices/2023-06-01/vaultextendedinfo/client.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/client.go deleted file mode 100644 index d977cd83af4..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultextendedinfo - -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 VaultExtendedInfoClient struct { - Client *resourcemanager.Client -} - -func NewVaultExtendedInfoClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultExtendedInfoClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultextendedinfo", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultExtendedInfoClient: %+v", err) - } - - return &VaultExtendedInfoClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault.go deleted file mode 100644 index 383129a1d1e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultextendedinfo - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault_test.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault_test.go deleted file mode 100644 index cd8a330cad3..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultextendedinfo - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-06-01/vaultextendedinfo/method_createorupdate.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_createorupdate.go deleted file mode 100644 index 46299e1c76a..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// CreateOrUpdate ... -func (c VaultExtendedInfoClient) CreateOrUpdate(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_get.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_get.go deleted file mode 100644 index 63222675990..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultextendedinfo - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Get ... -func (c VaultExtendedInfoClient) Get(ctx context.Context, id VaultId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_update.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_update.go deleted file mode 100644 index 74d9926995b..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/method_update.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Update ... -func (c VaultExtendedInfoClient) Update(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinfo.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinfo.go deleted file mode 100644 index a1514fbe948..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfo struct { - Algorithm *string `json:"algorithm,omitempty"` - EncryptionKey *string `json:"encryptionKey,omitempty"` - EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` - IntegrityKey *string `json:"integrityKey,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinforesource.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinforesource.go deleted file mode 100644 index ee148aba996..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/model_vaultextendedinforesource.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfoResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultExtendedInfo `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/version.go b/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/version.go deleted file mode 100644 index 91e2cce3024..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultextendedinfo/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultextendedinfo/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/README.md b/resource-manager/recoveryservices/2023-06-01/vaults/README.md deleted file mode 100644 index 4b23c08812f..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaults` Documentation - -The `vaults` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/vaults" -``` - - -### Client Initialization - -```go -client := vaults.NewVaultsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.Vault{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VaultsClient.Delete` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.Get` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.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: `VaultsClient.ListBySubscriptionId` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscriptionId(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionIdComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VaultsClient.Update` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.PatchVault{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/client.go b/resource-manager/recoveryservices/2023-06-01/vaults/client.go deleted file mode 100644 index 1ddc5db936e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaults - -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 VaultsClient struct { - Client *resourcemanager.Client -} - -func NewVaultsClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaults", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultsClient: %+v", err) - } - - return &VaultsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/constants.go b/resource-manager/recoveryservices/2023-06-01/vaults/constants.go deleted file mode 100644 index 2f824292610..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/constants.go +++ /dev/null @@ -1,861 +0,0 @@ -package vaults - -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 AlertsState string - -const ( - AlertsStateDisabled AlertsState = "Disabled" - AlertsStateEnabled AlertsState = "Enabled" -) - -func PossibleValuesForAlertsState() []string { - return []string{ - string(AlertsStateDisabled), - string(AlertsStateEnabled), - } -} - -func (s *AlertsState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertsState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertsState(input string) (*AlertsState, error) { - vals := map[string]AlertsState{ - "disabled": AlertsStateDisabled, - "enabled": AlertsStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertsState(input) - return &out, nil -} - -type BackupStorageVersion string - -const ( - BackupStorageVersionUnassigned BackupStorageVersion = "Unassigned" - BackupStorageVersionVOne BackupStorageVersion = "V1" - BackupStorageVersionVTwo BackupStorageVersion = "V2" -) - -func PossibleValuesForBackupStorageVersion() []string { - return []string{ - string(BackupStorageVersionUnassigned), - string(BackupStorageVersionVOne), - string(BackupStorageVersionVTwo), - } -} - -func (s *BackupStorageVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBackupStorageVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBackupStorageVersion(input string) (*BackupStorageVersion, error) { - vals := map[string]BackupStorageVersion{ - "unassigned": BackupStorageVersionUnassigned, - "v1": BackupStorageVersionVOne, - "v2": BackupStorageVersionVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupStorageVersion(input) - return &out, nil -} - -type CrossRegionRestore string - -const ( - CrossRegionRestoreDisabled CrossRegionRestore = "Disabled" - CrossRegionRestoreEnabled CrossRegionRestore = "Enabled" -) - -func PossibleValuesForCrossRegionRestore() []string { - return []string{ - string(CrossRegionRestoreDisabled), - string(CrossRegionRestoreEnabled), - } -} - -func (s *CrossRegionRestore) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossRegionRestore(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossRegionRestore(input string) (*CrossRegionRestore, error) { - vals := map[string]CrossRegionRestore{ - "disabled": CrossRegionRestoreDisabled, - "enabled": CrossRegionRestoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossRegionRestore(input) - return &out, nil -} - -type CrossSubscriptionRestoreState string - -const ( - CrossSubscriptionRestoreStateDisabled CrossSubscriptionRestoreState = "Disabled" - CrossSubscriptionRestoreStateEnabled CrossSubscriptionRestoreState = "Enabled" - CrossSubscriptionRestoreStatePermanentlyDisabled CrossSubscriptionRestoreState = "PermanentlyDisabled" -) - -func PossibleValuesForCrossSubscriptionRestoreState() []string { - return []string{ - string(CrossSubscriptionRestoreStateDisabled), - string(CrossSubscriptionRestoreStateEnabled), - string(CrossSubscriptionRestoreStatePermanentlyDisabled), - } -} - -func (s *CrossSubscriptionRestoreState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossSubscriptionRestoreState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossSubscriptionRestoreState(input string) (*CrossSubscriptionRestoreState, error) { - vals := map[string]CrossSubscriptionRestoreState{ - "disabled": CrossSubscriptionRestoreStateDisabled, - "enabled": CrossSubscriptionRestoreStateEnabled, - "permanentlydisabled": CrossSubscriptionRestoreStatePermanentlyDisabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossSubscriptionRestoreState(input) - return &out, nil -} - -type ImmutabilityState string - -const ( - ImmutabilityStateDisabled ImmutabilityState = "Disabled" - ImmutabilityStateLocked ImmutabilityState = "Locked" - ImmutabilityStateUnlocked ImmutabilityState = "Unlocked" -) - -func PossibleValuesForImmutabilityState() []string { - return []string{ - string(ImmutabilityStateDisabled), - string(ImmutabilityStateLocked), - string(ImmutabilityStateUnlocked), - } -} - -func (s *ImmutabilityState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImmutabilityState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImmutabilityState(input string) (*ImmutabilityState, error) { - vals := map[string]ImmutabilityState{ - "disabled": ImmutabilityStateDisabled, - "locked": ImmutabilityStateLocked, - "unlocked": ImmutabilityStateUnlocked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImmutabilityState(input) - return &out, nil -} - -type InfrastructureEncryptionState string - -const ( - InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled" - InfrastructureEncryptionStateEnabled InfrastructureEncryptionState = "Enabled" -) - -func PossibleValuesForInfrastructureEncryptionState() []string { - return []string{ - string(InfrastructureEncryptionStateDisabled), - string(InfrastructureEncryptionStateEnabled), - } -} - -func (s *InfrastructureEncryptionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInfrastructureEncryptionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInfrastructureEncryptionState(input string) (*InfrastructureEncryptionState, error) { - vals := map[string]InfrastructureEncryptionState{ - "disabled": InfrastructureEncryptionStateDisabled, - "enabled": InfrastructureEncryptionStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InfrastructureEncryptionState(input) - return &out, nil -} - -type MultiUserAuthorization string - -const ( - MultiUserAuthorizationDisabled MultiUserAuthorization = "Disabled" - MultiUserAuthorizationEnabled MultiUserAuthorization = "Enabled" - MultiUserAuthorizationInvalid MultiUserAuthorization = "Invalid" -) - -func PossibleValuesForMultiUserAuthorization() []string { - return []string{ - string(MultiUserAuthorizationDisabled), - string(MultiUserAuthorizationEnabled), - string(MultiUserAuthorizationInvalid), - } -} - -func (s *MultiUserAuthorization) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMultiUserAuthorization(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMultiUserAuthorization(input string) (*MultiUserAuthorization, error) { - vals := map[string]MultiUserAuthorization{ - "disabled": MultiUserAuthorizationDisabled, - "enabled": MultiUserAuthorizationEnabled, - "invalid": MultiUserAuthorizationInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MultiUserAuthorization(input) - return &out, nil -} - -type PrivateEndpointConnectionStatus string - -const ( - PrivateEndpointConnectionStatusApproved PrivateEndpointConnectionStatus = "Approved" - PrivateEndpointConnectionStatusDisconnected PrivateEndpointConnectionStatus = "Disconnected" - PrivateEndpointConnectionStatusPending PrivateEndpointConnectionStatus = "Pending" - PrivateEndpointConnectionStatusRejected PrivateEndpointConnectionStatus = "Rejected" -) - -func PossibleValuesForPrivateEndpointConnectionStatus() []string { - return []string{ - string(PrivateEndpointConnectionStatusApproved), - string(PrivateEndpointConnectionStatusDisconnected), - string(PrivateEndpointConnectionStatusPending), - string(PrivateEndpointConnectionStatusRejected), - } -} - -func (s *PrivateEndpointConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateEndpointConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateEndpointConnectionStatus(input string) (*PrivateEndpointConnectionStatus, error) { - vals := map[string]PrivateEndpointConnectionStatus{ - "approved": PrivateEndpointConnectionStatusApproved, - "disconnected": PrivateEndpointConnectionStatusDisconnected, - "pending": PrivateEndpointConnectionStatusPending, - "rejected": PrivateEndpointConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateEndpointConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStatePending ProvisioningState = "Pending" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStatePending), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "pending": ProvisioningStatePending, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(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 ResourceMoveState string - -const ( - ResourceMoveStateCommitFailed ResourceMoveState = "CommitFailed" - ResourceMoveStateCommitTimedout ResourceMoveState = "CommitTimedout" - ResourceMoveStateCriticalFailure ResourceMoveState = "CriticalFailure" - ResourceMoveStateFailure ResourceMoveState = "Failure" - ResourceMoveStateInProgress ResourceMoveState = "InProgress" - ResourceMoveStateMoveSucceeded ResourceMoveState = "MoveSucceeded" - ResourceMoveStatePartialSuccess ResourceMoveState = "PartialSuccess" - ResourceMoveStatePrepareFailed ResourceMoveState = "PrepareFailed" - ResourceMoveStatePrepareTimedout ResourceMoveState = "PrepareTimedout" - ResourceMoveStateUnknown ResourceMoveState = "Unknown" -) - -func PossibleValuesForResourceMoveState() []string { - return []string{ - string(ResourceMoveStateCommitFailed), - string(ResourceMoveStateCommitTimedout), - string(ResourceMoveStateCriticalFailure), - string(ResourceMoveStateFailure), - string(ResourceMoveStateInProgress), - string(ResourceMoveStateMoveSucceeded), - string(ResourceMoveStatePartialSuccess), - string(ResourceMoveStatePrepareFailed), - string(ResourceMoveStatePrepareTimedout), - string(ResourceMoveStateUnknown), - } -} - -func (s *ResourceMoveState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceMoveState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceMoveState(input string) (*ResourceMoveState, error) { - vals := map[string]ResourceMoveState{ - "commitfailed": ResourceMoveStateCommitFailed, - "committimedout": ResourceMoveStateCommitTimedout, - "criticalfailure": ResourceMoveStateCriticalFailure, - "failure": ResourceMoveStateFailure, - "inprogress": ResourceMoveStateInProgress, - "movesucceeded": ResourceMoveStateMoveSucceeded, - "partialsuccess": ResourceMoveStatePartialSuccess, - "preparefailed": ResourceMoveStatePrepareFailed, - "preparetimedout": ResourceMoveStatePrepareTimedout, - "unknown": ResourceMoveStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceMoveState(input) - return &out, nil -} - -type SecureScoreLevel string - -const ( - SecureScoreLevelAdequate SecureScoreLevel = "Adequate" - SecureScoreLevelMaximum SecureScoreLevel = "Maximum" - SecureScoreLevelMinimum SecureScoreLevel = "Minimum" - SecureScoreLevelNone SecureScoreLevel = "None" -) - -func PossibleValuesForSecureScoreLevel() []string { - return []string{ - string(SecureScoreLevelAdequate), - string(SecureScoreLevelMaximum), - string(SecureScoreLevelMinimum), - string(SecureScoreLevelNone), - } -} - -func (s *SecureScoreLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecureScoreLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecureScoreLevel(input string) (*SecureScoreLevel, error) { - vals := map[string]SecureScoreLevel{ - "adequate": SecureScoreLevelAdequate, - "maximum": SecureScoreLevelMaximum, - "minimum": SecureScoreLevelMinimum, - "none": SecureScoreLevelNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecureScoreLevel(input) - return &out, nil -} - -type SkuName string - -const ( - SkuNameRSZero SkuName = "RS0" - SkuNameStandard SkuName = "Standard" -) - -func PossibleValuesForSkuName() []string { - return []string{ - string(SkuNameRSZero), - string(SkuNameStandard), - } -} - -func (s *SkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuName(input string) (*SkuName, error) { - vals := map[string]SkuName{ - "rs0": SkuNameRSZero, - "standard": SkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuName(input) - return &out, nil -} - -type SoftDeleteState string - -const ( - SoftDeleteStateAlwaysON SoftDeleteState = "AlwaysON" - SoftDeleteStateDisabled SoftDeleteState = "Disabled" - SoftDeleteStateEnabled SoftDeleteState = "Enabled" - SoftDeleteStateInvalid SoftDeleteState = "Invalid" -) - -func PossibleValuesForSoftDeleteState() []string { - return []string{ - string(SoftDeleteStateAlwaysON), - string(SoftDeleteStateDisabled), - string(SoftDeleteStateEnabled), - string(SoftDeleteStateInvalid), - } -} - -func (s *SoftDeleteState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftDeleteState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftDeleteState(input string) (*SoftDeleteState, error) { - vals := map[string]SoftDeleteState{ - "alwayson": SoftDeleteStateAlwaysON, - "disabled": SoftDeleteStateDisabled, - "enabled": SoftDeleteStateEnabled, - "invalid": SoftDeleteStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftDeleteState(input) - return &out, nil -} - -type StandardTierStorageRedundancy string - -const ( - StandardTierStorageRedundancyGeoRedundant StandardTierStorageRedundancy = "GeoRedundant" - StandardTierStorageRedundancyLocallyRedundant StandardTierStorageRedundancy = "LocallyRedundant" - StandardTierStorageRedundancyZoneRedundant StandardTierStorageRedundancy = "ZoneRedundant" -) - -func PossibleValuesForStandardTierStorageRedundancy() []string { - return []string{ - string(StandardTierStorageRedundancyGeoRedundant), - string(StandardTierStorageRedundancyLocallyRedundant), - string(StandardTierStorageRedundancyZoneRedundant), - } -} - -func (s *StandardTierStorageRedundancy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStandardTierStorageRedundancy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStandardTierStorageRedundancy(input string) (*StandardTierStorageRedundancy, error) { - vals := map[string]StandardTierStorageRedundancy{ - "georedundant": StandardTierStorageRedundancyGeoRedundant, - "locallyredundant": StandardTierStorageRedundancyLocallyRedundant, - "zoneredundant": StandardTierStorageRedundancyZoneRedundant, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StandardTierStorageRedundancy(input) - return &out, nil -} - -type TriggerType string - -const ( - TriggerTypeForcedUpgrade TriggerType = "ForcedUpgrade" - TriggerTypeUserTriggered TriggerType = "UserTriggered" -) - -func PossibleValuesForTriggerType() []string { - return []string{ - string(TriggerTypeForcedUpgrade), - string(TriggerTypeUserTriggered), - } -} - -func (s *TriggerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerType(input string) (*TriggerType, error) { - vals := map[string]TriggerType{ - "forcedupgrade": TriggerTypeForcedUpgrade, - "usertriggered": TriggerTypeUserTriggered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerType(input) - return &out, nil -} - -type VaultPrivateEndpointState string - -const ( - VaultPrivateEndpointStateEnabled VaultPrivateEndpointState = "Enabled" - VaultPrivateEndpointStateNone VaultPrivateEndpointState = "None" -) - -func PossibleValuesForVaultPrivateEndpointState() []string { - return []string{ - string(VaultPrivateEndpointStateEnabled), - string(VaultPrivateEndpointStateNone), - } -} - -func (s *VaultPrivateEndpointState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultPrivateEndpointState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultPrivateEndpointState(input string) (*VaultPrivateEndpointState, error) { - vals := map[string]VaultPrivateEndpointState{ - "enabled": VaultPrivateEndpointStateEnabled, - "none": VaultPrivateEndpointStateNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultPrivateEndpointState(input) - return &out, nil -} - -type VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} - -type VaultUpgradeState string - -const ( - VaultUpgradeStateFailed VaultUpgradeState = "Failed" - VaultUpgradeStateInProgress VaultUpgradeState = "InProgress" - VaultUpgradeStateUnknown VaultUpgradeState = "Unknown" - VaultUpgradeStateUpgraded VaultUpgradeState = "Upgraded" -) - -func PossibleValuesForVaultUpgradeState() []string { - return []string{ - string(VaultUpgradeStateFailed), - string(VaultUpgradeStateInProgress), - string(VaultUpgradeStateUnknown), - string(VaultUpgradeStateUpgraded), - } -} - -func (s *VaultUpgradeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultUpgradeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultUpgradeState(input string) (*VaultUpgradeState, error) { - vals := map[string]VaultUpgradeState{ - "failed": VaultUpgradeStateFailed, - "inprogress": VaultUpgradeStateInProgress, - "unknown": VaultUpgradeStateUnknown, - "upgraded": VaultUpgradeStateUpgraded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultUpgradeState(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/id_vault.go b/resource-manager/recoveryservices/2023-06-01/vaults/id_vault.go deleted file mode 100644 index 1cb6def7087..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaults - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/id_vault_test.go b/resource-manager/recoveryservices/2023-06-01/vaults/id_vault_test.go deleted file mode 100644 index d99d7310acc..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaults - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-06-01/vaults/method_createorupdate.go b/resource-manager/recoveryservices/2023-06-01/vaults/method_createorupdate.go deleted file mode 100644 index 93fd5e76cbb..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 *Vault -} - -// CreateOrUpdate ... -func (c VaultsClient) CreateOrUpdate(ctx context.Context, id VaultId, input Vault) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VaultsClient) CreateOrUpdateThenPoll(ctx context.Context, id VaultId, input Vault) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/recoveryservices/2023-06-01/vaults/method_delete.go b/resource-manager/recoveryservices/2023-06-01/vaults/method_delete.go deleted file mode 100644 index 70e0ba8dd2b..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package vaults - -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 VaultsClient) Delete(ctx context.Context, id VaultId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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/recoveryservices/2023-06-01/vaults/method_get.go b/resource-manager/recoveryservices/2023-06-01/vaults/method_get.go deleted file mode 100644 index 181926c5390..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package vaults - -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 *Vault -} - -// Get ... -func (c VaultsClient) Get(ctx context.Context, id VaultId) (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 Vault - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/method_listbyresourcegroup.go b/resource-manager/recoveryservices/2023-06-01/vaults/method_listbyresourcegroup.go deleted file mode 100644 index 09ba434e931..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 *[]Vault -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListByResourceGroup ... -func (c VaultsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `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 VaultsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VaultOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/recoveryservices/2023-06-01/vaults/method_listbysubscriptionid.go b/resource-manager/recoveryservices/2023-06-01/vaults/method_listbysubscriptionid.go deleted file mode 100644 index e1f63694b10..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/method_listbysubscriptionid.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 ListBySubscriptionIdOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Vault -} - -type ListBySubscriptionIdCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListBySubscriptionId ... -func (c VaultsClient) ListBySubscriptionId(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionIdOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionIdComplete retrieves all the results into a single object -func (c VaultsClient) ListBySubscriptionIdComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionIdCompleteResult, error) { - return c.ListBySubscriptionIdCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListBySubscriptionIdCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListBySubscriptionIdCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VaultOperationPredicate) (result ListBySubscriptionIdCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListBySubscriptionId(ctx, id) - if err != nil { - 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 = ListBySubscriptionIdCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/method_update.go b/resource-manager/recoveryservices/2023-06-01/vaults/method_update.go deleted file mode 100644 index fd0c9f3e6da..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Vault -} - -// Update ... -func (c VaultsClient) Update(ctx context.Context, id VaultId, input PatchVault) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VaultsClient) UpdateThenPoll(ctx context.Context, id VaultId, input PatchVault) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_azuremonitoralertsettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_azuremonitoralertsettings.go deleted file mode 100644 index c41bfcca517..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_azuremonitoralertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorAlertSettings struct { - AlertsForAllJobFailures *AlertsState `json:"alertsForAllJobFailures,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_classicalertsettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_classicalertsettings.go deleted file mode 100644 index f82f4c55b31..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_classicalertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClassicAlertSettings struct { - AlertsForCriticalOperations *AlertsState `json:"alertsForCriticalOperations,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkekidentity.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkekidentity.go deleted file mode 100644 index 1e5e7be3d2d..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkekidentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKekIdentity struct { - UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkeyvaultproperties.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkeyvaultproperties.go deleted file mode 100644 index c53f530b9f5..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_cmkkeyvaultproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKeyVaultProperties struct { - KeyUri *string `json:"keyUri,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_crosssubscriptionrestoresettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_crosssubscriptionrestoresettings.go deleted file mode 100644 index 4a4fecb8bdd..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_crosssubscriptionrestoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossSubscriptionRestoreSettings struct { - CrossSubscriptionRestoreState *CrossSubscriptionRestoreState `json:"crossSubscriptionRestoreState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_immutabilitysettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_immutabilitysettings.go deleted file mode 100644 index f52ae97a4c3..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_immutabilitysettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImmutabilitySettings struct { - State *ImmutabilityState `json:"state,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_monitoringsettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_monitoringsettings.go deleted file mode 100644 index 391ede46ae2..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_monitoringsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSettings struct { - AzureMonitorAlertSettings *AzureMonitorAlertSettings `json:"azureMonitorAlertSettings,omitempty"` - ClassicAlertSettings *ClassicAlertSettings `json:"classicAlertSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_patchvault.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_patchvault.go deleted file mode 100644 index 5ffc9615bc5..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_patchvault.go +++ /dev/null @@ -1,20 +0,0 @@ -package vaults - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchVault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpoint.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpoint.go deleted file mode 100644 index 64ce35a3d98..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// 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/recoveryservices/2023-06-01/vaults/model_privateendpointconnection.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnection.go deleted file mode 100644 index 687aefc111c..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaults - -// 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 { - GroupIds *[]VaultSubResourceType `json:"groupIds,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnectionvaultproperties.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnectionvaultproperties.go deleted file mode 100644 index 5758db1bfa3..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_privateendpointconnectionvaultproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionVaultProperties struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointConnection `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_privatelinkserviceconnectionstate.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index b07724e0e27..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *PrivateEndpointConnectionStatus `json:"status,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_restoresettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_restoresettings.go deleted file mode 100644 index b5126dbe263..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_restoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreSettings struct { - CrossSubscriptionRestoreSettings *CrossSubscriptionRestoreSettings `json:"crossSubscriptionRestoreSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_securitysettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_securitysettings.go deleted file mode 100644 index b5c9821e944..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_securitysettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecuritySettings struct { - ImmutabilitySettings *ImmutabilitySettings `json:"immutabilitySettings,omitempty"` - MultiUserAuthorization *MultiUserAuthorization `json:"multiUserAuthorization,omitempty"` - SoftDeleteSettings *SoftDeleteSettings `json:"softDeleteSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_sku.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_sku.go deleted file mode 100644 index d89e1340ee6..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *string `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name SkuName `json:"name"` - Size *string `json:"size,omitempty"` - Tier *string `json:"tier,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_softdeletesettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_softdeletesettings.go deleted file mode 100644 index 64f405a917d..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_softdeletesettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftDeleteSettings struct { - SoftDeleteRetentionPeriodInDays *int64 `json:"softDeleteRetentionPeriodInDays,omitempty"` - SoftDeleteState *SoftDeleteState `json:"softDeleteState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_upgradedetails.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_upgradedetails.go deleted file mode 100644 index f5e021983ab..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_upgradedetails.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaults - -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 UpgradeDetails struct { - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Message *string `json:"message,omitempty"` - OperationId *string `json:"operationId,omitempty"` - PreviousResourceId *string `json:"previousResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *VaultUpgradeState `json:"status,omitempty"` - TriggerType *TriggerType `json:"triggerType,omitempty"` - UpgradedResourceId *string `json:"upgradedResourceId,omitempty"` -} - -func (o *UpgradeDetails) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetLastUpdatedTimeUtcAsTime() (*time.Time, error) { - if o.LastUpdatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetLastUpdatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_vault.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_vault.go deleted file mode 100644 index dc5d7d049c1..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_vault.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -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 Vault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `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/recoveryservices/2023-06-01/vaults/model_vaultproperties.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultproperties.go deleted file mode 100644 index 01dae5e76f8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultProperties struct { - BackupStorageVersion *BackupStorageVersion `json:"backupStorageVersion,omitempty"` - Encryption *VaultPropertiesEncryption `json:"encryption,omitempty"` - MonitoringSettings *MonitoringSettings `json:"monitoringSettings,omitempty"` - MoveDetails *VaultPropertiesMoveDetails `json:"moveDetails,omitempty"` - MoveState *ResourceMoveState `json:"moveState,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnectionVaultProperties `json:"privateEndpointConnections,omitempty"` - PrivateEndpointStateForBackup *VaultPrivateEndpointState `json:"privateEndpointStateForBackup,omitempty"` - PrivateEndpointStateForSiteRecovery *VaultPrivateEndpointState `json:"privateEndpointStateForSiteRecovery,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - RedundancySettings *VaultPropertiesRedundancySettings `json:"redundancySettings,omitempty"` - RestoreSettings *RestoreSettings `json:"restoreSettings,omitempty"` - SecureScore *SecureScoreLevel `json:"secureScore,omitempty"` - SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"` - UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesencryption.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesencryption.go deleted file mode 100644 index 05c6effec1d..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesencryption.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesEncryption struct { - InfrastructureEncryption *InfrastructureEncryptionState `json:"infrastructureEncryption,omitempty"` - KekIdentity *CmkKekIdentity `json:"kekIdentity,omitempty"` - KeyVaultProperties *CmkKeyVaultProperties `json:"keyVaultProperties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesmovedetails.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesmovedetails.go deleted file mode 100644 index b65be5a0669..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesmovedetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package vaults - -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 VaultPropertiesMoveDetails struct { - CompletionTimeUtc *string `json:"completionTimeUtc,omitempty"` - OperationId *string `json:"operationId,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` -} - -func (o *VaultPropertiesMoveDetails) GetCompletionTimeUtcAsTime() (*time.Time, error) { - if o.CompletionTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CompletionTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetCompletionTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CompletionTimeUtc = &formatted -} - -func (o *VaultPropertiesMoveDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesredundancysettings.go b/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesredundancysettings.go deleted file mode 100644 index 2d1174f221f..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/model_vaultpropertiesredundancysettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesRedundancySettings struct { - CrossRegionRestore *CrossRegionRestore `json:"crossRegionRestore,omitempty"` - StandardTierStorageRedundancy *StandardTierStorageRedundancy `json:"standardTierStorageRedundancy,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/predicates.go b/resource-manager/recoveryservices/2023-06-01/vaults/predicates.go deleted file mode 100644 index 1039a9afe4e..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VaultOperationPredicate) Matches(input Vault) 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 -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaults/version.go b/resource-manager/recoveryservices/2023-06-01/vaults/version.go deleted file mode 100644 index 08c9b6c674b..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaults/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaults/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/README.md b/resource-manager/recoveryservices/2023-06-01/vaultusages/README.md deleted file mode 100644 index 5401f6f35fc..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-06-01/vaultusages` Documentation - -The `vaultusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-06-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/recoveryservices/2023-06-01/vaultusages" -``` - - -### Client Initialization - -```go -client := vaultusages.NewVaultUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultUsagesClient.UsagesListByVaults` - -```go -ctx := context.TODO() -id := vaultusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -read, err := client.UsagesListByVaults(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/recoveryservices/2023-06-01/vaultusages/client.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/client.go deleted file mode 100644 index 625eba65044..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultusages - -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 VaultUsagesClient struct { - Client *resourcemanager.Client -} - -func NewVaultUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultUsagesClient: %+v", err) - } - - return &VaultUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/constants.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/constants.go deleted file mode 100644 index 333eba1e6c6..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package vaultusages - -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 UsagesUnit string - -const ( - UsagesUnitBytes UsagesUnit = "Bytes" - UsagesUnitBytesPerSecond UsagesUnit = "BytesPerSecond" - UsagesUnitCount UsagesUnit = "Count" - UsagesUnitCountPerSecond UsagesUnit = "CountPerSecond" - UsagesUnitPercent UsagesUnit = "Percent" - UsagesUnitSeconds UsagesUnit = "Seconds" -) - -func PossibleValuesForUsagesUnit() []string { - return []string{ - string(UsagesUnitBytes), - string(UsagesUnitBytesPerSecond), - string(UsagesUnitCount), - string(UsagesUnitCountPerSecond), - string(UsagesUnitPercent), - string(UsagesUnitSeconds), - } -} - -func (s *UsagesUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUsagesUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUsagesUnit(input string) (*UsagesUnit, error) { - vals := map[string]UsagesUnit{ - "bytes": UsagesUnitBytes, - "bytespersecond": UsagesUnitBytesPerSecond, - "count": UsagesUnitCount, - "countpersecond": UsagesUnitCountPerSecond, - "percent": UsagesUnitPercent, - "seconds": UsagesUnitSeconds, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsagesUnit(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault.go deleted file mode 100644 index b455e8760a5..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault_test.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault_test.go deleted file mode 100644 index 9ef11c18ec0..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-06-01/vaultusages/method_usageslistbyvaults.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/method_usageslistbyvaults.go deleted file mode 100644 index 258a5d0bb75..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/method_usageslistbyvaults.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultusages - -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 UsagesListByVaultsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultUsageList -} - -// UsagesListByVaults ... -func (c VaultUsagesClient) UsagesListByVaults(ctx context.Context, id VaultId) (result UsagesListByVaultsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 VaultUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/model_nameinfo.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/model_nameinfo.go deleted file mode 100644 index 974668c26f9..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/model_nameinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameInfo struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusage.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusage.go deleted file mode 100644 index 6b7bc2b68d8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusage.go +++ /dev/null @@ -1,31 +0,0 @@ -package vaultusages - -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 VaultUsage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *NameInfo `json:"name,omitempty"` - NextResetTime *string `json:"nextResetTime,omitempty"` - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - Unit *UsagesUnit `json:"unit,omitempty"` -} - -func (o *VaultUsage) GetNextResetTimeAsTime() (*time.Time, error) { - if o.NextResetTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.NextResetTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultUsage) SetNextResetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.NextResetTime = &formatted -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusagelist.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusagelist.go deleted file mode 100644 index aa529e6fcbf..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/model_vaultusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultUsageList struct { - Value *[]VaultUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-06-01/vaultusages/version.go b/resource-manager/recoveryservices/2023-06-01/vaultusages/version.go deleted file mode 100644 index 503260202b8..00000000000 --- a/resource-manager/recoveryservices/2023-06-01/vaultusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-06-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/client.go b/resource-manager/recoveryservices/2023-08-01/client.go deleted file mode 100644 index 28c39b069bf..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/client.go +++ /dev/null @@ -1,100 +0,0 @@ -package v2023_08_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/recoveryservices/2023-08-01/getprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/recoveryservices" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/registeredidentities" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/replicationusages" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaultcertificates" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaults" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaultusages" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - GetPrivateLinkResources *getprivatelinkresources.GetPrivateLinkResourcesClient - ListPrivateLinkResources *listprivatelinkresources.ListPrivateLinkResourcesClient - RecoveryServices *recoveryservices.RecoveryServicesClient - RegisteredIdentities *registeredidentities.RegisteredIdentitiesClient - ReplicationUsages *replicationusages.ReplicationUsagesClient - VaultCertificates *vaultcertificates.VaultCertificatesClient - VaultExtendedInfo *vaultextendedinfo.VaultExtendedInfoClient - VaultUsages *vaultusages.VaultUsagesClient - Vaults *vaults.VaultsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - getPrivateLinkResourcesClient, err := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building GetPrivateLinkResources client: %+v", err) - } - configureFunc(getPrivateLinkResourcesClient.Client) - - listPrivateLinkResourcesClient, err := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ListPrivateLinkResources client: %+v", err) - } - configureFunc(listPrivateLinkResourcesClient.Client) - - recoveryServicesClient, err := recoveryservices.NewRecoveryServicesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RecoveryServices client: %+v", err) - } - configureFunc(recoveryServicesClient.Client) - - registeredIdentitiesClient, err := registeredidentities.NewRegisteredIdentitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building RegisteredIdentities client: %+v", err) - } - configureFunc(registeredIdentitiesClient.Client) - - replicationUsagesClient, err := replicationusages.NewReplicationUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ReplicationUsages client: %+v", err) - } - configureFunc(replicationUsagesClient.Client) - - vaultCertificatesClient, err := vaultcertificates.NewVaultCertificatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultCertificates client: %+v", err) - } - configureFunc(vaultCertificatesClient.Client) - - vaultExtendedInfoClient, err := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultExtendedInfo client: %+v", err) - } - configureFunc(vaultExtendedInfoClient.Client) - - vaultUsagesClient, err := vaultusages.NewVaultUsagesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building VaultUsages client: %+v", err) - } - configureFunc(vaultUsagesClient.Client) - - vaultsClient, err := vaults.NewVaultsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Vaults client: %+v", err) - } - configureFunc(vaultsClient.Client) - - return &Client{ - GetPrivateLinkResources: getPrivateLinkResourcesClient, - ListPrivateLinkResources: listPrivateLinkResourcesClient, - RecoveryServices: recoveryServicesClient, - RegisteredIdentities: registeredIdentitiesClient, - ReplicationUsages: replicationUsagesClient, - VaultCertificates: vaultCertificatesClient, - VaultExtendedInfo: vaultExtendedInfoClient, - VaultUsages: vaultUsagesClient, - Vaults: vaultsClient, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/README.md deleted file mode 100644 index 40fadc67d52..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources` Documentation - -The `getprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/getprivatelinkresources" -``` - - -### Client Initialization - -```go -client := getprivatelinkresources.NewGetPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `GetPrivateLinkResourcesClient.PrivateLinkResourcesGet` - -```go -ctx := context.TODO() -id := getprivatelinkresources.NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - -read, err := client.PrivateLinkResourcesGet(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/recoveryservices/2023-08-01/getprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/client.go deleted file mode 100644 index 2c788db4e51..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package getprivatelinkresources - -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 GetPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewGetPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*GetPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "getprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating GetPrivateLinkResourcesClient: %+v", err) - } - - return &GetPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource.go deleted file mode 100644 index 70ee568e5d3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource.go +++ /dev/null @@ -1,139 +0,0 @@ -package getprivatelinkresources - -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(&PrivateLinkResourceId{}) -} - -var _ resourceids.ResourceId = &PrivateLinkResourceId{} - -// PrivateLinkResourceId is a struct representing the Resource ID for a Private Link Resource -type PrivateLinkResourceId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - PrivateLinkResourceName string -} - -// NewPrivateLinkResourceID returns a new PrivateLinkResourceId struct -func NewPrivateLinkResourceID(subscriptionId string, resourceGroupName string, vaultName string, privateLinkResourceName string) PrivateLinkResourceId { - return PrivateLinkResourceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - PrivateLinkResourceName: privateLinkResourceName, - } -} - -// ParsePrivateLinkResourceID parses 'input' into a PrivateLinkResourceId -func ParsePrivateLinkResourceID(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePrivateLinkResourceIDInsensitively parses 'input' case-insensitively into a PrivateLinkResourceId -// note: this method should only be used for API response data and not user input -func ParsePrivateLinkResourceIDInsensitively(input string) (*PrivateLinkResourceId, error) { - parser := resourceids.NewParserFromResourceIdType(&PrivateLinkResourceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PrivateLinkResourceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PrivateLinkResourceId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.PrivateLinkResourceName, ok = input.Parsed["privateLinkResourceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "privateLinkResourceName", input) - } - - return nil -} - -// ValidatePrivateLinkResourceID checks that 'input' can be parsed as a Private Link Resource ID -func ValidatePrivateLinkResourceID(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 := ParsePrivateLinkResourceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Private Link Resource ID -func (id PrivateLinkResourceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/privateLinkResources/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.PrivateLinkResourceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Private Link Resource ID -func (id PrivateLinkResourceId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticPrivateLinkResources", "privateLinkResources", "privateLinkResources"), - resourceids.UserSpecifiedSegment("privateLinkResourceName", "privateLinkResourceValue"), - } -} - -// String returns a human-readable description of this Private Link Resource ID -func (id PrivateLinkResourceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Private Link Resource Name: %q", id.PrivateLinkResourceName), - } - return fmt.Sprintf("Private Link Resource (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource_test.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource_test.go deleted file mode 100644 index 7ee1c858da1..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/id_privatelinkresource_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package getprivatelinkresources - -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 = &PrivateLinkResourceId{} - -func TestNewPrivateLinkResourceID(t *testing.T) { - id := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.PrivateLinkResourceName != "privateLinkResourceValue" { - t.Fatalf("Expected %q but got %q for Segment 'PrivateLinkResourceName'", id.PrivateLinkResourceName, "privateLinkResourceValue") - } -} - -func TestFormatPrivateLinkResourceID(t *testing.T) { - actual := NewPrivateLinkResourceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "privateLinkResourceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePrivateLinkResourceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestParsePrivateLinkResourceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PrivateLinkResourceId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - PrivateLinkResourceName: "privateLinkResourceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/privateLinkResources/privateLinkResourceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE", - Expected: &PrivateLinkResourceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - PrivateLinkResourceName: "pRiVaTeLiNkReSoUrCeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/pRiVaTeLiNkReSoUrCeS/pRiVaTeLiNkReSoUrCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePrivateLinkResourceIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.PrivateLinkResourceName != v.Expected.PrivateLinkResourceName { - t.Fatalf("Expected %q but got %q for PrivateLinkResourceName", v.Expected.PrivateLinkResourceName, actual.PrivateLinkResourceName) - } - - } -} - -func TestSegmentsForPrivateLinkResourceId(t *testing.T) { - segments := PrivateLinkResourceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PrivateLinkResourceId 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/recoveryservices/2023-08-01/getprivatelinkresources/method_privatelinkresourcesget.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/method_privatelinkresourcesget.go deleted file mode 100644 index 8074fb34792..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/method_privatelinkresourcesget.go +++ /dev/null @@ -1,54 +0,0 @@ -package getprivatelinkresources - -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 PrivateLinkResourcesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *PrivateLinkResource -} - -// PrivateLinkResourcesGet ... -func (c GetPrivateLinkResourcesClient) PrivateLinkResourcesGet(ctx context.Context, id PrivateLinkResourceId) (result PrivateLinkResourcesGetOperationResponse, 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 PrivateLinkResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 36e56a45b5e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package getprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index 92b1276283a..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package getprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/version.go deleted file mode 100644 index 53c195c9042..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/getprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package getprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/getprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/README.md b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/README.md deleted file mode 100644 index e9c0232c0b3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources` Documentation - -The `listprivatelinkresources` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/listprivatelinkresources" -``` - - -### Client Initialization - -```go -client := listprivatelinkresources.NewListPrivateLinkResourcesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ListPrivateLinkResourcesClient.PrivateLinkResourcesList` - -```go -ctx := context.TODO() -id := listprivatelinkresources.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -// alternatively `client.PrivateLinkResourcesList(ctx, id)` can be used to do batched pagination -items, err := client.PrivateLinkResourcesListComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/client.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/client.go deleted file mode 100644 index d68ed338ccc..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package listprivatelinkresources - -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 ListPrivateLinkResourcesClient struct { - Client *resourcemanager.Client -} - -func NewListPrivateLinkResourcesClientWithBaseURI(sdkApi sdkEnv.Api) (*ListPrivateLinkResourcesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "listprivatelinkresources", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ListPrivateLinkResourcesClient: %+v", err) - } - - return &ListPrivateLinkResourcesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault.go deleted file mode 100644 index 332d5bf97d5..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package listprivatelinkresources - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault_test.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault_test.go deleted file mode 100644 index 79099dc74de..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package listprivatelinkresources - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-08-01/listprivatelinkresources/method_privatelinkresourceslist.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/method_privatelinkresourceslist.go deleted file mode 100644 index 994db6cbef7..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/method_privatelinkresourceslist.go +++ /dev/null @@ -1,91 +0,0 @@ -package listprivatelinkresources - -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 PrivateLinkResourcesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]PrivateLinkResource -} - -type PrivateLinkResourcesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []PrivateLinkResource -} - -// PrivateLinkResourcesList ... -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesList(ctx context.Context, id VaultId) (result PrivateLinkResourcesListOperationResponse, 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.ExecutePaged(ctx) - if resp != nil { - result.OData = resp.OData - result.HttpResponse = resp.Response - } - if err != nil { - return - } - - var values struct { - Values *[]PrivateLinkResource `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// PrivateLinkResourcesListComplete retrieves all the results into a single object -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListComplete(ctx context.Context, id VaultId) (PrivateLinkResourcesListCompleteResult, error) { - return c.PrivateLinkResourcesListCompleteMatchingPredicate(ctx, id, PrivateLinkResourceOperationPredicate{}) -} - -// PrivateLinkResourcesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ListPrivateLinkResourcesClient) PrivateLinkResourcesListCompleteMatchingPredicate(ctx context.Context, id VaultId, predicate PrivateLinkResourceOperationPredicate) (result PrivateLinkResourcesListCompleteResult, err error) { - items := make([]PrivateLinkResource, 0) - - resp, err := c.PrivateLinkResourcesList(ctx, id) - if err != nil { - 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 = PrivateLinkResourcesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresource.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresource.go deleted file mode 100644 index 43ad3ab77fa..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresource.go +++ /dev/null @@ -1,11 +0,0 @@ -package listprivatelinkresources - -// 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 { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresourceproperties.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresourceproperties.go deleted file mode 100644 index b1ff4a935fd..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/model_privatelinkresourceproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceProperties struct { - GroupId *string `json:"groupId,omitempty"` - RequiredMembers *[]string `json:"requiredMembers,omitempty"` - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/predicates.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/predicates.go deleted file mode 100644 index 5eb0bb91e57..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package listprivatelinkresources - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateLinkResourceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PrivateLinkResourceOperationPredicate) Matches(input PrivateLinkResource) 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/recoveryservices/2023-08-01/listprivatelinkresources/version.go b/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/version.go deleted file mode 100644 index ac37e25d0cd..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/listprivatelinkresources/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package listprivatelinkresources - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/listprivatelinkresources/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/README.md b/resource-manager/recoveryservices/2023-08-01/recoveryservices/README.md deleted file mode 100644 index fd31fbf6def..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/README.md +++ /dev/null @@ -1,62 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/recoveryservices` Documentation - -The `recoveryservices` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/recoveryservices" -``` - - -### Client Initialization - -```go -client := recoveryservices.NewRecoveryServicesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RecoveryServicesClient.Capabilities` - -```go -ctx := context.TODO() -id := recoveryservices.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := recoveryservices.ResourceCapabilities{ - // ... -} - - -read, err := client.Capabilities(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `RecoveryServicesClient.CheckNameAvailability` - -```go -ctx := context.TODO() -id := recoveryservices.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -payload := recoveryservices.CheckNameAvailabilityParameters{ - // ... -} - - -read, err := client.CheckNameAvailability(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/recoveryservices/2023-08-01/recoveryservices/client.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/client.go deleted file mode 100644 index 518088771ea..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package recoveryservices - -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 RecoveryServicesClient struct { - Client *resourcemanager.Client -} - -func NewRecoveryServicesClientWithBaseURI(sdkApi sdkEnv.Api) (*RecoveryServicesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "recoveryservices", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RecoveryServicesClient: %+v", err) - } - - return &RecoveryServicesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/constants.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/constants.go deleted file mode 100644 index 920bcd8e566..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package recoveryservices - -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 VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location.go deleted file mode 100644 index 1fd49c9d992..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package recoveryservices - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservices/2023-08-01/recoveryservices/id_location_test.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location_test.go deleted file mode 100644 index 3c75d278a94..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package recoveryservices - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservices/2023-08-01/recoveryservices/id_providerlocation.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation.go deleted file mode 100644 index 33d3548750d..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package recoveryservices - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation_test.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation_test.go deleted file mode 100644 index 28405ec9bd8..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package recoveryservices - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/recoveryservices/2023-08-01/recoveryservices/method_capabilities.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/method_capabilities.go deleted file mode 100644 index 5864d60faeb..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/method_capabilities.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CapabilitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CapabilitiesResponse -} - -// Capabilities ... -func (c RecoveryServicesClient) Capabilities(ctx context.Context, id LocationId, input ResourceCapabilities) (result CapabilitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/capabilities", 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 CapabilitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/method_checknameavailability.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/method_checknameavailability.go deleted file mode 100644 index 3512794c701..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/method_checknameavailability.go +++ /dev/null @@ -1,59 +0,0 @@ -package recoveryservices - -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 CheckNameAvailabilityOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *CheckNameAvailabilityResult -} - -// CheckNameAvailability ... -func (c RecoveryServicesClient) CheckNameAvailability(ctx context.Context, id ProviderLocationId, input CheckNameAvailabilityParameters) (result CheckNameAvailabilityOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/checkNameAvailability", 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 CheckNameAvailabilityResult - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesproperties.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesproperties.go deleted file mode 100644 index 3698ddb8850..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesProperties struct { - DnsZones *[]DNSZone `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponse.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponse.go deleted file mode 100644 index 47e4997660f..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponse struct { - Properties *CapabilitiesResponseProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponseproperties.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponseproperties.go deleted file mode 100644 index 8c1bfbcac8d..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_capabilitiesresponseproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CapabilitiesResponseProperties struct { - DnsZones *[]DNSZoneResponse `json:"dnsZones,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityparameters.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityparameters.go deleted file mode 100644 index e6c5aff2402..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityParameters struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityresult.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityresult.go deleted file mode 100644 index d2840ec335e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_checknameavailabilityresult.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CheckNameAvailabilityResult struct { - Message *string `json:"message,omitempty"` - NameAvailable *bool `json:"nameAvailable,omitempty"` - Reason *string `json:"reason,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszone.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszone.go deleted file mode 100644 index 34952cfbd7e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszone.go +++ /dev/null @@ -1,8 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZone struct { - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszoneresponse.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszoneresponse.go deleted file mode 100644 index 4aabe0bd6d4..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_dnszoneresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DNSZoneResponse struct { - RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` - SubResource *VaultSubResourceType `json:"subResource,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_resourcecapabilities.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_resourcecapabilities.go deleted file mode 100644 index 16d3a668058..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/model_resourcecapabilities.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoveryservices - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceCapabilities struct { - Properties *CapabilitiesProperties `json:"properties,omitempty"` - Type string `json:"type"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/recoveryservices/version.go b/resource-manager/recoveryservices/2023-08-01/recoveryservices/version.go deleted file mode 100644 index 8654cffc1c3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/recoveryservices/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoveryservices - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/recoveryservices/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/registeredidentities/client.go b/resource-manager/recoveryservices/2023-08-01/registeredidentities/client.go deleted file mode 100644 index 36b4015e582..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/registeredidentities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient struct { - Client *resourcemanager.Client -} - -func NewRegisteredIdentitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*RegisteredIdentitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "registeredidentities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RegisteredIdentitiesClient: %+v", err) - } - - return &RegisteredIdentitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity.go b/resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity.go deleted file mode 100644 index 147a6d0d6e3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity.go +++ /dev/null @@ -1,139 +0,0 @@ -package registeredidentities - -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(&RegisteredIdentityId{}) -} - -var _ resourceids.ResourceId = &RegisteredIdentityId{} - -// RegisteredIdentityId is a struct representing the Resource ID for a Registered Identity -type RegisteredIdentityId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - RegisteredIdentityName string -} - -// NewRegisteredIdentityID returns a new RegisteredIdentityId struct -func NewRegisteredIdentityID(subscriptionId string, resourceGroupName string, vaultName string, registeredIdentityName string) RegisteredIdentityId { - return RegisteredIdentityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - RegisteredIdentityName: registeredIdentityName, - } -} - -// ParseRegisteredIdentityID parses 'input' into a RegisteredIdentityId -func ParseRegisteredIdentityID(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRegisteredIdentityIDInsensitively parses 'input' case-insensitively into a RegisteredIdentityId -// note: this method should only be used for API response data and not user input -func ParseRegisteredIdentityIDInsensitively(input string) (*RegisteredIdentityId, error) { - parser := resourceids.NewParserFromResourceIdType(&RegisteredIdentityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RegisteredIdentityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RegisteredIdentityId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.RegisteredIdentityName, ok = input.Parsed["registeredIdentityName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "registeredIdentityName", input) - } - - return nil -} - -// ValidateRegisteredIdentityID checks that 'input' can be parsed as a Registered Identity ID -func ValidateRegisteredIdentityID(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 := ParseRegisteredIdentityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Registered Identity ID -func (id RegisteredIdentityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/registeredIdentities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.RegisteredIdentityName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Registered Identity ID -func (id RegisteredIdentityId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticRegisteredIdentities", "registeredIdentities", "registeredIdentities"), - resourceids.UserSpecifiedSegment("registeredIdentityName", "registeredIdentityValue"), - } -} - -// String returns a human-readable description of this Registered Identity ID -func (id RegisteredIdentityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Registered Identity Name: %q", id.RegisteredIdentityName), - } - return fmt.Sprintf("Registered Identity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity_test.go b/resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity_test.go deleted file mode 100644 index 6857bb4f14e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/registeredidentities/id_registeredidentity_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package registeredidentities - -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 = &RegisteredIdentityId{} - -func TestNewRegisteredIdentityID(t *testing.T) { - id := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.RegisteredIdentityName != "registeredIdentityValue" { - t.Fatalf("Expected %q but got %q for Segment 'RegisteredIdentityName'", id.RegisteredIdentityName, "registeredIdentityValue") - } -} - -func TestFormatRegisteredIdentityID(t *testing.T) { - actual := NewRegisteredIdentityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "registeredIdentityValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRegisteredIdentityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestParseRegisteredIdentityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RegisteredIdentityId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - RegisteredIdentityName: "registeredIdentityValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/registeredIdentities/registeredIdentityValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe", - Expected: &RegisteredIdentityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - RegisteredIdentityName: "rEgIsTeReDiDeNtItYvAlUe", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/rEgIsTeReDiDeNtItIeS/rEgIsTeReDiDeNtItYvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRegisteredIdentityIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.RegisteredIdentityName != v.Expected.RegisteredIdentityName { - t.Fatalf("Expected %q but got %q for RegisteredIdentityName", v.Expected.RegisteredIdentityName, actual.RegisteredIdentityName) - } - - } -} - -func TestSegmentsForRegisteredIdentityId(t *testing.T) { - segments := RegisteredIdentityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RegisteredIdentityId 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/recoveryservices/2023-08-01/registeredidentities/method_delete.go b/resource-manager/recoveryservices/2023-08-01/registeredidentities/method_delete.go deleted file mode 100644 index 16a5301af92..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/registeredidentities/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package registeredidentities - -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 RegisteredIdentitiesClient) Delete(ctx context.Context, id RegisteredIdentityId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/registeredidentities/version.go b/resource-manager/recoveryservices/2023-08-01/registeredidentities/version.go deleted file mode 100644 index 9cc12482d5b..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/registeredidentities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package registeredidentities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/registeredidentities/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/README.md b/resource-manager/recoveryservices/2023-08-01/replicationusages/README.md deleted file mode 100644 index cd433a69182..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/replicationusages` Documentation - -The `replicationusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/replicationusages" -``` - - -### Client Initialization - -```go -client := replicationusages.NewReplicationUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ReplicationUsagesClient.List` - -```go -ctx := context.TODO() -id := replicationusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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/recoveryservices/2023-08-01/replicationusages/client.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/client.go deleted file mode 100644 index 40ebde8ba63..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package replicationusages - -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 ReplicationUsagesClient struct { - Client *resourcemanager.Client -} - -func NewReplicationUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*ReplicationUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "replicationusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ReplicationUsagesClient: %+v", err) - } - - return &ReplicationUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault.go deleted file mode 100644 index 338b117c7be..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package replicationusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault_test.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault_test.go deleted file mode 100644 index 679ad2eacfb..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package replicationusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-08-01/replicationusages/method_list.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/method_list.go deleted file mode 100644 index 67aa893023e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package replicationusages - -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 *ReplicationUsageList -} - -// List ... -func (c ReplicationUsagesClient) List(ctx context.Context, id VaultId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/replicationUsages", 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 ReplicationUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_jobssummary.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/model_jobssummary.go deleted file mode 100644 index b4e8997b7d2..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_jobssummary.go +++ /dev/null @@ -1,10 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobsSummary struct { - FailedJobs *int64 `json:"failedJobs,omitempty"` - InProgressJobs *int64 `json:"inProgressJobs,omitempty"` - SuspendedJobs *int64 `json:"suspendedJobs,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_monitoringsummary.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/model_monitoringsummary.go deleted file mode 100644 index fbf4ba89507..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_monitoringsummary.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSummary struct { - DeprecatedProviderCount *int64 `json:"deprecatedProviderCount,omitempty"` - EventsCount *int64 `json:"eventsCount,omitempty"` - SupportedProviderCount *int64 `json:"supportedProviderCount,omitempty"` - UnHealthyProviderCount *int64 `json:"unHealthyProviderCount,omitempty"` - UnHealthyVMCount *int64 `json:"unHealthyVmCount,omitempty"` - UnsupportedProviderCount *int64 `json:"unsupportedProviderCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusage.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusage.go deleted file mode 100644 index 0842f810533..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusage.go +++ /dev/null @@ -1,13 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsage struct { - JobsSummary *JobsSummary `json:"jobsSummary,omitempty"` - MonitoringSummary *MonitoringSummary `json:"monitoringSummary,omitempty"` - ProtectedItemCount *int64 `json:"protectedItemCount,omitempty"` - RecoveryPlanCount *int64 `json:"recoveryPlanCount,omitempty"` - RecoveryServicesProviderAuthType *int64 `json:"recoveryServicesProviderAuthType,omitempty"` - RegisteredServersCount *int64 `json:"registeredServersCount,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusagelist.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusagelist.go deleted file mode 100644 index 11300c459d2..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/model_replicationusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package replicationusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ReplicationUsageList struct { - Value *[]ReplicationUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/replicationusages/version.go b/resource-manager/recoveryservices/2023-08-01/replicationusages/version.go deleted file mode 100644 index 76c710cf36d..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/replicationusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package replicationusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/replicationusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/README.md b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/README.md deleted file mode 100644 index 2d8e3902951..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaultcertificates` Documentation - -The `vaultcertificates` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/vaultcertificates" -``` - - -### Client Initialization - -```go -client := vaultcertificates.NewVaultCertificatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultCertificatesClient.Create` - -```go -ctx := context.TODO() -id := vaultcertificates.NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - -payload := vaultcertificates.CertificateRequest{ - // ... -} - - -read, err := client.Create(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/recoveryservices/2023-08-01/vaultcertificates/client.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/client.go deleted file mode 100644 index f25a5998dcc..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultcertificates - -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 VaultCertificatesClient struct { - Client *resourcemanager.Client -} - -func NewVaultCertificatesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultCertificatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultcertificates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultCertificatesClient: %+v", err) - } - - return &VaultCertificatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/constants.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/constants.go deleted file mode 100644 index 66072e83ada..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/constants.go +++ /dev/null @@ -1,60 +0,0 @@ -package vaultcertificates - -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 AuthType string - -const ( - AuthTypeAAD AuthType = "AAD" - AuthTypeACS AuthType = "ACS" - AuthTypeAccessControlService AuthType = "AccessControlService" - AuthTypeAzureActiveDirectory AuthType = "AzureActiveDirectory" - AuthTypeInvalid AuthType = "Invalid" -) - -func PossibleValuesForAuthType() []string { - return []string{ - string(AuthTypeAAD), - string(AuthTypeACS), - string(AuthTypeAccessControlService), - string(AuthTypeAzureActiveDirectory), - string(AuthTypeInvalid), - } -} - -func (s *AuthType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAuthType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAuthType(input string) (*AuthType, error) { - vals := map[string]AuthType{ - "aad": AuthTypeAAD, - "acs": AuthTypeACS, - "accesscontrolservice": AuthTypeAccessControlService, - "azureactivedirectory": AuthTypeAzureActiveDirectory, - "invalid": AuthTypeInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AuthType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate.go deleted file mode 100644 index 1a998266e49..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate.go +++ /dev/null @@ -1,139 +0,0 @@ -package vaultcertificates - -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(&CertificateId{}) -} - -var _ resourceids.ResourceId = &CertificateId{} - -// CertificateId is a struct representing the Resource ID for a Certificate -type CertificateId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - CertificateName string -} - -// NewCertificateID returns a new CertificateId struct -func NewCertificateID(subscriptionId string, resourceGroupName string, vaultName string, certificateName string) CertificateId { - return CertificateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - CertificateName: certificateName, - } -} - -// ParseCertificateID parses 'input' into a CertificateId -func ParseCertificateID(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCertificateIDInsensitively parses 'input' case-insensitively into a CertificateId -// note: this method should only be used for API response data and not user input -func ParseCertificateIDInsensitively(input string) (*CertificateId, error) { - parser := resourceids.NewParserFromResourceIdType(&CertificateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CertificateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CertificateId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.CertificateName, ok = input.Parsed["certificateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "certificateName", input) - } - - return nil -} - -// ValidateCertificateID checks that 'input' can be parsed as a Certificate ID -func ValidateCertificateID(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 := ParseCertificateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Certificate ID -func (id CertificateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/certificates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.CertificateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Certificate ID -func (id CertificateId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticCertificates", "certificates", "certificates"), - resourceids.UserSpecifiedSegment("certificateName", "certificateValue"), - } -} - -// String returns a human-readable description of this Certificate ID -func (id CertificateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Certificate Name: %q", id.CertificateName), - } - return fmt.Sprintf("Certificate (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate_test.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate_test.go deleted file mode 100644 index 2e113a065ed..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/id_certificate_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package vaultcertificates - -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 = &CertificateId{} - -func TestNewCertificateID(t *testing.T) { - id := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.CertificateName != "certificateValue" { - t.Fatalf("Expected %q but got %q for Segment 'CertificateName'", id.CertificateName, "certificateValue") - } -} - -func TestFormatCertificateID(t *testing.T) { - actual := NewCertificateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "certificateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCertificateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestParseCertificateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CertificateId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - CertificateName: "certificateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/certificates/certificateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE", - Expected: &CertificateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - CertificateName: "cErTiFiCaTeVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/cErTiFiCaTeS/cErTiFiCaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCertificateIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.CertificateName != v.Expected.CertificateName { - t.Fatalf("Expected %q but got %q for CertificateName", v.Expected.CertificateName, actual.CertificateName) - } - - } -} - -func TestSegmentsForCertificateId(t *testing.T) { - segments := CertificateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CertificateId 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/recoveryservices/2023-08-01/vaultcertificates/method_create.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/method_create.go deleted file mode 100644 index 1be290d4f6b..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaultcertificates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultCertificateResponse -} - -// Create ... -func (c VaultCertificatesClient) Create(ctx context.Context, id CertificateId, input CertificateRequest) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 VaultCertificateResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_certificaterequest.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_certificaterequest.go deleted file mode 100644 index 64984a9fb6e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_certificaterequest.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CertificateRequest struct { - Properties *RawCertificateData `json:"properties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_rawcertificatedata.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_rawcertificatedata.go deleted file mode 100644 index 2b6657d3813..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_rawcertificatedata.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultcertificates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RawCertificateData struct { - AuthType *AuthType `json:"authType,omitempty"` - Certificate *string `json:"certificate,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandaaddetails.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandaaddetails.go deleted file mode 100644 index 59f9a303924..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandaaddetails.go +++ /dev/null @@ -1,82 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAadDetails{} - -type ResourceCertificateAndAadDetails struct { - AadAudience *string `json:"aadAudience,omitempty"` - AadAuthority string `json:"aadAuthority"` - AadTenantId string `json:"aadTenantId"` - AzureManagementEndpointAudience string `json:"azureManagementEndpointAudience"` - ServicePrincipalClientId string `json:"servicePrincipalClientId"` - ServicePrincipalObjectId string `json:"servicePrincipalObjectId"` - ServiceResourceId *string `json:"serviceResourceId,omitempty"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAadDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAadDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAadDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAadDetails{} - -func (s ResourceCertificateAndAadDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAadDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAadDetails: %+v", err) - } - decoded["authType"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAadDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandacsdetails.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandacsdetails.go deleted file mode 100644 index f0a2484e123..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificateandacsdetails.go +++ /dev/null @@ -1,78 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" - "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. - -var _ ResourceCertificateDetails = ResourceCertificateAndAcsDetails{} - -type ResourceCertificateAndAcsDetails struct { - GlobalAcsHostName string `json:"globalAcsHostName"` - GlobalAcsNamespace string `json:"globalAcsNamespace"` - GlobalAcsRPRealm string `json:"globalAcsRPRealm"` - - // Fields inherited from ResourceCertificateDetails - Certificate *string `json:"certificate,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Issuer *string `json:"issuer,omitempty"` - ResourceId *int64 `json:"resourceId,omitempty"` - Subject *string `json:"subject,omitempty"` - Thumbprint *string `json:"thumbprint,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidTo *string `json:"validTo,omitempty"` -} - -func (o *ResourceCertificateAndAcsDetails) GetValidFromAsTime() (*time.Time, error) { - if o.ValidFrom == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidFrom, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidFromAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidFrom = &formatted -} - -func (o *ResourceCertificateAndAcsDetails) GetValidToAsTime() (*time.Time, error) { - if o.ValidTo == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ValidTo, "2006-01-02T15:04:05Z07:00") -} - -func (o *ResourceCertificateAndAcsDetails) SetValidToAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ValidTo = &formatted -} - -var _ json.Marshaler = ResourceCertificateAndAcsDetails{} - -func (s ResourceCertificateAndAcsDetails) MarshalJSON() ([]byte, error) { - type wrapper ResourceCertificateAndAcsDetails - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateAndAcsDetails: %+v", err) - } - decoded["authType"] = "AccessControlService" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ResourceCertificateAndAcsDetails: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificatedetails.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificatedetails.go deleted file mode 100644 index 4057ff8ccdd..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_resourcecertificatedetails.go +++ /dev/null @@ -1,61 +0,0 @@ -package vaultcertificates - -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 ResourceCertificateDetails interface { -} - -// RawResourceCertificateDetailsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawResourceCertificateDetailsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalResourceCertificateDetailsImplementation(input []byte) (ResourceCertificateDetails, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ResourceCertificateDetails into map[string]interface: %+v", err) - } - - value, ok := temp["authType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out ResourceCertificateAndAadDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAadDetails: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AccessControlService") { - var out ResourceCertificateAndAcsDetails - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ResourceCertificateAndAcsDetails: %+v", err) - } - return out, nil - } - - out := RawResourceCertificateDetailsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_vaultcertificateresponse.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_vaultcertificateresponse.go deleted file mode 100644 index f5f8f52cf03..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/model_vaultcertificateresponse.go +++ /dev/null @@ -1,44 +0,0 @@ -package vaultcertificates - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultCertificateResponse struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties ResourceCertificateDetails `json:"properties"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &VaultCertificateResponse{} - -func (s *VaultCertificateResponse) UnmarshalJSON(bytes []byte) error { - type alias VaultCertificateResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into VaultCertificateResponse: %+v", err) - } - - s.Id = decoded.Id - s.Name = decoded.Name - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling VaultCertificateResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalResourceCertificateDetailsImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'VaultCertificateResponse': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/version.go b/resource-manager/recoveryservices/2023-08-01/vaultcertificates/version.go deleted file mode 100644 index e76f0570eff..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultcertificates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultcertificates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultcertificates/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/README.md b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/README.md deleted file mode 100644 index d19d6d769b1..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/README.md +++ /dev/null @@ -1,78 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo` Documentation - -The `vaultextendedinfo` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/vaultextendedinfo" -``` - - -### Client Initialization - -```go -client := vaultextendedinfo.NewVaultExtendedInfoClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultExtendedInfoClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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: `VaultExtendedInfoClient.Get` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultExtendedInfoClient.Update` - -```go -ctx := context.TODO() -id := vaultextendedinfo.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaultextendedinfo.VaultExtendedInfoResource{ - // ... -} - - -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/recoveryservices/2023-08-01/vaultextendedinfo/client.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/client.go deleted file mode 100644 index d977cd83af4..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultextendedinfo - -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 VaultExtendedInfoClient struct { - Client *resourcemanager.Client -} - -func NewVaultExtendedInfoClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultExtendedInfoClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultextendedinfo", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultExtendedInfoClient: %+v", err) - } - - return &VaultExtendedInfoClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault.go deleted file mode 100644 index 383129a1d1e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultextendedinfo - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault_test.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault_test.go deleted file mode 100644 index cd8a330cad3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultextendedinfo - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-08-01/vaultextendedinfo/method_createorupdate.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_createorupdate.go deleted file mode 100644 index 46299e1c76a..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 CreateOrUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// CreateOrUpdate ... -func (c VaultExtendedInfoClient) CreateOrUpdate(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result CreateOrUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_get.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_get.go deleted file mode 100644 index 63222675990..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_get.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultextendedinfo - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Get ... -func (c VaultExtendedInfoClient) Get(ctx context.Context, id VaultId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_update.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_update.go deleted file mode 100644 index 74d9926995b..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/method_update.go +++ /dev/null @@ -1,59 +0,0 @@ -package vaultextendedinfo - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultExtendedInfoResource -} - -// Update ... -func (c VaultExtendedInfoClient) Update(ctx context.Context, id VaultId, input VaultExtendedInfoResource) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPatch, - Path: fmt.Sprintf("%s/extendedInformation/vaultExtendedInfo", 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 VaultExtendedInfoResource - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinfo.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinfo.go deleted file mode 100644 index a1514fbe948..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfo struct { - Algorithm *string `json:"algorithm,omitempty"` - EncryptionKey *string `json:"encryptionKey,omitempty"` - EncryptionKeyThumbprint *string `json:"encryptionKeyThumbprint,omitempty"` - IntegrityKey *string `json:"integrityKey,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinforesource.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinforesource.go deleted file mode 100644 index ee148aba996..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/model_vaultextendedinforesource.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultExtendedInfoResource struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultExtendedInfo `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/version.go b/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/version.go deleted file mode 100644 index a56ec8b1618..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultextendedinfo/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultextendedinfo - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultextendedinfo/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/README.md b/resource-manager/recoveryservices/2023-08-01/vaults/README.md deleted file mode 100644 index 8db5fe7f2b3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/README.md +++ /dev/null @@ -1,121 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaults` Documentation - -The `vaults` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/vaults" -``` - - -### Client Initialization - -```go -client := vaults.NewVaultsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.Vault{ - // ... -} - - -if err := client.CreateOrUpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` - - -### Example Usage: `VaultsClient.Delete` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.Get` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `VaultsClient.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: `VaultsClient.ListBySubscriptionId` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.ListBySubscriptionId(ctx, id)` can be used to do batched pagination -items, err := client.ListBySubscriptionIdComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `VaultsClient.Update` - -```go -ctx := context.TODO() -id := vaults.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := vaults.PatchVault{ - // ... -} - - -if err := client.UpdateThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/client.go b/resource-manager/recoveryservices/2023-08-01/vaults/client.go deleted file mode 100644 index 1ddc5db936e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaults - -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 VaultsClient struct { - Client *resourcemanager.Client -} - -func NewVaultsClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaults", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultsClient: %+v", err) - } - - return &VaultsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/constants.go b/resource-manager/recoveryservices/2023-08-01/vaults/constants.go deleted file mode 100644 index 6da7a52fa02..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/constants.go +++ /dev/null @@ -1,911 +0,0 @@ -package vaults - -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 AlertsState string - -const ( - AlertsStateDisabled AlertsState = "Disabled" - AlertsStateEnabled AlertsState = "Enabled" -) - -func PossibleValuesForAlertsState() []string { - return []string{ - string(AlertsStateDisabled), - string(AlertsStateEnabled), - } -} - -func (s *AlertsState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertsState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertsState(input string) (*AlertsState, error) { - vals := map[string]AlertsState{ - "disabled": AlertsStateDisabled, - "enabled": AlertsStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertsState(input) - return &out, nil -} - -type BackupStorageVersion string - -const ( - BackupStorageVersionUnassigned BackupStorageVersion = "Unassigned" - BackupStorageVersionVOne BackupStorageVersion = "V1" - BackupStorageVersionVTwo BackupStorageVersion = "V2" -) - -func PossibleValuesForBackupStorageVersion() []string { - return []string{ - string(BackupStorageVersionUnassigned), - string(BackupStorageVersionVOne), - string(BackupStorageVersionVTwo), - } -} - -func (s *BackupStorageVersion) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseBackupStorageVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseBackupStorageVersion(input string) (*BackupStorageVersion, error) { - vals := map[string]BackupStorageVersion{ - "unassigned": BackupStorageVersionUnassigned, - "v1": BackupStorageVersionVOne, - "v2": BackupStorageVersionVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupStorageVersion(input) - return &out, nil -} - -type CrossRegionRestore string - -const ( - CrossRegionRestoreDisabled CrossRegionRestore = "Disabled" - CrossRegionRestoreEnabled CrossRegionRestore = "Enabled" -) - -func PossibleValuesForCrossRegionRestore() []string { - return []string{ - string(CrossRegionRestoreDisabled), - string(CrossRegionRestoreEnabled), - } -} - -func (s *CrossRegionRestore) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossRegionRestore(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossRegionRestore(input string) (*CrossRegionRestore, error) { - vals := map[string]CrossRegionRestore{ - "disabled": CrossRegionRestoreDisabled, - "enabled": CrossRegionRestoreEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossRegionRestore(input) - return &out, nil -} - -type CrossSubscriptionRestoreState string - -const ( - CrossSubscriptionRestoreStateDisabled CrossSubscriptionRestoreState = "Disabled" - CrossSubscriptionRestoreStateEnabled CrossSubscriptionRestoreState = "Enabled" - CrossSubscriptionRestoreStatePermanentlyDisabled CrossSubscriptionRestoreState = "PermanentlyDisabled" -) - -func PossibleValuesForCrossSubscriptionRestoreState() []string { - return []string{ - string(CrossSubscriptionRestoreStateDisabled), - string(CrossSubscriptionRestoreStateEnabled), - string(CrossSubscriptionRestoreStatePermanentlyDisabled), - } -} - -func (s *CrossSubscriptionRestoreState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCrossSubscriptionRestoreState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCrossSubscriptionRestoreState(input string) (*CrossSubscriptionRestoreState, error) { - vals := map[string]CrossSubscriptionRestoreState{ - "disabled": CrossSubscriptionRestoreStateDisabled, - "enabled": CrossSubscriptionRestoreStateEnabled, - "permanentlydisabled": CrossSubscriptionRestoreStatePermanentlyDisabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CrossSubscriptionRestoreState(input) - return &out, nil -} - -type EnhancedSecurityState string - -const ( - EnhancedSecurityStateAlwaysON EnhancedSecurityState = "AlwaysON" - EnhancedSecurityStateDisabled EnhancedSecurityState = "Disabled" - EnhancedSecurityStateEnabled EnhancedSecurityState = "Enabled" - EnhancedSecurityStateInvalid EnhancedSecurityState = "Invalid" -) - -func PossibleValuesForEnhancedSecurityState() []string { - return []string{ - string(EnhancedSecurityStateAlwaysON), - string(EnhancedSecurityStateDisabled), - string(EnhancedSecurityStateEnabled), - string(EnhancedSecurityStateInvalid), - } -} - -func (s *EnhancedSecurityState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEnhancedSecurityState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEnhancedSecurityState(input string) (*EnhancedSecurityState, error) { - vals := map[string]EnhancedSecurityState{ - "alwayson": EnhancedSecurityStateAlwaysON, - "disabled": EnhancedSecurityStateDisabled, - "enabled": EnhancedSecurityStateEnabled, - "invalid": EnhancedSecurityStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EnhancedSecurityState(input) - return &out, nil -} - -type ImmutabilityState string - -const ( - ImmutabilityStateDisabled ImmutabilityState = "Disabled" - ImmutabilityStateLocked ImmutabilityState = "Locked" - ImmutabilityStateUnlocked ImmutabilityState = "Unlocked" -) - -func PossibleValuesForImmutabilityState() []string { - return []string{ - string(ImmutabilityStateDisabled), - string(ImmutabilityStateLocked), - string(ImmutabilityStateUnlocked), - } -} - -func (s *ImmutabilityState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseImmutabilityState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseImmutabilityState(input string) (*ImmutabilityState, error) { - vals := map[string]ImmutabilityState{ - "disabled": ImmutabilityStateDisabled, - "locked": ImmutabilityStateLocked, - "unlocked": ImmutabilityStateUnlocked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ImmutabilityState(input) - return &out, nil -} - -type InfrastructureEncryptionState string - -const ( - InfrastructureEncryptionStateDisabled InfrastructureEncryptionState = "Disabled" - InfrastructureEncryptionStateEnabled InfrastructureEncryptionState = "Enabled" -) - -func PossibleValuesForInfrastructureEncryptionState() []string { - return []string{ - string(InfrastructureEncryptionStateDisabled), - string(InfrastructureEncryptionStateEnabled), - } -} - -func (s *InfrastructureEncryptionState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInfrastructureEncryptionState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInfrastructureEncryptionState(input string) (*InfrastructureEncryptionState, error) { - vals := map[string]InfrastructureEncryptionState{ - "disabled": InfrastructureEncryptionStateDisabled, - "enabled": InfrastructureEncryptionStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InfrastructureEncryptionState(input) - return &out, nil -} - -type MultiUserAuthorization string - -const ( - MultiUserAuthorizationDisabled MultiUserAuthorization = "Disabled" - MultiUserAuthorizationEnabled MultiUserAuthorization = "Enabled" - MultiUserAuthorizationInvalid MultiUserAuthorization = "Invalid" -) - -func PossibleValuesForMultiUserAuthorization() []string { - return []string{ - string(MultiUserAuthorizationDisabled), - string(MultiUserAuthorizationEnabled), - string(MultiUserAuthorizationInvalid), - } -} - -func (s *MultiUserAuthorization) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMultiUserAuthorization(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMultiUserAuthorization(input string) (*MultiUserAuthorization, error) { - vals := map[string]MultiUserAuthorization{ - "disabled": MultiUserAuthorizationDisabled, - "enabled": MultiUserAuthorizationEnabled, - "invalid": MultiUserAuthorizationInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MultiUserAuthorization(input) - return &out, nil -} - -type PrivateEndpointConnectionStatus string - -const ( - PrivateEndpointConnectionStatusApproved PrivateEndpointConnectionStatus = "Approved" - PrivateEndpointConnectionStatusDisconnected PrivateEndpointConnectionStatus = "Disconnected" - PrivateEndpointConnectionStatusPending PrivateEndpointConnectionStatus = "Pending" - PrivateEndpointConnectionStatusRejected PrivateEndpointConnectionStatus = "Rejected" -) - -func PossibleValuesForPrivateEndpointConnectionStatus() []string { - return []string{ - string(PrivateEndpointConnectionStatusApproved), - string(PrivateEndpointConnectionStatusDisconnected), - string(PrivateEndpointConnectionStatusPending), - string(PrivateEndpointConnectionStatusRejected), - } -} - -func (s *PrivateEndpointConnectionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePrivateEndpointConnectionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePrivateEndpointConnectionStatus(input string) (*PrivateEndpointConnectionStatus, error) { - vals := map[string]PrivateEndpointConnectionStatus{ - "approved": PrivateEndpointConnectionStatusApproved, - "disconnected": PrivateEndpointConnectionStatusDisconnected, - "pending": PrivateEndpointConnectionStatusPending, - "rejected": PrivateEndpointConnectionStatusRejected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PrivateEndpointConnectionStatus(input) - return &out, nil -} - -type ProvisioningState string - -const ( - ProvisioningStateDeleting ProvisioningState = "Deleting" - ProvisioningStateFailed ProvisioningState = "Failed" - ProvisioningStatePending ProvisioningState = "Pending" - ProvisioningStateSucceeded ProvisioningState = "Succeeded" -) - -func PossibleValuesForProvisioningState() []string { - return []string{ - string(ProvisioningStateDeleting), - string(ProvisioningStateFailed), - string(ProvisioningStatePending), - string(ProvisioningStateSucceeded), - } -} - -func (s *ProvisioningState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProvisioningState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProvisioningState(input string) (*ProvisioningState, error) { - vals := map[string]ProvisioningState{ - "deleting": ProvisioningStateDeleting, - "failed": ProvisioningStateFailed, - "pending": ProvisioningStatePending, - "succeeded": ProvisioningStateSucceeded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProvisioningState(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 ResourceMoveState string - -const ( - ResourceMoveStateCommitFailed ResourceMoveState = "CommitFailed" - ResourceMoveStateCommitTimedout ResourceMoveState = "CommitTimedout" - ResourceMoveStateCriticalFailure ResourceMoveState = "CriticalFailure" - ResourceMoveStateFailure ResourceMoveState = "Failure" - ResourceMoveStateInProgress ResourceMoveState = "InProgress" - ResourceMoveStateMoveSucceeded ResourceMoveState = "MoveSucceeded" - ResourceMoveStatePartialSuccess ResourceMoveState = "PartialSuccess" - ResourceMoveStatePrepareFailed ResourceMoveState = "PrepareFailed" - ResourceMoveStatePrepareTimedout ResourceMoveState = "PrepareTimedout" - ResourceMoveStateUnknown ResourceMoveState = "Unknown" -) - -func PossibleValuesForResourceMoveState() []string { - return []string{ - string(ResourceMoveStateCommitFailed), - string(ResourceMoveStateCommitTimedout), - string(ResourceMoveStateCriticalFailure), - string(ResourceMoveStateFailure), - string(ResourceMoveStateInProgress), - string(ResourceMoveStateMoveSucceeded), - string(ResourceMoveStatePartialSuccess), - string(ResourceMoveStatePrepareFailed), - string(ResourceMoveStatePrepareTimedout), - string(ResourceMoveStateUnknown), - } -} - -func (s *ResourceMoveState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseResourceMoveState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseResourceMoveState(input string) (*ResourceMoveState, error) { - vals := map[string]ResourceMoveState{ - "commitfailed": ResourceMoveStateCommitFailed, - "committimedout": ResourceMoveStateCommitTimedout, - "criticalfailure": ResourceMoveStateCriticalFailure, - "failure": ResourceMoveStateFailure, - "inprogress": ResourceMoveStateInProgress, - "movesucceeded": ResourceMoveStateMoveSucceeded, - "partialsuccess": ResourceMoveStatePartialSuccess, - "preparefailed": ResourceMoveStatePrepareFailed, - "preparetimedout": ResourceMoveStatePrepareTimedout, - "unknown": ResourceMoveStateUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceMoveState(input) - return &out, nil -} - -type SecureScoreLevel string - -const ( - SecureScoreLevelAdequate SecureScoreLevel = "Adequate" - SecureScoreLevelMaximum SecureScoreLevel = "Maximum" - SecureScoreLevelMinimum SecureScoreLevel = "Minimum" - SecureScoreLevelNone SecureScoreLevel = "None" -) - -func PossibleValuesForSecureScoreLevel() []string { - return []string{ - string(SecureScoreLevelAdequate), - string(SecureScoreLevelMaximum), - string(SecureScoreLevelMinimum), - string(SecureScoreLevelNone), - } -} - -func (s *SecureScoreLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecureScoreLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecureScoreLevel(input string) (*SecureScoreLevel, error) { - vals := map[string]SecureScoreLevel{ - "adequate": SecureScoreLevelAdequate, - "maximum": SecureScoreLevelMaximum, - "minimum": SecureScoreLevelMinimum, - "none": SecureScoreLevelNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecureScoreLevel(input) - return &out, nil -} - -type SkuName string - -const ( - SkuNameRSZero SkuName = "RS0" - SkuNameStandard SkuName = "Standard" -) - -func PossibleValuesForSkuName() []string { - return []string{ - string(SkuNameRSZero), - string(SkuNameStandard), - } -} - -func (s *SkuName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSkuName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSkuName(input string) (*SkuName, error) { - vals := map[string]SkuName{ - "rs0": SkuNameRSZero, - "standard": SkuNameStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SkuName(input) - return &out, nil -} - -type SoftDeleteState string - -const ( - SoftDeleteStateAlwaysON SoftDeleteState = "AlwaysON" - SoftDeleteStateDisabled SoftDeleteState = "Disabled" - SoftDeleteStateEnabled SoftDeleteState = "Enabled" - SoftDeleteStateInvalid SoftDeleteState = "Invalid" -) - -func PossibleValuesForSoftDeleteState() []string { - return []string{ - string(SoftDeleteStateAlwaysON), - string(SoftDeleteStateDisabled), - string(SoftDeleteStateEnabled), - string(SoftDeleteStateInvalid), - } -} - -func (s *SoftDeleteState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSoftDeleteState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSoftDeleteState(input string) (*SoftDeleteState, error) { - vals := map[string]SoftDeleteState{ - "alwayson": SoftDeleteStateAlwaysON, - "disabled": SoftDeleteStateDisabled, - "enabled": SoftDeleteStateEnabled, - "invalid": SoftDeleteStateInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SoftDeleteState(input) - return &out, nil -} - -type StandardTierStorageRedundancy string - -const ( - StandardTierStorageRedundancyGeoRedundant StandardTierStorageRedundancy = "GeoRedundant" - StandardTierStorageRedundancyInvalid StandardTierStorageRedundancy = "Invalid" - StandardTierStorageRedundancyLocallyRedundant StandardTierStorageRedundancy = "LocallyRedundant" - StandardTierStorageRedundancyZoneRedundant StandardTierStorageRedundancy = "ZoneRedundant" -) - -func PossibleValuesForStandardTierStorageRedundancy() []string { - return []string{ - string(StandardTierStorageRedundancyGeoRedundant), - string(StandardTierStorageRedundancyInvalid), - string(StandardTierStorageRedundancyLocallyRedundant), - string(StandardTierStorageRedundancyZoneRedundant), - } -} - -func (s *StandardTierStorageRedundancy) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseStandardTierStorageRedundancy(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseStandardTierStorageRedundancy(input string) (*StandardTierStorageRedundancy, error) { - vals := map[string]StandardTierStorageRedundancy{ - "georedundant": StandardTierStorageRedundancyGeoRedundant, - "invalid": StandardTierStorageRedundancyInvalid, - "locallyredundant": StandardTierStorageRedundancyLocallyRedundant, - "zoneredundant": StandardTierStorageRedundancyZoneRedundant, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StandardTierStorageRedundancy(input) - return &out, nil -} - -type TriggerType string - -const ( - TriggerTypeForcedUpgrade TriggerType = "ForcedUpgrade" - TriggerTypeUserTriggered TriggerType = "UserTriggered" -) - -func PossibleValuesForTriggerType() []string { - return []string{ - string(TriggerTypeForcedUpgrade), - string(TriggerTypeUserTriggered), - } -} - -func (s *TriggerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerType(input string) (*TriggerType, error) { - vals := map[string]TriggerType{ - "forcedupgrade": TriggerTypeForcedUpgrade, - "usertriggered": TriggerTypeUserTriggered, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerType(input) - return &out, nil -} - -type VaultPrivateEndpointState string - -const ( - VaultPrivateEndpointStateEnabled VaultPrivateEndpointState = "Enabled" - VaultPrivateEndpointStateNone VaultPrivateEndpointState = "None" -) - -func PossibleValuesForVaultPrivateEndpointState() []string { - return []string{ - string(VaultPrivateEndpointStateEnabled), - string(VaultPrivateEndpointStateNone), - } -} - -func (s *VaultPrivateEndpointState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultPrivateEndpointState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultPrivateEndpointState(input string) (*VaultPrivateEndpointState, error) { - vals := map[string]VaultPrivateEndpointState{ - "enabled": VaultPrivateEndpointStateEnabled, - "none": VaultPrivateEndpointStateNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultPrivateEndpointState(input) - return &out, nil -} - -type VaultSubResourceType string - -const ( - VaultSubResourceTypeAzureBackup VaultSubResourceType = "AzureBackup" - VaultSubResourceTypeAzureBackupSecondary VaultSubResourceType = "AzureBackup_secondary" - VaultSubResourceTypeAzureSiteRecovery VaultSubResourceType = "AzureSiteRecovery" -) - -func PossibleValuesForVaultSubResourceType() []string { - return []string{ - string(VaultSubResourceTypeAzureBackup), - string(VaultSubResourceTypeAzureBackupSecondary), - string(VaultSubResourceTypeAzureSiteRecovery), - } -} - -func (s *VaultSubResourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultSubResourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultSubResourceType(input string) (*VaultSubResourceType, error) { - vals := map[string]VaultSubResourceType{ - "azurebackup": VaultSubResourceTypeAzureBackup, - "azurebackup_secondary": VaultSubResourceTypeAzureBackupSecondary, - "azuresiterecovery": VaultSubResourceTypeAzureSiteRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultSubResourceType(input) - return &out, nil -} - -type VaultUpgradeState string - -const ( - VaultUpgradeStateFailed VaultUpgradeState = "Failed" - VaultUpgradeStateInProgress VaultUpgradeState = "InProgress" - VaultUpgradeStateUnknown VaultUpgradeState = "Unknown" - VaultUpgradeStateUpgraded VaultUpgradeState = "Upgraded" -) - -func PossibleValuesForVaultUpgradeState() []string { - return []string{ - string(VaultUpgradeStateFailed), - string(VaultUpgradeStateInProgress), - string(VaultUpgradeStateUnknown), - string(VaultUpgradeStateUpgraded), - } -} - -func (s *VaultUpgradeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVaultUpgradeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVaultUpgradeState(input string) (*VaultUpgradeState, error) { - vals := map[string]VaultUpgradeState{ - "failed": VaultUpgradeStateFailed, - "inprogress": VaultUpgradeStateInProgress, - "unknown": VaultUpgradeStateUnknown, - "upgraded": VaultUpgradeStateUpgraded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := VaultUpgradeState(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/id_vault.go b/resource-manager/recoveryservices/2023-08-01/vaults/id_vault.go deleted file mode 100644 index 1cb6def7087..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaults - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/id_vault_test.go b/resource-manager/recoveryservices/2023-08-01/vaults/id_vault_test.go deleted file mode 100644 index d99d7310acc..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaults - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-08-01/vaults/method_createorupdate.go b/resource-manager/recoveryservices/2023-08-01/vaults/method_createorupdate.go deleted file mode 100644 index 93fd5e76cbb..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/method_createorupdate.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 *Vault -} - -// CreateOrUpdate ... -func (c VaultsClient) CreateOrUpdate(ctx context.Context, id VaultId, input Vault) (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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// CreateOrUpdateThenPoll performs CreateOrUpdate then polls until it's completed -func (c VaultsClient) CreateOrUpdateThenPoll(ctx context.Context, id VaultId, input Vault) error { - result, err := c.CreateOrUpdate(ctx, id, input) - 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/recoveryservices/2023-08-01/vaults/method_delete.go b/resource-manager/recoveryservices/2023-08-01/vaults/method_delete.go deleted file mode 100644 index 70e0ba8dd2b..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package vaults - -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 VaultsClient) Delete(ctx context.Context, id VaultId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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/recoveryservices/2023-08-01/vaults/method_get.go b/resource-manager/recoveryservices/2023-08-01/vaults/method_get.go deleted file mode 100644 index 181926c5390..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package vaults - -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 *Vault -} - -// Get ... -func (c VaultsClient) Get(ctx context.Context, id VaultId) (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 Vault - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/method_listbyresourcegroup.go b/resource-manager/recoveryservices/2023-08-01/vaults/method_listbyresourcegroup.go deleted file mode 100644 index 09ba434e931..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 *[]Vault -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListByResourceGroup ... -func (c VaultsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `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 VaultsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate VaultOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/recoveryservices/2023-08-01/vaults/method_listbysubscriptionid.go b/resource-manager/recoveryservices/2023-08-01/vaults/method_listbysubscriptionid.go deleted file mode 100644 index e1f63694b10..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/method_listbysubscriptionid.go +++ /dev/null @@ -1,92 +0,0 @@ -package vaults - -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 ListBySubscriptionIdOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Vault -} - -type ListBySubscriptionIdCompleteResult struct { - LatestHttpResponse *http.Response - Items []Vault -} - -// ListBySubscriptionId ... -func (c VaultsClient) ListBySubscriptionId(ctx context.Context, id commonids.SubscriptionId) (result ListBySubscriptionIdOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.RecoveryServices/vaults", 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 *[]Vault `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListBySubscriptionIdComplete retrieves all the results into a single object -func (c VaultsClient) ListBySubscriptionIdComplete(ctx context.Context, id commonids.SubscriptionId) (ListBySubscriptionIdCompleteResult, error) { - return c.ListBySubscriptionIdCompleteMatchingPredicate(ctx, id, VaultOperationPredicate{}) -} - -// ListBySubscriptionIdCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c VaultsClient) ListBySubscriptionIdCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate VaultOperationPredicate) (result ListBySubscriptionIdCompleteResult, err error) { - items := make([]Vault, 0) - - resp, err := c.ListBySubscriptionId(ctx, id) - if err != nil { - 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 = ListBySubscriptionIdCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/method_update.go b/resource-manager/recoveryservices/2023-08-01/vaults/method_update.go deleted file mode 100644 index fd0c9f3e6da..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/method_update.go +++ /dev/null @@ -1,75 +0,0 @@ -package vaults - -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 UpdateOperationResponse struct { - Poller pollers.Poller - HttpResponse *http.Response - OData *odata.OData - Model *Vault -} - -// Update ... -func (c VaultsClient) Update(ctx context.Context, id VaultId, input PatchVault) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusAccepted, - 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 - } - - result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) - if err != nil { - return - } - - return -} - -// UpdateThenPoll performs Update then polls until it's completed -func (c VaultsClient) UpdateThenPoll(ctx context.Context, id VaultId, input PatchVault) error { - result, err := c.Update(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Update: %+v", err) - } - - if err := result.Poller.PollUntilDone(ctx); err != nil { - return fmt.Errorf("polling after Update: %+v", err) - } - - return nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_azuremonitoralertsettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_azuremonitoralertsettings.go deleted file mode 100644 index c41bfcca517..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_azuremonitoralertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureMonitorAlertSettings struct { - AlertsForAllJobFailures *AlertsState `json:"alertsForAllJobFailures,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_classicalertsettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_classicalertsettings.go deleted file mode 100644 index f82f4c55b31..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_classicalertsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClassicAlertSettings struct { - AlertsForCriticalOperations *AlertsState `json:"alertsForCriticalOperations,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkekidentity.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkekidentity.go deleted file mode 100644 index 1e5e7be3d2d..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkekidentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKekIdentity struct { - UseSystemAssignedIdentity *bool `json:"useSystemAssignedIdentity,omitempty"` - UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkeyvaultproperties.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkeyvaultproperties.go deleted file mode 100644 index c53f530b9f5..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_cmkkeyvaultproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CmkKeyVaultProperties struct { - KeyUri *string `json:"keyUri,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_crosssubscriptionrestoresettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_crosssubscriptionrestoresettings.go deleted file mode 100644 index 4a4fecb8bdd..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_crosssubscriptionrestoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossSubscriptionRestoreSettings struct { - CrossSubscriptionRestoreState *CrossSubscriptionRestoreState `json:"crossSubscriptionRestoreState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_immutabilitysettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_immutabilitysettings.go deleted file mode 100644 index f52ae97a4c3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_immutabilitysettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ImmutabilitySettings struct { - State *ImmutabilityState `json:"state,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_monitoringsettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_monitoringsettings.go deleted file mode 100644 index 391ede46ae2..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_monitoringsettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MonitoringSettings struct { - AzureMonitorAlertSettings *AzureMonitorAlertSettings `json:"azureMonitorAlertSettings,omitempty"` - ClassicAlertSettings *ClassicAlertSettings `json:"classicAlertSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_patchvault.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_patchvault.go deleted file mode 100644 index 5ffc9615bc5..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_patchvault.go +++ /dev/null @@ -1,20 +0,0 @@ -package vaults - -import ( - "github.com/hashicorp/go-azure-helpers/resourcemanager/identity" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchVault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `json:"properties,omitempty"` - Sku *Sku `json:"sku,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpoint.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpoint.go deleted file mode 100644 index 64ce35a3d98..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpoint.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// 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/recoveryservices/2023-08-01/vaults/model_privateendpointconnection.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnection.go deleted file mode 100644 index 687aefc111c..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnection.go +++ /dev/null @@ -1,11 +0,0 @@ -package vaults - -// 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 { - GroupIds *[]VaultSubResourceType `json:"groupIds,omitempty"` - PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` - PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` - ProvisioningState *ProvisioningState `json:"provisioningState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnectionvaultproperties.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnectionvaultproperties.go deleted file mode 100644 index 5758db1bfa3..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_privateendpointconnectionvaultproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PrivateEndpointConnectionVaultProperties struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PrivateEndpointConnection `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_privatelinkserviceconnectionstate.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_privatelinkserviceconnectionstate.go deleted file mode 100644 index b07724e0e27..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_privatelinkserviceconnectionstate.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// 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 { - ActionsRequired *string `json:"actionsRequired,omitempty"` - Description *string `json:"description,omitempty"` - Status *PrivateEndpointConnectionStatus `json:"status,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_restoresettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_restoresettings.go deleted file mode 100644 index b5126dbe263..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_restoresettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreSettings struct { - CrossSubscriptionRestoreSettings *CrossSubscriptionRestoreSettings `json:"crossSubscriptionRestoreSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_securitysettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_securitysettings.go deleted file mode 100644 index b5c9821e944..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_securitysettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecuritySettings struct { - ImmutabilitySettings *ImmutabilitySettings `json:"immutabilitySettings,omitempty"` - MultiUserAuthorization *MultiUserAuthorization `json:"multiUserAuthorization,omitempty"` - SoftDeleteSettings *SoftDeleteSettings `json:"softDeleteSettings,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_sku.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_sku.go deleted file mode 100644 index d89e1340ee6..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_sku.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Sku struct { - Capacity *string `json:"capacity,omitempty"` - Family *string `json:"family,omitempty"` - Name SkuName `json:"name"` - Size *string `json:"size,omitempty"` - Tier *string `json:"tier,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_softdeletesettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_softdeletesettings.go deleted file mode 100644 index fb257ac28c7..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_softdeletesettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SoftDeleteSettings struct { - EnhancedSecurityState *EnhancedSecurityState `json:"enhancedSecurityState,omitempty"` - SoftDeleteRetentionPeriodInDays *int64 `json:"softDeleteRetentionPeriodInDays,omitempty"` - SoftDeleteState *SoftDeleteState `json:"softDeleteState,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_upgradedetails.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_upgradedetails.go deleted file mode 100644 index f5e021983ab..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_upgradedetails.go +++ /dev/null @@ -1,58 +0,0 @@ -package vaults - -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 UpgradeDetails struct { - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Message *string `json:"message,omitempty"` - OperationId *string `json:"operationId,omitempty"` - PreviousResourceId *string `json:"previousResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *VaultUpgradeState `json:"status,omitempty"` - TriggerType *TriggerType `json:"triggerType,omitempty"` - UpgradedResourceId *string `json:"upgradedResourceId,omitempty"` -} - -func (o *UpgradeDetails) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetLastUpdatedTimeUtcAsTime() (*time.Time, error) { - if o.LastUpdatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetLastUpdatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedTimeUtc = &formatted -} - -func (o *UpgradeDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *UpgradeDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_vault.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_vault.go deleted file mode 100644 index dc5d7d049c1..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_vault.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -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 Vault struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Identity *identity.SystemAndUserAssignedMap `json:"identity,omitempty"` - Location string `json:"location"` - Name *string `json:"name,omitempty"` - Properties *VaultProperties `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/recoveryservices/2023-08-01/vaults/model_vaultproperties.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultproperties.go deleted file mode 100644 index 01dae5e76f8..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultproperties.go +++ /dev/null @@ -1,22 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultProperties struct { - BackupStorageVersion *BackupStorageVersion `json:"backupStorageVersion,omitempty"` - Encryption *VaultPropertiesEncryption `json:"encryption,omitempty"` - MonitoringSettings *MonitoringSettings `json:"monitoringSettings,omitempty"` - MoveDetails *VaultPropertiesMoveDetails `json:"moveDetails,omitempty"` - MoveState *ResourceMoveState `json:"moveState,omitempty"` - PrivateEndpointConnections *[]PrivateEndpointConnectionVaultProperties `json:"privateEndpointConnections,omitempty"` - PrivateEndpointStateForBackup *VaultPrivateEndpointState `json:"privateEndpointStateForBackup,omitempty"` - PrivateEndpointStateForSiteRecovery *VaultPrivateEndpointState `json:"privateEndpointStateForSiteRecovery,omitempty"` - ProvisioningState *string `json:"provisioningState,omitempty"` - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` - RedundancySettings *VaultPropertiesRedundancySettings `json:"redundancySettings,omitempty"` - RestoreSettings *RestoreSettings `json:"restoreSettings,omitempty"` - SecureScore *SecureScoreLevel `json:"secureScore,omitempty"` - SecuritySettings *SecuritySettings `json:"securitySettings,omitempty"` - UpgradeDetails *UpgradeDetails `json:"upgradeDetails,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesencryption.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesencryption.go deleted file mode 100644 index 05c6effec1d..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesencryption.go +++ /dev/null @@ -1,10 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesEncryption struct { - InfrastructureEncryption *InfrastructureEncryptionState `json:"infrastructureEncryption,omitempty"` - KekIdentity *CmkKekIdentity `json:"kekIdentity,omitempty"` - KeyVaultProperties *CmkKeyVaultProperties `json:"keyVaultProperties,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesmovedetails.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesmovedetails.go deleted file mode 100644 index b65be5a0669..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesmovedetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package vaults - -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 VaultPropertiesMoveDetails struct { - CompletionTimeUtc *string `json:"completionTimeUtc,omitempty"` - OperationId *string `json:"operationId,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` -} - -func (o *VaultPropertiesMoveDetails) GetCompletionTimeUtcAsTime() (*time.Time, error) { - if o.CompletionTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CompletionTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetCompletionTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CompletionTimeUtc = &formatted -} - -func (o *VaultPropertiesMoveDetails) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultPropertiesMoveDetails) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesredundancysettings.go b/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesredundancysettings.go deleted file mode 100644 index 2d1174f221f..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/model_vaultpropertiesredundancysettings.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultPropertiesRedundancySettings struct { - CrossRegionRestore *CrossRegionRestore `json:"crossRegionRestore,omitempty"` - StandardTierStorageRedundancy *StandardTierStorageRedundancy `json:"standardTierStorageRedundancy,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/predicates.go b/resource-manager/recoveryservices/2023-08-01/vaults/predicates.go deleted file mode 100644 index 1039a9afe4e..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package vaults - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultOperationPredicate struct { - Etag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p VaultOperationPredicate) Matches(input Vault) 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 -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaults/version.go b/resource-manager/recoveryservices/2023-08-01/vaults/version.go deleted file mode 100644 index 0fb0772d96f..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaults/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaults - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaults/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/README.md b/resource-manager/recoveryservices/2023-08-01/vaultusages/README.md deleted file mode 100644 index 18e2ab3353b..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservices/2023-08-01/vaultusages` Documentation - -The `vaultusages` SDK allows for interaction with the Azure Resource Manager Service `recoveryservices` (API Version `2023-08-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/recoveryservices/2023-08-01/vaultusages" -``` - - -### Client Initialization - -```go -client := vaultusages.NewVaultUsagesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `VaultUsagesClient.UsagesListByVaults` - -```go -ctx := context.TODO() -id := vaultusages.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -read, err := client.UsagesListByVaults(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/recoveryservices/2023-08-01/vaultusages/client.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/client.go deleted file mode 100644 index 625eba65044..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package vaultusages - -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 VaultUsagesClient struct { - Client *resourcemanager.Client -} - -func NewVaultUsagesClientWithBaseURI(sdkApi sdkEnv.Api) (*VaultUsagesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "vaultusages", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating VaultUsagesClient: %+v", err) - } - - return &VaultUsagesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/constants.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/constants.go deleted file mode 100644 index 333eba1e6c6..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/constants.go +++ /dev/null @@ -1,63 +0,0 @@ -package vaultusages - -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 UsagesUnit string - -const ( - UsagesUnitBytes UsagesUnit = "Bytes" - UsagesUnitBytesPerSecond UsagesUnit = "BytesPerSecond" - UsagesUnitCount UsagesUnit = "Count" - UsagesUnitCountPerSecond UsagesUnit = "CountPerSecond" - UsagesUnitPercent UsagesUnit = "Percent" - UsagesUnitSeconds UsagesUnit = "Seconds" -) - -func PossibleValuesForUsagesUnit() []string { - return []string{ - string(UsagesUnitBytes), - string(UsagesUnitBytesPerSecond), - string(UsagesUnitCount), - string(UsagesUnitCountPerSecond), - string(UsagesUnitPercent), - string(UsagesUnitSeconds), - } -} - -func (s *UsagesUnit) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUsagesUnit(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUsagesUnit(input string) (*UsagesUnit, error) { - vals := map[string]UsagesUnit{ - "bytes": UsagesUnitBytes, - "bytespersecond": UsagesUnitBytesPerSecond, - "count": UsagesUnitCount, - "countpersecond": UsagesUnitCountPerSecond, - "percent": UsagesUnitPercent, - "seconds": UsagesUnitSeconds, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsagesUnit(input) - return &out, nil -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault.go deleted file mode 100644 index b455e8760a5..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package vaultusages - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault_test.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault_test.go deleted file mode 100644 index 9ef11c18ec0..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package vaultusages - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservices/2023-08-01/vaultusages/method_usageslistbyvaults.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/method_usageslistbyvaults.go deleted file mode 100644 index 258a5d0bb75..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/method_usageslistbyvaults.go +++ /dev/null @@ -1,55 +0,0 @@ -package vaultusages - -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 UsagesListByVaultsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *VaultUsageList -} - -// UsagesListByVaults ... -func (c VaultUsagesClient) UsagesListByVaults(ctx context.Context, id VaultId) (result UsagesListByVaultsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/usages", 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 VaultUsageList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/model_nameinfo.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/model_nameinfo.go deleted file mode 100644 index 974668c26f9..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/model_nameinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameInfo struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusage.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusage.go deleted file mode 100644 index 6b7bc2b68d8..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusage.go +++ /dev/null @@ -1,31 +0,0 @@ -package vaultusages - -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 VaultUsage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *NameInfo `json:"name,omitempty"` - NextResetTime *string `json:"nextResetTime,omitempty"` - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - Unit *UsagesUnit `json:"unit,omitempty"` -} - -func (o *VaultUsage) GetNextResetTimeAsTime() (*time.Time, error) { - if o.NextResetTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.NextResetTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *VaultUsage) SetNextResetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.NextResetTime = &formatted -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusagelist.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusagelist.go deleted file mode 100644 index aa529e6fcbf..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/model_vaultusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package vaultusages - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type VaultUsageList struct { - Value *[]VaultUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservices/2023-08-01/vaultusages/version.go b/resource-manager/recoveryservices/2023-08-01/vaultusages/version.go deleted file mode 100644 index b5f6ba50d6a..00000000000 --- a/resource-manager/recoveryservices/2023-08-01/vaultusages/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package vaultusages - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/vaultusages/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/README.md deleted file mode 100644 index c32c1957845..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties` Documentation - -The `aadproperties` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/aadproperties" -``` - - -### Client Initialization - -```go -client := aadproperties.NewAadPropertiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AadPropertiesClient.Get` - -```go -ctx := context.TODO() -id := aadproperties.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -read, err := client.Get(ctx, id, aadproperties.DefaultGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/client.go deleted file mode 100644 index b27ee0d2533..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package aadproperties - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AadPropertiesClient struct { - Client autorest.Client - baseUri string -} - -func NewAadPropertiesClientWithBaseURI(endpoint string) AadPropertiesClient { - return AadPropertiesClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location.go deleted file mode 100644 index 4fc4de2febe..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package aadproperties - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservicesbackup/2023-01-15/aadproperties/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location_test.go deleted file mode 100644 index 83ce109c62e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package aadproperties - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservicesbackup/2023-01-15/aadproperties/method_get_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/method_get_autorest.go deleted file mode 100644 index ed91d676a20..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/method_get_autorest.go +++ /dev/null @@ -1,98 +0,0 @@ -package aadproperties - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *AADPropertiesResource -} - -type GetOperationOptions struct { - Filter *string -} - -func DefaultGetOperationOptions() GetOperationOptions { - return GetOperationOptions{} -} - -func (o GetOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o GetOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - return out -} - -// Get ... -func (c AadPropertiesClient) Get(ctx context.Context, id LocationId, options GetOperationOptions) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "aadproperties.AadPropertiesClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "aadproperties.AadPropertiesClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "aadproperties.AadPropertiesClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c AadPropertiesClient) preparerForGet(ctx context.Context, id LocationId, options GetOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/backupAadProperties", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c AadPropertiesClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadproperties.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadproperties.go deleted file mode 100644 index 862b029921d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package aadproperties - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADProperties struct { - Audience *string `json:"audience,omitempty"` - Authority *string `json:"authority,omitempty"` - ServicePrincipalClientId *string `json:"servicePrincipalClientId,omitempty"` - ServicePrincipalObjectId *string `json:"servicePrincipalObjectId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadpropertiesresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadpropertiesresource.go deleted file mode 100644 index 4ac058d6097..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/model_aadpropertiesresource.go +++ /dev/null @@ -1,14 +0,0 @@ -package aadproperties - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADPropertiesResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AADProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/version.go deleted file mode 100644 index 9f78930504e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package aadproperties - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/aadproperties/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/README.md deleted file mode 100644 index 156028af6e5..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs` Documentation - -The `backupcrrjobs` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/backupcrrjobs" -``` - - -### Client Initialization - -```go -client := backupcrrjobs.NewBackupCrrJobsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BackupCrrJobsClient.List` - -```go -ctx := context.TODO() -id := backupcrrjobs.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := backupcrrjobs.CrrJobRequest{ - // ... -} - - -// alternatively `client.List(ctx, id, payload, backupcrrjobs.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, payload, backupcrrjobs.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/client.go deleted file mode 100644 index afda7406201..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package backupcrrjobs - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupCrrJobsClient struct { - Client autorest.Client - baseUri string -} - -func NewBackupCrrJobsClientWithBaseURI(endpoint string) BackupCrrJobsClient { - return BackupCrrJobsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/constants.go deleted file mode 100644 index 6fa9fbfd415..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/constants.go +++ /dev/null @@ -1,220 +0,0 @@ -package backupcrrjobs - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupManagementType string - -const ( - BackupManagementTypeAzureBackupServer BackupManagementType = "AzureBackupServer" - BackupManagementTypeAzureIaasVM BackupManagementType = "AzureIaasVM" - BackupManagementTypeAzureSql BackupManagementType = "AzureSql" - BackupManagementTypeAzureStorage BackupManagementType = "AzureStorage" - BackupManagementTypeAzureWorkload BackupManagementType = "AzureWorkload" - BackupManagementTypeDPM BackupManagementType = "DPM" - BackupManagementTypeDefaultBackup BackupManagementType = "DefaultBackup" - BackupManagementTypeInvalid BackupManagementType = "Invalid" - BackupManagementTypeMAB BackupManagementType = "MAB" -) - -func PossibleValuesForBackupManagementType() []string { - return []string{ - string(BackupManagementTypeAzureBackupServer), - string(BackupManagementTypeAzureIaasVM), - string(BackupManagementTypeAzureSql), - string(BackupManagementTypeAzureStorage), - string(BackupManagementTypeAzureWorkload), - string(BackupManagementTypeDPM), - string(BackupManagementTypeDefaultBackup), - string(BackupManagementTypeInvalid), - string(BackupManagementTypeMAB), - } -} - -func parseBackupManagementType(input string) (*BackupManagementType, error) { - vals := map[string]BackupManagementType{ - "azurebackupserver": BackupManagementTypeAzureBackupServer, - "azureiaasvm": BackupManagementTypeAzureIaasVM, - "azuresql": BackupManagementTypeAzureSql, - "azurestorage": BackupManagementTypeAzureStorage, - "azureworkload": BackupManagementTypeAzureWorkload, - "dpm": BackupManagementTypeDPM, - "defaultbackup": BackupManagementTypeDefaultBackup, - "invalid": BackupManagementTypeInvalid, - "mab": BackupManagementTypeMAB, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupManagementType(input) - return &out, nil -} - -type JobSupportedAction string - -const ( - JobSupportedActionCancellable JobSupportedAction = "Cancellable" - JobSupportedActionInvalid JobSupportedAction = "Invalid" - JobSupportedActionRetriable JobSupportedAction = "Retriable" -) - -func PossibleValuesForJobSupportedAction() []string { - return []string{ - string(JobSupportedActionCancellable), - string(JobSupportedActionInvalid), - string(JobSupportedActionRetriable), - } -} - -func parseJobSupportedAction(input string) (*JobSupportedAction, error) { - vals := map[string]JobSupportedAction{ - "cancellable": JobSupportedActionCancellable, - "invalid": JobSupportedActionInvalid, - "retriable": JobSupportedActionRetriable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := JobSupportedAction(input) - return &out, nil -} - -type MabServerType string - -const ( - MabServerTypeAzureBackupServerContainer MabServerType = "AzureBackupServerContainer" - MabServerTypeAzureSqlContainer MabServerType = "AzureSqlContainer" - MabServerTypeCluster MabServerType = "Cluster" - MabServerTypeDPMContainer MabServerType = "DPMContainer" - MabServerTypeGenericContainer MabServerType = "GenericContainer" - MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" - MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer" - MabServerTypeInvalid MabServerType = "Invalid" - MabServerTypeMABContainer MabServerType = "MABContainer" - MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" - MabServerTypeStorageContainer MabServerType = "StorageContainer" - MabServerTypeUnknown MabServerType = "Unknown" - MabServerTypeVCenter MabServerType = "VCenter" - MabServerTypeVMAppContainer MabServerType = "VMAppContainer" - MabServerTypeWindows MabServerType = "Windows" -) - -func PossibleValuesForMabServerType() []string { - return []string{ - string(MabServerTypeAzureBackupServerContainer), - string(MabServerTypeAzureSqlContainer), - string(MabServerTypeCluster), - string(MabServerTypeDPMContainer), - string(MabServerTypeGenericContainer), - string(MabServerTypeIaasVMContainer), - string(MabServerTypeIaasVMServiceContainer), - string(MabServerTypeInvalid), - string(MabServerTypeMABContainer), - string(MabServerTypeSQLAGWorkLoadContainer), - string(MabServerTypeStorageContainer), - string(MabServerTypeUnknown), - string(MabServerTypeVCenter), - string(MabServerTypeVMAppContainer), - string(MabServerTypeWindows), - } -} - -func parseMabServerType(input string) (*MabServerType, error) { - vals := map[string]MabServerType{ - "azurebackupservercontainer": MabServerTypeAzureBackupServerContainer, - "azuresqlcontainer": MabServerTypeAzureSqlContainer, - "cluster": MabServerTypeCluster, - "dpmcontainer": MabServerTypeDPMContainer, - "genericcontainer": MabServerTypeGenericContainer, - "iaasvmcontainer": MabServerTypeIaasVMContainer, - "iaasvmservicecontainer": MabServerTypeIaasVMServiceContainer, - "invalid": MabServerTypeInvalid, - "mabcontainer": MabServerTypeMABContainer, - "sqlagworkloadcontainer": MabServerTypeSQLAGWorkLoadContainer, - "storagecontainer": MabServerTypeStorageContainer, - "unknown": MabServerTypeUnknown, - "vcenter": MabServerTypeVCenter, - "vmappcontainer": MabServerTypeVMAppContainer, - "windows": MabServerTypeWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MabServerType(input) - return &out, nil -} - -type WorkloadType string - -const ( - WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" - WorkloadTypeAzureSqlDb WorkloadType = "AzureSqlDb" - WorkloadTypeClient WorkloadType = "Client" - WorkloadTypeExchange WorkloadType = "Exchange" - WorkloadTypeFileFolder WorkloadType = "FileFolder" - WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" - WorkloadTypeInvalid WorkloadType = "Invalid" - WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" - WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" - WorkloadTypeSQLDB WorkloadType = "SQLDB" - WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" - WorkloadTypeSharepoint WorkloadType = "Sharepoint" - WorkloadTypeSystemState WorkloadType = "SystemState" - WorkloadTypeVM WorkloadType = "VM" - WorkloadTypeVMwareVM WorkloadType = "VMwareVM" -) - -func PossibleValuesForWorkloadType() []string { - return []string{ - string(WorkloadTypeAzureFileShare), - string(WorkloadTypeAzureSqlDb), - string(WorkloadTypeClient), - string(WorkloadTypeExchange), - string(WorkloadTypeFileFolder), - string(WorkloadTypeGenericDataSource), - string(WorkloadTypeInvalid), - string(WorkloadTypeSAPAseDatabase), - string(WorkloadTypeSAPHanaDatabase), - string(WorkloadTypeSQLDB), - string(WorkloadTypeSQLDataBase), - string(WorkloadTypeSharepoint), - string(WorkloadTypeSystemState), - string(WorkloadTypeVM), - string(WorkloadTypeVMwareVM), - } -} - -func parseWorkloadType(input string) (*WorkloadType, error) { - vals := map[string]WorkloadType{ - "azurefileshare": WorkloadTypeAzureFileShare, - "azuresqldb": WorkloadTypeAzureSqlDb, - "client": WorkloadTypeClient, - "exchange": WorkloadTypeExchange, - "filefolder": WorkloadTypeFileFolder, - "genericdatasource": WorkloadTypeGenericDataSource, - "invalid": WorkloadTypeInvalid, - "sapasedatabase": WorkloadTypeSAPAseDatabase, - "saphanadatabase": WorkloadTypeSAPHanaDatabase, - "sqldb": WorkloadTypeSQLDB, - "sqldatabase": WorkloadTypeSQLDataBase, - "sharepoint": WorkloadTypeSharepoint, - "systemstate": WorkloadTypeSystemState, - "vm": WorkloadTypeVM, - "vmwarevm": WorkloadTypeVMwareVM, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WorkloadType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location.go deleted file mode 100644 index 709977ad6d2..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package backupcrrjobs - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location_test.go deleted file mode 100644 index 418d6ed957e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package backupcrrjobs - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservicesbackup/2023-01-15/backupcrrjobs/method_list_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/method_list_autorest.go deleted file mode 100644 index be538677c4d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/method_list_autorest.go +++ /dev/null @@ -1,216 +0,0 @@ -package backupcrrjobs - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *[]JobResource - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) -} - -type ListCompleteResult struct { - Items []JobResource -} - -func (r ListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type ListOperationOptions struct { - Filter *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - return out -} - -// List ... -func (c BackupCrrJobsClient) List(ctx context.Context, id LocationId, input CrrJobRequest, options ListOperationOptions) (resp ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id, input, options) - if err != nil { - err = autorest.NewErrorWithError(err, "backupcrrjobs.BackupCrrJobsClient", "List", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupcrrjobs.BackupCrrJobsClient", "List", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupcrrjobs.BackupCrrJobsClient", "List", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForList prepares the List request. -func (c BackupCrrJobsClient) preparerForList(ctx context.Context, id LocationId, input CrrJobRequest, options ListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/backupCrrJobs", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListWithNextLink prepares the List request with the given nextLink token. -func (c BackupCrrJobsClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c BackupCrrJobsClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - type page struct { - Values []JobResource `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { - req, err := c.preparerForListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "backupcrrjobs.BackupCrrJobsClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupcrrjobs.BackupCrrJobsClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupcrrjobs.BackupCrrJobsClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListComplete retrieves all of the results into a single object -func (c BackupCrrJobsClient) ListComplete(ctx context.Context, id LocationId, input CrrJobRequest, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, input, options, JobResourceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c BackupCrrJobsClient) ListCompleteMatchingPredicate(ctx context.Context, id LocationId, input CrrJobRequest, options ListOperationOptions, predicate JobResourceOperationPredicate) (resp ListCompleteResult, err error) { - items := make([]JobResource, 0) - - page, err := c.List(ctx, id, input, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmerrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmerrorinfo.go deleted file mode 100644 index d40cfd59cc5..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmerrorinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureIaaSVMErrorInfo struct { - ErrorCode *int64 `json:"errorCode,omitempty"` - ErrorString *string `json:"errorString,omitempty"` - ErrorTitle *string `json:"errorTitle,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjob.go deleted file mode 100644 index 83f5a676f90..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjob.go +++ /dev/null @@ -1,79 +0,0 @@ -package backupcrrjobs - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = AzureIaaSVMJob{} - -type AzureIaaSVMJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *AzureIaaSVMJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureIaaSVMJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = AzureIaaSVMJob{} - -func (s AzureIaaSVMJob) MarshalJSON() ([]byte, error) { - type wrapper AzureIaaSVMJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureIaaSVMJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureIaaSVMJob: %+v", err) - } - decoded["jobType"] = "AzureIaaSVMJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureIaaSVMJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobextendedinfo.go deleted file mode 100644 index 20d7d4820f8..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobextendedinfo.go +++ /dev/null @@ -1,13 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureIaaSVMJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - EstimatedRemainingDuration *string `json:"estimatedRemainingDuration,omitempty"` - InternalPropertyBag *map[string]string `json:"internalPropertyBag,omitempty"` - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobtaskdetails.go deleted file mode 100644 index 32b27304ba3..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureiaasvmjobtaskdetails.go +++ /dev/null @@ -1,45 +0,0 @@ -package backupcrrjobs - -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 AzureIaaSVMJobTaskDetails struct { - Duration *string `json:"duration,omitempty"` - EndTime *string `json:"endTime,omitempty"` - InstanceId *string `json:"instanceId,omitempty"` - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - TaskExecutionDetails *string `json:"taskExecutionDetails,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} - -func (o *AzureIaaSVMJobTaskDetails) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJobTaskDetails) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureIaaSVMJobTaskDetails) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJobTaskDetails) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestorageerrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestorageerrorinfo.go deleted file mode 100644 index aaccc66f2e2..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestorageerrorinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureStorageErrorInfo struct { - ErrorCode *int64 `json:"errorCode,omitempty"` - ErrorString *string `json:"errorString,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejob.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejob.go deleted file mode 100644 index f6e8aedc42d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejob.go +++ /dev/null @@ -1,80 +0,0 @@ -package backupcrrjobs - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = AzureStorageJob{} - -type AzureStorageJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` - StorageAccountName *string `json:"storageAccountName,omitempty"` - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *AzureStorageJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureStorageJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureStorageJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureStorageJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = AzureStorageJob{} - -func (s AzureStorageJob) MarshalJSON() ([]byte, error) { - type wrapper AzureStorageJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureStorageJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureStorageJob: %+v", err) - } - decoded["jobType"] = "AzureStorageJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureStorageJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobextendedinfo.go deleted file mode 100644 index 05c68387051..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureStorageJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobtaskdetails.go deleted file mode 100644 index 83f9beeb9b1..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azurestoragejobtaskdetails.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureStorageJobTaskDetails struct { - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloaderrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloaderrorinfo.go deleted file mode 100644 index 2a8b4ce912d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloaderrorinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWorkloadErrorInfo struct { - AdditionalDetails *string `json:"additionalDetails,omitempty"` - ErrorCode *int64 `json:"errorCode,omitempty"` - ErrorString *string `json:"errorString,omitempty"` - ErrorTitle *string `json:"errorTitle,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjob.go deleted file mode 100644 index 9f78dfa76ea..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjob.go +++ /dev/null @@ -1,79 +0,0 @@ -package backupcrrjobs - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = AzureWorkloadJob{} - -type AzureWorkloadJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *AzureWorkloadJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureWorkloadJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureWorkloadJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureWorkloadJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = AzureWorkloadJob{} - -func (s AzureWorkloadJob) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadJob: %+v", err) - } - decoded["jobType"] = "AzureWorkloadJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobextendedinfo.go deleted file mode 100644 index dd22afc85d4..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWorkloadJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobtaskdetails.go deleted file mode 100644 index 76fc0d2f8d6..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_azureworkloadjobtaskdetails.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWorkloadJobTaskDetails struct { - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_crrjobrequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_crrjobrequest.go deleted file mode 100644 index a5715751de6..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_crrjobrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrrJobRequest struct { - JobName *string `json:"jobName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmerrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmerrorinfo.go deleted file mode 100644 index fca8e066c3b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmerrorinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DpmErrorInfo struct { - ErrorString *string `json:"errorString,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjob.go deleted file mode 100644 index ca76154da8c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjob.go +++ /dev/null @@ -1,82 +0,0 @@ -package backupcrrjobs - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = DpmJob{} - -type DpmJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - ContainerType *string `json:"containerType,omitempty"` - DpmServerName *string `json:"dpmServerName,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *DpmJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *DpmJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = DpmJob{} - -func (s DpmJob) MarshalJSON() ([]byte, error) { - type wrapper DpmJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DpmJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DpmJob: %+v", err) - } - decoded["jobType"] = "DpmJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DpmJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobextendedinfo.go deleted file mode 100644 index 78c4aa228c7..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DpmJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobtaskdetails.go deleted file mode 100644 index fd847cd4ce6..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_dpmjobtaskdetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package backupcrrjobs - -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 DpmJobTaskDetails struct { - Duration *string `json:"duration,omitempty"` - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} - -func (o *DpmJobTaskDetails) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJobTaskDetails) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *DpmJobTaskDetails) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJobTaskDetails) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_job.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_job.go deleted file mode 100644 index 48e70df7594..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_job.go +++ /dev/null @@ -1,85 +0,0 @@ -package backupcrrjobs - -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 Job interface { -} - -// RawJobImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawJobImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalJobImplementation(input []byte) (Job, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Job into map[string]interface: %+v", err) - } - - value, ok := temp["jobType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureIaaSVMJob") { - var out AzureIaaSVMJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureIaaSVMJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureStorageJob") { - var out AzureStorageJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureStorageJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadJob") { - var out AzureWorkloadJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "DpmJob") { - var out DpmJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DpmJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MabJob") { - var out MabJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MabJob: %+v", err) - } - return out, nil - } - - out := RawJobImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_jobresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_jobresource.go deleted file mode 100644 index d21a08867db..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_jobresource.go +++ /dev/null @@ -1,50 +0,0 @@ -package backupcrrjobs - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties Job `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &JobResource{} - -func (s *JobResource) UnmarshalJSON(bytes []byte) error { - type alias JobResource - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into JobResource: %+v", err) - } - - s.ETag = decoded.ETag - s.Id = decoded.Id - s.Location = decoded.Location - s.Name = decoded.Name - s.Tags = decoded.Tags - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling JobResource into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalJobImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'JobResource': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_maberrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_maberrorinfo.go deleted file mode 100644 index 8db44b3d8b2..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_maberrorinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MabErrorInfo struct { - ErrorString *string `json:"errorString,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjob.go deleted file mode 100644 index 52d2b22b637..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjob.go +++ /dev/null @@ -1,81 +0,0 @@ -package backupcrrjobs - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = MabJob{} - -type MabJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` - MabServerName *string `json:"mabServerName,omitempty"` - MabServerType *MabServerType `json:"mabServerType,omitempty"` - WorkloadType *WorkloadType `json:"workloadType,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *MabJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *MabJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = MabJob{} - -func (s MabJob) MarshalJSON() ([]byte, error) { - type wrapper MabJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MabJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MabJob: %+v", err) - } - decoded["jobType"] = "MabJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MabJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobextendedinfo.go deleted file mode 100644 index 923901a06f4..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MabJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobtaskdetails.go deleted file mode 100644 index d66c710003d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/model_mabjobtaskdetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package backupcrrjobs - -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 MabJobTaskDetails struct { - Duration *string `json:"duration,omitempty"` - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} - -func (o *MabJobTaskDetails) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJobTaskDetails) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *MabJobTaskDetails) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJobTaskDetails) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/predicates.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/predicates.go deleted file mode 100644 index bd273e71b98..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package backupcrrjobs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobResourceOperationPredicate struct { - ETag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p JobResourceOperationPredicate) Matches(input JobResource) 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 && (input.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/recoveryservicesbackup/2023-01-15/backupcrrjobs/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/version.go deleted file mode 100644 index 8886ec75b4f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package backupcrrjobs - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/backupcrrjobs/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/README.md deleted file mode 100644 index dc73ab895c8..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr` Documentation - -The `backupprotecteditemscrr` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr" -``` - - -### Client Initialization - -```go -client := backupprotecteditemscrr.NewBackupProtectedItemsCrrClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BackupProtectedItemsCrrClient.List` - -```go -ctx := context.TODO() -id := backupprotecteditemscrr.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -// alternatively `client.List(ctx, id, backupprotecteditemscrr.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, backupprotecteditemscrr.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/client.go deleted file mode 100644 index ff3f4b12f7a..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package backupprotecteditemscrr - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupProtectedItemsCrrClient struct { - Client autorest.Client - baseUri string -} - -func NewBackupProtectedItemsCrrClientWithBaseURI(endpoint string) BackupProtectedItemsCrrClient { - return BackupProtectedItemsCrrClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/constants.go deleted file mode 100644 index 91f41d534fa..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/constants.go +++ /dev/null @@ -1,378 +0,0 @@ -package backupprotecteditemscrr - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupManagementType string - -const ( - BackupManagementTypeAzureBackupServer BackupManagementType = "AzureBackupServer" - BackupManagementTypeAzureIaasVM BackupManagementType = "AzureIaasVM" - BackupManagementTypeAzureSql BackupManagementType = "AzureSql" - BackupManagementTypeAzureStorage BackupManagementType = "AzureStorage" - BackupManagementTypeAzureWorkload BackupManagementType = "AzureWorkload" - BackupManagementTypeDPM BackupManagementType = "DPM" - BackupManagementTypeDefaultBackup BackupManagementType = "DefaultBackup" - BackupManagementTypeInvalid BackupManagementType = "Invalid" - BackupManagementTypeMAB BackupManagementType = "MAB" -) - -func PossibleValuesForBackupManagementType() []string { - return []string{ - string(BackupManagementTypeAzureBackupServer), - string(BackupManagementTypeAzureIaasVM), - string(BackupManagementTypeAzureSql), - string(BackupManagementTypeAzureStorage), - string(BackupManagementTypeAzureWorkload), - string(BackupManagementTypeDPM), - string(BackupManagementTypeDefaultBackup), - string(BackupManagementTypeInvalid), - string(BackupManagementTypeMAB), - } -} - -func parseBackupManagementType(input string) (*BackupManagementType, error) { - vals := map[string]BackupManagementType{ - "azurebackupserver": BackupManagementTypeAzureBackupServer, - "azureiaasvm": BackupManagementTypeAzureIaasVM, - "azuresql": BackupManagementTypeAzureSql, - "azurestorage": BackupManagementTypeAzureStorage, - "azureworkload": BackupManagementTypeAzureWorkload, - "dpm": BackupManagementTypeDPM, - "defaultbackup": BackupManagementTypeDefaultBackup, - "invalid": BackupManagementTypeInvalid, - "mab": BackupManagementTypeMAB, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupManagementType(input) - return &out, nil -} - -type CreateMode string - -const ( - CreateModeDefault CreateMode = "Default" - CreateModeInvalid CreateMode = "Invalid" - CreateModeRecover CreateMode = "Recover" -) - -func PossibleValuesForCreateMode() []string { - return []string{ - string(CreateModeDefault), - string(CreateModeInvalid), - string(CreateModeRecover), - } -} - -func parseCreateMode(input string) (*CreateMode, error) { - vals := map[string]CreateMode{ - "default": CreateModeDefault, - "invalid": CreateModeInvalid, - "recover": CreateModeRecover, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreateMode(input) - return &out, nil -} - -type DataSourceType string - -const ( - DataSourceTypeAzureFileShare DataSourceType = "AzureFileShare" - DataSourceTypeAzureSqlDb DataSourceType = "AzureSqlDb" - DataSourceTypeClient DataSourceType = "Client" - DataSourceTypeExchange DataSourceType = "Exchange" - DataSourceTypeFileFolder DataSourceType = "FileFolder" - DataSourceTypeGenericDataSource DataSourceType = "GenericDataSource" - DataSourceTypeInvalid DataSourceType = "Invalid" - DataSourceTypeSAPAseDatabase DataSourceType = "SAPAseDatabase" - DataSourceTypeSAPHanaDatabase DataSourceType = "SAPHanaDatabase" - DataSourceTypeSQLDB DataSourceType = "SQLDB" - DataSourceTypeSQLDataBase DataSourceType = "SQLDataBase" - DataSourceTypeSharepoint DataSourceType = "Sharepoint" - DataSourceTypeSystemState DataSourceType = "SystemState" - DataSourceTypeVM DataSourceType = "VM" - DataSourceTypeVMwareVM DataSourceType = "VMwareVM" -) - -func PossibleValuesForDataSourceType() []string { - return []string{ - string(DataSourceTypeAzureFileShare), - string(DataSourceTypeAzureSqlDb), - string(DataSourceTypeClient), - string(DataSourceTypeExchange), - string(DataSourceTypeFileFolder), - string(DataSourceTypeGenericDataSource), - string(DataSourceTypeInvalid), - string(DataSourceTypeSAPAseDatabase), - string(DataSourceTypeSAPHanaDatabase), - string(DataSourceTypeSQLDB), - string(DataSourceTypeSQLDataBase), - string(DataSourceTypeSharepoint), - string(DataSourceTypeSystemState), - string(DataSourceTypeVM), - string(DataSourceTypeVMwareVM), - } -} - -func parseDataSourceType(input string) (*DataSourceType, error) { - vals := map[string]DataSourceType{ - "azurefileshare": DataSourceTypeAzureFileShare, - "azuresqldb": DataSourceTypeAzureSqlDb, - "client": DataSourceTypeClient, - "exchange": DataSourceTypeExchange, - "filefolder": DataSourceTypeFileFolder, - "genericdatasource": DataSourceTypeGenericDataSource, - "invalid": DataSourceTypeInvalid, - "sapasedatabase": DataSourceTypeSAPAseDatabase, - "saphanadatabase": DataSourceTypeSAPHanaDatabase, - "sqldb": DataSourceTypeSQLDB, - "sqldatabase": DataSourceTypeSQLDataBase, - "sharepoint": DataSourceTypeSharepoint, - "systemstate": DataSourceTypeSystemState, - "vm": DataSourceTypeVM, - "vmwarevm": DataSourceTypeVMwareVM, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataSourceType(input) - return &out, nil -} - -type HealthStatus string - -const ( - HealthStatusActionRequired HealthStatus = "ActionRequired" - HealthStatusActionSuggested HealthStatus = "ActionSuggested" - HealthStatusInvalid HealthStatus = "Invalid" - HealthStatusPassed HealthStatus = "Passed" -) - -func PossibleValuesForHealthStatus() []string { - return []string{ - string(HealthStatusActionRequired), - string(HealthStatusActionSuggested), - string(HealthStatusInvalid), - string(HealthStatusPassed), - } -} - -func parseHealthStatus(input string) (*HealthStatus, error) { - vals := map[string]HealthStatus{ - "actionrequired": HealthStatusActionRequired, - "actionsuggested": HealthStatusActionSuggested, - "invalid": HealthStatusInvalid, - "passed": HealthStatusPassed, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := HealthStatus(input) - return &out, nil -} - -type LastBackupStatus string - -const ( - LastBackupStatusHealthy LastBackupStatus = "Healthy" - LastBackupStatusIRPending LastBackupStatus = "IRPending" - LastBackupStatusInvalid LastBackupStatus = "Invalid" - LastBackupStatusUnhealthy LastBackupStatus = "Unhealthy" -) - -func PossibleValuesForLastBackupStatus() []string { - return []string{ - string(LastBackupStatusHealthy), - string(LastBackupStatusIRPending), - string(LastBackupStatusInvalid), - string(LastBackupStatusUnhealthy), - } -} - -func parseLastBackupStatus(input string) (*LastBackupStatus, error) { - vals := map[string]LastBackupStatus{ - "healthy": LastBackupStatusHealthy, - "irpending": LastBackupStatusIRPending, - "invalid": LastBackupStatusInvalid, - "unhealthy": LastBackupStatusUnhealthy, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := LastBackupStatus(input) - return &out, nil -} - -type ProtectedItemHealthStatus string - -const ( - ProtectedItemHealthStatusHealthy ProtectedItemHealthStatus = "Healthy" - ProtectedItemHealthStatusIRPending ProtectedItemHealthStatus = "IRPending" - ProtectedItemHealthStatusInvalid ProtectedItemHealthStatus = "Invalid" - ProtectedItemHealthStatusNotReachable ProtectedItemHealthStatus = "NotReachable" - ProtectedItemHealthStatusUnhealthy ProtectedItemHealthStatus = "Unhealthy" -) - -func PossibleValuesForProtectedItemHealthStatus() []string { - return []string{ - string(ProtectedItemHealthStatusHealthy), - string(ProtectedItemHealthStatusIRPending), - string(ProtectedItemHealthStatusInvalid), - string(ProtectedItemHealthStatusNotReachable), - string(ProtectedItemHealthStatusUnhealthy), - } -} - -func parseProtectedItemHealthStatus(input string) (*ProtectedItemHealthStatus, error) { - vals := map[string]ProtectedItemHealthStatus{ - "healthy": ProtectedItemHealthStatusHealthy, - "irpending": ProtectedItemHealthStatusIRPending, - "invalid": ProtectedItemHealthStatusInvalid, - "notreachable": ProtectedItemHealthStatusNotReachable, - "unhealthy": ProtectedItemHealthStatusUnhealthy, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtectedItemHealthStatus(input) - return &out, nil -} - -type ProtectedItemState string - -const ( - ProtectedItemStateIRPending ProtectedItemState = "IRPending" - ProtectedItemStateInvalid ProtectedItemState = "Invalid" - ProtectedItemStateProtected ProtectedItemState = "Protected" - ProtectedItemStateProtectionError ProtectedItemState = "ProtectionError" - ProtectedItemStateProtectionPaused ProtectedItemState = "ProtectionPaused" - ProtectedItemStateProtectionStopped ProtectedItemState = "ProtectionStopped" -) - -func PossibleValuesForProtectedItemState() []string { - return []string{ - string(ProtectedItemStateIRPending), - string(ProtectedItemStateInvalid), - string(ProtectedItemStateProtected), - string(ProtectedItemStateProtectionError), - string(ProtectedItemStateProtectionPaused), - string(ProtectedItemStateProtectionStopped), - } -} - -func parseProtectedItemState(input string) (*ProtectedItemState, error) { - vals := map[string]ProtectedItemState{ - "irpending": ProtectedItemStateIRPending, - "invalid": ProtectedItemStateInvalid, - "protected": ProtectedItemStateProtected, - "protectionerror": ProtectedItemStateProtectionError, - "protectionpaused": ProtectedItemStateProtectionPaused, - "protectionstopped": ProtectedItemStateProtectionStopped, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtectedItemState(input) - return &out, nil -} - -type ProtectionState string - -const ( - ProtectionStateIRPending ProtectionState = "IRPending" - ProtectionStateInvalid ProtectionState = "Invalid" - ProtectionStateProtected ProtectionState = "Protected" - ProtectionStateProtectionError ProtectionState = "ProtectionError" - ProtectionStateProtectionPaused ProtectionState = "ProtectionPaused" - ProtectionStateProtectionStopped ProtectionState = "ProtectionStopped" -) - -func PossibleValuesForProtectionState() []string { - return []string{ - string(ProtectionStateIRPending), - string(ProtectionStateInvalid), - string(ProtectionStateProtected), - string(ProtectionStateProtectionError), - string(ProtectionStateProtectionPaused), - string(ProtectionStateProtectionStopped), - } -} - -func parseProtectionState(input string) (*ProtectionState, error) { - vals := map[string]ProtectionState{ - "irpending": ProtectionStateIRPending, - "invalid": ProtectionStateInvalid, - "protected": ProtectionStateProtected, - "protectionerror": ProtectionStateProtectionError, - "protectionpaused": ProtectionStateProtectionPaused, - "protectionstopped": ProtectionStateProtectionStopped, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProtectionState(input) - return &out, nil -} - -type ResourceHealthStatus string - -const ( - ResourceHealthStatusHealthy ResourceHealthStatus = "Healthy" - ResourceHealthStatusInvalid ResourceHealthStatus = "Invalid" - ResourceHealthStatusPersistentDegraded ResourceHealthStatus = "PersistentDegraded" - ResourceHealthStatusPersistentUnhealthy ResourceHealthStatus = "PersistentUnhealthy" - ResourceHealthStatusTransientDegraded ResourceHealthStatus = "TransientDegraded" - ResourceHealthStatusTransientUnhealthy ResourceHealthStatus = "TransientUnhealthy" -) - -func PossibleValuesForResourceHealthStatus() []string { - return []string{ - string(ResourceHealthStatusHealthy), - string(ResourceHealthStatusInvalid), - string(ResourceHealthStatusPersistentDegraded), - string(ResourceHealthStatusPersistentUnhealthy), - string(ResourceHealthStatusTransientDegraded), - string(ResourceHealthStatusTransientUnhealthy), - } -} - -func parseResourceHealthStatus(input string) (*ResourceHealthStatus, error) { - vals := map[string]ResourceHealthStatus{ - "healthy": ResourceHealthStatusHealthy, - "invalid": ResourceHealthStatusInvalid, - "persistentdegraded": ResourceHealthStatusPersistentDegraded, - "persistentunhealthy": ResourceHealthStatusPersistentUnhealthy, - "transientdegraded": ResourceHealthStatusTransientDegraded, - "transientunhealthy": ResourceHealthStatusTransientUnhealthy, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ResourceHealthStatus(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault.go deleted file mode 100644 index 7ea462661ba..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package backupprotecteditemscrr - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault_test.go deleted file mode 100644 index ea238d77412..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package backupprotecteditemscrr - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/method_list_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/method_list_autorest.go deleted file mode 100644 index 462d873a329..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/method_list_autorest.go +++ /dev/null @@ -1,215 +0,0 @@ -package backupprotecteditemscrr - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *[]ProtectedItemResource - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) -} - -type ListCompleteResult struct { - Items []ProtectedItemResource -} - -func (r ListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type ListOperationOptions struct { - Filter *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - return out -} - -// List ... -func (c BackupProtectedItemsCrrClient) List(ctx context.Context, id VaultId, options ListOperationOptions) (resp ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "backupprotecteditemscrr.BackupProtectedItemsCrrClient", "List", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupprotecteditemscrr.BackupProtectedItemsCrrClient", "List", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupprotecteditemscrr.BackupProtectedItemsCrrClient", "List", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForList prepares the List request. -func (c BackupProtectedItemsCrrClient) preparerForList(ctx context.Context, id VaultId, options ListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/backupProtectedItems", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListWithNextLink prepares the List request with the given nextLink token. -func (c BackupProtectedItemsCrrClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c BackupProtectedItemsCrrClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - type page struct { - Values []ProtectedItemResource `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { - req, err := c.preparerForListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "backupprotecteditemscrr.BackupProtectedItemsCrrClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupprotecteditemscrr.BackupProtectedItemsCrrClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupprotecteditemscrr.BackupProtectedItemsCrrClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListComplete retrieves all of the results into a single object -func (c BackupProtectedItemsCrrClient) ListComplete(ctx context.Context, id VaultId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, ProtectedItemResourceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c BackupProtectedItemsCrrClient) ListCompleteMatchingPredicate(ctx context.Context, id VaultId, options ListOperationOptions, predicate ProtectedItemResourceOperationPredicate) (resp ListCompleteResult, err error) { - items := make([]ProtectedItemResource, 0) - - page, err := c.List(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditem.go deleted file mode 100644 index e697002ed8d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditem.go +++ /dev/null @@ -1,89 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureFileshareProtectedItem{} - -type AzureFileshareProtectedItem struct { - ExtendedInfo *AzureFileshareProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureFileshareProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureFileshareProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureFileshareProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureFileshareProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureFileshareProtectedItem{} - -func (s AzureFileshareProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureFileshareProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureFileshareProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureFileshareProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "AzureFileShareProtectedItem" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureFileshareProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditemextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditemextendedinfo.go deleted file mode 100644 index df16d3f3ea7..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurefileshareprotecteditemextendedinfo.go +++ /dev/null @@ -1,42 +0,0 @@ -package backupprotecteditemscrr - -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 AzureFileshareProtectedItemExtendedInfo struct { - OldestRecoveryPoint *string `json:"oldestRecoveryPoint,omitempty"` - PolicyState *string `json:"policyState,omitempty"` - RecoveryPointCount *int64 `json:"recoveryPointCount,omitempty"` - ResourceState *string `json:"resourceState,omitempty"` - ResourceStateSyncTime *string `json:"resourceStateSyncTime,omitempty"` -} - -func (o *AzureFileshareProtectedItemExtendedInfo) GetOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureFileshareProtectedItemExtendedInfo) SetOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OldestRecoveryPoint = &formatted -} - -func (o *AzureFileshareProtectedItemExtendedInfo) GetResourceStateSyncTimeAsTime() (*time.Time, error) { - if o.ResourceStateSyncTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ResourceStateSyncTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureFileshareProtectedItemExtendedInfo) SetResourceStateSyncTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ResourceStateSyncTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasclassiccomputevmprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasclassiccomputevmprotecteditem.go deleted file mode 100644 index c2e790fc2ee..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasclassiccomputevmprotecteditem.go +++ /dev/null @@ -1,93 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureIaaSClassicComputeVMProtectedItem{} - -type AzureIaaSClassicComputeVMProtectedItem struct { - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HealthDetails *[]ResourceHealthDetails `json:"healthDetails,omitempty"` - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ProtectedItemDataId *string `json:"protectedItemDataId,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - VirtualMachineId *string `json:"virtualMachineId,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureIaaSClassicComputeVMProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSClassicComputeVMProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureIaaSClassicComputeVMProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSClassicComputeVMProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureIaaSClassicComputeVMProtectedItem{} - -func (s AzureIaaSClassicComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureIaaSClassicComputeVMProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureIaaSClassicComputeVMProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureIaaSClassicComputeVMProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "Microsoft.ClassicCompute/virtualMachines" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureIaaSClassicComputeVMProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaascomputevmprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaascomputevmprotecteditem.go deleted file mode 100644 index 7959779c5bd..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaascomputevmprotecteditem.go +++ /dev/null @@ -1,93 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureIaaSComputeVMProtectedItem{} - -type AzureIaaSComputeVMProtectedItem struct { - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HealthDetails *[]ResourceHealthDetails `json:"healthDetails,omitempty"` - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ProtectedItemDataId *string `json:"protectedItemDataId,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - VirtualMachineId *string `json:"virtualMachineId,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureIaaSComputeVMProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSComputeVMProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureIaaSComputeVMProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSComputeVMProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureIaaSComputeVMProtectedItem{} - -func (s AzureIaaSComputeVMProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureIaaSComputeVMProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureIaaSComputeVMProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureIaaSComputeVMProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "Microsoft.Compute/virtualMachines" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureIaaSComputeVMProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditem.go deleted file mode 100644 index 4f2edc598dc..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditem.go +++ /dev/null @@ -1,93 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureIaaSVMProtectedItem{} - -type AzureIaaSVMProtectedItem struct { - ExtendedInfo *AzureIaaSVMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ExtendedProperties *ExtendedProperties `json:"extendedProperties,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HealthDetails *[]ResourceHealthDetails `json:"healthDetails,omitempty"` - HealthStatus *HealthStatus `json:"healthStatus,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ProtectedItemDataId *string `json:"protectedItemDataId,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - VirtualMachineId *string `json:"virtualMachineId,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureIaaSVMProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureIaaSVMProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureIaaSVMProtectedItem{} - -func (s AzureIaaSVMProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureIaaSVMProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureIaaSVMProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureIaaSVMProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "AzureIaaSVMProtectedItem" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureIaaSVMProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditemextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditemextendedinfo.go deleted file mode 100644 index 910874ea47f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azureiaasvmprotecteditemextendedinfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package backupprotecteditemscrr - -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 AzureIaaSVMProtectedItemExtendedInfo struct { - OldestRecoveryPoint *string `json:"oldestRecoveryPoint,omitempty"` - PolicyInconsistent *bool `json:"policyInconsistent,omitempty"` - RecoveryPointCount *int64 `json:"recoveryPointCount,omitempty"` -} - -func (o *AzureIaaSVMProtectedItemExtendedInfo) GetOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMProtectedItemExtendedInfo) SetOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OldestRecoveryPoint = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditem.go deleted file mode 100644 index 73ab548f97e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditem.go +++ /dev/null @@ -1,84 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureSqlProtectedItem{} - -type AzureSqlProtectedItem struct { - ExtendedInfo *AzureSqlProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - ProtectedItemDataId *string `json:"protectedItemDataId,omitempty"` - ProtectionState *ProtectedItemState `json:"protectionState,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureSqlProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureSqlProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureSqlProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureSqlProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureSqlProtectedItem{} - -func (s AzureSqlProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureSqlProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureSqlProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureSqlProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "Microsoft.Sql/servers/databases" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureSqlProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditemextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditemextendedinfo.go deleted file mode 100644 index 3d095e4d81e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azuresqlprotecteditemextendedinfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package backupprotecteditemscrr - -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 AzureSqlProtectedItemExtendedInfo struct { - OldestRecoveryPoint *string `json:"oldestRecoveryPoint,omitempty"` - PolicyState *string `json:"policyState,omitempty"` - RecoveryPointCount *int64 `json:"recoveryPointCount,omitempty"` -} - -func (o *AzureSqlProtectedItemExtendedInfo) GetOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureSqlProtectedItemExtendedInfo) SetOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OldestRecoveryPoint = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditem.go deleted file mode 100644 index 6b366598c6f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditem.go +++ /dev/null @@ -1,94 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureVMWorkloadProtectedItem{} - -type AzureVMWorkloadProtectedItem struct { - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - LastBackupStatus *LastBackupStatus `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ParentName *string `json:"parentName,omitempty"` - ParentType *string `json:"parentType,omitempty"` - ProtectedItemDataSourceId *string `json:"protectedItemDataSourceId,omitempty"` - ProtectedItemHealthStatus *ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - ServerName *string `json:"serverName,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureVMWorkloadProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureVMWorkloadProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureVMWorkloadProtectedItem{} - -func (s AzureVMWorkloadProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureVMWorkloadProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureVMWorkloadProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureVMWorkloadProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "AzureVmWorkloadProtectedItem" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureVMWorkloadProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditemextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditemextendedinfo.go deleted file mode 100644 index ea104aac6ff..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadprotecteditemextendedinfo.go +++ /dev/null @@ -1,28 +0,0 @@ -package backupprotecteditemscrr - -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 AzureVMWorkloadProtectedItemExtendedInfo struct { - OldestRecoveryPoint *string `json:"oldestRecoveryPoint,omitempty"` - PolicyState *string `json:"policyState,omitempty"` - RecoveryPointCount *int64 `json:"recoveryPointCount,omitempty"` -} - -func (o *AzureVMWorkloadProtectedItemExtendedInfo) GetOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadProtectedItemExtendedInfo) SetOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OldestRecoveryPoint = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsapasedatabaseprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsapasedatabaseprotecteditem.go deleted file mode 100644 index 090c22080a4..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsapasedatabaseprotecteditem.go +++ /dev/null @@ -1,94 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureVMWorkloadSAPAseDatabaseProtectedItem{} - -type AzureVMWorkloadSAPAseDatabaseProtectedItem struct { - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - LastBackupStatus *LastBackupStatus `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ParentName *string `json:"parentName,omitempty"` - ParentType *string `json:"parentType,omitempty"` - ProtectedItemDataSourceId *string `json:"protectedItemDataSourceId,omitempty"` - ProtectedItemHealthStatus *ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - ServerName *string `json:"serverName,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureVMWorkloadSAPAseDatabaseProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadSAPAseDatabaseProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureVMWorkloadSAPAseDatabaseProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadSAPAseDatabaseProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureVMWorkloadSAPAseDatabaseProtectedItem{} - -func (s AzureVMWorkloadSAPAseDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureVMWorkloadSAPAseDatabaseProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureVMWorkloadSAPAseDatabaseProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureVMWorkloadSAPAseDatabaseProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "AzureVmWorkloadSAPAseDatabase" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureVMWorkloadSAPAseDatabaseProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsaphanadatabaseprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsaphanadatabaseprotecteditem.go deleted file mode 100644 index de35e2903d9..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsaphanadatabaseprotecteditem.go +++ /dev/null @@ -1,94 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureVMWorkloadSAPHanaDatabaseProtectedItem{} - -type AzureVMWorkloadSAPHanaDatabaseProtectedItem struct { - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - LastBackupStatus *LastBackupStatus `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ParentName *string `json:"parentName,omitempty"` - ParentType *string `json:"parentType,omitempty"` - ProtectedItemDataSourceId *string `json:"protectedItemDataSourceId,omitempty"` - ProtectedItemHealthStatus *ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - ServerName *string `json:"serverName,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureVMWorkloadSAPHanaDatabaseProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadSAPHanaDatabaseProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureVMWorkloadSAPHanaDatabaseProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadSAPHanaDatabaseProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureVMWorkloadSAPHanaDatabaseProtectedItem{} - -func (s AzureVMWorkloadSAPHanaDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureVMWorkloadSAPHanaDatabaseProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureVMWorkloadSAPHanaDatabaseProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureVMWorkloadSAPHanaDatabaseProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "AzureVmWorkloadSAPHanaDatabase" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureVMWorkloadSAPHanaDatabaseProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsqldatabaseprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsqldatabaseprotecteditem.go deleted file mode 100644 index 80a8d5bb97e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_azurevmworkloadsqldatabaseprotecteditem.go +++ /dev/null @@ -1,94 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = AzureVMWorkloadSQLDatabaseProtectedItem{} - -type AzureVMWorkloadSQLDatabaseProtectedItem struct { - ExtendedInfo *AzureVMWorkloadProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KpisHealths *map[string]KPIResourceHealthDetails `json:"kpisHealths,omitempty"` - LastBackupErrorDetail *ErrorDetail `json:"lastBackupErrorDetail,omitempty"` - LastBackupStatus *LastBackupStatus `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ParentName *string `json:"parentName,omitempty"` - ParentType *string `json:"parentType,omitempty"` - ProtectedItemDataSourceId *string `json:"protectedItemDataSourceId,omitempty"` - ProtectedItemHealthStatus *ProtectedItemHealthStatus `json:"protectedItemHealthStatus,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - ProtectionStatus *string `json:"protectionStatus,omitempty"` - ServerName *string `json:"serverName,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *AzureVMWorkloadSQLDatabaseProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadSQLDatabaseProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *AzureVMWorkloadSQLDatabaseProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureVMWorkloadSQLDatabaseProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = AzureVMWorkloadSQLDatabaseProtectedItem{} - -func (s AzureVMWorkloadSQLDatabaseProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper AzureVMWorkloadSQLDatabaseProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureVMWorkloadSQLDatabaseProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureVMWorkloadSQLDatabaseProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "AzureVmWorkloadSQLDatabase" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureVMWorkloadSQLDatabaseProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_diskexclusionproperties.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_diskexclusionproperties.go deleted file mode 100644 index e1ebdca7b4c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_diskexclusionproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupprotecteditemscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskExclusionProperties struct { - DiskLunList *[]int64 `json:"diskLunList,omitempty"` - IsInclusionList *bool `json:"isInclusionList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditem.go deleted file mode 100644 index a76cf6e1a60..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditem.go +++ /dev/null @@ -1,85 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = DPMProtectedItem{} - -type DPMProtectedItem struct { - BackupEngineName *string `json:"backupEngineName,omitempty"` - ExtendedInfo *DPMProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ProtectionState *ProtectedItemState `json:"protectionState,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *DPMProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *DPMProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *DPMProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *DPMProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = DPMProtectedItem{} - -func (s DPMProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper DPMProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DPMProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DPMProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "DPMProtectedItem" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DPMProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditemextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditemextendedinfo.go deleted file mode 100644 index 49661b4da73..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_dpmprotecteditemextendedinfo.go +++ /dev/null @@ -1,75 +0,0 @@ -package backupprotecteditemscrr - -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 DPMProtectedItemExtendedInfo struct { - DiskStorageUsedInBytes *string `json:"diskStorageUsedInBytes,omitempty"` - IsCollocated *bool `json:"isCollocated,omitempty"` - IsPresentOnCloud *bool `json:"isPresentOnCloud,omitempty"` - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - LastRefreshedAt *string `json:"lastRefreshedAt,omitempty"` - OldestRecoveryPoint *string `json:"oldestRecoveryPoint,omitempty"` - OnPremiseLatestRecoveryPoint *string `json:"onPremiseLatestRecoveryPoint,omitempty"` - OnPremiseOldestRecoveryPoint *string `json:"onPremiseOldestRecoveryPoint,omitempty"` - OnPremiseRecoveryPointCount *int64 `json:"onPremiseRecoveryPointCount,omitempty"` - ProtectableObjectLoadPath *map[string]string `json:"protectableObjectLoadPath,omitempty"` - Protected *bool `json:"protected,omitempty"` - ProtectionGroupName *string `json:"protectionGroupName,omitempty"` - RecoveryPointCount *int64 `json:"recoveryPointCount,omitempty"` - TotalDiskStorageSizeInBytes *string `json:"totalDiskStorageSizeInBytes,omitempty"` -} - -func (o *DPMProtectedItemExtendedInfo) GetLastRefreshedAtAsTime() (*time.Time, error) { - if o.LastRefreshedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRefreshedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *DPMProtectedItemExtendedInfo) SetLastRefreshedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRefreshedAt = &formatted -} - -func (o *DPMProtectedItemExtendedInfo) GetOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *DPMProtectedItemExtendedInfo) SetOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OldestRecoveryPoint = &formatted -} - -func (o *DPMProtectedItemExtendedInfo) GetOnPremiseLatestRecoveryPointAsTime() (*time.Time, error) { - if o.OnPremiseLatestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OnPremiseLatestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *DPMProtectedItemExtendedInfo) SetOnPremiseLatestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OnPremiseLatestRecoveryPoint = &formatted -} - -func (o *DPMProtectedItemExtendedInfo) GetOnPremiseOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OnPremiseOldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OnPremiseOldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *DPMProtectedItemExtendedInfo) SetOnPremiseOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OnPremiseOldestRecoveryPoint = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_errordetail.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_errordetail.go deleted file mode 100644 index 71fc14c532c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_errordetail.go +++ /dev/null @@ -1,10 +0,0 @@ -package backupprotecteditemscrr - -// 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 { - Code *string `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_extendedproperties.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_extendedproperties.go deleted file mode 100644 index e177d81083c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_extendedproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package backupprotecteditemscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExtendedProperties struct { - DiskExclusionProperties *DiskExclusionProperties `json:"diskExclusionProperties,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_genericprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_genericprotecteditem.go deleted file mode 100644 index 63bd36f41ff..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_genericprotecteditem.go +++ /dev/null @@ -1,87 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = GenericProtectedItem{} - -type GenericProtectedItem struct { - FabricName *string `json:"fabricName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - PolicyState *string `json:"policyState,omitempty"` - ProtectedItemId *int64 `json:"protectedItemId,omitempty"` - ProtectionState *ProtectionState `json:"protectionState,omitempty"` - SourceAssociations *map[string]string `json:"sourceAssociations,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *GenericProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *GenericProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *GenericProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *GenericProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = GenericProtectedItem{} - -func (s GenericProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper GenericProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling GenericProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling GenericProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "GenericProtectedItem" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling GenericProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_kpiresourcehealthdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_kpiresourcehealthdetails.go deleted file mode 100644 index 69dd32a5819..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_kpiresourcehealthdetails.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupprotecteditemscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KPIResourceHealthDetails struct { - ResourceHealthDetails *[]ResourceHealthDetails `json:"resourceHealthDetails,omitempty"` - ResourceHealthStatus *ResourceHealthStatus `json:"resourceHealthStatus,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditem.go deleted file mode 100644 index 86c918bfc97..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditem.go +++ /dev/null @@ -1,88 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" - "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. - -var _ ProtectedItem = MabFileFolderProtectedItem{} - -type MabFileFolderProtectedItem struct { - ComputerName *string `json:"computerName,omitempty"` - DeferredDeleteSyncTimeInUTC *int64 `json:"deferredDeleteSyncTimeInUTC,omitempty"` - ExtendedInfo *MabFileFolderProtectedItemExtendedInfo `json:"extendedInfo,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - LastBackupStatus *string `json:"lastBackupStatus,omitempty"` - LastBackupTime *string `json:"lastBackupTime,omitempty"` - ProtectionState *string `json:"protectionState,omitempty"` - - // Fields inherited from ProtectedItem - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - BackupSetName *string `json:"backupSetName,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - CreateMode *CreateMode `json:"createMode,omitempty"` - DeferredDeleteTimeInUTC *string `json:"deferredDeleteTimeInUTC,omitempty"` - DeferredDeleteTimeRemaining *string `json:"deferredDeleteTimeRemaining,omitempty"` - IsDeferredDeleteScheduleUpcoming *bool `json:"isDeferredDeleteScheduleUpcoming,omitempty"` - IsRehydrate *bool `json:"isRehydrate,omitempty"` - IsScheduledForDeferredDelete *bool `json:"isScheduledForDeferredDelete,omitempty"` - LastRecoveryPoint *string `json:"lastRecoveryPoint,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - ResourceGuardOperationRequests *[]string `json:"resourceGuardOperationRequests,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - WorkloadType *DataSourceType `json:"workloadType,omitempty"` -} - -func (o *MabFileFolderProtectedItem) GetDeferredDeleteTimeInUTCAsTime() (*time.Time, error) { - if o.DeferredDeleteTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeferredDeleteTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabFileFolderProtectedItem) SetDeferredDeleteTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeferredDeleteTimeInUTC = &formatted -} - -func (o *MabFileFolderProtectedItem) GetLastRecoveryPointAsTime() (*time.Time, error) { - if o.LastRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabFileFolderProtectedItem) SetLastRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRecoveryPoint = &formatted -} - -var _ json.Marshaler = MabFileFolderProtectedItem{} - -func (s MabFileFolderProtectedItem) MarshalJSON() ([]byte, error) { - type wrapper MabFileFolderProtectedItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MabFileFolderProtectedItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MabFileFolderProtectedItem: %+v", err) - } - decoded["protectedItemType"] = "MabFileFolderProtectedItem" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MabFileFolderProtectedItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditemextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditemextendedinfo.go deleted file mode 100644 index 319b43e89d8..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_mabfilefolderprotecteditemextendedinfo.go +++ /dev/null @@ -1,40 +0,0 @@ -package backupprotecteditemscrr - -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 MabFileFolderProtectedItemExtendedInfo struct { - LastRefreshedAt *string `json:"lastRefreshedAt,omitempty"` - OldestRecoveryPoint *string `json:"oldestRecoveryPoint,omitempty"` - RecoveryPointCount *int64 `json:"recoveryPointCount,omitempty"` -} - -func (o *MabFileFolderProtectedItemExtendedInfo) GetLastRefreshedAtAsTime() (*time.Time, error) { - if o.LastRefreshedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastRefreshedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabFileFolderProtectedItemExtendedInfo) SetLastRefreshedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastRefreshedAt = &formatted -} - -func (o *MabFileFolderProtectedItemExtendedInfo) GetOldestRecoveryPointAsTime() (*time.Time, error) { - if o.OldestRecoveryPoint == nil { - return nil, nil - } - return dates.ParseAsFormat(o.OldestRecoveryPoint, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabFileFolderProtectedItemExtendedInfo) SetOldestRecoveryPointAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.OldestRecoveryPoint = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditem.go deleted file mode 100644 index 68f9dd43b9f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditem.go +++ /dev/null @@ -1,141 +0,0 @@ -package backupprotecteditemscrr - -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 ProtectedItem interface { -} - -// RawProtectedItemImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawProtectedItemImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalProtectedItemImplementation(input []byte) (ProtectedItem, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ProtectedItem into map[string]interface: %+v", err) - } - - value, ok := temp["protectedItemType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureFileShareProtectedItem") { - var out AzureFileshareProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureFileshareProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Microsoft.ClassicCompute/virtualMachines") { - var out AzureIaaSClassicComputeVMProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureIaaSClassicComputeVMProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Microsoft.Compute/virtualMachines") { - var out AzureIaaSComputeVMProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureIaaSComputeVMProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureIaaSVMProtectedItem") { - var out AzureIaaSVMProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureIaaSVMProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Microsoft.Sql/servers/databases") { - var out AzureSqlProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureSqlProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureVmWorkloadProtectedItem") { - var out AzureVMWorkloadProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureVMWorkloadProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureVmWorkloadSAPAseDatabase") { - var out AzureVMWorkloadSAPAseDatabaseProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureVMWorkloadSAPAseDatabaseProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureVmWorkloadSAPHanaDatabase") { - var out AzureVMWorkloadSAPHanaDatabaseProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureVMWorkloadSAPHanaDatabaseProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureVmWorkloadSQLDatabase") { - var out AzureVMWorkloadSQLDatabaseProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureVMWorkloadSQLDatabaseProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "DPMProtectedItem") { - var out DPMProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DPMProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "GenericProtectedItem") { - var out GenericProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into GenericProtectedItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MabFileFolderProtectedItem") { - var out MabFileFolderProtectedItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MabFileFolderProtectedItem: %+v", err) - } - return out, nil - } - - out := RawProtectedItemImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditemresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditemresource.go deleted file mode 100644 index 1538615d107..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_protecteditemresource.go +++ /dev/null @@ -1,50 +0,0 @@ -package backupprotecteditemscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProtectedItemResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties ProtectedItem `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &ProtectedItemResource{} - -func (s *ProtectedItemResource) UnmarshalJSON(bytes []byte) error { - type alias ProtectedItemResource - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into ProtectedItemResource: %+v", err) - } - - s.ETag = decoded.ETag - s.Id = decoded.Id - s.Location = decoded.Location - s.Name = decoded.Name - s.Tags = decoded.Tags - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling ProtectedItemResource into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalProtectedItemImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'ProtectedItemResource': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_resourcehealthdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_resourcehealthdetails.go deleted file mode 100644 index 90104c30537..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/model_resourcehealthdetails.go +++ /dev/null @@ -1,11 +0,0 @@ -package backupprotecteditemscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceHealthDetails struct { - Code *int64 `json:"code,omitempty"` - Message *string `json:"message,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/predicates.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/predicates.go deleted file mode 100644 index bdaa03f51d2..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package backupprotecteditemscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ProtectedItemResourceOperationPredicate struct { - ETag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p ProtectedItemResourceOperationPredicate) Matches(input ProtectedItemResource) 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 && (input.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/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/version.go deleted file mode 100644 index 8df6f410843..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package backupprotecteditemscrr - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/backupprotecteditemscrr/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/README.md deleted file mode 100644 index 0e0ecc4ca4e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/README.md +++ /dev/null @@ -1,78 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs` Documentation - -The `backupresourcestorageconfigs` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs" -``` - - -### Client Initialization - -```go -client := backupresourcestorageconfigs.NewBackupResourceStorageConfigsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BackupResourceStorageConfigsClient.Get` - -```go -ctx := context.TODO() -id := backupresourcestorageconfigs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -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: `BackupResourceStorageConfigsClient.Patch` - -```go -ctx := context.TODO() -id := backupresourcestorageconfigs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := backupresourcestorageconfigs.BackupResourceConfigResource{ - // ... -} - - -read, err := client.Patch(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `BackupResourceStorageConfigsClient.Update` - -```go -ctx := context.TODO() -id := backupresourcestorageconfigs.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -payload := backupresourcestorageconfigs.BackupResourceConfigResource{ - // ... -} - - -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/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/client.go deleted file mode 100644 index baaada475c6..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package backupresourcestorageconfigs - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupResourceStorageConfigsClient struct { - Client autorest.Client - baseUri string -} - -func NewBackupResourceStorageConfigsClientWithBaseURI(endpoint string) BackupResourceStorageConfigsClient { - return BackupResourceStorageConfigsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/constants.go deleted file mode 100644 index 00c02364801..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/constants.go +++ /dev/null @@ -1,74 +0,0 @@ -package backupresourcestorageconfigs - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type StorageType string - -const ( - StorageTypeGeoRedundant StorageType = "GeoRedundant" - StorageTypeInvalid StorageType = "Invalid" - StorageTypeLocallyRedundant StorageType = "LocallyRedundant" - StorageTypeReadAccessGeoZoneRedundant StorageType = "ReadAccessGeoZoneRedundant" - StorageTypeZoneRedundant StorageType = "ZoneRedundant" -) - -func PossibleValuesForStorageType() []string { - return []string{ - string(StorageTypeGeoRedundant), - string(StorageTypeInvalid), - string(StorageTypeLocallyRedundant), - string(StorageTypeReadAccessGeoZoneRedundant), - string(StorageTypeZoneRedundant), - } -} - -func parseStorageType(input string) (*StorageType, error) { - vals := map[string]StorageType{ - "georedundant": StorageTypeGeoRedundant, - "invalid": StorageTypeInvalid, - "locallyredundant": StorageTypeLocallyRedundant, - "readaccessgeozoneredundant": StorageTypeReadAccessGeoZoneRedundant, - "zoneredundant": StorageTypeZoneRedundant, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StorageType(input) - return &out, nil -} - -type StorageTypeState string - -const ( - StorageTypeStateInvalid StorageTypeState = "Invalid" - StorageTypeStateLocked StorageTypeState = "Locked" - StorageTypeStateUnlocked StorageTypeState = "Unlocked" -) - -func PossibleValuesForStorageTypeState() []string { - return []string{ - string(StorageTypeStateInvalid), - string(StorageTypeStateLocked), - string(StorageTypeStateUnlocked), - } -} - -func parseStorageTypeState(input string) (*StorageTypeState, error) { - vals := map[string]StorageTypeState{ - "invalid": StorageTypeStateInvalid, - "locked": StorageTypeStateLocked, - "unlocked": StorageTypeStateUnlocked, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := StorageTypeState(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault.go deleted file mode 100644 index 5e783889d36..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package backupresourcestorageconfigs - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault_test.go deleted file mode 100644 index 502e107b535..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package backupresourcestorageconfigs - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_get_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_get_autorest.go deleted file mode 100644 index 124f54f8857..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_get_autorest.go +++ /dev/null @@ -1,69 +0,0 @@ -package backupresourcestorageconfigs - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *BackupResourceConfigResource -} - -// Get ... -func (c BackupResourceStorageConfigsClient) Get(ctx context.Context, id VaultId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c BackupResourceStorageConfigsClient) preparerForGet(ctx context.Context, id VaultId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/backupStorageConfig/vaultStorageConfig", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c BackupResourceStorageConfigsClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_patch_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_patch_autorest.go deleted file mode 100644 index de0666e1b6d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_patch_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package backupresourcestorageconfigs - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PatchOperationResponse struct { - HttpResponse *http.Response -} - -// Patch ... -func (c BackupResourceStorageConfigsClient) Patch(ctx context.Context, id VaultId, input BackupResourceConfigResource) (result PatchOperationResponse, err error) { - req, err := c.preparerForPatch(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Patch", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Patch", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForPatch(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Patch", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForPatch prepares the Patch request. -func (c BackupResourceStorageConfigsClient) preparerForPatch(ctx context.Context, id VaultId, input BackupResourceConfigResource) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPatch(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/backupStorageConfig/vaultStorageConfig", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForPatch handles the response to the Patch request. The method always -// closes the http.Response Body. -func (c BackupResourceStorageConfigsClient) responderForPatch(resp *http.Response) (result PatchOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusNoContent), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_update_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_update_autorest.go deleted file mode 100644 index 48c4ce56513..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/method_update_autorest.go +++ /dev/null @@ -1,70 +0,0 @@ -package backupresourcestorageconfigs - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 { - HttpResponse *http.Response - Model *BackupResourceConfigResource -} - -// Update ... -func (c BackupResourceStorageConfigsClient) Update(ctx context.Context, id VaultId, input BackupResourceConfigResource) (result UpdateOperationResponse, err error) { - req, err := c.preparerForUpdate(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Update", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Update", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForUpdate(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupresourcestorageconfigs.BackupResourceStorageConfigsClient", "Update", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForUpdate prepares the Update request. -func (c BackupResourceStorageConfigsClient) preparerForUpdate(ctx context.Context, id VaultId, input BackupResourceConfigResource) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/backupStorageConfig/vaultStorageConfig", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForUpdate handles the response to the Update request. The method always -// closes the http.Response Body. -func (c BackupResourceStorageConfigsClient) responderForUpdate(resp *http.Response) (result UpdateOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfig.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfig.go deleted file mode 100644 index c17414c4736..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfig.go +++ /dev/null @@ -1,11 +0,0 @@ -package backupresourcestorageconfigs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupResourceConfig struct { - CrossRegionRestoreFlag *bool `json:"crossRegionRestoreFlag,omitempty"` - StorageModelType *StorageType `json:"storageModelType,omitempty"` - StorageType *StorageType `json:"storageType,omitempty"` - StorageTypeState *StorageTypeState `json:"storageTypeState,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfigresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfigresource.go deleted file mode 100644 index 0b143cfd6ca..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/model_backupresourceconfigresource.go +++ /dev/null @@ -1,14 +0,0 @@ -package backupresourcestorageconfigs - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupResourceConfigResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BackupResourceConfig `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/version.go deleted file mode 100644 index edd3926057f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package backupresourcestorageconfigs - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/backupresourcestorageconfigs/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/README.md deleted file mode 100644 index 5e6eaad7a89..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr` Documentation - -The `backupusagesummariescrr` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/backupusagesummariescrr" -``` - - -### Client Initialization - -```go -client := backupusagesummariescrr.NewBackupUsageSummariesCRRClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BackupUsageSummariesCRRClient.List` - -```go -ctx := context.TODO() -id := backupusagesummariescrr.NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - -read, err := client.List(ctx, id, backupusagesummariescrr.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/client.go deleted file mode 100644 index 67bd6386b41..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package backupusagesummariescrr - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupUsageSummariesCRRClient struct { - Client autorest.Client - baseUri string -} - -func NewBackupUsageSummariesCRRClientWithBaseURI(endpoint string) BackupUsageSummariesCRRClient { - return BackupUsageSummariesCRRClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/constants.go deleted file mode 100644 index 9f4e8f50013..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/constants.go +++ /dev/null @@ -1,46 +0,0 @@ -package backupusagesummariescrr - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UsagesUnit string - -const ( - UsagesUnitBytes UsagesUnit = "Bytes" - UsagesUnitBytesPerSecond UsagesUnit = "BytesPerSecond" - UsagesUnitCount UsagesUnit = "Count" - UsagesUnitCountPerSecond UsagesUnit = "CountPerSecond" - UsagesUnitPercent UsagesUnit = "Percent" - UsagesUnitSeconds UsagesUnit = "Seconds" -) - -func PossibleValuesForUsagesUnit() []string { - return []string{ - string(UsagesUnitBytes), - string(UsagesUnitBytesPerSecond), - string(UsagesUnitCount), - string(UsagesUnitCountPerSecond), - string(UsagesUnitPercent), - string(UsagesUnitSeconds), - } -} - -func parseUsagesUnit(input string) (*UsagesUnit, error) { - vals := map[string]UsagesUnit{ - "bytes": UsagesUnitBytes, - "bytespersecond": UsagesUnitBytesPerSecond, - "count": UsagesUnitCount, - "countpersecond": UsagesUnitCountPerSecond, - "percent": UsagesUnitPercent, - "seconds": UsagesUnitSeconds, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UsagesUnit(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault.go deleted file mode 100644 index a2502fe109c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault.go +++ /dev/null @@ -1,130 +0,0 @@ -package backupusagesummariescrr - -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(&VaultId{}) -} - -var _ resourceids.ResourceId = &VaultId{} - -// VaultId is a struct representing the Resource ID for a Vault -type VaultId struct { - SubscriptionId string - ResourceGroupName string - VaultName string -} - -// NewVaultID returns a new VaultId struct -func NewVaultID(subscriptionId string, resourceGroupName string, vaultName string) VaultId { - return VaultId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - } -} - -// ParseVaultID parses 'input' into a VaultId -func ParseVaultID(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseVaultIDInsensitively parses 'input' case-insensitively into a VaultId -// note: this method should only be used for API response data and not user input -func ParseVaultIDInsensitively(input string) (*VaultId, error) { - parser := resourceids.NewParserFromResourceIdType(&VaultId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := VaultId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *VaultId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - return nil -} - -// ValidateVaultID checks that 'input' can be parsed as a Vault ID -func ValidateVaultID(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 := ParseVaultID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Vault ID -func (id VaultId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Vault ID -func (id VaultId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - } -} - -// String returns a human-readable description of this Vault ID -func (id VaultId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - } - return fmt.Sprintf("Vault (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault_test.go deleted file mode 100644 index 3a0b03acc58..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/id_vault_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package backupusagesummariescrr - -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 = &VaultId{} - -func TestNewVaultID(t *testing.T) { - id := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } -} - -func TestFormatVaultID(t *testing.T) { - actual := NewVaultID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseVaultID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestParseVaultIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *VaultId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Expected: &VaultId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseVaultIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - } -} - -func TestSegmentsForVaultId(t *testing.T) { - segments := VaultId{}.Segments() - if len(segments) == 0 { - t.Fatalf("VaultId 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/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/method_list_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/method_list_autorest.go deleted file mode 100644 index 7f96cab7568..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/method_list_autorest.go +++ /dev/null @@ -1,98 +0,0 @@ -package backupusagesummariescrr - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *BackupManagementUsageList -} - -type ListOperationOptions struct { - Filter *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - return out -} - -// List ... -func (c BackupUsageSummariesCRRClient) List(ctx context.Context, id VaultId, options ListOperationOptions) (result ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "backupusagesummariescrr.BackupUsageSummariesCRRClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "backupusagesummariescrr.BackupUsageSummariesCRRClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "backupusagesummariescrr.BackupUsageSummariesCRRClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForList prepares the List request. -func (c BackupUsageSummariesCRRClient) preparerForList(ctx context.Context, id VaultId, options ListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/backupUsageSummaries", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c BackupUsageSummariesCRRClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusage.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusage.go deleted file mode 100644 index 2d44c1dea6a..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusage.go +++ /dev/null @@ -1,31 +0,0 @@ -package backupusagesummariescrr - -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 BackupManagementUsage struct { - CurrentValue *int64 `json:"currentValue,omitempty"` - Limit *int64 `json:"limit,omitempty"` - Name *NameInfo `json:"name,omitempty"` - NextResetTime *string `json:"nextResetTime,omitempty"` - QuotaPeriod *string `json:"quotaPeriod,omitempty"` - Unit *UsagesUnit `json:"unit,omitempty"` -} - -func (o *BackupManagementUsage) GetNextResetTimeAsTime() (*time.Time, error) { - if o.NextResetTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.NextResetTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BackupManagementUsage) SetNextResetTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.NextResetTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusagelist.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusagelist.go deleted file mode 100644 index 7c65f493393..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_backupmanagementusagelist.go +++ /dev/null @@ -1,8 +0,0 @@ -package backupusagesummariescrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupManagementUsageList struct { - Value *[]BackupManagementUsage `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_nameinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_nameinfo.go deleted file mode 100644 index 7c56faafcab..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/model_nameinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package backupusagesummariescrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NameInfo struct { - LocalizedValue *string `json:"localizedValue,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/version.go deleted file mode 100644 index 9d9fd48f596..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package backupusagesummariescrr - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/backupusagesummariescrr/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/client.go deleted file mode 100644 index ab05bacb0a9..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/client.go +++ /dev/null @@ -1,71 +0,0 @@ -package v2023_01_15 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -import ( - "github.com/Azure/go-autorest/autorest" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/aadproperties" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupcrrjobs" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupprotecteditemscrr" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupresourcestorageconfigs" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/backupusagesummariescrr" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr" - "github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken" -) - -type Client struct { - AadProperties *aadproperties.AadPropertiesClient - BackupCrrJobs *backupcrrjobs.BackupCrrJobsClient - BackupProtectedItemsCrr *backupprotecteditemscrr.BackupProtectedItemsCrrClient - BackupResourceStorageConfigs *backupresourcestorageconfigs.BackupResourceStorageConfigsClient - BackupUsageSummariesCRR *backupusagesummariescrr.BackupUsageSummariesCRRClient - CrossRegionRestore *crossregionrestore.CrossRegionRestoreClient - CrrJobDetails *crrjobdetails.CrrJobDetailsClient - RecoveryPointsCrr *recoverypointscrr.RecoveryPointsCrrClient - RecoveryPointsGetAccessToken *recoverypointsgetaccesstoken.RecoveryPointsGetAccessTokenClient -} - -func NewClientWithBaseURI(endpoint string, configureAuthFunc func(c *autorest.Client)) Client { - - aadPropertiesClient := aadproperties.NewAadPropertiesClientWithBaseURI(endpoint) - configureAuthFunc(&aadPropertiesClient.Client) - - backupCrrJobsClient := backupcrrjobs.NewBackupCrrJobsClientWithBaseURI(endpoint) - configureAuthFunc(&backupCrrJobsClient.Client) - - backupProtectedItemsCrrClient := backupprotecteditemscrr.NewBackupProtectedItemsCrrClientWithBaseURI(endpoint) - configureAuthFunc(&backupProtectedItemsCrrClient.Client) - - backupResourceStorageConfigsClient := backupresourcestorageconfigs.NewBackupResourceStorageConfigsClientWithBaseURI(endpoint) - configureAuthFunc(&backupResourceStorageConfigsClient.Client) - - backupUsageSummariesCRRClient := backupusagesummariescrr.NewBackupUsageSummariesCRRClientWithBaseURI(endpoint) - configureAuthFunc(&backupUsageSummariesCRRClient.Client) - - crossRegionRestoreClient := crossregionrestore.NewCrossRegionRestoreClientWithBaseURI(endpoint) - configureAuthFunc(&crossRegionRestoreClient.Client) - - crrJobDetailsClient := crrjobdetails.NewCrrJobDetailsClientWithBaseURI(endpoint) - configureAuthFunc(&crrJobDetailsClient.Client) - - recoveryPointsCrrClient := recoverypointscrr.NewRecoveryPointsCrrClientWithBaseURI(endpoint) - configureAuthFunc(&recoveryPointsCrrClient.Client) - - recoveryPointsGetAccessTokenClient := recoverypointsgetaccesstoken.NewRecoveryPointsGetAccessTokenClientWithBaseURI(endpoint) - configureAuthFunc(&recoveryPointsGetAccessTokenClient.Client) - - return Client{ - AadProperties: &aadPropertiesClient, - BackupCrrJobs: &backupCrrJobsClient, - BackupProtectedItemsCrr: &backupProtectedItemsCrrClient, - BackupResourceStorageConfigs: &backupResourceStorageConfigsClient, - BackupUsageSummariesCRR: &backupUsageSummariesCRRClient, - CrossRegionRestore: &crossRegionRestoreClient, - CrrJobDetails: &crrJobDetailsClient, - RecoveryPointsCrr: &recoveryPointsCrrClient, - RecoveryPointsGetAccessToken: &recoveryPointsGetAccessTokenClient, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/README.md deleted file mode 100644 index 24b6a126c18..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/README.md +++ /dev/null @@ -1,37 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore` Documentation - -The `crossregionrestore` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/crossregionrestore" -``` - - -### Client Initialization - -```go -client := crossregionrestore.NewCrossRegionRestoreClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CrossRegionRestoreClient.Trigger` - -```go -ctx := context.TODO() -id := crossregionrestore.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := crossregionrestore.CrossRegionRestoreRequest{ - // ... -} - - -if err := client.TriggerThenPoll(ctx, id, payload); err != nil { - // handle the error -} -``` diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/client.go deleted file mode 100644 index 4f9695a8753..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package crossregionrestore - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossRegionRestoreClient struct { - Client autorest.Client - baseUri string -} - -func NewCrossRegionRestoreClientWithBaseURI(endpoint string) CrossRegionRestoreClient { - return CrossRegionRestoreClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/constants.go deleted file mode 100644 index c31490f3d85..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/constants.go +++ /dev/null @@ -1,204 +0,0 @@ -package crossregionrestore - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CopyOptions string - -const ( - CopyOptionsCreateCopy CopyOptions = "CreateCopy" - CopyOptionsFailOnConflict CopyOptions = "FailOnConflict" - CopyOptionsInvalid CopyOptions = "Invalid" - CopyOptionsOverwrite CopyOptions = "Overwrite" - CopyOptionsSkip CopyOptions = "Skip" -) - -func PossibleValuesForCopyOptions() []string { - return []string{ - string(CopyOptionsCreateCopy), - string(CopyOptionsFailOnConflict), - string(CopyOptionsInvalid), - string(CopyOptionsOverwrite), - string(CopyOptionsSkip), - } -} - -func parseCopyOptions(input string) (*CopyOptions, error) { - vals := map[string]CopyOptions{ - "createcopy": CopyOptionsCreateCopy, - "failonconflict": CopyOptionsFailOnConflict, - "invalid": CopyOptionsInvalid, - "overwrite": CopyOptionsOverwrite, - "skip": CopyOptionsSkip, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CopyOptions(input) - return &out, nil -} - -type OverwriteOptions string - -const ( - OverwriteOptionsFailOnConflict OverwriteOptions = "FailOnConflict" - OverwriteOptionsInvalid OverwriteOptions = "Invalid" - OverwriteOptionsOverwrite OverwriteOptions = "Overwrite" -) - -func PossibleValuesForOverwriteOptions() []string { - return []string{ - string(OverwriteOptionsFailOnConflict), - string(OverwriteOptionsInvalid), - string(OverwriteOptionsOverwrite), - } -} - -func parseOverwriteOptions(input string) (*OverwriteOptions, error) { - vals := map[string]OverwriteOptions{ - "failonconflict": OverwriteOptionsFailOnConflict, - "invalid": OverwriteOptionsInvalid, - "overwrite": OverwriteOptionsOverwrite, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OverwriteOptions(input) - return &out, nil -} - -type RecoveryMode string - -const ( - RecoveryModeFileRecovery RecoveryMode = "FileRecovery" - RecoveryModeInvalid RecoveryMode = "Invalid" - RecoveryModeWorkloadRecovery RecoveryMode = "WorkloadRecovery" -) - -func PossibleValuesForRecoveryMode() []string { - return []string{ - string(RecoveryModeFileRecovery), - string(RecoveryModeInvalid), - string(RecoveryModeWorkloadRecovery), - } -} - -func parseRecoveryMode(input string) (*RecoveryMode, error) { - vals := map[string]RecoveryMode{ - "filerecovery": RecoveryModeFileRecovery, - "invalid": RecoveryModeInvalid, - "workloadrecovery": RecoveryModeWorkloadRecovery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecoveryMode(input) - return &out, nil -} - -type RecoveryType string - -const ( - RecoveryTypeAlternateLocation RecoveryType = "AlternateLocation" - RecoveryTypeInvalid RecoveryType = "Invalid" - RecoveryTypeOffline RecoveryType = "Offline" - RecoveryTypeOriginalLocation RecoveryType = "OriginalLocation" - RecoveryTypeRestoreDisks RecoveryType = "RestoreDisks" -) - -func PossibleValuesForRecoveryType() []string { - return []string{ - string(RecoveryTypeAlternateLocation), - string(RecoveryTypeInvalid), - string(RecoveryTypeOffline), - string(RecoveryTypeOriginalLocation), - string(RecoveryTypeRestoreDisks), - } -} - -func parseRecoveryType(input string) (*RecoveryType, error) { - vals := map[string]RecoveryType{ - "alternatelocation": RecoveryTypeAlternateLocation, - "invalid": RecoveryTypeInvalid, - "offline": RecoveryTypeOffline, - "originallocation": RecoveryTypeOriginalLocation, - "restoredisks": RecoveryTypeRestoreDisks, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecoveryType(input) - return &out, nil -} - -type RestoreRequestType string - -const ( - RestoreRequestTypeFullShareRestore RestoreRequestType = "FullShareRestore" - RestoreRequestTypeInvalid RestoreRequestType = "Invalid" - RestoreRequestTypeItemLevelRestore RestoreRequestType = "ItemLevelRestore" -) - -func PossibleValuesForRestoreRequestType() []string { - return []string{ - string(RestoreRequestTypeFullShareRestore), - string(RestoreRequestTypeInvalid), - string(RestoreRequestTypeItemLevelRestore), - } -} - -func parseRestoreRequestType(input string) (*RestoreRequestType, error) { - vals := map[string]RestoreRequestType{ - "fullsharerestore": RestoreRequestTypeFullShareRestore, - "invalid": RestoreRequestTypeInvalid, - "itemlevelrestore": RestoreRequestTypeItemLevelRestore, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RestoreRequestType(input) - return &out, nil -} - -type SQLDataDirectoryType string - -const ( - SQLDataDirectoryTypeData SQLDataDirectoryType = "Data" - SQLDataDirectoryTypeInvalid SQLDataDirectoryType = "Invalid" - SQLDataDirectoryTypeLog SQLDataDirectoryType = "Log" -) - -func PossibleValuesForSQLDataDirectoryType() []string { - return []string{ - string(SQLDataDirectoryTypeData), - string(SQLDataDirectoryTypeInvalid), - string(SQLDataDirectoryTypeLog), - } -} - -func parseSQLDataDirectoryType(input string) (*SQLDataDirectoryType, error) { - vals := map[string]SQLDataDirectoryType{ - "data": SQLDataDirectoryTypeData, - "invalid": SQLDataDirectoryTypeInvalid, - "log": SQLDataDirectoryTypeLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SQLDataDirectoryType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location.go deleted file mode 100644 index 18802751ab3..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package crossregionrestore - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location_test.go deleted file mode 100644 index 103e8aa78fe..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package crossregionrestore - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservicesbackup/2023-01-15/crossregionrestore/method_trigger_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/method_trigger_autorest.go deleted file mode 100644 index 48229fed69c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/method_trigger_autorest.go +++ /dev/null @@ -1,79 +0,0 @@ -package crossregionrestore - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" - "github.com/hashicorp/go-azure-helpers/polling" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TriggerOperationResponse struct { - Poller polling.LongRunningPoller - HttpResponse *http.Response -} - -// Trigger ... -func (c CrossRegionRestoreClient) Trigger(ctx context.Context, id LocationId, input CrossRegionRestoreRequest) (result TriggerOperationResponse, err error) { - req, err := c.preparerForTrigger(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "crossregionrestore.CrossRegionRestoreClient", "Trigger", nil, "Failure preparing request") - return - } - - result, err = c.senderForTrigger(ctx, req) - if err != nil { - err = autorest.NewErrorWithError(err, "crossregionrestore.CrossRegionRestoreClient", "Trigger", result.HttpResponse, "Failure sending request") - return - } - - return -} - -// TriggerThenPoll performs Trigger then polls until it's completed -func (c CrossRegionRestoreClient) TriggerThenPoll(ctx context.Context, id LocationId, input CrossRegionRestoreRequest) error { - result, err := c.Trigger(ctx, id, input) - if err != nil { - return fmt.Errorf("performing Trigger: %+v", err) - } - - if err := result.Poller.PollUntilDone(); err != nil { - return fmt.Errorf("polling after Trigger: %+v", err) - } - - return nil -} - -// preparerForTrigger prepares the Trigger request. -func (c CrossRegionRestoreClient) preparerForTrigger(ctx context.Context, id LocationId, input CrossRegionRestoreRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/backupCrossRegionRestore", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// senderForTrigger sends the Trigger request. The method will close the -// http.Response Body if it receives an error. -func (c CrossRegionRestoreClient) senderForTrigger(ctx context.Context, req *http.Request) (future TriggerOperationResponse, err error) { - var resp *http.Response - resp, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - return - } - - future.Poller, err = polling.NewPollerFromResponse(ctx, resp, c.Client, req.Method) - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azurefilesharerestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azurefilesharerestorerequest.go deleted file mode 100644 index 484d6c27379..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azurefilesharerestorerequest.go +++ /dev/null @@ -1,46 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureFileShareRestoreRequest{} - -type AzureFileShareRestoreRequest struct { - CopyOptions *CopyOptions `json:"copyOptions,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - RestoreFileSpecs *[]RestoreFileSpecs `json:"restoreFileSpecs,omitempty"` - RestoreRequestType *RestoreRequestType `json:"restoreRequestType,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetDetails *TargetAFSRestoreInfo `json:"targetDetails,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureFileShareRestoreRequest{} - -func (s AzureFileShareRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureFileShareRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureFileShareRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureFileShareRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureFileShareRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureFileShareRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadpointintimerestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadpointintimerestorerequest.go deleted file mode 100644 index 66bb11d2e71..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadpointintimerestorerequest.go +++ /dev/null @@ -1,47 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureWorkloadPointInTimeRestoreRequest{} - -type AzureWorkloadPointInTimeRestoreRequest struct { - PointInTime *string `json:"pointInTime,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - RecoveryMode *RecoveryMode `json:"recoveryMode,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureWorkloadPointInTimeRestoreRequest{} - -func (s AzureWorkloadPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadPointInTimeRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadPointInTimeRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadPointInTimeRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureWorkloadPointInTimeRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadPointInTimeRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadrestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadrestorerequest.go deleted file mode 100644 index dc77d8d7256..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadrestorerequest.go +++ /dev/null @@ -1,46 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureWorkloadRestoreRequest{} - -type AzureWorkloadRestoreRequest struct { - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - RecoveryMode *RecoveryMode `json:"recoveryMode,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureWorkloadRestoreRequest{} - -func (s AzureWorkloadRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureWorkloadRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanapointintimerestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanapointintimerestorerequest.go deleted file mode 100644 index 9efc75e0cf9..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanapointintimerestorerequest.go +++ /dev/null @@ -1,47 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureWorkloadSAPHanaPointInTimeRestoreRequest{} - -type AzureWorkloadSAPHanaPointInTimeRestoreRequest struct { - PointInTime *string `json:"pointInTime,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - RecoveryMode *RecoveryMode `json:"recoveryMode,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureWorkloadSAPHanaPointInTimeRestoreRequest{} - -func (s AzureWorkloadSAPHanaPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSAPHanaPointInTimeRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSAPHanaPointInTimeRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSAPHanaPointInTimeRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSAPHanaPointInTimeRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSAPHanaPointInTimeRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanarestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanarestorerequest.go deleted file mode 100644 index 0af85d6b41d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsaphanarestorerequest.go +++ /dev/null @@ -1,46 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureWorkloadSAPHanaRestoreRequest{} - -type AzureWorkloadSAPHanaRestoreRequest struct { - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - RecoveryMode *RecoveryMode `json:"recoveryMode,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureWorkloadSAPHanaRestoreRequest{} - -func (s AzureWorkloadSAPHanaRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSAPHanaRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSAPHanaRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSAPHanaRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSAPHanaRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSAPHanaRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlpointintimerestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlpointintimerestorerequest.go deleted file mode 100644 index 478cfbcac4a..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlpointintimerestorerequest.go +++ /dev/null @@ -1,50 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureWorkloadSQLPointInTimeRestoreRequest{} - -type AzureWorkloadSQLPointInTimeRestoreRequest struct { - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - PointInTime *string `json:"pointInTime,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - RecoveryMode *RecoveryMode `json:"recoveryMode,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureWorkloadSQLPointInTimeRestoreRequest{} - -func (s AzureWorkloadSQLPointInTimeRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSQLPointInTimeRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSQLPointInTimeRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSQLPointInTimeRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSQLPointInTimeRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSQLPointInTimeRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlrestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlrestorerequest.go deleted file mode 100644 index f8c1af7c80d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_azureworkloadsqlrestorerequest.go +++ /dev/null @@ -1,49 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RestoreRequest = AzureWorkloadSQLRestoreRequest{} - -type AzureWorkloadSQLRestoreRequest struct { - AlternateDirectoryPaths *[]SQLDataDirectoryMapping `json:"alternateDirectoryPaths,omitempty"` - IsNonRecoverable *bool `json:"isNonRecoverable,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - RecoveryMode *RecoveryMode `json:"recoveryMode,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - ShouldUseAlternateTargetLocation *bool `json:"shouldUseAlternateTargetLocation,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - TargetInfo *TargetRestoreInfo `json:"targetInfo,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = AzureWorkloadSQLRestoreRequest{} - -func (s AzureWorkloadSQLRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSQLRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSQLRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSQLRestoreRequest: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSQLRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSQLRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crossregionrestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crossregionrestorerequest.go deleted file mode 100644 index 70f5106fc2e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crossregionrestorerequest.go +++ /dev/null @@ -1,41 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrossRegionRestoreRequest struct { - CrossRegionRestoreAccessDetails CrrAccessToken `json:"crossRegionRestoreAccessDetails"` - RestoreRequest RestoreRequest `json:"restoreRequest"` -} - -var _ json.Unmarshaler = &CrossRegionRestoreRequest{} - -func (s *CrossRegionRestoreRequest) UnmarshalJSON(bytes []byte) error { - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling CrossRegionRestoreRequest into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["crossRegionRestoreAccessDetails"]; ok { - impl, err := unmarshalCrrAccessTokenImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'CrossRegionRestoreAccessDetails' for 'CrossRegionRestoreRequest': %+v", err) - } - s.CrossRegionRestoreAccessDetails = impl - } - - if v, ok := temp["restoreRequest"]; ok { - impl, err := unmarshalRestoreRequestImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'RestoreRequest' for 'CrossRegionRestoreRequest': %+v", err) - } - s.RestoreRequest = impl - } - return nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crraccesstoken.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crraccesstoken.go deleted file mode 100644 index a08b1cb5c5b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_crraccesstoken.go +++ /dev/null @@ -1,53 +0,0 @@ -package crossregionrestore - -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 CrrAccessToken interface { -} - -// RawCrrAccessTokenImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawCrrAccessTokenImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalCrrAccessTokenImplementation(input []byte) (CrrAccessToken, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling CrrAccessToken into map[string]interface: %+v", err) - } - - value, ok := temp["objectType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "WorkloadCrrAccessToken") { - var out WorkloadCrrAccessToken - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into WorkloadCrrAccessToken: %+v", err) - } - return out, nil - } - - out := RawCrrAccessTokenImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_encryptiondetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_encryptiondetails.go deleted file mode 100644 index 3c4bf4b815b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_encryptiondetails.go +++ /dev/null @@ -1,12 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EncryptionDetails struct { - EncryptionEnabled *bool `json:"encryptionEnabled,omitempty"` - KekUrl *string `json:"kekUrl,omitempty"` - KekVaultId *string `json:"kekVaultId,omitempty"` - SecretKeyUrl *string `json:"secretKeyUrl,omitempty"` - SecretKeyVaultId *string `json:"secretKeyVaultId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_iaasvmrestorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_iaasvmrestorerequest.go deleted file mode 100644 index 708c404549c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_iaasvmrestorerequest.go +++ /dev/null @@ -1,62 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" - - "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. - -var _ RestoreRequest = IaasVMRestoreRequest{} - -type IaasVMRestoreRequest struct { - AffinityGroup *string `json:"affinityGroup,omitempty"` - CreateNewCloudService *bool `json:"createNewCloudService,omitempty"` - DiskEncryptionSetId *string `json:"diskEncryptionSetId,omitempty"` - EncryptionDetails *EncryptionDetails `json:"encryptionDetails,omitempty"` - IdentityBasedRestoreDetails *IdentityBasedRestoreDetails `json:"identityBasedRestoreDetails,omitempty"` - IdentityInfo *IdentityInfo `json:"identityInfo,omitempty"` - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - RecoveryPointId *string `json:"recoveryPointId,omitempty"` - RecoveryType *RecoveryType `json:"recoveryType,omitempty"` - Region *string `json:"region,omitempty"` - RestoreDiskLunList *[]int64 `json:"restoreDiskLunList,omitempty"` - RestoreWithManagedDisks *bool `json:"restoreWithManagedDisks,omitempty"` - SourceResourceId *string `json:"sourceResourceId,omitempty"` - StorageAccountId *string `json:"storageAccountId,omitempty"` - SubnetId *string `json:"subnetId,omitempty"` - TargetDomainNameId *string `json:"targetDomainNameId,omitempty"` - TargetResourceGroupId *string `json:"targetResourceGroupId,omitempty"` - TargetVirtualMachineId *string `json:"targetVirtualMachineId,omitempty"` - VirtualNetworkId *string `json:"virtualNetworkId,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` - - // Fields inherited from RestoreRequest -} - -var _ json.Marshaler = IaasVMRestoreRequest{} - -func (s IaasVMRestoreRequest) MarshalJSON() ([]byte, error) { - type wrapper IaasVMRestoreRequest - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IaasVMRestoreRequest: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IaasVMRestoreRequest: %+v", err) - } - decoded["objectType"] = "IaasVMRestoreRequest" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IaasVMRestoreRequest: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identitybasedrestoredetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identitybasedrestoredetails.go deleted file mode 100644 index 995eb397b4f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identitybasedrestoredetails.go +++ /dev/null @@ -1,9 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IdentityBasedRestoreDetails struct { - ObjectType *string `json:"objectType,omitempty"` - TargetStorageAccountId *string `json:"targetStorageAccountId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identityinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identityinfo.go deleted file mode 100644 index b900199f1e4..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_identityinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IdentityInfo struct { - IsSystemAssignedIdentity *bool `json:"isSystemAssignedIdentity,omitempty"` - ManagedIdentityResourceId *string `json:"managedIdentityResourceId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorefilespecs.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorefilespecs.go deleted file mode 100644 index 399217f4e0f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorefilespecs.go +++ /dev/null @@ -1,10 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RestoreFileSpecs struct { - FileSpecType *string `json:"fileSpecType,omitempty"` - Path *string `json:"path,omitempty"` - TargetFolderPath *string `json:"targetFolderPath,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorerequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorerequest.go deleted file mode 100644 index 59239dbd500..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_restorerequest.go +++ /dev/null @@ -1,109 +0,0 @@ -package crossregionrestore - -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 RestoreRequest interface { -} - -// RawRestoreRequestImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawRestoreRequestImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalRestoreRequestImplementation(input []byte) (RestoreRequest, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling RestoreRequest into map[string]interface: %+v", err) - } - - value, ok := temp["objectType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureFileShareRestoreRequest") { - var out AzureFileShareRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureFileShareRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadPointInTimeRestoreRequest") { - var out AzureWorkloadPointInTimeRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadPointInTimeRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadRestoreRequest") { - var out AzureWorkloadRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSAPHanaPointInTimeRestoreRequest") { - var out AzureWorkloadSAPHanaPointInTimeRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSAPHanaPointInTimeRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSAPHanaRestoreRequest") { - var out AzureWorkloadSAPHanaRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSAPHanaRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSQLPointInTimeRestoreRequest") { - var out AzureWorkloadSQLPointInTimeRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSQLPointInTimeRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSQLRestoreRequest") { - var out AzureWorkloadSQLRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSQLRestoreRequest: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IaasVMRestoreRequest") { - var out IaasVMRestoreRequest - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IaasVMRestoreRequest: %+v", err) - } - return out, nil - } - - out := RawRestoreRequestImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_sqldatadirectorymapping.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_sqldatadirectorymapping.go deleted file mode 100644 index 94a1f65f173..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_sqldatadirectorymapping.go +++ /dev/null @@ -1,11 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SQLDataDirectoryMapping struct { - MappingType *SQLDataDirectoryType `json:"mappingType,omitempty"` - SourceLogicalName *string `json:"sourceLogicalName,omitempty"` - SourcePath *string `json:"sourcePath,omitempty"` - TargetPath *string `json:"targetPath,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetafsrestoreinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetafsrestoreinfo.go deleted file mode 100644 index 04e8799d4d3..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetafsrestoreinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TargetAFSRestoreInfo struct { - Name *string `json:"name,omitempty"` - TargetResourceId *string `json:"targetResourceId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetrestoreinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetrestoreinfo.go deleted file mode 100644 index d54707d9c25..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_targetrestoreinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package crossregionrestore - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TargetRestoreInfo struct { - ContainerId *string `json:"containerId,omitempty"` - DatabaseName *string `json:"databaseName,omitempty"` - OverwriteOption *OverwriteOptions `json:"overwriteOption,omitempty"` - TargetDirectoryForFileRestore *string `json:"targetDirectoryForFileRestore,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_workloadcrraccesstoken.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_workloadcrraccesstoken.go deleted file mode 100644 index c4463b32681..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/model_workloadcrraccesstoken.go +++ /dev/null @@ -1,74 +0,0 @@ -package crossregionrestore - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ CrrAccessToken = WorkloadCrrAccessToken{} - -type WorkloadCrrAccessToken struct { - ContainerId *string `json:"containerId,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - PolicyName *string `json:"policyName,omitempty"` - ProtectableObjectContainerHostOsName *string `json:"protectableObjectContainerHostOsName,omitempty"` - ProtectableObjectFriendlyName *string `json:"protectableObjectFriendlyName,omitempty"` - ProtectableObjectParentLogicalContainerName *string `json:"protectableObjectParentLogicalContainerName,omitempty"` - ProtectableObjectProtectionState *string `json:"protectableObjectProtectionState,omitempty"` - ProtectableObjectUniqueName *string `json:"protectableObjectUniqueName,omitempty"` - ProtectableObjectWorkloadType *string `json:"protectableObjectWorkloadType,omitempty"` - - // Fields inherited from CrrAccessToken - AccessTokenString *string `json:"accessTokenString,omitempty"` - BMSActiveRegion *string `json:"bMSActiveRegion,omitempty"` - BackupManagementType *string `json:"backupManagementType,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - ContainerType *string `json:"containerType,omitempty"` - CoordinatorServiceStampId *string `json:"coordinatorServiceStampId,omitempty"` - CoordinatorServiceStampUri *string `json:"coordinatorServiceStampUri,omitempty"` - DatasourceContainerName *string `json:"datasourceContainerName,omitempty"` - DatasourceId *string `json:"datasourceId,omitempty"` - DatasourceName *string `json:"datasourceName,omitempty"` - DatasourceType *string `json:"datasourceType,omitempty"` - ProtectionContainerId *int64 `json:"protectionContainerId,omitempty"` - ProtectionServiceStampId *string `json:"protectionServiceStampId,omitempty"` - ProtectionServiceStampUri *string `json:"protectionServiceStampUri,omitempty"` - RecoveryPointId *string `json:"recoveryPointId,omitempty"` - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - RpIsManagedVirtualMachine *bool `json:"rpIsManagedVirtualMachine,omitempty"` - RpOriginalSAOption *bool `json:"rpOriginalSAOption,omitempty"` - RpTierInformation *map[string]string `json:"rpTierInformation,omitempty"` - RpVMSizeDescription *string `json:"rpVMSizeDescription,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` - TokenExtendedInformation *string `json:"tokenExtendedInformation,omitempty"` -} - -var _ json.Marshaler = WorkloadCrrAccessToken{} - -func (s WorkloadCrrAccessToken) MarshalJSON() ([]byte, error) { - type wrapper WorkloadCrrAccessToken - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling WorkloadCrrAccessToken: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling WorkloadCrrAccessToken: %+v", err) - } - decoded["objectType"] = "WorkloadCrrAccessToken" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling WorkloadCrrAccessToken: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/version.go deleted file mode 100644 index 79be71c428e..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crossregionrestore/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package crossregionrestore - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/crossregionrestore/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/README.md deleted file mode 100644 index c7976e20c80..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails` Documentation - -The `crrjobdetails` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/crrjobdetails" -``` - - -### Client Initialization - -```go -client := crrjobdetails.NewCrrJobDetailsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CrrJobDetailsClient.BackupCrrJobDetailsGet` - -```go -ctx := context.TODO() -id := crrjobdetails.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -payload := crrjobdetails.CrrJobRequest{ - // ... -} - - -read, err := client.BackupCrrJobDetailsGet(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/recoveryservicesbackup/2023-01-15/crrjobdetails/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/client.go deleted file mode 100644 index 7d71d024ddf..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package crrjobdetails - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrrJobDetailsClient struct { - Client autorest.Client - baseUri string -} - -func NewCrrJobDetailsClientWithBaseURI(endpoint string) CrrJobDetailsClient { - return CrrJobDetailsClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/constants.go deleted file mode 100644 index 452baf319fc..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/constants.go +++ /dev/null @@ -1,220 +0,0 @@ -package crrjobdetails - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupManagementType string - -const ( - BackupManagementTypeAzureBackupServer BackupManagementType = "AzureBackupServer" - BackupManagementTypeAzureIaasVM BackupManagementType = "AzureIaasVM" - BackupManagementTypeAzureSql BackupManagementType = "AzureSql" - BackupManagementTypeAzureStorage BackupManagementType = "AzureStorage" - BackupManagementTypeAzureWorkload BackupManagementType = "AzureWorkload" - BackupManagementTypeDPM BackupManagementType = "DPM" - BackupManagementTypeDefaultBackup BackupManagementType = "DefaultBackup" - BackupManagementTypeInvalid BackupManagementType = "Invalid" - BackupManagementTypeMAB BackupManagementType = "MAB" -) - -func PossibleValuesForBackupManagementType() []string { - return []string{ - string(BackupManagementTypeAzureBackupServer), - string(BackupManagementTypeAzureIaasVM), - string(BackupManagementTypeAzureSql), - string(BackupManagementTypeAzureStorage), - string(BackupManagementTypeAzureWorkload), - string(BackupManagementTypeDPM), - string(BackupManagementTypeDefaultBackup), - string(BackupManagementTypeInvalid), - string(BackupManagementTypeMAB), - } -} - -func parseBackupManagementType(input string) (*BackupManagementType, error) { - vals := map[string]BackupManagementType{ - "azurebackupserver": BackupManagementTypeAzureBackupServer, - "azureiaasvm": BackupManagementTypeAzureIaasVM, - "azuresql": BackupManagementTypeAzureSql, - "azurestorage": BackupManagementTypeAzureStorage, - "azureworkload": BackupManagementTypeAzureWorkload, - "dpm": BackupManagementTypeDPM, - "defaultbackup": BackupManagementTypeDefaultBackup, - "invalid": BackupManagementTypeInvalid, - "mab": BackupManagementTypeMAB, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := BackupManagementType(input) - return &out, nil -} - -type JobSupportedAction string - -const ( - JobSupportedActionCancellable JobSupportedAction = "Cancellable" - JobSupportedActionInvalid JobSupportedAction = "Invalid" - JobSupportedActionRetriable JobSupportedAction = "Retriable" -) - -func PossibleValuesForJobSupportedAction() []string { - return []string{ - string(JobSupportedActionCancellable), - string(JobSupportedActionInvalid), - string(JobSupportedActionRetriable), - } -} - -func parseJobSupportedAction(input string) (*JobSupportedAction, error) { - vals := map[string]JobSupportedAction{ - "cancellable": JobSupportedActionCancellable, - "invalid": JobSupportedActionInvalid, - "retriable": JobSupportedActionRetriable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := JobSupportedAction(input) - return &out, nil -} - -type MabServerType string - -const ( - MabServerTypeAzureBackupServerContainer MabServerType = "AzureBackupServerContainer" - MabServerTypeAzureSqlContainer MabServerType = "AzureSqlContainer" - MabServerTypeCluster MabServerType = "Cluster" - MabServerTypeDPMContainer MabServerType = "DPMContainer" - MabServerTypeGenericContainer MabServerType = "GenericContainer" - MabServerTypeIaasVMContainer MabServerType = "IaasVMContainer" - MabServerTypeIaasVMServiceContainer MabServerType = "IaasVMServiceContainer" - MabServerTypeInvalid MabServerType = "Invalid" - MabServerTypeMABContainer MabServerType = "MABContainer" - MabServerTypeSQLAGWorkLoadContainer MabServerType = "SQLAGWorkLoadContainer" - MabServerTypeStorageContainer MabServerType = "StorageContainer" - MabServerTypeUnknown MabServerType = "Unknown" - MabServerTypeVCenter MabServerType = "VCenter" - MabServerTypeVMAppContainer MabServerType = "VMAppContainer" - MabServerTypeWindows MabServerType = "Windows" -) - -func PossibleValuesForMabServerType() []string { - return []string{ - string(MabServerTypeAzureBackupServerContainer), - string(MabServerTypeAzureSqlContainer), - string(MabServerTypeCluster), - string(MabServerTypeDPMContainer), - string(MabServerTypeGenericContainer), - string(MabServerTypeIaasVMContainer), - string(MabServerTypeIaasVMServiceContainer), - string(MabServerTypeInvalid), - string(MabServerTypeMABContainer), - string(MabServerTypeSQLAGWorkLoadContainer), - string(MabServerTypeStorageContainer), - string(MabServerTypeUnknown), - string(MabServerTypeVCenter), - string(MabServerTypeVMAppContainer), - string(MabServerTypeWindows), - } -} - -func parseMabServerType(input string) (*MabServerType, error) { - vals := map[string]MabServerType{ - "azurebackupservercontainer": MabServerTypeAzureBackupServerContainer, - "azuresqlcontainer": MabServerTypeAzureSqlContainer, - "cluster": MabServerTypeCluster, - "dpmcontainer": MabServerTypeDPMContainer, - "genericcontainer": MabServerTypeGenericContainer, - "iaasvmcontainer": MabServerTypeIaasVMContainer, - "iaasvmservicecontainer": MabServerTypeIaasVMServiceContainer, - "invalid": MabServerTypeInvalid, - "mabcontainer": MabServerTypeMABContainer, - "sqlagworkloadcontainer": MabServerTypeSQLAGWorkLoadContainer, - "storagecontainer": MabServerTypeStorageContainer, - "unknown": MabServerTypeUnknown, - "vcenter": MabServerTypeVCenter, - "vmappcontainer": MabServerTypeVMAppContainer, - "windows": MabServerTypeWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MabServerType(input) - return &out, nil -} - -type WorkloadType string - -const ( - WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare" - WorkloadTypeAzureSqlDb WorkloadType = "AzureSqlDb" - WorkloadTypeClient WorkloadType = "Client" - WorkloadTypeExchange WorkloadType = "Exchange" - WorkloadTypeFileFolder WorkloadType = "FileFolder" - WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource" - WorkloadTypeInvalid WorkloadType = "Invalid" - WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase" - WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase" - WorkloadTypeSQLDB WorkloadType = "SQLDB" - WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase" - WorkloadTypeSharepoint WorkloadType = "Sharepoint" - WorkloadTypeSystemState WorkloadType = "SystemState" - WorkloadTypeVM WorkloadType = "VM" - WorkloadTypeVMwareVM WorkloadType = "VMwareVM" -) - -func PossibleValuesForWorkloadType() []string { - return []string{ - string(WorkloadTypeAzureFileShare), - string(WorkloadTypeAzureSqlDb), - string(WorkloadTypeClient), - string(WorkloadTypeExchange), - string(WorkloadTypeFileFolder), - string(WorkloadTypeGenericDataSource), - string(WorkloadTypeInvalid), - string(WorkloadTypeSAPAseDatabase), - string(WorkloadTypeSAPHanaDatabase), - string(WorkloadTypeSQLDB), - string(WorkloadTypeSQLDataBase), - string(WorkloadTypeSharepoint), - string(WorkloadTypeSystemState), - string(WorkloadTypeVM), - string(WorkloadTypeVMwareVM), - } -} - -func parseWorkloadType(input string) (*WorkloadType, error) { - vals := map[string]WorkloadType{ - "azurefileshare": WorkloadTypeAzureFileShare, - "azuresqldb": WorkloadTypeAzureSqlDb, - "client": WorkloadTypeClient, - "exchange": WorkloadTypeExchange, - "filefolder": WorkloadTypeFileFolder, - "genericdatasource": WorkloadTypeGenericDataSource, - "invalid": WorkloadTypeInvalid, - "sapasedatabase": WorkloadTypeSAPAseDatabase, - "saphanadatabase": WorkloadTypeSAPHanaDatabase, - "sqldb": WorkloadTypeSQLDB, - "sqldatabase": WorkloadTypeSQLDataBase, - "sharepoint": WorkloadTypeSharepoint, - "systemstate": WorkloadTypeSystemState, - "vm": WorkloadTypeVM, - "vmwarevm": WorkloadTypeVMwareVM, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := WorkloadType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location.go deleted file mode 100644 index e597deedfa3..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package crrjobdetails - -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.RecoveryServices/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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location_test.go deleted file mode 100644 index 54785379ad7..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package crrjobdetails - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue" - 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.RecoveryServices/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/lOcAtIoNs/lOcAtIoNvAlUe/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/recoveryservicesbackup/2023-01-15/crrjobdetails/method_backupcrrjobdetailsget_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/method_backupcrrjobdetailsget_autorest.go deleted file mode 100644 index 71cf566317d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/method_backupcrrjobdetailsget_autorest.go +++ /dev/null @@ -1,70 +0,0 @@ -package crrjobdetails - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BackupCrrJobDetailsGetOperationResponse struct { - HttpResponse *http.Response - Model *JobResource -} - -// BackupCrrJobDetailsGet ... -func (c CrrJobDetailsClient) BackupCrrJobDetailsGet(ctx context.Context, id LocationId, input CrrJobRequest) (result BackupCrrJobDetailsGetOperationResponse, err error) { - req, err := c.preparerForBackupCrrJobDetailsGet(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "crrjobdetails.CrrJobDetailsClient", "BackupCrrJobDetailsGet", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "crrjobdetails.CrrJobDetailsClient", "BackupCrrJobDetailsGet", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForBackupCrrJobDetailsGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "crrjobdetails.CrrJobDetailsClient", "BackupCrrJobDetailsGet", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForBackupCrrJobDetailsGet prepares the BackupCrrJobDetailsGet request. -func (c CrrJobDetailsClient) preparerForBackupCrrJobDetailsGet(ctx context.Context, id LocationId, input CrrJobRequest) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/backupCrrJob", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForBackupCrrJobDetailsGet handles the response to the BackupCrrJobDetailsGet request. The method always -// closes the http.Response Body. -func (c CrrJobDetailsClient) responderForBackupCrrJobDetailsGet(resp *http.Response) (result BackupCrrJobDetailsGetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmerrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmerrorinfo.go deleted file mode 100644 index 5e216bfa4a7..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmerrorinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureIaaSVMErrorInfo struct { - ErrorCode *int64 `json:"errorCode,omitempty"` - ErrorString *string `json:"errorString,omitempty"` - ErrorTitle *string `json:"errorTitle,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjob.go deleted file mode 100644 index e1240a4e39f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjob.go +++ /dev/null @@ -1,79 +0,0 @@ -package crrjobdetails - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = AzureIaaSVMJob{} - -type AzureIaaSVMJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]AzureIaaSVMErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *AzureIaaSVMJobExtendedInfo `json:"extendedInfo,omitempty"` - VirtualMachineVersion *string `json:"virtualMachineVersion,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *AzureIaaSVMJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureIaaSVMJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = AzureIaaSVMJob{} - -func (s AzureIaaSVMJob) MarshalJSON() ([]byte, error) { - type wrapper AzureIaaSVMJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureIaaSVMJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureIaaSVMJob: %+v", err) - } - decoded["jobType"] = "AzureIaaSVMJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureIaaSVMJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobextendedinfo.go deleted file mode 100644 index e9354cd2e59..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobextendedinfo.go +++ /dev/null @@ -1,13 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureIaaSVMJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - EstimatedRemainingDuration *string `json:"estimatedRemainingDuration,omitempty"` - InternalPropertyBag *map[string]string `json:"internalPropertyBag,omitempty"` - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]AzureIaaSVMJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobtaskdetails.go deleted file mode 100644 index ed5339ba6a8..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureiaasvmjobtaskdetails.go +++ /dev/null @@ -1,45 +0,0 @@ -package crrjobdetails - -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 AzureIaaSVMJobTaskDetails struct { - Duration *string `json:"duration,omitempty"` - EndTime *string `json:"endTime,omitempty"` - InstanceId *string `json:"instanceId,omitempty"` - ProgressPercentage *float64 `json:"progressPercentage,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - TaskExecutionDetails *string `json:"taskExecutionDetails,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} - -func (o *AzureIaaSVMJobTaskDetails) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJobTaskDetails) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureIaaSVMJobTaskDetails) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureIaaSVMJobTaskDetails) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestorageerrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestorageerrorinfo.go deleted file mode 100644 index 301c27bb7ee..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestorageerrorinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureStorageErrorInfo struct { - ErrorCode *int64 `json:"errorCode,omitempty"` - ErrorString *string `json:"errorString,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejob.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejob.go deleted file mode 100644 index 0941617f47a..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejob.go +++ /dev/null @@ -1,80 +0,0 @@ -package crrjobdetails - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = AzureStorageJob{} - -type AzureStorageJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]AzureStorageErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *AzureStorageJobExtendedInfo `json:"extendedInfo,omitempty"` - StorageAccountName *string `json:"storageAccountName,omitempty"` - StorageAccountVersion *string `json:"storageAccountVersion,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *AzureStorageJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureStorageJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureStorageJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureStorageJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = AzureStorageJob{} - -func (s AzureStorageJob) MarshalJSON() ([]byte, error) { - type wrapper AzureStorageJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureStorageJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureStorageJob: %+v", err) - } - decoded["jobType"] = "AzureStorageJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureStorageJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobextendedinfo.go deleted file mode 100644 index 61a23deb767..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureStorageJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]AzureStorageJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobtaskdetails.go deleted file mode 100644 index 0ff7f78531c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azurestoragejobtaskdetails.go +++ /dev/null @@ -1,9 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureStorageJobTaskDetails struct { - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloaderrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloaderrorinfo.go deleted file mode 100644 index cab43bf3182..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloaderrorinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWorkloadErrorInfo struct { - AdditionalDetails *string `json:"additionalDetails,omitempty"` - ErrorCode *int64 `json:"errorCode,omitempty"` - ErrorString *string `json:"errorString,omitempty"` - ErrorTitle *string `json:"errorTitle,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjob.go deleted file mode 100644 index 48865ba191f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjob.go +++ /dev/null @@ -1,79 +0,0 @@ -package crrjobdetails - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = AzureWorkloadJob{} - -type AzureWorkloadJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]AzureWorkloadErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *AzureWorkloadJobExtendedInfo `json:"extendedInfo,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *AzureWorkloadJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureWorkloadJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *AzureWorkloadJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureWorkloadJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = AzureWorkloadJob{} - -func (s AzureWorkloadJob) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadJob: %+v", err) - } - decoded["jobType"] = "AzureWorkloadJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobextendedinfo.go deleted file mode 100644 index 8b975fc1208..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWorkloadJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]AzureWorkloadJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobtaskdetails.go deleted file mode 100644 index cca0da6a322..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_azureworkloadjobtaskdetails.go +++ /dev/null @@ -1,9 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureWorkloadJobTaskDetails struct { - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_crrjobrequest.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_crrjobrequest.go deleted file mode 100644 index 0473bcb9125..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_crrjobrequest.go +++ /dev/null @@ -1,9 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrrJobRequest struct { - JobName *string `json:"jobName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmerrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmerrorinfo.go deleted file mode 100644 index 7f7a57c7576..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmerrorinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DpmErrorInfo struct { - ErrorString *string `json:"errorString,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjob.go deleted file mode 100644 index bfd60bdd233..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjob.go +++ /dev/null @@ -1,82 +0,0 @@ -package crrjobdetails - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = DpmJob{} - -type DpmJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - ContainerType *string `json:"containerType,omitempty"` - DpmServerName *string `json:"dpmServerName,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]DpmErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *DpmJobExtendedInfo `json:"extendedInfo,omitempty"` - WorkloadType *string `json:"workloadType,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *DpmJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *DpmJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = DpmJob{} - -func (s DpmJob) MarshalJSON() ([]byte, error) { - type wrapper DpmJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DpmJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DpmJob: %+v", err) - } - decoded["jobType"] = "DpmJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DpmJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobextendedinfo.go deleted file mode 100644 index ba71758e4a7..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DpmJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]DpmJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobtaskdetails.go deleted file mode 100644 index 9a6ecee8805..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_dpmjobtaskdetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package crrjobdetails - -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 DpmJobTaskDetails struct { - Duration *string `json:"duration,omitempty"` - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} - -func (o *DpmJobTaskDetails) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJobTaskDetails) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *DpmJobTaskDetails) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *DpmJobTaskDetails) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_job.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_job.go deleted file mode 100644 index 5cccb47ef0b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_job.go +++ /dev/null @@ -1,85 +0,0 @@ -package crrjobdetails - -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 Job interface { -} - -// RawJobImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawJobImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalJobImplementation(input []byte) (Job, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Job into map[string]interface: %+v", err) - } - - value, ok := temp["jobType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureIaaSVMJob") { - var out AzureIaaSVMJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureIaaSVMJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureStorageJob") { - var out AzureStorageJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureStorageJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadJob") { - var out AzureWorkloadJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "DpmJob") { - var out DpmJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DpmJob: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MabJob") { - var out MabJob - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MabJob: %+v", err) - } - return out, nil - } - - out := RawJobImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_jobresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_jobresource.go deleted file mode 100644 index 6a6bd8c3622..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_jobresource.go +++ /dev/null @@ -1,50 +0,0 @@ -package crrjobdetails - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type JobResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties Job `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &JobResource{} - -func (s *JobResource) UnmarshalJSON(bytes []byte) error { - type alias JobResource - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into JobResource: %+v", err) - } - - s.ETag = decoded.ETag - s.Id = decoded.Id - s.Location = decoded.Location - s.Name = decoded.Name - s.Tags = decoded.Tags - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling JobResource into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalJobImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'JobResource': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_maberrorinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_maberrorinfo.go deleted file mode 100644 index c623dd79df4..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_maberrorinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MabErrorInfo struct { - ErrorString *string `json:"errorString,omitempty"` - Recommendations *[]string `json:"recommendations,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjob.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjob.go deleted file mode 100644 index 4932edfa3e1..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjob.go +++ /dev/null @@ -1,81 +0,0 @@ -package crrjobdetails - -import ( - "encoding/json" - "fmt" - "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. - -var _ Job = MabJob{} - -type MabJob struct { - ActionsInfo *[]JobSupportedAction `json:"actionsInfo,omitempty"` - Duration *string `json:"duration,omitempty"` - ErrorDetails *[]MabErrorInfo `json:"errorDetails,omitempty"` - ExtendedInfo *MabJobExtendedInfo `json:"extendedInfo,omitempty"` - MabServerName *string `json:"mabServerName,omitempty"` - MabServerType *MabServerType `json:"mabServerType,omitempty"` - WorkloadType *WorkloadType `json:"workloadType,omitempty"` - - // Fields inherited from Job - ActivityId *string `json:"activityId,omitempty"` - BackupManagementType *BackupManagementType `json:"backupManagementType,omitempty"` - EndTime *string `json:"endTime,omitempty"` - EntityFriendlyName *string `json:"entityFriendlyName,omitempty"` - Operation *string `json:"operation,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` -} - -func (o *MabJob) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJob) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *MabJob) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJob) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} - -var _ json.Marshaler = MabJob{} - -func (s MabJob) MarshalJSON() ([]byte, error) { - type wrapper MabJob - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MabJob: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MabJob: %+v", err) - } - decoded["jobType"] = "MabJob" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MabJob: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobextendedinfo.go deleted file mode 100644 index e1b65c13381..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobextendedinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package crrjobdetails - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MabJobExtendedInfo struct { - DynamicErrorMessage *string `json:"dynamicErrorMessage,omitempty"` - PropertyBag *map[string]string `json:"propertyBag,omitempty"` - TasksList *[]MabJobTaskDetails `json:"tasksList,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobtaskdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobtaskdetails.go deleted file mode 100644 index 3c58ebfca4d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/model_mabjobtaskdetails.go +++ /dev/null @@ -1,42 +0,0 @@ -package crrjobdetails - -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 MabJobTaskDetails struct { - Duration *string `json:"duration,omitempty"` - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` - Status *string `json:"status,omitempty"` - TaskId *string `json:"taskId,omitempty"` -} - -func (o *MabJobTaskDetails) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJobTaskDetails) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *MabJobTaskDetails) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MabJobTaskDetails) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/version.go deleted file mode 100644 index e9b3d1d1a95..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/crrjobdetails/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package crrjobdetails - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/crrjobdetails/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/README.md deleted file mode 100644 index e7dc4588ca1..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr` Documentation - -The `recoverypointscrr` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/recoverypointscrr" -``` - - -### Client Initialization - -```go -client := recoverypointscrr.NewRecoveryPointsCrrClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RecoveryPointsCrrClient.Get` - -```go -ctx := context.TODO() -id := recoverypointscrr.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue", "recoveryPointIdValue") - -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: `RecoveryPointsCrrClient.List` - -```go -ctx := context.TODO() -id := recoverypointscrr.NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue") - -// alternatively `client.List(ctx, id, recoverypointscrr.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, recoverypointscrr.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/client.go deleted file mode 100644 index 9afd4072351..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package recoverypointscrr - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointsCrrClient struct { - Client autorest.Client - baseUri string -} - -func NewRecoveryPointsCrrClientWithBaseURI(endpoint string) RecoveryPointsCrrClient { - return RecoveryPointsCrrClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/constants.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/constants.go deleted file mode 100644 index 73bfe65907d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -package recoverypointscrr - -import "strings" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointTierStatus string - -const ( - RecoveryPointTierStatusDeleted RecoveryPointTierStatus = "Deleted" - RecoveryPointTierStatusDisabled RecoveryPointTierStatus = "Disabled" - RecoveryPointTierStatusInvalid RecoveryPointTierStatus = "Invalid" - RecoveryPointTierStatusRehydrated RecoveryPointTierStatus = "Rehydrated" - RecoveryPointTierStatusValid RecoveryPointTierStatus = "Valid" -) - -func PossibleValuesForRecoveryPointTierStatus() []string { - return []string{ - string(RecoveryPointTierStatusDeleted), - string(RecoveryPointTierStatusDisabled), - string(RecoveryPointTierStatusInvalid), - string(RecoveryPointTierStatusRehydrated), - string(RecoveryPointTierStatusValid), - } -} - -func parseRecoveryPointTierStatus(input string) (*RecoveryPointTierStatus, error) { - vals := map[string]RecoveryPointTierStatus{ - "deleted": RecoveryPointTierStatusDeleted, - "disabled": RecoveryPointTierStatusDisabled, - "invalid": RecoveryPointTierStatusInvalid, - "rehydrated": RecoveryPointTierStatusRehydrated, - "valid": RecoveryPointTierStatusValid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecoveryPointTierStatus(input) - return &out, nil -} - -type RecoveryPointTierType string - -const ( - RecoveryPointTierTypeArchivedRP RecoveryPointTierType = "ArchivedRP" - RecoveryPointTierTypeHardenedRP RecoveryPointTierType = "HardenedRP" - RecoveryPointTierTypeInstantRP RecoveryPointTierType = "InstantRP" - RecoveryPointTierTypeInvalid RecoveryPointTierType = "Invalid" -) - -func PossibleValuesForRecoveryPointTierType() []string { - return []string{ - string(RecoveryPointTierTypeArchivedRP), - string(RecoveryPointTierTypeHardenedRP), - string(RecoveryPointTierTypeInstantRP), - string(RecoveryPointTierTypeInvalid), - } -} - -func parseRecoveryPointTierType(input string) (*RecoveryPointTierType, error) { - vals := map[string]RecoveryPointTierType{ - "archivedrp": RecoveryPointTierTypeArchivedRP, - "hardenedrp": RecoveryPointTierTypeHardenedRP, - "instantrp": RecoveryPointTierTypeInstantRP, - "invalid": RecoveryPointTierTypeInvalid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecoveryPointTierType(input) - return &out, nil -} - -type RestorePointType string - -const ( - RestorePointTypeDifferential RestorePointType = "Differential" - RestorePointTypeFull RestorePointType = "Full" - RestorePointTypeIncremental RestorePointType = "Incremental" - RestorePointTypeInvalid RestorePointType = "Invalid" - RestorePointTypeLog RestorePointType = "Log" -) - -func PossibleValuesForRestorePointType() []string { - return []string{ - string(RestorePointTypeDifferential), - string(RestorePointTypeFull), - string(RestorePointTypeIncremental), - string(RestorePointTypeInvalid), - string(RestorePointTypeLog), - } -} - -func parseRestorePointType(input string) (*RestorePointType, error) { - vals := map[string]RestorePointType{ - "differential": RestorePointTypeDifferential, - "full": RestorePointTypeFull, - "incremental": RestorePointTypeIncremental, - "invalid": RestorePointTypeInvalid, - "log": RestorePointTypeLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RestorePointType(input) - return &out, nil -} - -type SQLDataDirectoryType string - -const ( - SQLDataDirectoryTypeData SQLDataDirectoryType = "Data" - SQLDataDirectoryTypeInvalid SQLDataDirectoryType = "Invalid" - SQLDataDirectoryTypeLog SQLDataDirectoryType = "Log" -) - -func PossibleValuesForSQLDataDirectoryType() []string { - return []string{ - string(SQLDataDirectoryTypeData), - string(SQLDataDirectoryTypeInvalid), - string(SQLDataDirectoryTypeLog), - } -} - -func parseSQLDataDirectoryType(input string) (*SQLDataDirectoryType, error) { - vals := map[string]SQLDataDirectoryType{ - "data": SQLDataDirectoryTypeData, - "invalid": SQLDataDirectoryTypeInvalid, - "log": SQLDataDirectoryTypeLog, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SQLDataDirectoryType(input) - return &out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem.go deleted file mode 100644 index 2dcfd85e749..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem.go +++ /dev/null @@ -1,157 +0,0 @@ -package recoverypointscrr - -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(&ProtectedItemId{}) -} - -var _ resourceids.ResourceId = &ProtectedItemId{} - -// ProtectedItemId is a struct representing the Resource ID for a Protected Item -type ProtectedItemId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - BackupFabricName string - ProtectionContainerName string - ProtectedItemName string -} - -// NewProtectedItemID returns a new ProtectedItemId struct -func NewProtectedItemID(subscriptionId string, resourceGroupName string, vaultName string, backupFabricName string, protectionContainerName string, protectedItemName string) ProtectedItemId { - return ProtectedItemId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - BackupFabricName: backupFabricName, - ProtectionContainerName: protectionContainerName, - ProtectedItemName: protectedItemName, - } -} - -// ParseProtectedItemID parses 'input' into a ProtectedItemId -func ParseProtectedItemID(input string) (*ProtectedItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProtectedItemId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProtectedItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProtectedItemIDInsensitively parses 'input' case-insensitively into a ProtectedItemId -// note: this method should only be used for API response data and not user input -func ParseProtectedItemIDInsensitively(input string) (*ProtectedItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProtectedItemId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProtectedItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProtectedItemId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.BackupFabricName, ok = input.Parsed["backupFabricName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backupFabricName", input) - } - - if id.ProtectionContainerName, ok = input.Parsed["protectionContainerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "protectionContainerName", input) - } - - if id.ProtectedItemName, ok = input.Parsed["protectedItemName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "protectedItemName", input) - } - - return nil -} - -// ValidateProtectedItemID checks that 'input' can be parsed as a Protected Item ID -func ValidateProtectedItemID(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 := ParseProtectedItemID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Protected Item ID -func (id ProtectedItemId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/backupFabrics/%s/protectionContainers/%s/protectedItems/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.BackupFabricName, id.ProtectionContainerName, id.ProtectedItemName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Protected Item ID -func (id ProtectedItemId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricValue"), - resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerValue"), - resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), - resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemValue"), - } -} - -// String returns a human-readable description of this Protected Item ID -func (id ProtectedItemId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Backup Fabric Name: %q", id.BackupFabricName), - fmt.Sprintf("Protection Container Name: %q", id.ProtectionContainerName), - fmt.Sprintf("Protected Item Name: %q", id.ProtectedItemName), - } - return fmt.Sprintf("Protected Item (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem_test.go deleted file mode 100644 index f7739f1ceca..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_protecteditem_test.go +++ /dev/null @@ -1,417 +0,0 @@ -package recoverypointscrr - -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 = &ProtectedItemId{} - -func TestNewProtectedItemID(t *testing.T) { - id := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.BackupFabricName != "backupFabricValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricValue") - } - - if id.ProtectionContainerName != "protectionContainerValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerValue") - } - - if id.ProtectedItemName != "protectedItemValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectedItemName'", id.ProtectedItemName, "protectedItemValue") - } -} - -func TestFormatProtectedItemID(t *testing.T) { - actual := NewProtectedItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProtectedItemID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProtectedItemId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue", - Expected: &ProtectedItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - BackupFabricName: "backupFabricValue", - ProtectionContainerName: "protectionContainerValue", - ProtectedItemName: "protectedItemValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProtectedItemID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.BackupFabricName != v.Expected.BackupFabricName { - t.Fatalf("Expected %q but got %q for BackupFabricName", v.Expected.BackupFabricName, actual.BackupFabricName) - } - - if actual.ProtectionContainerName != v.Expected.ProtectionContainerName { - t.Fatalf("Expected %q but got %q for ProtectionContainerName", v.Expected.ProtectionContainerName, actual.ProtectionContainerName) - } - - if actual.ProtectedItemName != v.Expected.ProtectedItemName { - t.Fatalf("Expected %q but got %q for ProtectedItemName", v.Expected.ProtectedItemName, actual.ProtectedItemName) - } - - } -} - -func TestParseProtectedItemIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProtectedItemId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue", - Expected: &ProtectedItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - BackupFabricName: "backupFabricValue", - ProtectionContainerName: "protectionContainerValue", - ProtectedItemName: "protectedItemValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE", - Expected: &ProtectedItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - BackupFabricName: "bAcKuPfAbRiCvAlUe", - ProtectionContainerName: "pRoTeCtIoNcOnTaInErVaLuE", - ProtectedItemName: "pRoTeCtEdItEmVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProtectedItemIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.BackupFabricName != v.Expected.BackupFabricName { - t.Fatalf("Expected %q but got %q for BackupFabricName", v.Expected.BackupFabricName, actual.BackupFabricName) - } - - if actual.ProtectionContainerName != v.Expected.ProtectionContainerName { - t.Fatalf("Expected %q but got %q for ProtectionContainerName", v.Expected.ProtectionContainerName, actual.ProtectionContainerName) - } - - if actual.ProtectedItemName != v.Expected.ProtectedItemName { - t.Fatalf("Expected %q but got %q for ProtectedItemName", v.Expected.ProtectedItemName, actual.ProtectedItemName) - } - - } -} - -func TestSegmentsForProtectedItemId(t *testing.T) { - segments := ProtectedItemId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProtectedItemId 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/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint.go deleted file mode 100644 index 99d9df64358..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint.go +++ /dev/null @@ -1,166 +0,0 @@ -package recoverypointscrr - -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(&RecoveryPointId{}) -} - -var _ resourceids.ResourceId = &RecoveryPointId{} - -// RecoveryPointId is a struct representing the Resource ID for a Recovery Point -type RecoveryPointId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - BackupFabricName string - ProtectionContainerName string - ProtectedItemName string - RecoveryPointId string -} - -// NewRecoveryPointID returns a new RecoveryPointId struct -func NewRecoveryPointID(subscriptionId string, resourceGroupName string, vaultName string, backupFabricName string, protectionContainerName string, protectedItemName string, recoveryPointId string) RecoveryPointId { - return RecoveryPointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - BackupFabricName: backupFabricName, - ProtectionContainerName: protectionContainerName, - ProtectedItemName: protectedItemName, - RecoveryPointId: recoveryPointId, - } -} - -// ParseRecoveryPointID parses 'input' into a RecoveryPointId -func ParseRecoveryPointID(input string) (*RecoveryPointId, error) { - parser := resourceids.NewParserFromResourceIdType(&RecoveryPointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RecoveryPointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRecoveryPointIDInsensitively parses 'input' case-insensitively into a RecoveryPointId -// note: this method should only be used for API response data and not user input -func ParseRecoveryPointIDInsensitively(input string) (*RecoveryPointId, error) { - parser := resourceids.NewParserFromResourceIdType(&RecoveryPointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RecoveryPointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RecoveryPointId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.BackupFabricName, ok = input.Parsed["backupFabricName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backupFabricName", input) - } - - if id.ProtectionContainerName, ok = input.Parsed["protectionContainerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "protectionContainerName", input) - } - - if id.ProtectedItemName, ok = input.Parsed["protectedItemName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "protectedItemName", input) - } - - if id.RecoveryPointId, ok = input.Parsed["recoveryPointId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "recoveryPointId", input) - } - - return nil -} - -// ValidateRecoveryPointID checks that 'input' can be parsed as a Recovery Point ID -func ValidateRecoveryPointID(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 := ParseRecoveryPointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Recovery Point ID -func (id RecoveryPointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/backupFabrics/%s/protectionContainers/%s/protectedItems/%s/recoveryPoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.BackupFabricName, id.ProtectionContainerName, id.ProtectedItemName, id.RecoveryPointId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Recovery Point ID -func (id RecoveryPointId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricValue"), - resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerValue"), - resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), - resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemValue"), - resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), - resourceids.UserSpecifiedSegment("recoveryPointId", "recoveryPointIdValue"), - } -} - -// String returns a human-readable description of this Recovery Point ID -func (id RecoveryPointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Backup Fabric Name: %q", id.BackupFabricName), - fmt.Sprintf("Protection Container Name: %q", id.ProtectionContainerName), - fmt.Sprintf("Protected Item Name: %q", id.ProtectedItemName), - fmt.Sprintf("Recovery Point: %q", id.RecoveryPointId), - } - return fmt.Sprintf("Recovery Point (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint_test.go deleted file mode 100644 index 3a6491c536b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/id_recoverypoint_test.go +++ /dev/null @@ -1,462 +0,0 @@ -package recoverypointscrr - -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 = &RecoveryPointId{} - -func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue", "recoveryPointIdValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.BackupFabricName != "backupFabricValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricValue") - } - - if id.ProtectionContainerName != "protectionContainerValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerValue") - } - - if id.ProtectedItemName != "protectedItemValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectedItemName'", id.ProtectedItemName, "protectedItemValue") - } - - if id.RecoveryPointId != "recoveryPointIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RecoveryPointId'", id.RecoveryPointId, "recoveryPointIdValue") - } -} - -func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue", "recoveryPointIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRecoveryPointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RecoveryPointId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue", - Expected: &RecoveryPointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - BackupFabricName: "backupFabricValue", - ProtectionContainerName: "protectionContainerValue", - ProtectedItemName: "protectedItemValue", - RecoveryPointId: "recoveryPointIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRecoveryPointID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.BackupFabricName != v.Expected.BackupFabricName { - t.Fatalf("Expected %q but got %q for BackupFabricName", v.Expected.BackupFabricName, actual.BackupFabricName) - } - - if actual.ProtectionContainerName != v.Expected.ProtectionContainerName { - t.Fatalf("Expected %q but got %q for ProtectionContainerName", v.Expected.ProtectionContainerName, actual.ProtectionContainerName) - } - - if actual.ProtectedItemName != v.Expected.ProtectedItemName { - t.Fatalf("Expected %q but got %q for ProtectedItemName", v.Expected.ProtectedItemName, actual.ProtectedItemName) - } - - if actual.RecoveryPointId != v.Expected.RecoveryPointId { - t.Fatalf("Expected %q but got %q for RecoveryPointId", v.Expected.RecoveryPointId, actual.RecoveryPointId) - } - - } -} - -func TestParseRecoveryPointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RecoveryPointId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/rEcOvErYpOiNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue", - Expected: &RecoveryPointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - BackupFabricName: "backupFabricValue", - ProtectionContainerName: "protectionContainerValue", - ProtectedItemName: "protectedItemValue", - RecoveryPointId: "recoveryPointIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/rEcOvErYpOiNtS/rEcOvErYpOiNtIdVaLuE", - Expected: &RecoveryPointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - BackupFabricName: "bAcKuPfAbRiCvAlUe", - ProtectionContainerName: "pRoTeCtIoNcOnTaInErVaLuE", - ProtectedItemName: "pRoTeCtEdItEmVaLuE", - RecoveryPointId: "rEcOvErYpOiNtIdVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/rEcOvErYpOiNtS/rEcOvErYpOiNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRecoveryPointIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.BackupFabricName != v.Expected.BackupFabricName { - t.Fatalf("Expected %q but got %q for BackupFabricName", v.Expected.BackupFabricName, actual.BackupFabricName) - } - - if actual.ProtectionContainerName != v.Expected.ProtectionContainerName { - t.Fatalf("Expected %q but got %q for ProtectionContainerName", v.Expected.ProtectionContainerName, actual.ProtectionContainerName) - } - - if actual.ProtectedItemName != v.Expected.ProtectedItemName { - t.Fatalf("Expected %q but got %q for ProtectedItemName", v.Expected.ProtectedItemName, actual.ProtectedItemName) - } - - if actual.RecoveryPointId != v.Expected.RecoveryPointId { - t.Fatalf("Expected %q but got %q for RecoveryPointId", v.Expected.RecoveryPointId, actual.RecoveryPointId) - } - - } -} - -func TestSegmentsForRecoveryPointId(t *testing.T) { - segments := RecoveryPointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RecoveryPointId 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/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_get_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_get_autorest.go deleted file mode 100644 index 43b20239c95..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_get_autorest.go +++ /dev/null @@ -1,68 +0,0 @@ -package recoverypointscrr - -import ( - "context" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *RecoveryPointResource -} - -// Get ... -func (c RecoveryPointsCrrClient) Get(ctx context.Context, id RecoveryPointId) (result GetOperationResponse, err error) { - req, err := c.preparerForGet(ctx, id) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "Get", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "Get", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForGet(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "Get", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForGet prepares the Get request. -func (c RecoveryPointsCrrClient) preparerForGet(ctx context.Context, id RecoveryPointId) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(id.ID()), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForGet handles the response to the Get request. The method always -// closes the http.Response Body. -func (c RecoveryPointsCrrClient) responderForGet(resp *http.Response) (result GetOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_list_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_list_autorest.go deleted file mode 100644 index f2efaabe0a1..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/method_list_autorest.go +++ /dev/null @@ -1,215 +0,0 @@ -package recoverypointscrr - -import ( - "context" - "fmt" - "net/http" - "net/url" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// 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 - Model *[]RecoveryPointResource - - nextLink *string - nextPageFunc func(ctx context.Context, nextLink string) (ListOperationResponse, error) -} - -type ListCompleteResult struct { - Items []RecoveryPointResource -} - -func (r ListOperationResponse) HasMore() bool { - return r.nextLink != nil -} - -func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error) { - if !r.HasMore() { - err = fmt.Errorf("no more pages returned") - return - } - return r.nextPageFunc(ctx, *r.nextLink) -} - -type ListOperationOptions struct { - Filter *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) toHeaders() map[string]interface{} { - out := make(map[string]interface{}) - - return out -} - -func (o ListOperationOptions) toQueryString() map[string]interface{} { - out := make(map[string]interface{}) - - if o.Filter != nil { - out["$filter"] = *o.Filter - } - - return out -} - -// List ... -func (c RecoveryPointsCrrClient) List(ctx context.Context, id ProtectedItemId, options ListOperationOptions) (resp ListOperationResponse, err error) { - req, err := c.preparerForList(ctx, id, options) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "List", nil, "Failure preparing request") - return - } - - resp.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "List", resp.HttpResponse, "Failure sending request") - return - } - - resp, err = c.responderForList(resp.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "List", resp.HttpResponse, "Failure responding to request") - return - } - return -} - -// preparerForList prepares the List request. -func (c RecoveryPointsCrrClient) preparerForList(ctx context.Context, id ProtectedItemId, options ListOperationOptions) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - for k, v := range options.toQueryString() { - queryParameters[k] = autorest.Encode("query", v) - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithHeaders(options.toHeaders()), - autorest.WithPath(fmt.Sprintf("%s/recoveryPoints", id.ID())), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// preparerForListWithNextLink prepares the List request with the given nextLink token. -func (c RecoveryPointsCrrClient) preparerForListWithNextLink(ctx context.Context, nextLink string) (*http.Request, error) { - uri, err := url.Parse(nextLink) - if err != nil { - return nil, fmt.Errorf("parsing nextLink %q: %+v", nextLink, err) - } - queryParameters := map[string]interface{}{} - for k, v := range uri.Query() { - if len(v) == 0 { - continue - } - val := v[0] - val = autorest.Encode("query", val) - queryParameters[k] = val - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsGet(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(uri.Path), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForList handles the response to the List request. The method always -// closes the http.Response Body. -func (c RecoveryPointsCrrClient) responderForList(resp *http.Response) (result ListOperationResponse, err error) { - type page struct { - Values []RecoveryPointResource `json:"value"` - NextLink *string `json:"nextLink"` - } - var respObj page - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&respObj), - autorest.ByClosing()) - result.HttpResponse = resp - result.Model = &respObj.Values - result.nextLink = respObj.NextLink - if respObj.NextLink != nil { - result.nextPageFunc = func(ctx context.Context, nextLink string) (result ListOperationResponse, err error) { - req, err := c.preparerForListWithNextLink(ctx, nextLink) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "List", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "List", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForList(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointscrr.RecoveryPointsCrrClient", "List", result.HttpResponse, "Failure responding to request") - return - } - - return - } - } - return -} - -// ListComplete retrieves all of the results into a single object -func (c RecoveryPointsCrrClient) ListComplete(ctx context.Context, id ProtectedItemId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, RecoveryPointResourceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate -func (c RecoveryPointsCrrClient) ListCompleteMatchingPredicate(ctx context.Context, id ProtectedItemId, options ListOperationOptions, predicate RecoveryPointResourceOperationPredicate) (resp ListCompleteResult, err error) { - items := make([]RecoveryPointResource, 0) - - page, err := c.List(ctx, id, options) - if err != nil { - err = fmt.Errorf("loading the initial page: %+v", err) - return - } - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - - for page.HasMore() { - page, err = page.LoadMore(ctx) - if err != nil { - err = fmt.Errorf("loading the next page: %+v", err) - return - } - - if page.Model != nil { - for _, v := range *page.Model { - if predicate.Matches(v) { - items = append(items, v) - } - } - } - } - - out := ListCompleteResult{ - Items: items, - } - return out, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azurefilesharerecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azurefilesharerecoverypoint.go deleted file mode 100644 index 730507b138b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azurefilesharerecoverypoint.go +++ /dev/null @@ -1,45 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureFileShareRecoveryPoint{} - -type AzureFileShareRecoveryPoint struct { - FileShareSnapshotUri *string `json:"fileShareSnapshotUri,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointSizeInGB *int64 `json:"recoveryPointSizeInGB,omitempty"` - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureFileShareRecoveryPoint{} - -func (s AzureFileShareRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureFileShareRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureFileShareRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureFileShareRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureFileShareRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureFileShareRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadpointintimerecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadpointintimerecoverypoint.go deleted file mode 100644 index 32d826f990b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadpointintimerecoverypoint.go +++ /dev/null @@ -1,46 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureWorkloadPointInTimeRecoveryPoint{} - -type AzureWorkloadPointInTimeRecoveryPoint struct { - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTimeInUTC *string `json:"recoveryPointTimeInUTC,omitempty"` - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - Type *RestorePointType `json:"type,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureWorkloadPointInTimeRecoveryPoint{} - -func (s AzureWorkloadPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadPointInTimeRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadPointInTimeRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadPointInTimeRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureWorkloadPointInTimeRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadPointInTimeRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadrecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadrecoverypoint.go deleted file mode 100644 index e75c0f581ba..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadrecoverypoint.go +++ /dev/null @@ -1,45 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureWorkloadRecoveryPoint{} - -type AzureWorkloadRecoveryPoint struct { - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTimeInUTC *string `json:"recoveryPointTimeInUTC,omitempty"` - Type *RestorePointType `json:"type,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureWorkloadRecoveryPoint{} - -func (s AzureWorkloadRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureWorkloadRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanapointintimerecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanapointintimerecoverypoint.go deleted file mode 100644 index 58b32f6afb7..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanapointintimerecoverypoint.go +++ /dev/null @@ -1,46 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureWorkloadSAPHanaPointInTimeRecoveryPoint{} - -type AzureWorkloadSAPHanaPointInTimeRecoveryPoint struct { - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTimeInUTC *string `json:"recoveryPointTimeInUTC,omitempty"` - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - Type *RestorePointType `json:"type,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureWorkloadSAPHanaPointInTimeRecoveryPoint{} - -func (s AzureWorkloadSAPHanaPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSAPHanaPointInTimeRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSAPHanaPointInTimeRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSAPHanaPointInTimeRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSAPHanaPointInTimeRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSAPHanaPointInTimeRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanarecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanarecoverypoint.go deleted file mode 100644 index 26f8b90e016..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsaphanarecoverypoint.go +++ /dev/null @@ -1,45 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureWorkloadSAPHanaRecoveryPoint{} - -type AzureWorkloadSAPHanaRecoveryPoint struct { - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTimeInUTC *string `json:"recoveryPointTimeInUTC,omitempty"` - Type *RestorePointType `json:"type,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureWorkloadSAPHanaRecoveryPoint{} - -func (s AzureWorkloadSAPHanaRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSAPHanaRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSAPHanaRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSAPHanaRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSAPHanaRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSAPHanaRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlpointintimerecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlpointintimerecoverypoint.go deleted file mode 100644 index 3cc2507ca3b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlpointintimerecoverypoint.go +++ /dev/null @@ -1,47 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureWorkloadSQLPointInTimeRecoveryPoint{} - -type AzureWorkloadSQLPointInTimeRecoveryPoint struct { - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTimeInUTC *string `json:"recoveryPointTimeInUTC,omitempty"` - TimeRanges *[]PointInTimeRange `json:"timeRanges,omitempty"` - Type *RestorePointType `json:"type,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureWorkloadSQLPointInTimeRecoveryPoint{} - -func (s AzureWorkloadSQLPointInTimeRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSQLPointInTimeRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSQLPointInTimeRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSQLPointInTimeRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSQLPointInTimeRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSQLPointInTimeRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypoint.go deleted file mode 100644 index 5adf237239b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypoint.go +++ /dev/null @@ -1,46 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = AzureWorkloadSQLRecoveryPoint{} - -type AzureWorkloadSQLRecoveryPoint struct { - ExtendedInfo *AzureWorkloadSQLRecoveryPointExtendedInfo `json:"extendedInfo,omitempty"` - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTimeInUTC *string `json:"recoveryPointTimeInUTC,omitempty"` - Type *RestorePointType `json:"type,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = AzureWorkloadSQLRecoveryPoint{} - -func (s AzureWorkloadSQLRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper AzureWorkloadSQLRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureWorkloadSQLRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureWorkloadSQLRecoveryPoint: %+v", err) - } - decoded["objectType"] = "AzureWorkloadSQLRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureWorkloadSQLRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypointextendedinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypointextendedinfo.go deleted file mode 100644 index 0041482caec..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_azureworkloadsqlrecoverypointextendedinfo.go +++ /dev/null @@ -1,27 +0,0 @@ -package recoverypointscrr - -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 AzureWorkloadSQLRecoveryPointExtendedInfo struct { - DataDirectoryPaths *[]SQLDataDirectory `json:"dataDirectoryPaths,omitempty"` - DataDirectoryTimeInUTC *string `json:"dataDirectoryTimeInUTC,omitempty"` -} - -func (o *AzureWorkloadSQLRecoveryPointExtendedInfo) GetDataDirectoryTimeInUTCAsTime() (*time.Time, error) { - if o.DataDirectoryTimeInUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DataDirectoryTimeInUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *AzureWorkloadSQLRecoveryPointExtendedInfo) SetDataDirectoryTimeInUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DataDirectoryTimeInUTC = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_bekdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_bekdetails.go deleted file mode 100644 index b589510aa6a..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_bekdetails.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BEKDetails struct { - SecretData *string `json:"secretData,omitempty"` - SecretUrl *string `json:"secretUrl,omitempty"` - SecretVaultId *string `json:"secretVaultId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_diskinformation.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_diskinformation.go deleted file mode 100644 index 91f8b541e62..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_diskinformation.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DiskInformation struct { - Lun *int64 `json:"lun,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_genericrecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_genericrecoverypoint.go deleted file mode 100644 index 9b027f74bd2..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_genericrecoverypoint.go +++ /dev/null @@ -1,45 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ RecoveryPoint = GenericRecoveryPoint{} - -type GenericRecoveryPoint struct { - FriendlyName *string `json:"friendlyName,omitempty"` - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = GenericRecoveryPoint{} - -func (s GenericRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper GenericRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling GenericRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling GenericRecoveryPoint: %+v", err) - } - decoded["objectType"] = "GenericRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling GenericRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_iaasvmrecoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_iaasvmrecoverypoint.go deleted file mode 100644 index 2d97a72a94c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_iaasvmrecoverypoint.go +++ /dev/null @@ -1,58 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" - - "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. - -var _ RecoveryPoint = IaasVMRecoveryPoint{} - -type IaasVMRecoveryPoint struct { - IsInstantIlrSessionActive *bool `json:"isInstantIlrSessionActive,omitempty"` - IsManagedVirtualMachine *bool `json:"isManagedVirtualMachine,omitempty"` - IsSourceVMEncrypted *bool `json:"isSourceVMEncrypted,omitempty"` - KeyAndSecret *KeyAndSecretDetails `json:"keyAndSecret,omitempty"` - OriginalStorageAccountOption *bool `json:"originalStorageAccountOption,omitempty"` - OsType *string `json:"osType,omitempty"` - RecoveryPointAdditionalInfo *string `json:"recoveryPointAdditionalInfo,omitempty"` - RecoveryPointDiskConfiguration *RecoveryPointDiskConfiguration `json:"recoveryPointDiskConfiguration,omitempty"` - RecoveryPointMoveReadinessInfo *map[string]RecoveryPointMoveReadinessInfo `json:"recoveryPointMoveReadinessInfo,omitempty"` - RecoveryPointProperties *RecoveryPointProperties `json:"recoveryPointProperties,omitempty"` - RecoveryPointTierDetails *[]RecoveryPointTierInformation `json:"recoveryPointTierDetails,omitempty"` - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - RecoveryPointType *string `json:"recoveryPointType,omitempty"` - SourceVMStorageType *string `json:"sourceVMStorageType,omitempty"` - VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` - Zones *zones.Schema `json:"zones,omitempty"` - - // Fields inherited from RecoveryPoint -} - -var _ json.Marshaler = IaasVMRecoveryPoint{} - -func (s IaasVMRecoveryPoint) MarshalJSON() ([]byte, error) { - type wrapper IaasVMRecoveryPoint - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IaasVMRecoveryPoint: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IaasVMRecoveryPoint: %+v", err) - } - decoded["objectType"] = "IaasVMRecoveryPoint" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IaasVMRecoveryPoint: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_kekdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_kekdetails.go deleted file mode 100644 index 980ab17983c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_kekdetails.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KEKDetails struct { - KeyBackupData *string `json:"keyBackupData,omitempty"` - KeyUrl *string `json:"keyUrl,omitempty"` - KeyVaultId *string `json:"keyVaultId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_keyandsecretdetails.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_keyandsecretdetails.go deleted file mode 100644 index a591bf6e03d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_keyandsecretdetails.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type KeyAndSecretDetails struct { - BekDetails *BEKDetails `json:"bekDetails,omitempty"` - EncryptionMechanism *string `json:"encryptionMechanism,omitempty"` - KekDetails *KEKDetails `json:"kekDetails,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_pointintimerange.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_pointintimerange.go deleted file mode 100644 index 00a22c13b9f..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_pointintimerange.go +++ /dev/null @@ -1,39 +0,0 @@ -package recoverypointscrr - -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 PointInTimeRange struct { - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *PointInTimeRange) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PointInTimeRange) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *PointInTimeRange) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *PointInTimeRange) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypoint.go deleted file mode 100644 index 03c6a7c753d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypoint.go +++ /dev/null @@ -1,117 +0,0 @@ -package recoverypointscrr - -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 RecoveryPoint interface { -} - -// RawRecoveryPointImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawRecoveryPointImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalRecoveryPointImplementation(input []byte) (RecoveryPoint, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling RecoveryPoint into map[string]interface: %+v", err) - } - - value, ok := temp["objectType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureFileShareRecoveryPoint") { - var out AzureFileShareRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureFileShareRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadPointInTimeRecoveryPoint") { - var out AzureWorkloadPointInTimeRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadPointInTimeRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadRecoveryPoint") { - var out AzureWorkloadRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSAPHanaPointInTimeRecoveryPoint") { - var out AzureWorkloadSAPHanaPointInTimeRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSAPHanaPointInTimeRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSAPHanaRecoveryPoint") { - var out AzureWorkloadSAPHanaRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSAPHanaRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSQLPointInTimeRecoveryPoint") { - var out AzureWorkloadSQLPointInTimeRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSQLPointInTimeRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureWorkloadSQLRecoveryPoint") { - var out AzureWorkloadSQLRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureWorkloadSQLRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "GenericRecoveryPoint") { - var out GenericRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into GenericRecoveryPoint: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IaasVMRecoveryPoint") { - var out IaasVMRecoveryPoint - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IaasVMRecoveryPoint: %+v", err) - } - return out, nil - } - - out := RawRecoveryPointImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointdiskconfiguration.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointdiskconfiguration.go deleted file mode 100644 index 2ecbcc336b8..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointdiskconfiguration.go +++ /dev/null @@ -1,11 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointDiskConfiguration struct { - ExcludedDiskList *[]DiskInformation `json:"excludedDiskList,omitempty"` - IncludedDiskList *[]DiskInformation `json:"includedDiskList,omitempty"` - NumberOfDisksAttachedToVM *int64 `json:"numberOfDisksAttachedToVm,omitempty"` - NumberOfDisksIncludedInBackup *int64 `json:"numberOfDisksIncludedInBackup,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointmovereadinessinfo.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointmovereadinessinfo.go deleted file mode 100644 index 6c35e7f9ccc..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointmovereadinessinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointMoveReadinessInfo struct { - AdditionalInfo *string `json:"additionalInfo,omitempty"` - IsReadyForMove *bool `json:"isReadyForMove,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointproperties.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointproperties.go deleted file mode 100644 index 0eae51237e2..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointProperties struct { - ExpiryTime *string `json:"expiryTime,omitempty"` - IsSoftDeleted *bool `json:"isSoftDeleted,omitempty"` - RuleName *string `json:"ruleName,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointresource.go deleted file mode 100644 index a1db2070069..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointresource.go +++ /dev/null @@ -1,50 +0,0 @@ -package recoverypointscrr - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties RecoveryPoint `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &RecoveryPointResource{} - -func (s *RecoveryPointResource) UnmarshalJSON(bytes []byte) error { - type alias RecoveryPointResource - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into RecoveryPointResource: %+v", err) - } - - s.ETag = decoded.ETag - s.Id = decoded.Id - s.Location = decoded.Location - s.Name = decoded.Name - s.Tags = decoded.Tags - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling RecoveryPointResource into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalRecoveryPointImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'RecoveryPointResource': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointtierinformation.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointtierinformation.go deleted file mode 100644 index 1bfcf5d80af..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_recoverypointtierinformation.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointTierInformation struct { - ExtendedInfo *map[string]string `json:"extendedInfo,omitempty"` - Status *RecoveryPointTierStatus `json:"status,omitempty"` - Type *RecoveryPointTierType `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_sqldatadirectory.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_sqldatadirectory.go deleted file mode 100644 index 50db34fde22..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/model_sqldatadirectory.go +++ /dev/null @@ -1,10 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SQLDataDirectory struct { - LogicalName *string `json:"logicalName,omitempty"` - Path *string `json:"path,omitempty"` - Type *SQLDataDirectoryType `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/predicates.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/predicates.go deleted file mode 100644 index 5f0e3c9e9ac..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/predicates.go +++ /dev/null @@ -1,37 +0,0 @@ -package recoverypointscrr - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointResourceOperationPredicate struct { - ETag *string - Id *string - Location *string - Name *string - Type *string -} - -func (p RecoveryPointResourceOperationPredicate) Matches(input RecoveryPointResource) 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 && (input.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/recoveryservicesbackup/2023-01-15/recoverypointscrr/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/version.go deleted file mode 100644 index 43b06037c1c..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointscrr/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoverypointscrr - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/recoverypointscrr/%s", defaultApiVersion) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/README.md b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/README.md deleted file mode 100644 index e297490c65d..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken` Documentation - -The `recoverypointsgetaccesstoken` SDK allows for interaction with the Azure Resource Manager Service `recoveryservicesbackup` (API Version `2023-01-15`). - -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/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken" -``` - - -### Client Initialization - -```go -client := recoverypointsgetaccesstoken.NewRecoveryPointsGetAccessTokenClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RecoveryPointsGetAccessTokenClient.RecoveryPointsGetAccessToken` - -```go -ctx := context.TODO() -id := recoverypointsgetaccesstoken.NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue", "recoveryPointIdValue") - -payload := recoverypointsgetaccesstoken.AADPropertiesResource{ - // ... -} - - -read, err := client.RecoveryPointsGetAccessToken(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/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/client.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/client.go deleted file mode 100644 index 986d2b373ea..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/client.go +++ /dev/null @@ -1,18 +0,0 @@ -package recoverypointsgetaccesstoken - -import "github.com/Azure/go-autorest/autorest" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointsGetAccessTokenClient struct { - Client autorest.Client - baseUri string -} - -func NewRecoveryPointsGetAccessTokenClientWithBaseURI(endpoint string) RecoveryPointsGetAccessTokenClient { - return RecoveryPointsGetAccessTokenClient{ - Client: autorest.NewClientWithUserAgent(userAgent()), - baseUri: endpoint, - } -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint.go deleted file mode 100644 index 0b77df397dc..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint.go +++ /dev/null @@ -1,166 +0,0 @@ -package recoverypointsgetaccesstoken - -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(&RecoveryPointId{}) -} - -var _ resourceids.ResourceId = &RecoveryPointId{} - -// RecoveryPointId is a struct representing the Resource ID for a Recovery Point -type RecoveryPointId struct { - SubscriptionId string - ResourceGroupName string - VaultName string - BackupFabricName string - ProtectionContainerName string - ProtectedItemName string - RecoveryPointId string -} - -// NewRecoveryPointID returns a new RecoveryPointId struct -func NewRecoveryPointID(subscriptionId string, resourceGroupName string, vaultName string, backupFabricName string, protectionContainerName string, protectedItemName string, recoveryPointId string) RecoveryPointId { - return RecoveryPointId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - VaultName: vaultName, - BackupFabricName: backupFabricName, - ProtectionContainerName: protectionContainerName, - ProtectedItemName: protectedItemName, - RecoveryPointId: recoveryPointId, - } -} - -// ParseRecoveryPointID parses 'input' into a RecoveryPointId -func ParseRecoveryPointID(input string) (*RecoveryPointId, error) { - parser := resourceids.NewParserFromResourceIdType(&RecoveryPointId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RecoveryPointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRecoveryPointIDInsensitively parses 'input' case-insensitively into a RecoveryPointId -// note: this method should only be used for API response data and not user input -func ParseRecoveryPointIDInsensitively(input string) (*RecoveryPointId, error) { - parser := resourceids.NewParserFromResourceIdType(&RecoveryPointId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RecoveryPointId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RecoveryPointId) 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.VaultName, ok = input.Parsed["vaultName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "vaultName", input) - } - - if id.BackupFabricName, ok = input.Parsed["backupFabricName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "backupFabricName", input) - } - - if id.ProtectionContainerName, ok = input.Parsed["protectionContainerName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "protectionContainerName", input) - } - - if id.ProtectedItemName, ok = input.Parsed["protectedItemName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "protectedItemName", input) - } - - if id.RecoveryPointId, ok = input.Parsed["recoveryPointId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "recoveryPointId", input) - } - - return nil -} - -// ValidateRecoveryPointID checks that 'input' can be parsed as a Recovery Point ID -func ValidateRecoveryPointID(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 := ParseRecoveryPointID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Recovery Point ID -func (id RecoveryPointId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.RecoveryServices/vaults/%s/backupFabrics/%s/protectionContainers/%s/protectedItems/%s/recoveryPoints/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.VaultName, id.BackupFabricName, id.ProtectionContainerName, id.ProtectedItemName, id.RecoveryPointId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Recovery Point ID -func (id RecoveryPointId) 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("staticMicrosoftRecoveryServices", "Microsoft.RecoveryServices", "Microsoft.RecoveryServices"), - resourceids.StaticSegment("staticVaults", "vaults", "vaults"), - resourceids.UserSpecifiedSegment("vaultName", "vaultValue"), - resourceids.StaticSegment("staticBackupFabrics", "backupFabrics", "backupFabrics"), - resourceids.UserSpecifiedSegment("backupFabricName", "backupFabricValue"), - resourceids.StaticSegment("staticProtectionContainers", "protectionContainers", "protectionContainers"), - resourceids.UserSpecifiedSegment("protectionContainerName", "protectionContainerValue"), - resourceids.StaticSegment("staticProtectedItems", "protectedItems", "protectedItems"), - resourceids.UserSpecifiedSegment("protectedItemName", "protectedItemValue"), - resourceids.StaticSegment("staticRecoveryPoints", "recoveryPoints", "recoveryPoints"), - resourceids.UserSpecifiedSegment("recoveryPointId", "recoveryPointIdValue"), - } -} - -// String returns a human-readable description of this Recovery Point ID -func (id RecoveryPointId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Vault Name: %q", id.VaultName), - fmt.Sprintf("Backup Fabric Name: %q", id.BackupFabricName), - fmt.Sprintf("Protection Container Name: %q", id.ProtectionContainerName), - fmt.Sprintf("Protected Item Name: %q", id.ProtectedItemName), - fmt.Sprintf("Recovery Point: %q", id.RecoveryPointId), - } - return fmt.Sprintf("Recovery Point (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint_test.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint_test.go deleted file mode 100644 index 6f6a9bf9281..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/id_recoverypoint_test.go +++ /dev/null @@ -1,462 +0,0 @@ -package recoverypointsgetaccesstoken - -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 = &RecoveryPointId{} - -func TestNewRecoveryPointID(t *testing.T) { - id := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue", "recoveryPointIdValue") - - 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.VaultName != "vaultValue" { - t.Fatalf("Expected %q but got %q for Segment 'VaultName'", id.VaultName, "vaultValue") - } - - if id.BackupFabricName != "backupFabricValue" { - t.Fatalf("Expected %q but got %q for Segment 'BackupFabricName'", id.BackupFabricName, "backupFabricValue") - } - - if id.ProtectionContainerName != "protectionContainerValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectionContainerName'", id.ProtectionContainerName, "protectionContainerValue") - } - - if id.ProtectedItemName != "protectedItemValue" { - t.Fatalf("Expected %q but got %q for Segment 'ProtectedItemName'", id.ProtectedItemName, "protectedItemValue") - } - - if id.RecoveryPointId != "recoveryPointIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RecoveryPointId'", id.RecoveryPointId, "recoveryPointIdValue") - } -} - -func TestFormatRecoveryPointID(t *testing.T) { - actual := NewRecoveryPointID("12345678-1234-9876-4563-123456789012", "example-resource-group", "vaultValue", "backupFabricValue", "protectionContainerValue", "protectedItemValue", "recoveryPointIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRecoveryPointID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RecoveryPointId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue", - Expected: &RecoveryPointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - BackupFabricName: "backupFabricValue", - ProtectionContainerName: "protectionContainerValue", - ProtectedItemName: "protectedItemValue", - RecoveryPointId: "recoveryPointIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRecoveryPointID(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.BackupFabricName != v.Expected.BackupFabricName { - t.Fatalf("Expected %q but got %q for BackupFabricName", v.Expected.BackupFabricName, actual.BackupFabricName) - } - - if actual.ProtectionContainerName != v.Expected.ProtectionContainerName { - t.Fatalf("Expected %q but got %q for ProtectionContainerName", v.Expected.ProtectionContainerName, actual.ProtectionContainerName) - } - - if actual.ProtectedItemName != v.Expected.ProtectedItemName { - t.Fatalf("Expected %q but got %q for ProtectedItemName", v.Expected.ProtectedItemName, actual.ProtectedItemName) - } - - if actual.RecoveryPointId != v.Expected.RecoveryPointId { - t.Fatalf("Expected %q but got %q for RecoveryPointId", v.Expected.RecoveryPointId, actual.RecoveryPointId) - } - - } -} - -func TestParseRecoveryPointIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RecoveryPointId - }{ - { - // 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.RecoveryServices", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/rEcOvErYpOiNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue", - Expected: &RecoveryPointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - VaultName: "vaultValue", - BackupFabricName: "backupFabricValue", - ProtectionContainerName: "protectionContainerValue", - ProtectedItemName: "protectedItemValue", - RecoveryPointId: "recoveryPointIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.RecoveryServices/vaults/vaultValue/backupFabrics/backupFabricValue/protectionContainers/protectionContainerValue/protectedItems/protectedItemValue/recoveryPoints/recoveryPointIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/rEcOvErYpOiNtS/rEcOvErYpOiNtIdVaLuE", - Expected: &RecoveryPointId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - VaultName: "vAuLtVaLuE", - BackupFabricName: "bAcKuPfAbRiCvAlUe", - ProtectionContainerName: "pRoTeCtIoNcOnTaInErVaLuE", - ProtectedItemName: "pRoTeCtEdItEmVaLuE", - RecoveryPointId: "rEcOvErYpOiNtIdVaLuE", - }, - }, - { - // 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.rEcOvErYsErViCeS/vAuLtS/vAuLtVaLuE/bAcKuPfAbRiCs/bAcKuPfAbRiCvAlUe/pRoTeCtIoNcOnTaInErS/pRoTeCtIoNcOnTaInErVaLuE/pRoTeCtEdItEmS/pRoTeCtEdItEmVaLuE/rEcOvErYpOiNtS/rEcOvErYpOiNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRecoveryPointIDInsensitively(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.VaultName != v.Expected.VaultName { - t.Fatalf("Expected %q but got %q for VaultName", v.Expected.VaultName, actual.VaultName) - } - - if actual.BackupFabricName != v.Expected.BackupFabricName { - t.Fatalf("Expected %q but got %q for BackupFabricName", v.Expected.BackupFabricName, actual.BackupFabricName) - } - - if actual.ProtectionContainerName != v.Expected.ProtectionContainerName { - t.Fatalf("Expected %q but got %q for ProtectionContainerName", v.Expected.ProtectionContainerName, actual.ProtectionContainerName) - } - - if actual.ProtectedItemName != v.Expected.ProtectedItemName { - t.Fatalf("Expected %q but got %q for ProtectedItemName", v.Expected.ProtectedItemName, actual.ProtectedItemName) - } - - if actual.RecoveryPointId != v.Expected.RecoveryPointId { - t.Fatalf("Expected %q but got %q for RecoveryPointId", v.Expected.RecoveryPointId, actual.RecoveryPointId) - } - - } -} - -func TestSegmentsForRecoveryPointId(t *testing.T) { - segments := RecoveryPointId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RecoveryPointId 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/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/method_recoverypointsgetaccesstoken_autorest.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/method_recoverypointsgetaccesstoken_autorest.go deleted file mode 100644 index 4ae7e0f25be..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/method_recoverypointsgetaccesstoken_autorest.go +++ /dev/null @@ -1,70 +0,0 @@ -package recoverypointsgetaccesstoken - -import ( - "context" - "fmt" - "net/http" - - "github.com/Azure/go-autorest/autorest" - "github.com/Azure/go-autorest/autorest/azure" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecoveryPointsGetAccessTokenOperationResponse struct { - HttpResponse *http.Response - Model *CrrAccessTokenResource -} - -// RecoveryPointsGetAccessToken ... -func (c RecoveryPointsGetAccessTokenClient) RecoveryPointsGetAccessToken(ctx context.Context, id RecoveryPointId, input AADPropertiesResource) (result RecoveryPointsGetAccessTokenOperationResponse, err error) { - req, err := c.preparerForRecoveryPointsGetAccessToken(ctx, id, input) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointsgetaccesstoken.RecoveryPointsGetAccessTokenClient", "RecoveryPointsGetAccessToken", nil, "Failure preparing request") - return - } - - result.HttpResponse, err = c.Client.Send(req, azure.DoRetryWithRegistration(c.Client)) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointsgetaccesstoken.RecoveryPointsGetAccessTokenClient", "RecoveryPointsGetAccessToken", result.HttpResponse, "Failure sending request") - return - } - - result, err = c.responderForRecoveryPointsGetAccessToken(result.HttpResponse) - if err != nil { - err = autorest.NewErrorWithError(err, "recoverypointsgetaccesstoken.RecoveryPointsGetAccessTokenClient", "RecoveryPointsGetAccessToken", result.HttpResponse, "Failure responding to request") - return - } - - return -} - -// preparerForRecoveryPointsGetAccessToken prepares the RecoveryPointsGetAccessToken request. -func (c RecoveryPointsGetAccessTokenClient) preparerForRecoveryPointsGetAccessToken(ctx context.Context, id RecoveryPointId, input AADPropertiesResource) (*http.Request, error) { - queryParameters := map[string]interface{}{ - "api-version": defaultApiVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithBaseURL(c.baseUri), - autorest.WithPath(fmt.Sprintf("%s/accessToken", id.ID())), - autorest.WithJSON(input), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// responderForRecoveryPointsGetAccessToken handles the response to the RecoveryPointsGetAccessToken request. The method always -// closes the http.Response Body. -func (c RecoveryPointsGetAccessTokenClient) responderForRecoveryPointsGetAccessToken(resp *http.Response) (result RecoveryPointsGetAccessTokenOperationResponse, err error) { - err = autorest.Respond( - resp, - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Model), - autorest.ByClosing()) - result.HttpResponse = resp - - return -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadproperties.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadproperties.go deleted file mode 100644 index 201c0dfea1b..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoverypointsgetaccesstoken - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADProperties struct { - Audience *string `json:"audience,omitempty"` - Authority *string `json:"authority,omitempty"` - ServicePrincipalClientId *string `json:"servicePrincipalClientId,omitempty"` - ServicePrincipalObjectId *string `json:"servicePrincipalObjectId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadpropertiesresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadpropertiesresource.go deleted file mode 100644 index a337fda86e0..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_aadpropertiesresource.go +++ /dev/null @@ -1,14 +0,0 @@ -package recoverypointsgetaccesstoken - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADPropertiesResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AADProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstoken.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstoken.go deleted file mode 100644 index 197d86451ae..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstoken.go +++ /dev/null @@ -1,53 +0,0 @@ -package recoverypointsgetaccesstoken - -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 CrrAccessToken interface { -} - -// RawCrrAccessTokenImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawCrrAccessTokenImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalCrrAccessTokenImplementation(input []byte) (CrrAccessToken, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling CrrAccessToken into map[string]interface: %+v", err) - } - - value, ok := temp["objectType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "WorkloadCrrAccessToken") { - var out WorkloadCrrAccessToken - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into WorkloadCrrAccessToken: %+v", err) - } - return out, nil - } - - out := RawCrrAccessTokenImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstokenresource.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstokenresource.go deleted file mode 100644 index bff215e0aea..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_crraccesstokenresource.go +++ /dev/null @@ -1,50 +0,0 @@ -package recoverypointsgetaccesstoken - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CrrAccessTokenResource struct { - ETag *string `json:"eTag,omitempty"` - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties CrrAccessToken `json:"properties"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Unmarshaler = &CrrAccessTokenResource{} - -func (s *CrrAccessTokenResource) UnmarshalJSON(bytes []byte) error { - type alias CrrAccessTokenResource - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into CrrAccessTokenResource: %+v", err) - } - - s.ETag = decoded.ETag - s.Id = decoded.Id - s.Location = decoded.Location - s.Name = decoded.Name - s.Tags = decoded.Tags - s.Type = decoded.Type - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling CrrAccessTokenResource into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["properties"]; ok { - impl, err := unmarshalCrrAccessTokenImplementation(v) - if err != nil { - return fmt.Errorf("unmarshaling field 'Properties' for 'CrrAccessTokenResource': %+v", err) - } - s.Properties = impl - } - return nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_workloadcrraccesstoken.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_workloadcrraccesstoken.go deleted file mode 100644 index 3ef3a27a809..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/model_workloadcrraccesstoken.go +++ /dev/null @@ -1,74 +0,0 @@ -package recoverypointsgetaccesstoken - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ CrrAccessToken = WorkloadCrrAccessToken{} - -type WorkloadCrrAccessToken struct { - ContainerId *string `json:"containerId,omitempty"` - PolicyId *string `json:"policyId,omitempty"` - PolicyName *string `json:"policyName,omitempty"` - ProtectableObjectContainerHostOsName *string `json:"protectableObjectContainerHostOsName,omitempty"` - ProtectableObjectFriendlyName *string `json:"protectableObjectFriendlyName,omitempty"` - ProtectableObjectParentLogicalContainerName *string `json:"protectableObjectParentLogicalContainerName,omitempty"` - ProtectableObjectProtectionState *string `json:"protectableObjectProtectionState,omitempty"` - ProtectableObjectUniqueName *string `json:"protectableObjectUniqueName,omitempty"` - ProtectableObjectWorkloadType *string `json:"protectableObjectWorkloadType,omitempty"` - - // Fields inherited from CrrAccessToken - AccessTokenString *string `json:"accessTokenString,omitempty"` - BMSActiveRegion *string `json:"bMSActiveRegion,omitempty"` - BackupManagementType *string `json:"backupManagementType,omitempty"` - ContainerName *string `json:"containerName,omitempty"` - ContainerType *string `json:"containerType,omitempty"` - CoordinatorServiceStampId *string `json:"coordinatorServiceStampId,omitempty"` - CoordinatorServiceStampUri *string `json:"coordinatorServiceStampUri,omitempty"` - DatasourceContainerName *string `json:"datasourceContainerName,omitempty"` - DatasourceId *string `json:"datasourceId,omitempty"` - DatasourceName *string `json:"datasourceName,omitempty"` - DatasourceType *string `json:"datasourceType,omitempty"` - ProtectionContainerId *int64 `json:"protectionContainerId,omitempty"` - ProtectionServiceStampId *string `json:"protectionServiceStampId,omitempty"` - ProtectionServiceStampUri *string `json:"protectionServiceStampUri,omitempty"` - RecoveryPointId *string `json:"recoveryPointId,omitempty"` - RecoveryPointTime *string `json:"recoveryPointTime,omitempty"` - ResourceGroupName *string `json:"resourceGroupName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - ResourceName *string `json:"resourceName,omitempty"` - RpIsManagedVirtualMachine *bool `json:"rpIsManagedVirtualMachine,omitempty"` - RpOriginalSAOption *bool `json:"rpOriginalSAOption,omitempty"` - RpTierInformation *map[string]string `json:"rpTierInformation,omitempty"` - RpVMSizeDescription *string `json:"rpVMSizeDescription,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` - TokenExtendedInformation *string `json:"tokenExtendedInformation,omitempty"` -} - -var _ json.Marshaler = WorkloadCrrAccessToken{} - -func (s WorkloadCrrAccessToken) MarshalJSON() ([]byte, error) { - type wrapper WorkloadCrrAccessToken - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling WorkloadCrrAccessToken: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling WorkloadCrrAccessToken: %+v", err) - } - decoded["objectType"] = "WorkloadCrrAccessToken" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling WorkloadCrrAccessToken: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/version.go b/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/version.go deleted file mode 100644 index 0a24883bd93..00000000000 --- a/resource-manager/recoveryservicesbackup/2023-01-15/recoverypointsgetaccesstoken/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package recoverypointsgetaccesstoken - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2023-01-15" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/recoverypointsgetaccesstoken/%s", defaultApiVersion) -} diff --git a/resource-manager/resources/2024-03-01/client.go b/resource-manager/resources/2024-03-01/client.go index dcdebb36b4f..1004ed2aec5 100644 --- a/resource-manager/resources/2024-03-01/client.go +++ b/resource-manager/resources/2024-03-01/client.go @@ -8,6 +8,7 @@ import ( "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deploymentoperations" "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deployments" + "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deploymentstacks" "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/providers" "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/resourcegroups" "github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/resources" @@ -18,6 +19,7 @@ import ( type Client struct { DeploymentOperations *deploymentoperations.DeploymentOperationsClient + DeploymentStacks *deploymentstacks.DeploymentStacksClient Deployments *deployments.DeploymentsClient Providers *providers.ProvidersClient ResourceGroups *resourcegroups.ResourceGroupsClient @@ -32,6 +34,12 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag } configureFunc(deploymentOperationsClient.Client) + deploymentStacksClient, err := deploymentstacks.NewDeploymentStacksClientWithBaseURI(sdkApi) + if err != nil { + return nil, fmt.Errorf("building DeploymentStacks client: %+v", err) + } + configureFunc(deploymentStacksClient.Client) + deploymentsClient, err := deployments.NewDeploymentsClientWithBaseURI(sdkApi) if err != nil { return nil, fmt.Errorf("building Deployments client: %+v", err) @@ -64,6 +72,7 @@ func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanag return &Client{ DeploymentOperations: deploymentOperationsClient, + DeploymentStacks: deploymentStacksClient, Deployments: deploymentsClient, Providers: providersClient, ResourceGroups: resourceGroupsClient, diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/README.md b/resource-manager/resources/2024-03-01/deploymentstacks/README.md new file mode 100644 index 00000000000..61eb8d565d4 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/README.md @@ -0,0 +1,306 @@ + +## `github.com/hashicorp/go-azure-sdk/resource-manager/resources/2024-03-01/deploymentstacks` Documentation + +The `deploymentstacks` SDK allows for interaction with the Azure Resource Manager Service `resources` (API Version `2024-03-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/resources/2024-03-01/deploymentstacks" +``` + + +### Client Initialization + +```go +client := deploymentstacks.NewDeploymentStacksClientWithBaseURI("https://management.azure.com") +client.Client.Authorizer = authorizer +``` + + +### Example Usage: `DeploymentStacksClient.CreateOrUpdateAtManagementGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue") + +payload := deploymentstacks.DeploymentStack{ + // ... +} + + +if err := client.CreateOrUpdateAtManagementGroupThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.CreateOrUpdateAtResourceGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue") + +payload := deploymentstacks.DeploymentStack{ + // ... +} + + +if err := client.CreateOrUpdateAtResourceGroupThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.CreateOrUpdateAtSubscription` + +```go +ctx := context.TODO() +id := deploymentstacks.NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue") + +payload := deploymentstacks.DeploymentStack{ + // ... +} + + +if err := client.CreateOrUpdateAtSubscriptionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.DeleteAtManagementGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue") + +if err := client.DeleteAtManagementGroupThenPoll(ctx, id, deploymentstacks.DefaultDeleteAtManagementGroupOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.DeleteAtResourceGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue") + +if err := client.DeleteAtResourceGroupThenPoll(ctx, id, deploymentstacks.DefaultDeleteAtResourceGroupOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.DeleteAtSubscription` + +```go +ctx := context.TODO() +id := deploymentstacks.NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue") + +if err := client.DeleteAtSubscriptionThenPoll(ctx, id, deploymentstacks.DefaultDeleteAtSubscriptionOperationOptions()); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.ExportTemplateAtManagementGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue") + +read, err := client.ExportTemplateAtManagementGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DeploymentStacksClient.ExportTemplateAtResourceGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue") + +read, err := client.ExportTemplateAtResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DeploymentStacksClient.ExportTemplateAtSubscription` + +```go +ctx := context.TODO() +id := deploymentstacks.NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue") + +read, err := client.ExportTemplateAtSubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DeploymentStacksClient.GetAtManagementGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue") + +read, err := client.GetAtManagementGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DeploymentStacksClient.GetAtResourceGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue") + +read, err := client.GetAtResourceGroup(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DeploymentStacksClient.GetAtSubscription` + +```go +ctx := context.TODO() +id := deploymentstacks.NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue") + +read, err := client.GetAtSubscription(ctx, id) +if err != nil { + // handle the error +} +if model := read.Model; model != nil { + // do something with the model/response object +} +``` + + +### Example Usage: `DeploymentStacksClient.ListAtManagementGroup` + +```go +ctx := context.TODO() +id := commonids.NewManagementGroupID("groupIdValue") + +// alternatively `client.ListAtManagementGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListAtManagementGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DeploymentStacksClient.ListAtResourceGroup` + +```go +ctx := context.TODO() +id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") + +// alternatively `client.ListAtResourceGroup(ctx, id)` can be used to do batched pagination +items, err := client.ListAtResourceGroupComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DeploymentStacksClient.ListAtSubscription` + +```go +ctx := context.TODO() +id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") + +// alternatively `client.ListAtSubscription(ctx, id)` can be used to do batched pagination +items, err := client.ListAtSubscriptionComplete(ctx, id) +if err != nil { + // handle the error +} +for _, item := range items { + // do something +} +``` + + +### Example Usage: `DeploymentStacksClient.ValidateStackAtManagementGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue") + +payload := deploymentstacks.DeploymentStack{ + // ... +} + + +if err := client.ValidateStackAtManagementGroupThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.ValidateStackAtResourceGroup` + +```go +ctx := context.TODO() +id := deploymentstacks.NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue") + +payload := deploymentstacks.DeploymentStack{ + // ... +} + + +if err := client.ValidateStackAtResourceGroupThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` + + +### Example Usage: `DeploymentStacksClient.ValidateStackAtSubscription` + +```go +ctx := context.TODO() +id := deploymentstacks.NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue") + +payload := deploymentstacks.DeploymentStack{ + // ... +} + + +if err := client.ValidateStackAtSubscriptionThenPoll(ctx, id, payload); err != nil { + // handle the error +} +``` diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/client.go b/resource-manager/resources/2024-03-01/deploymentstacks/client.go new file mode 100644 index 00000000000..f5aac94a77e --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/client.go @@ -0,0 +1,26 @@ +package deploymentstacks + +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 DeploymentStacksClient struct { + Client *resourcemanager.Client +} + +func NewDeploymentStacksClientWithBaseURI(sdkApi sdkEnv.Api) (*DeploymentStacksClient, error) { + client, err := resourcemanager.NewResourceManagerClient(sdkApi, "deploymentstacks", defaultApiVersion) + if err != nil { + return nil, fmt.Errorf("instantiating DeploymentStacksClient: %+v", err) + } + + return &DeploymentStacksClient{ + Client: client, + }, nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/constants.go b/resource-manager/resources/2024-03-01/deploymentstacks/constants.go new file mode 100644 index 00000000000..b59c82f084a --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/constants.go @@ -0,0 +1,383 @@ +package deploymentstacks + +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 DenySettingsMode string + +const ( + DenySettingsModeDenyDelete DenySettingsMode = "denyDelete" + DenySettingsModeDenyWriteAndDelete DenySettingsMode = "denyWriteAndDelete" + DenySettingsModeNone DenySettingsMode = "none" +) + +func PossibleValuesForDenySettingsMode() []string { + return []string{ + string(DenySettingsModeDenyDelete), + string(DenySettingsModeDenyWriteAndDelete), + string(DenySettingsModeNone), + } +} + +func (s *DenySettingsMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDenySettingsMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDenySettingsMode(input string) (*DenySettingsMode, error) { + vals := map[string]DenySettingsMode{ + "denydelete": DenySettingsModeDenyDelete, + "denywriteanddelete": DenySettingsModeDenyWriteAndDelete, + "none": DenySettingsModeNone, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DenySettingsMode(input) + return &out, nil +} + +type DenyStatusMode string + +const ( + DenyStatusModeDenyDelete DenyStatusMode = "denyDelete" + DenyStatusModeDenyWriteAndDelete DenyStatusMode = "denyWriteAndDelete" + DenyStatusModeInapplicable DenyStatusMode = "inapplicable" + DenyStatusModeNone DenyStatusMode = "none" + DenyStatusModeNotSupported DenyStatusMode = "notSupported" + DenyStatusModeRemovedBySystem DenyStatusMode = "removedBySystem" +) + +func PossibleValuesForDenyStatusMode() []string { + return []string{ + string(DenyStatusModeDenyDelete), + string(DenyStatusModeDenyWriteAndDelete), + string(DenyStatusModeInapplicable), + string(DenyStatusModeNone), + string(DenyStatusModeNotSupported), + string(DenyStatusModeRemovedBySystem), + } +} + +func (s *DenyStatusMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDenyStatusMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDenyStatusMode(input string) (*DenyStatusMode, error) { + vals := map[string]DenyStatusMode{ + "denydelete": DenyStatusModeDenyDelete, + "denywriteanddelete": DenyStatusModeDenyWriteAndDelete, + "inapplicable": DenyStatusModeInapplicable, + "none": DenyStatusModeNone, + "notsupported": DenyStatusModeNotSupported, + "removedbysystem": DenyStatusModeRemovedBySystem, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DenyStatusMode(input) + return &out, nil +} + +type DeploymentStackProvisioningState string + +const ( + DeploymentStackProvisioningStateCanceled DeploymentStackProvisioningState = "canceled" + DeploymentStackProvisioningStateCanceling DeploymentStackProvisioningState = "canceling" + DeploymentStackProvisioningStateCreating DeploymentStackProvisioningState = "creating" + DeploymentStackProvisioningStateDeleting DeploymentStackProvisioningState = "deleting" + DeploymentStackProvisioningStateDeletingResources DeploymentStackProvisioningState = "deletingResources" + DeploymentStackProvisioningStateDeploying DeploymentStackProvisioningState = "deploying" + DeploymentStackProvisioningStateFailed DeploymentStackProvisioningState = "failed" + DeploymentStackProvisioningStateSucceeded DeploymentStackProvisioningState = "succeeded" + DeploymentStackProvisioningStateUpdatingDenyAssignments DeploymentStackProvisioningState = "updatingDenyAssignments" + DeploymentStackProvisioningStateValidating DeploymentStackProvisioningState = "validating" + DeploymentStackProvisioningStateWaiting DeploymentStackProvisioningState = "waiting" +) + +func PossibleValuesForDeploymentStackProvisioningState() []string { + return []string{ + string(DeploymentStackProvisioningStateCanceled), + string(DeploymentStackProvisioningStateCanceling), + string(DeploymentStackProvisioningStateCreating), + string(DeploymentStackProvisioningStateDeleting), + string(DeploymentStackProvisioningStateDeletingResources), + string(DeploymentStackProvisioningStateDeploying), + string(DeploymentStackProvisioningStateFailed), + string(DeploymentStackProvisioningStateSucceeded), + string(DeploymentStackProvisioningStateUpdatingDenyAssignments), + string(DeploymentStackProvisioningStateValidating), + string(DeploymentStackProvisioningStateWaiting), + } +} + +func (s *DeploymentStackProvisioningState) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeploymentStackProvisioningState(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeploymentStackProvisioningState(input string) (*DeploymentStackProvisioningState, error) { + vals := map[string]DeploymentStackProvisioningState{ + "canceled": DeploymentStackProvisioningStateCanceled, + "canceling": DeploymentStackProvisioningStateCanceling, + "creating": DeploymentStackProvisioningStateCreating, + "deleting": DeploymentStackProvisioningStateDeleting, + "deletingresources": DeploymentStackProvisioningStateDeletingResources, + "deploying": DeploymentStackProvisioningStateDeploying, + "failed": DeploymentStackProvisioningStateFailed, + "succeeded": DeploymentStackProvisioningStateSucceeded, + "updatingdenyassignments": DeploymentStackProvisioningStateUpdatingDenyAssignments, + "validating": DeploymentStackProvisioningStateValidating, + "waiting": DeploymentStackProvisioningStateWaiting, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeploymentStackProvisioningState(input) + return &out, nil +} + +type DeploymentStacksDeleteDetachEnum string + +const ( + DeploymentStacksDeleteDetachEnumDelete DeploymentStacksDeleteDetachEnum = "delete" + DeploymentStacksDeleteDetachEnumDetach DeploymentStacksDeleteDetachEnum = "detach" +) + +func PossibleValuesForDeploymentStacksDeleteDetachEnum() []string { + return []string{ + string(DeploymentStacksDeleteDetachEnumDelete), + string(DeploymentStacksDeleteDetachEnumDetach), + } +} + +func (s *DeploymentStacksDeleteDetachEnum) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseDeploymentStacksDeleteDetachEnum(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseDeploymentStacksDeleteDetachEnum(input string) (*DeploymentStacksDeleteDetachEnum, error) { + vals := map[string]DeploymentStacksDeleteDetachEnum{ + "delete": DeploymentStacksDeleteDetachEnumDelete, + "detach": DeploymentStacksDeleteDetachEnumDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := DeploymentStacksDeleteDetachEnum(input) + return &out, nil +} + +type ResourceStatusMode string + +const ( + ResourceStatusModeDeleteFailed ResourceStatusMode = "deleteFailed" + ResourceStatusModeManaged ResourceStatusMode = "managed" + ResourceStatusModeRemoveDenyFailed ResourceStatusMode = "removeDenyFailed" +) + +func PossibleValuesForResourceStatusMode() []string { + return []string{ + string(ResourceStatusModeDeleteFailed), + string(ResourceStatusModeManaged), + string(ResourceStatusModeRemoveDenyFailed), + } +} + +func (s *ResourceStatusMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseResourceStatusMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseResourceStatusMode(input string) (*ResourceStatusMode, error) { + vals := map[string]ResourceStatusMode{ + "deletefailed": ResourceStatusModeDeleteFailed, + "managed": ResourceStatusModeManaged, + "removedenyfailed": ResourceStatusModeRemoveDenyFailed, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := ResourceStatusMode(input) + return &out, nil +} + +type UnmanageActionManagementGroupMode string + +const ( + UnmanageActionManagementGroupModeDelete UnmanageActionManagementGroupMode = "delete" + UnmanageActionManagementGroupModeDetach UnmanageActionManagementGroupMode = "detach" +) + +func PossibleValuesForUnmanageActionManagementGroupMode() []string { + return []string{ + string(UnmanageActionManagementGroupModeDelete), + string(UnmanageActionManagementGroupModeDetach), + } +} + +func (s *UnmanageActionManagementGroupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUnmanageActionManagementGroupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUnmanageActionManagementGroupMode(input string) (*UnmanageActionManagementGroupMode, error) { + vals := map[string]UnmanageActionManagementGroupMode{ + "delete": UnmanageActionManagementGroupModeDelete, + "detach": UnmanageActionManagementGroupModeDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UnmanageActionManagementGroupMode(input) + return &out, nil +} + +type UnmanageActionResourceGroupMode string + +const ( + UnmanageActionResourceGroupModeDelete UnmanageActionResourceGroupMode = "delete" + UnmanageActionResourceGroupModeDetach UnmanageActionResourceGroupMode = "detach" +) + +func PossibleValuesForUnmanageActionResourceGroupMode() []string { + return []string{ + string(UnmanageActionResourceGroupModeDelete), + string(UnmanageActionResourceGroupModeDetach), + } +} + +func (s *UnmanageActionResourceGroupMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUnmanageActionResourceGroupMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUnmanageActionResourceGroupMode(input string) (*UnmanageActionResourceGroupMode, error) { + vals := map[string]UnmanageActionResourceGroupMode{ + "delete": UnmanageActionResourceGroupModeDelete, + "detach": UnmanageActionResourceGroupModeDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UnmanageActionResourceGroupMode(input) + return &out, nil +} + +type UnmanageActionResourceMode string + +const ( + UnmanageActionResourceModeDelete UnmanageActionResourceMode = "delete" + UnmanageActionResourceModeDetach UnmanageActionResourceMode = "detach" +) + +func PossibleValuesForUnmanageActionResourceMode() []string { + return []string{ + string(UnmanageActionResourceModeDelete), + string(UnmanageActionResourceModeDetach), + } +} + +func (s *UnmanageActionResourceMode) UnmarshalJSON(bytes []byte) error { + var decoded string + if err := json.Unmarshal(bytes, &decoded); err != nil { + return fmt.Errorf("unmarshaling: %+v", err) + } + out, err := parseUnmanageActionResourceMode(decoded) + if err != nil { + return fmt.Errorf("parsing %q: %+v", decoded, err) + } + *s = *out + return nil +} + +func parseUnmanageActionResourceMode(input string) (*UnmanageActionResourceMode, error) { + vals := map[string]UnmanageActionResourceMode{ + "delete": UnmanageActionResourceModeDelete, + "detach": UnmanageActionResourceModeDetach, + } + if v, ok := vals[strings.ToLower(input)]; ok { + return &v, nil + } + + // otherwise presume it's an undefined value and best-effort it + out := UnmanageActionResourceMode(input) + return &out, nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack.go b/resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack.go new file mode 100644 index 00000000000..3d6bd0b9147 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack.go @@ -0,0 +1,121 @@ +package deploymentstacks + +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(&DeploymentStackId{}) +} + +var _ resourceids.ResourceId = &DeploymentStackId{} + +// DeploymentStackId is a struct representing the Resource ID for a Deployment Stack +type DeploymentStackId struct { + SubscriptionId string + DeploymentStackName string +} + +// NewDeploymentStackID returns a new DeploymentStackId struct +func NewDeploymentStackID(subscriptionId string, deploymentStackName string) DeploymentStackId { + return DeploymentStackId{ + SubscriptionId: subscriptionId, + DeploymentStackName: deploymentStackName, + } +} + +// ParseDeploymentStackID parses 'input' into a DeploymentStackId +func ParseDeploymentStackID(input string) (*DeploymentStackId, error) { + parser := resourceids.NewParserFromResourceIdType(&DeploymentStackId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DeploymentStackId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseDeploymentStackIDInsensitively parses 'input' case-insensitively into a DeploymentStackId +// note: this method should only be used for API response data and not user input +func ParseDeploymentStackIDInsensitively(input string) (*DeploymentStackId, error) { + parser := resourceids.NewParserFromResourceIdType(&DeploymentStackId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := DeploymentStackId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *DeploymentStackId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) + } + + if id.DeploymentStackName, ok = input.Parsed["deploymentStackName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "deploymentStackName", input) + } + + return nil +} + +// ValidateDeploymentStackID checks that 'input' can be parsed as a Deployment Stack ID +func ValidateDeploymentStackID(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 := ParseDeploymentStackID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Deployment Stack ID +func (id DeploymentStackId) ID() string { + fmtString := "/subscriptions/%s/providers/Microsoft.Resources/deploymentStacks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.DeploymentStackName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Deployment Stack ID +func (id DeploymentStackId) 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("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), + resourceids.StaticSegment("staticDeploymentStacks", "deploymentStacks", "deploymentStacks"), + resourceids.UserSpecifiedSegment("deploymentStackName", "deploymentStackValue"), + } +} + +// String returns a human-readable description of this Deployment Stack ID +func (id DeploymentStackId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Deployment Stack Name: %q", id.DeploymentStackName), + } + return fmt.Sprintf("Deployment Stack (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack_test.go b/resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack_test.go new file mode 100644 index 00000000000..76e63063e3f --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/id_deploymentstack_test.go @@ -0,0 +1,237 @@ +package deploymentstacks + +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 = &DeploymentStackId{} + +func TestNewDeploymentStackID(t *testing.T) { + id := NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue") + + 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.DeploymentStackName != "deploymentStackValue" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentStackName'", id.DeploymentStackName, "deploymentStackValue") + } +} + +func TestFormatDeploymentStackID(t *testing.T) { + actual := NewDeploymentStackID("12345678-1234-9876-4563-123456789012", "deploymentStackValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseDeploymentStackID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DeploymentStackId + }{ + { + // 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.Resources", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue", + Expected: &DeploymentStackId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + DeploymentStackName: "deploymentStackValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDeploymentStackID(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.DeploymentStackName != v.Expected.DeploymentStackName { + t.Fatalf("Expected %q but got %q for DeploymentStackName", v.Expected.DeploymentStackName, actual.DeploymentStackName) + } + + } +} + +func TestParseDeploymentStackIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *DeploymentStackId + }{ + { + // 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.Resources", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEsOuRcEs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue", + Expected: &DeploymentStackId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + DeploymentStackName: "deploymentStackValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS/dEpLoYmEnTsTaCkVaLuE", + Expected: &DeploymentStackId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + DeploymentStackName: "dEpLoYmEnTsTaCkVaLuE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS/dEpLoYmEnTsTaCkVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseDeploymentStackIDInsensitively(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.DeploymentStackName != v.Expected.DeploymentStackName { + t.Fatalf("Expected %q but got %q for DeploymentStackName", v.Expected.DeploymentStackName, actual.DeploymentStackName) + } + + } +} + +func TestSegmentsForDeploymentStackId(t *testing.T) { + segments := DeploymentStackId{}.Segments() + if len(segments) == 0 { + t.Fatalf("DeploymentStackId 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/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack.go b/resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack.go new file mode 100644 index 00000000000..db298acdb7e --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack.go @@ -0,0 +1,130 @@ +package deploymentstacks + +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(&ProviderDeploymentStackId{}) +} + +var _ resourceids.ResourceId = &ProviderDeploymentStackId{} + +// ProviderDeploymentStackId is a struct representing the Resource ID for a Provider Deployment Stack +type ProviderDeploymentStackId struct { + SubscriptionId string + ResourceGroupName string + DeploymentStackName string +} + +// NewProviderDeploymentStackID returns a new ProviderDeploymentStackId struct +func NewProviderDeploymentStackID(subscriptionId string, resourceGroupName string, deploymentStackName string) ProviderDeploymentStackId { + return ProviderDeploymentStackId{ + SubscriptionId: subscriptionId, + ResourceGroupName: resourceGroupName, + DeploymentStackName: deploymentStackName, + } +} + +// ParseProviderDeploymentStackID parses 'input' into a ProviderDeploymentStackId +func ParseProviderDeploymentStackID(input string) (*ProviderDeploymentStackId, error) { + parser := resourceids.NewParserFromResourceIdType(&ProviderDeploymentStackId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ProviderDeploymentStackId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseProviderDeploymentStackIDInsensitively parses 'input' case-insensitively into a ProviderDeploymentStackId +// note: this method should only be used for API response data and not user input +func ParseProviderDeploymentStackIDInsensitively(input string) (*ProviderDeploymentStackId, error) { + parser := resourceids.NewParserFromResourceIdType(&ProviderDeploymentStackId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := ProviderDeploymentStackId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *ProviderDeploymentStackId) 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.DeploymentStackName, ok = input.Parsed["deploymentStackName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "deploymentStackName", input) + } + + return nil +} + +// ValidateProviderDeploymentStackID checks that 'input' can be parsed as a Provider Deployment Stack ID +func ValidateProviderDeploymentStackID(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 := ParseProviderDeploymentStackID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Provider Deployment Stack ID +func (id ProviderDeploymentStackId) ID() string { + fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Resources/deploymentStacks/%s" + return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.DeploymentStackName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Provider Deployment Stack ID +func (id ProviderDeploymentStackId) 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("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), + resourceids.StaticSegment("staticDeploymentStacks", "deploymentStacks", "deploymentStacks"), + resourceids.UserSpecifiedSegment("deploymentStackName", "deploymentStackValue"), + } +} + +// String returns a human-readable description of this Provider Deployment Stack ID +func (id ProviderDeploymentStackId) String() string { + components := []string{ + fmt.Sprintf("Subscription: %q", id.SubscriptionId), + fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), + fmt.Sprintf("Deployment Stack Name: %q", id.DeploymentStackName), + } + return fmt.Sprintf("Provider Deployment Stack (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack_test.go b/resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack_test.go new file mode 100644 index 00000000000..8e621324407 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/id_providerdeploymentstack_test.go @@ -0,0 +1,282 @@ +package deploymentstacks + +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 = &ProviderDeploymentStackId{} + +func TestNewProviderDeploymentStackID(t *testing.T) { + id := NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue") + + 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.DeploymentStackName != "deploymentStackValue" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentStackName'", id.DeploymentStackName, "deploymentStackValue") + } +} + +func TestFormatProviderDeploymentStackID(t *testing.T) { + actual := NewProviderDeploymentStackID("12345678-1234-9876-4563-123456789012", "example-resource-group", "deploymentStackValue").ID() + expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseProviderDeploymentStackID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ProviderDeploymentStackId + }{ + { + // 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.Resources", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue", + Expected: &ProviderDeploymentStackId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DeploymentStackName: "deploymentStackValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseProviderDeploymentStackID(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.DeploymentStackName != v.Expected.DeploymentStackName { + t.Fatalf("Expected %q but got %q for DeploymentStackName", v.Expected.DeploymentStackName, actual.DeploymentStackName) + } + + } +} + +func TestParseProviderDeploymentStackIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *ProviderDeploymentStackId + }{ + { + // 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.Resources", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs", + Error: true, + }, + { + // Incomplete URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS", + Error: true, + }, + { + // Valid URI + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue", + Expected: &ProviderDeploymentStackId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "example-resource-group", + DeploymentStackName: "deploymentStackValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS/dEpLoYmEnTsTaCkVaLuE", + Expected: &ProviderDeploymentStackId{ + SubscriptionId: "12345678-1234-9876-4563-123456789012", + ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", + DeploymentStackName: "dEpLoYmEnTsTaCkVaLuE", + }, + }, + { + // 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.rEsOuRcEs/dEpLoYmEnTsTaCkS/dEpLoYmEnTsTaCkVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseProviderDeploymentStackIDInsensitively(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.DeploymentStackName != v.Expected.DeploymentStackName { + t.Fatalf("Expected %q but got %q for DeploymentStackName", v.Expected.DeploymentStackName, actual.DeploymentStackName) + } + + } +} + +func TestSegmentsForProviderDeploymentStackId(t *testing.T) { + segments := ProviderDeploymentStackId{}.Segments() + if len(segments) == 0 { + t.Fatalf("ProviderDeploymentStackId 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/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack.go b/resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack.go new file mode 100644 index 00000000000..6a6d80bb80f --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack.go @@ -0,0 +1,123 @@ +package deploymentstacks + +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(&Providers2DeploymentStackId{}) +} + +var _ resourceids.ResourceId = &Providers2DeploymentStackId{} + +// Providers2DeploymentStackId is a struct representing the Resource ID for a Providers 2 Deployment Stack +type Providers2DeploymentStackId struct { + ManagementGroupId string + DeploymentStackName string +} + +// NewProviders2DeploymentStackID returns a new Providers2DeploymentStackId struct +func NewProviders2DeploymentStackID(managementGroupId string, deploymentStackName string) Providers2DeploymentStackId { + return Providers2DeploymentStackId{ + ManagementGroupId: managementGroupId, + DeploymentStackName: deploymentStackName, + } +} + +// ParseProviders2DeploymentStackID parses 'input' into a Providers2DeploymentStackId +func ParseProviders2DeploymentStackID(input string) (*Providers2DeploymentStackId, error) { + parser := resourceids.NewParserFromResourceIdType(&Providers2DeploymentStackId{}) + parsed, err := parser.Parse(input, false) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := Providers2DeploymentStackId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +// ParseProviders2DeploymentStackIDInsensitively parses 'input' case-insensitively into a Providers2DeploymentStackId +// note: this method should only be used for API response data and not user input +func ParseProviders2DeploymentStackIDInsensitively(input string) (*Providers2DeploymentStackId, error) { + parser := resourceids.NewParserFromResourceIdType(&Providers2DeploymentStackId{}) + parsed, err := parser.Parse(input, true) + if err != nil { + return nil, fmt.Errorf("parsing %q: %+v", input, err) + } + + id := Providers2DeploymentStackId{} + if err := id.FromParseResult(*parsed); err != nil { + return nil, err + } + + return &id, nil +} + +func (id *Providers2DeploymentStackId) FromParseResult(input resourceids.ParseResult) error { + var ok bool + + if id.ManagementGroupId, ok = input.Parsed["managementGroupId"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "managementGroupId", input) + } + + if id.DeploymentStackName, ok = input.Parsed["deploymentStackName"]; !ok { + return resourceids.NewSegmentNotSpecifiedError(id, "deploymentStackName", input) + } + + return nil +} + +// ValidateProviders2DeploymentStackID checks that 'input' can be parsed as a Providers 2 Deployment Stack ID +func ValidateProviders2DeploymentStackID(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 := ParseProviders2DeploymentStackID(v); err != nil { + errors = append(errors, err) + } + + return +} + +// ID returns the formatted Providers 2 Deployment Stack ID +func (id Providers2DeploymentStackId) ID() string { + fmtString := "/providers/Microsoft.Management/managementGroups/%s/providers/Microsoft.Resources/deploymentStacks/%s" + return fmt.Sprintf(fmtString, id.ManagementGroupId, id.DeploymentStackName) +} + +// Segments returns a slice of Resource ID Segments which comprise this Providers 2 Deployment Stack ID +func (id Providers2DeploymentStackId) Segments() []resourceids.Segment { + return []resourceids.Segment{ + resourceids.StaticSegment("staticProviders", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftManagement", "Microsoft.Management", "Microsoft.Management"), + resourceids.StaticSegment("staticManagementGroups", "managementGroups", "managementGroups"), + resourceids.UserSpecifiedSegment("managementGroupId", "managementGroupIdValue"), + resourceids.StaticSegment("staticProviders2", "providers", "providers"), + resourceids.ResourceProviderSegment("staticMicrosoftResources", "Microsoft.Resources", "Microsoft.Resources"), + resourceids.StaticSegment("staticDeploymentStacks", "deploymentStacks", "deploymentStacks"), + resourceids.UserSpecifiedSegment("deploymentStackName", "deploymentStackValue"), + } +} + +// String returns a human-readable description of this Providers 2 Deployment Stack ID +func (id Providers2DeploymentStackId) String() string { + components := []string{ + fmt.Sprintf("Management Group: %q", id.ManagementGroupId), + fmt.Sprintf("Deployment Stack Name: %q", id.DeploymentStackName), + } + return fmt.Sprintf("Providers 2 Deployment Stack (%s)", strings.Join(components, "\n")) +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack_test.go b/resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack_test.go new file mode 100644 index 00000000000..93ebb11436b --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/id_providers2deploymentstack_test.go @@ -0,0 +1,267 @@ +package deploymentstacks + +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 = &Providers2DeploymentStackId{} + +func TestNewProviders2DeploymentStackID(t *testing.T) { + id := NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue") + + if id.ManagementGroupId != "managementGroupIdValue" { + t.Fatalf("Expected %q but got %q for Segment 'ManagementGroupId'", id.ManagementGroupId, "managementGroupIdValue") + } + + if id.DeploymentStackName != "deploymentStackValue" { + t.Fatalf("Expected %q but got %q for Segment 'DeploymentStackName'", id.DeploymentStackName, "deploymentStackValue") + } +} + +func TestFormatProviders2DeploymentStackID(t *testing.T) { + actual := NewProviders2DeploymentStackID("managementGroupIdValue", "deploymentStackValue").ID() + expected := "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue" + if actual != expected { + t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) + } +} + +func TestParseProviders2DeploymentStackID(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *Providers2DeploymentStackId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks", + Error: true, + }, + { + // Valid URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue", + Expected: &Providers2DeploymentStackId{ + ManagementGroupId: "managementGroupIdValue", + DeploymentStackName: "deploymentStackValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseProviders2DeploymentStackID(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.ManagementGroupId != v.Expected.ManagementGroupId { + t.Fatalf("Expected %q but got %q for ManagementGroupId", v.Expected.ManagementGroupId, actual.ManagementGroupId) + } + + if actual.DeploymentStackName != v.Expected.DeploymentStackName { + t.Fatalf("Expected %q but got %q for DeploymentStackName", v.Expected.DeploymentStackName, actual.DeploymentStackName) + } + + } +} + +func TestParseProviders2DeploymentStackIDInsensitively(t *testing.T) { + testData := []struct { + Input string + Error bool + Expected *Providers2DeploymentStackId + }{ + { + // Incomplete URI + Input: "", + Error: true, + }, + { + // Incomplete URI + Input: "/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.rEsOuRcEs", + Error: true, + }, + { + // Incomplete URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks", + Error: true, + }, + { + // Incomplete URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS", + Error: true, + }, + { + // Valid URI + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue", + Expected: &Providers2DeploymentStackId{ + ManagementGroupId: "managementGroupIdValue", + DeploymentStackName: "deploymentStackValue", + }, + }, + { + // Invalid (Valid Uri with Extra segment) + Input: "/providers/Microsoft.Management/managementGroups/managementGroupIdValue/providers/Microsoft.Resources/deploymentStacks/deploymentStackValue/extra", + Error: true, + }, + { + // Valid URI (mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS/dEpLoYmEnTsTaCkVaLuE", + Expected: &Providers2DeploymentStackId{ + ManagementGroupId: "mAnAgEmEnTgRoUpIdVaLuE", + DeploymentStackName: "dEpLoYmEnTsTaCkVaLuE", + }, + }, + { + // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) + Input: "/pRoViDeRs/mIcRoSoFt.mAnAgEmEnT/mAnAgEmEnTgRoUpS/mAnAgEmEnTgRoUpIdVaLuE/pRoViDeRs/mIcRoSoFt.rEsOuRcEs/dEpLoYmEnTsTaCkS/dEpLoYmEnTsTaCkVaLuE/extra", + Error: true, + }, + } + for _, v := range testData { + t.Logf("[DEBUG] Testing %q", v.Input) + + actual, err := ParseProviders2DeploymentStackIDInsensitively(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.ManagementGroupId != v.Expected.ManagementGroupId { + t.Fatalf("Expected %q but got %q for ManagementGroupId", v.Expected.ManagementGroupId, actual.ManagementGroupId) + } + + if actual.DeploymentStackName != v.Expected.DeploymentStackName { + t.Fatalf("Expected %q but got %q for DeploymentStackName", v.Expected.DeploymentStackName, actual.DeploymentStackName) + } + + } +} + +func TestSegmentsForProviders2DeploymentStackId(t *testing.T) { + segments := Providers2DeploymentStackId{}.Segments() + if len(segments) == 0 { + t.Fatalf("Providers2DeploymentStackId 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/resources/2024-03-01/deploymentstacks/method_createorupdateatmanagementgroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatmanagementgroup.go new file mode 100644 index 00000000000..27e5eb841b8 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatmanagementgroup.go @@ -0,0 +1,75 @@ +package deploymentstacks + +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 CreateOrUpdateAtManagementGroupOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStack +} + +// CreateOrUpdateAtManagementGroup ... +func (c DeploymentStacksClient) CreateOrUpdateAtManagementGroup(ctx context.Context, id Providers2DeploymentStackId, input DeploymentStack) (result CreateOrUpdateAtManagementGroupOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateAtManagementGroupThenPoll performs CreateOrUpdateAtManagementGroup then polls until it's completed +func (c DeploymentStacksClient) CreateOrUpdateAtManagementGroupThenPoll(ctx context.Context, id Providers2DeploymentStackId, input DeploymentStack) error { + result, err := c.CreateOrUpdateAtManagementGroup(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateAtManagementGroup: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateAtManagementGroup: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatresourcegroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatresourcegroup.go new file mode 100644 index 00000000000..6a564931844 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatresourcegroup.go @@ -0,0 +1,75 @@ +package deploymentstacks + +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 CreateOrUpdateAtResourceGroupOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStack +} + +// CreateOrUpdateAtResourceGroup ... +func (c DeploymentStacksClient) CreateOrUpdateAtResourceGroup(ctx context.Context, id ProviderDeploymentStackId, input DeploymentStack) (result CreateOrUpdateAtResourceGroupOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateAtResourceGroupThenPoll performs CreateOrUpdateAtResourceGroup then polls until it's completed +func (c DeploymentStacksClient) CreateOrUpdateAtResourceGroupThenPoll(ctx context.Context, id ProviderDeploymentStackId, input DeploymentStack) error { + result, err := c.CreateOrUpdateAtResourceGroup(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateAtResourceGroup: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateAtResourceGroup: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatsubscription.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatsubscription.go new file mode 100644 index 00000000000..71238e337c9 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_createorupdateatsubscription.go @@ -0,0 +1,75 @@ +package deploymentstacks + +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 CreateOrUpdateAtSubscriptionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStack +} + +// CreateOrUpdateAtSubscription ... +func (c DeploymentStacksClient) CreateOrUpdateAtSubscription(ctx context.Context, id DeploymentStackId, input DeploymentStack) (result CreateOrUpdateAtSubscriptionOperationResponse, 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 + } + + result.Poller, err = resourcemanager.PollerFromResponse(resp, c.Client) + if err != nil { + return + } + + return +} + +// CreateOrUpdateAtSubscriptionThenPoll performs CreateOrUpdateAtSubscription then polls until it's completed +func (c DeploymentStacksClient) CreateOrUpdateAtSubscriptionThenPoll(ctx context.Context, id DeploymentStackId, input DeploymentStack) error { + result, err := c.CreateOrUpdateAtSubscription(ctx, id, input) + if err != nil { + return fmt.Errorf("performing CreateOrUpdateAtSubscription: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after CreateOrUpdateAtSubscription: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatmanagementgroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatmanagementgroup.go new file mode 100644 index 00000000000..3fe0bd51ab7 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatmanagementgroup.go @@ -0,0 +1,111 @@ +package deploymentstacks + +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 DeleteAtManagementGroupOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +type DeleteAtManagementGroupOperationOptions struct { + BypassStackOutOfSyncError *bool + UnmanageActionManagementGroups *UnmanageActionManagementGroupMode + UnmanageActionResourceGroups *UnmanageActionResourceGroupMode + UnmanageActionResources *UnmanageActionResourceMode +} + +func DefaultDeleteAtManagementGroupOperationOptions() DeleteAtManagementGroupOperationOptions { + return DeleteAtManagementGroupOperationOptions{} +} + +func (o DeleteAtManagementGroupOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteAtManagementGroupOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteAtManagementGroupOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.BypassStackOutOfSyncError != nil { + out.Append("bypassStackOutOfSyncError", fmt.Sprintf("%v", *o.BypassStackOutOfSyncError)) + } + if o.UnmanageActionManagementGroups != nil { + out.Append("unmanageAction.ManagementGroups", fmt.Sprintf("%v", *o.UnmanageActionManagementGroups)) + } + if o.UnmanageActionResourceGroups != nil { + out.Append("unmanageAction.ResourceGroups", fmt.Sprintf("%v", *o.UnmanageActionResourceGroups)) + } + if o.UnmanageActionResources != nil { + out.Append("unmanageAction.Resources", fmt.Sprintf("%v", *o.UnmanageActionResources)) + } + return &out +} + +// DeleteAtManagementGroup ... +func (c DeploymentStacksClient) DeleteAtManagementGroup(ctx context.Context, id Providers2DeploymentStackId, options DeleteAtManagementGroupOperationOptions) (result DeleteAtManagementGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 +} + +// DeleteAtManagementGroupThenPoll performs DeleteAtManagementGroup then polls until it's completed +func (c DeploymentStacksClient) DeleteAtManagementGroupThenPoll(ctx context.Context, id Providers2DeploymentStackId, options DeleteAtManagementGroupOperationOptions) error { + result, err := c.DeleteAtManagementGroup(ctx, id, options) + if err != nil { + return fmt.Errorf("performing DeleteAtManagementGroup: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteAtManagementGroup: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatresourcegroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatresourcegroup.go new file mode 100644 index 00000000000..1969ed04ff9 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatresourcegroup.go @@ -0,0 +1,111 @@ +package deploymentstacks + +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 DeleteAtResourceGroupOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +type DeleteAtResourceGroupOperationOptions struct { + BypassStackOutOfSyncError *bool + UnmanageActionManagementGroups *UnmanageActionManagementGroupMode + UnmanageActionResourceGroups *UnmanageActionResourceGroupMode + UnmanageActionResources *UnmanageActionResourceMode +} + +func DefaultDeleteAtResourceGroupOperationOptions() DeleteAtResourceGroupOperationOptions { + return DeleteAtResourceGroupOperationOptions{} +} + +func (o DeleteAtResourceGroupOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteAtResourceGroupOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteAtResourceGroupOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.BypassStackOutOfSyncError != nil { + out.Append("bypassStackOutOfSyncError", fmt.Sprintf("%v", *o.BypassStackOutOfSyncError)) + } + if o.UnmanageActionManagementGroups != nil { + out.Append("unmanageAction.ManagementGroups", fmt.Sprintf("%v", *o.UnmanageActionManagementGroups)) + } + if o.UnmanageActionResourceGroups != nil { + out.Append("unmanageAction.ResourceGroups", fmt.Sprintf("%v", *o.UnmanageActionResourceGroups)) + } + if o.UnmanageActionResources != nil { + out.Append("unmanageAction.Resources", fmt.Sprintf("%v", *o.UnmanageActionResources)) + } + return &out +} + +// DeleteAtResourceGroup ... +func (c DeploymentStacksClient) DeleteAtResourceGroup(ctx context.Context, id ProviderDeploymentStackId, options DeleteAtResourceGroupOperationOptions) (result DeleteAtResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 +} + +// DeleteAtResourceGroupThenPoll performs DeleteAtResourceGroup then polls until it's completed +func (c DeploymentStacksClient) DeleteAtResourceGroupThenPoll(ctx context.Context, id ProviderDeploymentStackId, options DeleteAtResourceGroupOperationOptions) error { + result, err := c.DeleteAtResourceGroup(ctx, id, options) + if err != nil { + return fmt.Errorf("performing DeleteAtResourceGroup: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteAtResourceGroup: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatsubscription.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatsubscription.go new file mode 100644 index 00000000000..1aa8a913a3b --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_deleteatsubscription.go @@ -0,0 +1,111 @@ +package deploymentstacks + +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 DeleteAtSubscriptionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData +} + +type DeleteAtSubscriptionOperationOptions struct { + BypassStackOutOfSyncError *bool + UnmanageActionManagementGroups *UnmanageActionManagementGroupMode + UnmanageActionResourceGroups *UnmanageActionResourceGroupMode + UnmanageActionResources *UnmanageActionResourceMode +} + +func DefaultDeleteAtSubscriptionOperationOptions() DeleteAtSubscriptionOperationOptions { + return DeleteAtSubscriptionOperationOptions{} +} + +func (o DeleteAtSubscriptionOperationOptions) ToHeaders() *client.Headers { + out := client.Headers{} + + return &out +} + +func (o DeleteAtSubscriptionOperationOptions) ToOData() *odata.Query { + out := odata.Query{} + return &out +} + +func (o DeleteAtSubscriptionOperationOptions) ToQuery() *client.QueryParams { + out := client.QueryParams{} + if o.BypassStackOutOfSyncError != nil { + out.Append("bypassStackOutOfSyncError", fmt.Sprintf("%v", *o.BypassStackOutOfSyncError)) + } + if o.UnmanageActionManagementGroups != nil { + out.Append("unmanageAction.ManagementGroups", fmt.Sprintf("%v", *o.UnmanageActionManagementGroups)) + } + if o.UnmanageActionResourceGroups != nil { + out.Append("unmanageAction.ResourceGroups", fmt.Sprintf("%v", *o.UnmanageActionResourceGroups)) + } + if o.UnmanageActionResources != nil { + out.Append("unmanageAction.Resources", fmt.Sprintf("%v", *o.UnmanageActionResources)) + } + return &out +} + +// DeleteAtSubscription ... +func (c DeploymentStacksClient) DeleteAtSubscription(ctx context.Context, id DeploymentStackId, options DeleteAtSubscriptionOperationOptions) (result DeleteAtSubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusNoContent, + http.StatusOK, + }, + HttpMethod: http.MethodDelete, + Path: id.ID(), + OptionsObject: options, + } + + 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 +} + +// DeleteAtSubscriptionThenPoll performs DeleteAtSubscription then polls until it's completed +func (c DeploymentStacksClient) DeleteAtSubscriptionThenPoll(ctx context.Context, id DeploymentStackId, options DeleteAtSubscriptionOperationOptions) error { + result, err := c.DeleteAtSubscription(ctx, id, options) + if err != nil { + return fmt.Errorf("performing DeleteAtSubscription: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after DeleteAtSubscription: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatmanagementgroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatmanagementgroup.go new file mode 100644 index 00000000000..0ec08888098 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatmanagementgroup.go @@ -0,0 +1,55 @@ +package deploymentstacks + +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 ExportTemplateAtManagementGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStackTemplateDefinition +} + +// ExportTemplateAtManagementGroup ... +func (c DeploymentStacksClient) ExportTemplateAtManagementGroup(ctx context.Context, id Providers2DeploymentStackId) (result ExportTemplateAtManagementGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/exportTemplate", 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 DeploymentStackTemplateDefinition + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatresourcegroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatresourcegroup.go new file mode 100644 index 00000000000..8eaa5682851 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatresourcegroup.go @@ -0,0 +1,55 @@ +package deploymentstacks + +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 ExportTemplateAtResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStackTemplateDefinition +} + +// ExportTemplateAtResourceGroup ... +func (c DeploymentStacksClient) ExportTemplateAtResourceGroup(ctx context.Context, id ProviderDeploymentStackId) (result ExportTemplateAtResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/exportTemplate", 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 DeploymentStackTemplateDefinition + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatsubscription.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatsubscription.go new file mode 100644 index 00000000000..0d4d3052d5e --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_exporttemplateatsubscription.go @@ -0,0 +1,55 @@ +package deploymentstacks + +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 ExportTemplateAtSubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStackTemplateDefinition +} + +// ExportTemplateAtSubscription ... +func (c DeploymentStacksClient) ExportTemplateAtSubscription(ctx context.Context, id DeploymentStackId) (result ExportTemplateAtSubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/exportTemplate", 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 DeploymentStackTemplateDefinition + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_getatmanagementgroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_getatmanagementgroup.go new file mode 100644 index 00000000000..dad3f5a43e3 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_getatmanagementgroup.go @@ -0,0 +1,54 @@ +package deploymentstacks + +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 GetAtManagementGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStack +} + +// GetAtManagementGroup ... +func (c DeploymentStacksClient) GetAtManagementGroup(ctx context.Context, id Providers2DeploymentStackId) (result GetAtManagementGroupOperationResponse, 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 DeploymentStack + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_getatresourcegroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_getatresourcegroup.go new file mode 100644 index 00000000000..ac2a6df0156 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_getatresourcegroup.go @@ -0,0 +1,54 @@ +package deploymentstacks + +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 GetAtResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStack +} + +// GetAtResourceGroup ... +func (c DeploymentStacksClient) GetAtResourceGroup(ctx context.Context, id ProviderDeploymentStackId) (result GetAtResourceGroupOperationResponse, 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 DeploymentStack + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_getatsubscription.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_getatsubscription.go new file mode 100644 index 00000000000..9d3952260db --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_getatsubscription.go @@ -0,0 +1,54 @@ +package deploymentstacks + +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 GetAtSubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStack +} + +// GetAtSubscription ... +func (c DeploymentStacksClient) GetAtSubscription(ctx context.Context, id DeploymentStackId) (result GetAtSubscriptionOperationResponse, 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 DeploymentStack + result.Model = &model + + if err = resp.Unmarshal(result.Model); err != nil { + return + } + + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_listatmanagementgroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_listatmanagementgroup.go new file mode 100644 index 00000000000..e915bf40379 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_listatmanagementgroup.go @@ -0,0 +1,92 @@ +package deploymentstacks + +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 ListAtManagementGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DeploymentStack +} + +type ListAtManagementGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []DeploymentStack +} + +// ListAtManagementGroup ... +func (c DeploymentStacksClient) ListAtManagementGroup(ctx context.Context, id commonids.ManagementGroupId) (result ListAtManagementGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Resources/deploymentStacks", 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 *[]DeploymentStack `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListAtManagementGroupComplete retrieves all the results into a single object +func (c DeploymentStacksClient) ListAtManagementGroupComplete(ctx context.Context, id commonids.ManagementGroupId) (ListAtManagementGroupCompleteResult, error) { + return c.ListAtManagementGroupCompleteMatchingPredicate(ctx, id, DeploymentStackOperationPredicate{}) +} + +// ListAtManagementGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DeploymentStacksClient) ListAtManagementGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ManagementGroupId, predicate DeploymentStackOperationPredicate) (result ListAtManagementGroupCompleteResult, err error) { + items := make([]DeploymentStack, 0) + + resp, err := c.ListAtManagementGroup(ctx, id) + if err != nil { + 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 = ListAtManagementGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_listatresourcegroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_listatresourcegroup.go new file mode 100644 index 00000000000..12981716ac7 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_listatresourcegroup.go @@ -0,0 +1,92 @@ +package deploymentstacks + +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 ListAtResourceGroupOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DeploymentStack +} + +type ListAtResourceGroupCompleteResult struct { + LatestHttpResponse *http.Response + Items []DeploymentStack +} + +// ListAtResourceGroup ... +func (c DeploymentStacksClient) ListAtResourceGroup(ctx context.Context, id commonids.ResourceGroupId) (result ListAtResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Resources/deploymentStacks", 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 *[]DeploymentStack `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListAtResourceGroupComplete retrieves all the results into a single object +func (c DeploymentStacksClient) ListAtResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListAtResourceGroupCompleteResult, error) { + return c.ListAtResourceGroupCompleteMatchingPredicate(ctx, id, DeploymentStackOperationPredicate{}) +} + +// ListAtResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DeploymentStacksClient) ListAtResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate DeploymentStackOperationPredicate) (result ListAtResourceGroupCompleteResult, err error) { + items := make([]DeploymentStack, 0) + + resp, err := c.ListAtResourceGroup(ctx, id) + if err != nil { + 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 = ListAtResourceGroupCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_listatsubscription.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_listatsubscription.go new file mode 100644 index 00000000000..4508da1b16c --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_listatsubscription.go @@ -0,0 +1,92 @@ +package deploymentstacks + +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 ListAtSubscriptionOperationResponse struct { + HttpResponse *http.Response + OData *odata.OData + Model *[]DeploymentStack +} + +type ListAtSubscriptionCompleteResult struct { + LatestHttpResponse *http.Response + Items []DeploymentStack +} + +// ListAtSubscription ... +func (c DeploymentStacksClient) ListAtSubscription(ctx context.Context, id commonids.SubscriptionId) (result ListAtSubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusOK, + }, + HttpMethod: http.MethodGet, + Path: fmt.Sprintf("%s/providers/Microsoft.Resources/deploymentStacks", 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 *[]DeploymentStack `json:"value"` + } + if err = resp.Unmarshal(&values); err != nil { + return + } + + result.Model = values.Values + + return +} + +// ListAtSubscriptionComplete retrieves all the results into a single object +func (c DeploymentStacksClient) ListAtSubscriptionComplete(ctx context.Context, id commonids.SubscriptionId) (ListAtSubscriptionCompleteResult, error) { + return c.ListAtSubscriptionCompleteMatchingPredicate(ctx, id, DeploymentStackOperationPredicate{}) +} + +// ListAtSubscriptionCompleteMatchingPredicate retrieves all the results and then applies the predicate +func (c DeploymentStacksClient) ListAtSubscriptionCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate DeploymentStackOperationPredicate) (result ListAtSubscriptionCompleteResult, err error) { + items := make([]DeploymentStack, 0) + + resp, err := c.ListAtSubscription(ctx, id) + if err != nil { + 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 = ListAtSubscriptionCompleteResult{ + LatestHttpResponse: resp.HttpResponse, + Items: items, + } + return +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatmanagementgroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatmanagementgroup.go new file mode 100644 index 00000000000..5592eb7cc07 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatmanagementgroup.go @@ -0,0 +1,75 @@ +package deploymentstacks + +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 ValidateStackAtManagementGroupOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStackValidateResult +} + +// ValidateStackAtManagementGroup ... +func (c DeploymentStacksClient) ValidateStackAtManagementGroup(ctx context.Context, id Providers2DeploymentStackId, input DeploymentStack) (result ValidateStackAtManagementGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/validate", 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 +} + +// ValidateStackAtManagementGroupThenPoll performs ValidateStackAtManagementGroup then polls until it's completed +func (c DeploymentStacksClient) ValidateStackAtManagementGroupThenPoll(ctx context.Context, id Providers2DeploymentStackId, input DeploymentStack) error { + result, err := c.ValidateStackAtManagementGroup(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateStackAtManagementGroup: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateStackAtManagementGroup: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatresourcegroup.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatresourcegroup.go new file mode 100644 index 00000000000..f26a94f9f54 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatresourcegroup.go @@ -0,0 +1,75 @@ +package deploymentstacks + +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 ValidateStackAtResourceGroupOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStackValidateResult +} + +// ValidateStackAtResourceGroup ... +func (c DeploymentStacksClient) ValidateStackAtResourceGroup(ctx context.Context, id ProviderDeploymentStackId, input DeploymentStack) (result ValidateStackAtResourceGroupOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/validate", 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 +} + +// ValidateStackAtResourceGroupThenPoll performs ValidateStackAtResourceGroup then polls until it's completed +func (c DeploymentStacksClient) ValidateStackAtResourceGroupThenPoll(ctx context.Context, id ProviderDeploymentStackId, input DeploymentStack) error { + result, err := c.ValidateStackAtResourceGroup(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateStackAtResourceGroup: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateStackAtResourceGroup: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatsubscription.go b/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatsubscription.go new file mode 100644 index 00000000000..56143533446 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/method_validatestackatsubscription.go @@ -0,0 +1,75 @@ +package deploymentstacks + +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 ValidateStackAtSubscriptionOperationResponse struct { + Poller pollers.Poller + HttpResponse *http.Response + OData *odata.OData + Model *DeploymentStackValidateResult +} + +// ValidateStackAtSubscription ... +func (c DeploymentStacksClient) ValidateStackAtSubscription(ctx context.Context, id DeploymentStackId, input DeploymentStack) (result ValidateStackAtSubscriptionOperationResponse, err error) { + opts := client.RequestOptions{ + ContentType: "application/json; charset=utf-8", + ExpectedStatusCodes: []int{ + http.StatusAccepted, + http.StatusOK, + }, + HttpMethod: http.MethodPost, + Path: fmt.Sprintf("%s/validate", 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 +} + +// ValidateStackAtSubscriptionThenPoll performs ValidateStackAtSubscription then polls until it's completed +func (c DeploymentStacksClient) ValidateStackAtSubscriptionThenPoll(ctx context.Context, id DeploymentStackId, input DeploymentStack) error { + result, err := c.ValidateStackAtSubscription(ctx, id, input) + if err != nil { + return fmt.Errorf("performing ValidateStackAtSubscription: %+v", err) + } + + if err := result.Poller.PollUntilDone(ctx); err != nil { + return fmt.Errorf("polling after ValidateStackAtSubscription: %+v", err) + } + + return nil +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_actiononunmanage.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_actiononunmanage.go new file mode 100644 index 00000000000..7740c79bfa0 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_actiononunmanage.go @@ -0,0 +1,10 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ActionOnUnmanage struct { + ManagementGroups *DeploymentStacksDeleteDetachEnum `json:"managementGroups,omitempty"` + ResourceGroups *DeploymentStacksDeleteDetachEnum `json:"resourceGroups,omitempty"` + Resources DeploymentStacksDeleteDetachEnum `json:"resources"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_denysettings.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_denysettings.go new file mode 100644 index 00000000000..b0f379cdd05 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_denysettings.go @@ -0,0 +1,11 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DenySettings struct { + ApplyToChildScopes *bool `json:"applyToChildScopes,omitempty"` + ExcludedActions *[]string `json:"excludedActions,omitempty"` + ExcludedPrincipals *[]string `json:"excludedPrincipals,omitempty"` + Mode DenySettingsMode `json:"mode"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentparameter.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentparameter.go new file mode 100644 index 00000000000..5babbd1cacc --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentparameter.go @@ -0,0 +1,10 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentParameter struct { + Reference *KeyVaultParameterReference `json:"reference,omitempty"` + Type *string `json:"type,omitempty"` + Value *interface{} `json:"value,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstack.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstack.go new file mode 100644 index 00000000000..a5a58a99850 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstack.go @@ -0,0 +1,18 @@ +package deploymentstacks + +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 DeploymentStack struct { + Id *string `json:"id,omitempty"` + Location *string `json:"location,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DeploymentStackProperties `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/resources/2024-03-01/deploymentstacks/model_deploymentstackproperties.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackproperties.go new file mode 100644 index 00000000000..c2b1b48e84e --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackproperties.go @@ -0,0 +1,27 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStackProperties struct { + ActionOnUnmanage ActionOnUnmanage `json:"actionOnUnmanage"` + BypassStackOutOfSyncError *bool `json:"bypassStackOutOfSyncError,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + DebugSetting *DeploymentStacksDebugSetting `json:"debugSetting,omitempty"` + DeletedResources *[]ResourceReference `json:"deletedResources,omitempty"` + DenySettings DenySettings `json:"denySettings"` + DeploymentId *string `json:"deploymentId,omitempty"` + DeploymentScope *string `json:"deploymentScope,omitempty"` + Description *string `json:"description,omitempty"` + DetachedResources *[]ResourceReference `json:"detachedResources,omitempty"` + Duration *string `json:"duration,omitempty"` + Error *ErrorDetail `json:"error,omitempty"` + FailedResources *[]ResourceReferenceExtended `json:"failedResources,omitempty"` + Outputs *interface{} `json:"outputs,omitempty"` + Parameters *map[string]DeploymentParameter `json:"parameters,omitempty"` + ParametersLink *DeploymentStacksParametersLink `json:"parametersLink,omitempty"` + ProvisioningState *DeploymentStackProvisioningState `json:"provisioningState,omitempty"` + Resources *[]ManagedResourceReference `json:"resources,omitempty"` + Template *interface{} `json:"template,omitempty"` + TemplateLink *DeploymentStacksTemplateLink `json:"templateLink,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksdebugsetting.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksdebugsetting.go new file mode 100644 index 00000000000..813772a6e08 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksdebugsetting.go @@ -0,0 +1,8 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStacksDebugSetting struct { + DetailLevel *string `json:"detailLevel,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksparameterslink.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksparameterslink.go new file mode 100644 index 00000000000..62608b9fca4 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacksparameterslink.go @@ -0,0 +1,9 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStacksParametersLink struct { + ContentVersion *string `json:"contentVersion,omitempty"` + Uri string `json:"uri"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackstemplatelink.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackstemplatelink.go new file mode 100644 index 00000000000..96b5f3ebc29 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackstemplatelink.go @@ -0,0 +1,12 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStacksTemplateLink struct { + ContentVersion *string `json:"contentVersion,omitempty"` + Id *string `json:"id,omitempty"` + QueryString *string `json:"queryString,omitempty"` + RelativePath *string `json:"relativePath,omitempty"` + Uri *string `json:"uri,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacktemplatedefinition.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacktemplatedefinition.go new file mode 100644 index 00000000000..e25e9ae96a8 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstacktemplatedefinition.go @@ -0,0 +1,9 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStackTemplateDefinition struct { + Template *interface{} `json:"template,omitempty"` + TemplateLink *DeploymentStacksTemplateLink `json:"templateLink,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateproperties.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateproperties.go new file mode 100644 index 00000000000..0c31ae31304 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateproperties.go @@ -0,0 +1,15 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStackValidateProperties struct { + ActionOnUnmanage *ActionOnUnmanage `json:"actionOnUnmanage,omitempty"` + CorrelationId *string `json:"correlationId,omitempty"` + DenySettings *DenySettings `json:"denySettings,omitempty"` + DeploymentScope *string `json:"deploymentScope,omitempty"` + Description *string `json:"description,omitempty"` + Parameters *map[string]DeploymentParameter `json:"parameters,omitempty"` + TemplateLink *DeploymentStacksTemplateLink `json:"templateLink,omitempty"` + ValidatedResources *[]ResourceReference `json:"validatedResources,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateresult.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateresult.go new file mode 100644 index 00000000000..b88e9815aaa --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_deploymentstackvalidateresult.go @@ -0,0 +1,17 @@ +package deploymentstacks + +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 DeploymentStackValidateResult struct { + Error *ErrorDetail `json:"error,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Properties *DeploymentStackValidateProperties `json:"properties,omitempty"` + SystemData *systemdata.SystemData `json:"systemData,omitempty"` + Type *string `json:"type,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_erroradditionalinfo.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_erroradditionalinfo.go new file mode 100644 index 00000000000..69f531a2722 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_erroradditionalinfo.go @@ -0,0 +1,9 @@ +package deploymentstacks + +// 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/resources/2024-03-01/deploymentstacks/model_errordetail.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_errordetail.go new file mode 100644 index 00000000000..b4c7deb7f59 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_errordetail.go @@ -0,0 +1,12 @@ +package deploymentstacks + +// 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/resources/2024-03-01/deploymentstacks/model_keyvaultparameterreference.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultparameterreference.go new file mode 100644 index 00000000000..7ad6f38bd89 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultparameterreference.go @@ -0,0 +1,10 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultParameterReference struct { + KeyVault KeyVaultReference `json:"keyVault"` + SecretName string `json:"secretName"` + SecretVersion *string `json:"secretVersion,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultreference.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultreference.go new file mode 100644 index 00000000000..7e4006b1820 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_keyvaultreference.go @@ -0,0 +1,8 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type KeyVaultReference struct { + Id string `json:"id"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_managedresourcereference.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_managedresourcereference.go new file mode 100644 index 00000000000..0843b94e211 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_managedresourcereference.go @@ -0,0 +1,10 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ManagedResourceReference struct { + DenyStatus *DenyStatusMode `json:"denyStatus,omitempty"` + Id *string `json:"id,omitempty"` + Status *ResourceStatusMode `json:"status,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereference.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereference.go new file mode 100644 index 00000000000..e3cecdebd04 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereference.go @@ -0,0 +1,8 @@ +package deploymentstacks + +// 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/resources/2024-03-01/deploymentstacks/model_resourcereferenceextended.go b/resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereferenceextended.go new file mode 100644 index 00000000000..655e56665a5 --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/model_resourcereferenceextended.go @@ -0,0 +1,9 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type ResourceReferenceExtended struct { + Error *ErrorDetail `json:"error,omitempty"` + Id *string `json:"id,omitempty"` +} diff --git a/resource-manager/resources/2024-03-01/deploymentstacks/predicates.go b/resource-manager/resources/2024-03-01/deploymentstacks/predicates.go new file mode 100644 index 00000000000..cbbde07dbbe --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/predicates.go @@ -0,0 +1,32 @@ +package deploymentstacks + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See NOTICE.txt in the project root for license information. + +type DeploymentStackOperationPredicate struct { + Id *string + Location *string + Name *string + Type *string +} + +func (p DeploymentStackOperationPredicate) Matches(input DeploymentStack) bool { + + if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { + return false + } + + if p.Location != nil && (input.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/resources/2024-03-01/deploymentstacks/version.go b/resource-manager/resources/2024-03-01/deploymentstacks/version.go new file mode 100644 index 00000000000..094e81b693f --- /dev/null +++ b/resource-manager/resources/2024-03-01/deploymentstacks/version.go @@ -0,0 +1,12 @@ +package deploymentstacks + +import "fmt" + +// 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-03-01" + +func userAgent() string { + return fmt.Sprintf("hashicorp/go-azure-sdk/deploymentstacks/%s", defaultApiVersion) +} diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/README.md b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/README.md deleted file mode 100644 index 332d1000c87..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/README.md +++ /dev/null @@ -1,58 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/advancedthreatprotection` Documentation - -The `advancedthreatprotection` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/advancedthreatprotection" -``` - - -### Client Initialization - -```go -client := advancedthreatprotection.NewAdvancedThreatProtectionClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdvancedThreatProtectionClient.Create` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -payload := advancedthreatprotection.AdvancedThreatProtectionSetting{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AdvancedThreatProtectionClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -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 -} -``` diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/client.go b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/client.go deleted file mode 100644 index f6a8e468e8f..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package advancedthreatprotection - -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 AdvancedThreatProtectionClient struct { - Client *resourcemanager.Client -} - -func NewAdvancedThreatProtectionClientWithBaseURI(sdkApi sdkEnv.Api) (*AdvancedThreatProtectionClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "advancedthreatprotection", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AdvancedThreatProtectionClient: %+v", err) - } - - return &AdvancedThreatProtectionClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_create.go b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_create.go deleted file mode 100644 index e61c0708116..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_create.go +++ /dev/null @@ -1,60 +0,0 @@ -package advancedthreatprotection - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AdvancedThreatProtectionSetting -} - -// Create ... -func (c AdvancedThreatProtectionClient) Create(ctx context.Context, id commonids.ScopeId, input AdvancedThreatProtectionSetting) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/advancedThreatProtectionSettings/current", 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 AdvancedThreatProtectionSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_get.go b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_get.go deleted file mode 100644 index bd66a54c4d3..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/method_get.go +++ /dev/null @@ -1,56 +0,0 @@ -package advancedthreatprotection - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AdvancedThreatProtectionSetting -} - -// Get ... -func (c AdvancedThreatProtectionClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/advancedThreatProtectionSettings/current", 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 AdvancedThreatProtectionSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionproperties.go b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionproperties.go deleted file mode 100644 index 46f35818e85..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package advancedthreatprotection - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdvancedThreatProtectionProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionsetting.go b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionsetting.go deleted file mode 100644 index 428c0f467b7..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/model_advancedthreatprotectionsetting.go +++ /dev/null @@ -1,11 +0,0 @@ -package advancedthreatprotection - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdvancedThreatProtectionSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/version.go b/resource-manager/security/2017-08-01-preview/advancedthreatprotection/version.go deleted file mode 100644 index 1adc24dc4b3..00000000000 --- a/resource-manager/security/2017-08-01-preview/advancedthreatprotection/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package advancedthreatprotection - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/advancedthreatprotection/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/README.md b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/README.md deleted file mode 100644 index 1a2ed8c77a3..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/README.md +++ /dev/null @@ -1,75 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/autoprovisioningsettings` Documentation - -The `autoprovisioningsettings` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/autoprovisioningsettings" -``` - - -### Client Initialization - -```go -client := autoprovisioningsettings.NewAutoProvisioningSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AutoProvisioningSettingsClient.Create` - -```go -ctx := context.TODO() -id := autoprovisioningsettings.NewAutoProvisioningSettingID("12345678-1234-9876-4563-123456789012", "autoProvisioningSettingValue") - -payload := autoprovisioningsettings.AutoProvisioningSetting{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AutoProvisioningSettingsClient.Get` - -```go -ctx := context.TODO() -id := autoprovisioningsettings.NewAutoProvisioningSettingID("12345678-1234-9876-4563-123456789012", "autoProvisioningSettingValue") - -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: `AutoProvisioningSettingsClient.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 -} -``` diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/client.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/client.go deleted file mode 100644 index 23b3a3dd251..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package autoprovisioningsettings - -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 AutoProvisioningSettingsClient struct { - Client *resourcemanager.Client -} - -func NewAutoProvisioningSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*AutoProvisioningSettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "autoprovisioningsettings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AutoProvisioningSettingsClient: %+v", err) - } - - return &AutoProvisioningSettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/constants.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/constants.go deleted file mode 100644 index 2c413f12174..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package autoprovisioningsettings - -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 AutoProvision string - -const ( - AutoProvisionOff AutoProvision = "Off" - AutoProvisionOn AutoProvision = "On" -) - -func PossibleValuesForAutoProvision() []string { - return []string{ - string(AutoProvisionOff), - string(AutoProvisionOn), - } -} - -func (s *AutoProvision) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutoProvision(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutoProvision(input string) (*AutoProvision, error) { - vals := map[string]AutoProvision{ - "off": AutoProvisionOff, - "on": AutoProvisionOn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutoProvision(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting.go deleted file mode 100644 index c5e6c766297..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting.go +++ /dev/null @@ -1,121 +0,0 @@ -package autoprovisioningsettings - -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(&AutoProvisioningSettingId{}) -} - -var _ resourceids.ResourceId = &AutoProvisioningSettingId{} - -// AutoProvisioningSettingId is a struct representing the Resource ID for a Auto Provisioning Setting -type AutoProvisioningSettingId struct { - SubscriptionId string - AutoProvisioningSettingName string -} - -// NewAutoProvisioningSettingID returns a new AutoProvisioningSettingId struct -func NewAutoProvisioningSettingID(subscriptionId string, autoProvisioningSettingName string) AutoProvisioningSettingId { - return AutoProvisioningSettingId{ - SubscriptionId: subscriptionId, - AutoProvisioningSettingName: autoProvisioningSettingName, - } -} - -// ParseAutoProvisioningSettingID parses 'input' into a AutoProvisioningSettingId -func ParseAutoProvisioningSettingID(input string) (*AutoProvisioningSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutoProvisioningSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutoProvisioningSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAutoProvisioningSettingIDInsensitively parses 'input' case-insensitively into a AutoProvisioningSettingId -// note: this method should only be used for API response data and not user input -func ParseAutoProvisioningSettingIDInsensitively(input string) (*AutoProvisioningSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutoProvisioningSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutoProvisioningSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AutoProvisioningSettingId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.AutoProvisioningSettingName, ok = input.Parsed["autoProvisioningSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "autoProvisioningSettingName", input) - } - - return nil -} - -// ValidateAutoProvisioningSettingID checks that 'input' can be parsed as a Auto Provisioning Setting ID -func ValidateAutoProvisioningSettingID(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 := ParseAutoProvisioningSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Auto Provisioning Setting ID -func (id AutoProvisioningSettingId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/autoProvisioningSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.AutoProvisioningSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Auto Provisioning Setting ID -func (id AutoProvisioningSettingId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticAutoProvisioningSettings", "autoProvisioningSettings", "autoProvisioningSettings"), - resourceids.UserSpecifiedSegment("autoProvisioningSettingName", "autoProvisioningSettingValue"), - } -} - -// String returns a human-readable description of this Auto Provisioning Setting ID -func (id AutoProvisioningSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Auto Provisioning Setting Name: %q", id.AutoProvisioningSettingName), - } - return fmt.Sprintf("Auto Provisioning Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting_test.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting_test.go deleted file mode 100644 index 3bbce55b31d..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/id_autoprovisioningsetting_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package autoprovisioningsettings - -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 = &AutoProvisioningSettingId{} - -func TestNewAutoProvisioningSettingID(t *testing.T) { - id := NewAutoProvisioningSettingID("12345678-1234-9876-4563-123456789012", "autoProvisioningSettingValue") - - 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.AutoProvisioningSettingName != "autoProvisioningSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'AutoProvisioningSettingName'", id.AutoProvisioningSettingName, "autoProvisioningSettingValue") - } -} - -func TestFormatAutoProvisioningSettingID(t *testing.T) { - actual := NewAutoProvisioningSettingID("12345678-1234-9876-4563-123456789012", "autoProvisioningSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings/autoProvisioningSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAutoProvisioningSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutoProvisioningSettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings/autoProvisioningSettingValue", - Expected: &AutoProvisioningSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AutoProvisioningSettingName: "autoProvisioningSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings/autoProvisioningSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutoProvisioningSettingID(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.AutoProvisioningSettingName != v.Expected.AutoProvisioningSettingName { - t.Fatalf("Expected %q but got %q for AutoProvisioningSettingName", v.Expected.AutoProvisioningSettingName, actual.AutoProvisioningSettingName) - } - - } -} - -func TestParseAutoProvisioningSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutoProvisioningSettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/aUtOpRoViSiOnInGsEtTiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings/autoProvisioningSettingValue", - Expected: &AutoProvisioningSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AutoProvisioningSettingName: "autoProvisioningSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/autoProvisioningSettings/autoProvisioningSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/aUtOpRoViSiOnInGsEtTiNgS/aUtOpRoViSiOnInGsEtTiNgVaLuE", - Expected: &AutoProvisioningSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - AutoProvisioningSettingName: "aUtOpRoViSiOnInGsEtTiNgVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/aUtOpRoViSiOnInGsEtTiNgS/aUtOpRoViSiOnInGsEtTiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutoProvisioningSettingIDInsensitively(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.AutoProvisioningSettingName != v.Expected.AutoProvisioningSettingName { - t.Fatalf("Expected %q but got %q for AutoProvisioningSettingName", v.Expected.AutoProvisioningSettingName, actual.AutoProvisioningSettingName) - } - - } -} - -func TestSegmentsForAutoProvisioningSettingId(t *testing.T) { - segments := AutoProvisioningSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AutoProvisioningSettingId 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/security/2017-08-01-preview/autoprovisioningsettings/method_create.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_create.go deleted file mode 100644 index a694c00623c..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package autoprovisioningsettings - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AutoProvisioningSetting -} - -// Create ... -func (c AutoProvisioningSettingsClient) Create(ctx context.Context, id AutoProvisioningSettingId, input AutoProvisioningSetting) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 AutoProvisioningSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_get.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_get.go deleted file mode 100644 index 13a574f8e49..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package autoprovisioningsettings - -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 *AutoProvisioningSetting -} - -// Get ... -func (c AutoProvisioningSettingsClient) Get(ctx context.Context, id AutoProvisioningSettingId) (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 AutoProvisioningSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_list.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_list.go deleted file mode 100644 index 924f07a9554..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package autoprovisioningsettings - -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 *[]AutoProvisioningSetting -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutoProvisioningSetting -} - -// List ... -func (c AutoProvisioningSettingsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/autoProvisioningSettings", 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 *[]AutoProvisioningSetting `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 AutoProvisioningSettingsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AutoProvisioningSettingOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AutoProvisioningSettingsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate AutoProvisioningSettingOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AutoProvisioningSetting, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsetting.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsetting.go deleted file mode 100644 index 0ec4d16fb7f..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsetting.go +++ /dev/null @@ -1,11 +0,0 @@ -package autoprovisioningsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoProvisioningSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AutoProvisioningSettingProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsettingproperties.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsettingproperties.go deleted file mode 100644 index 5eac397d757..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/model_autoprovisioningsettingproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package autoprovisioningsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoProvisioningSettingProperties struct { - AutoProvision AutoProvision `json:"autoProvision"` -} diff --git a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/predicates.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/predicates.go deleted file mode 100644 index fc0aadec9a4..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package autoprovisioningsettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutoProvisioningSettingOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p AutoProvisioningSettingOperationPredicate) Matches(input AutoProvisioningSetting) 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/security/2017-08-01-preview/autoprovisioningsettings/version.go b/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/version.go deleted file mode 100644 index c72f0cb58f2..00000000000 --- a/resource-manager/security/2017-08-01-preview/autoprovisioningsettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package autoprovisioningsettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/autoprovisioningsettings/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/client.go b/resource-manager/security/2017-08-01-preview/client.go deleted file mode 100644 index 01e25cd0393..00000000000 --- a/resource-manager/security/2017-08-01-preview/client.go +++ /dev/null @@ -1,118 +0,0 @@ -package v2017_08_01_preview - -// 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/security/2017-08-01-preview/advancedthreatprotection" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/autoprovisioningsettings" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/compliances" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/devicesecuritygroups" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/informationprotectionpolicies" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/iotsecuritysolutions" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/pricings" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/securitycontacts" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/settings" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/workspacesettings" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - AdvancedThreatProtection *advancedthreatprotection.AdvancedThreatProtectionClient - AutoProvisioningSettings *autoprovisioningsettings.AutoProvisioningSettingsClient - Compliances *compliances.CompliancesClient - DeviceSecurityGroups *devicesecuritygroups.DeviceSecurityGroupsClient - InformationProtectionPolicies *informationprotectionpolicies.InformationProtectionPoliciesClient - IoTSecuritySolutionsAnalytics *iotsecuritysolutionsanalytics.IoTSecuritySolutionsAnalyticsClient - IotSecuritySolutions *iotsecuritysolutions.IotSecuritySolutionsClient - Pricings *pricings.PricingsClient - SecurityContacts *securitycontacts.SecurityContactsClient - Settings *settings.SettingsClient - WorkspaceSettings *workspacesettings.WorkspaceSettingsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - advancedThreatProtectionClient, err := advancedthreatprotection.NewAdvancedThreatProtectionClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdvancedThreatProtection client: %+v", err) - } - configureFunc(advancedThreatProtectionClient.Client) - - autoProvisioningSettingsClient, err := autoprovisioningsettings.NewAutoProvisioningSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AutoProvisioningSettings client: %+v", err) - } - configureFunc(autoProvisioningSettingsClient.Client) - - compliancesClient, err := compliances.NewCompliancesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Compliances client: %+v", err) - } - configureFunc(compliancesClient.Client) - - deviceSecurityGroupsClient, err := devicesecuritygroups.NewDeviceSecurityGroupsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DeviceSecurityGroups client: %+v", err) - } - configureFunc(deviceSecurityGroupsClient.Client) - - informationProtectionPoliciesClient, err := informationprotectionpolicies.NewInformationProtectionPoliciesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building InformationProtectionPolicies client: %+v", err) - } - configureFunc(informationProtectionPoliciesClient.Client) - - ioTSecuritySolutionsAnalyticsClient, err := iotsecuritysolutionsanalytics.NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IoTSecuritySolutionsAnalytics client: %+v", err) - } - configureFunc(ioTSecuritySolutionsAnalyticsClient.Client) - - iotSecuritySolutionsClient, err := iotsecuritysolutions.NewIotSecuritySolutionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IotSecuritySolutions client: %+v", err) - } - configureFunc(iotSecuritySolutionsClient.Client) - - pricingsClient, err := pricings.NewPricingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Pricings client: %+v", err) - } - configureFunc(pricingsClient.Client) - - securityContactsClient, err := securitycontacts.NewSecurityContactsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityContacts client: %+v", err) - } - configureFunc(securityContactsClient.Client) - - settingsClient, err := settings.NewSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Settings client: %+v", err) - } - configureFunc(settingsClient.Client) - - workspaceSettingsClient, err := workspacesettings.NewWorkspaceSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WorkspaceSettings client: %+v", err) - } - configureFunc(workspaceSettingsClient.Client) - - return &Client{ - AdvancedThreatProtection: advancedThreatProtectionClient, - AutoProvisioningSettings: autoProvisioningSettingsClient, - Compliances: compliancesClient, - DeviceSecurityGroups: deviceSecurityGroupsClient, - InformationProtectionPolicies: informationProtectionPoliciesClient, - IoTSecuritySolutionsAnalytics: ioTSecuritySolutionsAnalyticsClient, - IotSecuritySolutions: iotSecuritySolutionsClient, - Pricings: pricingsClient, - SecurityContacts: securityContactsClient, - Settings: settingsClient, - WorkspaceSettings: workspaceSettingsClient, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/README.md b/resource-manager/security/2017-08-01-preview/compliances/README.md deleted file mode 100644 index cb278cfb645..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/README.md +++ /dev/null @@ -1,54 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/compliances` Documentation - -The `compliances` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/compliances" -``` - - -### Client Initialization - -```go -client := compliances.NewCompliancesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CompliancesClient.Get` - -```go -ctx := context.TODO() -id := compliances.NewScopedComplianceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "complianceValue") - -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: `CompliancesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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/security/2017-08-01-preview/compliances/client.go b/resource-manager/security/2017-08-01-preview/compliances/client.go deleted file mode 100644 index 90d4f909cb6..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package compliances - -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 CompliancesClient struct { - Client *resourcemanager.Client -} - -func NewCompliancesClientWithBaseURI(sdkApi sdkEnv.Api) (*CompliancesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "compliances", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CompliancesClient: %+v", err) - } - - return &CompliancesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance.go b/resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance.go deleted file mode 100644 index 5b8162d2d41..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance.go +++ /dev/null @@ -1,120 +0,0 @@ -package compliances - -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(&ScopedComplianceId{}) -} - -var _ resourceids.ResourceId = &ScopedComplianceId{} - -// ScopedComplianceId is a struct representing the Resource ID for a Scoped Compliance -type ScopedComplianceId struct { - Scope string - ComplianceName string -} - -// NewScopedComplianceID returns a new ScopedComplianceId struct -func NewScopedComplianceID(scope string, complianceName string) ScopedComplianceId { - return ScopedComplianceId{ - Scope: scope, - ComplianceName: complianceName, - } -} - -// ParseScopedComplianceID parses 'input' into a ScopedComplianceId -func ParseScopedComplianceID(input string) (*ScopedComplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedComplianceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedComplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedComplianceIDInsensitively parses 'input' case-insensitively into a ScopedComplianceId -// note: this method should only be used for API response data and not user input -func ParseScopedComplianceIDInsensitively(input string) (*ScopedComplianceId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedComplianceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedComplianceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedComplianceId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if id.ComplianceName, ok = input.Parsed["complianceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "complianceName", input) - } - - return nil -} - -// ValidateScopedComplianceID checks that 'input' can be parsed as a Scoped Compliance ID -func ValidateScopedComplianceID(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 := ParseScopedComplianceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Compliance ID -func (id ScopedComplianceId) ID() string { - fmtString := "/%s/providers/Microsoft.Security/compliances/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), id.ComplianceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Compliance ID -func (id ScopedComplianceId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticCompliances", "compliances", "compliances"), - resourceids.UserSpecifiedSegment("complianceName", "complianceValue"), - } -} - -// String returns a human-readable description of this Scoped Compliance ID -func (id ScopedComplianceId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Compliance Name: %q", id.ComplianceName), - } - return fmt.Sprintf("Scoped Compliance (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance_test.go b/resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance_test.go deleted file mode 100644 index ce792ea2db1..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/id_scopedcompliance_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package compliances - -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 = &ScopedComplianceId{} - -func TestNewScopedComplianceID(t *testing.T) { - id := NewScopedComplianceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "complianceValue") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.ComplianceName != "complianceValue" { - t.Fatalf("Expected %q but got %q for Segment 'ComplianceName'", id.ComplianceName, "complianceValue") - } -} - -func TestFormatScopedComplianceID(t *testing.T) { - actual := NewScopedComplianceID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "complianceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances/complianceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedComplianceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedComplianceId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances/complianceValue", - Expected: &ScopedComplianceId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ComplianceName: "complianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances/complianceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedComplianceID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ComplianceName != v.Expected.ComplianceName { - t.Fatalf("Expected %q but got %q for ComplianceName", v.Expected.ComplianceName, actual.ComplianceName) - } - - } -} - -func TestParseScopedComplianceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedComplianceId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/cOmPlIaNcEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances/complianceValue", - Expected: &ScopedComplianceId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - ComplianceName: "complianceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/compliances/complianceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/cOmPlIaNcEs/cOmPlIaNcEvAlUe", - Expected: &ScopedComplianceId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - ComplianceName: "cOmPlIaNcEvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/cOmPlIaNcEs/cOmPlIaNcEvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedComplianceIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.ComplianceName != v.Expected.ComplianceName { - t.Fatalf("Expected %q but got %q for ComplianceName", v.Expected.ComplianceName, actual.ComplianceName) - } - - } -} - -func TestSegmentsForScopedComplianceId(t *testing.T) { - segments := ScopedComplianceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedComplianceId 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/security/2017-08-01-preview/compliances/method_get.go b/resource-manager/security/2017-08-01-preview/compliances/method_get.go deleted file mode 100644 index e6a58d2b897..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package compliances - -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 *Compliance -} - -// Get ... -func (c CompliancesClient) Get(ctx context.Context, id ScopedComplianceId) (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 Compliance - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/method_list.go b/resource-manager/security/2017-08-01-preview/compliances/method_list.go deleted file mode 100644 index eae5e596950..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package compliances - -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 *[]Compliance -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Compliance -} - -// List ... -func (c CompliancesClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/compliances", 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 *[]Compliance `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 CompliancesClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, ComplianceOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c CompliancesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate ComplianceOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Compliance, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/compliances/model_compliance.go b/resource-manager/security/2017-08-01-preview/compliances/model_compliance.go deleted file mode 100644 index 7ed33c36f2c..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/model_compliance.go +++ /dev/null @@ -1,11 +0,0 @@ -package compliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Compliance struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ComplianceProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/model_complianceproperties.go b/resource-manager/security/2017-08-01-preview/compliances/model_complianceproperties.go deleted file mode 100644 index f1ea19441f4..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/model_complianceproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package compliances - -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 ComplianceProperties struct { - AssessmentResult *[]ComplianceSegment `json:"assessmentResult,omitempty"` - AssessmentTimestampUtcDate *string `json:"assessmentTimestampUtcDate,omitempty"` - ResourceCount *int64 `json:"resourceCount,omitempty"` -} - -func (o *ComplianceProperties) GetAssessmentTimestampUtcDateAsTime() (*time.Time, error) { - if o.AssessmentTimestampUtcDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.AssessmentTimestampUtcDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *ComplianceProperties) SetAssessmentTimestampUtcDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.AssessmentTimestampUtcDate = &formatted -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/model_compliancesegment.go b/resource-manager/security/2017-08-01-preview/compliances/model_compliancesegment.go deleted file mode 100644 index 62bd8e685e0..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/model_compliancesegment.go +++ /dev/null @@ -1,9 +0,0 @@ -package compliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComplianceSegment struct { - Percentage *float64 `json:"percentage,omitempty"` - SegmentType *string `json:"segmentType,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/compliances/predicates.go b/resource-manager/security/2017-08-01-preview/compliances/predicates.go deleted file mode 100644 index a0849ac334c..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package compliances - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ComplianceOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p ComplianceOperationPredicate) Matches(input Compliance) 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/security/2017-08-01-preview/compliances/version.go b/resource-manager/security/2017-08-01-preview/compliances/version.go deleted file mode 100644 index c5f5821fd7c..00000000000 --- a/resource-manager/security/2017-08-01-preview/compliances/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package compliances - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/compliances/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/README.md b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/README.md deleted file mode 100644 index f2ff6f975f2..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/README.md +++ /dev/null @@ -1,91 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/devicesecuritygroups` Documentation - -The `devicesecuritygroups` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/devicesecuritygroups" -``` - - -### Client Initialization - -```go -client := devicesecuritygroups.NewDeviceSecurityGroupsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DeviceSecurityGroupsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := devicesecuritygroups.NewScopedDeviceSecurityGroupID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deviceSecurityGroupValue") - -payload := devicesecuritygroups.DeviceSecurityGroup{ - // ... -} - - -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: `DeviceSecurityGroupsClient.Delete` - -```go -ctx := context.TODO() -id := devicesecuritygroups.NewScopedDeviceSecurityGroupID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deviceSecurityGroupValue") - -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: `DeviceSecurityGroupsClient.Get` - -```go -ctx := context.TODO() -id := devicesecuritygroups.NewScopedDeviceSecurityGroupID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deviceSecurityGroupValue") - -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: `DeviceSecurityGroupsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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/security/2017-08-01-preview/devicesecuritygroups/client.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/client.go deleted file mode 100644 index 28a38adb72d..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package devicesecuritygroups - -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 DeviceSecurityGroupsClient struct { - Client *resourcemanager.Client -} - -func NewDeviceSecurityGroupsClientWithBaseURI(sdkApi sdkEnv.Api) (*DeviceSecurityGroupsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "devicesecuritygroups", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DeviceSecurityGroupsClient: %+v", err) - } - - return &DeviceSecurityGroupsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/constants.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/constants.go deleted file mode 100644 index 6445089285f..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package devicesecuritygroups - -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 ValueType string - -const ( - ValueTypeIPCidr ValueType = "IpCidr" - ValueTypeString ValueType = "String" -) - -func PossibleValuesForValueType() []string { - return []string{ - string(ValueTypeIPCidr), - string(ValueTypeString), - } -} - -func (s *ValueType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseValueType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseValueType(input string) (*ValueType, error) { - vals := map[string]ValueType{ - "ipcidr": ValueTypeIPCidr, - "string": ValueTypeString, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ValueType(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup.go deleted file mode 100644 index 98088a4449d..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup.go +++ /dev/null @@ -1,120 +0,0 @@ -package devicesecuritygroups - -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(&ScopedDeviceSecurityGroupId{}) -} - -var _ resourceids.ResourceId = &ScopedDeviceSecurityGroupId{} - -// ScopedDeviceSecurityGroupId is a struct representing the Resource ID for a Scoped Device Security Group -type ScopedDeviceSecurityGroupId struct { - ResourceId string - DeviceSecurityGroupName string -} - -// NewScopedDeviceSecurityGroupID returns a new ScopedDeviceSecurityGroupId struct -func NewScopedDeviceSecurityGroupID(resourceId string, deviceSecurityGroupName string) ScopedDeviceSecurityGroupId { - return ScopedDeviceSecurityGroupId{ - ResourceId: resourceId, - DeviceSecurityGroupName: deviceSecurityGroupName, - } -} - -// ParseScopedDeviceSecurityGroupID parses 'input' into a ScopedDeviceSecurityGroupId -func ParseScopedDeviceSecurityGroupID(input string) (*ScopedDeviceSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedDeviceSecurityGroupId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedDeviceSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedDeviceSecurityGroupIDInsensitively parses 'input' case-insensitively into a ScopedDeviceSecurityGroupId -// note: this method should only be used for API response data and not user input -func ParseScopedDeviceSecurityGroupIDInsensitively(input string) (*ScopedDeviceSecurityGroupId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedDeviceSecurityGroupId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedDeviceSecurityGroupId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedDeviceSecurityGroupId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.ResourceId, ok = input.Parsed["resourceId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "resourceId", input) - } - - if id.DeviceSecurityGroupName, ok = input.Parsed["deviceSecurityGroupName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "deviceSecurityGroupName", input) - } - - return nil -} - -// ValidateScopedDeviceSecurityGroupID checks that 'input' can be parsed as a Scoped Device Security Group ID -func ValidateScopedDeviceSecurityGroupID(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 := ParseScopedDeviceSecurityGroupID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Device Security Group ID -func (id ScopedDeviceSecurityGroupId) ID() string { - fmtString := "/%s/providers/Microsoft.Security/deviceSecurityGroups/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.ResourceId, "/"), id.DeviceSecurityGroupName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Device Security Group ID -func (id ScopedDeviceSecurityGroupId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("resourceId", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticDeviceSecurityGroups", "deviceSecurityGroups", "deviceSecurityGroups"), - resourceids.UserSpecifiedSegment("deviceSecurityGroupName", "deviceSecurityGroupValue"), - } -} - -// String returns a human-readable description of this Scoped Device Security Group ID -func (id ScopedDeviceSecurityGroupId) String() string { - components := []string{ - fmt.Sprintf("Resource: %q", id.ResourceId), - fmt.Sprintf("Device Security Group Name: %q", id.DeviceSecurityGroupName), - } - return fmt.Sprintf("Scoped Device Security Group (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup_test.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup_test.go deleted file mode 100644 index 5e71776eefe..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/id_scopeddevicesecuritygroup_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package devicesecuritygroups - -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 = &ScopedDeviceSecurityGroupId{} - -func TestNewScopedDeviceSecurityGroupID(t *testing.T) { - id := NewScopedDeviceSecurityGroupID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deviceSecurityGroupValue") - - if id.ResourceId != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'ResourceId'", id.ResourceId, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.DeviceSecurityGroupName != "deviceSecurityGroupValue" { - t.Fatalf("Expected %q but got %q for Segment 'DeviceSecurityGroupName'", id.DeviceSecurityGroupName, "deviceSecurityGroupValue") - } -} - -func TestFormatScopedDeviceSecurityGroupID(t *testing.T) { - actual := NewScopedDeviceSecurityGroupID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "deviceSecurityGroupValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups/deviceSecurityGroupValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedDeviceSecurityGroupID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedDeviceSecurityGroupId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups/deviceSecurityGroupValue", - Expected: &ScopedDeviceSecurityGroupId{ - ResourceId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DeviceSecurityGroupName: "deviceSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups/deviceSecurityGroupValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedDeviceSecurityGroupID(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.ResourceId != v.Expected.ResourceId { - t.Fatalf("Expected %q but got %q for ResourceId", v.Expected.ResourceId, actual.ResourceId) - } - - if actual.DeviceSecurityGroupName != v.Expected.DeviceSecurityGroupName { - t.Fatalf("Expected %q but got %q for DeviceSecurityGroupName", v.Expected.DeviceSecurityGroupName, actual.DeviceSecurityGroupName) - } - - } -} - -func TestParseScopedDeviceSecurityGroupIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedDeviceSecurityGroupId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/dEvIcEsEcUrItYgRoUpS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups/deviceSecurityGroupValue", - Expected: &ScopedDeviceSecurityGroupId{ - ResourceId: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - DeviceSecurityGroupName: "deviceSecurityGroupValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/deviceSecurityGroups/deviceSecurityGroupValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/dEvIcEsEcUrItYgRoUpS/dEvIcEsEcUrItYgRoUpVaLuE", - Expected: &ScopedDeviceSecurityGroupId{ - ResourceId: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - DeviceSecurityGroupName: "dEvIcEsEcUrItYgRoUpVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/dEvIcEsEcUrItYgRoUpS/dEvIcEsEcUrItYgRoUpVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedDeviceSecurityGroupIDInsensitively(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.ResourceId != v.Expected.ResourceId { - t.Fatalf("Expected %q but got %q for ResourceId", v.Expected.ResourceId, actual.ResourceId) - } - - if actual.DeviceSecurityGroupName != v.Expected.DeviceSecurityGroupName { - t.Fatalf("Expected %q but got %q for DeviceSecurityGroupName", v.Expected.DeviceSecurityGroupName, actual.DeviceSecurityGroupName) - } - - } -} - -func TestSegmentsForScopedDeviceSecurityGroupId(t *testing.T) { - segments := ScopedDeviceSecurityGroupId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedDeviceSecurityGroupId 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/security/2017-08-01-preview/devicesecuritygroups/method_createorupdate.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_createorupdate.go deleted file mode 100644 index 5999060cee7..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package devicesecuritygroups - -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 *DeviceSecurityGroup -} - -// CreateOrUpdate ... -func (c DeviceSecurityGroupsClient) CreateOrUpdate(ctx context.Context, id ScopedDeviceSecurityGroupId, input DeviceSecurityGroup) (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 DeviceSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_delete.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_delete.go deleted file mode 100644 index 33121e8c543..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package devicesecuritygroups - -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 DeviceSecurityGroupsClient) Delete(ctx context.Context, id ScopedDeviceSecurityGroupId) (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/security/2017-08-01-preview/devicesecuritygroups/method_get.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_get.go deleted file mode 100644 index a473adbdd9c..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package devicesecuritygroups - -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 *DeviceSecurityGroup -} - -// Get ... -func (c DeviceSecurityGroupsClient) Get(ctx context.Context, id ScopedDeviceSecurityGroupId) (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 DeviceSecurityGroup - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_list.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_list.go deleted file mode 100644 index 6e6f581fc2c..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package devicesecuritygroups - -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 *[]DeviceSecurityGroup -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DeviceSecurityGroup -} - -// List ... -func (c DeviceSecurityGroupsClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/deviceSecurityGroups", 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 *[]DeviceSecurityGroup `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 DeviceSecurityGroupsClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DeviceSecurityGroupOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DeviceSecurityGroupsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate DeviceSecurityGroupOperationPredicate) (result ListCompleteResult, err error) { - items := make([]DeviceSecurityGroup, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/devicesecuritygroups/model_allowlistcustomalertrule.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_allowlistcustomalertrule.go deleted file mode 100644 index 3684338085a..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_allowlistcustomalertrule.go +++ /dev/null @@ -1,13 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AllowlistCustomAlertRule struct { - AllowlistValues []string `json:"allowlistValues"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - IsEnabled bool `json:"isEnabled"` - RuleType string `json:"ruleType"` - ValueType *ValueType `json:"valueType,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_denylistcustomalertrule.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_denylistcustomalertrule.go deleted file mode 100644 index 45d260c64f5..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_denylistcustomalertrule.go +++ /dev/null @@ -1,13 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DenylistCustomAlertRule struct { - DenylistValues []string `json:"denylistValues"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - IsEnabled bool `json:"isEnabled"` - RuleType string `json:"ruleType"` - ValueType *ValueType `json:"valueType,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroup.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroup.go deleted file mode 100644 index 39bef7d1f98..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroup.go +++ /dev/null @@ -1,11 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceSecurityGroup struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *DeviceSecurityGroupProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroupproperties.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroupproperties.go deleted file mode 100644 index c86db7842b3..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_devicesecuritygroupproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceSecurityGroupProperties struct { - AllowlistRules *[]AllowlistCustomAlertRule `json:"allowlistRules,omitempty"` - DenylistRules *[]DenylistCustomAlertRule `json:"denylistRules,omitempty"` - ThresholdRules *[]ThresholdCustomAlertRule `json:"thresholdRules,omitempty"` - TimeWindowRules *[]TimeWindowCustomAlertRule `json:"timeWindowRules,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_thresholdcustomalertrule.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_thresholdcustomalertrule.go deleted file mode 100644 index 14b838e4ad3..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_thresholdcustomalertrule.go +++ /dev/null @@ -1,13 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThresholdCustomAlertRule struct { - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - IsEnabled bool `json:"isEnabled"` - MaxThreshold int64 `json:"maxThreshold"` - MinThreshold int64 `json:"minThreshold"` - RuleType string `json:"ruleType"` -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_timewindowcustomalertrule.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_timewindowcustomalertrule.go deleted file mode 100644 index 22341084266..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/model_timewindowcustomalertrule.go +++ /dev/null @@ -1,14 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimeWindowCustomAlertRule struct { - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - IsEnabled bool `json:"isEnabled"` - MaxThreshold int64 `json:"maxThreshold"` - MinThreshold int64 `json:"minThreshold"` - RuleType string `json:"ruleType"` - TimeWindowSize string `json:"timeWindowSize"` -} diff --git a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/predicates.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/predicates.go deleted file mode 100644 index c4ff87efcaa..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package devicesecuritygroups - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeviceSecurityGroupOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p DeviceSecurityGroupOperationPredicate) Matches(input DeviceSecurityGroup) 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/security/2017-08-01-preview/devicesecuritygroups/version.go b/resource-manager/security/2017-08-01-preview/devicesecuritygroups/version.go deleted file mode 100644 index 862de5403e7..00000000000 --- a/resource-manager/security/2017-08-01-preview/devicesecuritygroups/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package devicesecuritygroups - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/devicesecuritygroups/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/README.md b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/README.md deleted file mode 100644 index 2e8a9199b90..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/README.md +++ /dev/null @@ -1,75 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/informationprotectionpolicies` Documentation - -The `informationprotectionpolicies` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/informationprotectionpolicies" -``` - - -### Client Initialization - -```go -client := informationprotectionpolicies.NewInformationProtectionPoliciesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `InformationProtectionPoliciesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := informationprotectionpolicies.NewScopedInformationProtectionPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "custom") - -payload := informationprotectionpolicies.InformationProtectionPolicy{ - // ... -} - - -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: `InformationProtectionPoliciesClient.Get` - -```go -ctx := context.TODO() -id := informationprotectionpolicies.NewScopedInformationProtectionPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "custom") - -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: `InformationProtectionPoliciesClient.List` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -// 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/security/2017-08-01-preview/informationprotectionpolicies/client.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/client.go deleted file mode 100644 index 7e018db0ce6..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package informationprotectionpolicies - -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 InformationProtectionPoliciesClient struct { - Client *resourcemanager.Client -} - -func NewInformationProtectionPoliciesClientWithBaseURI(sdkApi sdkEnv.Api) (*InformationProtectionPoliciesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "informationprotectionpolicies", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating InformationProtectionPoliciesClient: %+v", err) - } - - return &InformationProtectionPoliciesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/constants.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/constants.go deleted file mode 100644 index 304f103f1ca..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/constants.go +++ /dev/null @@ -1,101 +0,0 @@ -package informationprotectionpolicies - -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 InformationProtectionPolicyName string - -const ( - InformationProtectionPolicyNameCustom InformationProtectionPolicyName = "custom" - InformationProtectionPolicyNameEffective InformationProtectionPolicyName = "effective" -) - -func PossibleValuesForInformationProtectionPolicyName() []string { - return []string{ - string(InformationProtectionPolicyNameCustom), - string(InformationProtectionPolicyNameEffective), - } -} - -func (s *InformationProtectionPolicyName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseInformationProtectionPolicyName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseInformationProtectionPolicyName(input string) (*InformationProtectionPolicyName, error) { - vals := map[string]InformationProtectionPolicyName{ - "custom": InformationProtectionPolicyNameCustom, - "effective": InformationProtectionPolicyNameEffective, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := InformationProtectionPolicyName(input) - return &out, nil -} - -type Rank string - -const ( - RankCritical Rank = "Critical" - RankHigh Rank = "High" - RankLow Rank = "Low" - RankMedium Rank = "Medium" - RankNone Rank = "None" -) - -func PossibleValuesForRank() []string { - return []string{ - string(RankCritical), - string(RankHigh), - string(RankLow), - string(RankMedium), - string(RankNone), - } -} - -func (s *Rank) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRank(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRank(input string) (*Rank, error) { - vals := map[string]Rank{ - "critical": RankCritical, - "high": RankHigh, - "low": RankLow, - "medium": RankMedium, - "none": RankNone, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Rank(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy.go deleted file mode 100644 index c580f5ee2b2..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy.go +++ /dev/null @@ -1,128 +0,0 @@ -package informationprotectionpolicies - -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(&ScopedInformationProtectionPolicyId{}) -} - -var _ resourceids.ResourceId = &ScopedInformationProtectionPolicyId{} - -// ScopedInformationProtectionPolicyId is a struct representing the Resource ID for a Scoped Information Protection Policy -type ScopedInformationProtectionPolicyId struct { - Scope string - InformationProtectionPolicyName InformationProtectionPolicyName -} - -// NewScopedInformationProtectionPolicyID returns a new ScopedInformationProtectionPolicyId struct -func NewScopedInformationProtectionPolicyID(scope string, informationProtectionPolicyName InformationProtectionPolicyName) ScopedInformationProtectionPolicyId { - return ScopedInformationProtectionPolicyId{ - Scope: scope, - InformationProtectionPolicyName: informationProtectionPolicyName, - } -} - -// ParseScopedInformationProtectionPolicyID parses 'input' into a ScopedInformationProtectionPolicyId -func ParseScopedInformationProtectionPolicyID(input string) (*ScopedInformationProtectionPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedInformationProtectionPolicyId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedInformationProtectionPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseScopedInformationProtectionPolicyIDInsensitively parses 'input' case-insensitively into a ScopedInformationProtectionPolicyId -// note: this method should only be used for API response data and not user input -func ParseScopedInformationProtectionPolicyIDInsensitively(input string) (*ScopedInformationProtectionPolicyId, error) { - parser := resourceids.NewParserFromResourceIdType(&ScopedInformationProtectionPolicyId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ScopedInformationProtectionPolicyId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ScopedInformationProtectionPolicyId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.Scope, ok = input.Parsed["scope"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "scope", input) - } - - if v, ok := input.Parsed["informationProtectionPolicyName"]; true { - if !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "informationProtectionPolicyName", input) - } - - informationProtectionPolicyName, err := parseInformationProtectionPolicyName(v) - if err != nil { - return fmt.Errorf("parsing %q: %+v", v, err) - } - id.InformationProtectionPolicyName = *informationProtectionPolicyName - } - - return nil -} - -// ValidateScopedInformationProtectionPolicyID checks that 'input' can be parsed as a Scoped Information Protection Policy ID -func ValidateScopedInformationProtectionPolicyID(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 := ParseScopedInformationProtectionPolicyID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Scoped Information Protection Policy ID -func (id ScopedInformationProtectionPolicyId) ID() string { - fmtString := "/%s/providers/Microsoft.Security/informationProtectionPolicies/%s" - return fmt.Sprintf(fmtString, strings.TrimPrefix(id.Scope, "/"), string(id.InformationProtectionPolicyName)) -} - -// Segments returns a slice of Resource ID Segments which comprise this Scoped Information Protection Policy ID -func (id ScopedInformationProtectionPolicyId) Segments() []resourceids.Segment { - return []resourceids.Segment{ - resourceids.ScopeSegment("scope", "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group"), - resourceids.StaticSegment("staticProviders", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticInformationProtectionPolicies", "informationProtectionPolicies", "informationProtectionPolicies"), - resourceids.ConstantSegment("informationProtectionPolicyName", PossibleValuesForInformationProtectionPolicyName(), "custom"), - } -} - -// String returns a human-readable description of this Scoped Information Protection Policy ID -func (id ScopedInformationProtectionPolicyId) String() string { - components := []string{ - fmt.Sprintf("Scope: %q", id.Scope), - fmt.Sprintf("Information Protection Policy Name: %q", string(id.InformationProtectionPolicyName)), - } - return fmt.Sprintf("Scoped Information Protection Policy (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy_test.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy_test.go deleted file mode 100644 index bd5a342341e..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/id_scopedinformationprotectionpolicy_test.go +++ /dev/null @@ -1,222 +0,0 @@ -package informationprotectionpolicies - -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 = &ScopedInformationProtectionPolicyId{} - -func TestNewScopedInformationProtectionPolicyID(t *testing.T) { - id := NewScopedInformationProtectionPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "custom") - - if id.Scope != "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group" { - t.Fatalf("Expected %q but got %q for Segment 'Scope'", id.Scope, "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - } - - if id.InformationProtectionPolicyName != "custom" { - t.Fatalf("Expected %q but got %q for Segment 'InformationProtectionPolicyName'", id.InformationProtectionPolicyName, "custom") - } -} - -func TestFormatScopedInformationProtectionPolicyID(t *testing.T) { - actual := NewScopedInformationProtectionPolicyID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", "custom").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies/custom" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseScopedInformationProtectionPolicyID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedInformationProtectionPolicyId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies/custom", - Expected: &ScopedInformationProtectionPolicyId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - InformationProtectionPolicyName: "custom", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies/custom/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedInformationProtectionPolicyID(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.InformationProtectionPolicyName != v.Expected.InformationProtectionPolicyName { - t.Fatalf("Expected %q but got %q for InformationProtectionPolicyName", v.Expected.InformationProtectionPolicyName, actual.InformationProtectionPolicyName) - } - - } -} - -func TestParseScopedInformationProtectionPolicyIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ScopedInformationProtectionPolicyId - }{ - { - // Incomplete URI - Input: "", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/iNfOrMaTiOnPrOtEcTiOnPoLiCiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies/custom", - Expected: &ScopedInformationProtectionPolicyId{ - Scope: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group", - InformationProtectionPolicyName: "custom", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group/providers/Microsoft.Security/informationProtectionPolicies/custom/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/iNfOrMaTiOnPrOtEcTiOnPoLiCiEs/cUsToM", - Expected: &ScopedInformationProtectionPolicyId{ - Scope: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp", - InformationProtectionPolicyName: "custom", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/sOmE-ReSoUrCe-gRoUp/pRoViDeRs/mIcRoSoFt.sEcUrItY/iNfOrMaTiOnPrOtEcTiOnPoLiCiEs/cUsToM/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseScopedInformationProtectionPolicyIDInsensitively(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.Scope != v.Expected.Scope { - t.Fatalf("Expected %q but got %q for Scope", v.Expected.Scope, actual.Scope) - } - - if actual.InformationProtectionPolicyName != v.Expected.InformationProtectionPolicyName { - t.Fatalf("Expected %q but got %q for InformationProtectionPolicyName", v.Expected.InformationProtectionPolicyName, actual.InformationProtectionPolicyName) - } - - } -} - -func TestSegmentsForScopedInformationProtectionPolicyId(t *testing.T) { - segments := ScopedInformationProtectionPolicyId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ScopedInformationProtectionPolicyId 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/security/2017-08-01-preview/informationprotectionpolicies/method_createorupdate.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_createorupdate.go deleted file mode 100644 index d7a3ad7daa4..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package informationprotectionpolicies - -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 *InformationProtectionPolicy -} - -// CreateOrUpdate ... -func (c InformationProtectionPoliciesClient) CreateOrUpdate(ctx context.Context, id ScopedInformationProtectionPolicyId, input InformationProtectionPolicy) (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 InformationProtectionPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_get.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_get.go deleted file mode 100644 index a2306400171..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package informationprotectionpolicies - -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 *InformationProtectionPolicy -} - -// Get ... -func (c InformationProtectionPoliciesClient) Get(ctx context.Context, id ScopedInformationProtectionPolicyId) (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 InformationProtectionPolicy - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_list.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_list.go deleted file mode 100644 index 50adfc26ea8..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package informationprotectionpolicies - -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 *[]InformationProtectionPolicy -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []InformationProtectionPolicy -} - -// List ... -func (c InformationProtectionPoliciesClient) List(ctx context.Context, id commonids.ScopeId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/informationProtectionPolicies", 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 *[]InformationProtectionPolicy `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 InformationProtectionPoliciesClient) ListComplete(ctx context.Context, id commonids.ScopeId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, InformationProtectionPolicyOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c InformationProtectionPoliciesClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.ScopeId, predicate InformationProtectionPolicyOperationPredicate) (result ListCompleteResult, err error) { - items := make([]InformationProtectionPolicy, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionkeyword.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionkeyword.go deleted file mode 100644 index ae75edd725e..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionkeyword.go +++ /dev/null @@ -1,11 +0,0 @@ -package informationprotectionpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InformationProtectionKeyword struct { - CanBeNumeric *bool `json:"canBeNumeric,omitempty"` - Custom *bool `json:"custom,omitempty"` - Excluded *bool `json:"excluded,omitempty"` - Pattern *string `json:"pattern,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicy.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicy.go deleted file mode 100644 index 48b9c573168..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicy.go +++ /dev/null @@ -1,11 +0,0 @@ -package informationprotectionpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InformationProtectionPolicy struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *InformationProtectionPolicyProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicyproperties.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicyproperties.go deleted file mode 100644 index e1656886d16..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationprotectionpolicyproperties.go +++ /dev/null @@ -1,29 +0,0 @@ -package informationprotectionpolicies - -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 InformationProtectionPolicyProperties struct { - InformationTypes *map[string]InformationType `json:"informationTypes,omitempty"` - Labels *map[string]SensitivityLabel `json:"labels,omitempty"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *InformationProtectionPolicyProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *InformationProtectionPolicyProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationtype.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationtype.go deleted file mode 100644 index 2da8e45cfc0..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_informationtype.go +++ /dev/null @@ -1,14 +0,0 @@ -package informationprotectionpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InformationType struct { - Custom *bool `json:"custom,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Keywords *[]InformationProtectionKeyword `json:"keywords,omitempty"` - Order *int64 `json:"order,omitempty"` - RecommendedLabelId *string `json:"recommendedLabelId,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_sensitivitylabel.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_sensitivitylabel.go deleted file mode 100644 index f145fe80633..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/model_sensitivitylabel.go +++ /dev/null @@ -1,12 +0,0 @@ -package informationprotectionpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SensitivityLabel struct { - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - Order *int64 `json:"order,omitempty"` - Rank *Rank `json:"rank,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/predicates.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/predicates.go deleted file mode 100644 index 64bce19c168..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package informationprotectionpolicies - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InformationProtectionPolicyOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p InformationProtectionPolicyOperationPredicate) Matches(input InformationProtectionPolicy) 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/security/2017-08-01-preview/informationprotectionpolicies/version.go b/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/version.go deleted file mode 100644 index 277702a3054..00000000000 --- a/resource-manager/security/2017-08-01-preview/informationprotectionpolicies/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package informationprotectionpolicies - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/informationprotectionpolicies/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/README.md b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/README.md deleted file mode 100644 index 469c295867b..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/iotsecuritysolutions` Documentation - -The `iotsecuritysolutions` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/iotsecuritysolutions" -``` - - -### Client Initialization - -```go -client := iotsecuritysolutions.NewIotSecuritySolutionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IotSecuritySolutionsClient.IoTSecuritySolutionsList` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.IoTSecuritySolutionsList(ctx, id, iotsecuritysolutions.DefaultIoTSecuritySolutionsListOperationOptions())` can be used to do batched pagination -items, err := client.IoTSecuritySolutionsListComplete(ctx, id, iotsecuritysolutions.DefaultIoTSecuritySolutionsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `IotSecuritySolutionsClient.IoTSecuritySolutionsResourceGroupList` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.IoTSecuritySolutionsResourceGroupList(ctx, id, iotsecuritysolutions.DefaultIoTSecuritySolutionsResourceGroupListOperationOptions())` can be used to do batched pagination -items, err := client.IoTSecuritySolutionsResourceGroupListComplete(ctx, id, iotsecuritysolutions.DefaultIoTSecuritySolutionsResourceGroupListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `IotSecuritySolutionsClient.IotSecuritySolutionCreate` - -```go -ctx := context.TODO() -id := iotsecuritysolutions.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -payload := iotsecuritysolutions.IoTSecuritySolutionModel{ - // ... -} - - -read, err := client.IotSecuritySolutionCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IotSecuritySolutionsClient.IotSecuritySolutionDelete` - -```go -ctx := context.TODO() -id := iotsecuritysolutions.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -read, err := client.IotSecuritySolutionDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IotSecuritySolutionsClient.IotSecuritySolutionGet` - -```go -ctx := context.TODO() -id := iotsecuritysolutions.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -read, err := client.IotSecuritySolutionGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IotSecuritySolutionsClient.IotSecuritySolutionUpdate` - -```go -ctx := context.TODO() -id := iotsecuritysolutions.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -payload := iotsecuritysolutions.UpdateIotSecuritySolutionData{ - // ... -} - - -read, err := client.IotSecuritySolutionUpdate(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/security/2017-08-01-preview/iotsecuritysolutions/client.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/client.go deleted file mode 100644 index 5ec9c3e1b6a..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package iotsecuritysolutions - -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 IotSecuritySolutionsClient struct { - Client *resourcemanager.Client -} - -func NewIotSecuritySolutionsClientWithBaseURI(sdkApi sdkEnv.Api) (*IotSecuritySolutionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "iotsecuritysolutions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IotSecuritySolutionsClient: %+v", err) - } - - return &IotSecuritySolutionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/constants.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/constants.go deleted file mode 100644 index 1bdea8af1d4..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/constants.go +++ /dev/null @@ -1,251 +0,0 @@ -package iotsecuritysolutions - -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 DataSource string - -const ( - DataSourceTwinData DataSource = "TwinData" -) - -func PossibleValuesForDataSource() []string { - return []string{ - string(DataSourceTwinData), - } -} - -func (s *DataSource) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataSource(input string) (*DataSource, error) { - vals := map[string]DataSource{ - "twindata": DataSourceTwinData, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataSource(input) - return &out, nil -} - -type ExportData string - -const ( - ExportDataRawEvents ExportData = "RawEvents" -) - -func PossibleValuesForExportData() []string { - return []string{ - string(ExportDataRawEvents), - } -} - -func (s *ExportData) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseExportData(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseExportData(input string) (*ExportData, error) { - vals := map[string]ExportData{ - "rawevents": ExportDataRawEvents, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ExportData(input) - return &out, nil -} - -type RecommendationConfigStatus string - -const ( - RecommendationConfigStatusDisabled RecommendationConfigStatus = "Disabled" - RecommendationConfigStatusEnabled RecommendationConfigStatus = "Enabled" -) - -func PossibleValuesForRecommendationConfigStatus() []string { - return []string{ - string(RecommendationConfigStatusDisabled), - string(RecommendationConfigStatusEnabled), - } -} - -func (s *RecommendationConfigStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRecommendationConfigStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRecommendationConfigStatus(input string) (*RecommendationConfigStatus, error) { - vals := map[string]RecommendationConfigStatus{ - "disabled": RecommendationConfigStatusDisabled, - "enabled": RecommendationConfigStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecommendationConfigStatus(input) - return &out, nil -} - -type RecommendationType string - -const ( - RecommendationTypeIoTACRAuthentication RecommendationType = "IoT_ACRAuthentication" - RecommendationTypeIoTAgentSendsUnutilizedMessages RecommendationType = "IoT_AgentSendsUnutilizedMessages" - RecommendationTypeIoTBaseline RecommendationType = "IoT_Baseline" - RecommendationTypeIoTEdgeHubMemOptimize RecommendationType = "IoT_EdgeHubMemOptimize" - RecommendationTypeIoTEdgeLoggingOptions RecommendationType = "IoT_EdgeLoggingOptions" - RecommendationTypeIoTIPFilterDenyAll RecommendationType = "IoT_IPFilter_DenyAll" - RecommendationTypeIoTIPFilterPermissiveRule RecommendationType = "IoT_IPFilter_PermissiveRule" - RecommendationTypeIoTInconsistentModuleSettings RecommendationType = "IoT_InconsistentModuleSettings" - RecommendationTypeIoTInstallAgent RecommendationType = "IoT_InstallAgent" - RecommendationTypeIoTOpenPorts RecommendationType = "IoT_OpenPorts" - RecommendationTypeIoTPermissiveFirewallPolicy RecommendationType = "IoT_PermissiveFirewallPolicy" - RecommendationTypeIoTPermissiveInputFirewallRules RecommendationType = "IoT_PermissiveInputFirewallRules" - RecommendationTypeIoTPermissiveOutputFirewallRules RecommendationType = "IoT_PermissiveOutputFirewallRules" - RecommendationTypeIoTPrivilegedDockerOptions RecommendationType = "IoT_PrivilegedDockerOptions" - RecommendationTypeIoTSharedCredentials RecommendationType = "IoT_SharedCredentials" - RecommendationTypeIoTVulnerableTLSCipherSuite RecommendationType = "IoT_VulnerableTLSCipherSuite" -) - -func PossibleValuesForRecommendationType() []string { - return []string{ - string(RecommendationTypeIoTACRAuthentication), - string(RecommendationTypeIoTAgentSendsUnutilizedMessages), - string(RecommendationTypeIoTBaseline), - string(RecommendationTypeIoTEdgeHubMemOptimize), - string(RecommendationTypeIoTEdgeLoggingOptions), - string(RecommendationTypeIoTIPFilterDenyAll), - string(RecommendationTypeIoTIPFilterPermissiveRule), - string(RecommendationTypeIoTInconsistentModuleSettings), - string(RecommendationTypeIoTInstallAgent), - string(RecommendationTypeIoTOpenPorts), - string(RecommendationTypeIoTPermissiveFirewallPolicy), - string(RecommendationTypeIoTPermissiveInputFirewallRules), - string(RecommendationTypeIoTPermissiveOutputFirewallRules), - string(RecommendationTypeIoTPrivilegedDockerOptions), - string(RecommendationTypeIoTSharedCredentials), - string(RecommendationTypeIoTVulnerableTLSCipherSuite), - } -} - -func (s *RecommendationType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRecommendationType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRecommendationType(input string) (*RecommendationType, error) { - vals := map[string]RecommendationType{ - "iot_acrauthentication": RecommendationTypeIoTACRAuthentication, - "iot_agentsendsunutilizedmessages": RecommendationTypeIoTAgentSendsUnutilizedMessages, - "iot_baseline": RecommendationTypeIoTBaseline, - "iot_edgehubmemoptimize": RecommendationTypeIoTEdgeHubMemOptimize, - "iot_edgeloggingoptions": RecommendationTypeIoTEdgeLoggingOptions, - "iot_ipfilter_denyall": RecommendationTypeIoTIPFilterDenyAll, - "iot_ipfilter_permissiverule": RecommendationTypeIoTIPFilterPermissiveRule, - "iot_inconsistentmodulesettings": RecommendationTypeIoTInconsistentModuleSettings, - "iot_installagent": RecommendationTypeIoTInstallAgent, - "iot_openports": RecommendationTypeIoTOpenPorts, - "iot_permissivefirewallpolicy": RecommendationTypeIoTPermissiveFirewallPolicy, - "iot_permissiveinputfirewallrules": RecommendationTypeIoTPermissiveInputFirewallRules, - "iot_permissiveoutputfirewallrules": RecommendationTypeIoTPermissiveOutputFirewallRules, - "iot_privilegeddockeroptions": RecommendationTypeIoTPrivilegedDockerOptions, - "iot_sharedcredentials": RecommendationTypeIoTSharedCredentials, - "iot_vulnerabletlsciphersuite": RecommendationTypeIoTVulnerableTLSCipherSuite, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RecommendationType(input) - return &out, nil -} - -type SecuritySolutionStatus string - -const ( - SecuritySolutionStatusDisabled SecuritySolutionStatus = "Disabled" - SecuritySolutionStatusEnabled SecuritySolutionStatus = "Enabled" -) - -func PossibleValuesForSecuritySolutionStatus() []string { - return []string{ - string(SecuritySolutionStatusDisabled), - string(SecuritySolutionStatusEnabled), - } -} - -func (s *SecuritySolutionStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecuritySolutionStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecuritySolutionStatus(input string) (*SecuritySolutionStatus, error) { - vals := map[string]SecuritySolutionStatus{ - "disabled": SecuritySolutionStatusDisabled, - "enabled": SecuritySolutionStatusEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecuritySolutionStatus(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution.go deleted file mode 100644 index ce34edc6c4e..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution.go +++ /dev/null @@ -1,130 +0,0 @@ -package iotsecuritysolutions - -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(&IotSecuritySolutionId{}) -} - -var _ resourceids.ResourceId = &IotSecuritySolutionId{} - -// IotSecuritySolutionId is a struct representing the Resource ID for a Iot Security Solution -type IotSecuritySolutionId struct { - SubscriptionId string - ResourceGroupName string - IotSecuritySolutionName string -} - -// NewIotSecuritySolutionID returns a new IotSecuritySolutionId struct -func NewIotSecuritySolutionID(subscriptionId string, resourceGroupName string, iotSecuritySolutionName string) IotSecuritySolutionId { - return IotSecuritySolutionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IotSecuritySolutionName: iotSecuritySolutionName, - } -} - -// ParseIotSecuritySolutionID parses 'input' into a IotSecuritySolutionId -func ParseIotSecuritySolutionID(input string) (*IotSecuritySolutionId, error) { - parser := resourceids.NewParserFromResourceIdType(&IotSecuritySolutionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IotSecuritySolutionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIotSecuritySolutionIDInsensitively parses 'input' case-insensitively into a IotSecuritySolutionId -// note: this method should only be used for API response data and not user input -func ParseIotSecuritySolutionIDInsensitively(input string) (*IotSecuritySolutionId, error) { - parser := resourceids.NewParserFromResourceIdType(&IotSecuritySolutionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IotSecuritySolutionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IotSecuritySolutionId) 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.IotSecuritySolutionName, ok = input.Parsed["iotSecuritySolutionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "iotSecuritySolutionName", input) - } - - return nil -} - -// ValidateIotSecuritySolutionID checks that 'input' can be parsed as a Iot Security Solution ID -func ValidateIotSecuritySolutionID(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 := ParseIotSecuritySolutionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Iot Security Solution ID -func (id IotSecuritySolutionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/iotSecuritySolutions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IotSecuritySolutionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Iot Security Solution ID -func (id IotSecuritySolutionId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticIotSecuritySolutions", "iotSecuritySolutions", "iotSecuritySolutions"), - resourceids.UserSpecifiedSegment("iotSecuritySolutionName", "iotSecuritySolutionValue"), - } -} - -// String returns a human-readable description of this Iot Security Solution ID -func (id IotSecuritySolutionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Iot Security Solution Name: %q", id.IotSecuritySolutionName), - } - return fmt.Sprintf("Iot Security Solution (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution_test.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution_test.go deleted file mode 100644 index 996ff663219..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/id_iotsecuritysolution_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package iotsecuritysolutions - -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 = &IotSecuritySolutionId{} - -func TestNewIotSecuritySolutionID(t *testing.T) { - id := NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - - 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.IotSecuritySolutionName != "iotSecuritySolutionValue" { - t.Fatalf("Expected %q but got %q for Segment 'IotSecuritySolutionName'", id.IotSecuritySolutionName, "iotSecuritySolutionValue") - } -} - -func TestFormatIotSecuritySolutionID(t *testing.T) { - actual := NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIotSecuritySolutionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IotSecuritySolutionId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Expected: &IotSecuritySolutionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIotSecuritySolutionID(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - } -} - -func TestParseIotSecuritySolutionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IotSecuritySolutionId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Expected: &IotSecuritySolutionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE", - Expected: &IotSecuritySolutionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotSecuritySolutionName: "iOtSeCuRiTySoLuTiOnVaLuE", - }, - }, - { - // 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.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIotSecuritySolutionIDInsensitively(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - } -} - -func TestSegmentsForIotSecuritySolutionId(t *testing.T) { - segments := IotSecuritySolutionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IotSecuritySolutionId 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/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutioncreate.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutioncreate.go deleted file mode 100644 index 64c70a673de..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutioncreate.go +++ /dev/null @@ -1,59 +0,0 @@ -package iotsecuritysolutions - -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 IotSecuritySolutionCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IoTSecuritySolutionModel -} - -// IotSecuritySolutionCreate ... -func (c IotSecuritySolutionsClient) IotSecuritySolutionCreate(ctx context.Context, id IotSecuritySolutionId, input IoTSecuritySolutionModel) (result IotSecuritySolutionCreateOperationResponse, 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 IoTSecuritySolutionModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutiondelete.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutiondelete.go deleted file mode 100644 index 70100eca999..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutiondelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package iotsecuritysolutions - -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 IotSecuritySolutionDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IotSecuritySolutionDelete ... -func (c IotSecuritySolutionsClient) IotSecuritySolutionDelete(ctx context.Context, id IotSecuritySolutionId) (result IotSecuritySolutionDeleteOperationResponse, 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/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionget.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionget.go deleted file mode 100644 index 8b8286f6952..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionget.go +++ /dev/null @@ -1,54 +0,0 @@ -package iotsecuritysolutions - -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 IotSecuritySolutionGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IoTSecuritySolutionModel -} - -// IotSecuritySolutionGet ... -func (c IotSecuritySolutionsClient) IotSecuritySolutionGet(ctx context.Context, id IotSecuritySolutionId) (result IotSecuritySolutionGetOperationResponse, 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 IoTSecuritySolutionModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionslist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionslist.go deleted file mode 100644 index 884901c446e..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionslist.go +++ /dev/null @@ -1,120 +0,0 @@ -package iotsecuritysolutions - -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 IoTSecuritySolutionsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]IoTSecuritySolutionModel -} - -type IoTSecuritySolutionsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IoTSecuritySolutionModel -} - -type IoTSecuritySolutionsListOperationOptions struct { - Filter *string -} - -func DefaultIoTSecuritySolutionsListOperationOptions() IoTSecuritySolutionsListOperationOptions { - return IoTSecuritySolutionsListOperationOptions{} -} - -func (o IoTSecuritySolutionsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IoTSecuritySolutionsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IoTSecuritySolutionsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - return &out -} - -// IoTSecuritySolutionsList ... -func (c IotSecuritySolutionsClient) IoTSecuritySolutionsList(ctx context.Context, id commonids.SubscriptionId, options IoTSecuritySolutionsListOperationOptions) (result IoTSecuritySolutionsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/iotSecuritySolutions", id.ID()), - OptionsObject: options, - } - - 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 *[]IoTSecuritySolutionModel `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// IoTSecuritySolutionsListComplete retrieves all the results into a single object -func (c IotSecuritySolutionsClient) IoTSecuritySolutionsListComplete(ctx context.Context, id commonids.SubscriptionId, options IoTSecuritySolutionsListOperationOptions) (IoTSecuritySolutionsListCompleteResult, error) { - return c.IoTSecuritySolutionsListCompleteMatchingPredicate(ctx, id, options, IoTSecuritySolutionModelOperationPredicate{}) -} - -// IoTSecuritySolutionsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IotSecuritySolutionsClient) IoTSecuritySolutionsListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options IoTSecuritySolutionsListOperationOptions, predicate IoTSecuritySolutionModelOperationPredicate) (result IoTSecuritySolutionsListCompleteResult, err error) { - items := make([]IoTSecuritySolutionModel, 0) - - resp, err := c.IoTSecuritySolutionsList(ctx, id, options) - if err != nil { - 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 = IoTSecuritySolutionsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionsresourcegrouplist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionsresourcegrouplist.go deleted file mode 100644 index 6b7253b74ce..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionsresourcegrouplist.go +++ /dev/null @@ -1,120 +0,0 @@ -package iotsecuritysolutions - -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 IoTSecuritySolutionsResourceGroupListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]IoTSecuritySolutionModel -} - -type IoTSecuritySolutionsResourceGroupListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IoTSecuritySolutionModel -} - -type IoTSecuritySolutionsResourceGroupListOperationOptions struct { - Filter *string -} - -func DefaultIoTSecuritySolutionsResourceGroupListOperationOptions() IoTSecuritySolutionsResourceGroupListOperationOptions { - return IoTSecuritySolutionsResourceGroupListOperationOptions{} -} - -func (o IoTSecuritySolutionsResourceGroupListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IoTSecuritySolutionsResourceGroupListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IoTSecuritySolutionsResourceGroupListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - return &out -} - -// IoTSecuritySolutionsResourceGroupList ... -func (c IotSecuritySolutionsClient) IoTSecuritySolutionsResourceGroupList(ctx context.Context, id commonids.ResourceGroupId, options IoTSecuritySolutionsResourceGroupListOperationOptions) (result IoTSecuritySolutionsResourceGroupListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/iotSecuritySolutions", id.ID()), - OptionsObject: options, - } - - 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 *[]IoTSecuritySolutionModel `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// IoTSecuritySolutionsResourceGroupListComplete retrieves all the results into a single object -func (c IotSecuritySolutionsClient) IoTSecuritySolutionsResourceGroupListComplete(ctx context.Context, id commonids.ResourceGroupId, options IoTSecuritySolutionsResourceGroupListOperationOptions) (IoTSecuritySolutionsResourceGroupListCompleteResult, error) { - return c.IoTSecuritySolutionsResourceGroupListCompleteMatchingPredicate(ctx, id, options, IoTSecuritySolutionModelOperationPredicate{}) -} - -// IoTSecuritySolutionsResourceGroupListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IotSecuritySolutionsClient) IoTSecuritySolutionsResourceGroupListCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options IoTSecuritySolutionsResourceGroupListOperationOptions, predicate IoTSecuritySolutionModelOperationPredicate) (result IoTSecuritySolutionsResourceGroupListCompleteResult, err error) { - items := make([]IoTSecuritySolutionModel, 0) - - resp, err := c.IoTSecuritySolutionsResourceGroupList(ctx, id, options) - if err != nil { - 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 = IoTSecuritySolutionsResourceGroupListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionupdate.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionupdate.go deleted file mode 100644 index 50003c15bdf..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/method_iotsecuritysolutionupdate.go +++ /dev/null @@ -1,58 +0,0 @@ -package iotsecuritysolutions - -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 IotSecuritySolutionUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IoTSecuritySolutionModel -} - -// IotSecuritySolutionUpdate ... -func (c IotSecuritySolutionsClient) IotSecuritySolutionUpdate(ctx context.Context, id IotSecuritySolutionId, input UpdateIotSecuritySolutionData) (result IotSecuritySolutionUpdateOperationResponse, 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 IoTSecuritySolutionModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionmodel.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionmodel.go deleted file mode 100644 index 1b28df95f40..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionmodel.go +++ /dev/null @@ -1,13 +0,0 @@ -package iotsecuritysolutions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecuritySolutionModel struct { - Id *string `json:"id,omitempty"` - Location *string `json:"location,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IoTSecuritySolutionProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionproperties.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionproperties.go deleted file mode 100644 index 69e4861851b..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_iotsecuritysolutionproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package iotsecuritysolutions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecuritySolutionProperties struct { - AutoDiscoveredResources *[]string `json:"autoDiscoveredResources,omitempty"` - DisabledDataSources *[]DataSource `json:"disabledDataSources,omitempty"` - DisplayName string `json:"displayName"` - Export *[]ExportData `json:"export,omitempty"` - IotHubs []string `json:"iotHubs"` - RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` - Status *SecuritySolutionStatus `json:"status,omitempty"` - UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` - Workspace string `json:"workspace"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_recommendationconfigurationproperties.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_recommendationconfigurationproperties.go deleted file mode 100644 index bf43d12462e..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_recommendationconfigurationproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package iotsecuritysolutions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RecommendationConfigurationProperties struct { - Name *string `json:"name,omitempty"` - RecommendationType RecommendationType `json:"recommendationType"` - Status RecommendationConfigStatus `json:"status"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_updateiotsecuritysolutiondata.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_updateiotsecuritysolutiondata.go deleted file mode 100644 index dade44ab3d7..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_updateiotsecuritysolutiondata.go +++ /dev/null @@ -1,10 +0,0 @@ -package iotsecuritysolutions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UpdateIotSecuritySolutionData struct { - RecommendationsConfiguration *[]RecommendationConfigurationProperties `json:"recommendationsConfiguration,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - UserDefinedResources *UserDefinedResourcesProperties `json:"userDefinedResources,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_userdefinedresourcesproperties.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_userdefinedresourcesproperties.go deleted file mode 100644 index 0f4b055fa45..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/model_userdefinedresourcesproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package iotsecuritysolutions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserDefinedResourcesProperties struct { - Query string `json:"query"` - QuerySubscriptions []string `json:"querySubscriptions"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/predicates.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/predicates.go deleted file mode 100644 index 5459e683fae..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package iotsecuritysolutions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecuritySolutionModelOperationPredicate struct { - Id *string - Location *string - Name *string - Type *string -} - -func (p IoTSecuritySolutionModelOperationPredicate) Matches(input IoTSecuritySolutionModel) bool { - - if p.Id != nil && (input.Id == nil || *p.Id != *input.Id) { - return false - } - - if p.Location != nil && (input.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/security/2017-08-01-preview/iotsecuritysolutions/version.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/version.go deleted file mode 100644 index bb738457265..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package iotsecuritysolutions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/iotsecuritysolutions/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/README.md b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/README.md deleted file mode 100644 index 96e0d36fd23..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/README.md +++ /dev/null @@ -1,135 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics` Documentation - -The `iotsecuritysolutionsanalytics` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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/security/2017-08-01-preview/iotsecuritysolutionsanalytics" -``` - - -### Client Initialization - -```go -client := iotsecuritysolutionsanalytics.NewIoTSecuritySolutionsAnalyticsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.AggregatedAlertDismiss` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewAggregatedAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedAlertValue") - -read, err := client.AggregatedAlertDismiss(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.AggregatedAlertGet` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewAggregatedAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedAlertValue") - -read, err := client.AggregatedAlertGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.AggregatedAlertsList` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -// alternatively `client.AggregatedAlertsList(ctx, id, iotsecuritysolutionsanalytics.DefaultAggregatedAlertsListOperationOptions())` can be used to do batched pagination -items, err := client.AggregatedAlertsListComplete(ctx, id, iotsecuritysolutionsanalytics.DefaultAggregatedAlertsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.GetAll` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -// alternatively `client.GetAll(ctx, id)` can be used to do batched pagination -items, err := client.GetAllComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.GetDefault` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -read, err := client.GetDefault(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.RecommendationGet` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewAggregatedRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedRecommendationValue") - -read, err := client.RecommendationGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `IoTSecuritySolutionsAnalyticsClient.RecommendationsList` - -```go -ctx := context.TODO() -id := iotsecuritysolutionsanalytics.NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - -// alternatively `client.RecommendationsList(ctx, id, iotsecuritysolutionsanalytics.DefaultRecommendationsListOperationOptions())` can be used to do batched pagination -items, err := client.RecommendationsListComplete(ctx, id, iotsecuritysolutionsanalytics.DefaultRecommendationsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/client.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/client.go deleted file mode 100644 index 4ec6642d6e2..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 IoTSecuritySolutionsAnalyticsClient struct { - Client *resourcemanager.Client -} - -func NewIoTSecuritySolutionsAnalyticsClientWithBaseURI(sdkApi sdkEnv.Api) (*IoTSecuritySolutionsAnalyticsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "iotsecuritysolutionsanalytics", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IoTSecuritySolutionsAnalyticsClient: %+v", err) - } - - return &IoTSecuritySolutionsAnalyticsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/constants.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/constants.go deleted file mode 100644 index 4cc42bf4636..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 ReportedSeverity string - -const ( - ReportedSeverityHigh ReportedSeverity = "High" - ReportedSeverityInformational ReportedSeverity = "Informational" - ReportedSeverityLow ReportedSeverity = "Low" - ReportedSeverityMedium ReportedSeverity = "Medium" -) - -func PossibleValuesForReportedSeverity() []string { - return []string{ - string(ReportedSeverityHigh), - string(ReportedSeverityInformational), - string(ReportedSeverityLow), - string(ReportedSeverityMedium), - } -} - -func (s *ReportedSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseReportedSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseReportedSeverity(input string) (*ReportedSeverity, error) { - vals := map[string]ReportedSeverity{ - "high": ReportedSeverityHigh, - "informational": ReportedSeverityInformational, - "low": ReportedSeverityLow, - "medium": ReportedSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReportedSeverity(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert.go deleted file mode 100644 index d253b4e337f..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert.go +++ /dev/null @@ -1,141 +0,0 @@ -package iotsecuritysolutionsanalytics - -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(&AggregatedAlertId{}) -} - -var _ resourceids.ResourceId = &AggregatedAlertId{} - -// AggregatedAlertId is a struct representing the Resource ID for a Aggregated Alert -type AggregatedAlertId struct { - SubscriptionId string - ResourceGroupName string - IotSecuritySolutionName string - AggregatedAlertName string -} - -// NewAggregatedAlertID returns a new AggregatedAlertId struct -func NewAggregatedAlertID(subscriptionId string, resourceGroupName string, iotSecuritySolutionName string, aggregatedAlertName string) AggregatedAlertId { - return AggregatedAlertId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IotSecuritySolutionName: iotSecuritySolutionName, - AggregatedAlertName: aggregatedAlertName, - } -} - -// ParseAggregatedAlertID parses 'input' into a AggregatedAlertId -func ParseAggregatedAlertID(input string) (*AggregatedAlertId, error) { - parser := resourceids.NewParserFromResourceIdType(&AggregatedAlertId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AggregatedAlertId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAggregatedAlertIDInsensitively parses 'input' case-insensitively into a AggregatedAlertId -// note: this method should only be used for API response data and not user input -func ParseAggregatedAlertIDInsensitively(input string) (*AggregatedAlertId, error) { - parser := resourceids.NewParserFromResourceIdType(&AggregatedAlertId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AggregatedAlertId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AggregatedAlertId) 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.IotSecuritySolutionName, ok = input.Parsed["iotSecuritySolutionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "iotSecuritySolutionName", input) - } - - if id.AggregatedAlertName, ok = input.Parsed["aggregatedAlertName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "aggregatedAlertName", input) - } - - return nil -} - -// ValidateAggregatedAlertID checks that 'input' can be parsed as a Aggregated Alert ID -func ValidateAggregatedAlertID(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 := ParseAggregatedAlertID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Aggregated Alert ID -func (id AggregatedAlertId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/iotSecuritySolutions/%s/analyticsModels/default/aggregatedAlerts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IotSecuritySolutionName, id.AggregatedAlertName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Aggregated Alert ID -func (id AggregatedAlertId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticIotSecuritySolutions", "iotSecuritySolutions", "iotSecuritySolutions"), - resourceids.UserSpecifiedSegment("iotSecuritySolutionName", "iotSecuritySolutionValue"), - resourceids.StaticSegment("staticAnalyticsModels", "analyticsModels", "analyticsModels"), - resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.StaticSegment("staticAggregatedAlerts", "aggregatedAlerts", "aggregatedAlerts"), - resourceids.UserSpecifiedSegment("aggregatedAlertName", "aggregatedAlertValue"), - } -} - -// String returns a human-readable description of this Aggregated Alert ID -func (id AggregatedAlertId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Iot Security Solution Name: %q", id.IotSecuritySolutionName), - fmt.Sprintf("Aggregated Alert Name: %q", id.AggregatedAlertName), - } - return fmt.Sprintf("Aggregated Alert (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert_test.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert_test.go deleted file mode 100644 index f731f80ff54..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedalert_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 = &AggregatedAlertId{} - -func TestNewAggregatedAlertID(t *testing.T) { - id := NewAggregatedAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedAlertValue") - - 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.IotSecuritySolutionName != "iotSecuritySolutionValue" { - t.Fatalf("Expected %q but got %q for Segment 'IotSecuritySolutionName'", id.IotSecuritySolutionName, "iotSecuritySolutionValue") - } - - if id.AggregatedAlertName != "aggregatedAlertValue" { - t.Fatalf("Expected %q but got %q for Segment 'AggregatedAlertName'", id.AggregatedAlertName, "aggregatedAlertValue") - } -} - -func TestFormatAggregatedAlertID(t *testing.T) { - actual := NewAggregatedAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedAlertValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts/aggregatedAlertValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAggregatedAlertID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AggregatedAlertId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts/aggregatedAlertValue", - Expected: &AggregatedAlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - AggregatedAlertName: "aggregatedAlertValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts/aggregatedAlertValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAggregatedAlertID(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - if actual.AggregatedAlertName != v.Expected.AggregatedAlertName { - t.Fatalf("Expected %q but got %q for AggregatedAlertName", v.Expected.AggregatedAlertName, actual.AggregatedAlertName) - } - - } -} - -func TestParseAggregatedAlertIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AggregatedAlertId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt/aGgReGaTeDaLeRtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts/aggregatedAlertValue", - Expected: &AggregatedAlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - AggregatedAlertName: "aggregatedAlertValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedAlerts/aggregatedAlertValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt/aGgReGaTeDaLeRtS/aGgReGaTeDaLeRtVaLuE", - Expected: &AggregatedAlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotSecuritySolutionName: "iOtSeCuRiTySoLuTiOnVaLuE", - AggregatedAlertName: "aGgReGaTeDaLeRtVaLuE", - }, - }, - { - // 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.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt/aGgReGaTeDaLeRtS/aGgReGaTeDaLeRtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAggregatedAlertIDInsensitively(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - if actual.AggregatedAlertName != v.Expected.AggregatedAlertName { - t.Fatalf("Expected %q but got %q for AggregatedAlertName", v.Expected.AggregatedAlertName, actual.AggregatedAlertName) - } - - } -} - -func TestSegmentsForAggregatedAlertId(t *testing.T) { - segments := AggregatedAlertId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AggregatedAlertId 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/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation.go deleted file mode 100644 index c5166b66458..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation.go +++ /dev/null @@ -1,141 +0,0 @@ -package iotsecuritysolutionsanalytics - -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(&AggregatedRecommendationId{}) -} - -var _ resourceids.ResourceId = &AggregatedRecommendationId{} - -// AggregatedRecommendationId is a struct representing the Resource ID for a Aggregated Recommendation -type AggregatedRecommendationId struct { - SubscriptionId string - ResourceGroupName string - IotSecuritySolutionName string - AggregatedRecommendationName string -} - -// NewAggregatedRecommendationID returns a new AggregatedRecommendationId struct -func NewAggregatedRecommendationID(subscriptionId string, resourceGroupName string, iotSecuritySolutionName string, aggregatedRecommendationName string) AggregatedRecommendationId { - return AggregatedRecommendationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IotSecuritySolutionName: iotSecuritySolutionName, - AggregatedRecommendationName: aggregatedRecommendationName, - } -} - -// ParseAggregatedRecommendationID parses 'input' into a AggregatedRecommendationId -func ParseAggregatedRecommendationID(input string) (*AggregatedRecommendationId, error) { - parser := resourceids.NewParserFromResourceIdType(&AggregatedRecommendationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AggregatedRecommendationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAggregatedRecommendationIDInsensitively parses 'input' case-insensitively into a AggregatedRecommendationId -// note: this method should only be used for API response data and not user input -func ParseAggregatedRecommendationIDInsensitively(input string) (*AggregatedRecommendationId, error) { - parser := resourceids.NewParserFromResourceIdType(&AggregatedRecommendationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AggregatedRecommendationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AggregatedRecommendationId) 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.IotSecuritySolutionName, ok = input.Parsed["iotSecuritySolutionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "iotSecuritySolutionName", input) - } - - if id.AggregatedRecommendationName, ok = input.Parsed["aggregatedRecommendationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "aggregatedRecommendationName", input) - } - - return nil -} - -// ValidateAggregatedRecommendationID checks that 'input' can be parsed as a Aggregated Recommendation ID -func ValidateAggregatedRecommendationID(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 := ParseAggregatedRecommendationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Aggregated Recommendation ID -func (id AggregatedRecommendationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/iotSecuritySolutions/%s/analyticsModels/default/aggregatedRecommendations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IotSecuritySolutionName, id.AggregatedRecommendationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Aggregated Recommendation ID -func (id AggregatedRecommendationId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticIotSecuritySolutions", "iotSecuritySolutions", "iotSecuritySolutions"), - resourceids.UserSpecifiedSegment("iotSecuritySolutionName", "iotSecuritySolutionValue"), - resourceids.StaticSegment("staticAnalyticsModels", "analyticsModels", "analyticsModels"), - resourceids.StaticSegment("staticDefault", "default", "default"), - resourceids.StaticSegment("staticAggregatedRecommendations", "aggregatedRecommendations", "aggregatedRecommendations"), - resourceids.UserSpecifiedSegment("aggregatedRecommendationName", "aggregatedRecommendationValue"), - } -} - -// String returns a human-readable description of this Aggregated Recommendation ID -func (id AggregatedRecommendationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Iot Security Solution Name: %q", id.IotSecuritySolutionName), - fmt.Sprintf("Aggregated Recommendation Name: %q", id.AggregatedRecommendationName), - } - return fmt.Sprintf("Aggregated Recommendation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation_test.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation_test.go deleted file mode 100644 index 96ae49d6815..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_aggregatedrecommendation_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 = &AggregatedRecommendationId{} - -func TestNewAggregatedRecommendationID(t *testing.T) { - id := NewAggregatedRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedRecommendationValue") - - 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.IotSecuritySolutionName != "iotSecuritySolutionValue" { - t.Fatalf("Expected %q but got %q for Segment 'IotSecuritySolutionName'", id.IotSecuritySolutionName, "iotSecuritySolutionValue") - } - - if id.AggregatedRecommendationName != "aggregatedRecommendationValue" { - t.Fatalf("Expected %q but got %q for Segment 'AggregatedRecommendationName'", id.AggregatedRecommendationName, "aggregatedRecommendationValue") - } -} - -func TestFormatAggregatedRecommendationID(t *testing.T) { - actual := NewAggregatedRecommendationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue", "aggregatedRecommendationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations/aggregatedRecommendationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAggregatedRecommendationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AggregatedRecommendationId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations/aggregatedRecommendationValue", - Expected: &AggregatedRecommendationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - AggregatedRecommendationName: "aggregatedRecommendationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations/aggregatedRecommendationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAggregatedRecommendationID(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - if actual.AggregatedRecommendationName != v.Expected.AggregatedRecommendationName { - t.Fatalf("Expected %q but got %q for AggregatedRecommendationName", v.Expected.AggregatedRecommendationName, actual.AggregatedRecommendationName) - } - - } -} - -func TestParseAggregatedRecommendationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AggregatedRecommendationId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt/aGgReGaTeDrEcOmMeNdAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations/aggregatedRecommendationValue", - Expected: &AggregatedRecommendationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - AggregatedRecommendationName: "aggregatedRecommendationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/analyticsModels/default/aggregatedRecommendations/aggregatedRecommendationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt/aGgReGaTeDrEcOmMeNdAtIoNs/aGgReGaTeDrEcOmMeNdAtIoNvAlUe", - Expected: &AggregatedRecommendationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotSecuritySolutionName: "iOtSeCuRiTySoLuTiOnVaLuE", - AggregatedRecommendationName: "aGgReGaTeDrEcOmMeNdAtIoNvAlUe", - }, - }, - { - // 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.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/aNaLyTiCsMoDeLs/dEfAuLt/aGgReGaTeDrEcOmMeNdAtIoNs/aGgReGaTeDrEcOmMeNdAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAggregatedRecommendationIDInsensitively(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - if actual.AggregatedRecommendationName != v.Expected.AggregatedRecommendationName { - t.Fatalf("Expected %q but got %q for AggregatedRecommendationName", v.Expected.AggregatedRecommendationName, actual.AggregatedRecommendationName) - } - - } -} - -func TestSegmentsForAggregatedRecommendationId(t *testing.T) { - segments := AggregatedRecommendationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AggregatedRecommendationId 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/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution.go deleted file mode 100644 index 5ade178d7a3..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution.go +++ /dev/null @@ -1,130 +0,0 @@ -package iotsecuritysolutionsanalytics - -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(&IotSecuritySolutionId{}) -} - -var _ resourceids.ResourceId = &IotSecuritySolutionId{} - -// IotSecuritySolutionId is a struct representing the Resource ID for a Iot Security Solution -type IotSecuritySolutionId struct { - SubscriptionId string - ResourceGroupName string - IotSecuritySolutionName string -} - -// NewIotSecuritySolutionID returns a new IotSecuritySolutionId struct -func NewIotSecuritySolutionID(subscriptionId string, resourceGroupName string, iotSecuritySolutionName string) IotSecuritySolutionId { - return IotSecuritySolutionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - IotSecuritySolutionName: iotSecuritySolutionName, - } -} - -// ParseIotSecuritySolutionID parses 'input' into a IotSecuritySolutionId -func ParseIotSecuritySolutionID(input string) (*IotSecuritySolutionId, error) { - parser := resourceids.NewParserFromResourceIdType(&IotSecuritySolutionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IotSecuritySolutionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIotSecuritySolutionIDInsensitively parses 'input' case-insensitively into a IotSecuritySolutionId -// note: this method should only be used for API response data and not user input -func ParseIotSecuritySolutionIDInsensitively(input string) (*IotSecuritySolutionId, error) { - parser := resourceids.NewParserFromResourceIdType(&IotSecuritySolutionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IotSecuritySolutionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IotSecuritySolutionId) 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.IotSecuritySolutionName, ok = input.Parsed["iotSecuritySolutionName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "iotSecuritySolutionName", input) - } - - return nil -} - -// ValidateIotSecuritySolutionID checks that 'input' can be parsed as a Iot Security Solution ID -func ValidateIotSecuritySolutionID(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 := ParseIotSecuritySolutionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Iot Security Solution ID -func (id IotSecuritySolutionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/iotSecuritySolutions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.IotSecuritySolutionName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Iot Security Solution ID -func (id IotSecuritySolutionId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticIotSecuritySolutions", "iotSecuritySolutions", "iotSecuritySolutions"), - resourceids.UserSpecifiedSegment("iotSecuritySolutionName", "iotSecuritySolutionValue"), - } -} - -// String returns a human-readable description of this Iot Security Solution ID -func (id IotSecuritySolutionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Iot Security Solution Name: %q", id.IotSecuritySolutionName), - } - return fmt.Sprintf("Iot Security Solution (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution_test.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution_test.go deleted file mode 100644 index 49a5391bc7c..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/id_iotsecuritysolution_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 = &IotSecuritySolutionId{} - -func TestNewIotSecuritySolutionID(t *testing.T) { - id := NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue") - - 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.IotSecuritySolutionName != "iotSecuritySolutionValue" { - t.Fatalf("Expected %q but got %q for Segment 'IotSecuritySolutionName'", id.IotSecuritySolutionName, "iotSecuritySolutionValue") - } -} - -func TestFormatIotSecuritySolutionID(t *testing.T) { - actual := NewIotSecuritySolutionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "iotSecuritySolutionValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIotSecuritySolutionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IotSecuritySolutionId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Expected: &IotSecuritySolutionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIotSecuritySolutionID(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - } -} - -func TestParseIotSecuritySolutionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IotSecuritySolutionId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue", - Expected: &IotSecuritySolutionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - IotSecuritySolutionName: "iotSecuritySolutionValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/iotSecuritySolutions/iotSecuritySolutionValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE", - Expected: &IotSecuritySolutionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - IotSecuritySolutionName: "iOtSeCuRiTySoLuTiOnVaLuE", - }, - }, - { - // 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.sEcUrItY/iOtSeCuRiTySoLuTiOnS/iOtSeCuRiTySoLuTiOnVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIotSecuritySolutionIDInsensitively(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.IotSecuritySolutionName != v.Expected.IotSecuritySolutionName { - t.Fatalf("Expected %q but got %q for IotSecuritySolutionName", v.Expected.IotSecuritySolutionName, actual.IotSecuritySolutionName) - } - - } -} - -func TestSegmentsForIotSecuritySolutionId(t *testing.T) { - segments := IotSecuritySolutionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IotSecuritySolutionId 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/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertdismiss.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertdismiss.go deleted file mode 100644 index 63ed1e30125..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertdismiss.go +++ /dev/null @@ -1,47 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 AggregatedAlertDismissOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// AggregatedAlertDismiss ... -func (c IoTSecuritySolutionsAnalyticsClient) AggregatedAlertDismiss(ctx context.Context, id AggregatedAlertId) (result AggregatedAlertDismissOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/dismiss", 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/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertget.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertget.go deleted file mode 100644 index 97ee26aab0a..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertget.go +++ /dev/null @@ -1,54 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 AggregatedAlertGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IoTSecurityAggregatedAlert -} - -// AggregatedAlertGet ... -func (c IoTSecuritySolutionsAnalyticsClient) AggregatedAlertGet(ctx context.Context, id AggregatedAlertId) (result AggregatedAlertGetOperationResponse, 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 IoTSecurityAggregatedAlert - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertslist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertslist.go deleted file mode 100644 index be08d4b4e14..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_aggregatedalertslist.go +++ /dev/null @@ -1,119 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 AggregatedAlertsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]IoTSecurityAggregatedAlert -} - -type AggregatedAlertsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IoTSecurityAggregatedAlert -} - -type AggregatedAlertsListOperationOptions struct { - Top *int64 -} - -func DefaultAggregatedAlertsListOperationOptions() AggregatedAlertsListOperationOptions { - return AggregatedAlertsListOperationOptions{} -} - -func (o AggregatedAlertsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o AggregatedAlertsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o AggregatedAlertsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// AggregatedAlertsList ... -func (c IoTSecuritySolutionsAnalyticsClient) AggregatedAlertsList(ctx context.Context, id IotSecuritySolutionId, options AggregatedAlertsListOperationOptions) (result AggregatedAlertsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/analyticsModels/default/aggregatedAlerts", id.ID()), - OptionsObject: options, - } - - 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 *[]IoTSecurityAggregatedAlert `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// AggregatedAlertsListComplete retrieves all the results into a single object -func (c IoTSecuritySolutionsAnalyticsClient) AggregatedAlertsListComplete(ctx context.Context, id IotSecuritySolutionId, options AggregatedAlertsListOperationOptions) (AggregatedAlertsListCompleteResult, error) { - return c.AggregatedAlertsListCompleteMatchingPredicate(ctx, id, options, IoTSecurityAggregatedAlertOperationPredicate{}) -} - -// AggregatedAlertsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IoTSecuritySolutionsAnalyticsClient) AggregatedAlertsListCompleteMatchingPredicate(ctx context.Context, id IotSecuritySolutionId, options AggregatedAlertsListOperationOptions, predicate IoTSecurityAggregatedAlertOperationPredicate) (result AggregatedAlertsListCompleteResult, err error) { - items := make([]IoTSecurityAggregatedAlert, 0) - - resp, err := c.AggregatedAlertsList(ctx, id, options) - if err != nil { - 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 = AggregatedAlertsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getall.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getall.go deleted file mode 100644 index 1fe8041f5e1..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getall.go +++ /dev/null @@ -1,91 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 GetAllOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]IoTSecuritySolutionAnalyticsModel -} - -type GetAllCompleteResult struct { - LatestHttpResponse *http.Response - Items []IoTSecuritySolutionAnalyticsModel -} - -// GetAll ... -func (c IoTSecuritySolutionsAnalyticsClient) GetAll(ctx context.Context, id IotSecuritySolutionId) (result GetAllOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/analyticsModels", 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 *[]IoTSecuritySolutionAnalyticsModel `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// GetAllComplete retrieves all the results into a single object -func (c IoTSecuritySolutionsAnalyticsClient) GetAllComplete(ctx context.Context, id IotSecuritySolutionId) (GetAllCompleteResult, error) { - return c.GetAllCompleteMatchingPredicate(ctx, id, IoTSecuritySolutionAnalyticsModelOperationPredicate{}) -} - -// GetAllCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IoTSecuritySolutionsAnalyticsClient) GetAllCompleteMatchingPredicate(ctx context.Context, id IotSecuritySolutionId, predicate IoTSecuritySolutionAnalyticsModelOperationPredicate) (result GetAllCompleteResult, err error) { - items := make([]IoTSecuritySolutionAnalyticsModel, 0) - - resp, err := c.GetAll(ctx, id) - if err != nil { - 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 = GetAllCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getdefault.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getdefault.go deleted file mode 100644 index 67191d1317c..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_getdefault.go +++ /dev/null @@ -1,55 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 GetDefaultOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IoTSecuritySolutionAnalyticsModel -} - -// GetDefault ... -func (c IoTSecuritySolutionsAnalyticsClient) GetDefault(ctx context.Context, id IotSecuritySolutionId) (result GetDefaultOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/analyticsModels/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 IoTSecuritySolutionAnalyticsModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationget.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationget.go deleted file mode 100644 index 7eb5ea09050..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationget.go +++ /dev/null @@ -1,54 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 RecommendationGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IoTSecurityAggregatedRecommendation -} - -// RecommendationGet ... -func (c IoTSecuritySolutionsAnalyticsClient) RecommendationGet(ctx context.Context, id AggregatedRecommendationId) (result RecommendationGetOperationResponse, 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 IoTSecurityAggregatedRecommendation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationslist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationslist.go deleted file mode 100644 index 171280ee16f..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/method_recommendationslist.go +++ /dev/null @@ -1,119 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 RecommendationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]IoTSecurityAggregatedRecommendation -} - -type RecommendationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IoTSecurityAggregatedRecommendation -} - -type RecommendationsListOperationOptions struct { - Top *int64 -} - -func DefaultRecommendationsListOperationOptions() RecommendationsListOperationOptions { - return RecommendationsListOperationOptions{} -} - -func (o RecommendationsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o RecommendationsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o RecommendationsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// RecommendationsList ... -func (c IoTSecuritySolutionsAnalyticsClient) RecommendationsList(ctx context.Context, id IotSecuritySolutionId, options RecommendationsListOperationOptions) (result RecommendationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/analyticsModels/default/aggregatedRecommendations", id.ID()), - OptionsObject: options, - } - - 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 *[]IoTSecurityAggregatedRecommendation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// RecommendationsListComplete retrieves all the results into a single object -func (c IoTSecuritySolutionsAnalyticsClient) RecommendationsListComplete(ctx context.Context, id IotSecuritySolutionId, options RecommendationsListOperationOptions) (RecommendationsListCompleteResult, error) { - return c.RecommendationsListCompleteMatchingPredicate(ctx, id, options, IoTSecurityAggregatedRecommendationOperationPredicate{}) -} - -// RecommendationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IoTSecuritySolutionsAnalyticsClient) RecommendationsListCompleteMatchingPredicate(ctx context.Context, id IotSecuritySolutionId, options RecommendationsListOperationOptions, predicate IoTSecurityAggregatedRecommendationOperationPredicate) (result RecommendationsListCompleteResult, err error) { - items := make([]IoTSecurityAggregatedRecommendation, 0) - - resp, err := c.RecommendationsList(ctx, id, options) - if err != nil { - 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 = RecommendationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalert.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalert.go deleted file mode 100644 index 72a455eaccc..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalert.go +++ /dev/null @@ -1,12 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAggregatedAlert struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IoTSecurityAggregatedAlertProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalertproperties.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalertproperties.go deleted file mode 100644 index 4be3c7e82ea..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedalertproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAggregatedAlertProperties struct { - ActionTaken *string `json:"actionTaken,omitempty"` - AggregatedDateUtc *string `json:"aggregatedDateUtc,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertType *string `json:"alertType,omitempty"` - Count *int64 `json:"count,omitempty"` - Description *string `json:"description,omitempty"` - EffectedResourceType *string `json:"effectedResourceType,omitempty"` - LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` - RemediationSteps *string `json:"remediationSteps,omitempty"` - ReportedSeverity *ReportedSeverity `json:"reportedSeverity,omitempty"` - SystemSource *string `json:"systemSource,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendation.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendation.go deleted file mode 100644 index d9214323884..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendation.go +++ /dev/null @@ -1,12 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAggregatedRecommendation struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IoTSecurityAggregatedRecommendationProperties `json:"properties,omitempty"` - Tags *map[string]string `json:"tags,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendationproperties.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendationproperties.go deleted file mode 100644 index 03bafc5d6c7..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityaggregatedrecommendationproperties.go +++ /dev/null @@ -1,17 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAggregatedRecommendationProperties struct { - Description *string `json:"description,omitempty"` - DetectedBy *string `json:"detectedBy,omitempty"` - HealthyDevices *int64 `json:"healthyDevices,omitempty"` - LogAnalyticsQuery *string `json:"logAnalyticsQuery,omitempty"` - RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` - RecommendationName *string `json:"recommendationName,omitempty"` - RecommendationTypeId *string `json:"recommendationTypeId,omitempty"` - RemediationSteps *string `json:"remediationSteps,omitempty"` - ReportedSeverity *ReportedSeverity `json:"reportedSeverity,omitempty"` - UnhealthyDeviceCount *int64 `json:"unhealthyDeviceCount,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddevice.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddevice.go deleted file mode 100644 index f18c01e7c9d..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddevice.go +++ /dev/null @@ -1,9 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAlertedDevice struct { - AlertsCount *int64 `json:"alertsCount,omitempty"` - DeviceId *string `json:"deviceId,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddeviceslist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddeviceslist.go deleted file mode 100644 index 159c3ccc70e..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecurityalerteddeviceslist.go +++ /dev/null @@ -1,9 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAlertedDevicesList struct { - NextLink *string `json:"nextLink,omitempty"` - Value []IoTSecurityAlertedDevice `json:"value"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealert.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealert.go deleted file mode 100644 index 7f315022c24..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealert.go +++ /dev/null @@ -1,10 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityDeviceAlert struct { - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertsCount *int64 `json:"alertsCount,omitempty"` - ReportedSeverity *ReportedSeverity `json:"reportedSeverity,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealertslist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealertslist.go deleted file mode 100644 index 49c2bdb848f..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicealertslist.go +++ /dev/null @@ -1,9 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityDeviceAlertsList struct { - NextLink *string `json:"nextLink,omitempty"` - Value []IoTSecurityDeviceAlert `json:"value"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendation.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendation.go deleted file mode 100644 index f3966b7ceb9..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendation.go +++ /dev/null @@ -1,10 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityDeviceRecommendation struct { - DevicesCount *int64 `json:"devicesCount,omitempty"` - RecommendationDisplayName *string `json:"recommendationDisplayName,omitempty"` - ReportedSeverity *ReportedSeverity `json:"reportedSeverity,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendationslist.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendationslist.go deleted file mode 100644 index f5230fb5105..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritydevicerecommendationslist.go +++ /dev/null @@ -1,9 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityDeviceRecommendationsList struct { - NextLink *string `json:"nextLink,omitempty"` - Value []IoTSecurityDeviceRecommendation `json:"value"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodel.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodel.go deleted file mode 100644 index 94605497ece..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodel.go +++ /dev/null @@ -1,11 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecuritySolutionAnalyticsModel struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IoTSecuritySolutionAnalyticsModelProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelproperties.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelproperties.go deleted file mode 100644 index 49f15cdba21..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecuritySolutionAnalyticsModelProperties struct { - DevicesMetrics *[]IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsInlined `json:"devicesMetrics,omitempty"` - Metrics *IoTSeverityMetrics `json:"metrics,omitempty"` - MostPrevalentDeviceAlerts *IoTSecurityDeviceAlertsList `json:"mostPrevalentDeviceAlerts,omitempty"` - MostPrevalentDeviceRecommendations *IoTSecurityDeviceRecommendationsList `json:"mostPrevalentDeviceRecommendations,omitempty"` - TopAlertedDevices *IoTSecurityAlertedDevicesList `json:"topAlertedDevices,omitempty"` - UnhealthyDeviceCount *int64 `json:"unhealthyDeviceCount,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelpropertiesdevicesmetricsinlined.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelpropertiesdevicesmetricsinlined.go deleted file mode 100644 index 12ba0b05882..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotsecuritysolutionanalyticsmodelpropertiesdevicesmetricsinlined.go +++ /dev/null @@ -1,27 +0,0 @@ -package iotsecuritysolutionsanalytics - -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 IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsInlined struct { - Date *string `json:"date,omitempty"` - DevicesMetrics *IoTSeverityMetrics `json:"devicesMetrics,omitempty"` -} - -func (o *IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsInlined) GetDateAsTime() (*time.Time, error) { - if o.Date == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Date, "2006-01-02T15:04:05Z07:00") -} - -func (o *IoTSecuritySolutionAnalyticsModelPropertiesDevicesMetricsInlined) SetDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Date = &formatted -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotseveritymetrics.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotseveritymetrics.go deleted file mode 100644 index 843928104ba..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/model_iotseveritymetrics.go +++ /dev/null @@ -1,10 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSeverityMetrics struct { - High *int64 `json:"high,omitempty"` - Low *int64 `json:"low,omitempty"` - Medium *int64 `json:"medium,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/predicates.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/predicates.go deleted file mode 100644 index d0ce51c5fb9..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/predicates.go +++ /dev/null @@ -1,73 +0,0 @@ -package iotsecuritysolutionsanalytics - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTSecurityAggregatedAlertOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p IoTSecurityAggregatedAlertOperationPredicate) Matches(input IoTSecurityAggregatedAlert) 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 IoTSecurityAggregatedRecommendationOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p IoTSecurityAggregatedRecommendationOperationPredicate) Matches(input IoTSecurityAggregatedRecommendation) 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 IoTSecuritySolutionAnalyticsModelOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p IoTSecuritySolutionAnalyticsModelOperationPredicate) Matches(input IoTSecuritySolutionAnalyticsModel) 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/security/2017-08-01-preview/iotsecuritysolutionsanalytics/version.go b/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/version.go deleted file mode 100644 index b0cb46c2bcd..00000000000 --- a/resource-manager/security/2017-08-01-preview/iotsecuritysolutionsanalytics/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package iotsecuritysolutionsanalytics - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/iotsecuritysolutionsanalytics/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/README.md b/resource-manager/security/2017-08-01-preview/pricings/README.md deleted file mode 100644 index e7ccdcc24b3..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/README.md +++ /dev/null @@ -1,129 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/pricings` Documentation - -The `pricings` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/pricings" -``` - - -### Client Initialization - -```go -client := pricings.NewPricingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `PricingsClient.CreateOrUpdateResourceGroupPricing` - -```go -ctx := context.TODO() -id := pricings.NewProviderPricingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "pricingValue") - -payload := pricings.Pricing{ - // ... -} - - -read, err := client.CreateOrUpdateResourceGroupPricing(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PricingsClient.GetResourceGroupPricing` - -```go -ctx := context.TODO() -id := pricings.NewProviderPricingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "pricingValue") - -read, err := client.GetResourceGroupPricing(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PricingsClient.GetSubscriptionPricing` - -```go -ctx := context.TODO() -id := pricings.NewPricingID("12345678-1234-9876-4563-123456789012", "pricingValue") - -read, err := client.GetSubscriptionPricing(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `PricingsClient.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: `PricingsClient.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: `PricingsClient.UpdateSubscriptionPricing` - -```go -ctx := context.TODO() -id := pricings.NewPricingID("12345678-1234-9876-4563-123456789012", "pricingValue") - -payload := pricings.Pricing{ - // ... -} - - -read, err := client.UpdateSubscriptionPricing(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/security/2017-08-01-preview/pricings/client.go b/resource-manager/security/2017-08-01-preview/pricings/client.go deleted file mode 100644 index 7d9c16fd7af..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package pricings - -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 PricingsClient struct { - Client *resourcemanager.Client -} - -func NewPricingsClientWithBaseURI(sdkApi sdkEnv.Api) (*PricingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "pricings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating PricingsClient: %+v", err) - } - - return &PricingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/constants.go b/resource-manager/security/2017-08-01-preview/pricings/constants.go deleted file mode 100644 index e8869695f43..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package pricings - -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 PricingTier string - -const ( - PricingTierFree PricingTier = "Free" - PricingTierStandard PricingTier = "Standard" -) - -func PossibleValuesForPricingTier() []string { - return []string{ - string(PricingTierFree), - string(PricingTierStandard), - } -} - -func (s *PricingTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePricingTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePricingTier(input string) (*PricingTier, error) { - vals := map[string]PricingTier{ - "free": PricingTierFree, - "standard": PricingTierStandard, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PricingTier(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/id_pricing.go b/resource-manager/security/2017-08-01-preview/pricings/id_pricing.go deleted file mode 100644 index 3a6e71ebd07..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/id_pricing.go +++ /dev/null @@ -1,121 +0,0 @@ -package pricings - -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(&PricingId{}) -} - -var _ resourceids.ResourceId = &PricingId{} - -// PricingId is a struct representing the Resource ID for a Pricing -type PricingId struct { - SubscriptionId string - PricingName string -} - -// NewPricingID returns a new PricingId struct -func NewPricingID(subscriptionId string, pricingName string) PricingId { - return PricingId{ - SubscriptionId: subscriptionId, - PricingName: pricingName, - } -} - -// ParsePricingID parses 'input' into a PricingId -func ParsePricingID(input string) (*PricingId, error) { - parser := resourceids.NewParserFromResourceIdType(&PricingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PricingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParsePricingIDInsensitively parses 'input' case-insensitively into a PricingId -// note: this method should only be used for API response data and not user input -func ParsePricingIDInsensitively(input string) (*PricingId, error) { - parser := resourceids.NewParserFromResourceIdType(&PricingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := PricingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *PricingId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.PricingName, ok = input.Parsed["pricingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "pricingName", input) - } - - return nil -} - -// ValidatePricingID checks that 'input' can be parsed as a Pricing ID -func ValidatePricingID(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 := ParsePricingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Pricing ID -func (id PricingId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/pricings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.PricingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Pricing ID -func (id PricingId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticPricings", "pricings", "pricings"), - resourceids.UserSpecifiedSegment("pricingName", "pricingValue"), - } -} - -// String returns a human-readable description of this Pricing ID -func (id PricingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Pricing Name: %q", id.PricingName), - } - return fmt.Sprintf("Pricing (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/id_pricing_test.go b/resource-manager/security/2017-08-01-preview/pricings/id_pricing_test.go deleted file mode 100644 index e9f1684d464..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/id_pricing_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package pricings - -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 = &PricingId{} - -func TestNewPricingID(t *testing.T) { - id := NewPricingID("12345678-1234-9876-4563-123456789012", "pricingValue") - - 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.PricingName != "pricingValue" { - t.Fatalf("Expected %q but got %q for Segment 'PricingName'", id.PricingName, "pricingValue") - } -} - -func TestFormatPricingID(t *testing.T) { - actual := NewPricingID("12345678-1234-9876-4563-123456789012", "pricingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings/pricingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParsePricingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PricingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings/pricingValue", - Expected: &PricingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PricingName: "pricingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings/pricingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePricingID(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.PricingName != v.Expected.PricingName { - t.Fatalf("Expected %q but got %q for PricingName", v.Expected.PricingName, actual.PricingName) - } - - } -} - -func TestParsePricingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *PricingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/pRiCiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings/pricingValue", - Expected: &PricingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PricingName: "pricingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/pricings/pricingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/pRiCiNgS/pRiCiNgVaLuE", - Expected: &PricingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - PricingName: "pRiCiNgVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/pRiCiNgS/pRiCiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParsePricingIDInsensitively(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.PricingName != v.Expected.PricingName { - t.Fatalf("Expected %q but got %q for PricingName", v.Expected.PricingName, actual.PricingName) - } - - } -} - -func TestSegmentsForPricingId(t *testing.T) { - segments := PricingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("PricingId 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/security/2017-08-01-preview/pricings/id_providerpricing.go b/resource-manager/security/2017-08-01-preview/pricings/id_providerpricing.go deleted file mode 100644 index e7bfba57eb3..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/id_providerpricing.go +++ /dev/null @@ -1,130 +0,0 @@ -package pricings - -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(&ProviderPricingId{}) -} - -var _ resourceids.ResourceId = &ProviderPricingId{} - -// ProviderPricingId is a struct representing the Resource ID for a Provider Pricing -type ProviderPricingId struct { - SubscriptionId string - ResourceGroupName string - PricingName string -} - -// NewProviderPricingID returns a new ProviderPricingId struct -func NewProviderPricingID(subscriptionId string, resourceGroupName string, pricingName string) ProviderPricingId { - return ProviderPricingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - PricingName: pricingName, - } -} - -// ParseProviderPricingID parses 'input' into a ProviderPricingId -func ParseProviderPricingID(input string) (*ProviderPricingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderPricingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderPricingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderPricingIDInsensitively parses 'input' case-insensitively into a ProviderPricingId -// note: this method should only be used for API response data and not user input -func ParseProviderPricingIDInsensitively(input string) (*ProviderPricingId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderPricingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderPricingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderPricingId) 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.PricingName, ok = input.Parsed["pricingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "pricingName", input) - } - - return nil -} - -// ValidateProviderPricingID checks that 'input' can be parsed as a Provider Pricing ID -func ValidateProviderPricingID(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 := ParseProviderPricingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Pricing ID -func (id ProviderPricingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/pricings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.PricingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Pricing ID -func (id ProviderPricingId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticPricings", "pricings", "pricings"), - resourceids.UserSpecifiedSegment("pricingName", "pricingValue"), - } -} - -// String returns a human-readable description of this Provider Pricing ID -func (id ProviderPricingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Pricing Name: %q", id.PricingName), - } - return fmt.Sprintf("Provider Pricing (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/id_providerpricing_test.go b/resource-manager/security/2017-08-01-preview/pricings/id_providerpricing_test.go deleted file mode 100644 index 7695980315f..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/id_providerpricing_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package pricings - -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 = &ProviderPricingId{} - -func TestNewProviderPricingID(t *testing.T) { - id := NewProviderPricingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "pricingValue") - - 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.PricingName != "pricingValue" { - t.Fatalf("Expected %q but got %q for Segment 'PricingName'", id.PricingName, "pricingValue") - } -} - -func TestFormatProviderPricingID(t *testing.T) { - actual := NewProviderPricingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "pricingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings/pricingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderPricingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderPricingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings/pricingValue", - Expected: &ProviderPricingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PricingName: "pricingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings/pricingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderPricingID(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.PricingName != v.Expected.PricingName { - t.Fatalf("Expected %q but got %q for PricingName", v.Expected.PricingName, actual.PricingName) - } - - } -} - -func TestParseProviderPricingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderPricingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/pRiCiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings/pricingValue", - Expected: &ProviderPricingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - PricingName: "pricingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/pricings/pricingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/pRiCiNgS/pRiCiNgVaLuE", - Expected: &ProviderPricingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - PricingName: "pRiCiNgVaLuE", - }, - }, - { - // 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.sEcUrItY/pRiCiNgS/pRiCiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderPricingIDInsensitively(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.PricingName != v.Expected.PricingName { - t.Fatalf("Expected %q but got %q for PricingName", v.Expected.PricingName, actual.PricingName) - } - - } -} - -func TestSegmentsForProviderPricingId(t *testing.T) { - segments := ProviderPricingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderPricingId 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/security/2017-08-01-preview/pricings/method_createorupdateresourcegrouppricing.go b/resource-manager/security/2017-08-01-preview/pricings/method_createorupdateresourcegrouppricing.go deleted file mode 100644 index 9571da1de8e..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/method_createorupdateresourcegrouppricing.go +++ /dev/null @@ -1,58 +0,0 @@ -package pricings - -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 CreateOrUpdateResourceGroupPricingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Pricing -} - -// CreateOrUpdateResourceGroupPricing ... -func (c PricingsClient) CreateOrUpdateResourceGroupPricing(ctx context.Context, id ProviderPricingId, input Pricing) (result CreateOrUpdateResourceGroupPricingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Pricing - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/method_getresourcegrouppricing.go b/resource-manager/security/2017-08-01-preview/pricings/method_getresourcegrouppricing.go deleted file mode 100644 index 5d4658a22eb..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/method_getresourcegrouppricing.go +++ /dev/null @@ -1,54 +0,0 @@ -package pricings - -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 GetResourceGroupPricingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Pricing -} - -// GetResourceGroupPricing ... -func (c PricingsClient) GetResourceGroupPricing(ctx context.Context, id ProviderPricingId) (result GetResourceGroupPricingOperationResponse, 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 Pricing - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/method_getsubscriptionpricing.go b/resource-manager/security/2017-08-01-preview/pricings/method_getsubscriptionpricing.go deleted file mode 100644 index ebd734ac27f..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/method_getsubscriptionpricing.go +++ /dev/null @@ -1,54 +0,0 @@ -package pricings - -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 GetSubscriptionPricingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Pricing -} - -// GetSubscriptionPricing ... -func (c PricingsClient) GetSubscriptionPricing(ctx context.Context, id PricingId) (result GetSubscriptionPricingOperationResponse, 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 Pricing - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/method_list.go b/resource-manager/security/2017-08-01-preview/pricings/method_list.go deleted file mode 100644 index 6989db21413..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package pricings - -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 *[]Pricing -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Pricing -} - -// List ... -func (c PricingsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/pricings", 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 *[]Pricing `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 PricingsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, PricingOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PricingsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate PricingOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Pricing, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/pricings/method_listbyresourcegroup.go b/resource-manager/security/2017-08-01-preview/pricings/method_listbyresourcegroup.go deleted file mode 100644 index 9df2f89baa4..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/method_listbyresourcegroup.go +++ /dev/null @@ -1,92 +0,0 @@ -package pricings - -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 *[]Pricing -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Pricing -} - -// ListByResourceGroup ... -func (c PricingsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/pricings", 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 *[]Pricing `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 PricingsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, PricingOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c PricingsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, predicate PricingOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Pricing, 0) - - resp, err := c.ListByResourceGroup(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/pricings/method_updatesubscriptionpricing.go b/resource-manager/security/2017-08-01-preview/pricings/method_updatesubscriptionpricing.go deleted file mode 100644 index cd0a9183f2f..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/method_updatesubscriptionpricing.go +++ /dev/null @@ -1,58 +0,0 @@ -package pricings - -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 UpdateSubscriptionPricingOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Pricing -} - -// UpdateSubscriptionPricing ... -func (c PricingsClient) UpdateSubscriptionPricing(ctx context.Context, id PricingId, input Pricing) (result UpdateSubscriptionPricingOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 Pricing - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/model_pricing.go b/resource-manager/security/2017-08-01-preview/pricings/model_pricing.go deleted file mode 100644 index c3e5ecba7f5..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/model_pricing.go +++ /dev/null @@ -1,11 +0,0 @@ -package pricings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Pricing struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *PricingProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/model_pricingproperties.go b/resource-manager/security/2017-08-01-preview/pricings/model_pricingproperties.go deleted file mode 100644 index 0a8dd517d2b..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/model_pricingproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package pricings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PricingProperties struct { - PricingTier PricingTier `json:"pricingTier"` -} diff --git a/resource-manager/security/2017-08-01-preview/pricings/predicates.go b/resource-manager/security/2017-08-01-preview/pricings/predicates.go deleted file mode 100644 index b4ed4dbbc97..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package pricings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PricingOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p PricingOperationPredicate) Matches(input Pricing) 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/security/2017-08-01-preview/pricings/version.go b/resource-manager/security/2017-08-01-preview/pricings/version.go deleted file mode 100644 index 7e7fcf3e4f4..00000000000 --- a/resource-manager/security/2017-08-01-preview/pricings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package pricings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/pricings/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/README.md b/resource-manager/security/2017-08-01-preview/securitycontacts/README.md deleted file mode 100644 index 00e2980cdb7..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/README.md +++ /dev/null @@ -1,112 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/securitycontacts` Documentation - -The `securitycontacts` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/securitycontacts" -``` - - -### Client Initialization - -```go -client := securitycontacts.NewSecurityContactsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityContactsClient.Create` - -```go -ctx := context.TODO() -id := securitycontacts.NewSecurityContactID("12345678-1234-9876-4563-123456789012", "securityContactValue") - -payload := securitycontacts.SecurityContact{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SecurityContactsClient.Delete` - -```go -ctx := context.TODO() -id := securitycontacts.NewSecurityContactID("12345678-1234-9876-4563-123456789012", "securityContactValue") - -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: `SecurityContactsClient.Get` - -```go -ctx := context.TODO() -id := securitycontacts.NewSecurityContactID("12345678-1234-9876-4563-123456789012", "securityContactValue") - -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: `SecurityContactsClient.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: `SecurityContactsClient.Update` - -```go -ctx := context.TODO() -id := securitycontacts.NewSecurityContactID("12345678-1234-9876-4563-123456789012", "securityContactValue") - -payload := securitycontacts.SecurityContact{ - // ... -} - - -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/security/2017-08-01-preview/securitycontacts/client.go b/resource-manager/security/2017-08-01-preview/securitycontacts/client.go deleted file mode 100644 index dd404c2dccd..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securitycontacts - -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 SecurityContactsClient struct { - Client *resourcemanager.Client -} - -func NewSecurityContactsClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityContactsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securitycontacts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityContactsClient: %+v", err) - } - - return &SecurityContactsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/constants.go b/resource-manager/security/2017-08-01-preview/securitycontacts/constants.go deleted file mode 100644 index ceedab90dd1..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package securitycontacts - -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 AlertNotifications string - -const ( - AlertNotificationsOff AlertNotifications = "Off" - AlertNotificationsOn AlertNotifications = "On" -) - -func PossibleValuesForAlertNotifications() []string { - return []string{ - string(AlertNotificationsOff), - string(AlertNotificationsOn), - } -} - -func (s *AlertNotifications) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertNotifications(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertNotifications(input string) (*AlertNotifications, error) { - vals := map[string]AlertNotifications{ - "off": AlertNotificationsOff, - "on": AlertNotificationsOn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertNotifications(input) - return &out, nil -} - -type AlertsToAdmins string - -const ( - AlertsToAdminsOff AlertsToAdmins = "Off" - AlertsToAdminsOn AlertsToAdmins = "On" -) - -func PossibleValuesForAlertsToAdmins() []string { - return []string{ - string(AlertsToAdminsOff), - string(AlertsToAdminsOn), - } -} - -func (s *AlertsToAdmins) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertsToAdmins(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertsToAdmins(input string) (*AlertsToAdmins, error) { - vals := map[string]AlertsToAdmins{ - "off": AlertsToAdminsOff, - "on": AlertsToAdminsOn, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertsToAdmins(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact.go b/resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact.go deleted file mode 100644 index 1d2cc6bddd9..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact.go +++ /dev/null @@ -1,121 +0,0 @@ -package securitycontacts - -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(&SecurityContactId{}) -} - -var _ resourceids.ResourceId = &SecurityContactId{} - -// SecurityContactId is a struct representing the Resource ID for a Security Contact -type SecurityContactId struct { - SubscriptionId string - SecurityContactName string -} - -// NewSecurityContactID returns a new SecurityContactId struct -func NewSecurityContactID(subscriptionId string, securityContactName string) SecurityContactId { - return SecurityContactId{ - SubscriptionId: subscriptionId, - SecurityContactName: securityContactName, - } -} - -// ParseSecurityContactID parses 'input' into a SecurityContactId -func ParseSecurityContactID(input string) (*SecurityContactId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityContactId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityContactId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityContactIDInsensitively parses 'input' case-insensitively into a SecurityContactId -// note: this method should only be used for API response data and not user input -func ParseSecurityContactIDInsensitively(input string) (*SecurityContactId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityContactId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityContactId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityContactId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.SecurityContactName, ok = input.Parsed["securityContactName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityContactName", input) - } - - return nil -} - -// ValidateSecurityContactID checks that 'input' can be parsed as a Security Contact ID -func ValidateSecurityContactID(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 := ParseSecurityContactID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security Contact ID -func (id SecurityContactId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/securityContacts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.SecurityContactName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security Contact ID -func (id SecurityContactId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticSecurityContacts", "securityContacts", "securityContacts"), - resourceids.UserSpecifiedSegment("securityContactName", "securityContactValue"), - } -} - -// String returns a human-readable description of this Security Contact ID -func (id SecurityContactId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Security Contact Name: %q", id.SecurityContactName), - } - return fmt.Sprintf("Security Contact (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact_test.go b/resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact_test.go deleted file mode 100644 index ea0a64bbc34..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/id_securitycontact_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package securitycontacts - -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 = &SecurityContactId{} - -func TestNewSecurityContactID(t *testing.T) { - id := NewSecurityContactID("12345678-1234-9876-4563-123456789012", "securityContactValue") - - 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.SecurityContactName != "securityContactValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityContactName'", id.SecurityContactName, "securityContactValue") - } -} - -func TestFormatSecurityContactID(t *testing.T) { - actual := NewSecurityContactID("12345678-1234-9876-4563-123456789012", "securityContactValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts/securityContactValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityContactID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityContactId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts/securityContactValue", - Expected: &SecurityContactId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SecurityContactName: "securityContactValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts/securityContactValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityContactID(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.SecurityContactName != v.Expected.SecurityContactName { - t.Fatalf("Expected %q but got %q for SecurityContactName", v.Expected.SecurityContactName, actual.SecurityContactName) - } - - } -} - -func TestParseSecurityContactIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityContactId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnTaCtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts/securityContactValue", - Expected: &SecurityContactId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SecurityContactName: "securityContactValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/securityContacts/securityContactValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnTaCtS/sEcUrItYcOnTaCtVaLuE", - Expected: &SecurityContactId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SecurityContactName: "sEcUrItYcOnTaCtVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEcUrItYcOnTaCtS/sEcUrItYcOnTaCtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityContactIDInsensitively(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.SecurityContactName != v.Expected.SecurityContactName { - t.Fatalf("Expected %q but got %q for SecurityContactName", v.Expected.SecurityContactName, actual.SecurityContactName) - } - - } -} - -func TestSegmentsForSecurityContactId(t *testing.T) { - segments := SecurityContactId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityContactId 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/security/2017-08-01-preview/securitycontacts/method_create.go b/resource-manager/security/2017-08-01-preview/securitycontacts/method_create.go deleted file mode 100644 index 05d3fbbcbc4..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package securitycontacts - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SecurityContact -} - -// Create ... -func (c SecurityContactsClient) Create(ctx context.Context, id SecurityContactId, input SecurityContact) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 SecurityContact - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/method_delete.go b/resource-manager/security/2017-08-01-preview/securitycontacts/method_delete.go deleted file mode 100644 index dab71971e25..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package securitycontacts - -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 SecurityContactsClient) Delete(ctx context.Context, id SecurityContactId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/method_get.go b/resource-manager/security/2017-08-01-preview/securitycontacts/method_get.go deleted file mode 100644 index 81966c48e27..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package securitycontacts - -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 *SecurityContact -} - -// Get ... -func (c SecurityContactsClient) Get(ctx context.Context, id SecurityContactId) (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 SecurityContact - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/method_list.go b/resource-manager/security/2017-08-01-preview/securitycontacts/method_list.go deleted file mode 100644 index 5ad4e1a6722..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package securitycontacts - -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 *[]SecurityContact -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityContact -} - -// List ... -func (c SecurityContactsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/securityContacts", 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 *[]SecurityContact `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 SecurityContactsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SecurityContactOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityContactsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SecurityContactOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityContact, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/securitycontacts/method_update.go b/resource-manager/security/2017-08-01-preview/securitycontacts/method_update.go deleted file mode 100644 index 6321bd18654..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package securitycontacts - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SecurityContact -} - -// Update ... -func (c SecurityContactsClient) Update(ctx context.Context, id SecurityContactId, input SecurityContact) (result UpdateOperationResponse, 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 SecurityContact - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontact.go b/resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontact.go deleted file mode 100644 index 2381a3b7938..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontact.go +++ /dev/null @@ -1,11 +0,0 @@ -package securitycontacts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityContact struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SecurityContactProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontactproperties.go b/resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontactproperties.go deleted file mode 100644 index f035a4c3e0a..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/model_securitycontactproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package securitycontacts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityContactProperties struct { - AlertNotifications AlertNotifications `json:"alertNotifications"` - AlertsToAdmins AlertsToAdmins `json:"alertsToAdmins"` - Email string `json:"email"` - Phone *string `json:"phone,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/securitycontacts/predicates.go b/resource-manager/security/2017-08-01-preview/securitycontacts/predicates.go deleted file mode 100644 index c92d20bb42b..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package securitycontacts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityContactOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p SecurityContactOperationPredicate) Matches(input SecurityContact) 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/security/2017-08-01-preview/securitycontacts/version.go b/resource-manager/security/2017-08-01-preview/securitycontacts/version.go deleted file mode 100644 index 66152d3b579..00000000000 --- a/resource-manager/security/2017-08-01-preview/securitycontacts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitycontacts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securitycontacts/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/settings/README.md b/resource-manager/security/2017-08-01-preview/settings/README.md deleted file mode 100644 index 795d53dfc83..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/README.md +++ /dev/null @@ -1,75 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/settings` Documentation - -The `settings` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/settings" -``` - - -### Client Initialization - -```go -client := settings.NewSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SettingsClient.Get` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS") - -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: `SettingsClient.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: `SettingsClient.Update` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS") - -payload := settings.Setting{ - // ... -} - - -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/security/2017-08-01-preview/settings/client.go b/resource-manager/security/2017-08-01-preview/settings/client.go deleted file mode 100644 index 7a9bd9ec8a1..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package settings - -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 SettingsClient struct { - Client *resourcemanager.Client -} - -func NewSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*SettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "settings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SettingsClient: %+v", err) - } - - return &SettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/settings/constants.go b/resource-manager/security/2017-08-01-preview/settings/constants.go deleted file mode 100644 index d7bc8458c6f..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package settings - -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 SettingKind string - -const ( - SettingKindAlertSuppressionSetting SettingKind = "AlertSuppressionSetting" - SettingKindDataExportSetting SettingKind = "DataExportSetting" -) - -func PossibleValuesForSettingKind() []string { - return []string{ - string(SettingKindAlertSuppressionSetting), - string(SettingKindDataExportSetting), - } -} - -func (s *SettingKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingKind(input string) (*SettingKind, error) { - vals := map[string]SettingKind{ - "alertsuppressionsetting": SettingKindAlertSuppressionSetting, - "dataexportsetting": SettingKindDataExportSetting, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingKind(input) - return &out, nil -} - -type SettingName string - -const ( - SettingNameMCAS SettingName = "MCAS" - SettingNameWDATP SettingName = "WDATP" -) - -func PossibleValuesForSettingName() []string { - return []string{ - string(SettingNameMCAS), - string(SettingNameWDATP), - } -} - -func (s *SettingName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingName(input string) (*SettingName, error) { - vals := map[string]SettingName{ - "mcas": SettingNameMCAS, - "wdatp": SettingNameWDATP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingName(input) - return &out, nil -} diff --git a/resource-manager/security/2017-08-01-preview/settings/id_setting.go b/resource-manager/security/2017-08-01-preview/settings/id_setting.go deleted file mode 100644 index bb7aff42014..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/id_setting.go +++ /dev/null @@ -1,129 +0,0 @@ -package settings - -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(&SettingId{}) -} - -var _ resourceids.ResourceId = &SettingId{} - -// SettingId is a struct representing the Resource ID for a Setting -type SettingId struct { - SubscriptionId string - SettingName SettingName -} - -// NewSettingID returns a new SettingId struct -func NewSettingID(subscriptionId string, settingName SettingName) SettingId { - return SettingId{ - SubscriptionId: subscriptionId, - SettingName: settingName, - } -} - -// ParseSettingID parses 'input' into a SettingId -func ParseSettingID(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSettingIDInsensitively parses 'input' case-insensitively into a SettingId -// note: this method should only be used for API response data and not user input -func ParseSettingIDInsensitively(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SettingId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if v, ok := input.Parsed["settingName"]; true { - if !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "settingName", input) - } - - settingName, err := parseSettingName(v) - if err != nil { - return fmt.Errorf("parsing %q: %+v", v, err) - } - id.SettingName = *settingName - } - - return nil -} - -// ValidateSettingID checks that 'input' can be parsed as a Setting ID -func ValidateSettingID(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 := ParseSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Setting ID -func (id SettingId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/settings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, string(id.SettingName)) -} - -// Segments returns a slice of Resource ID Segments which comprise this Setting ID -func (id SettingId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticSettings", "settings", "settings"), - resourceids.ConstantSegment("settingName", PossibleValuesForSettingName(), "MCAS"), - } -} - -// String returns a human-readable description of this Setting ID -func (id SettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Setting Name: %q", string(id.SettingName)), - } - return fmt.Sprintf("Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/settings/id_setting_test.go b/resource-manager/security/2017-08-01-preview/settings/id_setting_test.go deleted file mode 100644 index 388b1c0092a..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/id_setting_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package settings - -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 = &SettingId{} - -func TestNewSettingID(t *testing.T) { - id := NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS") - - 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.SettingName != "MCAS" { - t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "MCAS") - } -} - -func TestFormatSettingID(t *testing.T) { - actual := NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SettingName: "MCAS", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingID(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.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestParseSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEtTiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SettingName: "MCAS", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEtTiNgS/mCaS", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SettingName: "MCAS", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEtTiNgS/mCaS/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingIDInsensitively(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.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestSegmentsForSettingId(t *testing.T) { - segments := SettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SettingId 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/security/2017-08-01-preview/settings/method_get.go b/resource-manager/security/2017-08-01-preview/settings/method_get.go deleted file mode 100644 index 0ff21eba040..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 *Setting -} - -// Get ... -func (c SettingsClient) Get(ctx context.Context, id SettingId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/security/2017-08-01-preview/settings/method_list.go b/resource-manager/security/2017-08-01-preview/settings/method_list.go deleted file mode 100644 index a353ea41327..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/method_list.go +++ /dev/null @@ -1,104 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 *[]Setting -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Setting -} - -// List ... -func (c SettingsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/settings", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]Setting, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalSettingImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for Setting (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c SettingsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SettingOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SettingsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SettingOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Setting, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/settings/method_update.go b/resource-manager/security/2017-08-01-preview/settings/method_update.go deleted file mode 100644 index 283f4df6177..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/method_update.go +++ /dev/null @@ -1,62 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Setting -} - -// Update ... -func (c SettingsClient) Update(ctx context.Context, id SettingId, input Setting) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/security/2017-08-01-preview/settings/model_dataexportsetting.go b/resource-manager/security/2017-08-01-preview/settings/model_dataexportsetting.go deleted file mode 100644 index 3c5c41fec94..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/model_dataexportsetting.go +++ /dev/null @@ -1,44 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Setting = DataExportSetting{} - -type DataExportSetting struct { - Properties *DataExportSettingProperties `json:"properties,omitempty"` - - // Fields inherited from Setting - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DataExportSetting{} - -func (s DataExportSetting) MarshalJSON() ([]byte, error) { - type wrapper DataExportSetting - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DataExportSetting: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DataExportSetting: %+v", err) - } - decoded["kind"] = "DataExportSetting" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DataExportSetting: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/security/2017-08-01-preview/settings/model_dataexportsettingproperties.go b/resource-manager/security/2017-08-01-preview/settings/model_dataexportsettingproperties.go deleted file mode 100644 index 58764d1f0df..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/model_dataexportsettingproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataExportSettingProperties struct { - Enabled bool `json:"enabled"` -} diff --git a/resource-manager/security/2017-08-01-preview/settings/model_setting.go b/resource-manager/security/2017-08-01-preview/settings/model_setting.go deleted file mode 100644 index 0f98201eadd..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/model_setting.go +++ /dev/null @@ -1,53 +0,0 @@ -package settings - -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 Setting interface { -} - -// RawSettingImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSettingImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalSettingImplementation(input []byte) (Setting, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Setting into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "DataExportSetting") { - var out DataExportSetting - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DataExportSetting: %+v", err) - } - return out, nil - } - - out := RawSettingImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/security/2017-08-01-preview/settings/predicates.go b/resource-manager/security/2017-08-01-preview/settings/predicates.go deleted file mode 100644 index 47c095a507a..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SettingOperationPredicate struct { -} - -func (p SettingOperationPredicate) Matches(input Setting) bool { - - return true -} diff --git a/resource-manager/security/2017-08-01-preview/settings/version.go b/resource-manager/security/2017-08-01-preview/settings/version.go deleted file mode 100644 index 657d1cc93b2..00000000000 --- a/resource-manager/security/2017-08-01-preview/settings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package settings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/settings/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/README.md b/resource-manager/security/2017-08-01-preview/workspacesettings/README.md deleted file mode 100644 index eb65374c9f0..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/README.md +++ /dev/null @@ -1,112 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/workspacesettings` Documentation - -The `workspacesettings` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2017-08-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/security/2017-08-01-preview/workspacesettings" -``` - - -### Client Initialization - -```go -client := workspacesettings.NewWorkspaceSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WorkspaceSettingsClient.Create` - -```go -ctx := context.TODO() -id := workspacesettings.NewWorkspaceSettingID("12345678-1234-9876-4563-123456789012", "workspaceSettingValue") - -payload := workspacesettings.WorkspaceSetting{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `WorkspaceSettingsClient.Delete` - -```go -ctx := context.TODO() -id := workspacesettings.NewWorkspaceSettingID("12345678-1234-9876-4563-123456789012", "workspaceSettingValue") - -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: `WorkspaceSettingsClient.Get` - -```go -ctx := context.TODO() -id := workspacesettings.NewWorkspaceSettingID("12345678-1234-9876-4563-123456789012", "workspaceSettingValue") - -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: `WorkspaceSettingsClient.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: `WorkspaceSettingsClient.Update` - -```go -ctx := context.TODO() -id := workspacesettings.NewWorkspaceSettingID("12345678-1234-9876-4563-123456789012", "workspaceSettingValue") - -payload := workspacesettings.WorkspaceSetting{ - // ... -} - - -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/security/2017-08-01-preview/workspacesettings/client.go b/resource-manager/security/2017-08-01-preview/workspacesettings/client.go deleted file mode 100644 index 9f2ca64d2bd..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package workspacesettings - -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 WorkspaceSettingsClient struct { - Client *resourcemanager.Client -} - -func NewWorkspaceSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*WorkspaceSettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "workspacesettings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WorkspaceSettingsClient: %+v", err) - } - - return &WorkspaceSettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting.go b/resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting.go deleted file mode 100644 index ad0d81b2079..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting.go +++ /dev/null @@ -1,121 +0,0 @@ -package workspacesettings - -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(&WorkspaceSettingId{}) -} - -var _ resourceids.ResourceId = &WorkspaceSettingId{} - -// WorkspaceSettingId is a struct representing the Resource ID for a Workspace Setting -type WorkspaceSettingId struct { - SubscriptionId string - WorkspaceSettingName string -} - -// NewWorkspaceSettingID returns a new WorkspaceSettingId struct -func NewWorkspaceSettingID(subscriptionId string, workspaceSettingName string) WorkspaceSettingId { - return WorkspaceSettingId{ - SubscriptionId: subscriptionId, - WorkspaceSettingName: workspaceSettingName, - } -} - -// ParseWorkspaceSettingID parses 'input' into a WorkspaceSettingId -func ParseWorkspaceSettingID(input string) (*WorkspaceSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceSettingIDInsensitively parses 'input' case-insensitively into a WorkspaceSettingId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceSettingIDInsensitively(input string) (*WorkspaceSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceSettingId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if id.WorkspaceSettingName, ok = input.Parsed["workspaceSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceSettingName", input) - } - - return nil -} - -// ValidateWorkspaceSettingID checks that 'input' can be parsed as a Workspace Setting ID -func ValidateWorkspaceSettingID(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 := ParseWorkspaceSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace Setting ID -func (id WorkspaceSettingId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/workspaceSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.WorkspaceSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace Setting ID -func (id WorkspaceSettingId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticWorkspaceSettings", "workspaceSettings", "workspaceSettings"), - resourceids.UserSpecifiedSegment("workspaceSettingName", "workspaceSettingValue"), - } -} - -// String returns a human-readable description of this Workspace Setting ID -func (id WorkspaceSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Workspace Setting Name: %q", id.WorkspaceSettingName), - } - return fmt.Sprintf("Workspace Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting_test.go b/resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting_test.go deleted file mode 100644 index 9924eea6a0e..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/id_workspacesetting_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package workspacesettings - -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 = &WorkspaceSettingId{} - -func TestNewWorkspaceSettingID(t *testing.T) { - id := NewWorkspaceSettingID("12345678-1234-9876-4563-123456789012", "workspaceSettingValue") - - 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.WorkspaceSettingName != "workspaceSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceSettingName'", id.WorkspaceSettingName, "workspaceSettingValue") - } -} - -func TestFormatWorkspaceSettingID(t *testing.T) { - actual := NewWorkspaceSettingID("12345678-1234-9876-4563-123456789012", "workspaceSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings/workspaceSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceSettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings/workspaceSettingValue", - Expected: &WorkspaceSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - WorkspaceSettingName: "workspaceSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings/workspaceSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceSettingID(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.WorkspaceSettingName != v.Expected.WorkspaceSettingName { - t.Fatalf("Expected %q but got %q for WorkspaceSettingName", v.Expected.WorkspaceSettingName, actual.WorkspaceSettingName) - } - - } -} - -func TestParseWorkspaceSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceSettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/wOrKsPaCeSeTtInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings/workspaceSettingValue", - Expected: &WorkspaceSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - WorkspaceSettingName: "workspaceSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/workspaceSettings/workspaceSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/wOrKsPaCeSeTtInGs/wOrKsPaCeSeTtInGvAlUe", - Expected: &WorkspaceSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - WorkspaceSettingName: "wOrKsPaCeSeTtInGvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/wOrKsPaCeSeTtInGs/wOrKsPaCeSeTtInGvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceSettingIDInsensitively(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.WorkspaceSettingName != v.Expected.WorkspaceSettingName { - t.Fatalf("Expected %q but got %q for WorkspaceSettingName", v.Expected.WorkspaceSettingName, actual.WorkspaceSettingName) - } - - } -} - -func TestSegmentsForWorkspaceSettingId(t *testing.T) { - segments := WorkspaceSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceSettingId 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/security/2017-08-01-preview/workspacesettings/method_create.go b/resource-manager/security/2017-08-01-preview/workspacesettings/method_create.go deleted file mode 100644 index 784689ef21d..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/method_create.go +++ /dev/null @@ -1,58 +0,0 @@ -package workspacesettings - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *WorkspaceSetting -} - -// Create ... -func (c WorkspaceSettingsClient) Create(ctx context.Context, id WorkspaceSettingId, input WorkspaceSetting) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 WorkspaceSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/method_delete.go b/resource-manager/security/2017-08-01-preview/workspacesettings/method_delete.go deleted file mode 100644 index 6600eb325a1..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/method_delete.go +++ /dev/null @@ -1,46 +0,0 @@ -package workspacesettings - -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 WorkspaceSettingsClient) Delete(ctx context.Context, id WorkspaceSettingId) (result DeleteOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/method_get.go b/resource-manager/security/2017-08-01-preview/workspacesettings/method_get.go deleted file mode 100644 index 0846e4b79d0..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package workspacesettings - -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 *WorkspaceSetting -} - -// Get ... -func (c WorkspaceSettingsClient) Get(ctx context.Context, id WorkspaceSettingId) (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 WorkspaceSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/method_list.go b/resource-manager/security/2017-08-01-preview/workspacesettings/method_list.go deleted file mode 100644 index ecc85caf684..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/method_list.go +++ /dev/null @@ -1,92 +0,0 @@ -package workspacesettings - -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 *[]WorkspaceSetting -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []WorkspaceSetting -} - -// List ... -func (c WorkspaceSettingsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/workspaceSettings", 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 *[]WorkspaceSetting `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 WorkspaceSettingsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WorkspaceSettingOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WorkspaceSettingsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate WorkspaceSettingOperationPredicate) (result ListCompleteResult, err error) { - items := make([]WorkspaceSetting, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2017-08-01-preview/workspacesettings/method_update.go b/resource-manager/security/2017-08-01-preview/workspacesettings/method_update.go deleted file mode 100644 index ceb4e169268..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package workspacesettings - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *WorkspaceSetting -} - -// Update ... -func (c WorkspaceSettingsClient) Update(ctx context.Context, id WorkspaceSettingId, input WorkspaceSetting) (result UpdateOperationResponse, 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 WorkspaceSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesetting.go b/resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesetting.go deleted file mode 100644 index 960aeb5e8c1..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesetting.go +++ /dev/null @@ -1,11 +0,0 @@ -package workspacesettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WorkspaceSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WorkspaceSettingProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesettingproperties.go b/resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesettingproperties.go deleted file mode 100644 index e1e2f0c6230..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/model_workspacesettingproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package workspacesettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WorkspaceSettingProperties struct { - Scope string `json:"scope"` - WorkspaceId string `json:"workspaceId"` -} diff --git a/resource-manager/security/2017-08-01-preview/workspacesettings/predicates.go b/resource-manager/security/2017-08-01-preview/workspacesettings/predicates.go deleted file mode 100644 index c11aa0bb7dc..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package workspacesettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WorkspaceSettingOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p WorkspaceSettingOperationPredicate) Matches(input WorkspaceSetting) 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/security/2017-08-01-preview/workspacesettings/version.go b/resource-manager/security/2017-08-01-preview/workspacesettings/version.go deleted file mode 100644 index 944b1b25c10..00000000000 --- a/resource-manager/security/2017-08-01-preview/workspacesettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package workspacesettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2017-08-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/workspacesettings/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/README.md b/resource-manager/security/2019-01-01/advancedthreatprotection/README.md deleted file mode 100644 index b8869d167f1..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/README.md +++ /dev/null @@ -1,58 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01/advancedthreatprotection` Documentation - -The `advancedthreatprotection` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2019-01-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/security/2019-01-01/advancedthreatprotection" -``` - - -### Client Initialization - -```go -client := advancedthreatprotection.NewAdvancedThreatProtectionClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AdvancedThreatProtectionClient.Create` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -payload := advancedthreatprotection.AdvancedThreatProtectionSetting{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AdvancedThreatProtectionClient.Get` - -```go -ctx := context.TODO() -id := commonids.NewScopeID("/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/some-resource-group") - -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 -} -``` diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/client.go b/resource-manager/security/2019-01-01/advancedthreatprotection/client.go deleted file mode 100644 index f6a8e468e8f..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package advancedthreatprotection - -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 AdvancedThreatProtectionClient struct { - Client *resourcemanager.Client -} - -func NewAdvancedThreatProtectionClientWithBaseURI(sdkApi sdkEnv.Api) (*AdvancedThreatProtectionClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "advancedthreatprotection", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AdvancedThreatProtectionClient: %+v", err) - } - - return &AdvancedThreatProtectionClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/method_create.go b/resource-manager/security/2019-01-01/advancedthreatprotection/method_create.go deleted file mode 100644 index e61c0708116..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/method_create.go +++ /dev/null @@ -1,60 +0,0 @@ -package advancedthreatprotection - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AdvancedThreatProtectionSetting -} - -// Create ... -func (c AdvancedThreatProtectionClient) Create(ctx context.Context, id commonids.ScopeId, input AdvancedThreatProtectionSetting) (result CreateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPut, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/advancedThreatProtectionSettings/current", 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 AdvancedThreatProtectionSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/method_get.go b/resource-manager/security/2019-01-01/advancedthreatprotection/method_get.go deleted file mode 100644 index bd66a54c4d3..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/method_get.go +++ /dev/null @@ -1,56 +0,0 @@ -package advancedthreatprotection - -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 GetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *AdvancedThreatProtectionSetting -} - -// Get ... -func (c AdvancedThreatProtectionClient) Get(ctx context.Context, id commonids.ScopeId) (result GetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/advancedThreatProtectionSettings/current", 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 AdvancedThreatProtectionSetting - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionproperties.go b/resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionproperties.go deleted file mode 100644 index 46f35818e85..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package advancedthreatprotection - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdvancedThreatProtectionProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionsetting.go b/resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionsetting.go deleted file mode 100644 index 428c0f467b7..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/model_advancedthreatprotectionsetting.go +++ /dev/null @@ -1,11 +0,0 @@ -package advancedthreatprotection - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AdvancedThreatProtectionSetting struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AdvancedThreatProtectionProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2019-01-01/advancedthreatprotection/version.go b/resource-manager/security/2019-01-01/advancedthreatprotection/version.go deleted file mode 100644 index 9468e8c7b4e..00000000000 --- a/resource-manager/security/2019-01-01/advancedthreatprotection/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package advancedthreatprotection - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2019-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/advancedthreatprotection/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2019-01-01/alerts/README.md b/resource-manager/security/2019-01-01/alerts/README.md deleted file mode 100644 index c350fab07a8..00000000000 --- a/resource-manager/security/2019-01-01/alerts/README.md +++ /dev/null @@ -1,185 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01/alerts` Documentation - -The `alerts` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2019-01-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/security/2019-01-01/alerts" -``` - - -### Client Initialization - -```go -client := alerts.NewAlertsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertsClient.GetResourceGroupLevelAlerts` - -```go -ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "alertValue") - -read, err := client.GetResourceGroupLevelAlerts(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AlertsClient.GetSubscriptionLevelAlert` - -```go -ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationValue", "alertValue") - -read, err := client.GetSubscriptionLevelAlert(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AlertsClient.List` - -```go -ctx := context.TODO() -id := commonids.NewSubscriptionID("12345678-1234-9876-4563-123456789012") - -// alternatively `client.List(ctx, id, alerts.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, alerts.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AlertsClient.ListByResourceGroup` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -// alternatively `client.ListByResourceGroup(ctx, id, alerts.DefaultListByResourceGroupOperationOptions())` can be used to do batched pagination -items, err := client.ListByResourceGroupComplete(ctx, id, alerts.DefaultListByResourceGroupOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AlertsClient.ListResourceGroupLevelAlertsByRegion` - -```go -ctx := context.TODO() -id := alerts.NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - -// alternatively `client.ListResourceGroupLevelAlertsByRegion(ctx, id, alerts.DefaultListResourceGroupLevelAlertsByRegionOperationOptions())` can be used to do batched pagination -items, err := client.ListResourceGroupLevelAlertsByRegionComplete(ctx, id, alerts.DefaultListResourceGroupLevelAlertsByRegionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AlertsClient.ListSubscriptionLevelAlertsByRegion` - -```go -ctx := context.TODO() -id := alerts.NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue") - -// alternatively `client.ListSubscriptionLevelAlertsByRegion(ctx, id, alerts.DefaultListSubscriptionLevelAlertsByRegionOperationOptions())` can be used to do batched pagination -items, err := client.ListSubscriptionLevelAlertsByRegionComplete(ctx, id, alerts.DefaultListSubscriptionLevelAlertsByRegionOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `AlertsClient.UpdateResourceGroupLevelAlertStateToDismiss` - -```go -ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "alertValue") - -read, err := client.UpdateResourceGroupLevelAlertStateToDismiss(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AlertsClient.UpdateResourceGroupLevelAlertStateToReactivate` - -```go -ctx := context.TODO() -id := alerts.NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "alertValue") - -read, err := client.UpdateResourceGroupLevelAlertStateToReactivate(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AlertsClient.UpdateSubscriptionLevelAlertStateToDismiss` - -```go -ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationValue", "alertValue") - -read, err := client.UpdateSubscriptionLevelAlertStateToDismiss(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `AlertsClient.UpdateSubscriptionLevelAlertStateToReactivate` - -```go -ctx := context.TODO() -id := alerts.NewAlertID("12345678-1234-9876-4563-123456789012", "locationValue", "alertValue") - -read, err := client.UpdateSubscriptionLevelAlertStateToReactivate(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/security/2019-01-01/alerts/client.go b/resource-manager/security/2019-01-01/alerts/client.go deleted file mode 100644 index a0f2e8f132f..00000000000 --- a/resource-manager/security/2019-01-01/alerts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alerts - -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 AlertsClient struct { - Client *resourcemanager.Client -} - -func NewAlertsClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alerts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertsClient: %+v", err) - } - - return &AlertsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2019-01-01/alerts/constants.go b/resource-manager/security/2019-01-01/alerts/constants.go deleted file mode 100644 index ad0a68f5c37..00000000000 --- a/resource-manager/security/2019-01-01/alerts/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package alerts - -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 ReportedSeverity string - -const ( - ReportedSeverityHigh ReportedSeverity = "High" - ReportedSeverityInformational ReportedSeverity = "Informational" - ReportedSeverityLow ReportedSeverity = "Low" - ReportedSeverityMedium ReportedSeverity = "Medium" -) - -func PossibleValuesForReportedSeverity() []string { - return []string{ - string(ReportedSeverityHigh), - string(ReportedSeverityInformational), - string(ReportedSeverityLow), - string(ReportedSeverityMedium), - } -} - -func (s *ReportedSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseReportedSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseReportedSeverity(input string) (*ReportedSeverity, error) { - vals := map[string]ReportedSeverity{ - "high": ReportedSeverityHigh, - "informational": ReportedSeverityInformational, - "low": ReportedSeverityLow, - "medium": ReportedSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ReportedSeverity(input) - return &out, nil -} diff --git a/resource-manager/security/2019-01-01/alerts/id_alert.go b/resource-manager/security/2019-01-01/alerts/id_alert.go deleted file mode 100644 index 2f82cadcc33..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_alert.go +++ /dev/null @@ -1,130 +0,0 @@ -package alerts - -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(&AlertId{}) -} - -var _ resourceids.ResourceId = &AlertId{} - -// AlertId is a struct representing the Resource ID for a Alert -type AlertId struct { - SubscriptionId string - LocationName string - AlertName string -} - -// NewAlertID returns a new AlertId struct -func NewAlertID(subscriptionId string, locationName string, alertName string) AlertId { - return AlertId{ - SubscriptionId: subscriptionId, - LocationName: locationName, - AlertName: alertName, - } -} - -// ParseAlertID parses 'input' into a AlertId -func ParseAlertID(input string) (*AlertId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertIDInsensitively parses 'input' case-insensitively into a AlertId -// note: this method should only be used for API response data and not user input -func ParseAlertIDInsensitively(input string) (*AlertId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertId) 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.AlertName, ok = input.Parsed["alertName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "alertName", input) - } - - return nil -} - -// ValidateAlertID checks that 'input' can be parsed as a Alert ID -func ValidateAlertID(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 := ParseAlertID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert ID -func (id AlertId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/locations/%s/alerts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.LocationName, id.AlertName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert ID -func (id AlertId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), - resourceids.UserSpecifiedSegment("alertName", "alertValue"), - } -} - -// String returns a human-readable description of this Alert ID -func (id AlertId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Location Name: %q", id.LocationName), - fmt.Sprintf("Alert Name: %q", id.AlertName), - } - return fmt.Sprintf("Alert (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2019-01-01/alerts/id_alert_test.go b/resource-manager/security/2019-01-01/alerts/id_alert_test.go deleted file mode 100644 index 1897159f815..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_alert_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alerts - -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 = &AlertId{} - -func TestNewAlertID(t *testing.T) { - id := NewAlertID("12345678-1234-9876-4563-123456789012", "locationValue", "alertValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } - - if id.AlertName != "alertValue" { - t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "alertValue") - } -} - -func TestFormatAlertID(t *testing.T) { - actual := NewAlertID("12345678-1234-9876-4563-123456789012", "locationValue", "alertValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts/alertValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts/alertValue", - Expected: &AlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - AlertName: "alertValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts/alertValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertID(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.AlertName != v.Expected.AlertName { - t.Fatalf("Expected %q but got %q for AlertName", v.Expected.AlertName, actual.AlertName) - } - - } -} - -func TestParseAlertIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/aLeRtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts/alertValue", - Expected: &AlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - AlertName: "alertValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/alerts/alertValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/aLeRtS/aLeRtVaLuE", - Expected: &AlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - AlertName: "aLeRtVaLuE", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/aLeRtS/aLeRtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertIDInsensitively(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.AlertName != v.Expected.AlertName { - t.Fatalf("Expected %q but got %q for AlertName", v.Expected.AlertName, actual.AlertName) - } - - } -} - -func TestSegmentsForAlertId(t *testing.T) { - segments := AlertId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertId 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/security/2019-01-01/alerts/id_location.go b/resource-manager/security/2019-01-01/alerts/id_location.go deleted file mode 100644 index ad32a70cafa..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_location.go +++ /dev/null @@ -1,121 +0,0 @@ -package alerts - -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.Security/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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// 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/security/2019-01-01/alerts/id_location_test.go b/resource-manager/security/2019-01-01/alerts/id_location_test.go deleted file mode 100644 index d8dc62e7dd0..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_location_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package alerts - -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", "locationValue") - - 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 != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatLocationID(t *testing.T) { - actual := NewLocationID("12345678-1234-9876-4563-123456789012", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue" - 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &LocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/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/security/2019-01-01/alerts/id_locationalert.go b/resource-manager/security/2019-01-01/alerts/id_locationalert.go deleted file mode 100644 index b6073e7e813..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_locationalert.go +++ /dev/null @@ -1,139 +0,0 @@ -package alerts - -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(&LocationAlertId{}) -} - -var _ resourceids.ResourceId = &LocationAlertId{} - -// LocationAlertId is a struct representing the Resource ID for a Location Alert -type LocationAlertId struct { - SubscriptionId string - ResourceGroupName string - LocationName string - AlertName string -} - -// NewLocationAlertID returns a new LocationAlertId struct -func NewLocationAlertID(subscriptionId string, resourceGroupName string, locationName string, alertName string) LocationAlertId { - return LocationAlertId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - AlertName: alertName, - } -} - -// ParseLocationAlertID parses 'input' into a LocationAlertId -func ParseLocationAlertID(input string) (*LocationAlertId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocationAlertId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocationAlertId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseLocationAlertIDInsensitively parses 'input' case-insensitively into a LocationAlertId -// note: this method should only be used for API response data and not user input -func ParseLocationAlertIDInsensitively(input string) (*LocationAlertId, error) { - parser := resourceids.NewParserFromResourceIdType(&LocationAlertId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := LocationAlertId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *LocationAlertId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - if id.AlertName, ok = input.Parsed["alertName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "alertName", input) - } - - return nil -} - -// ValidateLocationAlertID checks that 'input' can be parsed as a Location Alert ID -func ValidateLocationAlertID(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 := ParseLocationAlertID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Location Alert ID -func (id LocationAlertId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/locations/%s/alerts/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName, id.AlertName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Location Alert ID -func (id LocationAlertId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - resourceids.StaticSegment("staticAlerts", "alerts", "alerts"), - resourceids.UserSpecifiedSegment("alertName", "alertValue"), - } -} - -// String returns a human-readable description of this Location Alert ID -func (id LocationAlertId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - fmt.Sprintf("Alert Name: %q", id.AlertName), - } - return fmt.Sprintf("Location Alert (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2019-01-01/alerts/id_locationalert_test.go b/resource-manager/security/2019-01-01/alerts/id_locationalert_test.go deleted file mode 100644 index 9080608944b..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_locationalert_test.go +++ /dev/null @@ -1,327 +0,0 @@ -package alerts - -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 = &LocationAlertId{} - -func TestNewLocationAlertID(t *testing.T) { - id := NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "alertValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } - - if id.AlertName != "alertValue" { - t.Fatalf("Expected %q but got %q for Segment 'AlertName'", id.AlertName, "alertValue") - } -} - -func TestFormatLocationAlertID(t *testing.T) { - actual := NewLocationAlertID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue", "alertValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts/alertValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseLocationAlertID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocationAlertId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts/alertValue", - Expected: &LocationAlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - AlertName: "alertValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts/alertValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocationAlertID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - if actual.AlertName != v.Expected.AlertName { - t.Fatalf("Expected %q but got %q for AlertName", v.Expected.AlertName, actual.AlertName) - } - - } -} - -func TestParseLocationAlertIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *LocationAlertId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/aLeRtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts/alertValue", - Expected: &LocationAlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - AlertName: "alertValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/alerts/alertValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/aLeRtS/aLeRtVaLuE", - Expected: &LocationAlertId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - AlertName: "aLeRtVaLuE", - }, - }, - { - // 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.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/aLeRtS/aLeRtVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseLocationAlertIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - if actual.AlertName != v.Expected.AlertName { - t.Fatalf("Expected %q but got %q for AlertName", v.Expected.AlertName, actual.AlertName) - } - - } -} - -func TestSegmentsForLocationAlertId(t *testing.T) { - segments := LocationAlertId{}.Segments() - if len(segments) == 0 { - t.Fatalf("LocationAlertId 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/security/2019-01-01/alerts/id_providerlocation.go b/resource-manager/security/2019-01-01/alerts/id_providerlocation.go deleted file mode 100644 index 923f3e580eb..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_providerlocation.go +++ /dev/null @@ -1,130 +0,0 @@ -package alerts - -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(&ProviderLocationId{}) -} - -var _ resourceids.ResourceId = &ProviderLocationId{} - -// ProviderLocationId is a struct representing the Resource ID for a Provider Location -type ProviderLocationId struct { - SubscriptionId string - ResourceGroupName string - LocationName string -} - -// NewProviderLocationID returns a new ProviderLocationId struct -func NewProviderLocationID(subscriptionId string, resourceGroupName string, locationName string) ProviderLocationId { - return ProviderLocationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - LocationName: locationName, - } -} - -// ParseProviderLocationID parses 'input' into a ProviderLocationId -func ParseProviderLocationID(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseProviderLocationIDInsensitively parses 'input' case-insensitively into a ProviderLocationId -// note: this method should only be used for API response data and not user input -func ParseProviderLocationIDInsensitively(input string) (*ProviderLocationId, error) { - parser := resourceids.NewParserFromResourceIdType(&ProviderLocationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ProviderLocationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ProviderLocationId) 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.LocationName, ok = input.Parsed["locationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "locationName", input) - } - - return nil -} - -// ValidateProviderLocationID checks that 'input' can be parsed as a Provider Location ID -func ValidateProviderLocationID(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 := ParseProviderLocationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Provider Location ID -func (id ProviderLocationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.Security/locations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.LocationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Provider Location ID -func (id ProviderLocationId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticLocations", "locations", "locations"), - resourceids.UserSpecifiedSegment("locationName", "locationValue"), - } -} - -// String returns a human-readable description of this Provider Location ID -func (id ProviderLocationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Location Name: %q", id.LocationName), - } - return fmt.Sprintf("Provider Location (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2019-01-01/alerts/id_providerlocation_test.go b/resource-manager/security/2019-01-01/alerts/id_providerlocation_test.go deleted file mode 100644 index 066f59a55bf..00000000000 --- a/resource-manager/security/2019-01-01/alerts/id_providerlocation_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alerts - -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 = &ProviderLocationId{} - -func TestNewProviderLocationID(t *testing.T) { - id := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue") - - 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.LocationName != "locationValue" { - t.Fatalf("Expected %q but got %q for Segment 'LocationName'", id.LocationName, "locationValue") - } -} - -func TestFormatProviderLocationID(t *testing.T) { - actual := NewProviderLocationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "locationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseProviderLocationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationID(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestParseProviderLocationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ProviderLocationId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - LocationName: "locationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.Security/locations/locationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe", - Expected: &ProviderLocationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - LocationName: "lOcAtIoNvAlUe", - }, - }, - { - // 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.sEcUrItY/lOcAtIoNs/lOcAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseProviderLocationIDInsensitively(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.LocationName != v.Expected.LocationName { - t.Fatalf("Expected %q but got %q for LocationName", v.Expected.LocationName, actual.LocationName) - } - - } -} - -func TestSegmentsForProviderLocationId(t *testing.T) { - segments := ProviderLocationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ProviderLocationId 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/security/2019-01-01/alerts/method_getresourcegrouplevelalerts.go b/resource-manager/security/2019-01-01/alerts/method_getresourcegrouplevelalerts.go deleted file mode 100644 index a8f261a601c..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_getresourcegrouplevelalerts.go +++ /dev/null @@ -1,54 +0,0 @@ -package alerts - -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 GetResourceGroupLevelAlertsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Alert -} - -// GetResourceGroupLevelAlerts ... -func (c AlertsClient) GetResourceGroupLevelAlerts(ctx context.Context, id LocationAlertId) (result GetResourceGroupLevelAlertsOperationResponse, 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 Alert - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2019-01-01/alerts/method_getsubscriptionlevelalert.go b/resource-manager/security/2019-01-01/alerts/method_getsubscriptionlevelalert.go deleted file mode 100644 index 454c354494d..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_getsubscriptionlevelalert.go +++ /dev/null @@ -1,54 +0,0 @@ -package alerts - -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 GetSubscriptionLevelAlertOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Alert -} - -// GetSubscriptionLevelAlert ... -func (c AlertsClient) GetSubscriptionLevelAlert(ctx context.Context, id AlertId) (result GetSubscriptionLevelAlertOperationResponse, 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 Alert - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/security/2019-01-01/alerts/method_list.go b/resource-manager/security/2019-01-01/alerts/method_list.go deleted file mode 100644 index 1525be0e290..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_list.go +++ /dev/null @@ -1,132 +0,0 @@ -package alerts - -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 *[]Alert -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Alert -} - -type ListOperationOptions struct { - AutoDismissRuleName *string - Expand *string - Filter *string - Select *string -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.AutoDismissRuleName != nil { - out.Append("autoDismissRuleName", fmt.Sprintf("%v", *o.AutoDismissRuleName)) - } - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Select != nil { - out.Append("$select", fmt.Sprintf("%v", *o.Select)) - } - return &out -} - -// List ... -func (c AlertsClient) List(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/alerts", id.ID()), - OptionsObject: options, - } - - 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 *[]Alert `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 AlertsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, AlertOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, options ListOperationOptions, predicate AlertOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Alert, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/security/2019-01-01/alerts/method_listbyresourcegroup.go b/resource-manager/security/2019-01-01/alerts/method_listbyresourcegroup.go deleted file mode 100644 index ad33effca69..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_listbyresourcegroup.go +++ /dev/null @@ -1,132 +0,0 @@ -package alerts - -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 *[]Alert -} - -type ListByResourceGroupCompleteResult struct { - LatestHttpResponse *http.Response - Items []Alert -} - -type ListByResourceGroupOperationOptions struct { - AutoDismissRuleName *string - Expand *string - Filter *string - Select *string -} - -func DefaultListByResourceGroupOperationOptions() ListByResourceGroupOperationOptions { - return ListByResourceGroupOperationOptions{} -} - -func (o ListByResourceGroupOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListByResourceGroupOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListByResourceGroupOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.AutoDismissRuleName != nil { - out.Append("autoDismissRuleName", fmt.Sprintf("%v", *o.AutoDismissRuleName)) - } - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Select != nil { - out.Append("$select", fmt.Sprintf("%v", *o.Select)) - } - return &out -} - -// ListByResourceGroup ... -func (c AlertsClient) ListByResourceGroup(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (result ListByResourceGroupOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/alerts", id.ID()), - OptionsObject: options, - } - - 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 *[]Alert `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 AlertsClient) ListByResourceGroupComplete(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions) (ListByResourceGroupCompleteResult, error) { - return c.ListByResourceGroupCompleteMatchingPredicate(ctx, id, options, AlertOperationPredicate{}) -} - -// ListByResourceGroupCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertsClient) ListByResourceGroupCompleteMatchingPredicate(ctx context.Context, id commonids.ResourceGroupId, options ListByResourceGroupOperationOptions, predicate AlertOperationPredicate) (result ListByResourceGroupCompleteResult, err error) { - items := make([]Alert, 0) - - resp, err := c.ListByResourceGroup(ctx, id, options) - if err != nil { - 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/security/2019-01-01/alerts/method_listresourcegrouplevelalertsbyregion.go b/resource-manager/security/2019-01-01/alerts/method_listresourcegrouplevelalertsbyregion.go deleted file mode 100644 index a7f17a21e87..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_listresourcegrouplevelalertsbyregion.go +++ /dev/null @@ -1,131 +0,0 @@ -package alerts - -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 ListResourceGroupLevelAlertsByRegionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Alert -} - -type ListResourceGroupLevelAlertsByRegionCompleteResult struct { - LatestHttpResponse *http.Response - Items []Alert -} - -type ListResourceGroupLevelAlertsByRegionOperationOptions struct { - AutoDismissRuleName *string - Expand *string - Filter *string - Select *string -} - -func DefaultListResourceGroupLevelAlertsByRegionOperationOptions() ListResourceGroupLevelAlertsByRegionOperationOptions { - return ListResourceGroupLevelAlertsByRegionOperationOptions{} -} - -func (o ListResourceGroupLevelAlertsByRegionOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListResourceGroupLevelAlertsByRegionOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListResourceGroupLevelAlertsByRegionOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.AutoDismissRuleName != nil { - out.Append("autoDismissRuleName", fmt.Sprintf("%v", *o.AutoDismissRuleName)) - } - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Select != nil { - out.Append("$select", fmt.Sprintf("%v", *o.Select)) - } - return &out -} - -// ListResourceGroupLevelAlertsByRegion ... -func (c AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, id ProviderLocationId, options ListResourceGroupLevelAlertsByRegionOperationOptions) (result ListResourceGroupLevelAlertsByRegionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/alerts", id.ID()), - OptionsObject: options, - } - - 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 *[]Alert `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListResourceGroupLevelAlertsByRegionComplete retrieves all the results into a single object -func (c AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, id ProviderLocationId, options ListResourceGroupLevelAlertsByRegionOperationOptions) (ListResourceGroupLevelAlertsByRegionCompleteResult, error) { - return c.ListResourceGroupLevelAlertsByRegionCompleteMatchingPredicate(ctx, id, options, AlertOperationPredicate{}) -} - -// ListResourceGroupLevelAlertsByRegionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertsClient) ListResourceGroupLevelAlertsByRegionCompleteMatchingPredicate(ctx context.Context, id ProviderLocationId, options ListResourceGroupLevelAlertsByRegionOperationOptions, predicate AlertOperationPredicate) (result ListResourceGroupLevelAlertsByRegionCompleteResult, err error) { - items := make([]Alert, 0) - - resp, err := c.ListResourceGroupLevelAlertsByRegion(ctx, id, options) - if err != nil { - 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 = ListResourceGroupLevelAlertsByRegionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2019-01-01/alerts/method_listsubscriptionlevelalertsbyregion.go b/resource-manager/security/2019-01-01/alerts/method_listsubscriptionlevelalertsbyregion.go deleted file mode 100644 index 17b98687c58..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_listsubscriptionlevelalertsbyregion.go +++ /dev/null @@ -1,131 +0,0 @@ -package alerts - -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 ListSubscriptionLevelAlertsByRegionOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Alert -} - -type ListSubscriptionLevelAlertsByRegionCompleteResult struct { - LatestHttpResponse *http.Response - Items []Alert -} - -type ListSubscriptionLevelAlertsByRegionOperationOptions struct { - AutoDismissRuleName *string - Expand *string - Filter *string - Select *string -} - -func DefaultListSubscriptionLevelAlertsByRegionOperationOptions() ListSubscriptionLevelAlertsByRegionOperationOptions { - return ListSubscriptionLevelAlertsByRegionOperationOptions{} -} - -func (o ListSubscriptionLevelAlertsByRegionOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListSubscriptionLevelAlertsByRegionOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListSubscriptionLevelAlertsByRegionOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.AutoDismissRuleName != nil { - out.Append("autoDismissRuleName", fmt.Sprintf("%v", *o.AutoDismissRuleName)) - } - if o.Expand != nil { - out.Append("$expand", fmt.Sprintf("%v", *o.Expand)) - } - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Select != nil { - out.Append("$select", fmt.Sprintf("%v", *o.Select)) - } - return &out -} - -// ListSubscriptionLevelAlertsByRegion ... -func (c AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, id LocationId, options ListSubscriptionLevelAlertsByRegionOperationOptions) (result ListSubscriptionLevelAlertsByRegionOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/alerts", id.ID()), - OptionsObject: options, - } - - 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 *[]Alert `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListSubscriptionLevelAlertsByRegionComplete retrieves all the results into a single object -func (c AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, id LocationId, options ListSubscriptionLevelAlertsByRegionOperationOptions) (ListSubscriptionLevelAlertsByRegionCompleteResult, error) { - return c.ListSubscriptionLevelAlertsByRegionCompleteMatchingPredicate(ctx, id, options, AlertOperationPredicate{}) -} - -// ListSubscriptionLevelAlertsByRegionCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertsClient) ListSubscriptionLevelAlertsByRegionCompleteMatchingPredicate(ctx context.Context, id LocationId, options ListSubscriptionLevelAlertsByRegionOperationOptions, predicate AlertOperationPredicate) (result ListSubscriptionLevelAlertsByRegionCompleteResult, err error) { - items := make([]Alert, 0) - - resp, err := c.ListSubscriptionLevelAlertsByRegion(ctx, id, options) - if err != nil { - 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 = ListSubscriptionLevelAlertsByRegionCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetodismiss.go b/resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetodismiss.go deleted file mode 100644 index b2b34fff4cc..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetodismiss.go +++ /dev/null @@ -1,47 +0,0 @@ -package alerts - -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 UpdateResourceGroupLevelAlertStateToDismissOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateResourceGroupLevelAlertStateToDismiss ... -func (c AlertsClient) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, id LocationAlertId) (result UpdateResourceGroupLevelAlertStateToDismissOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/dismiss", 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/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetoreactivate.go b/resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetoreactivate.go deleted file mode 100644 index 7d16c57eff0..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_updateresourcegrouplevelalertstatetoreactivate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alerts - -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 UpdateResourceGroupLevelAlertStateToReactivateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateResourceGroupLevelAlertStateToReactivate ... -func (c AlertsClient) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, id LocationAlertId) (result UpdateResourceGroupLevelAlertStateToReactivateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reactivate", 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/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetodismiss.go b/resource-manager/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetodismiss.go deleted file mode 100644 index c6d4c865fab..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetodismiss.go +++ /dev/null @@ -1,47 +0,0 @@ -package alerts - -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 UpdateSubscriptionLevelAlertStateToDismissOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateSubscriptionLevelAlertStateToDismiss ... -func (c AlertsClient) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, id AlertId) (result UpdateSubscriptionLevelAlertStateToDismissOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/dismiss", 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/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetoreactivate.go b/resource-manager/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetoreactivate.go deleted file mode 100644 index 490247ba785..00000000000 --- a/resource-manager/security/2019-01-01/alerts/method_updatesubscriptionlevelalertstatetoreactivate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alerts - -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 UpdateSubscriptionLevelAlertStateToReactivateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// UpdateSubscriptionLevelAlertStateToReactivate ... -func (c AlertsClient) UpdateSubscriptionLevelAlertStateToReactivate(ctx context.Context, id AlertId) (result UpdateSubscriptionLevelAlertStateToReactivateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/reactivate", 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/security/2019-01-01/alerts/model_alert.go b/resource-manager/security/2019-01-01/alerts/model_alert.go deleted file mode 100644 index 846c8145b92..00000000000 --- a/resource-manager/security/2019-01-01/alerts/model_alert.go +++ /dev/null @@ -1,11 +0,0 @@ -package alerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Alert struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AlertProperties `json:"properties,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2019-01-01/alerts/model_alertconfidencereason.go b/resource-manager/security/2019-01-01/alerts/model_alertconfidencereason.go deleted file mode 100644 index 8e2915f3b6f..00000000000 --- a/resource-manager/security/2019-01-01/alerts/model_alertconfidencereason.go +++ /dev/null @@ -1,9 +0,0 @@ -package alerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertConfidenceReason struct { - Reason *string `json:"reason,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2019-01-01/alerts/model_alertentity.go b/resource-manager/security/2019-01-01/alerts/model_alertentity.go deleted file mode 100644 index 907a141e62b..00000000000 --- a/resource-manager/security/2019-01-01/alerts/model_alertentity.go +++ /dev/null @@ -1,8 +0,0 @@ -package alerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertEntity struct { - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/security/2019-01-01/alerts/model_alertproperties.go b/resource-manager/security/2019-01-01/alerts/model_alertproperties.go deleted file mode 100644 index d58627d791c..00000000000 --- a/resource-manager/security/2019-01-01/alerts/model_alertproperties.go +++ /dev/null @@ -1,60 +0,0 @@ -package alerts - -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 AlertProperties struct { - ActionTaken *string `json:"actionTaken,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertName *string `json:"alertName,omitempty"` - AssociatedResource *string `json:"associatedResource,omitempty"` - CanBeInvestigated *bool `json:"canBeInvestigated,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceReasons *[]AlertConfidenceReason `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - CorrelationKey *string `json:"correlationKey,omitempty"` - Description *string `json:"description,omitempty"` - DetectedTimeUtc *string `json:"detectedTimeUtc,omitempty"` - Entities *[]AlertEntity `json:"entities,omitempty"` - ExtendedProperties *interface{} `json:"extendedProperties,omitempty"` - InstanceId *string `json:"instanceId,omitempty"` - IsIncident *bool `json:"isIncident,omitempty"` - RemediationSteps *string `json:"remediationSteps,omitempty"` - ReportedSeverity *ReportedSeverity `json:"reportedSeverity,omitempty"` - ReportedTimeUtc *string `json:"reportedTimeUtc,omitempty"` - State *string `json:"state,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` - SystemSource *string `json:"systemSource,omitempty"` - VendorName *string `json:"vendorName,omitempty"` - WorkspaceArmId *string `json:"workspaceArmId,omitempty"` -} - -func (o *AlertProperties) GetDetectedTimeUtcAsTime() (*time.Time, error) { - if o.DetectedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DetectedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AlertProperties) SetDetectedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DetectedTimeUtc = &formatted -} - -func (o *AlertProperties) GetReportedTimeUtcAsTime() (*time.Time, error) { - if o.ReportedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ReportedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AlertProperties) SetReportedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ReportedTimeUtc = &formatted -} diff --git a/resource-manager/security/2019-01-01/alerts/predicates.go b/resource-manager/security/2019-01-01/alerts/predicates.go deleted file mode 100644 index 8eae453a8b9..00000000000 --- a/resource-manager/security/2019-01-01/alerts/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package alerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p AlertOperationPredicate) Matches(input Alert) 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/security/2019-01-01/alerts/version.go b/resource-manager/security/2019-01-01/alerts/version.go deleted file mode 100644 index b5f7eca4fd1..00000000000 --- a/resource-manager/security/2019-01-01/alerts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alerts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2019-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alerts/%s", defaultApiVersion) -} diff --git a/resource-manager/security/2019-01-01/client.go b/resource-manager/security/2019-01-01/client.go deleted file mode 100644 index cb12fc931d0..00000000000 --- a/resource-manager/security/2019-01-01/client.go +++ /dev/null @@ -1,46 +0,0 @@ -package v2019_01_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/security/2019-01-01/advancedthreatprotection" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01/alerts" - "github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01/settings" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - AdvancedThreatProtection *advancedthreatprotection.AdvancedThreatProtectionClient - Alerts *alerts.AlertsClient - Settings *settings.SettingsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - advancedThreatProtectionClient, err := advancedthreatprotection.NewAdvancedThreatProtectionClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AdvancedThreatProtection client: %+v", err) - } - configureFunc(advancedThreatProtectionClient.Client) - - alertsClient, err := alerts.NewAlertsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Alerts client: %+v", err) - } - configureFunc(alertsClient.Client) - - settingsClient, err := settings.NewSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Settings client: %+v", err) - } - configureFunc(settingsClient.Client) - - return &Client{ - AdvancedThreatProtection: advancedThreatProtectionClient, - Alerts: alertsClient, - Settings: settingsClient, - }, nil -} diff --git a/resource-manager/security/2019-01-01/settings/README.md b/resource-manager/security/2019-01-01/settings/README.md deleted file mode 100644 index f9f35ba429f..00000000000 --- a/resource-manager/security/2019-01-01/settings/README.md +++ /dev/null @@ -1,75 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/security/2019-01-01/settings` Documentation - -The `settings` SDK allows for interaction with the Azure Resource Manager Service `security` (API Version `2019-01-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/security/2019-01-01/settings" -``` - - -### Client Initialization - -```go -client := settings.NewSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SettingsClient.Get` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS") - -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: `SettingsClient.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: `SettingsClient.Update` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS") - -payload := settings.Setting{ - // ... -} - - -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/security/2019-01-01/settings/client.go b/resource-manager/security/2019-01-01/settings/client.go deleted file mode 100644 index 7a9bd9ec8a1..00000000000 --- a/resource-manager/security/2019-01-01/settings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package settings - -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 SettingsClient struct { - Client *resourcemanager.Client -} - -func NewSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*SettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "settings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SettingsClient: %+v", err) - } - - return &SettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/security/2019-01-01/settings/constants.go b/resource-manager/security/2019-01-01/settings/constants.go deleted file mode 100644 index 044da4b7e3c..00000000000 --- a/resource-manager/security/2019-01-01/settings/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package settings - -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 SettingKind string - -const ( - SettingKindAlertSuppressionSetting SettingKind = "AlertSuppressionSetting" - SettingKindDataExportSettings SettingKind = "DataExportSettings" -) - -func PossibleValuesForSettingKind() []string { - return []string{ - string(SettingKindAlertSuppressionSetting), - string(SettingKindDataExportSettings), - } -} - -func (s *SettingKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingKind(input string) (*SettingKind, error) { - vals := map[string]SettingKind{ - "alertsuppressionsetting": SettingKindAlertSuppressionSetting, - "dataexportsettings": SettingKindDataExportSettings, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingKind(input) - return &out, nil -} - -type SettingName string - -const ( - SettingNameMCAS SettingName = "MCAS" - SettingNameWDATP SettingName = "WDATP" -) - -func PossibleValuesForSettingName() []string { - return []string{ - string(SettingNameMCAS), - string(SettingNameWDATP), - } -} - -func (s *SettingName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingName(input string) (*SettingName, error) { - vals := map[string]SettingName{ - "mcas": SettingNameMCAS, - "wdatp": SettingNameWDATP, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingName(input) - return &out, nil -} diff --git a/resource-manager/security/2019-01-01/settings/id_setting.go b/resource-manager/security/2019-01-01/settings/id_setting.go deleted file mode 100644 index bb7aff42014..00000000000 --- a/resource-manager/security/2019-01-01/settings/id_setting.go +++ /dev/null @@ -1,129 +0,0 @@ -package settings - -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(&SettingId{}) -} - -var _ resourceids.ResourceId = &SettingId{} - -// SettingId is a struct representing the Resource ID for a Setting -type SettingId struct { - SubscriptionId string - SettingName SettingName -} - -// NewSettingID returns a new SettingId struct -func NewSettingID(subscriptionId string, settingName SettingName) SettingId { - return SettingId{ - SubscriptionId: subscriptionId, - SettingName: settingName, - } -} - -// ParseSettingID parses 'input' into a SettingId -func ParseSettingID(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSettingIDInsensitively parses 'input' case-insensitively into a SettingId -// note: this method should only be used for API response data and not user input -func ParseSettingIDInsensitively(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SettingId) FromParseResult(input resourceids.ParseResult) error { - var ok bool - - if id.SubscriptionId, ok = input.Parsed["subscriptionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "subscriptionId", input) - } - - if v, ok := input.Parsed["settingName"]; true { - if !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "settingName", input) - } - - settingName, err := parseSettingName(v) - if err != nil { - return fmt.Errorf("parsing %q: %+v", v, err) - } - id.SettingName = *settingName - } - - return nil -} - -// ValidateSettingID checks that 'input' can be parsed as a Setting ID -func ValidateSettingID(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 := ParseSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Setting ID -func (id SettingId) ID() string { - fmtString := "/subscriptions/%s/providers/Microsoft.Security/settings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, string(id.SettingName)) -} - -// Segments returns a slice of Resource ID Segments which comprise this Setting ID -func (id SettingId) 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("staticMicrosoftSecurity", "Microsoft.Security", "Microsoft.Security"), - resourceids.StaticSegment("staticSettings", "settings", "settings"), - resourceids.ConstantSegment("settingName", PossibleValuesForSettingName(), "MCAS"), - } -} - -// String returns a human-readable description of this Setting ID -func (id SettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Setting Name: %q", string(id.SettingName)), - } - return fmt.Sprintf("Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/security/2019-01-01/settings/id_setting_test.go b/resource-manager/security/2019-01-01/settings/id_setting_test.go deleted file mode 100644 index 388b1c0092a..00000000000 --- a/resource-manager/security/2019-01-01/settings/id_setting_test.go +++ /dev/null @@ -1,237 +0,0 @@ -package settings - -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 = &SettingId{} - -func TestNewSettingID(t *testing.T) { - id := NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS") - - 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.SettingName != "MCAS" { - t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "MCAS") - } -} - -func TestFormatSettingID(t *testing.T) { - actual := NewSettingID("12345678-1234-9876-4563-123456789012", "MCAS").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SettingName: "MCAS", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingID(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.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestParseSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.Security", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEtTiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SettingName: "MCAS", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/providers/Microsoft.Security/settings/MCAS/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEtTiNgS/mCaS", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - SettingName: "MCAS", - }, - }, - { - // Invalid (Valid Uri with Extra segment - mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/pRoViDeRs/mIcRoSoFt.sEcUrItY/sEtTiNgS/mCaS/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingIDInsensitively(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.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestSegmentsForSettingId(t *testing.T) { - segments := SettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SettingId 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/security/2019-01-01/settings/method_get.go b/resource-manager/security/2019-01-01/settings/method_get.go deleted file mode 100644 index 0ff21eba040..00000000000 --- a/resource-manager/security/2019-01-01/settings/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 *Setting -} - -// Get ... -func (c SettingsClient) Get(ctx context.Context, id SettingId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/security/2019-01-01/settings/method_list.go b/resource-manager/security/2019-01-01/settings/method_list.go deleted file mode 100644 index a353ea41327..00000000000 --- a/resource-manager/security/2019-01-01/settings/method_list.go +++ /dev/null @@ -1,104 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 *[]Setting -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Setting -} - -// List ... -func (c SettingsClient) 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, - Path: fmt.Sprintf("%s/providers/Microsoft.Security/settings", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]Setting, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalSettingImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for Setting (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c SettingsClient) ListComplete(ctx context.Context, id commonids.SubscriptionId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SettingOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SettingsClient) ListCompleteMatchingPredicate(ctx context.Context, id commonids.SubscriptionId, predicate SettingOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Setting, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/security/2019-01-01/settings/method_update.go b/resource-manager/security/2019-01-01/settings/method_update.go deleted file mode 100644 index 283f4df6177..00000000000 --- a/resource-manager/security/2019-01-01/settings/method_update.go +++ /dev/null @@ -1,62 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Setting -} - -// Update ... -func (c SettingsClient) Update(ctx context.Context, id SettingId, input Setting) (result UpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/security/2019-01-01/settings/model_dataexportsettingproperties.go b/resource-manager/security/2019-01-01/settings/model_dataexportsettingproperties.go deleted file mode 100644 index 58764d1f0df..00000000000 --- a/resource-manager/security/2019-01-01/settings/model_dataexportsettingproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataExportSettingProperties struct { - Enabled bool `json:"enabled"` -} diff --git a/resource-manager/security/2019-01-01/settings/model_dataexportsettings.go b/resource-manager/security/2019-01-01/settings/model_dataexportsettings.go deleted file mode 100644 index fb1b53b7839..00000000000 --- a/resource-manager/security/2019-01-01/settings/model_dataexportsettings.go +++ /dev/null @@ -1,44 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Setting = DataExportSettings{} - -type DataExportSettings struct { - Properties *DataExportSettingProperties `json:"properties,omitempty"` - - // Fields inherited from Setting - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DataExportSettings{} - -func (s DataExportSettings) MarshalJSON() ([]byte, error) { - type wrapper DataExportSettings - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DataExportSettings: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DataExportSettings: %+v", err) - } - decoded["kind"] = "DataExportSettings" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DataExportSettings: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/security/2019-01-01/settings/model_setting.go b/resource-manager/security/2019-01-01/settings/model_setting.go deleted file mode 100644 index e4bd0bb8732..00000000000 --- a/resource-manager/security/2019-01-01/settings/model_setting.go +++ /dev/null @@ -1,53 +0,0 @@ -package settings - -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 Setting interface { -} - -// RawSettingImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSettingImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalSettingImplementation(input []byte) (Setting, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Setting into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "DataExportSettings") { - var out DataExportSettings - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DataExportSettings: %+v", err) - } - return out, nil - } - - out := RawSettingImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/security/2019-01-01/settings/predicates.go b/resource-manager/security/2019-01-01/settings/predicates.go deleted file mode 100644 index 47c095a507a..00000000000 --- a/resource-manager/security/2019-01-01/settings/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SettingOperationPredicate struct { -} - -func (p SettingOperationPredicate) Matches(input Setting) bool { - - return true -} diff --git a/resource-manager/security/2019-01-01/settings/version.go b/resource-manager/security/2019-01-01/settings/version.go deleted file mode 100644 index 91b5777742c..00000000000 --- a/resource-manager/security/2019-01-01/settings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package settings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2019-01-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/settings/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/README.md b/resource-manager/securityinsights/2021-09-01-preview/actions/README.md deleted file mode 100644 index c73683cfab3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/actions` Documentation - -The `actions` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/actions" -``` - - -### Client Initialization - -```go -client := actions.NewActionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ActionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -payload := actions.ActionRequest{ - // ... -} - - -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: `ActionsClient.Delete` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -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: `ActionsClient.Get` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -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: `ActionsClient.ListByAlertRule` - -```go -ctx := context.TODO() -id := actions.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -// alternatively `client.ListByAlertRule(ctx, id)` can be used to do batched pagination -items, err := client.ListByAlertRuleComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/client.go b/resource-manager/securityinsights/2021-09-01-preview/actions/client.go deleted file mode 100644 index a2b7d01bfe1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package actions - -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 ActionsClient struct { - Client *resourcemanager.Client -} - -func NewActionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ActionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "actions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ActionsClient: %+v", err) - } - - return &ActionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/id_action.go b/resource-manager/securityinsights/2021-09-01-preview/actions/id_action.go deleted file mode 100644 index aeefc14d3f8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/id_action.go +++ /dev/null @@ -1,150 +0,0 @@ -package actions - -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(&ActionId{}) -} - -var _ resourceids.ResourceId = &ActionId{} - -// ActionId is a struct representing the Resource ID for a Action -type ActionId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string - ActionId string -} - -// NewActionID returns a new ActionId struct -func NewActionID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string, actionId string) ActionId { - return ActionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - ActionId: actionId, - } -} - -// ParseActionID parses 'input' into a ActionId -func ParseActionID(input string) (*ActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ActionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseActionIDInsensitively parses 'input' case-insensitively into a ActionId -// note: this method should only be used for API response data and not user input -func ParseActionIDInsensitively(input string) (*ActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ActionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ActionId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - if id.ActionId, ok = input.Parsed["actionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "actionId", input) - } - - return nil -} - -// ValidateActionID checks that 'input' can be parsed as a Action ID -func ValidateActionID(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 := ParseActionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Action ID -func (id ActionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s/actions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId, id.ActionId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Action ID -func (id ActionId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - resourceids.StaticSegment("staticActions", "actions", "actions"), - resourceids.UserSpecifiedSegment("actionId", "actionIdValue"), - } -} - -// String returns a human-readable description of this Action ID -func (id ActionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - fmt.Sprintf("Action: %q", id.ActionId), - } - return fmt.Sprintf("Action (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/id_action_test.go b/resource-manager/securityinsights/2021-09-01-preview/actions/id_action_test.go deleted file mode 100644 index 5178cfc7cdb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/id_action_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package actions - -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 = &ActionId{} - -func TestNewActionID(t *testing.T) { - id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } - - if id.ActionId != "actionIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ActionId'", id.ActionId, "actionIdValue") - } -} - -func TestFormatActionID(t *testing.T) { - actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseActionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ActionId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - ActionId: "actionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseActionID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - if actual.ActionId != v.Expected.ActionId { - t.Fatalf("Expected %q but got %q for ActionId", v.Expected.ActionId, actual.ActionId) - } - - } -} - -func TestParseActionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ActionId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - ActionId: "actionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs/aCtIoNiDvAlUe", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - ActionId: "aCtIoNiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs/aCtIoNiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseActionIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - if actual.ActionId != v.Expected.ActionId { - t.Fatalf("Expected %q but got %q for ActionId", v.Expected.ActionId, actual.ActionId) - } - - } -} - -func TestSegmentsForActionId(t *testing.T) { - segments := ActionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ActionId 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/securityinsights/2021-09-01-preview/actions/id_alertrule.go b/resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule.go deleted file mode 100644 index 731f6439ae3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package actions - -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(&AlertRuleId{}) -} - -var _ resourceids.ResourceId = &AlertRuleId{} - -// AlertRuleId is a struct representing the Resource ID for a Alert Rule -type AlertRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string -} - -// NewAlertRuleID returns a new AlertRuleId struct -func NewAlertRuleID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string) AlertRuleId { - return AlertRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - } -} - -// ParseAlertRuleID parses 'input' into a AlertRuleId -func ParseAlertRuleID(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleIDInsensitively parses 'input' case-insensitively into a AlertRuleId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - return nil -} - -// ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID -func ValidateAlertRuleID(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 := ParseAlertRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule ID -func (id AlertRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule ID -func (id AlertRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule ID -func (id AlertRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - } - return fmt.Sprintf("Alert Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule_test.go b/resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule_test.go deleted file mode 100644 index 890c1efe56a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/id_alertrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package actions - -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 = &AlertRuleId{} - -func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } -} - -func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestParseAlertRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestSegmentsForAlertRuleId(t *testing.T) { - segments := AlertRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleId 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/securityinsights/2021-09-01-preview/actions/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/actions/method_createorupdate.go deleted file mode 100644 index e84c5bebbd7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package actions - -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 *ActionResponse -} - -// CreateOrUpdate ... -func (c ActionsClient) CreateOrUpdate(ctx context.Context, id ActionId, input ActionRequest) (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 ActionResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/actions/method_delete.go deleted file mode 100644 index 0f8a28307c2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package actions - -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 ActionsClient) Delete(ctx context.Context, id ActionId) (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/securityinsights/2021-09-01-preview/actions/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/actions/method_get.go deleted file mode 100644 index 9d5aad5dc58..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package actions - -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 *ActionResponse -} - -// Get ... -func (c ActionsClient) Get(ctx context.Context, id ActionId) (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 ActionResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/method_listbyalertrule.go b/resource-manager/securityinsights/2021-09-01-preview/actions/method_listbyalertrule.go deleted file mode 100644 index 09d32b9d82d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/method_listbyalertrule.go +++ /dev/null @@ -1,91 +0,0 @@ -package actions - -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 ListByAlertRuleOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ActionResponse -} - -type ListByAlertRuleCompleteResult struct { - LatestHttpResponse *http.Response - Items []ActionResponse -} - -// ListByAlertRule ... -func (c ActionsClient) ListByAlertRule(ctx context.Context, id AlertRuleId) (result ListByAlertRuleOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/actions", 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 *[]ActionResponse `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByAlertRuleComplete retrieves all the results into a single object -func (c ActionsClient) ListByAlertRuleComplete(ctx context.Context, id AlertRuleId) (ListByAlertRuleCompleteResult, error) { - return c.ListByAlertRuleCompleteMatchingPredicate(ctx, id, ActionResponseOperationPredicate{}) -} - -// ListByAlertRuleCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ActionsClient) ListByAlertRuleCompleteMatchingPredicate(ctx context.Context, id AlertRuleId, predicate ActionResponseOperationPredicate) (result ListByAlertRuleCompleteResult, err error) { - items := make([]ActionResponse, 0) - - resp, err := c.ListByAlertRule(ctx, id) - if err != nil { - 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 = ListByAlertRuleCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequest.go b/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequest.go deleted file mode 100644 index d2392a75a2d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequest.go +++ /dev/null @@ -1,17 +0,0 @@ -package actions - -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 ActionRequest struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ActionRequestProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequestproperties.go b/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequestproperties.go deleted file mode 100644 index 209f602de8a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionrequestproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionRequestProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - TriggerUri string `json:"triggerUri"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponse.go b/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponse.go deleted file mode 100644 index c357a58ab2a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponse.go +++ /dev/null @@ -1,17 +0,0 @@ -package actions - -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 ActionResponse struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ActionResponseProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponseproperties.go b/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponseproperties.go deleted file mode 100644 index ef4e54d6817..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/model_actionresponseproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionResponseProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - WorkflowId *string `json:"workflowId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/actions/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/actions/predicates.go deleted file mode 100644 index 317d6feb3d6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionResponseOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ActionResponseOperationPredicate) Matches(input ActionResponse) 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.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/securityinsights/2021-09-01-preview/actions/version.go b/resource-manager/securityinsights/2021-09-01-preview/actions/version.go deleted file mode 100644 index ab6d228663a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/actions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package actions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/actions/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/README.md b/resource-manager/securityinsights/2021-09-01-preview/alertrules/README.md deleted file mode 100644 index 2415df7ac59..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertrules` Documentation - -The `alertrules` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/alertrules" -``` - - -### Client Initialization - -```go -client := alertrules.NewAlertRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -payload := alertrules.AlertRule{ - // ... -} - - -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: `AlertRulesClient.Delete` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -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: `AlertRulesClient.Get` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -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: `AlertRulesClient.List` - -```go -ctx := context.TODO() -id := alertrules.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/alertrules/client.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/client.go deleted file mode 100644 index e6ca04af9da..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alertrules - -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 AlertRulesClient struct { - Client *resourcemanager.Client -} - -func NewAlertRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alertrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertRulesClient: %+v", err) - } - - return &AlertRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/constants.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/constants.go deleted file mode 100644 index ca0025a13d0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/constants.go +++ /dev/null @@ -1,502 +0,0 @@ -package alertrules - -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 AlertDetail string - -const ( - AlertDetailDisplayName AlertDetail = "DisplayName" - AlertDetailSeverity AlertDetail = "Severity" -) - -func PossibleValuesForAlertDetail() []string { - return []string{ - string(AlertDetailDisplayName), - string(AlertDetailSeverity), - } -} - -func (s *AlertDetail) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertDetail(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertDetail(input string) (*AlertDetail, error) { - vals := map[string]AlertDetail{ - "displayname": AlertDetailDisplayName, - "severity": AlertDetailSeverity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertDetail(input) - return &out, nil -} - -type AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindNRT AlertRuleKind = "NRT" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" - AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMLBehaviorAnalytics), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindNRT), - string(AlertRuleKindScheduled), - string(AlertRuleKindThreatIntelligence), - } -} - -func (s *AlertRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "mlbehavioranalytics": AlertRuleKindMLBehaviorAnalytics, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "nrt": AlertRuleKindNRT, - "scheduled": AlertRuleKindScheduled, - "threatintelligence": AlertRuleKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func (s *EntityMappingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityMappingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func (s *EventGroupingAggregationKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEventGroupingAggregationKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MatchingMethod string - -const ( - MatchingMethodAllEntities MatchingMethod = "AllEntities" - MatchingMethodAnyAlert MatchingMethod = "AnyAlert" - MatchingMethodSelected MatchingMethod = "Selected" -) - -func PossibleValuesForMatchingMethod() []string { - return []string{ - string(MatchingMethodAllEntities), - string(MatchingMethodAnyAlert), - string(MatchingMethodSelected), - } -} - -func (s *MatchingMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMatchingMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMatchingMethod(input string) (*MatchingMethod, error) { - vals := map[string]MatchingMethod{ - "allentities": MatchingMethodAllEntities, - "anyalert": MatchingMethodAnyAlert, - "selected": MatchingMethodSelected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MatchingMethod(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" - MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" - MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - string(MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection), - string(MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection), - } -} - -func (s *MicrosoftSecurityProductName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMicrosoftSecurityProductName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - "microsoft defender advanced threat protection": MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, - "office 365 advanced threat protection": MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func (s *TriggerOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule.go deleted file mode 100644 index 818f124e5ef..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package alertrules - -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(&AlertRuleId{}) -} - -var _ resourceids.ResourceId = &AlertRuleId{} - -// AlertRuleId is a struct representing the Resource ID for a Alert Rule -type AlertRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string -} - -// NewAlertRuleID returns a new AlertRuleId struct -func NewAlertRuleID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string) AlertRuleId { - return AlertRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - } -} - -// ParseAlertRuleID parses 'input' into a AlertRuleId -func ParseAlertRuleID(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleIDInsensitively parses 'input' case-insensitively into a AlertRuleId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - return nil -} - -// ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID -func ValidateAlertRuleID(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 := ParseAlertRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule ID -func (id AlertRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule ID -func (id AlertRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule ID -func (id AlertRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - } - return fmt.Sprintf("Alert Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule_test.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule_test.go deleted file mode 100644 index c3c781da17b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_alertrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package alertrules - -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 = &AlertRuleId{} - -func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } -} - -func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestParseAlertRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestSegmentsForAlertRuleId(t *testing.T) { - segments := AlertRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleId 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/securityinsights/2021-09-01-preview/alertrules/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace.go deleted file mode 100644 index 005b7fc90a7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package alertrules - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace_test.go deleted file mode 100644 index 3846c76d11d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alertrules - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/alertrules/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_createorupdate.go deleted file mode 100644 index f77c7558d09..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *AlertRule -} - -// CreateOrUpdate ... -func (c AlertRulesClient) CreateOrUpdate(ctx context.Context, id AlertRuleId, input AlertRule) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_delete.go deleted file mode 100644 index aae7085c25e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertrules - -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 AlertRulesClient) Delete(ctx context.Context, id AlertRuleId) (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/securityinsights/2021-09-01-preview/alertrules/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_get.go deleted file mode 100644 index 945c07bfad1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *AlertRule -} - -// Get ... -func (c AlertRulesClient) Get(ctx context.Context, id AlertRuleId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_list.go deleted file mode 100644 index 5ac99496167..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *[]AlertRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AlertRule -} - -// List ... -func (c AlertRulesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRules", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]AlertRule, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalAlertRuleImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRule (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AlertRulesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AlertRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AlertRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/alertrules/model_alertdetailsoverride.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertdetailsoverride.go deleted file mode 100644 index 12e98f5419a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertrule.go deleted file mode 100644 index 7bb4d493656..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_alertrule.go +++ /dev/null @@ -1,93 +0,0 @@ -package alertrules - -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 AlertRule interface { -} - -// RawAlertRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAlertRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAlertRuleImplementation(input []byte) (AlertRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MLBehaviorAnalytics") { - var out MLBehaviorAnalyticsAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MLBehaviorAnalyticsAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NRT") { - var out NrtAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NrtAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out ThreatIntelligenceAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceAlertRule: %+v", err) - } - return out, nil - } - - out := RawAlertRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_entitymapping.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_entitymapping.go deleted file mode 100644 index b1fc81c3323..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_eventgroupingsettings.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_eventgroupingsettings.go deleted file mode 100644 index ae513b5b198..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fieldmapping.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fieldmapping.go deleted file mode 100644 index 9e73ac23218..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertrule.go deleted file mode 100644 index c4ed17f4319..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = FusionAlertRule{} - -type FusionAlertRule struct { - Properties *FusionAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRule{} - -func (s FusionAlertRule) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRule: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertruleproperties.go deleted file mode 100644 index 79164088b99..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_fusionalertruleproperties.go +++ /dev/null @@ -1,32 +0,0 @@ -package alertrules - -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 FusionAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *FusionAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_groupingconfiguration.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_groupingconfiguration.go deleted file mode 100644 index cb8d21f3d60..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_groupingconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupingConfiguration struct { - Enabled bool `json:"enabled"` - GroupByAlertDetails *[]AlertDetail `json:"groupByAlertDetails,omitempty"` - GroupByCustomDetails *[]string `json:"groupByCustomDetails,omitempty"` - GroupByEntities *[]EntityMappingType `json:"groupByEntities,omitempty"` - LookbackDuration string `json:"lookbackDuration"` - MatchingMethod MatchingMethod `json:"matchingMethod"` - ReopenClosedIncident bool `json:"reopenClosedIncident"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_incidentconfiguration.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_incidentconfiguration.go deleted file mode 100644 index 53ab8b667b1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_incidentconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentConfiguration struct { - CreateIncident bool `json:"createIncident"` - GroupingConfiguration *GroupingConfiguration `json:"groupingConfiguration,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go deleted file mode 100644 index 4fa227e3728..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = MicrosoftSecurityIncidentCreationAlertRule{} - -type MicrosoftSecurityIncidentCreationAlertRule struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRule{} - -func (s MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go deleted file mode 100644 index 428ca90f774..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go +++ /dev/null @@ -1,34 +0,0 @@ -package alertrules - -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 MicrosoftSecurityIncidentCreationAlertRuleProperties struct { - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - ProductFilter MicrosoftSecurityProductName `json:"productFilter"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go deleted file mode 100644 index e49aa4ea1f0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = MLBehaviorAnalyticsAlertRule{} - -type MLBehaviorAnalyticsAlertRule struct { - Properties *MLBehaviorAnalyticsAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MLBehaviorAnalyticsAlertRule{} - -func (s MLBehaviorAnalyticsAlertRule) MarshalJSON() ([]byte, error) { - type wrapper MLBehaviorAnalyticsAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MLBehaviorAnalyticsAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MLBehaviorAnalyticsAlertRule: %+v", err) - } - decoded["kind"] = "MLBehaviorAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MLBehaviorAnalyticsAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go deleted file mode 100644 index 2344fcdb9fd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go +++ /dev/null @@ -1,32 +0,0 @@ -package alertrules - -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 MLBehaviorAnalyticsAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *MLBehaviorAnalyticsAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *MLBehaviorAnalyticsAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_nrtalertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_nrtalertrule.go deleted file mode 100644 index bf35e3067cb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_nrtalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = NrtAlertRule{} - -type NrtAlertRule struct { - Properties *QueryBasedAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = NrtAlertRule{} - -func (s NrtAlertRule) MarshalJSON() ([]byte, error) { - type wrapper NrtAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NrtAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NrtAlertRule: %+v", err) - } - decoded["kind"] = "NRT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NrtAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_querybasedalertruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_querybasedalertruleproperties.go deleted file mode 100644 index ff8713e7ebd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_querybasedalertruleproperties.go +++ /dev/null @@ -1,40 +0,0 @@ -package alertrules - -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 QueryBasedAlertRuleProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Query *string `json:"query,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - SuppressionDuration string `json:"suppressionDuration"` - SuppressionEnabled bool `json:"suppressionEnabled"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TemplateVersion *string `json:"templateVersion,omitempty"` -} - -func (o *QueryBasedAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *QueryBasedAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertrule.go deleted file mode 100644 index cf91bcec4f2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = ScheduledAlertRule{} - -type ScheduledAlertRule struct { - Properties *ScheduledAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRule{} - -func (s ScheduledAlertRule) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRule: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertruleproperties.go deleted file mode 100644 index 6702957900b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_scheduledalertruleproperties.go +++ /dev/null @@ -1,45 +0,0 @@ -package alertrules - -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 ScheduledAlertRuleProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Query *string `json:"query,omitempty"` - QueryFrequency *string `json:"queryFrequency,omitempty"` - QueryPeriod *string `json:"queryPeriod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - SuppressionDuration string `json:"suppressionDuration"` - SuppressionEnabled bool `json:"suppressionEnabled"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TemplateVersion *string `json:"templateVersion,omitempty"` - TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` - TriggerThreshold *int64 `json:"triggerThreshold,omitempty"` -} - -func (o *ScheduledAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertrule.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertrule.go deleted file mode 100644 index fe9fc75c2e6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = ThreatIntelligenceAlertRule{} - -type ThreatIntelligenceAlertRule struct { - Properties *ThreatIntelligenceAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceAlertRule{} - -func (s ThreatIntelligenceAlertRule) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceAlertRule: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertruleproperties.go deleted file mode 100644 index 47415b6fc20..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/model_threatintelligencealertruleproperties.go +++ /dev/null @@ -1,32 +0,0 @@ -package alertrules - -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 ThreatIntelligenceAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *ThreatIntelligenceAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ThreatIntelligenceAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/predicates.go deleted file mode 100644 index 20dada02523..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleOperationPredicate struct { -} - -func (p AlertRuleOperationPredicate) Matches(input AlertRule) bool { - - return true -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertrules/version.go b/resource-manager/securityinsights/2021-09-01-preview/alertrules/version.go deleted file mode 100644 index e4f435b1939..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertrules/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md deleted file mode 100644 index 6c510f5abc8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates` Documentation - -The `alertruletemplates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/alertruletemplates" -``` - - -### Client Initialization - -```go -client := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRuleTemplatesClient.Get` - -```go -ctx := context.TODO() -id := alertruletemplates.NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - -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: `AlertRuleTemplatesClient.List` - -```go -ctx := context.TODO() -id := alertruletemplates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/alertruletemplates/client.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go deleted file mode 100644 index 2932bf14a55..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alertruletemplates - -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 AlertRuleTemplatesClient struct { - Client *resourcemanager.Client -} - -func NewAlertRuleTemplatesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRuleTemplatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alertruletemplates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertRuleTemplatesClient: %+v", err) - } - - return &AlertRuleTemplatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go deleted file mode 100644 index b0dee2366eb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/constants.go +++ /dev/null @@ -1,461 +0,0 @@ -package alertruletemplates - -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 AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindNRT AlertRuleKind = "NRT" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" - AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMLBehaviorAnalytics), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindNRT), - string(AlertRuleKindScheduled), - string(AlertRuleKindThreatIntelligence), - } -} - -func (s *AlertRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "mlbehavioranalytics": AlertRuleKindMLBehaviorAnalytics, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "nrt": AlertRuleKindNRT, - "scheduled": AlertRuleKindScheduled, - "threatintelligence": AlertRuleKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func (s *EntityMappingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityMappingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func (s *EventGroupingAggregationKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEventGroupingAggregationKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" - MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" - MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - string(MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection), - string(MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection), - } -} - -func (s *MicrosoftSecurityProductName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMicrosoftSecurityProductName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - "microsoft defender advanced threat protection": MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, - "office 365 advanced threat protection": MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TemplateStatus string - -const ( - TemplateStatusAvailable TemplateStatus = "Available" - TemplateStatusInstalled TemplateStatus = "Installed" - TemplateStatusNotAvailable TemplateStatus = "NotAvailable" -) - -func PossibleValuesForTemplateStatus() []string { - return []string{ - string(TemplateStatusAvailable), - string(TemplateStatusInstalled), - string(TemplateStatusNotAvailable), - } -} - -func (s *TemplateStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTemplateStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTemplateStatus(input string) (*TemplateStatus, error) { - vals := map[string]TemplateStatus{ - "available": TemplateStatusAvailable, - "installed": TemplateStatusInstalled, - "notavailable": TemplateStatusNotAvailable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TemplateStatus(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func (s *TriggerOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go deleted file mode 100644 index 6a82de7688f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate.go +++ /dev/null @@ -1,141 +0,0 @@ -package alertruletemplates - -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(&AlertRuleTemplateId{}) -} - -var _ resourceids.ResourceId = &AlertRuleTemplateId{} - -// AlertRuleTemplateId is a struct representing the Resource ID for a Alert Rule Template -type AlertRuleTemplateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AlertRuleTemplateId string -} - -// NewAlertRuleTemplateID returns a new AlertRuleTemplateId struct -func NewAlertRuleTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, alertRuleTemplateId string) AlertRuleTemplateId { - return AlertRuleTemplateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AlertRuleTemplateId: alertRuleTemplateId, - } -} - -// ParseAlertRuleTemplateID parses 'input' into a AlertRuleTemplateId -func ParseAlertRuleTemplateID(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleTemplateIDInsensitively parses 'input' case-insensitively into a AlertRuleTemplateId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleTemplateIDInsensitively(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleTemplateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AlertRuleTemplateId, ok = input.Parsed["alertRuleTemplateId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", input) - } - - return nil -} - -// ValidateAlertRuleTemplateID checks that 'input' can be parsed as a Alert Rule Template ID -func ValidateAlertRuleTemplateID(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 := ParseAlertRuleTemplateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule Template ID -func (id AlertRuleTemplateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRuleTemplates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AlertRuleTemplateId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule Template ID -func (id AlertRuleTemplateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRuleTemplates", "alertRuleTemplates", "alertRuleTemplates"), - resourceids.UserSpecifiedSegment("alertRuleTemplateId", "alertRuleTemplateIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule Template ID -func (id AlertRuleTemplateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Alert Rule Template: %q", id.AlertRuleTemplateId), - } - return fmt.Sprintf("Alert Rule Template (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate_test.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate_test.go deleted file mode 100644 index ebc3eb67204..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_alertruletemplate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package alertruletemplates - -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 = &AlertRuleTemplateId{} - -func TestNewAlertRuleTemplateID(t *testing.T) { - id := NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AlertRuleTemplateId != "alertRuleTemplateIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleTemplateId'", id.AlertRuleTemplateId, "alertRuleTemplateIdValue") - } -} - -func TestFormatAlertRuleTemplateID(t *testing.T) { - actual := NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleTemplateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AlertRuleTemplateId: "alertRuleTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleTemplateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AlertRuleTemplateId != v.Expected.AlertRuleTemplateId { - t.Fatalf("Expected %q but got %q for AlertRuleTemplateId", v.Expected.AlertRuleTemplateId, actual.AlertRuleTemplateId) - } - - } -} - -func TestParseAlertRuleTemplateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AlertRuleTemplateId: "alertRuleTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS/aLeRtRuLeTeMpLaTeIdVaLuE", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AlertRuleTemplateId: "aLeRtRuLeTeMpLaTeIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS/aLeRtRuLeTeMpLaTeIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleTemplateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AlertRuleTemplateId != v.Expected.AlertRuleTemplateId { - t.Fatalf("Expected %q but got %q for AlertRuleTemplateId", v.Expected.AlertRuleTemplateId, actual.AlertRuleTemplateId) - } - - } -} - -func TestSegmentsForAlertRuleTemplateId(t *testing.T) { - segments := AlertRuleTemplateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleTemplateId 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/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go deleted file mode 100644 index 184371fb5dc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package alertruletemplates - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace_test.go deleted file mode 100644 index 77410c05cea..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alertruletemplates - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/alertruletemplates/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_get.go deleted file mode 100644 index 861712be66a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "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 *AlertRuleTemplate -} - -// Get ... -func (c AlertRuleTemplatesClient) Get(ctx context.Context, id AlertRuleTemplateId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleTemplateImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_list.go deleted file mode 100644 index 21f9ceec3de..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "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 *[]AlertRuleTemplate -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AlertRuleTemplate -} - -// List ... -func (c AlertRuleTemplatesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRuleTemplates", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]AlertRuleTemplate, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalAlertRuleTemplateImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRuleTemplate (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AlertRuleTemplatesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AlertRuleTemplateOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertRuleTemplatesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleTemplateOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AlertRuleTemplate, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go deleted file mode 100644 index 136748927ba..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go deleted file mode 100644 index 262a4d668bc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplate.go +++ /dev/null @@ -1,93 +0,0 @@ -package alertruletemplates - -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 AlertRuleTemplate interface { -} - -// RawAlertRuleTemplateImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAlertRuleTemplateImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAlertRuleTemplateImplementation(input []byte) (AlertRuleTemplate, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRuleTemplate into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MLBehaviorAnalytics") { - var out MLBehaviorAnalyticsAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NRT") { - var out NrtAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NrtAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out ThreatIntelligenceAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - return out, nil - } - - out := RawAlertRuleTemplateImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go deleted file mode 100644 index 519fd6e1fe4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_alertruletemplatedatasource.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateDataSource struct { - ConnectorId *string `json:"connectorId,omitempty"` - DataTypes *[]string `json:"dataTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go deleted file mode 100644 index 86cf5667f04..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go deleted file mode 100644 index 3d80ecdb592..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go deleted file mode 100644 index be96362b135..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go deleted file mode 100644 index c2b4d8c3077..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = FusionAlertRuleTemplate{} - -type FusionAlertRuleTemplate struct { - Properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRuleTemplate{} - -func (s FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go deleted file mode 100644 index f55a7b59b28..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertruletemplates - -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 FusionAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *FusionAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *FusionAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go deleted file mode 100644 index 515a47767b2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -func (s MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go deleted file mode 100644 index 0a2b5025a2e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go +++ /dev/null @@ -1,45 +0,0 @@ -package alertruletemplates - -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 MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC string `json:"createdDateUTC"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - ProductFilter MicrosoftSecurityProductName `json:"productFilter"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` - Status TemplateStatus `json:"status"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = formatted -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go deleted file mode 100644 index 51e12f5562f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = MLBehaviorAnalyticsAlertRuleTemplate{} - -type MLBehaviorAnalyticsAlertRuleTemplate struct { - Properties *MLBehaviorAnalyticsAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MLBehaviorAnalyticsAlertRuleTemplate{} - -func (s MLBehaviorAnalyticsAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MLBehaviorAnalyticsAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MLBehaviorAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go deleted file mode 100644 index 1ece40f5e84..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertruletemplates - -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 MLBehaviorAnalyticsAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MLBehaviorAnalyticsAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go deleted file mode 100644 index 9f13bfa8160..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = NrtAlertRuleTemplate{} - -type NrtAlertRuleTemplate struct { - Properties *NrtAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = NrtAlertRuleTemplate{} - -func (s NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper NrtAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NrtAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NrtAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "NRT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NrtAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go deleted file mode 100644 index b0dcc457bf0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go +++ /dev/null @@ -1,51 +0,0 @@ -package alertruletemplates - -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 NrtAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - Query string `json:"query"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Version string `json:"version"` -} - -func (o *NrtAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *NrtAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *NrtAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *NrtAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go deleted file mode 100644 index c3428ada14d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = ScheduledAlertRuleTemplate{} - -type ScheduledAlertRuleTemplate struct { - Properties *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRuleTemplate{} - -func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go deleted file mode 100644 index ea962585026..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go +++ /dev/null @@ -1,56 +0,0 @@ -package alertruletemplates - -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 ScheduledAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - Query string `json:"query"` - QueryFrequency string `json:"queryFrequency"` - QueryPeriod string `json:"queryPeriod"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TriggerOperator TriggerOperator `json:"triggerOperator"` - TriggerThreshold int64 `json:"triggerThreshold"` - Version string `json:"version"` -} - -func (o *ScheduledAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *ScheduledAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go deleted file mode 100644 index 1f39f219a07..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = ThreatIntelligenceAlertRuleTemplate{} - -type ThreatIntelligenceAlertRuleTemplate struct { - Properties *ThreatIntelligenceAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceAlertRuleTemplate{} - -func (s ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go deleted file mode 100644 index ca0f00247e9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertruletemplates - -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 ThreatIntelligenceAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount int64 `json:"alertRulesCreatedByTemplateCount"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description string `json:"description"` - DisplayName string `json:"displayName"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity AlertSeverity `json:"severity"` - Status TemplateStatus `json:"status"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ThreatIntelligenceAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go deleted file mode 100644 index 093c50e1616..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateOperationPredicate struct { -} - -func (p AlertRuleTemplateOperationPredicate) Matches(input AlertRuleTemplate) bool { - - return true -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go b/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go deleted file mode 100644 index 0bf4ef8ed58..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertruletemplates/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrule/client.go b/resource-manager/securityinsights/2021-09-01-preview/automationrule/client.go deleted file mode 100644 index 76a0832c1f2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrule/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package automationrule - -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 AutomationRuleClient struct { - Client *resourcemanager.Client -} - -func NewAutomationRuleClientWithBaseURI(sdkApi sdkEnv.Api) (*AutomationRuleClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "automationrule", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AutomationRuleClient: %+v", err) - } - - return &AutomationRuleClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule.go b/resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule.go deleted file mode 100644 index 8c5f6d7407e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package automationrule - -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(&AutomationRuleId{}) -} - -var _ resourceids.ResourceId = &AutomationRuleId{} - -// AutomationRuleId is a struct representing the Resource ID for a Automation Rule -type AutomationRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AutomationRuleId string -} - -// NewAutomationRuleID returns a new AutomationRuleId struct -func NewAutomationRuleID(subscriptionId string, resourceGroupName string, workspaceName string, automationRuleId string) AutomationRuleId { - return AutomationRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AutomationRuleId: automationRuleId, - } -} - -// ParseAutomationRuleID parses 'input' into a AutomationRuleId -func ParseAutomationRuleID(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAutomationRuleIDInsensitively parses 'input' case-insensitively into a AutomationRuleId -// note: this method should only be used for API response data and not user input -func ParseAutomationRuleIDInsensitively(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AutomationRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AutomationRuleId, ok = input.Parsed["automationRuleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "automationRuleId", input) - } - - return nil -} - -// ValidateAutomationRuleID checks that 'input' can be parsed as a Automation Rule ID -func ValidateAutomationRuleID(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 := ParseAutomationRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Automation Rule ID -func (id AutomationRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/automationRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AutomationRuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Automation Rule ID -func (id AutomationRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAutomationRules", "automationRules", "automationRules"), - resourceids.UserSpecifiedSegment("automationRuleId", "automationRuleIdValue"), - } -} - -// String returns a human-readable description of this Automation Rule ID -func (id AutomationRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Automation Rule: %q", id.AutomationRuleId), - } - return fmt.Sprintf("Automation Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule_test.go b/resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule_test.go deleted file mode 100644 index 5f227e7b993..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrule/id_automationrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package automationrule - -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 = &AutomationRuleId{} - -func TestNewAutomationRuleID(t *testing.T) { - id := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AutomationRuleId != "automationRuleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AutomationRuleId'", id.AutomationRuleId, "automationRuleIdValue") - } -} - -func TestFormatAutomationRuleID(t *testing.T) { - actual := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAutomationRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestParseAutomationRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AutomationRuleId: "aUtOmAtIoNrUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestSegmentsForAutomationRuleId(t *testing.T) { - segments := AutomationRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AutomationRuleId 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/securityinsights/2021-09-01-preview/automationrule/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/automationrule/method_delete.go deleted file mode 100644 index 61f722711f9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrule/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package automationrule - -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 AutomationRuleClient) Delete(ctx context.Context, id AutomationRuleId) (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/securityinsights/2021-09-01-preview/automationrule/version.go b/resource-manager/securityinsights/2021-09-01-preview/automationrule/version.go deleted file mode 100644 index 579ab494fc0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrule/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrule - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/automationrule/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/README.md b/resource-manager/securityinsights/2021-09-01-preview/automationrules/README.md deleted file mode 100644 index 7d105fa0e4e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/README.md +++ /dev/null @@ -1,74 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/automationrules` Documentation - -The `automationrules` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/automationrules" -``` - - -### Client Initialization - -```go -client := automationrules.NewAutomationRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AutomationRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -payload := automationrules.AutomationRule{ - // ... -} - - -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: `AutomationRulesClient.Get` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -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: `AutomationRulesClient.List` - -```go -ctx := context.TODO() -id := automationrules.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/automationrules/client.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/client.go deleted file mode 100644 index 18fafea1496..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package automationrules - -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 AutomationRulesClient struct { - Client *resourcemanager.Client -} - -func NewAutomationRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AutomationRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "automationrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AutomationRulesClient: %+v", err) - } - - return &AutomationRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/constants.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/constants.go deleted file mode 100644 index 08cda9f4df7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/constants.go +++ /dev/null @@ -1,685 +0,0 @@ -package automationrules - -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 AutomationRuleActionType string - -const ( - AutomationRuleActionTypeModifyProperties AutomationRuleActionType = "ModifyProperties" - AutomationRuleActionTypeRunPlaybook AutomationRuleActionType = "RunPlaybook" -) - -func PossibleValuesForAutomationRuleActionType() []string { - return []string{ - string(AutomationRuleActionTypeModifyProperties), - string(AutomationRuleActionTypeRunPlaybook), - } -} - -func (s *AutomationRuleActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRuleActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRuleActionType(input string) (*AutomationRuleActionType, error) { - vals := map[string]AutomationRuleActionType{ - "modifyproperties": AutomationRuleActionTypeModifyProperties, - "runplaybook": AutomationRuleActionTypeRunPlaybook, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRuleActionType(input) - return &out, nil -} - -type AutomationRuleConditionType string - -const ( - AutomationRuleConditionTypeProperty AutomationRuleConditionType = "Property" -) - -func PossibleValuesForAutomationRuleConditionType() []string { - return []string{ - string(AutomationRuleConditionTypeProperty), - } -} - -func (s *AutomationRuleConditionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRuleConditionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRuleConditionType(input string) (*AutomationRuleConditionType, error) { - vals := map[string]AutomationRuleConditionType{ - "property": AutomationRuleConditionTypeProperty, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRuleConditionType(input) - return &out, nil -} - -type AutomationRulePropertyConditionSupportedOperator string - -const ( - AutomationRulePropertyConditionSupportedOperatorContains AutomationRulePropertyConditionSupportedOperator = "Contains" - AutomationRulePropertyConditionSupportedOperatorEndsWith AutomationRulePropertyConditionSupportedOperator = "EndsWith" - AutomationRulePropertyConditionSupportedOperatorEquals AutomationRulePropertyConditionSupportedOperator = "Equals" - AutomationRulePropertyConditionSupportedOperatorNotContains AutomationRulePropertyConditionSupportedOperator = "NotContains" - AutomationRulePropertyConditionSupportedOperatorNotEndsWith AutomationRulePropertyConditionSupportedOperator = "NotEndsWith" - AutomationRulePropertyConditionSupportedOperatorNotEquals AutomationRulePropertyConditionSupportedOperator = "NotEquals" - AutomationRulePropertyConditionSupportedOperatorNotStartsWith AutomationRulePropertyConditionSupportedOperator = "NotStartsWith" - AutomationRulePropertyConditionSupportedOperatorStartsWith AutomationRulePropertyConditionSupportedOperator = "StartsWith" -) - -func PossibleValuesForAutomationRulePropertyConditionSupportedOperator() []string { - return []string{ - string(AutomationRulePropertyConditionSupportedOperatorContains), - string(AutomationRulePropertyConditionSupportedOperatorEndsWith), - string(AutomationRulePropertyConditionSupportedOperatorEquals), - string(AutomationRulePropertyConditionSupportedOperatorNotContains), - string(AutomationRulePropertyConditionSupportedOperatorNotEndsWith), - string(AutomationRulePropertyConditionSupportedOperatorNotEquals), - string(AutomationRulePropertyConditionSupportedOperatorNotStartsWith), - string(AutomationRulePropertyConditionSupportedOperatorStartsWith), - } -} - -func (s *AutomationRulePropertyConditionSupportedOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyConditionSupportedOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyConditionSupportedOperator(input string) (*AutomationRulePropertyConditionSupportedOperator, error) { - vals := map[string]AutomationRulePropertyConditionSupportedOperator{ - "contains": AutomationRulePropertyConditionSupportedOperatorContains, - "endswith": AutomationRulePropertyConditionSupportedOperatorEndsWith, - "equals": AutomationRulePropertyConditionSupportedOperatorEquals, - "notcontains": AutomationRulePropertyConditionSupportedOperatorNotContains, - "notendswith": AutomationRulePropertyConditionSupportedOperatorNotEndsWith, - "notequals": AutomationRulePropertyConditionSupportedOperatorNotEquals, - "notstartswith": AutomationRulePropertyConditionSupportedOperatorNotStartsWith, - "startswith": AutomationRulePropertyConditionSupportedOperatorStartsWith, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyConditionSupportedOperator(input) - return &out, nil -} - -type AutomationRulePropertyConditionSupportedProperty string - -const ( - AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId AutomationRulePropertyConditionSupportedProperty = "AccountAadTenantId" - AutomationRulePropertyConditionSupportedPropertyAccountAadUserId AutomationRulePropertyConditionSupportedProperty = "AccountAadUserId" - AutomationRulePropertyConditionSupportedPropertyAccountNTDomain AutomationRulePropertyConditionSupportedProperty = "AccountNTDomain" - AutomationRulePropertyConditionSupportedPropertyAccountName AutomationRulePropertyConditionSupportedProperty = "AccountName" - AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid AutomationRulePropertyConditionSupportedProperty = "AccountObjectGuid" - AutomationRulePropertyConditionSupportedPropertyAccountPUID AutomationRulePropertyConditionSupportedProperty = "AccountPUID" - AutomationRulePropertyConditionSupportedPropertyAccountSid AutomationRulePropertyConditionSupportedProperty = "AccountSid" - AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix AutomationRulePropertyConditionSupportedProperty = "AccountUPNSuffix" - AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId AutomationRulePropertyConditionSupportedProperty = "AzureResourceResourceId" - AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId AutomationRulePropertyConditionSupportedProperty = "AzureResourceSubscriptionId" - AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId AutomationRulePropertyConditionSupportedProperty = "CloudApplicationAppId" - AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName AutomationRulePropertyConditionSupportedProperty = "CloudApplicationAppName" - AutomationRulePropertyConditionSupportedPropertyDNSDomainName AutomationRulePropertyConditionSupportedProperty = "DNSDomainName" - AutomationRulePropertyConditionSupportedPropertyFileDirectory AutomationRulePropertyConditionSupportedProperty = "FileDirectory" - AutomationRulePropertyConditionSupportedPropertyFileHashValue AutomationRulePropertyConditionSupportedProperty = "FileHashValue" - AutomationRulePropertyConditionSupportedPropertyFileName AutomationRulePropertyConditionSupportedProperty = "FileName" - AutomationRulePropertyConditionSupportedPropertyHostAzureID AutomationRulePropertyConditionSupportedProperty = "HostAzureID" - AutomationRulePropertyConditionSupportedPropertyHostNTDomain AutomationRulePropertyConditionSupportedProperty = "HostNTDomain" - AutomationRulePropertyConditionSupportedPropertyHostName AutomationRulePropertyConditionSupportedProperty = "HostName" - AutomationRulePropertyConditionSupportedPropertyHostNetBiosName AutomationRulePropertyConditionSupportedProperty = "HostNetBiosName" - AutomationRulePropertyConditionSupportedPropertyHostOSVersion AutomationRulePropertyConditionSupportedProperty = "HostOSVersion" - AutomationRulePropertyConditionSupportedPropertyIPAddress AutomationRulePropertyConditionSupportedProperty = "IPAddress" - AutomationRulePropertyConditionSupportedPropertyIncidentDescription AutomationRulePropertyConditionSupportedProperty = "IncidentDescription" - AutomationRulePropertyConditionSupportedPropertyIncidentProviderName AutomationRulePropertyConditionSupportedProperty = "IncidentProviderName" - AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds AutomationRulePropertyConditionSupportedProperty = "IncidentRelatedAnalyticRuleIds" - AutomationRulePropertyConditionSupportedPropertyIncidentSeverity AutomationRulePropertyConditionSupportedProperty = "IncidentSeverity" - AutomationRulePropertyConditionSupportedPropertyIncidentStatus AutomationRulePropertyConditionSupportedProperty = "IncidentStatus" - AutomationRulePropertyConditionSupportedPropertyIncidentTactics AutomationRulePropertyConditionSupportedProperty = "IncidentTactics" - AutomationRulePropertyConditionSupportedPropertyIncidentTitle AutomationRulePropertyConditionSupportedProperty = "IncidentTitle" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceId AutomationRulePropertyConditionSupportedProperty = "IoTDeviceId" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel AutomationRulePropertyConditionSupportedProperty = "IoTDeviceModel" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceName AutomationRulePropertyConditionSupportedProperty = "IoTDeviceName" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem AutomationRulePropertyConditionSupportedProperty = "IoTDeviceOperatingSystem" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceType AutomationRulePropertyConditionSupportedProperty = "IoTDeviceType" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor AutomationRulePropertyConditionSupportedProperty = "IoTDeviceVendor" - AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction AutomationRulePropertyConditionSupportedProperty = "MailMessageDeliveryAction" - AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation AutomationRulePropertyConditionSupportedProperty = "MailMessageDeliveryLocation" - AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender AutomationRulePropertyConditionSupportedProperty = "MailMessageP1Sender" - AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender AutomationRulePropertyConditionSupportedProperty = "MailMessageP2Sender" - AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient AutomationRulePropertyConditionSupportedProperty = "MailMessageRecipient" - AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP AutomationRulePropertyConditionSupportedProperty = "MailMessageSenderIP" - AutomationRulePropertyConditionSupportedPropertyMailMessageSubject AutomationRulePropertyConditionSupportedProperty = "MailMessageSubject" - AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName AutomationRulePropertyConditionSupportedProperty = "MailboxDisplayName" - AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress AutomationRulePropertyConditionSupportedProperty = "MailboxPrimaryAddress" - AutomationRulePropertyConditionSupportedPropertyMailboxUPN AutomationRulePropertyConditionSupportedProperty = "MailboxUPN" - AutomationRulePropertyConditionSupportedPropertyMalwareCategory AutomationRulePropertyConditionSupportedProperty = "MalwareCategory" - AutomationRulePropertyConditionSupportedPropertyMalwareName AutomationRulePropertyConditionSupportedProperty = "MalwareName" - AutomationRulePropertyConditionSupportedPropertyProcessCommandLine AutomationRulePropertyConditionSupportedProperty = "ProcessCommandLine" - AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" - AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" - AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" -) - -func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { - return []string{ - string(AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId), - string(AutomationRulePropertyConditionSupportedPropertyAccountAadUserId), - string(AutomationRulePropertyConditionSupportedPropertyAccountNTDomain), - string(AutomationRulePropertyConditionSupportedPropertyAccountName), - string(AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid), - string(AutomationRulePropertyConditionSupportedPropertyAccountPUID), - string(AutomationRulePropertyConditionSupportedPropertyAccountSid), - string(AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix), - string(AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId), - string(AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId), - string(AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId), - string(AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName), - string(AutomationRulePropertyConditionSupportedPropertyDNSDomainName), - string(AutomationRulePropertyConditionSupportedPropertyFileDirectory), - string(AutomationRulePropertyConditionSupportedPropertyFileHashValue), - string(AutomationRulePropertyConditionSupportedPropertyFileName), - string(AutomationRulePropertyConditionSupportedPropertyHostAzureID), - string(AutomationRulePropertyConditionSupportedPropertyHostNTDomain), - string(AutomationRulePropertyConditionSupportedPropertyHostName), - string(AutomationRulePropertyConditionSupportedPropertyHostNetBiosName), - string(AutomationRulePropertyConditionSupportedPropertyHostOSVersion), - string(AutomationRulePropertyConditionSupportedPropertyIPAddress), - string(AutomationRulePropertyConditionSupportedPropertyIncidentDescription), - string(AutomationRulePropertyConditionSupportedPropertyIncidentProviderName), - string(AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds), - string(AutomationRulePropertyConditionSupportedPropertyIncidentSeverity), - string(AutomationRulePropertyConditionSupportedPropertyIncidentStatus), - string(AutomationRulePropertyConditionSupportedPropertyIncidentTactics), - string(AutomationRulePropertyConditionSupportedPropertyIncidentTitle), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceId), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceName), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceType), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation), - string(AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender), - string(AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageSubject), - string(AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName), - string(AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress), - string(AutomationRulePropertyConditionSupportedPropertyMailboxUPN), - string(AutomationRulePropertyConditionSupportedPropertyMalwareCategory), - string(AutomationRulePropertyConditionSupportedPropertyMalwareName), - string(AutomationRulePropertyConditionSupportedPropertyProcessCommandLine), - string(AutomationRulePropertyConditionSupportedPropertyProcessId), - string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), - string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), - } -} - -func (s *AutomationRulePropertyConditionSupportedProperty) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyConditionSupportedProperty(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyConditionSupportedProperty(input string) (*AutomationRulePropertyConditionSupportedProperty, error) { - vals := map[string]AutomationRulePropertyConditionSupportedProperty{ - "accountaadtenantid": AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId, - "accountaaduserid": AutomationRulePropertyConditionSupportedPropertyAccountAadUserId, - "accountntdomain": AutomationRulePropertyConditionSupportedPropertyAccountNTDomain, - "accountname": AutomationRulePropertyConditionSupportedPropertyAccountName, - "accountobjectguid": AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid, - "accountpuid": AutomationRulePropertyConditionSupportedPropertyAccountPUID, - "accountsid": AutomationRulePropertyConditionSupportedPropertyAccountSid, - "accountupnsuffix": AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix, - "azureresourceresourceid": AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId, - "azureresourcesubscriptionid": AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId, - "cloudapplicationappid": AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId, - "cloudapplicationappname": AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName, - "dnsdomainname": AutomationRulePropertyConditionSupportedPropertyDNSDomainName, - "filedirectory": AutomationRulePropertyConditionSupportedPropertyFileDirectory, - "filehashvalue": AutomationRulePropertyConditionSupportedPropertyFileHashValue, - "filename": AutomationRulePropertyConditionSupportedPropertyFileName, - "hostazureid": AutomationRulePropertyConditionSupportedPropertyHostAzureID, - "hostntdomain": AutomationRulePropertyConditionSupportedPropertyHostNTDomain, - "hostname": AutomationRulePropertyConditionSupportedPropertyHostName, - "hostnetbiosname": AutomationRulePropertyConditionSupportedPropertyHostNetBiosName, - "hostosversion": AutomationRulePropertyConditionSupportedPropertyHostOSVersion, - "ipaddress": AutomationRulePropertyConditionSupportedPropertyIPAddress, - "incidentdescription": AutomationRulePropertyConditionSupportedPropertyIncidentDescription, - "incidentprovidername": AutomationRulePropertyConditionSupportedPropertyIncidentProviderName, - "incidentrelatedanalyticruleids": AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds, - "incidentseverity": AutomationRulePropertyConditionSupportedPropertyIncidentSeverity, - "incidentstatus": AutomationRulePropertyConditionSupportedPropertyIncidentStatus, - "incidenttactics": AutomationRulePropertyConditionSupportedPropertyIncidentTactics, - "incidenttitle": AutomationRulePropertyConditionSupportedPropertyIncidentTitle, - "iotdeviceid": AutomationRulePropertyConditionSupportedPropertyIoTDeviceId, - "iotdevicemodel": AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel, - "iotdevicename": AutomationRulePropertyConditionSupportedPropertyIoTDeviceName, - "iotdeviceoperatingsystem": AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem, - "iotdevicetype": AutomationRulePropertyConditionSupportedPropertyIoTDeviceType, - "iotdevicevendor": AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor, - "mailmessagedeliveryaction": AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction, - "mailmessagedeliverylocation": AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation, - "mailmessagep1sender": AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender, - "mailmessagep2sender": AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender, - "mailmessagerecipient": AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient, - "mailmessagesenderip": AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP, - "mailmessagesubject": AutomationRulePropertyConditionSupportedPropertyMailMessageSubject, - "mailboxdisplayname": AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName, - "mailboxprimaryaddress": AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress, - "mailboxupn": AutomationRulePropertyConditionSupportedPropertyMailboxUPN, - "malwarecategory": AutomationRulePropertyConditionSupportedPropertyMalwareCategory, - "malwarename": AutomationRulePropertyConditionSupportedPropertyMalwareName, - "processcommandline": AutomationRulePropertyConditionSupportedPropertyProcessCommandLine, - "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, - "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, - "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyConditionSupportedProperty(input) - return &out, nil -} - -type IncidentClassification string - -const ( - IncidentClassificationBenignPositive IncidentClassification = "BenignPositive" - IncidentClassificationFalsePositive IncidentClassification = "FalsePositive" - IncidentClassificationTruePositive IncidentClassification = "TruePositive" - IncidentClassificationUndetermined IncidentClassification = "Undetermined" -) - -func PossibleValuesForIncidentClassification() []string { - return []string{ - string(IncidentClassificationBenignPositive), - string(IncidentClassificationFalsePositive), - string(IncidentClassificationTruePositive), - string(IncidentClassificationUndetermined), - } -} - -func (s *IncidentClassification) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassification(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassification(input string) (*IncidentClassification, error) { - vals := map[string]IncidentClassification{ - "benignpositive": IncidentClassificationBenignPositive, - "falsepositive": IncidentClassificationFalsePositive, - "truepositive": IncidentClassificationTruePositive, - "undetermined": IncidentClassificationUndetermined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassification(input) - return &out, nil -} - -type IncidentClassificationReason string - -const ( - IncidentClassificationReasonInaccurateData IncidentClassificationReason = "InaccurateData" - IncidentClassificationReasonIncorrectAlertLogic IncidentClassificationReason = "IncorrectAlertLogic" - IncidentClassificationReasonSuspiciousActivity IncidentClassificationReason = "SuspiciousActivity" - IncidentClassificationReasonSuspiciousButExpected IncidentClassificationReason = "SuspiciousButExpected" -) - -func PossibleValuesForIncidentClassificationReason() []string { - return []string{ - string(IncidentClassificationReasonInaccurateData), - string(IncidentClassificationReasonIncorrectAlertLogic), - string(IncidentClassificationReasonSuspiciousActivity), - string(IncidentClassificationReasonSuspiciousButExpected), - } -} - -func (s *IncidentClassificationReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassificationReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassificationReason(input string) (*IncidentClassificationReason, error) { - vals := map[string]IncidentClassificationReason{ - "inaccuratedata": IncidentClassificationReasonInaccurateData, - "incorrectalertlogic": IncidentClassificationReasonIncorrectAlertLogic, - "suspiciousactivity": IncidentClassificationReasonSuspiciousActivity, - "suspiciousbutexpected": IncidentClassificationReasonSuspiciousButExpected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassificationReason(input) - return &out, nil -} - -type IncidentLabelType string - -const ( - IncidentLabelTypeSystem IncidentLabelType = "System" - IncidentLabelTypeUser IncidentLabelType = "User" -) - -func PossibleValuesForIncidentLabelType() []string { - return []string{ - string(IncidentLabelTypeSystem), - string(IncidentLabelTypeUser), - } -} - -func (s *IncidentLabelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentLabelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentLabelType(input string) (*IncidentLabelType, error) { - vals := map[string]IncidentLabelType{ - "system": IncidentLabelTypeSystem, - "user": IncidentLabelTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentLabelType(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type IncidentStatus string - -const ( - IncidentStatusActive IncidentStatus = "Active" - IncidentStatusClosed IncidentStatus = "Closed" - IncidentStatusNew IncidentStatus = "New" -) - -func PossibleValuesForIncidentStatus() []string { - return []string{ - string(IncidentStatusActive), - string(IncidentStatusClosed), - string(IncidentStatusNew), - } -} - -func (s *IncidentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentStatus(input string) (*IncidentStatus, error) { - vals := map[string]IncidentStatus{ - "active": IncidentStatusActive, - "closed": IncidentStatusClosed, - "new": IncidentStatusNew, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentStatus(input) - return &out, nil -} - -type OwnerType string - -const ( - OwnerTypeGroup OwnerType = "Group" - OwnerTypeUnknown OwnerType = "Unknown" - OwnerTypeUser OwnerType = "User" -) - -func PossibleValuesForOwnerType() []string { - return []string{ - string(OwnerTypeGroup), - string(OwnerTypeUnknown), - string(OwnerTypeUser), - } -} - -func (s *OwnerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwnerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwnerType(input string) (*OwnerType, error) { - vals := map[string]OwnerType{ - "group": OwnerTypeGroup, - "unknown": OwnerTypeUnknown, - "user": OwnerTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwnerType(input) - return &out, nil -} - -type TriggersOn string - -const ( - TriggersOnIncidents TriggersOn = "Incidents" -) - -func PossibleValuesForTriggersOn() []string { - return []string{ - string(TriggersOnIncidents), - } -} - -func (s *TriggersOn) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggersOn(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggersOn(input string) (*TriggersOn, error) { - vals := map[string]TriggersOn{ - "incidents": TriggersOnIncidents, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggersOn(input) - return &out, nil -} - -type TriggersWhen string - -const ( - TriggersWhenCreated TriggersWhen = "Created" -) - -func PossibleValuesForTriggersWhen() []string { - return []string{ - string(TriggersWhenCreated), - } -} - -func (s *TriggersWhen) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggersWhen(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggersWhen(input string) (*TriggersWhen, error) { - vals := map[string]TriggersWhen{ - "created": TriggersWhenCreated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggersWhen(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule.go deleted file mode 100644 index 00c7db776a3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package automationrules - -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(&AutomationRuleId{}) -} - -var _ resourceids.ResourceId = &AutomationRuleId{} - -// AutomationRuleId is a struct representing the Resource ID for a Automation Rule -type AutomationRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AutomationRuleId string -} - -// NewAutomationRuleID returns a new AutomationRuleId struct -func NewAutomationRuleID(subscriptionId string, resourceGroupName string, workspaceName string, automationRuleId string) AutomationRuleId { - return AutomationRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AutomationRuleId: automationRuleId, - } -} - -// ParseAutomationRuleID parses 'input' into a AutomationRuleId -func ParseAutomationRuleID(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAutomationRuleIDInsensitively parses 'input' case-insensitively into a AutomationRuleId -// note: this method should only be used for API response data and not user input -func ParseAutomationRuleIDInsensitively(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AutomationRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AutomationRuleId, ok = input.Parsed["automationRuleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "automationRuleId", input) - } - - return nil -} - -// ValidateAutomationRuleID checks that 'input' can be parsed as a Automation Rule ID -func ValidateAutomationRuleID(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 := ParseAutomationRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Automation Rule ID -func (id AutomationRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/automationRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AutomationRuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Automation Rule ID -func (id AutomationRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAutomationRules", "automationRules", "automationRules"), - resourceids.UserSpecifiedSegment("automationRuleId", "automationRuleIdValue"), - } -} - -// String returns a human-readable description of this Automation Rule ID -func (id AutomationRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Automation Rule: %q", id.AutomationRuleId), - } - return fmt.Sprintf("Automation Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule_test.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule_test.go deleted file mode 100644 index dd04eaade34..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_automationrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package automationrules - -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 = &AutomationRuleId{} - -func TestNewAutomationRuleID(t *testing.T) { - id := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AutomationRuleId != "automationRuleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AutomationRuleId'", id.AutomationRuleId, "automationRuleIdValue") - } -} - -func TestFormatAutomationRuleID(t *testing.T) { - actual := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAutomationRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestParseAutomationRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AutomationRuleId: "aUtOmAtIoNrUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestSegmentsForAutomationRuleId(t *testing.T) { - segments := AutomationRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AutomationRuleId 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/securityinsights/2021-09-01-preview/automationrules/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace.go deleted file mode 100644 index 72d00c87771..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package automationrules - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace_test.go deleted file mode 100644 index bc06f0f478f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package automationrules - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/automationrules/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_createorupdate.go deleted file mode 100644 index 6ab8b05e0fb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package automationrules - -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 *AutomationRule -} - -// CreateOrUpdate ... -func (c AutomationRulesClient) CreateOrUpdate(ctx context.Context, id AutomationRuleId, input AutomationRule) (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 AutomationRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_get.go deleted file mode 100644 index b5c7ce72e30..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package automationrules - -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 *AutomationRule -} - -// Get ... -func (c AutomationRulesClient) Get(ctx context.Context, id AutomationRuleId) (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 AutomationRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_list.go deleted file mode 100644 index a3c7db4995a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package automationrules - -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 *[]AutomationRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutomationRule -} - -// List ... -func (c AutomationRulesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/automationRules", 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 *[]AutomationRule `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 AutomationRulesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AutomationRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AutomationRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AutomationRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AutomationRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/automationrules/model_automationrule.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrule.go deleted file mode 100644 index cb62ab16d31..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package automationrules - -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 AutomationRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *AutomationRuleProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleaction.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleaction.go deleted file mode 100644 index 77887bb8adf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleaction.go +++ /dev/null @@ -1,61 +0,0 @@ -package automationrules - -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 AutomationRuleAction interface { -} - -// RawAutomationRuleActionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAutomationRuleActionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAutomationRuleActionImplementation(input []byte) (AutomationRuleAction, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleAction into map[string]interface: %+v", err) - } - - value, ok := temp["actionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "ModifyProperties") { - var out AutomationRuleModifyPropertiesAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRuleModifyPropertiesAction: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RunPlaybook") { - var out AutomationRuleRunPlaybookAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRuleRunPlaybookAction: %+v", err) - } - return out, nil - } - - out := RawAutomationRuleActionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulecondition.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulecondition.go deleted file mode 100644 index c3f80c16f5e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulecondition.go +++ /dev/null @@ -1,53 +0,0 @@ -package automationrules - -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 AutomationRuleCondition interface { -} - -// RawAutomationRuleConditionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAutomationRuleConditionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAutomationRuleConditionImplementation(input []byte) (AutomationRuleCondition, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleCondition into map[string]interface: %+v", err) - } - - value, ok := temp["conditionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Property") { - var out AutomationRulePropertyValuesCondition - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRulePropertyValuesCondition: %+v", err) - } - return out, nil - } - - out := RawAutomationRuleConditionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesaction.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesaction.go deleted file mode 100644 index e3f61738ff6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleAction = AutomationRuleModifyPropertiesAction{} - -type AutomationRuleModifyPropertiesAction struct { - ActionConfiguration AutomationRuleModifyPropertiesActionActionConfiguration `json:"actionConfiguration"` - - // Fields inherited from AutomationRuleAction - Order int64 `json:"order"` -} - -var _ json.Marshaler = AutomationRuleModifyPropertiesAction{} - -func (s AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { - type wrapper AutomationRuleModifyPropertiesAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - decoded["actionType"] = "ModifyProperties" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesactionactionconfiguration.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesactionactionconfiguration.go deleted file mode 100644 index b9e58ddcc8e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulemodifypropertiesactionactionconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRuleModifyPropertiesActionActionConfiguration struct { - Classification *IncidentClassification `json:"classification,omitempty"` - ClassificationComment *string `json:"classificationComment,omitempty"` - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` - Labels *[]IncidentLabel `json:"labels,omitempty"` - Owner *IncidentOwnerInfo `json:"owner,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Status *IncidentStatus `json:"status,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleproperties.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleproperties.go deleted file mode 100644 index 5460f9b5fba..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruleproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" - "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 AutomationRuleProperties struct { - Actions []AutomationRuleAction `json:"actions"` - CreatedBy *ClientInfo `json:"createdBy,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - DisplayName string `json:"displayName"` - LastModifiedBy *ClientInfo `json:"lastModifiedBy,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Order int64 `json:"order"` - TriggeringLogic AutomationRuleTriggeringLogic `json:"triggeringLogic"` -} - -func (o *AutomationRuleProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *AutomationRuleProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} - -var _ json.Unmarshaler = &AutomationRuleProperties{} - -func (s *AutomationRuleProperties) UnmarshalJSON(bytes []byte) error { - type alias AutomationRuleProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AutomationRuleProperties: %+v", err) - } - - s.CreatedBy = decoded.CreatedBy - s.CreatedTimeUtc = decoded.CreatedTimeUtc - s.DisplayName = decoded.DisplayName - s.LastModifiedBy = decoded.LastModifiedBy - s.LastModifiedTimeUtc = decoded.LastModifiedTimeUtc - s.Order = decoded.Order - s.TriggeringLogic = decoded.TriggeringLogic - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AutomationRuleProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["actions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Actions into list []json.RawMessage: %+v", err) - } - - output := make([]AutomationRuleAction, 0) - for i, val := range listTemp { - impl, err := unmarshalAutomationRuleActionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Actions' for 'AutomationRuleProperties': %+v", i, err) - } - output = append(output, impl) - } - s.Actions = output - } - return nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluescondition.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluescondition.go deleted file mode 100644 index 98df77f3445..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluescondition.go +++ /dev/null @@ -1,41 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleCondition = AutomationRulePropertyValuesCondition{} - -type AutomationRulePropertyValuesCondition struct { - ConditionProperties AutomationRulePropertyValuesConditionConditionProperties `json:"conditionProperties"` - - // Fields inherited from AutomationRuleCondition -} - -var _ json.Marshaler = AutomationRulePropertyValuesCondition{} - -func (s AutomationRulePropertyValuesCondition) MarshalJSON() ([]byte, error) { - type wrapper AutomationRulePropertyValuesCondition - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRulePropertyValuesCondition: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRulePropertyValuesCondition: %+v", err) - } - decoded["conditionType"] = "Property" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRulePropertyValuesCondition: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluesconditionconditionproperties.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluesconditionconditionproperties.go deleted file mode 100644 index af6b9f9aa40..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulepropertyvaluesconditionconditionproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRulePropertyValuesConditionConditionProperties struct { - Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` - PropertyName *AutomationRulePropertyConditionSupportedProperty `json:"propertyName,omitempty"` - PropertyValues *[]string `json:"propertyValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookaction.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookaction.go deleted file mode 100644 index 5f0daf4e77b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleAction = AutomationRuleRunPlaybookAction{} - -type AutomationRuleRunPlaybookAction struct { - ActionConfiguration AutomationRuleRunPlaybookActionActionConfiguration `json:"actionConfiguration"` - - // Fields inherited from AutomationRuleAction - Order int64 `json:"order"` -} - -var _ json.Marshaler = AutomationRuleRunPlaybookAction{} - -func (s AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { - type wrapper AutomationRuleRunPlaybookAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRuleRunPlaybookAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleRunPlaybookAction: %+v", err) - } - decoded["actionType"] = "RunPlaybook" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRuleRunPlaybookAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookactionactionconfiguration.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookactionactionconfiguration.go deleted file mode 100644 index d74cefd02e4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationrulerunplaybookactionactionconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRuleRunPlaybookActionActionConfiguration struct { - LogicAppResourceId *string `json:"logicAppResourceId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruletriggeringlogic.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruletriggeringlogic.go deleted file mode 100644 index 2f4592c4269..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_automationruletriggeringlogic.go +++ /dev/null @@ -1,70 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" - "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 AutomationRuleTriggeringLogic struct { - Conditions *[]AutomationRuleCondition `json:"conditions,omitempty"` - ExpirationTimeUtc *string `json:"expirationTimeUtc,omitempty"` - IsEnabled bool `json:"isEnabled"` - TriggersOn TriggersOn `json:"triggersOn"` - TriggersWhen TriggersWhen `json:"triggersWhen"` -} - -func (o *AutomationRuleTriggeringLogic) GetExpirationTimeUtcAsTime() (*time.Time, error) { - if o.ExpirationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ExpirationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleTriggeringLogic) SetExpirationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ExpirationTimeUtc = &formatted -} - -var _ json.Unmarshaler = &AutomationRuleTriggeringLogic{} - -func (s *AutomationRuleTriggeringLogic) UnmarshalJSON(bytes []byte) error { - type alias AutomationRuleTriggeringLogic - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AutomationRuleTriggeringLogic: %+v", err) - } - - s.ExpirationTimeUtc = decoded.ExpirationTimeUtc - s.IsEnabled = decoded.IsEnabled - s.TriggersOn = decoded.TriggersOn - s.TriggersWhen = decoded.TriggersWhen - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AutomationRuleTriggeringLogic into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["conditions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Conditions into list []json.RawMessage: %+v", err) - } - - output := make([]AutomationRuleCondition, 0) - for i, val := range listTemp { - impl, err := unmarshalAutomationRuleConditionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Conditions' for 'AutomationRuleTriggeringLogic': %+v", i, err) - } - output = append(output, impl) - } - s.Conditions = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_clientinfo.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_clientinfo.go deleted file mode 100644 index 6b1a9ec7520..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_clientinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentlabel.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentlabel.go deleted file mode 100644 index 8f66e17624f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentlabel.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentLabel struct { - LabelName string `json:"labelName"` - LabelType *IncidentLabelType `json:"labelType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentownerinfo.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentownerinfo.go deleted file mode 100644 index b3933802226..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/model_incidentownerinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOwnerInfo struct { - AssignedTo *string `json:"assignedTo,omitempty"` - Email *string `json:"email,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - OwnerType *OwnerType `json:"ownerType,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/automationrules/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/predicates.go deleted file mode 100644 index eaa1f88eb83..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AutomationRuleOperationPredicate) Matches(input AutomationRule) 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.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/securityinsights/2021-09-01-preview/automationrules/version.go b/resource-manager/securityinsights/2021-09-01-preview/automationrules/version.go deleted file mode 100644 index 29ded877153..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/automationrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/automationrules/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/README.md b/resource-manager/securityinsights/2021-09-01-preview/bookmark/README.md deleted file mode 100644 index 0470ff78376..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/bookmark` Documentation - -The `bookmark` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/bookmark" -``` - - -### Client Initialization - -```go -client := bookmark.NewBookmarkClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarkClient.Expand` - -```go -ctx := context.TODO() -id := bookmark.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -payload := bookmark.BookmarkExpandParameters{ - // ... -} - - -read, err := client.Expand(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/securityinsights/2021-09-01-preview/bookmark/client.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/client.go deleted file mode 100644 index f20b4939301..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmark - -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 BookmarkClient struct { - Client *resourcemanager.Client -} - -func NewBookmarkClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarkClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmark", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarkClient: %+v", err) - } - - return &BookmarkClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/constants.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/constants.go deleted file mode 100644 index 6d837b84514..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/constants.go +++ /dev/null @@ -1,108 +0,0 @@ -package bookmark - -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 EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark.go deleted file mode 100644 index 37ded815f59..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmark - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark_test.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark_test.go deleted file mode 100644 index f11911d55b6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmark - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2021-09-01-preview/bookmark/method_expand.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/method_expand.go deleted file mode 100644 index c3d30a1e86e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/method_expand.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmark - -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 ExpandOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BookmarkExpandResponse -} - -// Expand ... -func (c BookmarkClient) Expand(ctx context.Context, id BookmarkId, input BookmarkExpandParameters) (result ExpandOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/expand", 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 BookmarkExpandResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandparameters.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandparameters.go deleted file mode 100644 index d0c2ac39a21..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandparameters.go +++ /dev/null @@ -1,40 +0,0 @@ -package bookmark - -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 BookmarkExpandParameters struct { - EndTime *string `json:"endTime,omitempty"` - ExpansionId *string `json:"expansionId,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *BookmarkExpandParameters) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkExpandParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *BookmarkExpandParameters) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkExpandParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponse.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponse.go deleted file mode 100644 index 660174160da..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkExpandResponse struct { - MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` - Value *BookmarkExpandResponseValue `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponsevalue.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponsevalue.go deleted file mode 100644 index 7da54595645..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_bookmarkexpandresponsevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkExpandResponseValue struct { - Edges *[]ConnectedEntity `json:"edges,omitempty"` - Entities *[]Entity `json:"entities,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_connectedentity.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_connectedentity.go deleted file mode 100644 index 1b0eb2f8a63..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_connectedentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectedEntity struct { - AdditionalData *interface{} `json:"additionalData,omitempty"` - TargetEntityId *string `json:"targetEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_entity.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_entity.go deleted file mode 100644 index dd7f8959d78..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_entity.go +++ /dev/null @@ -1,16 +0,0 @@ -package bookmark - -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 Entity struct { - Id *string `json:"id,omitempty"` - Kind EntityKind `json:"kind"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultaggregation.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultaggregation.go deleted file mode 100644 index 3d2d9b94dd8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultaggregation.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultAggregation struct { - AggregationType *string `json:"aggregationType,omitempty"` - Count int64 `json:"count"` - DisplayName *string `json:"displayName,omitempty"` - EntityKind EntityKind `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultsmetadata.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultsmetadata.go deleted file mode 100644 index e1736c11641..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/model_expansionresultsmetadata.go +++ /dev/null @@ -1,8 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultsMetadata struct { - Aggregations *[]ExpansionResultAggregation `json:"aggregations,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmark/version.go b/resource-manager/securityinsights/2021-09-01-preview/bookmark/version.go deleted file mode 100644 index 04b19ab7640..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmark/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmark - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmark/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/README.md b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/README.md deleted file mode 100644 index b98cf25787f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations` Documentation - -The `bookmarkrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/bookmarkrelations" -``` - - -### Client Initialization - -```go -client := bookmarkrelations.NewBookmarkRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarkRelationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - -payload := bookmarkrelations.Relation{ - // ... -} - - -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: `BookmarkRelationsClient.Delete` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - -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: `BookmarkRelationsClient.Get` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - -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: `BookmarkRelationsClient.List` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -// alternatively `client.List(ctx, id, bookmarkrelations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, bookmarkrelations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/client.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/client.go deleted file mode 100644 index 7b2f113e83b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmarkrelations - -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 BookmarkRelationsClient struct { - Client *resourcemanager.Client -} - -func NewBookmarkRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarkRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmarkrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarkRelationsClient: %+v", err) - } - - return &BookmarkRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark.go deleted file mode 100644 index b435d465a74..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmarkrelations - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark_test.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark_test.go deleted file mode 100644 index d359e2cf571..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmarkrelations - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation.go deleted file mode 100644 index 7eb043f12dd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation.go +++ /dev/null @@ -1,150 +0,0 @@ -package bookmarkrelations - -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(&BookmarkRelationId{}) -} - -var _ resourceids.ResourceId = &BookmarkRelationId{} - -// BookmarkRelationId is a struct representing the Resource ID for a Bookmark Relation -type BookmarkRelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string - RelationName string -} - -// NewBookmarkRelationID returns a new BookmarkRelationId struct -func NewBookmarkRelationID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string, relationName string) BookmarkRelationId { - return BookmarkRelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - RelationName: relationName, - } -} - -// ParseBookmarkRelationID parses 'input' into a BookmarkRelationId -func ParseBookmarkRelationID(input string) (*BookmarkRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkRelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkRelationIDInsensitively parses 'input' case-insensitively into a BookmarkRelationId -// note: this method should only be used for API response data and not user input -func ParseBookmarkRelationIDInsensitively(input string) (*BookmarkRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkRelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkRelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateBookmarkRelationID checks that 'input' can be parsed as a Bookmark Relation ID -func ValidateBookmarkRelationID(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 := ParseBookmarkRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark Relation ID -func (id BookmarkRelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark Relation ID -func (id BookmarkRelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Bookmark Relation ID -func (id BookmarkRelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Bookmark Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation_test.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation_test.go deleted file mode 100644 index 4baaa6c1918..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/id_bookmarkrelation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package bookmarkrelations - -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 = &BookmarkRelationId{} - -func TestNewBookmarkRelationID(t *testing.T) { - id := NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatBookmarkRelationID(t *testing.T) { - actual := NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue", - Expected: &BookmarkRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseBookmarkRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue", - Expected: &BookmarkRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &BookmarkRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForBookmarkRelationId(t *testing.T) { - segments := BookmarkRelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkRelationId 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/securityinsights/2021-09-01-preview/bookmarkrelations/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_createorupdate.go deleted file mode 100644 index 1673e53e3d3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmarkrelations - -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 *Relation -} - -// CreateOrUpdate ... -func (c BookmarkRelationsClient) CreateOrUpdate(ctx context.Context, id BookmarkRelationId, input Relation) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_delete.go deleted file mode 100644 index be83fdfe96b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package bookmarkrelations - -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 BookmarkRelationsClient) Delete(ctx context.Context, id BookmarkRelationId) (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/securityinsights/2021-09-01-preview/bookmarkrelations/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_get.go deleted file mode 100644 index 368649d1413..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bookmarkrelations - -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 *Relation -} - -// Get ... -func (c BookmarkRelationsClient) Get(ctx context.Context, id BookmarkRelationId) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_list.go deleted file mode 100644 index c7b0e80ee33..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package bookmarkrelations - -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 *[]Relation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c BookmarkRelationsClient) List(ctx context.Context, id BookmarkId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `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 BookmarkRelationsClient) ListComplete(ctx context.Context, id BookmarkId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BookmarkRelationsClient) ListCompleteMatchingPredicate(ctx context.Context, id BookmarkId, options ListOperationOptions, predicate RelationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2021-09-01-preview/bookmarkrelations/model_relation.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relation.go deleted file mode 100644 index e33320efd48..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package bookmarkrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relationproperties.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relationproperties.go deleted file mode 100644 index e7ab9bd5ff4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmarkrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/predicates.go deleted file mode 100644 index 575631e64a9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bookmarkrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2021-09-01-preview/bookmarkrelations/version.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/version.go deleted file mode 100644 index 75b453151a9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmarkrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmarkrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/README.md b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/README.md deleted file mode 100644 index 56c602c8453..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/bookmarks` Documentation - -The `bookmarks` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/bookmarks" -``` - - -### Client Initialization - -```go -client := bookmarks.NewBookmarksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -payload := bookmarks.Bookmark{ - // ... -} - - -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: `BookmarksClient.Delete` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -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: `BookmarksClient.Get` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -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: `BookmarksClient.List` - -```go -ctx := context.TODO() -id := bookmarks.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/bookmarks/client.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/client.go deleted file mode 100644 index 22469155649..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmarks - -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 BookmarksClient struct { - Client *resourcemanager.Client -} - -func NewBookmarksClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmarks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarksClient: %+v", err) - } - - return &BookmarksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/constants.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/constants.go deleted file mode 100644 index c057284aed1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package bookmarks - -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 IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark.go deleted file mode 100644 index 5317bd28514..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmarks - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark_test.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark_test.go deleted file mode 100644 index 1d89b9448a6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmarks - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2021-09-01-preview/bookmarks/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace.go deleted file mode 100644 index 96d5c1221cf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package bookmarks - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace_test.go deleted file mode 100644 index c0e8adfac09..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bookmarks - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/bookmarks/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_createorupdate.go deleted file mode 100644 index 2e61ab3ee74..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmarks - -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 *Bookmark -} - -// CreateOrUpdate ... -func (c BookmarksClient) CreateOrUpdate(ctx context.Context, id BookmarkId, input Bookmark) (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 Bookmark - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_delete.go deleted file mode 100644 index 75eef715a7c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package bookmarks - -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 BookmarksClient) Delete(ctx context.Context, id BookmarkId) (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/securityinsights/2021-09-01-preview/bookmarks/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_get.go deleted file mode 100644 index 36c8d7fcc43..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bookmarks - -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 *Bookmark -} - -// Get ... -func (c BookmarksClient) Get(ctx context.Context, id BookmarkId) (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 Bookmark - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_list.go deleted file mode 100644 index 432b04c413a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package bookmarks - -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 *[]Bookmark -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Bookmark -} - -// List ... -func (c BookmarksClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/bookmarks", 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 *[]Bookmark `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 BookmarksClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BookmarkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BookmarksClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate BookmarkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Bookmark, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/bookmarks/model_bookmark.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmark.go deleted file mode 100644 index 0745cad5b0a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmark.go +++ /dev/null @@ -1,17 +0,0 @@ -package bookmarks - -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 Bookmark struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BookmarkProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmarkproperties.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmarkproperties.go deleted file mode 100644 index 0652d2b2110..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_bookmarkproperties.go +++ /dev/null @@ -1,86 +0,0 @@ -package bookmarks - -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 BookmarkProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryEndTime *string `json:"queryEndTime,omitempty"` - QueryResult *string `json:"queryResult,omitempty"` - QueryStartTime *string `json:"queryStartTime,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *BookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *BookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *BookmarkProperties) GetQueryEndTimeAsTime() (*time.Time, error) { - if o.QueryEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetQueryEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryEndTime = &formatted -} - -func (o *BookmarkProperties) GetQueryStartTimeAsTime() (*time.Time, error) { - if o.QueryStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetQueryStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryStartTime = &formatted -} - -func (o *BookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_incidentinfo.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_incidentinfo.go deleted file mode 100644 index a4c9f8c8d44..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_userinfo.go deleted file mode 100644 index 178ee7d633c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/predicates.go deleted file mode 100644 index d5334a9af01..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BookmarkOperationPredicate) Matches(input Bookmark) 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.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/securityinsights/2021-09-01-preview/bookmarks/version.go b/resource-manager/securityinsights/2021-09-01-preview/bookmarks/version.go deleted file mode 100644 index 4a95051ee0b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/bookmarks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmarks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmarks/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/README.md b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/README.md deleted file mode 100644 index e53fc06eece..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements` Documentation - -The `checkdataconnectorrequirements` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/checkdataconnectorrequirements" -``` - - -### Client Initialization - -```go -client := checkdataconnectorrequirements.NewCheckDataConnectorRequirementsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CheckDataConnectorRequirementsClient.DataConnectorsCheckRequirementsPost` - -```go -ctx := context.TODO() -id := checkdataconnectorrequirements.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := checkdataconnectorrequirements.DataConnectorsCheckRequirements{ - // ... -} - - -read, err := client.DataConnectorsCheckRequirementsPost(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/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/client.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/client.go deleted file mode 100644 index c01575bd213..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package checkdataconnectorrequirements - -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 CheckDataConnectorRequirementsClient struct { - Client *resourcemanager.Client -} - -func NewCheckDataConnectorRequirementsClientWithBaseURI(sdkApi sdkEnv.Api) (*CheckDataConnectorRequirementsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "checkdataconnectorrequirements", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CheckDataConnectorRequirementsClient: %+v", err) - } - - return &CheckDataConnectorRequirementsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/constants.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/constants.go deleted file mode 100644 index 108cfe6cd81..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/constants.go +++ /dev/null @@ -1,181 +0,0 @@ -package checkdataconnectorrequirements - -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 DataConnectorAuthorizationState string - -const ( - DataConnectorAuthorizationStateInvalid DataConnectorAuthorizationState = "Invalid" - DataConnectorAuthorizationStateValid DataConnectorAuthorizationState = "Valid" -) - -func PossibleValuesForDataConnectorAuthorizationState() []string { - return []string{ - string(DataConnectorAuthorizationStateInvalid), - string(DataConnectorAuthorizationStateValid), - } -} - -func (s *DataConnectorAuthorizationState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorAuthorizationState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorAuthorizationState(input string) (*DataConnectorAuthorizationState, error) { - vals := map[string]DataConnectorAuthorizationState{ - "invalid": DataConnectorAuthorizationStateInvalid, - "valid": DataConnectorAuthorizationStateValid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorAuthorizationState(input) - return &out, nil -} - -type DataConnectorKind string - -const ( - DataConnectorKindAPIPolling DataConnectorKind = "APIPolling" - DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" - DataConnectorKindAmazonWebServicesSThree DataConnectorKind = "AmazonWebServicesS3" - DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" - DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" - DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" - DataConnectorKindDynamicsThreeSixFive DataConnectorKind = "Dynamics365" - DataConnectorKindGenericUI DataConnectorKind = "GenericUI" - DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" - DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" - DataConnectorKindMicrosoftThreatIntelligence DataConnectorKind = "MicrosoftThreatIntelligence" - DataConnectorKindMicrosoftThreatProtection DataConnectorKind = "MicrosoftThreatProtection" - DataConnectorKindOfficeATP DataConnectorKind = "OfficeATP" - DataConnectorKindOfficeIRM DataConnectorKind = "OfficeIRM" - DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" - DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" - DataConnectorKindThreatIntelligenceTaxii DataConnectorKind = "ThreatIntelligenceTaxii" -) - -func PossibleValuesForDataConnectorKind() []string { - return []string{ - string(DataConnectorKindAPIPolling), - string(DataConnectorKindAmazonWebServicesCloudTrail), - string(DataConnectorKindAmazonWebServicesSThree), - string(DataConnectorKindAzureActiveDirectory), - string(DataConnectorKindAzureAdvancedThreatProtection), - string(DataConnectorKindAzureSecurityCenter), - string(DataConnectorKindDynamicsThreeSixFive), - string(DataConnectorKindGenericUI), - string(DataConnectorKindMicrosoftCloudAppSecurity), - string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), - string(DataConnectorKindMicrosoftThreatIntelligence), - string(DataConnectorKindMicrosoftThreatProtection), - string(DataConnectorKindOfficeATP), - string(DataConnectorKindOfficeIRM), - string(DataConnectorKindOfficeThreeSixFive), - string(DataConnectorKindThreatIntelligence), - string(DataConnectorKindThreatIntelligenceTaxii), - } -} - -func (s *DataConnectorKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorKind(input string) (*DataConnectorKind, error) { - vals := map[string]DataConnectorKind{ - "apipolling": DataConnectorKindAPIPolling, - "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, - "amazonwebservicess3": DataConnectorKindAmazonWebServicesSThree, - "azureactivedirectory": DataConnectorKindAzureActiveDirectory, - "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, - "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, - "dynamics365": DataConnectorKindDynamicsThreeSixFive, - "genericui": DataConnectorKindGenericUI, - "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, - "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, - "microsoftthreatintelligence": DataConnectorKindMicrosoftThreatIntelligence, - "microsoftthreatprotection": DataConnectorKindMicrosoftThreatProtection, - "officeatp": DataConnectorKindOfficeATP, - "officeirm": DataConnectorKindOfficeIRM, - "office365": DataConnectorKindOfficeThreeSixFive, - "threatintelligence": DataConnectorKindThreatIntelligence, - "threatintelligencetaxii": DataConnectorKindThreatIntelligenceTaxii, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorKind(input) - return &out, nil -} - -type DataConnectorLicenseState string - -const ( - DataConnectorLicenseStateInvalid DataConnectorLicenseState = "Invalid" - DataConnectorLicenseStateUnknown DataConnectorLicenseState = "Unknown" - DataConnectorLicenseStateValid DataConnectorLicenseState = "Valid" -) - -func PossibleValuesForDataConnectorLicenseState() []string { - return []string{ - string(DataConnectorLicenseStateInvalid), - string(DataConnectorLicenseStateUnknown), - string(DataConnectorLicenseStateValid), - } -} - -func (s *DataConnectorLicenseState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorLicenseState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorLicenseState(input string) (*DataConnectorLicenseState, error) { - vals := map[string]DataConnectorLicenseState{ - "invalid": DataConnectorLicenseStateInvalid, - "unknown": DataConnectorLicenseStateUnknown, - "valid": DataConnectorLicenseStateValid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorLicenseState(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace.go deleted file mode 100644 index b25e14b058a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package checkdataconnectorrequirements - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace_test.go deleted file mode 100644 index dfd92520cd0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package checkdataconnectorrequirements - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go deleted file mode 100644 index 592338190a2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go +++ /dev/null @@ -1,59 +0,0 @@ -package checkdataconnectorrequirements - -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 DataConnectorsCheckRequirementsPostOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataConnectorRequirementsState -} - -// DataConnectorsCheckRequirementsPost ... -func (c CheckDataConnectorRequirementsClient) DataConnectorsCheckRequirementsPost(ctx context.Context, id WorkspaceId, input DataConnectorsCheckRequirements) (result DataConnectorsCheckRequirementsPostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements", 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 DataConnectorRequirementsState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go deleted file mode 100644 index ff65fa7b99c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AADCheckRequirements{} - -type AADCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AADCheckRequirements{} - -func (s AADCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AADCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AADCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AADCheckRequirements: %+v", err) - } - decoded["kind"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AADCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go deleted file mode 100644 index 3e9bd0286a6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AATPCheckRequirements{} - -type AATPCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AATPCheckRequirements{} - -func (s AATPCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AATPCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AATPCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AATPCheckRequirements: %+v", err) - } - decoded["kind"] = "AzureAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AATPCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go deleted file mode 100644 index 540d0578fb0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = ASCCheckRequirements{} - -type ASCCheckRequirements struct { - Properties *ASCCheckRequirementsProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = ASCCheckRequirements{} - -func (s ASCCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper ASCCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ASCCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ASCCheckRequirements: %+v", err) - } - decoded["kind"] = "AzureSecurityCenter" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ASCCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go deleted file mode 100644 index ba43032141a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ASCCheckRequirementsProperties struct { - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go deleted file mode 100644 index 30f8e23168f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go +++ /dev/null @@ -1,40 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AwsCloudTrailCheckRequirements{} - -type AwsCloudTrailCheckRequirements struct { - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AwsCloudTrailCheckRequirements{} - -func (s AwsCloudTrailCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AwsCloudTrailCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsCloudTrailCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsCloudTrailCheckRequirements: %+v", err) - } - decoded["kind"] = "AmazonWebServicesCloudTrail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsCloudTrailCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go deleted file mode 100644 index 7a8ef502e8d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go +++ /dev/null @@ -1,40 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AwsS3CheckRequirements{} - -type AwsS3CheckRequirements struct { - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AwsS3CheckRequirements{} - -func (s AwsS3CheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AwsS3CheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsS3CheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsS3CheckRequirements: %+v", err) - } - decoded["kind"] = "AmazonWebServicesS3" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsS3CheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go deleted file mode 100644 index fb3d08c63a5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go +++ /dev/null @@ -1,9 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorRequirementsState struct { - AuthorizationState *DataConnectorAuthorizationState `json:"authorizationState,omitempty"` - LicenseState *DataConnectorLicenseState `json:"licenseState,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go deleted file mode 100644 index 33fb1ebd605..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go +++ /dev/null @@ -1,157 +0,0 @@ -package checkdataconnectorrequirements - -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 DataConnectorsCheckRequirements interface { -} - -// RawDataConnectorsCheckRequirementsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawDataConnectorsCheckRequirementsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalDataConnectorsCheckRequirementsImplementation(input []byte) (DataConnectorsCheckRequirements, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling DataConnectorsCheckRequirements into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out AADCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AADCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureAdvancedThreatProtection") { - var out AATPCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AATPCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureSecurityCenter") { - var out ASCCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ASCCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { - var out AwsCloudTrailCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsCloudTrailCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesS3") { - var out AwsS3CheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsS3CheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Dynamics365") { - var out Dynamics365CheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Dynamics365CheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { - var out MCASCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MCASCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { - var out MDATPCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MDATPCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatIntelligence") { - var out MSTICheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MSTICheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatProtection") { - var out MtpCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MtpCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeATP") { - var out OfficeATPCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeATPCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeIRM") { - var out OfficeIRMCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeIRMCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out TICheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TICheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligenceTaxii") { - var out TiTaxiiCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TiTaxiiCheckRequirements: %+v", err) - } - return out, nil - } - - out := RawDataConnectorsCheckRequirementsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go deleted file mode 100644 index 621ff38984a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorTenantId struct { - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go deleted file mode 100644 index 91327c1f028..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = Dynamics365CheckRequirements{} - -type Dynamics365CheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = Dynamics365CheckRequirements{} - -func (s Dynamics365CheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper Dynamics365CheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Dynamics365CheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Dynamics365CheckRequirements: %+v", err) - } - decoded["kind"] = "Dynamics365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Dynamics365CheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go deleted file mode 100644 index 98755f8e96e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MCASCheckRequirements{} - -type MCASCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MCASCheckRequirements{} - -func (s MCASCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MCASCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MCASCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MCASCheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftCloudAppSecurity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MCASCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go deleted file mode 100644 index 452c3359f5d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MDATPCheckRequirements{} - -type MDATPCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MDATPCheckRequirements{} - -func (s MDATPCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MDATPCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MDATPCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MDATPCheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MDATPCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go deleted file mode 100644 index c9b2e2de45c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MSTICheckRequirements{} - -type MSTICheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MSTICheckRequirements{} - -func (s MSTICheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MSTICheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MSTICheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MSTICheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MSTICheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go deleted file mode 100644 index 70a71b1b3c8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MtpCheckRequirements{} - -type MtpCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MtpCheckRequirements{} - -func (s MtpCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MtpCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MtpCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MtpCheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MtpCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go deleted file mode 100644 index 2ffb2d3ea00..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = OfficeATPCheckRequirements{} - -type OfficeATPCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = OfficeATPCheckRequirements{} - -func (s OfficeATPCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper OfficeATPCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeATPCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeATPCheckRequirements: %+v", err) - } - decoded["kind"] = "OfficeATP" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeATPCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go deleted file mode 100644 index 83a9ab02643..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = OfficeIRMCheckRequirements{} - -type OfficeIRMCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = OfficeIRMCheckRequirements{} - -func (s OfficeIRMCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper OfficeIRMCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeIRMCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeIRMCheckRequirements: %+v", err) - } - decoded["kind"] = "OfficeIRM" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeIRMCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go deleted file mode 100644 index ca83636b3d9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = TICheckRequirements{} - -type TICheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = TICheckRequirements{} - -func (s TICheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper TICheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TICheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TICheckRequirements: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TICheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go deleted file mode 100644 index cbc2eb9ec40..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = TiTaxiiCheckRequirements{} - -type TiTaxiiCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = TiTaxiiCheckRequirements{} - -func (s TiTaxiiCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper TiTaxiiCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TiTaxiiCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TiTaxiiCheckRequirements: %+v", err) - } - decoded["kind"] = "ThreatIntelligenceTaxii" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TiTaxiiCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/version.go b/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/version.go deleted file mode 100644 index e3e16185921..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package checkdataconnectorrequirements - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/checkdataconnectorrequirements/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/client.go b/resource-manager/securityinsights/2021-09-01-preview/client.go deleted file mode 100644 index 7e29cfaf20a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/client.go +++ /dev/null @@ -1,316 +0,0 @@ -package v2021_09_01_preview - -// 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/securityinsights/2021-09-01-preview/actions" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/alertruletemplates" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/automationrule" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/automationrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/bookmark" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/bookmarkrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/bookmarks" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/checkdataconnectorrequirements" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/dataconnectors" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/enrichment" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entities" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entityqueries" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entityrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entitytypes" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentalerts" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentcomments" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidententities" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidents" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentteam" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/metadata" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/officeconsents" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/repositories" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/settings" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/threatintelligence" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/watchlistitems" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/watchlists" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Actions *actions.ActionsClient - AlertRuleTemplates *alertruletemplates.AlertRuleTemplatesClient - AlertRules *alertrules.AlertRulesClient - AutomationRule *automationrule.AutomationRuleClient - AutomationRules *automationrules.AutomationRulesClient - Bookmark *bookmark.BookmarkClient - BookmarkRelations *bookmarkrelations.BookmarkRelationsClient - Bookmarks *bookmarks.BookmarksClient - CheckDataConnectorRequirements *checkdataconnectorrequirements.CheckDataConnectorRequirementsClient - DataConnectors *dataconnectors.DataConnectorsClient - DataConnectorsConnect *dataconnectorsconnect.DataConnectorsConnectClient - DataConnectorsDisconnect *dataconnectorsdisconnect.DataConnectorsDisconnectClient - Enrichment *enrichment.EnrichmentClient - Entities *entities.EntitiesClient - EntityQueries *entityqueries.EntityQueriesClient - EntityRelations *entityrelations.EntityRelationsClient - EntityTypes *entitytypes.EntityTypesClient - IncidentAlerts *incidentalerts.IncidentAlertsClient - IncidentBookmarks *incidentbookmarks.IncidentBookmarksClient - IncidentComments *incidentcomments.IncidentCommentsClient - IncidentEntities *incidententities.IncidentEntitiesClient - IncidentRelations *incidentrelations.IncidentRelationsClient - IncidentTeam *incidentteam.IncidentTeamClient - Incidents *incidents.IncidentsClient - Metadata *metadata.MetadataClient - OfficeConsents *officeconsents.OfficeConsentsClient - Repositories *repositories.RepositoriesClient - SentinelOnboardingStates *sentinelonboardingstates.SentinelOnboardingStatesClient - Settings *settings.SettingsClient - SourceControls *sourcecontrols.SourceControlsClient - ThreatIntelligence *threatintelligence.ThreatIntelligenceClient - WatchlistItems *watchlistitems.WatchlistItemsClient - Watchlists *watchlists.WatchlistsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - actionsClient, err := actions.NewActionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Actions client: %+v", err) - } - configureFunc(actionsClient.Client) - - alertRuleTemplatesClient, err := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AlertRuleTemplates client: %+v", err) - } - configureFunc(alertRuleTemplatesClient.Client) - - alertRulesClient, err := alertrules.NewAlertRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AlertRules client: %+v", err) - } - configureFunc(alertRulesClient.Client) - - automationRuleClient, err := automationrule.NewAutomationRuleClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AutomationRule client: %+v", err) - } - configureFunc(automationRuleClient.Client) - - automationRulesClient, err := automationrules.NewAutomationRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AutomationRules client: %+v", err) - } - configureFunc(automationRulesClient.Client) - - bookmarkClient, err := bookmark.NewBookmarkClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Bookmark client: %+v", err) - } - configureFunc(bookmarkClient.Client) - - bookmarkRelationsClient, err := bookmarkrelations.NewBookmarkRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BookmarkRelations client: %+v", err) - } - configureFunc(bookmarkRelationsClient.Client) - - bookmarksClient, err := bookmarks.NewBookmarksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Bookmarks client: %+v", err) - } - configureFunc(bookmarksClient.Client) - - checkDataConnectorRequirementsClient, err := checkdataconnectorrequirements.NewCheckDataConnectorRequirementsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CheckDataConnectorRequirements client: %+v", err) - } - configureFunc(checkDataConnectorRequirementsClient.Client) - - dataConnectorsClient, err := dataconnectors.NewDataConnectorsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectors client: %+v", err) - } - configureFunc(dataConnectorsClient.Client) - - dataConnectorsConnectClient, err := dataconnectorsconnect.NewDataConnectorsConnectClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectorsConnect client: %+v", err) - } - configureFunc(dataConnectorsConnectClient.Client) - - dataConnectorsDisconnectClient, err := dataconnectorsdisconnect.NewDataConnectorsDisconnectClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectorsDisconnect client: %+v", err) - } - configureFunc(dataConnectorsDisconnectClient.Client) - - enrichmentClient, err := enrichment.NewEnrichmentClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Enrichment client: %+v", err) - } - configureFunc(enrichmentClient.Client) - - entitiesClient, err := entities.NewEntitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Entities client: %+v", err) - } - configureFunc(entitiesClient.Client) - - entityQueriesClient, err := entityqueries.NewEntityQueriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityQueries client: %+v", err) - } - configureFunc(entityQueriesClient.Client) - - entityRelationsClient, err := entityrelations.NewEntityRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityRelations client: %+v", err) - } - configureFunc(entityRelationsClient.Client) - - entityTypesClient, err := entitytypes.NewEntityTypesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityTypes client: %+v", err) - } - configureFunc(entityTypesClient.Client) - - incidentAlertsClient, err := incidentalerts.NewIncidentAlertsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentAlerts client: %+v", err) - } - configureFunc(incidentAlertsClient.Client) - - incidentBookmarksClient, err := incidentbookmarks.NewIncidentBookmarksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentBookmarks client: %+v", err) - } - configureFunc(incidentBookmarksClient.Client) - - incidentCommentsClient, err := incidentcomments.NewIncidentCommentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentComments client: %+v", err) - } - configureFunc(incidentCommentsClient.Client) - - incidentEntitiesClient, err := incidententities.NewIncidentEntitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentEntities client: %+v", err) - } - configureFunc(incidentEntitiesClient.Client) - - incidentRelationsClient, err := incidentrelations.NewIncidentRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentRelations client: %+v", err) - } - configureFunc(incidentRelationsClient.Client) - - incidentTeamClient, err := incidentteam.NewIncidentTeamClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentTeam client: %+v", err) - } - configureFunc(incidentTeamClient.Client) - - incidentsClient, err := incidents.NewIncidentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Incidents client: %+v", err) - } - configureFunc(incidentsClient.Client) - - metadataClient, err := metadata.NewMetadataClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Metadata client: %+v", err) - } - configureFunc(metadataClient.Client) - - officeConsentsClient, err := officeconsents.NewOfficeConsentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building OfficeConsents client: %+v", err) - } - configureFunc(officeConsentsClient.Client) - - repositoriesClient, err := repositories.NewRepositoriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Repositories client: %+v", err) - } - configureFunc(repositoriesClient.Client) - - sentinelOnboardingStatesClient, err := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SentinelOnboardingStates client: %+v", err) - } - configureFunc(sentinelOnboardingStatesClient.Client) - - settingsClient, err := settings.NewSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Settings client: %+v", err) - } - configureFunc(settingsClient.Client) - - sourceControlsClient, err := sourcecontrols.NewSourceControlsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SourceControls client: %+v", err) - } - configureFunc(sourceControlsClient.Client) - - threatIntelligenceClient, err := threatintelligence.NewThreatIntelligenceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ThreatIntelligence client: %+v", err) - } - configureFunc(threatIntelligenceClient.Client) - - watchlistItemsClient, err := watchlistitems.NewWatchlistItemsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WatchlistItems client: %+v", err) - } - configureFunc(watchlistItemsClient.Client) - - watchlistsClient, err := watchlists.NewWatchlistsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Watchlists client: %+v", err) - } - configureFunc(watchlistsClient.Client) - - return &Client{ - Actions: actionsClient, - AlertRuleTemplates: alertRuleTemplatesClient, - AlertRules: alertRulesClient, - AutomationRule: automationRuleClient, - AutomationRules: automationRulesClient, - Bookmark: bookmarkClient, - BookmarkRelations: bookmarkRelationsClient, - Bookmarks: bookmarksClient, - CheckDataConnectorRequirements: checkDataConnectorRequirementsClient, - DataConnectors: dataConnectorsClient, - DataConnectorsConnect: dataConnectorsConnectClient, - DataConnectorsDisconnect: dataConnectorsDisconnectClient, - Enrichment: enrichmentClient, - Entities: entitiesClient, - EntityQueries: entityQueriesClient, - EntityRelations: entityRelationsClient, - EntityTypes: entityTypesClient, - IncidentAlerts: incidentAlertsClient, - IncidentBookmarks: incidentBookmarksClient, - IncidentComments: incidentCommentsClient, - IncidentEntities: incidentEntitiesClient, - IncidentRelations: incidentRelationsClient, - IncidentTeam: incidentTeamClient, - Incidents: incidentsClient, - Metadata: metadataClient, - OfficeConsents: officeConsentsClient, - Repositories: repositoriesClient, - SentinelOnboardingStates: sentinelOnboardingStatesClient, - Settings: settingsClient, - SourceControls: sourceControlsClient, - ThreatIntelligence: threatIntelligenceClient, - WatchlistItems: watchlistItemsClient, - Watchlists: watchlistsClient, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/README.md b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/README.md deleted file mode 100644 index 95712f433d8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/dataconnectors` Documentation - -The `dataconnectors` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/dataconnectors" -``` - - -### Client Initialization - -```go -client := dataconnectors.NewDataConnectorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataConnectorsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -payload := dataconnectors.DataConnector{ - // ... -} - - -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: `DataConnectorsClient.Delete` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -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: `DataConnectorsClient.Get` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -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: `DataConnectorsClient.List` - -```go -ctx := context.TODO() -id := dataconnectors.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/dataconnectors/client.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/client.go deleted file mode 100644 index 8ed0120c79a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectors - -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 DataConnectorsClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectors", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsClient: %+v", err) - } - - return &DataConnectorsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/constants.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/constants.go deleted file mode 100644 index 27970b1a0d1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/constants.go +++ /dev/null @@ -1,372 +0,0 @@ -package dataconnectors - -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 AvailabilityStatus int64 - -const ( - AvailabilityStatusOne AvailabilityStatus = 1 -) - -func PossibleValuesForAvailabilityStatus() []int64 { - return []int64{ - int64(AvailabilityStatusOne), - } -} - -type ConnectivityType string - -const ( - ConnectivityTypeIsConnectedQuery ConnectivityType = "IsConnectedQuery" -) - -func PossibleValuesForConnectivityType() []string { - return []string{ - string(ConnectivityTypeIsConnectedQuery), - } -} - -func (s *ConnectivityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityType(input string) (*ConnectivityType, error) { - vals := map[string]ConnectivityType{ - "isconnectedquery": ConnectivityTypeIsConnectedQuery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityType(input) - return &out, nil -} - -type DataConnectorKind string - -const ( - DataConnectorKindAPIPolling DataConnectorKind = "APIPolling" - DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" - DataConnectorKindAmazonWebServicesSThree DataConnectorKind = "AmazonWebServicesS3" - DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" - DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" - DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" - DataConnectorKindDynamicsThreeSixFive DataConnectorKind = "Dynamics365" - DataConnectorKindGenericUI DataConnectorKind = "GenericUI" - DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" - DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" - DataConnectorKindMicrosoftThreatIntelligence DataConnectorKind = "MicrosoftThreatIntelligence" - DataConnectorKindMicrosoftThreatProtection DataConnectorKind = "MicrosoftThreatProtection" - DataConnectorKindOfficeATP DataConnectorKind = "OfficeATP" - DataConnectorKindOfficeIRM DataConnectorKind = "OfficeIRM" - DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" - DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" - DataConnectorKindThreatIntelligenceTaxii DataConnectorKind = "ThreatIntelligenceTaxii" -) - -func PossibleValuesForDataConnectorKind() []string { - return []string{ - string(DataConnectorKindAPIPolling), - string(DataConnectorKindAmazonWebServicesCloudTrail), - string(DataConnectorKindAmazonWebServicesSThree), - string(DataConnectorKindAzureActiveDirectory), - string(DataConnectorKindAzureAdvancedThreatProtection), - string(DataConnectorKindAzureSecurityCenter), - string(DataConnectorKindDynamicsThreeSixFive), - string(DataConnectorKindGenericUI), - string(DataConnectorKindMicrosoftCloudAppSecurity), - string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), - string(DataConnectorKindMicrosoftThreatIntelligence), - string(DataConnectorKindMicrosoftThreatProtection), - string(DataConnectorKindOfficeATP), - string(DataConnectorKindOfficeIRM), - string(DataConnectorKindOfficeThreeSixFive), - string(DataConnectorKindThreatIntelligence), - string(DataConnectorKindThreatIntelligenceTaxii), - } -} - -func (s *DataConnectorKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorKind(input string) (*DataConnectorKind, error) { - vals := map[string]DataConnectorKind{ - "apipolling": DataConnectorKindAPIPolling, - "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, - "amazonwebservicess3": DataConnectorKindAmazonWebServicesSThree, - "azureactivedirectory": DataConnectorKindAzureActiveDirectory, - "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, - "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, - "dynamics365": DataConnectorKindDynamicsThreeSixFive, - "genericui": DataConnectorKindGenericUI, - "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, - "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, - "microsoftthreatintelligence": DataConnectorKindMicrosoftThreatIntelligence, - "microsoftthreatprotection": DataConnectorKindMicrosoftThreatProtection, - "officeatp": DataConnectorKindOfficeATP, - "officeirm": DataConnectorKindOfficeIRM, - "office365": DataConnectorKindOfficeThreeSixFive, - "threatintelligence": DataConnectorKindThreatIntelligence, - "threatintelligencetaxii": DataConnectorKindThreatIntelligenceTaxii, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorKind(input) - return &out, nil -} - -type DataTypeState string - -const ( - DataTypeStateDisabled DataTypeState = "Disabled" - DataTypeStateEnabled DataTypeState = "Enabled" -) - -func PossibleValuesForDataTypeState() []string { - return []string{ - string(DataTypeStateDisabled), - string(DataTypeStateEnabled), - } -} - -func (s *DataTypeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataTypeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataTypeState(input string) (*DataTypeState, error) { - vals := map[string]DataTypeState{ - "disabled": DataTypeStateDisabled, - "enabled": DataTypeStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataTypeState(input) - return &out, nil -} - -type PermissionProviderScope string - -const ( - PermissionProviderScopeResourceGroup PermissionProviderScope = "ResourceGroup" - PermissionProviderScopeSubscription PermissionProviderScope = "Subscription" - PermissionProviderScopeWorkspace PermissionProviderScope = "Workspace" -) - -func PossibleValuesForPermissionProviderScope() []string { - return []string{ - string(PermissionProviderScopeResourceGroup), - string(PermissionProviderScopeSubscription), - string(PermissionProviderScopeWorkspace), - } -} - -func (s *PermissionProviderScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePermissionProviderScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePermissionProviderScope(input string) (*PermissionProviderScope, error) { - vals := map[string]PermissionProviderScope{ - "resourcegroup": PermissionProviderScopeResourceGroup, - "subscription": PermissionProviderScopeSubscription, - "workspace": PermissionProviderScopeWorkspace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PermissionProviderScope(input) - return &out, nil -} - -type PollingFrequency string - -const ( - PollingFrequencyOnceADay PollingFrequency = "OnceADay" - PollingFrequencyOnceAMinute PollingFrequency = "OnceAMinute" - PollingFrequencyOnceAnHour PollingFrequency = "OnceAnHour" -) - -func PossibleValuesForPollingFrequency() []string { - return []string{ - string(PollingFrequencyOnceADay), - string(PollingFrequencyOnceAMinute), - string(PollingFrequencyOnceAnHour), - } -} - -func (s *PollingFrequency) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePollingFrequency(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePollingFrequency(input string) (*PollingFrequency, error) { - vals := map[string]PollingFrequency{ - "onceaday": PollingFrequencyOnceADay, - "onceaminute": PollingFrequencyOnceAMinute, - "onceanhour": PollingFrequencyOnceAnHour, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PollingFrequency(input) - return &out, nil -} - -type ProviderName string - -const ( - ProviderNameMicrosoftPointAuthorizationPolicyAssignments ProviderName = "Microsoft.Authorization/policyAssignments" - ProviderNameMicrosoftPointOperationalInsightsSolutions ProviderName = "Microsoft.OperationalInsights/solutions" - ProviderNameMicrosoftPointOperationalInsightsWorkspaces ProviderName = "Microsoft.OperationalInsights/workspaces" - ProviderNameMicrosoftPointOperationalInsightsWorkspacesDatasources ProviderName = "Microsoft.OperationalInsights/workspaces/datasources" - ProviderNameMicrosoftPointOperationalInsightsWorkspacesSharedKeys ProviderName = "Microsoft.OperationalInsights/workspaces/sharedKeys" - ProviderNameMicrosoftPointaadiamDiagnosticSettings ProviderName = "microsoft.aadiam/diagnosticSettings" -) - -func PossibleValuesForProviderName() []string { - return []string{ - string(ProviderNameMicrosoftPointAuthorizationPolicyAssignments), - string(ProviderNameMicrosoftPointOperationalInsightsSolutions), - string(ProviderNameMicrosoftPointOperationalInsightsWorkspaces), - string(ProviderNameMicrosoftPointOperationalInsightsWorkspacesDatasources), - string(ProviderNameMicrosoftPointOperationalInsightsWorkspacesSharedKeys), - string(ProviderNameMicrosoftPointaadiamDiagnosticSettings), - } -} - -func (s *ProviderName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProviderName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProviderName(input string) (*ProviderName, error) { - vals := map[string]ProviderName{ - "microsoft.authorization/policyassignments": ProviderNameMicrosoftPointAuthorizationPolicyAssignments, - "microsoft.operationalinsights/solutions": ProviderNameMicrosoftPointOperationalInsightsSolutions, - "microsoft.operationalinsights/workspaces": ProviderNameMicrosoftPointOperationalInsightsWorkspaces, - "microsoft.operationalinsights/workspaces/datasources": ProviderNameMicrosoftPointOperationalInsightsWorkspacesDatasources, - "microsoft.operationalinsights/workspaces/sharedkeys": ProviderNameMicrosoftPointOperationalInsightsWorkspacesSharedKeys, - "microsoft.aadiam/diagnosticsettings": ProviderNameMicrosoftPointaadiamDiagnosticSettings, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProviderName(input) - return &out, nil -} - -type SettingType string - -const ( - SettingTypeCopyableLabel SettingType = "CopyableLabel" - SettingTypeInfoMessage SettingType = "InfoMessage" - SettingTypeInstructionStepsGroup SettingType = "InstructionStepsGroup" -) - -func PossibleValuesForSettingType() []string { - return []string{ - string(SettingTypeCopyableLabel), - string(SettingTypeInfoMessage), - string(SettingTypeInstructionStepsGroup), - } -} - -func (s *SettingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingType(input string) (*SettingType, error) { - vals := map[string]SettingType{ - "copyablelabel": SettingTypeCopyableLabel, - "infomessage": SettingTypeInfoMessage, - "instructionstepsgroup": SettingTypeInstructionStepsGroup, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector.go deleted file mode 100644 index b55667aa923..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectors - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector_test.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector_test.go deleted file mode 100644 index b0bf20f7576..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectors - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2021-09-01-preview/dataconnectors/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace.go deleted file mode 100644 index 60237fcce07..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package dataconnectors - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace_test.go deleted file mode 100644 index ae4c27a844d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package dataconnectors - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/dataconnectors/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_createorupdate.go deleted file mode 100644 index c5f6e5d1503..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *DataConnector -} - -// CreateOrUpdate ... -func (c DataConnectorsClient) CreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_delete.go deleted file mode 100644 index 8461ec6d8a1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package dataconnectors - -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 DataConnectorsClient) Delete(ctx context.Context, id DataConnectorId) (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/securityinsights/2021-09-01-preview/dataconnectors/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_get.go deleted file mode 100644 index 3511ba85477..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *DataConnector -} - -// Get ... -func (c DataConnectorsClient) Get(ctx context.Context, id DataConnectorId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_list.go deleted file mode 100644 index 6975384fdee..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *[]DataConnector -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataConnector -} - -// List ... -func (c DataConnectorsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectors", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]DataConnector, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalDataConnectorImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for DataConnector (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c DataConnectorsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DataConnectorOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataConnectorsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate DataConnectorOperationPredicate) (result ListCompleteResult, err error) { - items := make([]DataConnector, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnector.go deleted file mode 100644 index dd0ca1af664..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AADDataConnector{} - -type AADDataConnector struct { - Properties *AADDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AADDataConnector{} - -func (s AADDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AADDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AADDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AADDataConnector: %+v", err) - } - decoded["kind"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AADDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnectorproperties.go deleted file mode 100644 index d5c4227265d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aaddataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnector.go deleted file mode 100644 index e1cd013bbd7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AATPDataConnector{} - -type AATPDataConnector struct { - Properties *AATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AATPDataConnector{} - -func (s AATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AATPDataConnector: %+v", err) - } - decoded["kind"] = "AzureAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnectorproperties.go deleted file mode 100644 index 4886a4a09b5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_aatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go deleted file mode 100644 index 828c4e8fdcc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertsDataTypeOfDataConnector struct { - Alerts DataConnectorDataTypeCommon `json:"alerts"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_apipollingparameters.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_apipollingparameters.go deleted file mode 100644 index dde34765e72..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_apipollingparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApiPollingParameters struct { - ConnectorUiConfig *CodelessUiConnectorConfigProperties `json:"connectorUiConfig,omitempty"` - PollingConfig *CodelessConnectorPollingConfigProperties `json:"pollingConfig,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnector.go deleted file mode 100644 index 3af09c2ff8b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = ASCDataConnector{} - -type ASCDataConnector struct { - Properties *ASCDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ASCDataConnector{} - -func (s ASCDataConnector) MarshalJSON() ([]byte, error) { - type wrapper ASCDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ASCDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ASCDataConnector: %+v", err) - } - decoded["kind"] = "AzureSecurityCenter" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ASCDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnectorproperties.go deleted file mode 100644 index ab5b1ceb172..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_ascdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ASCDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_availability.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_availability.go deleted file mode 100644 index a1d71ca3c9e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_availability.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Availability struct { - IsPreview *bool `json:"isPreview,omitempty"` - Status *AvailabilityStatus `json:"status,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnector.go deleted file mode 100644 index b0ef7fdd285..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AwsCloudTrailDataConnector{} - -type AwsCloudTrailDataConnector struct { - Properties *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AwsCloudTrailDataConnector{} - -func (s AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AwsCloudTrailDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsCloudTrailDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsCloudTrailDataConnector: %+v", err) - } - decoded["kind"] = "AmazonWebServicesCloudTrail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsCloudTrailDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go deleted file mode 100644 index f3be18e87d9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorDataTypes struct { - Logs DataConnectorDataTypeCommon `json:"logs"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go deleted file mode 100644 index c9fe4b9a3e5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorProperties struct { - AwsRoleArn *string `json:"awsRoleArn,omitempty"` - DataTypes AwsCloudTrailDataConnectorDataTypes `json:"dataTypes"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnector.go deleted file mode 100644 index 35e5dc2aa8b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AwsS3DataConnector{} - -type AwsS3DataConnector struct { - Properties *AwsS3DataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AwsS3DataConnector{} - -func (s AwsS3DataConnector) MarshalJSON() ([]byte, error) { - type wrapper AwsS3DataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsS3DataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsS3DataConnector: %+v", err) - } - decoded["kind"] = "AmazonWebServicesS3" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsS3DataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go deleted file mode 100644 index 86bc3d59e89..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsS3DataConnectorDataTypes struct { - Logs DataConnectorDataTypeCommon `json:"logs"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectorproperties.go deleted file mode 100644 index cfa37011a38..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_awss3dataconnectorproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsS3DataConnectorProperties struct { - DataTypes AwsS3DataConnectorDataTypes `json:"dataTypes"` - DestinationTable string `json:"destinationTable"` - RoleArn string `json:"roleArn"` - SqsUrls []string `json:"sqsUrls"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessapipollingdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessapipollingdataconnector.go deleted file mode 100644 index 3f6e413fc6e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessapipollingdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = CodelessApiPollingDataConnector{} - -type CodelessApiPollingDataConnector struct { - Properties *ApiPollingParameters `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CodelessApiPollingDataConnector{} - -func (s CodelessApiPollingDataConnector) MarshalJSON() ([]byte, error) { - type wrapper CodelessApiPollingDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CodelessApiPollingDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CodelessApiPollingDataConnector: %+v", err) - } - decoded["kind"] = "APIPolling" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CodelessApiPollingDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go deleted file mode 100644 index 5330433a026..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go +++ /dev/null @@ -1,20 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingAuthProperties struct { - ApiKeyIdentifier *string `json:"apiKeyIdentifier,omitempty"` - ApiKeyName *string `json:"apiKeyName,omitempty"` - AuthType string `json:"authType"` - AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` - AuthorizationEndpointQueryParameters *interface{} `json:"authorizationEndpointQueryParameters,omitempty"` - FlowName *string `json:"flowName,omitempty"` - IsApiKeyInPostPayload *string `json:"isApiKeyInPostPayload,omitempty"` - IsClientSecretInHeader *bool `json:"isClientSecretInHeader,omitempty"` - RedirectionEndpoint *string `json:"redirectionEndpoint,omitempty"` - Scope *string `json:"scope,omitempty"` - TokenEndpoint *string `json:"tokenEndpoint,omitempty"` - TokenEndpointHeaders *interface{} `json:"tokenEndpointHeaders,omitempty"` - TokenEndpointQueryParameters *interface{} `json:"tokenEndpointQueryParameters,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go deleted file mode 100644 index 43d86fb8eea..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingConfigProperties struct { - Auth CodelessConnectorPollingAuthProperties `json:"auth"` - IsActive *bool `json:"isActive,omitempty"` - Paging *CodelessConnectorPollingPagingProperties `json:"paging,omitempty"` - Request CodelessConnectorPollingRequestProperties `json:"request"` - Response *CodelessConnectorPollingResponseProperties `json:"response,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go deleted file mode 100644 index 6e8f0c486a8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingPagingProperties struct { - NextPageParaName *string `json:"nextPageParaName,omitempty"` - NextPageTokenJsonPath *string `json:"nextPageTokenJsonPath,omitempty"` - PageCountAttributePath *string `json:"pageCountAttributePath,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - PageSizeParaName *string `json:"pageSizeParaName,omitempty"` - PageTimeStampAttributePath *string `json:"pageTimeStampAttributePath,omitempty"` - PageTotalCountAttributePath *string `json:"pageTotalCountAttributePath,omitempty"` - PagingType string `json:"pagingType"` - SearchTheLatestTimeStampFromEventsList *string `json:"searchTheLatestTimeStampFromEventsList,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go deleted file mode 100644 index dd2ec1067de..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingRequestProperties struct { - ApiEndpoint string `json:"apiEndpoint"` - EndTimeAttributeName *string `json:"endTimeAttributeName,omitempty"` - HTTPMethod string `json:"httpMethod"` - Headers *interface{} `json:"headers,omitempty"` - QueryParameters *interface{} `json:"queryParameters,omitempty"` - QueryParametersTemplate *string `json:"queryParametersTemplate,omitempty"` - QueryTimeFormat string `json:"queryTimeFormat"` - QueryWindowInMin int64 `json:"queryWindowInMin"` - RateLimitQps *int64 `json:"rateLimitQps,omitempty"` - RetryCount *int64 `json:"retryCount,omitempty"` - StartTimeAttributeName *string `json:"startTimeAttributeName,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go deleted file mode 100644 index 0a503e2087c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingResponseProperties struct { - EventsJsonPaths []string `json:"eventsJsonPaths"` - IsGzipCompressed *bool `json:"isGzipCompressed,omitempty"` - SuccessStatusJsonPath *string `json:"successStatusJsonPath,omitempty"` - SuccessStatusValue *string `json:"successStatusValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessparameters.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessparameters.go deleted file mode 100644 index b6488edc786..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessParameters struct { - ConnectorUiConfig *CodelessUiConnectorConfigProperties `json:"connectorUiConfig,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go deleted file mode 100644 index 8e6d34a8748..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessUiConnectorConfigProperties struct { - Availability Availability `json:"availability"` - ConnectivityCriteria []ConnectivityCriteria `json:"connectivityCriteria"` - CustomImage *string `json:"customImage,omitempty"` - DataTypes []LastDataReceivedDataType `json:"dataTypes"` - DescriptionMarkdown string `json:"descriptionMarkdown"` - GraphQueries []GraphQueries `json:"graphQueries"` - GraphQueriesTableName string `json:"graphQueriesTableName"` - InstructionSteps []InstructionSteps `json:"instructionSteps"` - Permissions Permissions `json:"permissions"` - Publisher string `json:"publisher"` - SampleQueries []SampleQueries `json:"sampleQueries"` - Title string `json:"title"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuidataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuidataconnector.go deleted file mode 100644 index 4a43012e878..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_codelessuidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = CodelessUiDataConnector{} - -type CodelessUiDataConnector struct { - Properties *CodelessParameters `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CodelessUiDataConnector{} - -func (s CodelessUiDataConnector) MarshalJSON() ([]byte, error) { - type wrapper CodelessUiDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CodelessUiDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CodelessUiDataConnector: %+v", err) - } - decoded["kind"] = "GenericUI" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CodelessUiDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectivitycriteria.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectivitycriteria.go deleted file mode 100644 index d5c31487bb6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectivitycriteria.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityCriteria struct { - Type *ConnectivityType `json:"type,omitempty"` - Value *[]string `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectorinstructionmodelbase.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectorinstructionmodelbase.go deleted file mode 100644 index a1ee46edca1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_connectorinstructionmodelbase.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectorInstructionModelBase struct { - Parameters *interface{} `json:"parameters,omitempty"` - Type SettingType `json:"type"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_customspermission.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_customspermission.go deleted file mode 100644 index 542dfa8eeb0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_customspermission.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomsPermission struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnector.go deleted file mode 100644 index ffa116c306f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnector.go +++ /dev/null @@ -1,181 +0,0 @@ -package dataconnectors - -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 DataConnector interface { -} - -// RawDataConnectorImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawDataConnectorImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalDataConnectorImplementation(input []byte) (DataConnector, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling DataConnector into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out AADDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AADDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureAdvancedThreatProtection") { - var out AATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureSecurityCenter") { - var out ASCDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ASCDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { - var out AwsCloudTrailDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsCloudTrailDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesS3") { - var out AwsS3DataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsS3DataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "APIPolling") { - var out CodelessApiPollingDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CodelessApiPollingDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "GenericUI") { - var out CodelessUiDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CodelessUiDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Dynamics365") { - var out Dynamics365DataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Dynamics365DataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { - var out MCASDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MCASDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { - var out MDATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MDATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatIntelligence") { - var out MSTIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MSTIDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatProtection") { - var out MTPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MTPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeATP") { - var out OfficeATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Office365") { - var out OfficeDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeIRM") { - var out OfficeIRMDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeIRMDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out TIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TIDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligenceTaxii") { - var out TiTaxiiDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TiTaxiiDataConnector: %+v", err) - } - return out, nil - } - - out := RawDataConnectorImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnectordatatypecommon.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnectordatatypecommon.go deleted file mode 100644 index 806cc9a7617..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dataconnectordatatypecommon.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorDataTypeCommon struct { - State DataTypeState `json:"state"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnector.go deleted file mode 100644 index b740152afaa..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = Dynamics365DataConnector{} - -type Dynamics365DataConnector struct { - Properties *Dynamics365DataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Dynamics365DataConnector{} - -func (s Dynamics365DataConnector) MarshalJSON() ([]byte, error) { - type wrapper Dynamics365DataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Dynamics365DataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Dynamics365DataConnector: %+v", err) - } - decoded["kind"] = "Dynamics365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Dynamics365DataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go deleted file mode 100644 index 9a78f866c2b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Dynamics365DataConnectorDataTypes struct { - Dynamics365CdsActivities DataConnectorDataTypeCommon `json:"dynamics365CdsActivities"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go deleted file mode 100644 index 61901044697..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Dynamics365DataConnectorProperties struct { - DataTypes Dynamics365DataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_graphqueries.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_graphqueries.go deleted file mode 100644 index 81d0f434bc6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_graphqueries.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GraphQueries struct { - BaseQuery *string `json:"baseQuery,omitempty"` - Legend *string `json:"legend,omitempty"` - MetricName *string `json:"metricName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_instructionsteps.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_instructionsteps.go deleted file mode 100644 index 98a7ca179fe..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_instructionsteps.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InstructionSteps struct { - Description *string `json:"description,omitempty"` - Instructions *[]ConnectorInstructionModelBase `json:"instructions,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_lastdatareceiveddatatype.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_lastdatareceiveddatatype.go deleted file mode 100644 index 79f8e89e298..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_lastdatareceiveddatatype.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LastDataReceivedDataType struct { - LastDataReceivedQuery *string `json:"lastDataReceivedQuery,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnector.go deleted file mode 100644 index 6a0c9aebea0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MCASDataConnector{} - -type MCASDataConnector struct { - Properties *MCASDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MCASDataConnector{} - -func (s MCASDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MCASDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MCASDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MCASDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftCloudAppSecurity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MCASDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go deleted file mode 100644 index f633e0281ca..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorDataTypes struct { - Alerts DataConnectorDataTypeCommon `json:"alerts"` - DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectorproperties.go deleted file mode 100644 index 0eac613483f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mcasdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorProperties struct { - DataTypes MCASDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnector.go deleted file mode 100644 index 1a6bcbcb7bf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MDATPDataConnector{} - -type MDATPDataConnector struct { - Properties *MDATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MDATPDataConnector{} - -func (s MDATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MDATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MDATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MDATPDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MDATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go deleted file mode 100644 index bc07670068a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MDATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnector.go deleted file mode 100644 index 471a195af16..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MSTIDataConnector{} - -type MSTIDataConnector struct { - Properties *MSTIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MSTIDataConnector{} - -func (s MSTIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MSTIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MSTIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MSTIDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MSTIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypes.go deleted file mode 100644 index 0e6f3ae0313..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypes.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorDataTypes struct { - BingSafetyPhishingURL MSTIDataConnectorDataTypesBingSafetyPhishingURL `json:"bingSafetyPhishingURL"` - MicrosoftEmergingThreatFeed MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed `json:"microsoftEmergingThreatFeed"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go deleted file mode 100644 index c98b44400fa..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorDataTypesBingSafetyPhishingURL struct { - LookbackPeriod string `json:"lookbackPeriod"` - State *DataTypeState `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go deleted file mode 100644 index 95ed0316af1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed struct { - LookbackPeriod string `json:"lookbackPeriod"` - State *DataTypeState `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectorproperties.go deleted file mode 100644 index 6c3df2d05af..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mstidataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorProperties struct { - DataTypes MSTIDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnector.go deleted file mode 100644 index 080b901963a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MTPDataConnector{} - -type MTPDataConnector struct { - Properties *MTPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MTPDataConnector{} - -func (s MTPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MTPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MTPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MTPDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MTPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go deleted file mode 100644 index 942617f157f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MTPDataConnectorDataTypes struct { - Incidents DataConnectorDataTypeCommon `json:"incidents"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectorproperties.go deleted file mode 100644 index 9cc41e37181..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_mtpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MTPDataConnectorProperties struct { - DataTypes MTPDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnector.go deleted file mode 100644 index 40b24a90da2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeATPDataConnector{} - -type OfficeATPDataConnector struct { - Properties *OfficeATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeATPDataConnector{} - -func (s OfficeATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeATPDataConnector: %+v", err) - } - decoded["kind"] = "OfficeATP" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go deleted file mode 100644 index c6e4346b9a8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnector.go deleted file mode 100644 index 25b5a25e44d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeDataConnector{} - -type OfficeDataConnector struct { - Properties *OfficeDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeDataConnector{} - -func (s OfficeDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeDataConnector: %+v", err) - } - decoded["kind"] = "Office365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectordatatypes.go deleted file mode 100644 index c0d05c1618a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectordatatypes.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorDataTypes struct { - Exchange DataConnectorDataTypeCommon `json:"exchange"` - SharePoint DataConnectorDataTypeCommon `json:"sharePoint"` - Teams DataConnectorDataTypeCommon `json:"teams"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectorproperties.go deleted file mode 100644 index a135cc86148..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officedataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorProperties struct { - DataTypes OfficeDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnector.go deleted file mode 100644 index 437b746ebb4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeIRMDataConnector{} - -type OfficeIRMDataConnector struct { - Properties *OfficeIRMDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeIRMDataConnector{} - -func (s OfficeIRMDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeIRMDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeIRMDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeIRMDataConnector: %+v", err) - } - decoded["kind"] = "OfficeIRM" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeIRMDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go deleted file mode 100644 index 65193bbf5f9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeIRMDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_permissions.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_permissions.go deleted file mode 100644 index 221596eb052..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_permissions.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Permissions struct { - Customs *[]CustomsPermission `json:"customs,omitempty"` - ResourceProvider *[]ResourceProvider `json:"resourceProvider,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_requiredpermissions.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_requiredpermissions.go deleted file mode 100644 index 0bfc2723478..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_requiredpermissions.go +++ /dev/null @@ -1,11 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RequiredPermissions struct { - Action *bool `json:"action,omitempty"` - Delete *bool `json:"delete,omitempty"` - Read *bool `json:"read,omitempty"` - Write *bool `json:"write,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_resourceprovider.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_resourceprovider.go deleted file mode 100644 index b4b18e6a50b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_resourceprovider.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceProvider struct { - PermissionsDisplayText *string `json:"permissionsDisplayText,omitempty"` - Provider *ProviderName `json:"provider,omitempty"` - ProviderDisplayName *string `json:"providerDisplayName,omitempty"` - RequiredPermissions *RequiredPermissions `json:"requiredPermissions,omitempty"` - Scope *PermissionProviderScope `json:"scope,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_samplequeries.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_samplequeries.go deleted file mode 100644 index de648bd4da0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_samplequeries.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SampleQueries struct { - Description *string `json:"description,omitempty"` - Query *string `json:"query,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnector.go deleted file mode 100644 index 208513ef9aa..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = TIDataConnector{} - -type TIDataConnector struct { - Properties *TIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = TIDataConnector{} - -func (s TIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper TIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TIDataConnector: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectordatatypes.go deleted file mode 100644 index 0efba3951c0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TIDataConnectorDataTypes struct { - Indicators DataConnectorDataTypeCommon `json:"indicators"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectorproperties.go deleted file mode 100644 index 4676a657b95..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_tidataconnectorproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package dataconnectors - -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 TIDataConnectorProperties struct { - DataTypes TIDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` - TipLookbackPeriod *string `json:"tipLookbackPeriod,omitempty"` -} - -func (o *TIDataConnectorProperties) GetTipLookbackPeriodAsTime() (*time.Time, error) { - if o.TipLookbackPeriod == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TipLookbackPeriod, "2006-01-02T15:04:05Z07:00") -} - -func (o *TIDataConnectorProperties) SetTipLookbackPeriodAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TipLookbackPeriod = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnector.go deleted file mode 100644 index 1fa870a4d34..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = TiTaxiiDataConnector{} - -type TiTaxiiDataConnector struct { - Properties *TiTaxiiDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = TiTaxiiDataConnector{} - -func (s TiTaxiiDataConnector) MarshalJSON() ([]byte, error) { - type wrapper TiTaxiiDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TiTaxiiDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TiTaxiiDataConnector: %+v", err) - } - decoded["kind"] = "ThreatIntelligenceTaxii" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TiTaxiiDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go deleted file mode 100644 index dd07879f714..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TiTaxiiDataConnectorDataTypes struct { - TaxiiClient DataConnectorDataTypeCommon `json:"taxiiClient"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go deleted file mode 100644 index 6f39b02fa3e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go +++ /dev/null @@ -1,35 +0,0 @@ -package dataconnectors - -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 TiTaxiiDataConnectorProperties struct { - CollectionId *string `json:"collectionId,omitempty"` - DataTypes TiTaxiiDataConnectorDataTypes `json:"dataTypes"` - FriendlyName *string `json:"friendlyName,omitempty"` - Password *string `json:"password,omitempty"` - PollingFrequency PollingFrequency `json:"pollingFrequency"` - TaxiiLookbackPeriod *string `json:"taxiiLookbackPeriod,omitempty"` - TaxiiServer *string `json:"taxiiServer,omitempty"` - TenantId string `json:"tenantId"` - UserName *string `json:"userName,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} - -func (o *TiTaxiiDataConnectorProperties) GetTaxiiLookbackPeriodAsTime() (*time.Time, error) { - if o.TaxiiLookbackPeriod == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TaxiiLookbackPeriod, "2006-01-02T15:04:05Z07:00") -} - -func (o *TiTaxiiDataConnectorProperties) SetTaxiiLookbackPeriodAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TaxiiLookbackPeriod = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/predicates.go deleted file mode 100644 index 4521c20e58e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorOperationPredicate struct { -} - -func (p DataConnectorOperationPredicate) Matches(input DataConnector) bool { - - return true -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/version.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/version.go deleted file mode 100644 index c524d3bb9af..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectors/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/README.md b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/README.md deleted file mode 100644 index 93dfb8c0f6f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect` Documentation - -The `dataconnectorsconnect` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/dataconnectorsconnect" -``` - - -### Client Initialization - -```go -client := dataconnectorsconnect.NewDataConnectorsConnectClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataConnectorsConnectClient.DataConnectorsConnect` - -```go -ctx := context.TODO() -id := dataconnectorsconnect.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -payload := dataconnectorsconnect.DataConnectorConnectBody{ - // ... -} - - -read, err := client.DataConnectorsConnect(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/securityinsights/2021-09-01-preview/dataconnectorsconnect/client.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/client.go deleted file mode 100644 index f4ed6b1fb50..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectorsconnect - -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 DataConnectorsConnectClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsConnectClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsConnectClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectorsconnect", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsConnectClient: %+v", err) - } - - return &DataConnectorsConnectClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/constants.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/constants.go deleted file mode 100644 index a5b7f1713ca..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package dataconnectorsconnect - -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 ConnectAuthKind string - -const ( - ConnectAuthKindAPIKey ConnectAuthKind = "APIKey" - ConnectAuthKindBasic ConnectAuthKind = "Basic" - ConnectAuthKindOAuthTwo ConnectAuthKind = "OAuth2" -) - -func PossibleValuesForConnectAuthKind() []string { - return []string{ - string(ConnectAuthKindAPIKey), - string(ConnectAuthKindBasic), - string(ConnectAuthKindOAuthTwo), - } -} - -func (s *ConnectAuthKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectAuthKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectAuthKind(input string) (*ConnectAuthKind, error) { - vals := map[string]ConnectAuthKind{ - "apikey": ConnectAuthKindAPIKey, - "basic": ConnectAuthKindBasic, - "oauth2": ConnectAuthKindOAuthTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectAuthKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector.go deleted file mode 100644 index 391c5b0f0a4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectorsconnect - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector_test.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector_test.go deleted file mode 100644 index 8c9e935552b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectorsconnect - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2021-09-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go deleted file mode 100644 index 50018e5b900..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go +++ /dev/null @@ -1,51 +0,0 @@ -package dataconnectorsconnect - -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 DataConnectorsConnectOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// DataConnectorsConnect ... -func (c DataConnectorsConnectClient) DataConnectorsConnect(ctx context.Context, id DataConnectorId, input DataConnectorConnectBody) (result DataConnectorsConnectOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/connect", 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/securityinsights/2021-09-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go deleted file mode 100644 index fd8d8ef9426..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go +++ /dev/null @@ -1,15 +0,0 @@ -package dataconnectorsconnect - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorConnectBody struct { - ApiKey *string `json:"apiKey,omitempty"` - AuthorizationCode *string `json:"authorizationCode,omitempty"` - ClientId *string `json:"clientId,omitempty"` - ClientSecret *string `json:"clientSecret,omitempty"` - Kind *ConnectAuthKind `json:"kind,omitempty"` - Password *string `json:"password,omitempty"` - RequestConfigUserInputValues *[]interface{} `json:"requestConfigUserInputValues,omitempty"` - UserName *string `json:"userName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/version.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/version.go deleted file mode 100644 index 0acd93fd9cc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsconnect/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectorsconnect - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectorsconnect/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/client.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/client.go deleted file mode 100644 index 57ec64abb3c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectorsdisconnect - -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 DataConnectorsDisconnectClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsDisconnectClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsDisconnectClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectorsdisconnect", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsDisconnectClient: %+v", err) - } - - return &DataConnectorsDisconnectClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector.go deleted file mode 100644 index 90646640e53..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectorsdisconnect - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go deleted file mode 100644 index 5db0a89adeb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectorsdisconnect - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go deleted file mode 100644 index 2a883a2c958..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go +++ /dev/null @@ -1,47 +0,0 @@ -package dataconnectorsdisconnect - -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 DataConnectorsDisconnectOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// DataConnectorsDisconnect ... -func (c DataConnectorsDisconnectClient) DataConnectorsDisconnect(ctx context.Context, id DataConnectorId) (result DataConnectorsDisconnectOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnect", 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/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/version.go b/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/version.go deleted file mode 100644 index 0bfd28d45fb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/dataconnectorsdisconnect/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectorsdisconnect - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectorsdisconnect/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/README.md b/resource-manager/securityinsights/2021-09-01-preview/enrichment/README.md deleted file mode 100644 index ecd59eebdf4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/enrichment` Documentation - -The `enrichment` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/enrichment" -``` - - -### Client Initialization - -```go -client := enrichment.NewEnrichmentClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EnrichmentClient.DomainWhoisGet` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.DomainWhoisGet(ctx, id, enrichment.DefaultDomainWhoisGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EnrichmentClient.IPGeodataGet` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.IPGeodataGet(ctx, id, enrichment.DefaultIPGeodataGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/client.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/client.go deleted file mode 100644 index f60a3bef882..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package enrichment - -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 EnrichmentClient struct { - Client *resourcemanager.Client -} - -func NewEnrichmentClientWithBaseURI(sdkApi sdkEnv.Api) (*EnrichmentClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "enrichment", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EnrichmentClient: %+v", err) - } - - return &EnrichmentClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/method_domainwhoisget.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/method_domainwhoisget.go deleted file mode 100644 index 8cc4521e221..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/method_domainwhoisget.go +++ /dev/null @@ -1,84 +0,0 @@ -package enrichment - -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 DomainWhoisGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EnrichmentDomainWhois -} - -type DomainWhoisGetOperationOptions struct { - Domain *string -} - -func DefaultDomainWhoisGetOperationOptions() DomainWhoisGetOperationOptions { - return DomainWhoisGetOperationOptions{} -} - -func (o DomainWhoisGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DomainWhoisGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o DomainWhoisGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Domain != nil { - out.Append("domain", fmt.Sprintf("%v", *o.Domain)) - } - return &out -} - -// DomainWhoisGet ... -func (c EnrichmentClient) DomainWhoisGet(ctx context.Context, id commonids.ResourceGroupId, options DomainWhoisGetOperationOptions) (result DomainWhoisGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/enrichment/domain/whois", id.ID()), - OptionsObject: options, - } - - 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 EnrichmentDomainWhois - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/method_ipgeodataget.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/method_ipgeodataget.go deleted file mode 100644 index 52d80129385..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/method_ipgeodataget.go +++ /dev/null @@ -1,84 +0,0 @@ -package enrichment - -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 IPGeodataGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EnrichmentIPGeodata -} - -type IPGeodataGetOperationOptions struct { - IPAddress *string -} - -func DefaultIPGeodataGetOperationOptions() IPGeodataGetOperationOptions { - return IPGeodataGetOperationOptions{} -} - -func (o IPGeodataGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IPGeodataGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IPGeodataGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPAddress != nil { - out.Append("ipAddress", fmt.Sprintf("%v", *o.IPAddress)) - } - return &out -} - -// IPGeodataGet ... -func (c EnrichmentClient) IPGeodataGet(ctx context.Context, id commonids.ResourceGroupId, options IPGeodataGetOperationOptions) (result IPGeodataGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/enrichment/ip/geodata", id.ID()), - OptionsObject: options, - } - - 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 EnrichmentIPGeodata - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhois.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhois.go deleted file mode 100644 index b5e57fcd1bb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhois.go +++ /dev/null @@ -1,55 +0,0 @@ -package enrichment - -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 EnrichmentDomainWhois struct { - Created *string `json:"created,omitempty"` - Domain *string `json:"domain,omitempty"` - Expires *string `json:"expires,omitempty"` - ParsedWhois *EnrichmentDomainWhoisDetails `json:"parsedWhois,omitempty"` - Server *string `json:"server,omitempty"` - Updated *string `json:"updated,omitempty"` -} - -func (o *EnrichmentDomainWhois) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *EnrichmentDomainWhois) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *EnrichmentDomainWhois) GetExpiresAsTime() (*time.Time, error) { - if o.Expires == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Expires, "2006-01-02T15:04:05Z07:00") -} - -func (o *EnrichmentDomainWhois) SetExpiresAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Expires = &formatted -} - -func (o *EnrichmentDomainWhois) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *EnrichmentDomainWhois) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go deleted file mode 100644 index a1fe6efda9c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go +++ /dev/null @@ -1,17 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisContact struct { - City *string `json:"city,omitempty"` - Country *string `json:"country,omitempty"` - Email *string `json:"email,omitempty"` - Fax *string `json:"fax,omitempty"` - Name *string `json:"name,omitempty"` - Org *string `json:"org,omitempty"` - Phone *string `json:"phone,omitempty"` - Postal *string `json:"postal,omitempty"` - State *string `json:"state,omitempty"` - Street *[]string `json:"street,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go deleted file mode 100644 index 9825906696c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go +++ /dev/null @@ -1,11 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisContacts struct { - Admin *EnrichmentDomainWhoisContact `json:"admin,omitempty"` - Billing *EnrichmentDomainWhoisContact `json:"billing,omitempty"` - Registrant *EnrichmentDomainWhoisContact `json:"registrant,omitempty"` - Tech *EnrichmentDomainWhoisContact `json:"tech,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go deleted file mode 100644 index e9125217c09..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go +++ /dev/null @@ -1,11 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisDetails struct { - Contacts *EnrichmentDomainWhoisContacts `json:"contacts,omitempty"` - NameServers *[]string `json:"nameServers,omitempty"` - Registrar *EnrichmentDomainWhoisRegistrarDetails `json:"registrar,omitempty"` - Statuses *[]string `json:"statuses,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go deleted file mode 100644 index 43273bd44c2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go +++ /dev/null @@ -1,13 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisRegistrarDetails struct { - AbuseContactEmail *string `json:"abuseContactEmail,omitempty"` - AbuseContactPhone *string `json:"abuseContactPhone,omitempty"` - IanaId *string `json:"ianaId,omitempty"` - Name *string `json:"name,omitempty"` - Url *string `json:"url,omitempty"` - WhoisServer *string `json:"whoisServer,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentipgeodata.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentipgeodata.go deleted file mode 100644 index 38f645e8a46..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/model_enrichmentipgeodata.go +++ /dev/null @@ -1,24 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentIPGeodata struct { - Asn *string `json:"asn,omitempty"` - Carrier *string `json:"carrier,omitempty"` - City *string `json:"city,omitempty"` - CityCf *int64 `json:"cityCf,omitempty"` - Continent *string `json:"continent,omitempty"` - Country *string `json:"country,omitempty"` - CountryCf *int64 `json:"countryCf,omitempty"` - IPAddr *string `json:"ipAddr,omitempty"` - IPRoutingType *string `json:"ipRoutingType,omitempty"` - Latitude *string `json:"latitude,omitempty"` - Longitude *string `json:"longitude,omitempty"` - Organization *string `json:"organization,omitempty"` - OrganizationType *string `json:"organizationType,omitempty"` - Region *string `json:"region,omitempty"` - State *string `json:"state,omitempty"` - StateCf *int64 `json:"stateCf,omitempty"` - StateCode *string `json:"stateCode,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/enrichment/version.go b/resource-manager/securityinsights/2021-09-01-preview/enrichment/version.go deleted file mode 100644 index cb2745ff1e9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/enrichment/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package enrichment - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/enrichment/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/README.md b/resource-manager/securityinsights/2021-09-01-preview/entities/README.md deleted file mode 100644 index 8c101f04554..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/README.md +++ /dev/null @@ -1,132 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entities` Documentation - -The `entities` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/entities" -``` - - -### Client Initialization - -```go -client := entities.NewEntitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EntitiesClient.Expand` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -payload := entities.EntityExpandParameters{ - // ... -} - - -read, err := client.Expand(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntitiesClient.Get` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -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: `EntitiesClient.GetInsights` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -payload := entities.EntityGetInsightsParameters{ - // ... -} - - -read, err := client.GetInsights(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntitiesClient.GetTimelinelist` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -payload := entities.EntityTimelineParameters{ - // ... -} - - -read, err := client.GetTimelinelist(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntitiesClient.List` - -```go -ctx := context.TODO() -id := entities.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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: `EntitiesClient.Queries` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -read, err := client.Queries(ctx, id, entities.DefaultQueriesOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/client.go b/resource-manager/securityinsights/2021-09-01-preview/entities/client.go deleted file mode 100644 index 69f26c8d7e5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entities - -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 EntitiesClient struct { - Client *resourcemanager.Client -} - -func NewEntitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntitiesClient: %+v", err) - } - - return &EntitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/constants.go b/resource-manager/securityinsights/2021-09-01-preview/entities/constants.go deleted file mode 100644 index ff63a867e77..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/constants.go +++ /dev/null @@ -1,464 +0,0 @@ -package entities - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type EntityItemQueryKind string - -const ( - EntityItemQueryKindInsight EntityItemQueryKind = "Insight" -) - -func PossibleValuesForEntityItemQueryKind() []string { - return []string{ - string(EntityItemQueryKindInsight), - } -} - -func (s *EntityItemQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityItemQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityItemQueryKind(input string) (*EntityItemQueryKind, error) { - vals := map[string]EntityItemQueryKind{ - "insight": EntityItemQueryKindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityItemQueryKind(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type EntityQueryKind string - -const ( - EntityQueryKindActivity EntityQueryKind = "Activity" - EntityQueryKindExpansion EntityQueryKind = "Expansion" - EntityQueryKindInsight EntityQueryKind = "Insight" -) - -func PossibleValuesForEntityQueryKind() []string { - return []string{ - string(EntityQueryKindActivity), - string(EntityQueryKindExpansion), - string(EntityQueryKindInsight), - } -} - -func (s *EntityQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityQueryKind(input string) (*EntityQueryKind, error) { - vals := map[string]EntityQueryKind{ - "activity": EntityQueryKindActivity, - "expansion": EntityQueryKindExpansion, - "insight": EntityQueryKindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityQueryKind(input) - return &out, nil -} - -type EntityTimelineKind string - -const ( - EntityTimelineKindActivity EntityTimelineKind = "Activity" - EntityTimelineKindBookmark EntityTimelineKind = "Bookmark" - EntityTimelineKindSecurityAlert EntityTimelineKind = "SecurityAlert" -) - -func PossibleValuesForEntityTimelineKind() []string { - return []string{ - string(EntityTimelineKindActivity), - string(EntityTimelineKindBookmark), - string(EntityTimelineKindSecurityAlert), - } -} - -func (s *EntityTimelineKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityTimelineKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityTimelineKind(input string) (*EntityTimelineKind, error) { - vals := map[string]EntityTimelineKind{ - "activity": EntityTimelineKindActivity, - "bookmark": EntityTimelineKindBookmark, - "securityalert": EntityTimelineKindSecurityAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityTimelineKind(input) - return &out, nil -} - -type EntityType string - -const ( - EntityTypeAccount EntityType = "Account" - EntityTypeAzureResource EntityType = "AzureResource" - EntityTypeCloudApplication EntityType = "CloudApplication" - EntityTypeDNS EntityType = "DNS" - EntityTypeFile EntityType = "File" - EntityTypeFileHash EntityType = "FileHash" - EntityTypeHost EntityType = "Host" - EntityTypeHuntingBookmark EntityType = "HuntingBookmark" - EntityTypeIP EntityType = "IP" - EntityTypeIoTDevice EntityType = "IoTDevice" - EntityTypeMailCluster EntityType = "MailCluster" - EntityTypeMailMessage EntityType = "MailMessage" - EntityTypeMailbox EntityType = "Mailbox" - EntityTypeMalware EntityType = "Malware" - EntityTypeProcess EntityType = "Process" - EntityTypeRegistryKey EntityType = "RegistryKey" - EntityTypeRegistryValue EntityType = "RegistryValue" - EntityTypeSecurityAlert EntityType = "SecurityAlert" - EntityTypeSecurityGroup EntityType = "SecurityGroup" - EntityTypeSubmissionMail EntityType = "SubmissionMail" - EntityTypeURL EntityType = "URL" -) - -func PossibleValuesForEntityType() []string { - return []string{ - string(EntityTypeAccount), - string(EntityTypeAzureResource), - string(EntityTypeCloudApplication), - string(EntityTypeDNS), - string(EntityTypeFile), - string(EntityTypeFileHash), - string(EntityTypeHost), - string(EntityTypeHuntingBookmark), - string(EntityTypeIP), - string(EntityTypeIoTDevice), - string(EntityTypeMailCluster), - string(EntityTypeMailMessage), - string(EntityTypeMailbox), - string(EntityTypeMalware), - string(EntityTypeProcess), - string(EntityTypeRegistryKey), - string(EntityTypeRegistryValue), - string(EntityTypeSecurityAlert), - string(EntityTypeSecurityGroup), - string(EntityTypeSubmissionMail), - string(EntityTypeURL), - } -} - -func (s *EntityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityType(input string) (*EntityType, error) { - vals := map[string]EntityType{ - "account": EntityTypeAccount, - "azureresource": EntityTypeAzureResource, - "cloudapplication": EntityTypeCloudApplication, - "dns": EntityTypeDNS, - "file": EntityTypeFile, - "filehash": EntityTypeFileHash, - "host": EntityTypeHost, - "huntingbookmark": EntityTypeHuntingBookmark, - "ip": EntityTypeIP, - "iotdevice": EntityTypeIoTDevice, - "mailcluster": EntityTypeMailCluster, - "mailmessage": EntityTypeMailMessage, - "mailbox": EntityTypeMailbox, - "malware": EntityTypeMalware, - "process": EntityTypeProcess, - "registrykey": EntityTypeRegistryKey, - "registryvalue": EntityTypeRegistryValue, - "securityalert": EntityTypeSecurityAlert, - "securitygroup": EntityTypeSecurityGroup, - "submissionmail": EntityTypeSubmissionMail, - "url": EntityTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityType(input) - return &out, nil -} - -type Kind string - -const ( - KindInsight Kind = "Insight" -) - -func PossibleValuesForKind() []string { - return []string{ - string(KindInsight), - } -} - -func (s *Kind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKind(input string) (*Kind, error) { - vals := map[string]Kind{ - "insight": KindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Kind(input) - return &out, nil -} - -type OutputType string - -const ( - OutputTypeDate OutputType = "Date" - OutputTypeEntity OutputType = "Entity" - OutputTypeNumber OutputType = "Number" - OutputTypeString OutputType = "String" -) - -func PossibleValuesForOutputType() []string { - return []string{ - string(OutputTypeDate), - string(OutputTypeEntity), - string(OutputTypeNumber), - string(OutputTypeString), - } -} - -func (s *OutputType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOutputType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOutputType(input string) (*OutputType, error) { - vals := map[string]OutputType{ - "date": OutputTypeDate, - "entity": OutputTypeEntity, - "number": OutputTypeNumber, - "string": OutputTypeString, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OutputType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/id_entity.go b/resource-manager/securityinsights/2021-09-01-preview/entities/id_entity.go deleted file mode 100644 index 37774558d12..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/id_entity.go +++ /dev/null @@ -1,141 +0,0 @@ -package entities - -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(&EntityId{}) -} - -var _ resourceids.ResourceId = &EntityId{} - -// EntityId is a struct representing the Resource ID for a Entity -type EntityId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityId string -} - -// NewEntityID returns a new EntityId struct -func NewEntityID(subscriptionId string, resourceGroupName string, workspaceName string, entityId string) EntityId { - return EntityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityId: entityId, - } -} - -// ParseEntityID parses 'input' into a EntityId -func ParseEntityID(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityIDInsensitively parses 'input' case-insensitively into a EntityId -// note: this method should only be used for API response data and not user input -func ParseEntityIDInsensitively(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityId, ok = input.Parsed["entityId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityId", input) - } - - return nil -} - -// ValidateEntityID checks that 'input' can be parsed as a Entity ID -func ValidateEntityID(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 := ParseEntityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity ID -func (id EntityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity ID -func (id EntityId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntities", "entities", "entities"), - resourceids.UserSpecifiedSegment("entityId", "entityIdValue"), - } -} - -// String returns a human-readable description of this Entity ID -func (id EntityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity: %q", id.EntityId), - } - return fmt.Sprintf("Entity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/id_entity_test.go b/resource-manager/securityinsights/2021-09-01-preview/entities/id_entity_test.go deleted file mode 100644 index 3b6dfb0ab90..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/id_entity_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entities - -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 = &EntityId{} - -func TestNewEntityID(t *testing.T) { - id := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityId != "entityIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityId'", id.EntityId, "entityIdValue") - } -} - -func TestFormatEntityID(t *testing.T) { - actual := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestParseEntityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityId: "eNtItYiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestSegmentsForEntityId(t *testing.T) { - segments := EntityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityId 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/securityinsights/2021-09-01-preview/entities/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace.go deleted file mode 100644 index 14cfb6f0408..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package entities - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace_test.go deleted file mode 100644 index f965f501da9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package entities - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/entities/method_expand.go b/resource-manager/securityinsights/2021-09-01-preview/entities/method_expand.go deleted file mode 100644 index b9244ea2dea..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/method_expand.go +++ /dev/null @@ -1,59 +0,0 @@ -package entities - -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 ExpandOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityExpandResponse -} - -// Expand ... -func (c EntitiesClient) Expand(ctx context.Context, id EntityId, input EntityExpandParameters) (result ExpandOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/expand", 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 EntityExpandResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/entities/method_get.go deleted file mode 100644 index 85c2b0055fe..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package entities - -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 *Entity -} - -// Get ... -func (c EntitiesClient) Get(ctx context.Context, id EntityId) (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 Entity - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/method_getinsights.go b/resource-manager/securityinsights/2021-09-01-preview/entities/method_getinsights.go deleted file mode 100644 index f61b67c98e7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/method_getinsights.go +++ /dev/null @@ -1,59 +0,0 @@ -package entities - -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 GetInsightsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityGetInsightsResponse -} - -// GetInsights ... -func (c EntitiesClient) GetInsights(ctx context.Context, id EntityId, input EntityGetInsightsParameters) (result GetInsightsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getInsights", 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 EntityGetInsightsResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/method_gettimelinelist.go b/resource-manager/securityinsights/2021-09-01-preview/entities/method_gettimelinelist.go deleted file mode 100644 index 0a51b72c68f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/method_gettimelinelist.go +++ /dev/null @@ -1,59 +0,0 @@ -package entities - -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 GetTimelinelistOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityTimelineResponse -} - -// GetTimelinelist ... -func (c EntitiesClient) GetTimelinelist(ctx context.Context, id EntityId, input EntityTimelineParameters) (result GetTimelinelistOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getTimeline", 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 EntityTimelineResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/entities/method_list.go deleted file mode 100644 index 7bd410bbfb5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package entities - -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 *[]Entity -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Entity -} - -// List ... -func (c EntitiesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/entities", 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 *[]Entity `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 EntitiesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, EntityOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntitiesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate EntityOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Entity, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/entities/method_queries.go b/resource-manager/securityinsights/2021-09-01-preview/entities/method_queries.go deleted file mode 100644 index 05be3ea7aa2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/method_queries.go +++ /dev/null @@ -1,83 +0,0 @@ -package entities - -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 QueriesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *GetQueriesResponse -} - -type QueriesOperationOptions struct { - Kind *EntityItemQueryKind -} - -func DefaultQueriesOperationOptions() QueriesOperationOptions { - return QueriesOperationOptions{} -} - -func (o QueriesOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o QueriesOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o QueriesOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Kind != nil { - out.Append("kind", fmt.Sprintf("%v", *o.Kind)) - } - return &out -} - -// Queries ... -func (c EntitiesClient) Queries(ctx context.Context, id EntityId, options QueriesOperationOptions) (result QueriesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/queries", id.ID()), - OptionsObject: options, - } - - 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 GetQueriesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_activitytimelineitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_activitytimelineitem.go deleted file mode 100644 index da589276f6d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_activitytimelineitem.go +++ /dev/null @@ -1,47 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = ActivityTimelineItem{} - -type ActivityTimelineItem struct { - BucketEndTimeUTC string `json:"bucketEndTimeUTC"` - BucketStartTimeUTC string `json:"bucketStartTimeUTC"` - Content string `json:"content"` - FirstActivityTimeUTC string `json:"firstActivityTimeUTC"` - LastActivityTimeUTC string `json:"lastActivityTimeUTC"` - QueryId string `json:"queryId"` - Title string `json:"title"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = ActivityTimelineItem{} - -func (s ActivityTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper ActivityTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityTimelineItem: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_bookmarktimelineitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_bookmarktimelineitem.go deleted file mode 100644 index 5aad9bf124f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_bookmarktimelineitem.go +++ /dev/null @@ -1,48 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = BookmarkTimelineItem{} - -type BookmarkTimelineItem struct { - AzureResourceId string `json:"azureResourceId"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - EventTime *string `json:"eventTime,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = BookmarkTimelineItem{} - -func (s BookmarkTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper BookmarkTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling BookmarkTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling BookmarkTimelineItem: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling BookmarkTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entity.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entity.go deleted file mode 100644 index 414ade6a61f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entity.go +++ /dev/null @@ -1,16 +0,0 @@ -package entities - -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 Entity struct { - Id *string `json:"id,omitempty"` - Kind EntityKind `json:"kind"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityedges.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityedges.go deleted file mode 100644 index 352d2d65d38..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityedges.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityEdges struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - TargetEntityId *string `json:"targetEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandparameters.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandparameters.go deleted file mode 100644 index e4932ca91a5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandparameters.go +++ /dev/null @@ -1,40 +0,0 @@ -package entities - -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 EntityExpandParameters struct { - EndTime *string `json:"endTime,omitempty"` - ExpansionId *string `json:"expansionId,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *EntityExpandParameters) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityExpandParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *EntityExpandParameters) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityExpandParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponse.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponse.go deleted file mode 100644 index 7e962ed1be3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityExpandResponse struct { - MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` - Value *EntityExpandResponseValue `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponsevalue.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponsevalue.go deleted file mode 100644 index 7d2a9e3d68a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityexpandresponsevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityExpandResponseValue struct { - Edges *[]EntityEdges `json:"edges,omitempty"` - Entities *[]Entity `json:"entities,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsparameters.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsparameters.go deleted file mode 100644 index 7eaf2014482..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsparameters.go +++ /dev/null @@ -1,35 +0,0 @@ -package entities - -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 EntityGetInsightsParameters struct { - AddDefaultExtendedTimeRange *bool `json:"addDefaultExtendedTimeRange,omitempty"` - EndTime string `json:"endTime"` - InsightQueryIds *[]string `json:"insightQueryIds,omitempty"` - StartTime string `json:"startTime"` -} - -func (o *EntityGetInsightsParameters) GetEndTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityGetInsightsParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = formatted -} - -func (o *EntityGetInsightsParameters) GetStartTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityGetInsightsParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsresponse.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsresponse.go deleted file mode 100644 index cbe1fbcf313..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitygetinsightsresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityGetInsightsResponse struct { - MetaData *GetInsightsResultsMetadata `json:"metaData,omitempty"` - Value *[]EntityInsightItem `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitem.go deleted file mode 100644 index 335e610ca64..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityInsightItem struct { - ChartQueryResults *[]InsightsTableResult `json:"chartQueryResults,omitempty"` - QueryId *string `json:"queryId,omitempty"` - QueryTimeInterval *EntityInsightItemQueryTimeInterval `json:"queryTimeInterval,omitempty"` - TableQueryResults *InsightsTableResult `json:"tableQueryResults,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitemquerytimeinterval.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitemquerytimeinterval.go deleted file mode 100644 index 0e5d3b9312c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityinsightitemquerytimeinterval.go +++ /dev/null @@ -1,39 +0,0 @@ -package entities - -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 EntityInsightItemQueryTimeInterval struct { - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *EntityInsightItemQueryTimeInterval) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityInsightItemQueryTimeInterval) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *EntityInsightItemQueryTimeInterval) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityInsightItemQueryTimeInterval) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitem.go deleted file mode 100644 index c9b67487365..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitem.go +++ /dev/null @@ -1,53 +0,0 @@ -package entities - -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 EntityQueryItem interface { -} - -// RawEntityQueryItemImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityQueryItemImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityQueryItemImplementation(input []byte) (EntityQueryItem, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityQueryItem into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Insight") { - var out InsightQueryItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into InsightQueryItem: %+v", err) - } - return out, nil - } - - out := RawEntityQueryItemImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go deleted file mode 100644 index e8d72b9fc48..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityQueryItemPropertiesDataTypesInlined struct { - DataType *string `json:"dataType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineitem.go deleted file mode 100644 index c50d85b3332..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineitem.go +++ /dev/null @@ -1,69 +0,0 @@ -package entities - -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 EntityTimelineItem interface { -} - -// RawEntityTimelineItemImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityTimelineItemImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityTimelineItemImplementation(input []byte) (EntityTimelineItem, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityTimelineItem into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityTimelineItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out BookmarkTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into BookmarkTimelineItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlertTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlertTimelineItem: %+v", err) - } - return out, nil - } - - out := RawEntityTimelineItemImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineparameters.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineparameters.go deleted file mode 100644 index 7a6015c49fa..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineparameters.go +++ /dev/null @@ -1,35 +0,0 @@ -package entities - -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 EntityTimelineParameters struct { - EndTime string `json:"endTime"` - Kinds *[]EntityTimelineKind `json:"kinds,omitempty"` - NumberOfBucket *int64 `json:"numberOfBucket,omitempty"` - StartTime string `json:"startTime"` -} - -func (o *EntityTimelineParameters) GetEndTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityTimelineParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = formatted -} - -func (o *EntityTimelineParameters) GetStartTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityTimelineParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineresponse.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineresponse.go deleted file mode 100644 index 87dd76dbc06..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_entitytimelineresponse.go +++ /dev/null @@ -1,49 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityTimelineResponse struct { - MetaData *TimelineResultsMetadata `json:"metaData,omitempty"` - Value *[]EntityTimelineItem `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &EntityTimelineResponse{} - -func (s *EntityTimelineResponse) UnmarshalJSON(bytes []byte) error { - type alias EntityTimelineResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into EntityTimelineResponse: %+v", err) - } - - s.MetaData = decoded.MetaData - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling EntityTimelineResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]EntityTimelineItem, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityTimelineItemImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'EntityTimelineResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultaggregation.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultaggregation.go deleted file mode 100644 index 2c9c4346e5e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultaggregation.go +++ /dev/null @@ -1,11 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultAggregation struct { - AggregationType *string `json:"aggregationType,omitempty"` - Count int64 `json:"count"` - DisplayName *string `json:"displayName,omitempty"` - EntityKind EntityKind `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultsmetadata.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultsmetadata.go deleted file mode 100644 index 46a2a47421f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_expansionresultsmetadata.go +++ /dev/null @@ -1,8 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultsMetadata struct { - Aggregations *[]ExpansionResultAggregation `json:"aggregations,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightserror.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightserror.go deleted file mode 100644 index 3ecdba8be2e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightserror.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetInsightsError struct { - ErrorMessage string `json:"errorMessage"` - Kind Kind `json:"kind"` - QueryId *string `json:"queryId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightsresultsmetadata.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightsresultsmetadata.go deleted file mode 100644 index 0f2d39e3cdf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_getinsightsresultsmetadata.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetInsightsResultsMetadata struct { - Errors *[]GetInsightsError `json:"errors,omitempty"` - TotalCount int64 `json:"totalCount"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_getqueriesresponse.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_getqueriesresponse.go deleted file mode 100644 index 7e420fdfade..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_getqueriesresponse.go +++ /dev/null @@ -1,41 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetQueriesResponse struct { - Value *[]EntityQueryItem `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &GetQueriesResponse{} - -func (s *GetQueriesResponse) UnmarshalJSON(bytes []byte) error { - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling GetQueriesResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]EntityQueryItem, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityQueryItemImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'GetQueriesResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitem.go deleted file mode 100644 index 6581578a204..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitem.go +++ /dev/null @@ -1,44 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityQueryItem = InsightQueryItem{} - -type InsightQueryItem struct { - Properties *InsightQueryItemProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQueryItem - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = InsightQueryItem{} - -func (s InsightQueryItem) MarshalJSON() ([]byte, error) { - type wrapper InsightQueryItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling InsightQueryItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling InsightQueryItem: %+v", err) - } - decoded["kind"] = "Insight" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling InsightQueryItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitemproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitemproperties.go deleted file mode 100644 index f8c1d4407cf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitemproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemProperties struct { - AdditionalQuery *InsightQueryItemPropertiesAdditionalQuery `json:"additionalQuery,omitempty"` - BaseQuery *string `json:"baseQuery,omitempty"` - ChartQuery *interface{} `json:"chartQuery,omitempty"` - DataTypes *[]EntityQueryItemPropertiesDataTypesInlined `json:"dataTypes,omitempty"` - DefaultTimeRange *InsightQueryItemPropertiesDefaultTimeRange `json:"defaultTimeRange,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EntitiesFilter *interface{} `json:"entitiesFilter,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - ReferenceTimeRange *InsightQueryItemPropertiesReferenceTimeRange `json:"referenceTimeRange,omitempty"` - RequiredInputFieldsSets *[][]string `json:"requiredInputFieldsSets,omitempty"` - TableQuery *InsightQueryItemPropertiesTableQuery `json:"tableQuery,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go deleted file mode 100644 index 3807f0674bf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesAdditionalQuery struct { - Query *string `json:"query,omitempty"` - Text *string `json:"text,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go deleted file mode 100644 index ab5f16df664..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesDefaultTimeRange struct { - AfterRange *string `json:"afterRange,omitempty"` - BeforeRange *string `json:"beforeRange,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go deleted file mode 100644 index 2ebb97841cb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go +++ /dev/null @@ -1,8 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesReferenceTimeRange struct { - BeforeRange *string `json:"beforeRange,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequery.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequery.go deleted file mode 100644 index a2c572b6952..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequery.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQuery struct { - ColumnsDefinitions *[]InsightQueryItemPropertiesTableQueryColumnsDefinitionsInlined `json:"columnsDefinitions,omitempty"` - QueriesDefinitions *[]InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlined `json:"queriesDefinitions,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go deleted file mode 100644 index 2d2e7397c50..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQueryColumnsDefinitionsInlined struct { - Header *string `json:"header,omitempty"` - OutputType *OutputType `json:"outputType,omitempty"` - SupportDeepLink *bool `json:"supportDeepLink,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go deleted file mode 100644 index bb5a4b04a4a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go +++ /dev/null @@ -1,11 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlined struct { - Filter *string `json:"filter,omitempty"` - LinkColumnsDefinitions *[]InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlinedLinkColumnsDefinitionsInlined `json:"linkColumnsDefinitions,omitempty"` - Project *string `json:"project,omitempty"` - Summarize *string `json:"summarize,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go deleted file mode 100644 index 6b77d6cc83d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlinedLinkColumnsDefinitionsInlined struct { - ProjectedName *string `json:"projectedName,omitempty"` - Query *string `json:"Query,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresult.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresult.go deleted file mode 100644 index b0bea744d26..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightsTableResult struct { - Columns *[]InsightsTableResultColumnsInlined `json:"columns,omitempty"` - Rows *[][]string `json:"rows,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresultcolumnsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresultcolumnsinlined.go deleted file mode 100644 index 23bb093cb51..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_insightstableresultcolumnsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightsTableResultColumnsInlined struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_securityalerttimelineitem.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_securityalerttimelineitem.go deleted file mode 100644 index d0527f8c426..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_securityalerttimelineitem.go +++ /dev/null @@ -1,49 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = SecurityAlertTimelineItem{} - -type SecurityAlertTimelineItem struct { - AlertType string `json:"alertType"` - AzureResourceId string `json:"azureResourceId"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - EndTimeUtc string `json:"endTimeUtc"` - ProductName *string `json:"productName,omitempty"` - Severity AlertSeverity `json:"severity"` - StartTimeUtc string `json:"startTimeUtc"` - TimeGenerated string `json:"timeGenerated"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = SecurityAlertTimelineItem{} - -func (s SecurityAlertTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlertTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlertTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlertTimelineItem: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlertTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineaggregation.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineaggregation.go deleted file mode 100644 index 4e2bd7c7eb5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineaggregation.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimelineAggregation struct { - Count int64 `json:"count"` - Kind EntityTimelineKind `json:"kind"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineerror.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineerror.go deleted file mode 100644 index f14775c61f5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineerror.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimelineError struct { - ErrorMessage string `json:"errorMessage"` - Kind EntityTimelineKind `json:"kind"` - QueryId *string `json:"queryId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineresultsmetadata.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineresultsmetadata.go deleted file mode 100644 index 1810858daff..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_timelineresultsmetadata.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimelineResultsMetadata struct { - Aggregations []TimelineAggregation `json:"aggregations"` - Errors *[]TimelineError `json:"errors,omitempty"` - TotalCount int64 `json:"totalCount"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/entities/model_userinfo.go deleted file mode 100644 index 9e648dc68e6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entities/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/entities/predicates.go deleted file mode 100644 index f0f983c5e68..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EntityOperationPredicate) Matches(input Entity) 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/securityinsights/2021-09-01-preview/entities/version.go b/resource-manager/securityinsights/2021-09-01-preview/entities/version.go deleted file mode 100644 index 8883470a2d2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entities/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/README.md b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/README.md deleted file mode 100644 index 15c97d466fc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/README.md +++ /dev/null @@ -1,123 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entityqueries` Documentation - -The `entityqueries` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/entityqueries" -``` - - -### Client Initialization - -```go -client := entityqueries.NewEntityQueriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EntityQueriesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - -payload := entityqueries.CustomEntityQuery{ - // ... -} - - -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: `EntityQueriesClient.Delete` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - -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: `EntityQueriesClient.EntityQueryTemplatesGet` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryTemplateIdValue") - -read, err := client.EntityQueryTemplatesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntityQueriesClient.EntityQueryTemplatesList` - -```go -ctx := context.TODO() -id := entityqueries.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.EntityQueryTemplatesList(ctx, id, entityqueries.DefaultEntityQueryTemplatesListOperationOptions())` can be used to do batched pagination -items, err := client.EntityQueryTemplatesListComplete(ctx, id, entityqueries.DefaultEntityQueryTemplatesListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `EntityQueriesClient.Get` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - -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: `EntityQueriesClient.List` - -```go -ctx := context.TODO() -id := entityqueries.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, entityqueries.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, entityqueries.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/client.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/client.go deleted file mode 100644 index 4a7620bff39..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entityqueries - -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 EntityQueriesClient struct { - Client *resourcemanager.Client -} - -func NewEntityQueriesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityQueriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entityqueries", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityQueriesClient: %+v", err) - } - - return &EntityQueriesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/constants.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/constants.go deleted file mode 100644 index 40a5a40396d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/constants.go +++ /dev/null @@ -1,269 +0,0 @@ -package entityqueries - -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 CustomEntityQueryKind string - -const ( - CustomEntityQueryKindActivity CustomEntityQueryKind = "Activity" -) - -func PossibleValuesForCustomEntityQueryKind() []string { - return []string{ - string(CustomEntityQueryKindActivity), - } -} - -func (s *CustomEntityQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCustomEntityQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCustomEntityQueryKind(input string) (*CustomEntityQueryKind, error) { - vals := map[string]CustomEntityQueryKind{ - "activity": CustomEntityQueryKindActivity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CustomEntityQueryKind(input) - return &out, nil -} - -type EntityQueryKind string - -const ( - EntityQueryKindActivity EntityQueryKind = "Activity" - EntityQueryKindExpansion EntityQueryKind = "Expansion" - EntityQueryKindInsight EntityQueryKind = "Insight" -) - -func PossibleValuesForEntityQueryKind() []string { - return []string{ - string(EntityQueryKindActivity), - string(EntityQueryKindExpansion), - string(EntityQueryKindInsight), - } -} - -func (s *EntityQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityQueryKind(input string) (*EntityQueryKind, error) { - vals := map[string]EntityQueryKind{ - "activity": EntityQueryKindActivity, - "expansion": EntityQueryKindExpansion, - "insight": EntityQueryKindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityQueryKind(input) - return &out, nil -} - -type EntityQueryTemplateKind string - -const ( - EntityQueryTemplateKindActivity EntityQueryTemplateKind = "Activity" -) - -func PossibleValuesForEntityQueryTemplateKind() []string { - return []string{ - string(EntityQueryTemplateKindActivity), - } -} - -func (s *EntityQueryTemplateKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityQueryTemplateKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityQueryTemplateKind(input string) (*EntityQueryTemplateKind, error) { - vals := map[string]EntityQueryTemplateKind{ - "activity": EntityQueryTemplateKindActivity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityQueryTemplateKind(input) - return &out, nil -} - -type EntityType string - -const ( - EntityTypeAccount EntityType = "Account" - EntityTypeAzureResource EntityType = "AzureResource" - EntityTypeCloudApplication EntityType = "CloudApplication" - EntityTypeDNS EntityType = "DNS" - EntityTypeFile EntityType = "File" - EntityTypeFileHash EntityType = "FileHash" - EntityTypeHost EntityType = "Host" - EntityTypeHuntingBookmark EntityType = "HuntingBookmark" - EntityTypeIP EntityType = "IP" - EntityTypeIoTDevice EntityType = "IoTDevice" - EntityTypeMailCluster EntityType = "MailCluster" - EntityTypeMailMessage EntityType = "MailMessage" - EntityTypeMailbox EntityType = "Mailbox" - EntityTypeMalware EntityType = "Malware" - EntityTypeProcess EntityType = "Process" - EntityTypeRegistryKey EntityType = "RegistryKey" - EntityTypeRegistryValue EntityType = "RegistryValue" - EntityTypeSecurityAlert EntityType = "SecurityAlert" - EntityTypeSecurityGroup EntityType = "SecurityGroup" - EntityTypeSubmissionMail EntityType = "SubmissionMail" - EntityTypeURL EntityType = "URL" -) - -func PossibleValuesForEntityType() []string { - return []string{ - string(EntityTypeAccount), - string(EntityTypeAzureResource), - string(EntityTypeCloudApplication), - string(EntityTypeDNS), - string(EntityTypeFile), - string(EntityTypeFileHash), - string(EntityTypeHost), - string(EntityTypeHuntingBookmark), - string(EntityTypeIP), - string(EntityTypeIoTDevice), - string(EntityTypeMailCluster), - string(EntityTypeMailMessage), - string(EntityTypeMailbox), - string(EntityTypeMalware), - string(EntityTypeProcess), - string(EntityTypeRegistryKey), - string(EntityTypeRegistryValue), - string(EntityTypeSecurityAlert), - string(EntityTypeSecurityGroup), - string(EntityTypeSubmissionMail), - string(EntityTypeURL), - } -} - -func (s *EntityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityType(input string) (*EntityType, error) { - vals := map[string]EntityType{ - "account": EntityTypeAccount, - "azureresource": EntityTypeAzureResource, - "cloudapplication": EntityTypeCloudApplication, - "dns": EntityTypeDNS, - "file": EntityTypeFile, - "filehash": EntityTypeFileHash, - "host": EntityTypeHost, - "huntingbookmark": EntityTypeHuntingBookmark, - "ip": EntityTypeIP, - "iotdevice": EntityTypeIoTDevice, - "mailcluster": EntityTypeMailCluster, - "mailmessage": EntityTypeMailMessage, - "mailbox": EntityTypeMailbox, - "malware": EntityTypeMalware, - "process": EntityTypeProcess, - "registrykey": EntityTypeRegistryKey, - "registryvalue": EntityTypeRegistryValue, - "securityalert": EntityTypeSecurityAlert, - "securitygroup": EntityTypeSecurityGroup, - "submissionmail": EntityTypeSubmissionMail, - "url": EntityTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityType(input) - return &out, nil -} - -type Kind string - -const ( - KindActivity Kind = "Activity" - KindExpansion Kind = "Expansion" -) - -func PossibleValuesForKind() []string { - return []string{ - string(KindActivity), - string(KindExpansion), - } -} - -func (s *Kind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKind(input string) (*Kind, error) { - vals := map[string]Kind{ - "activity": KindActivity, - "expansion": KindExpansion, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Kind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery.go deleted file mode 100644 index f3b1d80e716..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery.go +++ /dev/null @@ -1,141 +0,0 @@ -package entityqueries - -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(&EntityQueryId{}) -} - -var _ resourceids.ResourceId = &EntityQueryId{} - -// EntityQueryId is a struct representing the Resource ID for a Entity Query -type EntityQueryId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityQueryId string -} - -// NewEntityQueryID returns a new EntityQueryId struct -func NewEntityQueryID(subscriptionId string, resourceGroupName string, workspaceName string, entityQueryId string) EntityQueryId { - return EntityQueryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityQueryId: entityQueryId, - } -} - -// ParseEntityQueryID parses 'input' into a EntityQueryId -func ParseEntityQueryID(input string) (*EntityQueryId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityQueryIDInsensitively parses 'input' case-insensitively into a EntityQueryId -// note: this method should only be used for API response data and not user input -func ParseEntityQueryIDInsensitively(input string) (*EntityQueryId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityQueryId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityQueryId, ok = input.Parsed["entityQueryId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityQueryId", input) - } - - return nil -} - -// ValidateEntityQueryID checks that 'input' can be parsed as a Entity Query ID -func ValidateEntityQueryID(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 := ParseEntityQueryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity Query ID -func (id EntityQueryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entityQueries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityQueryId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity Query ID -func (id EntityQueryId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntityQueries", "entityQueries", "entityQueries"), - resourceids.UserSpecifiedSegment("entityQueryId", "entityQueryIdValue"), - } -} - -// String returns a human-readable description of this Entity Query ID -func (id EntityQueryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity Query: %q", id.EntityQueryId), - } - return fmt.Sprintf("Entity Query (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery_test.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery_test.go deleted file mode 100644 index 110672c8c13..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquery_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entityqueries - -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 = &EntityQueryId{} - -func TestNewEntityQueryID(t *testing.T) { - id := NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityQueryId != "entityQueryIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityQueryId'", id.EntityQueryId, "entityQueryIdValue") - } -} - -func TestFormatEntityQueryID(t *testing.T) { - actual := NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityQueryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue", - Expected: &EntityQueryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryId: "entityQueryIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryId != v.Expected.EntityQueryId { - t.Fatalf("Expected %q but got %q for EntityQueryId", v.Expected.EntityQueryId, actual.EntityQueryId) - } - - } -} - -func TestParseEntityQueryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue", - Expected: &EntityQueryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryId: "entityQueryIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRiEs/eNtItYqUeRyIdVaLuE", - Expected: &EntityQueryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityQueryId: "eNtItYqUeRyIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRiEs/eNtItYqUeRyIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryId != v.Expected.EntityQueryId { - t.Fatalf("Expected %q but got %q for EntityQueryId", v.Expected.EntityQueryId, actual.EntityQueryId) - } - - } -} - -func TestSegmentsForEntityQueryId(t *testing.T) { - segments := EntityQueryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityQueryId 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/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate.go deleted file mode 100644 index cdc4a09121e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate.go +++ /dev/null @@ -1,141 +0,0 @@ -package entityqueries - -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(&EntityQueryTemplateId{}) -} - -var _ resourceids.ResourceId = &EntityQueryTemplateId{} - -// EntityQueryTemplateId is a struct representing the Resource ID for a Entity Query Template -type EntityQueryTemplateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityQueryTemplateId string -} - -// NewEntityQueryTemplateID returns a new EntityQueryTemplateId struct -func NewEntityQueryTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, entityQueryTemplateId string) EntityQueryTemplateId { - return EntityQueryTemplateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityQueryTemplateId: entityQueryTemplateId, - } -} - -// ParseEntityQueryTemplateID parses 'input' into a EntityQueryTemplateId -func ParseEntityQueryTemplateID(input string) (*EntityQueryTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryTemplateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityQueryTemplateIDInsensitively parses 'input' case-insensitively into a EntityQueryTemplateId -// note: this method should only be used for API response data and not user input -func ParseEntityQueryTemplateIDInsensitively(input string) (*EntityQueryTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryTemplateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityQueryTemplateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityQueryTemplateId, ok = input.Parsed["entityQueryTemplateId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityQueryTemplateId", input) - } - - return nil -} - -// ValidateEntityQueryTemplateID checks that 'input' can be parsed as a Entity Query Template ID -func ValidateEntityQueryTemplateID(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 := ParseEntityQueryTemplateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity Query Template ID -func (id EntityQueryTemplateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entityQueryTemplates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityQueryTemplateId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity Query Template ID -func (id EntityQueryTemplateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntityQueryTemplates", "entityQueryTemplates", "entityQueryTemplates"), - resourceids.UserSpecifiedSegment("entityQueryTemplateId", "entityQueryTemplateIdValue"), - } -} - -// String returns a human-readable description of this Entity Query Template ID -func (id EntityQueryTemplateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity Query Template: %q", id.EntityQueryTemplateId), - } - return fmt.Sprintf("Entity Query Template (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate_test.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate_test.go deleted file mode 100644 index 6878fc08b76..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_entityquerytemplate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entityqueries - -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 = &EntityQueryTemplateId{} - -func TestNewEntityQueryTemplateID(t *testing.T) { - id := NewEntityQueryTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryTemplateIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityQueryTemplateId != "entityQueryTemplateIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityQueryTemplateId'", id.EntityQueryTemplateId, "entityQueryTemplateIdValue") - } -} - -func TestFormatEntityQueryTemplateID(t *testing.T) { - actual := NewEntityQueryTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryTemplateIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityQueryTemplateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue", - Expected: &EntityQueryTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryTemplateId: "entityQueryTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryTemplateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryTemplateId != v.Expected.EntityQueryTemplateId { - t.Fatalf("Expected %q but got %q for EntityQueryTemplateId", v.Expected.EntityQueryTemplateId, actual.EntityQueryTemplateId) - } - - } -} - -func TestParseEntityQueryTemplateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRyTeMpLaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue", - Expected: &EntityQueryTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryTemplateId: "entityQueryTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRyTeMpLaTeS/eNtItYqUeRyTeMpLaTeIdVaLuE", - Expected: &EntityQueryTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityQueryTemplateId: "eNtItYqUeRyTeMpLaTeIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRyTeMpLaTeS/eNtItYqUeRyTeMpLaTeIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryTemplateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryTemplateId != v.Expected.EntityQueryTemplateId { - t.Fatalf("Expected %q but got %q for EntityQueryTemplateId", v.Expected.EntityQueryTemplateId, actual.EntityQueryTemplateId) - } - - } -} - -func TestSegmentsForEntityQueryTemplateId(t *testing.T) { - segments := EntityQueryTemplateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityQueryTemplateId 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/securityinsights/2021-09-01-preview/entityqueries/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace.go deleted file mode 100644 index ff2d84cb927..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package entityqueries - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace_test.go deleted file mode 100644 index 7529ef8f9d8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package entityqueries - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/entityqueries/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_createorupdate.go deleted file mode 100644 index b9ecc82c257..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 *EntityQuery -} - -// CreateOrUpdate ... -func (c EntityQueriesClient) CreateOrUpdate(ctx context.Context, id EntityQueryId, input CustomEntityQuery) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalEntityQueryImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_delete.go deleted file mode 100644 index b413ad04691..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package entityqueries - -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 EntityQueriesClient) Delete(ctx context.Context, id EntityQueryId) (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/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplatesget.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplatesget.go deleted file mode 100644 index 2e55614c8f0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplatesget.go +++ /dev/null @@ -1,58 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 EntityQueryTemplatesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityQueryTemplate -} - -// EntityQueryTemplatesGet ... -func (c EntityQueriesClient) EntityQueryTemplatesGet(ctx context.Context, id EntityQueryTemplateId) (result EntityQueryTemplatesGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalEntityQueryTemplateImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplateslist.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplateslist.go deleted file mode 100644 index 80a1a6ce617..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_entityquerytemplateslist.go +++ /dev/null @@ -1,131 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 EntityQueryTemplatesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]EntityQueryTemplate -} - -type EntityQueryTemplatesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EntityQueryTemplate -} - -type EntityQueryTemplatesListOperationOptions struct { - Kind *Kind -} - -func DefaultEntityQueryTemplatesListOperationOptions() EntityQueryTemplatesListOperationOptions { - return EntityQueryTemplatesListOperationOptions{} -} - -func (o EntityQueryTemplatesListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o EntityQueryTemplatesListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o EntityQueryTemplatesListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Kind != nil { - out.Append("kind", fmt.Sprintf("%v", *o.Kind)) - } - return &out -} - -// EntityQueryTemplatesList ... -func (c EntityQueriesClient) EntityQueryTemplatesList(ctx context.Context, id WorkspaceId, options EntityQueryTemplatesListOperationOptions) (result EntityQueryTemplatesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/entityQueryTemplates", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]EntityQueryTemplate, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalEntityQueryTemplateImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for EntityQueryTemplate (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// EntityQueryTemplatesListComplete retrieves all the results into a single object -func (c EntityQueriesClient) EntityQueryTemplatesListComplete(ctx context.Context, id WorkspaceId, options EntityQueryTemplatesListOperationOptions) (EntityQueryTemplatesListCompleteResult, error) { - return c.EntityQueryTemplatesListCompleteMatchingPredicate(ctx, id, options, EntityQueryTemplateOperationPredicate{}) -} - -// EntityQueryTemplatesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntityQueriesClient) EntityQueryTemplatesListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options EntityQueryTemplatesListOperationOptions, predicate EntityQueryTemplateOperationPredicate) (result EntityQueryTemplatesListCompleteResult, err error) { - items := make([]EntityQueryTemplate, 0) - - resp, err := c.EntityQueryTemplatesList(ctx, id, options) - if err != nil { - 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 = EntityQueryTemplatesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_get.go deleted file mode 100644 index 4a7022fa713..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 *EntityQuery -} - -// Get ... -func (c EntityQueriesClient) Get(ctx context.Context, id EntityQueryId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalEntityQueryImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_list.go deleted file mode 100644 index 5cf5f6c7631..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/method_list.go +++ /dev/null @@ -1,131 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 *[]EntityQuery -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EntityQuery -} - -type ListOperationOptions struct { - Kind *Kind -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Kind != nil { - out.Append("kind", fmt.Sprintf("%v", *o.Kind)) - } - return &out -} - -// List ... -func (c EntityQueriesClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/entityQueries", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]EntityQuery, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalEntityQueryImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for EntityQuery (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c EntityQueriesClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, EntityQueryOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntityQueriesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate EntityQueryOperationPredicate) (result ListCompleteResult, err error) { - items := make([]EntityQuery, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2021-09-01-preview/entityqueries/model_activitycustomentityquery.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activitycustomentityquery.go deleted file mode 100644 index 0cfe2c18623..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activitycustomentityquery.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ CustomEntityQuery = ActivityCustomEntityQuery{} - -type ActivityCustomEntityQuery struct { - Properties *ActivityEntityQueriesProperties `json:"properties,omitempty"` - - // Fields inherited from CustomEntityQuery - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ActivityCustomEntityQuery{} - -func (s ActivityCustomEntityQuery) MarshalJSON() ([]byte, error) { - type wrapper ActivityCustomEntityQuery - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityCustomEntityQuery: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityCustomEntityQuery: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityCustomEntityQuery: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriesproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriesproperties.go deleted file mode 100644 index 828bc04066b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriesproperties.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -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 ActivityEntityQueriesProperties struct { - Content *string `json:"content,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - Description *string `json:"description,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - EntitiesFilter *map[string][]string `json:"entitiesFilter,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - QueryDefinitions *ActivityEntityQueriesPropertiesQueryDefinitions `json:"queryDefinitions,omitempty"` - RequiredInputFieldsSets *[][]string `json:"requiredInputFieldsSets,omitempty"` - TemplateName *string `json:"templateName,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (o *ActivityEntityQueriesProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActivityEntityQueriesProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *ActivityEntityQueriesProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActivityEntityQueriesProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go deleted file mode 100644 index 7eb9592f372..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go +++ /dev/null @@ -1,8 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActivityEntityQueriesPropertiesQueryDefinitions struct { - Query *string `json:"query,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquery.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquery.go deleted file mode 100644 index bfdfa3bdbd5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquery.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ EntityQuery = ActivityEntityQuery{} - -type ActivityEntityQuery struct { - Properties *ActivityEntityQueriesProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQuery - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ActivityEntityQuery{} - -func (s ActivityEntityQuery) MarshalJSON() ([]byte, error) { - type wrapper ActivityEntityQuery - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityEntityQuery: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityEntityQuery: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityEntityQuery: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplate.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplate.go deleted file mode 100644 index bdbd16666a9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ EntityQueryTemplate = ActivityEntityQueryTemplate{} - -type ActivityEntityQueryTemplate struct { - Properties *ActivityEntityQueryTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQueryTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ActivityEntityQueryTemplate{} - -func (s ActivityEntityQueryTemplate) MarshalJSON() ([]byte, error) { - type wrapper ActivityEntityQueryTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityEntityQueryTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityEntityQueryTemplate: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityEntityQueryTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplateproperties.go deleted file mode 100644 index f740e7b4d09..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplateproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActivityEntityQueryTemplateProperties struct { - Content *string `json:"content,omitempty"` - DataTypes *[]DataTypeDefinitions `json:"dataTypes,omitempty"` - Description *string `json:"description,omitempty"` - EntitiesFilter *map[string][]string `json:"entitiesFilter,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - QueryDefinitions *ActivityEntityQueryTemplatePropertiesQueryDefinitions `json:"queryDefinitions,omitempty"` - RequiredInputFieldsSets *[][]string `json:"requiredInputFieldsSets,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go deleted file mode 100644 index 8df097f1420..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go +++ /dev/null @@ -1,9 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActivityEntityQueryTemplatePropertiesQueryDefinitions struct { - Query *string `json:"query,omitempty"` - SummarizeBy *string `json:"summarizeBy,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_customentityquery.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_customentityquery.go deleted file mode 100644 index 75460cc6795..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_customentityquery.go +++ /dev/null @@ -1,53 +0,0 @@ -package entityqueries - -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 CustomEntityQuery interface { -} - -// RawCustomEntityQueryImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawCustomEntityQueryImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalCustomEntityQueryImplementation(input []byte) (CustomEntityQuery, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling CustomEntityQuery into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityCustomEntityQuery - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityCustomEntityQuery: %+v", err) - } - return out, nil - } - - out := RawCustomEntityQueryImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_datatypedefinitions.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_datatypedefinitions.go deleted file mode 100644 index cea278763e9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_datatypedefinitions.go +++ /dev/null @@ -1,8 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataTypeDefinitions struct { - DataType *string `json:"dataType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquery.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquery.go deleted file mode 100644 index bfec2a4f7a4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquery.go +++ /dev/null @@ -1,61 +0,0 @@ -package entityqueries - -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 EntityQuery interface { -} - -// RawEntityQueryImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityQueryImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityQueryImplementation(input []byte) (EntityQuery, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityQuery into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityEntityQuery - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityEntityQuery: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Expansion") { - var out ExpansionEntityQuery - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ExpansionEntityQuery: %+v", err) - } - return out, nil - } - - out := RawEntityQueryImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquerytemplate.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquerytemplate.go deleted file mode 100644 index 5734f996be9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_entityquerytemplate.go +++ /dev/null @@ -1,53 +0,0 @@ -package entityqueries - -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 EntityQueryTemplate interface { -} - -// RawEntityQueryTemplateImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityQueryTemplateImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityQueryTemplateImplementation(input []byte) (EntityQueryTemplate, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityQueryTemplate into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityEntityQueryTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityEntityQueryTemplate: %+v", err) - } - return out, nil - } - - out := RawEntityQueryTemplateImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityqueriesproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityqueriesproperties.go deleted file mode 100644 index c87cb5c6561..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityqueriesproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionEntityQueriesProperties struct { - DataSources *[]string `json:"dataSources,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - InputFields *[]string `json:"inputFields,omitempty"` - OutputEntityTypes *[]EntityType `json:"outputEntityTypes,omitempty"` - QueryTemplate *string `json:"queryTemplate,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityquery.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityquery.go deleted file mode 100644 index bcc5a7e9b2e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/model_expansionentityquery.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ EntityQuery = ExpansionEntityQuery{} - -type ExpansionEntityQuery struct { - Properties *ExpansionEntityQueriesProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQuery - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ExpansionEntityQuery{} - -func (s ExpansionEntityQuery) MarshalJSON() ([]byte, error) { - type wrapper ExpansionEntityQuery - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ExpansionEntityQuery: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ExpansionEntityQuery: %+v", err) - } - decoded["kind"] = "Expansion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ExpansionEntityQuery: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/predicates.go deleted file mode 100644 index 641e052de67..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/predicates.go +++ /dev/null @@ -1,20 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityQueryOperationPredicate struct { -} - -func (p EntityQueryOperationPredicate) Matches(input EntityQuery) bool { - - return true -} - -type EntityQueryTemplateOperationPredicate struct { -} - -func (p EntityQueryTemplateOperationPredicate) Matches(input EntityQueryTemplate) bool { - - return true -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/version.go b/resource-manager/securityinsights/2021-09-01-preview/entityqueries/version.go deleted file mode 100644 index 37592c71f06..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityqueries/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entityqueries - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entityqueries/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/README.md b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/README.md deleted file mode 100644 index 42d08479b30..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entityrelations` Documentation - -The `entityrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/entityrelations" -``` - - -### Client Initialization - -```go -client := entityrelations.NewEntityRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EntityRelationsClient.EntitiesRelationsList` - -```go -ctx := context.TODO() -id := entityrelations.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -// alternatively `client.EntitiesRelationsList(ctx, id, entityrelations.DefaultEntitiesRelationsListOperationOptions())` can be used to do batched pagination -items, err := client.EntitiesRelationsListComplete(ctx, id, entityrelations.DefaultEntitiesRelationsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `EntityRelationsClient.GetRelation` - -```go -ctx := context.TODO() -id := entityrelations.NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue", "relationValue") - -read, err := client.GetRelation(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/securityinsights/2021-09-01-preview/entityrelations/client.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/client.go deleted file mode 100644 index 85b6978e574..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entityrelations - -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 EntityRelationsClient struct { - Client *resourcemanager.Client -} - -func NewEntityRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entityrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityRelationsClient: %+v", err) - } - - return &EntityRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity.go deleted file mode 100644 index 0f62b4a66b1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity.go +++ /dev/null @@ -1,141 +0,0 @@ -package entityrelations - -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(&EntityId{}) -} - -var _ resourceids.ResourceId = &EntityId{} - -// EntityId is a struct representing the Resource ID for a Entity -type EntityId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityId string -} - -// NewEntityID returns a new EntityId struct -func NewEntityID(subscriptionId string, resourceGroupName string, workspaceName string, entityId string) EntityId { - return EntityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityId: entityId, - } -} - -// ParseEntityID parses 'input' into a EntityId -func ParseEntityID(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityIDInsensitively parses 'input' case-insensitively into a EntityId -// note: this method should only be used for API response data and not user input -func ParseEntityIDInsensitively(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityId, ok = input.Parsed["entityId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityId", input) - } - - return nil -} - -// ValidateEntityID checks that 'input' can be parsed as a Entity ID -func ValidateEntityID(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 := ParseEntityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity ID -func (id EntityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity ID -func (id EntityId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntities", "entities", "entities"), - resourceids.UserSpecifiedSegment("entityId", "entityIdValue"), - } -} - -// String returns a human-readable description of this Entity ID -func (id EntityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity: %q", id.EntityId), - } - return fmt.Sprintf("Entity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity_test.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity_test.go deleted file mode 100644 index 4624e7de4fa..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_entity_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entityrelations - -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 = &EntityId{} - -func TestNewEntityID(t *testing.T) { - id := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityId != "entityIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityId'", id.EntityId, "entityIdValue") - } -} - -func TestFormatEntityID(t *testing.T) { - actual := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestParseEntityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityId: "eNtItYiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestSegmentsForEntityId(t *testing.T) { - segments := EntityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityId 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/securityinsights/2021-09-01-preview/entityrelations/id_relation.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation.go deleted file mode 100644 index 7c6b140220b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation.go +++ /dev/null @@ -1,150 +0,0 @@ -package entityrelations - -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(&RelationId{}) -} - -var _ resourceids.ResourceId = &RelationId{} - -// RelationId is a struct representing the Resource ID for a Relation -type RelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityId string - RelationName string -} - -// NewRelationID returns a new RelationId struct -func NewRelationID(subscriptionId string, resourceGroupName string, workspaceName string, entityId string, relationName string) RelationId { - return RelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityId: entityId, - RelationName: relationName, - } -} - -// ParseRelationID parses 'input' into a RelationId -func ParseRelationID(input string) (*RelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&RelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRelationIDInsensitively parses 'input' case-insensitively into a RelationId -// note: this method should only be used for API response data and not user input -func ParseRelationIDInsensitively(input string) (*RelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&RelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityId, ok = input.Parsed["entityId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateRelationID checks that 'input' can be parsed as a Relation ID -func ValidateRelationID(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 := ParseRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Relation ID -func (id RelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entities/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Relation ID -func (id RelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntities", "entities", "entities"), - resourceids.UserSpecifiedSegment("entityId", "entityIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Relation ID -func (id RelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity: %q", id.EntityId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation_test.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation_test.go deleted file mode 100644 index 5d6b424c451..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/id_relation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package entityrelations - -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 = &RelationId{} - -func TestNewRelationID(t *testing.T) { - id := NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityId != "entityIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityId'", id.EntityId, "entityIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatRelationID(t *testing.T) { - actual := NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityId: "eNtItYiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForRelationId(t *testing.T) { - segments := RelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RelationId 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/securityinsights/2021-09-01-preview/entityrelations/method_entitiesrelationslist.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_entitiesrelationslist.go deleted file mode 100644 index ffe62e84ee3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_entitiesrelationslist.go +++ /dev/null @@ -1,127 +0,0 @@ -package entityrelations - -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 EntitiesRelationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Relation -} - -type EntitiesRelationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type EntitiesRelationsListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultEntitiesRelationsListOperationOptions() EntitiesRelationsListOperationOptions { - return EntitiesRelationsListOperationOptions{} -} - -func (o EntitiesRelationsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o EntitiesRelationsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o EntitiesRelationsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// EntitiesRelationsList ... -func (c EntityRelationsClient) EntitiesRelationsList(ctx context.Context, id EntityId, options EntitiesRelationsListOperationOptions) (result EntitiesRelationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// EntitiesRelationsListComplete retrieves all the results into a single object -func (c EntityRelationsClient) EntitiesRelationsListComplete(ctx context.Context, id EntityId, options EntitiesRelationsListOperationOptions) (EntitiesRelationsListCompleteResult, error) { - return c.EntitiesRelationsListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// EntitiesRelationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntityRelationsClient) EntitiesRelationsListCompleteMatchingPredicate(ctx context.Context, id EntityId, options EntitiesRelationsListOperationOptions, predicate RelationOperationPredicate) (result EntitiesRelationsListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.EntitiesRelationsList(ctx, id, options) - if err != nil { - 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 = EntitiesRelationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_getrelation.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_getrelation.go deleted file mode 100644 index 21bd52b6efe..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/method_getrelation.go +++ /dev/null @@ -1,54 +0,0 @@ -package entityrelations - -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 GetRelationOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Relation -} - -// GetRelation ... -func (c EntityRelationsClient) GetRelation(ctx context.Context, id RelationId) (result GetRelationOperationResponse, 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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relation.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relation.go deleted file mode 100644 index 62a280eeb4c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package entityrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relationproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relationproperties.go deleted file mode 100644 index 1feb7ca28e3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entityrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/predicates.go deleted file mode 100644 index 28d0d19df17..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package entityrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2021-09-01-preview/entityrelations/version.go b/resource-manager/securityinsights/2021-09-01-preview/entityrelations/version.go deleted file mode 100644 index 4cb7a72aa9d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entityrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entityrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entityrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/README.md b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/README.md deleted file mode 100644 index b1455b23c07..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/README.md +++ /dev/null @@ -1,21 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/entitytypes` Documentation - -The `entitytypes` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/entitytypes" -``` - - -### Client Initialization - -```go -client := entitytypes.NewEntityTypesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/client.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/client.go deleted file mode 100644 index bcdd09e4029..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entitytypes - -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 EntityTypesClient struct { - Client *resourcemanager.Client -} - -func NewEntityTypesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityTypesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entitytypes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityTypesClient: %+v", err) - } - - return &EntityTypesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/constants.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/constants.go deleted file mode 100644 index 797b5f76c02..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/constants.go +++ /dev/null @@ -1,968 +0,0 @@ -package entitytypes - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AntispamMailDirection string - -const ( - AntispamMailDirectionInbound AntispamMailDirection = "Inbound" - AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" - AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" - AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" -) - -func PossibleValuesForAntispamMailDirection() []string { - return []string{ - string(AntispamMailDirectionInbound), - string(AntispamMailDirectionIntraorg), - string(AntispamMailDirectionOutbound), - string(AntispamMailDirectionUnknown), - } -} - -func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAntispamMailDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { - vals := map[string]AntispamMailDirection{ - "inbound": AntispamMailDirectionInbound, - "intraorg": AntispamMailDirectionIntraorg, - "outbound": AntispamMailDirectionOutbound, - "unknown": AntispamMailDirectionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AntispamMailDirection(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -func PossibleValuesForCreatedByType() []string { - return []string{ - string(CreatedByTypeApplication), - string(CreatedByTypeKey), - string(CreatedByTypeManagedIdentity), - string(CreatedByTypeUser), - } -} - -func (s *CreatedByType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCreatedByType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCreatedByType(input string) (*CreatedByType, error) { - vals := map[string]CreatedByType{ - "application": CreatedByTypeApplication, - "key": CreatedByTypeKey, - "managedidentity": CreatedByTypeManagedIdentity, - "user": CreatedByTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreatedByType(input) - return &out, nil -} - -type DeliveryAction string - -const ( - DeliveryActionBlocked DeliveryAction = "Blocked" - DeliveryActionDelivered DeliveryAction = "Delivered" - DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" - DeliveryActionReplaced DeliveryAction = "Replaced" - DeliveryActionUnknown DeliveryAction = "Unknown" -) - -func PossibleValuesForDeliveryAction() []string { - return []string{ - string(DeliveryActionBlocked), - string(DeliveryActionDelivered), - string(DeliveryActionDeliveredAsSpam), - string(DeliveryActionReplaced), - string(DeliveryActionUnknown), - } -} - -func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeliveryAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeliveryAction(input string) (*DeliveryAction, error) { - vals := map[string]DeliveryAction{ - "blocked": DeliveryActionBlocked, - "delivered": DeliveryActionDelivered, - "deliveredasspam": DeliveryActionDeliveredAsSpam, - "replaced": DeliveryActionReplaced, - "unknown": DeliveryActionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeliveryAction(input) - return &out, nil -} - -type DeliveryLocation string - -const ( - DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" - DeliveryLocationDropped DeliveryLocation = "Dropped" - DeliveryLocationExternal DeliveryLocation = "External" - DeliveryLocationFailed DeliveryLocation = "Failed" - DeliveryLocationForwarded DeliveryLocation = "Forwarded" - DeliveryLocationInbox DeliveryLocation = "Inbox" - DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" - DeliveryLocationQuarantine DeliveryLocation = "Quarantine" - DeliveryLocationUnknown DeliveryLocation = "Unknown" -) - -func PossibleValuesForDeliveryLocation() []string { - return []string{ - string(DeliveryLocationDeletedFolder), - string(DeliveryLocationDropped), - string(DeliveryLocationExternal), - string(DeliveryLocationFailed), - string(DeliveryLocationForwarded), - string(DeliveryLocationInbox), - string(DeliveryLocationJunkFolder), - string(DeliveryLocationQuarantine), - string(DeliveryLocationUnknown), - } -} - -func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeliveryLocation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeliveryLocation(input string) (*DeliveryLocation, error) { - vals := map[string]DeliveryLocation{ - "deletedfolder": DeliveryLocationDeletedFolder, - "dropped": DeliveryLocationDropped, - "external": DeliveryLocationExternal, - "failed": DeliveryLocationFailed, - "forwarded": DeliveryLocationForwarded, - "inbox": DeliveryLocationInbox, - "junkfolder": DeliveryLocationJunkFolder, - "quarantine": DeliveryLocationQuarantine, - "unknown": DeliveryLocationUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeliveryLocation(input) - return &out, nil -} - -type ElevationToken string - -const ( - ElevationTokenDefault ElevationToken = "Default" - ElevationTokenFull ElevationToken = "Full" - ElevationTokenLimited ElevationToken = "Limited" -) - -func PossibleValuesForElevationToken() []string { - return []string{ - string(ElevationTokenDefault), - string(ElevationTokenFull), - string(ElevationTokenLimited), - } -} - -func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseElevationToken(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseElevationToken(input string) (*ElevationToken, error) { - vals := map[string]ElevationToken{ - "default": ElevationTokenDefault, - "full": ElevationTokenFull, - "limited": ElevationTokenLimited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ElevationToken(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type FileHashAlgorithm string - -const ( - FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" - FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" - FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" - FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" - FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" -) - -func PossibleValuesForFileHashAlgorithm() []string { - return []string{ - string(FileHashAlgorithmMDFive), - string(FileHashAlgorithmSHAOne), - string(FileHashAlgorithmSHATwoFiveSix), - string(FileHashAlgorithmSHATwoFiveSixAC), - string(FileHashAlgorithmUnknown), - } -} - -func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFileHashAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { - vals := map[string]FileHashAlgorithm{ - "md5": FileHashAlgorithmMDFive, - "sha1": FileHashAlgorithmSHAOne, - "sha256": FileHashAlgorithmSHATwoFiveSix, - "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, - "unknown": FileHashAlgorithmUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FileHashAlgorithm(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} - -type OSFamily string - -const ( - OSFamilyAndroid OSFamily = "Android" - OSFamilyIOS OSFamily = "IOS" - OSFamilyLinux OSFamily = "Linux" - OSFamilyUnknown OSFamily = "Unknown" - OSFamilyWindows OSFamily = "Windows" -) - -func PossibleValuesForOSFamily() []string { - return []string{ - string(OSFamilyAndroid), - string(OSFamilyIOS), - string(OSFamilyLinux), - string(OSFamilyUnknown), - string(OSFamilyWindows), - } -} - -func (s *OSFamily) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOSFamily(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOSFamily(input string) (*OSFamily, error) { - vals := map[string]OSFamily{ - "android": OSFamilyAndroid, - "ios": OSFamilyIOS, - "linux": OSFamilyLinux, - "unknown": OSFamilyUnknown, - "windows": OSFamilyWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OSFamily(input) - return &out, nil -} - -type RegistryHive string - -const ( - RegistryHiveHKEYA RegistryHive = "HKEY_A" - RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" - RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" - RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" - RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" - RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" - RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" - RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" - RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" - RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" -) - -func PossibleValuesForRegistryHive() []string { - return []string{ - string(RegistryHiveHKEYA), - string(RegistryHiveHKEYCLASSESROOT), - string(RegistryHiveHKEYCURRENTCONFIG), - string(RegistryHiveHKEYCURRENTUSER), - string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), - string(RegistryHiveHKEYLOCALMACHINE), - string(RegistryHiveHKEYPERFORMANCEDATA), - string(RegistryHiveHKEYPERFORMANCENLSTEXT), - string(RegistryHiveHKEYPERFORMANCETEXT), - string(RegistryHiveHKEYUSERS), - } -} - -func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryHive(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryHive(input string) (*RegistryHive, error) { - vals := map[string]RegistryHive{ - "hkey_a": RegistryHiveHKEYA, - "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, - "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, - "hkey_current_user": RegistryHiveHKEYCURRENTUSER, - "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, - "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, - "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, - "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, - "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, - "hkey_users": RegistryHiveHKEYUSERS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryHive(input) - return &out, nil -} - -type RegistryValueKind string - -const ( - RegistryValueKindBinary RegistryValueKind = "Binary" - RegistryValueKindDWord RegistryValueKind = "DWord" - RegistryValueKindExpandString RegistryValueKind = "ExpandString" - RegistryValueKindMultiString RegistryValueKind = "MultiString" - RegistryValueKindNone RegistryValueKind = "None" - RegistryValueKindQWord RegistryValueKind = "QWord" - RegistryValueKindString RegistryValueKind = "String" - RegistryValueKindUnknown RegistryValueKind = "Unknown" -) - -func PossibleValuesForRegistryValueKind() []string { - return []string{ - string(RegistryValueKindBinary), - string(RegistryValueKindDWord), - string(RegistryValueKindExpandString), - string(RegistryValueKindMultiString), - string(RegistryValueKindNone), - string(RegistryValueKindQWord), - string(RegistryValueKindString), - string(RegistryValueKindUnknown), - } -} - -func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryValueKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryValueKind(input string) (*RegistryValueKind, error) { - vals := map[string]RegistryValueKind{ - "binary": RegistryValueKindBinary, - "dword": RegistryValueKindDWord, - "expandstring": RegistryValueKindExpandString, - "multistring": RegistryValueKindMultiString, - "none": RegistryValueKindNone, - "qword": RegistryValueKindQWord, - "string": RegistryValueKindString, - "unknown": RegistryValueKindUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryValueKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentity.go deleted file mode 100644 index 36622cda50b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = AccountEntity{} - -type AccountEntity struct { - Properties *AccountEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AccountEntity{} - -func (s AccountEntity) MarshalJSON() ([]byte, error) { - type wrapper AccountEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) - } - decoded["kind"] = "Account" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentityproperties.go deleted file mode 100644 index 95fb7cc52ad..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_accountentityproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountEntityProperties struct { - AadTenantId *string `json:"aadTenantId,omitempty"` - AadUserId *string `json:"aadUserId,omitempty"` - AccountName *string `json:"accountName,omitempty"` - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - DnsDomain *string `json:"dnsDomain,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - NtDomain *string `json:"ntDomain,omitempty"` - ObjectGuid *string `json:"objectGuid,omitempty"` - Puid *string `json:"puid,omitempty"` - Sid *string `json:"sid,omitempty"` - UpnSuffix *string `json:"upnSuffix,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentity.go deleted file mode 100644 index 6947a9b96e5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = AzureResourceEntity{} - -type AzureResourceEntity struct { - Properties *AzureResourceEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AzureResourceEntity{} - -func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { - type wrapper AzureResourceEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) - } - decoded["kind"] = "AzureResource" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentityproperties.go deleted file mode 100644 index db2fe348b06..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_azureresourceentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureResourceEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentity.go deleted file mode 100644 index 73b7fb5b308..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = CloudApplicationEntity{} - -type CloudApplicationEntity struct { - Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CloudApplicationEntity{} - -func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { - type wrapper CloudApplicationEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) - } - decoded["kind"] = "CloudApplication" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentityproperties.go deleted file mode 100644 index 8b2d40b573f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_cloudapplicationentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CloudApplicationEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AppId *int64 `json:"appId,omitempty"` - AppName *string `json:"appName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentity.go deleted file mode 100644 index 81c3c0dac5b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = DnsEntity{} - -type DnsEntity struct { - Properties *DnsEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DnsEntity{} - -func (s DnsEntity) MarshalJSON() ([]byte, error) { - type wrapper DnsEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) - } - decoded["kind"] = "DnsResolution" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentityproperties.go deleted file mode 100644 index fa580d56344..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_dnsentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` - DomainName *string `json:"domainName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` - IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_entity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_entity.go deleted file mode 100644 index e648085f87e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_entity.go +++ /dev/null @@ -1,213 +0,0 @@ -package entitytypes - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Account") { - var out AccountEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureResource") { - var out AzureResourceEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "CloudApplication") { - var out CloudApplicationEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "DnsResolution") { - var out DnsEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "File") { - var out FileEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "FileHash") { - var out FileHashEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Host") { - var out HostEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Ip") { - var out IPEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IoTDevice") { - var out IoTDeviceEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MailCluster") { - var out MailClusterEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MailMessage") { - var out MailMessageEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Mailbox") { - var out MailboxEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Malware") { - var out MalwareEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Process") { - var out ProcessEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RegistryKey") { - var out RegistryKeyEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RegistryValue") { - var out RegistryValueEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityGroup") { - var out SecurityGroupEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SubmissionMail") { - var out SubmissionMailEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Url") { - var out UrlEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlEntity: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentity.go deleted file mode 100644 index 98411b9b140..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = FileEntity{} - -type FileEntity struct { - Properties *FileEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FileEntity{} - -func (s FileEntity) MarshalJSON() ([]byte, error) { - type wrapper FileEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FileEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) - } - decoded["kind"] = "File" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentityproperties.go deleted file mode 100644 index 257ffb1ba04..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_fileentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FileEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Directory *string `json:"directory,omitempty"` - FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` - FileName *string `json:"fileName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentity.go deleted file mode 100644 index bf05183c64b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = FileHashEntity{} - -type FileHashEntity struct { - Properties *FileHashEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FileHashEntity{} - -func (s FileHashEntity) MarshalJSON() ([]byte, error) { - type wrapper FileHashEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) - } - decoded["kind"] = "FileHash" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentityproperties.go deleted file mode 100644 index d8097218e1d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_filehashentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FileHashEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HashValue *string `json:"hashValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_geolocation.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_geolocation.go deleted file mode 100644 index 53a44e73dcd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_geolocation.go +++ /dev/null @@ -1,14 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GeoLocation struct { - Asn *int64 `json:"asn,omitempty"` - City *string `json:"city,omitempty"` - CountryCode *string `json:"countryCode,omitempty"` - CountryName *string `json:"countryName,omitempty"` - Latitude *float64 `json:"latitude,omitempty"` - Longitude *float64 `json:"longitude,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentity.go deleted file mode 100644 index 90b206a2d15..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = HostEntity{} - -type HostEntity struct { - Properties *HostEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HostEntity{} - -func (s HostEntity) MarshalJSON() ([]byte, error) { - type wrapper HostEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HostEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) - } - decoded["kind"] = "Host" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentityproperties.go deleted file mode 100644 index aeff0d09403..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_hostentityproperties.go +++ /dev/null @@ -1,18 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AzureID *string `json:"azureID,omitempty"` - DnsDomain *string `json:"dnsDomain,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostName *string `json:"hostName,omitempty"` - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - NetBiosName *string `json:"netBiosName,omitempty"` - NtDomain *string `json:"ntDomain,omitempty"` - OmsAgentID *string `json:"omsAgentID,omitempty"` - OsFamily *OSFamily `json:"osFamily,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmark.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmark.go deleted file mode 100644 index e86ba910de6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmark.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmarkproperties.go deleted file mode 100644 index 5ebc3ac122f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package entitytypes - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_incidentinfo.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_incidentinfo.go deleted file mode 100644 index 80d014f5289..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentity.go deleted file mode 100644 index 3828d0cf7d2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = IoTDeviceEntity{} - -type IoTDeviceEntity struct { - Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IoTDeviceEntity{} - -func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { - type wrapper IoTDeviceEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) - } - decoded["kind"] = "IoTDevice" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentityproperties.go deleted file mode 100644 index f6619ce0b99..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_iotdeviceentityproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTDeviceEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DeviceId *string `json:"deviceId,omitempty"` - DeviceName *string `json:"deviceName,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - EdgeId *string `json:"edgeId,omitempty"` - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` - IotHubEntityId *string `json:"iotHubEntityId,omitempty"` - IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - Model *string `json:"model,omitempty"` - OperatingSystem *string `json:"operatingSystem,omitempty"` - Protocols *[]string `json:"protocols,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentity.go deleted file mode 100644 index e062bf2295a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = IPEntity{} - -type IPEntity struct { - Properties *IPEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IPEntity{} - -func (s IPEntity) MarshalJSON() ([]byte, error) { - type wrapper IPEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IPEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) - } - decoded["kind"] = "Ip" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentityproperties.go deleted file mode 100644 index b0cf7442a43..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_ipentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Address *string `json:"address,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Location *GeoLocation `json:"location,omitempty"` - ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentity.go deleted file mode 100644 index 57dee77697e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailboxEntity{} - -type MailboxEntity struct { - Properties *MailboxEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailboxEntity{} - -func (s MailboxEntity) MarshalJSON() ([]byte, error) { - type wrapper MailboxEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) - } - decoded["kind"] = "Mailbox" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentityproperties.go deleted file mode 100644 index 8d1b787b9c9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailboxentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MailboxEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` - Upn *string `json:"upn,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentity.go deleted file mode 100644 index afa0db447b6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailClusterEntity{} - -type MailClusterEntity struct { - Properties *MailClusterEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailClusterEntity{} - -func (s MailClusterEntity) MarshalJSON() ([]byte, error) { - type wrapper MailClusterEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) - } - decoded["kind"] = "MailCluster" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentityproperties.go deleted file mode 100644 index 6b6724b72a7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailclusterentityproperties.go +++ /dev/null @@ -1,66 +0,0 @@ -package entitytypes - -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 MailClusterEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - ClusterGroup *string `json:"clusterGroup,omitempty"` - ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` - ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` - ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` - ClusterSourceType *string `json:"clusterSourceType,omitempty"` - CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` - CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` - CountByThreatType *interface{} `json:"countByThreatType,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` - MailCount *int64 `json:"mailCount,omitempty"` - NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` - Query *string `json:"query,omitempty"` - QueryTime *string `json:"queryTime,omitempty"` - Source *string `json:"source,omitempty"` - Threats *[]string `json:"threats,omitempty"` -} - -func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { - if o.ClusterQueryEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ClusterQueryEndTime = &formatted -} - -func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { - if o.ClusterQueryStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ClusterQueryStartTime = &formatted -} - -func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { - if o.QueryTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryTime = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentity.go deleted file mode 100644 index e0fef66bf3b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailMessageEntity{} - -type MailMessageEntity struct { - Properties *MailMessageEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailMessageEntity{} - -func (s MailMessageEntity) MarshalJSON() ([]byte, error) { - type wrapper MailMessageEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) - } - decoded["kind"] = "MailMessage" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentityproperties.go deleted file mode 100644 index 48c4bfe7c77..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_mailmessageentityproperties.go +++ /dev/null @@ -1,52 +0,0 @@ -package entitytypes - -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 MailMessageEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` - BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` - BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` - BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` - BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` - BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` - DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` - DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` - FileEntityIds *[]string `json:"fileEntityIds,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - InternetMessageId *string `json:"internetMessageId,omitempty"` - Language *string `json:"language,omitempty"` - NetworkMessageId *string `json:"networkMessageId,omitempty"` - P1Sender *string `json:"p1Sender,omitempty"` - P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` - P1SenderDomain *string `json:"p1SenderDomain,omitempty"` - P2Sender *string `json:"p2Sender,omitempty"` - P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` - P2SenderDomain *string `json:"p2SenderDomain,omitempty"` - ReceiveDate *string `json:"receiveDate,omitempty"` - Recipient *string `json:"recipient,omitempty"` - SenderIP *string `json:"senderIP,omitempty"` - Subject *string `json:"subject,omitempty"` - ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` - Threats *[]string `json:"threats,omitempty"` - Urls *[]string `json:"urls,omitempty"` -} - -func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { - if o.ReceiveDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ReceiveDate = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentity.go deleted file mode 100644 index 01b3f9cda92..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MalwareEntity{} - -type MalwareEntity struct { - Properties *MalwareEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MalwareEntity{} - -func (s MalwareEntity) MarshalJSON() ([]byte, error) { - type wrapper MalwareEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) - } - decoded["kind"] = "Malware" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentityproperties.go deleted file mode 100644 index 99a3529f02f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_malwareentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MalwareEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Category *string `json:"category,omitempty"` - FileEntityIds *[]string `json:"fileEntityIds,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - MalwareName *string `json:"malwareName,omitempty"` - ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentity.go deleted file mode 100644 index b3d0be74fd8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = ProcessEntity{} - -type ProcessEntity struct { - Properties *ProcessEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ProcessEntity{} - -func (s ProcessEntity) MarshalJSON() ([]byte, error) { - type wrapper ProcessEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) - } - decoded["kind"] = "Process" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentityproperties.go deleted file mode 100644 index 49e9b63fe4a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_processentityproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package entitytypes - -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 ProcessEntityProperties struct { - AccountEntityId *string `json:"accountEntityId,omitempty"` - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - CommandLine *string `json:"commandLine,omitempty"` - CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` - ElevationToken *ElevationToken `json:"elevationToken,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` - ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` - ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` - ProcessId *string `json:"processId,omitempty"` -} - -func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { - if o.CreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentity.go deleted file mode 100644 index bef73eb2c5b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = RegistryKeyEntity{} - -type RegistryKeyEntity struct { - Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = RegistryKeyEntity{} - -func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { - type wrapper RegistryKeyEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) - } - decoded["kind"] = "RegistryKey" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentityproperties.go deleted file mode 100644 index f91f75ea021..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registrykeyentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryKeyEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Hive *RegistryHive `json:"hive,omitempty"` - Key *string `json:"key,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentity.go deleted file mode 100644 index 45599924191..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = RegistryValueEntity{} - -type RegistryValueEntity struct { - Properties *RegistryValueEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = RegistryValueEntity{} - -func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { - type wrapper RegistryValueEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) - } - decoded["kind"] = "RegistryValue" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentityproperties.go deleted file mode 100644 index c368632a1d3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_registryvalueentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryValueEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KeyEntityId *string `json:"keyEntityId,omitempty"` - ValueData *string `json:"valueData,omitempty"` - ValueName *string `json:"valueName,omitempty"` - ValueType *RegistryValueKind `json:"valueType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalert.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalert.go deleted file mode 100644 index cfda2671eec..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalert.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertproperties.go deleted file mode 100644 index 105a41b9daf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package entitytypes - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index 1560939747b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentity.go deleted file mode 100644 index 71a694b6c72..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SecurityGroupEntity{} - -type SecurityGroupEntity struct { - Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityGroupEntity{} - -func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { - type wrapper SecurityGroupEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) - } - decoded["kind"] = "SecurityGroup" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentityproperties.go deleted file mode 100644 index 458b2ccbfb1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_securitygroupentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DistinguishedName *string `json:"distinguishedName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ObjectGuid *string `json:"objectGuid,omitempty"` - Sid *string `json:"sid,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentity.go deleted file mode 100644 index ff1c9193b12..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SubmissionMailEntity{} - -type SubmissionMailEntity struct { - Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SubmissionMailEntity{} - -func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { - type wrapper SubmissionMailEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) - } - decoded["kind"] = "SubmissionMail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentityproperties.go deleted file mode 100644 index f28988a5d5b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_submissionmailentityproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package entitytypes - -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 SubmissionMailEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - NetworkMessageId *string `json:"networkMessageId,omitempty"` - Recipient *string `json:"recipient,omitempty"` - ReportType *string `json:"reportType,omitempty"` - Sender *string `json:"sender,omitempty"` - SenderIP *string `json:"senderIp,omitempty"` - Subject *string `json:"subject,omitempty"` - SubmissionDate *string `json:"submissionDate,omitempty"` - SubmissionId *string `json:"submissionId,omitempty"` - Submitter *string `json:"submitter,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` -} - -func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { - if o.SubmissionDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.SubmissionDate = &formatted -} - -func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_systemdata.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_systemdata.go deleted file mode 100644 index 862ee7fdbaf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_systemdata.go +++ /dev/null @@ -1,43 +0,0 @@ -package entitytypes - -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 SystemData struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *CreatedByType `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` -} - -func (o *SystemData) GetCreatedAtAsTime() (*time.Time, error) { - if o.CreatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *SystemData) SetCreatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedAt = &formatted -} - -func (o *SystemData) GetLastModifiedAtAsTime() (*time.Time, error) { - if o.LastModifiedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *SystemData) SetLastModifiedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedAt = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_threatintelligence.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_threatintelligence.go deleted file mode 100644 index e225a18045c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_threatintelligence.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligence struct { - Confidence *float64 `json:"confidence,omitempty"` - ProviderName *string `json:"providerName,omitempty"` - ReportLink *string `json:"reportLink,omitempty"` - ThreatDescription *string `json:"threatDescription,omitempty"` - ThreatName *string `json:"threatName,omitempty"` - ThreatType *string `json:"threatType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentity.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentity.go deleted file mode 100644 index a6d90352180..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = UrlEntity{} - -type UrlEntity struct { - Properties *UrlEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = UrlEntity{} - -func (s UrlEntity) MarshalJSON() ([]byte, error) { - type wrapper UrlEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling UrlEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlEntity: %+v", err) - } - decoded["kind"] = "Url" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling UrlEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentityproperties.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentityproperties.go deleted file mode 100644 index 2d3b7085055..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_urlentityproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UrlEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_userinfo.go deleted file mode 100644 index 9b6d8135aea..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/version.go b/resource-manager/securityinsights/2021-09-01-preview/entitytypes/version.go deleted file mode 100644 index baba9b85718..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/entitytypes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entitytypes/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/README.md deleted file mode 100644 index 47f7ba22a61..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentalerts` Documentation - -The `incidentalerts` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidentalerts" -``` - - -### Client Initialization - -```go -client := incidentalerts.NewIncidentAlertsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentAlertsClient.IncidentsListAlerts` - -```go -ctx := context.TODO() -id := incidentalerts.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -read, err := client.IncidentsListAlerts(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/securityinsights/2021-09-01-preview/incidentalerts/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/client.go deleted file mode 100644 index 53dc2b4cd4e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentalerts - -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 IncidentAlertsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentAlertsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentAlertsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentalerts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentAlertsClient: %+v", err) - } - - return &IncidentAlertsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/constants.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/constants.go deleted file mode 100644 index e7252cfe5ce..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/constants.go +++ /dev/null @@ -1,494 +0,0 @@ -package incidentalerts - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident.go deleted file mode 100644 index 6145c7882c4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentalerts - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident_test.go deleted file mode 100644 index 8bb97137cf9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentalerts - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidentalerts/method_incidentslistalerts.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/method_incidentslistalerts.go deleted file mode 100644 index a6b61790e56..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/method_incidentslistalerts.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidentalerts - -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 IncidentsListAlertsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentAlertList -} - -// IncidentsListAlerts ... -func (c IncidentAlertsClient) IncidentsListAlerts(ctx context.Context, id IncidentId) (result IncidentsListAlertsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/alerts", 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 IncidentAlertList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_entity.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_entity.go deleted file mode 100644 index 8a6c7ffef8e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidentalerts - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmark.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmark.go deleted file mode 100644 index 827ded08f6d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentalerts - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmarkproperties.go deleted file mode 100644 index f12788659cd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidentalerts - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentalertlist.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentalertlist.go deleted file mode 100644 index 5ce96fd6aa8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentalertlist.go +++ /dev/null @@ -1,8 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentAlertList struct { - Value []SecurityAlert `json:"value"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentinfo.go deleted file mode 100644 index af30d557ee7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalert.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalert.go deleted file mode 100644 index 3935326a1d2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentalerts - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertproperties.go deleted file mode 100644 index 99d6a0318e9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidentalerts - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index f7b76c4041c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_userinfo.go deleted file mode 100644 index 6093aa77979..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/version.go deleted file mode 100644 index 0e09f58122c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentalerts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentalerts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentalerts/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/README.md deleted file mode 100644 index 15577cfa51f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks` Documentation - -The `incidentbookmarks` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidentbookmarks" -``` - - -### Client Initialization - -```go -client := incidentbookmarks.NewIncidentBookmarksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentBookmarksClient.IncidentsListBookmarks` - -```go -ctx := context.TODO() -id := incidentbookmarks.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -read, err := client.IncidentsListBookmarks(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/securityinsights/2021-09-01-preview/incidentbookmarks/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/client.go deleted file mode 100644 index e6a60ede52d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentbookmarks - -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 IncidentBookmarksClient struct { - Client *resourcemanager.Client -} - -func NewIncidentBookmarksClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentBookmarksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentbookmarks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentBookmarksClient: %+v", err) - } - - return &IncidentBookmarksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/constants.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/constants.go deleted file mode 100644 index 6a4c429d22f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/constants.go +++ /dev/null @@ -1,494 +0,0 @@ -package incidentbookmarks - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident.go deleted file mode 100644 index f2bd006b056..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentbookmarks - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident_test.go deleted file mode 100644 index f17dbe1c939..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentbookmarks - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidentbookmarks/method_incidentslistbookmarks.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/method_incidentslistbookmarks.go deleted file mode 100644 index ea658d25e66..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/method_incidentslistbookmarks.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidentbookmarks - -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 IncidentsListBookmarksOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentBookmarkList -} - -// IncidentsListBookmarks ... -func (c IncidentBookmarksClient) IncidentsListBookmarks(ctx context.Context, id IncidentId) (result IncidentsListBookmarksOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/bookmarks", 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 IncidentBookmarkList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_entity.go deleted file mode 100644 index ac882c04383..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidentbookmarks - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmark.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmark.go deleted file mode 100644 index 1e9bfbf488f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentbookmarks - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go deleted file mode 100644 index e5e13270882..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidentbookmarks - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentbookmarklist.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentbookmarklist.go deleted file mode 100644 index cfeedfda4ac..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentbookmarklist.go +++ /dev/null @@ -1,8 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentBookmarkList struct { - Value []HuntingBookmark `json:"value"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentinfo.go deleted file mode 100644 index 0a1b8d71c42..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalert.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalert.go deleted file mode 100644 index a86152f3c69..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentbookmarks - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertproperties.go deleted file mode 100644 index 68387d97736..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidentbookmarks - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index d0dec8bc6c2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_userinfo.go deleted file mode 100644 index b585f0bdd6d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/version.go deleted file mode 100644 index 19a5bc16a5c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentbookmarks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentbookmarks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentbookmarks/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/README.md deleted file mode 100644 index d197c1b58ab..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentcomments` Documentation - -The `incidentcomments` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidentcomments" -``` - - -### Client Initialization - -```go -client := incidentcomments.NewIncidentCommentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentCommentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -payload := incidentcomments.IncidentComment{ - // ... -} - - -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: `IncidentCommentsClient.Delete` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -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: `IncidentCommentsClient.Get` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -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: `IncidentCommentsClient.List` - -```go -ctx := context.TODO() -id := incidentcomments.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -// alternatively `client.List(ctx, id, incidentcomments.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidentcomments.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/client.go deleted file mode 100644 index 981e6f75216..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentcomments - -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 IncidentCommentsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentCommentsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentCommentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentcomments", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentCommentsClient: %+v", err) - } - - return &IncidentCommentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment.go deleted file mode 100644 index 1c431622bbe..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment.go +++ /dev/null @@ -1,150 +0,0 @@ -package incidentcomments - -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(&CommentId{}) -} - -var _ resourceids.ResourceId = &CommentId{} - -// CommentId is a struct representing the Resource ID for a Comment -type CommentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string - IncidentCommentId string -} - -// NewCommentID returns a new CommentId struct -func NewCommentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string, incidentCommentId string) CommentId { - return CommentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - IncidentCommentId: incidentCommentId, - } -} - -// ParseCommentID parses 'input' into a CommentId -func ParseCommentID(input string) (*CommentId, error) { - parser := resourceids.NewParserFromResourceIdType(&CommentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CommentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCommentIDInsensitively parses 'input' case-insensitively into a CommentId -// note: this method should only be used for API response data and not user input -func ParseCommentIDInsensitively(input string) (*CommentId, error) { - parser := resourceids.NewParserFromResourceIdType(&CommentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CommentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CommentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - if id.IncidentCommentId, ok = input.Parsed["incidentCommentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentCommentId", input) - } - - return nil -} - -// ValidateCommentID checks that 'input' can be parsed as a Comment ID -func ValidateCommentID(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 := ParseCommentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Comment ID -func (id CommentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s/comments/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId, id.IncidentCommentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Comment ID -func (id CommentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - resourceids.StaticSegment("staticComments", "comments", "comments"), - resourceids.UserSpecifiedSegment("incidentCommentId", "incidentCommentIdValue"), - } -} - -// String returns a human-readable description of this Comment ID -func (id CommentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - fmt.Sprintf("Incident Comment: %q", id.IncidentCommentId), - } - return fmt.Sprintf("Comment (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment_test.go deleted file mode 100644 index 5dd784507fa..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_comment_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package incidentcomments - -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 = &CommentId{} - -func TestNewCommentID(t *testing.T) { - id := NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } - - if id.IncidentCommentId != "incidentCommentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentCommentId'", id.IncidentCommentId, "incidentCommentIdValue") - } -} - -func TestFormatCommentID(t *testing.T) { - actual := NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCommentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - IncidentCommentId: "incidentCommentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.IncidentCommentId != v.Expected.IncidentCommentId { - t.Fatalf("Expected %q but got %q for IncidentCommentId", v.Expected.IncidentCommentId, actual.IncidentCommentId) - } - - } -} - -func TestParseCommentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - IncidentCommentId: "incidentCommentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS/iNcIdEnTcOmMeNtIdVaLuE", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - IncidentCommentId: "iNcIdEnTcOmMeNtIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS/iNcIdEnTcOmMeNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.IncidentCommentId != v.Expected.IncidentCommentId { - t.Fatalf("Expected %q but got %q for IncidentCommentId", v.Expected.IncidentCommentId, actual.IncidentCommentId) - } - - } -} - -func TestSegmentsForCommentId(t *testing.T) { - segments := CommentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CommentId 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/securityinsights/2021-09-01-preview/incidentcomments/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident.go deleted file mode 100644 index 94bb1fcdd3c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentcomments - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident_test.go deleted file mode 100644 index 97fe12c64e1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentcomments - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidentcomments/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_createorupdate.go deleted file mode 100644 index 6ea7a1ed4dc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentcomments - -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 *IncidentComment -} - -// CreateOrUpdate ... -func (c IncidentCommentsClient) CreateOrUpdate(ctx context.Context, id CommentId, input IncidentComment) (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 IncidentComment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_delete.go deleted file mode 100644 index 78412a13e76..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentcomments - -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 IncidentCommentsClient) Delete(ctx context.Context, id CommentId) (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/securityinsights/2021-09-01-preview/incidentcomments/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_get.go deleted file mode 100644 index 1942042dbea..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidentcomments - -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 *IncidentComment -} - -// Get ... -func (c IncidentCommentsClient) Get(ctx context.Context, id CommentId) (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 IncidentComment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_list.go deleted file mode 100644 index b4c16058b38..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidentcomments - -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 *[]IncidentComment -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IncidentComment -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentCommentsClient) List(ctx context.Context, id IncidentId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/comments", id.ID()), - OptionsObject: options, - } - - 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 *[]IncidentComment `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 IncidentCommentsClient) ListComplete(ctx context.Context, id IncidentId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, IncidentCommentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentCommentsClient) ListCompleteMatchingPredicate(ctx context.Context, id IncidentId, options ListOperationOptions, predicate IncidentCommentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IncidentComment, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2021-09-01-preview/incidentcomments/model_clientinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_clientinfo.go deleted file mode 100644 index 55cc93b9c5d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_clientinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentcomments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcomment.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcomment.go deleted file mode 100644 index 93ee7dc82f8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcomment.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidentcomments - -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 IncidentComment struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IncidentCommentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcommentproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcommentproperties.go deleted file mode 100644 index 233937ddedc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/model_incidentcommentproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package incidentcomments - -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 IncidentCommentProperties struct { - Author *ClientInfo `json:"author,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Message string `json:"message"` -} - -func (o *IncidentCommentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentCommentProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *IncidentCommentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentCommentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/predicates.go deleted file mode 100644 index 434091dbb53..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidentcomments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentCommentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p IncidentCommentOperationPredicate) Matches(input IncidentComment) 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.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/securityinsights/2021-09-01-preview/incidentcomments/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/version.go deleted file mode 100644 index 30307ae6377..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentcomments/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentcomments - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentcomments/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidententities/README.md deleted file mode 100644 index 6a6d870dc30..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidententities` Documentation - -The `incidententities` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidententities" -``` - - -### Client Initialization - -```go -client := incidententities.NewIncidentEntitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentEntitiesClient.IncidentsListEntities` - -```go -ctx := context.TODO() -id := incidententities.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -read, err := client.IncidentsListEntities(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/securityinsights/2021-09-01-preview/incidententities/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/client.go deleted file mode 100644 index 740e7b81755..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidententities - -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 IncidentEntitiesClient struct { - Client *resourcemanager.Client -} - -func NewIncidentEntitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentEntitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidententities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentEntitiesClient: %+v", err) - } - - return &IncidentEntitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/constants.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/constants.go deleted file mode 100644 index d153eca4b63..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/constants.go +++ /dev/null @@ -1,494 +0,0 @@ -package incidententities - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident.go deleted file mode 100644 index c5a5ad1f7ba..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidententities - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident_test.go deleted file mode 100644 index 42b5ee10ef8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidententities - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidententities/method_incidentslistentities.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/method_incidentslistentities.go deleted file mode 100644 index 2723b2f44a9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/method_incidentslistentities.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidententities - -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 IncidentsListEntitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentEntitiesResponse -} - -// IncidentsListEntities ... -func (c IncidentEntitiesClient) IncidentsListEntities(ctx context.Context, id IncidentId) (result IncidentsListEntitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/entities", 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 IncidentEntitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_entity.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_entity.go deleted file mode 100644 index 43a9a64c0bf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidententities - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmark.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmark.go deleted file mode 100644 index f001f6b783a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmarkproperties.go deleted file mode 100644 index 278d0da2ec5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidententities - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresponse.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresponse.go deleted file mode 100644 index ab896895768..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresponse.go +++ /dev/null @@ -1,49 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentEntitiesResponse struct { - Entities *[]Entity `json:"entities,omitempty"` - MetaData *[]IncidentEntitiesResultsMetadata `json:"metaData,omitempty"` -} - -var _ json.Unmarshaler = &IncidentEntitiesResponse{} - -func (s *IncidentEntitiesResponse) UnmarshalJSON(bytes []byte) error { - type alias IncidentEntitiesResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into IncidentEntitiesResponse: %+v", err) - } - - s.MetaData = decoded.MetaData - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling IncidentEntitiesResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["entities"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Entities into list []json.RawMessage: %+v", err) - } - - output := make([]Entity, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Entities' for 'IncidentEntitiesResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Entities = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresultsmetadata.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresultsmetadata.go deleted file mode 100644 index 746b4e604b9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidententitiesresultsmetadata.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentEntitiesResultsMetadata struct { - Count int64 `json:"count"` - EntityKind EntityKind `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidentinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidentinfo.go deleted file mode 100644 index ec816413c8c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalert.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalert.go deleted file mode 100644 index 9d570306524..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertproperties.go deleted file mode 100644 index bdfa3d19c6d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidententities - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index 8f8651c6ef8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_userinfo.go deleted file mode 100644 index 3faed5bd1cf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidententities/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidententities/version.go deleted file mode 100644 index 556dbf51cfe..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidententities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidententities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidententities/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/README.md deleted file mode 100644 index c1f69b067fb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentrelations` Documentation - -The `incidentrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidentrelations" -``` - - -### Client Initialization - -```go -client := incidentrelations.NewIncidentRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentRelationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -payload := incidentrelations.Relation{ - // ... -} - - -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: `IncidentRelationsClient.Delete` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -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: `IncidentRelationsClient.Get` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -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: `IncidentRelationsClient.List` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -// alternatively `client.List(ctx, id, incidentrelations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidentrelations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/client.go deleted file mode 100644 index 4e8fbfeb71d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentrelations - -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 IncidentRelationsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentRelationsClient: %+v", err) - } - - return &IncidentRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident.go deleted file mode 100644 index 5fd6ef03d73..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentrelations - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident_test.go deleted file mode 100644 index 6b45b36072f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentrelations - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation.go deleted file mode 100644 index 81731639476..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation.go +++ /dev/null @@ -1,150 +0,0 @@ -package incidentrelations - -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(&IncidentRelationId{}) -} - -var _ resourceids.ResourceId = &IncidentRelationId{} - -// IncidentRelationId is a struct representing the Resource ID for a Incident Relation -type IncidentRelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string - RelationName string -} - -// NewIncidentRelationID returns a new IncidentRelationId struct -func NewIncidentRelationID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string, relationName string) IncidentRelationId { - return IncidentRelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - RelationName: relationName, - } -} - -// ParseIncidentRelationID parses 'input' into a IncidentRelationId -func ParseIncidentRelationID(input string) (*IncidentRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentRelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentRelationIDInsensitively parses 'input' case-insensitively into a IncidentRelationId -// note: this method should only be used for API response data and not user input -func ParseIncidentRelationIDInsensitively(input string) (*IncidentRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentRelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentRelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateIncidentRelationID checks that 'input' can be parsed as a Incident Relation ID -func ValidateIncidentRelationID(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 := ParseIncidentRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident Relation ID -func (id IncidentRelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident Relation ID -func (id IncidentRelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Incident Relation ID -func (id IncidentRelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Incident Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation_test.go deleted file mode 100644 index ba0fa6ec112..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/id_incidentrelation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package incidentrelations - -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 = &IncidentRelationId{} - -func TestNewIncidentRelationID(t *testing.T) { - id := NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatIncidentRelationID(t *testing.T) { - actual := NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue", - Expected: &IncidentRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseIncidentRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue", - Expected: &IncidentRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &IncidentRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForIncidentRelationId(t *testing.T) { - segments := IncidentRelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentRelationId 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/securityinsights/2021-09-01-preview/incidentrelations/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_createorupdate.go deleted file mode 100644 index ced0d3d360e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentrelations - -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 *Relation -} - -// CreateOrUpdate ... -func (c IncidentRelationsClient) CreateOrUpdate(ctx context.Context, id IncidentRelationId, input Relation) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_delete.go deleted file mode 100644 index 7206ac26d08..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentrelations - -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 IncidentRelationsClient) Delete(ctx context.Context, id IncidentRelationId) (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/securityinsights/2021-09-01-preview/incidentrelations/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_get.go deleted file mode 100644 index a96d8672089..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidentrelations - -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 *Relation -} - -// Get ... -func (c IncidentRelationsClient) Get(ctx context.Context, id IncidentRelationId) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_list.go deleted file mode 100644 index 80873d441b4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidentrelations - -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 *[]Relation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentRelationsClient) List(ctx context.Context, id IncidentId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `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 IncidentRelationsClient) ListComplete(ctx context.Context, id IncidentId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentRelationsClient) ListCompleteMatchingPredicate(ctx context.Context, id IncidentId, options ListOperationOptions, predicate RelationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2021-09-01-preview/incidentrelations/model_relation.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relation.go deleted file mode 100644 index 39b27ed1036..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidentrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relationproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relationproperties.go deleted file mode 100644 index b514fd1661e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/predicates.go deleted file mode 100644 index 35c3a9c1e3a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidentrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2021-09-01-preview/incidentrelations/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/version.go deleted file mode 100644 index f581072c275..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidents/README.md deleted file mode 100644 index 62c806614dd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidents` Documentation - -The `incidents` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidents" -``` - - -### Client Initialization - -```go -client := incidents.NewIncidentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -payload := incidents.Incident{ - // ... -} - - -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: `IncidentsClient.Delete` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -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: `IncidentsClient.Get` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -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: `IncidentsClient.List` - -```go -ctx := context.TODO() -id := incidents.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, incidents.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidents.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/client.go deleted file mode 100644 index aaf38071c39..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidents - -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 IncidentsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidents", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentsClient: %+v", err) - } - - return &IncidentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/constants.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/constants.go deleted file mode 100644 index a7c1b98fad1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/constants.go +++ /dev/null @@ -1,354 +0,0 @@ -package incidents - -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 AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type IncidentClassification string - -const ( - IncidentClassificationBenignPositive IncidentClassification = "BenignPositive" - IncidentClassificationFalsePositive IncidentClassification = "FalsePositive" - IncidentClassificationTruePositive IncidentClassification = "TruePositive" - IncidentClassificationUndetermined IncidentClassification = "Undetermined" -) - -func PossibleValuesForIncidentClassification() []string { - return []string{ - string(IncidentClassificationBenignPositive), - string(IncidentClassificationFalsePositive), - string(IncidentClassificationTruePositive), - string(IncidentClassificationUndetermined), - } -} - -func (s *IncidentClassification) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassification(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassification(input string) (*IncidentClassification, error) { - vals := map[string]IncidentClassification{ - "benignpositive": IncidentClassificationBenignPositive, - "falsepositive": IncidentClassificationFalsePositive, - "truepositive": IncidentClassificationTruePositive, - "undetermined": IncidentClassificationUndetermined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassification(input) - return &out, nil -} - -type IncidentClassificationReason string - -const ( - IncidentClassificationReasonInaccurateData IncidentClassificationReason = "InaccurateData" - IncidentClassificationReasonIncorrectAlertLogic IncidentClassificationReason = "IncorrectAlertLogic" - IncidentClassificationReasonSuspiciousActivity IncidentClassificationReason = "SuspiciousActivity" - IncidentClassificationReasonSuspiciousButExpected IncidentClassificationReason = "SuspiciousButExpected" -) - -func PossibleValuesForIncidentClassificationReason() []string { - return []string{ - string(IncidentClassificationReasonInaccurateData), - string(IncidentClassificationReasonIncorrectAlertLogic), - string(IncidentClassificationReasonSuspiciousActivity), - string(IncidentClassificationReasonSuspiciousButExpected), - } -} - -func (s *IncidentClassificationReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassificationReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassificationReason(input string) (*IncidentClassificationReason, error) { - vals := map[string]IncidentClassificationReason{ - "inaccuratedata": IncidentClassificationReasonInaccurateData, - "incorrectalertlogic": IncidentClassificationReasonIncorrectAlertLogic, - "suspiciousactivity": IncidentClassificationReasonSuspiciousActivity, - "suspiciousbutexpected": IncidentClassificationReasonSuspiciousButExpected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassificationReason(input) - return &out, nil -} - -type IncidentLabelType string - -const ( - IncidentLabelTypeSystem IncidentLabelType = "System" - IncidentLabelTypeUser IncidentLabelType = "User" -) - -func PossibleValuesForIncidentLabelType() []string { - return []string{ - string(IncidentLabelTypeSystem), - string(IncidentLabelTypeUser), - } -} - -func (s *IncidentLabelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentLabelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentLabelType(input string) (*IncidentLabelType, error) { - vals := map[string]IncidentLabelType{ - "system": IncidentLabelTypeSystem, - "user": IncidentLabelTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentLabelType(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type IncidentStatus string - -const ( - IncidentStatusActive IncidentStatus = "Active" - IncidentStatusClosed IncidentStatus = "Closed" - IncidentStatusNew IncidentStatus = "New" -) - -func PossibleValuesForIncidentStatus() []string { - return []string{ - string(IncidentStatusActive), - string(IncidentStatusClosed), - string(IncidentStatusNew), - } -} - -func (s *IncidentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentStatus(input string) (*IncidentStatus, error) { - vals := map[string]IncidentStatus{ - "active": IncidentStatusActive, - "closed": IncidentStatusClosed, - "new": IncidentStatusNew, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentStatus(input) - return &out, nil -} - -type OwnerType string - -const ( - OwnerTypeGroup OwnerType = "Group" - OwnerTypeUnknown OwnerType = "Unknown" - OwnerTypeUser OwnerType = "User" -) - -func PossibleValuesForOwnerType() []string { - return []string{ - string(OwnerTypeGroup), - string(OwnerTypeUnknown), - string(OwnerTypeUser), - } -} - -func (s *OwnerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwnerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwnerType(input string) (*OwnerType, error) { - vals := map[string]OwnerType{ - "group": OwnerTypeGroup, - "unknown": OwnerTypeUnknown, - "user": OwnerTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwnerType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident.go deleted file mode 100644 index d2a0fefd3dd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidents - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident_test.go deleted file mode 100644 index 415bc774655..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidents - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidents/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace.go deleted file mode 100644 index 9667e33b904..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package incidents - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace_test.go deleted file mode 100644 index 13cbb1918fc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package incidents - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/incidents/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/method_createorupdate.go deleted file mode 100644 index fc09e8a1cba..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidents - -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 *Incident -} - -// CreateOrUpdate ... -func (c IncidentsClient) CreateOrUpdate(ctx context.Context, id IncidentId, input Incident) (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 Incident - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/method_delete.go deleted file mode 100644 index 9b3205af5fc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidents - -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 IncidentsClient) Delete(ctx context.Context, id IncidentId) (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/securityinsights/2021-09-01-preview/incidents/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/method_get.go deleted file mode 100644 index c67e0bb22b8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidents - -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 *Incident -} - -// Get ... -func (c IncidentsClient) Get(ctx context.Context, id IncidentId) (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 Incident - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/method_list.go deleted file mode 100644 index fe19cd4d9ff..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidents - -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 *[]Incident -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Incident -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentsClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/incidents", id.ID()), - OptionsObject: options, - } - - 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 *[]Incident `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 IncidentsClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, IncidentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate IncidentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Incident, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2021-09-01-preview/incidents/model_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incident.go deleted file mode 100644 index 0c560cabced..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incident.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidents - -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 Incident struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IncidentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentadditionaldata.go deleted file mode 100644 index 7a7852f83f7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentadditionaldata.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentAdditionalData struct { - AlertProductNames *[]string `json:"alertProductNames,omitempty"` - AlertsCount *int64 `json:"alertsCount,omitempty"` - BookmarksCount *int64 `json:"bookmarksCount,omitempty"` - CommentsCount *int64 `json:"commentsCount,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentlabel.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentlabel.go deleted file mode 100644 index 706eeaa7686..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentlabel.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentLabel struct { - LabelName string `json:"labelName"` - LabelType *IncidentLabelType `json:"labelType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentownerinfo.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentownerinfo.go deleted file mode 100644 index f77549efb11..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentownerinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOwnerInfo struct { - AssignedTo *string `json:"assignedTo,omitempty"` - Email *string `json:"email,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - OwnerType *OwnerType `json:"ownerType,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentproperties.go deleted file mode 100644 index 8ecfb7aa260..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_incidentproperties.go +++ /dev/null @@ -1,81 +0,0 @@ -package incidents - -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 IncidentProperties struct { - AdditionalData *IncidentAdditionalData `json:"additionalData,omitempty"` - Classification *IncidentClassification `json:"classification,omitempty"` - ClassificationComment *string `json:"classificationComment,omitempty"` - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - Description *string `json:"description,omitempty"` - FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` - IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` - Labels *[]IncidentLabel `json:"labels,omitempty"` - LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Owner *IncidentOwnerInfo `json:"owner,omitempty"` - ProviderIncidentId *string `json:"providerIncidentId,omitempty"` - ProviderName *string `json:"providerName,omitempty"` - RelatedAnalyticRuleIds *[]string `json:"relatedAnalyticRuleIds,omitempty"` - Severity IncidentSeverity `json:"severity"` - Status IncidentStatus `json:"status"` - TeamInformation *TeamInformation `json:"teamInformation,omitempty"` - Title string `json:"title"` -} - -func (o *IncidentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *IncidentProperties) GetFirstActivityTimeUtcAsTime() (*time.Time, error) { - if o.FirstActivityTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.FirstActivityTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetFirstActivityTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.FirstActivityTimeUtc = &formatted -} - -func (o *IncidentProperties) GetLastActivityTimeUtcAsTime() (*time.Time, error) { - if o.LastActivityTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastActivityTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetLastActivityTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastActivityTimeUtc = &formatted -} - -func (o *IncidentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_teaminformation.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/model_teaminformation.go deleted file mode 100644 index 2ce83593a2a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/model_teaminformation.go +++ /dev/null @@ -1,30 +0,0 @@ -package incidents - -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 TeamInformation struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - PrimaryChannelUrl *string `json:"primaryChannelUrl,omitempty"` - TeamCreationTimeUtc *string `json:"teamCreationTimeUtc,omitempty"` - TeamId *string `json:"teamId,omitempty"` -} - -func (o *TeamInformation) GetTeamCreationTimeUtcAsTime() (*time.Time, error) { - if o.TeamCreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TeamCreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *TeamInformation) SetTeamCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TeamCreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidents/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/predicates.go deleted file mode 100644 index 6d4cc3da0be..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p IncidentOperationPredicate) Matches(input Incident) 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.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/securityinsights/2021-09-01-preview/incidents/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidents/version.go deleted file mode 100644 index 2979b307460..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidents/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidents/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/README.md b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/README.md deleted file mode 100644 index 4e61a5b2a81..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/incidentteam` Documentation - -The `incidentteam` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/incidentteam" -``` - - -### Client Initialization - -```go -client := incidentteam.NewIncidentTeamClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentTeamClient.IncidentsCreateTeam` - -```go -ctx := context.TODO() -id := incidentteam.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -payload := incidentteam.TeamProperties{ - // ... -} - - -read, err := client.IncidentsCreateTeam(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/securityinsights/2021-09-01-preview/incidentteam/client.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/client.go deleted file mode 100644 index 75ab2cfb3b1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentteam - -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 IncidentTeamClient struct { - Client *resourcemanager.Client -} - -func NewIncidentTeamClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentTeamClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentteam", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentTeamClient: %+v", err) - } - - return &IncidentTeamClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident.go deleted file mode 100644 index 00ca7e9f151..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentteam - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident_test.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident_test.go deleted file mode 100644 index 3950498c68d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentteam - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2021-09-01-preview/incidentteam/method_incidentscreateteam.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/method_incidentscreateteam.go deleted file mode 100644 index 25a784d4ab9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/method_incidentscreateteam.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentteam - -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 IncidentsCreateTeamOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *TeamInformation -} - -// IncidentsCreateTeam ... -func (c IncidentTeamClient) IncidentsCreateTeam(ctx context.Context, id IncidentId, input TeamProperties) (result IncidentsCreateTeamOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createTeam", 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 TeamInformation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teaminformation.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teaminformation.go deleted file mode 100644 index b3e84ff0fc7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teaminformation.go +++ /dev/null @@ -1,30 +0,0 @@ -package incidentteam - -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 TeamInformation struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - PrimaryChannelUrl *string `json:"primaryChannelUrl,omitempty"` - TeamCreationTimeUtc *string `json:"teamCreationTimeUtc,omitempty"` - TeamId *string `json:"teamId,omitempty"` -} - -func (o *TeamInformation) GetTeamCreationTimeUtcAsTime() (*time.Time, error) { - if o.TeamCreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TeamCreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *TeamInformation) SetTeamCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TeamCreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teamproperties.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teamproperties.go deleted file mode 100644 index 7c43f75585b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/model_teamproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentteam - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TeamProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - MemberIds *[]string `json:"memberIds,omitempty"` - TeamDescription *string `json:"teamDescription,omitempty"` - TeamName string `json:"teamName"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/version.go b/resource-manager/securityinsights/2021-09-01-preview/incidentteam/version.go deleted file mode 100644 index 5209ccc6d17..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/incidentteam/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentteam - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentteam/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/README.md b/resource-manager/securityinsights/2021-09-01-preview/metadata/README.md deleted file mode 100644 index d67b49a9b6d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/README.md +++ /dev/null @@ -1,111 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/metadata` Documentation - -The `metadata` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/metadata" -``` - - -### Client Initialization - -```go -client := metadata.NewMetadataClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `MetadataClient.Create` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -payload := metadata.MetadataModel{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `MetadataClient.Delete` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -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: `MetadataClient.Get` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -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: `MetadataClient.List` - -```go -ctx := context.TODO() -id := metadata.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, metadata.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, metadata.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `MetadataClient.Update` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -payload := metadata.MetadataPatch{ - // ... -} - - -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/securityinsights/2021-09-01-preview/metadata/client.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/client.go deleted file mode 100644 index 59e4192159f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package metadata - -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 MetadataClient struct { - Client *resourcemanager.Client -} - -func NewMetadataClientWithBaseURI(sdkApi sdkEnv.Api) (*MetadataClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "metadata", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating MetadataClient: %+v", err) - } - - return &MetadataClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/constants.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/constants.go deleted file mode 100644 index 6ae0aae9bec..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/constants.go +++ /dev/null @@ -1,219 +0,0 @@ -package metadata - -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 Kind string - -const ( - KindAnalyticsRule Kind = "AnalyticsRule" - KindAnalyticsRuleTemplate Kind = "AnalyticsRuleTemplate" - KindDataConnector Kind = "DataConnector" - KindDataType Kind = "DataType" - KindHuntingQuery Kind = "HuntingQuery" - KindInvestigationQuery Kind = "InvestigationQuery" - KindParser Kind = "Parser" - KindPlaybook Kind = "Playbook" - KindPlaybookTemplate Kind = "PlaybookTemplate" - KindSolution Kind = "Solution" - KindWatchlist Kind = "Watchlist" - KindWatchlistTemplate Kind = "WatchlistTemplate" - KindWorkbook Kind = "Workbook" - KindWorkbookTemplate Kind = "WorkbookTemplate" -) - -func PossibleValuesForKind() []string { - return []string{ - string(KindAnalyticsRule), - string(KindAnalyticsRuleTemplate), - string(KindDataConnector), - string(KindDataType), - string(KindHuntingQuery), - string(KindInvestigationQuery), - string(KindParser), - string(KindPlaybook), - string(KindPlaybookTemplate), - string(KindSolution), - string(KindWatchlist), - string(KindWatchlistTemplate), - string(KindWorkbook), - string(KindWorkbookTemplate), - } -} - -func (s *Kind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKind(input string) (*Kind, error) { - vals := map[string]Kind{ - "analyticsrule": KindAnalyticsRule, - "analyticsruletemplate": KindAnalyticsRuleTemplate, - "dataconnector": KindDataConnector, - "datatype": KindDataType, - "huntingquery": KindHuntingQuery, - "investigationquery": KindInvestigationQuery, - "parser": KindParser, - "playbook": KindPlaybook, - "playbooktemplate": KindPlaybookTemplate, - "solution": KindSolution, - "watchlist": KindWatchlist, - "watchlisttemplate": KindWatchlistTemplate, - "workbook": KindWorkbook, - "workbooktemplate": KindWorkbookTemplate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Kind(input) - return &out, nil -} - -type Operator string - -const ( - OperatorAND Operator = "AND" - OperatorOR Operator = "OR" -) - -func PossibleValuesForOperator() []string { - return []string{ - string(OperatorAND), - string(OperatorOR), - } -} - -func (s *Operator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperator(input string) (*Operator, error) { - vals := map[string]Operator{ - "and": OperatorAND, - "or": OperatorOR, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Operator(input) - return &out, nil -} - -type SourceKind string - -const ( - SourceKindCommunity SourceKind = "Community" - SourceKindLocalWorkspace SourceKind = "LocalWorkspace" - SourceKindSolution SourceKind = "Solution" - SourceKindSourceRepository SourceKind = "SourceRepository" -) - -func PossibleValuesForSourceKind() []string { - return []string{ - string(SourceKindCommunity), - string(SourceKindLocalWorkspace), - string(SourceKindSolution), - string(SourceKindSourceRepository), - } -} - -func (s *SourceKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSourceKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSourceKind(input string) (*SourceKind, error) { - vals := map[string]SourceKind{ - "community": SourceKindCommunity, - "localworkspace": SourceKindLocalWorkspace, - "solution": SourceKindSolution, - "sourcerepository": SourceKindSourceRepository, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SourceKind(input) - return &out, nil -} - -type SupportTier string - -const ( - SupportTierCommunity SupportTier = "Community" - SupportTierMicrosoft SupportTier = "Microsoft" - SupportTierPartner SupportTier = "Partner" -) - -func PossibleValuesForSupportTier() []string { - return []string{ - string(SupportTierCommunity), - string(SupportTierMicrosoft), - string(SupportTierPartner), - } -} - -func (s *SupportTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSupportTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSupportTier(input string) (*SupportTier, error) { - vals := map[string]SupportTier{ - "community": SupportTierCommunity, - "microsoft": SupportTierMicrosoft, - "partner": SupportTierPartner, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SupportTier(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata.go deleted file mode 100644 index 5d97d463191..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata.go +++ /dev/null @@ -1,141 +0,0 @@ -package metadata - -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(&MetadataId{}) -} - -var _ resourceids.ResourceId = &MetadataId{} - -// MetadataId is a struct representing the Resource ID for a Metadata -type MetadataId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - MetadataName string -} - -// NewMetadataID returns a new MetadataId struct -func NewMetadataID(subscriptionId string, resourceGroupName string, workspaceName string, metadataName string) MetadataId { - return MetadataId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - MetadataName: metadataName, - } -} - -// ParseMetadataID parses 'input' into a MetadataId -func ParseMetadataID(input string) (*MetadataId, error) { - parser := resourceids.NewParserFromResourceIdType(&MetadataId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MetadataId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseMetadataIDInsensitively parses 'input' case-insensitively into a MetadataId -// note: this method should only be used for API response data and not user input -func ParseMetadataIDInsensitively(input string) (*MetadataId, error) { - parser := resourceids.NewParserFromResourceIdType(&MetadataId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MetadataId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *MetadataId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.MetadataName, ok = input.Parsed["metadataName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "metadataName", input) - } - - return nil -} - -// ValidateMetadataID checks that 'input' can be parsed as a Metadata ID -func ValidateMetadataID(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 := ParseMetadataID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Metadata ID -func (id MetadataId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/metadata/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.MetadataName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Metadata ID -func (id MetadataId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticMetadata", "metadata", "metadata"), - resourceids.UserSpecifiedSegment("metadataName", "metadataValue"), - } -} - -// String returns a human-readable description of this Metadata ID -func (id MetadataId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Metadata Name: %q", id.MetadataName), - } - return fmt.Sprintf("Metadata (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata_test.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata_test.go deleted file mode 100644 index 4904daf0395..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_metadata_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package metadata - -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 = &MetadataId{} - -func TestNewMetadataID(t *testing.T) { - id := NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.MetadataName != "metadataValue" { - t.Fatalf("Expected %q but got %q for Segment 'MetadataName'", id.MetadataName, "metadataValue") - } -} - -func TestFormatMetadataID(t *testing.T) { - actual := NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseMetadataID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MetadataId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue", - Expected: &MetadataId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - MetadataName: "metadataValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMetadataID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.MetadataName != v.Expected.MetadataName { - t.Fatalf("Expected %q but got %q for MetadataName", v.Expected.MetadataName, actual.MetadataName) - } - - } -} - -func TestParseMetadataIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MetadataId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/mEtAdAtA", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue", - Expected: &MetadataId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - MetadataName: "metadataValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/mEtAdAtA/mEtAdAtAvAlUe", - Expected: &MetadataId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - MetadataName: "mEtAdAtAvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/mEtAdAtA/mEtAdAtAvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMetadataIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.MetadataName != v.Expected.MetadataName { - t.Fatalf("Expected %q but got %q for MetadataName", v.Expected.MetadataName, actual.MetadataName) - } - - } -} - -func TestSegmentsForMetadataId(t *testing.T) { - segments := MetadataId{}.Segments() - if len(segments) == 0 { - t.Fatalf("MetadataId 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/securityinsights/2021-09-01-preview/metadata/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace.go deleted file mode 100644 index 6248b4d13cc..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package metadata - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace_test.go deleted file mode 100644 index 9a9fefb8173..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package metadata - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/metadata/method_create.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/method_create.go deleted file mode 100644 index fd4a74a030a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package metadata - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MetadataModel -} - -// Create ... -func (c MetadataClient) Create(ctx context.Context, id MetadataId, input MetadataModel) (result CreateOperationResponse, 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 MetadataModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/method_delete.go deleted file mode 100644 index 559f479cb03..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package metadata - -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 MetadataClient) Delete(ctx context.Context, id MetadataId) (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/securityinsights/2021-09-01-preview/metadata/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/method_get.go deleted file mode 100644 index 68228f0b583..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package metadata - -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 *MetadataModel -} - -// Get ... -func (c MetadataClient) Get(ctx context.Context, id MetadataId) (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 MetadataModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/method_list.go deleted file mode 100644 index 58267143629..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_list.go +++ /dev/null @@ -1,131 +0,0 @@ -package metadata - -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 *[]MetadataModel -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []MetadataModel -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Skip *int64 - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Skip != nil { - out.Append("$skip", fmt.Sprintf("%v", *o.Skip)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c MetadataClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/metadata", id.ID()), - OptionsObject: options, - } - - 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 *[]MetadataModel `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 MetadataClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, MetadataModelOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c MetadataClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate MetadataModelOperationPredicate) (result ListCompleteResult, err error) { - items := make([]MetadataModel, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2021-09-01-preview/metadata/method_update.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/method_update.go deleted file mode 100644 index e6911fcbc1d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package metadata - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MetadataModel -} - -// Update ... -func (c MetadataClient) Update(ctx context.Context, id MetadataId, input MetadataPatch) (result UpdateOperationResponse, 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 MetadataModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataauthor.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataauthor.go deleted file mode 100644 index 9f27e5e7454..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataauthor.go +++ /dev/null @@ -1,10 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataAuthor struct { - Email *string `json:"email,omitempty"` - Link *string `json:"link,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatacategories.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatacategories.go deleted file mode 100644 index d9120925370..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatacategories.go +++ /dev/null @@ -1,9 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataCategories struct { - Domains *[]string `json:"domains,omitempty"` - Verticals *[]string `json:"verticals,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatadependencies.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatadependencies.go deleted file mode 100644 index fe82bf3f5d9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatadependencies.go +++ /dev/null @@ -1,13 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataDependencies struct { - ContentId *string `json:"contentId,omitempty"` - Criteria *[]MetadataDependencies `json:"criteria,omitempty"` - Kind *Kind `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Operator *Operator `json:"operator,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatamodel.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatamodel.go deleted file mode 100644 index 24d36aadd74..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatamodel.go +++ /dev/null @@ -1,17 +0,0 @@ -package metadata - -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 MetadataModel struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *MetadataProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapatch.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapatch.go deleted file mode 100644 index 05d052ba996..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapatch.go +++ /dev/null @@ -1,17 +0,0 @@ -package metadata - -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 MetadataPatch struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *MetadataPropertiesPatch `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataproperties.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataproperties.go deleted file mode 100644 index 0e1149b123d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadataproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataProperties struct { - Author *MetadataAuthor `json:"author,omitempty"` - Categories *MetadataCategories `json:"categories,omitempty"` - ContentId *string `json:"contentId,omitempty"` - Dependencies *MetadataDependencies `json:"dependencies,omitempty"` - FirstPublishDate *string `json:"firstPublishDate,omitempty"` - Kind Kind `json:"kind"` - LastPublishDate *string `json:"lastPublishDate,omitempty"` - ParentId string `json:"parentId"` - Providers *[]string `json:"providers,omitempty"` - Source *MetadataSource `json:"source,omitempty"` - Support *MetadataSupport `json:"support,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapropertiespatch.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapropertiespatch.go deleted file mode 100644 index 45c98f5cf80..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatapropertiespatch.go +++ /dev/null @@ -1,19 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataPropertiesPatch struct { - Author *MetadataAuthor `json:"author,omitempty"` - Categories *MetadataCategories `json:"categories,omitempty"` - ContentId *string `json:"contentId,omitempty"` - Dependencies *MetadataDependencies `json:"dependencies,omitempty"` - FirstPublishDate *string `json:"firstPublishDate,omitempty"` - Kind *Kind `json:"kind,omitempty"` - LastPublishDate *string `json:"lastPublishDate,omitempty"` - ParentId *string `json:"parentId,omitempty"` - Providers *[]string `json:"providers,omitempty"` - Source *MetadataSource `json:"source,omitempty"` - Support *MetadataSupport `json:"support,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasource.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasource.go deleted file mode 100644 index b6f4218a0ba..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasource.go +++ /dev/null @@ -1,10 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataSource struct { - Kind SourceKind `json:"kind"` - Name *string `json:"name,omitempty"` - SourceId *string `json:"sourceId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasupport.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasupport.go deleted file mode 100644 index 2a416d7bab3..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/model_metadatasupport.go +++ /dev/null @@ -1,11 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataSupport struct { - Email *string `json:"email,omitempty"` - Link *string `json:"link,omitempty"` - Name *string `json:"name,omitempty"` - Tier SupportTier `json:"tier"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/metadata/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/predicates.go deleted file mode 100644 index 11492b7da36..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataModelOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p MetadataModelOperationPredicate) Matches(input MetadataModel) 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.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/securityinsights/2021-09-01-preview/metadata/version.go b/resource-manager/securityinsights/2021-09-01-preview/metadata/version.go deleted file mode 100644 index 1eee8bae52e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/metadata/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package metadata - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/metadata/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/README.md b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/README.md deleted file mode 100644 index 75f61769a1c..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/README.md +++ /dev/null @@ -1,69 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/officeconsents` Documentation - -The `officeconsents` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/officeconsents" -``` - - -### Client Initialization - -```go -client := officeconsents.NewOfficeConsentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OfficeConsentsClient.Delete` - -```go -ctx := context.TODO() -id := officeconsents.NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue") - -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: `OfficeConsentsClient.Get` - -```go -ctx := context.TODO() -id := officeconsents.NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue") - -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: `OfficeConsentsClient.List` - -```go -ctx := context.TODO() -id := officeconsents.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/officeconsents/client.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/client.go deleted file mode 100644 index 2c2efc37d3d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package officeconsents - -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 OfficeConsentsClient struct { - Client *resourcemanager.Client -} - -func NewOfficeConsentsClientWithBaseURI(sdkApi sdkEnv.Api) (*OfficeConsentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "officeconsents", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating OfficeConsentsClient: %+v", err) - } - - return &OfficeConsentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent.go deleted file mode 100644 index 6112f6e7da8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent.go +++ /dev/null @@ -1,141 +0,0 @@ -package officeconsents - -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(&OfficeConsentId{}) -} - -var _ resourceids.ResourceId = &OfficeConsentId{} - -// OfficeConsentId is a struct representing the Resource ID for a Office Consent -type OfficeConsentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - ConsentId string -} - -// NewOfficeConsentID returns a new OfficeConsentId struct -func NewOfficeConsentID(subscriptionId string, resourceGroupName string, workspaceName string, consentId string) OfficeConsentId { - return OfficeConsentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - ConsentId: consentId, - } -} - -// ParseOfficeConsentID parses 'input' into a OfficeConsentId -func ParseOfficeConsentID(input string) (*OfficeConsentId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfficeConsentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfficeConsentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOfficeConsentIDInsensitively parses 'input' case-insensitively into a OfficeConsentId -// note: this method should only be used for API response data and not user input -func ParseOfficeConsentIDInsensitively(input string) (*OfficeConsentId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfficeConsentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfficeConsentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OfficeConsentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.ConsentId, ok = input.Parsed["consentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "consentId", input) - } - - return nil -} - -// ValidateOfficeConsentID checks that 'input' can be parsed as a Office Consent ID -func ValidateOfficeConsentID(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 := ParseOfficeConsentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Office Consent ID -func (id OfficeConsentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/officeConsents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.ConsentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Office Consent ID -func (id OfficeConsentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticOfficeConsents", "officeConsents", "officeConsents"), - resourceids.UserSpecifiedSegment("consentId", "consentIdValue"), - } -} - -// String returns a human-readable description of this Office Consent ID -func (id OfficeConsentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Consent: %q", id.ConsentId), - } - return fmt.Sprintf("Office Consent (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent_test.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent_test.go deleted file mode 100644 index d467492a7ed..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_officeconsent_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package officeconsents - -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 = &OfficeConsentId{} - -func TestNewOfficeConsentID(t *testing.T) { - id := NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.ConsentId != "consentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConsentId'", id.ConsentId, "consentIdValue") - } -} - -func TestFormatOfficeConsentID(t *testing.T) { - actual := NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOfficeConsentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfficeConsentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue", - Expected: &OfficeConsentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - ConsentId: "consentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfficeConsentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.ConsentId != v.Expected.ConsentId { - t.Fatalf("Expected %q but got %q for ConsentId", v.Expected.ConsentId, actual.ConsentId) - } - - } -} - -func TestParseOfficeConsentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfficeConsentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oFfIcEcOnSeNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue", - Expected: &OfficeConsentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - ConsentId: "consentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oFfIcEcOnSeNtS/cOnSeNtIdVaLuE", - Expected: &OfficeConsentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - ConsentId: "cOnSeNtIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oFfIcEcOnSeNtS/cOnSeNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfficeConsentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.ConsentId != v.Expected.ConsentId { - t.Fatalf("Expected %q but got %q for ConsentId", v.Expected.ConsentId, actual.ConsentId) - } - - } -} - -func TestSegmentsForOfficeConsentId(t *testing.T) { - segments := OfficeConsentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OfficeConsentId 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/securityinsights/2021-09-01-preview/officeconsents/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace.go deleted file mode 100644 index 44c5f84d447..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package officeconsents - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace_test.go deleted file mode 100644 index 985c59ffc82..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package officeconsents - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/officeconsents/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_delete.go deleted file mode 100644 index 3c098e73784..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package officeconsents - -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 OfficeConsentsClient) Delete(ctx context.Context, id OfficeConsentId) (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/securityinsights/2021-09-01-preview/officeconsents/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_get.go deleted file mode 100644 index eb59e32eadb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package officeconsents - -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 *OfficeConsent -} - -// Get ... -func (c OfficeConsentsClient) Get(ctx context.Context, id OfficeConsentId) (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 OfficeConsent - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_list.go deleted file mode 100644 index e23bd7dddfb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package officeconsents - -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 *[]OfficeConsent -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []OfficeConsent -} - -// List ... -func (c OfficeConsentsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/officeConsents", 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 *[]OfficeConsent `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 OfficeConsentsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, OfficeConsentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OfficeConsentsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate OfficeConsentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]OfficeConsent, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/officeconsents/model_officeconsent.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsent.go deleted file mode 100644 index 12d6f3bdb86..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsent.go +++ /dev/null @@ -1,16 +0,0 @@ -package officeconsents - -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 OfficeConsent struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OfficeConsentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsentproperties.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsentproperties.go deleted file mode 100644 index 547706a64b2..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/model_officeconsentproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package officeconsents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeConsentProperties struct { - ConsentId *string `json:"consentId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/predicates.go deleted file mode 100644 index de2081d698d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package officeconsents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeConsentOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p OfficeConsentOperationPredicate) Matches(input OfficeConsent) 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/securityinsights/2021-09-01-preview/officeconsents/version.go b/resource-manager/securityinsights/2021-09-01-preview/officeconsents/version.go deleted file mode 100644 index 9b13ace76ec..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/officeconsents/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package officeconsents - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/officeconsents/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/README.md b/resource-manager/securityinsights/2021-09-01-preview/repositories/README.md deleted file mode 100644 index a3f806601cd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/repositories` Documentation - -The `repositories` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/repositories" -``` - - -### Client Initialization - -```go -client := repositories.NewRepositoriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RepositoriesClient.SourceControllistRepositories` - -```go -ctx := context.TODO() -id := repositories.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := repositories.RepoType{ - // ... -} - - -// alternatively `client.SourceControllistRepositories(ctx, id, payload)` can be used to do batched pagination -items, err := client.SourceControllistRepositoriesComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/client.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/client.go deleted file mode 100644 index 62b7be88387..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package repositories - -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 RepositoriesClient struct { - Client *resourcemanager.Client -} - -func NewRepositoriesClientWithBaseURI(sdkApi sdkEnv.Api) (*RepositoriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "repositories", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RepositoriesClient: %+v", err) - } - - return &RepositoriesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/constants.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/constants.go deleted file mode 100644 index 828121b73be..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package repositories - -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 RepoType string - -const ( - RepoTypeDevOps RepoType = "DevOps" - RepoTypeGithub RepoType = "Github" -) - -func PossibleValuesForRepoType() []string { - return []string{ - string(RepoTypeDevOps), - string(RepoTypeGithub), - } -} - -func (s *RepoType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRepoType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRepoType(input string) (*RepoType, error) { - vals := map[string]RepoType{ - "devops": RepoTypeDevOps, - "github": RepoTypeGithub, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RepoType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace.go deleted file mode 100644 index d7e4ec6c5c6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package repositories - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace_test.go deleted file mode 100644 index 839f52ebb80..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package repositories - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/repositories/method_sourcecontrollistrepositories.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/method_sourcecontrollistrepositories.go deleted file mode 100644 index 3a007266273..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/method_sourcecontrollistrepositories.go +++ /dev/null @@ -1,91 +0,0 @@ -package repositories - -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 SourceControllistRepositoriesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Repo -} - -type SourceControllistRepositoriesCompleteResult struct { - LatestHttpResponse *http.Response - Items []Repo -} - -// SourceControllistRepositories ... -func (c RepositoriesClient) SourceControllistRepositories(ctx context.Context, id WorkspaceId, input RepoType) (result SourceControllistRepositoriesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/listRepositories", 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 *[]Repo `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SourceControllistRepositoriesComplete retrieves all the results into a single object -func (c RepositoriesClient) SourceControllistRepositoriesComplete(ctx context.Context, id WorkspaceId, input RepoType) (SourceControllistRepositoriesCompleteResult, error) { - return c.SourceControllistRepositoriesCompleteMatchingPredicate(ctx, id, input, RepoOperationPredicate{}) -} - -// SourceControllistRepositoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RepositoriesClient) SourceControllistRepositoriesCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input RepoType, predicate RepoOperationPredicate) (result SourceControllistRepositoriesCompleteResult, err error) { - items := make([]Repo, 0) - - resp, err := c.SourceControllistRepositories(ctx, id, input) - if err != nil { - 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 = SourceControllistRepositoriesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/model_repo.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/model_repo.go deleted file mode 100644 index 01764dc29a8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/model_repo.go +++ /dev/null @@ -1,10 +0,0 @@ -package repositories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Repo struct { - Branches *[]string `json:"branches,omitempty"` - FullName *string `json:"fullName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/predicates.go deleted file mode 100644 index 948d5824d0f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/predicates.go +++ /dev/null @@ -1,22 +0,0 @@ -package repositories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RepoOperationPredicate struct { - FullName *string - Url *string -} - -func (p RepoOperationPredicate) Matches(input Repo) bool { - - if p.FullName != nil && (input.FullName == nil || *p.FullName != *input.FullName) { - return false - } - - if p.Url != nil && (input.Url == nil || *p.Url != *input.Url) { - return false - } - - return true -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/repositories/version.go b/resource-manager/securityinsights/2021-09-01-preview/repositories/version.go deleted file mode 100644 index 6bccf54b4f1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/repositories/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package repositories - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/repositories/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/README.md deleted file mode 100644 index 36237cda622..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/README.md +++ /dev/null @@ -1,89 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates` Documentation - -The `sentinelonboardingstates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/sentinelonboardingstates" -``` - - -### Client Initialization - -```go -client := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SentinelOnboardingStatesClient.Create` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -payload := sentinelonboardingstates.SentinelOnboardingState{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SentinelOnboardingStatesClient.Delete` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -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: `SentinelOnboardingStatesClient.Get` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -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: `SentinelOnboardingStatesClient.List` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -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/securityinsights/2021-09-01-preview/sentinelonboardingstates/client.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/client.go deleted file mode 100644 index 94701ed853a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingStatesClient struct { - Client *resourcemanager.Client -} - -func NewSentinelOnboardingStatesClientWithBaseURI(sdkApi sdkEnv.Api) (*SentinelOnboardingStatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sentinelonboardingstates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SentinelOnboardingStatesClient: %+v", err) - } - - return &SentinelOnboardingStatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate.go deleted file mode 100644 index a0b15d704d4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate.go +++ /dev/null @@ -1,141 +0,0 @@ -package sentinelonboardingstates - -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(&OnboardingStateId{}) -} - -var _ resourceids.ResourceId = &OnboardingStateId{} - -// OnboardingStateId is a struct representing the Resource ID for a Onboarding State -type OnboardingStateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - OnboardingStateName string -} - -// NewOnboardingStateID returns a new OnboardingStateId struct -func NewOnboardingStateID(subscriptionId string, resourceGroupName string, workspaceName string, onboardingStateName string) OnboardingStateId { - return OnboardingStateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - OnboardingStateName: onboardingStateName, - } -} - -// ParseOnboardingStateID parses 'input' into a OnboardingStateId -func ParseOnboardingStateID(input string) (*OnboardingStateId, error) { - parser := resourceids.NewParserFromResourceIdType(&OnboardingStateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OnboardingStateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOnboardingStateIDInsensitively parses 'input' case-insensitively into a OnboardingStateId -// note: this method should only be used for API response data and not user input -func ParseOnboardingStateIDInsensitively(input string) (*OnboardingStateId, error) { - parser := resourceids.NewParserFromResourceIdType(&OnboardingStateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OnboardingStateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OnboardingStateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.OnboardingStateName, ok = input.Parsed["onboardingStateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "onboardingStateName", input) - } - - return nil -} - -// ValidateOnboardingStateID checks that 'input' can be parsed as a Onboarding State ID -func ValidateOnboardingStateID(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 := ParseOnboardingStateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Onboarding State ID -func (id OnboardingStateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/onboardingStates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.OnboardingStateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Onboarding State ID -func (id OnboardingStateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateValue"), - } -} - -// String returns a human-readable description of this Onboarding State ID -func (id OnboardingStateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Onboarding State Name: %q", id.OnboardingStateName), - } - return fmt.Sprintf("Onboarding State (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate_test.go deleted file mode 100644 index 2f1b37538f9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_onboardingstate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package sentinelonboardingstates - -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 = &OnboardingStateId{} - -func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.OnboardingStateName != "onboardingStateValue" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateValue") - } -} - -func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOnboardingStateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OnboardingStateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - OnboardingStateName: "onboardingStateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOnboardingStateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.OnboardingStateName != v.Expected.OnboardingStateName { - t.Fatalf("Expected %q but got %q for OnboardingStateName", v.Expected.OnboardingStateName, actual.OnboardingStateName) - } - - } -} - -func TestParseOnboardingStateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OnboardingStateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - OnboardingStateName: "onboardingStateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeVaLuE", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - OnboardingStateName: "oNbOaRdInGsTaTeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOnboardingStateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.OnboardingStateName != v.Expected.OnboardingStateName { - t.Fatalf("Expected %q but got %q for OnboardingStateName", v.Expected.OnboardingStateName, actual.OnboardingStateName) - } - - } -} - -func TestSegmentsForOnboardingStateId(t *testing.T) { - segments := OnboardingStateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OnboardingStateId 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/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace.go deleted file mode 100644 index 25f0d18c095..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package sentinelonboardingstates - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace_test.go deleted file mode 100644 index b50fc815542..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package sentinelonboardingstates - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_create.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_create.go deleted file mode 100644 index be0336fbcee..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package sentinelonboardingstates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SentinelOnboardingState -} - -// Create ... -func (c SentinelOnboardingStatesClient) Create(ctx context.Context, id OnboardingStateId, input SentinelOnboardingState) (result CreateOperationResponse, 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 SentinelOnboardingState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_delete.go deleted file mode 100644 index 1c6c5e372d7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingStatesClient) Delete(ctx context.Context, id OnboardingStateId) (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/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_get.go deleted file mode 100644 index e7b2c2cb86b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package sentinelonboardingstates - -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 *SentinelOnboardingState -} - -// Get ... -func (c SentinelOnboardingStatesClient) Get(ctx context.Context, id OnboardingStateId) (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 SentinelOnboardingState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_list.go deleted file mode 100644 index d53893d7842..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package sentinelonboardingstates - -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 *SentinelOnboardingStatesList -} - -// List ... -func (c SentinelOnboardingStatesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/onboardingStates", 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 SentinelOnboardingStatesList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go deleted file mode 100644 index c514c418596..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go +++ /dev/null @@ -1,17 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingState struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SentinelOnboardingStateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go deleted file mode 100644 index 366f9e1623d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package sentinelonboardingstates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SentinelOnboardingStateProperties struct { - CustomerManagedKey *bool `json:"customerManagedKey,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go deleted file mode 100644 index e601995e41b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package sentinelonboardingstates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SentinelOnboardingStatesList struct { - Value []SentinelOnboardingState `json:"value"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/version.go b/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/version.go deleted file mode 100644 index 5ad26763e4b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sentinelonboardingstates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package sentinelonboardingstates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/sentinelonboardingstates/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/README.md b/resource-manager/securityinsights/2021-09-01-preview/settings/README.md deleted file mode 100644 index f16c1efcba0..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/README.md +++ /dev/null @@ -1,89 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/settings` Documentation - -The `settings` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/settings" -``` - - -### Client Initialization - -```go -client := settings.NewSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SettingsClient.ProductSettingsDelete` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - -read, err := client.ProductSettingsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SettingsClient.ProductSettingsGet` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - -read, err := client.ProductSettingsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SettingsClient.ProductSettingsList` - -```go -ctx := context.TODO() -id := settings.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -read, err := client.ProductSettingsList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SettingsClient.ProductSettingsUpdate` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - -payload := settings.Settings{ - // ... -} - - -read, err := client.ProductSettingsUpdate(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/securityinsights/2021-09-01-preview/settings/client.go b/resource-manager/securityinsights/2021-09-01-preview/settings/client.go deleted file mode 100644 index 7a9bd9ec8a1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package settings - -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 SettingsClient struct { - Client *resourcemanager.Client -} - -func NewSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*SettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "settings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SettingsClient: %+v", err) - } - - return &SettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/constants.go b/resource-manager/securityinsights/2021-09-01-preview/settings/constants.go deleted file mode 100644 index 692555e3b04..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/constants.go +++ /dev/null @@ -1,104 +0,0 @@ -package settings - -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 SettingKind string - -const ( - SettingKindAnomalies SettingKind = "Anomalies" - SettingKindEntityAnalytics SettingKind = "EntityAnalytics" - SettingKindEyesOn SettingKind = "EyesOn" - SettingKindUeba SettingKind = "Ueba" -) - -func PossibleValuesForSettingKind() []string { - return []string{ - string(SettingKindAnomalies), - string(SettingKindEntityAnalytics), - string(SettingKindEyesOn), - string(SettingKindUeba), - } -} - -func (s *SettingKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingKind(input string) (*SettingKind, error) { - vals := map[string]SettingKind{ - "anomalies": SettingKindAnomalies, - "entityanalytics": SettingKindEntityAnalytics, - "eyeson": SettingKindEyesOn, - "ueba": SettingKindUeba, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingKind(input) - return &out, nil -} - -type UebaDataSources string - -const ( - UebaDataSourcesAuditLogs UebaDataSources = "AuditLogs" - UebaDataSourcesAzureActivity UebaDataSources = "AzureActivity" - UebaDataSourcesSecurityEvent UebaDataSources = "SecurityEvent" - UebaDataSourcesSigninLogs UebaDataSources = "SigninLogs" -) - -func PossibleValuesForUebaDataSources() []string { - return []string{ - string(UebaDataSourcesAuditLogs), - string(UebaDataSourcesAzureActivity), - string(UebaDataSourcesSecurityEvent), - string(UebaDataSourcesSigninLogs), - } -} - -func (s *UebaDataSources) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUebaDataSources(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUebaDataSources(input string) (*UebaDataSources, error) { - vals := map[string]UebaDataSources{ - "auditlogs": UebaDataSourcesAuditLogs, - "azureactivity": UebaDataSourcesAzureActivity, - "securityevent": UebaDataSourcesSecurityEvent, - "signinlogs": UebaDataSourcesSigninLogs, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UebaDataSources(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/id_setting.go b/resource-manager/securityinsights/2021-09-01-preview/settings/id_setting.go deleted file mode 100644 index 90889b749de..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/id_setting.go +++ /dev/null @@ -1,141 +0,0 @@ -package settings - -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(&SettingId{}) -} - -var _ resourceids.ResourceId = &SettingId{} - -// SettingId is a struct representing the Resource ID for a Setting -type SettingId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - SettingName string -} - -// NewSettingID returns a new SettingId struct -func NewSettingID(subscriptionId string, resourceGroupName string, workspaceName string, settingName string) SettingId { - return SettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - SettingName: settingName, - } -} - -// ParseSettingID parses 'input' into a SettingId -func ParseSettingID(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSettingIDInsensitively parses 'input' case-insensitively into a SettingId -// note: this method should only be used for API response data and not user input -func ParseSettingIDInsensitively(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SettingId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.SettingName, ok = input.Parsed["settingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "settingName", input) - } - - return nil -} - -// ValidateSettingID checks that 'input' can be parsed as a Setting ID -func ValidateSettingID(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 := ParseSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Setting ID -func (id SettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/settings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Setting ID -func (id SettingId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticSettings", "settings", "settings"), - resourceids.UserSpecifiedSegment("settingName", "settingValue"), - } -} - -// String returns a human-readable description of this Setting ID -func (id SettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Setting Name: %q", id.SettingName), - } - return fmt.Sprintf("Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/id_setting_test.go b/resource-manager/securityinsights/2021-09-01-preview/settings/id_setting_test.go deleted file mode 100644 index 73d5eec1834..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/id_setting_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package settings - -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 = &SettingId{} - -func TestNewSettingID(t *testing.T) { - id := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.SettingName != "settingValue" { - t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "settingValue") - } -} - -func TestFormatSettingID(t *testing.T) { - actual := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SettingName: "settingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestParseSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SettingName: "settingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgVaLuE", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - SettingName: "sEtTiNgVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestSegmentsForSettingId(t *testing.T) { - segments := SettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SettingId 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/securityinsights/2021-09-01-preview/settings/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace.go deleted file mode 100644 index e001d01ad15..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package settings - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace_test.go deleted file mode 100644 index b1c2389e272..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package settings - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/settings/method_productsettingsdelete.go b/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsdelete.go deleted file mode 100644 index 3306b03a761..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package settings - -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 ProductSettingsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// ProductSettingsDelete ... -func (c SettingsClient) ProductSettingsDelete(ctx context.Context, id SettingId) (result ProductSettingsDeleteOperationResponse, 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/securityinsights/2021-09-01-preview/settings/method_productsettingsget.go b/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsget.go deleted file mode 100644 index 3d546bae766..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsget.go +++ /dev/null @@ -1,58 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 ProductSettingsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Settings -} - -// ProductSettingsGet ... -func (c SettingsClient) ProductSettingsGet(ctx context.Context, id SettingId) (result ProductSettingsGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingsImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingslist.go b/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingslist.go deleted file mode 100644 index 8c3a8350b7a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package settings - -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 ProductSettingsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SettingList -} - -// ProductSettingsList ... -func (c SettingsClient) ProductSettingsList(ctx context.Context, id WorkspaceId) (result ProductSettingsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/settings", 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 SettingList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsupdate.go b/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsupdate.go deleted file mode 100644 index 1f33013bb47..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/method_productsettingsupdate.go +++ /dev/null @@ -1,62 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 ProductSettingsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Settings -} - -// ProductSettingsUpdate ... -func (c SettingsClient) ProductSettingsUpdate(ctx context.Context, id SettingId, input Settings) (result ProductSettingsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingsImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_anomalies.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_anomalies.go deleted file mode 100644 index 625b817d33e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_anomalies.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = Anomalies{} - -type Anomalies struct { - Properties *AnomaliesSettingsProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Anomalies{} - -func (s Anomalies) MarshalJSON() ([]byte, error) { - type wrapper Anomalies - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Anomalies: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Anomalies: %+v", err) - } - decoded["kind"] = "Anomalies" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Anomalies: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_anomaliessettingsproperties.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_anomaliessettingsproperties.go deleted file mode 100644 index b93bec5e558..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_anomaliessettingsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AnomaliesSettingsProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalytics.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalytics.go deleted file mode 100644 index 1ce4b746aba..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalytics.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = EntityAnalytics{} - -type EntityAnalytics struct { - Properties *EntityAnalyticsProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = EntityAnalytics{} - -func (s EntityAnalytics) MarshalJSON() ([]byte, error) { - type wrapper EntityAnalytics - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EntityAnalytics: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EntityAnalytics: %+v", err) - } - decoded["kind"] = "EntityAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EntityAnalytics: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalyticsproperties.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalyticsproperties.go deleted file mode 100644 index 7a26ed4f2cd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_entityanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityAnalyticsProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_eyeson.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_eyeson.go deleted file mode 100644 index e392345fefe..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_eyeson.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = EyesOn{} - -type EyesOn struct { - Properties *EyesOnSettingsProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = EyesOn{} - -func (s EyesOn) MarshalJSON() ([]byte, error) { - type wrapper EyesOn - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EyesOn: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EyesOn: %+v", err) - } - decoded["kind"] = "EyesOn" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EyesOn: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_eyesonsettingsproperties.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_eyesonsettingsproperties.go deleted file mode 100644 index b1e4ab84344..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_eyesonsettingsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EyesOnSettingsProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_settinglist.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_settinglist.go deleted file mode 100644 index f5eb0f61e00..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_settinglist.go +++ /dev/null @@ -1,41 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SettingList struct { - Value []Settings `json:"value"` -} - -var _ json.Unmarshaler = &SettingList{} - -func (s *SettingList) UnmarshalJSON(bytes []byte) error { - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling SettingList into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]Settings, 0) - for i, val := range listTemp { - impl, err := unmarshalSettingsImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'SettingList': %+v", i, err) - } - output = append(output, impl) - } - s.Value = output - } - return nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_settings.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_settings.go deleted file mode 100644 index f091da772d6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_settings.go +++ /dev/null @@ -1,77 +0,0 @@ -package settings - -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 Settings interface { -} - -// RawSettingsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSettingsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalSettingsImplementation(input []byte) (Settings, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Settings into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Anomalies") { - var out Anomalies - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Anomalies: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "EntityAnalytics") { - var out EntityAnalytics - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EntityAnalytics: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "EyesOn") { - var out EyesOn - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EyesOn: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Ueba") { - var out Ueba - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Ueba: %+v", err) - } - return out, nil - } - - out := RawSettingsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_ueba.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_ueba.go deleted file mode 100644 index 2c897343bb4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_ueba.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = Ueba{} - -type Ueba struct { - Properties *UebaProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Ueba{} - -func (s Ueba) MarshalJSON() ([]byte, error) { - type wrapper Ueba - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Ueba: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Ueba: %+v", err) - } - decoded["kind"] = "Ueba" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Ueba: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/model_uebaproperties.go b/resource-manager/securityinsights/2021-09-01-preview/settings/model_uebaproperties.go deleted file mode 100644 index 46b6a2832b4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/model_uebaproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UebaProperties struct { - DataSources *[]UebaDataSources `json:"dataSources,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/settings/version.go b/resource-manager/securityinsights/2021-09-01-preview/settings/version.go deleted file mode 100644 index 765cca2ce76..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/settings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package settings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/settings/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/README.md b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/README.md deleted file mode 100644 index cea8dc3fc54..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols` Documentation - -The `sourcecontrols` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/sourcecontrols" -``` - - -### Client Initialization - -```go -client := sourcecontrols.NewSourceControlsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SourceControlsClient.Create` - -```go -ctx := context.TODO() -id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - -payload := sourcecontrols.SourceControl{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SourceControlsClient.Delete` - -```go -ctx := context.TODO() -id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - -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: `SourceControlsClient.Get` - -```go -ctx := context.TODO() -id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - -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: `SourceControlsClient.List` - -```go -ctx := context.TODO() -id := sourcecontrols.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/sourcecontrols/client.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/client.go deleted file mode 100644 index 9bfd651a63a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sourcecontrols - -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 SourceControlsClient struct { - Client *resourcemanager.Client -} - -func NewSourceControlsClientWithBaseURI(sdkApi sdkEnv.Api) (*SourceControlsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sourcecontrols", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SourceControlsClient: %+v", err) - } - - return &SourceControlsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/constants.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/constants.go deleted file mode 100644 index 3a0fbd1e544..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package sourcecontrols - -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 ContentType string - -const ( - ContentTypeAnalyticRule ContentType = "AnalyticRule" - ContentTypeWorkbook ContentType = "Workbook" -) - -func PossibleValuesForContentType() []string { - return []string{ - string(ContentTypeAnalyticRule), - string(ContentTypeWorkbook), - } -} - -func (s *ContentType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseContentType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseContentType(input string) (*ContentType, error) { - vals := map[string]ContentType{ - "analyticrule": ContentTypeAnalyticRule, - "workbook": ContentTypeWorkbook, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ContentType(input) - return &out, nil -} - -type RepoType string - -const ( - RepoTypeDevOps RepoType = "DevOps" - RepoTypeGithub RepoType = "Github" -) - -func PossibleValuesForRepoType() []string { - return []string{ - string(RepoTypeDevOps), - string(RepoTypeGithub), - } -} - -func (s *RepoType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRepoType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRepoType(input string) (*RepoType, error) { - vals := map[string]RepoType{ - "devops": RepoTypeDevOps, - "github": RepoTypeGithub, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RepoType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol.go deleted file mode 100644 index e31a40901b7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol.go +++ /dev/null @@ -1,141 +0,0 @@ -package sourcecontrols - -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(&SourceControlId{}) -} - -var _ resourceids.ResourceId = &SourceControlId{} - -// SourceControlId is a struct representing the Resource ID for a Source Control -type SourceControlId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - SourceControlId string -} - -// NewSourceControlID returns a new SourceControlId struct -func NewSourceControlID(subscriptionId string, resourceGroupName string, workspaceName string, sourceControlId string) SourceControlId { - return SourceControlId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - SourceControlId: sourceControlId, - } -} - -// ParseSourceControlID parses 'input' into a SourceControlId -func ParseSourceControlID(input string) (*SourceControlId, error) { - parser := resourceids.NewParserFromResourceIdType(&SourceControlId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SourceControlId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSourceControlIDInsensitively parses 'input' case-insensitively into a SourceControlId -// note: this method should only be used for API response data and not user input -func ParseSourceControlIDInsensitively(input string) (*SourceControlId, error) { - parser := resourceids.NewParserFromResourceIdType(&SourceControlId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SourceControlId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SourceControlId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.SourceControlId, ok = input.Parsed["sourceControlId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "sourceControlId", input) - } - - return nil -} - -// ValidateSourceControlID checks that 'input' can be parsed as a Source Control ID -func ValidateSourceControlID(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 := ParseSourceControlID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Source Control ID -func (id SourceControlId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/sourceControls/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SourceControlId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Source Control ID -func (id SourceControlId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), - resourceids.UserSpecifiedSegment("sourceControlId", "sourceControlIdValue"), - } -} - -// String returns a human-readable description of this Source Control ID -func (id SourceControlId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Source Control: %q", id.SourceControlId), - } - return fmt.Sprintf("Source Control (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol_test.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol_test.go deleted file mode 100644 index 99bab4e60fb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_sourcecontrol_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package sourcecontrols - -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 = &SourceControlId{} - -func TestNewSourceControlID(t *testing.T) { - id := NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.SourceControlId != "sourceControlIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'SourceControlId'", id.SourceControlId, "sourceControlIdValue") - } -} - -func TestFormatSourceControlID(t *testing.T) { - actual := NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSourceControlID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SourceControlId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue", - Expected: &SourceControlId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SourceControlId: "sourceControlIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSourceControlID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SourceControlId != v.Expected.SourceControlId { - t.Fatalf("Expected %q but got %q for SourceControlId", v.Expected.SourceControlId, actual.SourceControlId) - } - - } -} - -func TestParseSourceControlIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SourceControlId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sOuRcEcOnTrOlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue", - Expected: &SourceControlId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SourceControlId: "sourceControlIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sOuRcEcOnTrOlS/sOuRcEcOnTrOlIdVaLuE", - Expected: &SourceControlId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - SourceControlId: "sOuRcEcOnTrOlIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sOuRcEcOnTrOlS/sOuRcEcOnTrOlIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSourceControlIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SourceControlId != v.Expected.SourceControlId { - t.Fatalf("Expected %q but got %q for SourceControlId", v.Expected.SourceControlId, actual.SourceControlId) - } - - } -} - -func TestSegmentsForSourceControlId(t *testing.T) { - segments := SourceControlId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SourceControlId 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/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace.go deleted file mode 100644 index ebdc1ecef81..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package sourcecontrols - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace_test.go deleted file mode 100644 index e8eeb2a6dee..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package sourcecontrols - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/sourcecontrols/method_create.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_create.go deleted file mode 100644 index 5df3dad0407..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package sourcecontrols - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SourceControl -} - -// Create ... -func (c SourceControlsClient) Create(ctx context.Context, id SourceControlId, input SourceControl) (result CreateOperationResponse, 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 SourceControl - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_delete.go deleted file mode 100644 index 579d919b3df..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package sourcecontrols - -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 SourceControlsClient) Delete(ctx context.Context, id SourceControlId) (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/securityinsights/2021-09-01-preview/sourcecontrols/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_get.go deleted file mode 100644 index dccc280d648..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package sourcecontrols - -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 *SourceControl -} - -// Get ... -func (c SourceControlsClient) Get(ctx context.Context, id SourceControlId) (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 SourceControl - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_list.go deleted file mode 100644 index f058d0ec61e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package sourcecontrols - -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 *[]SourceControl -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SourceControl -} - -// List ... -func (c SourceControlsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/sourceControls", 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 *[]SourceControl `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 SourceControlsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SourceControlOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SourceControlsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate SourceControlOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SourceControl, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/sourcecontrols/model_contentpathmap.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_contentpathmap.go deleted file mode 100644 index 236954d4dd9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_contentpathmap.go +++ /dev/null @@ -1,9 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContentPathMap struct { - ContentType *ContentType `json:"contentType,omitempty"` - Path *string `json:"path,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_repository.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_repository.go deleted file mode 100644 index fc80c1eb57b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_repository.go +++ /dev/null @@ -1,12 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Repository struct { - Branch *string `json:"branch,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` - DisplayUrl *string `json:"displayUrl,omitempty"` - PathMapping *[]ContentPathMap `json:"pathMapping,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrol.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrol.go deleted file mode 100644 index b0be9ef4aeb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrol.go +++ /dev/null @@ -1,17 +0,0 @@ -package sourcecontrols - -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 SourceControl struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SourceControlProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrolproperties.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrolproperties.go deleted file mode 100644 index 90168adc258..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/model_sourcecontrolproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceControlProperties struct { - ContentTypes []ContentType `json:"contentTypes"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Id *string `json:"id,omitempty"` - RepoType RepoType `json:"repoType"` - Repository Repository `json:"repository"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/predicates.go deleted file mode 100644 index 6f0751146d1..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceControlOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SourceControlOperationPredicate) Matches(input SourceControl) 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.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/securityinsights/2021-09-01-preview/sourcecontrols/version.go b/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/version.go deleted file mode 100644 index b6b620b55c6..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/sourcecontrols/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package sourcecontrols - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/sourcecontrols/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/README.md b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/README.md deleted file mode 100644 index 78b989de68d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/README.md +++ /dev/null @@ -1,191 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/threatintelligence` Documentation - -The `threatintelligence` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/threatintelligence" -``` - - -### Client Initialization - -```go -client := threatintelligence.NewThreatIntelligenceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorAppendTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceAppendTags{ - // ... -} - - -read, err := client.IndicatorAppendTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreate` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModelForRequestBody{ - // ... -} - - -read, err := client.IndicatorCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreateIndicator` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModelForRequestBody{ - // ... -} - - -read, err := client.IndicatorCreateIndicator(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorDelete` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorGet` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorMetricsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -read, err := client.IndicatorMetricsList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorQueryIndicators` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceFilteringCriteria{ - // ... -} - - -// alternatively `client.IndicatorQueryIndicators(ctx, id, payload)` can be used to do batched pagination -items, err := client.IndicatorQueryIndicatorsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorReplaceTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModelForRequestBody{ - // ... -} - - -read, err := client.IndicatorReplaceTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.IndicatorsList(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions())` can be used to do batched pagination -items, err := client.IndicatorsListComplete(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/client.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/client.go deleted file mode 100644 index edf96c3143f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceClient struct { - Client *resourcemanager.Client -} - -func NewThreatIntelligenceClientWithBaseURI(sdkApi sdkEnv.Api) (*ThreatIntelligenceClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "threatintelligence", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ThreatIntelligenceClient: %+v", err) - } - - return &ThreatIntelligenceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/constants.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/constants.go deleted file mode 100644 index 3047e7d6d68..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceResourceKindEnum string - -const ( - ThreatIntelligenceResourceKindEnumIndicator ThreatIntelligenceResourceKindEnum = "indicator" -) - -func PossibleValuesForThreatIntelligenceResourceKindEnum() []string { - return []string{ - string(ThreatIntelligenceResourceKindEnumIndicator), - } -} - -func (s *ThreatIntelligenceResourceKindEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseThreatIntelligenceResourceKindEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseThreatIntelligenceResourceKindEnum(input string) (*ThreatIntelligenceResourceKindEnum, error) { - vals := map[string]ThreatIntelligenceResourceKindEnum{ - "indicator": ThreatIntelligenceResourceKindEnumIndicator, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceResourceKindEnum(input) - return &out, nil -} - -type ThreatIntelligenceSortingCriteriaEnum string - -const ( - ThreatIntelligenceSortingCriteriaEnumAscending ThreatIntelligenceSortingCriteriaEnum = "ascending" - ThreatIntelligenceSortingCriteriaEnumDescending ThreatIntelligenceSortingCriteriaEnum = "descending" - ThreatIntelligenceSortingCriteriaEnumUnsorted ThreatIntelligenceSortingCriteriaEnum = "unsorted" -) - -func PossibleValuesForThreatIntelligenceSortingCriteriaEnum() []string { - return []string{ - string(ThreatIntelligenceSortingCriteriaEnumAscending), - string(ThreatIntelligenceSortingCriteriaEnumDescending), - string(ThreatIntelligenceSortingCriteriaEnumUnsorted), - } -} - -func (s *ThreatIntelligenceSortingCriteriaEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseThreatIntelligenceSortingCriteriaEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseThreatIntelligenceSortingCriteriaEnum(input string) (*ThreatIntelligenceSortingCriteriaEnum, error) { - vals := map[string]ThreatIntelligenceSortingCriteriaEnum{ - "ascending": ThreatIntelligenceSortingCriteriaEnumAscending, - "descending": ThreatIntelligenceSortingCriteriaEnumDescending, - "unsorted": ThreatIntelligenceSortingCriteriaEnumUnsorted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceSortingCriteriaEnum(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator.go deleted file mode 100644 index 73373ce2134..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator.go +++ /dev/null @@ -1,143 +0,0 @@ -package threatintelligence - -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(&IndicatorId{}) -} - -var _ resourceids.ResourceId = &IndicatorId{} - -// IndicatorId is a struct representing the Resource ID for a Indicator -type IndicatorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IndicatorName string -} - -// NewIndicatorID returns a new IndicatorId struct -func NewIndicatorID(subscriptionId string, resourceGroupName string, workspaceName string, indicatorName string) IndicatorId { - return IndicatorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IndicatorName: indicatorName, - } -} - -// ParseIndicatorID parses 'input' into a IndicatorId -func ParseIndicatorID(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(&IndicatorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IndicatorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIndicatorIDInsensitively parses 'input' case-insensitively into a IndicatorId -// note: this method should only be used for API response data and not user input -func ParseIndicatorIDInsensitively(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(&IndicatorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IndicatorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IndicatorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IndicatorName, ok = input.Parsed["indicatorName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", input) - } - - return nil -} - -// ValidateIndicatorID checks that 'input' can be parsed as a Indicator ID -func ValidateIndicatorID(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 := ParseIndicatorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Indicator ID -func (id IndicatorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IndicatorName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Indicator ID -func (id IndicatorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), - resourceids.StaticSegment("staticMain", "main", "main"), - resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "indicatorValue"), - } -} - -// String returns a human-readable description of this Indicator ID -func (id IndicatorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Indicator Name: %q", id.IndicatorName), - } - return fmt.Sprintf("Indicator (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator_test.go deleted file mode 100644 index 48751c131c7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_indicator_test.go +++ /dev/null @@ -1,387 +0,0 @@ -package threatintelligence - -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 = &IndicatorId{} - -func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IndicatorName != "indicatorValue" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorValue") - } -} - -func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIndicatorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IndicatorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IndicatorName: "indicatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIndicatorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IndicatorName != v.Expected.IndicatorName { - t.Fatalf("Expected %q but got %q for IndicatorName", v.Expected.IndicatorName, actual.IndicatorName) - } - - } -} - -func TestParseIndicatorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IndicatorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IndicatorName: "indicatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrVaLuE", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IndicatorName: "iNdIcAtOrVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIndicatorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IndicatorName != v.Expected.IndicatorName { - t.Fatalf("Expected %q but got %q for IndicatorName", v.Expected.IndicatorName, actual.IndicatorName) - } - - } -} - -func TestSegmentsForIndicatorId(t *testing.T) { - segments := IndicatorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IndicatorId 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/securityinsights/2021-09-01-preview/threatintelligence/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace.go deleted file mode 100644 index 2265507abcf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package threatintelligence - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace_test.go deleted file mode 100644 index 6609c36a05b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package threatintelligence - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorappendtags.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorappendtags.go deleted file mode 100644 index 4384327485d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorappendtags.go +++ /dev/null @@ -1,51 +0,0 @@ -package threatintelligence - -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 IndicatorAppendTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IndicatorAppendTags ... -func (c ThreatIntelligenceClient) IndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (result IndicatorAppendTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/appendTags", 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/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreate.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreate.go deleted file mode 100644 index 9cd68b9070e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreate.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorCreate ... -func (c ThreatIntelligenceClient) IndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModelForRequestBody) (result IndicatorCreateOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreateindicator.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreateindicator.go deleted file mode 100644 index 8cc69065279..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorcreateindicator.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorCreateIndicatorOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorCreateIndicator ... -func (c ThreatIntelligenceClient) IndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModelForRequestBody) (result IndicatorCreateIndicatorOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator", 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatordelete.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatordelete.go deleted file mode 100644 index 4de264524d5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatordelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package threatintelligence - -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 IndicatorDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IndicatorDelete ... -func (c ThreatIntelligenceClient) IndicatorDelete(ctx context.Context, id IndicatorId) (result IndicatorDeleteOperationResponse, 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/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorget.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorget.go deleted file mode 100644 index 3358363f139..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorget.go +++ /dev/null @@ -1,58 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorGet ... -func (c ThreatIntelligenceClient) IndicatorGet(ctx context.Context, id IndicatorId) (result IndicatorGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatormetricslist.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatormetricslist.go deleted file mode 100644 index f692c803e50..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatormetricslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package threatintelligence - -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 IndicatorMetricsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceMetricsList -} - -// IndicatorMetricsList ... -func (c ThreatIntelligenceClient) IndicatorMetricsList(ctx context.Context, id WorkspaceId) (result IndicatorMetricsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics", 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 ThreatIntelligenceMetricsList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorqueryindicators.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorqueryindicators.go deleted file mode 100644 index 8ce639f2623..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorqueryindicators.go +++ /dev/null @@ -1,103 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorQueryIndicatorsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ThreatIntelligenceInformation -} - -type IndicatorQueryIndicatorsCompleteResult struct { - LatestHttpResponse *http.Response - Items []ThreatIntelligenceInformation -} - -// IndicatorQueryIndicators ... -func (c ThreatIntelligenceClient) IndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (result IndicatorQueryIndicatorsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]ThreatIntelligenceInformation, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// IndicatorQueryIndicatorsComplete retrieves all the results into a single object -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsComplete(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (IndicatorQueryIndicatorsCompleteResult, error) { - return c.IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx, id, input, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorQueryIndicatorsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria, predicate ThreatIntelligenceInformationOperationPredicate) (result IndicatorQueryIndicatorsCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - resp, err := c.IndicatorQueryIndicators(ctx, id, input) - if err != nil { - 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 = IndicatorQueryIndicatorsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorreplacetags.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorreplacetags.go deleted file mode 100644 index 20da1141fcd..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorreplacetags.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorReplaceTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorReplaceTags ... -func (c ThreatIntelligenceClient) IndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModelForRequestBody) (result IndicatorReplaceTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/replaceTags", 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorslist.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorslist.go deleted file mode 100644 index 860ecd26255..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/method_indicatorslist.go +++ /dev/null @@ -1,139 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ThreatIntelligenceInformation -} - -type IndicatorsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ThreatIntelligenceInformation -} - -type IndicatorsListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultIndicatorsListOperationOptions() IndicatorsListOperationOptions { - return IndicatorsListOperationOptions{} -} - -func (o IndicatorsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IndicatorsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IndicatorsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// IndicatorsList ... -func (c ThreatIntelligenceClient) IndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (result IndicatorsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]ThreatIntelligenceInformation, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// IndicatorsListComplete retrieves all the results into a single object -func (c ThreatIntelligenceClient) IndicatorsListComplete(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (IndicatorsListCompleteResult, error) { - return c.IndicatorsListCompleteMatchingPredicate(ctx, id, options, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ThreatIntelligenceClient) IndicatorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions, predicate ThreatIntelligenceInformationOperationPredicate) (result IndicatorsListCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - resp, err := c.IndicatorsList(ctx, id, options) - if err != nil { - 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 = IndicatorsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceappendtags.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceappendtags.go deleted file mode 100644 index d864022037f..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceappendtags.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceAppendTags struct { - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceexternalreference.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceexternalreference.go deleted file mode 100644 index 52978aae636..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceexternalreference.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceExternalReference struct { - Description *string `json:"description,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - Hashes *map[string]string `json:"hashes,omitempty"` - SourceName *string `json:"sourceName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go deleted file mode 100644 index 181ef4790bf..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go +++ /dev/null @@ -1,20 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceFilteringCriteria struct { - Ids *[]string `json:"ids,omitempty"` - IncludeDisabled *bool `json:"includeDisabled,omitempty"` - Keywords *[]string `json:"keywords,omitempty"` - MaxConfidence *int64 `json:"maxConfidence,omitempty"` - MaxValidUntil *string `json:"maxValidUntil,omitempty"` - MinConfidence *int64 `json:"minConfidence,omitempty"` - MinValidUntil *string `json:"minValidUntil,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - PatternTypes *[]string `json:"patternTypes,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` - SortBy *[]ThreatIntelligenceSortingCriteria `json:"sortBy,omitempty"` - Sources *[]string `json:"sources,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go deleted file mode 100644 index f35c4df440d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go +++ /dev/null @@ -1,10 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceGranularMarkingModel struct { - Language *string `json:"language,omitempty"` - MarkingRef *int64 `json:"markingRef,omitempty"` - Selectors *[]string `json:"selectors,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go deleted file mode 100644 index 9ee1b5778ed..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go +++ /dev/null @@ -1,48 +0,0 @@ -package threatintelligence - -import ( - "encoding/json" - "fmt" - - "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. - -var _ ThreatIntelligenceInformation = ThreatIntelligenceIndicatorModel{} - -type ThreatIntelligenceIndicatorModel struct { - Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` - - // Fields inherited from ThreatIntelligenceInformation - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceIndicatorModel{} - -func (s ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceIndicatorModel - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - decoded["kind"] = "indicator" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodelforrequestbody.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodelforrequestbody.go deleted file mode 100644 index 428dd0b64f9..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatormodelforrequestbody.go +++ /dev/null @@ -1,10 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceIndicatorModelForRequestBody struct { - Etag *string `json:"etag,omitempty"` - Kind ThreatIntelligenceResourceKindEnum `json:"kind"` - Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go deleted file mode 100644 index 49660ed5792..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go +++ /dev/null @@ -1,37 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceIndicatorProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Confidence *int64 `json:"confidence,omitempty"` - Created *string `json:"created,omitempty"` - CreatedByRef *string `json:"createdByRef,omitempty"` - Defanged *bool `json:"defanged,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` - ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - GranularMarkings *[]ThreatIntelligenceGranularMarkingModel `json:"granularMarkings,omitempty"` - IndicatorTypes *[]string `json:"indicatorTypes,omitempty"` - KillChainPhases *[]ThreatIntelligenceKillChainPhase `json:"killChainPhases,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Language *string `json:"language,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Modified *string `json:"modified,omitempty"` - ObjectMarkingRefs *[]string `json:"objectMarkingRefs,omitempty"` - ParsedPattern *[]ThreatIntelligenceParsedPattern `json:"parsedPattern,omitempty"` - Pattern *string `json:"pattern,omitempty"` - PatternType *string `json:"patternType,omitempty"` - PatternVersion *string `json:"patternVersion,omitempty"` - Revoked *bool `json:"revoked,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidUntil *string `json:"validUntil,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceinformation.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceinformation.go deleted file mode 100644 index d036b649d26..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceinformation.go +++ /dev/null @@ -1,53 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceInformation interface { -} - -// RawThreatIntelligenceInformationImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawThreatIntelligenceInformationImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalThreatIntelligenceInformationImplementation(input []byte) (ThreatIntelligenceInformation, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceInformation into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "indicator") { - var out ThreatIntelligenceIndicatorModel - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceIndicatorModel: %+v", err) - } - return out, nil - } - - out := RawThreatIntelligenceInformationImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencekillchainphase.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencekillchainphase.go deleted file mode 100644 index 69319b0f616..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencekillchainphase.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceKillChainPhase struct { - KillChainName *string `json:"killChainName,omitempty"` - PhaseName *string `json:"phaseName,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetric.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetric.go deleted file mode 100644 index a6af3828039..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetric.go +++ /dev/null @@ -1,11 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetric struct { - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - PatternTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"patternTypeMetrics,omitempty"` - SourceMetrics *[]ThreatIntelligenceMetricEntity `json:"sourceMetrics,omitempty"` - ThreatTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"threatTypeMetrics,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricentity.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricentity.go deleted file mode 100644 index 562f12dd822..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricEntity struct { - MetricName *string `json:"metricName,omitempty"` - MetricValue *int64 `json:"metricValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetrics.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetrics.go deleted file mode 100644 index 14a6959c873..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetrics.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetrics struct { - Properties *ThreatIntelligenceMetric `json:"properties,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricslist.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricslist.go deleted file mode 100644 index 68025bf73cb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencemetricslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricsList struct { - Value []ThreatIntelligenceMetrics `json:"value"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go deleted file mode 100644 index 432ca8c997b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPattern struct { - PatternTypeKey *string `json:"patternTypeKey,omitempty"` - PatternTypeValues *[]ThreatIntelligenceParsedPatternTypeValue `json:"patternTypeValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go deleted file mode 100644 index e65b3199903..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPatternTypeValue struct { - Value *string `json:"value,omitempty"` - ValueType *string `json:"valueType,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go deleted file mode 100644 index e2369ffa0bb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceSortingCriteria struct { - ItemKey *string `json:"itemKey,omitempty"` - SortOrder *ThreatIntelligenceSortingCriteriaEnum `json:"sortOrder,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/predicates.go deleted file mode 100644 index 6020562ed4b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceInformationOperationPredicate struct { -} - -func (p ThreatIntelligenceInformationOperationPredicate) Matches(input ThreatIntelligenceInformation) bool { - - return true -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/version.go b/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/version.go deleted file mode 100644 index 1fbd1f95a93..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/threatintelligence/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/threatintelligence/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/README.md b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/README.md deleted file mode 100644 index 01dd45495a8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/watchlistitems` Documentation - -The `watchlistitems` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/watchlistitems" -``` - - -### Client Initialization - -```go -client := watchlistitems.NewWatchlistItemsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WatchlistItemsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -payload := watchlistitems.WatchlistItem{ - // ... -} - - -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: `WatchlistItemsClient.Delete` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -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: `WatchlistItemsClient.Get` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -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: `WatchlistItemsClient.List` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -// 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/securityinsights/2021-09-01-preview/watchlistitems/client.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/client.go deleted file mode 100644 index d3193694a48..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package watchlistitems - -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 WatchlistItemsClient struct { - Client *resourcemanager.Client -} - -func NewWatchlistItemsClientWithBaseURI(sdkApi sdkEnv.Api) (*WatchlistItemsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "watchlistitems", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WatchlistItemsClient: %+v", err) - } - - return &WatchlistItemsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist.go deleted file mode 100644 index 7df2e8c2562..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist.go +++ /dev/null @@ -1,141 +0,0 @@ -package watchlistitems - -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(&WatchlistId{}) -} - -var _ resourceids.ResourceId = &WatchlistId{} - -// WatchlistId is a struct representing the Resource ID for a Watchlist -type WatchlistId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string -} - -// NewWatchlistID returns a new WatchlistId struct -func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - } -} - -// ParseWatchlistID parses 'input' into a WatchlistId -func ParseWatchlistID(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId -// note: this method should only be used for API response data and not user input -func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - return nil -} - -// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID -func ValidateWatchlistID(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 := ParseWatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist ID -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID -func (id WatchlistId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - } -} - -// String returns a human-readable description of this Watchlist ID -func (id WatchlistId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - } - return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist_test.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist_test.go deleted file mode 100644 index c0840d7109b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlist_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package watchlistitems - -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 = &WatchlistId{} - -func TestNewWatchlistID(t *testing.T) { - id := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } -} - -func TestFormatWatchlistID(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestParseWatchlistIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestSegmentsForWatchlistId(t *testing.T) { - segments := WatchlistId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistId 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/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem.go deleted file mode 100644 index 95aa9b8f56d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem.go +++ /dev/null @@ -1,150 +0,0 @@ -package watchlistitems - -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(&WatchlistItemId{}) -} - -var _ resourceids.ResourceId = &WatchlistItemId{} - -// WatchlistItemId is a struct representing the Resource ID for a Watchlist Item -type WatchlistItemId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string - WatchlistItemId string -} - -// NewWatchlistItemID returns a new WatchlistItemId struct -func NewWatchlistItemID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string, watchlistItemId string) WatchlistItemId { - return WatchlistItemId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - WatchlistItemId: watchlistItemId, - } -} - -// ParseWatchlistItemID parses 'input' into a WatchlistItemId -func ParseWatchlistItemID(input string) (*WatchlistItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistItemId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistItemIDInsensitively parses 'input' case-insensitively into a WatchlistItemId -// note: this method should only be used for API response data and not user input -func ParseWatchlistItemIDInsensitively(input string) (*WatchlistItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistItemId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistItemId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - if id.WatchlistItemId, ok = input.Parsed["watchlistItemId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistItemId", input) - } - - return nil -} - -// ValidateWatchlistItemID checks that 'input' can be parsed as a Watchlist Item ID -func ValidateWatchlistItemID(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 := ParseWatchlistItemID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist Item ID -func (id WatchlistItemId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s/watchlistItems/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias, id.WatchlistItemId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist Item ID -func (id WatchlistItemId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - resourceids.StaticSegment("staticWatchlistItems", "watchlistItems", "watchlistItems"), - resourceids.UserSpecifiedSegment("watchlistItemId", "watchlistItemIdValue"), - } -} - -// String returns a human-readable description of this Watchlist Item ID -func (id WatchlistItemId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - fmt.Sprintf("Watchlist Item: %q", id.WatchlistItemId), - } - return fmt.Sprintf("Watchlist Item (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem_test.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem_test.go deleted file mode 100644 index 6f4a0b1438a..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/id_watchlistitem_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package watchlistitems - -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 = &WatchlistItemId{} - -func TestNewWatchlistItemID(t *testing.T) { - id := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } - - if id.WatchlistItemId != "watchlistItemIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistItemId'", id.WatchlistItemId, "watchlistItemIdValue") - } -} - -func TestFormatWatchlistItemID(t *testing.T) { - actual := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistItemID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - WatchlistItemId: "watchlistItemIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistItemID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - if actual.WatchlistItemId != v.Expected.WatchlistItemId { - t.Fatalf("Expected %q but got %q for WatchlistItemId", v.Expected.WatchlistItemId, actual.WatchlistItemId) - } - - } -} - -func TestParseWatchlistItemIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - WatchlistItemId: "watchlistItemIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS/wAtChLiStItEmIdVaLuE", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - WatchlistItemId: "wAtChLiStItEmIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS/wAtChLiStItEmIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistItemIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - if actual.WatchlistItemId != v.Expected.WatchlistItemId { - t.Fatalf("Expected %q but got %q for WatchlistItemId", v.Expected.WatchlistItemId, actual.WatchlistItemId) - } - - } -} - -func TestSegmentsForWatchlistItemId(t *testing.T) { - segments := WatchlistItemId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistItemId 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/securityinsights/2021-09-01-preview/watchlistitems/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_createorupdate.go deleted file mode 100644 index 68142e971a8..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package watchlistitems - -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 *WatchlistItem -} - -// CreateOrUpdate ... -func (c WatchlistItemsClient) CreateOrUpdate(ctx context.Context, id WatchlistItemId, input WatchlistItem) (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 WatchlistItem - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_delete.go deleted file mode 100644 index 5565b767fa5..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlistitems - -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 WatchlistItemsClient) Delete(ctx context.Context, id WatchlistItemId) (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/securityinsights/2021-09-01-preview/watchlistitems/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_get.go deleted file mode 100644 index 1973c679f9e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package watchlistitems - -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 *WatchlistItem -} - -// Get ... -func (c WatchlistItemsClient) Get(ctx context.Context, id WatchlistItemId) (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 WatchlistItem - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_list.go deleted file mode 100644 index 8a4d418ea0b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package watchlistitems - -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 *[]WatchlistItem -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []WatchlistItem -} - -// List ... -func (c WatchlistItemsClient) List(ctx context.Context, id WatchlistId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/watchlistItems", 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 *[]WatchlistItem `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 WatchlistItemsClient) ListComplete(ctx context.Context, id WatchlistId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WatchlistItemOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WatchlistItemsClient) ListCompleteMatchingPredicate(ctx context.Context, id WatchlistId, predicate WatchlistItemOperationPredicate) (result ListCompleteResult, err error) { - items := make([]WatchlistItem, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/watchlistitems/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_userinfo.go deleted file mode 100644 index 9d03c24555b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package watchlistitems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitem.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitem.go deleted file mode 100644 index 1b198fb819b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitem.go +++ /dev/null @@ -1,17 +0,0 @@ -package watchlistitems - -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 WatchlistItem struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WatchlistItemProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitemproperties.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitemproperties.go deleted file mode 100644 index 77f219a0cce..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/model_watchlistitemproperties.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlistitems - -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 WatchlistItemProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - EntityMapping *interface{} `json:"entityMapping,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsKeyValue interface{} `json:"itemsKeyValue"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - WatchlistItemId *string `json:"watchlistItemId,omitempty"` - WatchlistItemType *string `json:"watchlistItemType,omitempty"` -} - -func (o *WatchlistItemProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistItemProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *WatchlistItemProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistItemProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/predicates.go deleted file mode 100644 index c9960b515cb..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package watchlistitems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WatchlistItemOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p WatchlistItemOperationPredicate) Matches(input WatchlistItem) 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.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/securityinsights/2021-09-01-preview/watchlistitems/version.go b/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/version.go deleted file mode 100644 index b26a6c88fc4..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlistitems/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package watchlistitems - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/watchlistitems/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/README.md b/resource-manager/securityinsights/2021-09-01-preview/watchlists/README.md deleted file mode 100644 index dc709e4c812..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2021-09-01-preview/watchlists` Documentation - -The `watchlists` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2021-09-01-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/securityinsights/2021-09-01-preview/watchlists" -``` - - -### Client Initialization - -```go -client := watchlists.NewWatchlistsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WatchlistsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -payload := watchlists.Watchlist{ - // ... -} - - -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: `WatchlistsClient.Delete` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -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: `WatchlistsClient.Get` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -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: `WatchlistsClient.List` - -```go -ctx := context.TODO() -id := watchlists.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2021-09-01-preview/watchlists/client.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/client.go deleted file mode 100644 index 45211175054..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package watchlists - -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 WatchlistsClient struct { - Client *resourcemanager.Client -} - -func NewWatchlistsClientWithBaseURI(sdkApi sdkEnv.Api) (*WatchlistsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "watchlists", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WatchlistsClient: %+v", err) - } - - return &WatchlistsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/constants.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/constants.go deleted file mode 100644 index 2ec351b8408..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package watchlists - -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 Source string - -const ( - SourceLocalFile Source = "Local file" - SourceRemoteStorage Source = "Remote storage" -) - -func PossibleValuesForSource() []string { - return []string{ - string(SourceLocalFile), - string(SourceRemoteStorage), - } -} - -func (s *Source) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSource(input string) (*Source, error) { - vals := map[string]Source{ - "local file": SourceLocalFile, - "remote storage": SourceRemoteStorage, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Source(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist.go deleted file mode 100644 index e5b47b1456e..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist.go +++ /dev/null @@ -1,141 +0,0 @@ -package watchlists - -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(&WatchlistId{}) -} - -var _ resourceids.ResourceId = &WatchlistId{} - -// WatchlistId is a struct representing the Resource ID for a Watchlist -type WatchlistId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string -} - -// NewWatchlistID returns a new WatchlistId struct -func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - } -} - -// ParseWatchlistID parses 'input' into a WatchlistId -func ParseWatchlistID(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId -// note: this method should only be used for API response data and not user input -func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - return nil -} - -// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID -func ValidateWatchlistID(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 := ParseWatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist ID -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID -func (id WatchlistId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - } -} - -// String returns a human-readable description of this Watchlist ID -func (id WatchlistId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - } - return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist_test.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist_test.go deleted file mode 100644 index 31b93b91550..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_watchlist_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package watchlists - -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 = &WatchlistId{} - -func TestNewWatchlistID(t *testing.T) { - id := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } -} - -func TestFormatWatchlistID(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestParseWatchlistIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestSegmentsForWatchlistId(t *testing.T) { - segments := WatchlistId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistId 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/securityinsights/2021-09-01-preview/watchlists/id_workspace.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace.go deleted file mode 100644 index d8e6bddfee7..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package watchlists - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace_test.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace_test.go deleted file mode 100644 index dfecaa8860b..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package watchlists - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2021-09-01-preview/watchlists/method_createorupdate.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_createorupdate.go deleted file mode 100644 index eb0b4f9396d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package watchlists - -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 *Watchlist -} - -// CreateOrUpdate ... -func (c WatchlistsClient) CreateOrUpdate(ctx context.Context, id WatchlistId, input Watchlist) (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 Watchlist - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_delete.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_delete.go deleted file mode 100644 index 9d495f99c57..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlists - -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 WatchlistsClient) Delete(ctx context.Context, id WatchlistId) (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/securityinsights/2021-09-01-preview/watchlists/method_get.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_get.go deleted file mode 100644 index 7aac16c3975..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package watchlists - -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 *Watchlist -} - -// Get ... -func (c WatchlistsClient) Get(ctx context.Context, id WatchlistId) (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 Watchlist - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_list.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_list.go deleted file mode 100644 index 9122b014815..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package watchlists - -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 *[]Watchlist -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Watchlist -} - -// List ... -func (c WatchlistsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/watchlists", 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 *[]Watchlist `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 WatchlistsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WatchlistOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WatchlistsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate WatchlistOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Watchlist, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2021-09-01-preview/watchlists/model_userinfo.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_userinfo.go deleted file mode 100644 index 5c0e0c29617..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package watchlists - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlist.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlist.go deleted file mode 100644 index 2c34c33bb58..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlist.go +++ /dev/null @@ -1,17 +0,0 @@ -package watchlists - -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 Watchlist struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WatchlistProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlistproperties.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlistproperties.go deleted file mode 100644 index 84611500c9d..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/model_watchlistproperties.go +++ /dev/null @@ -1,58 +0,0 @@ -package watchlists - -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 WatchlistProperties struct { - ContentType *string `json:"contentType,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DefaultDuration *string `json:"defaultDuration,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsSearchKey string `json:"itemsSearchKey"` - Labels *[]string `json:"labels,omitempty"` - NumberOfLinesToSkip *int64 `json:"numberOfLinesToSkip,omitempty"` - Provider string `json:"provider"` - RawContent *string `json:"rawContent,omitempty"` - Source Source `json:"source"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - UploadStatus *string `json:"uploadStatus,omitempty"` - WatchlistAlias *string `json:"watchlistAlias,omitempty"` - WatchlistId *string `json:"watchlistId,omitempty"` - WatchlistItemsCount *int64 `json:"watchlistItemsCount,omitempty"` - WatchlistType *string `json:"watchlistType,omitempty"` -} - -func (o *WatchlistProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *WatchlistProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2021-09-01-preview/watchlists/predicates.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/predicates.go deleted file mode 100644 index f335c7c61ff..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package watchlists - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WatchlistOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p WatchlistOperationPredicate) Matches(input Watchlist) 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.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/securityinsights/2021-09-01-preview/watchlists/version.go b/resource-manager/securityinsights/2021-09-01-preview/watchlists/version.go deleted file mode 100644 index 7b5daab0a70..00000000000 --- a/resource-manager/securityinsights/2021-09-01-preview/watchlists/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package watchlists - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2021-09-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/watchlists/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/README.md b/resource-manager/securityinsights/2022-07-01-preview/actions/README.md deleted file mode 100644 index 26e4455dc2f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/actions` Documentation - -The `actions` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/actions" -``` - - -### Client Initialization - -```go -client := actions.NewActionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ActionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -payload := actions.ActionRequest{ - // ... -} - - -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: `ActionsClient.Delete` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -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: `ActionsClient.Get` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -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: `ActionsClient.ListByAlertRule` - -```go -ctx := context.TODO() -id := actions.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -// alternatively `client.ListByAlertRule(ctx, id)` can be used to do batched pagination -items, err := client.ListByAlertRuleComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/client.go b/resource-manager/securityinsights/2022-07-01-preview/actions/client.go deleted file mode 100644 index a2b7d01bfe1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package actions - -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 ActionsClient struct { - Client *resourcemanager.Client -} - -func NewActionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ActionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "actions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ActionsClient: %+v", err) - } - - return &ActionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/id_action.go b/resource-manager/securityinsights/2022-07-01-preview/actions/id_action.go deleted file mode 100644 index aeefc14d3f8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/id_action.go +++ /dev/null @@ -1,150 +0,0 @@ -package actions - -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(&ActionId{}) -} - -var _ resourceids.ResourceId = &ActionId{} - -// ActionId is a struct representing the Resource ID for a Action -type ActionId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string - ActionId string -} - -// NewActionID returns a new ActionId struct -func NewActionID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string, actionId string) ActionId { - return ActionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - ActionId: actionId, - } -} - -// ParseActionID parses 'input' into a ActionId -func ParseActionID(input string) (*ActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ActionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseActionIDInsensitively parses 'input' case-insensitively into a ActionId -// note: this method should only be used for API response data and not user input -func ParseActionIDInsensitively(input string) (*ActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ActionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ActionId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - if id.ActionId, ok = input.Parsed["actionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "actionId", input) - } - - return nil -} - -// ValidateActionID checks that 'input' can be parsed as a Action ID -func ValidateActionID(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 := ParseActionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Action ID -func (id ActionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s/actions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId, id.ActionId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Action ID -func (id ActionId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - resourceids.StaticSegment("staticActions", "actions", "actions"), - resourceids.UserSpecifiedSegment("actionId", "actionIdValue"), - } -} - -// String returns a human-readable description of this Action ID -func (id ActionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - fmt.Sprintf("Action: %q", id.ActionId), - } - return fmt.Sprintf("Action (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/id_action_test.go b/resource-manager/securityinsights/2022-07-01-preview/actions/id_action_test.go deleted file mode 100644 index 5178cfc7cdb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/id_action_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package actions - -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 = &ActionId{} - -func TestNewActionID(t *testing.T) { - id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } - - if id.ActionId != "actionIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ActionId'", id.ActionId, "actionIdValue") - } -} - -func TestFormatActionID(t *testing.T) { - actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseActionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ActionId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - ActionId: "actionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseActionID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - if actual.ActionId != v.Expected.ActionId { - t.Fatalf("Expected %q but got %q for ActionId", v.Expected.ActionId, actual.ActionId) - } - - } -} - -func TestParseActionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ActionId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - ActionId: "actionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs/aCtIoNiDvAlUe", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - ActionId: "aCtIoNiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs/aCtIoNiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseActionIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - if actual.ActionId != v.Expected.ActionId { - t.Fatalf("Expected %q but got %q for ActionId", v.Expected.ActionId, actual.ActionId) - } - - } -} - -func TestSegmentsForActionId(t *testing.T) { - segments := ActionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ActionId 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/securityinsights/2022-07-01-preview/actions/id_alertrule.go b/resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule.go deleted file mode 100644 index 731f6439ae3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package actions - -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(&AlertRuleId{}) -} - -var _ resourceids.ResourceId = &AlertRuleId{} - -// AlertRuleId is a struct representing the Resource ID for a Alert Rule -type AlertRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string -} - -// NewAlertRuleID returns a new AlertRuleId struct -func NewAlertRuleID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string) AlertRuleId { - return AlertRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - } -} - -// ParseAlertRuleID parses 'input' into a AlertRuleId -func ParseAlertRuleID(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleIDInsensitively parses 'input' case-insensitively into a AlertRuleId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - return nil -} - -// ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID -func ValidateAlertRuleID(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 := ParseAlertRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule ID -func (id AlertRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule ID -func (id AlertRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule ID -func (id AlertRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - } - return fmt.Sprintf("Alert Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule_test.go b/resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule_test.go deleted file mode 100644 index 890c1efe56a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/id_alertrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package actions - -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 = &AlertRuleId{} - -func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } -} - -func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestParseAlertRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestSegmentsForAlertRuleId(t *testing.T) { - segments := AlertRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleId 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/securityinsights/2022-07-01-preview/actions/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/actions/method_createorupdate.go deleted file mode 100644 index e84c5bebbd7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package actions - -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 *ActionResponse -} - -// CreateOrUpdate ... -func (c ActionsClient) CreateOrUpdate(ctx context.Context, id ActionId, input ActionRequest) (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 ActionResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/actions/method_delete.go deleted file mode 100644 index 0f8a28307c2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package actions - -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 ActionsClient) Delete(ctx context.Context, id ActionId) (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/securityinsights/2022-07-01-preview/actions/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/actions/method_get.go deleted file mode 100644 index 9d5aad5dc58..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package actions - -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 *ActionResponse -} - -// Get ... -func (c ActionsClient) Get(ctx context.Context, id ActionId) (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 ActionResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/method_listbyalertrule.go b/resource-manager/securityinsights/2022-07-01-preview/actions/method_listbyalertrule.go deleted file mode 100644 index 09d32b9d82d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/method_listbyalertrule.go +++ /dev/null @@ -1,91 +0,0 @@ -package actions - -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 ListByAlertRuleOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ActionResponse -} - -type ListByAlertRuleCompleteResult struct { - LatestHttpResponse *http.Response - Items []ActionResponse -} - -// ListByAlertRule ... -func (c ActionsClient) ListByAlertRule(ctx context.Context, id AlertRuleId) (result ListByAlertRuleOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/actions", 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 *[]ActionResponse `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByAlertRuleComplete retrieves all the results into a single object -func (c ActionsClient) ListByAlertRuleComplete(ctx context.Context, id AlertRuleId) (ListByAlertRuleCompleteResult, error) { - return c.ListByAlertRuleCompleteMatchingPredicate(ctx, id, ActionResponseOperationPredicate{}) -} - -// ListByAlertRuleCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ActionsClient) ListByAlertRuleCompleteMatchingPredicate(ctx context.Context, id AlertRuleId, predicate ActionResponseOperationPredicate) (result ListByAlertRuleCompleteResult, err error) { - items := make([]ActionResponse, 0) - - resp, err := c.ListByAlertRule(ctx, id) - if err != nil { - 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 = ListByAlertRuleCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequest.go b/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequest.go deleted file mode 100644 index d2392a75a2d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequest.go +++ /dev/null @@ -1,17 +0,0 @@ -package actions - -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 ActionRequest struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ActionRequestProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequestproperties.go b/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequestproperties.go deleted file mode 100644 index 209f602de8a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionrequestproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionRequestProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - TriggerUri string `json:"triggerUri"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponse.go b/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponse.go deleted file mode 100644 index c357a58ab2a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponse.go +++ /dev/null @@ -1,17 +0,0 @@ -package actions - -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 ActionResponse struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ActionResponseProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponseproperties.go b/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponseproperties.go deleted file mode 100644 index ef4e54d6817..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/model_actionresponseproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionResponseProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - WorkflowId *string `json:"workflowId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/actions/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/actions/predicates.go deleted file mode 100644 index 317d6feb3d6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionResponseOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ActionResponseOperationPredicate) Matches(input ActionResponse) 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.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/securityinsights/2022-07-01-preview/actions/version.go b/resource-manager/securityinsights/2022-07-01-preview/actions/version.go deleted file mode 100644 index c612ab1e00d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/actions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package actions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/actions/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/README.md b/resource-manager/securityinsights/2022-07-01-preview/alertrules/README.md deleted file mode 100644 index 648c74b5997..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/alertrules` Documentation - -The `alertrules` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/alertrules" -``` - - -### Client Initialization - -```go -client := alertrules.NewAlertRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -payload := alertrules.AlertRule{ - // ... -} - - -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: `AlertRulesClient.Delete` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -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: `AlertRulesClient.Get` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -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: `AlertRulesClient.List` - -```go -ctx := context.TODO() -id := alertrules.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/alertrules/client.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/client.go deleted file mode 100644 index e6ca04af9da..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alertrules - -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 AlertRulesClient struct { - Client *resourcemanager.Client -} - -func NewAlertRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alertrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertRulesClient: %+v", err) - } - - return &AlertRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/constants.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/constants.go deleted file mode 100644 index b6058aaf656..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/constants.go +++ /dev/null @@ -1,514 +0,0 @@ -package alertrules - -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 AlertDetail string - -const ( - AlertDetailDisplayName AlertDetail = "DisplayName" - AlertDetailSeverity AlertDetail = "Severity" -) - -func PossibleValuesForAlertDetail() []string { - return []string{ - string(AlertDetailDisplayName), - string(AlertDetailSeverity), - } -} - -func (s *AlertDetail) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertDetail(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertDetail(input string) (*AlertDetail, error) { - vals := map[string]AlertDetail{ - "displayname": AlertDetailDisplayName, - "severity": AlertDetailSeverity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertDetail(input) - return &out, nil -} - -type AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindNRT AlertRuleKind = "NRT" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" - AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMLBehaviorAnalytics), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindNRT), - string(AlertRuleKindScheduled), - string(AlertRuleKindThreatIntelligence), - } -} - -func (s *AlertRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "mlbehavioranalytics": AlertRuleKindMLBehaviorAnalytics, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "nrt": AlertRuleKindNRT, - "scheduled": AlertRuleKindScheduled, - "threatintelligence": AlertRuleKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func (s *EntityMappingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityMappingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func (s *EventGroupingAggregationKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEventGroupingAggregationKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MatchingMethod string - -const ( - MatchingMethodAllEntities MatchingMethod = "AllEntities" - MatchingMethodAnyAlert MatchingMethod = "AnyAlert" - MatchingMethodSelected MatchingMethod = "Selected" -) - -func PossibleValuesForMatchingMethod() []string { - return []string{ - string(MatchingMethodAllEntities), - string(MatchingMethodAnyAlert), - string(MatchingMethodSelected), - } -} - -func (s *MatchingMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMatchingMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMatchingMethod(input string) (*MatchingMethod, error) { - vals := map[string]MatchingMethod{ - "allentities": MatchingMethodAllEntities, - "anyalert": MatchingMethodAnyAlert, - "selected": MatchingMethodSelected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MatchingMethod(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" - MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" - MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - string(MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection), - string(MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection), - } -} - -func (s *MicrosoftSecurityProductName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMicrosoftSecurityProductName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - "microsoft defender advanced threat protection": MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, - "office 365 advanced threat protection": MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func (s *TriggerOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule.go deleted file mode 100644 index 818f124e5ef..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package alertrules - -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(&AlertRuleId{}) -} - -var _ resourceids.ResourceId = &AlertRuleId{} - -// AlertRuleId is a struct representing the Resource ID for a Alert Rule -type AlertRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string -} - -// NewAlertRuleID returns a new AlertRuleId struct -func NewAlertRuleID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string) AlertRuleId { - return AlertRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - } -} - -// ParseAlertRuleID parses 'input' into a AlertRuleId -func ParseAlertRuleID(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleIDInsensitively parses 'input' case-insensitively into a AlertRuleId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - return nil -} - -// ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID -func ValidateAlertRuleID(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 := ParseAlertRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule ID -func (id AlertRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule ID -func (id AlertRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule ID -func (id AlertRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - } - return fmt.Sprintf("Alert Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule_test.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule_test.go deleted file mode 100644 index c3c781da17b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_alertrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package alertrules - -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 = &AlertRuleId{} - -func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } -} - -func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestParseAlertRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestSegmentsForAlertRuleId(t *testing.T) { - segments := AlertRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleId 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/securityinsights/2022-07-01-preview/alertrules/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace.go deleted file mode 100644 index 005b7fc90a7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package alertrules - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace_test.go deleted file mode 100644 index 3846c76d11d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alertrules - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/alertrules/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_createorupdate.go deleted file mode 100644 index f77c7558d09..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *AlertRule -} - -// CreateOrUpdate ... -func (c AlertRulesClient) CreateOrUpdate(ctx context.Context, id AlertRuleId, input AlertRule) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_delete.go deleted file mode 100644 index aae7085c25e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertrules - -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 AlertRulesClient) Delete(ctx context.Context, id AlertRuleId) (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/securityinsights/2022-07-01-preview/alertrules/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_get.go deleted file mode 100644 index 945c07bfad1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *AlertRule -} - -// Get ... -func (c AlertRulesClient) Get(ctx context.Context, id AlertRuleId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_list.go deleted file mode 100644 index 5ac99496167..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *[]AlertRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AlertRule -} - -// List ... -func (c AlertRulesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRules", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]AlertRule, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalAlertRuleImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRule (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AlertRulesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AlertRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AlertRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/alertrules/model_alertdetailsoverride.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertdetailsoverride.go deleted file mode 100644 index 12e98f5419a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertrule.go deleted file mode 100644 index 7bb4d493656..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_alertrule.go +++ /dev/null @@ -1,93 +0,0 @@ -package alertrules - -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 AlertRule interface { -} - -// RawAlertRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAlertRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAlertRuleImplementation(input []byte) (AlertRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MLBehaviorAnalytics") { - var out MLBehaviorAnalyticsAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MLBehaviorAnalyticsAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NRT") { - var out NrtAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NrtAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out ThreatIntelligenceAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceAlertRule: %+v", err) - } - return out, nil - } - - out := RawAlertRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_entitymapping.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_entitymapping.go deleted file mode 100644 index b1fc81c3323..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_eventgroupingsettings.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_eventgroupingsettings.go deleted file mode 100644 index ae513b5b198..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fieldmapping.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fieldmapping.go deleted file mode 100644 index 9e73ac23218..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertrule.go deleted file mode 100644 index c4ed17f4319..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = FusionAlertRule{} - -type FusionAlertRule struct { - Properties *FusionAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRule{} - -func (s FusionAlertRule) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRule: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertruleproperties.go deleted file mode 100644 index 89e3751fcc8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionalertruleproperties.go +++ /dev/null @@ -1,35 +0,0 @@ -package alertrules - -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 FusionAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - ScenarioExclusionPatterns *[]FusionScenarioExclusionPattern `json:"scenarioExclusionPatterns,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - SourceSettings *[]FusionSourceSettings `json:"sourceSettings,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *FusionAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionscenarioexclusionpattern.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionscenarioexclusionpattern.go deleted file mode 100644 index 98b11076d11..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionscenarioexclusionpattern.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionScenarioExclusionPattern struct { - DateAddedInUTC string `json:"dateAddedInUTC"` - ExclusionPattern string `json:"exclusionPattern"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesettings.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesettings.go deleted file mode 100644 index dd206d437b5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesettings.go +++ /dev/null @@ -1,10 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionSourceSettings struct { - Enabled bool `json:"enabled"` - SourceName string `json:"sourceName"` - SourceSubTypes *[]FusionSourceSubTypeSetting `json:"sourceSubTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesubtypesetting.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesubtypesetting.go deleted file mode 100644 index b2561512e5f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsourcesubtypesetting.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionSourceSubTypeSetting struct { - Enabled bool `json:"enabled"` - SeverityFilters FusionSubTypeSeverityFilter `json:"severityFilters"` - SourceSubTypeDisplayName *string `json:"sourceSubTypeDisplayName,omitempty"` - SourceSubTypeName string `json:"sourceSubTypeName"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfilter.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfilter.go deleted file mode 100644 index 149cc8f8372..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfilter.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionSubTypeSeverityFilter struct { - Filters *[]FusionSubTypeSeverityFiltersItem `json:"filters,omitempty"` - IsSupported *bool `json:"isSupported,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfiltersitem.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfiltersitem.go deleted file mode 100644 index 5e70b222ee7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_fusionsubtypeseverityfiltersitem.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionSubTypeSeverityFiltersItem struct { - Enabled bool `json:"enabled"` - Severity AlertSeverity `json:"severity"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_groupingconfiguration.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_groupingconfiguration.go deleted file mode 100644 index cb8d21f3d60..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_groupingconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupingConfiguration struct { - Enabled bool `json:"enabled"` - GroupByAlertDetails *[]AlertDetail `json:"groupByAlertDetails,omitempty"` - GroupByCustomDetails *[]string `json:"groupByCustomDetails,omitempty"` - GroupByEntities *[]EntityMappingType `json:"groupByEntities,omitempty"` - LookbackDuration string `json:"lookbackDuration"` - MatchingMethod MatchingMethod `json:"matchingMethod"` - ReopenClosedIncident bool `json:"reopenClosedIncident"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_incidentconfiguration.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_incidentconfiguration.go deleted file mode 100644 index 53ab8b667b1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_incidentconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentConfiguration struct { - CreateIncident bool `json:"createIncident"` - GroupingConfiguration *GroupingConfiguration `json:"groupingConfiguration,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go deleted file mode 100644 index 4fa227e3728..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = MicrosoftSecurityIncidentCreationAlertRule{} - -type MicrosoftSecurityIncidentCreationAlertRule struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRule{} - -func (s MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go deleted file mode 100644 index 428ca90f774..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go +++ /dev/null @@ -1,34 +0,0 @@ -package alertrules - -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 MicrosoftSecurityIncidentCreationAlertRuleProperties struct { - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - ProductFilter MicrosoftSecurityProductName `json:"productFilter"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go deleted file mode 100644 index e49aa4ea1f0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = MLBehaviorAnalyticsAlertRule{} - -type MLBehaviorAnalyticsAlertRule struct { - Properties *MLBehaviorAnalyticsAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MLBehaviorAnalyticsAlertRule{} - -func (s MLBehaviorAnalyticsAlertRule) MarshalJSON() ([]byte, error) { - type wrapper MLBehaviorAnalyticsAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MLBehaviorAnalyticsAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MLBehaviorAnalyticsAlertRule: %+v", err) - } - decoded["kind"] = "MLBehaviorAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MLBehaviorAnalyticsAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go deleted file mode 100644 index 87834ad4f66..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_mlbehavioranalyticsalertruleproperties.go +++ /dev/null @@ -1,33 +0,0 @@ -package alertrules - -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 MLBehaviorAnalyticsAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *MLBehaviorAnalyticsAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *MLBehaviorAnalyticsAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertrule.go deleted file mode 100644 index d0d096cbfc5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = NrtAlertRule{} - -type NrtAlertRule struct { - Properties *NrtAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = NrtAlertRule{} - -func (s NrtAlertRule) MarshalJSON() ([]byte, error) { - type wrapper NrtAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NrtAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NrtAlertRule: %+v", err) - } - decoded["kind"] = "NRT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NrtAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertruleproperties.go deleted file mode 100644 index aae2559be23..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_nrtalertruleproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package alertrules - -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 NrtAlertRuleProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Query string `json:"query"` - Severity AlertSeverity `json:"severity"` - SuppressionDuration string `json:"suppressionDuration"` - SuppressionEnabled bool `json:"suppressionEnabled"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - TemplateVersion *string `json:"templateVersion,omitempty"` -} - -func (o *NrtAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *NrtAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertrule.go deleted file mode 100644 index cf91bcec4f2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = ScheduledAlertRule{} - -type ScheduledAlertRule struct { - Properties *ScheduledAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRule{} - -func (s ScheduledAlertRule) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRule: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertruleproperties.go deleted file mode 100644 index 992328f9f02..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_scheduledalertruleproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertrules - -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 ScheduledAlertRuleProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Query *string `json:"query,omitempty"` - QueryFrequency *string `json:"queryFrequency,omitempty"` - QueryPeriod *string `json:"queryPeriod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - SuppressionDuration string `json:"suppressionDuration"` - SuppressionEnabled bool `json:"suppressionEnabled"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - TemplateVersion *string `json:"templateVersion,omitempty"` - TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` - TriggerThreshold *int64 `json:"triggerThreshold,omitempty"` -} - -func (o *ScheduledAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertrule.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertrule.go deleted file mode 100644 index fe9fc75c2e6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = ThreatIntelligenceAlertRule{} - -type ThreatIntelligenceAlertRule struct { - Properties *ThreatIntelligenceAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceAlertRule{} - -func (s ThreatIntelligenceAlertRule) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceAlertRule: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertruleproperties.go deleted file mode 100644 index 498f1079525..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/model_threatintelligencealertruleproperties.go +++ /dev/null @@ -1,33 +0,0 @@ -package alertrules - -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 ThreatIntelligenceAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *ThreatIntelligenceAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ThreatIntelligenceAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/predicates.go deleted file mode 100644 index 20dada02523..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleOperationPredicate struct { -} - -func (p AlertRuleOperationPredicate) Matches(input AlertRule) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertrules/version.go b/resource-manager/securityinsights/2022-07-01-preview/alertrules/version.go deleted file mode 100644 index 321684b7c45..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertrules/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/README.md b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/README.md deleted file mode 100644 index 09b0ff83e21..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates` Documentation - -The `alertruletemplates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/alertruletemplates" -``` - - -### Client Initialization - -```go -client := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRuleTemplatesClient.Get` - -```go -ctx := context.TODO() -id := alertruletemplates.NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - -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: `AlertRuleTemplatesClient.List` - -```go -ctx := context.TODO() -id := alertruletemplates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/alertruletemplates/client.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/client.go deleted file mode 100644 index 2932bf14a55..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alertruletemplates - -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 AlertRuleTemplatesClient struct { - Client *resourcemanager.Client -} - -func NewAlertRuleTemplatesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRuleTemplatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alertruletemplates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertRuleTemplatesClient: %+v", err) - } - - return &AlertRuleTemplatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/constants.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/constants.go deleted file mode 100644 index bd47949dd74..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/constants.go +++ /dev/null @@ -1,473 +0,0 @@ -package alertruletemplates - -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 AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMLBehaviorAnalytics AlertRuleKind = "MLBehaviorAnalytics" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindNRT AlertRuleKind = "NRT" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" - AlertRuleKindThreatIntelligence AlertRuleKind = "ThreatIntelligence" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMLBehaviorAnalytics), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindNRT), - string(AlertRuleKindScheduled), - string(AlertRuleKindThreatIntelligence), - } -} - -func (s *AlertRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "mlbehavioranalytics": AlertRuleKindMLBehaviorAnalytics, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "nrt": AlertRuleKindNRT, - "scheduled": AlertRuleKindScheduled, - "threatintelligence": AlertRuleKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func (s *EntityMappingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityMappingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func (s *EventGroupingAggregationKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEventGroupingAggregationKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" - MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection MicrosoftSecurityProductName = "Microsoft Defender Advanced Threat Protection" - MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection MicrosoftSecurityProductName = "Office 365 Advanced Threat Protection" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - string(MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection), - string(MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection), - } -} - -func (s *MicrosoftSecurityProductName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMicrosoftSecurityProductName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - "microsoft defender advanced threat protection": MicrosoftSecurityProductNameMicrosoftDefenderAdvancedThreatProtection, - "office 365 advanced threat protection": MicrosoftSecurityProductNameOfficeThreeSixFiveAdvancedThreatProtection, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TemplateStatus string - -const ( - TemplateStatusAvailable TemplateStatus = "Available" - TemplateStatusInstalled TemplateStatus = "Installed" - TemplateStatusNotAvailable TemplateStatus = "NotAvailable" -) - -func PossibleValuesForTemplateStatus() []string { - return []string{ - string(TemplateStatusAvailable), - string(TemplateStatusInstalled), - string(TemplateStatusNotAvailable), - } -} - -func (s *TemplateStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTemplateStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTemplateStatus(input string) (*TemplateStatus, error) { - vals := map[string]TemplateStatus{ - "available": TemplateStatusAvailable, - "installed": TemplateStatusInstalled, - "notavailable": TemplateStatusNotAvailable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TemplateStatus(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func (s *TriggerOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate.go deleted file mode 100644 index 6a82de7688f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate.go +++ /dev/null @@ -1,141 +0,0 @@ -package alertruletemplates - -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(&AlertRuleTemplateId{}) -} - -var _ resourceids.ResourceId = &AlertRuleTemplateId{} - -// AlertRuleTemplateId is a struct representing the Resource ID for a Alert Rule Template -type AlertRuleTemplateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AlertRuleTemplateId string -} - -// NewAlertRuleTemplateID returns a new AlertRuleTemplateId struct -func NewAlertRuleTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, alertRuleTemplateId string) AlertRuleTemplateId { - return AlertRuleTemplateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AlertRuleTemplateId: alertRuleTemplateId, - } -} - -// ParseAlertRuleTemplateID parses 'input' into a AlertRuleTemplateId -func ParseAlertRuleTemplateID(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleTemplateIDInsensitively parses 'input' case-insensitively into a AlertRuleTemplateId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleTemplateIDInsensitively(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleTemplateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AlertRuleTemplateId, ok = input.Parsed["alertRuleTemplateId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", input) - } - - return nil -} - -// ValidateAlertRuleTemplateID checks that 'input' can be parsed as a Alert Rule Template ID -func ValidateAlertRuleTemplateID(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 := ParseAlertRuleTemplateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule Template ID -func (id AlertRuleTemplateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRuleTemplates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AlertRuleTemplateId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule Template ID -func (id AlertRuleTemplateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRuleTemplates", "alertRuleTemplates", "alertRuleTemplates"), - resourceids.UserSpecifiedSegment("alertRuleTemplateId", "alertRuleTemplateIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule Template ID -func (id AlertRuleTemplateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Alert Rule Template: %q", id.AlertRuleTemplateId), - } - return fmt.Sprintf("Alert Rule Template (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate_test.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate_test.go deleted file mode 100644 index ebc3eb67204..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_alertruletemplate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package alertruletemplates - -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 = &AlertRuleTemplateId{} - -func TestNewAlertRuleTemplateID(t *testing.T) { - id := NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AlertRuleTemplateId != "alertRuleTemplateIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleTemplateId'", id.AlertRuleTemplateId, "alertRuleTemplateIdValue") - } -} - -func TestFormatAlertRuleTemplateID(t *testing.T) { - actual := NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleTemplateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AlertRuleTemplateId: "alertRuleTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleTemplateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AlertRuleTemplateId != v.Expected.AlertRuleTemplateId { - t.Fatalf("Expected %q but got %q for AlertRuleTemplateId", v.Expected.AlertRuleTemplateId, actual.AlertRuleTemplateId) - } - - } -} - -func TestParseAlertRuleTemplateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AlertRuleTemplateId: "alertRuleTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS/aLeRtRuLeTeMpLaTeIdVaLuE", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AlertRuleTemplateId: "aLeRtRuLeTeMpLaTeIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS/aLeRtRuLeTeMpLaTeIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleTemplateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AlertRuleTemplateId != v.Expected.AlertRuleTemplateId { - t.Fatalf("Expected %q but got %q for AlertRuleTemplateId", v.Expected.AlertRuleTemplateId, actual.AlertRuleTemplateId) - } - - } -} - -func TestSegmentsForAlertRuleTemplateId(t *testing.T) { - segments := AlertRuleTemplateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleTemplateId 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/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace.go deleted file mode 100644 index 184371fb5dc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package alertruletemplates - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace_test.go deleted file mode 100644 index 77410c05cea..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alertruletemplates - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/alertruletemplates/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_get.go deleted file mode 100644 index 861712be66a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "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 *AlertRuleTemplate -} - -// Get ... -func (c AlertRuleTemplatesClient) Get(ctx context.Context, id AlertRuleTemplateId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleTemplateImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_list.go deleted file mode 100644 index 21f9ceec3de..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "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 *[]AlertRuleTemplate -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AlertRuleTemplate -} - -// List ... -func (c AlertRuleTemplatesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRuleTemplates", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]AlertRuleTemplate, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalAlertRuleTemplateImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRuleTemplate (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AlertRuleTemplatesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AlertRuleTemplateOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertRuleTemplatesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleTemplateOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AlertRuleTemplate, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/alertruletemplates/model_alertdetailsoverride.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertdetailsoverride.go deleted file mode 100644 index 136748927ba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplate.go deleted file mode 100644 index 262a4d668bc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplate.go +++ /dev/null @@ -1,93 +0,0 @@ -package alertruletemplates - -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 AlertRuleTemplate interface { -} - -// RawAlertRuleTemplateImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAlertRuleTemplateImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAlertRuleTemplateImplementation(input []byte) (AlertRuleTemplate, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRuleTemplate into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MLBehaviorAnalytics") { - var out MLBehaviorAnalyticsAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "NRT") { - var out NrtAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NrtAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out ThreatIntelligenceAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - return out, nil - } - - out := RawAlertRuleTemplateImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplatedatasource.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplatedatasource.go deleted file mode 100644 index 519fd6e1fe4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_alertruletemplatedatasource.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateDataSource struct { - ConnectorId *string `json:"connectorId,omitempty"` - DataTypes *[]string `json:"dataTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_entitymapping.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_entitymapping.go deleted file mode 100644 index 86cf5667f04..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_eventgroupingsettings.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_eventgroupingsettings.go deleted file mode 100644 index 3d80ecdb592..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fieldmapping.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fieldmapping.go deleted file mode 100644 index be96362b135..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplate.go deleted file mode 100644 index c2b4d8c3077..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = FusionAlertRuleTemplate{} - -type FusionAlertRuleTemplate struct { - Properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRuleTemplate{} - -func (s FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go deleted file mode 100644 index 9faeeac95c5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusionalertruletemplateproperties.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertruletemplates - -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 FusionAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount *int64 `json:"alertRulesCreatedByTemplateCount,omitempty"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - SourceSettings *[]FusionTemplateSourceSetting `json:"sourceSettings,omitempty"` - Status *TemplateStatus `json:"status,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *FusionAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *FusionAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesetting.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesetting.go deleted file mode 100644 index 99896590018..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesetting.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionTemplateSourceSetting struct { - SourceName string `json:"sourceName"` - SourceSubTypes *[]FusionTemplateSourceSubType `json:"sourceSubTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesubtype.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesubtype.go deleted file mode 100644 index f031d8a0a71..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesourcesubtype.go +++ /dev/null @@ -1,10 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionTemplateSourceSubType struct { - SeverityFilter FusionTemplateSubTypeSeverityFilter `json:"severityFilter"` - SourceSubTypeDisplayName *string `json:"sourceSubTypeDisplayName,omitempty"` - SourceSubTypeName string `json:"sourceSubTypeName"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesubtypeseverityfilter.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesubtypeseverityfilter.go deleted file mode 100644 index b93614d640c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_fusiontemplatesubtypeseverityfilter.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FusionTemplateSubTypeSeverityFilter struct { - IsSupported bool `json:"isSupported"` - SeverityFilters *[]AlertSeverity `json:"severityFilters,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go deleted file mode 100644 index 515a47767b2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -func (s MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go deleted file mode 100644 index 407623a746c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertruletemplates - -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 MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount *int64 `json:"alertRulesCreatedByTemplateCount,omitempty"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - ProductFilter *MicrosoftSecurityProductName `json:"productFilter,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` - Status *TemplateStatus `json:"status,omitempty"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go deleted file mode 100644 index 51e12f5562f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = MLBehaviorAnalyticsAlertRuleTemplate{} - -type MLBehaviorAnalyticsAlertRuleTemplate struct { - Properties *MLBehaviorAnalyticsAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MLBehaviorAnalyticsAlertRuleTemplate{} - -func (s MLBehaviorAnalyticsAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MLBehaviorAnalyticsAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MLBehaviorAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MLBehaviorAnalyticsAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go deleted file mode 100644 index 68f8ff87325..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_mlbehavioranalyticsalertruletemplateproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MLBehaviorAnalyticsAlertRuleTemplateProperties struct { - Severity AlertSeverity `json:"severity"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplate.go deleted file mode 100644 index 9f13bfa8160..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = NrtAlertRuleTemplate{} - -type NrtAlertRuleTemplate struct { - Properties *NrtAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = NrtAlertRuleTemplate{} - -func (s NrtAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper NrtAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NrtAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NrtAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "NRT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NrtAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go deleted file mode 100644 index 5c837dc8fde..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_nrtalertruletemplateproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NrtAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - Query string `json:"query"` - Severity AlertSeverity `json:"severity"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - Version string `json:"version"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplate.go deleted file mode 100644 index c3428ada14d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = ScheduledAlertRuleTemplate{} - -type ScheduledAlertRuleTemplate struct { - Properties *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRuleTemplate{} - -func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go deleted file mode 100644 index 16b946a1bf2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_scheduledalertruletemplateproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -package alertruletemplates - -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 ScheduledAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRulesCreatedByTemplateCount *int64 `json:"alertRulesCreatedByTemplateCount,omitempty"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - Query *string `json:"query,omitempty"` - QueryFrequency *string `json:"queryFrequency,omitempty"` - QueryPeriod *string `json:"queryPeriod,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Status *TemplateStatus `json:"status,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` - TriggerThreshold *int64 `json:"triggerThreshold,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *ScheduledAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *ScheduledAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go deleted file mode 100644 index 1f39f219a07..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = ThreatIntelligenceAlertRuleTemplate{} - -type ThreatIntelligenceAlertRuleTemplate struct { - Properties *ThreatIntelligenceAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceAlertRuleTemplate{} - -func (s ThreatIntelligenceAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go deleted file mode 100644 index 804cc2e0f03..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/model_threatintelligencealertruletemplateproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceAlertRuleTemplateProperties struct { - Severity AlertSeverity `json:"severity"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/predicates.go deleted file mode 100644 index 093c50e1616..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateOperationPredicate struct { -} - -func (p AlertRuleTemplateOperationPredicate) Matches(input AlertRuleTemplate) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/version.go b/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/version.go deleted file mode 100644 index b23a46eb8a2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertruletemplates/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/README.md b/resource-manager/securityinsights/2022-07-01-preview/automationrules/README.md deleted file mode 100644 index d8841155c88..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/automationrules` Documentation - -The `automationrules` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/automationrules" -``` - - -### Client Initialization - -```go -client := automationrules.NewAutomationRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AutomationRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -payload := automationrules.AutomationRule{ - // ... -} - - -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: `AutomationRulesClient.Delete` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -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: `AutomationRulesClient.Get` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -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: `AutomationRulesClient.List` - -```go -ctx := context.TODO() -id := automationrules.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/automationrules/client.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/client.go deleted file mode 100644 index 18fafea1496..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package automationrules - -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 AutomationRulesClient struct { - Client *resourcemanager.Client -} - -func NewAutomationRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AutomationRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "automationrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AutomationRulesClient: %+v", err) - } - - return &AutomationRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/constants.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/constants.go deleted file mode 100644 index c5f119d44c3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/constants.go +++ /dev/null @@ -1,876 +0,0 @@ -package automationrules - -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 ActionType string - -const ( - ActionTypeModifyProperties ActionType = "ModifyProperties" - ActionTypeRunPlaybook ActionType = "RunPlaybook" -) - -func PossibleValuesForActionType() []string { - return []string{ - string(ActionTypeModifyProperties), - string(ActionTypeRunPlaybook), - } -} - -func (s *ActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionType(input string) (*ActionType, error) { - vals := map[string]ActionType{ - "modifyproperties": ActionTypeModifyProperties, - "runplaybook": ActionTypeRunPlaybook, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionType(input) - return &out, nil -} - -type AutomationRulePropertyArrayChangedConditionSupportedArrayType string - -const ( - AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Alerts" - AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Comments" - AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Labels" - AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics AutomationRulePropertyArrayChangedConditionSupportedArrayType = "Tactics" -) - -func PossibleValuesForAutomationRulePropertyArrayChangedConditionSupportedArrayType() []string { - return []string{ - string(AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts), - string(AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments), - string(AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels), - string(AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics), - } -} - -func (s *AutomationRulePropertyArrayChangedConditionSupportedArrayType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyArrayChangedConditionSupportedArrayType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyArrayChangedConditionSupportedArrayType(input string) (*AutomationRulePropertyArrayChangedConditionSupportedArrayType, error) { - vals := map[string]AutomationRulePropertyArrayChangedConditionSupportedArrayType{ - "alerts": AutomationRulePropertyArrayChangedConditionSupportedArrayTypeAlerts, - "comments": AutomationRulePropertyArrayChangedConditionSupportedArrayTypeComments, - "labels": AutomationRulePropertyArrayChangedConditionSupportedArrayTypeLabels, - "tactics": AutomationRulePropertyArrayChangedConditionSupportedArrayTypeTactics, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyArrayChangedConditionSupportedArrayType(input) - return &out, nil -} - -type AutomationRulePropertyArrayChangedConditionSupportedChangeType string - -const ( - AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded AutomationRulePropertyArrayChangedConditionSupportedChangeType = "Added" -) - -func PossibleValuesForAutomationRulePropertyArrayChangedConditionSupportedChangeType() []string { - return []string{ - string(AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded), - } -} - -func (s *AutomationRulePropertyArrayChangedConditionSupportedChangeType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyArrayChangedConditionSupportedChangeType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyArrayChangedConditionSupportedChangeType(input string) (*AutomationRulePropertyArrayChangedConditionSupportedChangeType, error) { - vals := map[string]AutomationRulePropertyArrayChangedConditionSupportedChangeType{ - "added": AutomationRulePropertyArrayChangedConditionSupportedChangeTypeAdded, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyArrayChangedConditionSupportedChangeType(input) - return &out, nil -} - -type AutomationRulePropertyChangedConditionSupportedChangedType string - -const ( - AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom AutomationRulePropertyChangedConditionSupportedChangedType = "ChangedFrom" - AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo AutomationRulePropertyChangedConditionSupportedChangedType = "ChangedTo" -) - -func PossibleValuesForAutomationRulePropertyChangedConditionSupportedChangedType() []string { - return []string{ - string(AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom), - string(AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo), - } -} - -func (s *AutomationRulePropertyChangedConditionSupportedChangedType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyChangedConditionSupportedChangedType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyChangedConditionSupportedChangedType(input string) (*AutomationRulePropertyChangedConditionSupportedChangedType, error) { - vals := map[string]AutomationRulePropertyChangedConditionSupportedChangedType{ - "changedfrom": AutomationRulePropertyChangedConditionSupportedChangedTypeChangedFrom, - "changedto": AutomationRulePropertyChangedConditionSupportedChangedTypeChangedTo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyChangedConditionSupportedChangedType(input) - return &out, nil -} - -type AutomationRulePropertyChangedConditionSupportedPropertyType string - -const ( - AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner AutomationRulePropertyChangedConditionSupportedPropertyType = "IncidentOwner" - AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity AutomationRulePropertyChangedConditionSupportedPropertyType = "IncidentSeverity" - AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus AutomationRulePropertyChangedConditionSupportedPropertyType = "IncidentStatus" -) - -func PossibleValuesForAutomationRulePropertyChangedConditionSupportedPropertyType() []string { - return []string{ - string(AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner), - string(AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity), - string(AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus), - } -} - -func (s *AutomationRulePropertyChangedConditionSupportedPropertyType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyChangedConditionSupportedPropertyType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyChangedConditionSupportedPropertyType(input string) (*AutomationRulePropertyChangedConditionSupportedPropertyType, error) { - vals := map[string]AutomationRulePropertyChangedConditionSupportedPropertyType{ - "incidentowner": AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentOwner, - "incidentseverity": AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentSeverity, - "incidentstatus": AutomationRulePropertyChangedConditionSupportedPropertyTypeIncidentStatus, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyChangedConditionSupportedPropertyType(input) - return &out, nil -} - -type AutomationRulePropertyConditionSupportedOperator string - -const ( - AutomationRulePropertyConditionSupportedOperatorContains AutomationRulePropertyConditionSupportedOperator = "Contains" - AutomationRulePropertyConditionSupportedOperatorEndsWith AutomationRulePropertyConditionSupportedOperator = "EndsWith" - AutomationRulePropertyConditionSupportedOperatorEquals AutomationRulePropertyConditionSupportedOperator = "Equals" - AutomationRulePropertyConditionSupportedOperatorNotContains AutomationRulePropertyConditionSupportedOperator = "NotContains" - AutomationRulePropertyConditionSupportedOperatorNotEndsWith AutomationRulePropertyConditionSupportedOperator = "NotEndsWith" - AutomationRulePropertyConditionSupportedOperatorNotEquals AutomationRulePropertyConditionSupportedOperator = "NotEquals" - AutomationRulePropertyConditionSupportedOperatorNotStartsWith AutomationRulePropertyConditionSupportedOperator = "NotStartsWith" - AutomationRulePropertyConditionSupportedOperatorStartsWith AutomationRulePropertyConditionSupportedOperator = "StartsWith" -) - -func PossibleValuesForAutomationRulePropertyConditionSupportedOperator() []string { - return []string{ - string(AutomationRulePropertyConditionSupportedOperatorContains), - string(AutomationRulePropertyConditionSupportedOperatorEndsWith), - string(AutomationRulePropertyConditionSupportedOperatorEquals), - string(AutomationRulePropertyConditionSupportedOperatorNotContains), - string(AutomationRulePropertyConditionSupportedOperatorNotEndsWith), - string(AutomationRulePropertyConditionSupportedOperatorNotEquals), - string(AutomationRulePropertyConditionSupportedOperatorNotStartsWith), - string(AutomationRulePropertyConditionSupportedOperatorStartsWith), - } -} - -func (s *AutomationRulePropertyConditionSupportedOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyConditionSupportedOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyConditionSupportedOperator(input string) (*AutomationRulePropertyConditionSupportedOperator, error) { - vals := map[string]AutomationRulePropertyConditionSupportedOperator{ - "contains": AutomationRulePropertyConditionSupportedOperatorContains, - "endswith": AutomationRulePropertyConditionSupportedOperatorEndsWith, - "equals": AutomationRulePropertyConditionSupportedOperatorEquals, - "notcontains": AutomationRulePropertyConditionSupportedOperatorNotContains, - "notendswith": AutomationRulePropertyConditionSupportedOperatorNotEndsWith, - "notequals": AutomationRulePropertyConditionSupportedOperatorNotEquals, - "notstartswith": AutomationRulePropertyConditionSupportedOperatorNotStartsWith, - "startswith": AutomationRulePropertyConditionSupportedOperatorStartsWith, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyConditionSupportedOperator(input) - return &out, nil -} - -type AutomationRulePropertyConditionSupportedProperty string - -const ( - AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId AutomationRulePropertyConditionSupportedProperty = "AccountAadTenantId" - AutomationRulePropertyConditionSupportedPropertyAccountAadUserId AutomationRulePropertyConditionSupportedProperty = "AccountAadUserId" - AutomationRulePropertyConditionSupportedPropertyAccountNTDomain AutomationRulePropertyConditionSupportedProperty = "AccountNTDomain" - AutomationRulePropertyConditionSupportedPropertyAccountName AutomationRulePropertyConditionSupportedProperty = "AccountName" - AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid AutomationRulePropertyConditionSupportedProperty = "AccountObjectGuid" - AutomationRulePropertyConditionSupportedPropertyAccountPUID AutomationRulePropertyConditionSupportedProperty = "AccountPUID" - AutomationRulePropertyConditionSupportedPropertyAccountSid AutomationRulePropertyConditionSupportedProperty = "AccountSid" - AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix AutomationRulePropertyConditionSupportedProperty = "AccountUPNSuffix" - AutomationRulePropertyConditionSupportedPropertyAlertAnalyticRuleIds AutomationRulePropertyConditionSupportedProperty = "AlertAnalyticRuleIds" - AutomationRulePropertyConditionSupportedPropertyAlertProductNames AutomationRulePropertyConditionSupportedProperty = "AlertProductNames" - AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId AutomationRulePropertyConditionSupportedProperty = "AzureResourceResourceId" - AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId AutomationRulePropertyConditionSupportedProperty = "AzureResourceSubscriptionId" - AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId AutomationRulePropertyConditionSupportedProperty = "CloudApplicationAppId" - AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName AutomationRulePropertyConditionSupportedProperty = "CloudApplicationAppName" - AutomationRulePropertyConditionSupportedPropertyDNSDomainName AutomationRulePropertyConditionSupportedProperty = "DNSDomainName" - AutomationRulePropertyConditionSupportedPropertyFileDirectory AutomationRulePropertyConditionSupportedProperty = "FileDirectory" - AutomationRulePropertyConditionSupportedPropertyFileHashValue AutomationRulePropertyConditionSupportedProperty = "FileHashValue" - AutomationRulePropertyConditionSupportedPropertyFileName AutomationRulePropertyConditionSupportedProperty = "FileName" - AutomationRulePropertyConditionSupportedPropertyHostAzureID AutomationRulePropertyConditionSupportedProperty = "HostAzureID" - AutomationRulePropertyConditionSupportedPropertyHostNTDomain AutomationRulePropertyConditionSupportedProperty = "HostNTDomain" - AutomationRulePropertyConditionSupportedPropertyHostName AutomationRulePropertyConditionSupportedProperty = "HostName" - AutomationRulePropertyConditionSupportedPropertyHostNetBiosName AutomationRulePropertyConditionSupportedProperty = "HostNetBiosName" - AutomationRulePropertyConditionSupportedPropertyHostOSVersion AutomationRulePropertyConditionSupportedProperty = "HostOSVersion" - AutomationRulePropertyConditionSupportedPropertyIPAddress AutomationRulePropertyConditionSupportedProperty = "IPAddress" - AutomationRulePropertyConditionSupportedPropertyIncidentDescription AutomationRulePropertyConditionSupportedProperty = "IncidentDescription" - AutomationRulePropertyConditionSupportedPropertyIncidentLabel AutomationRulePropertyConditionSupportedProperty = "IncidentLabel" - AutomationRulePropertyConditionSupportedPropertyIncidentProviderName AutomationRulePropertyConditionSupportedProperty = "IncidentProviderName" - AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds AutomationRulePropertyConditionSupportedProperty = "IncidentRelatedAnalyticRuleIds" - AutomationRulePropertyConditionSupportedPropertyIncidentSeverity AutomationRulePropertyConditionSupportedProperty = "IncidentSeverity" - AutomationRulePropertyConditionSupportedPropertyIncidentStatus AutomationRulePropertyConditionSupportedProperty = "IncidentStatus" - AutomationRulePropertyConditionSupportedPropertyIncidentTactics AutomationRulePropertyConditionSupportedProperty = "IncidentTactics" - AutomationRulePropertyConditionSupportedPropertyIncidentTitle AutomationRulePropertyConditionSupportedProperty = "IncidentTitle" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceId AutomationRulePropertyConditionSupportedProperty = "IoTDeviceId" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel AutomationRulePropertyConditionSupportedProperty = "IoTDeviceModel" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceName AutomationRulePropertyConditionSupportedProperty = "IoTDeviceName" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem AutomationRulePropertyConditionSupportedProperty = "IoTDeviceOperatingSystem" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceType AutomationRulePropertyConditionSupportedProperty = "IoTDeviceType" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor AutomationRulePropertyConditionSupportedProperty = "IoTDeviceVendor" - AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction AutomationRulePropertyConditionSupportedProperty = "MailMessageDeliveryAction" - AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation AutomationRulePropertyConditionSupportedProperty = "MailMessageDeliveryLocation" - AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender AutomationRulePropertyConditionSupportedProperty = "MailMessageP1Sender" - AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender AutomationRulePropertyConditionSupportedProperty = "MailMessageP2Sender" - AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient AutomationRulePropertyConditionSupportedProperty = "MailMessageRecipient" - AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP AutomationRulePropertyConditionSupportedProperty = "MailMessageSenderIP" - AutomationRulePropertyConditionSupportedPropertyMailMessageSubject AutomationRulePropertyConditionSupportedProperty = "MailMessageSubject" - AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName AutomationRulePropertyConditionSupportedProperty = "MailboxDisplayName" - AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress AutomationRulePropertyConditionSupportedProperty = "MailboxPrimaryAddress" - AutomationRulePropertyConditionSupportedPropertyMailboxUPN AutomationRulePropertyConditionSupportedProperty = "MailboxUPN" - AutomationRulePropertyConditionSupportedPropertyMalwareCategory AutomationRulePropertyConditionSupportedProperty = "MalwareCategory" - AutomationRulePropertyConditionSupportedPropertyMalwareName AutomationRulePropertyConditionSupportedProperty = "MalwareName" - AutomationRulePropertyConditionSupportedPropertyProcessCommandLine AutomationRulePropertyConditionSupportedProperty = "ProcessCommandLine" - AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" - AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" - AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" -) - -func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { - return []string{ - string(AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId), - string(AutomationRulePropertyConditionSupportedPropertyAccountAadUserId), - string(AutomationRulePropertyConditionSupportedPropertyAccountNTDomain), - string(AutomationRulePropertyConditionSupportedPropertyAccountName), - string(AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid), - string(AutomationRulePropertyConditionSupportedPropertyAccountPUID), - string(AutomationRulePropertyConditionSupportedPropertyAccountSid), - string(AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix), - string(AutomationRulePropertyConditionSupportedPropertyAlertAnalyticRuleIds), - string(AutomationRulePropertyConditionSupportedPropertyAlertProductNames), - string(AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId), - string(AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId), - string(AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId), - string(AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName), - string(AutomationRulePropertyConditionSupportedPropertyDNSDomainName), - string(AutomationRulePropertyConditionSupportedPropertyFileDirectory), - string(AutomationRulePropertyConditionSupportedPropertyFileHashValue), - string(AutomationRulePropertyConditionSupportedPropertyFileName), - string(AutomationRulePropertyConditionSupportedPropertyHostAzureID), - string(AutomationRulePropertyConditionSupportedPropertyHostNTDomain), - string(AutomationRulePropertyConditionSupportedPropertyHostName), - string(AutomationRulePropertyConditionSupportedPropertyHostNetBiosName), - string(AutomationRulePropertyConditionSupportedPropertyHostOSVersion), - string(AutomationRulePropertyConditionSupportedPropertyIPAddress), - string(AutomationRulePropertyConditionSupportedPropertyIncidentDescription), - string(AutomationRulePropertyConditionSupportedPropertyIncidentLabel), - string(AutomationRulePropertyConditionSupportedPropertyIncidentProviderName), - string(AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds), - string(AutomationRulePropertyConditionSupportedPropertyIncidentSeverity), - string(AutomationRulePropertyConditionSupportedPropertyIncidentStatus), - string(AutomationRulePropertyConditionSupportedPropertyIncidentTactics), - string(AutomationRulePropertyConditionSupportedPropertyIncidentTitle), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceId), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceName), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceType), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation), - string(AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender), - string(AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageSubject), - string(AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName), - string(AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress), - string(AutomationRulePropertyConditionSupportedPropertyMailboxUPN), - string(AutomationRulePropertyConditionSupportedPropertyMalwareCategory), - string(AutomationRulePropertyConditionSupportedPropertyMalwareName), - string(AutomationRulePropertyConditionSupportedPropertyProcessCommandLine), - string(AutomationRulePropertyConditionSupportedPropertyProcessId), - string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), - string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), - } -} - -func (s *AutomationRulePropertyConditionSupportedProperty) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyConditionSupportedProperty(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyConditionSupportedProperty(input string) (*AutomationRulePropertyConditionSupportedProperty, error) { - vals := map[string]AutomationRulePropertyConditionSupportedProperty{ - "accountaadtenantid": AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId, - "accountaaduserid": AutomationRulePropertyConditionSupportedPropertyAccountAadUserId, - "accountntdomain": AutomationRulePropertyConditionSupportedPropertyAccountNTDomain, - "accountname": AutomationRulePropertyConditionSupportedPropertyAccountName, - "accountobjectguid": AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid, - "accountpuid": AutomationRulePropertyConditionSupportedPropertyAccountPUID, - "accountsid": AutomationRulePropertyConditionSupportedPropertyAccountSid, - "accountupnsuffix": AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix, - "alertanalyticruleids": AutomationRulePropertyConditionSupportedPropertyAlertAnalyticRuleIds, - "alertproductnames": AutomationRulePropertyConditionSupportedPropertyAlertProductNames, - "azureresourceresourceid": AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId, - "azureresourcesubscriptionid": AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId, - "cloudapplicationappid": AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId, - "cloudapplicationappname": AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName, - "dnsdomainname": AutomationRulePropertyConditionSupportedPropertyDNSDomainName, - "filedirectory": AutomationRulePropertyConditionSupportedPropertyFileDirectory, - "filehashvalue": AutomationRulePropertyConditionSupportedPropertyFileHashValue, - "filename": AutomationRulePropertyConditionSupportedPropertyFileName, - "hostazureid": AutomationRulePropertyConditionSupportedPropertyHostAzureID, - "hostntdomain": AutomationRulePropertyConditionSupportedPropertyHostNTDomain, - "hostname": AutomationRulePropertyConditionSupportedPropertyHostName, - "hostnetbiosname": AutomationRulePropertyConditionSupportedPropertyHostNetBiosName, - "hostosversion": AutomationRulePropertyConditionSupportedPropertyHostOSVersion, - "ipaddress": AutomationRulePropertyConditionSupportedPropertyIPAddress, - "incidentdescription": AutomationRulePropertyConditionSupportedPropertyIncidentDescription, - "incidentlabel": AutomationRulePropertyConditionSupportedPropertyIncidentLabel, - "incidentprovidername": AutomationRulePropertyConditionSupportedPropertyIncidentProviderName, - "incidentrelatedanalyticruleids": AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds, - "incidentseverity": AutomationRulePropertyConditionSupportedPropertyIncidentSeverity, - "incidentstatus": AutomationRulePropertyConditionSupportedPropertyIncidentStatus, - "incidenttactics": AutomationRulePropertyConditionSupportedPropertyIncidentTactics, - "incidenttitle": AutomationRulePropertyConditionSupportedPropertyIncidentTitle, - "iotdeviceid": AutomationRulePropertyConditionSupportedPropertyIoTDeviceId, - "iotdevicemodel": AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel, - "iotdevicename": AutomationRulePropertyConditionSupportedPropertyIoTDeviceName, - "iotdeviceoperatingsystem": AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem, - "iotdevicetype": AutomationRulePropertyConditionSupportedPropertyIoTDeviceType, - "iotdevicevendor": AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor, - "mailmessagedeliveryaction": AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction, - "mailmessagedeliverylocation": AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation, - "mailmessagep1sender": AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender, - "mailmessagep2sender": AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender, - "mailmessagerecipient": AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient, - "mailmessagesenderip": AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP, - "mailmessagesubject": AutomationRulePropertyConditionSupportedPropertyMailMessageSubject, - "mailboxdisplayname": AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName, - "mailboxprimaryaddress": AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress, - "mailboxupn": AutomationRulePropertyConditionSupportedPropertyMailboxUPN, - "malwarecategory": AutomationRulePropertyConditionSupportedPropertyMalwareCategory, - "malwarename": AutomationRulePropertyConditionSupportedPropertyMalwareName, - "processcommandline": AutomationRulePropertyConditionSupportedPropertyProcessCommandLine, - "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, - "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, - "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyConditionSupportedProperty(input) - return &out, nil -} - -type ConditionType string - -const ( - ConditionTypeProperty ConditionType = "Property" - ConditionTypePropertyArrayChanged ConditionType = "PropertyArrayChanged" - ConditionTypePropertyChanged ConditionType = "PropertyChanged" -) - -func PossibleValuesForConditionType() []string { - return []string{ - string(ConditionTypeProperty), - string(ConditionTypePropertyArrayChanged), - string(ConditionTypePropertyChanged), - } -} - -func (s *ConditionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConditionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConditionType(input string) (*ConditionType, error) { - vals := map[string]ConditionType{ - "property": ConditionTypeProperty, - "propertyarraychanged": ConditionTypePropertyArrayChanged, - "propertychanged": ConditionTypePropertyChanged, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConditionType(input) - return &out, nil -} - -type IncidentClassification string - -const ( - IncidentClassificationBenignPositive IncidentClassification = "BenignPositive" - IncidentClassificationFalsePositive IncidentClassification = "FalsePositive" - IncidentClassificationTruePositive IncidentClassification = "TruePositive" - IncidentClassificationUndetermined IncidentClassification = "Undetermined" -) - -func PossibleValuesForIncidentClassification() []string { - return []string{ - string(IncidentClassificationBenignPositive), - string(IncidentClassificationFalsePositive), - string(IncidentClassificationTruePositive), - string(IncidentClassificationUndetermined), - } -} - -func (s *IncidentClassification) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassification(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassification(input string) (*IncidentClassification, error) { - vals := map[string]IncidentClassification{ - "benignpositive": IncidentClassificationBenignPositive, - "falsepositive": IncidentClassificationFalsePositive, - "truepositive": IncidentClassificationTruePositive, - "undetermined": IncidentClassificationUndetermined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassification(input) - return &out, nil -} - -type IncidentClassificationReason string - -const ( - IncidentClassificationReasonInaccurateData IncidentClassificationReason = "InaccurateData" - IncidentClassificationReasonIncorrectAlertLogic IncidentClassificationReason = "IncorrectAlertLogic" - IncidentClassificationReasonSuspiciousActivity IncidentClassificationReason = "SuspiciousActivity" - IncidentClassificationReasonSuspiciousButExpected IncidentClassificationReason = "SuspiciousButExpected" -) - -func PossibleValuesForIncidentClassificationReason() []string { - return []string{ - string(IncidentClassificationReasonInaccurateData), - string(IncidentClassificationReasonIncorrectAlertLogic), - string(IncidentClassificationReasonSuspiciousActivity), - string(IncidentClassificationReasonSuspiciousButExpected), - } -} - -func (s *IncidentClassificationReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassificationReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassificationReason(input string) (*IncidentClassificationReason, error) { - vals := map[string]IncidentClassificationReason{ - "inaccuratedata": IncidentClassificationReasonInaccurateData, - "incorrectalertlogic": IncidentClassificationReasonIncorrectAlertLogic, - "suspiciousactivity": IncidentClassificationReasonSuspiciousActivity, - "suspiciousbutexpected": IncidentClassificationReasonSuspiciousButExpected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassificationReason(input) - return &out, nil -} - -type IncidentLabelType string - -const ( - IncidentLabelTypeAutoAssigned IncidentLabelType = "AutoAssigned" - IncidentLabelTypeUser IncidentLabelType = "User" -) - -func PossibleValuesForIncidentLabelType() []string { - return []string{ - string(IncidentLabelTypeAutoAssigned), - string(IncidentLabelTypeUser), - } -} - -func (s *IncidentLabelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentLabelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentLabelType(input string) (*IncidentLabelType, error) { - vals := map[string]IncidentLabelType{ - "autoassigned": IncidentLabelTypeAutoAssigned, - "user": IncidentLabelTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentLabelType(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type IncidentStatus string - -const ( - IncidentStatusActive IncidentStatus = "Active" - IncidentStatusClosed IncidentStatus = "Closed" - IncidentStatusNew IncidentStatus = "New" -) - -func PossibleValuesForIncidentStatus() []string { - return []string{ - string(IncidentStatusActive), - string(IncidentStatusClosed), - string(IncidentStatusNew), - } -} - -func (s *IncidentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentStatus(input string) (*IncidentStatus, error) { - vals := map[string]IncidentStatus{ - "active": IncidentStatusActive, - "closed": IncidentStatusClosed, - "new": IncidentStatusNew, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentStatus(input) - return &out, nil -} - -type OwnerType string - -const ( - OwnerTypeGroup OwnerType = "Group" - OwnerTypeUnknown OwnerType = "Unknown" - OwnerTypeUser OwnerType = "User" -) - -func PossibleValuesForOwnerType() []string { - return []string{ - string(OwnerTypeGroup), - string(OwnerTypeUnknown), - string(OwnerTypeUser), - } -} - -func (s *OwnerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwnerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwnerType(input string) (*OwnerType, error) { - vals := map[string]OwnerType{ - "group": OwnerTypeGroup, - "unknown": OwnerTypeUnknown, - "user": OwnerTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwnerType(input) - return &out, nil -} - -type TriggersOn string - -const ( - TriggersOnAlerts TriggersOn = "Alerts" - TriggersOnIncidents TriggersOn = "Incidents" -) - -func PossibleValuesForTriggersOn() []string { - return []string{ - string(TriggersOnAlerts), - string(TriggersOnIncidents), - } -} - -func (s *TriggersOn) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggersOn(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggersOn(input string) (*TriggersOn, error) { - vals := map[string]TriggersOn{ - "alerts": TriggersOnAlerts, - "incidents": TriggersOnIncidents, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggersOn(input) - return &out, nil -} - -type TriggersWhen string - -const ( - TriggersWhenCreated TriggersWhen = "Created" - TriggersWhenUpdated TriggersWhen = "Updated" -) - -func PossibleValuesForTriggersWhen() []string { - return []string{ - string(TriggersWhenCreated), - string(TriggersWhenUpdated), - } -} - -func (s *TriggersWhen) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggersWhen(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggersWhen(input string) (*TriggersWhen, error) { - vals := map[string]TriggersWhen{ - "created": TriggersWhenCreated, - "updated": TriggersWhenUpdated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggersWhen(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule.go deleted file mode 100644 index 00c7db776a3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package automationrules - -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(&AutomationRuleId{}) -} - -var _ resourceids.ResourceId = &AutomationRuleId{} - -// AutomationRuleId is a struct representing the Resource ID for a Automation Rule -type AutomationRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AutomationRuleId string -} - -// NewAutomationRuleID returns a new AutomationRuleId struct -func NewAutomationRuleID(subscriptionId string, resourceGroupName string, workspaceName string, automationRuleId string) AutomationRuleId { - return AutomationRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AutomationRuleId: automationRuleId, - } -} - -// ParseAutomationRuleID parses 'input' into a AutomationRuleId -func ParseAutomationRuleID(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAutomationRuleIDInsensitively parses 'input' case-insensitively into a AutomationRuleId -// note: this method should only be used for API response data and not user input -func ParseAutomationRuleIDInsensitively(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AutomationRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AutomationRuleId, ok = input.Parsed["automationRuleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "automationRuleId", input) - } - - return nil -} - -// ValidateAutomationRuleID checks that 'input' can be parsed as a Automation Rule ID -func ValidateAutomationRuleID(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 := ParseAutomationRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Automation Rule ID -func (id AutomationRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/automationRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AutomationRuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Automation Rule ID -func (id AutomationRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAutomationRules", "automationRules", "automationRules"), - resourceids.UserSpecifiedSegment("automationRuleId", "automationRuleIdValue"), - } -} - -// String returns a human-readable description of this Automation Rule ID -func (id AutomationRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Automation Rule: %q", id.AutomationRuleId), - } - return fmt.Sprintf("Automation Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule_test.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule_test.go deleted file mode 100644 index dd04eaade34..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_automationrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package automationrules - -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 = &AutomationRuleId{} - -func TestNewAutomationRuleID(t *testing.T) { - id := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AutomationRuleId != "automationRuleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AutomationRuleId'", id.AutomationRuleId, "automationRuleIdValue") - } -} - -func TestFormatAutomationRuleID(t *testing.T) { - actual := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAutomationRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestParseAutomationRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AutomationRuleId: "aUtOmAtIoNrUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestSegmentsForAutomationRuleId(t *testing.T) { - segments := AutomationRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AutomationRuleId 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/securityinsights/2022-07-01-preview/automationrules/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace.go deleted file mode 100644 index 72d00c87771..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package automationrules - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace_test.go deleted file mode 100644 index bc06f0f478f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package automationrules - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/automationrules/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_createorupdate.go deleted file mode 100644 index 6ab8b05e0fb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package automationrules - -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 *AutomationRule -} - -// CreateOrUpdate ... -func (c AutomationRulesClient) CreateOrUpdate(ctx context.Context, id AutomationRuleId, input AutomationRule) (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 AutomationRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_delete.go deleted file mode 100644 index c32a7e886ad..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_delete.go +++ /dev/null @@ -1,55 +0,0 @@ -package automationrules - -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 - Model *interface{} -} - -// Delete ... -func (c AutomationRulesClient) Delete(ctx context.Context, id AutomationRuleId) (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 - } - - var model interface{} - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_get.go deleted file mode 100644 index b5c7ce72e30..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package automationrules - -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 *AutomationRule -} - -// Get ... -func (c AutomationRulesClient) Get(ctx context.Context, id AutomationRuleId) (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 AutomationRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_list.go deleted file mode 100644 index a3c7db4995a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package automationrules - -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 *[]AutomationRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutomationRule -} - -// List ... -func (c AutomationRulesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/automationRules", 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 *[]AutomationRule `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 AutomationRulesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AutomationRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AutomationRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AutomationRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AutomationRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/automationrules/model_automationrule.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrule.go deleted file mode 100644 index 1c49c5a77de..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package automationrules - -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 AutomationRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties AutomationRuleProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleaction.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleaction.go deleted file mode 100644 index 77887bb8adf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleaction.go +++ /dev/null @@ -1,61 +0,0 @@ -package automationrules - -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 AutomationRuleAction interface { -} - -// RawAutomationRuleActionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAutomationRuleActionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAutomationRuleActionImplementation(input []byte) (AutomationRuleAction, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleAction into map[string]interface: %+v", err) - } - - value, ok := temp["actionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "ModifyProperties") { - var out AutomationRuleModifyPropertiesAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRuleModifyPropertiesAction: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RunPlaybook") { - var out AutomationRuleRunPlaybookAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRuleRunPlaybookAction: %+v", err) - } - return out, nil - } - - out := RawAutomationRuleActionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulecondition.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulecondition.go deleted file mode 100644 index 81938bfb589..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulecondition.go +++ /dev/null @@ -1,69 +0,0 @@ -package automationrules - -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 AutomationRuleCondition interface { -} - -// RawAutomationRuleConditionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAutomationRuleConditionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAutomationRuleConditionImplementation(input []byte) (AutomationRuleCondition, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleCondition into map[string]interface: %+v", err) - } - - value, ok := temp["conditionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "PropertyArrayChanged") { - var out PropertyArrayChangedConditionProperties - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into PropertyArrayChangedConditionProperties: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "PropertyChanged") { - var out PropertyChangedConditionProperties - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into PropertyChangedConditionProperties: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Property") { - var out PropertyConditionProperties - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into PropertyConditionProperties: %+v", err) - } - return out, nil - } - - out := RawAutomationRuleConditionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulemodifypropertiesaction.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulemodifypropertiesaction.go deleted file mode 100644 index 98eb39b6a9b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulemodifypropertiesaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleAction = AutomationRuleModifyPropertiesAction{} - -type AutomationRuleModifyPropertiesAction struct { - ActionConfiguration *IncidentPropertiesAction `json:"actionConfiguration,omitempty"` - - // Fields inherited from AutomationRuleAction - Order int64 `json:"order"` -} - -var _ json.Marshaler = AutomationRuleModifyPropertiesAction{} - -func (s AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { - type wrapper AutomationRuleModifyPropertiesAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - decoded["actionType"] = "ModifyProperties" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleproperties.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleproperties.go deleted file mode 100644 index 5460f9b5fba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruleproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" - "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 AutomationRuleProperties struct { - Actions []AutomationRuleAction `json:"actions"` - CreatedBy *ClientInfo `json:"createdBy,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - DisplayName string `json:"displayName"` - LastModifiedBy *ClientInfo `json:"lastModifiedBy,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Order int64 `json:"order"` - TriggeringLogic AutomationRuleTriggeringLogic `json:"triggeringLogic"` -} - -func (o *AutomationRuleProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *AutomationRuleProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} - -var _ json.Unmarshaler = &AutomationRuleProperties{} - -func (s *AutomationRuleProperties) UnmarshalJSON(bytes []byte) error { - type alias AutomationRuleProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AutomationRuleProperties: %+v", err) - } - - s.CreatedBy = decoded.CreatedBy - s.CreatedTimeUtc = decoded.CreatedTimeUtc - s.DisplayName = decoded.DisplayName - s.LastModifiedBy = decoded.LastModifiedBy - s.LastModifiedTimeUtc = decoded.LastModifiedTimeUtc - s.Order = decoded.Order - s.TriggeringLogic = decoded.TriggeringLogic - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AutomationRuleProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["actions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Actions into list []json.RawMessage: %+v", err) - } - - output := make([]AutomationRuleAction, 0) - for i, val := range listTemp { - impl, err := unmarshalAutomationRuleActionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Actions' for 'AutomationRuleProperties': %+v", i, err) - } - output = append(output, impl) - } - s.Actions = output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyarraychangedvaluescondition.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyarraychangedvaluescondition.go deleted file mode 100644 index fc4f7b8f5f7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyarraychangedvaluescondition.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRulePropertyArrayChangedValuesCondition struct { - ArrayType *AutomationRulePropertyArrayChangedConditionSupportedArrayType `json:"arrayType,omitempty"` - ChangeType *AutomationRulePropertyArrayChangedConditionSupportedChangeType `json:"changeType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvalueschangedcondition.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvalueschangedcondition.go deleted file mode 100644 index 9873faa9d83..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvalueschangedcondition.go +++ /dev/null @@ -1,11 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRulePropertyValuesChangedCondition struct { - ChangeType *AutomationRulePropertyChangedConditionSupportedChangedType `json:"changeType,omitempty"` - Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` - PropertyName *AutomationRulePropertyChangedConditionSupportedPropertyType `json:"propertyName,omitempty"` - PropertyValues *[]string `json:"propertyValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvaluescondition.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvaluescondition.go deleted file mode 100644 index 8ace5d8c942..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulepropertyvaluescondition.go +++ /dev/null @@ -1,10 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRulePropertyValuesCondition struct { - Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` - PropertyName *AutomationRulePropertyConditionSupportedProperty `json:"propertyName,omitempty"` - PropertyValues *[]string `json:"propertyValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulerunplaybookaction.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulerunplaybookaction.go deleted file mode 100644 index c3e139aacf7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationrulerunplaybookaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleAction = AutomationRuleRunPlaybookAction{} - -type AutomationRuleRunPlaybookAction struct { - ActionConfiguration *PlaybookActionProperties `json:"actionConfiguration,omitempty"` - - // Fields inherited from AutomationRuleAction - Order int64 `json:"order"` -} - -var _ json.Marshaler = AutomationRuleRunPlaybookAction{} - -func (s AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { - type wrapper AutomationRuleRunPlaybookAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRuleRunPlaybookAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleRunPlaybookAction: %+v", err) - } - decoded["actionType"] = "RunPlaybook" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRuleRunPlaybookAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruletriggeringlogic.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruletriggeringlogic.go deleted file mode 100644 index 2f4592c4269..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_automationruletriggeringlogic.go +++ /dev/null @@ -1,70 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" - "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 AutomationRuleTriggeringLogic struct { - Conditions *[]AutomationRuleCondition `json:"conditions,omitempty"` - ExpirationTimeUtc *string `json:"expirationTimeUtc,omitempty"` - IsEnabled bool `json:"isEnabled"` - TriggersOn TriggersOn `json:"triggersOn"` - TriggersWhen TriggersWhen `json:"triggersWhen"` -} - -func (o *AutomationRuleTriggeringLogic) GetExpirationTimeUtcAsTime() (*time.Time, error) { - if o.ExpirationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ExpirationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleTriggeringLogic) SetExpirationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ExpirationTimeUtc = &formatted -} - -var _ json.Unmarshaler = &AutomationRuleTriggeringLogic{} - -func (s *AutomationRuleTriggeringLogic) UnmarshalJSON(bytes []byte) error { - type alias AutomationRuleTriggeringLogic - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AutomationRuleTriggeringLogic: %+v", err) - } - - s.ExpirationTimeUtc = decoded.ExpirationTimeUtc - s.IsEnabled = decoded.IsEnabled - s.TriggersOn = decoded.TriggersOn - s.TriggersWhen = decoded.TriggersWhen - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AutomationRuleTriggeringLogic into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["conditions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Conditions into list []json.RawMessage: %+v", err) - } - - output := make([]AutomationRuleCondition, 0) - for i, val := range listTemp { - impl, err := unmarshalAutomationRuleConditionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Conditions' for 'AutomationRuleTriggeringLogic': %+v", i, err) - } - output = append(output, impl) - } - s.Conditions = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_clientinfo.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_clientinfo.go deleted file mode 100644 index 6b1a9ec7520..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_clientinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentlabel.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentlabel.go deleted file mode 100644 index 8f66e17624f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentlabel.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentLabel struct { - LabelName string `json:"labelName"` - LabelType *IncidentLabelType `json:"labelType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentownerinfo.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentownerinfo.go deleted file mode 100644 index b3933802226..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentownerinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOwnerInfo struct { - AssignedTo *string `json:"assignedTo,omitempty"` - Email *string `json:"email,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - OwnerType *OwnerType `json:"ownerType,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentpropertiesaction.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentpropertiesaction.go deleted file mode 100644 index 55f613832aa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_incidentpropertiesaction.go +++ /dev/null @@ -1,14 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentPropertiesAction struct { - Classification *IncidentClassification `json:"classification,omitempty"` - ClassificationComment *string `json:"classificationComment,omitempty"` - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` - Labels *[]IncidentLabel `json:"labels,omitempty"` - Owner *IncidentOwnerInfo `json:"owner,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Status *IncidentStatus `json:"status,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_playbookactionproperties.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_playbookactionproperties.go deleted file mode 100644 index 6fc5d55a00d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_playbookactionproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlaybookActionProperties struct { - LogicAppResourceId *string `json:"logicAppResourceId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyarraychangedconditionproperties.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyarraychangedconditionproperties.go deleted file mode 100644 index 9abf0187ac4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyarraychangedconditionproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleCondition = PropertyArrayChangedConditionProperties{} - -type PropertyArrayChangedConditionProperties struct { - ConditionProperties *AutomationRulePropertyArrayChangedValuesCondition `json:"conditionProperties,omitempty"` - - // Fields inherited from AutomationRuleCondition -} - -var _ json.Marshaler = PropertyArrayChangedConditionProperties{} - -func (s PropertyArrayChangedConditionProperties) MarshalJSON() ([]byte, error) { - type wrapper PropertyArrayChangedConditionProperties - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling PropertyArrayChangedConditionProperties: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling PropertyArrayChangedConditionProperties: %+v", err) - } - decoded["conditionType"] = "PropertyArrayChanged" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling PropertyArrayChangedConditionProperties: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertychangedconditionproperties.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertychangedconditionproperties.go deleted file mode 100644 index b72736f49a2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertychangedconditionproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleCondition = PropertyChangedConditionProperties{} - -type PropertyChangedConditionProperties struct { - ConditionProperties *AutomationRulePropertyValuesChangedCondition `json:"conditionProperties,omitempty"` - - // Fields inherited from AutomationRuleCondition -} - -var _ json.Marshaler = PropertyChangedConditionProperties{} - -func (s PropertyChangedConditionProperties) MarshalJSON() ([]byte, error) { - type wrapper PropertyChangedConditionProperties - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling PropertyChangedConditionProperties: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling PropertyChangedConditionProperties: %+v", err) - } - decoded["conditionType"] = "PropertyChanged" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling PropertyChangedConditionProperties: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyconditionproperties.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyconditionproperties.go deleted file mode 100644 index 6e77d74c58c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/model_propertyconditionproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleCondition = PropertyConditionProperties{} - -type PropertyConditionProperties struct { - ConditionProperties *AutomationRulePropertyValuesCondition `json:"conditionProperties,omitempty"` - - // Fields inherited from AutomationRuleCondition -} - -var _ json.Marshaler = PropertyConditionProperties{} - -func (s PropertyConditionProperties) MarshalJSON() ([]byte, error) { - type wrapper PropertyConditionProperties - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling PropertyConditionProperties: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling PropertyConditionProperties: %+v", err) - } - decoded["conditionType"] = "Property" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling PropertyConditionProperties: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/automationrules/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/predicates.go deleted file mode 100644 index eaa1f88eb83..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AutomationRuleOperationPredicate) Matches(input AutomationRule) 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.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/securityinsights/2022-07-01-preview/automationrules/version.go b/resource-manager/securityinsights/2022-07-01-preview/automationrules/version.go deleted file mode 100644 index 9d8a7e6efcc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/automationrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/automationrules/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/README.md b/resource-manager/securityinsights/2022-07-01-preview/bookmark/README.md deleted file mode 100644 index e03d525ec5b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/bookmark` Documentation - -The `bookmark` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/bookmark" -``` - - -### Client Initialization - -```go -client := bookmark.NewBookmarkClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarkClient.Expand` - -```go -ctx := context.TODO() -id := bookmark.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -payload := bookmark.BookmarkExpandParameters{ - // ... -} - - -read, err := client.Expand(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/securityinsights/2022-07-01-preview/bookmark/client.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/client.go deleted file mode 100644 index f20b4939301..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmark - -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 BookmarkClient struct { - Client *resourcemanager.Client -} - -func NewBookmarkClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarkClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmark", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarkClient: %+v", err) - } - - return &BookmarkClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/constants.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/constants.go deleted file mode 100644 index 95e462c1392..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/constants.go +++ /dev/null @@ -1,111 +0,0 @@ -package bookmark - -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 EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindNic EntityKind = "Nic" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindNic), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "nic": EntityKindNic, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark.go deleted file mode 100644 index 37ded815f59..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmark - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark_test.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark_test.go deleted file mode 100644 index f11911d55b6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmark - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2022-07-01-preview/bookmark/method_expand.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/method_expand.go deleted file mode 100644 index c3d30a1e86e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/method_expand.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmark - -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 ExpandOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *BookmarkExpandResponse -} - -// Expand ... -func (c BookmarkClient) Expand(ctx context.Context, id BookmarkId, input BookmarkExpandParameters) (result ExpandOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/expand", 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 BookmarkExpandResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandparameters.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandparameters.go deleted file mode 100644 index d0c2ac39a21..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandparameters.go +++ /dev/null @@ -1,40 +0,0 @@ -package bookmark - -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 BookmarkExpandParameters struct { - EndTime *string `json:"endTime,omitempty"` - ExpansionId *string `json:"expansionId,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *BookmarkExpandParameters) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkExpandParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *BookmarkExpandParameters) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkExpandParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponse.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponse.go deleted file mode 100644 index 660174160da..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkExpandResponse struct { - MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` - Value *BookmarkExpandResponseValue `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponsevalue.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponsevalue.go deleted file mode 100644 index 7da54595645..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_bookmarkexpandresponsevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkExpandResponseValue struct { - Edges *[]ConnectedEntity `json:"edges,omitempty"` - Entities *[]Entity `json:"entities,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_connectedentity.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_connectedentity.go deleted file mode 100644 index 1b0eb2f8a63..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_connectedentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectedEntity struct { - AdditionalData *interface{} `json:"additionalData,omitempty"` - TargetEntityId *string `json:"targetEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_entity.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_entity.go deleted file mode 100644 index dd7f8959d78..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_entity.go +++ /dev/null @@ -1,16 +0,0 @@ -package bookmark - -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 Entity struct { - Id *string `json:"id,omitempty"` - Kind EntityKind `json:"kind"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultaggregation.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultaggregation.go deleted file mode 100644 index 3d2d9b94dd8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultaggregation.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultAggregation struct { - AggregationType *string `json:"aggregationType,omitempty"` - Count int64 `json:"count"` - DisplayName *string `json:"displayName,omitempty"` - EntityKind EntityKind `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultsmetadata.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultsmetadata.go deleted file mode 100644 index e1736c11641..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/model_expansionresultsmetadata.go +++ /dev/null @@ -1,8 +0,0 @@ -package bookmark - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultsMetadata struct { - Aggregations *[]ExpansionResultAggregation `json:"aggregations,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmark/version.go b/resource-manager/securityinsights/2022-07-01-preview/bookmark/version.go deleted file mode 100644 index b1b8c459693..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmark/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmark - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmark/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/README.md b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/README.md deleted file mode 100644 index 4155202051e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations` Documentation - -The `bookmarkrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/bookmarkrelations" -``` - - -### Client Initialization - -```go -client := bookmarkrelations.NewBookmarkRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarkRelationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - -payload := bookmarkrelations.Relation{ - // ... -} - - -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: `BookmarkRelationsClient.Delete` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - -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: `BookmarkRelationsClient.Get` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - -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: `BookmarkRelationsClient.List` - -```go -ctx := context.TODO() -id := bookmarkrelations.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -// alternatively `client.List(ctx, id, bookmarkrelations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, bookmarkrelations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/client.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/client.go deleted file mode 100644 index 7b2f113e83b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmarkrelations - -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 BookmarkRelationsClient struct { - Client *resourcemanager.Client -} - -func NewBookmarkRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarkRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmarkrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarkRelationsClient: %+v", err) - } - - return &BookmarkRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark.go deleted file mode 100644 index b435d465a74..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmarkrelations - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark_test.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark_test.go deleted file mode 100644 index d359e2cf571..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmarkrelations - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation.go deleted file mode 100644 index 7eb043f12dd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation.go +++ /dev/null @@ -1,150 +0,0 @@ -package bookmarkrelations - -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(&BookmarkRelationId{}) -} - -var _ resourceids.ResourceId = &BookmarkRelationId{} - -// BookmarkRelationId is a struct representing the Resource ID for a Bookmark Relation -type BookmarkRelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string - RelationName string -} - -// NewBookmarkRelationID returns a new BookmarkRelationId struct -func NewBookmarkRelationID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string, relationName string) BookmarkRelationId { - return BookmarkRelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - RelationName: relationName, - } -} - -// ParseBookmarkRelationID parses 'input' into a BookmarkRelationId -func ParseBookmarkRelationID(input string) (*BookmarkRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkRelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkRelationIDInsensitively parses 'input' case-insensitively into a BookmarkRelationId -// note: this method should only be used for API response data and not user input -func ParseBookmarkRelationIDInsensitively(input string) (*BookmarkRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkRelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkRelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateBookmarkRelationID checks that 'input' can be parsed as a Bookmark Relation ID -func ValidateBookmarkRelationID(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 := ParseBookmarkRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark Relation ID -func (id BookmarkRelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark Relation ID -func (id BookmarkRelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Bookmark Relation ID -func (id BookmarkRelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Bookmark Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation_test.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation_test.go deleted file mode 100644 index 4baaa6c1918..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/id_bookmarkrelation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package bookmarkrelations - -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 = &BookmarkRelationId{} - -func TestNewBookmarkRelationID(t *testing.T) { - id := NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatBookmarkRelationID(t *testing.T) { - actual := NewBookmarkRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue", - Expected: &BookmarkRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseBookmarkRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue", - Expected: &BookmarkRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &BookmarkRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForBookmarkRelationId(t *testing.T) { - segments := BookmarkRelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkRelationId 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/securityinsights/2022-07-01-preview/bookmarkrelations/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_createorupdate.go deleted file mode 100644 index 1673e53e3d3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmarkrelations - -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 *Relation -} - -// CreateOrUpdate ... -func (c BookmarkRelationsClient) CreateOrUpdate(ctx context.Context, id BookmarkRelationId, input Relation) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_delete.go deleted file mode 100644 index be83fdfe96b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package bookmarkrelations - -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 BookmarkRelationsClient) Delete(ctx context.Context, id BookmarkRelationId) (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/securityinsights/2022-07-01-preview/bookmarkrelations/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_get.go deleted file mode 100644 index 368649d1413..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bookmarkrelations - -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 *Relation -} - -// Get ... -func (c BookmarkRelationsClient) Get(ctx context.Context, id BookmarkRelationId) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_list.go deleted file mode 100644 index c7b0e80ee33..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package bookmarkrelations - -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 *[]Relation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c BookmarkRelationsClient) List(ctx context.Context, id BookmarkId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `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 BookmarkRelationsClient) ListComplete(ctx context.Context, id BookmarkId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BookmarkRelationsClient) ListCompleteMatchingPredicate(ctx context.Context, id BookmarkId, options ListOperationOptions, predicate RelationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-07-01-preview/bookmarkrelations/model_relation.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relation.go deleted file mode 100644 index e33320efd48..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package bookmarkrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relationproperties.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relationproperties.go deleted file mode 100644 index e7ab9bd5ff4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmarkrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/predicates.go deleted file mode 100644 index 575631e64a9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bookmarkrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2022-07-01-preview/bookmarkrelations/version.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/version.go deleted file mode 100644 index 9bdb6105328..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmarkrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmarkrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/README.md b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/README.md deleted file mode 100644 index 99ea5c08d78..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/bookmarks` Documentation - -The `bookmarks` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/bookmarks" -``` - - -### Client Initialization - -```go -client := bookmarks.NewBookmarksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -payload := bookmarks.Bookmark{ - // ... -} - - -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: `BookmarksClient.Delete` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -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: `BookmarksClient.Get` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -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: `BookmarksClient.List` - -```go -ctx := context.TODO() -id := bookmarks.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/bookmarks/client.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/client.go deleted file mode 100644 index 22469155649..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmarks - -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 BookmarksClient struct { - Client *resourcemanager.Client -} - -func NewBookmarksClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmarks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarksClient: %+v", err) - } - - return &BookmarksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/constants.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/constants.go deleted file mode 100644 index 9ec53ffa34f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/constants.go +++ /dev/null @@ -1,143 +0,0 @@ -package bookmarks - -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 AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark.go deleted file mode 100644 index 5317bd28514..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmarks - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark_test.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark_test.go deleted file mode 100644 index 1d89b9448a6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmarks - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2022-07-01-preview/bookmarks/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace.go deleted file mode 100644 index 96d5c1221cf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package bookmarks - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace_test.go deleted file mode 100644 index c0e8adfac09..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bookmarks - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/bookmarks/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_createorupdate.go deleted file mode 100644 index 2e61ab3ee74..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmarks - -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 *Bookmark -} - -// CreateOrUpdate ... -func (c BookmarksClient) CreateOrUpdate(ctx context.Context, id BookmarkId, input Bookmark) (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 Bookmark - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_delete.go deleted file mode 100644 index 75eef715a7c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package bookmarks - -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 BookmarksClient) Delete(ctx context.Context, id BookmarkId) (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/securityinsights/2022-07-01-preview/bookmarks/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_get.go deleted file mode 100644 index 36c8d7fcc43..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bookmarks - -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 *Bookmark -} - -// Get ... -func (c BookmarksClient) Get(ctx context.Context, id BookmarkId) (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 Bookmark - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_list.go deleted file mode 100644 index 432b04c413a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package bookmarks - -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 *[]Bookmark -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Bookmark -} - -// List ... -func (c BookmarksClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/bookmarks", 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 *[]Bookmark `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 BookmarksClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BookmarkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BookmarksClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate BookmarkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Bookmark, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/bookmarks/model_bookmark.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmark.go deleted file mode 100644 index 0745cad5b0a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmark.go +++ /dev/null @@ -1,17 +0,0 @@ -package bookmarks - -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 Bookmark struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BookmarkProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkentitymappings.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkentitymappings.go deleted file mode 100644 index 2b6063866db..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkentitymappings.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkEntityMappings struct { - EntityType *string `json:"entityType,omitempty"` - FieldMappings *[]EntityFieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkproperties.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkproperties.go deleted file mode 100644 index cb3b21e0911..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_bookmarkproperties.go +++ /dev/null @@ -1,89 +0,0 @@ -package bookmarks - -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 BookmarkProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EntityMappings *[]BookmarkEntityMappings `json:"entityMappings,omitempty"` - EventTime *string `json:"eventTime,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryEndTime *string `json:"queryEndTime,omitempty"` - QueryResult *string `json:"queryResult,omitempty"` - QueryStartTime *string `json:"queryStartTime,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *BookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *BookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *BookmarkProperties) GetQueryEndTimeAsTime() (*time.Time, error) { - if o.QueryEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetQueryEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryEndTime = &formatted -} - -func (o *BookmarkProperties) GetQueryStartTimeAsTime() (*time.Time, error) { - if o.QueryStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetQueryStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryStartTime = &formatted -} - -func (o *BookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_entityfieldmapping.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_entityfieldmapping.go deleted file mode 100644 index 5a68b56cfe6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_entityfieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityFieldMapping struct { - Identifier *string `json:"identifier,omitempty"` - Value *string `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_incidentinfo.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_incidentinfo.go deleted file mode 100644 index a4c9f8c8d44..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_userinfo.go deleted file mode 100644 index 178ee7d633c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/predicates.go deleted file mode 100644 index d5334a9af01..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BookmarkOperationPredicate) Matches(input Bookmark) 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.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/securityinsights/2022-07-01-preview/bookmarks/version.go b/resource-manager/securityinsights/2022-07-01-preview/bookmarks/version.go deleted file mode 100644 index 08b38639644..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/bookmarks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmarks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmarks/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/README.md b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/README.md deleted file mode 100644 index caa3f7eda6f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements` Documentation - -The `checkdataconnectorrequirements` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/checkdataconnectorrequirements" -``` - - -### Client Initialization - -```go -client := checkdataconnectorrequirements.NewCheckDataConnectorRequirementsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `CheckDataConnectorRequirementsClient.DataConnectorsCheckRequirementsPost` - -```go -ctx := context.TODO() -id := checkdataconnectorrequirements.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := checkdataconnectorrequirements.DataConnectorsCheckRequirements{ - // ... -} - - -read, err := client.DataConnectorsCheckRequirementsPost(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/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/client.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/client.go deleted file mode 100644 index c01575bd213..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package checkdataconnectorrequirements - -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 CheckDataConnectorRequirementsClient struct { - Client *resourcemanager.Client -} - -func NewCheckDataConnectorRequirementsClientWithBaseURI(sdkApi sdkEnv.Api) (*CheckDataConnectorRequirementsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "checkdataconnectorrequirements", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating CheckDataConnectorRequirementsClient: %+v", err) - } - - return &CheckDataConnectorRequirementsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/constants.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/constants.go deleted file mode 100644 index c2cb4a1623a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/constants.go +++ /dev/null @@ -1,190 +0,0 @@ -package checkdataconnectorrequirements - -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 DataConnectorAuthorizationState string - -const ( - DataConnectorAuthorizationStateInvalid DataConnectorAuthorizationState = "Invalid" - DataConnectorAuthorizationStateValid DataConnectorAuthorizationState = "Valid" -) - -func PossibleValuesForDataConnectorAuthorizationState() []string { - return []string{ - string(DataConnectorAuthorizationStateInvalid), - string(DataConnectorAuthorizationStateValid), - } -} - -func (s *DataConnectorAuthorizationState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorAuthorizationState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorAuthorizationState(input string) (*DataConnectorAuthorizationState, error) { - vals := map[string]DataConnectorAuthorizationState{ - "invalid": DataConnectorAuthorizationStateInvalid, - "valid": DataConnectorAuthorizationStateValid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorAuthorizationState(input) - return &out, nil -} - -type DataConnectorKind string - -const ( - DataConnectorKindAPIPolling DataConnectorKind = "APIPolling" - DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" - DataConnectorKindAmazonWebServicesSThree DataConnectorKind = "AmazonWebServicesS3" - DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" - DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" - DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" - DataConnectorKindDynamicsThreeSixFive DataConnectorKind = "Dynamics365" - DataConnectorKindGenericUI DataConnectorKind = "GenericUI" - DataConnectorKindIOT DataConnectorKind = "IOT" - DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" - DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" - DataConnectorKindMicrosoftThreatIntelligence DataConnectorKind = "MicrosoftThreatIntelligence" - DataConnectorKindMicrosoftThreatProtection DataConnectorKind = "MicrosoftThreatProtection" - DataConnectorKindOfficeATP DataConnectorKind = "OfficeATP" - DataConnectorKindOfficeIRM DataConnectorKind = "OfficeIRM" - DataConnectorKindOfficePowerBI DataConnectorKind = "OfficePowerBI" - DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" - DataConnectorKindOfficeThreeSixFiveProject DataConnectorKind = "Office365Project" - DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" - DataConnectorKindThreatIntelligenceTaxii DataConnectorKind = "ThreatIntelligenceTaxii" -) - -func PossibleValuesForDataConnectorKind() []string { - return []string{ - string(DataConnectorKindAPIPolling), - string(DataConnectorKindAmazonWebServicesCloudTrail), - string(DataConnectorKindAmazonWebServicesSThree), - string(DataConnectorKindAzureActiveDirectory), - string(DataConnectorKindAzureAdvancedThreatProtection), - string(DataConnectorKindAzureSecurityCenter), - string(DataConnectorKindDynamicsThreeSixFive), - string(DataConnectorKindGenericUI), - string(DataConnectorKindIOT), - string(DataConnectorKindMicrosoftCloudAppSecurity), - string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), - string(DataConnectorKindMicrosoftThreatIntelligence), - string(DataConnectorKindMicrosoftThreatProtection), - string(DataConnectorKindOfficeATP), - string(DataConnectorKindOfficeIRM), - string(DataConnectorKindOfficePowerBI), - string(DataConnectorKindOfficeThreeSixFive), - string(DataConnectorKindOfficeThreeSixFiveProject), - string(DataConnectorKindThreatIntelligence), - string(DataConnectorKindThreatIntelligenceTaxii), - } -} - -func (s *DataConnectorKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorKind(input string) (*DataConnectorKind, error) { - vals := map[string]DataConnectorKind{ - "apipolling": DataConnectorKindAPIPolling, - "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, - "amazonwebservicess3": DataConnectorKindAmazonWebServicesSThree, - "azureactivedirectory": DataConnectorKindAzureActiveDirectory, - "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, - "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, - "dynamics365": DataConnectorKindDynamicsThreeSixFive, - "genericui": DataConnectorKindGenericUI, - "iot": DataConnectorKindIOT, - "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, - "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, - "microsoftthreatintelligence": DataConnectorKindMicrosoftThreatIntelligence, - "microsoftthreatprotection": DataConnectorKindMicrosoftThreatProtection, - "officeatp": DataConnectorKindOfficeATP, - "officeirm": DataConnectorKindOfficeIRM, - "officepowerbi": DataConnectorKindOfficePowerBI, - "office365": DataConnectorKindOfficeThreeSixFive, - "office365project": DataConnectorKindOfficeThreeSixFiveProject, - "threatintelligence": DataConnectorKindThreatIntelligence, - "threatintelligencetaxii": DataConnectorKindThreatIntelligenceTaxii, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorKind(input) - return &out, nil -} - -type DataConnectorLicenseState string - -const ( - DataConnectorLicenseStateInvalid DataConnectorLicenseState = "Invalid" - DataConnectorLicenseStateUnknown DataConnectorLicenseState = "Unknown" - DataConnectorLicenseStateValid DataConnectorLicenseState = "Valid" -) - -func PossibleValuesForDataConnectorLicenseState() []string { - return []string{ - string(DataConnectorLicenseStateInvalid), - string(DataConnectorLicenseStateUnknown), - string(DataConnectorLicenseStateValid), - } -} - -func (s *DataConnectorLicenseState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorLicenseState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorLicenseState(input string) (*DataConnectorLicenseState, error) { - vals := map[string]DataConnectorLicenseState{ - "invalid": DataConnectorLicenseStateInvalid, - "unknown": DataConnectorLicenseStateUnknown, - "valid": DataConnectorLicenseStateValid, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorLicenseState(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace.go deleted file mode 100644 index b25e14b058a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package checkdataconnectorrequirements - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace_test.go deleted file mode 100644 index dfd92520cd0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package checkdataconnectorrequirements - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go deleted file mode 100644 index 592338190a2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/method_dataconnectorscheckrequirementspost.go +++ /dev/null @@ -1,59 +0,0 @@ -package checkdataconnectorrequirements - -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 DataConnectorsCheckRequirementsPostOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *DataConnectorRequirementsState -} - -// DataConnectorsCheckRequirementsPost ... -func (c CheckDataConnectorRequirementsClient) DataConnectorsCheckRequirementsPost(ctx context.Context, id WorkspaceId, input DataConnectorsCheckRequirements) (result DataConnectorsCheckRequirementsPostOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectorsCheckRequirements", 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 DataConnectorRequirementsState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go deleted file mode 100644 index ff65fa7b99c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aadcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AADCheckRequirements{} - -type AADCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AADCheckRequirements{} - -func (s AADCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AADCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AADCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AADCheckRequirements: %+v", err) - } - decoded["kind"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AADCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go deleted file mode 100644 index 3e9bd0286a6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_aatpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AATPCheckRequirements{} - -type AATPCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AATPCheckRequirements{} - -func (s AATPCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AATPCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AATPCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AATPCheckRequirements: %+v", err) - } - decoded["kind"] = "AzureAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AATPCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go deleted file mode 100644 index 540d0578fb0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = ASCCheckRequirements{} - -type ASCCheckRequirements struct { - Properties *ASCCheckRequirementsProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = ASCCheckRequirements{} - -func (s ASCCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper ASCCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ASCCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ASCCheckRequirements: %+v", err) - } - decoded["kind"] = "AzureSecurityCenter" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ASCCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go deleted file mode 100644 index ba43032141a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_asccheckrequirementsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ASCCheckRequirementsProperties struct { - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go deleted file mode 100644 index 30f8e23168f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awscloudtrailcheckrequirements.go +++ /dev/null @@ -1,40 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AwsCloudTrailCheckRequirements{} - -type AwsCloudTrailCheckRequirements struct { - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AwsCloudTrailCheckRequirements{} - -func (s AwsCloudTrailCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AwsCloudTrailCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsCloudTrailCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsCloudTrailCheckRequirements: %+v", err) - } - decoded["kind"] = "AmazonWebServicesCloudTrail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsCloudTrailCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go deleted file mode 100644 index 7a8ef502e8d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_awss3checkrequirements.go +++ /dev/null @@ -1,40 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = AwsS3CheckRequirements{} - -type AwsS3CheckRequirements struct { - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = AwsS3CheckRequirements{} - -func (s AwsS3CheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper AwsS3CheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsS3CheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsS3CheckRequirements: %+v", err) - } - decoded["kind"] = "AmazonWebServicesS3" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsS3CheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go deleted file mode 100644 index fb3d08c63a5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorrequirementsstate.go +++ /dev/null @@ -1,9 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorRequirementsState struct { - AuthorizationState *DataConnectorAuthorizationState `json:"authorizationState,omitempty"` - LicenseState *DataConnectorLicenseState `json:"licenseState,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go deleted file mode 100644 index 108ee7f1467..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectorscheckrequirements.go +++ /dev/null @@ -1,181 +0,0 @@ -package checkdataconnectorrequirements - -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 DataConnectorsCheckRequirements interface { -} - -// RawDataConnectorsCheckRequirementsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawDataConnectorsCheckRequirementsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalDataConnectorsCheckRequirementsImplementation(input []byte) (DataConnectorsCheckRequirements, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling DataConnectorsCheckRequirements into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out AADCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AADCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureAdvancedThreatProtection") { - var out AATPCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AATPCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureSecurityCenter") { - var out ASCCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ASCCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { - var out AwsCloudTrailCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsCloudTrailCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesS3") { - var out AwsS3CheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsS3CheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Dynamics365") { - var out Dynamics365CheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Dynamics365CheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IOT") { - var out IoTCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IoTCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { - var out MCASCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MCASCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { - var out MDATPCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MDATPCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatIntelligence") { - var out MSTICheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MSTICheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatProtection") { - var out MtpCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MtpCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Office365Project") { - var out Office365ProjectCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Office365ProjectCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeATP") { - var out OfficeATPCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeATPCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeIRM") { - var out OfficeIRMCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeIRMCheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficePowerBI") { - var out OfficePowerBICheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficePowerBICheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out TICheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TICheckRequirements: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligenceTaxii") { - var out TiTaxiiCheckRequirements - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TiTaxiiCheckRequirements: %+v", err) - } - return out, nil - } - - out := RawDataConnectorsCheckRequirementsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go deleted file mode 100644 index 621ff38984a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dataconnectortenantid.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorTenantId struct { - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go deleted file mode 100644 index 91327c1f028..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_dynamics365checkrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = Dynamics365CheckRequirements{} - -type Dynamics365CheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = Dynamics365CheckRequirements{} - -func (s Dynamics365CheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper Dynamics365CheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Dynamics365CheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Dynamics365CheckRequirements: %+v", err) - } - decoded["kind"] = "Dynamics365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Dynamics365CheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirements.go deleted file mode 100644 index 7d929ad555f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = IoTCheckRequirements{} - -type IoTCheckRequirements struct { - Properties *IoTCheckRequirementsProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = IoTCheckRequirements{} - -func (s IoTCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper IoTCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IoTCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IoTCheckRequirements: %+v", err) - } - decoded["kind"] = "IOT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IoTCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirementsproperties.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirementsproperties.go deleted file mode 100644 index da164a9dd47..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_iotcheckrequirementsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package checkdataconnectorrequirements - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTCheckRequirementsProperties struct { - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go deleted file mode 100644 index 98755f8e96e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mcascheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MCASCheckRequirements{} - -type MCASCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MCASCheckRequirements{} - -func (s MCASCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MCASCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MCASCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MCASCheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftCloudAppSecurity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MCASCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go deleted file mode 100644 index 452c3359f5d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mdatpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MDATPCheckRequirements{} - -type MDATPCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MDATPCheckRequirements{} - -func (s MDATPCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MDATPCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MDATPCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MDATPCheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MDATPCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go deleted file mode 100644 index c9b2e2de45c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_msticheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MSTICheckRequirements{} - -type MSTICheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MSTICheckRequirements{} - -func (s MSTICheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MSTICheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MSTICheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MSTICheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MSTICheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go deleted file mode 100644 index 70a71b1b3c8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_mtpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = MtpCheckRequirements{} - -type MtpCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = MtpCheckRequirements{} - -func (s MtpCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper MtpCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MtpCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MtpCheckRequirements: %+v", err) - } - decoded["kind"] = "MicrosoftThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MtpCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_office365projectcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_office365projectcheckrequirements.go deleted file mode 100644 index 2cee1cca12d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_office365projectcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = Office365ProjectCheckRequirements{} - -type Office365ProjectCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = Office365ProjectCheckRequirements{} - -func (s Office365ProjectCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper Office365ProjectCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Office365ProjectCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Office365ProjectCheckRequirements: %+v", err) - } - decoded["kind"] = "Office365Project" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Office365ProjectCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go deleted file mode 100644 index 2ffb2d3ea00..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeatpcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = OfficeATPCheckRequirements{} - -type OfficeATPCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = OfficeATPCheckRequirements{} - -func (s OfficeATPCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper OfficeATPCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeATPCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeATPCheckRequirements: %+v", err) - } - decoded["kind"] = "OfficeATP" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeATPCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go deleted file mode 100644 index 83a9ab02643..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officeirmcheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = OfficeIRMCheckRequirements{} - -type OfficeIRMCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = OfficeIRMCheckRequirements{} - -func (s OfficeIRMCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper OfficeIRMCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeIRMCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeIRMCheckRequirements: %+v", err) - } - decoded["kind"] = "OfficeIRM" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeIRMCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officepowerbicheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officepowerbicheckrequirements.go deleted file mode 100644 index 68e0635aefe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_officepowerbicheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = OfficePowerBICheckRequirements{} - -type OfficePowerBICheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = OfficePowerBICheckRequirements{} - -func (s OfficePowerBICheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper OfficePowerBICheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficePowerBICheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficePowerBICheckRequirements: %+v", err) - } - decoded["kind"] = "OfficePowerBI" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficePowerBICheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go deleted file mode 100644 index ca83636b3d9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_ticheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = TICheckRequirements{} - -type TICheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = TICheckRequirements{} - -func (s TICheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper TICheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TICheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TICheckRequirements: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TICheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go deleted file mode 100644 index cbc2eb9ec40..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/model_titaxiicheckrequirements.go +++ /dev/null @@ -1,41 +0,0 @@ -package checkdataconnectorrequirements - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ DataConnectorsCheckRequirements = TiTaxiiCheckRequirements{} - -type TiTaxiiCheckRequirements struct { - Properties *DataConnectorTenantId `json:"properties,omitempty"` - - // Fields inherited from DataConnectorsCheckRequirements -} - -var _ json.Marshaler = TiTaxiiCheckRequirements{} - -func (s TiTaxiiCheckRequirements) MarshalJSON() ([]byte, error) { - type wrapper TiTaxiiCheckRequirements - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TiTaxiiCheckRequirements: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TiTaxiiCheckRequirements: %+v", err) - } - decoded["kind"] = "ThreatIntelligenceTaxii" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TiTaxiiCheckRequirements: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/version.go b/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/version.go deleted file mode 100644 index 215dcfddc33..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package checkdataconnectorrequirements - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/checkdataconnectorrequirements/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/client.go b/resource-manager/securityinsights/2022-07-01-preview/client.go deleted file mode 100644 index 8474198bcea..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/client.go +++ /dev/null @@ -1,325 +0,0 @@ -package v2022_07_01_preview - -// 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/securityinsights/2022-07-01-preview/actions" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/alertrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/alertruletemplates" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/automationrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/bookmark" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/bookmarkrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/bookmarks" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/checkdataconnectorrequirements" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/dataconnectors" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/enrichment" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entities" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entityqueries" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entityrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entitytypes" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentalerts" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentcomments" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidententities" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidents" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentteam" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/manualtrigger" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/metadata" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/officeconsents" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/repositories" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/settings" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/threatintelligence" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/watchlistitems" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/watchlists" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Actions *actions.ActionsClient - AlertRuleTemplates *alertruletemplates.AlertRuleTemplatesClient - AlertRules *alertrules.AlertRulesClient - AutomationRules *automationrules.AutomationRulesClient - Bookmark *bookmark.BookmarkClient - BookmarkRelations *bookmarkrelations.BookmarkRelationsClient - Bookmarks *bookmarks.BookmarksClient - CheckDataConnectorRequirements *checkdataconnectorrequirements.CheckDataConnectorRequirementsClient - DataConnectors *dataconnectors.DataConnectorsClient - DataConnectorsConnect *dataconnectorsconnect.DataConnectorsConnectClient - DataConnectorsDisconnect *dataconnectorsdisconnect.DataConnectorsDisconnectClient - Enrichment *enrichment.EnrichmentClient - Entities *entities.EntitiesClient - EntityQueries *entityqueries.EntityQueriesClient - EntityRelations *entityrelations.EntityRelationsClient - EntityTypes *entitytypes.EntityTypesClient - IncidentAlerts *incidentalerts.IncidentAlertsClient - IncidentBookmarks *incidentbookmarks.IncidentBookmarksClient - IncidentComments *incidentcomments.IncidentCommentsClient - IncidentEntities *incidententities.IncidentEntitiesClient - IncidentRelations *incidentrelations.IncidentRelationsClient - IncidentTeam *incidentteam.IncidentTeamClient - Incidents *incidents.IncidentsClient - ManualTrigger *manualtrigger.ManualTriggerClient - Metadata *metadata.MetadataClient - OfficeConsents *officeconsents.OfficeConsentsClient - Repositories *repositories.RepositoriesClient - SecurityMLAnalyticsSettings *securitymlanalyticssettings.SecurityMLAnalyticsSettingsClient - SentinelOnboardingStates *sentinelonboardingstates.SentinelOnboardingStatesClient - Settings *settings.SettingsClient - SourceControls *sourcecontrols.SourceControlsClient - ThreatIntelligence *threatintelligence.ThreatIntelligenceClient - WatchlistItems *watchlistitems.WatchlistItemsClient - Watchlists *watchlists.WatchlistsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - actionsClient, err := actions.NewActionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Actions client: %+v", err) - } - configureFunc(actionsClient.Client) - - alertRuleTemplatesClient, err := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AlertRuleTemplates client: %+v", err) - } - configureFunc(alertRuleTemplatesClient.Client) - - alertRulesClient, err := alertrules.NewAlertRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AlertRules client: %+v", err) - } - configureFunc(alertRulesClient.Client) - - automationRulesClient, err := automationrules.NewAutomationRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AutomationRules client: %+v", err) - } - configureFunc(automationRulesClient.Client) - - bookmarkClient, err := bookmark.NewBookmarkClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Bookmark client: %+v", err) - } - configureFunc(bookmarkClient.Client) - - bookmarkRelationsClient, err := bookmarkrelations.NewBookmarkRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building BookmarkRelations client: %+v", err) - } - configureFunc(bookmarkRelationsClient.Client) - - bookmarksClient, err := bookmarks.NewBookmarksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Bookmarks client: %+v", err) - } - configureFunc(bookmarksClient.Client) - - checkDataConnectorRequirementsClient, err := checkdataconnectorrequirements.NewCheckDataConnectorRequirementsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building CheckDataConnectorRequirements client: %+v", err) - } - configureFunc(checkDataConnectorRequirementsClient.Client) - - dataConnectorsClient, err := dataconnectors.NewDataConnectorsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectors client: %+v", err) - } - configureFunc(dataConnectorsClient.Client) - - dataConnectorsConnectClient, err := dataconnectorsconnect.NewDataConnectorsConnectClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectorsConnect client: %+v", err) - } - configureFunc(dataConnectorsConnectClient.Client) - - dataConnectorsDisconnectClient, err := dataconnectorsdisconnect.NewDataConnectorsDisconnectClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectorsDisconnect client: %+v", err) - } - configureFunc(dataConnectorsDisconnectClient.Client) - - enrichmentClient, err := enrichment.NewEnrichmentClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Enrichment client: %+v", err) - } - configureFunc(enrichmentClient.Client) - - entitiesClient, err := entities.NewEntitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Entities client: %+v", err) - } - configureFunc(entitiesClient.Client) - - entityQueriesClient, err := entityqueries.NewEntityQueriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityQueries client: %+v", err) - } - configureFunc(entityQueriesClient.Client) - - entityRelationsClient, err := entityrelations.NewEntityRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityRelations client: %+v", err) - } - configureFunc(entityRelationsClient.Client) - - entityTypesClient, err := entitytypes.NewEntityTypesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityTypes client: %+v", err) - } - configureFunc(entityTypesClient.Client) - - incidentAlertsClient, err := incidentalerts.NewIncidentAlertsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentAlerts client: %+v", err) - } - configureFunc(incidentAlertsClient.Client) - - incidentBookmarksClient, err := incidentbookmarks.NewIncidentBookmarksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentBookmarks client: %+v", err) - } - configureFunc(incidentBookmarksClient.Client) - - incidentCommentsClient, err := incidentcomments.NewIncidentCommentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentComments client: %+v", err) - } - configureFunc(incidentCommentsClient.Client) - - incidentEntitiesClient, err := incidententities.NewIncidentEntitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentEntities client: %+v", err) - } - configureFunc(incidentEntitiesClient.Client) - - incidentRelationsClient, err := incidentrelations.NewIncidentRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentRelations client: %+v", err) - } - configureFunc(incidentRelationsClient.Client) - - incidentTeamClient, err := incidentteam.NewIncidentTeamClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentTeam client: %+v", err) - } - configureFunc(incidentTeamClient.Client) - - incidentsClient, err := incidents.NewIncidentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Incidents client: %+v", err) - } - configureFunc(incidentsClient.Client) - - manualTriggerClient, err := manualtrigger.NewManualTriggerClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ManualTrigger client: %+v", err) - } - configureFunc(manualTriggerClient.Client) - - metadataClient, err := metadata.NewMetadataClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Metadata client: %+v", err) - } - configureFunc(metadataClient.Client) - - officeConsentsClient, err := officeconsents.NewOfficeConsentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building OfficeConsents client: %+v", err) - } - configureFunc(officeConsentsClient.Client) - - repositoriesClient, err := repositories.NewRepositoriesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Repositories client: %+v", err) - } - configureFunc(repositoriesClient.Client) - - securityMLAnalyticsSettingsClient, err := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SecurityMLAnalyticsSettings client: %+v", err) - } - configureFunc(securityMLAnalyticsSettingsClient.Client) - - sentinelOnboardingStatesClient, err := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SentinelOnboardingStates client: %+v", err) - } - configureFunc(sentinelOnboardingStatesClient.Client) - - settingsClient, err := settings.NewSettingsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Settings client: %+v", err) - } - configureFunc(settingsClient.Client) - - sourceControlsClient, err := sourcecontrols.NewSourceControlsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SourceControls client: %+v", err) - } - configureFunc(sourceControlsClient.Client) - - threatIntelligenceClient, err := threatintelligence.NewThreatIntelligenceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ThreatIntelligence client: %+v", err) - } - configureFunc(threatIntelligenceClient.Client) - - watchlistItemsClient, err := watchlistitems.NewWatchlistItemsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WatchlistItems client: %+v", err) - } - configureFunc(watchlistItemsClient.Client) - - watchlistsClient, err := watchlists.NewWatchlistsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Watchlists client: %+v", err) - } - configureFunc(watchlistsClient.Client) - - return &Client{ - Actions: actionsClient, - AlertRuleTemplates: alertRuleTemplatesClient, - AlertRules: alertRulesClient, - AutomationRules: automationRulesClient, - Bookmark: bookmarkClient, - BookmarkRelations: bookmarkRelationsClient, - Bookmarks: bookmarksClient, - CheckDataConnectorRequirements: checkDataConnectorRequirementsClient, - DataConnectors: dataConnectorsClient, - DataConnectorsConnect: dataConnectorsConnectClient, - DataConnectorsDisconnect: dataConnectorsDisconnectClient, - Enrichment: enrichmentClient, - Entities: entitiesClient, - EntityQueries: entityQueriesClient, - EntityRelations: entityRelationsClient, - EntityTypes: entityTypesClient, - IncidentAlerts: incidentAlertsClient, - IncidentBookmarks: incidentBookmarksClient, - IncidentComments: incidentCommentsClient, - IncidentEntities: incidentEntitiesClient, - IncidentRelations: incidentRelationsClient, - IncidentTeam: incidentTeamClient, - Incidents: incidentsClient, - ManualTrigger: manualTriggerClient, - Metadata: metadataClient, - OfficeConsents: officeConsentsClient, - Repositories: repositoriesClient, - SecurityMLAnalyticsSettings: securityMLAnalyticsSettingsClient, - SentinelOnboardingStates: sentinelOnboardingStatesClient, - Settings: settingsClient, - SourceControls: sourceControlsClient, - ThreatIntelligence: threatIntelligenceClient, - WatchlistItems: watchlistItemsClient, - Watchlists: watchlistsClient, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/README.md b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/README.md deleted file mode 100644 index 35c2acfe053..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/dataconnectors` Documentation - -The `dataconnectors` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/dataconnectors" -``` - - -### Client Initialization - -```go -client := dataconnectors.NewDataConnectorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataConnectorsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -payload := dataconnectors.DataConnector{ - // ... -} - - -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: `DataConnectorsClient.Delete` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -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: `DataConnectorsClient.Get` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -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: `DataConnectorsClient.List` - -```go -ctx := context.TODO() -id := dataconnectors.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/dataconnectors/client.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/client.go deleted file mode 100644 index 8ed0120c79a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectors - -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 DataConnectorsClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectors", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsClient: %+v", err) - } - - return &DataConnectorsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/constants.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/constants.go deleted file mode 100644 index ae527d22647..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/constants.go +++ /dev/null @@ -1,381 +0,0 @@ -package dataconnectors - -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 AvailabilityStatus int64 - -const ( - AvailabilityStatusOne AvailabilityStatus = 1 -) - -func PossibleValuesForAvailabilityStatus() []int64 { - return []int64{ - int64(AvailabilityStatusOne), - } -} - -type ConnectivityType string - -const ( - ConnectivityTypeIsConnectedQuery ConnectivityType = "IsConnectedQuery" -) - -func PossibleValuesForConnectivityType() []string { - return []string{ - string(ConnectivityTypeIsConnectedQuery), - } -} - -func (s *ConnectivityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectivityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectivityType(input string) (*ConnectivityType, error) { - vals := map[string]ConnectivityType{ - "isconnectedquery": ConnectivityTypeIsConnectedQuery, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectivityType(input) - return &out, nil -} - -type DataConnectorKind string - -const ( - DataConnectorKindAPIPolling DataConnectorKind = "APIPolling" - DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" - DataConnectorKindAmazonWebServicesSThree DataConnectorKind = "AmazonWebServicesS3" - DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" - DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" - DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" - DataConnectorKindDynamicsThreeSixFive DataConnectorKind = "Dynamics365" - DataConnectorKindGenericUI DataConnectorKind = "GenericUI" - DataConnectorKindIOT DataConnectorKind = "IOT" - DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" - DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" - DataConnectorKindMicrosoftThreatIntelligence DataConnectorKind = "MicrosoftThreatIntelligence" - DataConnectorKindMicrosoftThreatProtection DataConnectorKind = "MicrosoftThreatProtection" - DataConnectorKindOfficeATP DataConnectorKind = "OfficeATP" - DataConnectorKindOfficeIRM DataConnectorKind = "OfficeIRM" - DataConnectorKindOfficePowerBI DataConnectorKind = "OfficePowerBI" - DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" - DataConnectorKindOfficeThreeSixFiveProject DataConnectorKind = "Office365Project" - DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" - DataConnectorKindThreatIntelligenceTaxii DataConnectorKind = "ThreatIntelligenceTaxii" -) - -func PossibleValuesForDataConnectorKind() []string { - return []string{ - string(DataConnectorKindAPIPolling), - string(DataConnectorKindAmazonWebServicesCloudTrail), - string(DataConnectorKindAmazonWebServicesSThree), - string(DataConnectorKindAzureActiveDirectory), - string(DataConnectorKindAzureAdvancedThreatProtection), - string(DataConnectorKindAzureSecurityCenter), - string(DataConnectorKindDynamicsThreeSixFive), - string(DataConnectorKindGenericUI), - string(DataConnectorKindIOT), - string(DataConnectorKindMicrosoftCloudAppSecurity), - string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), - string(DataConnectorKindMicrosoftThreatIntelligence), - string(DataConnectorKindMicrosoftThreatProtection), - string(DataConnectorKindOfficeATP), - string(DataConnectorKindOfficeIRM), - string(DataConnectorKindOfficePowerBI), - string(DataConnectorKindOfficeThreeSixFive), - string(DataConnectorKindOfficeThreeSixFiveProject), - string(DataConnectorKindThreatIntelligence), - string(DataConnectorKindThreatIntelligenceTaxii), - } -} - -func (s *DataConnectorKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorKind(input string) (*DataConnectorKind, error) { - vals := map[string]DataConnectorKind{ - "apipolling": DataConnectorKindAPIPolling, - "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, - "amazonwebservicess3": DataConnectorKindAmazonWebServicesSThree, - "azureactivedirectory": DataConnectorKindAzureActiveDirectory, - "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, - "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, - "dynamics365": DataConnectorKindDynamicsThreeSixFive, - "genericui": DataConnectorKindGenericUI, - "iot": DataConnectorKindIOT, - "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, - "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, - "microsoftthreatintelligence": DataConnectorKindMicrosoftThreatIntelligence, - "microsoftthreatprotection": DataConnectorKindMicrosoftThreatProtection, - "officeatp": DataConnectorKindOfficeATP, - "officeirm": DataConnectorKindOfficeIRM, - "officepowerbi": DataConnectorKindOfficePowerBI, - "office365": DataConnectorKindOfficeThreeSixFive, - "office365project": DataConnectorKindOfficeThreeSixFiveProject, - "threatintelligence": DataConnectorKindThreatIntelligence, - "threatintelligencetaxii": DataConnectorKindThreatIntelligenceTaxii, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorKind(input) - return &out, nil -} - -type DataTypeState string - -const ( - DataTypeStateDisabled DataTypeState = "Disabled" - DataTypeStateEnabled DataTypeState = "Enabled" -) - -func PossibleValuesForDataTypeState() []string { - return []string{ - string(DataTypeStateDisabled), - string(DataTypeStateEnabled), - } -} - -func (s *DataTypeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataTypeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataTypeState(input string) (*DataTypeState, error) { - vals := map[string]DataTypeState{ - "disabled": DataTypeStateDisabled, - "enabled": DataTypeStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataTypeState(input) - return &out, nil -} - -type PermissionProviderScope string - -const ( - PermissionProviderScopeResourceGroup PermissionProviderScope = "ResourceGroup" - PermissionProviderScopeSubscription PermissionProviderScope = "Subscription" - PermissionProviderScopeWorkspace PermissionProviderScope = "Workspace" -) - -func PossibleValuesForPermissionProviderScope() []string { - return []string{ - string(PermissionProviderScopeResourceGroup), - string(PermissionProviderScopeSubscription), - string(PermissionProviderScopeWorkspace), - } -} - -func (s *PermissionProviderScope) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePermissionProviderScope(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePermissionProviderScope(input string) (*PermissionProviderScope, error) { - vals := map[string]PermissionProviderScope{ - "resourcegroup": PermissionProviderScopeResourceGroup, - "subscription": PermissionProviderScopeSubscription, - "workspace": PermissionProviderScopeWorkspace, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PermissionProviderScope(input) - return &out, nil -} - -type PollingFrequency string - -const ( - PollingFrequencyOnceADay PollingFrequency = "OnceADay" - PollingFrequencyOnceAMinute PollingFrequency = "OnceAMinute" - PollingFrequencyOnceAnHour PollingFrequency = "OnceAnHour" -) - -func PossibleValuesForPollingFrequency() []string { - return []string{ - string(PollingFrequencyOnceADay), - string(PollingFrequencyOnceAMinute), - string(PollingFrequencyOnceAnHour), - } -} - -func (s *PollingFrequency) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parsePollingFrequency(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parsePollingFrequency(input string) (*PollingFrequency, error) { - vals := map[string]PollingFrequency{ - "onceaday": PollingFrequencyOnceADay, - "onceaminute": PollingFrequencyOnceAMinute, - "onceanhour": PollingFrequencyOnceAnHour, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := PollingFrequency(input) - return &out, nil -} - -type ProviderName string - -const ( - ProviderNameMicrosoftPointAuthorizationPolicyAssignments ProviderName = "Microsoft.Authorization/policyAssignments" - ProviderNameMicrosoftPointOperationalInsightsSolutions ProviderName = "Microsoft.OperationalInsights/solutions" - ProviderNameMicrosoftPointOperationalInsightsWorkspaces ProviderName = "Microsoft.OperationalInsights/workspaces" - ProviderNameMicrosoftPointOperationalInsightsWorkspacesDatasources ProviderName = "Microsoft.OperationalInsights/workspaces/datasources" - ProviderNameMicrosoftPointOperationalInsightsWorkspacesSharedKeys ProviderName = "Microsoft.OperationalInsights/workspaces/sharedKeys" - ProviderNameMicrosoftPointaadiamDiagnosticSettings ProviderName = "microsoft.aadiam/diagnosticSettings" -) - -func PossibleValuesForProviderName() []string { - return []string{ - string(ProviderNameMicrosoftPointAuthorizationPolicyAssignments), - string(ProviderNameMicrosoftPointOperationalInsightsSolutions), - string(ProviderNameMicrosoftPointOperationalInsightsWorkspaces), - string(ProviderNameMicrosoftPointOperationalInsightsWorkspacesDatasources), - string(ProviderNameMicrosoftPointOperationalInsightsWorkspacesSharedKeys), - string(ProviderNameMicrosoftPointaadiamDiagnosticSettings), - } -} - -func (s *ProviderName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseProviderName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseProviderName(input string) (*ProviderName, error) { - vals := map[string]ProviderName{ - "microsoft.authorization/policyassignments": ProviderNameMicrosoftPointAuthorizationPolicyAssignments, - "microsoft.operationalinsights/solutions": ProviderNameMicrosoftPointOperationalInsightsSolutions, - "microsoft.operationalinsights/workspaces": ProviderNameMicrosoftPointOperationalInsightsWorkspaces, - "microsoft.operationalinsights/workspaces/datasources": ProviderNameMicrosoftPointOperationalInsightsWorkspacesDatasources, - "microsoft.operationalinsights/workspaces/sharedkeys": ProviderNameMicrosoftPointOperationalInsightsWorkspacesSharedKeys, - "microsoft.aadiam/diagnosticsettings": ProviderNameMicrosoftPointaadiamDiagnosticSettings, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ProviderName(input) - return &out, nil -} - -type SettingType string - -const ( - SettingTypeCopyableLabel SettingType = "CopyableLabel" - SettingTypeInfoMessage SettingType = "InfoMessage" - SettingTypeInstructionStepsGroup SettingType = "InstructionStepsGroup" -) - -func PossibleValuesForSettingType() []string { - return []string{ - string(SettingTypeCopyableLabel), - string(SettingTypeInfoMessage), - string(SettingTypeInstructionStepsGroup), - } -} - -func (s *SettingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingType(input string) (*SettingType, error) { - vals := map[string]SettingType{ - "copyablelabel": SettingTypeCopyableLabel, - "infomessage": SettingTypeInfoMessage, - "instructionstepsgroup": SettingTypeInstructionStepsGroup, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector.go deleted file mode 100644 index b55667aa923..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectors - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector_test.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector_test.go deleted file mode 100644 index b0bf20f7576..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectors - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2022-07-01-preview/dataconnectors/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace.go deleted file mode 100644 index 60237fcce07..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package dataconnectors - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace_test.go deleted file mode 100644 index ae4c27a844d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package dataconnectors - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/dataconnectors/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_createorupdate.go deleted file mode 100644 index c5f6e5d1503..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *DataConnector -} - -// CreateOrUpdate ... -func (c DataConnectorsClient) CreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_delete.go deleted file mode 100644 index 8461ec6d8a1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package dataconnectors - -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 DataConnectorsClient) Delete(ctx context.Context, id DataConnectorId) (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/securityinsights/2022-07-01-preview/dataconnectors/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_get.go deleted file mode 100644 index 3511ba85477..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *DataConnector -} - -// Get ... -func (c DataConnectorsClient) Get(ctx context.Context, id DataConnectorId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_list.go deleted file mode 100644 index 6975384fdee..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *[]DataConnector -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataConnector -} - -// List ... -func (c DataConnectorsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectors", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]DataConnector, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalDataConnectorImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for DataConnector (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c DataConnectorsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DataConnectorOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataConnectorsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate DataConnectorOperationPredicate) (result ListCompleteResult, err error) { - items := make([]DataConnector, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnector.go deleted file mode 100644 index dd0ca1af664..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AADDataConnector{} - -type AADDataConnector struct { - Properties *AADDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AADDataConnector{} - -func (s AADDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AADDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AADDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AADDataConnector: %+v", err) - } - decoded["kind"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AADDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnectorproperties.go deleted file mode 100644 index d5c4227265d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aaddataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnector.go deleted file mode 100644 index e1cd013bbd7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AATPDataConnector{} - -type AATPDataConnector struct { - Properties *AATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AATPDataConnector{} - -func (s AATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AATPDataConnector: %+v", err) - } - decoded["kind"] = "AzureAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnectorproperties.go deleted file mode 100644 index 4886a4a09b5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_aatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go deleted file mode 100644 index 828c4e8fdcc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_alertsdatatypeofdataconnector.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertsDataTypeOfDataConnector struct { - Alerts DataConnectorDataTypeCommon `json:"alerts"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_apipollingparameters.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_apipollingparameters.go deleted file mode 100644 index dde34765e72..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_apipollingparameters.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ApiPollingParameters struct { - ConnectorUiConfig *CodelessUiConnectorConfigProperties `json:"connectorUiConfig,omitempty"` - PollingConfig *CodelessConnectorPollingConfigProperties `json:"pollingConfig,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnector.go deleted file mode 100644 index 3af09c2ff8b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = ASCDataConnector{} - -type ASCDataConnector struct { - Properties *ASCDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ASCDataConnector{} - -func (s ASCDataConnector) MarshalJSON() ([]byte, error) { - type wrapper ASCDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ASCDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ASCDataConnector: %+v", err) - } - decoded["kind"] = "AzureSecurityCenter" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ASCDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnectorproperties.go deleted file mode 100644 index ab5b1ceb172..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_ascdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ASCDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_availability.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_availability.go deleted file mode 100644 index a1d71ca3c9e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_availability.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Availability struct { - IsPreview *bool `json:"isPreview,omitempty"` - Status *AvailabilityStatus `json:"status,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnector.go deleted file mode 100644 index b0ef7fdd285..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AwsCloudTrailDataConnector{} - -type AwsCloudTrailDataConnector struct { - Properties *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AwsCloudTrailDataConnector{} - -func (s AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AwsCloudTrailDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsCloudTrailDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsCloudTrailDataConnector: %+v", err) - } - decoded["kind"] = "AmazonWebServicesCloudTrail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsCloudTrailDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go deleted file mode 100644 index f3be18e87d9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorDataTypes struct { - Logs DataConnectorDataTypeCommon `json:"logs"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go deleted file mode 100644 index c9fe4b9a3e5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awscloudtraildataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorProperties struct { - AwsRoleArn *string `json:"awsRoleArn,omitempty"` - DataTypes AwsCloudTrailDataConnectorDataTypes `json:"dataTypes"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnector.go deleted file mode 100644 index 35e5dc2aa8b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AwsS3DataConnector{} - -type AwsS3DataConnector struct { - Properties *AwsS3DataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AwsS3DataConnector{} - -func (s AwsS3DataConnector) MarshalJSON() ([]byte, error) { - type wrapper AwsS3DataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsS3DataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsS3DataConnector: %+v", err) - } - decoded["kind"] = "AmazonWebServicesS3" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsS3DataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go deleted file mode 100644 index 86bc3d59e89..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsS3DataConnectorDataTypes struct { - Logs DataConnectorDataTypeCommon `json:"logs"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectorproperties.go deleted file mode 100644 index cfa37011a38..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_awss3dataconnectorproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsS3DataConnectorProperties struct { - DataTypes AwsS3DataConnectorDataTypes `json:"dataTypes"` - DestinationTable string `json:"destinationTable"` - RoleArn string `json:"roleArn"` - SqsUrls []string `json:"sqsUrls"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessapipollingdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessapipollingdataconnector.go deleted file mode 100644 index 3f6e413fc6e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessapipollingdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = CodelessApiPollingDataConnector{} - -type CodelessApiPollingDataConnector struct { - Properties *ApiPollingParameters `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CodelessApiPollingDataConnector{} - -func (s CodelessApiPollingDataConnector) MarshalJSON() ([]byte, error) { - type wrapper CodelessApiPollingDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CodelessApiPollingDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CodelessApiPollingDataConnector: %+v", err) - } - decoded["kind"] = "APIPolling" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CodelessApiPollingDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go deleted file mode 100644 index 5330433a026..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingauthproperties.go +++ /dev/null @@ -1,20 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingAuthProperties struct { - ApiKeyIdentifier *string `json:"apiKeyIdentifier,omitempty"` - ApiKeyName *string `json:"apiKeyName,omitempty"` - AuthType string `json:"authType"` - AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` - AuthorizationEndpointQueryParameters *interface{} `json:"authorizationEndpointQueryParameters,omitempty"` - FlowName *string `json:"flowName,omitempty"` - IsApiKeyInPostPayload *string `json:"isApiKeyInPostPayload,omitempty"` - IsClientSecretInHeader *bool `json:"isClientSecretInHeader,omitempty"` - RedirectionEndpoint *string `json:"redirectionEndpoint,omitempty"` - Scope *string `json:"scope,omitempty"` - TokenEndpoint *string `json:"tokenEndpoint,omitempty"` - TokenEndpointHeaders *interface{} `json:"tokenEndpointHeaders,omitempty"` - TokenEndpointQueryParameters *interface{} `json:"tokenEndpointQueryParameters,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go deleted file mode 100644 index 43d86fb8eea..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingconfigproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingConfigProperties struct { - Auth CodelessConnectorPollingAuthProperties `json:"auth"` - IsActive *bool `json:"isActive,omitempty"` - Paging *CodelessConnectorPollingPagingProperties `json:"paging,omitempty"` - Request CodelessConnectorPollingRequestProperties `json:"request"` - Response *CodelessConnectorPollingResponseProperties `json:"response,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go deleted file mode 100644 index 6e8f0c486a8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingpagingproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingPagingProperties struct { - NextPageParaName *string `json:"nextPageParaName,omitempty"` - NextPageTokenJsonPath *string `json:"nextPageTokenJsonPath,omitempty"` - PageCountAttributePath *string `json:"pageCountAttributePath,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - PageSizeParaName *string `json:"pageSizeParaName,omitempty"` - PageTimeStampAttributePath *string `json:"pageTimeStampAttributePath,omitempty"` - PageTotalCountAttributePath *string `json:"pageTotalCountAttributePath,omitempty"` - PagingType string `json:"pagingType"` - SearchTheLatestTimeStampFromEventsList *string `json:"searchTheLatestTimeStampFromEventsList,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go deleted file mode 100644 index dd2ec1067de..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingrequestproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingRequestProperties struct { - ApiEndpoint string `json:"apiEndpoint"` - EndTimeAttributeName *string `json:"endTimeAttributeName,omitempty"` - HTTPMethod string `json:"httpMethod"` - Headers *interface{} `json:"headers,omitempty"` - QueryParameters *interface{} `json:"queryParameters,omitempty"` - QueryParametersTemplate *string `json:"queryParametersTemplate,omitempty"` - QueryTimeFormat string `json:"queryTimeFormat"` - QueryWindowInMin int64 `json:"queryWindowInMin"` - RateLimitQps *int64 `json:"rateLimitQps,omitempty"` - RetryCount *int64 `json:"retryCount,omitempty"` - StartTimeAttributeName *string `json:"startTimeAttributeName,omitempty"` - TimeoutInSeconds *int64 `json:"timeoutInSeconds,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go deleted file mode 100644 index 0a503e2087c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessconnectorpollingresponseproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessConnectorPollingResponseProperties struct { - EventsJsonPaths []string `json:"eventsJsonPaths"` - IsGzipCompressed *bool `json:"isGzipCompressed,omitempty"` - SuccessStatusJsonPath *string `json:"successStatusJsonPath,omitempty"` - SuccessStatusValue *string `json:"successStatusValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessparameters.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessparameters.go deleted file mode 100644 index b6488edc786..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessparameters.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessParameters struct { - ConnectorUiConfig *CodelessUiConnectorConfigProperties `json:"connectorUiConfig,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go deleted file mode 100644 index 8e6d34a8748..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuiconnectorconfigproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CodelessUiConnectorConfigProperties struct { - Availability Availability `json:"availability"` - ConnectivityCriteria []ConnectivityCriteria `json:"connectivityCriteria"` - CustomImage *string `json:"customImage,omitempty"` - DataTypes []LastDataReceivedDataType `json:"dataTypes"` - DescriptionMarkdown string `json:"descriptionMarkdown"` - GraphQueries []GraphQueries `json:"graphQueries"` - GraphQueriesTableName string `json:"graphQueriesTableName"` - InstructionSteps []InstructionSteps `json:"instructionSteps"` - Permissions Permissions `json:"permissions"` - Publisher string `json:"publisher"` - SampleQueries []SampleQueries `json:"sampleQueries"` - Title string `json:"title"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuidataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuidataconnector.go deleted file mode 100644 index 4a43012e878..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_codelessuidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = CodelessUiDataConnector{} - -type CodelessUiDataConnector struct { - Properties *CodelessParameters `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CodelessUiDataConnector{} - -func (s CodelessUiDataConnector) MarshalJSON() ([]byte, error) { - type wrapper CodelessUiDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CodelessUiDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CodelessUiDataConnector: %+v", err) - } - decoded["kind"] = "GenericUI" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CodelessUiDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectivitycriteria.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectivitycriteria.go deleted file mode 100644 index d5c31487bb6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectivitycriteria.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectivityCriteria struct { - Type *ConnectivityType `json:"type,omitempty"` - Value *[]string `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectorinstructionmodelbase.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectorinstructionmodelbase.go deleted file mode 100644 index a1ee46edca1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_connectorinstructionmodelbase.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ConnectorInstructionModelBase struct { - Parameters *interface{} `json:"parameters,omitempty"` - Type SettingType `json:"type"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_customspermission.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_customspermission.go deleted file mode 100644 index 542dfa8eeb0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_customspermission.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CustomsPermission struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnector.go deleted file mode 100644 index 4150bccd62d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnector.go +++ /dev/null @@ -1,205 +0,0 @@ -package dataconnectors - -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 DataConnector interface { -} - -// RawDataConnectorImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawDataConnectorImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalDataConnectorImplementation(input []byte) (DataConnector, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling DataConnector into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out AADDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AADDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureAdvancedThreatProtection") { - var out AATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureSecurityCenter") { - var out ASCDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ASCDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { - var out AwsCloudTrailDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsCloudTrailDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesS3") { - var out AwsS3DataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsS3DataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "APIPolling") { - var out CodelessApiPollingDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CodelessApiPollingDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "GenericUI") { - var out CodelessUiDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CodelessUiDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Dynamics365") { - var out Dynamics365DataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Dynamics365DataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IOT") { - var out IoTDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IoTDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { - var out MCASDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MCASDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { - var out MDATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MDATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatIntelligence") { - var out MSTIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MSTIDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftThreatProtection") { - var out MTPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MTPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Office365Project") { - var out Office365ProjectDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Office365ProjectDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeATP") { - var out OfficeATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Office365") { - var out OfficeDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficeIRM") { - var out OfficeIRMDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeIRMDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "OfficePowerBI") { - var out OfficePowerBIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficePowerBIDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out TIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TIDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligenceTaxii") { - var out TiTaxiiDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TiTaxiiDataConnector: %+v", err) - } - return out, nil - } - - out := RawDataConnectorImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnectordatatypecommon.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnectordatatypecommon.go deleted file mode 100644 index 806cc9a7617..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dataconnectordatatypecommon.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorDataTypeCommon struct { - State DataTypeState `json:"state"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnector.go deleted file mode 100644 index b740152afaa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = Dynamics365DataConnector{} - -type Dynamics365DataConnector struct { - Properties *Dynamics365DataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Dynamics365DataConnector{} - -func (s Dynamics365DataConnector) MarshalJSON() ([]byte, error) { - type wrapper Dynamics365DataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Dynamics365DataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Dynamics365DataConnector: %+v", err) - } - decoded["kind"] = "Dynamics365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Dynamics365DataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go deleted file mode 100644 index 9a78f866c2b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Dynamics365DataConnectorDataTypes struct { - Dynamics365CdsActivities DataConnectorDataTypeCommon `json:"dynamics365CdsActivities"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go deleted file mode 100644 index 61901044697..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_dynamics365dataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Dynamics365DataConnectorProperties struct { - DataTypes Dynamics365DataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_graphqueries.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_graphqueries.go deleted file mode 100644 index 81d0f434bc6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_graphqueries.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GraphQueries struct { - BaseQuery *string `json:"baseQuery,omitempty"` - Legend *string `json:"legend,omitempty"` - MetricName *string `json:"metricName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_instructionsteps.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_instructionsteps.go deleted file mode 100644 index 98a7ca179fe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_instructionsteps.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InstructionSteps struct { - Description *string `json:"description,omitempty"` - Instructions *[]ConnectorInstructionModelBase `json:"instructions,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnector.go deleted file mode 100644 index 35737b5b0db..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = IoTDataConnector{} - -type IoTDataConnector struct { - Properties *IoTDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IoTDataConnector{} - -func (s IoTDataConnector) MarshalJSON() ([]byte, error) { - type wrapper IoTDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IoTDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IoTDataConnector: %+v", err) - } - decoded["kind"] = "IOT" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IoTDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnectorproperties.go deleted file mode 100644 index 907f1ef17c3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_iotdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_lastdatareceiveddatatype.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_lastdatareceiveddatatype.go deleted file mode 100644 index 79f8e89e298..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_lastdatareceiveddatatype.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type LastDataReceivedDataType struct { - LastDataReceivedQuery *string `json:"lastDataReceivedQuery,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnector.go deleted file mode 100644 index 6a0c9aebea0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MCASDataConnector{} - -type MCASDataConnector struct { - Properties *MCASDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MCASDataConnector{} - -func (s MCASDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MCASDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MCASDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MCASDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftCloudAppSecurity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MCASDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go deleted file mode 100644 index f633e0281ca..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectordatatypes.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorDataTypes struct { - Alerts DataConnectorDataTypeCommon `json:"alerts"` - DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectorproperties.go deleted file mode 100644 index 0eac613483f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mcasdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorProperties struct { - DataTypes MCASDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnector.go deleted file mode 100644 index 1a6bcbcb7bf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MDATPDataConnector{} - -type MDATPDataConnector struct { - Properties *MDATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MDATPDataConnector{} - -func (s MDATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MDATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MDATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MDATPDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MDATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go deleted file mode 100644 index bc07670068a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mdatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MDATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnector.go deleted file mode 100644 index 471a195af16..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MSTIDataConnector{} - -type MSTIDataConnector struct { - Properties *MSTIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MSTIDataConnector{} - -func (s MSTIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MSTIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MSTIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MSTIDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MSTIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypes.go deleted file mode 100644 index 0e6f3ae0313..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypes.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorDataTypes struct { - BingSafetyPhishingURL MSTIDataConnectorDataTypesBingSafetyPhishingURL `json:"bingSafetyPhishingURL"` - MicrosoftEmergingThreatFeed MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed `json:"microsoftEmergingThreatFeed"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go deleted file mode 100644 index c98b44400fa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesbingsafetyphishingurl.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorDataTypesBingSafetyPhishingURL struct { - LookbackPeriod string `json:"lookbackPeriod"` - State *DataTypeState `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go deleted file mode 100644 index 95ed0316af1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectordatatypesmicrosoftemergingthreatfeed.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorDataTypesMicrosoftEmergingThreatFeed struct { - LookbackPeriod string `json:"lookbackPeriod"` - State *DataTypeState `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectorproperties.go deleted file mode 100644 index 6c3df2d05af..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mstidataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MSTIDataConnectorProperties struct { - DataTypes MSTIDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnector.go deleted file mode 100644 index 080b901963a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MTPDataConnector{} - -type MTPDataConnector struct { - Properties *MTPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MTPDataConnector{} - -func (s MTPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MTPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MTPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MTPDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MTPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go deleted file mode 100644 index 942617f157f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MTPDataConnectorDataTypes struct { - Incidents DataConnectorDataTypeCommon `json:"incidents"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectorproperties.go deleted file mode 100644 index 9cc41e37181..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_mtpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MTPDataConnectorProperties struct { - DataTypes MTPDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectconnectordatatypes.go deleted file mode 100644 index 198b93c0c02..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Office365ProjectConnectorDataTypes struct { - Logs DataConnectorDataTypeCommon `json:"logs"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnector.go deleted file mode 100644 index 85feb1633f3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = Office365ProjectDataConnector{} - -type Office365ProjectDataConnector struct { - Properties *Office365ProjectDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Office365ProjectDataConnector{} - -func (s Office365ProjectDataConnector) MarshalJSON() ([]byte, error) { - type wrapper Office365ProjectDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Office365ProjectDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Office365ProjectDataConnector: %+v", err) - } - decoded["kind"] = "Office365Project" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Office365ProjectDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnectorproperties.go deleted file mode 100644 index 74cbac6fb47..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_office365projectdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Office365ProjectDataConnectorProperties struct { - DataTypes Office365ProjectConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnector.go deleted file mode 100644 index 40b24a90da2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeATPDataConnector{} - -type OfficeATPDataConnector struct { - Properties *OfficeATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeATPDataConnector{} - -func (s OfficeATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeATPDataConnector: %+v", err) - } - decoded["kind"] = "OfficeATP" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go deleted file mode 100644 index c6e4346b9a8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnector.go deleted file mode 100644 index 25b5a25e44d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeDataConnector{} - -type OfficeDataConnector struct { - Properties *OfficeDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeDataConnector{} - -func (s OfficeDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeDataConnector: %+v", err) - } - decoded["kind"] = "Office365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectordatatypes.go deleted file mode 100644 index c0d05c1618a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectordatatypes.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorDataTypes struct { - Exchange DataConnectorDataTypeCommon `json:"exchange"` - SharePoint DataConnectorDataTypeCommon `json:"sharePoint"` - Teams DataConnectorDataTypeCommon `json:"teams"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectorproperties.go deleted file mode 100644 index a135cc86148..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officedataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorProperties struct { - DataTypes OfficeDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnector.go deleted file mode 100644 index 437b746ebb4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeIRMDataConnector{} - -type OfficeIRMDataConnector struct { - Properties *OfficeIRMDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeIRMDataConnector{} - -func (s OfficeIRMDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeIRMDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeIRMDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeIRMDataConnector: %+v", err) - } - decoded["kind"] = "OfficeIRM" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeIRMDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go deleted file mode 100644 index 65193bbf5f9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officeirmdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeIRMDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbiconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbiconnectordatatypes.go deleted file mode 100644 index 8c412f47eba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbiconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficePowerBIConnectorDataTypes struct { - Logs DataConnectorDataTypeCommon `json:"logs"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnector.go deleted file mode 100644 index 9846e2026f4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficePowerBIDataConnector{} - -type OfficePowerBIDataConnector struct { - Properties *OfficePowerBIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficePowerBIDataConnector{} - -func (s OfficePowerBIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficePowerBIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficePowerBIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficePowerBIDataConnector: %+v", err) - } - decoded["kind"] = "OfficePowerBI" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficePowerBIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnectorproperties.go deleted file mode 100644 index 9d44dd2c674..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_officepowerbidataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficePowerBIDataConnectorProperties struct { - DataTypes OfficePowerBIConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_permissions.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_permissions.go deleted file mode 100644 index 221596eb052..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_permissions.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Permissions struct { - Customs *[]CustomsPermission `json:"customs,omitempty"` - ResourceProvider *[]ResourceProvider `json:"resourceProvider,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_requiredpermissions.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_requiredpermissions.go deleted file mode 100644 index 0bfc2723478..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_requiredpermissions.go +++ /dev/null @@ -1,11 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RequiredPermissions struct { - Action *bool `json:"action,omitempty"` - Delete *bool `json:"delete,omitempty"` - Read *bool `json:"read,omitempty"` - Write *bool `json:"write,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_resourceprovider.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_resourceprovider.go deleted file mode 100644 index b4b18e6a50b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_resourceprovider.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ResourceProvider struct { - PermissionsDisplayText *string `json:"permissionsDisplayText,omitempty"` - Provider *ProviderName `json:"provider,omitempty"` - ProviderDisplayName *string `json:"providerDisplayName,omitempty"` - RequiredPermissions *RequiredPermissions `json:"requiredPermissions,omitempty"` - Scope *PermissionProviderScope `json:"scope,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_samplequeries.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_samplequeries.go deleted file mode 100644 index de648bd4da0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_samplequeries.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SampleQueries struct { - Description *string `json:"description,omitempty"` - Query *string `json:"query,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnector.go deleted file mode 100644 index 208513ef9aa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = TIDataConnector{} - -type TIDataConnector struct { - Properties *TIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = TIDataConnector{} - -func (s TIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper TIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TIDataConnector: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectordatatypes.go deleted file mode 100644 index 0efba3951c0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TIDataConnectorDataTypes struct { - Indicators DataConnectorDataTypeCommon `json:"indicators"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectorproperties.go deleted file mode 100644 index 4676a657b95..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_tidataconnectorproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package dataconnectors - -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 TIDataConnectorProperties struct { - DataTypes TIDataConnectorDataTypes `json:"dataTypes"` - TenantId string `json:"tenantId"` - TipLookbackPeriod *string `json:"tipLookbackPeriod,omitempty"` -} - -func (o *TIDataConnectorProperties) GetTipLookbackPeriodAsTime() (*time.Time, error) { - if o.TipLookbackPeriod == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TipLookbackPeriod, "2006-01-02T15:04:05Z07:00") -} - -func (o *TIDataConnectorProperties) SetTipLookbackPeriodAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TipLookbackPeriod = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnector.go deleted file mode 100644 index 1fa870a4d34..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = TiTaxiiDataConnector{} - -type TiTaxiiDataConnector struct { - Properties *TiTaxiiDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = TiTaxiiDataConnector{} - -func (s TiTaxiiDataConnector) MarshalJSON() ([]byte, error) { - type wrapper TiTaxiiDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TiTaxiiDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TiTaxiiDataConnector: %+v", err) - } - decoded["kind"] = "ThreatIntelligenceTaxii" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TiTaxiiDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go deleted file mode 100644 index dd07879f714..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TiTaxiiDataConnectorDataTypes struct { - TaxiiClient DataConnectorDataTypeCommon `json:"taxiiClient"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go deleted file mode 100644 index 6f39b02fa3e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/model_titaxiidataconnectorproperties.go +++ /dev/null @@ -1,35 +0,0 @@ -package dataconnectors - -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 TiTaxiiDataConnectorProperties struct { - CollectionId *string `json:"collectionId,omitempty"` - DataTypes TiTaxiiDataConnectorDataTypes `json:"dataTypes"` - FriendlyName *string `json:"friendlyName,omitempty"` - Password *string `json:"password,omitempty"` - PollingFrequency PollingFrequency `json:"pollingFrequency"` - TaxiiLookbackPeriod *string `json:"taxiiLookbackPeriod,omitempty"` - TaxiiServer *string `json:"taxiiServer,omitempty"` - TenantId string `json:"tenantId"` - UserName *string `json:"userName,omitempty"` - WorkspaceId *string `json:"workspaceId,omitempty"` -} - -func (o *TiTaxiiDataConnectorProperties) GetTaxiiLookbackPeriodAsTime() (*time.Time, error) { - if o.TaxiiLookbackPeriod == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TaxiiLookbackPeriod, "2006-01-02T15:04:05Z07:00") -} - -func (o *TiTaxiiDataConnectorProperties) SetTaxiiLookbackPeriodAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TaxiiLookbackPeriod = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/predicates.go deleted file mode 100644 index 4521c20e58e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorOperationPredicate struct { -} - -func (p DataConnectorOperationPredicate) Matches(input DataConnector) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/version.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/version.go deleted file mode 100644 index e1c8e6b5eb4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectors/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/README.md b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/README.md deleted file mode 100644 index 0d921293945..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect` Documentation - -The `dataconnectorsconnect` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/dataconnectorsconnect" -``` - - -### Client Initialization - -```go -client := dataconnectorsconnect.NewDataConnectorsConnectClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataConnectorsConnectClient.DataConnectorsConnect` - -```go -ctx := context.TODO() -id := dataconnectorsconnect.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -payload := dataconnectorsconnect.DataConnectorConnectBody{ - // ... -} - - -read, err := client.DataConnectorsConnect(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/securityinsights/2022-07-01-preview/dataconnectorsconnect/client.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/client.go deleted file mode 100644 index f4ed6b1fb50..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectorsconnect - -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 DataConnectorsConnectClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsConnectClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsConnectClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectorsconnect", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsConnectClient: %+v", err) - } - - return &DataConnectorsConnectClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/constants.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/constants.go deleted file mode 100644 index a5b7f1713ca..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/constants.go +++ /dev/null @@ -1,54 +0,0 @@ -package dataconnectorsconnect - -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 ConnectAuthKind string - -const ( - ConnectAuthKindAPIKey ConnectAuthKind = "APIKey" - ConnectAuthKindBasic ConnectAuthKind = "Basic" - ConnectAuthKindOAuthTwo ConnectAuthKind = "OAuth2" -) - -func PossibleValuesForConnectAuthKind() []string { - return []string{ - string(ConnectAuthKindAPIKey), - string(ConnectAuthKindBasic), - string(ConnectAuthKindOAuthTwo), - } -} - -func (s *ConnectAuthKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConnectAuthKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConnectAuthKind(input string) (*ConnectAuthKind, error) { - vals := map[string]ConnectAuthKind{ - "apikey": ConnectAuthKindAPIKey, - "basic": ConnectAuthKindBasic, - "oauth2": ConnectAuthKindOAuthTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConnectAuthKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector.go deleted file mode 100644 index 391c5b0f0a4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectorsconnect - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector_test.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector_test.go deleted file mode 100644 index 8c9e935552b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectorsconnect - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2022-07-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go deleted file mode 100644 index 50018e5b900..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/method_dataconnectorsconnect.go +++ /dev/null @@ -1,51 +0,0 @@ -package dataconnectorsconnect - -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 DataConnectorsConnectOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// DataConnectorsConnect ... -func (c DataConnectorsConnectClient) DataConnectorsConnect(ctx context.Context, id DataConnectorId, input DataConnectorConnectBody) (result DataConnectorsConnectOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/connect", 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/securityinsights/2022-07-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go deleted file mode 100644 index 692f793c38b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/model_dataconnectorconnectbody.go +++ /dev/null @@ -1,18 +0,0 @@ -package dataconnectorsconnect - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorConnectBody struct { - ApiKey *string `json:"apiKey,omitempty"` - AuthorizationCode *string `json:"authorizationCode,omitempty"` - ClientId *string `json:"clientId,omitempty"` - ClientSecret *string `json:"clientSecret,omitempty"` - DataCollectionEndpoint *string `json:"dataCollectionEndpoint,omitempty"` - DataCollectionRuleImmutableId *string `json:"dataCollectionRuleImmutableId,omitempty"` - Kind *ConnectAuthKind `json:"kind,omitempty"` - OutputStream *string `json:"outputStream,omitempty"` - Password *string `json:"password,omitempty"` - RequestConfigUserInputValues *[]interface{} `json:"requestConfigUserInputValues,omitempty"` - UserName *string `json:"userName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/version.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/version.go deleted file mode 100644 index 5f48f31b91f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsconnect/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectorsconnect - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectorsconnect/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/client.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/client.go deleted file mode 100644 index 57ec64abb3c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectorsdisconnect - -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 DataConnectorsDisconnectClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsDisconnectClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsDisconnectClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectorsdisconnect", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsDisconnectClient: %+v", err) - } - - return &DataConnectorsDisconnectClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector.go deleted file mode 100644 index 90646640e53..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectorsdisconnect - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go deleted file mode 100644 index 5db0a89adeb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectorsdisconnect - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go deleted file mode 100644 index 2a883a2c958..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/method_dataconnectorsdisconnect.go +++ /dev/null @@ -1,47 +0,0 @@ -package dataconnectorsdisconnect - -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 DataConnectorsDisconnectOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// DataConnectorsDisconnect ... -func (c DataConnectorsDisconnectClient) DataConnectorsDisconnect(ctx context.Context, id DataConnectorId) (result DataConnectorsDisconnectOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/disconnect", 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/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/version.go b/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/version.go deleted file mode 100644 index a2d01d3782e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/dataconnectorsdisconnect/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectorsdisconnect - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectorsdisconnect/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/README.md b/resource-manager/securityinsights/2022-07-01-preview/enrichment/README.md deleted file mode 100644 index 95118d67e3b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/enrichment` Documentation - -The `enrichment` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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-helpers/resourcemanager/commonids" -import "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/enrichment" -``` - - -### Client Initialization - -```go -client := enrichment.NewEnrichmentClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EnrichmentClient.DomainWhoisGet` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.DomainWhoisGet(ctx, id, enrichment.DefaultDomainWhoisGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EnrichmentClient.IPGeodataGet` - -```go -ctx := context.TODO() -id := commonids.NewResourceGroupID("12345678-1234-9876-4563-123456789012", "example-resource-group") - -read, err := client.IPGeodataGet(ctx, id, enrichment.DefaultIPGeodataGetOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/client.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/client.go deleted file mode 100644 index f60a3bef882..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package enrichment - -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 EnrichmentClient struct { - Client *resourcemanager.Client -} - -func NewEnrichmentClientWithBaseURI(sdkApi sdkEnv.Api) (*EnrichmentClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "enrichment", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EnrichmentClient: %+v", err) - } - - return &EnrichmentClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/method_domainwhoisget.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/method_domainwhoisget.go deleted file mode 100644 index 8cc4521e221..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/method_domainwhoisget.go +++ /dev/null @@ -1,84 +0,0 @@ -package enrichment - -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 DomainWhoisGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EnrichmentDomainWhois -} - -type DomainWhoisGetOperationOptions struct { - Domain *string -} - -func DefaultDomainWhoisGetOperationOptions() DomainWhoisGetOperationOptions { - return DomainWhoisGetOperationOptions{} -} - -func (o DomainWhoisGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o DomainWhoisGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o DomainWhoisGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Domain != nil { - out.Append("domain", fmt.Sprintf("%v", *o.Domain)) - } - return &out -} - -// DomainWhoisGet ... -func (c EnrichmentClient) DomainWhoisGet(ctx context.Context, id commonids.ResourceGroupId, options DomainWhoisGetOperationOptions) (result DomainWhoisGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/enrichment/domain/whois", id.ID()), - OptionsObject: options, - } - - 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 EnrichmentDomainWhois - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/method_ipgeodataget.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/method_ipgeodataget.go deleted file mode 100644 index 52d80129385..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/method_ipgeodataget.go +++ /dev/null @@ -1,84 +0,0 @@ -package enrichment - -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 IPGeodataGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EnrichmentIPGeodata -} - -type IPGeodataGetOperationOptions struct { - IPAddress *string -} - -func DefaultIPGeodataGetOperationOptions() IPGeodataGetOperationOptions { - return IPGeodataGetOperationOptions{} -} - -func (o IPGeodataGetOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IPGeodataGetOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IPGeodataGetOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.IPAddress != nil { - out.Append("ipAddress", fmt.Sprintf("%v", *o.IPAddress)) - } - return &out -} - -// IPGeodataGet ... -func (c EnrichmentClient) IPGeodataGet(ctx context.Context, id commonids.ResourceGroupId, options IPGeodataGetOperationOptions) (result IPGeodataGetOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/enrichment/ip/geodata", id.ID()), - OptionsObject: options, - } - - 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 EnrichmentIPGeodata - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhois.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhois.go deleted file mode 100644 index b5e57fcd1bb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhois.go +++ /dev/null @@ -1,55 +0,0 @@ -package enrichment - -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 EnrichmentDomainWhois struct { - Created *string `json:"created,omitempty"` - Domain *string `json:"domain,omitempty"` - Expires *string `json:"expires,omitempty"` - ParsedWhois *EnrichmentDomainWhoisDetails `json:"parsedWhois,omitempty"` - Server *string `json:"server,omitempty"` - Updated *string `json:"updated,omitempty"` -} - -func (o *EnrichmentDomainWhois) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *EnrichmentDomainWhois) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *EnrichmentDomainWhois) GetExpiresAsTime() (*time.Time, error) { - if o.Expires == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Expires, "2006-01-02T15:04:05Z07:00") -} - -func (o *EnrichmentDomainWhois) SetExpiresAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Expires = &formatted -} - -func (o *EnrichmentDomainWhois) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *EnrichmentDomainWhois) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go deleted file mode 100644 index a1fe6efda9c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontact.go +++ /dev/null @@ -1,17 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisContact struct { - City *string `json:"city,omitempty"` - Country *string `json:"country,omitempty"` - Email *string `json:"email,omitempty"` - Fax *string `json:"fax,omitempty"` - Name *string `json:"name,omitempty"` - Org *string `json:"org,omitempty"` - Phone *string `json:"phone,omitempty"` - Postal *string `json:"postal,omitempty"` - State *string `json:"state,omitempty"` - Street *[]string `json:"street,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go deleted file mode 100644 index 9825906696c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoiscontacts.go +++ /dev/null @@ -1,11 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisContacts struct { - Admin *EnrichmentDomainWhoisContact `json:"admin,omitempty"` - Billing *EnrichmentDomainWhoisContact `json:"billing,omitempty"` - Registrant *EnrichmentDomainWhoisContact `json:"registrant,omitempty"` - Tech *EnrichmentDomainWhoisContact `json:"tech,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go deleted file mode 100644 index e9125217c09..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisdetails.go +++ /dev/null @@ -1,11 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisDetails struct { - Contacts *EnrichmentDomainWhoisContacts `json:"contacts,omitempty"` - NameServers *[]string `json:"nameServers,omitempty"` - Registrar *EnrichmentDomainWhoisRegistrarDetails `json:"registrar,omitempty"` - Statuses *[]string `json:"statuses,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go deleted file mode 100644 index 43273bd44c2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentdomainwhoisregistrardetails.go +++ /dev/null @@ -1,13 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentDomainWhoisRegistrarDetails struct { - AbuseContactEmail *string `json:"abuseContactEmail,omitempty"` - AbuseContactPhone *string `json:"abuseContactPhone,omitempty"` - IanaId *string `json:"ianaId,omitempty"` - Name *string `json:"name,omitempty"` - Url *string `json:"url,omitempty"` - WhoisServer *string `json:"whoisServer,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentipgeodata.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentipgeodata.go deleted file mode 100644 index 38f645e8a46..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/model_enrichmentipgeodata.go +++ /dev/null @@ -1,24 +0,0 @@ -package enrichment - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EnrichmentIPGeodata struct { - Asn *string `json:"asn,omitempty"` - Carrier *string `json:"carrier,omitempty"` - City *string `json:"city,omitempty"` - CityCf *int64 `json:"cityCf,omitempty"` - Continent *string `json:"continent,omitempty"` - Country *string `json:"country,omitempty"` - CountryCf *int64 `json:"countryCf,omitempty"` - IPAddr *string `json:"ipAddr,omitempty"` - IPRoutingType *string `json:"ipRoutingType,omitempty"` - Latitude *string `json:"latitude,omitempty"` - Longitude *string `json:"longitude,omitempty"` - Organization *string `json:"organization,omitempty"` - OrganizationType *string `json:"organizationType,omitempty"` - Region *string `json:"region,omitempty"` - State *string `json:"state,omitempty"` - StateCf *int64 `json:"stateCf,omitempty"` - StateCode *string `json:"stateCode,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/enrichment/version.go b/resource-manager/securityinsights/2022-07-01-preview/enrichment/version.go deleted file mode 100644 index ec18dd86dd8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/enrichment/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package enrichment - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/enrichment/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/README.md b/resource-manager/securityinsights/2022-07-01-preview/entities/README.md deleted file mode 100644 index f90e7ab17a5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/README.md +++ /dev/null @@ -1,132 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entities` Documentation - -The `entities` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/entities" -``` - - -### Client Initialization - -```go -client := entities.NewEntitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EntitiesClient.Expand` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -payload := entities.EntityExpandParameters{ - // ... -} - - -read, err := client.Expand(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntitiesClient.Get` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -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: `EntitiesClient.GetInsights` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -payload := entities.EntityGetInsightsParameters{ - // ... -} - - -read, err := client.GetInsights(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntitiesClient.GetTimelinelist` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -payload := entities.EntityTimelineParameters{ - // ... -} - - -read, err := client.GetTimelinelist(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntitiesClient.List` - -```go -ctx := context.TODO() -id := entities.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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: `EntitiesClient.Queries` - -```go -ctx := context.TODO() -id := entities.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -read, err := client.Queries(ctx, id, entities.DefaultQueriesOperationOptions()) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/client.go b/resource-manager/securityinsights/2022-07-01-preview/entities/client.go deleted file mode 100644 index 69f26c8d7e5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entities - -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 EntitiesClient struct { - Client *resourcemanager.Client -} - -func NewEntitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntitiesClient: %+v", err) - } - - return &EntitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/constants.go b/resource-manager/securityinsights/2022-07-01-preview/entities/constants.go deleted file mode 100644 index 40b7dae6f30..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/constants.go +++ /dev/null @@ -1,473 +0,0 @@ -package entities - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type EntityItemQueryKind string - -const ( - EntityItemQueryKindInsight EntityItemQueryKind = "Insight" -) - -func PossibleValuesForEntityItemQueryKind() []string { - return []string{ - string(EntityItemQueryKindInsight), - } -} - -func (s *EntityItemQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityItemQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityItemQueryKind(input string) (*EntityItemQueryKind, error) { - vals := map[string]EntityItemQueryKind{ - "insight": EntityItemQueryKindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityItemQueryKind(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindNic EntityKind = "Nic" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindNic), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "nic": EntityKindNic, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type EntityQueryKind string - -const ( - EntityQueryKindActivity EntityQueryKind = "Activity" - EntityQueryKindExpansion EntityQueryKind = "Expansion" - EntityQueryKindInsight EntityQueryKind = "Insight" -) - -func PossibleValuesForEntityQueryKind() []string { - return []string{ - string(EntityQueryKindActivity), - string(EntityQueryKindExpansion), - string(EntityQueryKindInsight), - } -} - -func (s *EntityQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityQueryKind(input string) (*EntityQueryKind, error) { - vals := map[string]EntityQueryKind{ - "activity": EntityQueryKindActivity, - "expansion": EntityQueryKindExpansion, - "insight": EntityQueryKindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityQueryKind(input) - return &out, nil -} - -type EntityTimelineKind string - -const ( - EntityTimelineKindActivity EntityTimelineKind = "Activity" - EntityTimelineKindAnomaly EntityTimelineKind = "Anomaly" - EntityTimelineKindBookmark EntityTimelineKind = "Bookmark" - EntityTimelineKindSecurityAlert EntityTimelineKind = "SecurityAlert" -) - -func PossibleValuesForEntityTimelineKind() []string { - return []string{ - string(EntityTimelineKindActivity), - string(EntityTimelineKindAnomaly), - string(EntityTimelineKindBookmark), - string(EntityTimelineKindSecurityAlert), - } -} - -func (s *EntityTimelineKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityTimelineKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityTimelineKind(input string) (*EntityTimelineKind, error) { - vals := map[string]EntityTimelineKind{ - "activity": EntityTimelineKindActivity, - "anomaly": EntityTimelineKindAnomaly, - "bookmark": EntityTimelineKindBookmark, - "securityalert": EntityTimelineKindSecurityAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityTimelineKind(input) - return &out, nil -} - -type EntityType string - -const ( - EntityTypeAccount EntityType = "Account" - EntityTypeAzureResource EntityType = "AzureResource" - EntityTypeCloudApplication EntityType = "CloudApplication" - EntityTypeDNS EntityType = "DNS" - EntityTypeFile EntityType = "File" - EntityTypeFileHash EntityType = "FileHash" - EntityTypeHost EntityType = "Host" - EntityTypeHuntingBookmark EntityType = "HuntingBookmark" - EntityTypeIP EntityType = "IP" - EntityTypeIoTDevice EntityType = "IoTDevice" - EntityTypeMailCluster EntityType = "MailCluster" - EntityTypeMailMessage EntityType = "MailMessage" - EntityTypeMailbox EntityType = "Mailbox" - EntityTypeMalware EntityType = "Malware" - EntityTypeNic EntityType = "Nic" - EntityTypeProcess EntityType = "Process" - EntityTypeRegistryKey EntityType = "RegistryKey" - EntityTypeRegistryValue EntityType = "RegistryValue" - EntityTypeSecurityAlert EntityType = "SecurityAlert" - EntityTypeSecurityGroup EntityType = "SecurityGroup" - EntityTypeSubmissionMail EntityType = "SubmissionMail" - EntityTypeURL EntityType = "URL" -) - -func PossibleValuesForEntityType() []string { - return []string{ - string(EntityTypeAccount), - string(EntityTypeAzureResource), - string(EntityTypeCloudApplication), - string(EntityTypeDNS), - string(EntityTypeFile), - string(EntityTypeFileHash), - string(EntityTypeHost), - string(EntityTypeHuntingBookmark), - string(EntityTypeIP), - string(EntityTypeIoTDevice), - string(EntityTypeMailCluster), - string(EntityTypeMailMessage), - string(EntityTypeMailbox), - string(EntityTypeMalware), - string(EntityTypeNic), - string(EntityTypeProcess), - string(EntityTypeRegistryKey), - string(EntityTypeRegistryValue), - string(EntityTypeSecurityAlert), - string(EntityTypeSecurityGroup), - string(EntityTypeSubmissionMail), - string(EntityTypeURL), - } -} - -func (s *EntityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityType(input string) (*EntityType, error) { - vals := map[string]EntityType{ - "account": EntityTypeAccount, - "azureresource": EntityTypeAzureResource, - "cloudapplication": EntityTypeCloudApplication, - "dns": EntityTypeDNS, - "file": EntityTypeFile, - "filehash": EntityTypeFileHash, - "host": EntityTypeHost, - "huntingbookmark": EntityTypeHuntingBookmark, - "ip": EntityTypeIP, - "iotdevice": EntityTypeIoTDevice, - "mailcluster": EntityTypeMailCluster, - "mailmessage": EntityTypeMailMessage, - "mailbox": EntityTypeMailbox, - "malware": EntityTypeMalware, - "nic": EntityTypeNic, - "process": EntityTypeProcess, - "registrykey": EntityTypeRegistryKey, - "registryvalue": EntityTypeRegistryValue, - "securityalert": EntityTypeSecurityAlert, - "securitygroup": EntityTypeSecurityGroup, - "submissionmail": EntityTypeSubmissionMail, - "url": EntityTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityType(input) - return &out, nil -} - -type GetInsightsError string - -const ( - GetInsightsErrorInsight GetInsightsError = "Insight" -) - -func PossibleValuesForGetInsightsError() []string { - return []string{ - string(GetInsightsErrorInsight), - } -} - -func (s *GetInsightsError) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseGetInsightsError(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseGetInsightsError(input string) (*GetInsightsError, error) { - vals := map[string]GetInsightsError{ - "insight": GetInsightsErrorInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := GetInsightsError(input) - return &out, nil -} - -type OutputType string - -const ( - OutputTypeDate OutputType = "Date" - OutputTypeEntity OutputType = "Entity" - OutputTypeNumber OutputType = "Number" - OutputTypeString OutputType = "String" -) - -func PossibleValuesForOutputType() []string { - return []string{ - string(OutputTypeDate), - string(OutputTypeEntity), - string(OutputTypeNumber), - string(OutputTypeString), - } -} - -func (s *OutputType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOutputType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOutputType(input string) (*OutputType, error) { - vals := map[string]OutputType{ - "date": OutputTypeDate, - "entity": OutputTypeEntity, - "number": OutputTypeNumber, - "string": OutputTypeString, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OutputType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/id_entity.go b/resource-manager/securityinsights/2022-07-01-preview/entities/id_entity.go deleted file mode 100644 index 37774558d12..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/id_entity.go +++ /dev/null @@ -1,141 +0,0 @@ -package entities - -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(&EntityId{}) -} - -var _ resourceids.ResourceId = &EntityId{} - -// EntityId is a struct representing the Resource ID for a Entity -type EntityId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityId string -} - -// NewEntityID returns a new EntityId struct -func NewEntityID(subscriptionId string, resourceGroupName string, workspaceName string, entityId string) EntityId { - return EntityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityId: entityId, - } -} - -// ParseEntityID parses 'input' into a EntityId -func ParseEntityID(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityIDInsensitively parses 'input' case-insensitively into a EntityId -// note: this method should only be used for API response data and not user input -func ParseEntityIDInsensitively(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityId, ok = input.Parsed["entityId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityId", input) - } - - return nil -} - -// ValidateEntityID checks that 'input' can be parsed as a Entity ID -func ValidateEntityID(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 := ParseEntityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity ID -func (id EntityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity ID -func (id EntityId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntities", "entities", "entities"), - resourceids.UserSpecifiedSegment("entityId", "entityIdValue"), - } -} - -// String returns a human-readable description of this Entity ID -func (id EntityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity: %q", id.EntityId), - } - return fmt.Sprintf("Entity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/id_entity_test.go b/resource-manager/securityinsights/2022-07-01-preview/entities/id_entity_test.go deleted file mode 100644 index 3b6dfb0ab90..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/id_entity_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entities - -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 = &EntityId{} - -func TestNewEntityID(t *testing.T) { - id := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityId != "entityIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityId'", id.EntityId, "entityIdValue") - } -} - -func TestFormatEntityID(t *testing.T) { - actual := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestParseEntityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityId: "eNtItYiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestSegmentsForEntityId(t *testing.T) { - segments := EntityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityId 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/securityinsights/2022-07-01-preview/entities/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace.go deleted file mode 100644 index 14cfb6f0408..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package entities - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace_test.go deleted file mode 100644 index f965f501da9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package entities - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/entities/method_expand.go b/resource-manager/securityinsights/2022-07-01-preview/entities/method_expand.go deleted file mode 100644 index b9244ea2dea..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/method_expand.go +++ /dev/null @@ -1,59 +0,0 @@ -package entities - -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 ExpandOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityExpandResponse -} - -// Expand ... -func (c EntitiesClient) Expand(ctx context.Context, id EntityId, input EntityExpandParameters) (result ExpandOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/expand", 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 EntityExpandResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/entities/method_get.go deleted file mode 100644 index 85c2b0055fe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package entities - -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 *Entity -} - -// Get ... -func (c EntitiesClient) Get(ctx context.Context, id EntityId) (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 Entity - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/method_getinsights.go b/resource-manager/securityinsights/2022-07-01-preview/entities/method_getinsights.go deleted file mode 100644 index f61b67c98e7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/method_getinsights.go +++ /dev/null @@ -1,59 +0,0 @@ -package entities - -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 GetInsightsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityGetInsightsResponse -} - -// GetInsights ... -func (c EntitiesClient) GetInsights(ctx context.Context, id EntityId, input EntityGetInsightsParameters) (result GetInsightsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getInsights", 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 EntityGetInsightsResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/method_gettimelinelist.go b/resource-manager/securityinsights/2022-07-01-preview/entities/method_gettimelinelist.go deleted file mode 100644 index 0a51b72c68f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/method_gettimelinelist.go +++ /dev/null @@ -1,59 +0,0 @@ -package entities - -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 GetTimelinelistOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityTimelineResponse -} - -// GetTimelinelist ... -func (c EntitiesClient) GetTimelinelist(ctx context.Context, id EntityId, input EntityTimelineParameters) (result GetTimelinelistOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/getTimeline", 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 EntityTimelineResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/entities/method_list.go deleted file mode 100644 index 7bd410bbfb5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package entities - -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 *[]Entity -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Entity -} - -// List ... -func (c EntitiesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/entities", 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 *[]Entity `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 EntitiesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, EntityOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntitiesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate EntityOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Entity, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/entities/method_queries.go b/resource-manager/securityinsights/2022-07-01-preview/entities/method_queries.go deleted file mode 100644 index 05be3ea7aa2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/method_queries.go +++ /dev/null @@ -1,83 +0,0 @@ -package entities - -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 QueriesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *GetQueriesResponse -} - -type QueriesOperationOptions struct { - Kind *EntityItemQueryKind -} - -func DefaultQueriesOperationOptions() QueriesOperationOptions { - return QueriesOperationOptions{} -} - -func (o QueriesOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o QueriesOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o QueriesOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Kind != nil { - out.Append("kind", fmt.Sprintf("%v", *o.Kind)) - } - return &out -} - -// Queries ... -func (c EntitiesClient) Queries(ctx context.Context, id EntityId, options QueriesOperationOptions) (result QueriesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/queries", id.ID()), - OptionsObject: options, - } - - 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 GetQueriesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_activitytimelineitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_activitytimelineitem.go deleted file mode 100644 index da589276f6d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_activitytimelineitem.go +++ /dev/null @@ -1,47 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = ActivityTimelineItem{} - -type ActivityTimelineItem struct { - BucketEndTimeUTC string `json:"bucketEndTimeUTC"` - BucketStartTimeUTC string `json:"bucketStartTimeUTC"` - Content string `json:"content"` - FirstActivityTimeUTC string `json:"firstActivityTimeUTC"` - LastActivityTimeUTC string `json:"lastActivityTimeUTC"` - QueryId string `json:"queryId"` - Title string `json:"title"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = ActivityTimelineItem{} - -func (s ActivityTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper ActivityTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityTimelineItem: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_anomalytimelineitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_anomalytimelineitem.go deleted file mode 100644 index ccc03779948..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_anomalytimelineitem.go +++ /dev/null @@ -1,51 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = AnomalyTimelineItem{} - -type AnomalyTimelineItem struct { - AzureResourceId string `json:"azureResourceId"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - EndTimeUtc string `json:"endTimeUtc"` - Intent *string `json:"intent,omitempty"` - ProductName *string `json:"productName,omitempty"` - Reasons *[]string `json:"reasons,omitempty"` - StartTimeUtc string `json:"startTimeUtc"` - Techniques *[]string `json:"techniques,omitempty"` - TimeGenerated string `json:"timeGenerated"` - Vendor *string `json:"vendor,omitempty"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = AnomalyTimelineItem{} - -func (s AnomalyTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper AnomalyTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AnomalyTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AnomalyTimelineItem: %+v", err) - } - decoded["kind"] = "Anomaly" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AnomalyTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_bookmarktimelineitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_bookmarktimelineitem.go deleted file mode 100644 index 5aad9bf124f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_bookmarktimelineitem.go +++ /dev/null @@ -1,48 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = BookmarkTimelineItem{} - -type BookmarkTimelineItem struct { - AzureResourceId string `json:"azureResourceId"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - EventTime *string `json:"eventTime,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = BookmarkTimelineItem{} - -func (s BookmarkTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper BookmarkTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling BookmarkTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling BookmarkTimelineItem: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling BookmarkTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entity.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entity.go deleted file mode 100644 index 414ade6a61f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entity.go +++ /dev/null @@ -1,16 +0,0 @@ -package entities - -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 Entity struct { - Id *string `json:"id,omitempty"` - Kind EntityKind `json:"kind"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityedges.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityedges.go deleted file mode 100644 index 352d2d65d38..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityedges.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityEdges struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - TargetEntityId *string `json:"targetEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandparameters.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandparameters.go deleted file mode 100644 index e4932ca91a5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandparameters.go +++ /dev/null @@ -1,40 +0,0 @@ -package entities - -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 EntityExpandParameters struct { - EndTime *string `json:"endTime,omitempty"` - ExpansionId *string `json:"expansionId,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *EntityExpandParameters) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityExpandParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *EntityExpandParameters) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityExpandParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponse.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponse.go deleted file mode 100644 index 7e962ed1be3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityExpandResponse struct { - MetaData *ExpansionResultsMetadata `json:"metaData,omitempty"` - Value *EntityExpandResponseValue `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponsevalue.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponsevalue.go deleted file mode 100644 index 7d2a9e3d68a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityexpandresponsevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityExpandResponseValue struct { - Edges *[]EntityEdges `json:"edges,omitempty"` - Entities *[]Entity `json:"entities,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsparameters.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsparameters.go deleted file mode 100644 index 7eaf2014482..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsparameters.go +++ /dev/null @@ -1,35 +0,0 @@ -package entities - -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 EntityGetInsightsParameters struct { - AddDefaultExtendedTimeRange *bool `json:"addDefaultExtendedTimeRange,omitempty"` - EndTime string `json:"endTime"` - InsightQueryIds *[]string `json:"insightQueryIds,omitempty"` - StartTime string `json:"startTime"` -} - -func (o *EntityGetInsightsParameters) GetEndTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityGetInsightsParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = formatted -} - -func (o *EntityGetInsightsParameters) GetStartTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityGetInsightsParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsresponse.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsresponse.go deleted file mode 100644 index cbe1fbcf313..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitygetinsightsresponse.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityGetInsightsResponse struct { - MetaData *GetInsightsResultsMetadata `json:"metaData,omitempty"` - Value *[]EntityInsightItem `json:"value,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitem.go deleted file mode 100644 index 335e610ca64..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitem.go +++ /dev/null @@ -1,11 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityInsightItem struct { - ChartQueryResults *[]InsightsTableResult `json:"chartQueryResults,omitempty"` - QueryId *string `json:"queryId,omitempty"` - QueryTimeInterval *EntityInsightItemQueryTimeInterval `json:"queryTimeInterval,omitempty"` - TableQueryResults *InsightsTableResult `json:"tableQueryResults,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitemquerytimeinterval.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitemquerytimeinterval.go deleted file mode 100644 index 0e5d3b9312c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityinsightitemquerytimeinterval.go +++ /dev/null @@ -1,39 +0,0 @@ -package entities - -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 EntityInsightItemQueryTimeInterval struct { - EndTime *string `json:"endTime,omitempty"` - StartTime *string `json:"startTime,omitempty"` -} - -func (o *EntityInsightItemQueryTimeInterval) GetEndTimeAsTime() (*time.Time, error) { - if o.EndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityInsightItemQueryTimeInterval) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = &formatted -} - -func (o *EntityInsightItemQueryTimeInterval) GetStartTimeAsTime() (*time.Time, error) { - if o.StartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityInsightItemQueryTimeInterval) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitem.go deleted file mode 100644 index c9b67487365..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitem.go +++ /dev/null @@ -1,53 +0,0 @@ -package entities - -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 EntityQueryItem interface { -} - -// RawEntityQueryItemImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityQueryItemImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityQueryItemImplementation(input []byte) (EntityQueryItem, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityQueryItem into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Insight") { - var out InsightQueryItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into InsightQueryItem: %+v", err) - } - return out, nil - } - - out := RawEntityQueryItemImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go deleted file mode 100644 index e8d72b9fc48..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entityqueryitempropertiesdatatypesinlined.go +++ /dev/null @@ -1,8 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityQueryItemPropertiesDataTypesInlined struct { - DataType *string `json:"dataType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineitem.go deleted file mode 100644 index ce1cd5ac2cc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineitem.go +++ /dev/null @@ -1,77 +0,0 @@ -package entities - -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 EntityTimelineItem interface { -} - -// RawEntityTimelineItemImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityTimelineItemImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityTimelineItemImplementation(input []byte) (EntityTimelineItem, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityTimelineItem into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityTimelineItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Anomaly") { - var out AnomalyTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AnomalyTimelineItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out BookmarkTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into BookmarkTimelineItem: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlertTimelineItem - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlertTimelineItem: %+v", err) - } - return out, nil - } - - out := RawEntityTimelineItemImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineparameters.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineparameters.go deleted file mode 100644 index 7a6015c49fa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineparameters.go +++ /dev/null @@ -1,35 +0,0 @@ -package entities - -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 EntityTimelineParameters struct { - EndTime string `json:"endTime"` - Kinds *[]EntityTimelineKind `json:"kinds,omitempty"` - NumberOfBucket *int64 `json:"numberOfBucket,omitempty"` - StartTime string `json:"startTime"` -} - -func (o *EntityTimelineParameters) GetEndTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.EndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityTimelineParameters) SetEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTime = formatted -} - -func (o *EntityTimelineParameters) GetStartTimeAsTime() (*time.Time, error) { - return dates.ParseAsFormat(&o.StartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *EntityTimelineParameters) SetStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTime = formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineresponse.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineresponse.go deleted file mode 100644 index 87dd76dbc06..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_entitytimelineresponse.go +++ /dev/null @@ -1,49 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityTimelineResponse struct { - MetaData *TimelineResultsMetadata `json:"metaData,omitempty"` - Value *[]EntityTimelineItem `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &EntityTimelineResponse{} - -func (s *EntityTimelineResponse) UnmarshalJSON(bytes []byte) error { - type alias EntityTimelineResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into EntityTimelineResponse: %+v", err) - } - - s.MetaData = decoded.MetaData - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling EntityTimelineResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]EntityTimelineItem, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityTimelineItemImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'EntityTimelineResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultaggregation.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultaggregation.go deleted file mode 100644 index 2c9c4346e5e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultaggregation.go +++ /dev/null @@ -1,11 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultAggregation struct { - AggregationType *string `json:"aggregationType,omitempty"` - Count int64 `json:"count"` - DisplayName *string `json:"displayName,omitempty"` - EntityKind EntityKind `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultsmetadata.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultsmetadata.go deleted file mode 100644 index 46a2a47421f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_expansionresultsmetadata.go +++ /dev/null @@ -1,8 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionResultsMetadata struct { - Aggregations *[]ExpansionResultAggregation `json:"aggregations,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightserrorkind.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightserrorkind.go deleted file mode 100644 index 1fa98c87f81..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightserrorkind.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetInsightsErrorKind struct { - ErrorMessage string `json:"errorMessage"` - Kind GetInsightsError `json:"kind"` - QueryId *string `json:"queryId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightsresultsmetadata.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightsresultsmetadata.go deleted file mode 100644 index 0a310e166e7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_getinsightsresultsmetadata.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetInsightsResultsMetadata struct { - Errors *[]GetInsightsErrorKind `json:"errors,omitempty"` - TotalCount int64 `json:"totalCount"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_getqueriesresponse.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_getqueriesresponse.go deleted file mode 100644 index 7e420fdfade..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_getqueriesresponse.go +++ /dev/null @@ -1,41 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GetQueriesResponse struct { - Value *[]EntityQueryItem `json:"value,omitempty"` -} - -var _ json.Unmarshaler = &GetQueriesResponse{} - -func (s *GetQueriesResponse) UnmarshalJSON(bytes []byte) error { - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling GetQueriesResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]EntityQueryItem, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityQueryItemImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'GetQueriesResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Value = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitem.go deleted file mode 100644 index 6581578a204..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitem.go +++ /dev/null @@ -1,44 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityQueryItem = InsightQueryItem{} - -type InsightQueryItem struct { - Properties *InsightQueryItemProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQueryItem - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = InsightQueryItem{} - -func (s InsightQueryItem) MarshalJSON() ([]byte, error) { - type wrapper InsightQueryItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling InsightQueryItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling InsightQueryItem: %+v", err) - } - decoded["kind"] = "Insight" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling InsightQueryItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitemproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitemproperties.go deleted file mode 100644 index f8c1d4407cf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitemproperties.go +++ /dev/null @@ -1,19 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemProperties struct { - AdditionalQuery *InsightQueryItemPropertiesAdditionalQuery `json:"additionalQuery,omitempty"` - BaseQuery *string `json:"baseQuery,omitempty"` - ChartQuery *interface{} `json:"chartQuery,omitempty"` - DataTypes *[]EntityQueryItemPropertiesDataTypesInlined `json:"dataTypes,omitempty"` - DefaultTimeRange *InsightQueryItemPropertiesDefaultTimeRange `json:"defaultTimeRange,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EntitiesFilter *interface{} `json:"entitiesFilter,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - ReferenceTimeRange *InsightQueryItemPropertiesReferenceTimeRange `json:"referenceTimeRange,omitempty"` - RequiredInputFieldsSets *[][]string `json:"requiredInputFieldsSets,omitempty"` - TableQuery *InsightQueryItemPropertiesTableQuery `json:"tableQuery,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go deleted file mode 100644 index 3807f0674bf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesadditionalquery.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesAdditionalQuery struct { - Query *string `json:"query,omitempty"` - Text *string `json:"text,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go deleted file mode 100644 index ab5f16df664..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesdefaulttimerange.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesDefaultTimeRange struct { - AfterRange *string `json:"afterRange,omitempty"` - BeforeRange *string `json:"beforeRange,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go deleted file mode 100644 index 2ebb97841cb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiesreferencetimerange.go +++ /dev/null @@ -1,8 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesReferenceTimeRange struct { - BeforeRange *string `json:"beforeRange,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequery.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequery.go deleted file mode 100644 index a2c572b6952..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequery.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQuery struct { - ColumnsDefinitions *[]InsightQueryItemPropertiesTableQueryColumnsDefinitionsInlined `json:"columnsDefinitions,omitempty"` - QueriesDefinitions *[]InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlined `json:"queriesDefinitions,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go deleted file mode 100644 index 2d2e7397c50..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequerycolumnsdefinitionsinlined.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQueryColumnsDefinitionsInlined struct { - Header *string `json:"header,omitempty"` - OutputType *OutputType `json:"outputType,omitempty"` - SupportDeepLink *bool `json:"supportDeepLink,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go deleted file mode 100644 index bb5a4b04a4a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlined.go +++ /dev/null @@ -1,11 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlined struct { - Filter *string `json:"filter,omitempty"` - LinkColumnsDefinitions *[]InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlinedLinkColumnsDefinitionsInlined `json:"linkColumnsDefinitions,omitempty"` - Project *string `json:"project,omitempty"` - Summarize *string `json:"summarize,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go deleted file mode 100644 index 6b77d6cc83d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightqueryitempropertiestablequeryqueriesdefinitionsinlinedlinkcolumnsdefinitionsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightQueryItemPropertiesTableQueryQueriesDefinitionsInlinedLinkColumnsDefinitionsInlined struct { - ProjectedName *string `json:"projectedName,omitempty"` - Query *string `json:"Query,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresult.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresult.go deleted file mode 100644 index b0bea744d26..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresult.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightsTableResult struct { - Columns *[]InsightsTableResultColumnsInlined `json:"columns,omitempty"` - Rows *[][]string `json:"rows,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresultcolumnsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresultcolumnsinlined.go deleted file mode 100644 index 23bb093cb51..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_insightstableresultcolumnsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type InsightsTableResultColumnsInlined struct { - Name *string `json:"name,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_securityalerttimelineitem.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_securityalerttimelineitem.go deleted file mode 100644 index d0527f8c426..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_securityalerttimelineitem.go +++ /dev/null @@ -1,49 +0,0 @@ -package entities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ EntityTimelineItem = SecurityAlertTimelineItem{} - -type SecurityAlertTimelineItem struct { - AlertType string `json:"alertType"` - AzureResourceId string `json:"azureResourceId"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - EndTimeUtc string `json:"endTimeUtc"` - ProductName *string `json:"productName,omitempty"` - Severity AlertSeverity `json:"severity"` - StartTimeUtc string `json:"startTimeUtc"` - TimeGenerated string `json:"timeGenerated"` - - // Fields inherited from EntityTimelineItem -} - -var _ json.Marshaler = SecurityAlertTimelineItem{} - -func (s SecurityAlertTimelineItem) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlertTimelineItem - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlertTimelineItem: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlertTimelineItem: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlertTimelineItem: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineaggregation.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineaggregation.go deleted file mode 100644 index 4e2bd7c7eb5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineaggregation.go +++ /dev/null @@ -1,9 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimelineAggregation struct { - Count int64 `json:"count"` - Kind EntityTimelineKind `json:"kind"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineerror.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineerror.go deleted file mode 100644 index f14775c61f5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineerror.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimelineError struct { - ErrorMessage string `json:"errorMessage"` - Kind EntityTimelineKind `json:"kind"` - QueryId *string `json:"queryId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineresultsmetadata.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineresultsmetadata.go deleted file mode 100644 index 1810858daff..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_timelineresultsmetadata.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TimelineResultsMetadata struct { - Aggregations []TimelineAggregation `json:"aggregations"` - Errors *[]TimelineError `json:"errors,omitempty"` - TotalCount int64 `json:"totalCount"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/entities/model_userinfo.go deleted file mode 100644 index 9e648dc68e6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entities/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/entities/predicates.go deleted file mode 100644 index f0f983c5e68..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package entities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p EntityOperationPredicate) Matches(input Entity) 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/securityinsights/2022-07-01-preview/entities/version.go b/resource-manager/securityinsights/2022-07-01-preview/entities/version.go deleted file mode 100644 index 32c9bbfde9c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entities/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/README.md b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/README.md deleted file mode 100644 index 6a4b1c220f1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/README.md +++ /dev/null @@ -1,123 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entityqueries` Documentation - -The `entityqueries` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/entityqueries" -``` - - -### Client Initialization - -```go -client := entityqueries.NewEntityQueriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EntityQueriesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - -payload := entityqueries.CustomEntityQuery{ - // ... -} - - -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: `EntityQueriesClient.Delete` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - -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: `EntityQueriesClient.EntityQueryTemplatesGet` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryTemplateIdValue") - -read, err := client.EntityQueryTemplatesGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `EntityQueriesClient.EntityQueryTemplatesList` - -```go -ctx := context.TODO() -id := entityqueries.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.EntityQueryTemplatesList(ctx, id, entityqueries.DefaultEntityQueryTemplatesListOperationOptions())` can be used to do batched pagination -items, err := client.EntityQueryTemplatesListComplete(ctx, id, entityqueries.DefaultEntityQueryTemplatesListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `EntityQueriesClient.Get` - -```go -ctx := context.TODO() -id := entityqueries.NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - -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: `EntityQueriesClient.List` - -```go -ctx := context.TODO() -id := entityqueries.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, entityqueries.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, entityqueries.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/client.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/client.go deleted file mode 100644 index 4a7620bff39..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entityqueries - -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 EntityQueriesClient struct { - Client *resourcemanager.Client -} - -func NewEntityQueriesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityQueriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entityqueries", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityQueriesClient: %+v", err) - } - - return &EntityQueriesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/constants.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/constants.go deleted file mode 100644 index 9693ed3f519..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/constants.go +++ /dev/null @@ -1,272 +0,0 @@ -package entityqueries - -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 CustomEntityQueryKind string - -const ( - CustomEntityQueryKindActivity CustomEntityQueryKind = "Activity" -) - -func PossibleValuesForCustomEntityQueryKind() []string { - return []string{ - string(CustomEntityQueryKindActivity), - } -} - -func (s *CustomEntityQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCustomEntityQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCustomEntityQueryKind(input string) (*CustomEntityQueryKind, error) { - vals := map[string]CustomEntityQueryKind{ - "activity": CustomEntityQueryKindActivity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CustomEntityQueryKind(input) - return &out, nil -} - -type EntityQueryKind string - -const ( - EntityQueryKindActivity EntityQueryKind = "Activity" - EntityQueryKindExpansion EntityQueryKind = "Expansion" - EntityQueryKindInsight EntityQueryKind = "Insight" -) - -func PossibleValuesForEntityQueryKind() []string { - return []string{ - string(EntityQueryKindActivity), - string(EntityQueryKindExpansion), - string(EntityQueryKindInsight), - } -} - -func (s *EntityQueryKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityQueryKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityQueryKind(input string) (*EntityQueryKind, error) { - vals := map[string]EntityQueryKind{ - "activity": EntityQueryKindActivity, - "expansion": EntityQueryKindExpansion, - "insight": EntityQueryKindInsight, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityQueryKind(input) - return &out, nil -} - -type EntityQueryTemplateKind string - -const ( - EntityQueryTemplateKindActivity EntityQueryTemplateKind = "Activity" -) - -func PossibleValuesForEntityQueryTemplateKind() []string { - return []string{ - string(EntityQueryTemplateKindActivity), - } -} - -func (s *EntityQueryTemplateKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityQueryTemplateKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityQueryTemplateKind(input string) (*EntityQueryTemplateKind, error) { - vals := map[string]EntityQueryTemplateKind{ - "activity": EntityQueryTemplateKindActivity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityQueryTemplateKind(input) - return &out, nil -} - -type EntityType string - -const ( - EntityTypeAccount EntityType = "Account" - EntityTypeAzureResource EntityType = "AzureResource" - EntityTypeCloudApplication EntityType = "CloudApplication" - EntityTypeDNS EntityType = "DNS" - EntityTypeFile EntityType = "File" - EntityTypeFileHash EntityType = "FileHash" - EntityTypeHost EntityType = "Host" - EntityTypeHuntingBookmark EntityType = "HuntingBookmark" - EntityTypeIP EntityType = "IP" - EntityTypeIoTDevice EntityType = "IoTDevice" - EntityTypeMailCluster EntityType = "MailCluster" - EntityTypeMailMessage EntityType = "MailMessage" - EntityTypeMailbox EntityType = "Mailbox" - EntityTypeMalware EntityType = "Malware" - EntityTypeNic EntityType = "Nic" - EntityTypeProcess EntityType = "Process" - EntityTypeRegistryKey EntityType = "RegistryKey" - EntityTypeRegistryValue EntityType = "RegistryValue" - EntityTypeSecurityAlert EntityType = "SecurityAlert" - EntityTypeSecurityGroup EntityType = "SecurityGroup" - EntityTypeSubmissionMail EntityType = "SubmissionMail" - EntityTypeURL EntityType = "URL" -) - -func PossibleValuesForEntityType() []string { - return []string{ - string(EntityTypeAccount), - string(EntityTypeAzureResource), - string(EntityTypeCloudApplication), - string(EntityTypeDNS), - string(EntityTypeFile), - string(EntityTypeFileHash), - string(EntityTypeHost), - string(EntityTypeHuntingBookmark), - string(EntityTypeIP), - string(EntityTypeIoTDevice), - string(EntityTypeMailCluster), - string(EntityTypeMailMessage), - string(EntityTypeMailbox), - string(EntityTypeMalware), - string(EntityTypeNic), - string(EntityTypeProcess), - string(EntityTypeRegistryKey), - string(EntityTypeRegistryValue), - string(EntityTypeSecurityAlert), - string(EntityTypeSecurityGroup), - string(EntityTypeSubmissionMail), - string(EntityTypeURL), - } -} - -func (s *EntityType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityType(input string) (*EntityType, error) { - vals := map[string]EntityType{ - "account": EntityTypeAccount, - "azureresource": EntityTypeAzureResource, - "cloudapplication": EntityTypeCloudApplication, - "dns": EntityTypeDNS, - "file": EntityTypeFile, - "filehash": EntityTypeFileHash, - "host": EntityTypeHost, - "huntingbookmark": EntityTypeHuntingBookmark, - "ip": EntityTypeIP, - "iotdevice": EntityTypeIoTDevice, - "mailcluster": EntityTypeMailCluster, - "mailmessage": EntityTypeMailMessage, - "mailbox": EntityTypeMailbox, - "malware": EntityTypeMalware, - "nic": EntityTypeNic, - "process": EntityTypeProcess, - "registrykey": EntityTypeRegistryKey, - "registryvalue": EntityTypeRegistryValue, - "securityalert": EntityTypeSecurityAlert, - "securitygroup": EntityTypeSecurityGroup, - "submissionmail": EntityTypeSubmissionMail, - "url": EntityTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityType(input) - return &out, nil -} - -type Kind string - -const ( - KindActivity Kind = "Activity" - KindExpansion Kind = "Expansion" -) - -func PossibleValuesForKind() []string { - return []string{ - string(KindActivity), - string(KindExpansion), - } -} - -func (s *Kind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKind(input string) (*Kind, error) { - vals := map[string]Kind{ - "activity": KindActivity, - "expansion": KindExpansion, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Kind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery.go deleted file mode 100644 index f3b1d80e716..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery.go +++ /dev/null @@ -1,141 +0,0 @@ -package entityqueries - -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(&EntityQueryId{}) -} - -var _ resourceids.ResourceId = &EntityQueryId{} - -// EntityQueryId is a struct representing the Resource ID for a Entity Query -type EntityQueryId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityQueryId string -} - -// NewEntityQueryID returns a new EntityQueryId struct -func NewEntityQueryID(subscriptionId string, resourceGroupName string, workspaceName string, entityQueryId string) EntityQueryId { - return EntityQueryId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityQueryId: entityQueryId, - } -} - -// ParseEntityQueryID parses 'input' into a EntityQueryId -func ParseEntityQueryID(input string) (*EntityQueryId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityQueryIDInsensitively parses 'input' case-insensitively into a EntityQueryId -// note: this method should only be used for API response data and not user input -func ParseEntityQueryIDInsensitively(input string) (*EntityQueryId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityQueryId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityQueryId, ok = input.Parsed["entityQueryId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityQueryId", input) - } - - return nil -} - -// ValidateEntityQueryID checks that 'input' can be parsed as a Entity Query ID -func ValidateEntityQueryID(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 := ParseEntityQueryID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity Query ID -func (id EntityQueryId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entityQueries/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityQueryId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity Query ID -func (id EntityQueryId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntityQueries", "entityQueries", "entityQueries"), - resourceids.UserSpecifiedSegment("entityQueryId", "entityQueryIdValue"), - } -} - -// String returns a human-readable description of this Entity Query ID -func (id EntityQueryId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity Query: %q", id.EntityQueryId), - } - return fmt.Sprintf("Entity Query (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery_test.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery_test.go deleted file mode 100644 index 110672c8c13..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquery_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entityqueries - -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 = &EntityQueryId{} - -func TestNewEntityQueryID(t *testing.T) { - id := NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityQueryId != "entityQueryIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityQueryId'", id.EntityQueryId, "entityQueryIdValue") - } -} - -func TestFormatEntityQueryID(t *testing.T) { - actual := NewEntityQueryID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityQueryID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue", - Expected: &EntityQueryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryId: "entityQueryIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryId != v.Expected.EntityQueryId { - t.Fatalf("Expected %q but got %q for EntityQueryId", v.Expected.EntityQueryId, actual.EntityQueryId) - } - - } -} - -func TestParseEntityQueryIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRiEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue", - Expected: &EntityQueryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryId: "entityQueryIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueries/entityQueryIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRiEs/eNtItYqUeRyIdVaLuE", - Expected: &EntityQueryId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityQueryId: "eNtItYqUeRyIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRiEs/eNtItYqUeRyIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryId != v.Expected.EntityQueryId { - t.Fatalf("Expected %q but got %q for EntityQueryId", v.Expected.EntityQueryId, actual.EntityQueryId) - } - - } -} - -func TestSegmentsForEntityQueryId(t *testing.T) { - segments := EntityQueryId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityQueryId 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/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate.go deleted file mode 100644 index cdc4a09121e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate.go +++ /dev/null @@ -1,141 +0,0 @@ -package entityqueries - -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(&EntityQueryTemplateId{}) -} - -var _ resourceids.ResourceId = &EntityQueryTemplateId{} - -// EntityQueryTemplateId is a struct representing the Resource ID for a Entity Query Template -type EntityQueryTemplateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityQueryTemplateId string -} - -// NewEntityQueryTemplateID returns a new EntityQueryTemplateId struct -func NewEntityQueryTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, entityQueryTemplateId string) EntityQueryTemplateId { - return EntityQueryTemplateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityQueryTemplateId: entityQueryTemplateId, - } -} - -// ParseEntityQueryTemplateID parses 'input' into a EntityQueryTemplateId -func ParseEntityQueryTemplateID(input string) (*EntityQueryTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryTemplateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityQueryTemplateIDInsensitively parses 'input' case-insensitively into a EntityQueryTemplateId -// note: this method should only be used for API response data and not user input -func ParseEntityQueryTemplateIDInsensitively(input string) (*EntityQueryTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityQueryTemplateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityQueryTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityQueryTemplateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityQueryTemplateId, ok = input.Parsed["entityQueryTemplateId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityQueryTemplateId", input) - } - - return nil -} - -// ValidateEntityQueryTemplateID checks that 'input' can be parsed as a Entity Query Template ID -func ValidateEntityQueryTemplateID(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 := ParseEntityQueryTemplateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity Query Template ID -func (id EntityQueryTemplateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entityQueryTemplates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityQueryTemplateId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity Query Template ID -func (id EntityQueryTemplateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntityQueryTemplates", "entityQueryTemplates", "entityQueryTemplates"), - resourceids.UserSpecifiedSegment("entityQueryTemplateId", "entityQueryTemplateIdValue"), - } -} - -// String returns a human-readable description of this Entity Query Template ID -func (id EntityQueryTemplateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity Query Template: %q", id.EntityQueryTemplateId), - } - return fmt.Sprintf("Entity Query Template (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate_test.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate_test.go deleted file mode 100644 index 6878fc08b76..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_entityquerytemplate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entityqueries - -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 = &EntityQueryTemplateId{} - -func TestNewEntityQueryTemplateID(t *testing.T) { - id := NewEntityQueryTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryTemplateIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityQueryTemplateId != "entityQueryTemplateIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityQueryTemplateId'", id.EntityQueryTemplateId, "entityQueryTemplateIdValue") - } -} - -func TestFormatEntityQueryTemplateID(t *testing.T) { - actual := NewEntityQueryTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityQueryTemplateIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityQueryTemplateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue", - Expected: &EntityQueryTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryTemplateId: "entityQueryTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryTemplateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryTemplateId != v.Expected.EntityQueryTemplateId { - t.Fatalf("Expected %q but got %q for EntityQueryTemplateId", v.Expected.EntityQueryTemplateId, actual.EntityQueryTemplateId) - } - - } -} - -func TestParseEntityQueryTemplateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityQueryTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRyTeMpLaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue", - Expected: &EntityQueryTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityQueryTemplateId: "entityQueryTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entityQueryTemplates/entityQueryTemplateIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRyTeMpLaTeS/eNtItYqUeRyTeMpLaTeIdVaLuE", - Expected: &EntityQueryTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityQueryTemplateId: "eNtItYqUeRyTeMpLaTeIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItYqUeRyTeMpLaTeS/eNtItYqUeRyTeMpLaTeIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityQueryTemplateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityQueryTemplateId != v.Expected.EntityQueryTemplateId { - t.Fatalf("Expected %q but got %q for EntityQueryTemplateId", v.Expected.EntityQueryTemplateId, actual.EntityQueryTemplateId) - } - - } -} - -func TestSegmentsForEntityQueryTemplateId(t *testing.T) { - segments := EntityQueryTemplateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityQueryTemplateId 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/securityinsights/2022-07-01-preview/entityqueries/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace.go deleted file mode 100644 index ff2d84cb927..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package entityqueries - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace_test.go deleted file mode 100644 index 7529ef8f9d8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package entityqueries - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/entityqueries/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_createorupdate.go deleted file mode 100644 index b9ecc82c257..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 *EntityQuery -} - -// CreateOrUpdate ... -func (c EntityQueriesClient) CreateOrUpdate(ctx context.Context, id EntityQueryId, input CustomEntityQuery) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalEntityQueryImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_delete.go deleted file mode 100644 index b413ad04691..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package entityqueries - -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 EntityQueriesClient) Delete(ctx context.Context, id EntityQueryId) (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/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplatesget.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplatesget.go deleted file mode 100644 index 2e55614c8f0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplatesget.go +++ /dev/null @@ -1,58 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 EntityQueryTemplatesGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *EntityQueryTemplate -} - -// EntityQueryTemplatesGet ... -func (c EntityQueriesClient) EntityQueryTemplatesGet(ctx context.Context, id EntityQueryTemplateId) (result EntityQueryTemplatesGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalEntityQueryTemplateImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplateslist.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplateslist.go deleted file mode 100644 index 80a1a6ce617..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_entityquerytemplateslist.go +++ /dev/null @@ -1,131 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 EntityQueryTemplatesListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]EntityQueryTemplate -} - -type EntityQueryTemplatesListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EntityQueryTemplate -} - -type EntityQueryTemplatesListOperationOptions struct { - Kind *Kind -} - -func DefaultEntityQueryTemplatesListOperationOptions() EntityQueryTemplatesListOperationOptions { - return EntityQueryTemplatesListOperationOptions{} -} - -func (o EntityQueryTemplatesListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o EntityQueryTemplatesListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o EntityQueryTemplatesListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Kind != nil { - out.Append("kind", fmt.Sprintf("%v", *o.Kind)) - } - return &out -} - -// EntityQueryTemplatesList ... -func (c EntityQueriesClient) EntityQueryTemplatesList(ctx context.Context, id WorkspaceId, options EntityQueryTemplatesListOperationOptions) (result EntityQueryTemplatesListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/entityQueryTemplates", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]EntityQueryTemplate, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalEntityQueryTemplateImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for EntityQueryTemplate (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// EntityQueryTemplatesListComplete retrieves all the results into a single object -func (c EntityQueriesClient) EntityQueryTemplatesListComplete(ctx context.Context, id WorkspaceId, options EntityQueryTemplatesListOperationOptions) (EntityQueryTemplatesListCompleteResult, error) { - return c.EntityQueryTemplatesListCompleteMatchingPredicate(ctx, id, options, EntityQueryTemplateOperationPredicate{}) -} - -// EntityQueryTemplatesListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntityQueriesClient) EntityQueryTemplatesListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options EntityQueryTemplatesListOperationOptions, predicate EntityQueryTemplateOperationPredicate) (result EntityQueryTemplatesListCompleteResult, err error) { - items := make([]EntityQueryTemplate, 0) - - resp, err := c.EntityQueryTemplatesList(ctx, id, options) - if err != nil { - 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 = EntityQueryTemplatesListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_get.go deleted file mode 100644 index 4a7022fa713..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 *EntityQuery -} - -// Get ... -func (c EntityQueriesClient) Get(ctx context.Context, id EntityQueryId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalEntityQueryImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_list.go deleted file mode 100644 index 5cf5f6c7631..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/method_list.go +++ /dev/null @@ -1,131 +0,0 @@ -package entityqueries - -import ( - "context" - "encoding/json" - "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 *[]EntityQuery -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []EntityQuery -} - -type ListOperationOptions struct { - Kind *Kind -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Kind != nil { - out.Append("kind", fmt.Sprintf("%v", *o.Kind)) - } - return &out -} - -// List ... -func (c EntityQueriesClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/entityQueries", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]EntityQuery, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalEntityQueryImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for EntityQuery (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c EntityQueriesClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, EntityQueryOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntityQueriesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate EntityQueryOperationPredicate) (result ListCompleteResult, err error) { - items := make([]EntityQuery, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-07-01-preview/entityqueries/model_activitycustomentityquery.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activitycustomentityquery.go deleted file mode 100644 index 0cfe2c18623..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activitycustomentityquery.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ CustomEntityQuery = ActivityCustomEntityQuery{} - -type ActivityCustomEntityQuery struct { - Properties *ActivityEntityQueriesProperties `json:"properties,omitempty"` - - // Fields inherited from CustomEntityQuery - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ActivityCustomEntityQuery{} - -func (s ActivityCustomEntityQuery) MarshalJSON() ([]byte, error) { - type wrapper ActivityCustomEntityQuery - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityCustomEntityQuery: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityCustomEntityQuery: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityCustomEntityQuery: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriesproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriesproperties.go deleted file mode 100644 index 828bc04066b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriesproperties.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -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 ActivityEntityQueriesProperties struct { - Content *string `json:"content,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - Description *string `json:"description,omitempty"` - Enabled *bool `json:"enabled,omitempty"` - EntitiesFilter *map[string][]string `json:"entitiesFilter,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - QueryDefinitions *ActivityEntityQueriesPropertiesQueryDefinitions `json:"queryDefinitions,omitempty"` - RequiredInputFieldsSets *[][]string `json:"requiredInputFieldsSets,omitempty"` - TemplateName *string `json:"templateName,omitempty"` - Title *string `json:"title,omitempty"` -} - -func (o *ActivityEntityQueriesProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActivityEntityQueriesProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *ActivityEntityQueriesProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ActivityEntityQueriesProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go deleted file mode 100644 index 7eb9592f372..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityqueriespropertiesquerydefinitions.go +++ /dev/null @@ -1,8 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActivityEntityQueriesPropertiesQueryDefinitions struct { - Query *string `json:"query,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquery.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquery.go deleted file mode 100644 index bfdfa3bdbd5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquery.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ EntityQuery = ActivityEntityQuery{} - -type ActivityEntityQuery struct { - Properties *ActivityEntityQueriesProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQuery - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ActivityEntityQuery{} - -func (s ActivityEntityQuery) MarshalJSON() ([]byte, error) { - type wrapper ActivityEntityQuery - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityEntityQuery: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityEntityQuery: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityEntityQuery: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplate.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplate.go deleted file mode 100644 index bdbd16666a9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ EntityQueryTemplate = ActivityEntityQueryTemplate{} - -type ActivityEntityQueryTemplate struct { - Properties *ActivityEntityQueryTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQueryTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ActivityEntityQueryTemplate{} - -func (s ActivityEntityQueryTemplate) MarshalJSON() ([]byte, error) { - type wrapper ActivityEntityQueryTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ActivityEntityQueryTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ActivityEntityQueryTemplate: %+v", err) - } - decoded["kind"] = "Activity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ActivityEntityQueryTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplateproperties.go deleted file mode 100644 index f740e7b4d09..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplateproperties.go +++ /dev/null @@ -1,15 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActivityEntityQueryTemplateProperties struct { - Content *string `json:"content,omitempty"` - DataTypes *[]DataTypeDefinitions `json:"dataTypes,omitempty"` - Description *string `json:"description,omitempty"` - EntitiesFilter *map[string][]string `json:"entitiesFilter,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - QueryDefinitions *ActivityEntityQueryTemplatePropertiesQueryDefinitions `json:"queryDefinitions,omitempty"` - RequiredInputFieldsSets *[][]string `json:"requiredInputFieldsSets,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go deleted file mode 100644 index 8df097f1420..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_activityentityquerytemplatepropertiesquerydefinitions.go +++ /dev/null @@ -1,9 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActivityEntityQueryTemplatePropertiesQueryDefinitions struct { - Query *string `json:"query,omitempty"` - SummarizeBy *string `json:"summarizeBy,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_customentityquery.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_customentityquery.go deleted file mode 100644 index 75460cc6795..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_customentityquery.go +++ /dev/null @@ -1,53 +0,0 @@ -package entityqueries - -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 CustomEntityQuery interface { -} - -// RawCustomEntityQueryImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawCustomEntityQueryImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalCustomEntityQueryImplementation(input []byte) (CustomEntityQuery, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling CustomEntityQuery into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityCustomEntityQuery - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityCustomEntityQuery: %+v", err) - } - return out, nil - } - - out := RawCustomEntityQueryImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_datatypedefinitions.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_datatypedefinitions.go deleted file mode 100644 index cea278763e9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_datatypedefinitions.go +++ /dev/null @@ -1,8 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataTypeDefinitions struct { - DataType *string `json:"dataType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquery.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquery.go deleted file mode 100644 index bfec2a4f7a4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquery.go +++ /dev/null @@ -1,61 +0,0 @@ -package entityqueries - -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 EntityQuery interface { -} - -// RawEntityQueryImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityQueryImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityQueryImplementation(input []byte) (EntityQuery, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityQuery into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityEntityQuery - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityEntityQuery: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Expansion") { - var out ExpansionEntityQuery - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ExpansionEntityQuery: %+v", err) - } - return out, nil - } - - out := RawEntityQueryImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquerytemplate.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquerytemplate.go deleted file mode 100644 index 5734f996be9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_entityquerytemplate.go +++ /dev/null @@ -1,53 +0,0 @@ -package entityqueries - -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 EntityQueryTemplate interface { -} - -// RawEntityQueryTemplateImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityQueryTemplateImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityQueryTemplateImplementation(input []byte) (EntityQueryTemplate, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling EntityQueryTemplate into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Activity") { - var out ActivityEntityQueryTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ActivityEntityQueryTemplate: %+v", err) - } - return out, nil - } - - out := RawEntityQueryTemplateImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityqueriesproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityqueriesproperties.go deleted file mode 100644 index c87cb5c6561..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityqueriesproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ExpansionEntityQueriesProperties struct { - DataSources *[]string `json:"dataSources,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - InputEntityType *EntityType `json:"inputEntityType,omitempty"` - InputFields *[]string `json:"inputFields,omitempty"` - OutputEntityTypes *[]EntityType `json:"outputEntityTypes,omitempty"` - QueryTemplate *string `json:"queryTemplate,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityquery.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityquery.go deleted file mode 100644 index bcc5a7e9b2e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/model_expansionentityquery.go +++ /dev/null @@ -1,48 +0,0 @@ -package entityqueries - -import ( - "encoding/json" - "fmt" - - "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. - -var _ EntityQuery = ExpansionEntityQuery{} - -type ExpansionEntityQuery struct { - Properties *ExpansionEntityQueriesProperties `json:"properties,omitempty"` - - // Fields inherited from EntityQuery - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ExpansionEntityQuery{} - -func (s ExpansionEntityQuery) MarshalJSON() ([]byte, error) { - type wrapper ExpansionEntityQuery - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ExpansionEntityQuery: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ExpansionEntityQuery: %+v", err) - } - decoded["kind"] = "Expansion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ExpansionEntityQuery: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/predicates.go deleted file mode 100644 index 641e052de67..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/predicates.go +++ /dev/null @@ -1,20 +0,0 @@ -package entityqueries - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityQueryOperationPredicate struct { -} - -func (p EntityQueryOperationPredicate) Matches(input EntityQuery) bool { - - return true -} - -type EntityQueryTemplateOperationPredicate struct { -} - -func (p EntityQueryTemplateOperationPredicate) Matches(input EntityQueryTemplate) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/version.go b/resource-manager/securityinsights/2022-07-01-preview/entityqueries/version.go deleted file mode 100644 index fe4b629e1fb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityqueries/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entityqueries - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entityqueries/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/README.md b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/README.md deleted file mode 100644 index f09a0e8f2b5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entityrelations` Documentation - -The `entityrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/entityrelations" -``` - - -### Client Initialization - -```go -client := entityrelations.NewEntityRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `EntityRelationsClient.EntitiesRelationsList` - -```go -ctx := context.TODO() -id := entityrelations.NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - -// alternatively `client.EntitiesRelationsList(ctx, id, entityrelations.DefaultEntitiesRelationsListOperationOptions())` can be used to do batched pagination -items, err := client.EntitiesRelationsListComplete(ctx, id, entityrelations.DefaultEntitiesRelationsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `EntityRelationsClient.GetRelation` - -```go -ctx := context.TODO() -id := entityrelations.NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue", "relationValue") - -read, err := client.GetRelation(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/securityinsights/2022-07-01-preview/entityrelations/client.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/client.go deleted file mode 100644 index 85b6978e574..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entityrelations - -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 EntityRelationsClient struct { - Client *resourcemanager.Client -} - -func NewEntityRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entityrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityRelationsClient: %+v", err) - } - - return &EntityRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity.go deleted file mode 100644 index 0f62b4a66b1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity.go +++ /dev/null @@ -1,141 +0,0 @@ -package entityrelations - -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(&EntityId{}) -} - -var _ resourceids.ResourceId = &EntityId{} - -// EntityId is a struct representing the Resource ID for a Entity -type EntityId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityId string -} - -// NewEntityID returns a new EntityId struct -func NewEntityID(subscriptionId string, resourceGroupName string, workspaceName string, entityId string) EntityId { - return EntityId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityId: entityId, - } -} - -// ParseEntityID parses 'input' into a EntityId -func ParseEntityID(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseEntityIDInsensitively parses 'input' case-insensitively into a EntityId -// note: this method should only be used for API response data and not user input -func ParseEntityIDInsensitively(input string) (*EntityId, error) { - parser := resourceids.NewParserFromResourceIdType(&EntityId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := EntityId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *EntityId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityId, ok = input.Parsed["entityId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityId", input) - } - - return nil -} - -// ValidateEntityID checks that 'input' can be parsed as a Entity ID -func ValidateEntityID(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 := ParseEntityID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Entity ID -func (id EntityId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entities/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Entity ID -func (id EntityId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntities", "entities", "entities"), - resourceids.UserSpecifiedSegment("entityId", "entityIdValue"), - } -} - -// String returns a human-readable description of this Entity ID -func (id EntityId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity: %q", id.EntityId), - } - return fmt.Sprintf("Entity (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity_test.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity_test.go deleted file mode 100644 index 4624e7de4fa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_entity_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package entityrelations - -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 = &EntityId{} - -func TestNewEntityID(t *testing.T) { - id := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityId != "entityIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityId'", id.EntityId, "entityIdValue") - } -} - -func TestFormatEntityID(t *testing.T) { - actual := NewEntityID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseEntityID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestParseEntityIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *EntityId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe", - Expected: &EntityId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityId: "eNtItYiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseEntityIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - } -} - -func TestSegmentsForEntityId(t *testing.T) { - segments := EntityId{}.Segments() - if len(segments) == 0 { - t.Fatalf("EntityId 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/securityinsights/2022-07-01-preview/entityrelations/id_relation.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation.go deleted file mode 100644 index 7c6b140220b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation.go +++ /dev/null @@ -1,150 +0,0 @@ -package entityrelations - -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(&RelationId{}) -} - -var _ resourceids.ResourceId = &RelationId{} - -// RelationId is a struct representing the Resource ID for a Relation -type RelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - EntityId string - RelationName string -} - -// NewRelationID returns a new RelationId struct -func NewRelationID(subscriptionId string, resourceGroupName string, workspaceName string, entityId string, relationName string) RelationId { - return RelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - EntityId: entityId, - RelationName: relationName, - } -} - -// ParseRelationID parses 'input' into a RelationId -func ParseRelationID(input string) (*RelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&RelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRelationIDInsensitively parses 'input' case-insensitively into a RelationId -// note: this method should only be used for API response data and not user input -func ParseRelationIDInsensitively(input string) (*RelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&RelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.EntityId, ok = input.Parsed["entityId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "entityId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateRelationID checks that 'input' can be parsed as a Relation ID -func ValidateRelationID(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 := ParseRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Relation ID -func (id RelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/entities/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.EntityId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Relation ID -func (id RelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticEntities", "entities", "entities"), - resourceids.UserSpecifiedSegment("entityId", "entityIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Relation ID -func (id RelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Entity: %q", id.EntityId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation_test.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation_test.go deleted file mode 100644 index 5d6b424c451..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/id_relation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package entityrelations - -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 = &RelationId{} - -func TestNewRelationID(t *testing.T) { - id := NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.EntityId != "entityIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'EntityId'", id.EntityId, "entityIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatRelationID(t *testing.T) { - actual := NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "entityIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - EntityId: "entityIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/entities/entityIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - EntityId: "eNtItYiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/eNtItIeS/eNtItYiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.EntityId != v.Expected.EntityId { - t.Fatalf("Expected %q but got %q for EntityId", v.Expected.EntityId, actual.EntityId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForRelationId(t *testing.T) { - segments := RelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RelationId 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/securityinsights/2022-07-01-preview/entityrelations/method_entitiesrelationslist.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_entitiesrelationslist.go deleted file mode 100644 index ffe62e84ee3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_entitiesrelationslist.go +++ /dev/null @@ -1,127 +0,0 @@ -package entityrelations - -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 EntitiesRelationsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Relation -} - -type EntitiesRelationsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type EntitiesRelationsListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultEntitiesRelationsListOperationOptions() EntitiesRelationsListOperationOptions { - return EntitiesRelationsListOperationOptions{} -} - -func (o EntitiesRelationsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o EntitiesRelationsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o EntitiesRelationsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// EntitiesRelationsList ... -func (c EntityRelationsClient) EntitiesRelationsList(ctx context.Context, id EntityId, options EntitiesRelationsListOperationOptions) (result EntitiesRelationsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// EntitiesRelationsListComplete retrieves all the results into a single object -func (c EntityRelationsClient) EntitiesRelationsListComplete(ctx context.Context, id EntityId, options EntitiesRelationsListOperationOptions) (EntitiesRelationsListCompleteResult, error) { - return c.EntitiesRelationsListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// EntitiesRelationsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c EntityRelationsClient) EntitiesRelationsListCompleteMatchingPredicate(ctx context.Context, id EntityId, options EntitiesRelationsListOperationOptions, predicate RelationOperationPredicate) (result EntitiesRelationsListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.EntitiesRelationsList(ctx, id, options) - if err != nil { - 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 = EntitiesRelationsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_getrelation.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_getrelation.go deleted file mode 100644 index 21bd52b6efe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/method_getrelation.go +++ /dev/null @@ -1,54 +0,0 @@ -package entityrelations - -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 GetRelationOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Relation -} - -// GetRelation ... -func (c EntityRelationsClient) GetRelation(ctx context.Context, id RelationId) (result GetRelationOperationResponse, 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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relation.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relation.go deleted file mode 100644 index 62a280eeb4c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package entityrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relationproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relationproperties.go deleted file mode 100644 index 1feb7ca28e3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entityrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/predicates.go deleted file mode 100644 index 28d0d19df17..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package entityrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2022-07-01-preview/entityrelations/version.go b/resource-manager/securityinsights/2022-07-01-preview/entityrelations/version.go deleted file mode 100644 index 27262a83a4e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entityrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entityrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entityrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/README.md b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/README.md deleted file mode 100644 index bf6dfa83cc6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/README.md +++ /dev/null @@ -1,21 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/entitytypes` Documentation - -The `entitytypes` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/entitytypes" -``` - - -### Client Initialization - -```go -client := entitytypes.NewEntityTypesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/client.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/client.go deleted file mode 100644 index bcdd09e4029..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entitytypes - -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 EntityTypesClient struct { - Client *resourcemanager.Client -} - -func NewEntityTypesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityTypesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entitytypes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityTypesClient: %+v", err) - } - - return &EntityTypesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/constants.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/constants.go deleted file mode 100644 index 83bedfbe6a8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/constants.go +++ /dev/null @@ -1,1030 +0,0 @@ -package entitytypes - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AntispamMailDirection string - -const ( - AntispamMailDirectionInbound AntispamMailDirection = "Inbound" - AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" - AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" - AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" -) - -func PossibleValuesForAntispamMailDirection() []string { - return []string{ - string(AntispamMailDirectionInbound), - string(AntispamMailDirectionIntraorg), - string(AntispamMailDirectionOutbound), - string(AntispamMailDirectionUnknown), - } -} - -func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAntispamMailDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { - vals := map[string]AntispamMailDirection{ - "inbound": AntispamMailDirectionInbound, - "intraorg": AntispamMailDirectionIntraorg, - "outbound": AntispamMailDirectionOutbound, - "unknown": AntispamMailDirectionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AntispamMailDirection(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -func PossibleValuesForCreatedByType() []string { - return []string{ - string(CreatedByTypeApplication), - string(CreatedByTypeKey), - string(CreatedByTypeManagedIdentity), - string(CreatedByTypeUser), - } -} - -func (s *CreatedByType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCreatedByType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCreatedByType(input string) (*CreatedByType, error) { - vals := map[string]CreatedByType{ - "application": CreatedByTypeApplication, - "key": CreatedByTypeKey, - "managedidentity": CreatedByTypeManagedIdentity, - "user": CreatedByTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreatedByType(input) - return &out, nil -} - -type DeliveryAction string - -const ( - DeliveryActionBlocked DeliveryAction = "Blocked" - DeliveryActionDelivered DeliveryAction = "Delivered" - DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" - DeliveryActionReplaced DeliveryAction = "Replaced" - DeliveryActionUnknown DeliveryAction = "Unknown" -) - -func PossibleValuesForDeliveryAction() []string { - return []string{ - string(DeliveryActionBlocked), - string(DeliveryActionDelivered), - string(DeliveryActionDeliveredAsSpam), - string(DeliveryActionReplaced), - string(DeliveryActionUnknown), - } -} - -func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeliveryAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeliveryAction(input string) (*DeliveryAction, error) { - vals := map[string]DeliveryAction{ - "blocked": DeliveryActionBlocked, - "delivered": DeliveryActionDelivered, - "deliveredasspam": DeliveryActionDeliveredAsSpam, - "replaced": DeliveryActionReplaced, - "unknown": DeliveryActionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeliveryAction(input) - return &out, nil -} - -type DeliveryLocation string - -const ( - DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" - DeliveryLocationDropped DeliveryLocation = "Dropped" - DeliveryLocationExternal DeliveryLocation = "External" - DeliveryLocationFailed DeliveryLocation = "Failed" - DeliveryLocationForwarded DeliveryLocation = "Forwarded" - DeliveryLocationInbox DeliveryLocation = "Inbox" - DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" - DeliveryLocationQuarantine DeliveryLocation = "Quarantine" - DeliveryLocationUnknown DeliveryLocation = "Unknown" -) - -func PossibleValuesForDeliveryLocation() []string { - return []string{ - string(DeliveryLocationDeletedFolder), - string(DeliveryLocationDropped), - string(DeliveryLocationExternal), - string(DeliveryLocationFailed), - string(DeliveryLocationForwarded), - string(DeliveryLocationInbox), - string(DeliveryLocationJunkFolder), - string(DeliveryLocationQuarantine), - string(DeliveryLocationUnknown), - } -} - -func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeliveryLocation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeliveryLocation(input string) (*DeliveryLocation, error) { - vals := map[string]DeliveryLocation{ - "deletedfolder": DeliveryLocationDeletedFolder, - "dropped": DeliveryLocationDropped, - "external": DeliveryLocationExternal, - "failed": DeliveryLocationFailed, - "forwarded": DeliveryLocationForwarded, - "inbox": DeliveryLocationInbox, - "junkfolder": DeliveryLocationJunkFolder, - "quarantine": DeliveryLocationQuarantine, - "unknown": DeliveryLocationUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeliveryLocation(input) - return &out, nil -} - -type DeviceImportance string - -const ( - DeviceImportanceHigh DeviceImportance = "High" - DeviceImportanceLow DeviceImportance = "Low" - DeviceImportanceNormal DeviceImportance = "Normal" - DeviceImportanceUnknown DeviceImportance = "Unknown" -) - -func PossibleValuesForDeviceImportance() []string { - return []string{ - string(DeviceImportanceHigh), - string(DeviceImportanceLow), - string(DeviceImportanceNormal), - string(DeviceImportanceUnknown), - } -} - -func (s *DeviceImportance) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeviceImportance(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeviceImportance(input string) (*DeviceImportance, error) { - vals := map[string]DeviceImportance{ - "high": DeviceImportanceHigh, - "low": DeviceImportanceLow, - "normal": DeviceImportanceNormal, - "unknown": DeviceImportanceUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeviceImportance(input) - return &out, nil -} - -type ElevationToken string - -const ( - ElevationTokenDefault ElevationToken = "Default" - ElevationTokenFull ElevationToken = "Full" - ElevationTokenLimited ElevationToken = "Limited" -) - -func PossibleValuesForElevationToken() []string { - return []string{ - string(ElevationTokenDefault), - string(ElevationTokenFull), - string(ElevationTokenLimited), - } -} - -func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseElevationToken(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseElevationToken(input string) (*ElevationToken, error) { - vals := map[string]ElevationToken{ - "default": ElevationTokenDefault, - "full": ElevationTokenFull, - "limited": ElevationTokenLimited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ElevationToken(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindNic EntityKind = "Nic" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindNic), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "nic": EntityKindNic, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type FileHashAlgorithm string - -const ( - FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" - FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" - FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" - FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" - FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" -) - -func PossibleValuesForFileHashAlgorithm() []string { - return []string{ - string(FileHashAlgorithmMDFive), - string(FileHashAlgorithmSHAOne), - string(FileHashAlgorithmSHATwoFiveSix), - string(FileHashAlgorithmSHATwoFiveSixAC), - string(FileHashAlgorithmUnknown), - } -} - -func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFileHashAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { - vals := map[string]FileHashAlgorithm{ - "md5": FileHashAlgorithmMDFive, - "sha1": FileHashAlgorithmSHAOne, - "sha256": FileHashAlgorithmSHATwoFiveSix, - "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, - "unknown": FileHashAlgorithmUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FileHashAlgorithm(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} - -type OSFamily string - -const ( - OSFamilyAndroid OSFamily = "Android" - OSFamilyIOS OSFamily = "IOS" - OSFamilyLinux OSFamily = "Linux" - OSFamilyUnknown OSFamily = "Unknown" - OSFamilyWindows OSFamily = "Windows" -) - -func PossibleValuesForOSFamily() []string { - return []string{ - string(OSFamilyAndroid), - string(OSFamilyIOS), - string(OSFamilyLinux), - string(OSFamilyUnknown), - string(OSFamilyWindows), - } -} - -func (s *OSFamily) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOSFamily(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOSFamily(input string) (*OSFamily, error) { - vals := map[string]OSFamily{ - "android": OSFamilyAndroid, - "ios": OSFamilyIOS, - "linux": OSFamilyLinux, - "unknown": OSFamilyUnknown, - "windows": OSFamilyWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OSFamily(input) - return &out, nil -} - -type RegistryHive string - -const ( - RegistryHiveHKEYA RegistryHive = "HKEY_A" - RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" - RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" - RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" - RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" - RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" - RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" - RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" - RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" - RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" -) - -func PossibleValuesForRegistryHive() []string { - return []string{ - string(RegistryHiveHKEYA), - string(RegistryHiveHKEYCLASSESROOT), - string(RegistryHiveHKEYCURRENTCONFIG), - string(RegistryHiveHKEYCURRENTUSER), - string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), - string(RegistryHiveHKEYLOCALMACHINE), - string(RegistryHiveHKEYPERFORMANCEDATA), - string(RegistryHiveHKEYPERFORMANCENLSTEXT), - string(RegistryHiveHKEYPERFORMANCETEXT), - string(RegistryHiveHKEYUSERS), - } -} - -func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryHive(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryHive(input string) (*RegistryHive, error) { - vals := map[string]RegistryHive{ - "hkey_a": RegistryHiveHKEYA, - "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, - "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, - "hkey_current_user": RegistryHiveHKEYCURRENTUSER, - "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, - "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, - "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, - "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, - "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, - "hkey_users": RegistryHiveHKEYUSERS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryHive(input) - return &out, nil -} - -type RegistryValueKind string - -const ( - RegistryValueKindBinary RegistryValueKind = "Binary" - RegistryValueKindDWord RegistryValueKind = "DWord" - RegistryValueKindExpandString RegistryValueKind = "ExpandString" - RegistryValueKindMultiString RegistryValueKind = "MultiString" - RegistryValueKindNone RegistryValueKind = "None" - RegistryValueKindQWord RegistryValueKind = "QWord" - RegistryValueKindString RegistryValueKind = "String" - RegistryValueKindUnknown RegistryValueKind = "Unknown" -) - -func PossibleValuesForRegistryValueKind() []string { - return []string{ - string(RegistryValueKindBinary), - string(RegistryValueKindDWord), - string(RegistryValueKindExpandString), - string(RegistryValueKindMultiString), - string(RegistryValueKindNone), - string(RegistryValueKindQWord), - string(RegistryValueKindString), - string(RegistryValueKindUnknown), - } -} - -func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryValueKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryValueKind(input string) (*RegistryValueKind, error) { - vals := map[string]RegistryValueKind{ - "binary": RegistryValueKindBinary, - "dword": RegistryValueKindDWord, - "expandstring": RegistryValueKindExpandString, - "multistring": RegistryValueKindMultiString, - "none": RegistryValueKindNone, - "qword": RegistryValueKindQWord, - "string": RegistryValueKindString, - "unknown": RegistryValueKindUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryValueKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentity.go deleted file mode 100644 index 36622cda50b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = AccountEntity{} - -type AccountEntity struct { - Properties *AccountEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AccountEntity{} - -func (s AccountEntity) MarshalJSON() ([]byte, error) { - type wrapper AccountEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) - } - decoded["kind"] = "Account" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentityproperties.go deleted file mode 100644 index 95fb7cc52ad..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_accountentityproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountEntityProperties struct { - AadTenantId *string `json:"aadTenantId,omitempty"` - AadUserId *string `json:"aadUserId,omitempty"` - AccountName *string `json:"accountName,omitempty"` - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - DnsDomain *string `json:"dnsDomain,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - NtDomain *string `json:"ntDomain,omitempty"` - ObjectGuid *string `json:"objectGuid,omitempty"` - Puid *string `json:"puid,omitempty"` - Sid *string `json:"sid,omitempty"` - UpnSuffix *string `json:"upnSuffix,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentity.go deleted file mode 100644 index 6947a9b96e5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = AzureResourceEntity{} - -type AzureResourceEntity struct { - Properties *AzureResourceEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AzureResourceEntity{} - -func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { - type wrapper AzureResourceEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) - } - decoded["kind"] = "AzureResource" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentityproperties.go deleted file mode 100644 index db2fe348b06..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_azureresourceentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureResourceEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentity.go deleted file mode 100644 index 73b7fb5b308..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = CloudApplicationEntity{} - -type CloudApplicationEntity struct { - Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CloudApplicationEntity{} - -func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { - type wrapper CloudApplicationEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) - } - decoded["kind"] = "CloudApplication" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentityproperties.go deleted file mode 100644 index 8b2d40b573f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_cloudapplicationentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CloudApplicationEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AppId *int64 `json:"appId,omitempty"` - AppName *string `json:"appName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentity.go deleted file mode 100644 index 81c3c0dac5b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = DnsEntity{} - -type DnsEntity struct { - Properties *DnsEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DnsEntity{} - -func (s DnsEntity) MarshalJSON() ([]byte, error) { - type wrapper DnsEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) - } - decoded["kind"] = "DnsResolution" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentityproperties.go deleted file mode 100644 index fa580d56344..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_dnsentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` - DomainName *string `json:"domainName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` - IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_entity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_entity.go deleted file mode 100644 index 1af3c4d08f9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_entity.go +++ /dev/null @@ -1,221 +0,0 @@ -package entitytypes - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Account") { - var out AccountEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureResource") { - var out AzureResourceEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "CloudApplication") { - var out CloudApplicationEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "DnsResolution") { - var out DnsEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "File") { - var out FileEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "FileHash") { - var out FileHashEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Host") { - var out HostEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Ip") { - var out IPEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IoTDevice") { - var out IoTDeviceEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MailCluster") { - var out MailClusterEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MailMessage") { - var out MailMessageEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Mailbox") { - var out MailboxEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Malware") { - var out MalwareEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Nic") { - var out NicEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into NicEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Process") { - var out ProcessEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RegistryKey") { - var out RegistryKeyEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RegistryValue") { - var out RegistryValueEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityGroup") { - var out SecurityGroupEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SubmissionMail") { - var out SubmissionMailEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Url") { - var out UrlEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlEntity: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentity.go deleted file mode 100644 index 98411b9b140..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = FileEntity{} - -type FileEntity struct { - Properties *FileEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FileEntity{} - -func (s FileEntity) MarshalJSON() ([]byte, error) { - type wrapper FileEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FileEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) - } - decoded["kind"] = "File" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentityproperties.go deleted file mode 100644 index 257ffb1ba04..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_fileentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FileEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Directory *string `json:"directory,omitempty"` - FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` - FileName *string `json:"fileName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentity.go deleted file mode 100644 index bf05183c64b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = FileHashEntity{} - -type FileHashEntity struct { - Properties *FileHashEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FileHashEntity{} - -func (s FileHashEntity) MarshalJSON() ([]byte, error) { - type wrapper FileHashEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) - } - decoded["kind"] = "FileHash" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentityproperties.go deleted file mode 100644 index d8097218e1d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_filehashentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FileHashEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HashValue *string `json:"hashValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_geolocation.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_geolocation.go deleted file mode 100644 index 53a44e73dcd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_geolocation.go +++ /dev/null @@ -1,14 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GeoLocation struct { - Asn *int64 `json:"asn,omitempty"` - City *string `json:"city,omitempty"` - CountryCode *string `json:"countryCode,omitempty"` - CountryName *string `json:"countryName,omitempty"` - Latitude *float64 `json:"latitude,omitempty"` - Longitude *float64 `json:"longitude,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentity.go deleted file mode 100644 index 90b206a2d15..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = HostEntity{} - -type HostEntity struct { - Properties *HostEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HostEntity{} - -func (s HostEntity) MarshalJSON() ([]byte, error) { - type wrapper HostEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HostEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) - } - decoded["kind"] = "Host" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentityproperties.go deleted file mode 100644 index aeff0d09403..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_hostentityproperties.go +++ /dev/null @@ -1,18 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AzureID *string `json:"azureID,omitempty"` - DnsDomain *string `json:"dnsDomain,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostName *string `json:"hostName,omitempty"` - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - NetBiosName *string `json:"netBiosName,omitempty"` - NtDomain *string `json:"ntDomain,omitempty"` - OmsAgentID *string `json:"omsAgentID,omitempty"` - OsFamily *OSFamily `json:"osFamily,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmark.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmark.go deleted file mode 100644 index e86ba910de6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmark.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmarkproperties.go deleted file mode 100644 index 5ebc3ac122f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package entitytypes - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_incidentinfo.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_incidentinfo.go deleted file mode 100644 index 80d014f5289..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentity.go deleted file mode 100644 index 3828d0cf7d2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = IoTDeviceEntity{} - -type IoTDeviceEntity struct { - Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IoTDeviceEntity{} - -func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { - type wrapper IoTDeviceEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) - } - decoded["kind"] = "IoTDevice" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentityproperties.go deleted file mode 100644 index 4cd3953b37d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_iotdeviceentityproperties.go +++ /dev/null @@ -1,37 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTDeviceEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DeviceId *string `json:"deviceId,omitempty"` - DeviceName *string `json:"deviceName,omitempty"` - DeviceSubType *string `json:"deviceSubType,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - EdgeId *string `json:"edgeId,omitempty"` - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` - Importance *DeviceImportance `json:"importance,omitempty"` - IotHubEntityId *string `json:"iotHubEntityId,omitempty"` - IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` - IsAuthorized *bool `json:"isAuthorized,omitempty"` - IsProgramming *bool `json:"isProgramming,omitempty"` - IsScanner *bool `json:"isScanner,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - Model *string `json:"model,omitempty"` - NicEntityIds *[]string `json:"nicEntityIds,omitempty"` - OperatingSystem *string `json:"operatingSystem,omitempty"` - Owners *[]string `json:"owners,omitempty"` - Protocols *[]string `json:"protocols,omitempty"` - PurdueLayer *string `json:"purdueLayer,omitempty"` - Sensor *string `json:"sensor,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - Site *string `json:"site,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` - Vendor *string `json:"vendor,omitempty"` - Zone *string `json:"zone,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentity.go deleted file mode 100644 index e062bf2295a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = IPEntity{} - -type IPEntity struct { - Properties *IPEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IPEntity{} - -func (s IPEntity) MarshalJSON() ([]byte, error) { - type wrapper IPEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IPEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) - } - decoded["kind"] = "Ip" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentityproperties.go deleted file mode 100644 index b0cf7442a43..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_ipentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Address *string `json:"address,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Location *GeoLocation `json:"location,omitempty"` - ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentity.go deleted file mode 100644 index 57dee77697e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailboxEntity{} - -type MailboxEntity struct { - Properties *MailboxEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailboxEntity{} - -func (s MailboxEntity) MarshalJSON() ([]byte, error) { - type wrapper MailboxEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) - } - decoded["kind"] = "Mailbox" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentityproperties.go deleted file mode 100644 index 8d1b787b9c9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailboxentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MailboxEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` - Upn *string `json:"upn,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentity.go deleted file mode 100644 index afa0db447b6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailClusterEntity{} - -type MailClusterEntity struct { - Properties *MailClusterEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailClusterEntity{} - -func (s MailClusterEntity) MarshalJSON() ([]byte, error) { - type wrapper MailClusterEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) - } - decoded["kind"] = "MailCluster" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentityproperties.go deleted file mode 100644 index 6b6724b72a7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailclusterentityproperties.go +++ /dev/null @@ -1,66 +0,0 @@ -package entitytypes - -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 MailClusterEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - ClusterGroup *string `json:"clusterGroup,omitempty"` - ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` - ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` - ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` - ClusterSourceType *string `json:"clusterSourceType,omitempty"` - CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` - CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` - CountByThreatType *interface{} `json:"countByThreatType,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` - MailCount *int64 `json:"mailCount,omitempty"` - NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` - Query *string `json:"query,omitempty"` - QueryTime *string `json:"queryTime,omitempty"` - Source *string `json:"source,omitempty"` - Threats *[]string `json:"threats,omitempty"` -} - -func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { - if o.ClusterQueryEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ClusterQueryEndTime = &formatted -} - -func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { - if o.ClusterQueryStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ClusterQueryStartTime = &formatted -} - -func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { - if o.QueryTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryTime = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentity.go deleted file mode 100644 index e0fef66bf3b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailMessageEntity{} - -type MailMessageEntity struct { - Properties *MailMessageEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailMessageEntity{} - -func (s MailMessageEntity) MarshalJSON() ([]byte, error) { - type wrapper MailMessageEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) - } - decoded["kind"] = "MailMessage" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentityproperties.go deleted file mode 100644 index 48c4bfe7c77..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_mailmessageentityproperties.go +++ /dev/null @@ -1,52 +0,0 @@ -package entitytypes - -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 MailMessageEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` - BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` - BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` - BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` - BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` - BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` - DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` - DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` - FileEntityIds *[]string `json:"fileEntityIds,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - InternetMessageId *string `json:"internetMessageId,omitempty"` - Language *string `json:"language,omitempty"` - NetworkMessageId *string `json:"networkMessageId,omitempty"` - P1Sender *string `json:"p1Sender,omitempty"` - P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` - P1SenderDomain *string `json:"p1SenderDomain,omitempty"` - P2Sender *string `json:"p2Sender,omitempty"` - P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` - P2SenderDomain *string `json:"p2SenderDomain,omitempty"` - ReceiveDate *string `json:"receiveDate,omitempty"` - Recipient *string `json:"recipient,omitempty"` - SenderIP *string `json:"senderIP,omitempty"` - Subject *string `json:"subject,omitempty"` - ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` - Threats *[]string `json:"threats,omitempty"` - Urls *[]string `json:"urls,omitempty"` -} - -func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { - if o.ReceiveDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ReceiveDate = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentity.go deleted file mode 100644 index 01b3f9cda92..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MalwareEntity{} - -type MalwareEntity struct { - Properties *MalwareEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MalwareEntity{} - -func (s MalwareEntity) MarshalJSON() ([]byte, error) { - type wrapper MalwareEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) - } - decoded["kind"] = "Malware" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentityproperties.go deleted file mode 100644 index 99a3529f02f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_malwareentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MalwareEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Category *string `json:"category,omitempty"` - FileEntityIds *[]string `json:"fileEntityIds,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - MalwareName *string `json:"malwareName,omitempty"` - ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentity.go deleted file mode 100644 index 8dfa514edcb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = NicEntity{} - -type NicEntity struct { - Properties *NicEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = NicEntity{} - -func (s NicEntity) MarshalJSON() ([]byte, error) { - type wrapper NicEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling NicEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling NicEntity: %+v", err) - } - decoded["kind"] = "Nic" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling NicEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentityproperties.go deleted file mode 100644 index 41b9e710031..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_nicentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type NicEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - Vlans *[]string `json:"vlans,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentity.go deleted file mode 100644 index b3d0be74fd8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = ProcessEntity{} - -type ProcessEntity struct { - Properties *ProcessEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ProcessEntity{} - -func (s ProcessEntity) MarshalJSON() ([]byte, error) { - type wrapper ProcessEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) - } - decoded["kind"] = "Process" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentityproperties.go deleted file mode 100644 index 49e9b63fe4a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_processentityproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package entitytypes - -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 ProcessEntityProperties struct { - AccountEntityId *string `json:"accountEntityId,omitempty"` - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - CommandLine *string `json:"commandLine,omitempty"` - CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` - ElevationToken *ElevationToken `json:"elevationToken,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` - ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` - ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` - ProcessId *string `json:"processId,omitempty"` -} - -func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { - if o.CreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentity.go deleted file mode 100644 index bef73eb2c5b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = RegistryKeyEntity{} - -type RegistryKeyEntity struct { - Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = RegistryKeyEntity{} - -func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { - type wrapper RegistryKeyEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) - } - decoded["kind"] = "RegistryKey" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentityproperties.go deleted file mode 100644 index f91f75ea021..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registrykeyentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryKeyEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Hive *RegistryHive `json:"hive,omitempty"` - Key *string `json:"key,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentity.go deleted file mode 100644 index 45599924191..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = RegistryValueEntity{} - -type RegistryValueEntity struct { - Properties *RegistryValueEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = RegistryValueEntity{} - -func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { - type wrapper RegistryValueEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) - } - decoded["kind"] = "RegistryValue" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentityproperties.go deleted file mode 100644 index c368632a1d3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_registryvalueentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryValueEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KeyEntityId *string `json:"keyEntityId,omitempty"` - ValueData *string `json:"valueData,omitempty"` - ValueName *string `json:"valueName,omitempty"` - ValueType *RegistryValueKind `json:"valueType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalert.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalert.go deleted file mode 100644 index cfda2671eec..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalert.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertproperties.go deleted file mode 100644 index 105a41b9daf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package entitytypes - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index 1560939747b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentity.go deleted file mode 100644 index 71a694b6c72..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SecurityGroupEntity{} - -type SecurityGroupEntity struct { - Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityGroupEntity{} - -func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { - type wrapper SecurityGroupEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) - } - decoded["kind"] = "SecurityGroup" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentityproperties.go deleted file mode 100644 index 458b2ccbfb1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_securitygroupentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DistinguishedName *string `json:"distinguishedName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ObjectGuid *string `json:"objectGuid,omitempty"` - Sid *string `json:"sid,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentity.go deleted file mode 100644 index ff1c9193b12..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SubmissionMailEntity{} - -type SubmissionMailEntity struct { - Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SubmissionMailEntity{} - -func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { - type wrapper SubmissionMailEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) - } - decoded["kind"] = "SubmissionMail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentityproperties.go deleted file mode 100644 index f28988a5d5b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_submissionmailentityproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package entitytypes - -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 SubmissionMailEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - NetworkMessageId *string `json:"networkMessageId,omitempty"` - Recipient *string `json:"recipient,omitempty"` - ReportType *string `json:"reportType,omitempty"` - Sender *string `json:"sender,omitempty"` - SenderIP *string `json:"senderIp,omitempty"` - Subject *string `json:"subject,omitempty"` - SubmissionDate *string `json:"submissionDate,omitempty"` - SubmissionId *string `json:"submissionId,omitempty"` - Submitter *string `json:"submitter,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` -} - -func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { - if o.SubmissionDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.SubmissionDate = &formatted -} - -func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_systemdata.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_systemdata.go deleted file mode 100644 index 862ee7fdbaf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_systemdata.go +++ /dev/null @@ -1,43 +0,0 @@ -package entitytypes - -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 SystemData struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *CreatedByType `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` -} - -func (o *SystemData) GetCreatedAtAsTime() (*time.Time, error) { - if o.CreatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *SystemData) SetCreatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedAt = &formatted -} - -func (o *SystemData) GetLastModifiedAtAsTime() (*time.Time, error) { - if o.LastModifiedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *SystemData) SetLastModifiedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedAt = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_threatintelligence.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_threatintelligence.go deleted file mode 100644 index e225a18045c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_threatintelligence.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligence struct { - Confidence *float64 `json:"confidence,omitempty"` - ProviderName *string `json:"providerName,omitempty"` - ReportLink *string `json:"reportLink,omitempty"` - ThreatDescription *string `json:"threatDescription,omitempty"` - ThreatName *string `json:"threatName,omitempty"` - ThreatType *string `json:"threatType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentity.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentity.go deleted file mode 100644 index a6d90352180..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = UrlEntity{} - -type UrlEntity struct { - Properties *UrlEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = UrlEntity{} - -func (s UrlEntity) MarshalJSON() ([]byte, error) { - type wrapper UrlEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling UrlEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlEntity: %+v", err) - } - decoded["kind"] = "Url" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling UrlEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentityproperties.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentityproperties.go deleted file mode 100644 index 2d3b7085055..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_urlentityproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UrlEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_userinfo.go deleted file mode 100644 index 9b6d8135aea..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/version.go b/resource-manager/securityinsights/2022-07-01-preview/entitytypes/version.go deleted file mode 100644 index a2aeeb7c393..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/entitytypes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entitytypes/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/README.md deleted file mode 100644 index 29d7cfe30f4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentalerts` Documentation - -The `incidentalerts` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidentalerts" -``` - - -### Client Initialization - -```go -client := incidentalerts.NewIncidentAlertsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentAlertsClient.IncidentsListAlerts` - -```go -ctx := context.TODO() -id := incidentalerts.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -read, err := client.IncidentsListAlerts(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/securityinsights/2022-07-01-preview/incidentalerts/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/client.go deleted file mode 100644 index 53dc2b4cd4e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentalerts - -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 IncidentAlertsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentAlertsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentAlertsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentalerts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentAlertsClient: %+v", err) - } - - return &IncidentAlertsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/constants.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/constants.go deleted file mode 100644 index 5d286095967..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/constants.go +++ /dev/null @@ -1,509 +0,0 @@ -package incidentalerts - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindNic EntityKind = "Nic" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindNic), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "nic": EntityKindNic, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident.go deleted file mode 100644 index 0ab926f846f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentalerts - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident_test.go deleted file mode 100644 index 0e9696de1f5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentalerts - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidentalerts/method_incidentslistalerts.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/method_incidentslistalerts.go deleted file mode 100644 index a6b61790e56..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/method_incidentslistalerts.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidentalerts - -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 IncidentsListAlertsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentAlertList -} - -// IncidentsListAlerts ... -func (c IncidentAlertsClient) IncidentsListAlerts(ctx context.Context, id IncidentId) (result IncidentsListAlertsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/alerts", 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 IncidentAlertList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_entity.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_entity.go deleted file mode 100644 index 8a6c7ffef8e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidentalerts - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmark.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmark.go deleted file mode 100644 index 827ded08f6d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentalerts - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmarkproperties.go deleted file mode 100644 index f12788659cd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidentalerts - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentalertlist.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentalertlist.go deleted file mode 100644 index 5ce96fd6aa8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentalertlist.go +++ /dev/null @@ -1,8 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentAlertList struct { - Value []SecurityAlert `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentinfo.go deleted file mode 100644 index af30d557ee7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalert.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalert.go deleted file mode 100644 index 3935326a1d2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentalerts - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertproperties.go deleted file mode 100644 index 99d6a0318e9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidentalerts - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index f7b76c4041c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_userinfo.go deleted file mode 100644 index 6093aa77979..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/version.go deleted file mode 100644 index b786696c03b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentalerts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentalerts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentalerts/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/README.md deleted file mode 100644 index cd00fa82bae..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks` Documentation - -The `incidentbookmarks` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidentbookmarks" -``` - - -### Client Initialization - -```go -client := incidentbookmarks.NewIncidentBookmarksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentBookmarksClient.IncidentsListBookmarks` - -```go -ctx := context.TODO() -id := incidentbookmarks.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -read, err := client.IncidentsListBookmarks(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/securityinsights/2022-07-01-preview/incidentbookmarks/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/client.go deleted file mode 100644 index e6a60ede52d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentbookmarks - -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 IncidentBookmarksClient struct { - Client *resourcemanager.Client -} - -func NewIncidentBookmarksClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentBookmarksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentbookmarks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentBookmarksClient: %+v", err) - } - - return &IncidentBookmarksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/constants.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/constants.go deleted file mode 100644 index 1731dc01ffe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/constants.go +++ /dev/null @@ -1,509 +0,0 @@ -package incidentbookmarks - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindNic EntityKind = "Nic" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindNic), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "nic": EntityKindNic, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident.go deleted file mode 100644 index fde40d40514..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentbookmarks - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident_test.go deleted file mode 100644 index 98b398ae7d8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentbookmarks - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidentbookmarks/method_incidentslistbookmarks.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/method_incidentslistbookmarks.go deleted file mode 100644 index ea658d25e66..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/method_incidentslistbookmarks.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidentbookmarks - -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 IncidentsListBookmarksOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentBookmarkList -} - -// IncidentsListBookmarks ... -func (c IncidentBookmarksClient) IncidentsListBookmarks(ctx context.Context, id IncidentId) (result IncidentsListBookmarksOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/bookmarks", 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 IncidentBookmarkList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_entity.go deleted file mode 100644 index ac882c04383..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidentbookmarks - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmark.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmark.go deleted file mode 100644 index 1e9bfbf488f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentbookmarks - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go deleted file mode 100644 index e5e13270882..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidentbookmarks - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentbookmarklist.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentbookmarklist.go deleted file mode 100644 index cfeedfda4ac..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentbookmarklist.go +++ /dev/null @@ -1,8 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentBookmarkList struct { - Value []HuntingBookmark `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentinfo.go deleted file mode 100644 index 0a1b8d71c42..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalert.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalert.go deleted file mode 100644 index a86152f3c69..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentbookmarks - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertproperties.go deleted file mode 100644 index 68387d97736..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidentbookmarks - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index d0dec8bc6c2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_userinfo.go deleted file mode 100644 index b585f0bdd6d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/version.go deleted file mode 100644 index 6b3ee811b34..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentbookmarks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentbookmarks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentbookmarks/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/README.md deleted file mode 100644 index a933cf84a42..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentcomments` Documentation - -The `incidentcomments` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidentcomments" -``` - - -### Client Initialization - -```go -client := incidentcomments.NewIncidentCommentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentCommentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -payload := incidentcomments.IncidentComment{ - // ... -} - - -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: `IncidentCommentsClient.Delete` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -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: `IncidentCommentsClient.Get` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -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: `IncidentCommentsClient.List` - -```go -ctx := context.TODO() -id := incidentcomments.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -// alternatively `client.List(ctx, id, incidentcomments.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidentcomments.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/client.go deleted file mode 100644 index 981e6f75216..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentcomments - -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 IncidentCommentsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentCommentsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentCommentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentcomments", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentCommentsClient: %+v", err) - } - - return &IncidentCommentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment.go deleted file mode 100644 index 1c431622bbe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment.go +++ /dev/null @@ -1,150 +0,0 @@ -package incidentcomments - -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(&CommentId{}) -} - -var _ resourceids.ResourceId = &CommentId{} - -// CommentId is a struct representing the Resource ID for a Comment -type CommentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string - IncidentCommentId string -} - -// NewCommentID returns a new CommentId struct -func NewCommentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string, incidentCommentId string) CommentId { - return CommentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - IncidentCommentId: incidentCommentId, - } -} - -// ParseCommentID parses 'input' into a CommentId -func ParseCommentID(input string) (*CommentId, error) { - parser := resourceids.NewParserFromResourceIdType(&CommentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CommentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCommentIDInsensitively parses 'input' case-insensitively into a CommentId -// note: this method should only be used for API response data and not user input -func ParseCommentIDInsensitively(input string) (*CommentId, error) { - parser := resourceids.NewParserFromResourceIdType(&CommentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CommentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CommentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - if id.IncidentCommentId, ok = input.Parsed["incidentCommentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentCommentId", input) - } - - return nil -} - -// ValidateCommentID checks that 'input' can be parsed as a Comment ID -func ValidateCommentID(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 := ParseCommentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Comment ID -func (id CommentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s/comments/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId, id.IncidentCommentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Comment ID -func (id CommentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - resourceids.StaticSegment("staticComments", "comments", "comments"), - resourceids.UserSpecifiedSegment("incidentCommentId", "incidentCommentIdValue"), - } -} - -// String returns a human-readable description of this Comment ID -func (id CommentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - fmt.Sprintf("Incident Comment: %q", id.IncidentCommentId), - } - return fmt.Sprintf("Comment (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment_test.go deleted file mode 100644 index 5dd784507fa..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_comment_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package incidentcomments - -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 = &CommentId{} - -func TestNewCommentID(t *testing.T) { - id := NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } - - if id.IncidentCommentId != "incidentCommentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentCommentId'", id.IncidentCommentId, "incidentCommentIdValue") - } -} - -func TestFormatCommentID(t *testing.T) { - actual := NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCommentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - IncidentCommentId: "incidentCommentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.IncidentCommentId != v.Expected.IncidentCommentId { - t.Fatalf("Expected %q but got %q for IncidentCommentId", v.Expected.IncidentCommentId, actual.IncidentCommentId) - } - - } -} - -func TestParseCommentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - IncidentCommentId: "incidentCommentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS/iNcIdEnTcOmMeNtIdVaLuE", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - IncidentCommentId: "iNcIdEnTcOmMeNtIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS/iNcIdEnTcOmMeNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.IncidentCommentId != v.Expected.IncidentCommentId { - t.Fatalf("Expected %q but got %q for IncidentCommentId", v.Expected.IncidentCommentId, actual.IncidentCommentId) - } - - } -} - -func TestSegmentsForCommentId(t *testing.T) { - segments := CommentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CommentId 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/securityinsights/2022-07-01-preview/incidentcomments/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident.go deleted file mode 100644 index d2940c0215e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentcomments - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident_test.go deleted file mode 100644 index 22e8430b6a9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentcomments - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidentcomments/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_createorupdate.go deleted file mode 100644 index 6ea7a1ed4dc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentcomments - -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 *IncidentComment -} - -// CreateOrUpdate ... -func (c IncidentCommentsClient) CreateOrUpdate(ctx context.Context, id CommentId, input IncidentComment) (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 IncidentComment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_delete.go deleted file mode 100644 index 78412a13e76..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentcomments - -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 IncidentCommentsClient) Delete(ctx context.Context, id CommentId) (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/securityinsights/2022-07-01-preview/incidentcomments/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_get.go deleted file mode 100644 index 1942042dbea..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidentcomments - -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 *IncidentComment -} - -// Get ... -func (c IncidentCommentsClient) Get(ctx context.Context, id CommentId) (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 IncidentComment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_list.go deleted file mode 100644 index b4c16058b38..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidentcomments - -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 *[]IncidentComment -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IncidentComment -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentCommentsClient) List(ctx context.Context, id IncidentId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/comments", id.ID()), - OptionsObject: options, - } - - 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 *[]IncidentComment `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 IncidentCommentsClient) ListComplete(ctx context.Context, id IncidentId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, IncidentCommentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentCommentsClient) ListCompleteMatchingPredicate(ctx context.Context, id IncidentId, options ListOperationOptions, predicate IncidentCommentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IncidentComment, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-07-01-preview/incidentcomments/model_clientinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_clientinfo.go deleted file mode 100644 index 55cc93b9c5d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_clientinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentcomments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcomment.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcomment.go deleted file mode 100644 index 93ee7dc82f8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcomment.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidentcomments - -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 IncidentComment struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IncidentCommentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcommentproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcommentproperties.go deleted file mode 100644 index 233937ddedc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/model_incidentcommentproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package incidentcomments - -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 IncidentCommentProperties struct { - Author *ClientInfo `json:"author,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Message string `json:"message"` -} - -func (o *IncidentCommentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentCommentProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *IncidentCommentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentCommentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/predicates.go deleted file mode 100644 index 434091dbb53..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidentcomments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentCommentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p IncidentCommentOperationPredicate) Matches(input IncidentComment) 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.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/securityinsights/2022-07-01-preview/incidentcomments/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/version.go deleted file mode 100644 index b4fffe6b4e8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentcomments/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentcomments - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentcomments/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidententities/README.md deleted file mode 100644 index b06679d24cd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidententities` Documentation - -The `incidententities` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidententities" -``` - - -### Client Initialization - -```go -client := incidententities.NewIncidentEntitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentEntitiesClient.IncidentsListEntities` - -```go -ctx := context.TODO() -id := incidententities.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -read, err := client.IncidentsListEntities(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/securityinsights/2022-07-01-preview/incidententities/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/client.go deleted file mode 100644 index 740e7b81755..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidententities - -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 IncidentEntitiesClient struct { - Client *resourcemanager.Client -} - -func NewIncidentEntitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentEntitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidententities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentEntitiesClient: %+v", err) - } - - return &IncidentEntitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/constants.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/constants.go deleted file mode 100644 index 996bca7e8dc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/constants.go +++ /dev/null @@ -1,509 +0,0 @@ -package incidententities - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKind string - -const ( - EntityKindAccount EntityKind = "Account" - EntityKindAzureResource EntityKind = "AzureResource" - EntityKindBookmark EntityKind = "Bookmark" - EntityKindCloudApplication EntityKind = "CloudApplication" - EntityKindDnsResolution EntityKind = "DnsResolution" - EntityKindFile EntityKind = "File" - EntityKindFileHash EntityKind = "FileHash" - EntityKindHost EntityKind = "Host" - EntityKindIP EntityKind = "Ip" - EntityKindIoTDevice EntityKind = "IoTDevice" - EntityKindMailCluster EntityKind = "MailCluster" - EntityKindMailMessage EntityKind = "MailMessage" - EntityKindMailbox EntityKind = "Mailbox" - EntityKindMalware EntityKind = "Malware" - EntityKindNic EntityKind = "Nic" - EntityKindProcess EntityKind = "Process" - EntityKindRegistryKey EntityKind = "RegistryKey" - EntityKindRegistryValue EntityKind = "RegistryValue" - EntityKindSecurityAlert EntityKind = "SecurityAlert" - EntityKindSecurityGroup EntityKind = "SecurityGroup" - EntityKindSubmissionMail EntityKind = "SubmissionMail" - EntityKindUrl EntityKind = "Url" -) - -func PossibleValuesForEntityKind() []string { - return []string{ - string(EntityKindAccount), - string(EntityKindAzureResource), - string(EntityKindBookmark), - string(EntityKindCloudApplication), - string(EntityKindDnsResolution), - string(EntityKindFile), - string(EntityKindFileHash), - string(EntityKindHost), - string(EntityKindIP), - string(EntityKindIoTDevice), - string(EntityKindMailCluster), - string(EntityKindMailMessage), - string(EntityKindMailbox), - string(EntityKindMalware), - string(EntityKindNic), - string(EntityKindProcess), - string(EntityKindRegistryKey), - string(EntityKindRegistryValue), - string(EntityKindSecurityAlert), - string(EntityKindSecurityGroup), - string(EntityKindSubmissionMail), - string(EntityKindUrl), - } -} - -func (s *EntityKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKind(input string) (*EntityKind, error) { - vals := map[string]EntityKind{ - "account": EntityKindAccount, - "azureresource": EntityKindAzureResource, - "bookmark": EntityKindBookmark, - "cloudapplication": EntityKindCloudApplication, - "dnsresolution": EntityKindDnsResolution, - "file": EntityKindFile, - "filehash": EntityKindFileHash, - "host": EntityKindHost, - "ip": EntityKindIP, - "iotdevice": EntityKindIoTDevice, - "mailcluster": EntityKindMailCluster, - "mailmessage": EntityKindMailMessage, - "mailbox": EntityKindMailbox, - "malware": EntityKindMalware, - "nic": EntityKindNic, - "process": EntityKindProcess, - "registrykey": EntityKindRegistryKey, - "registryvalue": EntityKindRegistryValue, - "securityalert": EntityKindSecurityAlert, - "securitygroup": EntityKindSecurityGroup, - "submissionmail": EntityKindSubmissionMail, - "url": EntityKindUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKind(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident.go deleted file mode 100644 index b50dad94732..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidententities - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident_test.go deleted file mode 100644 index d9b2f1e0367..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidententities - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidententities/method_incidentslistentities.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/method_incidentslistentities.go deleted file mode 100644 index 2723b2f44a9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/method_incidentslistentities.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidententities - -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 IncidentsListEntitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentEntitiesResponse -} - -// IncidentsListEntities ... -func (c IncidentEntitiesClient) IncidentsListEntities(ctx context.Context, id IncidentId) (result IncidentsListEntitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/entities", 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 IncidentEntitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_entity.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_entity.go deleted file mode 100644 index 43a9a64c0bf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidententities - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmark.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmark.go deleted file mode 100644 index f001f6b783a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmarkproperties.go deleted file mode 100644 index 278d0da2ec5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidententities - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresponse.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresponse.go deleted file mode 100644 index ab896895768..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresponse.go +++ /dev/null @@ -1,49 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentEntitiesResponse struct { - Entities *[]Entity `json:"entities,omitempty"` - MetaData *[]IncidentEntitiesResultsMetadata `json:"metaData,omitempty"` -} - -var _ json.Unmarshaler = &IncidentEntitiesResponse{} - -func (s *IncidentEntitiesResponse) UnmarshalJSON(bytes []byte) error { - type alias IncidentEntitiesResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into IncidentEntitiesResponse: %+v", err) - } - - s.MetaData = decoded.MetaData - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling IncidentEntitiesResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["entities"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Entities into list []json.RawMessage: %+v", err) - } - - output := make([]Entity, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Entities' for 'IncidentEntitiesResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Entities = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresultsmetadata.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresultsmetadata.go deleted file mode 100644 index 746b4e604b9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidententitiesresultsmetadata.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentEntitiesResultsMetadata struct { - Count int64 `json:"count"` - EntityKind EntityKind `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidentinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidentinfo.go deleted file mode 100644 index ec816413c8c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalert.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalert.go deleted file mode 100644 index 9d570306524..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertproperties.go deleted file mode 100644 index bdfa3d19c6d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidententities - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index 8f8651c6ef8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_userinfo.go deleted file mode 100644 index 3faed5bd1cf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidententities/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidententities/version.go deleted file mode 100644 index 9d563e9d6be..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidententities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidententities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidententities/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/README.md deleted file mode 100644 index b8ffa2c9a62..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentrelations` Documentation - -The `incidentrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidentrelations" -``` - - -### Client Initialization - -```go -client := incidentrelations.NewIncidentRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentRelationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -payload := incidentrelations.Relation{ - // ... -} - - -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: `IncidentRelationsClient.Delete` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -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: `IncidentRelationsClient.Get` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -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: `IncidentRelationsClient.List` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -// alternatively `client.List(ctx, id, incidentrelations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidentrelations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/client.go deleted file mode 100644 index 4e8fbfeb71d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentrelations - -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 IncidentRelationsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentRelationsClient: %+v", err) - } - - return &IncidentRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident.go deleted file mode 100644 index 41d012358a0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentrelations - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident_test.go deleted file mode 100644 index d85112433dd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentrelations - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation.go deleted file mode 100644 index 81731639476..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation.go +++ /dev/null @@ -1,150 +0,0 @@ -package incidentrelations - -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(&IncidentRelationId{}) -} - -var _ resourceids.ResourceId = &IncidentRelationId{} - -// IncidentRelationId is a struct representing the Resource ID for a Incident Relation -type IncidentRelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string - RelationName string -} - -// NewIncidentRelationID returns a new IncidentRelationId struct -func NewIncidentRelationID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string, relationName string) IncidentRelationId { - return IncidentRelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - RelationName: relationName, - } -} - -// ParseIncidentRelationID parses 'input' into a IncidentRelationId -func ParseIncidentRelationID(input string) (*IncidentRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentRelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentRelationIDInsensitively parses 'input' case-insensitively into a IncidentRelationId -// note: this method should only be used for API response data and not user input -func ParseIncidentRelationIDInsensitively(input string) (*IncidentRelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentRelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentRelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentRelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateIncidentRelationID checks that 'input' can be parsed as a Incident Relation ID -func ValidateIncidentRelationID(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 := ParseIncidentRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident Relation ID -func (id IncidentRelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident Relation ID -func (id IncidentRelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Incident Relation ID -func (id IncidentRelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Incident Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation_test.go deleted file mode 100644 index ba0fa6ec112..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/id_incidentrelation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package incidentrelations - -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 = &IncidentRelationId{} - -func TestNewIncidentRelationID(t *testing.T) { - id := NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatIncidentRelationID(t *testing.T) { - actual := NewIncidentRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue", - Expected: &IncidentRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseIncidentRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentRelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue", - Expected: &IncidentRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &IncidentRelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForIncidentRelationId(t *testing.T) { - segments := IncidentRelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentRelationId 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/securityinsights/2022-07-01-preview/incidentrelations/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_createorupdate.go deleted file mode 100644 index ced0d3d360e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentrelations - -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 *Relation -} - -// CreateOrUpdate ... -func (c IncidentRelationsClient) CreateOrUpdate(ctx context.Context, id IncidentRelationId, input Relation) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_delete.go deleted file mode 100644 index 7206ac26d08..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentrelations - -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 IncidentRelationsClient) Delete(ctx context.Context, id IncidentRelationId) (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/securityinsights/2022-07-01-preview/incidentrelations/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_get.go deleted file mode 100644 index a96d8672089..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidentrelations - -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 *Relation -} - -// Get ... -func (c IncidentRelationsClient) Get(ctx context.Context, id IncidentRelationId) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_list.go deleted file mode 100644 index 80873d441b4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidentrelations - -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 *[]Relation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentRelationsClient) List(ctx context.Context, id IncidentId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `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 IncidentRelationsClient) ListComplete(ctx context.Context, id IncidentId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentRelationsClient) ListCompleteMatchingPredicate(ctx context.Context, id IncidentId, options ListOperationOptions, predicate RelationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-07-01-preview/incidentrelations/model_relation.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relation.go deleted file mode 100644 index 39b27ed1036..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidentrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relationproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relationproperties.go deleted file mode 100644 index b514fd1661e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/predicates.go deleted file mode 100644 index 35c3a9c1e3a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidentrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2022-07-01-preview/incidentrelations/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/version.go deleted file mode 100644 index 80a83151776..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidents/README.md deleted file mode 100644 index e58ff1614e3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidents` Documentation - -The `incidents` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidents" -``` - - -### Client Initialization - -```go -client := incidents.NewIncidentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -payload := incidents.Incident{ - // ... -} - - -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: `IncidentsClient.Delete` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -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: `IncidentsClient.Get` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -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: `IncidentsClient.List` - -```go -ctx := context.TODO() -id := incidents.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, incidents.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidents.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/client.go deleted file mode 100644 index aaf38071c39..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidents - -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 IncidentsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidents", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentsClient: %+v", err) - } - - return &IncidentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/constants.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/constants.go deleted file mode 100644 index ce046b9edba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/constants.go +++ /dev/null @@ -1,366 +0,0 @@ -package incidents - -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 AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type IncidentClassification string - -const ( - IncidentClassificationBenignPositive IncidentClassification = "BenignPositive" - IncidentClassificationFalsePositive IncidentClassification = "FalsePositive" - IncidentClassificationTruePositive IncidentClassification = "TruePositive" - IncidentClassificationUndetermined IncidentClassification = "Undetermined" -) - -func PossibleValuesForIncidentClassification() []string { - return []string{ - string(IncidentClassificationBenignPositive), - string(IncidentClassificationFalsePositive), - string(IncidentClassificationTruePositive), - string(IncidentClassificationUndetermined), - } -} - -func (s *IncidentClassification) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassification(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassification(input string) (*IncidentClassification, error) { - vals := map[string]IncidentClassification{ - "benignpositive": IncidentClassificationBenignPositive, - "falsepositive": IncidentClassificationFalsePositive, - "truepositive": IncidentClassificationTruePositive, - "undetermined": IncidentClassificationUndetermined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassification(input) - return &out, nil -} - -type IncidentClassificationReason string - -const ( - IncidentClassificationReasonInaccurateData IncidentClassificationReason = "InaccurateData" - IncidentClassificationReasonIncorrectAlertLogic IncidentClassificationReason = "IncorrectAlertLogic" - IncidentClassificationReasonSuspiciousActivity IncidentClassificationReason = "SuspiciousActivity" - IncidentClassificationReasonSuspiciousButExpected IncidentClassificationReason = "SuspiciousButExpected" -) - -func PossibleValuesForIncidentClassificationReason() []string { - return []string{ - string(IncidentClassificationReasonInaccurateData), - string(IncidentClassificationReasonIncorrectAlertLogic), - string(IncidentClassificationReasonSuspiciousActivity), - string(IncidentClassificationReasonSuspiciousButExpected), - } -} - -func (s *IncidentClassificationReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassificationReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassificationReason(input string) (*IncidentClassificationReason, error) { - vals := map[string]IncidentClassificationReason{ - "inaccuratedata": IncidentClassificationReasonInaccurateData, - "incorrectalertlogic": IncidentClassificationReasonIncorrectAlertLogic, - "suspiciousactivity": IncidentClassificationReasonSuspiciousActivity, - "suspiciousbutexpected": IncidentClassificationReasonSuspiciousButExpected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassificationReason(input) - return &out, nil -} - -type IncidentLabelType string - -const ( - IncidentLabelTypeAutoAssigned IncidentLabelType = "AutoAssigned" - IncidentLabelTypeUser IncidentLabelType = "User" -) - -func PossibleValuesForIncidentLabelType() []string { - return []string{ - string(IncidentLabelTypeAutoAssigned), - string(IncidentLabelTypeUser), - } -} - -func (s *IncidentLabelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentLabelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentLabelType(input string) (*IncidentLabelType, error) { - vals := map[string]IncidentLabelType{ - "autoassigned": IncidentLabelTypeAutoAssigned, - "user": IncidentLabelTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentLabelType(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type IncidentStatus string - -const ( - IncidentStatusActive IncidentStatus = "Active" - IncidentStatusClosed IncidentStatus = "Closed" - IncidentStatusNew IncidentStatus = "New" -) - -func PossibleValuesForIncidentStatus() []string { - return []string{ - string(IncidentStatusActive), - string(IncidentStatusClosed), - string(IncidentStatusNew), - } -} - -func (s *IncidentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentStatus(input string) (*IncidentStatus, error) { - vals := map[string]IncidentStatus{ - "active": IncidentStatusActive, - "closed": IncidentStatusClosed, - "new": IncidentStatusNew, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentStatus(input) - return &out, nil -} - -type OwnerType string - -const ( - OwnerTypeGroup OwnerType = "Group" - OwnerTypeUnknown OwnerType = "Unknown" - OwnerTypeUser OwnerType = "User" -) - -func PossibleValuesForOwnerType() []string { - return []string{ - string(OwnerTypeGroup), - string(OwnerTypeUnknown), - string(OwnerTypeUser), - } -} - -func (s *OwnerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwnerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwnerType(input string) (*OwnerType, error) { - vals := map[string]OwnerType{ - "group": OwnerTypeGroup, - "unknown": OwnerTypeUnknown, - "user": OwnerTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwnerType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident.go deleted file mode 100644 index d6e96822028..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidents - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident_test.go deleted file mode 100644 index 7871a231b35..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidents - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidents/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace.go deleted file mode 100644 index 9667e33b904..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package incidents - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace_test.go deleted file mode 100644 index 13cbb1918fc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package incidents - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/incidents/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/method_createorupdate.go deleted file mode 100644 index fc09e8a1cba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidents - -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 *Incident -} - -// CreateOrUpdate ... -func (c IncidentsClient) CreateOrUpdate(ctx context.Context, id IncidentId, input Incident) (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 Incident - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/method_delete.go deleted file mode 100644 index 9b3205af5fc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidents - -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 IncidentsClient) Delete(ctx context.Context, id IncidentId) (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/securityinsights/2022-07-01-preview/incidents/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/method_get.go deleted file mode 100644 index c67e0bb22b8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidents - -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 *Incident -} - -// Get ... -func (c IncidentsClient) Get(ctx context.Context, id IncidentId) (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 Incident - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/method_list.go deleted file mode 100644 index fe19cd4d9ff..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidents - -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 *[]Incident -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Incident -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentsClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/incidents", id.ID()), - OptionsObject: options, - } - - 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 *[]Incident `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 IncidentsClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, IncidentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate IncidentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Incident, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-07-01-preview/incidents/model_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incident.go deleted file mode 100644 index 0c560cabced..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incident.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidents - -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 Incident struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IncidentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentadditionaldata.go deleted file mode 100644 index 47c0b6b4f9e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentadditionaldata.go +++ /dev/null @@ -1,14 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentAdditionalData struct { - AlertProductNames *[]string `json:"alertProductNames,omitempty"` - AlertsCount *int64 `json:"alertsCount,omitempty"` - BookmarksCount *int64 `json:"bookmarksCount,omitempty"` - CommentsCount *int64 `json:"commentsCount,omitempty"` - ProviderIncidentUrl *string `json:"providerIncidentUrl,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentlabel.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentlabel.go deleted file mode 100644 index 706eeaa7686..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentlabel.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentLabel struct { - LabelName string `json:"labelName"` - LabelType *IncidentLabelType `json:"labelType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentownerinfo.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentownerinfo.go deleted file mode 100644 index f77549efb11..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentownerinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOwnerInfo struct { - AssignedTo *string `json:"assignedTo,omitempty"` - Email *string `json:"email,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - OwnerType *OwnerType `json:"ownerType,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentproperties.go deleted file mode 100644 index 8ecfb7aa260..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_incidentproperties.go +++ /dev/null @@ -1,81 +0,0 @@ -package incidents - -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 IncidentProperties struct { - AdditionalData *IncidentAdditionalData `json:"additionalData,omitempty"` - Classification *IncidentClassification `json:"classification,omitempty"` - ClassificationComment *string `json:"classificationComment,omitempty"` - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - Description *string `json:"description,omitempty"` - FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` - IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` - Labels *[]IncidentLabel `json:"labels,omitempty"` - LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Owner *IncidentOwnerInfo `json:"owner,omitempty"` - ProviderIncidentId *string `json:"providerIncidentId,omitempty"` - ProviderName *string `json:"providerName,omitempty"` - RelatedAnalyticRuleIds *[]string `json:"relatedAnalyticRuleIds,omitempty"` - Severity IncidentSeverity `json:"severity"` - Status IncidentStatus `json:"status"` - TeamInformation *TeamInformation `json:"teamInformation,omitempty"` - Title string `json:"title"` -} - -func (o *IncidentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *IncidentProperties) GetFirstActivityTimeUtcAsTime() (*time.Time, error) { - if o.FirstActivityTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.FirstActivityTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetFirstActivityTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.FirstActivityTimeUtc = &formatted -} - -func (o *IncidentProperties) GetLastActivityTimeUtcAsTime() (*time.Time, error) { - if o.LastActivityTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastActivityTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetLastActivityTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastActivityTimeUtc = &formatted -} - -func (o *IncidentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_teaminformation.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/model_teaminformation.go deleted file mode 100644 index 2ce83593a2a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/model_teaminformation.go +++ /dev/null @@ -1,30 +0,0 @@ -package incidents - -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 TeamInformation struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - PrimaryChannelUrl *string `json:"primaryChannelUrl,omitempty"` - TeamCreationTimeUtc *string `json:"teamCreationTimeUtc,omitempty"` - TeamId *string `json:"teamId,omitempty"` -} - -func (o *TeamInformation) GetTeamCreationTimeUtcAsTime() (*time.Time, error) { - if o.TeamCreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TeamCreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *TeamInformation) SetTeamCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TeamCreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidents/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/predicates.go deleted file mode 100644 index 6d4cc3da0be..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p IncidentOperationPredicate) Matches(input Incident) 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.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/securityinsights/2022-07-01-preview/incidents/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidents/version.go deleted file mode 100644 index e831592da9d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidents/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidents/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/README.md b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/README.md deleted file mode 100644 index 9784abf126d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/incidentteam` Documentation - -The `incidentteam` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/incidentteam" -``` - - -### Client Initialization - -```go -client := incidentteam.NewIncidentTeamClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentTeamClient.IncidentsCreateTeam` - -```go -ctx := context.TODO() -id := incidentteam.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -payload := incidentteam.TeamProperties{ - // ... -} - - -read, err := client.IncidentsCreateTeam(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/securityinsights/2022-07-01-preview/incidentteam/client.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/client.go deleted file mode 100644 index 75ab2cfb3b1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentteam - -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 IncidentTeamClient struct { - Client *resourcemanager.Client -} - -func NewIncidentTeamClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentTeamClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentteam", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentTeamClient: %+v", err) - } - - return &IncidentTeamClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident.go deleted file mode 100644 index f2530f99226..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentteam - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident_test.go deleted file mode 100644 index 95740eacc7f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentteam - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/incidentteam/method_incidentscreateteam.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/method_incidentscreateteam.go deleted file mode 100644 index 25a784d4ab9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/method_incidentscreateteam.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentteam - -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 IncidentsCreateTeamOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *TeamInformation -} - -// IncidentsCreateTeam ... -func (c IncidentTeamClient) IncidentsCreateTeam(ctx context.Context, id IncidentId, input TeamProperties) (result IncidentsCreateTeamOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/createTeam", 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 TeamInformation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teaminformation.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teaminformation.go deleted file mode 100644 index b3e84ff0fc7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teaminformation.go +++ /dev/null @@ -1,30 +0,0 @@ -package incidentteam - -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 TeamInformation struct { - Description *string `json:"description,omitempty"` - Name *string `json:"name,omitempty"` - PrimaryChannelUrl *string `json:"primaryChannelUrl,omitempty"` - TeamCreationTimeUtc *string `json:"teamCreationTimeUtc,omitempty"` - TeamId *string `json:"teamId,omitempty"` -} - -func (o *TeamInformation) GetTeamCreationTimeUtcAsTime() (*time.Time, error) { - if o.TeamCreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TeamCreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *TeamInformation) SetTeamCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TeamCreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teamproperties.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teamproperties.go deleted file mode 100644 index 7c43f75585b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/model_teamproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentteam - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TeamProperties struct { - GroupIds *[]string `json:"groupIds,omitempty"` - MemberIds *[]string `json:"memberIds,omitempty"` - TeamDescription *string `json:"teamDescription,omitempty"` - TeamName string `json:"teamName"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/version.go b/resource-manager/securityinsights/2022-07-01-preview/incidentteam/version.go deleted file mode 100644 index 6dab96778dd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/incidentteam/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentteam - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentteam/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/README.md b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/README.md deleted file mode 100644 index c90eb7bee50..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/README.md +++ /dev/null @@ -1,41 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/manualtrigger` Documentation - -The `manualtrigger` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/manualtrigger" -``` - - -### Client Initialization - -```go -client := manualtrigger.NewManualTriggerClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ManualTriggerClient.IncidentsRunPlaybook` - -```go -ctx := context.TODO() -id := manualtrigger.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - -payload := manualtrigger.ManualTriggerRequestBody{ - // ... -} - - -read, err := client.IncidentsRunPlaybook(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/securityinsights/2022-07-01-preview/manualtrigger/client.go b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/client.go deleted file mode 100644 index da5817ede95..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package manualtrigger - -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 ManualTriggerClient struct { - Client *resourcemanager.Client -} - -func NewManualTriggerClientWithBaseURI(sdkApi sdkEnv.Api) (*ManualTriggerClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "manualtrigger", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ManualTriggerClient: %+v", err) - } - - return &ManualTriggerClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident.go b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident.go deleted file mode 100644 index 82ca3cb00a1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package manualtrigger - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentIdentifier string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentIdentifier string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentIdentifier: incidentIdentifier, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentIdentifier, ok = input.Parsed["incidentIdentifier"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentIdentifier", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentIdentifier) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentIdentifier", "incidentIdentifierValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident Identifier: %q", id.IncidentIdentifier), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident_test.go b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident_test.go deleted file mode 100644 index e9a647a9c18..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package manualtrigger - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentIdentifier != "incidentIdentifierValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentIdentifier'", id.IncidentIdentifier, "incidentIdentifierValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdentifierValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentIdentifier: "incidentIdentifierValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdentifierValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentIdentifier: "iNcIdEnTiDeNtIfIeRvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDeNtIfIeRvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentIdentifier != v.Expected.IncidentIdentifier { - t.Fatalf("Expected %q but got %q for IncidentIdentifier", v.Expected.IncidentIdentifier, actual.IncidentIdentifier) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-07-01-preview/manualtrigger/method_incidentsrunplaybook.go b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/method_incidentsrunplaybook.go deleted file mode 100644 index d6c3d165db6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/method_incidentsrunplaybook.go +++ /dev/null @@ -1,59 +0,0 @@ -package manualtrigger - -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 IncidentsRunPlaybookOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *interface{} -} - -// IncidentsRunPlaybook ... -func (c ManualTriggerClient) IncidentsRunPlaybook(ctx context.Context, id IncidentId, input ManualTriggerRequestBody) (result IncidentsRunPlaybookOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusNoContent, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/runPlaybook", 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 interface{} - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/model_manualtriggerrequestbody.go b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/model_manualtriggerrequestbody.go deleted file mode 100644 index 5d04adba958..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/model_manualtriggerrequestbody.go +++ /dev/null @@ -1,9 +0,0 @@ -package manualtrigger - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ManualTriggerRequestBody struct { - LogicAppsResourceId string `json:"logicAppsResourceId"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/version.go b/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/version.go deleted file mode 100644 index 8a372aaae44..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/manualtrigger/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package manualtrigger - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/manualtrigger/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/README.md b/resource-manager/securityinsights/2022-07-01-preview/metadata/README.md deleted file mode 100644 index a9f62ebf193..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/README.md +++ /dev/null @@ -1,111 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/metadata` Documentation - -The `metadata` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/metadata" -``` - - -### Client Initialization - -```go -client := metadata.NewMetadataClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `MetadataClient.Create` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -payload := metadata.MetadataModel{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `MetadataClient.Delete` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -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: `MetadataClient.Get` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -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: `MetadataClient.List` - -```go -ctx := context.TODO() -id := metadata.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, metadata.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, metadata.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `MetadataClient.Update` - -```go -ctx := context.TODO() -id := metadata.NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - -payload := metadata.MetadataPatch{ - // ... -} - - -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/securityinsights/2022-07-01-preview/metadata/client.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/client.go deleted file mode 100644 index 59e4192159f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package metadata - -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 MetadataClient struct { - Client *resourcemanager.Client -} - -func NewMetadataClientWithBaseURI(sdkApi sdkEnv.Api) (*MetadataClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "metadata", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating MetadataClient: %+v", err) - } - - return &MetadataClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/constants.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/constants.go deleted file mode 100644 index e1a5d1b92ff..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/constants.go +++ /dev/null @@ -1,228 +0,0 @@ -package metadata - -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 Kind string - -const ( - KindAnalyticsRule Kind = "AnalyticsRule" - KindAnalyticsRuleTemplate Kind = "AnalyticsRuleTemplate" - KindAutomationRule Kind = "AutomationRule" - KindAzureFunction Kind = "AzureFunction" - KindDataConnector Kind = "DataConnector" - KindDataType Kind = "DataType" - KindHuntingQuery Kind = "HuntingQuery" - KindInvestigationQuery Kind = "InvestigationQuery" - KindLogicAppsCustomConnector Kind = "LogicAppsCustomConnector" - KindParser Kind = "Parser" - KindPlaybook Kind = "Playbook" - KindPlaybookTemplate Kind = "PlaybookTemplate" - KindSolution Kind = "Solution" - KindWatchlist Kind = "Watchlist" - KindWatchlistTemplate Kind = "WatchlistTemplate" - KindWorkbook Kind = "Workbook" - KindWorkbookTemplate Kind = "WorkbookTemplate" -) - -func PossibleValuesForKind() []string { - return []string{ - string(KindAnalyticsRule), - string(KindAnalyticsRuleTemplate), - string(KindAutomationRule), - string(KindAzureFunction), - string(KindDataConnector), - string(KindDataType), - string(KindHuntingQuery), - string(KindInvestigationQuery), - string(KindLogicAppsCustomConnector), - string(KindParser), - string(KindPlaybook), - string(KindPlaybookTemplate), - string(KindSolution), - string(KindWatchlist), - string(KindWatchlistTemplate), - string(KindWorkbook), - string(KindWorkbookTemplate), - } -} - -func (s *Kind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKind(input string) (*Kind, error) { - vals := map[string]Kind{ - "analyticsrule": KindAnalyticsRule, - "analyticsruletemplate": KindAnalyticsRuleTemplate, - "automationrule": KindAutomationRule, - "azurefunction": KindAzureFunction, - "dataconnector": KindDataConnector, - "datatype": KindDataType, - "huntingquery": KindHuntingQuery, - "investigationquery": KindInvestigationQuery, - "logicappscustomconnector": KindLogicAppsCustomConnector, - "parser": KindParser, - "playbook": KindPlaybook, - "playbooktemplate": KindPlaybookTemplate, - "solution": KindSolution, - "watchlist": KindWatchlist, - "watchlisttemplate": KindWatchlistTemplate, - "workbook": KindWorkbook, - "workbooktemplate": KindWorkbookTemplate, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Kind(input) - return &out, nil -} - -type Operator string - -const ( - OperatorAND Operator = "AND" - OperatorOR Operator = "OR" -) - -func PossibleValuesForOperator() []string { - return []string{ - string(OperatorAND), - string(OperatorOR), - } -} - -func (s *Operator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOperator(input string) (*Operator, error) { - vals := map[string]Operator{ - "and": OperatorAND, - "or": OperatorOR, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Operator(input) - return &out, nil -} - -type SourceKind string - -const ( - SourceKindCommunity SourceKind = "Community" - SourceKindLocalWorkspace SourceKind = "LocalWorkspace" - SourceKindSolution SourceKind = "Solution" - SourceKindSourceRepository SourceKind = "SourceRepository" -) - -func PossibleValuesForSourceKind() []string { - return []string{ - string(SourceKindCommunity), - string(SourceKindLocalWorkspace), - string(SourceKindSolution), - string(SourceKindSourceRepository), - } -} - -func (s *SourceKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSourceKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSourceKind(input string) (*SourceKind, error) { - vals := map[string]SourceKind{ - "community": SourceKindCommunity, - "localworkspace": SourceKindLocalWorkspace, - "solution": SourceKindSolution, - "sourcerepository": SourceKindSourceRepository, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SourceKind(input) - return &out, nil -} - -type SupportTier string - -const ( - SupportTierCommunity SupportTier = "Community" - SupportTierMicrosoft SupportTier = "Microsoft" - SupportTierPartner SupportTier = "Partner" -) - -func PossibleValuesForSupportTier() []string { - return []string{ - string(SupportTierCommunity), - string(SupportTierMicrosoft), - string(SupportTierPartner), - } -} - -func (s *SupportTier) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSupportTier(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSupportTier(input string) (*SupportTier, error) { - vals := map[string]SupportTier{ - "community": SupportTierCommunity, - "microsoft": SupportTierMicrosoft, - "partner": SupportTierPartner, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SupportTier(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata.go deleted file mode 100644 index 5d97d463191..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata.go +++ /dev/null @@ -1,141 +0,0 @@ -package metadata - -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(&MetadataId{}) -} - -var _ resourceids.ResourceId = &MetadataId{} - -// MetadataId is a struct representing the Resource ID for a Metadata -type MetadataId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - MetadataName string -} - -// NewMetadataID returns a new MetadataId struct -func NewMetadataID(subscriptionId string, resourceGroupName string, workspaceName string, metadataName string) MetadataId { - return MetadataId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - MetadataName: metadataName, - } -} - -// ParseMetadataID parses 'input' into a MetadataId -func ParseMetadataID(input string) (*MetadataId, error) { - parser := resourceids.NewParserFromResourceIdType(&MetadataId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MetadataId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseMetadataIDInsensitively parses 'input' case-insensitively into a MetadataId -// note: this method should only be used for API response data and not user input -func ParseMetadataIDInsensitively(input string) (*MetadataId, error) { - parser := resourceids.NewParserFromResourceIdType(&MetadataId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := MetadataId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *MetadataId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.MetadataName, ok = input.Parsed["metadataName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "metadataName", input) - } - - return nil -} - -// ValidateMetadataID checks that 'input' can be parsed as a Metadata ID -func ValidateMetadataID(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 := ParseMetadataID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Metadata ID -func (id MetadataId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/metadata/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.MetadataName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Metadata ID -func (id MetadataId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticMetadata", "metadata", "metadata"), - resourceids.UserSpecifiedSegment("metadataName", "metadataValue"), - } -} - -// String returns a human-readable description of this Metadata ID -func (id MetadataId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Metadata Name: %q", id.MetadataName), - } - return fmt.Sprintf("Metadata (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata_test.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata_test.go deleted file mode 100644 index 4904daf0395..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_metadata_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package metadata - -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 = &MetadataId{} - -func TestNewMetadataID(t *testing.T) { - id := NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.MetadataName != "metadataValue" { - t.Fatalf("Expected %q but got %q for Segment 'MetadataName'", id.MetadataName, "metadataValue") - } -} - -func TestFormatMetadataID(t *testing.T) { - actual := NewMetadataID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "metadataValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseMetadataID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MetadataId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue", - Expected: &MetadataId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - MetadataName: "metadataValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMetadataID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.MetadataName != v.Expected.MetadataName { - t.Fatalf("Expected %q but got %q for MetadataName", v.Expected.MetadataName, actual.MetadataName) - } - - } -} - -func TestParseMetadataIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *MetadataId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/mEtAdAtA", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue", - Expected: &MetadataId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - MetadataName: "metadataValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/metadata/metadataValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/mEtAdAtA/mEtAdAtAvAlUe", - Expected: &MetadataId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - MetadataName: "mEtAdAtAvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/mEtAdAtA/mEtAdAtAvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseMetadataIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.MetadataName != v.Expected.MetadataName { - t.Fatalf("Expected %q but got %q for MetadataName", v.Expected.MetadataName, actual.MetadataName) - } - - } -} - -func TestSegmentsForMetadataId(t *testing.T) { - segments := MetadataId{}.Segments() - if len(segments) == 0 { - t.Fatalf("MetadataId 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/securityinsights/2022-07-01-preview/metadata/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace.go deleted file mode 100644 index 6248b4d13cc..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package metadata - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace_test.go deleted file mode 100644 index 9a9fefb8173..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package metadata - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/metadata/method_create.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/method_create.go deleted file mode 100644 index fd4a74a030a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package metadata - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MetadataModel -} - -// Create ... -func (c MetadataClient) Create(ctx context.Context, id MetadataId, input MetadataModel) (result CreateOperationResponse, 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 MetadataModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/method_delete.go deleted file mode 100644 index 559f479cb03..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package metadata - -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 MetadataClient) Delete(ctx context.Context, id MetadataId) (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/securityinsights/2022-07-01-preview/metadata/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/method_get.go deleted file mode 100644 index 68228f0b583..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package metadata - -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 *MetadataModel -} - -// Get ... -func (c MetadataClient) Get(ctx context.Context, id MetadataId) (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 MetadataModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/method_list.go deleted file mode 100644 index 58267143629..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_list.go +++ /dev/null @@ -1,131 +0,0 @@ -package metadata - -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 *[]MetadataModel -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []MetadataModel -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Skip *int64 - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Skip != nil { - out.Append("$skip", fmt.Sprintf("%v", *o.Skip)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c MetadataClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/metadata", id.ID()), - OptionsObject: options, - } - - 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 *[]MetadataModel `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 MetadataClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, MetadataModelOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c MetadataClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate MetadataModelOperationPredicate) (result ListCompleteResult, err error) { - items := make([]MetadataModel, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-07-01-preview/metadata/method_update.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/method_update.go deleted file mode 100644 index e6911fcbc1d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/method_update.go +++ /dev/null @@ -1,58 +0,0 @@ -package metadata - -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 UpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *MetadataModel -} - -// Update ... -func (c MetadataClient) Update(ctx context.Context, id MetadataId, input MetadataPatch) (result UpdateOperationResponse, 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 MetadataModel - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataauthor.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataauthor.go deleted file mode 100644 index 9f27e5e7454..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataauthor.go +++ /dev/null @@ -1,10 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataAuthor struct { - Email *string `json:"email,omitempty"` - Link *string `json:"link,omitempty"` - Name *string `json:"name,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatacategories.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatacategories.go deleted file mode 100644 index d9120925370..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatacategories.go +++ /dev/null @@ -1,9 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataCategories struct { - Domains *[]string `json:"domains,omitempty"` - Verticals *[]string `json:"verticals,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatadependencies.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatadependencies.go deleted file mode 100644 index fe82bf3f5d9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatadependencies.go +++ /dev/null @@ -1,13 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataDependencies struct { - ContentId *string `json:"contentId,omitempty"` - Criteria *[]MetadataDependencies `json:"criteria,omitempty"` - Kind *Kind `json:"kind,omitempty"` - Name *string `json:"name,omitempty"` - Operator *Operator `json:"operator,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatamodel.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatamodel.go deleted file mode 100644 index 24d36aadd74..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatamodel.go +++ /dev/null @@ -1,17 +0,0 @@ -package metadata - -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 MetadataModel struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *MetadataProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapatch.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapatch.go deleted file mode 100644 index 05d052ba996..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapatch.go +++ /dev/null @@ -1,17 +0,0 @@ -package metadata - -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 MetadataPatch struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *MetadataPropertiesPatch `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataproperties.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataproperties.go deleted file mode 100644 index a59ba0176a0..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadataproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataProperties struct { - Author *MetadataAuthor `json:"author,omitempty"` - Categories *MetadataCategories `json:"categories,omitempty"` - ContentId *string `json:"contentId,omitempty"` - ContentSchemaVersion *string `json:"contentSchemaVersion,omitempty"` - CustomVersion *string `json:"customVersion,omitempty"` - Dependencies *MetadataDependencies `json:"dependencies,omitempty"` - FirstPublishDate *string `json:"firstPublishDate,omitempty"` - Icon *string `json:"icon,omitempty"` - Kind Kind `json:"kind"` - LastPublishDate *string `json:"lastPublishDate,omitempty"` - ParentId string `json:"parentId"` - PreviewImages *[]string `json:"previewImages,omitempty"` - PreviewImagesDark *[]string `json:"previewImagesDark,omitempty"` - Providers *[]string `json:"providers,omitempty"` - Source *MetadataSource `json:"source,omitempty"` - Support *MetadataSupport `json:"support,omitempty"` - ThreatAnalysisTactics *[]string `json:"threatAnalysisTactics,omitempty"` - ThreatAnalysisTechniques *[]string `json:"threatAnalysisTechniques,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapropertiespatch.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapropertiespatch.go deleted file mode 100644 index 38685ff0902..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatapropertiespatch.go +++ /dev/null @@ -1,26 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataPropertiesPatch struct { - Author *MetadataAuthor `json:"author,omitempty"` - Categories *MetadataCategories `json:"categories,omitempty"` - ContentId *string `json:"contentId,omitempty"` - ContentSchemaVersion *string `json:"contentSchemaVersion,omitempty"` - CustomVersion *string `json:"customVersion,omitempty"` - Dependencies *MetadataDependencies `json:"dependencies,omitempty"` - FirstPublishDate *string `json:"firstPublishDate,omitempty"` - Icon *string `json:"icon,omitempty"` - Kind *Kind `json:"kind,omitempty"` - LastPublishDate *string `json:"lastPublishDate,omitempty"` - ParentId *string `json:"parentId,omitempty"` - PreviewImages *[]string `json:"previewImages,omitempty"` - PreviewImagesDark *[]string `json:"previewImagesDark,omitempty"` - Providers *[]string `json:"providers,omitempty"` - Source *MetadataSource `json:"source,omitempty"` - Support *MetadataSupport `json:"support,omitempty"` - ThreatAnalysisTactics *[]string `json:"threatAnalysisTactics,omitempty"` - ThreatAnalysisTechniques *[]string `json:"threatAnalysisTechniques,omitempty"` - Version *string `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasource.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasource.go deleted file mode 100644 index b6f4218a0ba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasource.go +++ /dev/null @@ -1,10 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataSource struct { - Kind SourceKind `json:"kind"` - Name *string `json:"name,omitempty"` - SourceId *string `json:"sourceId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasupport.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasupport.go deleted file mode 100644 index 2a416d7bab3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/model_metadatasupport.go +++ /dev/null @@ -1,11 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataSupport struct { - Email *string `json:"email,omitempty"` - Link *string `json:"link,omitempty"` - Name *string `json:"name,omitempty"` - Tier SupportTier `json:"tier"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/metadata/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/predicates.go deleted file mode 100644 index 11492b7da36..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package metadata - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MetadataModelOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p MetadataModelOperationPredicate) Matches(input MetadataModel) 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.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/securityinsights/2022-07-01-preview/metadata/version.go b/resource-manager/securityinsights/2022-07-01-preview/metadata/version.go deleted file mode 100644 index bd78f416805..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/metadata/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package metadata - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/metadata/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/README.md b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/README.md deleted file mode 100644 index 3f138d5a578..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/README.md +++ /dev/null @@ -1,69 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/officeconsents` Documentation - -The `officeconsents` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/officeconsents" -``` - - -### Client Initialization - -```go -client := officeconsents.NewOfficeConsentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `OfficeConsentsClient.Delete` - -```go -ctx := context.TODO() -id := officeconsents.NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue") - -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: `OfficeConsentsClient.Get` - -```go -ctx := context.TODO() -id := officeconsents.NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue") - -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: `OfficeConsentsClient.List` - -```go -ctx := context.TODO() -id := officeconsents.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/officeconsents/client.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/client.go deleted file mode 100644 index 2c2efc37d3d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package officeconsents - -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 OfficeConsentsClient struct { - Client *resourcemanager.Client -} - -func NewOfficeConsentsClientWithBaseURI(sdkApi sdkEnv.Api) (*OfficeConsentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "officeconsents", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating OfficeConsentsClient: %+v", err) - } - - return &OfficeConsentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent.go deleted file mode 100644 index 6112f6e7da8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent.go +++ /dev/null @@ -1,141 +0,0 @@ -package officeconsents - -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(&OfficeConsentId{}) -} - -var _ resourceids.ResourceId = &OfficeConsentId{} - -// OfficeConsentId is a struct representing the Resource ID for a Office Consent -type OfficeConsentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - ConsentId string -} - -// NewOfficeConsentID returns a new OfficeConsentId struct -func NewOfficeConsentID(subscriptionId string, resourceGroupName string, workspaceName string, consentId string) OfficeConsentId { - return OfficeConsentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - ConsentId: consentId, - } -} - -// ParseOfficeConsentID parses 'input' into a OfficeConsentId -func ParseOfficeConsentID(input string) (*OfficeConsentId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfficeConsentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfficeConsentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOfficeConsentIDInsensitively parses 'input' case-insensitively into a OfficeConsentId -// note: this method should only be used for API response data and not user input -func ParseOfficeConsentIDInsensitively(input string) (*OfficeConsentId, error) { - parser := resourceids.NewParserFromResourceIdType(&OfficeConsentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OfficeConsentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OfficeConsentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.ConsentId, ok = input.Parsed["consentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "consentId", input) - } - - return nil -} - -// ValidateOfficeConsentID checks that 'input' can be parsed as a Office Consent ID -func ValidateOfficeConsentID(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 := ParseOfficeConsentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Office Consent ID -func (id OfficeConsentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/officeConsents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.ConsentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Office Consent ID -func (id OfficeConsentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticOfficeConsents", "officeConsents", "officeConsents"), - resourceids.UserSpecifiedSegment("consentId", "consentIdValue"), - } -} - -// String returns a human-readable description of this Office Consent ID -func (id OfficeConsentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Consent: %q", id.ConsentId), - } - return fmt.Sprintf("Office Consent (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent_test.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent_test.go deleted file mode 100644 index d467492a7ed..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_officeconsent_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package officeconsents - -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 = &OfficeConsentId{} - -func TestNewOfficeConsentID(t *testing.T) { - id := NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.ConsentId != "consentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ConsentId'", id.ConsentId, "consentIdValue") - } -} - -func TestFormatOfficeConsentID(t *testing.T) { - actual := NewOfficeConsentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "consentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOfficeConsentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfficeConsentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue", - Expected: &OfficeConsentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - ConsentId: "consentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfficeConsentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.ConsentId != v.Expected.ConsentId { - t.Fatalf("Expected %q but got %q for ConsentId", v.Expected.ConsentId, actual.ConsentId) - } - - } -} - -func TestParseOfficeConsentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OfficeConsentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oFfIcEcOnSeNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue", - Expected: &OfficeConsentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - ConsentId: "consentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/officeConsents/consentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oFfIcEcOnSeNtS/cOnSeNtIdVaLuE", - Expected: &OfficeConsentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - ConsentId: "cOnSeNtIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oFfIcEcOnSeNtS/cOnSeNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOfficeConsentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.ConsentId != v.Expected.ConsentId { - t.Fatalf("Expected %q but got %q for ConsentId", v.Expected.ConsentId, actual.ConsentId) - } - - } -} - -func TestSegmentsForOfficeConsentId(t *testing.T) { - segments := OfficeConsentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OfficeConsentId 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/securityinsights/2022-07-01-preview/officeconsents/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace.go deleted file mode 100644 index 44c5f84d447..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package officeconsents - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace_test.go deleted file mode 100644 index 985c59ffc82..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package officeconsents - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/officeconsents/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_delete.go deleted file mode 100644 index 3c098e73784..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package officeconsents - -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 OfficeConsentsClient) Delete(ctx context.Context, id OfficeConsentId) (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/securityinsights/2022-07-01-preview/officeconsents/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_get.go deleted file mode 100644 index eb59e32eadb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package officeconsents - -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 *OfficeConsent -} - -// Get ... -func (c OfficeConsentsClient) Get(ctx context.Context, id OfficeConsentId) (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 OfficeConsent - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_list.go deleted file mode 100644 index e23bd7dddfb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package officeconsents - -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 *[]OfficeConsent -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []OfficeConsent -} - -// List ... -func (c OfficeConsentsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/officeConsents", 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 *[]OfficeConsent `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 OfficeConsentsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, OfficeConsentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c OfficeConsentsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate OfficeConsentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]OfficeConsent, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/officeconsents/model_officeconsent.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsent.go deleted file mode 100644 index 12d6f3bdb86..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsent.go +++ /dev/null @@ -1,16 +0,0 @@ -package officeconsents - -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 OfficeConsent struct { - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *OfficeConsentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsentproperties.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsentproperties.go deleted file mode 100644 index 547706a64b2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/model_officeconsentproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package officeconsents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeConsentProperties struct { - ConsentId *string `json:"consentId,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/predicates.go deleted file mode 100644 index de2081d698d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/predicates.go +++ /dev/null @@ -1,27 +0,0 @@ -package officeconsents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeConsentOperationPredicate struct { - Id *string - Name *string - Type *string -} - -func (p OfficeConsentOperationPredicate) Matches(input OfficeConsent) 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/securityinsights/2022-07-01-preview/officeconsents/version.go b/resource-manager/securityinsights/2022-07-01-preview/officeconsents/version.go deleted file mode 100644 index 8200f5402f5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/officeconsents/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package officeconsents - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/officeconsents/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/README.md b/resource-manager/securityinsights/2022-07-01-preview/repositories/README.md deleted file mode 100644 index 8a668f8f3d5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/README.md +++ /dev/null @@ -1,42 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/repositories` Documentation - -The `repositories` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/repositories" -``` - - -### Client Initialization - -```go -client := repositories.NewRepositoriesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `RepositoriesClient.SourceControllistRepositories` - -```go -ctx := context.TODO() -id := repositories.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := repositories.RepoType{ - // ... -} - - -// alternatively `client.SourceControllistRepositories(ctx, id, payload)` can be used to do batched pagination -items, err := client.SourceControllistRepositoriesComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/client.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/client.go deleted file mode 100644 index 62b7be88387..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package repositories - -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 RepositoriesClient struct { - Client *resourcemanager.Client -} - -func NewRepositoriesClientWithBaseURI(sdkApi sdkEnv.Api) (*RepositoriesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "repositories", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating RepositoriesClient: %+v", err) - } - - return &RepositoriesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/constants.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/constants.go deleted file mode 100644 index 828121b73be..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package repositories - -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 RepoType string - -const ( - RepoTypeDevOps RepoType = "DevOps" - RepoTypeGithub RepoType = "Github" -) - -func PossibleValuesForRepoType() []string { - return []string{ - string(RepoTypeDevOps), - string(RepoTypeGithub), - } -} - -func (s *RepoType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRepoType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRepoType(input string) (*RepoType, error) { - vals := map[string]RepoType{ - "devops": RepoTypeDevOps, - "github": RepoTypeGithub, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RepoType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace.go deleted file mode 100644 index d7e4ec6c5c6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package repositories - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace_test.go deleted file mode 100644 index 839f52ebb80..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package repositories - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/repositories/method_sourcecontrollistrepositories.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/method_sourcecontrollistrepositories.go deleted file mode 100644 index 3a007266273..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/method_sourcecontrollistrepositories.go +++ /dev/null @@ -1,91 +0,0 @@ -package repositories - -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 SourceControllistRepositoriesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]Repo -} - -type SourceControllistRepositoriesCompleteResult struct { - LatestHttpResponse *http.Response - Items []Repo -} - -// SourceControllistRepositories ... -func (c RepositoriesClient) SourceControllistRepositories(ctx context.Context, id WorkspaceId, input RepoType) (result SourceControllistRepositoriesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/listRepositories", 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 *[]Repo `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// SourceControllistRepositoriesComplete retrieves all the results into a single object -func (c RepositoriesClient) SourceControllistRepositoriesComplete(ctx context.Context, id WorkspaceId, input RepoType) (SourceControllistRepositoriesCompleteResult, error) { - return c.SourceControllistRepositoriesCompleteMatchingPredicate(ctx, id, input, RepoOperationPredicate{}) -} - -// SourceControllistRepositoriesCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c RepositoriesClient) SourceControllistRepositoriesCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input RepoType, predicate RepoOperationPredicate) (result SourceControllistRepositoriesCompleteResult, err error) { - items := make([]Repo, 0) - - resp, err := c.SourceControllistRepositories(ctx, id, input) - if err != nil { - 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 = SourceControllistRepositoriesCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/model_repo.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/model_repo.go deleted file mode 100644 index 01764dc29a8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/model_repo.go +++ /dev/null @@ -1,10 +0,0 @@ -package repositories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Repo struct { - Branches *[]string `json:"branches,omitempty"` - FullName *string `json:"fullName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/predicates.go deleted file mode 100644 index 948d5824d0f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/predicates.go +++ /dev/null @@ -1,22 +0,0 @@ -package repositories - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RepoOperationPredicate struct { - FullName *string - Url *string -} - -func (p RepoOperationPredicate) Matches(input Repo) bool { - - if p.FullName != nil && (input.FullName == nil || *p.FullName != *input.FullName) { - return false - } - - if p.Url != nil && (input.Url == nil || *p.Url != *input.Url) { - return false - } - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/repositories/version.go b/resource-manager/securityinsights/2022-07-01-preview/repositories/version.go deleted file mode 100644 index e6d5fe42ca7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/repositories/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package repositories - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/repositories/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/README.md b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/README.md deleted file mode 100644 index bc2499b36f1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings` Documentation - -The `securitymlanalyticssettings` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/securitymlanalyticssettings" -``` - - -### Client Initialization - -```go -client := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SecurityMLAnalyticsSettingsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - -payload := securitymlanalyticssettings.SecurityMLAnalyticsSetting{ - // ... -} - - -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: `SecurityMLAnalyticsSettingsClient.Delete` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - -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: `SecurityMLAnalyticsSettingsClient.Get` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - -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: `SecurityMLAnalyticsSettingsClient.List` - -```go -ctx := context.TODO() -id := securitymlanalyticssettings.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/securitymlanalyticssettings/client.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/client.go deleted file mode 100644 index 65b248a41f5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package securitymlanalyticssettings - -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 SecurityMLAnalyticsSettingsClient struct { - Client *resourcemanager.Client -} - -func NewSecurityMLAnalyticsSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*SecurityMLAnalyticsSettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "securitymlanalyticssettings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SecurityMLAnalyticsSettingsClient: %+v", err) - } - - return &SecurityMLAnalyticsSettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/constants.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/constants.go deleted file mode 100644 index e32d4d9875f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/constants.go +++ /dev/null @@ -1,175 +0,0 @@ -package securitymlanalyticssettings - -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 AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type SecurityMLAnalyticsSettingsKind string - -const ( - SecurityMLAnalyticsSettingsKindAnomaly SecurityMLAnalyticsSettingsKind = "Anomaly" -) - -func PossibleValuesForSecurityMLAnalyticsSettingsKind() []string { - return []string{ - string(SecurityMLAnalyticsSettingsKindAnomaly), - } -} - -func (s *SecurityMLAnalyticsSettingsKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSecurityMLAnalyticsSettingsKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSecurityMLAnalyticsSettingsKind(input string) (*SecurityMLAnalyticsSettingsKind, error) { - vals := map[string]SecurityMLAnalyticsSettingsKind{ - "anomaly": SecurityMLAnalyticsSettingsKindAnomaly, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SecurityMLAnalyticsSettingsKind(input) - return &out, nil -} - -type SettingsStatus string - -const ( - SettingsStatusFlighting SettingsStatus = "Flighting" - SettingsStatusProduction SettingsStatus = "Production" -) - -func PossibleValuesForSettingsStatus() []string { - return []string{ - string(SettingsStatusFlighting), - string(SettingsStatusProduction), - } -} - -func (s *SettingsStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingsStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingsStatus(input string) (*SettingsStatus, error) { - vals := map[string]SettingsStatus{ - "flighting": SettingsStatusFlighting, - "production": SettingsStatusProduction, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingsStatus(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go deleted file mode 100644 index 31b3fe0787d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting.go +++ /dev/null @@ -1,141 +0,0 @@ -package securitymlanalyticssettings - -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(&SecurityMLAnalyticsSettingId{}) -} - -var _ resourceids.ResourceId = &SecurityMLAnalyticsSettingId{} - -// SecurityMLAnalyticsSettingId is a struct representing the Resource ID for a Security M L Analytics Setting -type SecurityMLAnalyticsSettingId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - SecurityMLAnalyticsSettingName string -} - -// NewSecurityMLAnalyticsSettingID returns a new SecurityMLAnalyticsSettingId struct -func NewSecurityMLAnalyticsSettingID(subscriptionId string, resourceGroupName string, workspaceName string, securityMLAnalyticsSettingName string) SecurityMLAnalyticsSettingId { - return SecurityMLAnalyticsSettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - SecurityMLAnalyticsSettingName: securityMLAnalyticsSettingName, - } -} - -// ParseSecurityMLAnalyticsSettingID parses 'input' into a SecurityMLAnalyticsSettingId -func ParseSecurityMLAnalyticsSettingID(input string) (*SecurityMLAnalyticsSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityMLAnalyticsSettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityMLAnalyticsSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSecurityMLAnalyticsSettingIDInsensitively parses 'input' case-insensitively into a SecurityMLAnalyticsSettingId -// note: this method should only be used for API response data and not user input -func ParseSecurityMLAnalyticsSettingIDInsensitively(input string) (*SecurityMLAnalyticsSettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SecurityMLAnalyticsSettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SecurityMLAnalyticsSettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SecurityMLAnalyticsSettingId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.SecurityMLAnalyticsSettingName, ok = input.Parsed["securityMLAnalyticsSettingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "securityMLAnalyticsSettingName", input) - } - - return nil -} - -// ValidateSecurityMLAnalyticsSettingID checks that 'input' can be parsed as a Security M L Analytics Setting ID -func ValidateSecurityMLAnalyticsSettingID(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 := ParseSecurityMLAnalyticsSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Security M L Analytics Setting ID -func (id SecurityMLAnalyticsSettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SecurityMLAnalyticsSettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Security M L Analytics Setting ID -func (id SecurityMLAnalyticsSettingId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticSecurityMLAnalyticsSettings", "securityMLAnalyticsSettings", "securityMLAnalyticsSettings"), - resourceids.UserSpecifiedSegment("securityMLAnalyticsSettingName", "securityMLAnalyticsSettingValue"), - } -} - -// String returns a human-readable description of this Security M L Analytics Setting ID -func (id SecurityMLAnalyticsSettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Security M L Analytics Setting Name: %q", id.SecurityMLAnalyticsSettingName), - } - return fmt.Sprintf("Security M L Analytics Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go deleted file mode 100644 index 9c7c408775d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_securitymlanalyticssetting_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package securitymlanalyticssettings - -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 = &SecurityMLAnalyticsSettingId{} - -func TestNewSecurityMLAnalyticsSettingID(t *testing.T) { - id := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.SecurityMLAnalyticsSettingName != "securityMLAnalyticsSettingValue" { - t.Fatalf("Expected %q but got %q for Segment 'SecurityMLAnalyticsSettingName'", id.SecurityMLAnalyticsSettingName, "securityMLAnalyticsSettingValue") - } -} - -func TestFormatSecurityMLAnalyticsSettingID(t *testing.T) { - actual := NewSecurityMLAnalyticsSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "securityMLAnalyticsSettingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSecurityMLAnalyticsSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityMLAnalyticsSettingId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingValue", - Expected: &SecurityMLAnalyticsSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityMLAnalyticsSettingID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SecurityMLAnalyticsSettingName != v.Expected.SecurityMLAnalyticsSettingName { - t.Fatalf("Expected %q but got %q for SecurityMLAnalyticsSettingName", v.Expected.SecurityMLAnalyticsSettingName, actual.SecurityMLAnalyticsSettingName) - } - - } -} - -func TestParseSecurityMLAnalyticsSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SecurityMLAnalyticsSettingId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingValue", - Expected: &SecurityMLAnalyticsSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SecurityMLAnalyticsSettingName: "securityMLAnalyticsSettingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings/securityMLAnalyticsSettingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGvAlUe", - Expected: &SecurityMLAnalyticsSettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - SecurityMLAnalyticsSettingName: "sEcUrItYmLaNaLyTiCsSeTtInGvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEcUrItYmLaNaLyTiCsSeTtInGs/sEcUrItYmLaNaLyTiCsSeTtInGvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSecurityMLAnalyticsSettingIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SecurityMLAnalyticsSettingName != v.Expected.SecurityMLAnalyticsSettingName { - t.Fatalf("Expected %q but got %q for SecurityMLAnalyticsSettingName", v.Expected.SecurityMLAnalyticsSettingName, actual.SecurityMLAnalyticsSettingName) - } - - } -} - -func TestSegmentsForSecurityMLAnalyticsSettingId(t *testing.T) { - segments := SecurityMLAnalyticsSettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SecurityMLAnalyticsSettingId 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/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace.go deleted file mode 100644 index 07bf58f2dc1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package securitymlanalyticssettings - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace_test.go deleted file mode 100644 index 295514c2b54..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package securitymlanalyticssettings - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_createorupdate.go deleted file mode 100644 index f08267b7fac..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "encoding/json" - "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 *SecurityMLAnalyticsSetting -} - -// CreateOrUpdate ... -func (c SecurityMLAnalyticsSettingsClient) CreateOrUpdate(ctx context.Context, id SecurityMLAnalyticsSettingId, input SecurityMLAnalyticsSetting) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSecurityMLAnalyticsSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_delete.go deleted file mode 100644 index 36309ecb138..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package securitymlanalyticssettings - -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 SecurityMLAnalyticsSettingsClient) Delete(ctx context.Context, id SecurityMLAnalyticsSettingId) (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/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_get.go deleted file mode 100644 index 9be89fdf974..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "encoding/json" - "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 *SecurityMLAnalyticsSetting -} - -// Get ... -func (c SecurityMLAnalyticsSettingsClient) Get(ctx context.Context, id SecurityMLAnalyticsSettingId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSecurityMLAnalyticsSettingImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_list.go deleted file mode 100644 index 49878345af3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package securitymlanalyticssettings - -import ( - "context" - "encoding/json" - "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 *[]SecurityMLAnalyticsSetting -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SecurityMLAnalyticsSetting -} - -// List ... -func (c SecurityMLAnalyticsSettingsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/securityMLAnalyticsSettings", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]SecurityMLAnalyticsSetting, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalSecurityMLAnalyticsSettingImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for SecurityMLAnalyticsSetting (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c SecurityMLAnalyticsSettingsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SecurityMLAnalyticsSettingOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SecurityMLAnalyticsSettingsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate SecurityMLAnalyticsSettingOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SecurityMLAnalyticsSetting, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go deleted file mode 100644 index 488f0b735f1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettings.go +++ /dev/null @@ -1,48 +0,0 @@ -package securitymlanalyticssettings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ SecurityMLAnalyticsSetting = AnomalySecurityMLAnalyticsSettings{} - -type AnomalySecurityMLAnalyticsSettings struct { - Properties *AnomalySecurityMLAnalyticsSettingsProperties `json:"properties,omitempty"` - - // Fields inherited from SecurityMLAnalyticsSetting - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AnomalySecurityMLAnalyticsSettings{} - -func (s AnomalySecurityMLAnalyticsSettings) MarshalJSON() ([]byte, error) { - type wrapper AnomalySecurityMLAnalyticsSettings - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AnomalySecurityMLAnalyticsSettings: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AnomalySecurityMLAnalyticsSettings: %+v", err) - } - decoded["kind"] = "Anomaly" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AnomalySecurityMLAnalyticsSettings: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go deleted file mode 100644 index 99a6e024a1c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_anomalysecuritymlanalyticssettingsproperties.go +++ /dev/null @@ -1,39 +0,0 @@ -package securitymlanalyticssettings - -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 AnomalySecurityMLAnalyticsSettingsProperties struct { - AnomalySettingsVersion *int64 `json:"anomalySettingsVersion,omitempty"` - AnomalyVersion string `json:"anomalyVersion"` - CustomizableObservations *interface{} `json:"customizableObservations,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - Frequency string `json:"frequency"` - IsDefaultSettings bool `json:"isDefaultSettings"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - RequiredDataConnectors *[]SecurityMLAnalyticsSettingsDataSource `json:"requiredDataConnectors,omitempty"` - SettingsDefinitionId *string `json:"settingsDefinitionId,omitempty"` - SettingsStatus SettingsStatus `json:"settingsStatus"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *AnomalySecurityMLAnalyticsSettingsProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AnomalySecurityMLAnalyticsSettingsProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssetting.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssetting.go deleted file mode 100644 index 85a395baf6a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssetting.go +++ /dev/null @@ -1,53 +0,0 @@ -package securitymlanalyticssettings - -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 SecurityMLAnalyticsSetting interface { -} - -// RawSecurityMLAnalyticsSettingImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSecurityMLAnalyticsSettingImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalSecurityMLAnalyticsSettingImplementation(input []byte) (SecurityMLAnalyticsSetting, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityMLAnalyticsSetting into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Anomaly") { - var out AnomalySecurityMLAnalyticsSettings - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AnomalySecurityMLAnalyticsSettings: %+v", err) - } - return out, nil - } - - out := RawSecurityMLAnalyticsSettingImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go deleted file mode 100644 index 6258b6b3094..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/model_securitymlanalyticssettingsdatasource.go +++ /dev/null @@ -1,9 +0,0 @@ -package securitymlanalyticssettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingsDataSource struct { - ConnectorId *string `json:"connectorId,omitempty"` - DataTypes *[]string `json:"dataTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/predicates.go deleted file mode 100644 index 7e6211c7d91..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitymlanalyticssettings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityMLAnalyticsSettingOperationPredicate struct { -} - -func (p SecurityMLAnalyticsSettingOperationPredicate) Matches(input SecurityMLAnalyticsSetting) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/version.go b/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/version.go deleted file mode 100644 index 1a45471c54a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/securitymlanalyticssettings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package securitymlanalyticssettings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/securitymlanalyticssettings/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/README.md deleted file mode 100644 index cf9dd7d50f5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/README.md +++ /dev/null @@ -1,89 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates` Documentation - -The `sentinelonboardingstates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/sentinelonboardingstates" -``` - - -### Client Initialization - -```go -client := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SentinelOnboardingStatesClient.Create` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -payload := sentinelonboardingstates.SentinelOnboardingState{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SentinelOnboardingStatesClient.Delete` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -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: `SentinelOnboardingStatesClient.Get` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -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: `SentinelOnboardingStatesClient.List` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -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/securityinsights/2022-07-01-preview/sentinelonboardingstates/client.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/client.go deleted file mode 100644 index 94701ed853a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingStatesClient struct { - Client *resourcemanager.Client -} - -func NewSentinelOnboardingStatesClientWithBaseURI(sdkApi sdkEnv.Api) (*SentinelOnboardingStatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sentinelonboardingstates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SentinelOnboardingStatesClient: %+v", err) - } - - return &SentinelOnboardingStatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate.go deleted file mode 100644 index a0b15d704d4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate.go +++ /dev/null @@ -1,141 +0,0 @@ -package sentinelonboardingstates - -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(&OnboardingStateId{}) -} - -var _ resourceids.ResourceId = &OnboardingStateId{} - -// OnboardingStateId is a struct representing the Resource ID for a Onboarding State -type OnboardingStateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - OnboardingStateName string -} - -// NewOnboardingStateID returns a new OnboardingStateId struct -func NewOnboardingStateID(subscriptionId string, resourceGroupName string, workspaceName string, onboardingStateName string) OnboardingStateId { - return OnboardingStateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - OnboardingStateName: onboardingStateName, - } -} - -// ParseOnboardingStateID parses 'input' into a OnboardingStateId -func ParseOnboardingStateID(input string) (*OnboardingStateId, error) { - parser := resourceids.NewParserFromResourceIdType(&OnboardingStateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OnboardingStateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOnboardingStateIDInsensitively parses 'input' case-insensitively into a OnboardingStateId -// note: this method should only be used for API response data and not user input -func ParseOnboardingStateIDInsensitively(input string) (*OnboardingStateId, error) { - parser := resourceids.NewParserFromResourceIdType(&OnboardingStateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OnboardingStateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OnboardingStateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.OnboardingStateName, ok = input.Parsed["onboardingStateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "onboardingStateName", input) - } - - return nil -} - -// ValidateOnboardingStateID checks that 'input' can be parsed as a Onboarding State ID -func ValidateOnboardingStateID(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 := ParseOnboardingStateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Onboarding State ID -func (id OnboardingStateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/onboardingStates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.OnboardingStateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Onboarding State ID -func (id OnboardingStateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateValue"), - } -} - -// String returns a human-readable description of this Onboarding State ID -func (id OnboardingStateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Onboarding State Name: %q", id.OnboardingStateName), - } - return fmt.Sprintf("Onboarding State (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate_test.go deleted file mode 100644 index 2f1b37538f9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_onboardingstate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package sentinelonboardingstates - -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 = &OnboardingStateId{} - -func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.OnboardingStateName != "onboardingStateValue" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateValue") - } -} - -func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOnboardingStateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OnboardingStateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - OnboardingStateName: "onboardingStateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOnboardingStateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.OnboardingStateName != v.Expected.OnboardingStateName { - t.Fatalf("Expected %q but got %q for OnboardingStateName", v.Expected.OnboardingStateName, actual.OnboardingStateName) - } - - } -} - -func TestParseOnboardingStateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OnboardingStateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - OnboardingStateName: "onboardingStateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeVaLuE", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - OnboardingStateName: "oNbOaRdInGsTaTeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOnboardingStateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.OnboardingStateName != v.Expected.OnboardingStateName { - t.Fatalf("Expected %q but got %q for OnboardingStateName", v.Expected.OnboardingStateName, actual.OnboardingStateName) - } - - } -} - -func TestSegmentsForOnboardingStateId(t *testing.T) { - segments := OnboardingStateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OnboardingStateId 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/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace.go deleted file mode 100644 index 25f0d18c095..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package sentinelonboardingstates - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace_test.go deleted file mode 100644 index b50fc815542..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package sentinelonboardingstates - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_create.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_create.go deleted file mode 100644 index be0336fbcee..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package sentinelonboardingstates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SentinelOnboardingState -} - -// Create ... -func (c SentinelOnboardingStatesClient) Create(ctx context.Context, id OnboardingStateId, input SentinelOnboardingState) (result CreateOperationResponse, 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 SentinelOnboardingState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_delete.go deleted file mode 100644 index 1c6c5e372d7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingStatesClient) Delete(ctx context.Context, id OnboardingStateId) (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/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_get.go deleted file mode 100644 index e7b2c2cb86b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package sentinelonboardingstates - -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 *SentinelOnboardingState -} - -// Get ... -func (c SentinelOnboardingStatesClient) Get(ctx context.Context, id OnboardingStateId) (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 SentinelOnboardingState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_list.go deleted file mode 100644 index d53893d7842..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package sentinelonboardingstates - -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 *SentinelOnboardingStatesList -} - -// List ... -func (c SentinelOnboardingStatesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/onboardingStates", 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 SentinelOnboardingStatesList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go deleted file mode 100644 index c514c418596..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstate.go +++ /dev/null @@ -1,17 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingState struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SentinelOnboardingStateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go deleted file mode 100644 index 366f9e1623d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package sentinelonboardingstates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SentinelOnboardingStateProperties struct { - CustomerManagedKey *bool `json:"customerManagedKey,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go deleted file mode 100644 index e601995e41b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/model_sentinelonboardingstateslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package sentinelonboardingstates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SentinelOnboardingStatesList struct { - Value []SentinelOnboardingState `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/version.go b/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/version.go deleted file mode 100644 index 9d7b33d8f68..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sentinelonboardingstates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package sentinelonboardingstates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/sentinelonboardingstates/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/README.md b/resource-manager/securityinsights/2022-07-01-preview/settings/README.md deleted file mode 100644 index ef5243edc83..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/README.md +++ /dev/null @@ -1,89 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/settings` Documentation - -The `settings` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/settings" -``` - - -### Client Initialization - -```go -client := settings.NewSettingsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SettingsClient.ProductSettingsDelete` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - -read, err := client.ProductSettingsDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SettingsClient.ProductSettingsGet` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - -read, err := client.ProductSettingsGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SettingsClient.ProductSettingsList` - -```go -ctx := context.TODO() -id := settings.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -read, err := client.ProductSettingsList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SettingsClient.ProductSettingsUpdate` - -```go -ctx := context.TODO() -id := settings.NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - -payload := settings.Settings{ - // ... -} - - -read, err := client.ProductSettingsUpdate(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/securityinsights/2022-07-01-preview/settings/client.go b/resource-manager/securityinsights/2022-07-01-preview/settings/client.go deleted file mode 100644 index 7a9bd9ec8a1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package settings - -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 SettingsClient struct { - Client *resourcemanager.Client -} - -func NewSettingsClientWithBaseURI(sdkApi sdkEnv.Api) (*SettingsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "settings", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SettingsClient: %+v", err) - } - - return &SettingsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/constants.go b/resource-manager/securityinsights/2022-07-01-preview/settings/constants.go deleted file mode 100644 index 22f9ec6323d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/constants.go +++ /dev/null @@ -1,145 +0,0 @@ -package settings - -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 EntityProviders string - -const ( - EntityProvidersActiveDirectory EntityProviders = "ActiveDirectory" - EntityProvidersAzureActiveDirectory EntityProviders = "AzureActiveDirectory" -) - -func PossibleValuesForEntityProviders() []string { - return []string{ - string(EntityProvidersActiveDirectory), - string(EntityProvidersAzureActiveDirectory), - } -} - -func (s *EntityProviders) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityProviders(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityProviders(input string) (*EntityProviders, error) { - vals := map[string]EntityProviders{ - "activedirectory": EntityProvidersActiveDirectory, - "azureactivedirectory": EntityProvidersAzureActiveDirectory, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityProviders(input) - return &out, nil -} - -type SettingKind string - -const ( - SettingKindAnomalies SettingKind = "Anomalies" - SettingKindEntityAnalytics SettingKind = "EntityAnalytics" - SettingKindEyesOn SettingKind = "EyesOn" - SettingKindUeba SettingKind = "Ueba" -) - -func PossibleValuesForSettingKind() []string { - return []string{ - string(SettingKindAnomalies), - string(SettingKindEntityAnalytics), - string(SettingKindEyesOn), - string(SettingKindUeba), - } -} - -func (s *SettingKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSettingKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSettingKind(input string) (*SettingKind, error) { - vals := map[string]SettingKind{ - "anomalies": SettingKindAnomalies, - "entityanalytics": SettingKindEntityAnalytics, - "eyeson": SettingKindEyesOn, - "ueba": SettingKindUeba, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SettingKind(input) - return &out, nil -} - -type UebaDataSources string - -const ( - UebaDataSourcesAuditLogs UebaDataSources = "AuditLogs" - UebaDataSourcesAzureActivity UebaDataSources = "AzureActivity" - UebaDataSourcesSecurityEvent UebaDataSources = "SecurityEvent" - UebaDataSourcesSigninLogs UebaDataSources = "SigninLogs" -) - -func PossibleValuesForUebaDataSources() []string { - return []string{ - string(UebaDataSourcesAuditLogs), - string(UebaDataSourcesAzureActivity), - string(UebaDataSourcesSecurityEvent), - string(UebaDataSourcesSigninLogs), - } -} - -func (s *UebaDataSources) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseUebaDataSources(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseUebaDataSources(input string) (*UebaDataSources, error) { - vals := map[string]UebaDataSources{ - "auditlogs": UebaDataSourcesAuditLogs, - "azureactivity": UebaDataSourcesAzureActivity, - "securityevent": UebaDataSourcesSecurityEvent, - "signinlogs": UebaDataSourcesSigninLogs, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := UebaDataSources(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/id_setting.go b/resource-manager/securityinsights/2022-07-01-preview/settings/id_setting.go deleted file mode 100644 index 90889b749de..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/id_setting.go +++ /dev/null @@ -1,141 +0,0 @@ -package settings - -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(&SettingId{}) -} - -var _ resourceids.ResourceId = &SettingId{} - -// SettingId is a struct representing the Resource ID for a Setting -type SettingId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - SettingName string -} - -// NewSettingID returns a new SettingId struct -func NewSettingID(subscriptionId string, resourceGroupName string, workspaceName string, settingName string) SettingId { - return SettingId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - SettingName: settingName, - } -} - -// ParseSettingID parses 'input' into a SettingId -func ParseSettingID(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSettingIDInsensitively parses 'input' case-insensitively into a SettingId -// note: this method should only be used for API response data and not user input -func ParseSettingIDInsensitively(input string) (*SettingId, error) { - parser := resourceids.NewParserFromResourceIdType(&SettingId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SettingId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SettingId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.SettingName, ok = input.Parsed["settingName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "settingName", input) - } - - return nil -} - -// ValidateSettingID checks that 'input' can be parsed as a Setting ID -func ValidateSettingID(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 := ParseSettingID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Setting ID -func (id SettingId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/settings/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SettingName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Setting ID -func (id SettingId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticSettings", "settings", "settings"), - resourceids.UserSpecifiedSegment("settingName", "settingValue"), - } -} - -// String returns a human-readable description of this Setting ID -func (id SettingId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Setting Name: %q", id.SettingName), - } - return fmt.Sprintf("Setting (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/id_setting_test.go b/resource-manager/securityinsights/2022-07-01-preview/settings/id_setting_test.go deleted file mode 100644 index 73d5eec1834..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/id_setting_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package settings - -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 = &SettingId{} - -func TestNewSettingID(t *testing.T) { - id := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.SettingName != "settingValue" { - t.Fatalf("Expected %q but got %q for Segment 'SettingName'", id.SettingName, "settingValue") - } -} - -func TestFormatSettingID(t *testing.T) { - actual := NewSettingID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "settingValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSettingID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SettingName: "settingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestParseSettingIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SettingId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SettingName: "settingValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/settings/settingValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgVaLuE", - Expected: &SettingId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - SettingName: "sEtTiNgVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sEtTiNgS/sEtTiNgVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSettingIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SettingName != v.Expected.SettingName { - t.Fatalf("Expected %q but got %q for SettingName", v.Expected.SettingName, actual.SettingName) - } - - } -} - -func TestSegmentsForSettingId(t *testing.T) { - segments := SettingId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SettingId 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/securityinsights/2022-07-01-preview/settings/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace.go deleted file mode 100644 index e001d01ad15..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package settings - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace_test.go deleted file mode 100644 index b1c2389e272..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package settings - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/settings/method_productsettingsdelete.go b/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsdelete.go deleted file mode 100644 index 3306b03a761..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsdelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package settings - -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 ProductSettingsDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// ProductSettingsDelete ... -func (c SettingsClient) ProductSettingsDelete(ctx context.Context, id SettingId) (result ProductSettingsDeleteOperationResponse, 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/securityinsights/2022-07-01-preview/settings/method_productsettingsget.go b/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsget.go deleted file mode 100644 index 3d546bae766..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsget.go +++ /dev/null @@ -1,58 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 ProductSettingsGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Settings -} - -// ProductSettingsGet ... -func (c SettingsClient) ProductSettingsGet(ctx context.Context, id SettingId) (result ProductSettingsGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingsImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingslist.go b/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingslist.go deleted file mode 100644 index 8c3a8350b7a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package settings - -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 ProductSettingsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SettingList -} - -// ProductSettingsList ... -func (c SettingsClient) ProductSettingsList(ctx context.Context, id WorkspaceId) (result ProductSettingsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/settings", 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 SettingList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsupdate.go b/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsupdate.go deleted file mode 100644 index 1f33013bb47..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/method_productsettingsupdate.go +++ /dev/null @@ -1,62 +0,0 @@ -package settings - -import ( - "context" - "encoding/json" - "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 ProductSettingsUpdateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *Settings -} - -// ProductSettingsUpdate ... -func (c SettingsClient) ProductSettingsUpdate(ctx context.Context, id SettingId, input Settings) (result ProductSettingsUpdateOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalSettingsImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_anomalies.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_anomalies.go deleted file mode 100644 index 625b817d33e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_anomalies.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = Anomalies{} - -type Anomalies struct { - Properties *AnomaliesSettingsProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Anomalies{} - -func (s Anomalies) MarshalJSON() ([]byte, error) { - type wrapper Anomalies - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Anomalies: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Anomalies: %+v", err) - } - decoded["kind"] = "Anomalies" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Anomalies: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_anomaliessettingsproperties.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_anomaliessettingsproperties.go deleted file mode 100644 index b93bec5e558..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_anomaliessettingsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AnomaliesSettingsProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalytics.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalytics.go deleted file mode 100644 index 1ce4b746aba..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalytics.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = EntityAnalytics{} - -type EntityAnalytics struct { - Properties *EntityAnalyticsProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = EntityAnalytics{} - -func (s EntityAnalytics) MarshalJSON() ([]byte, error) { - type wrapper EntityAnalytics - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EntityAnalytics: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EntityAnalytics: %+v", err) - } - decoded["kind"] = "EntityAnalytics" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EntityAnalytics: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalyticsproperties.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalyticsproperties.go deleted file mode 100644 index fea75d8b7f1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_entityanalyticsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityAnalyticsProperties struct { - EntityProviders *[]EntityProviders `json:"entityProviders,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_eyeson.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_eyeson.go deleted file mode 100644 index e392345fefe..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_eyeson.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = EyesOn{} - -type EyesOn struct { - Properties *EyesOnSettingsProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = EyesOn{} - -func (s EyesOn) MarshalJSON() ([]byte, error) { - type wrapper EyesOn - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling EyesOn: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling EyesOn: %+v", err) - } - decoded["kind"] = "EyesOn" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling EyesOn: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_eyesonsettingsproperties.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_eyesonsettingsproperties.go deleted file mode 100644 index b1e4ab84344..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_eyesonsettingsproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EyesOnSettingsProperties struct { - IsEnabled *bool `json:"isEnabled,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_settinglist.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_settinglist.go deleted file mode 100644 index f5eb0f61e00..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_settinglist.go +++ /dev/null @@ -1,41 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SettingList struct { - Value []Settings `json:"value"` -} - -var _ json.Unmarshaler = &SettingList{} - -func (s *SettingList) UnmarshalJSON(bytes []byte) error { - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling SettingList into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["value"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Value into list []json.RawMessage: %+v", err) - } - - output := make([]Settings, 0) - for i, val := range listTemp { - impl, err := unmarshalSettingsImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Value' for 'SettingList': %+v", i, err) - } - output = append(output, impl) - } - s.Value = output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_settings.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_settings.go deleted file mode 100644 index f091da772d6..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_settings.go +++ /dev/null @@ -1,77 +0,0 @@ -package settings - -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 Settings interface { -} - -// RawSettingsImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawSettingsImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalSettingsImplementation(input []byte) (Settings, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Settings into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Anomalies") { - var out Anomalies - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Anomalies: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "EntityAnalytics") { - var out EntityAnalytics - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EntityAnalytics: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "EyesOn") { - var out EyesOn - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into EyesOn: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Ueba") { - var out Ueba - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into Ueba: %+v", err) - } - return out, nil - } - - out := RawSettingsImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_ueba.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_ueba.go deleted file mode 100644 index 2c897343bb4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_ueba.go +++ /dev/null @@ -1,48 +0,0 @@ -package settings - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Settings = Ueba{} - -type Ueba struct { - Properties *UebaProperties `json:"properties,omitempty"` - - // Fields inherited from Settings - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = Ueba{} - -func (s Ueba) MarshalJSON() ([]byte, error) { - type wrapper Ueba - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling Ueba: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling Ueba: %+v", err) - } - decoded["kind"] = "Ueba" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling Ueba: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/model_uebaproperties.go b/resource-manager/securityinsights/2022-07-01-preview/settings/model_uebaproperties.go deleted file mode 100644 index 46b6a2832b4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/model_uebaproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package settings - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UebaProperties struct { - DataSources *[]UebaDataSources `json:"dataSources,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/settings/version.go b/resource-manager/securityinsights/2022-07-01-preview/settings/version.go deleted file mode 100644 index 4409f6b2545..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/settings/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package settings - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/settings/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/README.md b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/README.md deleted file mode 100644 index 9c1206d01a4..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols` Documentation - -The `sourcecontrols` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/sourcecontrols" -``` - - -### Client Initialization - -```go -client := sourcecontrols.NewSourceControlsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SourceControlsClient.Create` - -```go -ctx := context.TODO() -id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - -payload := sourcecontrols.SourceControl{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SourceControlsClient.Delete` - -```go -ctx := context.TODO() -id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - -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: `SourceControlsClient.Get` - -```go -ctx := context.TODO() -id := sourcecontrols.NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - -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: `SourceControlsClient.List` - -```go -ctx := context.TODO() -id := sourcecontrols.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/sourcecontrols/client.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/client.go deleted file mode 100644 index 9bfd651a63a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sourcecontrols - -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 SourceControlsClient struct { - Client *resourcemanager.Client -} - -func NewSourceControlsClientWithBaseURI(sdkApi sdkEnv.Api) (*SourceControlsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sourcecontrols", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SourceControlsClient: %+v", err) - } - - return &SourceControlsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/constants.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/constants.go deleted file mode 100644 index d134677e70c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/constants.go +++ /dev/null @@ -1,268 +0,0 @@ -package sourcecontrols - -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 ContentType string - -const ( - ContentTypeAnalyticRule ContentType = "AnalyticRule" - ContentTypeWorkbook ContentType = "Workbook" -) - -func PossibleValuesForContentType() []string { - return []string{ - string(ContentTypeAnalyticRule), - string(ContentTypeWorkbook), - } -} - -func (s *ContentType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseContentType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseContentType(input string) (*ContentType, error) { - vals := map[string]ContentType{ - "analyticrule": ContentTypeAnalyticRule, - "workbook": ContentTypeWorkbook, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ContentType(input) - return &out, nil -} - -type DeploymentFetchStatus string - -const ( - DeploymentFetchStatusNotFound DeploymentFetchStatus = "NotFound" - DeploymentFetchStatusSuccess DeploymentFetchStatus = "Success" - DeploymentFetchStatusUnauthorized DeploymentFetchStatus = "Unauthorized" -) - -func PossibleValuesForDeploymentFetchStatus() []string { - return []string{ - string(DeploymentFetchStatusNotFound), - string(DeploymentFetchStatusSuccess), - string(DeploymentFetchStatusUnauthorized), - } -} - -func (s *DeploymentFetchStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeploymentFetchStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeploymentFetchStatus(input string) (*DeploymentFetchStatus, error) { - vals := map[string]DeploymentFetchStatus{ - "notfound": DeploymentFetchStatusNotFound, - "success": DeploymentFetchStatusSuccess, - "unauthorized": DeploymentFetchStatusUnauthorized, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeploymentFetchStatus(input) - return &out, nil -} - -type DeploymentResult string - -const ( - DeploymentResultCanceled DeploymentResult = "Canceled" - DeploymentResultFailed DeploymentResult = "Failed" - DeploymentResultSuccess DeploymentResult = "Success" -) - -func PossibleValuesForDeploymentResult() []string { - return []string{ - string(DeploymentResultCanceled), - string(DeploymentResultFailed), - string(DeploymentResultSuccess), - } -} - -func (s *DeploymentResult) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeploymentResult(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeploymentResult(input string) (*DeploymentResult, error) { - vals := map[string]DeploymentResult{ - "canceled": DeploymentResultCanceled, - "failed": DeploymentResultFailed, - "success": DeploymentResultSuccess, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeploymentResult(input) - return &out, nil -} - -type DeploymentState string - -const ( - DeploymentStateCanceling DeploymentState = "Canceling" - DeploymentStateCompleted DeploymentState = "Completed" - DeploymentStateInProgress DeploymentState = "In_Progress" - DeploymentStateQueued DeploymentState = "Queued" -) - -func PossibleValuesForDeploymentState() []string { - return []string{ - string(DeploymentStateCanceling), - string(DeploymentStateCompleted), - string(DeploymentStateInProgress), - string(DeploymentStateQueued), - } -} - -func (s *DeploymentState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeploymentState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeploymentState(input string) (*DeploymentState, error) { - vals := map[string]DeploymentState{ - "canceling": DeploymentStateCanceling, - "completed": DeploymentStateCompleted, - "in_progress": DeploymentStateInProgress, - "queued": DeploymentStateQueued, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeploymentState(input) - return &out, nil -} - -type RepoType string - -const ( - RepoTypeDevOps RepoType = "DevOps" - RepoTypeGithub RepoType = "Github" -) - -func PossibleValuesForRepoType() []string { - return []string{ - string(RepoTypeDevOps), - string(RepoTypeGithub), - } -} - -func (s *RepoType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRepoType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRepoType(input string) (*RepoType, error) { - vals := map[string]RepoType{ - "devops": RepoTypeDevOps, - "github": RepoTypeGithub, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RepoType(input) - return &out, nil -} - -type Version string - -const ( - VersionVOne Version = "V1" - VersionVTwo Version = "V2" -) - -func PossibleValuesForVersion() []string { - return []string{ - string(VersionVOne), - string(VersionVTwo), - } -} - -func (s *Version) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseVersion(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseVersion(input string) (*Version, error) { - vals := map[string]Version{ - "v1": VersionVOne, - "v2": VersionVTwo, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Version(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol.go deleted file mode 100644 index e31a40901b7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol.go +++ /dev/null @@ -1,141 +0,0 @@ -package sourcecontrols - -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(&SourceControlId{}) -} - -var _ resourceids.ResourceId = &SourceControlId{} - -// SourceControlId is a struct representing the Resource ID for a Source Control -type SourceControlId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - SourceControlId string -} - -// NewSourceControlID returns a new SourceControlId struct -func NewSourceControlID(subscriptionId string, resourceGroupName string, workspaceName string, sourceControlId string) SourceControlId { - return SourceControlId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - SourceControlId: sourceControlId, - } -} - -// ParseSourceControlID parses 'input' into a SourceControlId -func ParseSourceControlID(input string) (*SourceControlId, error) { - parser := resourceids.NewParserFromResourceIdType(&SourceControlId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SourceControlId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseSourceControlIDInsensitively parses 'input' case-insensitively into a SourceControlId -// note: this method should only be used for API response data and not user input -func ParseSourceControlIDInsensitively(input string) (*SourceControlId, error) { - parser := resourceids.NewParserFromResourceIdType(&SourceControlId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := SourceControlId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *SourceControlId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.SourceControlId, ok = input.Parsed["sourceControlId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "sourceControlId", input) - } - - return nil -} - -// ValidateSourceControlID checks that 'input' can be parsed as a Source Control ID -func ValidateSourceControlID(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 := ParseSourceControlID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Source Control ID -func (id SourceControlId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/sourceControls/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.SourceControlId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Source Control ID -func (id SourceControlId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticSourceControls", "sourceControls", "sourceControls"), - resourceids.UserSpecifiedSegment("sourceControlId", "sourceControlIdValue"), - } -} - -// String returns a human-readable description of this Source Control ID -func (id SourceControlId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Source Control: %q", id.SourceControlId), - } - return fmt.Sprintf("Source Control (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol_test.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol_test.go deleted file mode 100644 index 99bab4e60fb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_sourcecontrol_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package sourcecontrols - -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 = &SourceControlId{} - -func TestNewSourceControlID(t *testing.T) { - id := NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.SourceControlId != "sourceControlIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'SourceControlId'", id.SourceControlId, "sourceControlIdValue") - } -} - -func TestFormatSourceControlID(t *testing.T) { - actual := NewSourceControlID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "sourceControlIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseSourceControlID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SourceControlId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue", - Expected: &SourceControlId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SourceControlId: "sourceControlIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSourceControlID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SourceControlId != v.Expected.SourceControlId { - t.Fatalf("Expected %q but got %q for SourceControlId", v.Expected.SourceControlId, actual.SourceControlId) - } - - } -} - -func TestParseSourceControlIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *SourceControlId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sOuRcEcOnTrOlS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue", - Expected: &SourceControlId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - SourceControlId: "sourceControlIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/sourceControls/sourceControlIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sOuRcEcOnTrOlS/sOuRcEcOnTrOlIdVaLuE", - Expected: &SourceControlId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - SourceControlId: "sOuRcEcOnTrOlIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/sOuRcEcOnTrOlS/sOuRcEcOnTrOlIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseSourceControlIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.SourceControlId != v.Expected.SourceControlId { - t.Fatalf("Expected %q but got %q for SourceControlId", v.Expected.SourceControlId, actual.SourceControlId) - } - - } -} - -func TestSegmentsForSourceControlId(t *testing.T) { - segments := SourceControlId{}.Segments() - if len(segments) == 0 { - t.Fatalf("SourceControlId 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/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace.go deleted file mode 100644 index ebdc1ecef81..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package sourcecontrols - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace_test.go deleted file mode 100644 index e8eeb2a6dee..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package sourcecontrols - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/sourcecontrols/method_create.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_create.go deleted file mode 100644 index 5df3dad0407..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package sourcecontrols - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SourceControl -} - -// Create ... -func (c SourceControlsClient) Create(ctx context.Context, id SourceControlId, input SourceControl) (result CreateOperationResponse, 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 SourceControl - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_delete.go deleted file mode 100644 index 579d919b3df..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package sourcecontrols - -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 SourceControlsClient) Delete(ctx context.Context, id SourceControlId) (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/securityinsights/2022-07-01-preview/sourcecontrols/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_get.go deleted file mode 100644 index dccc280d648..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package sourcecontrols - -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 *SourceControl -} - -// Get ... -func (c SourceControlsClient) Get(ctx context.Context, id SourceControlId) (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 SourceControl - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_list.go deleted file mode 100644 index f058d0ec61e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package sourcecontrols - -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 *[]SourceControl -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []SourceControl -} - -// List ... -func (c SourceControlsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/sourceControls", 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 *[]SourceControl `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 SourceControlsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, SourceControlOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c SourceControlsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate SourceControlOperationPredicate) (result ListCompleteResult, err error) { - items := make([]SourceControl, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/sourcecontrols/model_azuredevopsresourceinfo.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_azuredevopsresourceinfo.go deleted file mode 100644 index cf636fa854c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_azuredevopsresourceinfo.go +++ /dev/null @@ -1,9 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureDevOpsResourceInfo struct { - PipelineId *string `json:"pipelineId,omitempty"` - ServiceConnectionId *string `json:"serviceConnectionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_contentpathmap.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_contentpathmap.go deleted file mode 100644 index 236954d4dd9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_contentpathmap.go +++ /dev/null @@ -1,9 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ContentPathMap struct { - ContentType *ContentType `json:"contentType,omitempty"` - Path *string `json:"path,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deployment.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deployment.go deleted file mode 100644 index 11a744036f1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deployment.go +++ /dev/null @@ -1,30 +0,0 @@ -package sourcecontrols - -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 Deployment struct { - DeploymentId *string `json:"deploymentId,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` - DeploymentResult *DeploymentResult `json:"deploymentResult,omitempty"` - DeploymentState *DeploymentState `json:"deploymentState,omitempty"` - DeploymentTime *string `json:"deploymentTime,omitempty"` -} - -func (o *Deployment) GetDeploymentTimeAsTime() (*time.Time, error) { - if o.DeploymentTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.DeploymentTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *Deployment) SetDeploymentTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.DeploymentTime = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deploymentinfo.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deploymentinfo.go deleted file mode 100644 index 77091f7aa8b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_deploymentinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DeploymentInfo struct { - Deployment *Deployment `json:"deployment,omitempty"` - DeploymentFetchStatus *DeploymentFetchStatus `json:"deploymentFetchStatus,omitempty"` - Message *string `json:"message,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_githubresourceinfo.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_githubresourceinfo.go deleted file mode 100644 index f9d075ecfe2..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_githubresourceinfo.go +++ /dev/null @@ -1,8 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GitHubResourceInfo struct { - AppInstallationId *string `json:"appInstallationId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repository.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repository.go deleted file mode 100644 index fc80c1eb57b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repository.go +++ /dev/null @@ -1,12 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Repository struct { - Branch *string `json:"branch,omitempty"` - DeploymentLogsUrl *string `json:"deploymentLogsUrl,omitempty"` - DisplayUrl *string `json:"displayUrl,omitempty"` - PathMapping *[]ContentPathMap `json:"pathMapping,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repositoryresourceinfo.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repositoryresourceinfo.go deleted file mode 100644 index 9dbb318bc54..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_repositoryresourceinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RepositoryResourceInfo struct { - AzureDevOpsResourceInfo *AzureDevOpsResourceInfo `json:"azureDevOpsResourceInfo,omitempty"` - GitHubResourceInfo *GitHubResourceInfo `json:"gitHubResourceInfo,omitempty"` - Webhook *Webhook `json:"webhook,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrol.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrol.go deleted file mode 100644 index b0be9ef4aeb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrol.go +++ /dev/null @@ -1,17 +0,0 @@ -package sourcecontrols - -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 SourceControl struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SourceControlProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrolproperties.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrolproperties.go deleted file mode 100644 index d959883c065..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_sourcecontrolproperties.go +++ /dev/null @@ -1,16 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceControlProperties struct { - ContentTypes []ContentType `json:"contentTypes"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Id *string `json:"id,omitempty"` - LastDeploymentInfo *DeploymentInfo `json:"lastDeploymentInfo,omitempty"` - RepoType RepoType `json:"repoType"` - Repository Repository `json:"repository"` - RepositoryResourceInfo *RepositoryResourceInfo `json:"repositoryResourceInfo,omitempty"` - Version *Version `json:"version,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_webhook.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_webhook.go deleted file mode 100644 index 413967f4740..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/model_webhook.go +++ /dev/null @@ -1,11 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type Webhook struct { - RotateWebhookSecret *bool `json:"rotateWebhookSecret,omitempty"` - WebhookId *string `json:"webhookId,omitempty"` - WebhookSecretUpdateTime *string `json:"webhookSecretUpdateTime,omitempty"` - WebhookUrl *string `json:"webhookUrl,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/predicates.go deleted file mode 100644 index 6f0751146d1..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package sourcecontrols - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SourceControlOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p SourceControlOperationPredicate) Matches(input SourceControl) 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.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/securityinsights/2022-07-01-preview/sourcecontrols/version.go b/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/version.go deleted file mode 100644 index 1582899e2b9..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/sourcecontrols/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package sourcecontrols - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/sourcecontrols/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/README.md b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/README.md deleted file mode 100644 index bf598639881..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/README.md +++ /dev/null @@ -1,191 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/threatintelligence` Documentation - -The `threatintelligence` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/threatintelligence" -``` - - -### Client Initialization - -```go -client := threatintelligence.NewThreatIntelligenceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorAppendTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceAppendTags{ - // ... -} - - -read, err := client.IndicatorAppendTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreate` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreateIndicator` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorCreateIndicator(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorDelete` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorGet` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorMetricsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -read, err := client.IndicatorMetricsList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorQueryIndicators` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceFilteringCriteria{ - // ... -} - - -// alternatively `client.IndicatorQueryIndicators(ctx, id, payload)` can be used to do batched pagination -items, err := client.IndicatorQueryIndicatorsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorReplaceTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorReplaceTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.IndicatorsList(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions())` can be used to do batched pagination -items, err := client.IndicatorsListComplete(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/client.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/client.go deleted file mode 100644 index edf96c3143f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceClient struct { - Client *resourcemanager.Client -} - -func NewThreatIntelligenceClientWithBaseURI(sdkApi sdkEnv.Api) (*ThreatIntelligenceClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "threatintelligence", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ThreatIntelligenceClient: %+v", err) - } - - return &ThreatIntelligenceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/constants.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/constants.go deleted file mode 100644 index 3047e7d6d68..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceResourceKindEnum string - -const ( - ThreatIntelligenceResourceKindEnumIndicator ThreatIntelligenceResourceKindEnum = "indicator" -) - -func PossibleValuesForThreatIntelligenceResourceKindEnum() []string { - return []string{ - string(ThreatIntelligenceResourceKindEnumIndicator), - } -} - -func (s *ThreatIntelligenceResourceKindEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseThreatIntelligenceResourceKindEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseThreatIntelligenceResourceKindEnum(input string) (*ThreatIntelligenceResourceKindEnum, error) { - vals := map[string]ThreatIntelligenceResourceKindEnum{ - "indicator": ThreatIntelligenceResourceKindEnumIndicator, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceResourceKindEnum(input) - return &out, nil -} - -type ThreatIntelligenceSortingCriteriaEnum string - -const ( - ThreatIntelligenceSortingCriteriaEnumAscending ThreatIntelligenceSortingCriteriaEnum = "ascending" - ThreatIntelligenceSortingCriteriaEnumDescending ThreatIntelligenceSortingCriteriaEnum = "descending" - ThreatIntelligenceSortingCriteriaEnumUnsorted ThreatIntelligenceSortingCriteriaEnum = "unsorted" -) - -func PossibleValuesForThreatIntelligenceSortingCriteriaEnum() []string { - return []string{ - string(ThreatIntelligenceSortingCriteriaEnumAscending), - string(ThreatIntelligenceSortingCriteriaEnumDescending), - string(ThreatIntelligenceSortingCriteriaEnumUnsorted), - } -} - -func (s *ThreatIntelligenceSortingCriteriaEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseThreatIntelligenceSortingCriteriaEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseThreatIntelligenceSortingCriteriaEnum(input string) (*ThreatIntelligenceSortingCriteriaEnum, error) { - vals := map[string]ThreatIntelligenceSortingCriteriaEnum{ - "ascending": ThreatIntelligenceSortingCriteriaEnumAscending, - "descending": ThreatIntelligenceSortingCriteriaEnumDescending, - "unsorted": ThreatIntelligenceSortingCriteriaEnumUnsorted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceSortingCriteriaEnum(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator.go deleted file mode 100644 index 73373ce2134..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator.go +++ /dev/null @@ -1,143 +0,0 @@ -package threatintelligence - -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(&IndicatorId{}) -} - -var _ resourceids.ResourceId = &IndicatorId{} - -// IndicatorId is a struct representing the Resource ID for a Indicator -type IndicatorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IndicatorName string -} - -// NewIndicatorID returns a new IndicatorId struct -func NewIndicatorID(subscriptionId string, resourceGroupName string, workspaceName string, indicatorName string) IndicatorId { - return IndicatorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IndicatorName: indicatorName, - } -} - -// ParseIndicatorID parses 'input' into a IndicatorId -func ParseIndicatorID(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(&IndicatorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IndicatorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIndicatorIDInsensitively parses 'input' case-insensitively into a IndicatorId -// note: this method should only be used for API response data and not user input -func ParseIndicatorIDInsensitively(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(&IndicatorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IndicatorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IndicatorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IndicatorName, ok = input.Parsed["indicatorName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", input) - } - - return nil -} - -// ValidateIndicatorID checks that 'input' can be parsed as a Indicator ID -func ValidateIndicatorID(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 := ParseIndicatorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Indicator ID -func (id IndicatorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IndicatorName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Indicator ID -func (id IndicatorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), - resourceids.StaticSegment("staticMain", "main", "main"), - resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "indicatorValue"), - } -} - -// String returns a human-readable description of this Indicator ID -func (id IndicatorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Indicator Name: %q", id.IndicatorName), - } - return fmt.Sprintf("Indicator (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator_test.go deleted file mode 100644 index 48751c131c7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_indicator_test.go +++ /dev/null @@ -1,387 +0,0 @@ -package threatintelligence - -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 = &IndicatorId{} - -func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IndicatorName != "indicatorValue" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorValue") - } -} - -func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIndicatorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IndicatorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IndicatorName: "indicatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIndicatorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IndicatorName != v.Expected.IndicatorName { - t.Fatalf("Expected %q but got %q for IndicatorName", v.Expected.IndicatorName, actual.IndicatorName) - } - - } -} - -func TestParseIndicatorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IndicatorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IndicatorName: "indicatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrVaLuE", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IndicatorName: "iNdIcAtOrVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIndicatorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IndicatorName != v.Expected.IndicatorName { - t.Fatalf("Expected %q but got %q for IndicatorName", v.Expected.IndicatorName, actual.IndicatorName) - } - - } -} - -func TestSegmentsForIndicatorId(t *testing.T) { - segments := IndicatorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IndicatorId 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/securityinsights/2022-07-01-preview/threatintelligence/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace.go deleted file mode 100644 index 2265507abcf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package threatintelligence - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace_test.go deleted file mode 100644 index 6609c36a05b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package threatintelligence - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorappendtags.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorappendtags.go deleted file mode 100644 index 4384327485d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorappendtags.go +++ /dev/null @@ -1,51 +0,0 @@ -package threatintelligence - -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 IndicatorAppendTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IndicatorAppendTags ... -func (c ThreatIntelligenceClient) IndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (result IndicatorAppendTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/appendTags", 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/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreate.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreate.go deleted file mode 100644 index 3cee598931c..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreate.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorCreate ... -func (c ThreatIntelligenceClient) IndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreateindicator.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreateindicator.go deleted file mode 100644 index 0f3ab94c4f5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorcreateindicator.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorCreateIndicatorOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorCreateIndicator ... -func (c ThreatIntelligenceClient) IndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateIndicatorOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator", 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatordelete.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatordelete.go deleted file mode 100644 index 4de264524d5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatordelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package threatintelligence - -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 IndicatorDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IndicatorDelete ... -func (c ThreatIntelligenceClient) IndicatorDelete(ctx context.Context, id IndicatorId) (result IndicatorDeleteOperationResponse, 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/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorget.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorget.go deleted file mode 100644 index 3358363f139..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorget.go +++ /dev/null @@ -1,58 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorGet ... -func (c ThreatIntelligenceClient) IndicatorGet(ctx context.Context, id IndicatorId) (result IndicatorGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatormetricslist.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatormetricslist.go deleted file mode 100644 index f692c803e50..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatormetricslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package threatintelligence - -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 IndicatorMetricsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceMetricsList -} - -// IndicatorMetricsList ... -func (c ThreatIntelligenceClient) IndicatorMetricsList(ctx context.Context, id WorkspaceId) (result IndicatorMetricsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics", 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 ThreatIntelligenceMetricsList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorqueryindicators.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorqueryindicators.go deleted file mode 100644 index 8ce639f2623..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorqueryindicators.go +++ /dev/null @@ -1,103 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorQueryIndicatorsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ThreatIntelligenceInformation -} - -type IndicatorQueryIndicatorsCompleteResult struct { - LatestHttpResponse *http.Response - Items []ThreatIntelligenceInformation -} - -// IndicatorQueryIndicators ... -func (c ThreatIntelligenceClient) IndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (result IndicatorQueryIndicatorsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]ThreatIntelligenceInformation, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// IndicatorQueryIndicatorsComplete retrieves all the results into a single object -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsComplete(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (IndicatorQueryIndicatorsCompleteResult, error) { - return c.IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx, id, input, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorQueryIndicatorsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria, predicate ThreatIntelligenceInformationOperationPredicate) (result IndicatorQueryIndicatorsCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - resp, err := c.IndicatorQueryIndicators(ctx, id, input) - if err != nil { - 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 = IndicatorQueryIndicatorsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorreplacetags.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorreplacetags.go deleted file mode 100644 index 052bbe7b66a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorreplacetags.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorReplaceTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorReplaceTags ... -func (c ThreatIntelligenceClient) IndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorReplaceTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/replaceTags", 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorslist.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorslist.go deleted file mode 100644 index 860ecd26255..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/method_indicatorslist.go +++ /dev/null @@ -1,139 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ThreatIntelligenceInformation -} - -type IndicatorsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ThreatIntelligenceInformation -} - -type IndicatorsListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultIndicatorsListOperationOptions() IndicatorsListOperationOptions { - return IndicatorsListOperationOptions{} -} - -func (o IndicatorsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IndicatorsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IndicatorsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// IndicatorsList ... -func (c ThreatIntelligenceClient) IndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (result IndicatorsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]ThreatIntelligenceInformation, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// IndicatorsListComplete retrieves all the results into a single object -func (c ThreatIntelligenceClient) IndicatorsListComplete(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (IndicatorsListCompleteResult, error) { - return c.IndicatorsListCompleteMatchingPredicate(ctx, id, options, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ThreatIntelligenceClient) IndicatorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions, predicate ThreatIntelligenceInformationOperationPredicate) (result IndicatorsListCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - resp, err := c.IndicatorsList(ctx, id, options) - if err != nil { - 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 = IndicatorsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceappendtags.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceappendtags.go deleted file mode 100644 index d864022037f..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceappendtags.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceAppendTags struct { - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceexternalreference.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceexternalreference.go deleted file mode 100644 index 52978aae636..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceexternalreference.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceExternalReference struct { - Description *string `json:"description,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - Hashes *map[string]string `json:"hashes,omitempty"` - SourceName *string `json:"sourceName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go deleted file mode 100644 index 181ef4790bf..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencefilteringcriteria.go +++ /dev/null @@ -1,20 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceFilteringCriteria struct { - Ids *[]string `json:"ids,omitempty"` - IncludeDisabled *bool `json:"includeDisabled,omitempty"` - Keywords *[]string `json:"keywords,omitempty"` - MaxConfidence *int64 `json:"maxConfidence,omitempty"` - MaxValidUntil *string `json:"maxValidUntil,omitempty"` - MinConfidence *int64 `json:"minConfidence,omitempty"` - MinValidUntil *string `json:"minValidUntil,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - PatternTypes *[]string `json:"patternTypes,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` - SortBy *[]ThreatIntelligenceSortingCriteria `json:"sortBy,omitempty"` - Sources *[]string `json:"sources,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go deleted file mode 100644 index f35c4df440d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencegranularmarkingmodel.go +++ /dev/null @@ -1,10 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceGranularMarkingModel struct { - Language *string `json:"language,omitempty"` - MarkingRef *int64 `json:"markingRef,omitempty"` - Selectors *[]string `json:"selectors,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go deleted file mode 100644 index 9ee1b5778ed..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatormodel.go +++ /dev/null @@ -1,48 +0,0 @@ -package threatintelligence - -import ( - "encoding/json" - "fmt" - - "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. - -var _ ThreatIntelligenceInformation = ThreatIntelligenceIndicatorModel{} - -type ThreatIntelligenceIndicatorModel struct { - Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` - - // Fields inherited from ThreatIntelligenceInformation - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceIndicatorModel{} - -func (s ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceIndicatorModel - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - decoded["kind"] = "indicator" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go deleted file mode 100644 index 49660ed5792..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceindicatorproperties.go +++ /dev/null @@ -1,37 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceIndicatorProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Confidence *int64 `json:"confidence,omitempty"` - Created *string `json:"created,omitempty"` - CreatedByRef *string `json:"createdByRef,omitempty"` - Defanged *bool `json:"defanged,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` - ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - GranularMarkings *[]ThreatIntelligenceGranularMarkingModel `json:"granularMarkings,omitempty"` - IndicatorTypes *[]string `json:"indicatorTypes,omitempty"` - KillChainPhases *[]ThreatIntelligenceKillChainPhase `json:"killChainPhases,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Language *string `json:"language,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Modified *string `json:"modified,omitempty"` - ObjectMarkingRefs *[]string `json:"objectMarkingRefs,omitempty"` - ParsedPattern *[]ThreatIntelligenceParsedPattern `json:"parsedPattern,omitempty"` - Pattern *string `json:"pattern,omitempty"` - PatternType *string `json:"patternType,omitempty"` - PatternVersion *string `json:"patternVersion,omitempty"` - Revoked *bool `json:"revoked,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidUntil *string `json:"validUntil,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceinformation.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceinformation.go deleted file mode 100644 index d036b649d26..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceinformation.go +++ /dev/null @@ -1,53 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceInformation interface { -} - -// RawThreatIntelligenceInformationImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawThreatIntelligenceInformationImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalThreatIntelligenceInformationImplementation(input []byte) (ThreatIntelligenceInformation, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceInformation into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "indicator") { - var out ThreatIntelligenceIndicatorModel - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceIndicatorModel: %+v", err) - } - return out, nil - } - - out := RawThreatIntelligenceInformationImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencekillchainphase.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencekillchainphase.go deleted file mode 100644 index 69319b0f616..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencekillchainphase.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceKillChainPhase struct { - KillChainName *string `json:"killChainName,omitempty"` - PhaseName *string `json:"phaseName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetric.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetric.go deleted file mode 100644 index a6af3828039..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetric.go +++ /dev/null @@ -1,11 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetric struct { - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - PatternTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"patternTypeMetrics,omitempty"` - SourceMetrics *[]ThreatIntelligenceMetricEntity `json:"sourceMetrics,omitempty"` - ThreatTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"threatTypeMetrics,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricentity.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricentity.go deleted file mode 100644 index 562f12dd822..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricEntity struct { - MetricName *string `json:"metricName,omitempty"` - MetricValue *int64 `json:"metricValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetrics.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetrics.go deleted file mode 100644 index 14a6959c873..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetrics.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetrics struct { - Properties *ThreatIntelligenceMetric `json:"properties,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricslist.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricslist.go deleted file mode 100644 index 68025bf73cb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencemetricslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricsList struct { - Value []ThreatIntelligenceMetrics `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go deleted file mode 100644 index 432ca8c997b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpattern.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPattern struct { - PatternTypeKey *string `json:"patternTypeKey,omitempty"` - PatternTypeValues *[]ThreatIntelligenceParsedPatternTypeValue `json:"patternTypeValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go deleted file mode 100644 index e65b3199903..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPatternTypeValue struct { - Value *string `json:"value,omitempty"` - ValueType *string `json:"valueType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go deleted file mode 100644 index e2369ffa0bb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/model_threatintelligencesortingcriteria.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceSortingCriteria struct { - ItemKey *string `json:"itemKey,omitempty"` - SortOrder *ThreatIntelligenceSortingCriteriaEnum `json:"sortOrder,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/predicates.go deleted file mode 100644 index 6020562ed4b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceInformationOperationPredicate struct { -} - -func (p ThreatIntelligenceInformationOperationPredicate) Matches(input ThreatIntelligenceInformation) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/version.go b/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/version.go deleted file mode 100644 index 91edd5d1f69..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/threatintelligence/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/threatintelligence/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/README.md b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/README.md deleted file mode 100644 index 1d2d3159bcd..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/watchlistitems` Documentation - -The `watchlistitems` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/watchlistitems" -``` - - -### Client Initialization - -```go -client := watchlistitems.NewWatchlistItemsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WatchlistItemsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -payload := watchlistitems.WatchlistItem{ - // ... -} - - -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: `WatchlistItemsClient.Delete` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -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: `WatchlistItemsClient.Get` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -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: `WatchlistItemsClient.List` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -// 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/securityinsights/2022-07-01-preview/watchlistitems/client.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/client.go deleted file mode 100644 index d3193694a48..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package watchlistitems - -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 WatchlistItemsClient struct { - Client *resourcemanager.Client -} - -func NewWatchlistItemsClientWithBaseURI(sdkApi sdkEnv.Api) (*WatchlistItemsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "watchlistitems", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WatchlistItemsClient: %+v", err) - } - - return &WatchlistItemsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist.go deleted file mode 100644 index 7df2e8c2562..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist.go +++ /dev/null @@ -1,141 +0,0 @@ -package watchlistitems - -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(&WatchlistId{}) -} - -var _ resourceids.ResourceId = &WatchlistId{} - -// WatchlistId is a struct representing the Resource ID for a Watchlist -type WatchlistId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string -} - -// NewWatchlistID returns a new WatchlistId struct -func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - } -} - -// ParseWatchlistID parses 'input' into a WatchlistId -func ParseWatchlistID(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId -// note: this method should only be used for API response data and not user input -func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - return nil -} - -// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID -func ValidateWatchlistID(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 := ParseWatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist ID -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID -func (id WatchlistId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - } -} - -// String returns a human-readable description of this Watchlist ID -func (id WatchlistId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - } - return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist_test.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist_test.go deleted file mode 100644 index c0840d7109b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlist_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package watchlistitems - -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 = &WatchlistId{} - -func TestNewWatchlistID(t *testing.T) { - id := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } -} - -func TestFormatWatchlistID(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestParseWatchlistIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestSegmentsForWatchlistId(t *testing.T) { - segments := WatchlistId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistId 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/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem.go deleted file mode 100644 index 95aa9b8f56d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem.go +++ /dev/null @@ -1,150 +0,0 @@ -package watchlistitems - -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(&WatchlistItemId{}) -} - -var _ resourceids.ResourceId = &WatchlistItemId{} - -// WatchlistItemId is a struct representing the Resource ID for a Watchlist Item -type WatchlistItemId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string - WatchlistItemId string -} - -// NewWatchlistItemID returns a new WatchlistItemId struct -func NewWatchlistItemID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string, watchlistItemId string) WatchlistItemId { - return WatchlistItemId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - WatchlistItemId: watchlistItemId, - } -} - -// ParseWatchlistItemID parses 'input' into a WatchlistItemId -func ParseWatchlistItemID(input string) (*WatchlistItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistItemId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistItemIDInsensitively parses 'input' case-insensitively into a WatchlistItemId -// note: this method should only be used for API response data and not user input -func ParseWatchlistItemIDInsensitively(input string) (*WatchlistItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistItemId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistItemId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - if id.WatchlistItemId, ok = input.Parsed["watchlistItemId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistItemId", input) - } - - return nil -} - -// ValidateWatchlistItemID checks that 'input' can be parsed as a Watchlist Item ID -func ValidateWatchlistItemID(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 := ParseWatchlistItemID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist Item ID -func (id WatchlistItemId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s/watchlistItems/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias, id.WatchlistItemId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist Item ID -func (id WatchlistItemId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - resourceids.StaticSegment("staticWatchlistItems", "watchlistItems", "watchlistItems"), - resourceids.UserSpecifiedSegment("watchlistItemId", "watchlistItemIdValue"), - } -} - -// String returns a human-readable description of this Watchlist Item ID -func (id WatchlistItemId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - fmt.Sprintf("Watchlist Item: %q", id.WatchlistItemId), - } - return fmt.Sprintf("Watchlist Item (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem_test.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem_test.go deleted file mode 100644 index 6f4a0b1438a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/id_watchlistitem_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package watchlistitems - -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 = &WatchlistItemId{} - -func TestNewWatchlistItemID(t *testing.T) { - id := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } - - if id.WatchlistItemId != "watchlistItemIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistItemId'", id.WatchlistItemId, "watchlistItemIdValue") - } -} - -func TestFormatWatchlistItemID(t *testing.T) { - actual := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistItemID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - WatchlistItemId: "watchlistItemIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistItemID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - if actual.WatchlistItemId != v.Expected.WatchlistItemId { - t.Fatalf("Expected %q but got %q for WatchlistItemId", v.Expected.WatchlistItemId, actual.WatchlistItemId) - } - - } -} - -func TestParseWatchlistItemIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - WatchlistItemId: "watchlistItemIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS/wAtChLiStItEmIdVaLuE", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - WatchlistItemId: "wAtChLiStItEmIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS/wAtChLiStItEmIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistItemIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - if actual.WatchlistItemId != v.Expected.WatchlistItemId { - t.Fatalf("Expected %q but got %q for WatchlistItemId", v.Expected.WatchlistItemId, actual.WatchlistItemId) - } - - } -} - -func TestSegmentsForWatchlistItemId(t *testing.T) { - segments := WatchlistItemId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistItemId 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/securityinsights/2022-07-01-preview/watchlistitems/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_createorupdate.go deleted file mode 100644 index 68142e971a8..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package watchlistitems - -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 *WatchlistItem -} - -// CreateOrUpdate ... -func (c WatchlistItemsClient) CreateOrUpdate(ctx context.Context, id WatchlistItemId, input WatchlistItem) (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 WatchlistItem - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_delete.go deleted file mode 100644 index 5565b767fa5..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlistitems - -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 WatchlistItemsClient) Delete(ctx context.Context, id WatchlistItemId) (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/securityinsights/2022-07-01-preview/watchlistitems/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_get.go deleted file mode 100644 index 1973c679f9e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package watchlistitems - -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 *WatchlistItem -} - -// Get ... -func (c WatchlistItemsClient) Get(ctx context.Context, id WatchlistItemId) (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 WatchlistItem - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_list.go deleted file mode 100644 index 8a4d418ea0b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package watchlistitems - -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 *[]WatchlistItem -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []WatchlistItem -} - -// List ... -func (c WatchlistItemsClient) List(ctx context.Context, id WatchlistId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/watchlistItems", 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 *[]WatchlistItem `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 WatchlistItemsClient) ListComplete(ctx context.Context, id WatchlistId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WatchlistItemOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WatchlistItemsClient) ListCompleteMatchingPredicate(ctx context.Context, id WatchlistId, predicate WatchlistItemOperationPredicate) (result ListCompleteResult, err error) { - items := make([]WatchlistItem, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/watchlistitems/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_userinfo.go deleted file mode 100644 index 9d03c24555b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package watchlistitems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitem.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitem.go deleted file mode 100644 index 1b198fb819b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitem.go +++ /dev/null @@ -1,17 +0,0 @@ -package watchlistitems - -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 WatchlistItem struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WatchlistItemProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitemproperties.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitemproperties.go deleted file mode 100644 index 77f219a0cce..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/model_watchlistitemproperties.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlistitems - -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 WatchlistItemProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - EntityMapping *interface{} `json:"entityMapping,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsKeyValue interface{} `json:"itemsKeyValue"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - WatchlistItemId *string `json:"watchlistItemId,omitempty"` - WatchlistItemType *string `json:"watchlistItemType,omitempty"` -} - -func (o *WatchlistItemProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistItemProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *WatchlistItemProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistItemProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/predicates.go deleted file mode 100644 index c9960b515cb..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package watchlistitems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WatchlistItemOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p WatchlistItemOperationPredicate) Matches(input WatchlistItem) 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.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/securityinsights/2022-07-01-preview/watchlistitems/version.go b/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/version.go deleted file mode 100644 index 90bb37b0122..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlistitems/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package watchlistitems - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/watchlistitems/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/README.md b/resource-manager/securityinsights/2022-07-01-preview/watchlists/README.md deleted file mode 100644 index 1141cba6b7a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-07-01-preview/watchlists` Documentation - -The `watchlists` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-07-01-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/securityinsights/2022-07-01-preview/watchlists" -``` - - -### Client Initialization - -```go -client := watchlists.NewWatchlistsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WatchlistsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -payload := watchlists.Watchlist{ - // ... -} - - -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: `WatchlistsClient.Delete` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -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: `WatchlistsClient.Get` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -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: `WatchlistsClient.List` - -```go -ctx := context.TODO() -id := watchlists.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-07-01-preview/watchlists/client.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/client.go deleted file mode 100644 index 45211175054..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package watchlists - -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 WatchlistsClient struct { - Client *resourcemanager.Client -} - -func NewWatchlistsClientWithBaseURI(sdkApi sdkEnv.Api) (*WatchlistsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "watchlists", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WatchlistsClient: %+v", err) - } - - return &WatchlistsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/constants.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/constants.go deleted file mode 100644 index 6a9873135b3..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package watchlists - -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 SourceType string - -const ( - SourceTypeLocalFile SourceType = "Local file" - SourceTypeRemoteStorage SourceType = "Remote storage" -) - -func PossibleValuesForSourceType() []string { - return []string{ - string(SourceTypeLocalFile), - string(SourceTypeRemoteStorage), - } -} - -func (s *SourceType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSourceType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSourceType(input string) (*SourceType, error) { - vals := map[string]SourceType{ - "local file": SourceTypeLocalFile, - "remote storage": SourceTypeRemoteStorage, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := SourceType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist.go deleted file mode 100644 index e5b47b1456e..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist.go +++ /dev/null @@ -1,141 +0,0 @@ -package watchlists - -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(&WatchlistId{}) -} - -var _ resourceids.ResourceId = &WatchlistId{} - -// WatchlistId is a struct representing the Resource ID for a Watchlist -type WatchlistId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string -} - -// NewWatchlistID returns a new WatchlistId struct -func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - } -} - -// ParseWatchlistID parses 'input' into a WatchlistId -func ParseWatchlistID(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId -// note: this method should only be used for API response data and not user input -func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - return nil -} - -// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID -func ValidateWatchlistID(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 := ParseWatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist ID -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID -func (id WatchlistId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - } -} - -// String returns a human-readable description of this Watchlist ID -func (id WatchlistId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - } - return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist_test.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist_test.go deleted file mode 100644 index 31b93b91550..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_watchlist_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package watchlists - -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 = &WatchlistId{} - -func TestNewWatchlistID(t *testing.T) { - id := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } -} - -func TestFormatWatchlistID(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestParseWatchlistIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestSegmentsForWatchlistId(t *testing.T) { - segments := WatchlistId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistId 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/securityinsights/2022-07-01-preview/watchlists/id_workspace.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace.go deleted file mode 100644 index d8e6bddfee7..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package watchlists - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace_test.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace_test.go deleted file mode 100644 index dfecaa8860b..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package watchlists - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-07-01-preview/watchlists/method_createorupdate.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_createorupdate.go deleted file mode 100644 index eb0b4f9396d..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package watchlists - -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 *Watchlist -} - -// CreateOrUpdate ... -func (c WatchlistsClient) CreateOrUpdate(ctx context.Context, id WatchlistId, input Watchlist) (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 Watchlist - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_delete.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_delete.go deleted file mode 100644 index 9d495f99c57..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlists - -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 WatchlistsClient) Delete(ctx context.Context, id WatchlistId) (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/securityinsights/2022-07-01-preview/watchlists/method_get.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_get.go deleted file mode 100644 index 7aac16c3975..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package watchlists - -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 *Watchlist -} - -// Get ... -func (c WatchlistsClient) Get(ctx context.Context, id WatchlistId) (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 Watchlist - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_list.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_list.go deleted file mode 100644 index 9122b014815..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package watchlists - -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 *[]Watchlist -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Watchlist -} - -// List ... -func (c WatchlistsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/watchlists", 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 *[]Watchlist `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 WatchlistsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WatchlistOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WatchlistsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate WatchlistOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Watchlist, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-07-01-preview/watchlists/model_userinfo.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_userinfo.go deleted file mode 100644 index 5c0e0c29617..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package watchlists - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlist.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlist.go deleted file mode 100644 index 2c34c33bb58..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlist.go +++ /dev/null @@ -1,17 +0,0 @@ -package watchlists - -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 Watchlist struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WatchlistProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlistproperties.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlistproperties.go deleted file mode 100644 index 9312bf9af58..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/model_watchlistproperties.go +++ /dev/null @@ -1,58 +0,0 @@ -package watchlists - -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 WatchlistProperties struct { - ContentType *string `json:"contentType,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DefaultDuration *string `json:"defaultDuration,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsSearchKey string `json:"itemsSearchKey"` - Labels *[]string `json:"labels,omitempty"` - NumberOfLinesToSkip *int64 `json:"numberOfLinesToSkip,omitempty"` - Provider string `json:"provider"` - RawContent *string `json:"rawContent,omitempty"` - Source *string `json:"source,omitempty"` - SourceType *SourceType `json:"sourceType,omitempty"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - UploadStatus *string `json:"uploadStatus,omitempty"` - WatchlistAlias *string `json:"watchlistAlias,omitempty"` - WatchlistId *string `json:"watchlistId,omitempty"` - WatchlistType *string `json:"watchlistType,omitempty"` -} - -func (o *WatchlistProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *WatchlistProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-07-01-preview/watchlists/predicates.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/predicates.go deleted file mode 100644 index f335c7c61ff..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package watchlists - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WatchlistOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p WatchlistOperationPredicate) Matches(input Watchlist) 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.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/securityinsights/2022-07-01-preview/watchlists/version.go b/resource-manager/securityinsights/2022-07-01-preview/watchlists/version.go deleted file mode 100644 index d4838618f6a..00000000000 --- a/resource-manager/securityinsights/2022-07-01-preview/watchlists/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package watchlists - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-07-01-preview" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/watchlists/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/README.md b/resource-manager/securityinsights/2022-08-01/actions/README.md deleted file mode 100644 index 935c58d80de..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/actions` Documentation - -The `actions` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/actions" -``` - - -### Client Initialization - -```go -client := actions.NewActionsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ActionsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -payload := actions.ActionRequest{ - // ... -} - - -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: `ActionsClient.Delete` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -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: `ActionsClient.Get` - -```go -ctx := context.TODO() -id := actions.NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - -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: `ActionsClient.ListByAlertRule` - -```go -ctx := context.TODO() -id := actions.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -// alternatively `client.ListByAlertRule(ctx, id)` can be used to do batched pagination -items, err := client.ListByAlertRuleComplete(ctx, id) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-08-01/actions/client.go b/resource-manager/securityinsights/2022-08-01/actions/client.go deleted file mode 100644 index a2b7d01bfe1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package actions - -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 ActionsClient struct { - Client *resourcemanager.Client -} - -func NewActionsClientWithBaseURI(sdkApi sdkEnv.Api) (*ActionsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "actions", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ActionsClient: %+v", err) - } - - return &ActionsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/id_action.go b/resource-manager/securityinsights/2022-08-01/actions/id_action.go deleted file mode 100644 index aeefc14d3f8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/id_action.go +++ /dev/null @@ -1,150 +0,0 @@ -package actions - -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(&ActionId{}) -} - -var _ resourceids.ResourceId = &ActionId{} - -// ActionId is a struct representing the Resource ID for a Action -type ActionId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string - ActionId string -} - -// NewActionID returns a new ActionId struct -func NewActionID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string, actionId string) ActionId { - return ActionId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - ActionId: actionId, - } -} - -// ParseActionID parses 'input' into a ActionId -func ParseActionID(input string) (*ActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ActionId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseActionIDInsensitively parses 'input' case-insensitively into a ActionId -// note: this method should only be used for API response data and not user input -func ParseActionIDInsensitively(input string) (*ActionId, error) { - parser := resourceids.NewParserFromResourceIdType(&ActionId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := ActionId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *ActionId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - if id.ActionId, ok = input.Parsed["actionId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "actionId", input) - } - - return nil -} - -// ValidateActionID checks that 'input' can be parsed as a Action ID -func ValidateActionID(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 := ParseActionID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Action ID -func (id ActionId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s/actions/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId, id.ActionId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Action ID -func (id ActionId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - resourceids.StaticSegment("staticActions", "actions", "actions"), - resourceids.UserSpecifiedSegment("actionId", "actionIdValue"), - } -} - -// String returns a human-readable description of this Action ID -func (id ActionId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - fmt.Sprintf("Action: %q", id.ActionId), - } - return fmt.Sprintf("Action (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/id_action_test.go b/resource-manager/securityinsights/2022-08-01/actions/id_action_test.go deleted file mode 100644 index 5178cfc7cdb..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/id_action_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package actions - -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 = &ActionId{} - -func TestNewActionID(t *testing.T) { - id := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } - - if id.ActionId != "actionIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'ActionId'", id.ActionId, "actionIdValue") - } -} - -func TestFormatActionID(t *testing.T) { - actual := NewActionID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue", "actionIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseActionID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ActionId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - ActionId: "actionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseActionID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - if actual.ActionId != v.Expected.ActionId { - t.Fatalf("Expected %q but got %q for ActionId", v.Expected.ActionId, actual.ActionId) - } - - } -} - -func TestParseActionIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *ActionId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - ActionId: "actionIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/actions/actionIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs/aCtIoNiDvAlUe", - Expected: &ActionId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - ActionId: "aCtIoNiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/aCtIoNs/aCtIoNiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseActionIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - if actual.ActionId != v.Expected.ActionId { - t.Fatalf("Expected %q but got %q for ActionId", v.Expected.ActionId, actual.ActionId) - } - - } -} - -func TestSegmentsForActionId(t *testing.T) { - segments := ActionId{}.Segments() - if len(segments) == 0 { - t.Fatalf("ActionId 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/securityinsights/2022-08-01/actions/id_alertrule.go b/resource-manager/securityinsights/2022-08-01/actions/id_alertrule.go deleted file mode 100644 index 731f6439ae3..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/id_alertrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package actions - -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(&AlertRuleId{}) -} - -var _ resourceids.ResourceId = &AlertRuleId{} - -// AlertRuleId is a struct representing the Resource ID for a Alert Rule -type AlertRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string -} - -// NewAlertRuleID returns a new AlertRuleId struct -func NewAlertRuleID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string) AlertRuleId { - return AlertRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - } -} - -// ParseAlertRuleID parses 'input' into a AlertRuleId -func ParseAlertRuleID(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleIDInsensitively parses 'input' case-insensitively into a AlertRuleId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - return nil -} - -// ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID -func ValidateAlertRuleID(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 := ParseAlertRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule ID -func (id AlertRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule ID -func (id AlertRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule ID -func (id AlertRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - } - return fmt.Sprintf("Alert Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/id_alertrule_test.go b/resource-manager/securityinsights/2022-08-01/actions/id_alertrule_test.go deleted file mode 100644 index 890c1efe56a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/id_alertrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package actions - -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 = &AlertRuleId{} - -func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } -} - -func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestParseAlertRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestSegmentsForAlertRuleId(t *testing.T) { - segments := AlertRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleId 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/securityinsights/2022-08-01/actions/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/actions/method_createorupdate.go deleted file mode 100644 index e84c5bebbd7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package actions - -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 *ActionResponse -} - -// CreateOrUpdate ... -func (c ActionsClient) CreateOrUpdate(ctx context.Context, id ActionId, input ActionRequest) (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 ActionResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/method_delete.go b/resource-manager/securityinsights/2022-08-01/actions/method_delete.go deleted file mode 100644 index 0f8a28307c2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package actions - -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 ActionsClient) Delete(ctx context.Context, id ActionId) (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/securityinsights/2022-08-01/actions/method_get.go b/resource-manager/securityinsights/2022-08-01/actions/method_get.go deleted file mode 100644 index 9d5aad5dc58..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package actions - -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 *ActionResponse -} - -// Get ... -func (c ActionsClient) Get(ctx context.Context, id ActionId) (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 ActionResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/method_listbyalertrule.go b/resource-manager/securityinsights/2022-08-01/actions/method_listbyalertrule.go deleted file mode 100644 index 09d32b9d82d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/method_listbyalertrule.go +++ /dev/null @@ -1,91 +0,0 @@ -package actions - -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 ListByAlertRuleOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ActionResponse -} - -type ListByAlertRuleCompleteResult struct { - LatestHttpResponse *http.Response - Items []ActionResponse -} - -// ListByAlertRule ... -func (c ActionsClient) ListByAlertRule(ctx context.Context, id AlertRuleId) (result ListByAlertRuleOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/actions", 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 *[]ActionResponse `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - result.Model = values.Values - - return -} - -// ListByAlertRuleComplete retrieves all the results into a single object -func (c ActionsClient) ListByAlertRuleComplete(ctx context.Context, id AlertRuleId) (ListByAlertRuleCompleteResult, error) { - return c.ListByAlertRuleCompleteMatchingPredicate(ctx, id, ActionResponseOperationPredicate{}) -} - -// ListByAlertRuleCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ActionsClient) ListByAlertRuleCompleteMatchingPredicate(ctx context.Context, id AlertRuleId, predicate ActionResponseOperationPredicate) (result ListByAlertRuleCompleteResult, err error) { - items := make([]ActionResponse, 0) - - resp, err := c.ListByAlertRule(ctx, id) - if err != nil { - 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 = ListByAlertRuleCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/model_actionrequest.go b/resource-manager/securityinsights/2022-08-01/actions/model_actionrequest.go deleted file mode 100644 index d2392a75a2d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/model_actionrequest.go +++ /dev/null @@ -1,17 +0,0 @@ -package actions - -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 ActionRequest struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ActionRequestProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/model_actionrequestproperties.go b/resource-manager/securityinsights/2022-08-01/actions/model_actionrequestproperties.go deleted file mode 100644 index 209f602de8a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/model_actionrequestproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionRequestProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - TriggerUri string `json:"triggerUri"` -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/model_actionresponse.go b/resource-manager/securityinsights/2022-08-01/actions/model_actionresponse.go deleted file mode 100644 index c357a58ab2a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/model_actionresponse.go +++ /dev/null @@ -1,17 +0,0 @@ -package actions - -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 ActionResponse struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *ActionResponseProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/model_actionresponseproperties.go b/resource-manager/securityinsights/2022-08-01/actions/model_actionresponseproperties.go deleted file mode 100644 index ef4e54d6817..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/model_actionresponseproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionResponseProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - WorkflowId *string `json:"workflowId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/actions/predicates.go b/resource-manager/securityinsights/2022-08-01/actions/predicates.go deleted file mode 100644 index 317d6feb3d6..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package actions - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ActionResponseOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p ActionResponseOperationPredicate) Matches(input ActionResponse) 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.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/securityinsights/2022-08-01/actions/version.go b/resource-manager/securityinsights/2022-08-01/actions/version.go deleted file mode 100644 index 68817726243..00000000000 --- a/resource-manager/securityinsights/2022-08-01/actions/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package actions - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/actions/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/README.md b/resource-manager/securityinsights/2022-08-01/alertrules/README.md deleted file mode 100644 index 14a46606ee0..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/alertrules` Documentation - -The `alertrules` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/alertrules" -``` - - -### Client Initialization - -```go -client := alertrules.NewAlertRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -payload := alertrules.AlertRule{ - // ... -} - - -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: `AlertRulesClient.Delete` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -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: `AlertRulesClient.Get` - -```go -ctx := context.TODO() -id := alertrules.NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - -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: `AlertRulesClient.List` - -```go -ctx := context.TODO() -id := alertrules.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-08-01/alertrules/client.go b/resource-manager/securityinsights/2022-08-01/alertrules/client.go deleted file mode 100644 index e6ca04af9da..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alertrules - -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 AlertRulesClient struct { - Client *resourcemanager.Client -} - -func NewAlertRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alertrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertRulesClient: %+v", err) - } - - return &AlertRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/constants.go b/resource-manager/securityinsights/2022-08-01/alertrules/constants.go deleted file mode 100644 index 8c0d36ec74b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/constants.go +++ /dev/null @@ -1,499 +0,0 @@ -package alertrules - -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 AlertDetail string - -const ( - AlertDetailDisplayName AlertDetail = "DisplayName" - AlertDetailSeverity AlertDetail = "Severity" -) - -func PossibleValuesForAlertDetail() []string { - return []string{ - string(AlertDetailDisplayName), - string(AlertDetailSeverity), - } -} - -func (s *AlertDetail) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertDetail(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertDetail(input string) (*AlertDetail, error) { - vals := map[string]AlertDetail{ - "displayname": AlertDetailDisplayName, - "severity": AlertDetailSeverity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertDetail(input) - return &out, nil -} - -type AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindScheduled), - } -} - -func (s *AlertRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "scheduled": AlertRuleKindScheduled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func (s *EntityMappingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityMappingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func (s *EventGroupingAggregationKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEventGroupingAggregationKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MatchingMethod string - -const ( - MatchingMethodAllEntities MatchingMethod = "AllEntities" - MatchingMethodAnyAlert MatchingMethod = "AnyAlert" - MatchingMethodSelected MatchingMethod = "Selected" -) - -func PossibleValuesForMatchingMethod() []string { - return []string{ - string(MatchingMethodAllEntities), - string(MatchingMethodAnyAlert), - string(MatchingMethodSelected), - } -} - -func (s *MatchingMethod) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMatchingMethod(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMatchingMethod(input string) (*MatchingMethod, error) { - vals := map[string]MatchingMethod{ - "allentities": MatchingMethodAllEntities, - "anyalert": MatchingMethodAnyAlert, - "selected": MatchingMethodSelected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MatchingMethod(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - } -} - -func (s *MicrosoftSecurityProductName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMicrosoftSecurityProductName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func (s *TriggerOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule.go b/resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule.go deleted file mode 100644 index 818f124e5ef..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package alertrules - -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(&AlertRuleId{}) -} - -var _ resourceids.ResourceId = &AlertRuleId{} - -// AlertRuleId is a struct representing the Resource ID for a Alert Rule -type AlertRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - RuleId string -} - -// NewAlertRuleID returns a new AlertRuleId struct -func NewAlertRuleID(subscriptionId string, resourceGroupName string, workspaceName string, ruleId string) AlertRuleId { - return AlertRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - RuleId: ruleId, - } -} - -// ParseAlertRuleID parses 'input' into a AlertRuleId -func ParseAlertRuleID(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleIDInsensitively parses 'input' case-insensitively into a AlertRuleId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleIDInsensitively(input string) (*AlertRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.RuleId, ok = input.Parsed["ruleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "ruleId", input) - } - - return nil -} - -// ValidateAlertRuleID checks that 'input' can be parsed as a Alert Rule ID -func ValidateAlertRuleID(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 := ParseAlertRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule ID -func (id AlertRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.RuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule ID -func (id AlertRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRules", "alertRules", "alertRules"), - resourceids.UserSpecifiedSegment("ruleId", "ruleIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule ID -func (id AlertRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Rule: %q", id.RuleId), - } - return fmt.Sprintf("Alert Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule_test.go b/resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule_test.go deleted file mode 100644 index c3c781da17b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/id_alertrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package alertrules - -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 = &AlertRuleId{} - -func TestNewAlertRuleID(t *testing.T) { - id := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.RuleId != "ruleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'RuleId'", id.RuleId, "ruleIdValue") - } -} - -func TestFormatAlertRuleID(t *testing.T) { - actual := NewAlertRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "ruleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestParseAlertRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - RuleId: "ruleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRules/ruleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe", - Expected: &AlertRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - RuleId: "rUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeS/rUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.RuleId != v.Expected.RuleId { - t.Fatalf("Expected %q but got %q for RuleId", v.Expected.RuleId, actual.RuleId) - } - - } -} - -func TestSegmentsForAlertRuleId(t *testing.T) { - segments := AlertRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleId 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/securityinsights/2022-08-01/alertrules/id_workspace.go b/resource-manager/securityinsights/2022-08-01/alertrules/id_workspace.go deleted file mode 100644 index 005b7fc90a7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package alertrules - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/alertrules/id_workspace_test.go deleted file mode 100644 index 3846c76d11d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alertrules - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/alertrules/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/alertrules/method_createorupdate.go deleted file mode 100644 index f77c7558d09..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *AlertRule -} - -// CreateOrUpdate ... -func (c AlertRulesClient) CreateOrUpdate(ctx context.Context, id AlertRuleId, input AlertRule) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/method_delete.go b/resource-manager/securityinsights/2022-08-01/alertrules/method_delete.go deleted file mode 100644 index aae7085c25e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertrules - -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 AlertRulesClient) Delete(ctx context.Context, id AlertRuleId) (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/securityinsights/2022-08-01/alertrules/method_get.go b/resource-manager/securityinsights/2022-08-01/alertrules/method_get.go deleted file mode 100644 index 945c07bfad1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *AlertRule -} - -// Get ... -func (c AlertRulesClient) Get(ctx context.Context, id AlertRuleId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/method_list.go b/resource-manager/securityinsights/2022-08-01/alertrules/method_list.go deleted file mode 100644 index 5ac99496167..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package alertrules - -import ( - "context" - "encoding/json" - "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 *[]AlertRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AlertRule -} - -// List ... -func (c AlertRulesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRules", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]AlertRule, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalAlertRuleImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRule (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AlertRulesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AlertRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AlertRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/alertrules/model_alertdetailsoverride.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_alertdetailsoverride.go deleted file mode 100644 index 12e98f5419a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_alertrule.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_alertrule.go deleted file mode 100644 index 0a8eb3e2ad3..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_alertrule.go +++ /dev/null @@ -1,69 +0,0 @@ -package alertrules - -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 AlertRule interface { -} - -// RawAlertRuleImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAlertRuleImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAlertRuleImplementation(input []byte) (AlertRule, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRule into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRule - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRule: %+v", err) - } - return out, nil - } - - out := RawAlertRuleImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_entitymapping.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_entitymapping.go deleted file mode 100644 index b1fc81c3323..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_eventgroupingsettings.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_eventgroupingsettings.go deleted file mode 100644 index ae513b5b198..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_fieldmapping.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_fieldmapping.go deleted file mode 100644 index 9e73ac23218..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertrule.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertrule.go deleted file mode 100644 index c4ed17f4319..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = FusionAlertRule{} - -type FusionAlertRule struct { - Properties *FusionAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRule{} - -func (s FusionAlertRule) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRule: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertruleproperties.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertruleproperties.go deleted file mode 100644 index f912616e7a1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_fusionalertruleproperties.go +++ /dev/null @@ -1,33 +0,0 @@ -package alertrules - -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 FusionAlertRuleProperties struct { - AlertRuleTemplateName string `json:"alertRuleTemplateName"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *FusionAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_groupingconfiguration.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_groupingconfiguration.go deleted file mode 100644 index cb8d21f3d60..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_groupingconfiguration.go +++ /dev/null @@ -1,14 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GroupingConfiguration struct { - Enabled bool `json:"enabled"` - GroupByAlertDetails *[]AlertDetail `json:"groupByAlertDetails,omitempty"` - GroupByCustomDetails *[]string `json:"groupByCustomDetails,omitempty"` - GroupByEntities *[]EntityMappingType `json:"groupByEntities,omitempty"` - LookbackDuration string `json:"lookbackDuration"` - MatchingMethod MatchingMethod `json:"matchingMethod"` - ReopenClosedIncident bool `json:"reopenClosedIncident"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_incidentconfiguration.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_incidentconfiguration.go deleted file mode 100644 index 53ab8b667b1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_incidentconfiguration.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentConfiguration struct { - CreateIncident bool `json:"createIncident"` - GroupingConfiguration *GroupingConfiguration `json:"groupingConfiguration,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertrule.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertrule.go deleted file mode 100644 index 4fa227e3728..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = MicrosoftSecurityIncidentCreationAlertRule{} - -type MicrosoftSecurityIncidentCreationAlertRule struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRule{} - -func (s MicrosoftSecurityIncidentCreationAlertRule) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go deleted file mode 100644 index 428ca90f774..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_microsoftsecurityincidentcreationalertruleproperties.go +++ /dev/null @@ -1,34 +0,0 @@ -package alertrules - -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 MicrosoftSecurityIncidentCreationAlertRuleProperties struct { - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - Enabled bool `json:"enabled"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - ProductFilter MicrosoftSecurityProductName `json:"productFilter"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertrule.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertrule.go deleted file mode 100644 index cf91bcec4f2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertrule.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertrules - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRule = ScheduledAlertRule{} - -type ScheduledAlertRule struct { - Properties *ScheduledAlertRuleProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRule - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRule{} - -func (s ScheduledAlertRule) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRule - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRule: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRule: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRule: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertruleproperties.go b/resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertruleproperties.go deleted file mode 100644 index 992328f9f02..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/model_scheduledalertruleproperties.go +++ /dev/null @@ -1,46 +0,0 @@ -package alertrules - -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 ScheduledAlertRuleProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRuleTemplateName *string `json:"alertRuleTemplateName,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - Enabled bool `json:"enabled"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - IncidentConfiguration *IncidentConfiguration `json:"incidentConfiguration,omitempty"` - LastModifiedUtc *string `json:"lastModifiedUtc,omitempty"` - Query *string `json:"query,omitempty"` - QueryFrequency *string `json:"queryFrequency,omitempty"` - QueryPeriod *string `json:"queryPeriod,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - SuppressionDuration string `json:"suppressionDuration"` - SuppressionEnabled bool `json:"suppressionEnabled"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - TemplateVersion *string `json:"templateVersion,omitempty"` - TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` - TriggerThreshold *int64 `json:"triggerThreshold,omitempty"` -} - -func (o *ScheduledAlertRuleProperties) GetLastModifiedUtcAsTime() (*time.Time, error) { - if o.LastModifiedUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleProperties) SetLastModifiedUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/predicates.go b/resource-manager/securityinsights/2022-08-01/alertrules/predicates.go deleted file mode 100644 index 20dada02523..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleOperationPredicate struct { -} - -func (p AlertRuleOperationPredicate) Matches(input AlertRule) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-08-01/alertrules/version.go b/resource-manager/securityinsights/2022-08-01/alertrules/version.go deleted file mode 100644 index 7c71f6e5a58..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertrules/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/README.md b/resource-manager/securityinsights/2022-08-01/alertruletemplates/README.md deleted file mode 100644 index bc3099c4d83..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/README.md +++ /dev/null @@ -1,53 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/alertruletemplates` Documentation - -The `alertruletemplates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/alertruletemplates" -``` - - -### Client Initialization - -```go -client := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AlertRuleTemplatesClient.Get` - -```go -ctx := context.TODO() -id := alertruletemplates.NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - -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: `AlertRuleTemplatesClient.List` - -```go -ctx := context.TODO() -id := alertruletemplates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-08-01/alertruletemplates/client.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/client.go deleted file mode 100644 index 2932bf14a55..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package alertruletemplates - -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 AlertRuleTemplatesClient struct { - Client *resourcemanager.Client -} - -func NewAlertRuleTemplatesClientWithBaseURI(sdkApi sdkEnv.Api) (*AlertRuleTemplatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "alertruletemplates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AlertRuleTemplatesClient: %+v", err) - } - - return &AlertRuleTemplatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/constants.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/constants.go deleted file mode 100644 index 7ec9389513f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/constants.go +++ /dev/null @@ -1,458 +0,0 @@ -package alertruletemplates - -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 AlertRuleKind string - -const ( - AlertRuleKindFusion AlertRuleKind = "Fusion" - AlertRuleKindMicrosoftSecurityIncidentCreation AlertRuleKind = "MicrosoftSecurityIncidentCreation" - AlertRuleKindScheduled AlertRuleKind = "Scheduled" -) - -func PossibleValuesForAlertRuleKind() []string { - return []string{ - string(AlertRuleKindFusion), - string(AlertRuleKindMicrosoftSecurityIncidentCreation), - string(AlertRuleKindScheduled), - } -} - -func (s *AlertRuleKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertRuleKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertRuleKind(input string) (*AlertRuleKind, error) { - vals := map[string]AlertRuleKind{ - "fusion": AlertRuleKindFusion, - "microsoftsecurityincidentcreation": AlertRuleKindMicrosoftSecurityIncidentCreation, - "scheduled": AlertRuleKindScheduled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertRuleKind(input) - return &out, nil -} - -type AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type EntityMappingType string - -const ( - EntityMappingTypeAccount EntityMappingType = "Account" - EntityMappingTypeAzureResource EntityMappingType = "AzureResource" - EntityMappingTypeCloudApplication EntityMappingType = "CloudApplication" - EntityMappingTypeDNS EntityMappingType = "DNS" - EntityMappingTypeFile EntityMappingType = "File" - EntityMappingTypeFileHash EntityMappingType = "FileHash" - EntityMappingTypeHost EntityMappingType = "Host" - EntityMappingTypeIP EntityMappingType = "IP" - EntityMappingTypeMailCluster EntityMappingType = "MailCluster" - EntityMappingTypeMailMessage EntityMappingType = "MailMessage" - EntityMappingTypeMailbox EntityMappingType = "Mailbox" - EntityMappingTypeMalware EntityMappingType = "Malware" - EntityMappingTypeProcess EntityMappingType = "Process" - EntityMappingTypeRegistryKey EntityMappingType = "RegistryKey" - EntityMappingTypeRegistryValue EntityMappingType = "RegistryValue" - EntityMappingTypeSecurityGroup EntityMappingType = "SecurityGroup" - EntityMappingTypeSubmissionMail EntityMappingType = "SubmissionMail" - EntityMappingTypeURL EntityMappingType = "URL" -) - -func PossibleValuesForEntityMappingType() []string { - return []string{ - string(EntityMappingTypeAccount), - string(EntityMappingTypeAzureResource), - string(EntityMappingTypeCloudApplication), - string(EntityMappingTypeDNS), - string(EntityMappingTypeFile), - string(EntityMappingTypeFileHash), - string(EntityMappingTypeHost), - string(EntityMappingTypeIP), - string(EntityMappingTypeMailCluster), - string(EntityMappingTypeMailMessage), - string(EntityMappingTypeMailbox), - string(EntityMappingTypeMalware), - string(EntityMappingTypeProcess), - string(EntityMappingTypeRegistryKey), - string(EntityMappingTypeRegistryValue), - string(EntityMappingTypeSecurityGroup), - string(EntityMappingTypeSubmissionMail), - string(EntityMappingTypeURL), - } -} - -func (s *EntityMappingType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityMappingType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityMappingType(input string) (*EntityMappingType, error) { - vals := map[string]EntityMappingType{ - "account": EntityMappingTypeAccount, - "azureresource": EntityMappingTypeAzureResource, - "cloudapplication": EntityMappingTypeCloudApplication, - "dns": EntityMappingTypeDNS, - "file": EntityMappingTypeFile, - "filehash": EntityMappingTypeFileHash, - "host": EntityMappingTypeHost, - "ip": EntityMappingTypeIP, - "mailcluster": EntityMappingTypeMailCluster, - "mailmessage": EntityMappingTypeMailMessage, - "mailbox": EntityMappingTypeMailbox, - "malware": EntityMappingTypeMalware, - "process": EntityMappingTypeProcess, - "registrykey": EntityMappingTypeRegistryKey, - "registryvalue": EntityMappingTypeRegistryValue, - "securitygroup": EntityMappingTypeSecurityGroup, - "submissionmail": EntityMappingTypeSubmissionMail, - "url": EntityMappingTypeURL, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityMappingType(input) - return &out, nil -} - -type EventGroupingAggregationKind string - -const ( - EventGroupingAggregationKindAlertPerResult EventGroupingAggregationKind = "AlertPerResult" - EventGroupingAggregationKindSingleAlert EventGroupingAggregationKind = "SingleAlert" -) - -func PossibleValuesForEventGroupingAggregationKind() []string { - return []string{ - string(EventGroupingAggregationKindAlertPerResult), - string(EventGroupingAggregationKindSingleAlert), - } -} - -func (s *EventGroupingAggregationKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEventGroupingAggregationKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEventGroupingAggregationKind(input string) (*EventGroupingAggregationKind, error) { - vals := map[string]EventGroupingAggregationKind{ - "alertperresult": EventGroupingAggregationKindAlertPerResult, - "singlealert": EventGroupingAggregationKindSingleAlert, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EventGroupingAggregationKind(input) - return &out, nil -} - -type MicrosoftSecurityProductName string - -const ( - MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection MicrosoftSecurityProductName = "Azure Active Directory Identity Protection" - MicrosoftSecurityProductNameAzureAdvancedThreatProtection MicrosoftSecurityProductName = "Azure Advanced Threat Protection" - MicrosoftSecurityProductNameAzureSecurityCenter MicrosoftSecurityProductName = "Azure Security Center" - MicrosoftSecurityProductNameAzureSecurityCenterForIoT MicrosoftSecurityProductName = "Azure Security Center for IoT" - MicrosoftSecurityProductNameMicrosoftCloudAppSecurity MicrosoftSecurityProductName = "Microsoft Cloud App Security" -) - -func PossibleValuesForMicrosoftSecurityProductName() []string { - return []string{ - string(MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection), - string(MicrosoftSecurityProductNameAzureAdvancedThreatProtection), - string(MicrosoftSecurityProductNameAzureSecurityCenter), - string(MicrosoftSecurityProductNameAzureSecurityCenterForIoT), - string(MicrosoftSecurityProductNameMicrosoftCloudAppSecurity), - } -} - -func (s *MicrosoftSecurityProductName) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseMicrosoftSecurityProductName(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseMicrosoftSecurityProductName(input string) (*MicrosoftSecurityProductName, error) { - vals := map[string]MicrosoftSecurityProductName{ - "azure active directory identity protection": MicrosoftSecurityProductNameAzureActiveDirectoryIdentityProtection, - "azure advanced threat protection": MicrosoftSecurityProductNameAzureAdvancedThreatProtection, - "azure security center": MicrosoftSecurityProductNameAzureSecurityCenter, - "azure security center for iot": MicrosoftSecurityProductNameAzureSecurityCenterForIoT, - "microsoft cloud app security": MicrosoftSecurityProductNameMicrosoftCloudAppSecurity, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := MicrosoftSecurityProductName(input) - return &out, nil -} - -type TemplateStatus string - -const ( - TemplateStatusAvailable TemplateStatus = "Available" - TemplateStatusInstalled TemplateStatus = "Installed" - TemplateStatusNotAvailable TemplateStatus = "NotAvailable" -) - -func PossibleValuesForTemplateStatus() []string { - return []string{ - string(TemplateStatusAvailable), - string(TemplateStatusInstalled), - string(TemplateStatusNotAvailable), - } -} - -func (s *TemplateStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTemplateStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTemplateStatus(input string) (*TemplateStatus, error) { - vals := map[string]TemplateStatus{ - "available": TemplateStatusAvailable, - "installed": TemplateStatusInstalled, - "notavailable": TemplateStatusNotAvailable, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TemplateStatus(input) - return &out, nil -} - -type TriggerOperator string - -const ( - TriggerOperatorEqual TriggerOperator = "Equal" - TriggerOperatorGreaterThan TriggerOperator = "GreaterThan" - TriggerOperatorLessThan TriggerOperator = "LessThan" - TriggerOperatorNotEqual TriggerOperator = "NotEqual" -) - -func PossibleValuesForTriggerOperator() []string { - return []string{ - string(TriggerOperatorEqual), - string(TriggerOperatorGreaterThan), - string(TriggerOperatorLessThan), - string(TriggerOperatorNotEqual), - } -} - -func (s *TriggerOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggerOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggerOperator(input string) (*TriggerOperator, error) { - vals := map[string]TriggerOperator{ - "equal": TriggerOperatorEqual, - "greaterthan": TriggerOperatorGreaterThan, - "lessthan": TriggerOperatorLessThan, - "notequal": TriggerOperatorNotEqual, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggerOperator(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate.go deleted file mode 100644 index 6a82de7688f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate.go +++ /dev/null @@ -1,141 +0,0 @@ -package alertruletemplates - -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(&AlertRuleTemplateId{}) -} - -var _ resourceids.ResourceId = &AlertRuleTemplateId{} - -// AlertRuleTemplateId is a struct representing the Resource ID for a Alert Rule Template -type AlertRuleTemplateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AlertRuleTemplateId string -} - -// NewAlertRuleTemplateID returns a new AlertRuleTemplateId struct -func NewAlertRuleTemplateID(subscriptionId string, resourceGroupName string, workspaceName string, alertRuleTemplateId string) AlertRuleTemplateId { - return AlertRuleTemplateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AlertRuleTemplateId: alertRuleTemplateId, - } -} - -// ParseAlertRuleTemplateID parses 'input' into a AlertRuleTemplateId -func ParseAlertRuleTemplateID(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAlertRuleTemplateIDInsensitively parses 'input' case-insensitively into a AlertRuleTemplateId -// note: this method should only be used for API response data and not user input -func ParseAlertRuleTemplateIDInsensitively(input string) (*AlertRuleTemplateId, error) { - parser := resourceids.NewParserFromResourceIdType(&AlertRuleTemplateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AlertRuleTemplateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AlertRuleTemplateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AlertRuleTemplateId, ok = input.Parsed["alertRuleTemplateId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "alertRuleTemplateId", input) - } - - return nil -} - -// ValidateAlertRuleTemplateID checks that 'input' can be parsed as a Alert Rule Template ID -func ValidateAlertRuleTemplateID(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 := ParseAlertRuleTemplateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Alert Rule Template ID -func (id AlertRuleTemplateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/alertRuleTemplates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AlertRuleTemplateId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Alert Rule Template ID -func (id AlertRuleTemplateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAlertRuleTemplates", "alertRuleTemplates", "alertRuleTemplates"), - resourceids.UserSpecifiedSegment("alertRuleTemplateId", "alertRuleTemplateIdValue"), - } -} - -// String returns a human-readable description of this Alert Rule Template ID -func (id AlertRuleTemplateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Alert Rule Template: %q", id.AlertRuleTemplateId), - } - return fmt.Sprintf("Alert Rule Template (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate_test.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate_test.go deleted file mode 100644 index ebc3eb67204..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_alertruletemplate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package alertruletemplates - -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 = &AlertRuleTemplateId{} - -func TestNewAlertRuleTemplateID(t *testing.T) { - id := NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AlertRuleTemplateId != "alertRuleTemplateIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AlertRuleTemplateId'", id.AlertRuleTemplateId, "alertRuleTemplateIdValue") - } -} - -func TestFormatAlertRuleTemplateID(t *testing.T) { - actual := NewAlertRuleTemplateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "alertRuleTemplateIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAlertRuleTemplateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AlertRuleTemplateId: "alertRuleTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleTemplateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AlertRuleTemplateId != v.Expected.AlertRuleTemplateId { - t.Fatalf("Expected %q but got %q for AlertRuleTemplateId", v.Expected.AlertRuleTemplateId, actual.AlertRuleTemplateId) - } - - } -} - -func TestParseAlertRuleTemplateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AlertRuleTemplateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AlertRuleTemplateId: "alertRuleTemplateIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/alertRuleTemplates/alertRuleTemplateIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS/aLeRtRuLeTeMpLaTeIdVaLuE", - Expected: &AlertRuleTemplateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AlertRuleTemplateId: "aLeRtRuLeTeMpLaTeIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aLeRtRuLeTeMpLaTeS/aLeRtRuLeTeMpLaTeIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAlertRuleTemplateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AlertRuleTemplateId != v.Expected.AlertRuleTemplateId { - t.Fatalf("Expected %q but got %q for AlertRuleTemplateId", v.Expected.AlertRuleTemplateId, actual.AlertRuleTemplateId) - } - - } -} - -func TestSegmentsForAlertRuleTemplateId(t *testing.T) { - segments := AlertRuleTemplateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AlertRuleTemplateId 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/securityinsights/2022-08-01/alertruletemplates/id_workspace.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace.go deleted file mode 100644 index 184371fb5dc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package alertruletemplates - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace_test.go deleted file mode 100644 index 77410c05cea..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package alertruletemplates - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/alertruletemplates/method_get.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/method_get.go deleted file mode 100644 index 861712be66a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "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 *AlertRuleTemplate -} - -// Get ... -func (c AlertRuleTemplatesClient) Get(ctx context.Context, id AlertRuleTemplateId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalAlertRuleTemplateImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/method_list.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/method_list.go deleted file mode 100644 index 21f9ceec3de..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package alertruletemplates - -import ( - "context" - "encoding/json" - "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 *[]AlertRuleTemplate -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AlertRuleTemplate -} - -// List ... -func (c AlertRuleTemplatesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/alertRuleTemplates", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]AlertRuleTemplate, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalAlertRuleTemplateImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for AlertRuleTemplate (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c AlertRuleTemplatesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AlertRuleTemplateOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AlertRuleTemplatesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AlertRuleTemplateOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AlertRuleTemplate, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/alertruletemplates/model_alertdetailsoverride.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertdetailsoverride.go deleted file mode 100644 index 136748927ba..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertdetailsoverride.go +++ /dev/null @@ -1,11 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertDetailsOverride struct { - AlertDescriptionFormat *string `json:"alertDescriptionFormat,omitempty"` - AlertDisplayNameFormat *string `json:"alertDisplayNameFormat,omitempty"` - AlertSeverityColumnName *string `json:"alertSeverityColumnName,omitempty"` - AlertTacticsColumnName *string `json:"alertTacticsColumnName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplate.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplate.go deleted file mode 100644 index 6000fbb4b2c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplate.go +++ /dev/null @@ -1,69 +0,0 @@ -package alertruletemplates - -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 AlertRuleTemplate interface { -} - -// RawAlertRuleTemplateImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAlertRuleTemplateImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAlertRuleTemplateImplementation(input []byte) (AlertRuleTemplate, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AlertRuleTemplate into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Fusion") { - var out FusionAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FusionAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftSecurityIncidentCreation") { - var out MicrosoftSecurityIncidentCreationAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Scheduled") { - var out ScheduledAlertRuleTemplate - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ScheduledAlertRuleTemplate: %+v", err) - } - return out, nil - } - - out := RawAlertRuleTemplateImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplatedatasource.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplatedatasource.go deleted file mode 100644 index 519fd6e1fe4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_alertruletemplatedatasource.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateDataSource struct { - ConnectorId *string `json:"connectorId,omitempty"` - DataTypes *[]string `json:"dataTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_entitymapping.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_entitymapping.go deleted file mode 100644 index 86cf5667f04..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_entitymapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EntityMapping struct { - EntityType *EntityMappingType `json:"entityType,omitempty"` - FieldMappings *[]FieldMapping `json:"fieldMappings,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_eventgroupingsettings.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_eventgroupingsettings.go deleted file mode 100644 index 3d80ecdb592..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_eventgroupingsettings.go +++ /dev/null @@ -1,8 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type EventGroupingSettings struct { - AggregationKind *EventGroupingAggregationKind `json:"aggregationKind,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fieldmapping.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fieldmapping.go deleted file mode 100644 index be96362b135..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fieldmapping.go +++ /dev/null @@ -1,9 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FieldMapping struct { - ColumnName *string `json:"columnName,omitempty"` - Identifier *string `json:"identifier,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplate.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplate.go deleted file mode 100644 index c2b4d8c3077..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = FusionAlertRuleTemplate{} - -type FusionAlertRuleTemplate struct { - Properties *FusionAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FusionAlertRuleTemplate{} - -func (s FusionAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper FusionAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FusionAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FusionAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Fusion" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FusionAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplateproperties.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplateproperties.go deleted file mode 100644 index 488e7745c05..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_fusionalertruletemplateproperties.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -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 FusionAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount *int64 `json:"alertRulesCreatedByTemplateCount,omitempty"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Status *TemplateStatus `json:"status,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` -} - -func (o *FusionAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *FusionAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *FusionAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go deleted file mode 100644 index 515a47767b2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -type MicrosoftSecurityIncidentCreationAlertRuleTemplate struct { - Properties *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MicrosoftSecurityIncidentCreationAlertRuleTemplate{} - -func (s MicrosoftSecurityIncidentCreationAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper MicrosoftSecurityIncidentCreationAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "MicrosoftSecurityIncidentCreation" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MicrosoftSecurityIncidentCreationAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go deleted file mode 100644 index e8a790dbe36..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_microsoftsecurityincidentcreationalertruletemplateproperties.go +++ /dev/null @@ -1,48 +0,0 @@ -package alertruletemplates - -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 MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties struct { - AlertRulesCreatedByTemplateCount *int64 `json:"alertRulesCreatedByTemplateCount,omitempty"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - DisplayNamesExcludeFilter *[]string `json:"displayNamesExcludeFilter,omitempty"` - DisplayNamesFilter *[]string `json:"displayNamesFilter,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - ProductFilter MicrosoftSecurityProductName `json:"productFilter"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - SeveritiesFilter *[]AlertSeverity `json:"severitiesFilter,omitempty"` - Status *TemplateStatus `json:"status,omitempty"` -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *MicrosoftSecurityIncidentCreationAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplate.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplate.go deleted file mode 100644 index c3428ada14d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplate.go +++ /dev/null @@ -1,47 +0,0 @@ -package alertruletemplates - -import ( - "encoding/json" - "fmt" - - "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. - -var _ AlertRuleTemplate = ScheduledAlertRuleTemplate{} - -type ScheduledAlertRuleTemplate struct { - Properties *ScheduledAlertRuleTemplateProperties `json:"properties,omitempty"` - - // Fields inherited from AlertRuleTemplate - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ScheduledAlertRuleTemplate{} - -func (s ScheduledAlertRuleTemplate) MarshalJSON() ([]byte, error) { - type wrapper ScheduledAlertRuleTemplate - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ScheduledAlertRuleTemplate: %+v", err) - } - decoded["kind"] = "Scheduled" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ScheduledAlertRuleTemplate: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplateproperties.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplateproperties.go deleted file mode 100644 index 16b946a1bf2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/model_scheduledalertruletemplateproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -package alertruletemplates - -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 ScheduledAlertRuleTemplateProperties struct { - AlertDetailsOverride *AlertDetailsOverride `json:"alertDetailsOverride,omitempty"` - AlertRulesCreatedByTemplateCount *int64 `json:"alertRulesCreatedByTemplateCount,omitempty"` - CreatedDateUTC *string `json:"createdDateUTC,omitempty"` - CustomDetails *map[string]string `json:"customDetails,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - EntityMappings *[]EntityMapping `json:"entityMappings,omitempty"` - EventGroupingSettings *EventGroupingSettings `json:"eventGroupingSettings,omitempty"` - LastUpdatedDateUTC *string `json:"lastUpdatedDateUTC,omitempty"` - Query *string `json:"query,omitempty"` - QueryFrequency *string `json:"queryFrequency,omitempty"` - QueryPeriod *string `json:"queryPeriod,omitempty"` - RequiredDataConnectors *[]AlertRuleTemplateDataSource `json:"requiredDataConnectors,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - Status *TemplateStatus `json:"status,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - Techniques *[]string `json:"techniques,omitempty"` - TriggerOperator *TriggerOperator `json:"triggerOperator,omitempty"` - TriggerThreshold *int64 `json:"triggerThreshold,omitempty"` - Version *string `json:"version,omitempty"` -} - -func (o *ScheduledAlertRuleTemplateProperties) GetCreatedDateUTCAsTime() (*time.Time, error) { - if o.CreatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetCreatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedDateUTC = &formatted -} - -func (o *ScheduledAlertRuleTemplateProperties) GetLastUpdatedDateUTCAsTime() (*time.Time, error) { - if o.LastUpdatedDateUTC == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastUpdatedDateUTC, "2006-01-02T15:04:05Z07:00") -} - -func (o *ScheduledAlertRuleTemplateProperties) SetLastUpdatedDateUTCAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastUpdatedDateUTC = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/predicates.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/predicates.go deleted file mode 100644 index 093c50e1616..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertRuleTemplateOperationPredicate struct { -} - -func (p AlertRuleTemplateOperationPredicate) Matches(input AlertRuleTemplate) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-08-01/alertruletemplates/version.go b/resource-manager/securityinsights/2022-08-01/alertruletemplates/version.go deleted file mode 100644 index b5812f4f0b7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/alertruletemplates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package alertruletemplates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/alertruletemplates/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/README.md b/resource-manager/securityinsights/2022-08-01/automationrules/README.md deleted file mode 100644 index 55fd17daa01..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/automationrules` Documentation - -The `automationrules` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/automationrules" -``` - - -### Client Initialization - -```go -client := automationrules.NewAutomationRulesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `AutomationRulesClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -payload := automationrules.AutomationRule{ - // ... -} - - -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: `AutomationRulesClient.Delete` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -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: `AutomationRulesClient.Get` - -```go -ctx := context.TODO() -id := automationrules.NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - -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: `AutomationRulesClient.List` - -```go -ctx := context.TODO() -id := automationrules.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-08-01/automationrules/client.go b/resource-manager/securityinsights/2022-08-01/automationrules/client.go deleted file mode 100644 index 18fafea1496..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package automationrules - -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 AutomationRulesClient struct { - Client *resourcemanager.Client -} - -func NewAutomationRulesClientWithBaseURI(sdkApi sdkEnv.Api) (*AutomationRulesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "automationrules", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating AutomationRulesClient: %+v", err) - } - - return &AutomationRulesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/constants.go b/resource-manager/securityinsights/2022-08-01/automationrules/constants.go deleted file mode 100644 index 1b99265c0e2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/constants.go +++ /dev/null @@ -1,691 +0,0 @@ -package automationrules - -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 ActionType string - -const ( - ActionTypeModifyProperties ActionType = "ModifyProperties" - ActionTypeRunPlaybook ActionType = "RunPlaybook" -) - -func PossibleValuesForActionType() []string { - return []string{ - string(ActionTypeModifyProperties), - string(ActionTypeRunPlaybook), - } -} - -func (s *ActionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseActionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseActionType(input string) (*ActionType, error) { - vals := map[string]ActionType{ - "modifyproperties": ActionTypeModifyProperties, - "runplaybook": ActionTypeRunPlaybook, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ActionType(input) - return &out, nil -} - -type AutomationRulePropertyConditionSupportedOperator string - -const ( - AutomationRulePropertyConditionSupportedOperatorContains AutomationRulePropertyConditionSupportedOperator = "Contains" - AutomationRulePropertyConditionSupportedOperatorEndsWith AutomationRulePropertyConditionSupportedOperator = "EndsWith" - AutomationRulePropertyConditionSupportedOperatorEquals AutomationRulePropertyConditionSupportedOperator = "Equals" - AutomationRulePropertyConditionSupportedOperatorNotContains AutomationRulePropertyConditionSupportedOperator = "NotContains" - AutomationRulePropertyConditionSupportedOperatorNotEndsWith AutomationRulePropertyConditionSupportedOperator = "NotEndsWith" - AutomationRulePropertyConditionSupportedOperatorNotEquals AutomationRulePropertyConditionSupportedOperator = "NotEquals" - AutomationRulePropertyConditionSupportedOperatorNotStartsWith AutomationRulePropertyConditionSupportedOperator = "NotStartsWith" - AutomationRulePropertyConditionSupportedOperatorStartsWith AutomationRulePropertyConditionSupportedOperator = "StartsWith" -) - -func PossibleValuesForAutomationRulePropertyConditionSupportedOperator() []string { - return []string{ - string(AutomationRulePropertyConditionSupportedOperatorContains), - string(AutomationRulePropertyConditionSupportedOperatorEndsWith), - string(AutomationRulePropertyConditionSupportedOperatorEquals), - string(AutomationRulePropertyConditionSupportedOperatorNotContains), - string(AutomationRulePropertyConditionSupportedOperatorNotEndsWith), - string(AutomationRulePropertyConditionSupportedOperatorNotEquals), - string(AutomationRulePropertyConditionSupportedOperatorNotStartsWith), - string(AutomationRulePropertyConditionSupportedOperatorStartsWith), - } -} - -func (s *AutomationRulePropertyConditionSupportedOperator) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyConditionSupportedOperator(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyConditionSupportedOperator(input string) (*AutomationRulePropertyConditionSupportedOperator, error) { - vals := map[string]AutomationRulePropertyConditionSupportedOperator{ - "contains": AutomationRulePropertyConditionSupportedOperatorContains, - "endswith": AutomationRulePropertyConditionSupportedOperatorEndsWith, - "equals": AutomationRulePropertyConditionSupportedOperatorEquals, - "notcontains": AutomationRulePropertyConditionSupportedOperatorNotContains, - "notendswith": AutomationRulePropertyConditionSupportedOperatorNotEndsWith, - "notequals": AutomationRulePropertyConditionSupportedOperatorNotEquals, - "notstartswith": AutomationRulePropertyConditionSupportedOperatorNotStartsWith, - "startswith": AutomationRulePropertyConditionSupportedOperatorStartsWith, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyConditionSupportedOperator(input) - return &out, nil -} - -type AutomationRulePropertyConditionSupportedProperty string - -const ( - AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId AutomationRulePropertyConditionSupportedProperty = "AccountAadTenantId" - AutomationRulePropertyConditionSupportedPropertyAccountAadUserId AutomationRulePropertyConditionSupportedProperty = "AccountAadUserId" - AutomationRulePropertyConditionSupportedPropertyAccountNTDomain AutomationRulePropertyConditionSupportedProperty = "AccountNTDomain" - AutomationRulePropertyConditionSupportedPropertyAccountName AutomationRulePropertyConditionSupportedProperty = "AccountName" - AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid AutomationRulePropertyConditionSupportedProperty = "AccountObjectGuid" - AutomationRulePropertyConditionSupportedPropertyAccountPUID AutomationRulePropertyConditionSupportedProperty = "AccountPUID" - AutomationRulePropertyConditionSupportedPropertyAccountSid AutomationRulePropertyConditionSupportedProperty = "AccountSid" - AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix AutomationRulePropertyConditionSupportedProperty = "AccountUPNSuffix" - AutomationRulePropertyConditionSupportedPropertyAlertProductNames AutomationRulePropertyConditionSupportedProperty = "AlertProductNames" - AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId AutomationRulePropertyConditionSupportedProperty = "AzureResourceResourceId" - AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId AutomationRulePropertyConditionSupportedProperty = "AzureResourceSubscriptionId" - AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId AutomationRulePropertyConditionSupportedProperty = "CloudApplicationAppId" - AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName AutomationRulePropertyConditionSupportedProperty = "CloudApplicationAppName" - AutomationRulePropertyConditionSupportedPropertyDNSDomainName AutomationRulePropertyConditionSupportedProperty = "DNSDomainName" - AutomationRulePropertyConditionSupportedPropertyFileDirectory AutomationRulePropertyConditionSupportedProperty = "FileDirectory" - AutomationRulePropertyConditionSupportedPropertyFileHashValue AutomationRulePropertyConditionSupportedProperty = "FileHashValue" - AutomationRulePropertyConditionSupportedPropertyFileName AutomationRulePropertyConditionSupportedProperty = "FileName" - AutomationRulePropertyConditionSupportedPropertyHostAzureID AutomationRulePropertyConditionSupportedProperty = "HostAzureID" - AutomationRulePropertyConditionSupportedPropertyHostNTDomain AutomationRulePropertyConditionSupportedProperty = "HostNTDomain" - AutomationRulePropertyConditionSupportedPropertyHostName AutomationRulePropertyConditionSupportedProperty = "HostName" - AutomationRulePropertyConditionSupportedPropertyHostNetBiosName AutomationRulePropertyConditionSupportedProperty = "HostNetBiosName" - AutomationRulePropertyConditionSupportedPropertyHostOSVersion AutomationRulePropertyConditionSupportedProperty = "HostOSVersion" - AutomationRulePropertyConditionSupportedPropertyIPAddress AutomationRulePropertyConditionSupportedProperty = "IPAddress" - AutomationRulePropertyConditionSupportedPropertyIncidentDescription AutomationRulePropertyConditionSupportedProperty = "IncidentDescription" - AutomationRulePropertyConditionSupportedPropertyIncidentLabel AutomationRulePropertyConditionSupportedProperty = "IncidentLabel" - AutomationRulePropertyConditionSupportedPropertyIncidentProviderName AutomationRulePropertyConditionSupportedProperty = "IncidentProviderName" - AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds AutomationRulePropertyConditionSupportedProperty = "IncidentRelatedAnalyticRuleIds" - AutomationRulePropertyConditionSupportedPropertyIncidentSeverity AutomationRulePropertyConditionSupportedProperty = "IncidentSeverity" - AutomationRulePropertyConditionSupportedPropertyIncidentStatus AutomationRulePropertyConditionSupportedProperty = "IncidentStatus" - AutomationRulePropertyConditionSupportedPropertyIncidentTactics AutomationRulePropertyConditionSupportedProperty = "IncidentTactics" - AutomationRulePropertyConditionSupportedPropertyIncidentTitle AutomationRulePropertyConditionSupportedProperty = "IncidentTitle" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceId AutomationRulePropertyConditionSupportedProperty = "IoTDeviceId" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel AutomationRulePropertyConditionSupportedProperty = "IoTDeviceModel" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceName AutomationRulePropertyConditionSupportedProperty = "IoTDeviceName" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem AutomationRulePropertyConditionSupportedProperty = "IoTDeviceOperatingSystem" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceType AutomationRulePropertyConditionSupportedProperty = "IoTDeviceType" - AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor AutomationRulePropertyConditionSupportedProperty = "IoTDeviceVendor" - AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction AutomationRulePropertyConditionSupportedProperty = "MailMessageDeliveryAction" - AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation AutomationRulePropertyConditionSupportedProperty = "MailMessageDeliveryLocation" - AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender AutomationRulePropertyConditionSupportedProperty = "MailMessageP1Sender" - AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender AutomationRulePropertyConditionSupportedProperty = "MailMessageP2Sender" - AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient AutomationRulePropertyConditionSupportedProperty = "MailMessageRecipient" - AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP AutomationRulePropertyConditionSupportedProperty = "MailMessageSenderIP" - AutomationRulePropertyConditionSupportedPropertyMailMessageSubject AutomationRulePropertyConditionSupportedProperty = "MailMessageSubject" - AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName AutomationRulePropertyConditionSupportedProperty = "MailboxDisplayName" - AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress AutomationRulePropertyConditionSupportedProperty = "MailboxPrimaryAddress" - AutomationRulePropertyConditionSupportedPropertyMailboxUPN AutomationRulePropertyConditionSupportedProperty = "MailboxUPN" - AutomationRulePropertyConditionSupportedPropertyMalwareCategory AutomationRulePropertyConditionSupportedProperty = "MalwareCategory" - AutomationRulePropertyConditionSupportedPropertyMalwareName AutomationRulePropertyConditionSupportedProperty = "MalwareName" - AutomationRulePropertyConditionSupportedPropertyProcessCommandLine AutomationRulePropertyConditionSupportedProperty = "ProcessCommandLine" - AutomationRulePropertyConditionSupportedPropertyProcessId AutomationRulePropertyConditionSupportedProperty = "ProcessId" - AutomationRulePropertyConditionSupportedPropertyRegistryKey AutomationRulePropertyConditionSupportedProperty = "RegistryKey" - AutomationRulePropertyConditionSupportedPropertyRegistryValueData AutomationRulePropertyConditionSupportedProperty = "RegistryValueData" - AutomationRulePropertyConditionSupportedPropertyUrl AutomationRulePropertyConditionSupportedProperty = "Url" -) - -func PossibleValuesForAutomationRulePropertyConditionSupportedProperty() []string { - return []string{ - string(AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId), - string(AutomationRulePropertyConditionSupportedPropertyAccountAadUserId), - string(AutomationRulePropertyConditionSupportedPropertyAccountNTDomain), - string(AutomationRulePropertyConditionSupportedPropertyAccountName), - string(AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid), - string(AutomationRulePropertyConditionSupportedPropertyAccountPUID), - string(AutomationRulePropertyConditionSupportedPropertyAccountSid), - string(AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix), - string(AutomationRulePropertyConditionSupportedPropertyAlertProductNames), - string(AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId), - string(AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId), - string(AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId), - string(AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName), - string(AutomationRulePropertyConditionSupportedPropertyDNSDomainName), - string(AutomationRulePropertyConditionSupportedPropertyFileDirectory), - string(AutomationRulePropertyConditionSupportedPropertyFileHashValue), - string(AutomationRulePropertyConditionSupportedPropertyFileName), - string(AutomationRulePropertyConditionSupportedPropertyHostAzureID), - string(AutomationRulePropertyConditionSupportedPropertyHostNTDomain), - string(AutomationRulePropertyConditionSupportedPropertyHostName), - string(AutomationRulePropertyConditionSupportedPropertyHostNetBiosName), - string(AutomationRulePropertyConditionSupportedPropertyHostOSVersion), - string(AutomationRulePropertyConditionSupportedPropertyIPAddress), - string(AutomationRulePropertyConditionSupportedPropertyIncidentDescription), - string(AutomationRulePropertyConditionSupportedPropertyIncidentLabel), - string(AutomationRulePropertyConditionSupportedPropertyIncidentProviderName), - string(AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds), - string(AutomationRulePropertyConditionSupportedPropertyIncidentSeverity), - string(AutomationRulePropertyConditionSupportedPropertyIncidentStatus), - string(AutomationRulePropertyConditionSupportedPropertyIncidentTactics), - string(AutomationRulePropertyConditionSupportedPropertyIncidentTitle), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceId), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceName), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceType), - string(AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation), - string(AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender), - string(AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP), - string(AutomationRulePropertyConditionSupportedPropertyMailMessageSubject), - string(AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName), - string(AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress), - string(AutomationRulePropertyConditionSupportedPropertyMailboxUPN), - string(AutomationRulePropertyConditionSupportedPropertyMalwareCategory), - string(AutomationRulePropertyConditionSupportedPropertyMalwareName), - string(AutomationRulePropertyConditionSupportedPropertyProcessCommandLine), - string(AutomationRulePropertyConditionSupportedPropertyProcessId), - string(AutomationRulePropertyConditionSupportedPropertyRegistryKey), - string(AutomationRulePropertyConditionSupportedPropertyRegistryValueData), - string(AutomationRulePropertyConditionSupportedPropertyUrl), - } -} - -func (s *AutomationRulePropertyConditionSupportedProperty) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAutomationRulePropertyConditionSupportedProperty(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAutomationRulePropertyConditionSupportedProperty(input string) (*AutomationRulePropertyConditionSupportedProperty, error) { - vals := map[string]AutomationRulePropertyConditionSupportedProperty{ - "accountaadtenantid": AutomationRulePropertyConditionSupportedPropertyAccountAadTenantId, - "accountaaduserid": AutomationRulePropertyConditionSupportedPropertyAccountAadUserId, - "accountntdomain": AutomationRulePropertyConditionSupportedPropertyAccountNTDomain, - "accountname": AutomationRulePropertyConditionSupportedPropertyAccountName, - "accountobjectguid": AutomationRulePropertyConditionSupportedPropertyAccountObjectGuid, - "accountpuid": AutomationRulePropertyConditionSupportedPropertyAccountPUID, - "accountsid": AutomationRulePropertyConditionSupportedPropertyAccountSid, - "accountupnsuffix": AutomationRulePropertyConditionSupportedPropertyAccountUPNSuffix, - "alertproductnames": AutomationRulePropertyConditionSupportedPropertyAlertProductNames, - "azureresourceresourceid": AutomationRulePropertyConditionSupportedPropertyAzureResourceResourceId, - "azureresourcesubscriptionid": AutomationRulePropertyConditionSupportedPropertyAzureResourceSubscriptionId, - "cloudapplicationappid": AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppId, - "cloudapplicationappname": AutomationRulePropertyConditionSupportedPropertyCloudApplicationAppName, - "dnsdomainname": AutomationRulePropertyConditionSupportedPropertyDNSDomainName, - "filedirectory": AutomationRulePropertyConditionSupportedPropertyFileDirectory, - "filehashvalue": AutomationRulePropertyConditionSupportedPropertyFileHashValue, - "filename": AutomationRulePropertyConditionSupportedPropertyFileName, - "hostazureid": AutomationRulePropertyConditionSupportedPropertyHostAzureID, - "hostntdomain": AutomationRulePropertyConditionSupportedPropertyHostNTDomain, - "hostname": AutomationRulePropertyConditionSupportedPropertyHostName, - "hostnetbiosname": AutomationRulePropertyConditionSupportedPropertyHostNetBiosName, - "hostosversion": AutomationRulePropertyConditionSupportedPropertyHostOSVersion, - "ipaddress": AutomationRulePropertyConditionSupportedPropertyIPAddress, - "incidentdescription": AutomationRulePropertyConditionSupportedPropertyIncidentDescription, - "incidentlabel": AutomationRulePropertyConditionSupportedPropertyIncidentLabel, - "incidentprovidername": AutomationRulePropertyConditionSupportedPropertyIncidentProviderName, - "incidentrelatedanalyticruleids": AutomationRulePropertyConditionSupportedPropertyIncidentRelatedAnalyticRuleIds, - "incidentseverity": AutomationRulePropertyConditionSupportedPropertyIncidentSeverity, - "incidentstatus": AutomationRulePropertyConditionSupportedPropertyIncidentStatus, - "incidenttactics": AutomationRulePropertyConditionSupportedPropertyIncidentTactics, - "incidenttitle": AutomationRulePropertyConditionSupportedPropertyIncidentTitle, - "iotdeviceid": AutomationRulePropertyConditionSupportedPropertyIoTDeviceId, - "iotdevicemodel": AutomationRulePropertyConditionSupportedPropertyIoTDeviceModel, - "iotdevicename": AutomationRulePropertyConditionSupportedPropertyIoTDeviceName, - "iotdeviceoperatingsystem": AutomationRulePropertyConditionSupportedPropertyIoTDeviceOperatingSystem, - "iotdevicetype": AutomationRulePropertyConditionSupportedPropertyIoTDeviceType, - "iotdevicevendor": AutomationRulePropertyConditionSupportedPropertyIoTDeviceVendor, - "mailmessagedeliveryaction": AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryAction, - "mailmessagedeliverylocation": AutomationRulePropertyConditionSupportedPropertyMailMessageDeliveryLocation, - "mailmessagep1sender": AutomationRulePropertyConditionSupportedPropertyMailMessagePOneSender, - "mailmessagep2sender": AutomationRulePropertyConditionSupportedPropertyMailMessagePTwoSender, - "mailmessagerecipient": AutomationRulePropertyConditionSupportedPropertyMailMessageRecipient, - "mailmessagesenderip": AutomationRulePropertyConditionSupportedPropertyMailMessageSenderIP, - "mailmessagesubject": AutomationRulePropertyConditionSupportedPropertyMailMessageSubject, - "mailboxdisplayname": AutomationRulePropertyConditionSupportedPropertyMailboxDisplayName, - "mailboxprimaryaddress": AutomationRulePropertyConditionSupportedPropertyMailboxPrimaryAddress, - "mailboxupn": AutomationRulePropertyConditionSupportedPropertyMailboxUPN, - "malwarecategory": AutomationRulePropertyConditionSupportedPropertyMalwareCategory, - "malwarename": AutomationRulePropertyConditionSupportedPropertyMalwareName, - "processcommandline": AutomationRulePropertyConditionSupportedPropertyProcessCommandLine, - "processid": AutomationRulePropertyConditionSupportedPropertyProcessId, - "registrykey": AutomationRulePropertyConditionSupportedPropertyRegistryKey, - "registryvaluedata": AutomationRulePropertyConditionSupportedPropertyRegistryValueData, - "url": AutomationRulePropertyConditionSupportedPropertyUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AutomationRulePropertyConditionSupportedProperty(input) - return &out, nil -} - -type ConditionType string - -const ( - ConditionTypeProperty ConditionType = "Property" -) - -func PossibleValuesForConditionType() []string { - return []string{ - string(ConditionTypeProperty), - } -} - -func (s *ConditionType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConditionType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConditionType(input string) (*ConditionType, error) { - vals := map[string]ConditionType{ - "property": ConditionTypeProperty, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConditionType(input) - return &out, nil -} - -type IncidentClassification string - -const ( - IncidentClassificationBenignPositive IncidentClassification = "BenignPositive" - IncidentClassificationFalsePositive IncidentClassification = "FalsePositive" - IncidentClassificationTruePositive IncidentClassification = "TruePositive" - IncidentClassificationUndetermined IncidentClassification = "Undetermined" -) - -func PossibleValuesForIncidentClassification() []string { - return []string{ - string(IncidentClassificationBenignPositive), - string(IncidentClassificationFalsePositive), - string(IncidentClassificationTruePositive), - string(IncidentClassificationUndetermined), - } -} - -func (s *IncidentClassification) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassification(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassification(input string) (*IncidentClassification, error) { - vals := map[string]IncidentClassification{ - "benignpositive": IncidentClassificationBenignPositive, - "falsepositive": IncidentClassificationFalsePositive, - "truepositive": IncidentClassificationTruePositive, - "undetermined": IncidentClassificationUndetermined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassification(input) - return &out, nil -} - -type IncidentClassificationReason string - -const ( - IncidentClassificationReasonInaccurateData IncidentClassificationReason = "InaccurateData" - IncidentClassificationReasonIncorrectAlertLogic IncidentClassificationReason = "IncorrectAlertLogic" - IncidentClassificationReasonSuspiciousActivity IncidentClassificationReason = "SuspiciousActivity" - IncidentClassificationReasonSuspiciousButExpected IncidentClassificationReason = "SuspiciousButExpected" -) - -func PossibleValuesForIncidentClassificationReason() []string { - return []string{ - string(IncidentClassificationReasonInaccurateData), - string(IncidentClassificationReasonIncorrectAlertLogic), - string(IncidentClassificationReasonSuspiciousActivity), - string(IncidentClassificationReasonSuspiciousButExpected), - } -} - -func (s *IncidentClassificationReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassificationReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassificationReason(input string) (*IncidentClassificationReason, error) { - vals := map[string]IncidentClassificationReason{ - "inaccuratedata": IncidentClassificationReasonInaccurateData, - "incorrectalertlogic": IncidentClassificationReasonIncorrectAlertLogic, - "suspiciousactivity": IncidentClassificationReasonSuspiciousActivity, - "suspiciousbutexpected": IncidentClassificationReasonSuspiciousButExpected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassificationReason(input) - return &out, nil -} - -type IncidentLabelType string - -const ( - IncidentLabelTypeAutoAssigned IncidentLabelType = "AutoAssigned" - IncidentLabelTypeUser IncidentLabelType = "User" -) - -func PossibleValuesForIncidentLabelType() []string { - return []string{ - string(IncidentLabelTypeAutoAssigned), - string(IncidentLabelTypeUser), - } -} - -func (s *IncidentLabelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentLabelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentLabelType(input string) (*IncidentLabelType, error) { - vals := map[string]IncidentLabelType{ - "autoassigned": IncidentLabelTypeAutoAssigned, - "user": IncidentLabelTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentLabelType(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type IncidentStatus string - -const ( - IncidentStatusActive IncidentStatus = "Active" - IncidentStatusClosed IncidentStatus = "Closed" - IncidentStatusNew IncidentStatus = "New" -) - -func PossibleValuesForIncidentStatus() []string { - return []string{ - string(IncidentStatusActive), - string(IncidentStatusClosed), - string(IncidentStatusNew), - } -} - -func (s *IncidentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentStatus(input string) (*IncidentStatus, error) { - vals := map[string]IncidentStatus{ - "active": IncidentStatusActive, - "closed": IncidentStatusClosed, - "new": IncidentStatusNew, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentStatus(input) - return &out, nil -} - -type OwnerType string - -const ( - OwnerTypeGroup OwnerType = "Group" - OwnerTypeUnknown OwnerType = "Unknown" - OwnerTypeUser OwnerType = "User" -) - -func PossibleValuesForOwnerType() []string { - return []string{ - string(OwnerTypeGroup), - string(OwnerTypeUnknown), - string(OwnerTypeUser), - } -} - -func (s *OwnerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwnerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwnerType(input string) (*OwnerType, error) { - vals := map[string]OwnerType{ - "group": OwnerTypeGroup, - "unknown": OwnerTypeUnknown, - "user": OwnerTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwnerType(input) - return &out, nil -} - -type TriggersOn string - -const ( - TriggersOnIncidents TriggersOn = "Incidents" -) - -func PossibleValuesForTriggersOn() []string { - return []string{ - string(TriggersOnIncidents), - } -} - -func (s *TriggersOn) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggersOn(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggersOn(input string) (*TriggersOn, error) { - vals := map[string]TriggersOn{ - "incidents": TriggersOnIncidents, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggersOn(input) - return &out, nil -} - -type TriggersWhen string - -const ( - TriggersWhenCreated TriggersWhen = "Created" -) - -func PossibleValuesForTriggersWhen() []string { - return []string{ - string(TriggersWhenCreated), - } -} - -func (s *TriggersWhen) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseTriggersWhen(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseTriggersWhen(input string) (*TriggersWhen, error) { - vals := map[string]TriggersWhen{ - "created": TriggersWhenCreated, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := TriggersWhen(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule.go b/resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule.go deleted file mode 100644 index 00c7db776a3..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule.go +++ /dev/null @@ -1,141 +0,0 @@ -package automationrules - -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(&AutomationRuleId{}) -} - -var _ resourceids.ResourceId = &AutomationRuleId{} - -// AutomationRuleId is a struct representing the Resource ID for a Automation Rule -type AutomationRuleId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - AutomationRuleId string -} - -// NewAutomationRuleID returns a new AutomationRuleId struct -func NewAutomationRuleID(subscriptionId string, resourceGroupName string, workspaceName string, automationRuleId string) AutomationRuleId { - return AutomationRuleId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - AutomationRuleId: automationRuleId, - } -} - -// ParseAutomationRuleID parses 'input' into a AutomationRuleId -func ParseAutomationRuleID(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseAutomationRuleIDInsensitively parses 'input' case-insensitively into a AutomationRuleId -// note: this method should only be used for API response data and not user input -func ParseAutomationRuleIDInsensitively(input string) (*AutomationRuleId, error) { - parser := resourceids.NewParserFromResourceIdType(&AutomationRuleId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := AutomationRuleId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *AutomationRuleId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.AutomationRuleId, ok = input.Parsed["automationRuleId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "automationRuleId", input) - } - - return nil -} - -// ValidateAutomationRuleID checks that 'input' can be parsed as a Automation Rule ID -func ValidateAutomationRuleID(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 := ParseAutomationRuleID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Automation Rule ID -func (id AutomationRuleId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/automationRules/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.AutomationRuleId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Automation Rule ID -func (id AutomationRuleId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticAutomationRules", "automationRules", "automationRules"), - resourceids.UserSpecifiedSegment("automationRuleId", "automationRuleIdValue"), - } -} - -// String returns a human-readable description of this Automation Rule ID -func (id AutomationRuleId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Automation Rule: %q", id.AutomationRuleId), - } - return fmt.Sprintf("Automation Rule (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule_test.go b/resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule_test.go deleted file mode 100644 index dd04eaade34..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/id_automationrule_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package automationrules - -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 = &AutomationRuleId{} - -func TestNewAutomationRuleID(t *testing.T) { - id := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.AutomationRuleId != "automationRuleIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'AutomationRuleId'", id.AutomationRuleId, "automationRuleIdValue") - } -} - -func TestFormatAutomationRuleID(t *testing.T) { - actual := NewAutomationRuleID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "automationRuleIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseAutomationRuleID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestParseAutomationRuleIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *AutomationRuleId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - AutomationRuleId: "automationRuleIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/automationRules/automationRuleIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe", - Expected: &AutomationRuleId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - AutomationRuleId: "aUtOmAtIoNrUlEiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/aUtOmAtIoNrUlEs/aUtOmAtIoNrUlEiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseAutomationRuleIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.AutomationRuleId != v.Expected.AutomationRuleId { - t.Fatalf("Expected %q but got %q for AutomationRuleId", v.Expected.AutomationRuleId, actual.AutomationRuleId) - } - - } -} - -func TestSegmentsForAutomationRuleId(t *testing.T) { - segments := AutomationRuleId{}.Segments() - if len(segments) == 0 { - t.Fatalf("AutomationRuleId 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/securityinsights/2022-08-01/automationrules/id_workspace.go b/resource-manager/securityinsights/2022-08-01/automationrules/id_workspace.go deleted file mode 100644 index 72d00c87771..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package automationrules - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/automationrules/id_workspace_test.go deleted file mode 100644 index bc06f0f478f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package automationrules - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/automationrules/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/automationrules/method_createorupdate.go deleted file mode 100644 index 6ab8b05e0fb..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package automationrules - -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 *AutomationRule -} - -// CreateOrUpdate ... -func (c AutomationRulesClient) CreateOrUpdate(ctx context.Context, id AutomationRuleId, input AutomationRule) (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 AutomationRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/method_delete.go b/resource-manager/securityinsights/2022-08-01/automationrules/method_delete.go deleted file mode 100644 index c32a7e886ad..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/method_delete.go +++ /dev/null @@ -1,55 +0,0 @@ -package automationrules - -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 - Model *interface{} -} - -// Delete ... -func (c AutomationRulesClient) Delete(ctx context.Context, id AutomationRuleId) (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 - } - - var model interface{} - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/method_get.go b/resource-manager/securityinsights/2022-08-01/automationrules/method_get.go deleted file mode 100644 index b5c7ce72e30..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package automationrules - -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 *AutomationRule -} - -// Get ... -func (c AutomationRulesClient) Get(ctx context.Context, id AutomationRuleId) (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 AutomationRule - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/method_list.go b/resource-manager/securityinsights/2022-08-01/automationrules/method_list.go deleted file mode 100644 index a3c7db4995a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package automationrules - -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 *[]AutomationRule -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []AutomationRule -} - -// List ... -func (c AutomationRulesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/automationRules", 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 *[]AutomationRule `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 AutomationRulesClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, AutomationRuleOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c AutomationRulesClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate AutomationRuleOperationPredicate) (result ListCompleteResult, err error) { - items := make([]AutomationRule, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/automationrules/model_automationrule.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrule.go deleted file mode 100644 index 1c49c5a77de..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrule.go +++ /dev/null @@ -1,17 +0,0 @@ -package automationrules - -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 AutomationRule struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties AutomationRuleProperties `json:"properties"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleaction.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleaction.go deleted file mode 100644 index 77887bb8adf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleaction.go +++ /dev/null @@ -1,61 +0,0 @@ -package automationrules - -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 AutomationRuleAction interface { -} - -// RawAutomationRuleActionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAutomationRuleActionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAutomationRuleActionImplementation(input []byte) (AutomationRuleAction, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleAction into map[string]interface: %+v", err) - } - - value, ok := temp["actionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "ModifyProperties") { - var out AutomationRuleModifyPropertiesAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRuleModifyPropertiesAction: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RunPlaybook") { - var out AutomationRuleRunPlaybookAction - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AutomationRuleRunPlaybookAction: %+v", err) - } - return out, nil - } - - out := RawAutomationRuleActionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulecondition.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulecondition.go deleted file mode 100644 index 090edd3a7f4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulecondition.go +++ /dev/null @@ -1,53 +0,0 @@ -package automationrules - -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 AutomationRuleCondition interface { -} - -// RawAutomationRuleConditionImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawAutomationRuleConditionImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalAutomationRuleConditionImplementation(input []byte) (AutomationRuleCondition, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleCondition into map[string]interface: %+v", err) - } - - value, ok := temp["conditionType"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Property") { - var out PropertyConditionProperties - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into PropertyConditionProperties: %+v", err) - } - return out, nil - } - - out := RawAutomationRuleConditionImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulemodifypropertiesaction.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulemodifypropertiesaction.go deleted file mode 100644 index 98eb39b6a9b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulemodifypropertiesaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleAction = AutomationRuleModifyPropertiesAction{} - -type AutomationRuleModifyPropertiesAction struct { - ActionConfiguration *IncidentPropertiesAction `json:"actionConfiguration,omitempty"` - - // Fields inherited from AutomationRuleAction - Order int64 `json:"order"` -} - -var _ json.Marshaler = AutomationRuleModifyPropertiesAction{} - -func (s AutomationRuleModifyPropertiesAction) MarshalJSON() ([]byte, error) { - type wrapper AutomationRuleModifyPropertiesAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - decoded["actionType"] = "ModifyProperties" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRuleModifyPropertiesAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleproperties.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleproperties.go deleted file mode 100644 index 5460f9b5fba..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruleproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" - "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 AutomationRuleProperties struct { - Actions []AutomationRuleAction `json:"actions"` - CreatedBy *ClientInfo `json:"createdBy,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - DisplayName string `json:"displayName"` - LastModifiedBy *ClientInfo `json:"lastModifiedBy,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Order int64 `json:"order"` - TriggeringLogic AutomationRuleTriggeringLogic `json:"triggeringLogic"` -} - -func (o *AutomationRuleProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *AutomationRuleProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} - -var _ json.Unmarshaler = &AutomationRuleProperties{} - -func (s *AutomationRuleProperties) UnmarshalJSON(bytes []byte) error { - type alias AutomationRuleProperties - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AutomationRuleProperties: %+v", err) - } - - s.CreatedBy = decoded.CreatedBy - s.CreatedTimeUtc = decoded.CreatedTimeUtc - s.DisplayName = decoded.DisplayName - s.LastModifiedBy = decoded.LastModifiedBy - s.LastModifiedTimeUtc = decoded.LastModifiedTimeUtc - s.Order = decoded.Order - s.TriggeringLogic = decoded.TriggeringLogic - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AutomationRuleProperties into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["actions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Actions into list []json.RawMessage: %+v", err) - } - - output := make([]AutomationRuleAction, 0) - for i, val := range listTemp { - impl, err := unmarshalAutomationRuleActionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Actions' for 'AutomationRuleProperties': %+v", i, err) - } - output = append(output, impl) - } - s.Actions = output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulepropertyvaluescondition.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulepropertyvaluescondition.go deleted file mode 100644 index 8ace5d8c942..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulepropertyvaluescondition.go +++ /dev/null @@ -1,10 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRulePropertyValuesCondition struct { - Operator *AutomationRulePropertyConditionSupportedOperator `json:"operator,omitempty"` - PropertyName *AutomationRulePropertyConditionSupportedProperty `json:"propertyName,omitempty"` - PropertyValues *[]string `json:"propertyValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulerunplaybookaction.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulerunplaybookaction.go deleted file mode 100644 index c3e139aacf7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationrulerunplaybookaction.go +++ /dev/null @@ -1,42 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleAction = AutomationRuleRunPlaybookAction{} - -type AutomationRuleRunPlaybookAction struct { - ActionConfiguration *PlaybookActionProperties `json:"actionConfiguration,omitempty"` - - // Fields inherited from AutomationRuleAction - Order int64 `json:"order"` -} - -var _ json.Marshaler = AutomationRuleRunPlaybookAction{} - -func (s AutomationRuleRunPlaybookAction) MarshalJSON() ([]byte, error) { - type wrapper AutomationRuleRunPlaybookAction - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AutomationRuleRunPlaybookAction: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AutomationRuleRunPlaybookAction: %+v", err) - } - decoded["actionType"] = "RunPlaybook" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AutomationRuleRunPlaybookAction: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruletriggeringlogic.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruletriggeringlogic.go deleted file mode 100644 index 2f4592c4269..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_automationruletriggeringlogic.go +++ /dev/null @@ -1,70 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" - "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 AutomationRuleTriggeringLogic struct { - Conditions *[]AutomationRuleCondition `json:"conditions,omitempty"` - ExpirationTimeUtc *string `json:"expirationTimeUtc,omitempty"` - IsEnabled bool `json:"isEnabled"` - TriggersOn TriggersOn `json:"triggersOn"` - TriggersWhen TriggersWhen `json:"triggersWhen"` -} - -func (o *AutomationRuleTriggeringLogic) GetExpirationTimeUtcAsTime() (*time.Time, error) { - if o.ExpirationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ExpirationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *AutomationRuleTriggeringLogic) SetExpirationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ExpirationTimeUtc = &formatted -} - -var _ json.Unmarshaler = &AutomationRuleTriggeringLogic{} - -func (s *AutomationRuleTriggeringLogic) UnmarshalJSON(bytes []byte) error { - type alias AutomationRuleTriggeringLogic - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into AutomationRuleTriggeringLogic: %+v", err) - } - - s.ExpirationTimeUtc = decoded.ExpirationTimeUtc - s.IsEnabled = decoded.IsEnabled - s.TriggersOn = decoded.TriggersOn - s.TriggersWhen = decoded.TriggersWhen - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling AutomationRuleTriggeringLogic into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["conditions"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Conditions into list []json.RawMessage: %+v", err) - } - - output := make([]AutomationRuleCondition, 0) - for i, val := range listTemp { - impl, err := unmarshalAutomationRuleConditionImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Conditions' for 'AutomationRuleTriggeringLogic': %+v", i, err) - } - output = append(output, impl) - } - s.Conditions = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_clientinfo.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_clientinfo.go deleted file mode 100644 index 6b1a9ec7520..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_clientinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentlabel.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentlabel.go deleted file mode 100644 index 8f66e17624f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentlabel.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentLabel struct { - LabelName string `json:"labelName"` - LabelType *IncidentLabelType `json:"labelType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentownerinfo.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentownerinfo.go deleted file mode 100644 index b3933802226..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentownerinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOwnerInfo struct { - AssignedTo *string `json:"assignedTo,omitempty"` - Email *string `json:"email,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - OwnerType *OwnerType `json:"ownerType,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentpropertiesaction.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentpropertiesaction.go deleted file mode 100644 index 55f613832aa..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_incidentpropertiesaction.go +++ /dev/null @@ -1,14 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentPropertiesAction struct { - Classification *IncidentClassification `json:"classification,omitempty"` - ClassificationComment *string `json:"classificationComment,omitempty"` - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` - Labels *[]IncidentLabel `json:"labels,omitempty"` - Owner *IncidentOwnerInfo `json:"owner,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Status *IncidentStatus `json:"status,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_playbookactionproperties.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_playbookactionproperties.go deleted file mode 100644 index eef3dd3f31c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_playbookactionproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type PlaybookActionProperties struct { - LogicAppResourceId string `json:"logicAppResourceId"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/model_propertyconditionproperties.go b/resource-manager/securityinsights/2022-08-01/automationrules/model_propertyconditionproperties.go deleted file mode 100644 index 6e77d74c58c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/model_propertyconditionproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package automationrules - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ AutomationRuleCondition = PropertyConditionProperties{} - -type PropertyConditionProperties struct { - ConditionProperties *AutomationRulePropertyValuesCondition `json:"conditionProperties,omitempty"` - - // Fields inherited from AutomationRuleCondition -} - -var _ json.Marshaler = PropertyConditionProperties{} - -func (s PropertyConditionProperties) MarshalJSON() ([]byte, error) { - type wrapper PropertyConditionProperties - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling PropertyConditionProperties: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling PropertyConditionProperties: %+v", err) - } - decoded["conditionType"] = "Property" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling PropertyConditionProperties: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/automationrules/predicates.go b/resource-manager/securityinsights/2022-08-01/automationrules/predicates.go deleted file mode 100644 index eaa1f88eb83..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package automationrules - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AutomationRuleOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p AutomationRuleOperationPredicate) Matches(input AutomationRule) 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.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/securityinsights/2022-08-01/automationrules/version.go b/resource-manager/securityinsights/2022-08-01/automationrules/version.go deleted file mode 100644 index e75cb81f346..00000000000 --- a/resource-manager/securityinsights/2022-08-01/automationrules/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package automationrules - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/automationrules/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/README.md b/resource-manager/securityinsights/2022-08-01/bookmarks/README.md deleted file mode 100644 index 565e72b45b3..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/bookmarks` Documentation - -The `bookmarks` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/bookmarks" -``` - - -### Client Initialization - -```go -client := bookmarks.NewBookmarksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `BookmarksClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -payload := bookmarks.Bookmark{ - // ... -} - - -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: `BookmarksClient.Delete` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -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: `BookmarksClient.Get` - -```go -ctx := context.TODO() -id := bookmarks.NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - -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: `BookmarksClient.List` - -```go -ctx := context.TODO() -id := bookmarks.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-08-01/bookmarks/client.go b/resource-manager/securityinsights/2022-08-01/bookmarks/client.go deleted file mode 100644 index 22469155649..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package bookmarks - -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 BookmarksClient struct { - Client *resourcemanager.Client -} - -func NewBookmarksClientWithBaseURI(sdkApi sdkEnv.Api) (*BookmarksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "bookmarks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating BookmarksClient: %+v", err) - } - - return &BookmarksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/constants.go b/resource-manager/securityinsights/2022-08-01/bookmarks/constants.go deleted file mode 100644 index c057284aed1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/constants.go +++ /dev/null @@ -1,57 +0,0 @@ -package bookmarks - -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 IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark.go b/resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark.go deleted file mode 100644 index 5317bd28514..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark.go +++ /dev/null @@ -1,141 +0,0 @@ -package bookmarks - -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(&BookmarkId{}) -} - -var _ resourceids.ResourceId = &BookmarkId{} - -// BookmarkId is a struct representing the Resource ID for a Bookmark -type BookmarkId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - BookmarkId string -} - -// NewBookmarkID returns a new BookmarkId struct -func NewBookmarkID(subscriptionId string, resourceGroupName string, workspaceName string, bookmarkId string) BookmarkId { - return BookmarkId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - BookmarkId: bookmarkId, - } -} - -// ParseBookmarkID parses 'input' into a BookmarkId -func ParseBookmarkID(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseBookmarkIDInsensitively parses 'input' case-insensitively into a BookmarkId -// note: this method should only be used for API response data and not user input -func ParseBookmarkIDInsensitively(input string) (*BookmarkId, error) { - parser := resourceids.NewParserFromResourceIdType(&BookmarkId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := BookmarkId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *BookmarkId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.BookmarkId, ok = input.Parsed["bookmarkId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "bookmarkId", input) - } - - return nil -} - -// ValidateBookmarkID checks that 'input' can be parsed as a Bookmark ID -func ValidateBookmarkID(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 := ParseBookmarkID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Bookmark ID -func (id BookmarkId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/bookmarks/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.BookmarkId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Bookmark ID -func (id BookmarkId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticBookmarks", "bookmarks", "bookmarks"), - resourceids.UserSpecifiedSegment("bookmarkId", "bookmarkIdValue"), - } -} - -// String returns a human-readable description of this Bookmark ID -func (id BookmarkId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Bookmark: %q", id.BookmarkId), - } - return fmt.Sprintf("Bookmark (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark_test.go b/resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark_test.go deleted file mode 100644 index 1d89b9448a6..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/id_bookmark_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package bookmarks - -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 = &BookmarkId{} - -func TestNewBookmarkID(t *testing.T) { - id := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.BookmarkId != "bookmarkIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'BookmarkId'", id.BookmarkId, "bookmarkIdValue") - } -} - -func TestFormatBookmarkID(t *testing.T) { - actual := NewBookmarkID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "bookmarkIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseBookmarkID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestParseBookmarkIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *BookmarkId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - BookmarkId: "bookmarkIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/bookmarks/bookmarkIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe", - Expected: &BookmarkId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - BookmarkId: "bOoKmArKiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/bOoKmArKs/bOoKmArKiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseBookmarkIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.BookmarkId != v.Expected.BookmarkId { - t.Fatalf("Expected %q but got %q for BookmarkId", v.Expected.BookmarkId, actual.BookmarkId) - } - - } -} - -func TestSegmentsForBookmarkId(t *testing.T) { - segments := BookmarkId{}.Segments() - if len(segments) == 0 { - t.Fatalf("BookmarkId 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/securityinsights/2022-08-01/bookmarks/id_workspace.go b/resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace.go deleted file mode 100644 index 96d5c1221cf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package bookmarks - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace_test.go deleted file mode 100644 index c0e8adfac09..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package bookmarks - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/bookmarks/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/bookmarks/method_createorupdate.go deleted file mode 100644 index 2e61ab3ee74..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package bookmarks - -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 *Bookmark -} - -// CreateOrUpdate ... -func (c BookmarksClient) CreateOrUpdate(ctx context.Context, id BookmarkId, input Bookmark) (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 Bookmark - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/method_delete.go b/resource-manager/securityinsights/2022-08-01/bookmarks/method_delete.go deleted file mode 100644 index 75eef715a7c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package bookmarks - -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 BookmarksClient) Delete(ctx context.Context, id BookmarkId) (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/securityinsights/2022-08-01/bookmarks/method_get.go b/resource-manager/securityinsights/2022-08-01/bookmarks/method_get.go deleted file mode 100644 index 36c8d7fcc43..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package bookmarks - -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 *Bookmark -} - -// Get ... -func (c BookmarksClient) Get(ctx context.Context, id BookmarkId) (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 Bookmark - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/method_list.go b/resource-manager/securityinsights/2022-08-01/bookmarks/method_list.go deleted file mode 100644 index 432b04c413a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package bookmarks - -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 *[]Bookmark -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Bookmark -} - -// List ... -func (c BookmarksClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/bookmarks", 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 *[]Bookmark `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 BookmarksClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, BookmarkOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c BookmarksClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate BookmarkOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Bookmark, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/bookmarks/model_bookmark.go b/resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmark.go deleted file mode 100644 index 0745cad5b0a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmark.go +++ /dev/null @@ -1,17 +0,0 @@ -package bookmarks - -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 Bookmark struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *BookmarkProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmarkproperties.go b/resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmarkproperties.go deleted file mode 100644 index 0652d2b2110..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/model_bookmarkproperties.go +++ /dev/null @@ -1,86 +0,0 @@ -package bookmarks - -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 BookmarkProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryEndTime *string `json:"queryEndTime,omitempty"` - QueryResult *string `json:"queryResult,omitempty"` - QueryStartTime *string `json:"queryStartTime,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *BookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *BookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *BookmarkProperties) GetQueryEndTimeAsTime() (*time.Time, error) { - if o.QueryEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetQueryEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryEndTime = &formatted -} - -func (o *BookmarkProperties) GetQueryStartTimeAsTime() (*time.Time, error) { - if o.QueryStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetQueryStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryStartTime = &formatted -} - -func (o *BookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *BookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/model_incidentinfo.go b/resource-manager/securityinsights/2022-08-01/bookmarks/model_incidentinfo.go deleted file mode 100644 index a4c9f8c8d44..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/bookmarks/model_userinfo.go deleted file mode 100644 index 178ee7d633c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/bookmarks/predicates.go b/resource-manager/securityinsights/2022-08-01/bookmarks/predicates.go deleted file mode 100644 index d5334a9af01..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package bookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type BookmarkOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p BookmarkOperationPredicate) Matches(input Bookmark) 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.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/securityinsights/2022-08-01/bookmarks/version.go b/resource-manager/securityinsights/2022-08-01/bookmarks/version.go deleted file mode 100644 index 29f02bc9b8a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/bookmarks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package bookmarks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/bookmarks/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/client.go b/resource-manager/securityinsights/2022-08-01/client.go deleted file mode 100644 index dec96a8e832..00000000000 --- a/resource-manager/securityinsights/2022-08-01/client.go +++ /dev/null @@ -1,172 +0,0 @@ -package v2022_08_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/securityinsights/2022-08-01/actions" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/alertrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/alertruletemplates" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/automationrules" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/bookmarks" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/dataconnectors" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/entitytypes" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentalerts" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentbookmarks" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentcomments" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidententities" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentrelations" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidents" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/threatintelligence" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/watchlistitems" - "github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/watchlists" - "github.com/hashicorp/go-azure-sdk/sdk/client/resourcemanager" - sdkEnv "github.com/hashicorp/go-azure-sdk/sdk/environments" -) - -type Client struct { - Actions *actions.ActionsClient - AlertRuleTemplates *alertruletemplates.AlertRuleTemplatesClient - AlertRules *alertrules.AlertRulesClient - AutomationRules *automationrules.AutomationRulesClient - Bookmarks *bookmarks.BookmarksClient - DataConnectors *dataconnectors.DataConnectorsClient - EntityTypes *entitytypes.EntityTypesClient - IncidentAlerts *incidentalerts.IncidentAlertsClient - IncidentBookmarks *incidentbookmarks.IncidentBookmarksClient - IncidentComments *incidentcomments.IncidentCommentsClient - IncidentEntities *incidententities.IncidentEntitiesClient - IncidentRelations *incidentrelations.IncidentRelationsClient - Incidents *incidents.IncidentsClient - SentinelOnboardingStates *sentinelonboardingstates.SentinelOnboardingStatesClient - ThreatIntelligence *threatintelligence.ThreatIntelligenceClient - WatchlistItems *watchlistitems.WatchlistItemsClient - Watchlists *watchlists.WatchlistsClient -} - -func NewClientWithBaseURI(sdkApi sdkEnv.Api, configureFunc func(c *resourcemanager.Client)) (*Client, error) { - actionsClient, err := actions.NewActionsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Actions client: %+v", err) - } - configureFunc(actionsClient.Client) - - alertRuleTemplatesClient, err := alertruletemplates.NewAlertRuleTemplatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AlertRuleTemplates client: %+v", err) - } - configureFunc(alertRuleTemplatesClient.Client) - - alertRulesClient, err := alertrules.NewAlertRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AlertRules client: %+v", err) - } - configureFunc(alertRulesClient.Client) - - automationRulesClient, err := automationrules.NewAutomationRulesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building AutomationRules client: %+v", err) - } - configureFunc(automationRulesClient.Client) - - bookmarksClient, err := bookmarks.NewBookmarksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Bookmarks client: %+v", err) - } - configureFunc(bookmarksClient.Client) - - dataConnectorsClient, err := dataconnectors.NewDataConnectorsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building DataConnectors client: %+v", err) - } - configureFunc(dataConnectorsClient.Client) - - entityTypesClient, err := entitytypes.NewEntityTypesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building EntityTypes client: %+v", err) - } - configureFunc(entityTypesClient.Client) - - incidentAlertsClient, err := incidentalerts.NewIncidentAlertsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentAlerts client: %+v", err) - } - configureFunc(incidentAlertsClient.Client) - - incidentBookmarksClient, err := incidentbookmarks.NewIncidentBookmarksClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentBookmarks client: %+v", err) - } - configureFunc(incidentBookmarksClient.Client) - - incidentCommentsClient, err := incidentcomments.NewIncidentCommentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentComments client: %+v", err) - } - configureFunc(incidentCommentsClient.Client) - - incidentEntitiesClient, err := incidententities.NewIncidentEntitiesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentEntities client: %+v", err) - } - configureFunc(incidentEntitiesClient.Client) - - incidentRelationsClient, err := incidentrelations.NewIncidentRelationsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building IncidentRelations client: %+v", err) - } - configureFunc(incidentRelationsClient.Client) - - incidentsClient, err := incidents.NewIncidentsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Incidents client: %+v", err) - } - configureFunc(incidentsClient.Client) - - sentinelOnboardingStatesClient, err := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building SentinelOnboardingStates client: %+v", err) - } - configureFunc(sentinelOnboardingStatesClient.Client) - - threatIntelligenceClient, err := threatintelligence.NewThreatIntelligenceClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building ThreatIntelligence client: %+v", err) - } - configureFunc(threatIntelligenceClient.Client) - - watchlistItemsClient, err := watchlistitems.NewWatchlistItemsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building WatchlistItems client: %+v", err) - } - configureFunc(watchlistItemsClient.Client) - - watchlistsClient, err := watchlists.NewWatchlistsClientWithBaseURI(sdkApi) - if err != nil { - return nil, fmt.Errorf("building Watchlists client: %+v", err) - } - configureFunc(watchlistsClient.Client) - - return &Client{ - Actions: actionsClient, - AlertRuleTemplates: alertRuleTemplatesClient, - AlertRules: alertRulesClient, - AutomationRules: automationRulesClient, - Bookmarks: bookmarksClient, - DataConnectors: dataConnectorsClient, - EntityTypes: entityTypesClient, - IncidentAlerts: incidentAlertsClient, - IncidentBookmarks: incidentBookmarksClient, - IncidentComments: incidentCommentsClient, - IncidentEntities: incidentEntitiesClient, - IncidentRelations: incidentRelationsClient, - Incidents: incidentsClient, - SentinelOnboardingStates: sentinelOnboardingStatesClient, - ThreatIntelligence: threatIntelligenceClient, - WatchlistItems: watchlistItemsClient, - Watchlists: watchlistsClient, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/README.md b/resource-manager/securityinsights/2022-08-01/dataconnectors/README.md deleted file mode 100644 index 5be51e20e42..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/dataconnectors` Documentation - -The `dataconnectors` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/dataconnectors" -``` - - -### Client Initialization - -```go -client := dataconnectors.NewDataConnectorsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `DataConnectorsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -payload := dataconnectors.DataConnector{ - // ... -} - - -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: `DataConnectorsClient.Delete` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -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: `DataConnectorsClient.Get` - -```go -ctx := context.TODO() -id := dataconnectors.NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - -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: `DataConnectorsClient.List` - -```go -ctx := context.TODO() -id := dataconnectors.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-08-01/dataconnectors/client.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/client.go deleted file mode 100644 index 8ed0120c79a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package dataconnectors - -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 DataConnectorsClient struct { - Client *resourcemanager.Client -} - -func NewDataConnectorsClientWithBaseURI(sdkApi sdkEnv.Api) (*DataConnectorsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "dataconnectors", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating DataConnectorsClient: %+v", err) - } - - return &DataConnectorsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/constants.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/constants.go deleted file mode 100644 index 3fb78689b33..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/constants.go +++ /dev/null @@ -1,110 +0,0 @@ -package dataconnectors - -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 DataConnectorKind string - -const ( - DataConnectorKindAmazonWebServicesCloudTrail DataConnectorKind = "AmazonWebServicesCloudTrail" - DataConnectorKindAzureActiveDirectory DataConnectorKind = "AzureActiveDirectory" - DataConnectorKindAzureAdvancedThreatProtection DataConnectorKind = "AzureAdvancedThreatProtection" - DataConnectorKindAzureSecurityCenter DataConnectorKind = "AzureSecurityCenter" - DataConnectorKindMicrosoftCloudAppSecurity DataConnectorKind = "MicrosoftCloudAppSecurity" - DataConnectorKindMicrosoftDefenderAdvancedThreatProtection DataConnectorKind = "MicrosoftDefenderAdvancedThreatProtection" - DataConnectorKindOfficeThreeSixFive DataConnectorKind = "Office365" - DataConnectorKindThreatIntelligence DataConnectorKind = "ThreatIntelligence" -) - -func PossibleValuesForDataConnectorKind() []string { - return []string{ - string(DataConnectorKindAmazonWebServicesCloudTrail), - string(DataConnectorKindAzureActiveDirectory), - string(DataConnectorKindAzureAdvancedThreatProtection), - string(DataConnectorKindAzureSecurityCenter), - string(DataConnectorKindMicrosoftCloudAppSecurity), - string(DataConnectorKindMicrosoftDefenderAdvancedThreatProtection), - string(DataConnectorKindOfficeThreeSixFive), - string(DataConnectorKindThreatIntelligence), - } -} - -func (s *DataConnectorKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataConnectorKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataConnectorKind(input string) (*DataConnectorKind, error) { - vals := map[string]DataConnectorKind{ - "amazonwebservicescloudtrail": DataConnectorKindAmazonWebServicesCloudTrail, - "azureactivedirectory": DataConnectorKindAzureActiveDirectory, - "azureadvancedthreatprotection": DataConnectorKindAzureAdvancedThreatProtection, - "azuresecuritycenter": DataConnectorKindAzureSecurityCenter, - "microsoftcloudappsecurity": DataConnectorKindMicrosoftCloudAppSecurity, - "microsoftdefenderadvancedthreatprotection": DataConnectorKindMicrosoftDefenderAdvancedThreatProtection, - "office365": DataConnectorKindOfficeThreeSixFive, - "threatintelligence": DataConnectorKindThreatIntelligence, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataConnectorKind(input) - return &out, nil -} - -type DataTypeState string - -const ( - DataTypeStateDisabled DataTypeState = "Disabled" - DataTypeStateEnabled DataTypeState = "Enabled" -) - -func PossibleValuesForDataTypeState() []string { - return []string{ - string(DataTypeStateDisabled), - string(DataTypeStateEnabled), - } -} - -func (s *DataTypeState) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDataTypeState(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDataTypeState(input string) (*DataTypeState, error) { - vals := map[string]DataTypeState{ - "disabled": DataTypeStateDisabled, - "enabled": DataTypeStateEnabled, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DataTypeState(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector.go deleted file mode 100644 index b55667aa923..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector.go +++ /dev/null @@ -1,141 +0,0 @@ -package dataconnectors - -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(&DataConnectorId{}) -} - -var _ resourceids.ResourceId = &DataConnectorId{} - -// DataConnectorId is a struct representing the Resource ID for a Data Connector -type DataConnectorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - DataConnectorId string -} - -// NewDataConnectorID returns a new DataConnectorId struct -func NewDataConnectorID(subscriptionId string, resourceGroupName string, workspaceName string, dataConnectorId string) DataConnectorId { - return DataConnectorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - DataConnectorId: dataConnectorId, - } -} - -// ParseDataConnectorID parses 'input' into a DataConnectorId -func ParseDataConnectorID(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseDataConnectorIDInsensitively parses 'input' case-insensitively into a DataConnectorId -// note: this method should only be used for API response data and not user input -func ParseDataConnectorIDInsensitively(input string) (*DataConnectorId, error) { - parser := resourceids.NewParserFromResourceIdType(&DataConnectorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := DataConnectorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *DataConnectorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.DataConnectorId, ok = input.Parsed["dataConnectorId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "dataConnectorId", input) - } - - return nil -} - -// ValidateDataConnectorID checks that 'input' can be parsed as a Data Connector ID -func ValidateDataConnectorID(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 := ParseDataConnectorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Data Connector ID -func (id DataConnectorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/dataConnectors/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.DataConnectorId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Data Connector ID -func (id DataConnectorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticDataConnectors", "dataConnectors", "dataConnectors"), - resourceids.UserSpecifiedSegment("dataConnectorId", "dataConnectorIdValue"), - } -} - -// String returns a human-readable description of this Data Connector ID -func (id DataConnectorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Data Connector: %q", id.DataConnectorId), - } - return fmt.Sprintf("Data Connector (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector_test.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector_test.go deleted file mode 100644 index b0bf20f7576..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_dataconnector_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package dataconnectors - -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 = &DataConnectorId{} - -func TestNewDataConnectorID(t *testing.T) { - id := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.DataConnectorId != "dataConnectorIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'DataConnectorId'", id.DataConnectorId, "dataConnectorIdValue") - } -} - -func TestFormatDataConnectorID(t *testing.T) { - actual := NewDataConnectorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "dataConnectorIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseDataConnectorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestParseDataConnectorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *DataConnectorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - DataConnectorId: "dataConnectorIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/dataConnectors/dataConnectorIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE", - Expected: &DataConnectorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - DataConnectorId: "dAtAcOnNeCtOrIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/dAtAcOnNeCtOrS/dAtAcOnNeCtOrIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseDataConnectorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.DataConnectorId != v.Expected.DataConnectorId { - t.Fatalf("Expected %q but got %q for DataConnectorId", v.Expected.DataConnectorId, actual.DataConnectorId) - } - - } -} - -func TestSegmentsForDataConnectorId(t *testing.T) { - segments := DataConnectorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("DataConnectorId 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/securityinsights/2022-08-01/dataconnectors/id_workspace.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace.go deleted file mode 100644 index 60237fcce07..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package dataconnectors - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace_test.go deleted file mode 100644 index ae4c27a844d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package dataconnectors - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/dataconnectors/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/method_createorupdate.go deleted file mode 100644 index c5f6e5d1503..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/method_createorupdate.go +++ /dev/null @@ -1,63 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *DataConnector -} - -// CreateOrUpdate ... -func (c DataConnectorsClient) CreateOrUpdate(ctx context.Context, id DataConnectorId, input DataConnector) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/method_delete.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/method_delete.go deleted file mode 100644 index 8461ec6d8a1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package dataconnectors - -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 DataConnectorsClient) Delete(ctx context.Context, id DataConnectorId) (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/securityinsights/2022-08-01/dataconnectors/method_get.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/method_get.go deleted file mode 100644 index 3511ba85477..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/method_get.go +++ /dev/null @@ -1,58 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *DataConnector -} - -// Get ... -func (c DataConnectorsClient) Get(ctx context.Context, id DataConnectorId) (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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalDataConnectorImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/method_list.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/method_list.go deleted file mode 100644 index 6975384fdee..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/method_list.go +++ /dev/null @@ -1,103 +0,0 @@ -package dataconnectors - -import ( - "context" - "encoding/json" - "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 *[]DataConnector -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []DataConnector -} - -// List ... -func (c DataConnectorsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/dataConnectors", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]DataConnector, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalDataConnectorImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for DataConnector (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// ListComplete retrieves all the results into a single object -func (c DataConnectorsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, DataConnectorOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c DataConnectorsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate DataConnectorOperationPredicate) (result ListCompleteResult, err error) { - items := make([]DataConnector, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/dataconnectors/model_aaddataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnector.go deleted file mode 100644 index dd0ca1af664..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AADDataConnector{} - -type AADDataConnector struct { - Properties *AADDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AADDataConnector{} - -func (s AADDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AADDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AADDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AADDataConnector: %+v", err) - } - decoded["kind"] = "AzureActiveDirectory" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AADDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnectorproperties.go deleted file mode 100644 index eed0b8838ed..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aaddataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AADDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnector.go deleted file mode 100644 index e1cd013bbd7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AATPDataConnector{} - -type AATPDataConnector struct { - Properties *AATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AATPDataConnector{} - -func (s AATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AATPDataConnector: %+v", err) - } - decoded["kind"] = "AzureAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnectorproperties.go deleted file mode 100644 index 5f2791c58d2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_aatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_alertsdatatypeofdataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_alertsdatatypeofdataconnector.go deleted file mode 100644 index b61a1a7a196..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_alertsdatatypeofdataconnector.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AlertsDataTypeOfDataConnector struct { - Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnector.go deleted file mode 100644 index 3af09c2ff8b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = ASCDataConnector{} - -type ASCDataConnector struct { - Properties *ASCDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ASCDataConnector{} - -func (s ASCDataConnector) MarshalJSON() ([]byte, error) { - type wrapper ASCDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ASCDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ASCDataConnector: %+v", err) - } - decoded["kind"] = "AzureSecurityCenter" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ASCDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnectorproperties.go deleted file mode 100644 index ab5b1ceb172..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_ascdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ASCDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnector.go deleted file mode 100644 index b0ef7fdd285..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = AwsCloudTrailDataConnector{} - -type AwsCloudTrailDataConnector struct { - Properties *AwsCloudTrailDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AwsCloudTrailDataConnector{} - -func (s AwsCloudTrailDataConnector) MarshalJSON() ([]byte, error) { - type wrapper AwsCloudTrailDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AwsCloudTrailDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AwsCloudTrailDataConnector: %+v", err) - } - decoded["kind"] = "AmazonWebServicesCloudTrail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AwsCloudTrailDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go deleted file mode 100644 index 9d19a2feb9c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorDataTypes struct { - Logs *DataConnectorDataTypeCommon `json:"logs,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectorproperties.go deleted file mode 100644 index 42ac71deeca..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_awscloudtraildataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AwsCloudTrailDataConnectorProperties struct { - AwsRoleArn *string `json:"awsRoleArn,omitempty"` - DataTypes *AwsCloudTrailDataConnectorDataTypes `json:"dataTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnector.go deleted file mode 100644 index 66368d66fb7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnector.go +++ /dev/null @@ -1,109 +0,0 @@ -package dataconnectors - -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 DataConnector interface { -} - -// RawDataConnectorImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawDataConnectorImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalDataConnectorImplementation(input []byte) (DataConnector, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling DataConnector into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "AzureActiveDirectory") { - var out AADDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AADDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureAdvancedThreatProtection") { - var out AATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureSecurityCenter") { - var out ASCDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ASCDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AmazonWebServicesCloudTrail") { - var out AwsCloudTrailDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AwsCloudTrailDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftCloudAppSecurity") { - var out MCASDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MCASDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MicrosoftDefenderAdvancedThreatProtection") { - var out MDATPDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MDATPDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Office365") { - var out OfficeDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into OfficeDataConnector: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "ThreatIntelligence") { - var out TIDataConnector - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into TIDataConnector: %+v", err) - } - return out, nil - } - - out := RawDataConnectorImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnectordatatypecommon.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnectordatatypecommon.go deleted file mode 100644 index acf362026c4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_dataconnectordatatypecommon.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorDataTypeCommon struct { - State *DataTypeState `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnector.go deleted file mode 100644 index 6a0c9aebea0..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MCASDataConnector{} - -type MCASDataConnector struct { - Properties *MCASDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MCASDataConnector{} - -func (s MCASDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MCASDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MCASDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MCASDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftCloudAppSecurity" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MCASDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectordatatypes.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectordatatypes.go deleted file mode 100644 index 95d056b9518..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectordatatypes.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorDataTypes struct { - Alerts *DataConnectorDataTypeCommon `json:"alerts,omitempty"` - DiscoveryLogs *DataConnectorDataTypeCommon `json:"discoveryLogs,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectorproperties.go deleted file mode 100644 index c4145588ffe..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mcasdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MCASDataConnectorProperties struct { - DataTypes *MCASDataConnectorDataTypes `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnector.go deleted file mode 100644 index 1a6bcbcb7bf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = MDATPDataConnector{} - -type MDATPDataConnector struct { - Properties *MDATPDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MDATPDataConnector{} - -func (s MDATPDataConnector) MarshalJSON() ([]byte, error) { - type wrapper MDATPDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MDATPDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MDATPDataConnector: %+v", err) - } - decoded["kind"] = "MicrosoftDefenderAdvancedThreatProtection" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MDATPDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnectorproperties.go deleted file mode 100644 index b0d40d216ac..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_mdatpdataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MDATPDataConnectorProperties struct { - DataTypes *AlertsDataTypeOfDataConnector `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnector.go deleted file mode 100644 index 25b5a25e44d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = OfficeDataConnector{} - -type OfficeDataConnector struct { - Properties *OfficeDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = OfficeDataConnector{} - -func (s OfficeDataConnector) MarshalJSON() ([]byte, error) { - type wrapper OfficeDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling OfficeDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling OfficeDataConnector: %+v", err) - } - decoded["kind"] = "Office365" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling OfficeDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectordatatypes.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectordatatypes.go deleted file mode 100644 index 5b562d09575..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectordatatypes.go +++ /dev/null @@ -1,10 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorDataTypes struct { - Exchange *DataConnectorDataTypeCommon `json:"exchange,omitempty"` - SharePoint *DataConnectorDataTypeCommon `json:"sharePoint,omitempty"` - Teams *DataConnectorDataTypeCommon `json:"teams,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectorproperties.go deleted file mode 100644 index bf8da2781c8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_officedataconnectorproperties.go +++ /dev/null @@ -1,9 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type OfficeDataConnectorProperties struct { - DataTypes *OfficeDataConnectorDataTypes `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnector.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnector.go deleted file mode 100644 index 208513ef9aa..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnector.go +++ /dev/null @@ -1,48 +0,0 @@ -package dataconnectors - -import ( - "encoding/json" - "fmt" - - "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. - -var _ DataConnector = TIDataConnector{} - -type TIDataConnector struct { - Properties *TIDataConnectorProperties `json:"properties,omitempty"` - - // Fields inherited from DataConnector - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = TIDataConnector{} - -func (s TIDataConnector) MarshalJSON() ([]byte, error) { - type wrapper TIDataConnector - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling TIDataConnector: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling TIDataConnector: %+v", err) - } - decoded["kind"] = "ThreatIntelligence" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling TIDataConnector: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectordatatypes.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectordatatypes.go deleted file mode 100644 index be5cade481c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectordatatypes.go +++ /dev/null @@ -1,8 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type TIDataConnectorDataTypes struct { - Indicators *DataConnectorDataTypeCommon `json:"indicators,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectorproperties.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectorproperties.go deleted file mode 100644 index 4fce93cbd33..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/model_tidataconnectorproperties.go +++ /dev/null @@ -1,28 +0,0 @@ -package dataconnectors - -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 TIDataConnectorProperties struct { - DataTypes *TIDataConnectorDataTypes `json:"dataTypes,omitempty"` - TenantId *string `json:"tenantId,omitempty"` - TipLookbackPeriod *string `json:"tipLookbackPeriod,omitempty"` -} - -func (o *TIDataConnectorProperties) GetTipLookbackPeriodAsTime() (*time.Time, error) { - if o.TipLookbackPeriod == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TipLookbackPeriod, "2006-01-02T15:04:05Z07:00") -} - -func (o *TIDataConnectorProperties) SetTipLookbackPeriodAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TipLookbackPeriod = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/predicates.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/predicates.go deleted file mode 100644 index 4521c20e58e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DataConnectorOperationPredicate struct { -} - -func (p DataConnectorOperationPredicate) Matches(input DataConnector) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-08-01/dataconnectors/version.go b/resource-manager/securityinsights/2022-08-01/dataconnectors/version.go deleted file mode 100644 index 20b71a977a4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/dataconnectors/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package dataconnectors - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/dataconnectors/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/README.md b/resource-manager/securityinsights/2022-08-01/entitytypes/README.md deleted file mode 100644 index d417971439f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/README.md +++ /dev/null @@ -1,21 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/entitytypes` Documentation - -The `entitytypes` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/entitytypes" -``` - - -### Client Initialization - -```go -client := entitytypes.NewEntityTypesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/client.go b/resource-manager/securityinsights/2022-08-01/entitytypes/client.go deleted file mode 100644 index bcdd09e4029..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package entitytypes - -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 EntityTypesClient struct { - Client *resourcemanager.Client -} - -func NewEntityTypesClientWithBaseURI(sdkApi sdkEnv.Api) (*EntityTypesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "entitytypes", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating EntityTypesClient: %+v", err) - } - - return &EntityTypesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/constants.go b/resource-manager/securityinsights/2022-08-01/entitytypes/constants.go deleted file mode 100644 index 2f194a6f29d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/constants.go +++ /dev/null @@ -1,980 +0,0 @@ -package entitytypes - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AntispamMailDirection string - -const ( - AntispamMailDirectionInbound AntispamMailDirection = "Inbound" - AntispamMailDirectionIntraorg AntispamMailDirection = "Intraorg" - AntispamMailDirectionOutbound AntispamMailDirection = "Outbound" - AntispamMailDirectionUnknown AntispamMailDirection = "Unknown" -) - -func PossibleValuesForAntispamMailDirection() []string { - return []string{ - string(AntispamMailDirectionInbound), - string(AntispamMailDirectionIntraorg), - string(AntispamMailDirectionOutbound), - string(AntispamMailDirectionUnknown), - } -} - -func (s *AntispamMailDirection) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAntispamMailDirection(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAntispamMailDirection(input string) (*AntispamMailDirection, error) { - vals := map[string]AntispamMailDirection{ - "inbound": AntispamMailDirectionInbound, - "intraorg": AntispamMailDirectionIntraorg, - "outbound": AntispamMailDirectionOutbound, - "unknown": AntispamMailDirectionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AntispamMailDirection(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type CreatedByType string - -const ( - CreatedByTypeApplication CreatedByType = "Application" - CreatedByTypeKey CreatedByType = "Key" - CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" - CreatedByTypeUser CreatedByType = "User" -) - -func PossibleValuesForCreatedByType() []string { - return []string{ - string(CreatedByTypeApplication), - string(CreatedByTypeKey), - string(CreatedByTypeManagedIdentity), - string(CreatedByTypeUser), - } -} - -func (s *CreatedByType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseCreatedByType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseCreatedByType(input string) (*CreatedByType, error) { - vals := map[string]CreatedByType{ - "application": CreatedByTypeApplication, - "key": CreatedByTypeKey, - "managedidentity": CreatedByTypeManagedIdentity, - "user": CreatedByTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := CreatedByType(input) - return &out, nil -} - -type DeliveryAction string - -const ( - DeliveryActionBlocked DeliveryAction = "Blocked" - DeliveryActionDelivered DeliveryAction = "Delivered" - DeliveryActionDeliveredAsSpam DeliveryAction = "DeliveredAsSpam" - DeliveryActionReplaced DeliveryAction = "Replaced" - DeliveryActionUnknown DeliveryAction = "Unknown" -) - -func PossibleValuesForDeliveryAction() []string { - return []string{ - string(DeliveryActionBlocked), - string(DeliveryActionDelivered), - string(DeliveryActionDeliveredAsSpam), - string(DeliveryActionReplaced), - string(DeliveryActionUnknown), - } -} - -func (s *DeliveryAction) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeliveryAction(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeliveryAction(input string) (*DeliveryAction, error) { - vals := map[string]DeliveryAction{ - "blocked": DeliveryActionBlocked, - "delivered": DeliveryActionDelivered, - "deliveredasspam": DeliveryActionDeliveredAsSpam, - "replaced": DeliveryActionReplaced, - "unknown": DeliveryActionUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeliveryAction(input) - return &out, nil -} - -type DeliveryLocation string - -const ( - DeliveryLocationDeletedFolder DeliveryLocation = "DeletedFolder" - DeliveryLocationDropped DeliveryLocation = "Dropped" - DeliveryLocationExternal DeliveryLocation = "External" - DeliveryLocationFailed DeliveryLocation = "Failed" - DeliveryLocationForwarded DeliveryLocation = "Forwarded" - DeliveryLocationInbox DeliveryLocation = "Inbox" - DeliveryLocationJunkFolder DeliveryLocation = "JunkFolder" - DeliveryLocationQuarantine DeliveryLocation = "Quarantine" - DeliveryLocationUnknown DeliveryLocation = "Unknown" -) - -func PossibleValuesForDeliveryLocation() []string { - return []string{ - string(DeliveryLocationDeletedFolder), - string(DeliveryLocationDropped), - string(DeliveryLocationExternal), - string(DeliveryLocationFailed), - string(DeliveryLocationForwarded), - string(DeliveryLocationInbox), - string(DeliveryLocationJunkFolder), - string(DeliveryLocationQuarantine), - string(DeliveryLocationUnknown), - } -} - -func (s *DeliveryLocation) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseDeliveryLocation(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseDeliveryLocation(input string) (*DeliveryLocation, error) { - vals := map[string]DeliveryLocation{ - "deletedfolder": DeliveryLocationDeletedFolder, - "dropped": DeliveryLocationDropped, - "external": DeliveryLocationExternal, - "failed": DeliveryLocationFailed, - "forwarded": DeliveryLocationForwarded, - "inbox": DeliveryLocationInbox, - "junkfolder": DeliveryLocationJunkFolder, - "quarantine": DeliveryLocationQuarantine, - "unknown": DeliveryLocationUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := DeliveryLocation(input) - return &out, nil -} - -type ElevationToken string - -const ( - ElevationTokenDefault ElevationToken = "Default" - ElevationTokenFull ElevationToken = "Full" - ElevationTokenLimited ElevationToken = "Limited" -) - -func PossibleValuesForElevationToken() []string { - return []string{ - string(ElevationTokenDefault), - string(ElevationTokenFull), - string(ElevationTokenLimited), - } -} - -func (s *ElevationToken) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseElevationToken(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseElevationToken(input string) (*ElevationToken, error) { - vals := map[string]ElevationToken{ - "default": ElevationTokenDefault, - "full": ElevationTokenFull, - "limited": ElevationTokenLimited, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ElevationToken(input) - return &out, nil -} - -type EntityKindEnum string - -const ( - EntityKindEnumAccount EntityKindEnum = "Account" - EntityKindEnumAzureResource EntityKindEnum = "AzureResource" - EntityKindEnumBookmark EntityKindEnum = "Bookmark" - EntityKindEnumCloudApplication EntityKindEnum = "CloudApplication" - EntityKindEnumDnsResolution EntityKindEnum = "DnsResolution" - EntityKindEnumFile EntityKindEnum = "File" - EntityKindEnumFileHash EntityKindEnum = "FileHash" - EntityKindEnumHost EntityKindEnum = "Host" - EntityKindEnumIP EntityKindEnum = "Ip" - EntityKindEnumIoTDevice EntityKindEnum = "IoTDevice" - EntityKindEnumMailCluster EntityKindEnum = "MailCluster" - EntityKindEnumMailMessage EntityKindEnum = "MailMessage" - EntityKindEnumMailbox EntityKindEnum = "Mailbox" - EntityKindEnumMalware EntityKindEnum = "Malware" - EntityKindEnumProcess EntityKindEnum = "Process" - EntityKindEnumRegistryKey EntityKindEnum = "RegistryKey" - EntityKindEnumRegistryValue EntityKindEnum = "RegistryValue" - EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" - EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" - EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" -) - -func PossibleValuesForEntityKindEnum() []string { - return []string{ - string(EntityKindEnumAccount), - string(EntityKindEnumAzureResource), - string(EntityKindEnumBookmark), - string(EntityKindEnumCloudApplication), - string(EntityKindEnumDnsResolution), - string(EntityKindEnumFile), - string(EntityKindEnumFileHash), - string(EntityKindEnumHost), - string(EntityKindEnumIP), - string(EntityKindEnumIoTDevice), - string(EntityKindEnumMailCluster), - string(EntityKindEnumMailMessage), - string(EntityKindEnumMailbox), - string(EntityKindEnumMalware), - string(EntityKindEnumProcess), - string(EntityKindEnumRegistryKey), - string(EntityKindEnumRegistryValue), - string(EntityKindEnumSecurityAlert), - string(EntityKindEnumSecurityGroup), - string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), - } -} - -func (s *EntityKindEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKindEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKindEnum(input string) (*EntityKindEnum, error) { - vals := map[string]EntityKindEnum{ - "account": EntityKindEnumAccount, - "azureresource": EntityKindEnumAzureResource, - "bookmark": EntityKindEnumBookmark, - "cloudapplication": EntityKindEnumCloudApplication, - "dnsresolution": EntityKindEnumDnsResolution, - "file": EntityKindEnumFile, - "filehash": EntityKindEnumFileHash, - "host": EntityKindEnumHost, - "ip": EntityKindEnumIP, - "iotdevice": EntityKindEnumIoTDevice, - "mailcluster": EntityKindEnumMailCluster, - "mailmessage": EntityKindEnumMailMessage, - "mailbox": EntityKindEnumMailbox, - "malware": EntityKindEnumMalware, - "process": EntityKindEnumProcess, - "registrykey": EntityKindEnumRegistryKey, - "registryvalue": EntityKindEnumRegistryValue, - "securityalert": EntityKindEnumSecurityAlert, - "securitygroup": EntityKindEnumSecurityGroup, - "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKindEnum(input) - return &out, nil -} - -type FileHashAlgorithm string - -const ( - FileHashAlgorithmMDFive FileHashAlgorithm = "MD5" - FileHashAlgorithmSHAOne FileHashAlgorithm = "SHA1" - FileHashAlgorithmSHATwoFiveSix FileHashAlgorithm = "SHA256" - FileHashAlgorithmSHATwoFiveSixAC FileHashAlgorithm = "SHA256AC" - FileHashAlgorithmUnknown FileHashAlgorithm = "Unknown" -) - -func PossibleValuesForFileHashAlgorithm() []string { - return []string{ - string(FileHashAlgorithmMDFive), - string(FileHashAlgorithmSHAOne), - string(FileHashAlgorithmSHATwoFiveSix), - string(FileHashAlgorithmSHATwoFiveSixAC), - string(FileHashAlgorithmUnknown), - } -} - -func (s *FileHashAlgorithm) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseFileHashAlgorithm(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseFileHashAlgorithm(input string) (*FileHashAlgorithm, error) { - vals := map[string]FileHashAlgorithm{ - "md5": FileHashAlgorithmMDFive, - "sha1": FileHashAlgorithmSHAOne, - "sha256": FileHashAlgorithmSHATwoFiveSix, - "sha256ac": FileHashAlgorithmSHATwoFiveSixAC, - "unknown": FileHashAlgorithmUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := FileHashAlgorithm(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} - -type OSFamily string - -const ( - OSFamilyAndroid OSFamily = "Android" - OSFamilyIOS OSFamily = "IOS" - OSFamilyLinux OSFamily = "Linux" - OSFamilyUnknown OSFamily = "Unknown" - OSFamilyWindows OSFamily = "Windows" -) - -func PossibleValuesForOSFamily() []string { - return []string{ - string(OSFamilyAndroid), - string(OSFamilyIOS), - string(OSFamilyLinux), - string(OSFamilyUnknown), - string(OSFamilyWindows), - } -} - -func (s *OSFamily) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOSFamily(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOSFamily(input string) (*OSFamily, error) { - vals := map[string]OSFamily{ - "android": OSFamilyAndroid, - "ios": OSFamilyIOS, - "linux": OSFamilyLinux, - "unknown": OSFamilyUnknown, - "windows": OSFamilyWindows, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OSFamily(input) - return &out, nil -} - -type RegistryHive string - -const ( - RegistryHiveHKEYA RegistryHive = "HKEY_A" - RegistryHiveHKEYCLASSESROOT RegistryHive = "HKEY_CLASSES_ROOT" - RegistryHiveHKEYCURRENTCONFIG RegistryHive = "HKEY_CURRENT_CONFIG" - RegistryHiveHKEYCURRENTUSER RegistryHive = "HKEY_CURRENT_USER" - RegistryHiveHKEYCURRENTUSERLOCALSETTINGS RegistryHive = "HKEY_CURRENT_USER_LOCAL_SETTINGS" - RegistryHiveHKEYLOCALMACHINE RegistryHive = "HKEY_LOCAL_MACHINE" - RegistryHiveHKEYPERFORMANCEDATA RegistryHive = "HKEY_PERFORMANCE_DATA" - RegistryHiveHKEYPERFORMANCENLSTEXT RegistryHive = "HKEY_PERFORMANCE_NLSTEXT" - RegistryHiveHKEYPERFORMANCETEXT RegistryHive = "HKEY_PERFORMANCE_TEXT" - RegistryHiveHKEYUSERS RegistryHive = "HKEY_USERS" -) - -func PossibleValuesForRegistryHive() []string { - return []string{ - string(RegistryHiveHKEYA), - string(RegistryHiveHKEYCLASSESROOT), - string(RegistryHiveHKEYCURRENTCONFIG), - string(RegistryHiveHKEYCURRENTUSER), - string(RegistryHiveHKEYCURRENTUSERLOCALSETTINGS), - string(RegistryHiveHKEYLOCALMACHINE), - string(RegistryHiveHKEYPERFORMANCEDATA), - string(RegistryHiveHKEYPERFORMANCENLSTEXT), - string(RegistryHiveHKEYPERFORMANCETEXT), - string(RegistryHiveHKEYUSERS), - } -} - -func (s *RegistryHive) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryHive(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryHive(input string) (*RegistryHive, error) { - vals := map[string]RegistryHive{ - "hkey_a": RegistryHiveHKEYA, - "hkey_classes_root": RegistryHiveHKEYCLASSESROOT, - "hkey_current_config": RegistryHiveHKEYCURRENTCONFIG, - "hkey_current_user": RegistryHiveHKEYCURRENTUSER, - "hkey_current_user_local_settings": RegistryHiveHKEYCURRENTUSERLOCALSETTINGS, - "hkey_local_machine": RegistryHiveHKEYLOCALMACHINE, - "hkey_performance_data": RegistryHiveHKEYPERFORMANCEDATA, - "hkey_performance_nlstext": RegistryHiveHKEYPERFORMANCENLSTEXT, - "hkey_performance_text": RegistryHiveHKEYPERFORMANCETEXT, - "hkey_users": RegistryHiveHKEYUSERS, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryHive(input) - return &out, nil -} - -type RegistryValueKind string - -const ( - RegistryValueKindBinary RegistryValueKind = "Binary" - RegistryValueKindDWord RegistryValueKind = "DWord" - RegistryValueKindExpandString RegistryValueKind = "ExpandString" - RegistryValueKindMultiString RegistryValueKind = "MultiString" - RegistryValueKindNone RegistryValueKind = "None" - RegistryValueKindQWord RegistryValueKind = "QWord" - RegistryValueKindString RegistryValueKind = "String" - RegistryValueKindUnknown RegistryValueKind = "Unknown" -) - -func PossibleValuesForRegistryValueKind() []string { - return []string{ - string(RegistryValueKindBinary), - string(RegistryValueKindDWord), - string(RegistryValueKindExpandString), - string(RegistryValueKindMultiString), - string(RegistryValueKindNone), - string(RegistryValueKindQWord), - string(RegistryValueKindString), - string(RegistryValueKindUnknown), - } -} - -func (s *RegistryValueKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseRegistryValueKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseRegistryValueKind(input string) (*RegistryValueKind, error) { - vals := map[string]RegistryValueKind{ - "binary": RegistryValueKindBinary, - "dword": RegistryValueKindDWord, - "expandstring": RegistryValueKindExpandString, - "multistring": RegistryValueKindMultiString, - "none": RegistryValueKindNone, - "qword": RegistryValueKindQWord, - "string": RegistryValueKindString, - "unknown": RegistryValueKindUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := RegistryValueKind(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentity.go deleted file mode 100644 index 36622cda50b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = AccountEntity{} - -type AccountEntity struct { - Properties *AccountEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AccountEntity{} - -func (s AccountEntity) MarshalJSON() ([]byte, error) { - type wrapper AccountEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AccountEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AccountEntity: %+v", err) - } - decoded["kind"] = "Account" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AccountEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentityproperties.go deleted file mode 100644 index 95fb7cc52ad..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_accountentityproperties.go +++ /dev/null @@ -1,21 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AccountEntityProperties struct { - AadTenantId *string `json:"aadTenantId,omitempty"` - AadUserId *string `json:"aadUserId,omitempty"` - AccountName *string `json:"accountName,omitempty"` - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - DnsDomain *string `json:"dnsDomain,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - NtDomain *string `json:"ntDomain,omitempty"` - ObjectGuid *string `json:"objectGuid,omitempty"` - Puid *string `json:"puid,omitempty"` - Sid *string `json:"sid,omitempty"` - UpnSuffix *string `json:"upnSuffix,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentity.go deleted file mode 100644 index 6947a9b96e5..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = AzureResourceEntity{} - -type AzureResourceEntity struct { - Properties *AzureResourceEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = AzureResourceEntity{} - -func (s AzureResourceEntity) MarshalJSON() ([]byte, error) { - type wrapper AzureResourceEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling AzureResourceEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling AzureResourceEntity: %+v", err) - } - decoded["kind"] = "AzureResource" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling AzureResourceEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentityproperties.go deleted file mode 100644 index db2fe348b06..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_azureresourceentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type AzureResourceEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ResourceId *string `json:"resourceId,omitempty"` - SubscriptionId *string `json:"subscriptionId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentity.go deleted file mode 100644 index 73b7fb5b308..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = CloudApplicationEntity{} - -type CloudApplicationEntity struct { - Properties *CloudApplicationEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = CloudApplicationEntity{} - -func (s CloudApplicationEntity) MarshalJSON() ([]byte, error) { - type wrapper CloudApplicationEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling CloudApplicationEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling CloudApplicationEntity: %+v", err) - } - decoded["kind"] = "CloudApplication" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling CloudApplicationEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentityproperties.go deleted file mode 100644 index 8b2d40b573f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_cloudapplicationentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type CloudApplicationEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AppId *int64 `json:"appId,omitempty"` - AppName *string `json:"appName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - InstanceName *string `json:"instanceName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentity.go deleted file mode 100644 index 81c3c0dac5b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = DnsEntity{} - -type DnsEntity struct { - Properties *DnsEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = DnsEntity{} - -func (s DnsEntity) MarshalJSON() ([]byte, error) { - type wrapper DnsEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling DnsEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling DnsEntity: %+v", err) - } - decoded["kind"] = "DnsResolution" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling DnsEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentityproperties.go deleted file mode 100644 index fa580d56344..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_dnsentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type DnsEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DnsServerIPEntityId *string `json:"dnsServerIpEntityId,omitempty"` - DomainName *string `json:"domainName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostIPAddressEntityId *string `json:"hostIpAddressEntityId,omitempty"` - IPAddressEntityIds *[]string `json:"ipAddressEntityIds,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_entity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_entity.go deleted file mode 100644 index e648085f87e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_entity.go +++ /dev/null @@ -1,213 +0,0 @@ -package entitytypes - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Account") { - var out AccountEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AccountEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "AzureResource") { - var out AzureResourceEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into AzureResourceEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "CloudApplication") { - var out CloudApplicationEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into CloudApplicationEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "DnsResolution") { - var out DnsEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into DnsEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "File") { - var out FileEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FileEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "FileHash") { - var out FileHashEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into FileHashEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Host") { - var out HostEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HostEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Ip") { - var out IPEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IPEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "IoTDevice") { - var out IoTDeviceEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into IoTDeviceEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MailCluster") { - var out MailClusterEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailClusterEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "MailMessage") { - var out MailMessageEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailMessageEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Mailbox") { - var out MailboxEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MailboxEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Malware") { - var out MalwareEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into MalwareEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Process") { - var out ProcessEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ProcessEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RegistryKey") { - var out RegistryKeyEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RegistryKeyEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "RegistryValue") { - var out RegistryValueEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into RegistryValueEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityGroup") { - var out SecurityGroupEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityGroupEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SubmissionMail") { - var out SubmissionMailEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SubmissionMailEntity: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "Url") { - var out UrlEntity - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into UrlEntity: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentity.go deleted file mode 100644 index 98411b9b140..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = FileEntity{} - -type FileEntity struct { - Properties *FileEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FileEntity{} - -func (s FileEntity) MarshalJSON() ([]byte, error) { - type wrapper FileEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FileEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FileEntity: %+v", err) - } - decoded["kind"] = "File" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FileEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentityproperties.go deleted file mode 100644 index 257ffb1ba04..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_fileentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FileEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Directory *string `json:"directory,omitempty"` - FileHashEntityIds *[]string `json:"fileHashEntityIds,omitempty"` - FileName *string `json:"fileName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentity.go deleted file mode 100644 index bf05183c64b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = FileHashEntity{} - -type FileHashEntity struct { - Properties *FileHashEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = FileHashEntity{} - -func (s FileHashEntity) MarshalJSON() ([]byte, error) { - type wrapper FileHashEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling FileHashEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling FileHashEntity: %+v", err) - } - decoded["kind"] = "FileHash" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling FileHashEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentityproperties.go deleted file mode 100644 index d8097218e1d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_filehashentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type FileHashEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Algorithm *FileHashAlgorithm `json:"algorithm,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HashValue *string `json:"hashValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_geolocation.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_geolocation.go deleted file mode 100644 index 53a44e73dcd..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_geolocation.go +++ /dev/null @@ -1,14 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type GeoLocation struct { - Asn *int64 `json:"asn,omitempty"` - City *string `json:"city,omitempty"` - CountryCode *string `json:"countryCode,omitempty"` - CountryName *string `json:"countryName,omitempty"` - Latitude *float64 `json:"latitude,omitempty"` - Longitude *float64 `json:"longitude,omitempty"` - State *string `json:"state,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentity.go deleted file mode 100644 index 90b206a2d15..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = HostEntity{} - -type HostEntity struct { - Properties *HostEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HostEntity{} - -func (s HostEntity) MarshalJSON() ([]byte, error) { - type wrapper HostEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HostEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HostEntity: %+v", err) - } - decoded["kind"] = "Host" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HostEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentityproperties.go deleted file mode 100644 index aeff0d09403..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_hostentityproperties.go +++ /dev/null @@ -1,18 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type HostEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AzureID *string `json:"azureID,omitempty"` - DnsDomain *string `json:"dnsDomain,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostName *string `json:"hostName,omitempty"` - IsDomainJoined *bool `json:"isDomainJoined,omitempty"` - NetBiosName *string `json:"netBiosName,omitempty"` - NtDomain *string `json:"ntDomain,omitempty"` - OmsAgentID *string `json:"omsAgentID,omitempty"` - OsFamily *OSFamily `json:"osFamily,omitempty"` - OsVersion *string `json:"osVersion,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmark.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmark.go deleted file mode 100644 index e86ba910de6..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmark.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmarkproperties.go deleted file mode 100644 index 5ebc3ac122f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package entitytypes - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_incidentinfo.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_incidentinfo.go deleted file mode 100644 index 80d014f5289..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentity.go deleted file mode 100644 index 3828d0cf7d2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = IoTDeviceEntity{} - -type IoTDeviceEntity struct { - Properties *IoTDeviceEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IoTDeviceEntity{} - -func (s IoTDeviceEntity) MarshalJSON() ([]byte, error) { - type wrapper IoTDeviceEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IoTDeviceEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IoTDeviceEntity: %+v", err) - } - decoded["kind"] = "IoTDevice" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IoTDeviceEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentityproperties.go deleted file mode 100644 index f6619ce0b99..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_iotdeviceentityproperties.go +++ /dev/null @@ -1,26 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IoTDeviceEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DeviceId *string `json:"deviceId,omitempty"` - DeviceName *string `json:"deviceName,omitempty"` - DeviceType *string `json:"deviceType,omitempty"` - EdgeId *string `json:"edgeId,omitempty"` - FirmwareVersion *string `json:"firmwareVersion,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - IPAddressEntityId *string `json:"ipAddressEntityId,omitempty"` - IotHubEntityId *string `json:"iotHubEntityId,omitempty"` - IotSecurityAgentId *string `json:"iotSecurityAgentId,omitempty"` - MacAddress *string `json:"macAddress,omitempty"` - Model *string `json:"model,omitempty"` - OperatingSystem *string `json:"operatingSystem,omitempty"` - Protocols *[]string `json:"protocols,omitempty"` - SerialNumber *string `json:"serialNumber,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` - Vendor *string `json:"vendor,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentity.go deleted file mode 100644 index e062bf2295a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = IPEntity{} - -type IPEntity struct { - Properties *IPEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = IPEntity{} - -func (s IPEntity) MarshalJSON() ([]byte, error) { - type wrapper IPEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling IPEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling IPEntity: %+v", err) - } - decoded["kind"] = "Ip" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling IPEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentityproperties.go deleted file mode 100644 index b0cf7442a43..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_ipentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IPEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Address *string `json:"address,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Location *GeoLocation `json:"location,omitempty"` - ThreatIntelligence *[]ThreatIntelligence `json:"threatIntelligence,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentity.go deleted file mode 100644 index 57dee77697e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailboxEntity{} - -type MailboxEntity struct { - Properties *MailboxEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailboxEntity{} - -func (s MailboxEntity) MarshalJSON() ([]byte, error) { - type wrapper MailboxEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailboxEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailboxEntity: %+v", err) - } - decoded["kind"] = "Mailbox" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailboxEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentityproperties.go deleted file mode 100644 index 8d1b787b9c9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailboxentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MailboxEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - ExternalDirectoryObjectId *string `json:"externalDirectoryObjectId,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - MailboxPrimaryAddress *string `json:"mailboxPrimaryAddress,omitempty"` - Upn *string `json:"upn,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentity.go deleted file mode 100644 index afa0db447b6..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailClusterEntity{} - -type MailClusterEntity struct { - Properties *MailClusterEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailClusterEntity{} - -func (s MailClusterEntity) MarshalJSON() ([]byte, error) { - type wrapper MailClusterEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailClusterEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailClusterEntity: %+v", err) - } - decoded["kind"] = "MailCluster" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailClusterEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentityproperties.go deleted file mode 100644 index 6b6724b72a7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailclusterentityproperties.go +++ /dev/null @@ -1,66 +0,0 @@ -package entitytypes - -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 MailClusterEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - ClusterGroup *string `json:"clusterGroup,omitempty"` - ClusterQueryEndTime *string `json:"clusterQueryEndTime,omitempty"` - ClusterQueryStartTime *string `json:"clusterQueryStartTime,omitempty"` - ClusterSourceIdentifier *string `json:"clusterSourceIdentifier,omitempty"` - ClusterSourceType *string `json:"clusterSourceType,omitempty"` - CountByDeliveryStatus *interface{} `json:"countByDeliveryStatus,omitempty"` - CountByProtectionStatus *interface{} `json:"countByProtectionStatus,omitempty"` - CountByThreatType *interface{} `json:"countByThreatType,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IsVolumeAnomaly *bool `json:"isVolumeAnomaly,omitempty"` - MailCount *int64 `json:"mailCount,omitempty"` - NetworkMessageIds *[]string `json:"networkMessageIds,omitempty"` - Query *string `json:"query,omitempty"` - QueryTime *string `json:"queryTime,omitempty"` - Source *string `json:"source,omitempty"` - Threats *[]string `json:"threats,omitempty"` -} - -func (o *MailClusterEntityProperties) GetClusterQueryEndTimeAsTime() (*time.Time, error) { - if o.ClusterQueryEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ClusterQueryEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetClusterQueryEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ClusterQueryEndTime = &formatted -} - -func (o *MailClusterEntityProperties) GetClusterQueryStartTimeAsTime() (*time.Time, error) { - if o.ClusterQueryStartTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ClusterQueryStartTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetClusterQueryStartTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ClusterQueryStartTime = &formatted -} - -func (o *MailClusterEntityProperties) GetQueryTimeAsTime() (*time.Time, error) { - if o.QueryTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.QueryTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailClusterEntityProperties) SetQueryTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.QueryTime = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentity.go deleted file mode 100644 index e0fef66bf3b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MailMessageEntity{} - -type MailMessageEntity struct { - Properties *MailMessageEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MailMessageEntity{} - -func (s MailMessageEntity) MarshalJSON() ([]byte, error) { - type wrapper MailMessageEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MailMessageEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MailMessageEntity: %+v", err) - } - decoded["kind"] = "MailMessage" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MailMessageEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentityproperties.go deleted file mode 100644 index 48c4bfe7c77..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_mailmessageentityproperties.go +++ /dev/null @@ -1,52 +0,0 @@ -package entitytypes - -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 MailMessageEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AntispamDirection *AntispamMailDirection `json:"antispamDirection,omitempty"` - BodyFingerprintBin1 *int64 `json:"bodyFingerprintBin1,omitempty"` - BodyFingerprintBin2 *int64 `json:"bodyFingerprintBin2,omitempty"` - BodyFingerprintBin3 *int64 `json:"bodyFingerprintBin3,omitempty"` - BodyFingerprintBin4 *int64 `json:"bodyFingerprintBin4,omitempty"` - BodyFingerprintBin5 *int64 `json:"bodyFingerprintBin5,omitempty"` - DeliveryAction *DeliveryAction `json:"deliveryAction,omitempty"` - DeliveryLocation *DeliveryLocation `json:"deliveryLocation,omitempty"` - FileEntityIds *[]string `json:"fileEntityIds,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - InternetMessageId *string `json:"internetMessageId,omitempty"` - Language *string `json:"language,omitempty"` - NetworkMessageId *string `json:"networkMessageId,omitempty"` - P1Sender *string `json:"p1Sender,omitempty"` - P1SenderDisplayName *string `json:"p1SenderDisplayName,omitempty"` - P1SenderDomain *string `json:"p1SenderDomain,omitempty"` - P2Sender *string `json:"p2Sender,omitempty"` - P2SenderDisplayName *string `json:"p2SenderDisplayName,omitempty"` - P2SenderDomain *string `json:"p2SenderDomain,omitempty"` - ReceiveDate *string `json:"receiveDate,omitempty"` - Recipient *string `json:"recipient,omitempty"` - SenderIP *string `json:"senderIP,omitempty"` - Subject *string `json:"subject,omitempty"` - ThreatDetectionMethods *[]string `json:"threatDetectionMethods,omitempty"` - Threats *[]string `json:"threats,omitempty"` - Urls *[]string `json:"urls,omitempty"` -} - -func (o *MailMessageEntityProperties) GetReceiveDateAsTime() (*time.Time, error) { - if o.ReceiveDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ReceiveDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *MailMessageEntityProperties) SetReceiveDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ReceiveDate = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentity.go deleted file mode 100644 index 01b3f9cda92..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = MalwareEntity{} - -type MalwareEntity struct { - Properties *MalwareEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = MalwareEntity{} - -func (s MalwareEntity) MarshalJSON() ([]byte, error) { - type wrapper MalwareEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling MalwareEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling MalwareEntity: %+v", err) - } - decoded["kind"] = "Malware" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling MalwareEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentityproperties.go deleted file mode 100644 index 99a3529f02f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_malwareentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type MalwareEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Category *string `json:"category,omitempty"` - FileEntityIds *[]string `json:"fileEntityIds,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - MalwareName *string `json:"malwareName,omitempty"` - ProcessEntityIds *[]string `json:"processEntityIds,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_processentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_processentity.go deleted file mode 100644 index b3d0be74fd8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_processentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = ProcessEntity{} - -type ProcessEntity struct { - Properties *ProcessEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ProcessEntity{} - -func (s ProcessEntity) MarshalJSON() ([]byte, error) { - type wrapper ProcessEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ProcessEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ProcessEntity: %+v", err) - } - decoded["kind"] = "Process" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ProcessEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_processentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_processentityproperties.go deleted file mode 100644 index 49e9b63fe4a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_processentityproperties.go +++ /dev/null @@ -1,36 +0,0 @@ -package entitytypes - -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 ProcessEntityProperties struct { - AccountEntityId *string `json:"accountEntityId,omitempty"` - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - CommandLine *string `json:"commandLine,omitempty"` - CreationTimeUtc *string `json:"creationTimeUtc,omitempty"` - ElevationToken *ElevationToken `json:"elevationToken,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - HostEntityId *string `json:"hostEntityId,omitempty"` - HostLogonSessionEntityId *string `json:"hostLogonSessionEntityId,omitempty"` - ImageFileEntityId *string `json:"imageFileEntityId,omitempty"` - ParentProcessEntityId *string `json:"parentProcessEntityId,omitempty"` - ProcessId *string `json:"processId,omitempty"` -} - -func (o *ProcessEntityProperties) GetCreationTimeUtcAsTime() (*time.Time, error) { - if o.CreationTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreationTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *ProcessEntityProperties) SetCreationTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreationTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentity.go deleted file mode 100644 index bef73eb2c5b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = RegistryKeyEntity{} - -type RegistryKeyEntity struct { - Properties *RegistryKeyEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = RegistryKeyEntity{} - -func (s RegistryKeyEntity) MarshalJSON() ([]byte, error) { - type wrapper RegistryKeyEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RegistryKeyEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RegistryKeyEntity: %+v", err) - } - decoded["kind"] = "RegistryKey" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RegistryKeyEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentityproperties.go deleted file mode 100644 index f91f75ea021..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registrykeyentityproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryKeyEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Hive *RegistryHive `json:"hive,omitempty"` - Key *string `json:"key,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentity.go deleted file mode 100644 index 45599924191..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = RegistryValueEntity{} - -type RegistryValueEntity struct { - Properties *RegistryValueEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = RegistryValueEntity{} - -func (s RegistryValueEntity) MarshalJSON() ([]byte, error) { - type wrapper RegistryValueEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling RegistryValueEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling RegistryValueEntity: %+v", err) - } - decoded["kind"] = "RegistryValue" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling RegistryValueEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentityproperties.go deleted file mode 100644 index c368632a1d3..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_registryvalueentityproperties.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RegistryValueEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - KeyEntityId *string `json:"keyEntityId,omitempty"` - ValueData *string `json:"valueData,omitempty"` - ValueName *string `json:"valueName,omitempty"` - ValueType *RegistryValueKind `json:"valueType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalert.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalert.go deleted file mode 100644 index cfda2671eec..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalert.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertproperties.go deleted file mode 100644 index 105a41b9daf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package entitytypes - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index 1560939747b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentity.go deleted file mode 100644 index 71a694b6c72..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SecurityGroupEntity{} - -type SecurityGroupEntity struct { - Properties *SecurityGroupEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityGroupEntity{} - -func (s SecurityGroupEntity) MarshalJSON() ([]byte, error) { - type wrapper SecurityGroupEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityGroupEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityGroupEntity: %+v", err) - } - decoded["kind"] = "SecurityGroup" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityGroupEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentityproperties.go deleted file mode 100644 index 458b2ccbfb1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_securitygroupentityproperties.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityGroupEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - DistinguishedName *string `json:"distinguishedName,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - ObjectGuid *string `json:"objectGuid,omitempty"` - Sid *string `json:"sid,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentity.go deleted file mode 100644 index ff1c9193b12..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = SubmissionMailEntity{} - -type SubmissionMailEntity struct { - Properties *SubmissionMailEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SubmissionMailEntity{} - -func (s SubmissionMailEntity) MarshalJSON() ([]byte, error) { - type wrapper SubmissionMailEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SubmissionMailEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SubmissionMailEntity: %+v", err) - } - decoded["kind"] = "SubmissionMail" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SubmissionMailEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentityproperties.go deleted file mode 100644 index f28988a5d5b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_submissionmailentityproperties.go +++ /dev/null @@ -1,49 +0,0 @@ -package entitytypes - -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 SubmissionMailEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - NetworkMessageId *string `json:"networkMessageId,omitempty"` - Recipient *string `json:"recipient,omitempty"` - ReportType *string `json:"reportType,omitempty"` - Sender *string `json:"sender,omitempty"` - SenderIP *string `json:"senderIp,omitempty"` - Subject *string `json:"subject,omitempty"` - SubmissionDate *string `json:"submissionDate,omitempty"` - SubmissionId *string `json:"submissionId,omitempty"` - Submitter *string `json:"submitter,omitempty"` - Timestamp *string `json:"timestamp,omitempty"` -} - -func (o *SubmissionMailEntityProperties) GetSubmissionDateAsTime() (*time.Time, error) { - if o.SubmissionDate == nil { - return nil, nil - } - return dates.ParseAsFormat(o.SubmissionDate, "2006-01-02T15:04:05Z07:00") -} - -func (o *SubmissionMailEntityProperties) SetSubmissionDateAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.SubmissionDate = &formatted -} - -func (o *SubmissionMailEntityProperties) GetTimestampAsTime() (*time.Time, error) { - if o.Timestamp == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Timestamp, "2006-01-02T15:04:05Z07:00") -} - -func (o *SubmissionMailEntityProperties) SetTimestampAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Timestamp = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_systemdata.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_systemdata.go deleted file mode 100644 index 862ee7fdbaf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_systemdata.go +++ /dev/null @@ -1,43 +0,0 @@ -package entitytypes - -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 SystemData struct { - CreatedAt *string `json:"createdAt,omitempty"` - CreatedBy *string `json:"createdBy,omitempty"` - CreatedByType *CreatedByType `json:"createdByType,omitempty"` - LastModifiedAt *string `json:"lastModifiedAt,omitempty"` - LastModifiedBy *string `json:"lastModifiedBy,omitempty"` - LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` -} - -func (o *SystemData) GetCreatedAtAsTime() (*time.Time, error) { - if o.CreatedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *SystemData) SetCreatedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedAt = &formatted -} - -func (o *SystemData) GetLastModifiedAtAsTime() (*time.Time, error) { - if o.LastModifiedAt == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedAt, "2006-01-02T15:04:05Z07:00") -} - -func (o *SystemData) SetLastModifiedAtAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedAt = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_threatintelligence.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_threatintelligence.go deleted file mode 100644 index e225a18045c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_threatintelligence.go +++ /dev/null @@ -1,13 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligence struct { - Confidence *float64 `json:"confidence,omitempty"` - ProviderName *string `json:"providerName,omitempty"` - ReportLink *string `json:"reportLink,omitempty"` - ThreatDescription *string `json:"threatDescription,omitempty"` - ThreatName *string `json:"threatName,omitempty"` - ThreatType *string `json:"threatType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentity.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentity.go deleted file mode 100644 index a6d90352180..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentity.go +++ /dev/null @@ -1,45 +0,0 @@ -package entitytypes - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -var _ Entity = UrlEntity{} - -type UrlEntity struct { - Properties *UrlEntityProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = UrlEntity{} - -func (s UrlEntity) MarshalJSON() ([]byte, error) { - type wrapper UrlEntity - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling UrlEntity: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling UrlEntity: %+v", err) - } - decoded["kind"] = "Url" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling UrlEntity: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentityproperties.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentityproperties.go deleted file mode 100644 index 2d3b7085055..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_urlentityproperties.go +++ /dev/null @@ -1,10 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UrlEntityProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/entitytypes/model_userinfo.go deleted file mode 100644 index 9b6d8135aea..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package entitytypes - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/entitytypes/version.go b/resource-manager/securityinsights/2022-08-01/entitytypes/version.go deleted file mode 100644 index 558688f20da..00000000000 --- a/resource-manager/securityinsights/2022-08-01/entitytypes/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package entitytypes - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/entitytypes/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/README.md b/resource-manager/securityinsights/2022-08-01/incidentalerts/README.md deleted file mode 100644 index 3c3ecbe6586..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentalerts` Documentation - -The `incidentalerts` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/incidentalerts" -``` - - -### Client Initialization - -```go -client := incidentalerts.NewIncidentAlertsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentAlertsClient.IncidentsListAlerts` - -```go -ctx := context.TODO() -id := incidentalerts.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -read, err := client.IncidentsListAlerts(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/securityinsights/2022-08-01/incidentalerts/client.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/client.go deleted file mode 100644 index 53dc2b4cd4e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentalerts - -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 IncidentAlertsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentAlertsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentAlertsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentalerts", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentAlertsClient: %+v", err) - } - - return &IncidentAlertsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/constants.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/constants.go deleted file mode 100644 index 3673d5b1163..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/constants.go +++ /dev/null @@ -1,506 +0,0 @@ -package incidentalerts - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKindEnum string - -const ( - EntityKindEnumAccount EntityKindEnum = "Account" - EntityKindEnumAzureResource EntityKindEnum = "AzureResource" - EntityKindEnumBookmark EntityKindEnum = "Bookmark" - EntityKindEnumCloudApplication EntityKindEnum = "CloudApplication" - EntityKindEnumDnsResolution EntityKindEnum = "DnsResolution" - EntityKindEnumFile EntityKindEnum = "File" - EntityKindEnumFileHash EntityKindEnum = "FileHash" - EntityKindEnumHost EntityKindEnum = "Host" - EntityKindEnumIP EntityKindEnum = "Ip" - EntityKindEnumIoTDevice EntityKindEnum = "IoTDevice" - EntityKindEnumMailCluster EntityKindEnum = "MailCluster" - EntityKindEnumMailMessage EntityKindEnum = "MailMessage" - EntityKindEnumMailbox EntityKindEnum = "Mailbox" - EntityKindEnumMalware EntityKindEnum = "Malware" - EntityKindEnumProcess EntityKindEnum = "Process" - EntityKindEnumRegistryKey EntityKindEnum = "RegistryKey" - EntityKindEnumRegistryValue EntityKindEnum = "RegistryValue" - EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" - EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" - EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" -) - -func PossibleValuesForEntityKindEnum() []string { - return []string{ - string(EntityKindEnumAccount), - string(EntityKindEnumAzureResource), - string(EntityKindEnumBookmark), - string(EntityKindEnumCloudApplication), - string(EntityKindEnumDnsResolution), - string(EntityKindEnumFile), - string(EntityKindEnumFileHash), - string(EntityKindEnumHost), - string(EntityKindEnumIP), - string(EntityKindEnumIoTDevice), - string(EntityKindEnumMailCluster), - string(EntityKindEnumMailMessage), - string(EntityKindEnumMailbox), - string(EntityKindEnumMalware), - string(EntityKindEnumProcess), - string(EntityKindEnumRegistryKey), - string(EntityKindEnumRegistryValue), - string(EntityKindEnumSecurityAlert), - string(EntityKindEnumSecurityGroup), - string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), - } -} - -func (s *EntityKindEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKindEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKindEnum(input string) (*EntityKindEnum, error) { - vals := map[string]EntityKindEnum{ - "account": EntityKindEnumAccount, - "azureresource": EntityKindEnumAzureResource, - "bookmark": EntityKindEnumBookmark, - "cloudapplication": EntityKindEnumCloudApplication, - "dnsresolution": EntityKindEnumDnsResolution, - "file": EntityKindEnumFile, - "filehash": EntityKindEnumFileHash, - "host": EntityKindEnumHost, - "ip": EntityKindEnumIP, - "iotdevice": EntityKindEnumIoTDevice, - "mailcluster": EntityKindEnumMailCluster, - "mailmessage": EntityKindEnumMailMessage, - "mailbox": EntityKindEnumMailbox, - "malware": EntityKindEnumMalware, - "process": EntityKindEnumProcess, - "registrykey": EntityKindEnumRegistryKey, - "registryvalue": EntityKindEnumRegistryValue, - "securityalert": EntityKindEnumSecurityAlert, - "securitygroup": EntityKindEnumSecurityGroup, - "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKindEnum(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident.go deleted file mode 100644 index 6145c7882c4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentalerts - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident_test.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident_test.go deleted file mode 100644 index 8bb97137cf9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentalerts - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-08-01/incidentalerts/method_incidentslistalerts.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/method_incidentslistalerts.go deleted file mode 100644 index a6b61790e56..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/method_incidentslistalerts.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidentalerts - -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 IncidentsListAlertsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentAlertList -} - -// IncidentsListAlerts ... -func (c IncidentAlertsClient) IncidentsListAlerts(ctx context.Context, id IncidentId) (result IncidentsListAlertsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/alerts", 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 IncidentAlertList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_entity.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_entity.go deleted file mode 100644 index 8a6c7ffef8e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidentalerts - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmark.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmark.go deleted file mode 100644 index 827ded08f6d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentalerts - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmarkproperties.go deleted file mode 100644 index f12788659cd..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidentalerts - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentalertlist.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentalertlist.go deleted file mode 100644 index 5ce96fd6aa8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentalertlist.go +++ /dev/null @@ -1,8 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentAlertList struct { - Value []SecurityAlert `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentinfo.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentinfo.go deleted file mode 100644 index af30d557ee7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalert.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalert.go deleted file mode 100644 index 3935326a1d2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentalerts - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertproperties.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertproperties.go deleted file mode 100644 index 99d6a0318e9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidentalerts - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index f7b76c4041c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/model_userinfo.go deleted file mode 100644 index 6093aa77979..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidentalerts - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentalerts/version.go b/resource-manager/securityinsights/2022-08-01/incidentalerts/version.go deleted file mode 100644 index 493074a9ec7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentalerts/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentalerts - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentalerts/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/README.md b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/README.md deleted file mode 100644 index 62a61ee540c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentbookmarks` Documentation - -The `incidentbookmarks` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/incidentbookmarks" -``` - - -### Client Initialization - -```go -client := incidentbookmarks.NewIncidentBookmarksClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentBookmarksClient.IncidentsListBookmarks` - -```go -ctx := context.TODO() -id := incidentbookmarks.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -read, err := client.IncidentsListBookmarks(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/securityinsights/2022-08-01/incidentbookmarks/client.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/client.go deleted file mode 100644 index e6a60ede52d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentbookmarks - -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 IncidentBookmarksClient struct { - Client *resourcemanager.Client -} - -func NewIncidentBookmarksClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentBookmarksClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentbookmarks", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentBookmarksClient: %+v", err) - } - - return &IncidentBookmarksClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/constants.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/constants.go deleted file mode 100644 index 27f31cfcc5e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/constants.go +++ /dev/null @@ -1,506 +0,0 @@ -package incidentbookmarks - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKindEnum string - -const ( - EntityKindEnumAccount EntityKindEnum = "Account" - EntityKindEnumAzureResource EntityKindEnum = "AzureResource" - EntityKindEnumBookmark EntityKindEnum = "Bookmark" - EntityKindEnumCloudApplication EntityKindEnum = "CloudApplication" - EntityKindEnumDnsResolution EntityKindEnum = "DnsResolution" - EntityKindEnumFile EntityKindEnum = "File" - EntityKindEnumFileHash EntityKindEnum = "FileHash" - EntityKindEnumHost EntityKindEnum = "Host" - EntityKindEnumIP EntityKindEnum = "Ip" - EntityKindEnumIoTDevice EntityKindEnum = "IoTDevice" - EntityKindEnumMailCluster EntityKindEnum = "MailCluster" - EntityKindEnumMailMessage EntityKindEnum = "MailMessage" - EntityKindEnumMailbox EntityKindEnum = "Mailbox" - EntityKindEnumMalware EntityKindEnum = "Malware" - EntityKindEnumProcess EntityKindEnum = "Process" - EntityKindEnumRegistryKey EntityKindEnum = "RegistryKey" - EntityKindEnumRegistryValue EntityKindEnum = "RegistryValue" - EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" - EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" - EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" -) - -func PossibleValuesForEntityKindEnum() []string { - return []string{ - string(EntityKindEnumAccount), - string(EntityKindEnumAzureResource), - string(EntityKindEnumBookmark), - string(EntityKindEnumCloudApplication), - string(EntityKindEnumDnsResolution), - string(EntityKindEnumFile), - string(EntityKindEnumFileHash), - string(EntityKindEnumHost), - string(EntityKindEnumIP), - string(EntityKindEnumIoTDevice), - string(EntityKindEnumMailCluster), - string(EntityKindEnumMailMessage), - string(EntityKindEnumMailbox), - string(EntityKindEnumMalware), - string(EntityKindEnumProcess), - string(EntityKindEnumRegistryKey), - string(EntityKindEnumRegistryValue), - string(EntityKindEnumSecurityAlert), - string(EntityKindEnumSecurityGroup), - string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), - } -} - -func (s *EntityKindEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKindEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKindEnum(input string) (*EntityKindEnum, error) { - vals := map[string]EntityKindEnum{ - "account": EntityKindEnumAccount, - "azureresource": EntityKindEnumAzureResource, - "bookmark": EntityKindEnumBookmark, - "cloudapplication": EntityKindEnumCloudApplication, - "dnsresolution": EntityKindEnumDnsResolution, - "file": EntityKindEnumFile, - "filehash": EntityKindEnumFileHash, - "host": EntityKindEnumHost, - "ip": EntityKindEnumIP, - "iotdevice": EntityKindEnumIoTDevice, - "mailcluster": EntityKindEnumMailCluster, - "mailmessage": EntityKindEnumMailMessage, - "mailbox": EntityKindEnumMailbox, - "malware": EntityKindEnumMalware, - "process": EntityKindEnumProcess, - "registrykey": EntityKindEnumRegistryKey, - "registryvalue": EntityKindEnumRegistryValue, - "securityalert": EntityKindEnumSecurityAlert, - "securitygroup": EntityKindEnumSecurityGroup, - "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKindEnum(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident.go deleted file mode 100644 index f2bd006b056..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentbookmarks - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident_test.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident_test.go deleted file mode 100644 index f17dbe1c939..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentbookmarks - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-08-01/incidentbookmarks/method_incidentslistbookmarks.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/method_incidentslistbookmarks.go deleted file mode 100644 index ea658d25e66..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/method_incidentslistbookmarks.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidentbookmarks - -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 IncidentsListBookmarksOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentBookmarkList -} - -// IncidentsListBookmarks ... -func (c IncidentBookmarksClient) IncidentsListBookmarks(ctx context.Context, id IncidentId) (result IncidentsListBookmarksOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/bookmarks", 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 IncidentBookmarkList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_entity.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_entity.go deleted file mode 100644 index ac882c04383..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidentbookmarks - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmark.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmark.go deleted file mode 100644 index 1e9bfbf488f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentbookmarks - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmarkproperties.go deleted file mode 100644 index e5e13270882..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidentbookmarks - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentbookmarklist.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentbookmarklist.go deleted file mode 100644 index cfeedfda4ac..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentbookmarklist.go +++ /dev/null @@ -1,8 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentBookmarkList struct { - Value []HuntingBookmark `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentinfo.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentinfo.go deleted file mode 100644 index 0a1b8d71c42..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalert.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalert.go deleted file mode 100644 index a86152f3c69..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentbookmarks - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertproperties.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertproperties.go deleted file mode 100644 index 68387d97736..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidentbookmarks - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index d0dec8bc6c2..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_userinfo.go deleted file mode 100644 index b585f0bdd6d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidentbookmarks - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/version.go b/resource-manager/securityinsights/2022-08-01/incidentbookmarks/version.go deleted file mode 100644 index cfea27805f6..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentbookmarks/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentbookmarks - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentbookmarks/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/README.md b/resource-manager/securityinsights/2022-08-01/incidentcomments/README.md deleted file mode 100644 index 6301bda0572..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentcomments` Documentation - -The `incidentcomments` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/incidentcomments" -``` - - -### Client Initialization - -```go -client := incidentcomments.NewIncidentCommentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentCommentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -payload := incidentcomments.IncidentComment{ - // ... -} - - -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: `IncidentCommentsClient.Delete` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -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: `IncidentCommentsClient.Get` - -```go -ctx := context.TODO() -id := incidentcomments.NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - -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: `IncidentCommentsClient.List` - -```go -ctx := context.TODO() -id := incidentcomments.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -// alternatively `client.List(ctx, id, incidentcomments.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidentcomments.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/client.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/client.go deleted file mode 100644 index 981e6f75216..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentcomments - -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 IncidentCommentsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentCommentsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentCommentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentcomments", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentCommentsClient: %+v", err) - } - - return &IncidentCommentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment.go deleted file mode 100644 index 1c431622bbe..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment.go +++ /dev/null @@ -1,150 +0,0 @@ -package incidentcomments - -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(&CommentId{}) -} - -var _ resourceids.ResourceId = &CommentId{} - -// CommentId is a struct representing the Resource ID for a Comment -type CommentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string - IncidentCommentId string -} - -// NewCommentID returns a new CommentId struct -func NewCommentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string, incidentCommentId string) CommentId { - return CommentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - IncidentCommentId: incidentCommentId, - } -} - -// ParseCommentID parses 'input' into a CommentId -func ParseCommentID(input string) (*CommentId, error) { - parser := resourceids.NewParserFromResourceIdType(&CommentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CommentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseCommentIDInsensitively parses 'input' case-insensitively into a CommentId -// note: this method should only be used for API response data and not user input -func ParseCommentIDInsensitively(input string) (*CommentId, error) { - parser := resourceids.NewParserFromResourceIdType(&CommentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := CommentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *CommentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - if id.IncidentCommentId, ok = input.Parsed["incidentCommentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentCommentId", input) - } - - return nil -} - -// ValidateCommentID checks that 'input' can be parsed as a Comment ID -func ValidateCommentID(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 := ParseCommentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Comment ID -func (id CommentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s/comments/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId, id.IncidentCommentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Comment ID -func (id CommentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - resourceids.StaticSegment("staticComments", "comments", "comments"), - resourceids.UserSpecifiedSegment("incidentCommentId", "incidentCommentIdValue"), - } -} - -// String returns a human-readable description of this Comment ID -func (id CommentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - fmt.Sprintf("Incident Comment: %q", id.IncidentCommentId), - } - return fmt.Sprintf("Comment (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment_test.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment_test.go deleted file mode 100644 index 5dd784507fa..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_comment_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package incidentcomments - -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 = &CommentId{} - -func TestNewCommentID(t *testing.T) { - id := NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } - - if id.IncidentCommentId != "incidentCommentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentCommentId'", id.IncidentCommentId, "incidentCommentIdValue") - } -} - -func TestFormatCommentID(t *testing.T) { - actual := NewCommentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "incidentCommentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseCommentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - IncidentCommentId: "incidentCommentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.IncidentCommentId != v.Expected.IncidentCommentId { - t.Fatalf("Expected %q but got %q for IncidentCommentId", v.Expected.IncidentCommentId, actual.IncidentCommentId) - } - - } -} - -func TestParseCommentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *CommentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - IncidentCommentId: "incidentCommentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/comments/incidentCommentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS/iNcIdEnTcOmMeNtIdVaLuE", - Expected: &CommentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - IncidentCommentId: "iNcIdEnTcOmMeNtIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/cOmMeNtS/iNcIdEnTcOmMeNtIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseCommentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.IncidentCommentId != v.Expected.IncidentCommentId { - t.Fatalf("Expected %q but got %q for IncidentCommentId", v.Expected.IncidentCommentId, actual.IncidentCommentId) - } - - } -} - -func TestSegmentsForCommentId(t *testing.T) { - segments := CommentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("CommentId 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/securityinsights/2022-08-01/incidentcomments/id_incident.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident.go deleted file mode 100644 index 94bb1fcdd3c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentcomments - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident_test.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident_test.go deleted file mode 100644 index 97fe12c64e1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentcomments - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-08-01/incidentcomments/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/method_createorupdate.go deleted file mode 100644 index 6ea7a1ed4dc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentcomments - -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 *IncidentComment -} - -// CreateOrUpdate ... -func (c IncidentCommentsClient) CreateOrUpdate(ctx context.Context, id CommentId, input IncidentComment) (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 IncidentComment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/method_delete.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/method_delete.go deleted file mode 100644 index 78412a13e76..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentcomments - -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 IncidentCommentsClient) Delete(ctx context.Context, id CommentId) (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/securityinsights/2022-08-01/incidentcomments/method_get.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/method_get.go deleted file mode 100644 index 1942042dbea..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidentcomments - -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 *IncidentComment -} - -// Get ... -func (c IncidentCommentsClient) Get(ctx context.Context, id CommentId) (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 IncidentComment - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/method_list.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/method_list.go deleted file mode 100644 index b4c16058b38..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidentcomments - -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 *[]IncidentComment -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []IncidentComment -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentCommentsClient) List(ctx context.Context, id IncidentId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/comments", id.ID()), - OptionsObject: options, - } - - 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 *[]IncidentComment `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 IncidentCommentsClient) ListComplete(ctx context.Context, id IncidentId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, IncidentCommentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentCommentsClient) ListCompleteMatchingPredicate(ctx context.Context, id IncidentId, options ListOperationOptions, predicate IncidentCommentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]IncidentComment, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-08-01/incidentcomments/model_clientinfo.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/model_clientinfo.go deleted file mode 100644 index 55cc93b9c5d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/model_clientinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentcomments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ClientInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcomment.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcomment.go deleted file mode 100644 index 93ee7dc82f8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcomment.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidentcomments - -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 IncidentComment struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IncidentCommentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcommentproperties.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcommentproperties.go deleted file mode 100644 index 233937ddedc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/model_incidentcommentproperties.go +++ /dev/null @@ -1,41 +0,0 @@ -package incidentcomments - -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 IncidentCommentProperties struct { - Author *ClientInfo `json:"author,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Message string `json:"message"` -} - -func (o *IncidentCommentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentCommentProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *IncidentCommentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentCommentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentcomments/predicates.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/predicates.go deleted file mode 100644 index 434091dbb53..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidentcomments - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentCommentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p IncidentCommentOperationPredicate) Matches(input IncidentComment) 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.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/securityinsights/2022-08-01/incidentcomments/version.go b/resource-manager/securityinsights/2022-08-01/incidentcomments/version.go deleted file mode 100644 index 21879b203ee..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentcomments/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentcomments - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentcomments/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/README.md b/resource-manager/securityinsights/2022-08-01/incidententities/README.md deleted file mode 100644 index c23de63d5ee..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/README.md +++ /dev/null @@ -1,36 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidententities` Documentation - -The `incidententities` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/incidententities" -``` - - -### Client Initialization - -```go -client := incidententities.NewIncidentEntitiesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentEntitiesClient.IncidentsListEntities` - -```go -ctx := context.TODO() -id := incidententities.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -read, err := client.IncidentsListEntities(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/securityinsights/2022-08-01/incidententities/client.go b/resource-manager/securityinsights/2022-08-01/incidententities/client.go deleted file mode 100644 index 740e7b81755..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidententities - -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 IncidentEntitiesClient struct { - Client *resourcemanager.Client -} - -func NewIncidentEntitiesClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentEntitiesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidententities", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentEntitiesClient: %+v", err) - } - - return &IncidentEntitiesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/constants.go b/resource-manager/securityinsights/2022-08-01/incidententities/constants.go deleted file mode 100644 index a1d54eb28d0..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/constants.go +++ /dev/null @@ -1,506 +0,0 @@ -package incidententities - -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 AlertSeverity string - -const ( - AlertSeverityHigh AlertSeverity = "High" - AlertSeverityInformational AlertSeverity = "Informational" - AlertSeverityLow AlertSeverity = "Low" - AlertSeverityMedium AlertSeverity = "Medium" -) - -func PossibleValuesForAlertSeverity() []string { - return []string{ - string(AlertSeverityHigh), - string(AlertSeverityInformational), - string(AlertSeverityLow), - string(AlertSeverityMedium), - } -} - -func (s *AlertSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertSeverity(input string) (*AlertSeverity, error) { - vals := map[string]AlertSeverity{ - "high": AlertSeverityHigh, - "informational": AlertSeverityInformational, - "low": AlertSeverityLow, - "medium": AlertSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertSeverity(input) - return &out, nil -} - -type AlertStatus string - -const ( - AlertStatusDismissed AlertStatus = "Dismissed" - AlertStatusInProgress AlertStatus = "InProgress" - AlertStatusNew AlertStatus = "New" - AlertStatusResolved AlertStatus = "Resolved" - AlertStatusUnknown AlertStatus = "Unknown" -) - -func PossibleValuesForAlertStatus() []string { - return []string{ - string(AlertStatusDismissed), - string(AlertStatusInProgress), - string(AlertStatusNew), - string(AlertStatusResolved), - string(AlertStatusUnknown), - } -} - -func (s *AlertStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAlertStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAlertStatus(input string) (*AlertStatus, error) { - vals := map[string]AlertStatus{ - "dismissed": AlertStatusDismissed, - "inprogress": AlertStatusInProgress, - "new": AlertStatusNew, - "resolved": AlertStatusResolved, - "unknown": AlertStatusUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AlertStatus(input) - return &out, nil -} - -type AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type ConfidenceLevel string - -const ( - ConfidenceLevelHigh ConfidenceLevel = "High" - ConfidenceLevelLow ConfidenceLevel = "Low" - ConfidenceLevelUnknown ConfidenceLevel = "Unknown" -) - -func PossibleValuesForConfidenceLevel() []string { - return []string{ - string(ConfidenceLevelHigh), - string(ConfidenceLevelLow), - string(ConfidenceLevelUnknown), - } -} - -func (s *ConfidenceLevel) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceLevel(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceLevel(input string) (*ConfidenceLevel, error) { - vals := map[string]ConfidenceLevel{ - "high": ConfidenceLevelHigh, - "low": ConfidenceLevelLow, - "unknown": ConfidenceLevelUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceLevel(input) - return &out, nil -} - -type ConfidenceScoreStatus string - -const ( - ConfidenceScoreStatusFinal ConfidenceScoreStatus = "Final" - ConfidenceScoreStatusInProcess ConfidenceScoreStatus = "InProcess" - ConfidenceScoreStatusNotApplicable ConfidenceScoreStatus = "NotApplicable" - ConfidenceScoreStatusNotFinal ConfidenceScoreStatus = "NotFinal" -) - -func PossibleValuesForConfidenceScoreStatus() []string { - return []string{ - string(ConfidenceScoreStatusFinal), - string(ConfidenceScoreStatusInProcess), - string(ConfidenceScoreStatusNotApplicable), - string(ConfidenceScoreStatusNotFinal), - } -} - -func (s *ConfidenceScoreStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseConfidenceScoreStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseConfidenceScoreStatus(input string) (*ConfidenceScoreStatus, error) { - vals := map[string]ConfidenceScoreStatus{ - "final": ConfidenceScoreStatusFinal, - "inprocess": ConfidenceScoreStatusInProcess, - "notapplicable": ConfidenceScoreStatusNotApplicable, - "notfinal": ConfidenceScoreStatusNotFinal, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ConfidenceScoreStatus(input) - return &out, nil -} - -type EntityKindEnum string - -const ( - EntityKindEnumAccount EntityKindEnum = "Account" - EntityKindEnumAzureResource EntityKindEnum = "AzureResource" - EntityKindEnumBookmark EntityKindEnum = "Bookmark" - EntityKindEnumCloudApplication EntityKindEnum = "CloudApplication" - EntityKindEnumDnsResolution EntityKindEnum = "DnsResolution" - EntityKindEnumFile EntityKindEnum = "File" - EntityKindEnumFileHash EntityKindEnum = "FileHash" - EntityKindEnumHost EntityKindEnum = "Host" - EntityKindEnumIP EntityKindEnum = "Ip" - EntityKindEnumIoTDevice EntityKindEnum = "IoTDevice" - EntityKindEnumMailCluster EntityKindEnum = "MailCluster" - EntityKindEnumMailMessage EntityKindEnum = "MailMessage" - EntityKindEnumMailbox EntityKindEnum = "Mailbox" - EntityKindEnumMalware EntityKindEnum = "Malware" - EntityKindEnumProcess EntityKindEnum = "Process" - EntityKindEnumRegistryKey EntityKindEnum = "RegistryKey" - EntityKindEnumRegistryValue EntityKindEnum = "RegistryValue" - EntityKindEnumSecurityAlert EntityKindEnum = "SecurityAlert" - EntityKindEnumSecurityGroup EntityKindEnum = "SecurityGroup" - EntityKindEnumSubmissionMail EntityKindEnum = "SubmissionMail" - EntityKindEnumUrl EntityKindEnum = "Url" -) - -func PossibleValuesForEntityKindEnum() []string { - return []string{ - string(EntityKindEnumAccount), - string(EntityKindEnumAzureResource), - string(EntityKindEnumBookmark), - string(EntityKindEnumCloudApplication), - string(EntityKindEnumDnsResolution), - string(EntityKindEnumFile), - string(EntityKindEnumFileHash), - string(EntityKindEnumHost), - string(EntityKindEnumIP), - string(EntityKindEnumIoTDevice), - string(EntityKindEnumMailCluster), - string(EntityKindEnumMailMessage), - string(EntityKindEnumMailbox), - string(EntityKindEnumMalware), - string(EntityKindEnumProcess), - string(EntityKindEnumRegistryKey), - string(EntityKindEnumRegistryValue), - string(EntityKindEnumSecurityAlert), - string(EntityKindEnumSecurityGroup), - string(EntityKindEnumSubmissionMail), - string(EntityKindEnumUrl), - } -} - -func (s *EntityKindEnum) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseEntityKindEnum(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseEntityKindEnum(input string) (*EntityKindEnum, error) { - vals := map[string]EntityKindEnum{ - "account": EntityKindEnumAccount, - "azureresource": EntityKindEnumAzureResource, - "bookmark": EntityKindEnumBookmark, - "cloudapplication": EntityKindEnumCloudApplication, - "dnsresolution": EntityKindEnumDnsResolution, - "file": EntityKindEnumFile, - "filehash": EntityKindEnumFileHash, - "host": EntityKindEnumHost, - "ip": EntityKindEnumIP, - "iotdevice": EntityKindEnumIoTDevice, - "mailcluster": EntityKindEnumMailCluster, - "mailmessage": EntityKindEnumMailMessage, - "mailbox": EntityKindEnumMailbox, - "malware": EntityKindEnumMalware, - "process": EntityKindEnumProcess, - "registrykey": EntityKindEnumRegistryKey, - "registryvalue": EntityKindEnumRegistryValue, - "securityalert": EntityKindEnumSecurityAlert, - "securitygroup": EntityKindEnumSecurityGroup, - "submissionmail": EntityKindEnumSubmissionMail, - "url": EntityKindEnumUrl, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := EntityKindEnum(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type KillChainIntent string - -const ( - KillChainIntentCollection KillChainIntent = "Collection" - KillChainIntentCommandAndControl KillChainIntent = "CommandAndControl" - KillChainIntentCredentialAccess KillChainIntent = "CredentialAccess" - KillChainIntentDefenseEvasion KillChainIntent = "DefenseEvasion" - KillChainIntentDiscovery KillChainIntent = "Discovery" - KillChainIntentExecution KillChainIntent = "Execution" - KillChainIntentExfiltration KillChainIntent = "Exfiltration" - KillChainIntentExploitation KillChainIntent = "Exploitation" - KillChainIntentImpact KillChainIntent = "Impact" - KillChainIntentLateralMovement KillChainIntent = "LateralMovement" - KillChainIntentPersistence KillChainIntent = "Persistence" - KillChainIntentPrivilegeEscalation KillChainIntent = "PrivilegeEscalation" - KillChainIntentProbing KillChainIntent = "Probing" - KillChainIntentUnknown KillChainIntent = "Unknown" -) - -func PossibleValuesForKillChainIntent() []string { - return []string{ - string(KillChainIntentCollection), - string(KillChainIntentCommandAndControl), - string(KillChainIntentCredentialAccess), - string(KillChainIntentDefenseEvasion), - string(KillChainIntentDiscovery), - string(KillChainIntentExecution), - string(KillChainIntentExfiltration), - string(KillChainIntentExploitation), - string(KillChainIntentImpact), - string(KillChainIntentLateralMovement), - string(KillChainIntentPersistence), - string(KillChainIntentPrivilegeEscalation), - string(KillChainIntentProbing), - string(KillChainIntentUnknown), - } -} - -func (s *KillChainIntent) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseKillChainIntent(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseKillChainIntent(input string) (*KillChainIntent, error) { - vals := map[string]KillChainIntent{ - "collection": KillChainIntentCollection, - "commandandcontrol": KillChainIntentCommandAndControl, - "credentialaccess": KillChainIntentCredentialAccess, - "defenseevasion": KillChainIntentDefenseEvasion, - "discovery": KillChainIntentDiscovery, - "execution": KillChainIntentExecution, - "exfiltration": KillChainIntentExfiltration, - "exploitation": KillChainIntentExploitation, - "impact": KillChainIntentImpact, - "lateralmovement": KillChainIntentLateralMovement, - "persistence": KillChainIntentPersistence, - "privilegeescalation": KillChainIntentPrivilegeEscalation, - "probing": KillChainIntentProbing, - "unknown": KillChainIntentUnknown, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := KillChainIntent(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/id_incident.go b/resource-manager/securityinsights/2022-08-01/incidententities/id_incident.go deleted file mode 100644 index c5a5ad1f7ba..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidententities - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/id_incident_test.go b/resource-manager/securityinsights/2022-08-01/incidententities/id_incident_test.go deleted file mode 100644 index 42b5ee10ef8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidententities - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-08-01/incidententities/method_incidentslistentities.go b/resource-manager/securityinsights/2022-08-01/incidententities/method_incidentslistentities.go deleted file mode 100644 index 2723b2f44a9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/method_incidentslistentities.go +++ /dev/null @@ -1,55 +0,0 @@ -package incidententities - -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 IncidentsListEntitiesOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *IncidentEntitiesResponse -} - -// IncidentsListEntities ... -func (c IncidentEntitiesClient) IncidentsListEntities(ctx context.Context, id IncidentId) (result IncidentsListEntitiesOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/entities", 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 IncidentEntitiesResponse - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_entity.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_entity.go deleted file mode 100644 index 43a9a64c0bf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_entity.go +++ /dev/null @@ -1,61 +0,0 @@ -package incidententities - -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 Entity interface { -} - -// RawEntityImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawEntityImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalEntityImplementation(input []byte) (Entity, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling Entity into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "Bookmark") { - var out HuntingBookmark - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into HuntingBookmark: %+v", err) - } - return out, nil - } - - if strings.EqualFold(value, "SecurityAlert") { - var out SecurityAlert - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into SecurityAlert: %+v", err) - } - return out, nil - } - - out := RawEntityImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmark.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmark.go deleted file mode 100644 index f001f6b783a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmark.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = HuntingBookmark{} - -type HuntingBookmark struct { - Properties *HuntingBookmarkProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = HuntingBookmark{} - -func (s HuntingBookmark) MarshalJSON() ([]byte, error) { - type wrapper HuntingBookmark - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling HuntingBookmark: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling HuntingBookmark: %+v", err) - } - decoded["kind"] = "Bookmark" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling HuntingBookmark: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmarkproperties.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmarkproperties.go deleted file mode 100644 index 278d0da2ec5..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_huntingbookmarkproperties.go +++ /dev/null @@ -1,62 +0,0 @@ -package incidententities - -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 HuntingBookmarkProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DisplayName string `json:"displayName"` - EventTime *string `json:"eventTime,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Notes *string `json:"notes,omitempty"` - Query string `json:"query"` - QueryResult *string `json:"queryResult,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` -} - -func (o *HuntingBookmarkProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *HuntingBookmarkProperties) GetEventTimeAsTime() (*time.Time, error) { - if o.EventTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EventTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetEventTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EventTime = &formatted -} - -func (o *HuntingBookmarkProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *HuntingBookmarkProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresponse.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresponse.go deleted file mode 100644 index ab896895768..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresponse.go +++ /dev/null @@ -1,49 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" -) - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentEntitiesResponse struct { - Entities *[]Entity `json:"entities,omitempty"` - MetaData *[]IncidentEntitiesResultsMetadata `json:"metaData,omitempty"` -} - -var _ json.Unmarshaler = &IncidentEntitiesResponse{} - -func (s *IncidentEntitiesResponse) UnmarshalJSON(bytes []byte) error { - type alias IncidentEntitiesResponse - var decoded alias - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling into IncidentEntitiesResponse: %+v", err) - } - - s.MetaData = decoded.MetaData - - var temp map[string]json.RawMessage - if err := json.Unmarshal(bytes, &temp); err != nil { - return fmt.Errorf("unmarshaling IncidentEntitiesResponse into map[string]json.RawMessage: %+v", err) - } - - if v, ok := temp["entities"]; ok { - var listTemp []json.RawMessage - if err := json.Unmarshal(v, &listTemp); err != nil { - return fmt.Errorf("unmarshaling Entities into list []json.RawMessage: %+v", err) - } - - output := make([]Entity, 0) - for i, val := range listTemp { - impl, err := unmarshalEntityImplementation(val) - if err != nil { - return fmt.Errorf("unmarshaling index %d field 'Entities' for 'IncidentEntitiesResponse': %+v", i, err) - } - output = append(output, impl) - } - s.Entities = &output - } - return nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresultsmetadata.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresultsmetadata.go deleted file mode 100644 index 55e5ecdef42..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_incidententitiesresultsmetadata.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentEntitiesResultsMetadata struct { - Count int64 `json:"count"` - EntityKind EntityKindEnum `json:"entityKind"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_incidentinfo.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_incidentinfo.go deleted file mode 100644 index ec816413c8c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_incidentinfo.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentInfo struct { - IncidentId *string `json:"incidentId,omitempty"` - RelationName *string `json:"relationName,omitempty"` - Severity *IncidentSeverity `json:"severity,omitempty"` - Title *string `json:"title,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalert.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalert.go deleted file mode 100644 index 9d570306524..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalert.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidententities - -import ( - "encoding/json" - "fmt" - - "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. - -var _ Entity = SecurityAlert{} - -type SecurityAlert struct { - Properties *SecurityAlertProperties `json:"properties,omitempty"` - - // Fields inherited from Entity - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = SecurityAlert{} - -func (s SecurityAlert) MarshalJSON() ([]byte, error) { - type wrapper SecurityAlert - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling SecurityAlert: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling SecurityAlert: %+v", err) - } - decoded["kind"] = "SecurityAlert" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling SecurityAlert: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertproperties.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertproperties.go deleted file mode 100644 index bdfa3d19c6d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertproperties.go +++ /dev/null @@ -1,88 +0,0 @@ -package incidententities - -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 SecurityAlertProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - AlertDisplayName *string `json:"alertDisplayName,omitempty"` - AlertLink *string `json:"alertLink,omitempty"` - AlertType *string `json:"alertType,omitempty"` - CompromisedEntity *string `json:"compromisedEntity,omitempty"` - ConfidenceLevel *ConfidenceLevel `json:"confidenceLevel,omitempty"` - ConfidenceReasons *[]SecurityAlertPropertiesConfidenceReasonsInlined `json:"confidenceReasons,omitempty"` - ConfidenceScore *float64 `json:"confidenceScore,omitempty"` - ConfidenceScoreStatus *ConfidenceScoreStatus `json:"confidenceScoreStatus,omitempty"` - Description *string `json:"description,omitempty"` - EndTimeUtc *string `json:"endTimeUtc,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - Intent *KillChainIntent `json:"intent,omitempty"` - ProcessingEndTime *string `json:"processingEndTime,omitempty"` - ProductComponentName *string `json:"productComponentName,omitempty"` - ProductName *string `json:"productName,omitempty"` - ProductVersion *string `json:"productVersion,omitempty"` - ProviderAlertId *string `json:"providerAlertId,omitempty"` - RemediationSteps *[]string `json:"remediationSteps,omitempty"` - ResourceIdentifiers *[]interface{} `json:"resourceIdentifiers,omitempty"` - Severity *AlertSeverity `json:"severity,omitempty"` - StartTimeUtc *string `json:"startTimeUtc,omitempty"` - Status *AlertStatus `json:"status,omitempty"` - SystemAlertId *string `json:"systemAlertId,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` - TimeGenerated *string `json:"timeGenerated,omitempty"` - VendorName *string `json:"vendorName,omitempty"` -} - -func (o *SecurityAlertProperties) GetEndTimeUtcAsTime() (*time.Time, error) { - if o.EndTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.EndTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetEndTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.EndTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetProcessingEndTimeAsTime() (*time.Time, error) { - if o.ProcessingEndTime == nil { - return nil, nil - } - return dates.ParseAsFormat(o.ProcessingEndTime, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetProcessingEndTimeAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.ProcessingEndTime = &formatted -} - -func (o *SecurityAlertProperties) GetStartTimeUtcAsTime() (*time.Time, error) { - if o.StartTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.StartTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetStartTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.StartTimeUtc = &formatted -} - -func (o *SecurityAlertProperties) GetTimeGeneratedAsTime() (*time.Time, error) { - if o.TimeGenerated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.TimeGenerated, "2006-01-02T15:04:05Z07:00") -} - -func (o *SecurityAlertProperties) SetTimeGeneratedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.TimeGenerated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go deleted file mode 100644 index 8f8651c6ef8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_securityalertpropertiesconfidencereasonsinlined.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SecurityAlertPropertiesConfidenceReasonsInlined struct { - Reason *string `json:"reason,omitempty"` - ReasonType *string `json:"reasonType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/incidententities/model_userinfo.go deleted file mode 100644 index 3faed5bd1cf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package incidententities - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidententities/version.go b/resource-manager/securityinsights/2022-08-01/incidententities/version.go deleted file mode 100644 index 7d92eb9dadc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidententities/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidententities - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidententities/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/README.md b/resource-manager/securityinsights/2022-08-01/incidentrelations/README.md deleted file mode 100644 index 48f80f633a8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidentrelations` Documentation - -The `incidentrelations` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/incidentrelations" -``` - - -### Client Initialization - -```go -client := incidentrelations.NewIncidentRelationsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentRelationsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidentrelations.NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -payload := incidentrelations.Relation{ - // ... -} - - -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: `IncidentRelationsClient.Delete` - -```go -ctx := context.TODO() -id := incidentrelations.NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -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: `IncidentRelationsClient.Get` - -```go -ctx := context.TODO() -id := incidentrelations.NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - -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: `IncidentRelationsClient.List` - -```go -ctx := context.TODO() -id := incidentrelations.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -// alternatively `client.List(ctx, id, incidentrelations.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidentrelations.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/client.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/client.go deleted file mode 100644 index 4e8fbfeb71d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidentrelations - -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 IncidentRelationsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentRelationsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentRelationsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidentrelations", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentRelationsClient: %+v", err) - } - - return &IncidentRelationsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident.go deleted file mode 100644 index 5fd6ef03d73..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidentrelations - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident_test.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident_test.go deleted file mode 100644 index 6b45b36072f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidentrelations - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-08-01/incidentrelations/id_relation.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation.go deleted file mode 100644 index e268009b90c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation.go +++ /dev/null @@ -1,150 +0,0 @@ -package incidentrelations - -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(&RelationId{}) -} - -var _ resourceids.ResourceId = &RelationId{} - -// RelationId is a struct representing the Resource ID for a Relation -type RelationId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string - RelationName string -} - -// NewRelationID returns a new RelationId struct -func NewRelationID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string, relationName string) RelationId { - return RelationId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - RelationName: relationName, - } -} - -// ParseRelationID parses 'input' into a RelationId -func ParseRelationID(input string) (*RelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&RelationId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseRelationIDInsensitively parses 'input' case-insensitively into a RelationId -// note: this method should only be used for API response data and not user input -func ParseRelationIDInsensitively(input string) (*RelationId, error) { - parser := resourceids.NewParserFromResourceIdType(&RelationId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := RelationId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *RelationId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - if id.RelationName, ok = input.Parsed["relationName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "relationName", input) - } - - return nil -} - -// ValidateRelationID checks that 'input' can be parsed as a Relation ID -func ValidateRelationID(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 := ParseRelationID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Relation ID -func (id RelationId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s/relations/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId, id.RelationName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Relation ID -func (id RelationId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - resourceids.StaticSegment("staticRelations", "relations", "relations"), - resourceids.UserSpecifiedSegment("relationName", "relationValue"), - } -} - -// String returns a human-readable description of this Relation ID -func (id RelationId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - fmt.Sprintf("Relation Name: %q", id.RelationName), - } - return fmt.Sprintf("Relation (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation_test.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation_test.go deleted file mode 100644 index e173458c170..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/id_relation_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package incidentrelations - -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 = &RelationId{} - -func TestNewRelationID(t *testing.T) { - id := NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } - - if id.RelationName != "relationValue" { - t.Fatalf("Expected %q but got %q for Segment 'RelationName'", id.RelationName, "relationValue") - } -} - -func TestFormatRelationID(t *testing.T) { - actual := NewRelationID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue", "relationValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseRelationID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRelationID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestParseRelationIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *RelationId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - RelationName: "relationValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/relations/relationValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs/rElAtIoNvAlUe", - Expected: &RelationId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - RelationName: "rElAtIoNvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/rElAtIoNs/rElAtIoNvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseRelationIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - if actual.RelationName != v.Expected.RelationName { - t.Fatalf("Expected %q but got %q for RelationName", v.Expected.RelationName, actual.RelationName) - } - - } -} - -func TestSegmentsForRelationId(t *testing.T) { - segments := RelationId{}.Segments() - if len(segments) == 0 { - t.Fatalf("RelationId 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/securityinsights/2022-08-01/incidentrelations/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/method_createorupdate.go deleted file mode 100644 index 30fcaa14a14..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidentrelations - -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 *Relation -} - -// CreateOrUpdate ... -func (c IncidentRelationsClient) CreateOrUpdate(ctx context.Context, id RelationId, input Relation) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/method_delete.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/method_delete.go deleted file mode 100644 index de3afbf47c9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidentrelations - -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 IncidentRelationsClient) Delete(ctx context.Context, id RelationId) (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/securityinsights/2022-08-01/incidentrelations/method_get.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/method_get.go deleted file mode 100644 index 70bd3924ffc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidentrelations - -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 *Relation -} - -// Get ... -func (c IncidentRelationsClient) Get(ctx context.Context, id RelationId) (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 Relation - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/method_list.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/method_list.go deleted file mode 100644 index 80873d441b4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidentrelations - -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 *[]Relation -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Relation -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentRelationsClient) List(ctx context.Context, id IncidentId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/relations", id.ID()), - OptionsObject: options, - } - - 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 *[]Relation `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 IncidentRelationsClient) ListComplete(ctx context.Context, id IncidentId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, RelationOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentRelationsClient) ListCompleteMatchingPredicate(ctx context.Context, id IncidentId, options ListOperationOptions, predicate RelationOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Relation, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-08-01/incidentrelations/model_relation.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/model_relation.go deleted file mode 100644 index 39b27ed1036..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/model_relation.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidentrelations - -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 Relation struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *RelationProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/model_relationproperties.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/model_relationproperties.go deleted file mode 100644 index b514fd1661e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/model_relationproperties.go +++ /dev/null @@ -1,11 +0,0 @@ -package incidentrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationProperties struct { - RelatedResourceId string `json:"relatedResourceId"` - RelatedResourceKind *string `json:"relatedResourceKind,omitempty"` - RelatedResourceName *string `json:"relatedResourceName,omitempty"` - RelatedResourceType *string `json:"relatedResourceType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidentrelations/predicates.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/predicates.go deleted file mode 100644 index 35c3a9c1e3a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidentrelations - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type RelationOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p RelationOperationPredicate) Matches(input Relation) 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.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/securityinsights/2022-08-01/incidentrelations/version.go b/resource-manager/securityinsights/2022-08-01/incidentrelations/version.go deleted file mode 100644 index 95794f70d3f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidentrelations/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidentrelations - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidentrelations/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/README.md b/resource-manager/securityinsights/2022-08-01/incidents/README.md deleted file mode 100644 index 52319e9c4c8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/incidents` Documentation - -The `incidents` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/incidents" -``` - - -### Client Initialization - -```go -client := incidents.NewIncidentsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `IncidentsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -payload := incidents.Incident{ - // ... -} - - -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: `IncidentsClient.Delete` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -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: `IncidentsClient.Get` - -```go -ctx := context.TODO() -id := incidents.NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - -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: `IncidentsClient.List` - -```go -ctx := context.TODO() -id := incidents.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.List(ctx, id, incidents.DefaultListOperationOptions())` can be used to do batched pagination -items, err := client.ListComplete(ctx, id, incidents.DefaultListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-08-01/incidents/client.go b/resource-manager/securityinsights/2022-08-01/incidents/client.go deleted file mode 100644 index aaf38071c39..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package incidents - -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 IncidentsClient struct { - Client *resourcemanager.Client -} - -func NewIncidentsClientWithBaseURI(sdkApi sdkEnv.Api) (*IncidentsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "incidents", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating IncidentsClient: %+v", err) - } - - return &IncidentsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/constants.go b/resource-manager/securityinsights/2022-08-01/incidents/constants.go deleted file mode 100644 index ce046b9edba..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/constants.go +++ /dev/null @@ -1,366 +0,0 @@ -package incidents - -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 AttackTactic string - -const ( - AttackTacticCollection AttackTactic = "Collection" - AttackTacticCommandAndControl AttackTactic = "CommandAndControl" - AttackTacticCredentialAccess AttackTactic = "CredentialAccess" - AttackTacticDefenseEvasion AttackTactic = "DefenseEvasion" - AttackTacticDiscovery AttackTactic = "Discovery" - AttackTacticExecution AttackTactic = "Execution" - AttackTacticExfiltration AttackTactic = "Exfiltration" - AttackTacticImpact AttackTactic = "Impact" - AttackTacticImpairProcessControl AttackTactic = "ImpairProcessControl" - AttackTacticInhibitResponseFunction AttackTactic = "InhibitResponseFunction" - AttackTacticInitialAccess AttackTactic = "InitialAccess" - AttackTacticLateralMovement AttackTactic = "LateralMovement" - AttackTacticPersistence AttackTactic = "Persistence" - AttackTacticPreAttack AttackTactic = "PreAttack" - AttackTacticPrivilegeEscalation AttackTactic = "PrivilegeEscalation" - AttackTacticReconnaissance AttackTactic = "Reconnaissance" - AttackTacticResourceDevelopment AttackTactic = "ResourceDevelopment" -) - -func PossibleValuesForAttackTactic() []string { - return []string{ - string(AttackTacticCollection), - string(AttackTacticCommandAndControl), - string(AttackTacticCredentialAccess), - string(AttackTacticDefenseEvasion), - string(AttackTacticDiscovery), - string(AttackTacticExecution), - string(AttackTacticExfiltration), - string(AttackTacticImpact), - string(AttackTacticImpairProcessControl), - string(AttackTacticInhibitResponseFunction), - string(AttackTacticInitialAccess), - string(AttackTacticLateralMovement), - string(AttackTacticPersistence), - string(AttackTacticPreAttack), - string(AttackTacticPrivilegeEscalation), - string(AttackTacticReconnaissance), - string(AttackTacticResourceDevelopment), - } -} - -func (s *AttackTactic) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseAttackTactic(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseAttackTactic(input string) (*AttackTactic, error) { - vals := map[string]AttackTactic{ - "collection": AttackTacticCollection, - "commandandcontrol": AttackTacticCommandAndControl, - "credentialaccess": AttackTacticCredentialAccess, - "defenseevasion": AttackTacticDefenseEvasion, - "discovery": AttackTacticDiscovery, - "execution": AttackTacticExecution, - "exfiltration": AttackTacticExfiltration, - "impact": AttackTacticImpact, - "impairprocesscontrol": AttackTacticImpairProcessControl, - "inhibitresponsefunction": AttackTacticInhibitResponseFunction, - "initialaccess": AttackTacticInitialAccess, - "lateralmovement": AttackTacticLateralMovement, - "persistence": AttackTacticPersistence, - "preattack": AttackTacticPreAttack, - "privilegeescalation": AttackTacticPrivilegeEscalation, - "reconnaissance": AttackTacticReconnaissance, - "resourcedevelopment": AttackTacticResourceDevelopment, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := AttackTactic(input) - return &out, nil -} - -type IncidentClassification string - -const ( - IncidentClassificationBenignPositive IncidentClassification = "BenignPositive" - IncidentClassificationFalsePositive IncidentClassification = "FalsePositive" - IncidentClassificationTruePositive IncidentClassification = "TruePositive" - IncidentClassificationUndetermined IncidentClassification = "Undetermined" -) - -func PossibleValuesForIncidentClassification() []string { - return []string{ - string(IncidentClassificationBenignPositive), - string(IncidentClassificationFalsePositive), - string(IncidentClassificationTruePositive), - string(IncidentClassificationUndetermined), - } -} - -func (s *IncidentClassification) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassification(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassification(input string) (*IncidentClassification, error) { - vals := map[string]IncidentClassification{ - "benignpositive": IncidentClassificationBenignPositive, - "falsepositive": IncidentClassificationFalsePositive, - "truepositive": IncidentClassificationTruePositive, - "undetermined": IncidentClassificationUndetermined, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassification(input) - return &out, nil -} - -type IncidentClassificationReason string - -const ( - IncidentClassificationReasonInaccurateData IncidentClassificationReason = "InaccurateData" - IncidentClassificationReasonIncorrectAlertLogic IncidentClassificationReason = "IncorrectAlertLogic" - IncidentClassificationReasonSuspiciousActivity IncidentClassificationReason = "SuspiciousActivity" - IncidentClassificationReasonSuspiciousButExpected IncidentClassificationReason = "SuspiciousButExpected" -) - -func PossibleValuesForIncidentClassificationReason() []string { - return []string{ - string(IncidentClassificationReasonInaccurateData), - string(IncidentClassificationReasonIncorrectAlertLogic), - string(IncidentClassificationReasonSuspiciousActivity), - string(IncidentClassificationReasonSuspiciousButExpected), - } -} - -func (s *IncidentClassificationReason) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentClassificationReason(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentClassificationReason(input string) (*IncidentClassificationReason, error) { - vals := map[string]IncidentClassificationReason{ - "inaccuratedata": IncidentClassificationReasonInaccurateData, - "incorrectalertlogic": IncidentClassificationReasonIncorrectAlertLogic, - "suspiciousactivity": IncidentClassificationReasonSuspiciousActivity, - "suspiciousbutexpected": IncidentClassificationReasonSuspiciousButExpected, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentClassificationReason(input) - return &out, nil -} - -type IncidentLabelType string - -const ( - IncidentLabelTypeAutoAssigned IncidentLabelType = "AutoAssigned" - IncidentLabelTypeUser IncidentLabelType = "User" -) - -func PossibleValuesForIncidentLabelType() []string { - return []string{ - string(IncidentLabelTypeAutoAssigned), - string(IncidentLabelTypeUser), - } -} - -func (s *IncidentLabelType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentLabelType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentLabelType(input string) (*IncidentLabelType, error) { - vals := map[string]IncidentLabelType{ - "autoassigned": IncidentLabelTypeAutoAssigned, - "user": IncidentLabelTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentLabelType(input) - return &out, nil -} - -type IncidentSeverity string - -const ( - IncidentSeverityHigh IncidentSeverity = "High" - IncidentSeverityInformational IncidentSeverity = "Informational" - IncidentSeverityLow IncidentSeverity = "Low" - IncidentSeverityMedium IncidentSeverity = "Medium" -) - -func PossibleValuesForIncidentSeverity() []string { - return []string{ - string(IncidentSeverityHigh), - string(IncidentSeverityInformational), - string(IncidentSeverityLow), - string(IncidentSeverityMedium), - } -} - -func (s *IncidentSeverity) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentSeverity(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentSeverity(input string) (*IncidentSeverity, error) { - vals := map[string]IncidentSeverity{ - "high": IncidentSeverityHigh, - "informational": IncidentSeverityInformational, - "low": IncidentSeverityLow, - "medium": IncidentSeverityMedium, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentSeverity(input) - return &out, nil -} - -type IncidentStatus string - -const ( - IncidentStatusActive IncidentStatus = "Active" - IncidentStatusClosed IncidentStatus = "Closed" - IncidentStatusNew IncidentStatus = "New" -) - -func PossibleValuesForIncidentStatus() []string { - return []string{ - string(IncidentStatusActive), - string(IncidentStatusClosed), - string(IncidentStatusNew), - } -} - -func (s *IncidentStatus) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseIncidentStatus(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseIncidentStatus(input string) (*IncidentStatus, error) { - vals := map[string]IncidentStatus{ - "active": IncidentStatusActive, - "closed": IncidentStatusClosed, - "new": IncidentStatusNew, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := IncidentStatus(input) - return &out, nil -} - -type OwnerType string - -const ( - OwnerTypeGroup OwnerType = "Group" - OwnerTypeUnknown OwnerType = "Unknown" - OwnerTypeUser OwnerType = "User" -) - -func PossibleValuesForOwnerType() []string { - return []string{ - string(OwnerTypeGroup), - string(OwnerTypeUnknown), - string(OwnerTypeUser), - } -} - -func (s *OwnerType) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseOwnerType(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseOwnerType(input string) (*OwnerType, error) { - vals := map[string]OwnerType{ - "group": OwnerTypeGroup, - "unknown": OwnerTypeUnknown, - "user": OwnerTypeUser, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := OwnerType(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/id_incident.go b/resource-manager/securityinsights/2022-08-01/incidents/id_incident.go deleted file mode 100644 index d2a0fefd3dd..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/id_incident.go +++ /dev/null @@ -1,141 +0,0 @@ -package incidents - -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(&IncidentId{}) -} - -var _ resourceids.ResourceId = &IncidentId{} - -// IncidentId is a struct representing the Resource ID for a Incident -type IncidentId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IncidentId string -} - -// NewIncidentID returns a new IncidentId struct -func NewIncidentID(subscriptionId string, resourceGroupName string, workspaceName string, incidentId string) IncidentId { - return IncidentId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IncidentId: incidentId, - } -} - -// ParseIncidentID parses 'input' into a IncidentId -func ParseIncidentID(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIncidentIDInsensitively parses 'input' case-insensitively into a IncidentId -// note: this method should only be used for API response data and not user input -func ParseIncidentIDInsensitively(input string) (*IncidentId, error) { - parser := resourceids.NewParserFromResourceIdType(&IncidentId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IncidentId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IncidentId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IncidentId, ok = input.Parsed["incidentId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "incidentId", input) - } - - return nil -} - -// ValidateIncidentID checks that 'input' can be parsed as a Incident ID -func ValidateIncidentID(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 := ParseIncidentID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Incident ID -func (id IncidentId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/incidents/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IncidentId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Incident ID -func (id IncidentId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticIncidents", "incidents", "incidents"), - resourceids.UserSpecifiedSegment("incidentId", "incidentIdValue"), - } -} - -// String returns a human-readable description of this Incident ID -func (id IncidentId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Incident: %q", id.IncidentId), - } - return fmt.Sprintf("Incident (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/id_incident_test.go b/resource-manager/securityinsights/2022-08-01/incidents/id_incident_test.go deleted file mode 100644 index 415bc774655..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/id_incident_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package incidents - -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 = &IncidentId{} - -func TestNewIncidentID(t *testing.T) { - id := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IncidentId != "incidentIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'IncidentId'", id.IncidentId, "incidentIdValue") - } -} - -func TestFormatIncidentID(t *testing.T) { - actual := NewIncidentID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "incidentIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIncidentID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestParseIncidentIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IncidentId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IncidentId: "incidentIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/incidents/incidentIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe", - Expected: &IncidentId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IncidentId: "iNcIdEnTiDvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/iNcIdEnTs/iNcIdEnTiDvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIncidentIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IncidentId != v.Expected.IncidentId { - t.Fatalf("Expected %q but got %q for IncidentId", v.Expected.IncidentId, actual.IncidentId) - } - - } -} - -func TestSegmentsForIncidentId(t *testing.T) { - segments := IncidentId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IncidentId 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/securityinsights/2022-08-01/incidents/id_workspace.go b/resource-manager/securityinsights/2022-08-01/incidents/id_workspace.go deleted file mode 100644 index 9667e33b904..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package incidents - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/incidents/id_workspace_test.go deleted file mode 100644 index 13cbb1918fc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package incidents - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/incidents/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/incidents/method_createorupdate.go deleted file mode 100644 index fc09e8a1cba..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package incidents - -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 *Incident -} - -// CreateOrUpdate ... -func (c IncidentsClient) CreateOrUpdate(ctx context.Context, id IncidentId, input Incident) (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 Incident - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/method_delete.go b/resource-manager/securityinsights/2022-08-01/incidents/method_delete.go deleted file mode 100644 index 9b3205af5fc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package incidents - -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 IncidentsClient) Delete(ctx context.Context, id IncidentId) (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/securityinsights/2022-08-01/incidents/method_get.go b/resource-manager/securityinsights/2022-08-01/incidents/method_get.go deleted file mode 100644 index c67e0bb22b8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package incidents - -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 *Incident -} - -// Get ... -func (c IncidentsClient) Get(ctx context.Context, id IncidentId) (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 Incident - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/method_list.go b/resource-manager/securityinsights/2022-08-01/incidents/method_list.go deleted file mode 100644 index fe19cd4d9ff..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/method_list.go +++ /dev/null @@ -1,127 +0,0 @@ -package incidents - -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 *[]Incident -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Incident -} - -type ListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultListOperationOptions() ListOperationOptions { - return ListOperationOptions{} -} - -func (o ListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o ListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o ListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// List ... -func (c IncidentsClient) List(ctx context.Context, id WorkspaceId, options ListOperationOptions) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/incidents", id.ID()), - OptionsObject: options, - } - - 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 *[]Incident `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 IncidentsClient) ListComplete(ctx context.Context, id WorkspaceId, options ListOperationOptions) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, options, IncidentOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c IncidentsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options ListOperationOptions, predicate IncidentOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Incident, 0) - - resp, err := c.List(ctx, id, options) - if err != nil { - 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/securityinsights/2022-08-01/incidents/model_incident.go b/resource-manager/securityinsights/2022-08-01/incidents/model_incident.go deleted file mode 100644 index 0c560cabced..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/model_incident.go +++ /dev/null @@ -1,17 +0,0 @@ -package incidents - -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 Incident struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *IncidentProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentadditionaldata.go b/resource-manager/securityinsights/2022-08-01/incidents/model_incidentadditionaldata.go deleted file mode 100644 index 7a7852f83f7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentadditionaldata.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentAdditionalData struct { - AlertProductNames *[]string `json:"alertProductNames,omitempty"` - AlertsCount *int64 `json:"alertsCount,omitempty"` - BookmarksCount *int64 `json:"bookmarksCount,omitempty"` - CommentsCount *int64 `json:"commentsCount,omitempty"` - Tactics *[]AttackTactic `json:"tactics,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentlabel.go b/resource-manager/securityinsights/2022-08-01/incidents/model_incidentlabel.go deleted file mode 100644 index 706eeaa7686..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentlabel.go +++ /dev/null @@ -1,9 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentLabel struct { - LabelName string `json:"labelName"` - LabelType *IncidentLabelType `json:"labelType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentownerinfo.go b/resource-manager/securityinsights/2022-08-01/incidents/model_incidentownerinfo.go deleted file mode 100644 index f77549efb11..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentownerinfo.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOwnerInfo struct { - AssignedTo *string `json:"assignedTo,omitempty"` - Email *string `json:"email,omitempty"` - ObjectId *string `json:"objectId,omitempty"` - OwnerType *OwnerType `json:"ownerType,omitempty"` - UserPrincipalName *string `json:"userPrincipalName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentproperties.go b/resource-manager/securityinsights/2022-08-01/incidents/model_incidentproperties.go deleted file mode 100644 index 1a910a42d0d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/model_incidentproperties.go +++ /dev/null @@ -1,78 +0,0 @@ -package incidents - -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 IncidentProperties struct { - AdditionalData *IncidentAdditionalData `json:"additionalData,omitempty"` - Classification *IncidentClassification `json:"classification,omitempty"` - ClassificationComment *string `json:"classificationComment,omitempty"` - ClassificationReason *IncidentClassificationReason `json:"classificationReason,omitempty"` - CreatedTimeUtc *string `json:"createdTimeUtc,omitempty"` - Description *string `json:"description,omitempty"` - FirstActivityTimeUtc *string `json:"firstActivityTimeUtc,omitempty"` - IncidentNumber *int64 `json:"incidentNumber,omitempty"` - IncidentUrl *string `json:"incidentUrl,omitempty"` - Labels *[]IncidentLabel `json:"labels,omitempty"` - LastActivityTimeUtc *string `json:"lastActivityTimeUtc,omitempty"` - LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` - Owner *IncidentOwnerInfo `json:"owner,omitempty"` - RelatedAnalyticRuleIds *[]string `json:"relatedAnalyticRuleIds,omitempty"` - Severity IncidentSeverity `json:"severity"` - Status IncidentStatus `json:"status"` - Title string `json:"title"` -} - -func (o *IncidentProperties) GetCreatedTimeUtcAsTime() (*time.Time, error) { - if o.CreatedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.CreatedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetCreatedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.CreatedTimeUtc = &formatted -} - -func (o *IncidentProperties) GetFirstActivityTimeUtcAsTime() (*time.Time, error) { - if o.FirstActivityTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.FirstActivityTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetFirstActivityTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.FirstActivityTimeUtc = &formatted -} - -func (o *IncidentProperties) GetLastActivityTimeUtcAsTime() (*time.Time, error) { - if o.LastActivityTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastActivityTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetLastActivityTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastActivityTimeUtc = &formatted -} - -func (o *IncidentProperties) GetLastModifiedTimeUtcAsTime() (*time.Time, error) { - if o.LastModifiedTimeUtc == nil { - return nil, nil - } - return dates.ParseAsFormat(o.LastModifiedTimeUtc, "2006-01-02T15:04:05Z07:00") -} - -func (o *IncidentProperties) SetLastModifiedTimeUtcAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.LastModifiedTimeUtc = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/incidents/predicates.go b/resource-manager/securityinsights/2022-08-01/incidents/predicates.go deleted file mode 100644 index 6d4cc3da0be..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package incidents - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type IncidentOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p IncidentOperationPredicate) Matches(input Incident) 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.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/securityinsights/2022-08-01/incidents/version.go b/resource-manager/securityinsights/2022-08-01/incidents/version.go deleted file mode 100644 index 761b0dc84a1..00000000000 --- a/resource-manager/securityinsights/2022-08-01/incidents/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package incidents - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/incidents/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/README.md b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/README.md deleted file mode 100644 index 20f5e134bf9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/README.md +++ /dev/null @@ -1,89 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates` Documentation - -The `sentinelonboardingstates` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/sentinelonboardingstates" -``` - - -### Client Initialization - -```go -client := sentinelonboardingstates.NewSentinelOnboardingStatesClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `SentinelOnboardingStatesClient.Create` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -payload := sentinelonboardingstates.SentinelOnboardingState{ - // ... -} - - -read, err := client.Create(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `SentinelOnboardingStatesClient.Delete` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -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: `SentinelOnboardingStatesClient.Get` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - -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: `SentinelOnboardingStatesClient.List` - -```go -ctx := context.TODO() -id := sentinelonboardingstates.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -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/securityinsights/2022-08-01/sentinelonboardingstates/client.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/client.go deleted file mode 100644 index 94701ed853a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingStatesClient struct { - Client *resourcemanager.Client -} - -func NewSentinelOnboardingStatesClientWithBaseURI(sdkApi sdkEnv.Api) (*SentinelOnboardingStatesClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "sentinelonboardingstates", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating SentinelOnboardingStatesClient: %+v", err) - } - - return &SentinelOnboardingStatesClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate.go deleted file mode 100644 index a0b15d704d4..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate.go +++ /dev/null @@ -1,141 +0,0 @@ -package sentinelonboardingstates - -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(&OnboardingStateId{}) -} - -var _ resourceids.ResourceId = &OnboardingStateId{} - -// OnboardingStateId is a struct representing the Resource ID for a Onboarding State -type OnboardingStateId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - OnboardingStateName string -} - -// NewOnboardingStateID returns a new OnboardingStateId struct -func NewOnboardingStateID(subscriptionId string, resourceGroupName string, workspaceName string, onboardingStateName string) OnboardingStateId { - return OnboardingStateId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - OnboardingStateName: onboardingStateName, - } -} - -// ParseOnboardingStateID parses 'input' into a OnboardingStateId -func ParseOnboardingStateID(input string) (*OnboardingStateId, error) { - parser := resourceids.NewParserFromResourceIdType(&OnboardingStateId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OnboardingStateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseOnboardingStateIDInsensitively parses 'input' case-insensitively into a OnboardingStateId -// note: this method should only be used for API response data and not user input -func ParseOnboardingStateIDInsensitively(input string) (*OnboardingStateId, error) { - parser := resourceids.NewParserFromResourceIdType(&OnboardingStateId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := OnboardingStateId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *OnboardingStateId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.OnboardingStateName, ok = input.Parsed["onboardingStateName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "onboardingStateName", input) - } - - return nil -} - -// ValidateOnboardingStateID checks that 'input' can be parsed as a Onboarding State ID -func ValidateOnboardingStateID(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 := ParseOnboardingStateID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Onboarding State ID -func (id OnboardingStateId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/onboardingStates/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.OnboardingStateName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Onboarding State ID -func (id OnboardingStateId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticOnboardingStates", "onboardingStates", "onboardingStates"), - resourceids.UserSpecifiedSegment("onboardingStateName", "onboardingStateValue"), - } -} - -// String returns a human-readable description of this Onboarding State ID -func (id OnboardingStateId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Onboarding State Name: %q", id.OnboardingStateName), - } - return fmt.Sprintf("Onboarding State (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate_test.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate_test.go deleted file mode 100644 index 2f1b37538f9..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_onboardingstate_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package sentinelonboardingstates - -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 = &OnboardingStateId{} - -func TestNewOnboardingStateID(t *testing.T) { - id := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.OnboardingStateName != "onboardingStateValue" { - t.Fatalf("Expected %q but got %q for Segment 'OnboardingStateName'", id.OnboardingStateName, "onboardingStateValue") - } -} - -func TestFormatOnboardingStateID(t *testing.T) { - actual := NewOnboardingStateID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "onboardingStateValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseOnboardingStateID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OnboardingStateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - OnboardingStateName: "onboardingStateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOnboardingStateID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.OnboardingStateName != v.Expected.OnboardingStateName { - t.Fatalf("Expected %q but got %q for OnboardingStateName", v.Expected.OnboardingStateName, actual.OnboardingStateName) - } - - } -} - -func TestParseOnboardingStateIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *OnboardingStateId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - OnboardingStateName: "onboardingStateValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/onboardingStates/onboardingStateValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeVaLuE", - Expected: &OnboardingStateId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - OnboardingStateName: "oNbOaRdInGsTaTeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/oNbOaRdInGsTaTeS/oNbOaRdInGsTaTeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseOnboardingStateIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.OnboardingStateName != v.Expected.OnboardingStateName { - t.Fatalf("Expected %q but got %q for OnboardingStateName", v.Expected.OnboardingStateName, actual.OnboardingStateName) - } - - } -} - -func TestSegmentsForOnboardingStateId(t *testing.T) { - segments := OnboardingStateId{}.Segments() - if len(segments) == 0 { - t.Fatalf("OnboardingStateId 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/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace.go deleted file mode 100644 index 25f0d18c095..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package sentinelonboardingstates - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace_test.go deleted file mode 100644 index b50fc815542..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package sentinelonboardingstates - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/sentinelonboardingstates/method_create.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_create.go deleted file mode 100644 index be0336fbcee..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_create.go +++ /dev/null @@ -1,59 +0,0 @@ -package sentinelonboardingstates - -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 CreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *SentinelOnboardingState -} - -// Create ... -func (c SentinelOnboardingStatesClient) Create(ctx context.Context, id OnboardingStateId, input SentinelOnboardingState) (result CreateOperationResponse, 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 SentinelOnboardingState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_delete.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_delete.go deleted file mode 100644 index 1c6c5e372d7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingStatesClient) Delete(ctx context.Context, id OnboardingStateId) (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/securityinsights/2022-08-01/sentinelonboardingstates/method_get.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_get.go deleted file mode 100644 index e7b2c2cb86b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package sentinelonboardingstates - -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 *SentinelOnboardingState -} - -// Get ... -func (c SentinelOnboardingStatesClient) Get(ctx context.Context, id OnboardingStateId) (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 SentinelOnboardingState - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_list.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_list.go deleted file mode 100644 index d53893d7842..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/method_list.go +++ /dev/null @@ -1,55 +0,0 @@ -package sentinelonboardingstates - -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 *SentinelOnboardingStatesList -} - -// List ... -func (c SentinelOnboardingStatesClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/onboardingStates", 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 SentinelOnboardingStatesList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstate.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstate.go deleted file mode 100644 index c514c418596..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstate.go +++ /dev/null @@ -1,17 +0,0 @@ -package sentinelonboardingstates - -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 SentinelOnboardingState struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *SentinelOnboardingStateProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateproperties.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateproperties.go deleted file mode 100644 index 366f9e1623d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateproperties.go +++ /dev/null @@ -1,8 +0,0 @@ -package sentinelonboardingstates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SentinelOnboardingStateProperties struct { - CustomerManagedKey *bool `json:"customerManagedKey,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateslist.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateslist.go deleted file mode 100644 index e601995e41b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/model_sentinelonboardingstateslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package sentinelonboardingstates - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type SentinelOnboardingStatesList struct { - Value []SentinelOnboardingState `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/version.go b/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/version.go deleted file mode 100644 index 9e6f95adf28..00000000000 --- a/resource-manager/securityinsights/2022-08-01/sentinelonboardingstates/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package sentinelonboardingstates - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/sentinelonboardingstates/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/README.md b/resource-manager/securityinsights/2022-08-01/threatintelligence/README.md deleted file mode 100644 index 814616f1b8a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/README.md +++ /dev/null @@ -1,191 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/threatintelligence` Documentation - -The `threatintelligence` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/threatintelligence" -``` - - -### Client Initialization - -```go -client := threatintelligence.NewThreatIntelligenceClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorAppendTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceAppendTags{ - // ... -} - - -read, err := client.IndicatorAppendTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreate` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorCreate(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorCreateIndicator` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorCreateIndicator(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorDelete` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorDelete(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorGet` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -read, err := client.IndicatorGet(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorMetricsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -read, err := client.IndicatorMetricsList(ctx, id) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorQueryIndicators` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -payload := threatintelligence.ThreatIntelligenceFilteringCriteria{ - // ... -} - - -// alternatively `client.IndicatorQueryIndicators(ctx, id, payload)` can be used to do batched pagination -items, err := client.IndicatorQueryIndicatorsComplete(ctx, id, payload) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorReplaceTags` - -```go -ctx := context.TODO() -id := threatintelligence.NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - -payload := threatintelligence.ThreatIntelligenceIndicatorModel{ - // ... -} - - -read, err := client.IndicatorReplaceTags(ctx, id, payload) -if err != nil { - // handle the error -} -if model := read.Model; model != nil { - // do something with the model/response object -} -``` - - -### Example Usage: `ThreatIntelligenceClient.IndicatorsList` - -```go -ctx := context.TODO() -id := threatintelligence.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// alternatively `client.IndicatorsList(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions())` can be used to do batched pagination -items, err := client.IndicatorsListComplete(ctx, id, threatintelligence.DefaultIndicatorsListOperationOptions()) -if err != nil { - // handle the error -} -for _, item := range items { - // do something -} -``` diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/client.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/client.go deleted file mode 100644 index edf96c3143f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceClient struct { - Client *resourcemanager.Client -} - -func NewThreatIntelligenceClientWithBaseURI(sdkApi sdkEnv.Api) (*ThreatIntelligenceClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "threatintelligence", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating ThreatIntelligenceClient: %+v", err) - } - - return &ThreatIntelligenceClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/constants.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/constants.go deleted file mode 100644 index 8cef3ba3f75..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/constants.go +++ /dev/null @@ -1,92 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceResourceInnerKind string - -const ( - ThreatIntelligenceResourceInnerKindIndicator ThreatIntelligenceResourceInnerKind = "indicator" -) - -func PossibleValuesForThreatIntelligenceResourceInnerKind() []string { - return []string{ - string(ThreatIntelligenceResourceInnerKindIndicator), - } -} - -func (s *ThreatIntelligenceResourceInnerKind) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseThreatIntelligenceResourceInnerKind(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseThreatIntelligenceResourceInnerKind(input string) (*ThreatIntelligenceResourceInnerKind, error) { - vals := map[string]ThreatIntelligenceResourceInnerKind{ - "indicator": ThreatIntelligenceResourceInnerKindIndicator, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceResourceInnerKind(input) - return &out, nil -} - -type ThreatIntelligenceSortingOrder string - -const ( - ThreatIntelligenceSortingOrderAscending ThreatIntelligenceSortingOrder = "ascending" - ThreatIntelligenceSortingOrderDescending ThreatIntelligenceSortingOrder = "descending" - ThreatIntelligenceSortingOrderUnsorted ThreatIntelligenceSortingOrder = "unsorted" -) - -func PossibleValuesForThreatIntelligenceSortingOrder() []string { - return []string{ - string(ThreatIntelligenceSortingOrderAscending), - string(ThreatIntelligenceSortingOrderDescending), - string(ThreatIntelligenceSortingOrderUnsorted), - } -} - -func (s *ThreatIntelligenceSortingOrder) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseThreatIntelligenceSortingOrder(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseThreatIntelligenceSortingOrder(input string) (*ThreatIntelligenceSortingOrder, error) { - vals := map[string]ThreatIntelligenceSortingOrder{ - "ascending": ThreatIntelligenceSortingOrderAscending, - "descending": ThreatIntelligenceSortingOrderDescending, - "unsorted": ThreatIntelligenceSortingOrderUnsorted, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := ThreatIntelligenceSortingOrder(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator.go deleted file mode 100644 index 73373ce2134..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator.go +++ /dev/null @@ -1,143 +0,0 @@ -package threatintelligence - -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(&IndicatorId{}) -} - -var _ resourceids.ResourceId = &IndicatorId{} - -// IndicatorId is a struct representing the Resource ID for a Indicator -type IndicatorId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - IndicatorName string -} - -// NewIndicatorID returns a new IndicatorId struct -func NewIndicatorID(subscriptionId string, resourceGroupName string, workspaceName string, indicatorName string) IndicatorId { - return IndicatorId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - IndicatorName: indicatorName, - } -} - -// ParseIndicatorID parses 'input' into a IndicatorId -func ParseIndicatorID(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(&IndicatorId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IndicatorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseIndicatorIDInsensitively parses 'input' case-insensitively into a IndicatorId -// note: this method should only be used for API response data and not user input -func ParseIndicatorIDInsensitively(input string) (*IndicatorId, error) { - parser := resourceids.NewParserFromResourceIdType(&IndicatorId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := IndicatorId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *IndicatorId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.IndicatorName, ok = input.Parsed["indicatorName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "indicatorName", input) - } - - return nil -} - -// ValidateIndicatorID checks that 'input' can be parsed as a Indicator ID -func ValidateIndicatorID(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 := ParseIndicatorID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Indicator ID -func (id IndicatorId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.IndicatorName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Indicator ID -func (id IndicatorId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticThreatIntelligence", "threatIntelligence", "threatIntelligence"), - resourceids.StaticSegment("staticMain", "main", "main"), - resourceids.StaticSegment("staticIndicators", "indicators", "indicators"), - resourceids.UserSpecifiedSegment("indicatorName", "indicatorValue"), - } -} - -// String returns a human-readable description of this Indicator ID -func (id IndicatorId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Indicator Name: %q", id.IndicatorName), - } - return fmt.Sprintf("Indicator (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator_test.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator_test.go deleted file mode 100644 index 48751c131c7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_indicator_test.go +++ /dev/null @@ -1,387 +0,0 @@ -package threatintelligence - -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 = &IndicatorId{} - -func TestNewIndicatorID(t *testing.T) { - id := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.IndicatorName != "indicatorValue" { - t.Fatalf("Expected %q but got %q for Segment 'IndicatorName'", id.IndicatorName, "indicatorValue") - } -} - -func TestFormatIndicatorID(t *testing.T) { - actual := NewIndicatorID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "indicatorValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseIndicatorID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IndicatorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IndicatorName: "indicatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIndicatorID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IndicatorName != v.Expected.IndicatorName { - t.Fatalf("Expected %q but got %q for IndicatorName", v.Expected.IndicatorName, actual.IndicatorName) - } - - } -} - -func TestParseIndicatorIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *IndicatorId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - IndicatorName: "indicatorValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators/indicatorValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrVaLuE", - Expected: &IndicatorId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - IndicatorName: "iNdIcAtOrVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/tHrEaTiNtElLiGeNcE/mAiN/iNdIcAtOrS/iNdIcAtOrVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseIndicatorIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.IndicatorName != v.Expected.IndicatorName { - t.Fatalf("Expected %q but got %q for IndicatorName", v.Expected.IndicatorName, actual.IndicatorName) - } - - } -} - -func TestSegmentsForIndicatorId(t *testing.T) { - segments := IndicatorId{}.Segments() - if len(segments) == 0 { - t.Fatalf("IndicatorId 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/securityinsights/2022-08-01/threatintelligence/id_workspace.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace.go deleted file mode 100644 index 2265507abcf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package threatintelligence - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace_test.go deleted file mode 100644 index 6609c36a05b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package threatintelligence - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/threatintelligence/method_indicatorappendtags.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorappendtags.go deleted file mode 100644 index 4384327485d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorappendtags.go +++ /dev/null @@ -1,51 +0,0 @@ -package threatintelligence - -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 IndicatorAppendTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IndicatorAppendTags ... -func (c ThreatIntelligenceClient) IndicatorAppendTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceAppendTags) (result IndicatorAppendTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/appendTags", 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/securityinsights/2022-08-01/threatintelligence/method_indicatorcreate.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreate.go deleted file mode 100644 index 3cee598931c..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreate.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorCreateOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorCreate ... -func (c ThreatIntelligenceClient) IndicatorCreate(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreateindicator.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreateindicator.go deleted file mode 100644 index 0f3ab94c4f5..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorcreateindicator.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorCreateIndicatorOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorCreateIndicator ... -func (c ThreatIntelligenceClient) IndicatorCreateIndicator(ctx context.Context, id WorkspaceId, input ThreatIntelligenceIndicatorModel) (result IndicatorCreateIndicatorOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/createIndicator", 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatordelete.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatordelete.go deleted file mode 100644 index 4de264524d5..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatordelete.go +++ /dev/null @@ -1,47 +0,0 @@ -package threatintelligence - -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 IndicatorDeleteOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData -} - -// IndicatorDelete ... -func (c ThreatIntelligenceClient) IndicatorDelete(ctx context.Context, id IndicatorId) (result IndicatorDeleteOperationResponse, 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/securityinsights/2022-08-01/threatintelligence/method_indicatorget.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorget.go deleted file mode 100644 index 3358363f139..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorget.go +++ /dev/null @@ -1,58 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorGetOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorGet ... -func (c ThreatIntelligenceClient) IndicatorGet(ctx context.Context, id IndicatorId) (result IndicatorGetOperationResponse, 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatormetricslist.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatormetricslist.go deleted file mode 100644 index f692c803e50..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatormetricslist.go +++ /dev/null @@ -1,55 +0,0 @@ -package threatintelligence - -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 IndicatorMetricsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceMetricsList -} - -// IndicatorMetricsList ... -func (c ThreatIntelligenceClient) IndicatorMetricsList(ctx context.Context, id WorkspaceId) (result IndicatorMetricsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/metrics", 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 ThreatIntelligenceMetricsList - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorqueryindicators.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorqueryindicators.go deleted file mode 100644 index 8ce639f2623..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorqueryindicators.go +++ /dev/null @@ -1,103 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorQueryIndicatorsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ThreatIntelligenceInformation -} - -type IndicatorQueryIndicatorsCompleteResult struct { - LatestHttpResponse *http.Response - Items []ThreatIntelligenceInformation -} - -// IndicatorQueryIndicators ... -func (c ThreatIntelligenceClient) IndicatorQueryIndicators(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (result IndicatorQueryIndicatorsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/queryIndicators", 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]ThreatIntelligenceInformation, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// IndicatorQueryIndicatorsComplete retrieves all the results into a single object -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsComplete(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria) (IndicatorQueryIndicatorsCompleteResult, error) { - return c.IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx, id, input, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorQueryIndicatorsCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ThreatIntelligenceClient) IndicatorQueryIndicatorsCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, input ThreatIntelligenceFilteringCriteria, predicate ThreatIntelligenceInformationOperationPredicate) (result IndicatorQueryIndicatorsCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - resp, err := c.IndicatorQueryIndicators(ctx, id, input) - if err != nil { - 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 = IndicatorQueryIndicatorsCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorreplacetags.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorreplacetags.go deleted file mode 100644 index 052bbe7b66a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorreplacetags.go +++ /dev/null @@ -1,63 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorReplaceTagsOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *ThreatIntelligenceInformation -} - -// IndicatorReplaceTags ... -func (c ThreatIntelligenceClient) IndicatorReplaceTags(ctx context.Context, id IndicatorId, input ThreatIntelligenceIndicatorModel) (result IndicatorReplaceTagsOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodPost, - Path: fmt.Sprintf("%s/replaceTags", 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 respObj json.RawMessage - if err = resp.Unmarshal(&respObj); err != nil { - return - } - model, err := unmarshalThreatIntelligenceInformationImplementation(respObj) - if err != nil { - return - } - result.Model = &model - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorslist.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorslist.go deleted file mode 100644 index 860ecd26255..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/method_indicatorslist.go +++ /dev/null @@ -1,139 +0,0 @@ -package threatintelligence - -import ( - "context" - "encoding/json" - "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 IndicatorsListOperationResponse struct { - HttpResponse *http.Response - OData *odata.OData - Model *[]ThreatIntelligenceInformation -} - -type IndicatorsListCompleteResult struct { - LatestHttpResponse *http.Response - Items []ThreatIntelligenceInformation -} - -type IndicatorsListOperationOptions struct { - Filter *string - Orderby *string - Top *int64 -} - -func DefaultIndicatorsListOperationOptions() IndicatorsListOperationOptions { - return IndicatorsListOperationOptions{} -} - -func (o IndicatorsListOperationOptions) ToHeaders() *client.Headers { - out := client.Headers{} - - return &out -} - -func (o IndicatorsListOperationOptions) ToOData() *odata.Query { - out := odata.Query{} - return &out -} - -func (o IndicatorsListOperationOptions) ToQuery() *client.QueryParams { - out := client.QueryParams{} - if o.Filter != nil { - out.Append("$filter", fmt.Sprintf("%v", *o.Filter)) - } - if o.Orderby != nil { - out.Append("$orderby", fmt.Sprintf("%v", *o.Orderby)) - } - if o.Top != nil { - out.Append("$top", fmt.Sprintf("%v", *o.Top)) - } - return &out -} - -// IndicatorsList ... -func (c ThreatIntelligenceClient) IndicatorsList(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (result IndicatorsListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/threatIntelligence/main/indicators", id.ID()), - OptionsObject: options, - } - - 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 *[]json.RawMessage `json:"value"` - } - if err = resp.Unmarshal(&values); err != nil { - return - } - - temp := make([]ThreatIntelligenceInformation, 0) - if values.Values != nil { - for i, v := range *values.Values { - val, err := unmarshalThreatIntelligenceInformationImplementation(v) - if err != nil { - err = fmt.Errorf("unmarshalling item %d for ThreatIntelligenceInformation (%q): %+v", i, v, err) - return result, err - } - temp = append(temp, val) - } - } - result.Model = &temp - - return -} - -// IndicatorsListComplete retrieves all the results into a single object -func (c ThreatIntelligenceClient) IndicatorsListComplete(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions) (IndicatorsListCompleteResult, error) { - return c.IndicatorsListCompleteMatchingPredicate(ctx, id, options, ThreatIntelligenceInformationOperationPredicate{}) -} - -// IndicatorsListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c ThreatIntelligenceClient) IndicatorsListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, options IndicatorsListOperationOptions, predicate ThreatIntelligenceInformationOperationPredicate) (result IndicatorsListCompleteResult, err error) { - items := make([]ThreatIntelligenceInformation, 0) - - resp, err := c.IndicatorsList(ctx, id, options) - if err != nil { - 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 = IndicatorsListCompleteResult{ - LatestHttpResponse: resp.HttpResponse, - Items: items, - } - return -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceappendtags.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceappendtags.go deleted file mode 100644 index d864022037f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceappendtags.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceAppendTags struct { - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceexternalreference.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceexternalreference.go deleted file mode 100644 index 52978aae636..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceexternalreference.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceExternalReference struct { - Description *string `json:"description,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - Hashes *map[string]string `json:"hashes,omitempty"` - SourceName *string `json:"sourceName,omitempty"` - Url *string `json:"url,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencefilteringcriteria.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencefilteringcriteria.go deleted file mode 100644 index 181ef4790bf..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencefilteringcriteria.go +++ /dev/null @@ -1,20 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceFilteringCriteria struct { - Ids *[]string `json:"ids,omitempty"` - IncludeDisabled *bool `json:"includeDisabled,omitempty"` - Keywords *[]string `json:"keywords,omitempty"` - MaxConfidence *int64 `json:"maxConfidence,omitempty"` - MaxValidUntil *string `json:"maxValidUntil,omitempty"` - MinConfidence *int64 `json:"minConfidence,omitempty"` - MinValidUntil *string `json:"minValidUntil,omitempty"` - PageSize *int64 `json:"pageSize,omitempty"` - PatternTypes *[]string `json:"patternTypes,omitempty"` - SkipToken *string `json:"skipToken,omitempty"` - SortBy *[]ThreatIntelligenceSortingCriteria `json:"sortBy,omitempty"` - Sources *[]string `json:"sources,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go deleted file mode 100644 index f35c4df440d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencegranularmarkingmodel.go +++ /dev/null @@ -1,10 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceGranularMarkingModel struct { - Language *string `json:"language,omitempty"` - MarkingRef *int64 `json:"markingRef,omitempty"` - Selectors *[]string `json:"selectors,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatormodel.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatormodel.go deleted file mode 100644 index 9ee1b5778ed..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatormodel.go +++ /dev/null @@ -1,48 +0,0 @@ -package threatintelligence - -import ( - "encoding/json" - "fmt" - - "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. - -var _ ThreatIntelligenceInformation = ThreatIntelligenceIndicatorModel{} - -type ThreatIntelligenceIndicatorModel struct { - Properties *ThreatIntelligenceIndicatorProperties `json:"properties,omitempty"` - - // Fields inherited from ThreatIntelligenceInformation - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} - -var _ json.Marshaler = ThreatIntelligenceIndicatorModel{} - -func (s ThreatIntelligenceIndicatorModel) MarshalJSON() ([]byte, error) { - type wrapper ThreatIntelligenceIndicatorModel - wrapped := wrapper(s) - encoded, err := json.Marshal(wrapped) - if err != nil { - return nil, fmt.Errorf("marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - var decoded map[string]interface{} - if err := json.Unmarshal(encoded, &decoded); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - decoded["kind"] = "indicator" - - encoded, err = json.Marshal(decoded) - if err != nil { - return nil, fmt.Errorf("re-marshaling ThreatIntelligenceIndicatorModel: %+v", err) - } - - return encoded, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatorproperties.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatorproperties.go deleted file mode 100644 index 49660ed5792..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceindicatorproperties.go +++ /dev/null @@ -1,37 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceIndicatorProperties struct { - AdditionalData *map[string]interface{} `json:"additionalData,omitempty"` - Confidence *int64 `json:"confidence,omitempty"` - Created *string `json:"created,omitempty"` - CreatedByRef *string `json:"createdByRef,omitempty"` - Defanged *bool `json:"defanged,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName *string `json:"displayName,omitempty"` - Extensions *interface{} `json:"extensions,omitempty"` - ExternalId *string `json:"externalId,omitempty"` - ExternalLastUpdatedTimeUtc *string `json:"externalLastUpdatedTimeUtc,omitempty"` - ExternalReferences *[]ThreatIntelligenceExternalReference `json:"externalReferences,omitempty"` - FriendlyName *string `json:"friendlyName,omitempty"` - GranularMarkings *[]ThreatIntelligenceGranularMarkingModel `json:"granularMarkings,omitempty"` - IndicatorTypes *[]string `json:"indicatorTypes,omitempty"` - KillChainPhases *[]ThreatIntelligenceKillChainPhase `json:"killChainPhases,omitempty"` - Labels *[]string `json:"labels,omitempty"` - Language *string `json:"language,omitempty"` - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - Modified *string `json:"modified,omitempty"` - ObjectMarkingRefs *[]string `json:"objectMarkingRefs,omitempty"` - ParsedPattern *[]ThreatIntelligenceParsedPattern `json:"parsedPattern,omitempty"` - Pattern *string `json:"pattern,omitempty"` - PatternType *string `json:"patternType,omitempty"` - PatternVersion *string `json:"patternVersion,omitempty"` - Revoked *bool `json:"revoked,omitempty"` - Source *string `json:"source,omitempty"` - ThreatIntelligenceTags *[]string `json:"threatIntelligenceTags,omitempty"` - ThreatTypes *[]string `json:"threatTypes,omitempty"` - ValidFrom *string `json:"validFrom,omitempty"` - ValidUntil *string `json:"validUntil,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceinformation.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceinformation.go deleted file mode 100644 index d036b649d26..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceinformation.go +++ /dev/null @@ -1,53 +0,0 @@ -package threatintelligence - -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 ThreatIntelligenceInformation interface { -} - -// RawThreatIntelligenceInformationImpl is returned when the Discriminated Value -// doesn't match any of the defined types -// NOTE: this should only be used when a type isn't defined for this type of Object (as a workaround) -// and is used only for Deserialization (e.g. this cannot be used as a Request Payload). -type RawThreatIntelligenceInformationImpl struct { - Type string - Values map[string]interface{} -} - -func unmarshalThreatIntelligenceInformationImplementation(input []byte) (ThreatIntelligenceInformation, error) { - if input == nil { - return nil, nil - } - - var temp map[string]interface{} - if err := json.Unmarshal(input, &temp); err != nil { - return nil, fmt.Errorf("unmarshaling ThreatIntelligenceInformation into map[string]interface: %+v", err) - } - - value, ok := temp["kind"].(string) - if !ok { - return nil, nil - } - - if strings.EqualFold(value, "indicator") { - var out ThreatIntelligenceIndicatorModel - if err := json.Unmarshal(input, &out); err != nil { - return nil, fmt.Errorf("unmarshaling into ThreatIntelligenceIndicatorModel: %+v", err) - } - return out, nil - } - - out := RawThreatIntelligenceInformationImpl{ - Type: value, - Values: temp, - } - return out, nil - -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencekillchainphase.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencekillchainphase.go deleted file mode 100644 index 69319b0f616..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencekillchainphase.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceKillChainPhase struct { - KillChainName *string `json:"killChainName,omitempty"` - PhaseName *string `json:"phaseName,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetric.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetric.go deleted file mode 100644 index a6af3828039..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetric.go +++ /dev/null @@ -1,11 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetric struct { - LastUpdatedTimeUtc *string `json:"lastUpdatedTimeUtc,omitempty"` - PatternTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"patternTypeMetrics,omitempty"` - SourceMetrics *[]ThreatIntelligenceMetricEntity `json:"sourceMetrics,omitempty"` - ThreatTypeMetrics *[]ThreatIntelligenceMetricEntity `json:"threatTypeMetrics,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricentity.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricentity.go deleted file mode 100644 index 562f12dd822..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricentity.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricEntity struct { - MetricName *string `json:"metricName,omitempty"` - MetricValue *int64 `json:"metricValue,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetrics.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetrics.go deleted file mode 100644 index 14a6959c873..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetrics.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetrics struct { - Properties *ThreatIntelligenceMetric `json:"properties,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricslist.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricslist.go deleted file mode 100644 index 68025bf73cb..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencemetricslist.go +++ /dev/null @@ -1,8 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceMetricsList struct { - Value []ThreatIntelligenceMetrics `json:"value"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpattern.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpattern.go deleted file mode 100644 index 432ca8c997b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpattern.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPattern struct { - PatternTypeKey *string `json:"patternTypeKey,omitempty"` - PatternTypeValues *[]ThreatIntelligenceParsedPatternTypeValue `json:"patternTypeValues,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go deleted file mode 100644 index e65b3199903..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligenceparsedpatterntypevalue.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceParsedPatternTypeValue struct { - Value *string `json:"value,omitempty"` - ValueType *string `json:"valueType,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencesortingcriteria.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencesortingcriteria.go deleted file mode 100644 index 4b63a0af69e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/model_threatintelligencesortingcriteria.go +++ /dev/null @@ -1,9 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceSortingCriteria struct { - ItemKey *string `json:"itemKey,omitempty"` - SortOrder *ThreatIntelligenceSortingOrder `json:"sortOrder,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/predicates.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/predicates.go deleted file mode 100644 index 6020562ed4b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/predicates.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type ThreatIntelligenceInformationOperationPredicate struct { -} - -func (p ThreatIntelligenceInformationOperationPredicate) Matches(input ThreatIntelligenceInformation) bool { - - return true -} diff --git a/resource-manager/securityinsights/2022-08-01/threatintelligence/version.go b/resource-manager/securityinsights/2022-08-01/threatintelligence/version.go deleted file mode 100644 index de1d66ec515..00000000000 --- a/resource-manager/securityinsights/2022-08-01/threatintelligence/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package threatintelligence - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/threatintelligence/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/README.md b/resource-manager/securityinsights/2022-08-01/watchlistitems/README.md deleted file mode 100644 index 83e12ddbc0f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/watchlistitems` Documentation - -The `watchlistitems` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/watchlistitems" -``` - - -### Client Initialization - -```go -client := watchlistitems.NewWatchlistItemsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WatchlistItemsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -payload := watchlistitems.WatchlistItem{ - // ... -} - - -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: `WatchlistItemsClient.Delete` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -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: `WatchlistItemsClient.Get` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - -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: `WatchlistItemsClient.List` - -```go -ctx := context.TODO() -id := watchlistitems.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -// 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/securityinsights/2022-08-01/watchlistitems/client.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/client.go deleted file mode 100644 index d3193694a48..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package watchlistitems - -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 WatchlistItemsClient struct { - Client *resourcemanager.Client -} - -func NewWatchlistItemsClientWithBaseURI(sdkApi sdkEnv.Api) (*WatchlistItemsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "watchlistitems", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WatchlistItemsClient: %+v", err) - } - - return &WatchlistItemsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist.go deleted file mode 100644 index 7df2e8c2562..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist.go +++ /dev/null @@ -1,141 +0,0 @@ -package watchlistitems - -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(&WatchlistId{}) -} - -var _ resourceids.ResourceId = &WatchlistId{} - -// WatchlistId is a struct representing the Resource ID for a Watchlist -type WatchlistId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string -} - -// NewWatchlistID returns a new WatchlistId struct -func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - } -} - -// ParseWatchlistID parses 'input' into a WatchlistId -func ParseWatchlistID(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId -// note: this method should only be used for API response data and not user input -func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - return nil -} - -// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID -func ValidateWatchlistID(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 := ParseWatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist ID -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID -func (id WatchlistId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - } -} - -// String returns a human-readable description of this Watchlist ID -func (id WatchlistId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - } - return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist_test.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist_test.go deleted file mode 100644 index c0840d7109b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlist_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package watchlistitems - -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 = &WatchlistId{} - -func TestNewWatchlistID(t *testing.T) { - id := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } -} - -func TestFormatWatchlistID(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestParseWatchlistIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestSegmentsForWatchlistId(t *testing.T) { - segments := WatchlistId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistId 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/securityinsights/2022-08-01/watchlistitems/id_watchlistitem.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem.go deleted file mode 100644 index 95aa9b8f56d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem.go +++ /dev/null @@ -1,150 +0,0 @@ -package watchlistitems - -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(&WatchlistItemId{}) -} - -var _ resourceids.ResourceId = &WatchlistItemId{} - -// WatchlistItemId is a struct representing the Resource ID for a Watchlist Item -type WatchlistItemId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string - WatchlistItemId string -} - -// NewWatchlistItemID returns a new WatchlistItemId struct -func NewWatchlistItemID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string, watchlistItemId string) WatchlistItemId { - return WatchlistItemId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - WatchlistItemId: watchlistItemId, - } -} - -// ParseWatchlistItemID parses 'input' into a WatchlistItemId -func ParseWatchlistItemID(input string) (*WatchlistItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistItemId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistItemIDInsensitively parses 'input' case-insensitively into a WatchlistItemId -// note: this method should only be used for API response data and not user input -func ParseWatchlistItemIDInsensitively(input string) (*WatchlistItemId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistItemId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistItemId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistItemId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - if id.WatchlistItemId, ok = input.Parsed["watchlistItemId"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistItemId", input) - } - - return nil -} - -// ValidateWatchlistItemID checks that 'input' can be parsed as a Watchlist Item ID -func ValidateWatchlistItemID(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 := ParseWatchlistItemID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist Item ID -func (id WatchlistItemId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s/watchlistItems/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias, id.WatchlistItemId) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist Item ID -func (id WatchlistItemId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - resourceids.StaticSegment("staticWatchlistItems", "watchlistItems", "watchlistItems"), - resourceids.UserSpecifiedSegment("watchlistItemId", "watchlistItemIdValue"), - } -} - -// String returns a human-readable description of this Watchlist Item ID -func (id WatchlistItemId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - fmt.Sprintf("Watchlist Item: %q", id.WatchlistItemId), - } - return fmt.Sprintf("Watchlist Item (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem_test.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem_test.go deleted file mode 100644 index 6f4a0b1438a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/id_watchlistitem_test.go +++ /dev/null @@ -1,402 +0,0 @@ -package watchlistitems - -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 = &WatchlistItemId{} - -func TestNewWatchlistItemID(t *testing.T) { - id := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } - - if id.WatchlistItemId != "watchlistItemIdValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistItemId'", id.WatchlistItemId, "watchlistItemIdValue") - } -} - -func TestFormatWatchlistItemID(t *testing.T) { - actual := NewWatchlistItemID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue", "watchlistItemIdValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistItemID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - WatchlistItemId: "watchlistItemIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistItemID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - if actual.WatchlistItemId != v.Expected.WatchlistItemId { - t.Fatalf("Expected %q but got %q for WatchlistItemId", v.Expected.WatchlistItemId, actual.WatchlistItemId) - } - - } -} - -func TestParseWatchlistItemIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistItemId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - WatchlistItemId: "watchlistItemIdValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/watchlistItems/watchlistItemIdValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS/wAtChLiStItEmIdVaLuE", - Expected: &WatchlistItemId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - WatchlistItemId: "wAtChLiStItEmIdVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/wAtChLiStItEmS/wAtChLiStItEmIdVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistItemIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - if actual.WatchlistItemId != v.Expected.WatchlistItemId { - t.Fatalf("Expected %q but got %q for WatchlistItemId", v.Expected.WatchlistItemId, actual.WatchlistItemId) - } - - } -} - -func TestSegmentsForWatchlistItemId(t *testing.T) { - segments := WatchlistItemId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistItemId 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/securityinsights/2022-08-01/watchlistitems/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/method_createorupdate.go deleted file mode 100644 index 68142e971a8..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package watchlistitems - -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 *WatchlistItem -} - -// CreateOrUpdate ... -func (c WatchlistItemsClient) CreateOrUpdate(ctx context.Context, id WatchlistItemId, input WatchlistItem) (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 WatchlistItem - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/method_delete.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/method_delete.go deleted file mode 100644 index 5565b767fa5..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlistitems - -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 WatchlistItemsClient) Delete(ctx context.Context, id WatchlistItemId) (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/securityinsights/2022-08-01/watchlistitems/method_get.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/method_get.go deleted file mode 100644 index 1973c679f9e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package watchlistitems - -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 *WatchlistItem -} - -// Get ... -func (c WatchlistItemsClient) Get(ctx context.Context, id WatchlistItemId) (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 WatchlistItem - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/method_list.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/method_list.go deleted file mode 100644 index 8a4d418ea0b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package watchlistitems - -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 *[]WatchlistItem -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []WatchlistItem -} - -// List ... -func (c WatchlistItemsClient) List(ctx context.Context, id WatchlistId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/watchlistItems", 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 *[]WatchlistItem `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 WatchlistItemsClient) ListComplete(ctx context.Context, id WatchlistId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WatchlistItemOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WatchlistItemsClient) ListCompleteMatchingPredicate(ctx context.Context, id WatchlistId, predicate WatchlistItemOperationPredicate) (result ListCompleteResult, err error) { - items := make([]WatchlistItem, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/watchlistitems/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/model_userinfo.go deleted file mode 100644 index 9d03c24555b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package watchlistitems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitem.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitem.go deleted file mode 100644 index 1b198fb819b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitem.go +++ /dev/null @@ -1,17 +0,0 @@ -package watchlistitems - -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 WatchlistItem struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WatchlistItemProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitemproperties.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitemproperties.go deleted file mode 100644 index 77f219a0cce..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/model_watchlistitemproperties.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlistitems - -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 WatchlistItemProperties struct { - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - EntityMapping *interface{} `json:"entityMapping,omitempty"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsKeyValue interface{} `json:"itemsKeyValue"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - WatchlistItemId *string `json:"watchlistItemId,omitempty"` - WatchlistItemType *string `json:"watchlistItemType,omitempty"` -} - -func (o *WatchlistItemProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistItemProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *WatchlistItemProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistItemProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlistitems/predicates.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/predicates.go deleted file mode 100644 index c9960b515cb..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package watchlistitems - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WatchlistItemOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p WatchlistItemOperationPredicate) Matches(input WatchlistItem) 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.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/securityinsights/2022-08-01/watchlistitems/version.go b/resource-manager/securityinsights/2022-08-01/watchlistitems/version.go deleted file mode 100644 index a0ea163620f..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlistitems/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package watchlistitems - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/watchlistitems/%s", defaultApiVersion) -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/README.md b/resource-manager/securityinsights/2022-08-01/watchlists/README.md deleted file mode 100644 index 336c74c242d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/README.md +++ /dev/null @@ -1,90 +0,0 @@ - -## `github.com/hashicorp/go-azure-sdk/resource-manager/securityinsights/2022-08-01/watchlists` Documentation - -The `watchlists` SDK allows for interaction with the Azure Resource Manager Service `securityinsights` (API Version `2022-08-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/securityinsights/2022-08-01/watchlists" -``` - - -### Client Initialization - -```go -client := watchlists.NewWatchlistsClientWithBaseURI("https://management.azure.com") -client.Client.Authorizer = authorizer -``` - - -### Example Usage: `WatchlistsClient.CreateOrUpdate` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -payload := watchlists.Watchlist{ - // ... -} - - -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: `WatchlistsClient.Delete` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -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: `WatchlistsClient.Get` - -```go -ctx := context.TODO() -id := watchlists.NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - -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: `WatchlistsClient.List` - -```go -ctx := context.TODO() -id := watchlists.NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - -// 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/securityinsights/2022-08-01/watchlists/client.go b/resource-manager/securityinsights/2022-08-01/watchlists/client.go deleted file mode 100644 index 45211175054..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/client.go +++ /dev/null @@ -1,26 +0,0 @@ -package watchlists - -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 WatchlistsClient struct { - Client *resourcemanager.Client -} - -func NewWatchlistsClientWithBaseURI(sdkApi sdkEnv.Api) (*WatchlistsClient, error) { - client, err := resourcemanager.NewResourceManagerClient(sdkApi, "watchlists", defaultApiVersion) - if err != nil { - return nil, fmt.Errorf("instantiating WatchlistsClient: %+v", err) - } - - return &WatchlistsClient{ - Client: client, - }, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/constants.go b/resource-manager/securityinsights/2022-08-01/watchlists/constants.go deleted file mode 100644 index 2ec351b8408..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/constants.go +++ /dev/null @@ -1,51 +0,0 @@ -package watchlists - -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 Source string - -const ( - SourceLocalFile Source = "Local file" - SourceRemoteStorage Source = "Remote storage" -) - -func PossibleValuesForSource() []string { - return []string{ - string(SourceLocalFile), - string(SourceRemoteStorage), - } -} - -func (s *Source) UnmarshalJSON(bytes []byte) error { - var decoded string - if err := json.Unmarshal(bytes, &decoded); err != nil { - return fmt.Errorf("unmarshaling: %+v", err) - } - out, err := parseSource(decoded) - if err != nil { - return fmt.Errorf("parsing %q: %+v", decoded, err) - } - *s = *out - return nil -} - -func parseSource(input string) (*Source, error) { - vals := map[string]Source{ - "local file": SourceLocalFile, - "remote storage": SourceRemoteStorage, - } - if v, ok := vals[strings.ToLower(input)]; ok { - return &v, nil - } - - // otherwise presume it's an undefined value and best-effort it - out := Source(input) - return &out, nil -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist.go b/resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist.go deleted file mode 100644 index e5b47b1456e..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist.go +++ /dev/null @@ -1,141 +0,0 @@ -package watchlists - -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(&WatchlistId{}) -} - -var _ resourceids.ResourceId = &WatchlistId{} - -// WatchlistId is a struct representing the Resource ID for a Watchlist -type WatchlistId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string - WatchlistAlias string -} - -// NewWatchlistID returns a new WatchlistId struct -func NewWatchlistID(subscriptionId string, resourceGroupName string, workspaceName string, watchlistAlias string) WatchlistId { - return WatchlistId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - WatchlistAlias: watchlistAlias, - } -} - -// ParseWatchlistID parses 'input' into a WatchlistId -func ParseWatchlistID(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWatchlistIDInsensitively parses 'input' case-insensitively into a WatchlistId -// note: this method should only be used for API response data and not user input -func ParseWatchlistIDInsensitively(input string) (*WatchlistId, error) { - parser := resourceids.NewParserFromResourceIdType(&WatchlistId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WatchlistId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WatchlistId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - if id.WatchlistAlias, ok = input.Parsed["watchlistAlias"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "watchlistAlias", input) - } - - return nil -} - -// ValidateWatchlistID checks that 'input' can be parsed as a Watchlist ID -func ValidateWatchlistID(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 := ParseWatchlistID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Watchlist ID -func (id WatchlistId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s/providers/Microsoft.SecurityInsights/watchlists/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName, id.WatchlistAlias) -} - -// Segments returns a slice of Resource ID Segments which comprise this Watchlist ID -func (id WatchlistId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - resourceids.StaticSegment("staticProviders2", "providers", "providers"), - resourceids.ResourceProviderSegment("staticMicrosoftSecurityInsights", "Microsoft.SecurityInsights", "Microsoft.SecurityInsights"), - resourceids.StaticSegment("staticWatchlists", "watchlists", "watchlists"), - resourceids.UserSpecifiedSegment("watchlistAlias", "watchlistAliasValue"), - } -} - -// String returns a human-readable description of this Watchlist ID -func (id WatchlistId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - fmt.Sprintf("Watchlist Alias: %q", id.WatchlistAlias), - } - return fmt.Sprintf("Watchlist (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist_test.go b/resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist_test.go deleted file mode 100644 index 31b93b91550..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/id_watchlist_test.go +++ /dev/null @@ -1,357 +0,0 @@ -package watchlists - -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 = &WatchlistId{} - -func TestNewWatchlistID(t *testing.T) { - id := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } - - if id.WatchlistAlias != "watchlistAliasValue" { - t.Fatalf("Expected %q but got %q for Segment 'WatchlistAlias'", id.WatchlistAlias, "watchlistAliasValue") - } -} - -func TestFormatWatchlistID(t *testing.T) { - actual := NewWatchlistID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue", "watchlistAliasValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWatchlistID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestParseWatchlistIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WatchlistId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - WatchlistAlias: "watchlistAliasValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/providers/Microsoft.SecurityInsights/watchlists/watchlistAliasValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe", - Expected: &WatchlistId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - WatchlistAlias: "wAtChLiStAlIaSvAlUe", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/pRoViDeRs/mIcRoSoFt.sEcUrItYiNsIgHtS/wAtChLiStS/wAtChLiStAlIaSvAlUe/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWatchlistIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - if actual.WatchlistAlias != v.Expected.WatchlistAlias { - t.Fatalf("Expected %q but got %q for WatchlistAlias", v.Expected.WatchlistAlias, actual.WatchlistAlias) - } - - } -} - -func TestSegmentsForWatchlistId(t *testing.T) { - segments := WatchlistId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WatchlistId 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/securityinsights/2022-08-01/watchlists/id_workspace.go b/resource-manager/securityinsights/2022-08-01/watchlists/id_workspace.go deleted file mode 100644 index d8e6bddfee7..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/id_workspace.go +++ /dev/null @@ -1,130 +0,0 @@ -package watchlists - -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(&WorkspaceId{}) -} - -var _ resourceids.ResourceId = &WorkspaceId{} - -// WorkspaceId is a struct representing the Resource ID for a Workspace -type WorkspaceId struct { - SubscriptionId string - ResourceGroupName string - WorkspaceName string -} - -// NewWorkspaceID returns a new WorkspaceId struct -func NewWorkspaceID(subscriptionId string, resourceGroupName string, workspaceName string) WorkspaceId { - return WorkspaceId{ - SubscriptionId: subscriptionId, - ResourceGroupName: resourceGroupName, - WorkspaceName: workspaceName, - } -} - -// ParseWorkspaceID parses 'input' into a WorkspaceId -func ParseWorkspaceID(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, false) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -// ParseWorkspaceIDInsensitively parses 'input' case-insensitively into a WorkspaceId -// note: this method should only be used for API response data and not user input -func ParseWorkspaceIDInsensitively(input string) (*WorkspaceId, error) { - parser := resourceids.NewParserFromResourceIdType(&WorkspaceId{}) - parsed, err := parser.Parse(input, true) - if err != nil { - return nil, fmt.Errorf("parsing %q: %+v", input, err) - } - - id := WorkspaceId{} - if err := id.FromParseResult(*parsed); err != nil { - return nil, err - } - - return &id, nil -} - -func (id *WorkspaceId) 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.WorkspaceName, ok = input.Parsed["workspaceName"]; !ok { - return resourceids.NewSegmentNotSpecifiedError(id, "workspaceName", input) - } - - return nil -} - -// ValidateWorkspaceID checks that 'input' can be parsed as a Workspace ID -func ValidateWorkspaceID(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 := ParseWorkspaceID(v); err != nil { - errors = append(errors, err) - } - - return -} - -// ID returns the formatted Workspace ID -func (id WorkspaceId) ID() string { - fmtString := "/subscriptions/%s/resourceGroups/%s/providers/Microsoft.OperationalInsights/workspaces/%s" - return fmt.Sprintf(fmtString, id.SubscriptionId, id.ResourceGroupName, id.WorkspaceName) -} - -// Segments returns a slice of Resource ID Segments which comprise this Workspace ID -func (id WorkspaceId) 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("staticMicrosoftOperationalInsights", "Microsoft.OperationalInsights", "Microsoft.OperationalInsights"), - resourceids.StaticSegment("staticWorkspaces", "workspaces", "workspaces"), - resourceids.UserSpecifiedSegment("workspaceName", "workspaceValue"), - } -} - -// String returns a human-readable description of this Workspace ID -func (id WorkspaceId) String() string { - components := []string{ - fmt.Sprintf("Subscription: %q", id.SubscriptionId), - fmt.Sprintf("Resource Group Name: %q", id.ResourceGroupName), - fmt.Sprintf("Workspace Name: %q", id.WorkspaceName), - } - return fmt.Sprintf("Workspace (%s)", strings.Join(components, "\n")) -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/id_workspace_test.go b/resource-manager/securityinsights/2022-08-01/watchlists/id_workspace_test.go deleted file mode 100644 index dfecaa8860b..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/id_workspace_test.go +++ /dev/null @@ -1,282 +0,0 @@ -package watchlists - -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 = &WorkspaceId{} - -func TestNewWorkspaceID(t *testing.T) { - id := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue") - - 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.WorkspaceName != "workspaceValue" { - t.Fatalf("Expected %q but got %q for Segment 'WorkspaceName'", id.WorkspaceName, "workspaceValue") - } -} - -func TestFormatWorkspaceID(t *testing.T) { - actual := NewWorkspaceID("12345678-1234-9876-4563-123456789012", "example-resource-group", "workspaceValue").ID() - expected := "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue" - if actual != expected { - t.Fatalf("Expected the Formatted ID to be %q but got %q", expected, actual) - } -} - -func TestParseWorkspaceID(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceID(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestParseWorkspaceIDInsensitively(t *testing.T) { - testData := []struct { - Input string - Error bool - Expected *WorkspaceId - }{ - { - // 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.OperationalInsights", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs", - Error: true, - }, - { - // Incomplete URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces", - Error: true, - }, - { - // Incomplete URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS", - Error: true, - }, - { - // Valid URI - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "example-resource-group", - WorkspaceName: "workspaceValue", - }, - }, - { - // Invalid (Valid Uri with Extra segment) - Input: "/subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/example-resource-group/providers/Microsoft.OperationalInsights/workspaces/workspaceValue/extra", - Error: true, - }, - { - // Valid URI (mIxEd CaSe since this is insensitive) - Input: "/sUbScRiPtIoNs/12345678-1234-9876-4563-123456789012/rEsOuRcEgRoUpS/eXaMpLe-rEsOuRcE-GrOuP/pRoViDeRs/mIcRoSoFt.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE", - Expected: &WorkspaceId{ - SubscriptionId: "12345678-1234-9876-4563-123456789012", - ResourceGroupName: "eXaMpLe-rEsOuRcE-GrOuP", - WorkspaceName: "wOrKsPaCeVaLuE", - }, - }, - { - // 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.oPeRaTiOnAlInSiGhTs/wOrKsPaCeS/wOrKsPaCeVaLuE/extra", - Error: true, - }, - } - for _, v := range testData { - t.Logf("[DEBUG] Testing %q", v.Input) - - actual, err := ParseWorkspaceIDInsensitively(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.WorkspaceName != v.Expected.WorkspaceName { - t.Fatalf("Expected %q but got %q for WorkspaceName", v.Expected.WorkspaceName, actual.WorkspaceName) - } - - } -} - -func TestSegmentsForWorkspaceId(t *testing.T) { - segments := WorkspaceId{}.Segments() - if len(segments) == 0 { - t.Fatalf("WorkspaceId 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/securityinsights/2022-08-01/watchlists/method_createorupdate.go b/resource-manager/securityinsights/2022-08-01/watchlists/method_createorupdate.go deleted file mode 100644 index eb0b4f9396d..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/method_createorupdate.go +++ /dev/null @@ -1,59 +0,0 @@ -package watchlists - -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 *Watchlist -} - -// CreateOrUpdate ... -func (c WatchlistsClient) CreateOrUpdate(ctx context.Context, id WatchlistId, input Watchlist) (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 Watchlist - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/method_delete.go b/resource-manager/securityinsights/2022-08-01/watchlists/method_delete.go deleted file mode 100644 index 9d495f99c57..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/method_delete.go +++ /dev/null @@ -1,47 +0,0 @@ -package watchlists - -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 WatchlistsClient) Delete(ctx context.Context, id WatchlistId) (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/securityinsights/2022-08-01/watchlists/method_get.go b/resource-manager/securityinsights/2022-08-01/watchlists/method_get.go deleted file mode 100644 index 7aac16c3975..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/method_get.go +++ /dev/null @@ -1,54 +0,0 @@ -package watchlists - -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 *Watchlist -} - -// Get ... -func (c WatchlistsClient) Get(ctx context.Context, id WatchlistId) (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 Watchlist - result.Model = &model - - if err = resp.Unmarshal(result.Model); err != nil { - return - } - - return -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/method_list.go b/resource-manager/securityinsights/2022-08-01/watchlists/method_list.go deleted file mode 100644 index 9122b014815..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/method_list.go +++ /dev/null @@ -1,91 +0,0 @@ -package watchlists - -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 *[]Watchlist -} - -type ListCompleteResult struct { - LatestHttpResponse *http.Response - Items []Watchlist -} - -// List ... -func (c WatchlistsClient) List(ctx context.Context, id WorkspaceId) (result ListOperationResponse, err error) { - opts := client.RequestOptions{ - ContentType: "application/json; charset=utf-8", - ExpectedStatusCodes: []int{ - http.StatusOK, - }, - HttpMethod: http.MethodGet, - Path: fmt.Sprintf("%s/providers/Microsoft.SecurityInsights/watchlists", 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 *[]Watchlist `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 WatchlistsClient) ListComplete(ctx context.Context, id WorkspaceId) (ListCompleteResult, error) { - return c.ListCompleteMatchingPredicate(ctx, id, WatchlistOperationPredicate{}) -} - -// ListCompleteMatchingPredicate retrieves all the results and then applies the predicate -func (c WatchlistsClient) ListCompleteMatchingPredicate(ctx context.Context, id WorkspaceId, predicate WatchlistOperationPredicate) (result ListCompleteResult, err error) { - items := make([]Watchlist, 0) - - resp, err := c.List(ctx, id) - if err != nil { - 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/securityinsights/2022-08-01/watchlists/model_userinfo.go b/resource-manager/securityinsights/2022-08-01/watchlists/model_userinfo.go deleted file mode 100644 index 5c0e0c29617..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/model_userinfo.go +++ /dev/null @@ -1,10 +0,0 @@ -package watchlists - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type UserInfo struct { - Email *string `json:"email,omitempty"` - Name *string `json:"name,omitempty"` - ObjectId *string `json:"objectId,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/model_watchlist.go b/resource-manager/securityinsights/2022-08-01/watchlists/model_watchlist.go deleted file mode 100644 index 2c34c33bb58..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/model_watchlist.go +++ /dev/null @@ -1,17 +0,0 @@ -package watchlists - -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 Watchlist struct { - Etag *string `json:"etag,omitempty"` - Id *string `json:"id,omitempty"` - Name *string `json:"name,omitempty"` - Properties *WatchlistProperties `json:"properties,omitempty"` - SystemData *systemdata.SystemData `json:"systemData,omitempty"` - Type *string `json:"type,omitempty"` -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/model_watchlistproperties.go b/resource-manager/securityinsights/2022-08-01/watchlists/model_watchlistproperties.go deleted file mode 100644 index 9d5c01a1dbc..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/model_watchlistproperties.go +++ /dev/null @@ -1,57 +0,0 @@ -package watchlists - -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 WatchlistProperties struct { - ContentType *string `json:"contentType,omitempty"` - Created *string `json:"created,omitempty"` - CreatedBy *UserInfo `json:"createdBy,omitempty"` - DefaultDuration *string `json:"defaultDuration,omitempty"` - Description *string `json:"description,omitempty"` - DisplayName string `json:"displayName"` - IsDeleted *bool `json:"isDeleted,omitempty"` - ItemsSearchKey string `json:"itemsSearchKey"` - Labels *[]string `json:"labels,omitempty"` - NumberOfLinesToSkip *int64 `json:"numberOfLinesToSkip,omitempty"` - Provider string `json:"provider"` - RawContent *string `json:"rawContent,omitempty"` - Source Source `json:"source"` - TenantId *string `json:"tenantId,omitempty"` - Updated *string `json:"updated,omitempty"` - UpdatedBy *UserInfo `json:"updatedBy,omitempty"` - UploadStatus *string `json:"uploadStatus,omitempty"` - WatchlistAlias *string `json:"watchlistAlias,omitempty"` - WatchlistId *string `json:"watchlistId,omitempty"` - WatchlistType *string `json:"watchlistType,omitempty"` -} - -func (o *WatchlistProperties) GetCreatedAsTime() (*time.Time, error) { - if o.Created == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Created, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistProperties) SetCreatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Created = &formatted -} - -func (o *WatchlistProperties) GetUpdatedAsTime() (*time.Time, error) { - if o.Updated == nil { - return nil, nil - } - return dates.ParseAsFormat(o.Updated, "2006-01-02T15:04:05Z07:00") -} - -func (o *WatchlistProperties) SetUpdatedAsTime(input time.Time) { - formatted := input.Format("2006-01-02T15:04:05Z07:00") - o.Updated = &formatted -} diff --git a/resource-manager/securityinsights/2022-08-01/watchlists/predicates.go b/resource-manager/securityinsights/2022-08-01/watchlists/predicates.go deleted file mode 100644 index f335c7c61ff..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/predicates.go +++ /dev/null @@ -1,32 +0,0 @@ -package watchlists - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -type WatchlistOperationPredicate struct { - Etag *string - Id *string - Name *string - Type *string -} - -func (p WatchlistOperationPredicate) Matches(input Watchlist) 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.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/securityinsights/2022-08-01/watchlists/version.go b/resource-manager/securityinsights/2022-08-01/watchlists/version.go deleted file mode 100644 index 2813d9d1d9a..00000000000 --- a/resource-manager/securityinsights/2022-08-01/watchlists/version.go +++ /dev/null @@ -1,12 +0,0 @@ -package watchlists - -import "fmt" - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See NOTICE.txt in the project root for license information. - -const defaultApiVersion = "2022-08-01" - -func userAgent() string { - return fmt.Sprintf("hashicorp/go-azure-sdk/watchlists/%s", defaultApiVersion) -}